Require target lra in gcc.dg/pr108095.c
[official-gcc.git] / gcc / testsuite / c-c++-common / pr44715.c
blobf20a14688fa622299c0af59bd583e38b1e8fdc8a
1 /* PR c/44715 */
2 /* { dg-do run } */
3 /* { dg-options "" } */
5 void
6 foo (int x, int y)
8 int z;
9 switch (x)
11 case 0:
12 while (({ if (y) break; 0; }))
14 __builtin_abort ();
15 break;
16 case 1:
19 while (({ if (y) break; 0; }));
20 __builtin_abort ();
21 break;
22 case 2:
23 for (z = ({ if (y) break; 0; }); z < 5; z++)
25 __builtin_abort ();
26 break;
27 case 3:
28 for (z = 0; z < ({ if (y) break; 5; }); z++)
30 __builtin_abort ();
31 break;
32 case 4:
33 for (z = 0; z < 5; z += ({ if (y) break; 1; }))
35 __builtin_abort ();
36 break;
37 case 5:
38 switch (({ if (y) break; 1; }))
40 default: break;
42 __builtin_abort ();
43 break;
44 default:
45 __builtin_abort ();
46 break;
50 void
51 bar (int x, int y)
53 int z;
54 while (x >= 0)
56 if (x == 0)
58 while (({ if (y) break; 0; }))
60 __builtin_abort ();
62 if (x == 1)
66 while (({ if (y) break; 0; }));
67 __builtin_abort ();
69 if (x == 2)
71 for (z = ({ if (y) break; 0; }); z < 5; z++)
73 __builtin_abort ();
75 if (x == 3)
77 for (z = 0; z < ({ if (y) break; 5; }); z++)
79 __builtin_abort ();
81 if (x == 4)
83 for (z = 0; z < 5; z += ({ if (y) break; 1; }))
85 __builtin_abort ();
87 if (x == 5)
89 switch (({ if (y) break; 1; }))
91 default: break;
93 __builtin_abort ();
98 void
99 baz (int x, int y)
101 int z;
102 while (x >= 0)
104 if (++y == 2)
105 return;
106 if (x == 0)
108 while (({ if (y) continue; 0; }))
110 __builtin_abort ();
112 if (x == 1)
116 while (({ if (y) continue; 0; }));
117 __builtin_abort ();
119 if (x == 2)
121 for (z = ({ if (y) continue; 0; }); z < 5; z++)
123 __builtin_abort ();
125 if (x == 3)
127 for (z = 0; z < ({ if (y) continue; 5; }); z++)
129 __builtin_abort ();
131 if (x == 4)
133 for (z = 0; z < 5; z += ({ if (y) continue; 1; }))
135 __builtin_abort ();
137 if (x == 5)
139 switch (({ if (y) continue; 1; }))
141 default: break;
143 __builtin_abort ();
146 __builtin_abort ();
150 main ()
152 foo (0, 1);
153 foo (1, 1);
154 foo (2, 1);
155 foo (3, 1);
156 foo (4, 1);
157 foo (5, 1);
158 bar (0, 1);
159 bar (1, 1);
160 bar (2, 1);
161 bar (3, 1);
162 bar (4, 1);
163 bar (5, 1);
164 baz (0, 0);
165 baz (1, 0);
166 baz (2, 0);
167 baz (3, 0);
168 baz (4, 0);
169 baz (5, 0);
170 return 0;