summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCUDA/bad-attributes.cu
diff options
context:
space:
mode:
authorJustin Lebar <jlebar@google.com>2016-10-13 18:45:13 +0000
committerJustin Lebar <jlebar@google.com>2016-10-13 18:45:13 +0000
commitaa370bd0d77c136bc6ba87c7b20d007a53e82602 (patch)
tree02c923c7e31bf18513da0488ed0be7403fed2b52 /clang/test/SemaCUDA/bad-attributes.cu
parent179bdce72a4d36abeb9ba6ece8cf312456b92e73 (diff)
downloadbcm5719-llvm-aa370bd0d77c136bc6ba87c7b20d007a53e82602.tar.gz
bcm5719-llvm-aa370bd0d77c136bc6ba87c7b20d007a53e82602.zip
[CUDA] Disallow __shared__ variables in host functions.
Reviewers: tra, rnk Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25143 llvm-svn: 284144
Diffstat (limited to 'clang/test/SemaCUDA/bad-attributes.cu')
-rw-r--r--clang/test/SemaCUDA/bad-attributes.cu1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/test/SemaCUDA/bad-attributes.cu b/clang/test/SemaCUDA/bad-attributes.cu
index 4fb584aec4c..5aaff975967 100644
--- a/clang/test/SemaCUDA/bad-attributes.cu
+++ b/clang/test/SemaCUDA/bad-attributes.cu
@@ -65,6 +65,7 @@ __global__ static inline void foobar() {};
__constant__ int global_constant;
void host_fn() {
__constant__ int c; // expected-error {{__constant__ variables must be global}}
+ __shared__ int s; // expected-error {{__shared__ local variables not allowed in __host__ functions}}
}
__device__ void device_fn() {
__constant__ int c; // expected-error {{__constant__ variables must be global}}
OpenPOWER on IntegriCloud