xref: /aosp_15_r20/external/llvm/test/Transforms/InstCombine/cast-call-combine.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -always-inline -instcombine -S | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Workerdefine internal void @foo(i16*) alwaysinline {
4*9880d681SAndroid Build Coastguard Worker  ret void
5*9880d681SAndroid Build Coastguard Worker}
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Workerdefine void @bar() noinline noreturn {
8*9880d681SAndroid Build Coastguard Worker  unreachable
9*9880d681SAndroid Build Coastguard Worker}
10*9880d681SAndroid Build Coastguard Worker
11*9880d681SAndroid Build Coastguard Workerdefine void @test() {
12*9880d681SAndroid Build Coastguard Worker  br i1 false, label %then, label %else
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard Workerthen:
15*9880d681SAndroid Build Coastguard Worker  call void @bar()
16*9880d681SAndroid Build Coastguard Worker  unreachable
17*9880d681SAndroid Build Coastguard Worker
18*9880d681SAndroid Build Coastguard Workerelse:
19*9880d681SAndroid Build Coastguard Worker  ; CHECK-NOT: call
20*9880d681SAndroid Build Coastguard Worker  call void bitcast (void (i16*)* @foo to void (i8*)*) (i8* null)
21*9880d681SAndroid Build Coastguard Worker  ret void
22*9880d681SAndroid Build Coastguard Worker}
23*9880d681SAndroid Build Coastguard Worker
24