llvm-project/clang/test/Sema/address_spaces.c

16 lines
433 B
C
Raw Normal View History

// 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;
int _AS1 _AS2 *Y; // expected-error {{multiple address spaces specified for type}}
int *_AS1 _AS2 *Z; // expected-error {{multiple address spaces specified for type}}
*a = 5.0f;
}