File: attr-alias-elf.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 (54 lines) | stat: -rw-r--r-- 1,798 bytes parent folder | download
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
45
46
47
48
49
50
51
52
53
54
// RUN: %clang_cc1 -triple x86_64-pc-linux  -fsyntax-only -verify -emit-llvm-only %s

void f1(void) __attribute__((alias("g1")));
void g1(void) {
}

void f2(void) __attribute__((alias("g2"))); // expected-error {{alias must point to a defined variable or function}}


void f3(void) __attribute__((alias("g3"))); // expected-error {{alias must point to a defined variable or function}}
void g3(void);


void f4() __attribute__((alias("g4")));
void g4() {}
void h4() __attribute__((alias("f4")));

void f5() __attribute__((alias("g5")));
void h5() __attribute__((alias("f5")));
void g5() {}

void g6() {}
void f6() __attribute__((alias("g6")));
void h6() __attribute__((alias("f6")));

void g7() {}
void h7() __attribute__((alias("f7")));
void f7() __attribute__((alias("g7")));

void h8() __attribute__((alias("f8")));
void g8() {}
void f8() __attribute__((alias("g8")));

void h9() __attribute__((alias("f9")));
void f9() __attribute__((alias("g9")));
void g9() {}

void f10() __attribute__((alias("g10"))); // expected-error {{alias definition is part of a cycle}}
void g10() __attribute__((alias("f10"))); // expected-error {{alias definition is part of a cycle}}

// FIXME: This could be a bit better, h10 is not part of the cycle, it points
// to it.
void h10() __attribute__((alias("g10"))); // expected-error {{alias definition is part of a cycle}}

extern int a1 __attribute__((alias("b1")));
int b1 = 42;

extern int a2 __attribute__((alias("b2"))); // expected-error {{alias must point to a defined variable or function}}

extern int a3 __attribute__((alias("b3"))); // expected-error {{alias must point to a defined variable or function}}
extern int b3;

extern int a4 __attribute__((alias("b4"))); // expected-error {{alias must point to a defined variable or function}}
typedef int b4;