• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 
3 __attribute__((address_space(42)))
4 const float withc = 1.0f;
5 
6 __attribute__((address_space(42)))
7 volatile float withv = 1.0f;
8 
9 __attribute__((address_space(42)))
10 float nocv = 1.0f;
11 
12 __attribute__((address_space(42)))
13 float nocv_array[10] = { 1.0f };
14 
15 __attribute__((address_space(42)))
16 int nocv_iarray[10] = { 4 };
17 
18 
19 __attribute__((address_space(9999)))
20 int* 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