1// RUN: %clang_cc1 -fsyntax-only -verify %s
2
3__attribute__((address_space(42)))
4const float withc = 1.0f;
5
6__attribute__((address_space(42)))
7volatile float withv = 1.0f;
8
9__attribute__((address_space(42)))
10float nocv = 1.0f;
11
12__attribute__((address_space(42)))
13float nocv_array[10] = { 1.0f };
14
15__attribute__((address_space(42)))
16int nocv_iarray[10] = { 4 };
17
18
19__attribute__((address_space(9999)))
20int* as_ptr = nocv_iarray; // expected-error{{cannot initialize a variable of type '__attribute__((address_space(9999))) int *' with an lvalue of type '__attribute__((address_space(42))) int [10]'}}
21
22
23__attribute__((address_space(42))) int* __attribute__((address_space(42))) ptr_in_same_addr_space = nocv_iarray;
24__attribute__((address_space(42))) int* __attribute__((address_space(999))) ptr_in_different_addr_space = nocv_iarray;
25
26