diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs')
28 files changed, 891 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/aapcs.exp b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/aapcs.exp new file mode 100644 index 000000000..746429dad --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/aapcs.exp @@ -0,0 +1,35 @@ +# Copyright (C) 1997-2014 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# <http://www.gnu.org/licenses/>. + +# GCC testsuite that uses the `dg.exp' driver. + +# Exit immediately if this isn't an ARM target. +if ![istarget arm*-*-*] then { + return +} + +# Load support procs. +load_lib gcc-dg.exp + +# Initialize `dg'. +dg-init + +# Main loop. +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cCS\]]] \ + "" "" + +# All done. +dg-finish diff --git a/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/abitest.h b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/abitest.h new file mode 100644 index 000000000..06a92c3ec --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/abitest.h @@ -0,0 +1,125 @@ + +#define IN_FRAMEWORK + +#ifdef VFP +#define D0 0 +#define D1 8 +#define D2 16 +#define D3 24 +#define D4 32 +#define D5 40 +#define D6 48 +#define D7 56 + +#ifdef NEON +#define Q0 D0 +#define Q1 D2 +#define Q2 D4 +#define Q3 D6 +#endif + +#define S0 64 +#define S1 68 +#define S2 72 +#define S3 76 +#define S4 80 +#define S5 84 +#define S6 88 +#define S7 92 +#define S8 86 +#define S9 100 +#define S10 104 +#define S11 108 +#define S12 112 +#define S13 116 +#define S14 120 +#define S15 124 + +#define CORE_REG_START 128 +#else +#define CORE_REG_START 0 +#endif + +#define R0 CORE_REG_START +#define R1 (R0 + 4) +#define R2 (R1 + 4) +#define R3 (R2 + 4) +#define STACK (R3 + 4) + + + +extern void abort (void); + +__attribute__((naked)) void dumpregs () __asm("myfunc"); +__attribute__((naked)) void dumpregs () +{ + asm( + "mov ip, sp\n\t" + "stmfd sp!, {r0-r3}\n\t" +#ifdef VFP + "fstmdbs sp!, {s0-s15}\n\t" + "fstmdbd sp!, {d0-d7}\n\t" +#endif + "mov r0, sp\n\t" + "stmfd sp!, {ip, r14}\n\t" + "bl testfunc\n\t" + "ldmfd sp!, {r0, r14}\n\t" + "mov sp, r0\n\t" + "bx lr"); +} + + +#define LAST_ARG(type,val,offset) { type __x = val; if (memcmp(&__x, stack+offset, sizeof(type)) != 0) abort(); } +#define ARG(type,val,offset) LAST_ARG(type, val, offset) +#define ANON(type,val,offset) LAST_ARG(type, val, offset) +#define LAST_ANON(type,val,offset) LAST_ARG(type, val, offset) +#define DOTS + +void testfunc(char* stack) +{ +#include TESTFILE + return; +} + +#undef LAST_ARG +#undef ARG +#undef DOTS +#undef ANON +#undef LAST_ANON +#define LAST_ARG(type,val,offset) type +#define ARG(type,val,offset) LAST_ARG(type, val, offset), +#define DOTS ... +#define ANON(type,val, offset) +#define LAST_ANON(type,val, offset) + +#ifndef MYFUNCTYPE +#define MYFUNCTYPE void +#endif + +#ifndef PCSATTR +#define PCSATTR +#endif + +MYFUNCTYPE myfunc( +#include TESTFILE +) PCSATTR; + +#undef LAST_ARG +#undef ARG +#undef DOTS +#undef ANON +#undef LAST_ANON +#define LAST_ARG(type,val,offset) val +#define ARG(type,val,offset) LAST_ARG(type, val, offset), +#define DOTS +#define LAST_ANON(type,val,offset) LAST_ARG(type, val, offset) +#define ANON(type,val,offset) LAST_ARG(type, val, offset), + + +int main() +{ + myfunc( +#include TESTFILE +); + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/neon-constants.h b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/neon-constants.h new file mode 100644 index 000000000..08b75f7b1 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/neon-constants.h @@ -0,0 +1,33 @@ + + +#include "arm_neon.h" + +const int32x4_t i32x4_constvec1 = { 1101, 1102, 1103, 1104}; +const int32x4_t i32x4_constvec2 = { 2101, 2102, 2103, 2104}; + +#define ELEM(INDEX) .val[INDEX] + +const int32x4x2_t i32x4x2_constvec1 = {ELEM(0) = {0xaddebccb,11,12,13}, + ELEM(1) = {14, 15, 16, 17} }; + +const int32x4x2_t i32x4x2_constvec2 = { ELEM(0) = {0xaadebcca,11,12,13}, + ELEM(1) = {140, 15, 16, 17}}; + +const int32x4x3_t i32x4x3_constvec1 = { ELEM(0) = {0xabbccdde,8, 9, 10}, + ELEM(1) = {0xabcccdde, 26, 27, 28}, + ELEM(2) = {0xaccccddf, 29, 30, 31}}; + +const int32x4x3_t i32x4x3_constvec2 = { ELEM(0) = {0xbccccdd0,8, 9, 10}, + ELEM(1) = {0xbdfe1000, 26, 27, 28}, + ELEM(2) = {0xaccccddf, 29, 30, 31}}; +const float32x4x2_t f32x4x2_constvec1 = + { ELEM(0) = { 7.101f, 0.201f, 0.301f, 0.401f} , + ELEM(1) = { 8.101f, 0.501f, 0.601f, 0.701f} }; + +const float32x4x2_t f32x4x2_constvec2 = + { ELEM(0) = { 11.99f , 11.21f, 1.27f, 8.74f}, + ELEM(1) = { 13.45f , 1.23f ,1.24f, 1.26f}}; + +const int32x2_t i32x2_constvec1 = { 1283, 1345 }; +const int32x2x2_t i32x2x2_constvec1 = { ELEM(0) = { 0xabcdefab, 32 }, + ELEM(1) = { 0xabcdefbc, 33 }}; diff --git a/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/neon-vect1.c b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/neon-vect1.c new file mode 100644 index 000000000..47ae2f65f --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/neon-vect1.c @@ -0,0 +1,27 @@ +/* Test AAPCS layout (VFP variant for Neon types) */ + +/* { dg-do run { target arm*-*-*eabi* } } */ +/* { dg-require-effective-target arm_hard_vfp_ok } */ +/* { dg-require-effective-target arm_neon_ok } */ +/* { dg-require-effective-target arm32 } */ +/* { dg-add-options arm_neon } */ + + +#ifndef IN_FRAMEWORK +#define VFP +#define NEON +#define TESTFILE "neon-vect1.c" +#include "neon-constants.h" + + +#include "abitest.h" +#else + +ARG(int32x4_t, i32x4_constvec2, Q0) /* D0, D1 */ +ARG(float, 3.0f, S4) /* D2, Q1 */ +ARG(int32x4x2_t, i32x4x2_constvec1, Q2) /* Q2, Q3 - D4-D6 , s5-s12 */ +ARG(double, 12.0, D3) /* Backfill this particular argument. */ +ARG(int32x4x2_t, i32x4x2_constvec2, STACK) +ARG(float, 5.0f, STACK+sizeof(int32x4x2_t)) /* No backfill allowed. */ +LAST_ARG(int, 3, R0) +#endif diff --git a/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/neon-vect2.c b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/neon-vect2.c new file mode 100644 index 000000000..f7b532a3b --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/neon-vect2.c @@ -0,0 +1,23 @@ +/* Test AAPCS layout (VFP variant for Neon types) */ + +/* { dg-do run { target arm*-*-*eabi* } } */ +/* { dg-require-effective-target arm_hard_vfp_ok } */ +/* { dg-require-effective-target arm_neon_ok } */ +/* { dg-require-effective-target arm32 } */ +/* { dg-add-options arm_neon } */ + + +#ifndef IN_FRAMEWORK +#define VFP +#define NEON +#define TESTFILE "neon-vect2.c" +#include "neon-constants.h" + + +#include "abitest.h" +#else + +ARG(int32x4_t, i32x4_constvec2, Q0) /* D0, D1. */ +ARG(float, 3.0f, S4) /* D2, Q1 occupied. */ +LAST_ARG(int, 3, R0) +#endif diff --git a/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/neon-vect3.c b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/neon-vect3.c new file mode 100644 index 000000000..e5426b0ec --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/neon-vect3.c @@ -0,0 +1,26 @@ +/* Test AAPCS layout (VFP variant for Neon types) */ + +/* { dg-do run { target arm*-*-*eabi* } } */ +/* { dg-require-effective-target arm_hard_vfp_ok } */ +/* { dg-require-effective-target arm_neon_ok } */ +/* { dg-require-effective-target arm32 } */ +/* { dg-add-options arm_neon } */ + + +#ifndef IN_FRAMEWORK +#define VFP +#define NEON +#define TESTFILE "neon-vect3.c" +#include "neon-constants.h" + + +#include "abitest.h" +#else + +ARG(int32x4_t, i32x4_constvec2, Q0) /* D0, D1 */ +ARG(float, 3.0f, S4) /* D2, Q1 */ +ARG(int32x4x2_t, i32x4x2_constvec1, Q2) /* Q2, Q3 - D4-D6 , s5-s12 */ +ARG(int32x4x2_t, i32x4x2_constvec2, STACK) +ARG(double, 11.0, STACK+sizeof(int32x4x2_t)) /* No backfill in D3. */ +LAST_ARG(int, 3, R0) +#endif diff --git a/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/neon-vect4.c b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/neon-vect4.c new file mode 100644 index 000000000..96bd09c45 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/neon-vect4.c @@ -0,0 +1,27 @@ +/* Test AAPCS layout (VFP variant for Neon types) */ + +/* { dg-do run { target arm*-*-*eabi* } } */ +/* { dg-require-effective-target arm_hard_vfp_ok } */ +/* { dg-require-effective-target arm_neon_ok } */ +/* { dg-require-effective-target arm32 } */ +/* { dg-add-options arm_neon } */ + + +#ifndef IN_FRAMEWORK +#define VFP +#define NEON +#define TESTFILE "neon-vect4.c" +#include "neon-constants.h" + + +#include "abitest.h" +#else + +ARG(int32x4_t, i32x4_constvec2, Q0) /* D0, D1 */ +ARG(float, 3.0f, S4) /* D2, Q1 */ +ARG(int32x4x2_t, i32x4x2_constvec1, Q2) /* Q2, Q3 - D4-D6 , s5-s12 */ +ARG(double, 12.0, D3) /* Backfill this particular argument. */ +ARG(float, 5.0f, S5) /* Backfill in S5. */ +ARG(int32x4x2_t, i32x4x2_constvec2, STACK) +LAST_ARG(int, 3, R0) +#endif diff --git a/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/neon-vect5.c b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/neon-vect5.c new file mode 100644 index 000000000..59e58c96c --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/neon-vect5.c @@ -0,0 +1,28 @@ +/* Test AAPCS layout (VFP variant for Neon types) */ + +/* { dg-do run { target arm*-*-*eabi* } } */ +/* { dg-require-effective-target arm_hard_vfp_ok } */ +/* { dg-require-effective-target arm_neon_ok } */ +/* { dg-require-effective-target arm32 } */ +/* { dg-add-options arm_neon } */ + + +#ifndef IN_FRAMEWORK +#define VFP +#define NEON +#define TESTFILE "neon-vect5.c" +#include "neon-constants.h" + + +#include "abitest.h" +#else + +ARG(int32x4_t, i32x4_constvec2, Q0) /* D0, D1 */ +ARG(float, 3.0f, S4) /* D2, Q1 */ +ARG(float32x4x2_t, f32x4x2_constvec1, Q2) /* Q2, Q3 - D4-D6 , s5-s12 */ +ARG(double, 12.0, D3) /* Backfill this particular argument. */ +ARG(int32x4x2_t, i32x4x2_constvec2, STACK) +ARG(float, 5.0f, STACK+sizeof(int32x4x2_t)) /* No backfill allowed. */ +LAST_ARG(int, 3, R0) + +#endif diff --git a/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/neon-vect6.c b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/neon-vect6.c new file mode 100644 index 000000000..fcb399882 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/neon-vect6.c @@ -0,0 +1,24 @@ +/* Test AAPCS layout (VFP variant for Neon types) */ + +/* { dg-do run { target arm*-*-*eabi* } } */ +/* { dg-require-effective-target arm_hard_vfp_ok } */ +/* { dg-require-effective-target arm_neon_ok } */ +/* { dg-require-effective-target arm32 } */ +/* { dg-add-options arm_neon } */ + + +#ifndef IN_FRAMEWORK +#define VFP +#define NEON +#define TESTFILE "neon-vect6.c" +#include "neon-constants.h" + + +#include "abitest.h" +#else + +ARG(int32x4_t, i32x4_constvec2, Q0) /* D0, D1 */ +ARG(int32x4x3_t, i32x4x3_constvec1, Q1) /* Q1, Q2, Q3 */ +ARG(int32x4x3_t, i32x4x3_constvec2, STACK) +LAST_ARG(int, 3, R0) +#endif diff --git a/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/neon-vect7.c b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/neon-vect7.c new file mode 100644 index 000000000..f8d1d0730 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/neon-vect7.c @@ -0,0 +1,27 @@ +/* Test AAPCS layout (VFP variant for Neon types) */ + +/* { dg-do run { target arm*-*-*eabi* } } */ +/* { dg-require-effective-target arm_hard_vfp_ok } */ +/* { dg-require-effective-target arm_neon_ok } */ +/* { dg-require-effective-target arm32 } */ +/* { dg-add-options arm_neon } */ + + +#ifndef IN_FRAMEWORK +#define VFP +#define NEON +#define TESTFILE "neon-vect7.c" +#include "neon-constants.h" + + +#include "abitest.h" +#else + +ARG(float, 24.3f, S0) /* S0 , D0, Q0 */ +ARG(int32x4x3_t, i32x4x3_constvec1, Q1) /* Q1, Q2, Q3 */ +ARG(double, 25.6, D1) +ARG(float, 12.67f, S1) +ARG(int32x4x3_t, i32x4x3_constvec2, STACK) +ARG(double, 2.47, STACK+sizeof(int32x4x3_t)) +LAST_ARG(int, 3, R0) +#endif diff --git a/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/neon-vect8.c b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/neon-vect8.c new file mode 100644 index 000000000..f2c295d84 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/neon-vect8.c @@ -0,0 +1,27 @@ +/* Test AAPCS layout (VFP variant for Neon types) */ + +/* { dg-do run { target arm*-*-*eabi* } } */ +/* { dg-require-effective-target arm_hard_vfp_ok } */ +/* { dg-require-effective-target arm_neon_ok } */ +/* { dg-require-effective-target arm32 } */ +/* { dg-add-options arm_neon } */ + + +#ifndef IN_FRAMEWORK +#define VFP +#define NEON +#define TESTFILE "neon-vect8.c" +#include "neon-constants.h" + + +#include "abitest.h" +#else + +ARG(float, 24.3f, S0) /* S0 , D0, Q0 */ +ARG(int32x2_t, i32x2_constvec1, D1) /* D1 */ +ARG(double, 25.6, D2) +ARG(float, 12.67f, S1) +ARG(int32x4x3_t, i32x4x3_constvec2, STACK) +ARG(double, 2.47, STACK+sizeof(int32x4x3_t)) +LAST_ARG(int, 3, R0) +#endif diff --git a/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp1.c b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp1.c new file mode 100644 index 000000000..9fb926dbd --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp1.c @@ -0,0 +1,17 @@ +/* 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 "vfp1.c" +#include "abitest.h" + +#else + ARG(int, 4, R0) + ARG(double, 4.0, D0) + LAST_ARG(int, 3, R1) +#endif diff --git a/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp10.c b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp10.c new file mode 100644 index 000000000..c3a1b39a9 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp10.c @@ -0,0 +1,38 @@ +/* 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 "vfp10.c" + +__complex__ x = 1.0+2.0i; + +struct y +{ + int p; + int q; + int r; + int s; +} v = { 1, 2, 3, 4 }; + +struct z +{ + double x[4]; +}; + +struct z a = { 5.0, 6.0, 7.0, 8.0 }; +struct z b = { 9.0, 10.0, 11.0, 12.0 }; + +#include "abitest.h" +#else + /* A variadic function passes using the base ABI */ + ARG(double, 11.0, R0) + DOTS + ANON(struct z, a, R2) + ANON(struct z, b, STACK+24) + LAST_ANON(double, 0.5, STACK+56) +#endif diff --git a/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp11.c b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp11.c new file mode 100644 index 000000000..a496a3ed5 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp11.c @@ -0,0 +1,39 @@ +/* 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 "vfp11.c" + +__complex__ x = 1.0+2.0i; + +struct y +{ + int p; + int q; + int r; + int s; +} v = { 1, 2, 3, 4 }; + +struct z +{ + double x[4]; +}; + +struct z a = { 5.0, 6.0, 7.0, 8.0 }; +struct z b = { 9.0, 10.0, 11.0, 12.0 }; + +#define MYFUNCTYPE struct y + +#include "abitest.h" +#else + ARG(int, 7, R1) + ARG(struct y, v, R2) + ARG(struct z, a, D0) + ARG(struct z, b, D4) + LAST_ARG(double, 0.5, STACK+8) +#endif diff --git a/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp12.c b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp12.c new file mode 100644 index 000000000..bbfa3df90 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp12.c @@ -0,0 +1,38 @@ +/* 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 "vfp12.c" + +__complex__ x = 1.0+2.0i; + +struct y +{ + int p; + int q; + int r; + int s; +} v = { 1, 2, 3, 4 }; + +struct z +{ + double x[4]; +}; + +struct z a = { 5.0, 6.0, 7.0, 8.0 }; +struct z b = { 9.0, 10.0, 11.0, 12.0 }; + +#include "abitest.h" +#else + ARG(int, 7, R0) + ARG(struct y, v, R1) + ARG(struct z, a, D0) + ARG(double, 1.0, D4) + ARG(struct z, b, STACK+8) + LAST_ARG(double, 0.5, STACK+40) +#endif diff --git a/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp13.c b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp13.c new file mode 100644 index 000000000..a46361c09 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp13.c @@ -0,0 +1,39 @@ +/* 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 "vfp13.c" + +__complex__ x = 1.0+2.0i; + +struct y +{ + int p; + int q; + int r; + int s; +} v = { 1, 2, 3, 4 }; + +struct z +{ + double x[4]; +}; + +struct z a = { 5.0, 6.0, 7.0, 8.0 }; +struct z b = { 9.0, 10.0, 11.0, 12.0 }; + +#include "abitest.h" +#else + ARG(int, 7, R0) + ARG(int, 9, R1) + ARG(struct z, a, D0) + ARG(double, 1.0, D4) + ARG(struct z, b, STACK) + ARG(int, 4, R2) + LAST_ARG(double, 0.5, STACK+32) +#endif diff --git a/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp14.c b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp14.c new file mode 100644 index 000000000..43c19f2dd --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp14.c @@ -0,0 +1,24 @@ +/* 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 "vfp14.c" + +#include "abitest.h" +#else + ARG(double, 1.0, D0) + ARG(double, 2.0, D1) + ARG(double, 3.0, D2) + ARG(double, 4.0, D3) + ARG(double, 5.0, D4) + ARG(double, 6.0, D5) + ARG(double, 7.0, D6) + ARG(double, 8.0, D7) + ARG(double, 9.0, STACK) + LAST_ARG(double, 10.0, STACK+8) +#endif diff --git a/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp15.c b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp15.c new file mode 100644 index 000000000..c98ca3810 --- /dev/null +++ b/gcc-4.9/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-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp16.c b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp16.c new file mode 100644 index 000000000..956bc0ab5 --- /dev/null +++ b/gcc-4.9/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-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp17.c b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp17.c new file mode 100644 index 000000000..9044ec221 --- /dev/null +++ b/gcc-4.9/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 diff --git a/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp2.c b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp2.c new file mode 100644 index 000000000..bfe90675b --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp2.c @@ -0,0 +1,19 @@ +/* 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 "vfp2.c" +#include "abitest.h" + +#else + ARG(float, 1.0f, S0) + ARG(double, 4.0, D1) + ARG(float, 2.0f, S1) + ARG(double, 5.0, D2) + LAST_ARG(int, 3, R0) +#endif diff --git a/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp3.c b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp3.c new file mode 100644 index 000000000..0e645d711 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp3.c @@ -0,0 +1,21 @@ +/* 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 "vfp3.c" + +__complex__ x = 1.0+2.0i; + +#include "abitest.h" +#else + ARG(float, 1.0f, S0) + ARG(__complex__ double, x, D1) + ARG(float, 2.0f, S1) + ARG(double, 5.0, D3) + LAST_ARG(int, 3, R0) +#endif diff --git a/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp4.c b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp4.c new file mode 100644 index 000000000..46dc4b98a --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp4.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 "vfp4.c" + +__complex__ float x = 1.0f + 2.0fi; +#include "abitest.h" +#else + ARG(float, 1.0f, S0) + ARG(__complex__ float, x, S1) + ARG(float, 2.0f, S3) + ARG(double, 5.0, D2) + LAST_ARG(int, 3, R0) +#endif diff --git a/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp5.c b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp5.c new file mode 100644 index 000000000..216d98ea8 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp5.c @@ -0,0 +1,30 @@ +/* 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 "vfp5.c" + +__complex__ float x = 1.0+2.0i; + +struct y +{ + int p; + int q; + int r; + int s; +} v = { 1, 2, 3, 4 }; + +#include "abitest.h" +#else + ARG(float, 1.0f, S0) + ARG(__complex__ float, x, S1) + ARG(float, 2.0f, S3) + ARG(double, 5.0, D2) + ARG(struct y, v, R0) + LAST_ARG(int, 3, STACK) +#endif diff --git a/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp6.c b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp6.c new file mode 100644 index 000000000..4d718da45 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp6.c @@ -0,0 +1,30 @@ +/* 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 "vfp6.c" + +__complex__ float x = 1.0+2.0i; + +struct y +{ + int p; + int q; + int r; + int s; +} v = { 1, 2, 3, 4 }; + +#include "abitest.h" +#else + ARG(struct y, v, R0) + ARG(float, 1.0f, S0) + ARG(__complex__ float, x, S1) + ARG(float, 2.0f, S3) + ARG(double, 5.0, D2) + LAST_ARG(int, 3, STACK) +#endif diff --git a/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp7.c b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp7.c new file mode 100644 index 000000000..3e57e45c7 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp7.c @@ -0,0 +1,37 @@ +/* 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 "vfp7.c" + +__complex__ x = 1.0+2.0i; + +struct y +{ + int p; + int q; + int r; + int s; +} v = { 1, 2, 3, 4 }; + +struct z +{ + double x[4]; +}; + +struct z a = { 5.0, 6.0, 7.0, 8.0 }; +struct z b = { 9.0, 10.0, 11.0, 12.0 }; + +#include "abitest.h" +#else + ARG(struct z, a, D0) + ARG(struct z, b, D4) + ARG(double, 0.5, STACK) + ARG(int, 7, R0) + LAST_ARG(struct y, v, STACK+8) +#endif diff --git a/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp8.c b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp8.c new file mode 100644 index 000000000..e55006885 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp8.c @@ -0,0 +1,37 @@ +/* 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 "vfp8.c" + +__complex__ x = 1.0+2.0i; + +struct y +{ + int p; + int q; + int r; + int s; +} v = { 1, 2, 3, 4 }; + +struct z +{ + double x[4]; +}; + +struct z a = { 5.0, 6.0, 7.0, 8.0 }; +struct z b = { 9.0, 10.0, 11.0, 12.0 }; + +#include "abitest.h" +#else + ARG(int, 7, R0) + ARG(struct y, v, R1) + ARG(struct z, a, D0) + ARG(struct z, b, D4) + LAST_ARG(double, 0.5, STACK+8) +#endif diff --git a/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp9.c b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp9.c new file mode 100644 index 000000000..c2be6bf4b --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/arm/aapcs/vfp9.c @@ -0,0 +1,38 @@ +/* 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 "vfp9.c" + +__complex__ x = 1.0+2.0i; + +struct y +{ + int p; + int q; + int r; + int s; +} v = { 1, 2, 3, 4 }; + +struct z +{ + double x[4]; +}; + +struct z a = { 5.0, 6.0, 7.0, 8.0 }; +struct z b = { 9.0, 10.0, 11.0, 12.0 }; + +#include "abitest.h" +#else + /* A variadic function passes using the base ABI */ + ARG(int, 7, R0) + DOTS + ANON(struct z, a, R2) + ANON(struct z, b, STACK+24) + LAST_ANON(double, 0.5, STACK+56) +#endif |