File: alias-redefinition.c

package info (click to toggle)
llvm-toolchain-3.4 1%3A3.4.2-13
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 253,236 kB
  • ctags: 276,203
  • sloc: cpp: 1,665,580; ansic: 298,647; asm: 206,157; objc: 84,350; python: 73,119; sh: 23,466; perl: 5,679; makefile: 5,542; ml: 5,250; pascal: 2,467; lisp: 1,420; xml: 679; cs: 236; csh: 117
file content (44 lines) | stat: -rw-r--r-- 1,723 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fsyntax-only -verify %s

void f0() {}
void fun0(void) __attribute((alias("f0")));

void f1() {}
void fun1() {} // expected-note {{previous definition}}
void fun1(void) __attribute((alias("f1"))); // expected-error {{redefinition of 'fun1'}}

void f2() {}
void fun2(void) __attribute((alias("f2"))); // expected-note {{previous definition}}
void fun2() {} // expected-error {{redefinition of 'fun2'}}

void f3() {}
void fun3(void) __attribute((alias("f3"))); // expected-note {{previous definition}}
void fun3(void) __attribute((alias("f3"))); // expected-error {{redefinition of 'fun3'}}

void f4() {}
void fun4(void) __attribute((alias("f4")));
void fun4(void);

// FIXME: We should produce a special case error for this.
void f5() {}
void __attribute((alias("f5"))) fun5(void) {} // expected-error {{redefinition of 'fun5'}} // expected-note {{previous definition}}

int v1;
int var1 __attribute((alias("v1"))); // expected-note {{previous definition}}
int var1 __attribute((alias("v1"))); // expected-error {{redefinition of 'var1'}}

int v2;
int var2 = 2; // expected-note {{previous definition}}
int var2 __attribute((alias("v2"))); // expected-error {{redefinition of 'var2'}}

int v3;
int var3 __attribute((alias("v3"))); // expected-note {{previous definition}}
int var3 = 2; // expected-error {{redefinition of 'var3'}}

int v4;
int var4; // expected-note {{previous definition}}
int var4 __attribute((alias("v4"))); // expected-error {{alias definition of 'var4' after tentative definition}}

int v5;
int var5 __attribute((alias("v5"))); // expected-note {{previous definition}}
int var5; // expected-error {{tentative definition of 'var5' after alias definition}}