Skip to content

Commit

Permalink
[OpenCL] Tests C++ for OpenCL version macros
Browse files Browse the repository at this point in the history
Version macro definitions are tested for C++ for OpenCL when
explicit version is provided on command line via `-cl-std` flag.

Differential Revision: https://reviews.llvm.org/D109366
  • Loading branch information
Topotuna committed Sep 14, 2021
1 parent 6fbc167 commit ad88632
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions clang/test/Preprocessor/predefined-macros.c
Expand Up @@ -137,6 +137,10 @@
// RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-FRM
// RUN: %clang_cc1 %s -E -dM -o - -x cl -cl-std=clc++ \
// RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-CLCPP10
// RUN: %clang_cc1 %s -E -dM -o - -x cl -cl-std=clc++1.0 \
// RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-CLCPP10
// RUN: %clang_cc1 %s -E -dM -o - -x cl -cl-std=clc++2021 \
// RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-CLCPP2021
// CHECK-CL10: #define CL_VERSION_1_0 100
// CHECK-CL10: #define CL_VERSION_1_1 110
// CHECK-CL10: #define CL_VERSION_1_2 120
Expand Down Expand Up @@ -174,9 +178,15 @@
// CHECK-CL30-NOT: #define __FAST_RELAXED_MATH__ 1
// CHECK-FRM: #define __FAST_RELAXED_MATH__ 1
// CHECK-CLCPP10: #define __CL_CPP_VERSION_1_0__ 100
// CHECK-CLCPP10: #define __CL_CPP_VERSION_2021__ 202100
// CHECK-CLCPP10: #define __OPENCL_CPP_VERSION__ 100
// CHECK-CLCPP10-NOT: #define __FAST_RELAXED_MATH__ 1
// CHECK-CLCPP10-NOT: #define __ENDIAN_LITTLE__ 1
// CHECK-CLCPP2021: #define __CL_CPP_VERSION_1_0__ 100
// CHECK-CLCPP2021: #define __CL_CPP_VERSION_2021__ 202100
// CHECK-CLCPP2021: #define __OPENCL_CPP_VERSION__ 202100
// CHECK-CLCPP2021-NOT: #define __FAST_RELAXED_MATH__ 1
// CHECK-CLCPP2021-NOT: #define __ENDIAN_LITTLE__ 1

// RUN: %clang_cc1 %s -E -dM -o - -x cl \
// RUN: | FileCheck %s --check-prefix=MSCOPE
Expand Down

0 comments on commit ad88632

Please sign in to comment.