aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/PowerPC/2010-05-03-retaddr1.ll
blob: 72ae9d6c73b38f06a3c6c799bdbcc4e7d4047fd0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin -mcpu=g5 | FileCheck %s
; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin -mcpu=g5 -regalloc=basic | 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
}