diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-12-18 20:11:37 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-12-18 20:11:37 +0000 |
| commit | 461a67fa15370a9ec88f8f8a240bf7c123bb2029 (patch) | |
| tree | 6942083d7d56bba40ec790a453ca58ad3baf6832 /test/SemaOpenCL/storageclass-cl20.cl | |
| parent | 75c3240472ba6ac2669ee72ca67eb72d4e2851fc (diff) | |
Notes
Diffstat (limited to 'test/SemaOpenCL/storageclass-cl20.cl')
| -rw-r--r-- | test/SemaOpenCL/storageclass-cl20.cl | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/test/SemaOpenCL/storageclass-cl20.cl b/test/SemaOpenCL/storageclass-cl20.cl index b12676fe7437..581701d2a6a5 100644 --- a/test/SemaOpenCL/storageclass-cl20.cl +++ b/test/SemaOpenCL/storageclass-cl20.cl @@ -1,21 +1,41 @@ // RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0 -static constant int G1 = 0; int G2 = 0; global int G3 = 0; local int G4 = 0; // expected-error{{program scope variable must reside in global or constant address space}} -void kernel foo() { - static int S1 = 5; - static global int S2 = 5; - static private int S3 = 5; // expected-error{{static local variable must reside in global or constant address space}} +static float g_implicit_static_var = 0; +static constant float g_constant_static_var = 0; +static global float g_global_static_var = 0; +static local float g_local_static_var = 0; // expected-error {{program scope variable must reside in global or constant address space}} +static private float g_private_static_var = 0; // expected-error {{program scope variable must reside in global or constant address space}} +static generic float g_generic_static_var = 0; // expected-error {{program scope variable must reside in global or constant address space}} + +extern float g_implicit_extern_var; +extern constant float g_constant_extern_var; +extern global float g_global_extern_var; +extern local float g_local_extern_var; // expected-error {{extern variable must reside in global or constant address space}} +extern private float g_private_extern_var; // expected-error {{extern variable must reside in global or constant address space}} +extern generic float g_generic_extern_var; // expected-error {{extern variable must reside in global or constant address space}} +void kernel foo() { constant int L1 = 0; local int L2; global int L3; // expected-error{{function scope variable cannot be declared in global address space}} generic int L4; // expected-error{{automatic variable qualified with an invalid address space}} __attribute__((address_space(100))) int L5; // expected-error{{automatic variable qualified with an invalid address space}} - extern global int G5; - extern int G6; // expected-error{{extern variable must reside in global or constant address space}} + static float l_implicit_static_var = 0; + static constant float l_constant_static_var = 0; + static global float l_global_static_var = 0; + static local float l_local_static_var = 0; // expected-error {{static local variable must reside in global or constant address space}} + static private float l_private_static_var = 0; // expected-error {{static local variable must reside in global or constant address space}} + static generic float l_generic_static_var = 0; // expected-error {{static local variable must reside in global or constant address space}} + + extern float l_implicit_extern_var; + extern constant float l_constant_extern_var; + extern global float l_global_extern_var; + extern local float l_local_extern_var; // expected-error {{extern variable must reside in global or constant address space}} + extern private float l_private_extern_var; // expected-error {{extern variable must reside in global or constant address space}} + extern generic float l_generic_extern_var; // expected-error {{extern variable must reside in global or constant address space}} } |
