From 55e3136679754796a686cf30f182f2bff2ad2d59 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Thu, 18 Aug 2016 02:21:54 +0000 Subject: [PATCH] Testcase for r279022 llvm-svn: 279031 --- test/CodeGen/X86/taildup-crash.ll | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 test/CodeGen/X86/taildup-crash.ll diff --git a/test/CodeGen/X86/taildup-crash.ll b/test/CodeGen/X86/taildup-crash.ll new file mode 100644 index 00000000000..aeee114adb5 --- /dev/null +++ b/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 +}