Rafael Espindola | d53ffa0 | 2013-10-22 21:39:03 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fsyntax-only -verify %s |
| 2 | |
| 3 | void f0() {} |
| 4 | void fun0(void) __attribute((alias("f0"))); |
| 5 | |
| 6 | void f1() {} |
| 7 | void fun1() {} // expected-note {{previous definition}} |
| 8 | void fun1(void) __attribute((alias("f1"))); // expected-error {{redefinition of 'fun1'}} |
| 9 | |
| 10 | void f2() {} |
| 11 | void fun2(void) __attribute((alias("f2"))); // expected-note {{previous definition}} |
| 12 | void fun2() {} // expected-error {{redefinition of 'fun2'}} |
| 13 | |
| 14 | void f3() {} |
| 15 | void fun3(void) __attribute((alias("f3"))); // expected-note {{previous definition}} |
| 16 | void fun3(void) __attribute((alias("f3"))); // expected-error {{redefinition of 'fun3'}} |
| 17 | |
| 18 | void f4() {} |
| 19 | void fun4(void) __attribute((alias("f4"))); |
| 20 | void fun4(void); |
| 21 | |
| 22 | // FIXME: We should produce a special case error for this. |
| 23 | void f5() {} |
| 24 | void __attribute((alias("f5"))) fun5(void) {} // expected-error {{redefinition of 'fun5'}} // expected-note {{previous definition}} |
| 25 | |
| 26 | int v1; |
| 27 | int var1 __attribute((alias("v1"))); // expected-note {{previous definition}} |
| 28 | int var1 __attribute((alias("v1"))); // expected-error {{redefinition of 'var1'}} |
| 29 | |
| 30 | int v2; |
| 31 | int var2 = 2; // expected-note {{previous definition}} |
| 32 | int var2 __attribute((alias("v2"))); // expected-error {{redefinition of 'var2'}} |
| 33 | |
| 34 | int v3; |
| 35 | int var3 __attribute((alias("v3"))); // expected-note {{previous definition}} |
| 36 | int var3 = 2; // expected-error {{redefinition of 'var3'}} |
| 37 | |
| 38 | int v4; |
| 39 | int var4; // expected-note {{previous definition}} |
| 40 | int var4 __attribute((alias("v4"))); // expected-error {{alias definition of 'var4' after tentative definition}} |
| 41 | |
| 42 | int v5; |
| 43 | int var5 __attribute((alias("v5"))); // expected-note {{previous definition}} |
| 44 | int var5; // expected-error {{tentative definition of 'var5' after alias definition}} |