xref: /aosp_15_r20/external/llvm/test/CodeGen/ARM/tail-call-weak.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple thumbv7-windows-coff -filetype asm -o - %s | FileCheck %s -check-prefix CHECK-COFF
2*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple thumbv7-elf -filetype asm -o - %s | FileCheck %s -check-prefix CHECK-OTHER
3*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple thumbv7-macho -filetype asm -o - %s | FileCheck %s -check-prefix CHECK-OTHER
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Workerdeclare i8* @f()
6*9880d681SAndroid Build Coastguard Workerdeclare extern_weak i8* @g(i8*)
7*9880d681SAndroid Build Coastguard Worker
8*9880d681SAndroid Build Coastguard Worker; weak symbol resolution occurs statically in PE/COFF, ensure that we permit
9*9880d681SAndroid Build Coastguard Worker; tail calls on weak externals when targeting a COFF environment.
10*9880d681SAndroid Build Coastguard Workerdefine void @test() {
11*9880d681SAndroid Build Coastguard Worker  %call = tail call i8* @f()
12*9880d681SAndroid Build Coastguard Worker  %call1 = tail call i8* @g(i8* %call)
13*9880d681SAndroid Build Coastguard Worker  ret void
14*9880d681SAndroid Build Coastguard Worker}
15*9880d681SAndroid Build Coastguard Worker
16*9880d681SAndroid Build Coastguard Worker; CHECK-COFF: b g
17*9880d681SAndroid Build Coastguard Worker; CHECK-OTHER: bl {{_?}}g
18*9880d681SAndroid Build Coastguard Worker
19