summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen
diff options
context:
space:
mode:
authorRenato Golin <renato.golin@linaro.org>2015-07-09 13:29:35 +0000
committerRenato Golin <renato.golin@linaro.org>2015-07-09 13:29:35 +0000
commitce4ccdc2fceda56b268eacb1fb3a920d98bc0799 (patch)
tree9132a5c26dab77bd0005ae1966f54d9ba5acde67 /llvm/test/CodeGen
parentd5b310f2a39d268b0bc848fb6f872577f2a29e8b (diff)
downloadbcm5719-llvm-ce4ccdc2fceda56b268eacb1fb3a920d98bc0799.tar.gz
bcm5719-llvm-ce4ccdc2fceda56b268eacb1fb3a920d98bc0799.zip
Test for 241794 (nest attribute in AArch64)
Forgot to git add the test. Patch by Stephen Cross. llvm-svn: 241797
Diffstat (limited to 'llvm/test/CodeGen')
-rw-r--r--llvm/test/CodeGen/AArch64/nest-register.ll23
1 files changed, 23 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AArch64/nest-register.ll b/llvm/test/CodeGen/AArch64/nest-register.ll
new file mode 100644
index 00000000000..9c659fb74ec
--- /dev/null
+++ b/llvm/test/CodeGen/AArch64/nest-register.ll
@@ -0,0 +1,23 @@
+; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu | FileCheck %s
+
+; Tests that the 'nest' parameter attribute causes the relevant parameter to be
+; passed in the right register.
+
+define i8* @nest_receiver(i8* nest %arg) nounwind {
+; CHECK-LABEL: nest_receiver:
+; CHECK-NEXT: // BB#0:
+; CHECK-NEXT: mov x0, x18
+; CHECK-NEXT: ret
+
+ ret i8* %arg
+}
+
+define i8* @nest_caller(i8* %arg) nounwind {
+; CHECK-LABEL: nest_caller:
+; CHECK: mov x18, x0
+; CHECK-NEXT: bl nest_receiver
+; CHECK: ret
+
+ %result = call i8* @nest_receiver(i8* nest %arg)
+ ret i8* %result
+}
OpenPOWER on IntegriCloud