add test cases for frameaddr and returnaddr for aarch64

llvm-svn: 193626
This commit is contained in:
Weiming Zhao 2013-10-29 17:01:29 +00:00
parent ffade617bd
commit acf48d75e5
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