summaryrefslogtreecommitdiffstats
path: root/tests/spirv/infinite-loop.slang
blob: 1562f7334bf08e1eca616862c2c3f2df18fd1de5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Simple regression test for SPIRV compilation hang when there is cycle between unconditional branch and block.
// The -g was necessary to reproduce the hang prior to fix for https://github.com/shader-slang/slang/issues/8669

//TEST:SIMPLE(filecheck=CHECK): -target spirv -stage fragment -entry main -g
//CHECK: main
//CHECK: OpBranch
//CHECK: OpUnreachable

layout(location = 0) out float4 output_color;
[shader("fragment")]
void main()
{
    while (true) {
        int i = 0;
    }
    output_color = float4(1, 2, 3, 4);
}