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