1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +01:00
llvm-mirror/test/CodeGen/Mips/frame-address.ll
Simon Atanasyan c846f55ed0 [Mips] Always save RA when disabling frame pointer elimination
This ensures that frame-based unwinding will continue to work when
calling a noreturn function; there is not much use having the caller's
frame pointer saved if you don't also have the caller's program counter.

Patch by James Clarke.

Differential Revision: https://reviews.llvm.org/D68542

llvm-svn: 373907
2019-10-07 14:01:37 +00:00

27 lines
887 B
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -march=mipsel < %s | FileCheck %s
declare i8* @llvm.frameaddress(i32) nounwind readnone
define i8* @f() nounwind uwtable {
; CHECK-LABEL: f:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: addiu $sp, $sp, -8
; CHECK-NEXT: .cfi_def_cfa_offset 8
; CHECK-NEXT: sw $ra, 4($sp) # 4-byte Folded Spill
; CHECK-NEXT: sw $fp, 0($sp) # 4-byte Folded Spill
; CHECK-NEXT: .cfi_offset 31, -4
; CHECK-NEXT: .cfi_offset 30, -8
; CHECK-NEXT: move $fp, $sp
; CHECK-NEXT: .cfi_def_cfa_register 30
; CHECK-NEXT: move $2, $fp
; CHECK-NEXT: move $sp, $fp
; CHECK-NEXT: lw $fp, 0($sp) # 4-byte Folded Reload
; CHECK-NEXT: lw $ra, 4($sp) # 4-byte Folded Reload
; CHECK-NEXT: jr $ra
; CHECK-NEXT: addiu $sp, $sp, 8
entry:
%0 = call i8* @llvm.frameaddress(i32 0)
ret i8* %0
}