Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / PCH / stmts.h
blob4267e2c2b3523c19110cef428fd89b460dc053c4
1 // Header for PCH test stmts.c
3 void f0(int x) {
4 // NullStmt
6 // IfStmt
7 if (x) {
8 } else if (x + 1) {
11 switch (x) {
12 case 0:
13 x = 17;
14 break;
16 case 1:
17 break;
19 default:
20 switch (x >> 1) {
21 case 7:
22 // fall through
23 case 9:
24 break;
26 x += 2;
27 break;
30 while (x > 20) {
31 if (x > 30) {
32 --x;
33 continue;
34 } else if (x < 5)
35 break;
36 else
37 goto done;
40 do {
41 x++;
42 } while (x < 10);
44 almost_done:
45 for (int y = x; y < 20; ++y) {
46 if (x + y == 12)
47 return;
48 else if (x - y == 7)
49 goto almost_done;
52 done:
53 x = x + 2;
55 int z = x, *y, j = 5;
58 int f1(int x) {
59 switch (x) {
60 case 17:
61 return 12;
63 default:
64 break;
67 // variable-length array
68 int array[x * 17 + 3];
70 return x*2;
73 const char* what_is_my_name(void) { return __func__; }
75 int computed_goto(int x) {
76 start:
77 x = x << 1;
78 void *location = &&start;
80 if (x > 17)
81 location = &&done;
83 while (x > 12) {
84 --x;
85 if (x == 15)
86 goto *location;
89 done:
90 return 5;
93 #define maxint(a,b) ({int _a = (a), _b = (b); _a > _b ? _a : _b; })
94 int weird_max(int x, int y) {
95 return maxint(++x, --y);