unreachableblockelim.ll 453 Bytes
Newer Older
1
2
3
4
5
6
7
8
; RUN: opt -S < %s -unreachableblockelim | FileCheck %s

target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

declare void @abort()

; CHECK-LABEL: @foo(
Benjamin Kramer's avatar
Benjamin Kramer committed
9
; CHECK-NOT: return:
10
11
12
13
14
15
16
17
18
19
20
define void @foo(i32* %p) {
entry:
  %p.addr = alloca i32*, align 8
  call void @abort()
  unreachable

return:                                           ; No predecessors!
  store i32* %p, i32** %p.addr, align 8
  ret void
}