blob: 139381215ee80835e145ea31daa5af2db6dab4da [file] [log] [blame]
Anton Korobeynikov8b0a8c82007-04-25 14:27:10 +00001; RUN: llvm-as < %s | llvm-dis > %t1.ll
2; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
3; RUN: diff %t1.ll %t2.ll
4
Rafael Espindolacde25b42013-04-22 14:58:02 +00005@llvm.used = appending global [1 x i8*] [i8* bitcast (i32* @foo1 to i8*)], section "llvm.metadata"
6
Anton Korobeynikov8b0a8c82007-04-25 14:27:10 +00007@bar = external global i32
8@foo1 = alias i32* @bar
9@foo2 = alias i32* @bar
Anton Korobeynikov591858a2008-03-22 08:17:17 +000010@foo3 = alias i32* @foo2
Anton Korobeynikov8b0a8c82007-04-25 14:27:10 +000011
12%FunTy = type i32()
13
14declare i32 @foo_f()
15@bar_f = alias weak %FunTy* @foo_f
Anton Korobeynikov591858a2008-03-22 08:17:17 +000016@bar_ff = alias i32()* @bar_f
Anton Korobeynikov8b0a8c82007-04-25 14:27:10 +000017
18@bar_i = alias internal i32* @bar
19
Anton Korobeynikova80e1182007-04-28 13:45:00 +000020@A = alias bitcast (i32* @bar to i64*)
21
Anton Korobeynikov8b0a8c82007-04-25 14:27:10 +000022define i32 @test() {
23entry:
24 %tmp = load i32* @foo1
25 %tmp1 = load i32* @foo2
26 %tmp0 = load i32* @bar_i
27 %tmp2 = call i32 @foo_f()
28 %tmp3 = add i32 %tmp, %tmp2
29 %tmp4 = call %FunTy* @bar_f()
30 %tmp5 = add i32 %tmp3, %tmp4
31 %tmp6 = add i32 %tmp1, %tmp5
32 %tmp7 = add i32 %tmp6, %tmp0
33 ret i32 %tmp7
34}