From 13e93a4b7bca6d0871977d0dc6e9f9e5532f1fb7 Mon Sep 17 00:00:00 2001 From: rearnsha Date: Thu, 6 Aug 2009 18:15:19 +0000 Subject: * gcc.target/arm/abitest.h: Allow the test function to have a PCS attribute. * gcc.target/arm/vfp1[567].c: New tests. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150536 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/gcc.target/arm/aapcs/abitest.h | 6 +++++- gcc/testsuite/gcc.target/arm/aapcs/vfp15.c | 20 ++++++++++++++++++++ gcc/testsuite/gcc.target/arm/aapcs/vfp16.c | 22 ++++++++++++++++++++++ gcc/testsuite/gcc.target/arm/aapcs/vfp17.c | 20 ++++++++++++++++++++ 4 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/arm/aapcs/vfp15.c create mode 100644 gcc/testsuite/gcc.target/arm/aapcs/vfp16.c create mode 100644 gcc/testsuite/gcc.target/arm/aapcs/vfp17.c (limited to 'gcc/testsuite/gcc.target/arm') diff --git a/gcc/testsuite/gcc.target/arm/aapcs/abitest.h b/gcc/testsuite/gcc.target/arm/aapcs/abitest.h index f6474a988a0..7b7d0e24fac 100644 --- a/gcc/testsuite/gcc.target/arm/aapcs/abitest.h +++ b/gcc/testsuite/gcc.target/arm/aapcs/abitest.h @@ -93,9 +93,13 @@ void testfunc(char* stack) #define MYFUNCTYPE void #endif +#ifndef PCSATTR +#define PCSATTR +#endif + MYFUNCTYPE myfunc( #include TESTFILE -); +) PCSATTR; #undef LAST_ARG #undef ARG diff --git a/gcc/testsuite/gcc.target/arm/aapcs/vfp15.c b/gcc/testsuite/gcc.target/arm/aapcs/vfp15.c new file mode 100644 index 00000000000..d5a75b5b8ff --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/aapcs/vfp15.c @@ -0,0 +1,20 @@ +/* Test AAPCS layout (VFP variant) */ + +/* { dg-do run { target arm*-*-eabi* } } */ +/* { dg-require-effective-target arm_hard_vfp_ok } */ +/* { dg-require-effective-target arm32 } */ +/* { dg-options "-O -mfpu=vfp -mfloat-abi=hard" } */ + +#ifndef IN_FRAMEWORK +#define VFP +#define TESTFILE "vfp15.c" + +#define PCSATTR __attribute__((pcs("aapcs"))) + +#include "abitest.h" +#else + ARG(double, 1.0, R0) + ARG(double, 2.0, R2) + ARG(double, 3.0, STACK) + LAST_ARG(double, 4.0, STACK+8) +#endif diff --git a/gcc/testsuite/gcc.target/arm/aapcs/vfp16.c b/gcc/testsuite/gcc.target/arm/aapcs/vfp16.c new file mode 100644 index 00000000000..9815994ef8b --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/aapcs/vfp16.c @@ -0,0 +1,22 @@ +/* Test AAPCS layout (VFP variant) */ + +/* { dg-do run { target arm*-*-eabi* } } */ +/* { dg-require-effective-target arm_hard_vfp_ok } */ +/* { dg-require-effective-target arm32 } */ +/* { dg-options "-O -mfpu=vfp -mfloat-abi=hard" } */ + +#ifndef IN_FRAMEWORK +#define VFP +#define TESTFILE "vfp16.c" + +#define PCSATTR __attribute__((pcs("aapcs"))) + +#include "abitest.h" +#else + ARG(float, 1.0f, R0) + ARG(float, 2.0f, R1) + ARG(float, 3.0f, R2) + ARG(float, 4.0f, R3) + ARG(float, 5.0f, STACK) + LAST_ARG(float, 5.0f, STACK+4) +#endif diff --git a/gcc/testsuite/gcc.target/arm/aapcs/vfp17.c b/gcc/testsuite/gcc.target/arm/aapcs/vfp17.c new file mode 100644 index 00000000000..d02160c860b --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/aapcs/vfp17.c @@ -0,0 +1,20 @@ +/* Test AAPCS layout (VFP variant) */ + +/* { dg-do run { target arm*-*-eabi* } } */ +/* { dg-require-effective-target arm_hard_vfp_ok } */ +/* { dg-require-effective-target arm32 } */ +/* { dg-options "-O -mfpu=vfp -mfloat-abi=hard" } */ + +#ifndef IN_FRAMEWORK +#define VFP +#define TESTFILE "vfp17.c" + +#define PCSATTR __attribute__((pcs("aapcs"))) + +#include "abitest.h" +#else + ARG(float, 1.0f, R0) + ARG(double, 2.0, R2) + ARG(float, 3.0f, STACK) + LAST_ARG(double, 4.0, STACK+8) +#endif -- cgit v1.2.1