[PATCH] D106254: [OpenCL][NFC] Refactors conditional versioning

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


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGb510e0127da3: [OpenCL][NFC] Refactors lang version check in test. (authored by Anastasia).

Changed prior to commit:
  https://reviews.llvm.org/D106254?vs=359700&id=360843#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106254

Files:
  clang/test/SemaOpenCL/null_literal.cl


Index: clang/test/SemaOpenCL/null_literal.cl
===================================================================
--- clang/test/SemaOpenCL/null_literal.cl
+++ 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* 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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106254.360843.patch
Type: text/x-patch
Size: 745 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210722/a9df838a/attachment.bin>


More information about the cfe-commits mailing list