1 // RUN: %clang_cc1 -triple x86_64-pc-linux -Wno-strict-prototypes -fsyntax-only -verify -emit-llvm-only %s
3 void f1(void) __attribute__((alias("g1")));
7 void f2(void) __attribute__((alias("g2"))); // expected-error {{alias must point to a defined variable or function}}
10 void f3(void) __attribute__((alias("g3"))); // expected-error {{alias must point to a defined variable or function}}
14 void f4() __attribute__((alias("g4")));
16 void h4() __attribute__((alias("f4")));
18 void f5() __attribute__((alias("g5")));
19 void h5() __attribute__((alias("f5")));
23 void f6() __attribute__((alias("g6")));
24 void h6() __attribute__((alias("f6")));
27 void h7() __attribute__((alias("f7")));
28 void f7() __attribute__((alias("g7")));
30 void h8() __attribute__((alias("f8")));
32 void f8() __attribute__((alias("g8")));
34 void h9() __attribute__((alias("f9")));
35 void f9() __attribute__((alias("g9")));
38 void f10() __attribute__((alias("g10"))); // expected-error {{alias definition is part of a cycle}}
39 void g10() __attribute__((alias("f10"))); // expected-error {{alias definition is part of a cycle}}
41 // FIXME: This could be a bit better, h10 is not part of the cycle, it points
43 void h10() __attribute__((alias("g10"))); // expected-error {{alias definition is part of a cycle}}
45 extern int a1
__attribute__((alias("b1")));
48 extern int a2
__attribute__((alias("b2"))); // expected-error {{alias must point to a defined variable or function}}
50 extern int a3
__attribute__((alias("b3"))); // expected-error {{alias must point to a defined variable or function}}
53 extern int a4
__attribute__((alias("b4"))); // expected-error {{alias must point to a defined variable or function}}
57 void test2_foo() __attribute__((weak
, alias("test2_bar")));
58 void test2_zed() __attribute__((alias("test2_foo"))); // expected-warning {{alias will always resolve to test2_bar even if weak definition of test2_foo is overridden}}
61 void test3_foo() __attribute__((section("test"))); // expected-warning {{alias will not be in section 'test' but in the same section as the aliasee}}
62 void test3_foo() __attribute__((alias("test3_bar")));
64 __attribute__((section("test"))) void test4_bar() { }
65 void test4_foo() __attribute__((section("test")));
66 void test4_foo() __attribute__((alias("test4_bar")));
69 extern struct incomplete_type test5_foo
__attribute__((alias("test5_bar")));