[cfe-commits] r47423 - /cfe/trunk/test/Sema/address_spaces.c

Chris Lattner sabre at nondot.org
Wed Feb 20 17:42:42 PST 2008


Author: lattner
Date: Wed Feb 20 19:42:41 2008
New Revision: 47423

URL: http://llvm.org/viewvc/llvm-project?rev=47423&view=rev
Log:
add some semantic checks for address spaces.

Added:
    cfe/trunk/test/Sema/address_spaces.c

Added: cfe/trunk/test/Sema/address_spaces.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/address_spaces.c?rev=47423&view=auto

==============================================================================
--- cfe/trunk/test/Sema/address_spaces.c (added)
+++ cfe/trunk/test/Sema/address_spaces.c Wed Feb 20 19:42:41 2008
@@ -0,0 +1,15 @@
+// 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;
+}





More information about the cfe-commits mailing list