xref: /aosp_15_r20/external/clang/test/Sema/invalid-assignment-constant-address-space.c (revision 67e74705e28f6214e480b399dd47ea732279e315)
1 // RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only
2 
3 #define OPENCL_CONSTANT 8388354
4 int __attribute__((address_space(OPENCL_CONSTANT))) c[3] = {0};
5 
foo()6 void foo() {
7   c[0] = 1; //expected-error{{read-only variable is not assignable}}
8 }
9