xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/unreachableblockelim.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: opt -S < %s -unreachableblockelim | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker; RUN: opt -S < %s -passes=unreachableblockelim | FileCheck %s
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Workertarget datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
5*9880d681SAndroid Build Coastguard Workertarget triple = "x86_64-unknown-linux-gnu"
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Workerdeclare void @abort()
8*9880d681SAndroid Build Coastguard Worker
9*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: @foo(
10*9880d681SAndroid Build Coastguard Worker; CHECK-NOT return:
11*9880d681SAndroid Build Coastguard Workerdefine void @foo(i32* %p) {
12*9880d681SAndroid Build Coastguard Workerentry:
13*9880d681SAndroid Build Coastguard Worker  %p.addr = alloca i32*, align 8
14*9880d681SAndroid Build Coastguard Worker  call void @abort()
15*9880d681SAndroid Build Coastguard Worker  unreachable
16*9880d681SAndroid Build Coastguard Worker
17*9880d681SAndroid Build Coastguard Workerreturn:                                           ; No predecessors!
18*9880d681SAndroid Build Coastguard Worker  store i32* %p, i32** %p.addr, align 8
19*9880d681SAndroid Build Coastguard Worker  ret void
20*9880d681SAndroid Build Coastguard Worker}
21*9880d681SAndroid Build Coastguard Worker
22