llvm/clang/test/OpenMP/predefined_macro.c
Alexey Bataev 2e3a07fcb8 [OPENMP]Add standard macro value _OPENMP for OpenMP 5.0.
According to the OpenMP standard, compiler must define _OPENMP macro,
which has value in format yyyymm, where yyyy is the year of the standard
and mm is the month of the standard. For OpenMP 5.0 this value must be
set to 201811.

llvm-svn: 368170
2019-08-07 14:02:11 +00:00

22 lines
655 B
C

// RUN: %clang_cc1 -fopenmp -verify -DFOPENMP -o - %s
// RUN: %clang_cc1 -verify -o - %s
// RUN: %clang_cc1 -fopenmp-simd -verify -o - %s
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -verify -o - %s
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -verify -o - %s
// expected-no-diagnostics
#ifdef FOPENMP
// -fopenmp option is specified
#ifndef _OPENMP
#error "No _OPENMP macro is defined with -fopenmp option"
#elsif _OPENMP != 201107
#error "_OPENMP has incorrect value"
#endif //_OPENMP
#else
// No -fopenmp option is specified
#ifdef _OPENMP
#error "_OPENMP macro is defined without -fopenmp option"
#endif // _OPENMP
#endif // FOPENMP