mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-23 02:29:18 +00:00
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:
parent
160a14e2b1
commit
a72ec5517f
20
test/CodeGen/AArch64/frameaddr.ll
Normal file
20
test/CodeGen/AArch64/frameaddr.ll
Normal 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
|
21
test/CodeGen/AArch64/returnaddr.ll
Normal file
21
test/CodeGen/AArch64/returnaddr.ll
Normal 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
|
Loading…
Reference in New Issue
Block a user