1 // RUN: %clang_cc1 -x c -fsyntax-only -verify %s
2 // RUN: %clang_cc1 -std=c++17 -fsyntax-only -verify -Wall -Wno-unused -Wno-misleading-indentation -DCXX17 %s
3 // RUN: %clang_cc1 -x c -fsyntax-only -verify -Wmisleading-indentation -DWITH_WARN -ftabstop 8 -DTAB_SIZE=8 %s
4 // RUN: %clang_cc1 -std=c++17 -fsyntax-only -verify -Wall -Wno-unused -DWITH_WARN -ftabstop 4 -DTAB_SIZE=4 -DCXX17 %s
5 // RUN: %clang_cc1 -x c -fsyntax-only -verify -Wall -Wno-unused -DWITH_WARN -ftabstop 1 -DTAB_SIZE=1 %s
6 // RUN: %clang_cc1 -std=c++17 -fsyntax-only -verify -Wall -Wno-unused -Wmisleading-indentation -DCXX17 -DWITH_WARN -ftabstop 2 -DTAB_SIZE=2 %s
9 // expected-no-diagnostics
15 // expected-note@-2 {{here}}
20 // expected-warning@-2 {{misleading indentation; statement is not part of the previous 'if'}}
26 // expected-note@-2 {{here}}
31 // expected-warning@-2 {{misleading indentation; statement is not part of the previous 'if'}}
39 // expected-note@-2 {{here}}
44 // expected-warning@-2 {{misleading indentation; statement is not part of the previous 'for'}}
52 // expected-note@-2 {{here}}
56 // expected-warning@-2 {{misleading indentation; statement is not part of the previous 'while'}}
66 // expected-note@-2 {{here}}
71 // expected-warning@-2 {{misleading indentation; statement is not part of the previous 'else'}}
77 int *begin() {return nullptr;}
78 int *end() {return nullptr;}
91 // expected-note@-2 {{here}}
96 // expected-warning@-2 {{misleading indentation; statement is not part of the previous 'if'}}
102 // expected-note@-2 {{here}}
107 // expected-warning@-2 {{misleading indentation; statement is not part of the previous 'for'}}
131 // expected-note@-3 {{here}}
136 // expected-warning@-2 {{misleading indentation; statement is not part of the previous 'if'}}
155 // expected-note@-2 {{here}}
160 // expected-warning@-2 {{misleading indentation; statement is not part of the previous 'if'}}
177 // expected-note@-2 {{here}}
182 // expected-warning@-2 {{misleading indentation; statement is not part of the previous 'if'}}
194 void a1(int i
) { if (1) i
= 4; return; }
222 // expected-note@-2 {{here}}
227 // expected-warning@-2 {{misleading indentation; statement is not part of the previous 'if'}}
236 // expected-warning@-2 {{misleading indentation; statement is not part of the previous 'if'}}
237 // expected-note@-5 {{here}}
247 // expected-warning@-2 {{misleading indentation; statement is not part of the previous 'if'}}
248 // expected-note@-5 {{here}}
258 // expected-warning@-2 {{misleading indentation; statement is not part of the previous 'if'}}
259 // expected-note@-5 {{here}}
266 int main(int argc
, char* argv
[]) {
293 if (1) goto fail
; goto fail
;
308 void f_label(int b
) {