summaryrefslogtreecommitdiffstats
path: root/test/Sema/attr-decl-after-definition.c
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2012-08-15 20:02:54 +0000
committerdim <dim@FreeBSD.org>2012-08-15 20:02:54 +0000
commit554bcb69c2d785a011a30e7db87a36a87fe7db10 (patch)
tree9abb1a658a297776086f4e0dfa6ca533de02104e /test/Sema/attr-decl-after-definition.c
parentbb67ca86b31f67faee50bd10c3b036d65751745a (diff)
downloadFreeBSD-src-554bcb69c2d785a011a30e7db87a36a87fe7db10.zip
FreeBSD-src-554bcb69c2d785a011a30e7db87a36a87fe7db10.tar.gz
Vendor import of clang trunk r161861:
http://llvm.org/svn/llvm-project/cfe/trunk@161861
Diffstat (limited to 'test/Sema/attr-decl-after-definition.c')
-rw-r--r--test/Sema/attr-decl-after-definition.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/test/Sema/attr-decl-after-definition.c b/test/Sema/attr-decl-after-definition.c
index 4d32e00..17b94cc 100644
--- a/test/Sema/attr-decl-after-definition.c
+++ b/test/Sema/attr-decl-after-definition.c
@@ -14,6 +14,26 @@ int bar __attribute__((weak));
int bar __attribute__((used));
extern int bar __attribute__((weak));
int bar = 0; // expected-note {{previous definition is here}}
-int bar __attribute__((weak)); // expected-warning {{must precede definition}}
+int bar __attribute__((weak)); // no warning as it matches the existing
+ // attribute.
+int bar __attribute__((used,
+ visibility("hidden"))); // expected-warning {{must precede definition}}
int bar;
+struct zed { // expected-note {{previous definition is here}}
+};
+struct __attribute__((visibility("hidden"))) zed; // expected-warning {{must precede definition}}
+
+struct __attribute__((visibility("hidden"))) zed2 {
+};
+struct __attribute__((visibility("hidden"))) zed2;
+
+struct __attribute__((visibility("hidden"))) zed3 { // expected-note {{previous definition is here}}
+};
+struct __attribute__((visibility("hidden"),
+ packed // expected-warning {{must precede definition}}
+ )) zed3;
+
+struct __attribute__((visibility("hidden"))) zed4 { // expected-note {{previous attribute is here}}
+};
+struct __attribute__((visibility("default"))) zed4; // expected-error {{visibility does not match previous declaration}}
OpenPOWER on IntegriCloud