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
8 /* expected-no-diagnostics */
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.
18 #ifdef __STDC_VERSION__
19 #error "C89 didn't have this macro!"
22 _Static_assert(__STDC_VERSION__
== 199901L, "");
24 _Static_assert(__STDC_VERSION__
== 201112L, "");
26 _Static_assert(__STDC_VERSION__
== 201710L, "");
28 /* FIXME: this value will change once WG14 picks the final value for C2x. */
29 _Static_assert(__STDC_VERSION__
== 202000L, "");
31 #error "unknown language standard version"