summaryrefslogtreecommitdiffstats
path: root/test/Other
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2009-06-02 17:52:33 +0000
committered <ed@FreeBSD.org>2009-06-02 17:52:33 +0000
commit3277b69d734b9c90b44ebde4ede005717e2c3b2e (patch)
tree64ba909838c23261cace781ece27d106134ea451 /test/Other
downloadFreeBSD-src-3277b69d734b9c90b44ebde4ede005717e2c3b2e.zip
FreeBSD-src-3277b69d734b9c90b44ebde4ede005717e2c3b2e.tar.gz
Import LLVM, at r72732.
Diffstat (limited to 'test/Other')
-rw-r--r--test/Other/2002-01-31-CallGraph.ll13
-rw-r--r--test/Other/2002-02-24-InlineBrokePHINodes.ll23
-rw-r--r--test/Other/2002-03-11-ConstPropCrash.ll24
-rw-r--r--test/Other/2003-02-19-LoopInfoNestingBug.ll29
-rw-r--r--test/Other/2004-08-16-PackedConstantInlineStore.ll8
-rw-r--r--test/Other/2004-08-16-PackedGlobalConstant.ll11
-rw-r--r--test/Other/2004-08-16-PackedSelect.ll13
-rw-r--r--test/Other/2004-08-16-PackedSimple.ll13
-rw-r--r--test/Other/2004-08-20-PackedControlFlow.ll22
-rw-r--r--test/Other/2006-02-05-PassManager.ll5
-rw-r--r--test/Other/2007-04-24-eliminate-mostly-empty-blocks.ll309
-rw-r--r--test/Other/2007-06-05-PassID.ll11
-rw-r--r--test/Other/2007-06-28-PassManager.ll7
-rw-r--r--test/Other/2007-09-10-PassManager.ll32
-rw-r--r--test/Other/2008-02-14-PassManager.ll5
-rw-r--r--test/Other/2008-03-19-PassManager.ll58
-rw-r--r--test/Other/2008-06-04-FieldSizeInPacked.ll14
-rw-r--r--test/Other/2008-08-14-PassManager.ll5
-rw-r--r--test/Other/2008-10-06-RemoveDeadPass.ll11
-rw-r--r--test/Other/2008-10-15-MissingSpace.ll7
-rw-r--r--test/Other/2009-03-31-CallGraph.ll31
-rw-r--r--test/Other/dg.exp3
-rw-r--r--test/Other/invalid-commandline-option.ll3
23 files changed, 657 insertions, 0 deletions
diff --git a/test/Other/2002-01-31-CallGraph.ll b/test/Other/2002-01-31-CallGraph.ll
new file mode 100644
index 0000000..bb4c23e
--- /dev/null
+++ b/test/Other/2002-01-31-CallGraph.ll
@@ -0,0 +1,13 @@
+; Call graph construction crash: Not handling indirect calls right
+;
+; RUN: llvm-as < %s | opt -analyze -print-callgraph >& /dev/null
+;
+
+ %FunTy = type i32 (i32)
+
+define void @invoke(%FunTy* %x) {
+ %foo = call i32 %x( i32 123 ) ; <i32> [#uses=0]
+ ret void
+}
+
+
diff --git a/test/Other/2002-02-24-InlineBrokePHINodes.ll b/test/Other/2002-02-24-InlineBrokePHINodes.ll
new file mode 100644
index 0000000..cbb1a89
--- /dev/null
+++ b/test/Other/2002-02-24-InlineBrokePHINodes.ll
@@ -0,0 +1,23 @@
+; Inlining used to break PHI nodes. This tests that they are correctly updated
+; when a node is split around the call instruction. The verifier caught the error.
+;
+; RUN: llvm-as < %s | opt -inline
+;
+
+define i64 @test(i64 %X) {
+ ret i64 %X
+}
+
+define i64 @fib(i64 %n) {
+; <label>:0
+ %T = icmp ult i64 %n, 2 ; <i1> [#uses=1]
+ br i1 %T, label %BaseCase, label %RecurseCase
+
+RecurseCase: ; preds = %0
+ %result = call i64 @test( i64 %n ) ; <i64> [#uses=0]
+ br label %BaseCase
+
+BaseCase: ; preds = %RecurseCase, %0
+ %X = phi i64 [ 1, %0 ], [ 2, %RecurseCase ] ; <i64> [#uses=1]
+ ret i64 %X
+}
diff --git a/test/Other/2002-03-11-ConstPropCrash.ll b/test/Other/2002-03-11-ConstPropCrash.ll
new file mode 100644
index 0000000..90dc002
--- /dev/null
+++ b/test/Other/2002-03-11-ConstPropCrash.ll
@@ -0,0 +1,24 @@
+; When constant propogating terminator instructions, the basic block iterator
+; was not updated to refer to the final position of the new terminator. This
+; can be bad, f.e. because constproping a terminator can lead to the
+; destruction of PHI nodes, which invalidates the iterator!
+;
+; Fixed by adding new arguments to ConstantFoldTerminator
+;
+; RUN: llvm-as < %s | opt -constprop
+
+define void @build_tree(i32 %ml) {
+; <label>:0
+ br label %bb2
+
+bb2: ; preds = %bb2, %0
+ %reg137 = phi i32 [ %reg140, %bb2 ], [ 12, %0 ] ; <i32> [#uses=1]
+ %reg138 = phi i32 [ %reg139, %bb2 ], [ 0, %0 ] ; <i32> [#uses=1]
+ %reg139 = add i32 %reg138, 1 ; <i32> [#uses=1]
+ %reg140 = add i32 %reg137, -1 ; <i32> [#uses=1]
+ br i1 false, label %bb2, label %bb3
+
+bb3: ; preds = %bb2
+ ret void
+}
+
diff --git a/test/Other/2003-02-19-LoopInfoNestingBug.ll b/test/Other/2003-02-19-LoopInfoNestingBug.ll
new file mode 100644
index 0000000..d294553
--- /dev/null
+++ b/test/Other/2003-02-19-LoopInfoNestingBug.ll
@@ -0,0 +1,29 @@
+; LoopInfo is incorrectly calculating loop nesting! In this case it doesn't
+; figure out that loop "Inner" should be nested inside of leep "LoopHeader",
+; and instead nests it just inside loop "Top"
+;
+; RUN: llvm-as < %s | opt -analyze -loops | \
+; RUN: grep { Loop at depth 3 containing: %Inner<header><latch><exit>}
+;
+define void @test() {
+ br label %Top
+
+Top: ; preds = %Out, %0
+ br label %LoopHeader
+
+Next: ; preds = %LoopHeader
+ br i1 false, label %Inner, label %Out
+
+Inner: ; preds = %Inner, %Next
+ br i1 false, label %Inner, label %LoopHeader
+
+LoopHeader: ; preds = %Inner, %Top
+ br label %Next
+
+Out: ; preds = %Next
+ br i1 false, label %Top, label %Done
+
+Done: ; preds = %Out
+ ret void
+}
+
diff --git a/test/Other/2004-08-16-PackedConstantInlineStore.ll b/test/Other/2004-08-16-PackedConstantInlineStore.ll
new file mode 100644
index 0000000..36ac4fd
--- /dev/null
+++ b/test/Other/2004-08-16-PackedConstantInlineStore.ll
@@ -0,0 +1,8 @@
+; RUN: llvm-as < %s | llvm-dis
+@bar = external global <2 x i32> ; <<2 x i32>*> [#uses=1]
+
+define void @main() {
+ store <2 x i32> < i32 0, i32 1 >, <2 x i32>* @bar
+ ret void
+}
+
diff --git a/test/Other/2004-08-16-PackedGlobalConstant.ll b/test/Other/2004-08-16-PackedGlobalConstant.ll
new file mode 100644
index 0000000..9130ccb
--- /dev/null
+++ b/test/Other/2004-08-16-PackedGlobalConstant.ll
@@ -0,0 +1,11 @@
+; RUN: llvm-as < %s | llvm-dis
+
+@foo = global <2 x i32> < i32 0, i32 1 > ; <<2 x i32>*> [#uses=1]
+@bar = external global <2 x i32> ; <<2 x i32>*> [#uses=1]
+
+define void @main() {
+ %t0 = load <2 x i32>* @foo ; <<2 x i32>> [#uses=1]
+ store <2 x i32> %t0, <2 x i32>* @bar
+ ret void
+}
+
diff --git a/test/Other/2004-08-16-PackedSelect.ll b/test/Other/2004-08-16-PackedSelect.ll
new file mode 100644
index 0000000..6438316
--- /dev/null
+++ b/test/Other/2004-08-16-PackedSelect.ll
@@ -0,0 +1,13 @@
+; RUN: llvm-as < %s | llvm-dis
+
+@foo = external global <4 x float> ; <<4 x float>*> [#uses=1]
+@bar = external global <4 x float> ; <<4 x float>*> [#uses=1]
+
+define void @main() {
+ %t0 = load <4 x float>* @foo ; <<4 x float>> [#uses=3]
+ %t1 = add <4 x float> %t0, %t0 ; <<4 x float>> [#uses=1]
+ %t2 = select i1 true, <4 x float> %t0, <4 x float> %t1 ; <<4 x float>> [#uses=1]
+ store <4 x float> %t2, <4 x float>* @bar
+ ret void
+}
+
diff --git a/test/Other/2004-08-16-PackedSimple.ll b/test/Other/2004-08-16-PackedSimple.ll
new file mode 100644
index 0000000..5bb8b79
--- /dev/null
+++ b/test/Other/2004-08-16-PackedSimple.ll
@@ -0,0 +1,13 @@
+; RUN: llvm-as < %s | llvm-dis
+
+@foo = external global <4 x float> ; <<4 x float>*> [#uses=1]
+@bar = external global <4 x float> ; <<4 x float>*> [#uses=1]
+
+define void @main() {
+ %t0 = load <4 x float>* @foo ; <<4 x float>> [#uses=3]
+ %t2 = add <4 x float> %t0, %t0 ; <<4 x float>> [#uses=1]
+ %t3 = select i1 false, <4 x float> %t0, <4 x float> %t2 ; <<4 x float>> [#uses=1]
+ store <4 x float> %t3, <4 x float>* @bar
+ ret void
+}
+
diff --git a/test/Other/2004-08-20-PackedControlFlow.ll b/test/Other/2004-08-20-PackedControlFlow.ll
new file mode 100644
index 0000000..49aa606
--- /dev/null
+++ b/test/Other/2004-08-20-PackedControlFlow.ll
@@ -0,0 +1,22 @@
+; RUN: llvm-as < %s | llvm-dis | llvm-as > /dev/null
+
+ %v4f = type <4 x float>
+@foo = external global %v4f ; <%v4f*> [#uses=1]
+@bar = external global %v4f ; <%v4f*> [#uses=1]
+
+define void @main() {
+ br label %A
+
+C: ; preds = %B
+ store %v4f %t2, %v4f* @bar
+ ret void
+
+B: ; preds = %A
+ %t2 = add %v4f %t0, %t0 ; <%v4f> [#uses=1]
+ br label %C
+
+A: ; preds = %0
+ %t0 = load %v4f* @foo ; <%v4f> [#uses=2]
+ br label %B
+}
+
diff --git a/test/Other/2006-02-05-PassManager.ll b/test/Other/2006-02-05-PassManager.ll
new file mode 100644
index 0000000..c5f50ec
--- /dev/null
+++ b/test/Other/2006-02-05-PassManager.ll
@@ -0,0 +1,5 @@
+; RUN: llvm-as < %s | opt -domtree -gvn -domtree -constmerge -disable-output
+
+define i32 @test1() {
+ unreachable
+}
diff --git a/test/Other/2007-04-24-eliminate-mostly-empty-blocks.ll b/test/Other/2007-04-24-eliminate-mostly-empty-blocks.ll
new file mode 100644
index 0000000..4ffcf96
--- /dev/null
+++ b/test/Other/2007-04-24-eliminate-mostly-empty-blocks.ll
@@ -0,0 +1,309 @@
+;RUN: llvm-as < %s | opt -codegenprepare -disable-output
+
+define void @foo() {
+entry:
+ br i1 false, label %cond_next31, label %cond_true
+
+cond_true: ; preds = %entry
+ br i1 false, label %cond_true19, label %cond_next31
+
+cond_true19: ; preds = %cond_true
+ br i1 false, label %bb510, label %cond_next31
+
+cond_next31: ; preds = %cond_true19, %cond_true, %entry
+ br i1 false, label %cond_true61, label %cond_next78
+
+cond_true61: ; preds = %cond_next31
+ br label %cond_next78
+
+cond_next78: ; preds = %cond_true61, %cond_next31
+ br i1 false, label %cond_true93, label %bb.preheader
+
+cond_true93: ; preds = %cond_next78
+ br label %bb.preheader
+
+bb.preheader: ; preds = %cond_true93, %cond_next78
+ %iftmp.11.0.ph.ph = phi i16 [ 0, %cond_true93 ], [ 0, %cond_next78 ] ; <i16> [#uses=1]
+ br label %bb
+
+bb: ; preds = %cond_next499, %bb.preheader
+ %n.1 = phi i16 [ %iftmp.11.0.ph.ph, %cond_next499 ], [ 0, %bb.preheader ] ; <i16> [#uses=0]
+ br i1 false, label %bb148.preheader, label %bb493
+
+bb148.preheader: ; preds = %bb
+ br label %bb148
+
+bb148: ; preds = %cond_next475, %bb148.preheader
+ br i1 false, label %cond_next175, label %bb184
+
+cond_next175: ; preds = %bb148
+ br i1 false, label %bb184, label %bb185
+
+bb184: ; preds = %cond_next175, %bb148
+ br label %bb185
+
+bb185: ; preds = %bb184, %cond_next175
+ br i1 false, label %bb420.preheader, label %cond_true198
+
+bb420.preheader: ; preds = %bb185
+ br label %bb420
+
+cond_true198: ; preds = %bb185
+ br i1 false, label %bb294, label %cond_next208
+
+cond_next208: ; preds = %cond_true198
+ br i1 false, label %cond_next249, label %cond_true214
+
+cond_true214: ; preds = %cond_next208
+ br i1 false, label %bb294, label %cond_next262
+
+cond_next249: ; preds = %cond_next208
+ br i1 false, label %bb294, label %cond_next262
+
+cond_next262: ; preds = %cond_next249, %cond_true214
+ br label %bb269
+
+bb269: ; preds = %cond_next285, %cond_next262
+ br i1 false, label %cond_next285, label %cond_true279
+
+cond_true279: ; preds = %bb269
+ br label %cond_next285
+
+cond_next285: ; preds = %cond_true279, %bb269
+ br i1 false, label %bb269, label %cond_next446.loopexit
+
+bb294: ; preds = %cond_next249, %cond_true214, %cond_true198
+ br i1 false, label %cond_next336, label %cond_true301
+
+cond_true301: ; preds = %bb294
+ br i1 false, label %cond_false398, label %cond_true344
+
+cond_next336: ; preds = %bb294
+ br i1 false, label %cond_false398, label %cond_true344
+
+cond_true344: ; preds = %cond_next336, %cond_true301
+ br i1 false, label %cond_false381, label %cond_true351
+
+cond_true351: ; preds = %cond_true344
+ br label %cond_next387
+
+cond_false381: ; preds = %cond_true344
+ br label %cond_next387
+
+cond_next387: ; preds = %cond_false381, %cond_true351
+ br label %cond_next401
+
+cond_false398: ; preds = %cond_next336, %cond_true301
+ br label %cond_next401
+
+cond_next401: ; preds = %cond_false398, %cond_next387
+ br i1 false, label %cond_next475, label %cond_true453
+
+bb420: ; preds = %cond_next434, %bb420.preheader
+ br i1 false, label %cond_next434, label %cond_true428
+
+cond_true428: ; preds = %bb420
+ br label %cond_next434
+
+cond_next434: ; preds = %cond_true428, %bb420
+ br i1 false, label %bb420, label %cond_next446.loopexit1
+
+cond_next446.loopexit: ; preds = %cond_next285
+ br label %cond_next446
+
+cond_next446.loopexit1: ; preds = %cond_next434
+ br label %cond_next446
+
+cond_next446: ; preds = %cond_next446.loopexit1, %cond_next446.loopexit
+ br i1 false, label %cond_next475, label %cond_true453
+
+cond_true453: ; preds = %cond_next446, %cond_next401
+ br i1 false, label %cond_true458, label %cond_next475
+
+cond_true458: ; preds = %cond_true453
+ br label %cond_next475
+
+cond_next475: ; preds = %cond_true458, %cond_true453, %cond_next446, %cond_next401
+ br i1 false, label %bb493.loopexit, label %bb148
+
+bb493.loopexit: ; preds = %cond_next475
+ br label %bb493
+
+bb493: ; preds = %bb493.loopexit, %bb
+ br i1 false, label %cond_next499, label %bb510.loopexit
+
+cond_next499: ; preds = %bb493
+ br label %bb
+
+bb510.loopexit: ; preds = %bb493
+ br label %bb510
+
+bb510: ; preds = %bb510.loopexit, %cond_true19
+ br i1 false, label %cond_next524, label %cond_true517
+
+cond_true517: ; preds = %bb510
+ br label %cond_next524
+
+cond_next524: ; preds = %cond_true517, %bb510
+ br i1 false, label %cond_next540, label %cond_true533
+
+cond_true533: ; preds = %cond_next524
+ br label %cond_next540
+
+cond_next540: ; preds = %cond_true533, %cond_next524
+ br i1 false, label %cond_true554, label %cond_next560
+
+cond_true554: ; preds = %cond_next540
+ br label %cond_next560
+
+cond_next560: ; preds = %cond_true554, %cond_next540
+ br i1 false, label %cond_true566, label %cond_next572
+
+cond_true566: ; preds = %cond_next560
+ br label %cond_next572
+
+cond_next572: ; preds = %cond_true566, %cond_next560
+ br i1 false, label %bb608.preheader, label %bb791.preheader
+
+bb608.preheader: ; preds = %cond_next797.us, %cond_next572
+ br label %bb608
+
+bb608: ; preds = %cond_next771, %bb608.preheader
+ br i1 false, label %cond_false627, label %cond_true613
+
+cond_true613: ; preds = %bb608
+ br label %cond_next640
+
+cond_false627: ; preds = %bb608
+ br label %cond_next640
+
+cond_next640: ; preds = %cond_false627, %cond_true613
+ br i1 false, label %cond_true653, label %cond_next671
+
+cond_true653: ; preds = %cond_next640
+ br label %cond_next671
+
+cond_next671: ; preds = %cond_true653, %cond_next640
+ br i1 false, label %cond_true683, label %cond_next724
+
+cond_true683: ; preds = %cond_next671
+ br i1 false, label %cond_next724, label %L1
+
+cond_next724: ; preds = %cond_true683, %cond_next671
+ br i1 false, label %cond_true735, label %L1
+
+cond_true735: ; preds = %cond_next724
+ br label %L1
+
+L1: ; preds = %cond_true735, %cond_next724, %cond_true683
+ br i1 false, label %cond_true745, label %cond_next771
+
+cond_true745: ; preds = %L1
+ br label %cond_next771
+
+cond_next771: ; preds = %cond_true745, %L1
+ br i1 false, label %bb608, label %bb791.preheader.loopexit
+
+bb791.preheader.loopexit: ; preds = %cond_next771
+ br label %bb791.preheader
+
+bb791.preheader: ; preds = %bb791.preheader.loopexit, %cond_next572
+ br i1 false, label %cond_next797.us, label %bb809.split
+
+cond_next797.us: ; preds = %bb791.preheader
+ br label %bb608.preheader
+
+bb809.split: ; preds = %bb791.preheader
+ br i1 false, label %cond_next827, label %cond_true820
+
+cond_true820: ; preds = %bb809.split
+ br label %cond_next827
+
+cond_next827: ; preds = %cond_true820, %bb809.split
+ br i1 false, label %cond_true833, label %cond_next840
+
+cond_true833: ; preds = %cond_next827
+ br label %cond_next840
+
+cond_next840: ; preds = %cond_true833, %cond_next827
+ br i1 false, label %bb866, label %bb1245
+
+bb866: ; preds = %bb1239, %cond_next840
+ br i1 false, label %cond_true875, label %bb911
+
+cond_true875: ; preds = %bb866
+ br label %cond_next1180
+
+bb911: ; preds = %bb866
+ switch i32 0, label %bb1165 [
+ i32 0, label %bb915
+ i32 1, label %bb932
+ i32 2, label %bb941
+ i32 3, label %bb1029
+ i32 4, label %bb1036
+ i32 5, label %bb1069
+ i32 6, label %L3
+ ]
+
+bb915: ; preds = %cond_next1171, %bb911
+ br i1 false, label %cond_next1171, label %cond_next1180
+
+bb932: ; preds = %cond_next1171, %bb911
+ br label %L1970
+
+bb941: ; preds = %cond_next1171, %bb911
+ br label %L1970
+
+L1970: ; preds = %bb941, %bb932
+ br label %bb1165
+
+bb1029: ; preds = %cond_next1171, %bb911
+ br label %L4
+
+bb1036: ; preds = %cond_next1171, %bb911
+ br label %L4
+
+bb1069: ; preds = %cond_next1171, %bb911
+ br i1 false, label %cond_next1121, label %cond_true1108
+
+L3: ; preds = %cond_next1171, %bb911
+ br i1 false, label %cond_next1121, label %cond_true1108
+
+cond_true1108: ; preds = %L3, %bb1069
+ br label %L4
+
+cond_next1121: ; preds = %L3, %bb1069
+ br label %L4
+
+L4: ; preds = %cond_next1121, %cond_true1108, %bb1036, %bb1029
+ br label %bb1165
+
+bb1165: ; preds = %cond_next1171, %L4, %L1970, %bb911
+ br i1 false, label %cond_next1171, label %cond_next1180
+
+cond_next1171: ; preds = %bb1165, %bb915
+ switch i32 0, label %bb1165 [
+ i32 0, label %bb915
+ i32 1, label %bb932
+ i32 2, label %bb941
+ i32 3, label %bb1029
+ i32 4, label %bb1036
+ i32 5, label %bb1069
+ i32 6, label %L3
+ ]
+
+cond_next1180: ; preds = %bb1165, %bb915, %cond_true875
+ br label %bb1239
+
+bb1239: ; preds = %cond_next1251, %cond_next1180
+ br i1 false, label %bb866, label %bb1245
+
+bb1245: ; preds = %bb1239, %cond_next840
+ br i1 false, label %cond_next1251, label %bb1257
+
+cond_next1251: ; preds = %bb1245
+ br label %bb1239
+
+bb1257: ; preds = %bb1245
+ ret void
+}
diff --git a/test/Other/2007-06-05-PassID.ll b/test/Other/2007-06-05-PassID.ll
new file mode 100644
index 0000000..b6bba36
--- /dev/null
+++ b/test/Other/2007-06-05-PassID.ll
@@ -0,0 +1,11 @@
+;RUN: llvm-as < %s | opt -analyze -dot-cfg-only -disable-output 2>/dev/null
+;PR 1497
+
+define void @foo() {
+entry:
+ br label %return
+
+return: ; preds = %entry
+ ret void
+}
+
diff --git a/test/Other/2007-06-28-PassManager.ll b/test/Other/2007-06-28-PassManager.ll
new file mode 100644
index 0000000..5968d8c
--- /dev/null
+++ b/test/Other/2007-06-28-PassManager.ll
@@ -0,0 +1,7 @@
+; RUN: llvm-as < %s | opt -analyze -inline -disable-output
+; PR 1526
+; RUN: llvm-as < %s | opt -analyze -indvars -disable-output
+; PR 1539
+define i32 @test1() {
+ ret i32 0;
+}
diff --git a/test/Other/2007-09-10-PassManager.ll b/test/Other/2007-09-10-PassManager.ll
new file mode 100644
index 0000000..863be33
--- /dev/null
+++ b/test/Other/2007-09-10-PassManager.ll
@@ -0,0 +1,32 @@
+; RUN: llvm-as < %s | opt -loop-unswitch -indvars -disable-output
+; Require SCEV before LCSSA.
+define void @foo() {
+entry:
+ %i = alloca i32, align 4 ; <i32*> [#uses=5]
+ %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
+ store i32 0, i32* %i, align 4
+ br label %bb3
+
+bb: ; preds = %bb3
+ %tmp = load i32* %i, align 4 ; <i32> [#uses=1]
+ call void @bar( i32 %tmp )
+ %tmp1 = load i32* %i, align 4 ; <i32> [#uses=1]
+ %tmp2 = add i32 %tmp1, 1 ; <i32> [#uses=1]
+ store i32 %tmp2, i32* %i, align 4
+ br label %bb3
+
+bb3: ; preds = %bb, %entry
+ %tmp4 = load i32* %i, align 4 ; <i32> [#uses=1]
+ %tmp5 = icmp sle i32 %tmp4, 9 ; <i1> [#uses=1]
+ %tmp56 = zext i1 %tmp5 to i8 ; <i8> [#uses=1]
+ %toBool = icmp ne i8 %tmp56, 0 ; <i1> [#uses=1]
+ br i1 %toBool, label %bb, label %bb7
+
+bb7: ; preds = %bb3
+ br label %return
+
+return: ; preds = %bb7
+ ret void
+}
+
+declare void @bar(i32)
diff --git a/test/Other/2008-02-14-PassManager.ll b/test/Other/2008-02-14-PassManager.ll
new file mode 100644
index 0000000..985e190
--- /dev/null
+++ b/test/Other/2008-02-14-PassManager.ll
@@ -0,0 +1,5 @@
+; RUN: llvm-as < %s | opt -loop-unroll -loop-rotate -simplifycfg -disable-output
+; PR 2028
+define i32 @test1() {
+ ret i32 0;
+}
diff --git a/test/Other/2008-03-19-PassManager.ll b/test/Other/2008-03-19-PassManager.ll
new file mode 100644
index 0000000..832465c
--- /dev/null
+++ b/test/Other/2008-03-19-PassManager.ll
@@ -0,0 +1,58 @@
+; PR 2034
+; RUN: llvm-as < %s | opt -anders-aa -instcombine -gvn -disable-output
+ %struct.FULL = type { i32, i32, [1000 x float*] }
+
+define i32 @sgesl(%struct.FULL* %a, i32* %ipvt, float* %b, i32 %job) {
+entry:
+ %a_addr = alloca %struct.FULL* ; <%struct.FULL**> [#uses=1]
+ %ipvt_addr = alloca i32* ; <i32**> [#uses=1]
+ %b_addr = alloca float* ; <float**> [#uses=1]
+ %job_addr = alloca i32 ; <i32*> [#uses=1]
+ %akk = alloca float* ; <float**> [#uses=2]
+ %k = alloca i32 ; <i32*> [#uses=1]
+ %l = alloca i32 ; <i32*> [#uses=1]
+ %n = alloca i32 ; <i32*> [#uses=1]
+ %nm1 = alloca i32 ; <i32*> [#uses=1]
+ %tmp5 = load i32* %job_addr, align 4 ; <i32> [#uses=1]
+ %tmp6 = icmp eq i32 %tmp5, 0 ; <i1> [#uses=1]
+ %tmp67 = zext i1 %tmp6 to i8 ; <i8> [#uses=1]
+ %toBool = icmp ne i8 %tmp67, 0 ; <i1> [#uses=1]
+ br i1 %toBool, label %cond_true, label %cond_next137
+
+cond_true: ; preds = %entry
+ %tmp732 = load i32* %nm1, align 4 ; <i32> [#uses=1]
+ %tmp743 = icmp slt i32 0, %tmp732 ; <i1> [#uses=1]
+ %tmp74754 = zext i1 %tmp743 to i8 ; <i8> [#uses=1]
+ %toBool765 = icmp ne i8 %tmp74754, 0 ; <i1> [#uses=1]
+ br i1 %toBool765, label %bb, label %bb77
+
+bb: ; preds = %cond_true
+ %tmp9 = load %struct.FULL** %a_addr, align 4 ; <%struct.FULL*> [#uses=1]
+ %tmp10 = getelementptr %struct.FULL* %tmp9, i32 0, i32 2 ; <[1000 x float*]*> [#uses=1]
+ %tmp11 = getelementptr [1000 x float*]* %tmp10, i32 0, i32 0 ; <float**> [#uses=1]
+ %tmp12 = load float** %tmp11, align 4 ; <float*> [#uses=1]
+ %tmp13 = load i32* %k, align 4 ; <i32> [#uses=1]
+ %tmp14 = getelementptr float* %tmp12, i32 %tmp13 ; <float*> [#uses=1]
+ store float* %tmp14, float** %akk, align 4
+ %tmp17 = load float** %b_addr, align 4 ; <float*> [#uses=0]
+ %tmp18 = load i32* %l, align 4 ; <i32> [#uses=0]
+ ret i32 0
+
+bb77: ; preds = %cond_true
+ ret i32 0
+
+cond_next137: ; preds = %entry
+ %tmp18922 = load i32* %n, align 4 ; <i32> [#uses=1]
+ %tmp19023 = icmp slt i32 0, %tmp18922 ; <i1> [#uses=1]
+ %tmp19019124 = zext i1 %tmp19023 to i8 ; <i8> [#uses=1]
+ %toBool19225 = icmp ne i8 %tmp19019124, 0 ; <i1> [#uses=1]
+ br i1 %toBool19225, label %bb138, label %bb193
+
+bb138: ; preds = %cond_next137
+ store float* null, float** %akk, align 4
+ ret i32 0
+
+bb193: ; preds = %cond_next137
+ %tmp196 = load i32** %ipvt_addr, align 4 ; <i32*> [#uses=0]
+ ret i32 0
+}
diff --git a/test/Other/2008-06-04-FieldSizeInPacked.ll b/test/Other/2008-06-04-FieldSizeInPacked.ll
new file mode 100644
index 0000000..f718dd3
--- /dev/null
+++ b/test/Other/2008-06-04-FieldSizeInPacked.ll
@@ -0,0 +1,14 @@
+; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep true
+
+target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
+target triple = "x86_64-unknown-linux-gnu"
+ %packed = type <{ x86_fp80, i8 }>
+ %unpacked = type { x86_fp80, i8 }
+
+define i1 @q() nounwind {
+entry:
+ %char_p = getelementptr %packed* null, i32 0, i32 1 ; <i8*> [#uses=1]
+ %char_u = getelementptr %unpacked* null, i32 0, i32 1 ; <i8*> [#uses=1]
+ %res = icmp eq i8* %char_p, %char_u ; <i1> [#uses=1]
+ ret i1 %res
+}
diff --git a/test/Other/2008-08-14-PassManager.ll b/test/Other/2008-08-14-PassManager.ll
new file mode 100644
index 0000000..110f3806
--- /dev/null
+++ b/test/Other/2008-08-14-PassManager.ll
@@ -0,0 +1,5 @@
+; RUN: llvm-as < %s | opt -loop-deletion -loop-index-split -disable-output
+; PR 2640
+define i32 @test1() {
+ ret i32 0;
+}
diff --git a/test/Other/2008-10-06-RemoveDeadPass.ll b/test/Other/2008-10-06-RemoveDeadPass.ll
new file mode 100644
index 0000000..a82d1b6
--- /dev/null
+++ b/test/Other/2008-10-06-RemoveDeadPass.ll
@@ -0,0 +1,11 @@
+; RUN: llvm-as < %s | opt -inline -internalize -disable-output
+define void @foo() nounwind {
+ ret void
+}
+
+define void @main(...) nounwind {
+ call void @foo()
+ ret void
+}
+
+
diff --git a/test/Other/2008-10-15-MissingSpace.ll b/test/Other/2008-10-15-MissingSpace.ll
new file mode 100644
index 0000000..a61fa61
--- /dev/null
+++ b/test/Other/2008-10-15-MissingSpace.ll
@@ -0,0 +1,7 @@
+; RUN: llvm-as < %s | llvm-dis | not grep {void@}
+; PR2894
+declare void @g()
+define void @f() {
+ invoke void @g() to label %c unwind label %c
+ c: ret void
+}
diff --git a/test/Other/2009-03-31-CallGraph.ll b/test/Other/2009-03-31-CallGraph.ll
new file mode 100644
index 0000000..43578be
--- /dev/null
+++ b/test/Other/2009-03-31-CallGraph.ll
@@ -0,0 +1,31 @@
+; RUN: llvm-as < %s | opt -inline -prune-eh -disable-output
+define void @f2() {
+ invoke void @f6()
+ to label %ok1 unwind label %lpad1
+
+ok1:
+ ret void
+
+lpad1:
+ invoke void @f4()
+ to label %ok2 unwind label %lpad2
+
+ok2:
+ call void @f8()
+ unreachable
+
+lpad2:
+ unreachable
+}
+
+declare void @f3()
+
+define void @f4() {
+ call void @f3()
+ ret void
+}
+
+declare void @f6() nounwind
+
+declare void @f8()
+
diff --git a/test/Other/dg.exp b/test/Other/dg.exp
new file mode 100644
index 0000000..f200589
--- /dev/null
+++ b/test/Other/dg.exp
@@ -0,0 +1,3 @@
+load_lib llvm.exp
+
+RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]]
diff --git a/test/Other/invalid-commandline-option.ll b/test/Other/invalid-commandline-option.ll
new file mode 100644
index 0000000..60840fa
--- /dev/null
+++ b/test/Other/invalid-commandline-option.ll
@@ -0,0 +1,3 @@
+; RUN: not opt --foo |& grep {Unknown command line argument}
+
+; there is no --foo
OpenPOWER on IntegriCloud