[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / C / drs / dr411.c
blob0cb0000b3c3161a0fc959d501f99efbfd3573d18
1 /* RUN: %clang_cc1 -std=c89 -fsyntax-only -verify -DC89 -Wno-c11-extensions %s
2 RUN: %clang_cc1 -std=c99 -fsyntax-only -verify -DC99 -Wno-c11-extensions %s
3 RUN: %clang_cc1 -std=c11 -fsyntax-only -verify -DC11 %s
4 RUN: %clang_cc1 -std=c17 -fsyntax-only -verify -DC17 %s
5 RUN: %clang_cc1 -std=c2x -fsyntax-only -verify -DC2X %s
6 */
8 /* expected-no-diagnostics */
10 /* WG14 DR411: yes
11 * Predefined macro values
13 * Note: the DR is about the C11 macro value, but we'll test all the standard
14 * version macro values just to be sure. We do not need to test
15 * __STDC_LIB_EXT1__ values because that requires an Annex K-compatible header.
17 #if defined(C89)
18 #ifdef __STDC_VERSION__
19 #error "C89 didn't have this macro!"
20 #endif
21 #elif defined(C99)
22 _Static_assert(__STDC_VERSION__ == 199901L, "");
23 #elif defined(C11)
24 _Static_assert(__STDC_VERSION__ == 201112L, "");
25 #elif defined(C17)
26 _Static_assert(__STDC_VERSION__ == 201710L, "");
27 #elif defined(C2X)
28 /* FIXME: this value will change once WG14 picks the final value for C2x. */
29 _Static_assert(__STDC_VERSION__ == 202000L, "");
30 #else
31 #error "unknown language standard version"
32 #endif