summaryrefslogtreecommitdiff
path: root/test/SemaCUDA
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
commita1f58c85829f2c491e9cf32445f8c8287f11d80f (patch)
tree84d69937c65f21e9b4645b924eb22cf1eca6ee2a /test/SemaCUDA
parentfff8e6c7b6f6f8ebc8c9d8e8282e2f12d1fa565a (diff)
[CUDA] Disallow __shared__ variables in host functions.
Reviewers: tra, rnk Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25143 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@284144 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCUDA')
-rw-r--r--test/SemaCUDA/bad-attributes.cu1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/SemaCUDA/bad-attributes.cu b/test/SemaCUDA/bad-attributes.cu
index 4fb584aec4..5aaff97596 100644
--- a/test/SemaCUDA/bad-attributes.cu
+++ b/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}}