summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/AArch64/frameaddr.ll
diff options
context:
space:
mode:
authorWeiming Zhao <weimingz@codeaurora.org>2013-10-29 17:01:29 +0000
committerWeiming Zhao <weimingz@codeaurora.org>2013-10-29 17:01:29 +0000
commitacf48d75e5920b3b9e8fc532c17e9725fcd2fd04 (patch)
treef28779292b4b88629121ffdc5bb695a9debb0f28 /llvm/test/CodeGen/AArch64/frameaddr.ll
parentffade617bd6fb7aabd8b9f77f612494f181c15f3 (diff)
downloadbcm5719-llvm-acf48d75e5920b3b9e8fc532c17e9725fcd2fd04.tar.gz
bcm5719-llvm-acf48d75e5920b3b9e8fc532c17e9725fcd2fd04.zip
add test cases for frameaddr and returnaddr for aarch64
llvm-svn: 193626
Diffstat (limited to 'llvm/test/CodeGen/AArch64/frameaddr.ll')
-rw-r--r--llvm/test/CodeGen/AArch64/frameaddr.ll20
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AArch64/frameaddr.ll b/llvm/test/CodeGen/AArch64/frameaddr.ll
new file mode 100644
index 00000000000..182704bd654
--- /dev/null
+++ b/llvm/test/CodeGen/AArch64/frameaddr.ll
@@ -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
OpenPOWER on IntegriCloud