llvm-6502/test/CodeGen/PowerPC/2010-05-03-retaddr1.ll
Dale Johannesen 08673d2950 Implement builtin_return_address(x) and builtin_frame_address(x)
on PPC for x!=0.  7624113.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102972 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-03 22:59:34 +00:00

25 lines
589 B
LLVM

; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin -mcpu=g5 | FileCheck %s
declare i8* @llvm.frameaddress(i32) nounwind readnone
define i8* @g2() nounwind readnone {
entry:
; CHECK: _g2:
; CHECK: lwz r3, 0(r1)
%0 = tail call i8* @llvm.frameaddress(i32 1) ; <i8*> [#uses=1]
ret i8* %0
}
declare i8* @llvm.returnaddress(i32) nounwind readnone
define i8* @g() nounwind readnone {
entry:
; CHECK: _g:
; CHECK: mflr r0
; CHECK: stw r0, 8(r1)
; CHECK: lwz r3, 0(r1)
; CHECK: lwz r3, 8(r3)
%0 = tail call i8* @llvm.returnaddress(i32 1) ; <i8*> [#uses=1]
ret i8* %0
}