summaryrefslogtreecommitdiff
path: root/test/Sema/attr-alias-elf.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Sema/attr-alias-elf.c')
-rw-r--r--test/Sema/attr-alias-elf.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Sema/attr-alias-elf.c b/test/Sema/attr-alias-elf.c
index 88bd7b70958b1..f14514dccd2c6 100644
--- a/test/Sema/attr-alias-elf.c
+++ b/test/Sema/attr-alias-elf.c
@@ -52,3 +52,18 @@ extern int b3;
extern int a4 __attribute__((alias("b4"))); // expected-error {{alias must point to a defined variable or function}}
typedef int b4;
+
+void test2_bar() {}
+void test2_foo() __attribute__((weak, alias("test2_bar")));
+void test2_zed() __attribute__((alias("test2_foo"))); // expected-warning {{alias will always resolve to test2_bar even if weak definition of alias test2_foo is overridden}}
+
+void test3_bar() { }
+void test3_foo() __attribute__((section("test"))); // expected-warning {{alias will not be in section 'test' but in the same section as the aliasee}}
+void test3_foo() __attribute__((alias("test3_bar")));
+
+__attribute__((section("test"))) void test4_bar() { }
+void test4_foo() __attribute__((section("test")));
+void test4_foo() __attribute__((alias("test4_bar")));
+
+int test5_bar = 0;
+extern struct incomplete_type test5_foo __attribute__((alias("test5_bar")));