753d5d9f6cebf9758596b8697a52936410385229
[oota-llvm.git] / test / CodeGen / X86 / aliases.ll
1 ; RUN: llc < %s -mtriple=i686-pc-linux-gnu -asm-verbose=false -o %t
2 ; RUN: grep { = } %t   | count 7
3 ; RUN: grep set %t   | count 18
4 ; RUN: grep globl %t | count 6
5 ; RUN: grep weak %t  | count 1
6 ; RUN: grep hidden %t | count 1
7 ; RUN: grep protected %t | count 1
8
9 @bar = external global i32
10 @foo1 = alias i32* @bar
11 @foo2 = alias i32* @bar
12
13 %FunTy = type i32()
14
15 declare i32 @foo_f()
16 @bar_f = alias weak %FunTy* @foo_f
17
18 @bar_i = alias internal i32* @bar
19
20 @A = alias bitcast (i32* @bar to i64*)
21
22 @bar_h = hidden alias i32* @bar
23
24 @bar_p = protected alias i32* @bar
25
26 define i32 @test() {
27 entry:
28    %tmp = load i32* @foo1
29    %tmp1 = load i32* @foo2
30    %tmp0 = load i32* @bar_i
31    %tmp2 = call i32 @foo_f()
32    %tmp3 = add i32 %tmp, %tmp2
33    %tmp4 = call %FunTy* @bar_f()
34    %tmp5 = add i32 %tmp3, %tmp4
35    %tmp6 = add i32 %tmp1, %tmp5
36    %tmp7 = add i32 %tmp6, %tmp0
37    ret i32 %tmp7
38 }