summaryrefslogtreecommitdiff
path: root/test/Sema/attr-section.c
diff options
context:
space:
mode:
authorErich Keane <erich.keane@intel.com>2017-10-04 22:16:24 +0000
committerErich Keane <erich.keane@intel.com>2017-10-04 22:16:24 +0000
commit2c4bc52489de4075b24e275eec58f2ec4788666e (patch)
treec6a84d4a7737ea5fd6de23985531559cbfb27102 /test/Sema/attr-section.c
parent8dd6284b7c70a2489e722480ba4a264a374922cc (diff)
Fix 'section' warning behavior with tentatively-defined values
As reported on cfe-commits, r314262 resulted in tentatively-defined variables not being excluded for the warning. Patch By: Elizabeth Andrews git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@314939 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/attr-section.c')
-rw-r--r--test/Sema/attr-section.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/Sema/attr-section.c b/test/Sema/attr-section.c
index 2fb4dbd6bf..b361738e8e 100644
--- a/test/Sema/attr-section.c
+++ b/test/Sema/attr-section.c
@@ -23,3 +23,12 @@ enum __attribute__((section("NEAR,x"))) e { one }; // expected-error {{'section'
extern int a; // expected-note {{previous declaration is here}}
int *b = &a;
extern int a __attribute__((section("foo,zed"))); // expected-warning {{section attribute is specified on redeclared variable}}
+
+// Not a warning.
+int c;
+int c __attribute__((section("foo,zed")));
+
+// Also OK.
+struct r_debug {};
+extern struct r_debug _r_debug;
+struct r_debug _r_debug __attribute__((nocommon, section(".r_debug,bar")));