xref: /aosp_15_r20/external/angle/third_party/glslang/src/Test/spv.debuginfo.implicit_br.glsl.frag (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1#version 460
2
3out int outx;
4int counter = 0;
5
6void test_if() {
7    if (false) {
8        counter += 1;
9    }
10}
11
12void test_ifelse() {
13    if (false) {
14        counter += 1;
15    }
16    else {
17        counter += 2;
18    }
19}
20
21void test_if_compound() {
22    if (false) {
23        if (false) {
24            counter += 1;
25        }
26    }
27}
28
29void test_if_compound2() {
30    if (false) {
31        if (false) {
32            counter += 1;
33        }
34
35        counter += 2;
36    }
37}
38
39void test_switch() {
40    switch (0) {
41    case 0:
42        counter += 1;
43        // implict fallthrough
44    case 1:
45        counter += 2;
46        break;
47    default:
48        counter += 3;
49        // implicit break
50    }
51}
52
53void main() {
54    test_if();
55    test_ifelse();
56    test_if_compound();
57    test_if_compound2();
58    test_switch();
59    outx = counter;
60}