[llvm] r241797 - Test for 241794 (nest attribute in AArch64)
Renato Golin
renato.golin at linaro.org
Thu Jul 9 06:29:36 PDT 2015
Author: rengolin
Date: Thu Jul 9 08:29:35 2015
New Revision: 241797
URL: http://llvm.org/viewvc/llvm-project?rev=241797&view=rev
Log:
Test for 241794 (nest attribute in AArch64)
Forgot to git add the test.
Patch by Stephen Cross.
Added:
llvm/trunk/test/CodeGen/AArch64/nest-register.ll
Added: llvm/trunk/test/CodeGen/AArch64/nest-register.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/nest-register.ll?rev=241797&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/AArch64/nest-register.ll (added)
+++ llvm/trunk/test/CodeGen/AArch64/nest-register.ll Thu Jul 9 08:29:35 2015
@@ -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
+}
More information about the llvm-commits
mailing list