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, ptr @bar
10 ; CHECK-DAG: .globl foo2
11 ; CHECK-DAG: .set foo2, bar
12 @foo2 = alias i32, ptr @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, ptr @foo_f
25 ; CHECK-DAG: .weak bar_l
26 ; CHECK-DAG: .set bar_l, bar
27 @bar_l = linkonce_odr alias i32, ptr @bar
29 ; CHECK-DAG: .set bar_i, bar
30 @bar_i = internal alias i32, ptr @bar
33 @A = alias i64, ptr @bar
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, ptr @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, ptr @bar
45 ; CHECK-DAG: .set test2, bar+4
46 @test2 = alias i32, getelementptr(i32, ptr @bar, i32 1)
48 ; CHECK-DAG: .set test3, 42
49 @test3 = alias i32, inttoptr(i32 42 to ptr)
51 ; CHECK-DAG: .set test4, bar
52 @test4 = alias i32, inttoptr(i64 ptrtoint (ptr @bar to i64) to ptr)
54 ; CHECK-DAG: .set test5, test2-bar
55 @test5 = alias i32, inttoptr(i32 sub (i32 ptrtoint (ptr @test2 to i32),
56 i32 ptrtoint (ptr @bar to i32)) to ptr)
58 ; CHECK-DAG: .globl test
61 %tmp = load i32, ptr @foo1
62 %tmp1 = load i32, ptr @foo2
63 %tmp0 = load i32, ptr @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