[clang] b510e01 - [OpenCL][NFC] Refactors lang version check in test.

Anastasia Stulova via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 22 08:48:25 PDT 2021


Author: Anastasia Stulova
Date: 2021-07-22T16:47:38+01:00
New Revision: b510e0127da38d47b9224b082842e827c04947a8

URL: https://github.com/llvm/llvm-project/commit/b510e0127da38d47b9224b082842e827c04947a8
DIFF: https://github.com/llvm/llvm-project/commit/b510e0127da38d47b9224b082842e827c04947a8.diff

LOG: [OpenCL][NFC] Refactors lang version check in test.

Fixed test to use predefined version marco instead
of passing extra macro in the command line.

Patch by Topotuna (Justas Janickas)!

Differential Revision: https://reviews.llvm.org/D106254

Added: 
    

Modified: 
    clang/test/SemaOpenCL/null_literal.cl

Removed: 
    


################################################################################
diff  --git a/clang/test/SemaOpenCL/null_literal.cl b/clang/test/SemaOpenCL/null_literal.cl
index fb0f938d5952a..e84228a06fc41 100644
--- a/clang/test/SemaOpenCL/null_literal.cl
+++ b/clang/test/SemaOpenCL/null_literal.cl
@@ -1,5 +1,5 @@
 // RUN: %clang_cc1 -verify %s
-// RUN: %clang_cc1 -cl-std=CL2.0 -DCL20 -verify %s
+// RUN: %clang_cc1 -cl-std=CL2.0 -verify %s
 
 #define NULL ((void*)0)
 
@@ -13,7 +13,7 @@ constant int* ptr3 = NULL;
 
 constant int* ptr4 = (global void*)0; // expected-error{{initializing '__constant int *__private' with an expression of type '__global void *' changes address space of pointer}}
 
-#ifdef CL20
+#if __OPENCL_C_VERSION__ == CL_VERSION_2_0
 // Accept explicitly pointer to generic address space in OpenCL v2.0.
 global int* ptr5 = (generic void*)0;
 #endif


        


More information about the cfe-commits mailing list