xref: /minix3/external/bsd/llvm/dist/clang/test/OpenMP/predefined_macro.c (revision 433d6423c39e34ec4b79c950597bb2d236f886be)
1 // RUN: %clang_cc1 -fopenmp -verify -DFOPENMP -o - %s
2 // RUN: %clang_cc1 -verify -o - %s
3 // expected-no-diagnostics
4 #ifdef FOPENMP
5 // -fopenmp option is specified
6 #ifndef _OPENMP
7 #error "No _OPENMP macro is defined with -fopenmp option"
8 #elsif _OPENMP != 201107
9 #error "_OPENMP has incorrect value"
10 #endif //_OPENMP
11 #else
12 // No -fopenmp option is specified
13 #ifdef _OPENMP
14 #error "_OPENMP macro is defined without -fopenmp option"
15 #endif // _OPENMP
16 #endif // FOPENMP
17 
18 // RUN: %clang_cc1 -fopenmp -verify -DFOPENMP -o - %s
19 // RUN: %clang_cc1 -verify -o - %s
20 // expected-no-diagnostics
21 #ifdef FOPENMP
22 // -fopenmp option is specified
23 #ifndef _OPENMP
24 #error "No _OPENMP macro is defined with -fopenmp option"
25 #elsif _OPENMP != 201107
26 #error "_OPENMP has incorrect value"
27 #endif // _OPENMP
28 #else
29 // No -fopenmp option is specified
30 #ifdef _OPENMP
31 #error "_OPENMP macro is defined without -fopenmp option"
32 #endif // _OPENMP
33 #endif // FOPENMP
34