summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCUDA
diff options
context:
space:
mode:
authorMichael Liao <michael.hliao@gmail.com>2019-06-07 15:08:29 -0400
committerMichael Liao <michael.hliao@gmail.com>2019-11-05 14:19:32 -0500
commit0a220de9e9ca3e6786df6c03fd37668815805c62 (patch)
tree8e6530e9146db52615db6c5b0a351cab4378d38b /clang/test/CodeGenCUDA
parent6cd47f9dd7dd664ff855fb0d1ed26bf5e4bb77fc (diff)
downloadbcm5719-llvm-0a220de9e9ca3e6786df6c03fd37668815805c62.tar.gz
bcm5719-llvm-0a220de9e9ca3e6786df6c03fd37668815805c62.zip
[HIP] Fix visibility for 'extern' device variables.
Summary: - Fix a bug which misses the change for a variable to be set with target-specific attributes. Reviewers: yaxunl Subscribers: jvesely, nhaehnle, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63020
Diffstat (limited to 'clang/test/CodeGenCUDA')
-rw-r--r--clang/test/CodeGenCUDA/amdgpu-visibility.cu10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/CodeGenCUDA/amdgpu-visibility.cu b/clang/test/CodeGenCUDA/amdgpu-visibility.cu
index 9f44eb047f8..f23e562a4f2 100644
--- a/clang/test/CodeGenCUDA/amdgpu-visibility.cu
+++ b/clang/test/CodeGenCUDA/amdgpu-visibility.cu
@@ -13,6 +13,16 @@
__constant__ int c;
__device__ int g;
+// CHECK-DEFAULT: @e = external addrspace(1) global
+// CHECK-PROTECTED: @e = external protected addrspace(1) global
+// CHECK-HIDDEN: @e = external protected addrspace(1) global
+extern __device__ int e;
+
+// dummy one to hold reference to `e`.
+__device__ int f() {
+ return e;
+}
+
// CHECK-DEFAULT: define amdgpu_kernel void @_Z3foov()
// CHECK-PROTECTED: define protected amdgpu_kernel void @_Z3foov()
// CHECK-HIDDEN: define protected amdgpu_kernel void @_Z3foov()
OpenPOWER on IntegriCloud