1 ; Based llvm/test/CodeGen/X86/aliases.ll
2 ; RUN: llc < %s -mtriple=wasm32-unknown-uknown -asm-verbose=false | FileCheck %s
6 ; CHECK-DAG: .globl foo1
7 ; CHECK-DAG: .set foo1, bar
8 @foo1 = alias i32, i32* @bar
10 ; CHECK-DAG: .globl foo2
11 ; CHECK-DAG: .set foo2, bar
12 @foo2 = alias i32, i32* @bar
20 ; CHECK-DAG: .weak bar_f
21 ; CHECK-DAG: .type bar_f,@function
22 ; CHECK-DAG: .set bar_f, foo_f
23 @bar_f = weak alias %FunTy, %FunTy* @foo_f
25 ; CHECK-DAG: .weak bar_l
26 ; CHECK-DAG: .set bar_l, bar
27 @bar_l = linkonce_odr alias i32, i32* @bar
29 ; CHECK-DAG: .set bar_i, bar
30 @bar_i = internal alias i32, i32* @bar
33 @A = alias i64, bitcast (i32* @bar to i64*)
35 ; CHECK-DAG: .globl bar_h
36 ; CHECK-DAG: .hidden bar_h
37 ; CHECK-DAG: .set bar_h, bar
38 @bar_h = hidden alias i32, i32* @bar
40 ; CHECK-DAG: .globl bar_p
41 ; CHECK-DAG: .protected bar_p
42 ; CHECK-DAG: .set bar_p, bar
43 @bar_p = protected alias i32, i32* @bar
45 ; CHECK-DAG: .set test2, bar+4
46 @test2 = alias i32, getelementptr(i32, i32* @bar, i32 1)
48 ; CHECK-DAG: .set test3, 42
49 @test3 = alias i32, inttoptr(i32 42 to i32*)
51 ; CHECK-DAG: .set test4, bar
52 @test4 = alias i32, inttoptr(i64 ptrtoint (i32* @bar to i64) to i32*)
54 ; CHECK-DAG: .set test5, test2-bar
55 @test5 = alias i32, inttoptr(i32 sub (i32 ptrtoint (i32* @test2 to i32),
56 i32 ptrtoint (i32* @bar to i32)) to i32*)
58 ; CHECK-DAG: .globl test
61 %tmp = load i32, i32* @foo1
62 %tmp1 = load i32, i32* @foo2
63 %tmp0 = load i32, i32* @bar_i
64 %tmp2 = call i32 @foo_f()
65 %tmp3 = add i32 %tmp, %tmp2
66 %tmp4 = call i32 @bar_f()
67 %tmp5 = add i32 %tmp3, %tmp4
68 %tmp6 = add i32 %tmp1, %tmp5
69 %tmp7 = add i32 %tmp6, %tmp0