2008-02-21 04:42:41 +03: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) {
|
2009-02-27 21:53:28 +03:00
|
|
|
_AS2 *x;// expected-warning {{type specifier missing, defaults to 'int'}}
|
2008-02-21 04:42:41 +03:00
|
|
|
_AS1 float * _AS2 *B;
|
|
|
|
|
2008-03-14 21:07:10 +03:00
|
|
|
int _AS1 _AS2 *Y; // expected-error {{multiple address spaces specified for type}}
|
2008-02-21 04:42:41 +03:00
|
|
|
int *_AS1 _AS2 *Z; // expected-error {{multiple address spaces specified for type}}
|
|
|
|
|
2008-03-14 21:07:10 +03:00
|
|
|
_AS1 int local; // expected-error {{automatic variable qualified with an address space}}
|
2008-03-25 21:36:32 +03: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 03:22:18 +03:00
|
|
|
|
2008-02-21 04:42:41 +03:00
|
|
|
*a = 5.0f;
|
|
|
|
}
|
2009-01-12 03:08:58 +03:00
|
|
|
|
|
|
|
struct _st {
|
|
|
|
int x, y;
|
|
|
|
} s __attribute ((address_space(1))) = {1, 1};
|
|
|
|
|