2014-08-22 04:57:57 +08:00
|
|
|
; RUN: llc -mtriple=aarch64-apple-darwin -verify-machineinstrs < %s | FileCheck %s
|
|
|
|
; RUN: llc -mtriple=aarch64-apple-darwin -fast-isel -fast-isel-abort -verify-machineinstrs < %s | FileCheck %s
|
2013-10-30 01:01:29 +08:00
|
|
|
|
2014-07-26 01:47:14 +08:00
|
|
|
define i8* @test_frameaddress0() nounwind {
|
2013-10-30 01:01:29 +08:00
|
|
|
entry:
|
2014-07-26 01:47:14 +08:00
|
|
|
; CHECK-LABEL: test_frameaddress0:
|
|
|
|
; CHECK: stp x29, x30, [sp, #-16]!
|
|
|
|
; CHECK: mov x29, sp
|
2013-10-30 01:01:29 +08:00
|
|
|
; CHECK: mov x0, x29
|
2014-07-26 01:47:14 +08:00
|
|
|
; CHECK: ldp x29, x30, [sp], #16
|
|
|
|
; CHECK: ret
|
|
|
|
%0 = call i8* @llvm.frameaddress(i32 0)
|
|
|
|
ret i8* %0
|
2013-10-30 01:01:29 +08:00
|
|
|
}
|
|
|
|
|
2014-07-26 01:47:14 +08:00
|
|
|
define i8* @test_frameaddress2() nounwind {
|
2013-10-30 01:01:29 +08:00
|
|
|
entry:
|
2014-07-26 01:47:14 +08:00
|
|
|
; CHECK-LABEL: test_frameaddress2:
|
|
|
|
; CHECK: stp x29, x30, [sp, #-16]!
|
|
|
|
; CHECK: mov x29, sp
|
2013-10-30 01:01:29 +08:00
|
|
|
; CHECK: ldr x[[reg:[0-9]+]], [x29]
|
2014-07-26 01:47:14 +08:00
|
|
|
; CHECK: ldr x0, [x[[reg]]]
|
|
|
|
; CHECK: ldp x29, x30, [sp], #16
|
|
|
|
; CHECK: ret
|
|
|
|
%0 = call i8* @llvm.frameaddress(i32 2)
|
|
|
|
ret i8* %0
|
2013-10-30 01:01:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
declare i8* @llvm.frameaddress(i32) nounwind readnone
|