[PATCH] D109366: [OpenCL] Tests C++ for OpenCL version macros

Justas Janickas via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 9 03:56:13 PDT 2021


Topotuna updated this revision to Diff 371544.
Topotuna retitled this revision from "[OpenCL] Tests C++ for OpenCL 2021 version macros" to "[OpenCL] Tests C++ for OpenCL version macros".
Topotuna edited the summary of this revision.
Topotuna added a comment.

Test case added for command line flag `-cl-std=clc++`


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109366/new/

https://reviews.llvm.org/D109366

Files:
  clang/test/Preprocessor/predefined-macros.c


Index: clang/test/Preprocessor/predefined-macros.c
===================================================================
--- clang/test/Preprocessor/predefined-macros.c
+++ clang/test/Preprocessor/predefined-macros.c
@@ -136,7 +136,11 @@
 // RUN: %clang_cc1 %s -E -dM -o - -x cl -cl-fast-relaxed-math \
 // 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-CLCPP
+// 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
@@ -173,10 +177,21 @@
 // CHECK-CL30: #define __OPENCL_C_VERSION__ 300
 // CHECK-CL30-NOT: #define __FAST_RELAXED_MATH__ 1
 // CHECK-FRM: #define __FAST_RELAXED_MATH__ 1
+// CHECK-CLCPP: #define __CL_CPP_VERSION_1_0__ 100
+// CHECK-CLCPP: #define __CL_CPP_VERSION_2021__ 202100
+// CHECK-CLCPP: #define __OPENCL_CPP_VERSION__ 100
+// CHECK-CLCPP-NOT: #define __FAST_RELAXED_MATH__ 1
+// CHECK-CLCPP-NOT: #define __ENDIAN_LITTLE__ 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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109366.371544.patch
Type: text/x-patch
Size: 1978 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210909/02b0a607/attachment.bin>


More information about the cfe-commits mailing list