summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2015-12-21 18:24:35 +0000
committerTeresa Johnson <tejohnson@google.com>2015-12-21 18:24:35 +0000
commit8c9c853ff4829cf9e532278d1a6e11987bcf2dbf (patch)
treef73b287821afba9d7106cf0e9a6c1346b7d5ea26
parent308175c1f17a99b93705ee346036c389f3ff9f56 (diff)
Add testcase for r256161 (PR25907)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256174 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/tools/gold/X86/pr25907.ll28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/tools/gold/X86/pr25907.ll b/test/tools/gold/X86/pr25907.ll
new file mode 100644
index 00000000000..502938cf812
--- /dev/null
+++ b/test/tools/gold/X86/pr25907.ll
@@ -0,0 +1,28 @@
+; RUN: llvm-as %s -o %t.o
+; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \
+; RUN: -shared %t.o -o %t2
+; RUN: llvm-nm %t2 | FileCheck %s
+; CHECK: T main
+
+@main.L = internal unnamed_addr constant [3 x i8*] [i8* blockaddress(@main, %L1), i8* blockaddress(@main, %L2), i8* null], align 16
+
+define i32 @main() #0 {
+entry:
+ br label %L1
+
+L1: ; preds = %entry, %L1
+ %i.0 = phi i32 [ 0, %entry ], [ %inc, %L1 ]
+ %inc = add i32 %i.0, 1
+ %idxprom = zext i32 %i.0 to i64
+ %arrayidx = getelementptr inbounds [3 x i8*], [3 x i8*]* @main.L, i64 0, i64 %idxprom
+ %0 = load i8*, i8** %arrayidx, align 8, !tbaa !1
+ indirectbr i8* %0, [label %L1, label %L2]
+
+L2: ; preds = %L1
+ ret i32 0
+}
+
+!1 = !{!2, !2, i64 0}
+!2 = !{!"any pointer", !3, i64 0}
+!3 = !{!"omnipotent char", !4, i64 0}
+!4 = !{!"Simple C/C++ TBAA"}