Make test more lenient for custom clang version strings
[llvm-project.git] / clang / test / C / C99 / n570.c
blob31c09224e618b5ab7f9e24d8a0b1f4c5589d79f3
1 // RUN: %clang_cc1 -verify -std=c99 %s
2 // RUN: %clang_cc1 -E -std=c99 %s | FileCheck %s
3 // expected-no-diagnostics
5 /* WG14 N570: Yes
6 * Empty macro arguments
8 * NB: the original paper is not available online anywhere, so the test
9 * coverage is coming from what could be gleaned from the C99 rationale
10 * document. In C89, it was UB to pass no arguments to a function-like macro,
11 * and that's now supported in C99.
14 #define TEN 10
15 #define U u
16 #define I // expands into no preprocessing tokens
17 #define L L
18 #define glue(a, b) a ## b
19 #define xglue(a, b) glue(a, b)
21 const unsigned u = xglue(TEN, U);
22 const int i = xglue(TEN, I);
23 const long l = xglue(TEN, L);
25 // CHECK: const unsigned u = 10u;
26 // CHECK-NEXT: const int i = 10;
27 // CHECK-NEXT: const long l = 10L;
29 _Static_assert(u == 10U, "");
30 _Static_assert(i == 10, "");
31 _Static_assert(l == 10L, "");