Clang Project

clang_source_code/test/OpenMP/predefined_macro.c
1// RUN: %clang_cc1 -fopenmp -verify -DFOPENMP -o - %s
2// RUN: %clang_cc1 -verify -o - %s
3
4// RUN: %clang_cc1 -fopenmp-simd -verify -o - %s
5// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -verify -o - %s
6// expected-no-diagnostics
7#ifdef FOPENMP
8// -fopenmp option is specified
9#ifndef _OPENMP
10#error "No _OPENMP macro is defined with -fopenmp option"
11#elsif _OPENMP != 201107
12#error "_OPENMP has incorrect value"
13#endif //_OPENMP
14#else
15// No -fopenmp option is specified
16#ifdef _OPENMP
17#error "_OPENMP macro is defined without -fopenmp option"
18#endif // _OPENMP
19#endif // FOPENMP
20
21