[clang] 388e811 - [OpenCL] Constructor address space test adjusted for C++ for OpenCL 2021

Justas Janickas via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 12 06:32:35 PST 2021


Author: Justas Janickas
Date: 2021-11-12T14:31:50Z
New Revision: 388e8110db6f7b4ad9d655a70780f8698c4b9fd1

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

LOG: [OpenCL] Constructor address space test adjusted for C++ for OpenCL 2021

Reuses C++ for OpenCL constructor address space test so that it
supports optional generic address spaces in version 2021.

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

Added: 
    

Modified: 
    clang/test/CodeGenOpenCLCXX/addrspace-constructors.clcpp

Removed: 
    


################################################################################
diff  --git a/clang/test/CodeGenOpenCLCXX/addrspace-constructors.clcpp b/clang/test/CodeGenOpenCLCXX/addrspace-constructors.clcpp
index c0913f484f5e3..9ad251d051c77 100644
--- a/clang/test/CodeGenOpenCLCXX/addrspace-constructors.clcpp
+++ b/clang/test/CodeGenOpenCLCXX/addrspace-constructors.clcpp
@@ -1,4 +1,6 @@
-// RUN: %clang_cc1 %s -emit-llvm -o - -O0 -triple spir-unknown-unknown | FileCheck %s
+// RUN: %clang_cc1 %s -cl-std=clc++1.0 -DGENERIC -emit-llvm -o - -O0 -triple spir-unknown-unknown | FileCheck %s
+// RUN: %clang_cc1 %s -cl-std=clc++2021 -DGENERIC -emit-llvm -o - -O0 -triple spir-unknown-unknown | FileCheck %s
+// RUN: %clang_cc1 %s -cl-std=clc++2021 -cl-ext=-__opencl_c_generic_address_space,-__opencl_c_pipes -emit-llvm -o - -O0 -triple spir-unknown-unknown | FileCheck %s
 
 // CHECK: %struct.X = type { i32 }
 
@@ -11,8 +13,10 @@ struct X {
   int x;
 
   // Local variables are handled in local_addrspace_init.clcpp
-  X() /*__generic*/ : x(0) {}
+  X() /*__generic or __private*/ : x(0) {}
+#if defined(GENERIC)
   X() __private : x(0) {}
+#endif
   X() __global : x(0) {}
   constexpr X() __constant : x(0) {}
   constexpr X(int x) __constant : x(x) {}


        


More information about the cfe-commits mailing list