xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/win64_nonvol.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=x86_64-pc-win32 | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=x86_64-pc-linux | FileCheck %s
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker; Check that, if a Win64 ABI function calls a SysV ABI function, all the
5*9880d681SAndroid Build Coastguard Worker; Win64 nonvolatile registers get saved.
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: bar:
8*9880d681SAndroid Build Coastguard Workerdefine x86_64_win64cc void @bar(i32 %a, i32 %b) {
9*9880d681SAndroid Build Coastguard Worker; CHECK-DAG: pushq %rdi
10*9880d681SAndroid Build Coastguard Worker; CHECK-DAG: pushq %rsi
11*9880d681SAndroid Build Coastguard Worker; CHECK-DAG: movaps %xmm6,
12*9880d681SAndroid Build Coastguard Worker; CHECK-DAG: movaps %xmm7,
13*9880d681SAndroid Build Coastguard Worker; CHECK-DAG: movaps %xmm8,
14*9880d681SAndroid Build Coastguard Worker; CHECK-DAG: movaps %xmm9,
15*9880d681SAndroid Build Coastguard Worker; CHECK-DAG: movaps %xmm10,
16*9880d681SAndroid Build Coastguard Worker; CHECK-DAG: movaps %xmm11,
17*9880d681SAndroid Build Coastguard Worker; CHECK-DAG: movaps %xmm12,
18*9880d681SAndroid Build Coastguard Worker; CHECK-DAG: movaps %xmm13,
19*9880d681SAndroid Build Coastguard Worker; CHECK-DAG: movaps %xmm14,
20*9880d681SAndroid Build Coastguard Worker; CHECK-DAG: movaps %xmm15,
21*9880d681SAndroid Build Coastguard Worker; CHECK: callq foo
22*9880d681SAndroid Build Coastguard Worker; CHECK: ret
23*9880d681SAndroid Build Coastguard Worker  call x86_64_sysvcc void @foo(i32 %a, i32 %b)
24*9880d681SAndroid Build Coastguard Worker  ret void
25*9880d681SAndroid Build Coastguard Worker}
26*9880d681SAndroid Build Coastguard Worker
27*9880d681SAndroid Build Coastguard Workerdeclare x86_64_sysvcc void @foo(i32 %a, i32 %b)
28*9880d681SAndroid Build Coastguard Worker
29