xref: /llvm-project/clang/test/C/C99/n696.c (revision 32466e55b19586880199347744fc1b76d6b04cfb)
1 // RUN: %clang_cc1 -triple x86_64 -verify %s
2 
3 /* WG14 N696: yes
4  * Standard pragmas - improved wording
5  *
6  * NB: this also covers N631 which changed these features into pragmas rather
7  * than macros.
8  */
9 
10 // Verify that we do not expand macros in STDC pragmas. If we expanded them,
11 // this code would issue diagnostics.
12 #define ON 12
13 #pragma STDC FENV_ACCESS ON
14 #pragma STDC CX_LIMITED_RANGE ON
15 #pragma STDC FP_CONTRACT ON
16 
17 // If we expanded macros, this code would not issue diagnostics.
18 #define BLERP OFF
19 #pragma STDC FENV_ACCESS BLERP      // expected-warning {{expected 'ON' or 'OFF' or 'DEFAULT' in pragma}}
20 #pragma STDC CX_LIMITED_RANGE BLERP // expected-warning {{expected 'ON' or 'OFF' or 'DEFAULT' in pragma}}
21 #pragma STDC FP_CONTRACT BLERP      // expected-warning {{expected 'ON' or 'OFF' or 'DEFAULT' in pragma}}
22 
23