• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -fsyntax-only -Wunknown-pragmas -verify %s
2 // RUN: %clang_cc1 -E %s | FileCheck --strict-whitespace %s
3 
4 // GCC doesn't expand macro args for unrecognized pragmas.
5 #define bar xX
6 #pragma foo bar   // expected-warning {{unknown pragma ignored}}
7 // CHECK: {{^}}#pragma foo bar{{$}}
8 
9 #pragma STDC FP_CONTRACT ON
10 #pragma STDC FP_CONTRACT OFF
11 #pragma STDC FP_CONTRACT DEFAULT
12 #pragma STDC FP_CONTRACT IN_BETWEEN  // expected-warning {{expected 'ON' or 'OFF' or 'DEFAULT' in pragma}}
13 
14 #pragma STDC FENV_ACCESS ON          // expected-warning {{pragma STDC FENV_ACCESS ON is not supported, ignoring pragma}}
15 #pragma STDC FENV_ACCESS OFF
16 #pragma STDC FENV_ACCESS DEFAULT
17 #pragma STDC FENV_ACCESS IN_BETWEEN   // expected-warning {{expected 'ON' or 'OFF' or 'DEFAULT' in pragma}}
18 
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 
24 #pragma STDC CX_LIMITED_RANGE    // expected-warning {{expected 'ON' or 'OFF' or 'DEFAULT' in pragma}}
25 #pragma STDC CX_LIMITED_RANGE ON FULL POWER  // expected-warning {{expected end of directive in pragma}}
26 
27 #pragma STDC SO_GREAT  // expected-warning {{unknown pragma in STDC namespace}}
28 #pragma STDC   // expected-warning {{unknown pragma in STDC namespace}}
29 
30