[llvm] r193626 - add test cases for frameaddr and returnaddr for aarch64
Weiming Zhao
weimingz at codeaurora.org
Tue Oct 29 10:01:30 PDT 2013
Author: weimingz
Date: Tue Oct 29 12:01:29 2013
New Revision: 193626
URL: http://llvm.org/viewvc/llvm-project?rev=193626&view=rev
Log:
add test cases for frameaddr and returnaddr for aarch64
Added:
llvm/trunk/test/CodeGen/AArch64/frameaddr.ll
llvm/trunk/test/CodeGen/AArch64/returnaddr.ll
Added: llvm/trunk/test/CodeGen/AArch64/frameaddr.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/frameaddr.ll?rev=193626&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/AArch64/frameaddr.ll (added)
+++ llvm/trunk/test/CodeGen/AArch64/frameaddr.ll Tue Oct 29 12:01:29 2013
@@ -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
Added: llvm/trunk/test/CodeGen/AArch64/returnaddr.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/returnaddr.ll?rev=193626&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/AArch64/returnaddr.ll (added)
+++ llvm/trunk/test/CodeGen/AArch64/returnaddr.ll Tue Oct 29 12:01:29 2013
@@ -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
More information about the llvm-commits
mailing list