aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/gnu-attributes.c
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-01-18 16:23:48 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-01-18 16:23:48 +0000
commit06d4ba388873e6d1cfa9cd715a8935ecc8cd2097 (patch)
tree3eb853da77d46cc77c4b017525a422f9ddb1385b /test/Sema/gnu-attributes.c
parent30d791273d07fac9c0c1641a0731191bca6e8606 (diff)
Diffstat (limited to 'test/Sema/gnu-attributes.c')
-rw-r--r--test/Sema/gnu-attributes.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/Sema/gnu-attributes.c b/test/Sema/gnu-attributes.c
new file mode 100644
index 000000000000..653fae826a74
--- /dev/null
+++ b/test/Sema/gnu-attributes.c
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
+
+struct s {};
+
+// FIXME: should warn that declaration attribute in type position is
+// being applied to the declaration instead?
+struct s __attribute__((used)) foo;
+
+// FIXME: Should warn that type attribute in declaration position is
+// being applied to the type instead?
+struct s *bar __attribute__((address_space(1)));
+
+// Should not warn because type attribute is in type position.
+struct s *__attribute__((address_space(1))) baz;
+
+// Should not warn because declaration attribute is in declaration position.
+struct s *quux __attribute__((used));