summaryrefslogtreecommitdiffstats
path: root/test/CodeGen/Generic
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/Generic')
-rw-r--r--test/CodeGen/Generic/2006-09-02-LocalAllocCrash.ll2
-rw-r--r--test/CodeGen/Generic/2009-06-03-UnreachableSplitPad.ll19
-rw-r--r--test/CodeGen/Generic/2012-06-08-APIntCrash.ll9
-rw-r--r--test/CodeGen/Generic/2012-07-15-BuildVectorPromote.ll8
-rw-r--r--test/CodeGen/Generic/asm-large-immediate.ll6
-rw-r--r--test/CodeGen/Generic/donothing.ll31
-rw-r--r--test/CodeGen/Generic/edge-bundles-blockIDs.ll2
-rw-r--r--test/CodeGen/Generic/print-after.ll6
-rw-r--r--test/CodeGen/Generic/print-machineinstrs.ll14
-rw-r--r--test/CodeGen/Generic/stop-after.ll10
-rw-r--r--test/CodeGen/Generic/undef-phi.ll26
11 files changed, 110 insertions, 23 deletions
diff --git a/test/CodeGen/Generic/2006-09-02-LocalAllocCrash.ll b/test/CodeGen/Generic/2006-09-02-LocalAllocCrash.ll
index 928edc4..2dc5c16 100644
--- a/test/CodeGen/Generic/2006-09-02-LocalAllocCrash.ll
+++ b/test/CodeGen/Generic/2006-09-02-LocalAllocCrash.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -regalloc=fast
+; RUN: llc < %s -regalloc=fast -optimize-regalloc=0
%struct.CHESS_POSITION = type { i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i32, i32, i8, i8, [64 x i8], i8, i8, i8, i8, i8 }
@search = external global %struct.CHESS_POSITION ; <%struct.CHESS_POSITION*> [#uses=2]
diff --git a/test/CodeGen/Generic/2009-06-03-UnreachableSplitPad.ll b/test/CodeGen/Generic/2009-06-03-UnreachableSplitPad.ll
deleted file mode 100644
index ad418f7..0000000
--- a/test/CodeGen/Generic/2009-06-03-UnreachableSplitPad.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llc < %s
-; PR4317
-
-declare i32 @b()
-
-define void @a() {
-entry:
- ret void
-
-dummy:
- invoke i32 @b() to label %reg unwind label %reg
-
-reg:
- %lpad = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
- catch i8* null
- ret void
-}
-
-declare i32 @__gxx_personality_v0(...)
diff --git a/test/CodeGen/Generic/2012-06-08-APIntCrash.ll b/test/CodeGen/Generic/2012-06-08-APIntCrash.ll
new file mode 100644
index 0000000..2c096bf
--- /dev/null
+++ b/test/CodeGen/Generic/2012-06-08-APIntCrash.ll
@@ -0,0 +1,9 @@
+; RUN: llc < %s
+
+define void @test1(<8 x i32>* %ptr)
+{
+ %1 = load <8 x i32>* %ptr, align 32
+ %2 = and <8 x i32> %1, <i32 0, i32 0, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 -1>
+ store <8 x i32> %2, <8 x i32>* %ptr, align 16
+ ret void
+}
diff --git a/test/CodeGen/Generic/2012-07-15-BuildVectorPromote.ll b/test/CodeGen/Generic/2012-07-15-BuildVectorPromote.ll
new file mode 100644
index 0000000..6591c64
--- /dev/null
+++ b/test/CodeGen/Generic/2012-07-15-BuildVectorPromote.ll
@@ -0,0 +1,8 @@
+; RUN: llc -mcpu=corei7 < %s
+; We don't care about the output, just that it doesn't crash
+
+define <1 x i1> @buildvec_promote() {
+ %cmp = icmp ule <1 x i32> undef, undef
+ %sel = select i1 undef, <1 x i1> undef, <1 x i1> %cmp
+ ret <1 x i1> %sel
+}
diff --git a/test/CodeGen/Generic/asm-large-immediate.ll b/test/CodeGen/Generic/asm-large-immediate.ll
index 605665b..891bbc9 100644
--- a/test/CodeGen/Generic/asm-large-immediate.ll
+++ b/test/CodeGen/Generic/asm-large-immediate.ll
@@ -1,8 +1,10 @@
-; RUN: llc < %s | grep 68719476738
+; RUN: llc < %s | FileCheck %s
define void @test() {
entry:
+; CHECK: /* result: 68719476738 */
tail call void asm sideeffect "/* result: ${0:c} */", "i,~{dirflag},~{fpsr},~{flags}"( i64 68719476738 )
+; CHECK: /* result: -68719476738 */
+ tail call void asm sideeffect "/* result: ${0:n} */", "i,~{dirflag},~{fpsr},~{flags}"( i64 68719476738 )
ret void
}
-
diff --git a/test/CodeGen/Generic/donothing.ll b/test/CodeGen/Generic/donothing.ll
new file mode 100644
index 0000000..d6ba138
--- /dev/null
+++ b/test/CodeGen/Generic/donothing.ll
@@ -0,0 +1,31 @@
+; RUN: llc < %s | FileCheck %s
+
+declare i32 @__gxx_personality_v0(...)
+declare void @__cxa_call_unexpected(i8*)
+declare void @llvm.donothing() readnone
+
+; CHECK: f1
+define void @f1() nounwind uwtable ssp {
+entry:
+; CHECK-NOT donothing
+ invoke void @llvm.donothing()
+ to label %invoke.cont unwind label %lpad
+
+invoke.cont:
+ ret void
+
+lpad:
+ %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ filter [0 x i8*] zeroinitializer
+ %1 = extractvalue { i8*, i32 } %0, 0
+ tail call void @__cxa_call_unexpected(i8* %1) noreturn nounwind
+ unreachable
+}
+
+; CHECK: f2
+define void @f2() nounwind {
+entry:
+; CHECK-NOT donothing
+ call void @llvm.donothing()
+ ret void
+}
diff --git a/test/CodeGen/Generic/edge-bundles-blockIDs.ll b/test/CodeGen/Generic/edge-bundles-blockIDs.ll
index b4ae415..d86c758 100644
--- a/test/CodeGen/Generic/edge-bundles-blockIDs.ll
+++ b/test/CodeGen/Generic/edge-bundles-blockIDs.ll
@@ -1,6 +1,6 @@
; Make sure EdgeBoundles handles the case when the function size is less then
; the number of block IDs.
-; RUN: llc -regalloc=fast < %s
+; RUN: llc -regalloc=fast -optimize-regalloc=0 < %s
define void @foo() nounwind {
entry:
diff --git a/test/CodeGen/Generic/print-after.ll b/test/CodeGen/Generic/print-after.ll
new file mode 100644
index 0000000..7505907
--- /dev/null
+++ b/test/CodeGen/Generic/print-after.ll
@@ -0,0 +1,6 @@
+; RUN: not llc --help-hidden 2>&1 | FileCheck %s
+
+; CHECK: -print-after
+; CHECK-NOT: -print-after-all
+; CHECK: =simple-register-coalescing
+; CHECK: -print-after-all
diff --git a/test/CodeGen/Generic/print-machineinstrs.ll b/test/CodeGen/Generic/print-machineinstrs.ll
new file mode 100644
index 0000000..75dceb5
--- /dev/null
+++ b/test/CodeGen/Generic/print-machineinstrs.ll
@@ -0,0 +1,14 @@
+; RUN: llc < %s -O3 -debug-pass=Structure -print-machineinstrs=branch-folder -o /dev/null 2>&1 | FileCheck %s
+; RUN: llc < %s -O3 -debug-pass=Structure -print-machineinstrs -o /dev/null 2>&1 | FileCheck %s
+; RUN: llc < %s -O3 -debug-pass=Structure -print-machineinstrs= -o /dev/null 2>&1 | FileCheck %s
+
+define i64 @foo(i64 %a, i64 %b) nounwind {
+; CHECK: -branch-folder -print-machineinstrs
+; CHECK: Control Flow Optimizer
+; CHECK-NEXT: MachineFunction Printer
+; CHECK: Machine code for function foo:
+ %c = add i64 %a, %b
+ %d = trunc i64 %c to i32
+ %e = zext i32 %d to i64
+ ret i64 %e
+}
diff --git a/test/CodeGen/Generic/stop-after.ll b/test/CodeGen/Generic/stop-after.ll
new file mode 100644
index 0000000..557e097
--- /dev/null
+++ b/test/CodeGen/Generic/stop-after.ll
@@ -0,0 +1,10 @@
+; RUN: llc < %s -debug-pass=Structure -stop-after=loop-reduce -o /dev/null 2>&1 | FileCheck %s -check-prefix=STOP
+; RUN: llc < %s -debug-pass=Structure -start-after=loop-reduce -o /dev/null 2>&1 | FileCheck %s -check-prefix=START
+
+; STOP: -loop-reduce -print-module
+; STOP: Loop Strength Reduction
+; STOP-NEXT: Machine Function Analysis
+
+; START: -machine-branch-prob -gc-lowering
+; START: FunctionPass Manager
+; START-NEXT: Lower Garbage Collection Instructions
diff --git a/test/CodeGen/Generic/undef-phi.ll b/test/CodeGen/Generic/undef-phi.ll
new file mode 100644
index 0000000..10899f9
--- /dev/null
+++ b/test/CodeGen/Generic/undef-phi.ll
@@ -0,0 +1,26 @@
+; RUN: llc < %s -verify-machineinstrs -verify-coalescing
+;
+; This function has a PHI with one undefined input. Verify that PHIElimination
+; inserts an IMPLICIT_DEF instruction in the predecessor so all paths to the use
+; pass through a def.
+
+%struct.xx_stack = type { i32, %struct.xx_stack* }
+
+define i32 @push(%struct.xx_stack* %stack) nounwind uwtable readonly ssp {
+entry:
+ %tobool1 = icmp eq %struct.xx_stack* %stack, null
+ br i1 %tobool1, label %for.end, label %for.body
+
+for.body:
+ %stack.addr.02 = phi %struct.xx_stack* [ %0, %for.body ], [ %stack, %entry ]
+ %next = getelementptr inbounds %struct.xx_stack* %stack.addr.02, i64 0, i32 1
+ %0 = load %struct.xx_stack** %next, align 8
+ %tobool = icmp eq %struct.xx_stack* %0, null
+ br i1 %tobool, label %for.end, label %for.body
+
+for.end:
+ %top.0.lcssa = phi %struct.xx_stack* [ undef, %entry ], [ %stack.addr.02, %for.body ]
+ %first = getelementptr inbounds %struct.xx_stack* %top.0.lcssa, i64 0, i32 0
+ %1 = load i32* %first, align 4
+ ret i32 %1
+}
OpenPOWER on IntegriCloud