add test cases for frameaddr and returnaddr for aarch64

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193626 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Weiming Zhao 2013-10-29 17:01:29 +00:00
parent 160a14e2b1
commit a72ec5517f
2 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,20 @@
; RUN: llc < %s -mtriple=aarch64-none-linux-gnu | FileCheck %s
define i8* @t() nounwind {
entry:
; CHECK-LABEL: t:
; CHECK: mov x0, x29
%0 = call i8* @llvm.frameaddress(i32 0)
ret i8* %0
}
define i8* @t2() nounwind {
entry:
; CHECK-LABEL: t2:
; CHECK: ldr x[[reg:[0-9]+]], [x29]
; CHECK: ldr x[[reg]], [x[[reg]]]
%0 = call i8* @llvm.frameaddress(i32 2)
ret i8* %0
}
declare i8* @llvm.frameaddress(i32) nounwind readnone

View File

@ -0,0 +1,21 @@
; RUN: llc < %s -mtriple=aarch64-none-linux-gnu | FileCheck %s
define i8* @rt0(i32 %x) nounwind readnone {
entry:
; CHECK-LABEL: rt0:
; CHECK: mov x0, x30
%0 = tail call i8* @llvm.returnaddress(i32 0)
ret i8* %0
}
define i8* @rt2() nounwind readnone {
entry:
; CHECK-LABEL: rt2:
; CHECK: ldr x[[reg:[0-9]+]], [x29]
; CHECK: ldr x[[reg]], [x[[reg]]]
; CHECK: ldr x0, [x[[reg]], #8]
%0 = tail call i8* @llvm.returnaddress(i32 2)
ret i8* %0
}
declare i8* @llvm.returnaddress(i32) nounwind readnone