1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 // RUN: %clang_cc1 -fsyntax-only -x c++ -Werror %s
6 for ( ; ({ if (first
) { first
= 0; continue; } 0; }); )
11 void pr8880_2(int first
) {
12 for ( ; ({ if (first
) { first
= 0; break; } 0; }); ) {}
15 void pr8880_3(int first
) {
16 for ( ; ; (void)({ if (first
) { first
= 0; continue; } 0; })) {}
19 void pr8880_4(int first
) {
20 for ( ; ; (void)({ if (first
) { first
= 0; break; } 0; })) {}
23 void pr8880_5 (int first
) {
24 while(({ if (first
) { first
= 0; continue; } 0; })) {}
27 void pr8880_6 (int first
) {
28 while(({ if (first
) { first
= 0; break; } 0; })) {}
31 void pr8880_7 (int first
) {
32 do {} while(({ if (first
) { first
= 0; continue; } 0; }));
35 void pr8880_8 (int first
) {
36 do {} while(({ if (first
) { first
= 0; break; } 0; }));
39 void pr8880_10(int i
) {
40 for ( ; i
!= 10 ; i
++ )
41 for ( ; ; (void)({ ++i
; continue; i
;})) {} // expected-warning{{'continue' is bound to current loop, GCC binds it to the enclosing loop}}
44 void pr8880_11(int i
) {
45 for ( ; i
!= 10 ; i
++ )
46 for ( ; ; (void)({ ++i
; break; i
;})) {} // expected-warning{{'break' is bound to current loop, GCC binds it to the enclosing loop}}
49 void pr8880_12(int i
, int j
) {
50 for ( ; i
!= 10 ; i
++ )
51 for ( ; ({if (i
) continue; i
;}); j
++) {} // expected-warning {{'continue' is bound to current loop, GCC binds it to the enclosing loop}}
54 void pr8880_13(int i
, int j
) {
55 for ( ; i
!= 10 ; i
++ )
56 for ( ; ({if (i
) break; i
;}); j
++) {} // expected-warning{{'break' is bound to current loop, GCC binds it to the enclosing loop}}
59 void pr8880_14(int i
) {
60 for ( ; i
!= 10 ; i
++ )
61 while(({if (i
) break; i
;})) {} // expected-warning {{'break' is bound to current loop, GCC binds it to the enclosing loop}}
64 void pr8880_15(int i
) {
66 while(({if (i
) continue; i
;})) {} // expected-warning {{'continue' is bound to current loop, GCC binds it to the enclosing loop}}
69 void pr8880_16(int i
) {
70 for ( ; i
!= 10 ; i
++ )
71 do {} while(({if (i
) break; i
;})); // expected-warning {{'break' is bound to current loop, GCC binds it to the enclosing loop}}
74 void pr8880_17(int i
) {
75 for ( ; i
!= 10 ; i
++ )
76 do {} while(({if (i
) continue; i
;})); // expected-warning {{'continue' is bound to current loop, GCC binds it to the enclosing loop}}
79 void pr8880_18(int x
, int y
) {
81 switch(({if(y
) break; y
;})) {
86 void pr8880_19(int x
, int y
) {
89 switch(({if(y
) break; y
;})) {
95 void pr8880_20(int x
, int y
) {
98 while(({if (y
) break; y
;})) {} //expected-warning {{'break' is bound to loop, GCC binds it to switch}}
102 void pr8880_21(int x
, int y
) {
105 do {} while(({if (y
) break; y
;})); //expected-warning {{'break' is bound to loop, GCC binds it to switch}}
109 void pr8880_22(int x
, int y
) {
112 for ( ; ; (void)({ ++y
; break; y
;})) {} // expected-warning{{'break' is bound to loop, GCC binds it to switc}}
116 void pr8880_23(int x
, int y
) {
119 for ( ; ({ ++y
; break; y
;}); ++y
) {} // expected-warning{{'break' is bound to loop, GCC binds it to switch}}
123 void pr32648_1(int x
, int y
) {
126 for ( ; ({ ++y
; switch (y
) { case 0: break; } y
;}); ++y
) {} // no warning
130 void pr32648_2(int x
, int y
) {
132 for ( ; ({ ++y
; switch (y
) { case 0: continue; } y
;}); ++y
) {} // expected-warning {{'continue' is bound to current loop, GCC binds it to the enclosing loop}}
136 void pr32648_3(int x
, int y
) {
139 for ( ; ({ ++y
; for (; y
; y
++) { break; } y
;}); ++y
) {} // no warning
143 void pr32648_4(int x
, int y
) {
146 for ( ; ({ ++y
; for (({ break; }); y
; y
++) { } y
;}); ++y
) {} // expected-warning{{'break' is bound to loop, GCC binds it to switch}}
150 void pr32648_5(int x
, int y
) {
153 for ( ; ({ ++y
; while (({ break; y
; })) {} y
;}); ++y
) {} // expected-warning{{'break' is bound to current loop, GCC binds it to the enclosing loop}}
157 void pr32648_6(int x
, int y
) {
160 for ( ; ({ ++y
; do {} while (({ break; y
; })); y
;}); ++y
) {} // expected-warning{{'break' is bound to current loop, GCC binds it to the enclosing loop}}
164 void pr32648_7(int x
, int y
) {
167 for ( ; ({ ++y
; do { break; } while (y
); y
;}); ++y
) {} // no warning