aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/CodeGen/X86/taildup-crash.ll
blob: 495644cf1fc6ace3f01af5fe93d9562f3e7ea86c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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
; CHECK: je
; CHECK: retq
; CHECK: jmp
define hidden void @func(i1 %arg) {
entry:
  br i1 %arg, 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 ptr undef, undef
  br i1 %cmp.i202, label %while.cond.preheader, label %while.cond
}