summaryrefslogtreecommitdiff
path: root/test/SemaCUDA
diff options
context:
space:
mode:
authorJustin Lebar <jlebar@google.com>2016-10-02 15:24:50 +0000
committerJustin Lebar <jlebar@google.com>2016-10-02 15:24:50 +0000
commit90917bdf3bb2a971530383aec34966ecff7e16f3 (patch)
tree4c32d237e8503d740f9d7fad91fb0fed56f70f71 /test/SemaCUDA
parent05da52cced3bc8edbc02dde560d3ebfc716d42b3 (diff)
[CUDA] Allow extern __shared__ on empty-length arrays.
"extern __shared__ int x[]" is OK. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@283068 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCUDA')
-rw-r--r--test/SemaCUDA/extern-shared.cu11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/SemaCUDA/extern-shared.cu b/test/SemaCUDA/extern-shared.cu
index 9450bbfa5a..9fd7bbba59 100644
--- a/test/SemaCUDA/extern-shared.cu
+++ b/test/SemaCUDA/extern-shared.cu
@@ -5,10 +5,19 @@
__device__ void foo() {
extern __shared__ int x; // expected-error {{__shared__ variable 'x' cannot be 'extern'}}
+ extern __shared__ int arr[]; // ok
+ extern __shared__ int arr0[0]; // expected-error {{__shared__ variable 'arr0' cannot be 'extern'}}
+ extern __shared__ int arr1[1]; // expected-error {{__shared__ variable 'arr1' cannot be 'extern'}}
+ extern __shared__ int* ptr ; // expected-error {{__shared__ variable 'ptr' cannot be 'extern'}}
}
__host__ __device__ void bar() {
- extern __shared__ int x; // expected-error {{__shared__ variable 'x' cannot be 'extern'}}
+ extern __shared__ int arr[]; // ok
+ extern __shared__ int arr0[0]; // expected-error {{__shared__ variable 'arr0' cannot be 'extern'}}
+ extern __shared__ int arr1[1]; // expected-error {{__shared__ variable 'arr1' cannot be 'extern'}}
+ extern __shared__ int* ptr ; // expected-error {{__shared__ variable 'ptr' cannot be 'extern'}}
}
extern __shared__ int global; // expected-error {{__shared__ variable 'global' cannot be 'extern'}}
+extern __shared__ int global_arr[]; // ok
+extern __shared__ int global_arr1[1]; // expected-error {{__shared__ variable 'global_arr1' cannot be 'extern'}}