aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.4.3/gcc/testsuite/gcc.target/arm
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.4.3/gcc/testsuite/gcc.target/arm')
-rw-r--r--gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/aapcs.exp35
-rw-r--r--gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/abitest.h122
-rw-r--r--gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp1.c17
-rw-r--r--gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp10.c38
-rw-r--r--gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp11.c39
-rw-r--r--gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp12.c38
-rw-r--r--gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp13.c39
-rw-r--r--gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp14.c24
-rw-r--r--gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp15.c20
-rw-r--r--gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp16.c22
-rw-r--r--gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp17.c20
-rw-r--r--gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp2.c19
-rw-r--r--gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp3.c21
-rw-r--r--gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp4.c20
-rw-r--r--gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp5.c30
-rw-r--r--gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp6.c30
-rw-r--r--gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp7.c37
-rw-r--r--gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp8.c37
-rw-r--r--gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp9.c38
-rw-r--r--gcc-4.4.3/gcc/testsuite/gcc.target/arm/eabi1.c71
-rw-r--r--gcc-4.4.3/gcc/testsuite/gcc.target/arm/g2.c2
-rw-r--r--gcc-4.4.3/gcc/testsuite/gcc.target/arm/loop-autoinc.c18
-rw-r--r--gcc-4.4.3/gcc/testsuite/gcc.target/arm/mmx-1.c2
-rw-r--r--gcc-4.4.3/gcc/testsuite/gcc.target/arm/pr44999.c9
-rw-r--r--gcc-4.4.3/gcc/testsuite/gcc.target/arm/pr46631.c16
-rw-r--r--gcc-4.4.3/gcc/testsuite/gcc.target/arm/scd42-2.c2
-rw-r--r--gcc-4.4.3/gcc/testsuite/gcc.target/arm/thumb2-cmpneg2add-1.c12
-rw-r--r--gcc-4.4.3/gcc/testsuite/gcc.target/arm/thumb2-cmpneg2add-2.c12
28 files changed, 757 insertions, 33 deletions
diff --git a/gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/aapcs.exp b/gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/aapcs.exp
new file mode 100644
index 000000000..fcc433346
--- /dev/null
+++ b/gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/aapcs.exp
@@ -0,0 +1,35 @@
+# Copyright (C) 1997, 2004, 2006, 2007 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.4.3/gcc/testsuite/gcc.target/arm/aapcs/abitest.h b/gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/abitest.h
new file mode 100644
index 000000000..7b7d0e24f
--- /dev/null
+++ b/gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/abitest.h
@@ -0,0 +1,122 @@
+#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
+
+#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 R0 128
+#define R1 132
+#define R2 136
+#define R3 140
+
+#define STACK 144
+
+#else
+
+#define R0 0
+#define R1 4
+#define R2 8
+#define R3 12
+
+#define STACK 16
+
+#endif
+
+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.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp1.c b/gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp1.c
new file mode 100644
index 000000000..9fb926dbd
--- /dev/null
+++ b/gcc-4.4.3/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.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp10.c b/gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp10.c
new file mode 100644
index 000000000..c3a1b39a9
--- /dev/null
+++ b/gcc-4.4.3/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.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp11.c b/gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp11.c
new file mode 100644
index 000000000..a496a3ed5
--- /dev/null
+++ b/gcc-4.4.3/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.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp12.c b/gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp12.c
new file mode 100644
index 000000000..bbfa3df90
--- /dev/null
+++ b/gcc-4.4.3/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.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp13.c b/gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp13.c
new file mode 100644
index 000000000..a46361c09
--- /dev/null
+++ b/gcc-4.4.3/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.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp14.c b/gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp14.c
new file mode 100644
index 000000000..43c19f2dd
--- /dev/null
+++ b/gcc-4.4.3/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.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp15.c b/gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp15.c
new file mode 100644
index 000000000..c98ca3810
--- /dev/null
+++ b/gcc-4.4.3/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.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp16.c b/gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp16.c
new file mode 100644
index 000000000..956bc0ab5
--- /dev/null
+++ b/gcc-4.4.3/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.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp17.c b/gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp17.c
new file mode 100644
index 000000000..9044ec221
--- /dev/null
+++ b/gcc-4.4.3/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.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp2.c b/gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp2.c
new file mode 100644
index 000000000..bfe90675b
--- /dev/null
+++ b/gcc-4.4.3/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.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp3.c b/gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp3.c
new file mode 100644
index 000000000..0e645d711
--- /dev/null
+++ b/gcc-4.4.3/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.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp4.c b/gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp4.c
new file mode 100644
index 000000000..46dc4b98a
--- /dev/null
+++ b/gcc-4.4.3/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.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp5.c b/gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp5.c
new file mode 100644
index 000000000..216d98ea8
--- /dev/null
+++ b/gcc-4.4.3/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.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp6.c b/gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp6.c
new file mode 100644
index 000000000..4d718da45
--- /dev/null
+++ b/gcc-4.4.3/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.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp7.c b/gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp7.c
new file mode 100644
index 000000000..3e57e45c7
--- /dev/null
+++ b/gcc-4.4.3/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.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp8.c b/gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp8.c
new file mode 100644
index 000000000..e55006885
--- /dev/null
+++ b/gcc-4.4.3/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.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp9.c b/gcc-4.4.3/gcc/testsuite/gcc.target/arm/aapcs/vfp9.c
new file mode 100644
index 000000000..c2be6bf4b
--- /dev/null
+++ b/gcc-4.4.3/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
diff --git a/gcc-4.4.3/gcc/testsuite/gcc.target/arm/eabi1.c b/gcc-4.4.3/gcc/testsuite/gcc.target/arm/eabi1.c
index e88ba021f..c90f5ff08 100644
--- a/gcc-4.4.3/gcc/testsuite/gcc.target/arm/eabi1.c
+++ b/gcc-4.4.3/gcc/testsuite/gcc.target/arm/eabi1.c
@@ -30,43 +30,48 @@
#include <stdlib.h>
#include <math.h>
-#define decl_float(code, type) \
- extern type __aeabi_ ## code ## add (type, type); \
- extern type __aeabi_ ## code ## div (type, type); \
- extern type __aeabi_ ## code ## mul (type, type); \
- extern type __aeabi_ ## code ## neg (type); \
- extern type __aeabi_ ## code ## rsub (type, type); \
- extern type __aeabi_ ## code ## sub (type, type); \
- extern int __aeabi_ ## code ## cmpeq (type, type); \
- extern int __aeabi_ ## code ## cmplt (type, type); \
- extern int __aeabi_ ## code ## cmple (type, type); \
- extern int __aeabi_ ## code ## cmpge (type, type); \
- extern int __aeabi_ ## code ## cmpgt (type, type); \
- extern int __aeabi_ ## code ## cmpun (type, type); \
- extern int __aeabi_ ## code ## 2iz (type); \
- extern unsigned int __aeabi_ ## code ## 2uiz (type); \
- extern long long __aeabi_ ## code ## 2lz (type); \
- extern unsigned long long __aeabi_ ## code ## 2ulz (type); \
- extern type __aeabi_i2 ## code (int); \
- extern type __aeabi_ui2 ## code (int); \
- extern type __aeabi_l2 ## code (long long); \
- extern type __aeabi_ul2 ## code (unsigned long long); \
- \
- type code ## zero = 0.0; \
- type code ## one = 1.0; \
- type code ## two = 2.0; \
- type code ## four = 4.0; \
- type code ## minus_one = -1.0; \
- type code ## minus_two = -2.0; \
- type code ## minus_four = -4.0; \
- type code ## epsilon = 1E-32; \
- type code ## NaN = 0.0 / 0.0;
+/* All these functions are defined to use the base ABI, so use the
+ attribute to ensure the tests use the base ABI to call them even
+ when the VFP ABI is otherwise in effect. */
+#define PCS __attribute__((pcs("aapcs")))
+
+#define decl_float(code, type) \
+ extern type __aeabi_ ## code ## add (type, type) PCS; \
+ extern type __aeabi_ ## code ## div (type, type) PCS; \
+ extern type __aeabi_ ## code ## mul (type, type) PCS; \
+ extern type __aeabi_ ## code ## neg (type) PCS; \
+ extern type __aeabi_ ## code ## rsub (type, type) PCS; \
+ extern type __aeabi_ ## code ## sub (type, type) PCS; \
+ extern int __aeabi_ ## code ## cmpeq (type, type) PCS; \
+ extern int __aeabi_ ## code ## cmplt (type, type) PCS; \
+ extern int __aeabi_ ## code ## cmple (type, type) PCS; \
+ extern int __aeabi_ ## code ## cmpge (type, type) PCS; \
+ extern int __aeabi_ ## code ## cmpgt (type, type) PCS; \
+ extern int __aeabi_ ## code ## cmpun (type, type) PCS; \
+ extern int __aeabi_ ## code ## 2iz (type) PCS; \
+ extern unsigned int __aeabi_ ## code ## 2uiz (type) PCS; \
+ extern long long __aeabi_ ## code ## 2lz (type) PCS; \
+ extern unsigned long long __aeabi_ ## code ## 2ulz (type) PCS; \
+ extern type __aeabi_i2 ## code (int) PCS; \
+ extern type __aeabi_ui2 ## code (int) PCS; \
+ extern type __aeabi_l2 ## code (long long) PCS; \
+ extern type __aeabi_ul2 ## code (unsigned long long) PCS; \
+ \
+ type code ## zero = 0.0; \
+ type code ## one = 1.0; \
+ type code ## two = 2.0; \
+ type code ## four = 4.0; \
+ type code ## minus_one = -1.0; \
+ type code ## minus_two = -2.0; \
+ type code ## minus_four = -4.0; \
+ type code ## epsilon = 1E-32; \
+ type code ## NaN = 0.0 / 0.0;
decl_float (d, double)
decl_float (f, float)
-extern float __aeabi_d2f (double);
-extern double __aeabi_f2d (float);
+extern float __aeabi_d2f (double) PCS;
+extern double __aeabi_f2d (float) PCS;
extern long long __aeabi_lmul (long long, long long);
extern long long __aeabi_llsl (long long, int);
extern long long __aeabi_llsr (long long, int);
diff --git a/gcc-4.4.3/gcc/testsuite/gcc.target/arm/g2.c b/gcc-4.4.3/gcc/testsuite/gcc.target/arm/g2.c
index 031b93657..85ba1906a 100644
--- a/gcc-4.4.3/gcc/testsuite/gcc.target/arm/g2.c
+++ b/gcc-4.4.3/gcc/testsuite/gcc.target/arm/g2.c
@@ -2,6 +2,8 @@
/* { dg-do compile } */
/* { dg-options "-mcpu=xscale -O2" } */
/* { dg-skip-if "Test is specific to the Xscale" { arm*-*-* } { "-march=*" } { "-march=xscale" } } */
+/* { dg-skip-if "Test is specific to the Xscale" { arm*-*-* } { "-mcpu=*" } { "-mcpu=xscale" } } */
+/* { dg-skip-if "Test is specific to ARM mode" { arm*-*-* } { "-mthumb" } { "" } } */
/* { dg-require-effective-target arm32 } */
/* Brett Gaines' test case. */
diff --git a/gcc-4.4.3/gcc/testsuite/gcc.target/arm/loop-autoinc.c b/gcc-4.4.3/gcc/testsuite/gcc.target/arm/loop-autoinc.c
new file mode 100644
index 000000000..f94c49ee7
--- /dev/null
+++ b/gcc-4.4.3/gcc/testsuite/gcc.target/arm/loop-autoinc.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-mthumb -Os" } */
+/* { dg-require-effective-target arm_thumb2_ok } */
+/* { dg-final { scan-assembler "ldr\t.*\], #4" } } */
+
+extern int x[];
+extern void bar();
+int foo ()
+{
+ int i;
+ int sum = 0;
+ for (i = 0; i < 100; i++) {
+ sum += x[i];
+ if (sum & 1)
+ sum *= sum;
+ }
+ return sum;
+}
diff --git a/gcc-4.4.3/gcc/testsuite/gcc.target/arm/mmx-1.c b/gcc-4.4.3/gcc/testsuite/gcc.target/arm/mmx-1.c
index 21cc47912..1240ffa63 100644
--- a/gcc-4.4.3/gcc/testsuite/gcc.target/arm/mmx-1.c
+++ b/gcc-4.4.3/gcc/testsuite/gcc.target/arm/mmx-1.c
@@ -4,7 +4,9 @@
/* { dg-skip-if "Test is specific to the iWMMXt" { arm*-*-* } { "-mcpu=*" } { "-mcpu=iwmmxt" } } */
/* { dg-skip-if "Test is specific to the iWMMXt" { arm*-*-* } { "-mabi=*" } { "-mabi=iwmmxt" } } */
/* { dg-skip-if "Test is specific to the iWMMXt" { arm*-*-* } { "-mfloat-abi=softfp" } { "" } } */
+/* { dg-skip-if "Test is specific to the iWMMXt" { arm*-*-* } { "-mfloat-abi=hard" } { "" } } */
/* { dg-skip-if "Test is specific to the iWMMXt" { arm*-*-* } { "-march=*" } { "-march=iwmmxt" } } */
+/* { dg-skip-if "Test is specific to ARM mode" { arm*-*-* } { "-mthumb" } { "" } } */
/* { dg-options "-O -mno-apcs-frame -mcpu=iwmmxt -mabi=iwmmxt" } */
/* { dg-require-effective-target arm32 } */
/* { dg-final { scan-assembler "ldmfd\[ ]sp!.*ip,\[ ]*pc" } } */
diff --git a/gcc-4.4.3/gcc/testsuite/gcc.target/arm/pr44999.c b/gcc-4.4.3/gcc/testsuite/gcc.target/arm/pr44999.c
new file mode 100644
index 000000000..d07dca1a0
--- /dev/null
+++ b/gcc-4.4.3/gcc/testsuite/gcc.target/arm/pr44999.c
@@ -0,0 +1,9 @@
+/* Use UXTB to extract the lowest byte. */
+/* { dg-options "-mthumb -Os" } */
+/* { dg-require-effective-target arm_thumb2_ok } */
+/* { dg-final { scan-assembler "uxtb" } } */
+
+int tp(int x, int y)
+{
+ return (x & 0xff) - (y & 0xffff);
+}
diff --git a/gcc-4.4.3/gcc/testsuite/gcc.target/arm/pr46631.c b/gcc-4.4.3/gcc/testsuite/gcc.target/arm/pr46631.c
new file mode 100644
index 000000000..6f6dc4e85
--- /dev/null
+++ b/gcc-4.4.3/gcc/testsuite/gcc.target/arm/pr46631.c
@@ -0,0 +1,16 @@
+/* { dg-options "-mthumb -Os" } */
+/* { dg-require-effective-target arm_thumb2_ok } */
+/* { dg-final { scan-assembler "ands" } } */
+
+struct S {
+ int bi_buf;
+ int bi_valid;
+};
+
+int tz (struct S* p, int bits, int value)
+{
+ if (p == 0) return 1;
+ p->bi_valid = bits;
+ p->bi_buf = value & ((1 << bits) - 1);
+ return 0;
+}
diff --git a/gcc-4.4.3/gcc/testsuite/gcc.target/arm/scd42-2.c b/gcc-4.4.3/gcc/testsuite/gcc.target/arm/scd42-2.c
index 0c372983a..e07740234 100644
--- a/gcc-4.4.3/gcc/testsuite/gcc.target/arm/scd42-2.c
+++ b/gcc-4.4.3/gcc/testsuite/gcc.target/arm/scd42-2.c
@@ -2,6 +2,8 @@
/* { dg-do compile } */
/* { dg-options "-mcpu=xscale -O" } */
/* { dg-skip-if "Test is specific to the Xscale" { arm*-*-* } { "-march=*" } { "-march=xscale" } } */
+/* { dg-skip-if "Test is specific to the Xscale" { arm*-*-* } { "-mcpu=*" } { "-mcpu=xscale" } } */
+/* { dg-skip-if "Test is specific to ARM mode" { arm*-*-* } { "-mthumb" } { "" } } */
/* { dg-require-effective-target arm32 } */
unsigned load2(void) __attribute__ ((naked));
diff --git a/gcc-4.4.3/gcc/testsuite/gcc.target/arm/thumb2-cmpneg2add-1.c b/gcc-4.4.3/gcc/testsuite/gcc.target/arm/thumb2-cmpneg2add-1.c
new file mode 100644
index 000000000..d75f13aa0
--- /dev/null
+++ b/gcc-4.4.3/gcc/testsuite/gcc.target/arm/thumb2-cmpneg2add-1.c
@@ -0,0 +1,12 @@
+/* Use ADDS clobbering source operand, rather than CMN */
+/* { dg-options "-mthumb -Os" } */
+/* { dg-require-effective-target arm_thumb2_ok } */
+/* { dg-final { scan-assembler "adds" } } */
+/* { dg-final { scan-assembler-not "cmn" } } */
+
+void foo1(void);
+void bar5(int x)
+{
+ if (x == -15)
+ foo1();
+}
diff --git a/gcc-4.4.3/gcc/testsuite/gcc.target/arm/thumb2-cmpneg2add-2.c b/gcc-4.4.3/gcc/testsuite/gcc.target/arm/thumb2-cmpneg2add-2.c
new file mode 100644
index 000000000..358bc6e14
--- /dev/null
+++ b/gcc-4.4.3/gcc/testsuite/gcc.target/arm/thumb2-cmpneg2add-2.c
@@ -0,0 +1,12 @@
+/* Use ADDS with a scratch, rather than CMN */
+/* { dg-options "-mthumb -Os" } */
+/* { dg-require-effective-target arm_thumb2_ok } */
+/* { dg-final { scan-assembler "adds" } } */
+/* { dg-final { scan-assembler-not "cmn" } } */
+
+void foo1(int);
+void bar5(int x)
+{
+ if (x == -1)
+ foo1(x);
+}