1 // RUN: %clang_cc1 -fsyntax-only -Wunknown-pragmas -verify %s
2 // RUN: %clang_cc1 -E %s 2>&1 | FileCheck --strict-whitespace %s
4 // GCC doesn't expand macro args for unrecognized pragmas.
6 #pragma foo bar // expected-warning {{unknown pragma ignored}}
7 // CHECK-NOT: unknown pragma in STDC namespace
8 // CHECK: {{^}}#pragma foo bar{{$}}
10 #pragma STDC FP_CONTRACT ON
11 #pragma STDC FP_CONTRACT OFF
12 #pragma STDC FP_CONTRACT DEFAULT
13 #pragma STDC FP_CONTRACT IN_BETWEEN // expected-warning {{expected 'ON' or 'OFF' or 'DEFAULT' in pragma}}
14 // CHECK: {{^}}#pragma STDC FP_CONTRACT ON{{$}}
15 // CHECK: {{^}}#pragma STDC FP_CONTRACT OFF{{$}}
16 // CHECK: {{^}}#pragma STDC FP_CONTRACT DEFAULT{{$}}
17 // CHECK: {{^}}#pragma STDC FP_CONTRACT IN_BETWEEN{{$}}
19 #pragma STDC CX_LIMITED_RANGE ON
20 #pragma STDC CX_LIMITED_RANGE OFF
21 #pragma STDC CX_LIMITED_RANGE DEFAULT
22 #pragma STDC CX_LIMITED_RANGE IN_BETWEEN // expected-warning {{expected 'ON' or 'OFF' or 'DEFAULT' in pragma}}
23 // CHECK: {{^}}#pragma STDC CX_LIMITED_RANGE ON{{$}}
24 // CHECK: {{^}}#pragma STDC CX_LIMITED_RANGE OFF{{$}}
25 // CHECK: {{^}}#pragma STDC CX_LIMITED_RANGE DEFAULT{{$}}
26 // CHECK: {{^}}#pragma STDC CX_LIMITED_RANGE IN_BETWEEN{{$}}
28 #pragma STDC CX_LIMITED_RANGE // expected-warning {{expected 'ON' or 'OFF' or 'DEFAULT' in pragma}}
29 #pragma STDC CX_LIMITED_RANGE ON FULL POWER // expected-warning {{expected end of directive in pragma}}
30 // CHECK: {{^}}#pragma STDC CX_LIMITED_RANGE{{$}}
31 // CHECK: {{^}}#pragma STDC CX_LIMITED_RANGE ON FULL POWER{{$}}
33 #pragma STDC SO_GREAT // expected-warning {{unknown pragma in STDC namespace}}
34 #pragma STDC // expected-warning {{unknown pragma in STDC namespace}}
35 // CHECK: {{^}}#pragma STDC SO_GREAT{{$}}
36 // CHECK: {{^}}#pragma STDC{{$}}