[Flang] remove whole-archive option for AIX linker (#76039)
[llvm-project.git] / clang / test / C / C2x / n2508.c
blobdae0a4508b7358bbcdaca7b03bc009135e5aa614
1 // RUN: %clang_cc1 -verify -std=c23 %s
2 // RUN: %clang_cc1 -verify=pedantic -std=c11 -pedantic %s
3 // RUN: %clang_cc1 -verify=compat -std=c23 -Wpre-c23-compat %s
5 // expected-no-diagnostics
7 /* WG14 N2508: yes
8 * Free positioning of labels inside compound statements
9 */
10 void test(void) {
12 inner:
13 } /* pedantic-warning {{label at end of compound statement is a C23 extension}}
14 compat-warning {{label at end of compound statement is incompatible with C standards before C23}}
17 switch (1) {
18 case 1:
19 } /* pedantic-warning {{label at end of compound statement is a C23 extension}}
20 compat-warning {{label at end of compound statement is incompatible with C standards before C23}}
24 multiple: labels: on: a: line:
25 } /* pedantic-warning {{label at end of compound statement is a C23 extension}}
26 compat-warning {{label at end of compound statement is incompatible with C standards before C23}}
29 final:
30 } /* pedantic-warning {{label at end of compound statement is a C23 extension}}
31 compat-warning {{label at end of compound statement is incompatible with C standards before C23}}
34 void test_labels(void) {
35 label:
36 int i = 0; /* pedantic-warning {{label followed by a declaration is a C23 extension}}
37 compat-warning {{label followed by a declaration is incompatible with C standards before C23}}
40 switch (i) {
41 case 1:
42 _Static_assert(1, ""); /* pedantic-warning {{label followed by a declaration is a C23 extension}}
43 compat-warning {{label followed by a declaration is incompatible with C standards before C23}}
45 default:
46 _Static_assert(1, ""); /* pedantic-warning {{label followed by a declaration is a C23 extension}}
47 compat-warning {{label followed by a declaration is incompatible with C standards before C23}}