1 ; RUN: llc -march=mips < %s | FileCheck --check-prefixes=ALL,O32 %s
2 ; RUN: llc -march=mipsel < %s | FileCheck --check-prefixes=ALL,O32 %s
4 ; RUN-TODO: llc -march=mips64 -target-abi o32 < %s | FileCheck --check-prefixes=ALL,O32 %s
5 ; RUN-TODO: llc -march=mips64el -target-abi o32 < %s | FileCheck --check-prefixes=ALL,O32 %s
7 ; RUN: llc -march=mips64 -target-abi n32 < %s | FileCheck --check-prefixes=ALL,N32 %s
8 ; RUN: llc -march=mips64el -target-abi n32 < %s | FileCheck --check-prefixes=ALL,N32 %s
10 ; RUN: llc -march=mips64 -target-abi n64 < %s | FileCheck --check-prefixes=ALL,N64 %s
11 ; RUN: llc -march=mips64el -target-abi n64 < %s | FileCheck --check-prefixes=ALL,N64 %s
13 ; Test that O32 correctly reserved space for the four arguments, even when
14 ; there aren't any as per section 5 of MD00305 (MIPS ABIs Described).
16 declare void @foo() nounwind;
18 define void @reserved_space() nounwind {
24 ; ALL-LABEL: reserved_space:
25 ; O32: addiu $sp, $sp, -24
26 ; O32: sw $ra, 20($sp)
27 ; O32: lw $ra, 20($sp)
28 ; O32: addiu $sp, $sp, 24
29 ; Despite pointers being 32-bit wide on N32, the return pointer is saved as a
30 ; 64-bit pointer. I've yet to find a documentation reference for this quirk but
31 ; this behaviour matches GCC so I have considered it to be correct.
32 ; N32: addiu $sp, $sp, -16
35 ; N32: addiu $sp, $sp, 16
36 ; N64: daddiu $sp, $sp, -16
39 ; N64: daddiu $sp, $sp, 16