Add testcase for r256161 (PR25907)
[oota-llvm.git] / test / tools / gold / X86 / pr25907.ll
1 ; RUN: llvm-as %s -o %t.o
2 ; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \
3 ; RUN:    -shared %t.o -o %t2
4 ; RUN: llvm-nm %t2 | FileCheck %s
5 ; CHECK: T main
6
7 @main.L = internal unnamed_addr constant [3 x i8*] [i8* blockaddress(@main, %L1), i8* blockaddress(@main, %L2), i8* null], align 16
8
9 define i32 @main() #0 {
10 entry:
11   br label %L1
12
13 L1:                                               ; preds = %entry, %L1
14   %i.0 = phi i32 [ 0, %entry ], [ %inc, %L1 ]
15   %inc = add i32 %i.0, 1
16   %idxprom = zext i32 %i.0 to i64
17   %arrayidx = getelementptr inbounds [3 x i8*], [3 x i8*]* @main.L, i64 0, i64 %idxprom
18   %0 = load i8*, i8** %arrayidx, align 8, !tbaa !1
19   indirectbr i8* %0, [label %L1, label %L2]
20
21 L2:                                               ; preds = %L1
22   ret i32 0
23 }
24
25 !1 = !{!2, !2, i64 0}
26 !2 = !{!"any pointer", !3, i64 0}
27 !3 = !{!"omnipotent char", !4, i64 0}
28 !4 = !{!"Simple C/C++ TBAA"}