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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@368170
91177308-0d34-0410-b5e6-
96231b3b80d8
case 45:
Builder.defineMacro("_OPENMP", "201511");
break;
+ case 50:
+ Builder.defineMacro("_OPENMP", "201811");
+ break;
default:
// Default version is OpenMP 3.1
Builder.defineMacro("_OPENMP", "201107");
// CHECK-45-VERSION: #define _OPENMP 201511
// CHECK-45-VERSION2: #define _OPENMP 201511
+// RUN: %clang %s -c -E -dM -fopenmp=libomp -fopenmp-version=50 | FileCheck --check-prefix=CHECK-50-VERSION %s
+// CHECK-50-VERSION: #define _OPENMP 201811
+
// RUN: %clang %s -c -E -dM -fopenmp-version=1 | FileCheck --check-prefix=CHECK-VERSION %s
// RUN: %clang %s -c -E -dM -fopenmp-version=31 | FileCheck --check-prefix=CHECK-VERSION %s
// RUN: %clang %s -c -E -dM -fopenmp-version=40 | FileCheck --check-prefix=CHECK-VERSION %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