2014-08-21 20:57:57 +00: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-29 17:01:29 +00:00
|
|
|
|
2014-07-25 17:47:14 +00:00
|
|
|
define i8* @test_frameaddress0() nounwind {
|
2013-10-29 17:01:29 +00:00
|
|
|
entry:
|
2014-07-25 17:47:14 +00:00
|
|
|
; CHECK-LABEL: test_frameaddress0:
|
|
|
|
; CHECK: stp x29, x30, [sp, #-16]!
|
|
|
|
; CHECK: mov x29, sp
|
2013-10-29 17:01:29 +00:00
|
|
|
; CHECK: mov x0, x29
|
2014-07-25 17:47:14 +00:00
|
|
|
; CHECK: ldp x29, x30, [sp], #16
|
|
|
|
; CHECK: ret
|
|
|
|
%0 = call i8* @llvm.frameaddress(i32 0)
|
|
|
|
ret i8* %0
|
2013-10-29 17:01:29 +00:00
|
|
|
}
|
|
|
|
|
2014-07-25 17:47:14 +00:00
|
|
|
define i8* @test_frameaddress2() nounwind {
|
2013-10-29 17:01:29 +00:00
|
|
|
entry:
|
2014-07-25 17:47:14 +00:00
|
|
|
; CHECK-LABEL: test_frameaddress2:
|
|
|
|
; CHECK: stp x29, x30, [sp, #-16]!
|
|
|
|
; CHECK: mov x29, sp
|
2013-10-29 17:01:29 +00:00
|
|
|
; CHECK: ldr x[[reg:[0-9]+]], [x29]
|
2014-07-25 17:47:14 +00: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-29 17:01:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
declare i8* @llvm.frameaddress(i32) nounwind readnone
|