From fc38fe26184666c982e33f4c7e485b1664537e13 Mon Sep 17 00:00:00 2001 From: Renato Golin Date: Thu, 9 Jul 2015 13:29:35 +0000 Subject: [PATCH] Test for 241794 (nest attribute in AArch64) Forgot to git add the test. Patch by Stephen Cross. llvm-svn: 241797 --- test/CodeGen/AArch64/nest-register.ll | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 test/CodeGen/AArch64/nest-register.ll diff --git a/test/CodeGen/AArch64/nest-register.ll b/test/CodeGen/AArch64/nest-register.ll new file mode 100644 index 00000000000..9c659fb74ec --- /dev/null +++ b/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 +}