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 //expected-error@-1 {{unknown type name 'POWER'}}
31 //expected-error@-2 {{expected identifier or '('}}
32 // CHECK: {{^}}#pragma STDC CX_LIMITED_RANGE{{$}}
33 // CHECK: {{^}}#pragma STDC CX_LIMITED_RANGE ON FULL POWER{{$}}
35 #pragma STDC SO_GREAT // expected-warning {{unknown pragma in STDC namespace}}
36 #pragma STDC // expected-warning {{unknown pragma in STDC namespace}}
37 // CHECK: {{^}}#pragma STDC SO_GREAT{{$}}
38 // CHECK: {{^}}#pragma STDC{{$}}