Merge pull request #2891 from dneto0/hlsl-namespace
[platform/upstream/glslang.git] / Test / dce.frag
1 #version 400\r
2 \r
3 const bool flag = false;\r
4 \r
5 int c = 0;\r
6 \r
7 void bar()\r
8 {\r
9     if (flag)\r
10         ++c;  // should still show up in AST\r
11     else\r
12         ++c;\r
13 \r
14     flag ? ++c : ++c;  // both should still show up in AST\r
15 \r
16     switch (c) {\r
17     case 1:\r
18         ++c;\r
19         break;\r
20         ++c;  // should still show up in AST\r
21     case 2:\r
22         break;\r
23         ++c;  // should still show up in AST\r
24     default:\r
25         break;\r
26     }\r
27 \r
28     for (int i = 0; i < 0; ++i)\r
29         ++c;  // should still show up in AST\r
30 \r
31     for (int i = 0; i < 10; ++i) {\r
32         if (c < 3) {\r
33             break; \r
34             ++c;    // should still show up in AST\r
35         } else {\r
36             continue;\r
37             ++c;    // should still show up in AST\r
38         }\r
39     }\r
40 \r
41     return;\r
42 \r
43     ++c;      // should still show up in AST\r
44 }\r
45 \r
46 int foo()     // not called, but should still show up in AST\r
47 {\r
48     if (c > 4) {\r
49         return 4;\r
50         ++c;   // should still show up in AST\r
51     }\r
52 \r
53     return 5;\r
54 \r
55     ++c;       // should still show up in AST\r
56 }\r