summaryrefslogtreecommitdiff
path: root/test/SemaCUDA/device-var-init.cu
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCUDA/device-var-init.cu')
-rw-r--r--test/SemaCUDA/device-var-init.cu13
1 files changed, 9 insertions, 4 deletions
diff --git a/test/SemaCUDA/device-var-init.cu b/test/SemaCUDA/device-var-init.cu
index 46cb90da2ecfc..dd5d19a6a2e8f 100644
--- a/test/SemaCUDA/device-var-init.cu
+++ b/test/SemaCUDA/device-var-init.cu
@@ -207,17 +207,22 @@ __device__ void df_sema() {
// expected-error@-1 {{initialization is not supported for __shared__ variables.}}
static __device__ int ds;
- // expected-error@-1 {{within a __device__ function, only __shared__ variables may be marked 'static'}}
+ // expected-error@-1 {{within a __device__ function, only __shared__ variables or const variables without device memory qualifier may be marked 'static'}}
static __constant__ int dc;
- // expected-error@-1 {{within a __device__ function, only __shared__ variables may be marked 'static'}}
+ // expected-error@-1 {{within a __device__ function, only __shared__ variables or const variables without device memory qualifier may be marked 'static'}}
static int v;
- // expected-error@-1 {{within a __device__ function, only __shared__ variables may be marked 'static'}}
+ // expected-error@-1 {{within a __device__ function, only __shared__ variables or const variables without device memory qualifier may be marked 'static'}}
+ static const int cv = 1;
+ static const __device__ int cds = 1;
+ // expected-error@-1 {{within a __device__ function, only __shared__ variables or const variables without device memory qualifier may be marked 'static'}}
+ static const __constant__ int cdc = 1;
+ // expected-error@-1 {{within a __device__ function, only __shared__ variables or const variables without device memory qualifier may be marked 'static'}}
}
__host__ __device__ void hd_sema() {
static int x = 42;
#ifdef __CUDA_ARCH__
- // expected-error@-2 {{within a __host__ __device__ function, only __shared__ variables may be marked 'static'}}
+ // expected-error@-2 {{within a __host__ __device__ function, only __shared__ variables or const variables without device memory qualifier may be marked 'static'}}
#endif
}