aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/Mips/return_address.ll
blob: e1c9241984ca912c000a03437e5b412873389e9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
; RUN: llc -march=mipsel < %s | FileCheck %s

define i8* @f1() nounwind {
entry:
  %0 = call i8* @llvm.returnaddress(i32 0)
  ret i8* %0

; CHECK:    addu    $2, $zero, $ra
}

define i8* @f2() nounwind {
entry:
  call void @g()
  %0 = call i8* @llvm.returnaddress(i32 0)
  ret i8* %0

; CHECK:    addu    $[[R0:[0-9]+]], $zero, $ra
; CHECK:    jal
; CHECK:    addu    $2,  $zero, $[[R0]]
}

declare i8* @llvm.returnaddress(i32) nounwind readnone
declare void @g()