2008-02-21 09:42:41 +08:00
|
|
|
// RUN: clang %s -fsyntax-only -verify
|
|
|
|
|
|
|
|
#define _AS1 __attribute__((address_space(1)))
|
|
|
|
#define _AS2 __attribute__((address_space(2)))
|
|
|
|
#define _AS3 __attribute__((address_space(3)))
|
|
|
|
|
|
|
|
void foo(_AS3 float *a) {
|
|
|
|
_AS2 *x;
|
|
|
|
_AS1 float * _AS2 *B;
|
|
|
|
|
2008-03-15 02:07:10 +08:00
|
|
|
int _AS1 _AS2 *Y; // expected-error {{multiple address spaces specified for type}}
|
2008-02-21 09:42:41 +08:00
|
|
|
int *_AS1 _AS2 *Z; // expected-error {{multiple address spaces specified for type}}
|
|
|
|
|
2008-03-15 02:07:10 +08:00
|
|
|
_AS1 int local; // expected-error {{automatic variable qualified with an address space}}
|
2008-03-26 02:36:32 +08:00
|
|
|
_AS1 int array[5]; // expected-error {{automatic variable qualified with an address space}}
|
|
|
|
_AS1 int arrarr[5][5]; // expected-error {{automatic variable qualified with an address space}}
|
2008-03-14 08:22:18 +08:00
|
|
|
|
2008-02-21 09:42:41 +08:00
|
|
|
*a = 5.0f;
|
|
|
|
}
|