xref: /aosp_15_r20/external/llvm/test/CodeGen/ARM/fast-isel-static.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=thumbv7-apple-ios -O0 -verify-machineinstrs -fast-isel-abort=1 -relocation-model=static -mattr=+long-calls | FileCheck -check-prefix=CHECK-LONG %s
2*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=armv7-linux-gnueabi -O0 -verify-machineinstrs -fast-isel-abort=1 -relocation-model=static -mattr=+long-calls | FileCheck -check-prefix=CHECK-LONG %s
3*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=thumbv7-apple-ios -O0 -verify-machineinstrs -fast-isel-abort=1 -relocation-model=static | FileCheck -check-prefix=CHECK-NORM %s
4*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=armv7-linux-gnueabi -O0 -verify-machineinstrs -fast-isel-abort=1 -relocation-model=static | FileCheck -check-prefix=CHECK-NORM %s
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Workerdefine void @myadd(float* %sum, float* %addend) nounwind {
7*9880d681SAndroid Build Coastguard Workerentry:
8*9880d681SAndroid Build Coastguard Worker  %sum.addr = alloca float*, align 4
9*9880d681SAndroid Build Coastguard Worker  %addend.addr = alloca float*, align 4
10*9880d681SAndroid Build Coastguard Worker  store float* %sum, float** %sum.addr, align 4
11*9880d681SAndroid Build Coastguard Worker  store float* %addend, float** %addend.addr, align 4
12*9880d681SAndroid Build Coastguard Worker  %tmp = load float*, float** %sum.addr, align 4
13*9880d681SAndroid Build Coastguard Worker  %tmp1 = load float, float* %tmp
14*9880d681SAndroid Build Coastguard Worker  %tmp2 = load float*, float** %addend.addr, align 4
15*9880d681SAndroid Build Coastguard Worker  %tmp3 = load float, float* %tmp2
16*9880d681SAndroid Build Coastguard Worker  %add = fadd float %tmp1, %tmp3
17*9880d681SAndroid Build Coastguard Worker  %tmp4 = load float*, float** %sum.addr, align 4
18*9880d681SAndroid Build Coastguard Worker  store float %add, float* %tmp4
19*9880d681SAndroid Build Coastguard Worker  ret void
20*9880d681SAndroid Build Coastguard Worker}
21*9880d681SAndroid Build Coastguard Worker
22*9880d681SAndroid Build Coastguard Workerdefine i32 @main(i32 %argc, i8** %argv) nounwind {
23*9880d681SAndroid Build Coastguard Workerentry:
24*9880d681SAndroid Build Coastguard Worker  %ztot = alloca float, align 4
25*9880d681SAndroid Build Coastguard Worker  %z = alloca float, align 4
26*9880d681SAndroid Build Coastguard Worker  store float 0.000000e+00, float* %ztot, align 4
27*9880d681SAndroid Build Coastguard Worker  store float 1.000000e+00, float* %z, align 4
28*9880d681SAndroid Build Coastguard Worker; CHECK-LONG: blx     r
29*9880d681SAndroid Build Coastguard Worker; CHECK-NORM: bl      {{_?}}myadd
30*9880d681SAndroid Build Coastguard Worker  call void @myadd(float* %ztot, float* %z)
31*9880d681SAndroid Build Coastguard Worker  ret i32 0
32*9880d681SAndroid Build Coastguard Worker}
33