summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2016-08-18 02:21:54 +0000
committerMatthias Braun <matze@braunis.de>2016-08-18 02:21:54 +0000
commitc9130ea6a3658901510fcf8194e935b4571842e2 (patch)
treee0b392f2ade4f738ed37e5981b00a98df5df6c6f /llvm/test
parent68f8cbd597d886f116a773ee0c2f56e26d4135ed (diff)
downloadbcm5719-llvm-c9130ea6a3658901510fcf8194e935b4571842e2.tar.gz
bcm5719-llvm-c9130ea6a3658901510fcf8194e935b4571842e2.zip
Testcase for r279022
llvm-svn: 279031
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/X86/taildup-crash.ll24
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/taildup-crash.ll b/llvm/test/CodeGen/X86/taildup-crash.ll
new file mode 100644
index 00000000000..aeee114adb5
--- /dev/null
+++ b/llvm/test/CodeGen/X86/taildup-crash.ll
@@ -0,0 +1,24 @@
+; RUN: llc -o - %s | FileCheck %s
+target triple = "x86_64--"
+
+; Make sure we do not crash in tail duplication when finding no successor of a
+; block.
+; CHECK-LABEL: func:
+; CHECK: testb
+; CEHCK: je
+; CHECK: retq
+; CHECK: jmp
+define hidden void @func() {
+entry:
+ br i1 undef, label %for.cond.cleanup, label %while.cond.preheader
+
+while.cond.preheader:
+ br label %while.cond
+
+for.cond.cleanup:
+ ret void
+
+while.cond:
+ %cmp.i202 = icmp eq i8* undef, undef
+ br i1 %cmp.i202, label %while.cond.preheader, label %while.cond
+}
OpenPOWER on IntegriCloud