Skip to content

Commit 0df4e63

Browse files
authored
[OpenCL] update address-spaces.cl (#162785)
This test was broken by #162714. Previously the `[[clang::opencl_private]]` attribute was applied first, resulting in the clashing `__global` attribute being ignored. Now that `__global` is applied first, it results in an error, and then `[[clang::opencl_private]]` is applied, resulting in another error.
1 parent 8a505a1 commit 0df4e63

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

clang/test/SemaOpenCL/address-spaces.cl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,8 @@ void func_multiple_addr2(void) {
265265
__attribute__((opencl_private)) private_int_t var5; // expected-warning {{multiple identical address spaces specified for type}}
266266
__attribute__((opencl_private)) private_int_t *var6; // expected-warning {{multiple identical address spaces specified for type}}
267267
#if __OPENCL_CPP_VERSION__
268-
__global int [[clang::opencl_private]] var7; // expected-error {{multiple address spaces specified for type}}
268+
__global int [[clang::opencl_private]] var7; // expected-error {{multiple address spaces specified for type}} \
269+
// expected-error {{function scope variable cannot be declared in global address space}}
269270
__global int [[clang::opencl_private]] *var8; // expected-error {{multiple address spaces specified for type}}
270271
private_int_t [[clang::opencl_private]] var9; // expected-warning {{multiple identical address spaces specified for type}}
271272
private_int_t [[clang::opencl_private]] *var10; // expected-warning {{multiple identical address spaces specified for type}}

0 commit comments

Comments
 (0)