diff options
| author | Artem Belevich <tra@google.com> | 2016-05-09 19:36:08 +0000 |
|---|---|---|
| committer | Artem Belevich <tra@google.com> | 2016-05-09 19:36:08 +0000 |
| commit | 0c0ada01b6e0dc5565dc50ecf8aa82412c1dd902 (patch) | |
| tree | 8f8e8cd620f7e7aa75f6ca09bcd477d1ac967d11 /clang/test/CodeGenCUDA/device-var-init.cu | |
| parent | a2dfae1fffbb8e06871e6e5ebb04d13a01c0c65f (diff) | |
| download | bcm5719-llvm-0c0ada01b6e0dc5565dc50ecf8aa82412c1dd902.tar.gz bcm5719-llvm-0c0ada01b6e0dc5565dc50ecf8aa82412c1dd902.zip | |
[CUDA] Only __shared__ variables can be static local on device side.
According to CUDA programming guide (v7.5):
> E.2.9.4: Within the body of a device or global function, only
> shared variables may be declared with static storage class.
Differential Revision: http://reviews.llvm.org/D20034
llvm-svn: 268962
Diffstat (limited to 'clang/test/CodeGenCUDA/device-var-init.cu')
| -rw-r--r-- | clang/test/CodeGenCUDA/device-var-init.cu | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/CodeGenCUDA/device-var-init.cu b/clang/test/CodeGenCUDA/device-var-init.cu index 864cc6daee8..23c9fe13762 100644 --- a/clang/test/CodeGenCUDA/device-var-init.cu +++ b/clang/test/CodeGenCUDA/device-var-init.cu @@ -368,6 +368,14 @@ __device__ void df() { T_F_NEC t_f_nec; T_FA_NEC t_fa_nec; static __shared__ UC s_uc; +#if ERROR_CASE + static __device__ int ds; + // expected-error@-1 {{Within a __device__/__global__ function, only __shared__ variables may be marked "static"}} + static __constant__ int dc; + // expected-error@-1 {{Within a __device__/__global__ function, only __shared__ variables may be marked "static"}} + static int v; + // expected-error@-1 {{Within a __device__/__global__ function, only __shared__ variables may be marked "static"}} +#endif } // CHECK: call void @_ZN2ECC1Ev(%struct.EC* %ec) |

