1 // RUN: %clang_cc1 -fsyntax-only -std=c17 -Wc2x-compat -verify=c17 %s
2 // RUN: %clang_cc1 -fsyntax-only -std=c2x -Wpre-c2x-compat -verify=c2x %s
4 void test_label_in_func() {
8 label2
: label3
: label4
:
9 } // c17-warning {{label at end of compound statement is a C23 extension}} \
10 c2x
-warning
{{label at end of compound statement is incompatible with C standards before C23
}}
12 int test_label_in_switch(int v
) {
18 case 3: case 4: case 5:
19 } // c17-warning {{label at end of compound statement is a C23 extension}} \
20 c2x
-warning
{{label at end of compound statement is incompatible with C standards before C23
}}
26 } // c17-warning {{label at end of compound statement is a C23 extension}} \
27 c2x
-warning
{{label at end of compound statement is incompatible with C standards before C23
}}