xref: /aosp_15_r20/external/llvm/test/CodeGen/PowerPC/2010-05-03-retaddr1.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin -mcpu=g5 | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin -mcpu=g5 -regalloc=basic | FileCheck %s
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Workerdeclare i8* @llvm.frameaddress(i32) nounwind readnone
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Workerdefine i8* @g2() nounwind readnone {
7*9880d681SAndroid Build Coastguard Workerentry:
8*9880d681SAndroid Build Coastguard Worker; CHECK: _g2:
9*9880d681SAndroid Build Coastguard Worker; CHECK: lwz r3, 0(r1)
10*9880d681SAndroid Build Coastguard Worker  %0 = tail call i8* @llvm.frameaddress(i32 1)    ; <i8*> [#uses=1]
11*9880d681SAndroid Build Coastguard Worker  ret i8* %0
12*9880d681SAndroid Build Coastguard Worker}
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard Workerdeclare i8* @llvm.returnaddress(i32) nounwind readnone
15*9880d681SAndroid Build Coastguard Worker
16*9880d681SAndroid Build Coastguard Workerdefine i8* @g() nounwind readnone {
17*9880d681SAndroid Build Coastguard Workerentry:
18*9880d681SAndroid Build Coastguard Worker; CHECK: _g:
19*9880d681SAndroid Build Coastguard Worker; CHECK:  mflr r0
20*9880d681SAndroid Build Coastguard Worker; CHECK:  stw r0, 8(r1)
21*9880d681SAndroid Build Coastguard Worker; CHECK:  lwz r2, 0(r1)
22*9880d681SAndroid Build Coastguard Worker; CHECK:  lwz r3, 8(r2)
23*9880d681SAndroid Build Coastguard Worker  %0 = tail call i8* @llvm.returnaddress(i32 1)   ; <i8*> [#uses=1]
24*9880d681SAndroid Build Coastguard Worker  ret i8* %0
25*9880d681SAndroid Build Coastguard Worker}
26