diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-07-08 16:18:49 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-07-08 16:18:49 +0000 |
commit | 71fd77c9b4b3398097c48d6c1d3be7296d670f89 (patch) | |
tree | ca77b69e8b4f032f1066c6a31847233f9db7f8e5 /gcc/testsuite/gcc.dg | |
parent | 313793ac30b7208dfb273ab1823bed6b0c20deb4 (diff) | |
download | gcc-71fd77c9b4b3398097c48d6c1d3be7296d670f89.tar.gz |
2008-07-08 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r137620
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@137632 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg')
63 files changed, 804 insertions, 69 deletions
diff --git a/gcc/testsuite/gcc.dg/20030702-1.c b/gcc/testsuite/gcc.dg/20030702-1.c index 892f7d50539..4dbb4c50fc5 100644 --- a/gcc/testsuite/gcc.dg/20030702-1.c +++ b/gcc/testsuite/gcc.dg/20030702-1.c @@ -2,6 +2,7 @@ correctly in combine. */ /* { dg-do compile { target fpic } } */ /* { dg-options "-O2 -fpic -fprofile-arcs" } */ +/* { dg-skip-if "requires unsupported run-time relocation" { spu-*-* } { "*" } { "" } } */ void test (void) { diff --git a/gcc/testsuite/gcc.dg/callabi/callabi.h b/gcc/testsuite/gcc.dg/callabi/callabi.h new file mode 100644 index 00000000000..d008ad659cb --- /dev/null +++ b/gcc/testsuite/gcc.dg/callabi/callabi.h @@ -0,0 +1,50 @@ +/* First the default target definition. */ +#ifndef __GNUC_VA_LIST +#define __GNUC_VA_LIST + typedef __builtin_va_list __gnuc_va_list; +#endif + +#ifndef _VA_LIST_DEFINED +#define _VA_LIST_DEFINED + typedef __gnuc_va_list va_list; +#endif + +#define __va_copy(d,s) __builtin_va_copy(d,s) +#define __va_start(v,l) __builtin_va_start(v,l) +#define __va_arg(v,l) __builtin_va_arg(v,l) +#define __va_end(v) __builtin_va_end(v) + +#define __ms_va_copy(d,s) __builtin_ms_va_copy(d,s) +#define __ms_va_start(v,l) __builtin_ms_va_start(v,l) +#define __ms_va_arg(v,l) __builtin_va_arg(v,l) +#define __ms_va_end(v) __builtin_ms_va_end(v) + +#define __sysv_va_copy(d,s) __builtin_sysv_va_copy(d,s) +#define __sysv_va_start(v,l) __builtin_sysv_va_start(v,l) +#define __sysv_va_arg(v,l) __builtin_va_arg(v,l) +#define __sysv_va_end(v) __builtin_sysv_va_end(v) + +#define CALLABI_NATIVE + +#ifdef _WIN64 +#define CALLABI_CROSS __attribute__ ((sysv_abi)) + +#define CROSS_VA_LIST __builtin_sysv_va_list + +#define CROSS_VA_COPY(d,s) __sysv_va_copy(d,s) +#define CROSS_VA_START(v,l) __sysv_va_start(v,l) +#define CROSS_VA_ARG(v,l) __sysv_va_arg(v,l) +#define CROSS_VA_END(v) __sysv_va_end(v) + +#else + +#define CALLABI_CROSS __attribute__ ((ms_abi)) + +#define CROSS_VA_LIST __builtin_ms_va_list + +#define CROSS_VA_COPY(d,s) __ms_va_copy(d,s) +#define CROSS_VA_START(v,l) __ms_va_start(v,l) +#define CROSS_VA_ARG(v,l) __ms_va_arg(v,l) +#define CROSS_VA_END(v) __ms_va_end(v) + +#endif
\ No newline at end of file diff --git a/gcc/testsuite/gcc.dg/callabi/func-1.c b/gcc/testsuite/gcc.dg/callabi/func-1.c new file mode 100644 index 00000000000..c727dbe6e53 --- /dev/null +++ b/gcc/testsuite/gcc.dg/callabi/func-1.c @@ -0,0 +1,40 @@ +/* Test for cross x86_64<->w64 abi standard calls. +*/ +/* Origin: Kai Tietz <kai.tietz@onevision.com> */ +/* { dg-do run { target { x86_64-*-* } } } */ +/* { dg-options "-std=gnu99 -ffast-math" } */ +#include "callabi.h" + +extern void abort (void); + +long double +CALLABI_CROSS func_cross (long double a, double b, float c, long d, int e, + char f) +{ + long double ret; + ret = a + (long double) b + (long double) c; + ret *= (long double) (d + (long) e); + if (f>0) + ret += func_cross (a,b,c,d,e,-f); + return ret; +} + +long double +CALLABI_NATIVE func_native (long double a, double b, float c, long d, int e, + char f) +{ + long double ret; + ret = a + (long double) b + (long double) c; + ret *= (long double) (d + (long) e); + if (f>0) + ret += func_native (a,b,c,d,e,-f); + return ret; +} + +int main () +{ + if (func_cross (1.0,2.0,3.0,1,2,3) + != func_native (1.0,2.0,3.0,1,2,3)) + abort (); + return 0; +}
\ No newline at end of file diff --git a/gcc/testsuite/gcc.dg/callabi/vaarg-1.c b/gcc/testsuite/gcc.dg/callabi/vaarg-1.c new file mode 100644 index 00000000000..1e745e56085 --- /dev/null +++ b/gcc/testsuite/gcc.dg/callabi/vaarg-1.c @@ -0,0 +1,47 @@ +/* Test for cross x86_64<->w64 abi va_list calls. +*/ +/* Origin: Kai Tietz <kai.tietz@onevision.com> */ +/* { dg-do run { target { x86_64-*-* } } } */ +/* { dg-options "-std=gnu99" } */ +#include "callabi.h" + +extern __SIZE_TYPE__ strlen (const char *); +extern int sprintf (char *,const char *, ...); +extern void abort (void); + +static +void CALLABI_CROSS vdo_cpy (char *s, CROSS_VA_LIST argp) +{ + __SIZE_TYPE__ len; + char *r = s; + char *e; + *r = 0; + for (;;) { + e = CROSS_VA_ARG (argp,char *); + if (*e == 0) break; + sprintf (r,"%s", e); + r += strlen (r); + } +} + +static +void CALLABI_CROSS do_cpy (char *s, ...) +{ + CROSS_VA_LIST argp; + CROSS_VA_START (argp, s); + vdo_cpy (s, argp); + CROSS_VA_END (argp); +} + +int main () +{ + char s[256]; + + do_cpy (s, "1","2","3","4", "5", "6", "7", ""); + + if (s[0] != '1' || s[1] !='2' || s[2] != '3' || s[3] != '4' + || s[4] != '5' || s[5] != '6' || s[6] != '7' || s[7] != 0) + abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/callabi/vaarg-2.c b/gcc/testsuite/gcc.dg/callabi/vaarg-2.c new file mode 100644 index 00000000000..c9b716194a6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/callabi/vaarg-2.c @@ -0,0 +1,47 @@ +/* Test for cross x86_64<->w64 abi va_list calls. +*/ +/* Origin: Kai Tietz <kai.tietz@onevision.com> */ +/* { dg-do run { target { x86_64-*-* } } } */ +/* { dg-options "-std=gnu99" } */ +#include "callabi.h" + +extern void abort (void); + +#define SZ_ARGS 1ll,2ll,3ll,4ll,5ll,6ll,7ll,0ll + +static +int CALLABI_CROSS fct1 (va_list argp, ...) +{ + long long p1,p2; + int ret = 1; + CROSS_VA_LIST argp_2; + CROSS_VA_START (argp_2,argp); + + do { + p1 = CROSS_VA_ARG (argp_2, long long); + p2 = __va_arg (argp, long long); + if (p1 != p2) + ret = 0; + } while (ret && p1 != 0); + CROSS_VA_END (argp_2); + return ret; +} + +static +int fct2 (int dummy, ...) +{ + va_list argp; + int ret = dummy; + + __va_start (argp, dummy); + ret += fct1 (argp, SZ_ARGS); + __va_end (argp); + return ret; +} + +int main() +{ + if (fct2 (-1, SZ_ARGS) != 0) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/callabi/vaarg-3.c b/gcc/testsuite/gcc.dg/callabi/vaarg-3.c new file mode 100644 index 00000000000..d0d068754e1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/callabi/vaarg-3.c @@ -0,0 +1,47 @@ +/* Test for cross x86_64<->w64 abi va_list calls. +*/ +/* Origin: Kai Tietz <kai.tietz@onevision.com> */ +/* { dg-do run { target { x86_64-*-* } } } */ +/* { dg-options "-std=gnu99" } */ +#include "callabi.h" + +extern void abort (void); + +#define SZ_ARGS 1ll,2ll,3ll,4ll,5ll,6ll,7ll,0ll + +static +int fct1 (CROSS_VA_LIST argp, ...) +{ + long long p1,p2; + int ret = 1; + va_list argp_2; + + __va_start (argp_2,argp); + do { + p1 = __va_arg (argp_2, long long); + p2 = CROSS_VA_ARG (argp, long long); + if (p1 != p2) + ret = 0; + } while (ret && p1 != 0); + __va_end (argp_2); + return ret; +} + +static +int CALLABI_CROSS fct2 (int dummy, ...) +{ + CROSS_VA_LIST argp; + int ret = dummy; + + CROSS_VA_START (argp, dummy); + ret += fct1 (argp, SZ_ARGS); + CROSS_VA_END (argp); + return ret; +} + +int main() +{ + if (fct2 (-1, SZ_ARGS) != 0) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-16_x.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-16_x.c index 6b7331833ae..eb995921467 100644 --- a/gcc/testsuite/gcc.dg/compat/struct-by-value-16_x.c +++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-16_x.c @@ -19,10 +19,7 @@ TEST(Scf9, _Complex float) TEST(Scf10, _Complex float) TEST(Scf11, _Complex float) TEST(Scf12, _Complex float) -TEST(Scf13, _Complex float) -TEST(Scf14, _Complex float) -TEST(Scf15, _Complex float) -TEST(Scf16, _Complex float) + #undef T @@ -45,10 +42,7 @@ T(Scf9, _Complex float) T(Scf10, _Complex float) T(Scf11, _Complex float) T(Scf12, _Complex float) -T(Scf13, _Complex float) -T(Scf14, _Complex float) -T(Scf15, _Complex float) -T(Scf16, _Complex float) + DEBUG_FINI diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-16_y.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-16_y.c index 273d7cc4f3e..9450815e74c 100644 --- a/gcc/testsuite/gcc.dg/compat/struct-by-value-16_y.c +++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-16_y.c @@ -27,7 +27,4 @@ TEST(Scf9, _Complex float) TEST(Scf10, _Complex float) TEST(Scf11, _Complex float) TEST(Scf12, _Complex float) -TEST(Scf13, _Complex float) -TEST(Scf14, _Complex float) -TEST(Scf15, _Complex float) -TEST(Scf16, _Complex float) + diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_main.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_main.c new file mode 100644 index 00000000000..6a71d15b8ec --- /dev/null +++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_main.c @@ -0,0 +1,14 @@ +/* Test structures passed by value, including to a function with a
+ variable-length argument lists. All struct members are of type
+ _Complex float. */
+
+extern void struct_by_value_16_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ struct_by_value_16a_x ();
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_x.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_x.c new file mode 100644 index 00000000000..0aa45249590 --- /dev/null +++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_x.c @@ -0,0 +1,37 @@ +#include "compat-common.h"
+
+#include "fp-struct-defs.h"
+#include "fp-struct-check.h"
+#include "fp-struct-test-by-value-x.h"
+
+DEFS(cf, _Complex float)
+CHECKS(cf, _Complex float)
+
+
+TEST(Scf13, _Complex float)
+TEST(Scf14, _Complex float)
+TEST(Scf15, _Complex float)
+TEST(Scf16, _Complex float)
+
+#undef T
+
+void
+struct_by_value_16a_x ()
+{
+DEBUG_INIT
+
+#define T(TYPE, MTYPE) testit##TYPE ();
+
+
+T(Scf13, _Complex float)
+T(Scf14, _Complex float)
+T(Scf15, _Complex float)
+T(Scf16, _Complex float)
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_y.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_y.c new file mode 100644 index 00000000000..2fd561ef044 --- /dev/null +++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_y.c @@ -0,0 +1,22 @@ +#include <stdarg.h>
+
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#include "fp-struct-defs.h"
+#include "fp-struct-init.h"
+#include "fp-struct-test-by-value-y.h"
+
+DEFS(cf,_Complex float)
+INITS(cf, _Complex float)
+
+
+TEST(Scf13, _Complex float)
+TEST(Scf14, _Complex float)
+TEST(Scf15, _Complex float)
+TEST(Scf16, _Complex float)
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-17_x.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-17_x.c index cba628bcb5b..93fd788ea45 100644 --- a/gcc/testsuite/gcc.dg/compat/struct-by-value-17_x.c +++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-17_x.c @@ -19,10 +19,7 @@ TEST(Scd9, _Complex double) TEST(Scd10, _Complex double) TEST(Scd11, _Complex double) TEST(Scd12, _Complex double) -TEST(Scd13, _Complex double) -TEST(Scd14, _Complex double) -TEST(Scd15, _Complex double) -TEST(Scd16, _Complex double) + #undef T @@ -45,10 +42,7 @@ T(Scd9, _Complex double) T(Scd10, _Complex double) T(Scd11, _Complex double) T(Scd12, _Complex double) -T(Scd13, _Complex double) -T(Scd14, _Complex double) -T(Scd15, _Complex double) -T(Scd16, _Complex double) + DEBUG_FINI diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-17_y.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-17_y.c index a0342a37c0c..f8ac0a7c15e 100644 --- a/gcc/testsuite/gcc.dg/compat/struct-by-value-17_y.c +++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-17_y.c @@ -27,7 +27,4 @@ TEST(Scd9, _Complex double) TEST(Scd10, _Complex double) TEST(Scd11, _Complex double) TEST(Scd12, _Complex double) -TEST(Scd13, _Complex double) -TEST(Scd14, _Complex double) -TEST(Scd15, _Complex double) -TEST(Scd16, _Complex double) + diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-17a_main.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-17a_main.c new file mode 100644 index 00000000000..1db00215f2c --- /dev/null +++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-17a_main.c @@ -0,0 +1,14 @@ +/* Test structures passed by value, including to a function with a + variable-length argument lists. All struct members are of type + _Complex double. */ + +extern void struct_by_value_17_x (void); +extern void exit (int); +int fails; + +int +main () +{ + struct_by_value_17a_x (); + exit (0); +} diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-17a_x.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-17a_x.c new file mode 100644 index 00000000000..5b2f1d1d920 --- /dev/null +++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-17a_x.c @@ -0,0 +1,37 @@ +#include "compat-common.h" + +#include "fp-struct-defs.h" +#include "fp-struct-check.h" +#include "fp-struct-test-by-value-x.h" + +DEFS(cd, _Complex double) +CHECKS(cd, _Complex double) + + +TEST(Scd13, _Complex double) +TEST(Scd14, _Complex double) +TEST(Scd15, _Complex double) +TEST(Scd16, _Complex double) + +#undef T + +void +struct_by_value_17a_x () +{ +DEBUG_INIT + +#define T(TYPE, MTYPE) testit##TYPE (); + + +T(Scd13, _Complex double) +T(Scd14, _Complex double) +T(Scd15, _Complex double) +T(Scd16, _Complex double) + +DEBUG_FINI + +if (fails != 0) + abort (); + +#undef T +} diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-17a_y.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-17a_y.c new file mode 100644 index 00000000000..d785a999d58 --- /dev/null +++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-17a_y.c @@ -0,0 +1,22 @@ +#include <stdarg.h> + +#include "compat-common.h" + +#ifdef SKIP_VA +const int test_va = 0; +#else +const int test_va = 1; +#endif + +#include "fp-struct-defs.h" +#include "fp-struct-init.h" +#include "fp-struct-test-by-value-y.h" + +DEFS(cd,_Complex double) +INITS(cd, _Complex double) + + +TEST(Scd13, _Complex double) +TEST(Scd14, _Complex double) +TEST(Scd15, _Complex double) +TEST(Scd16, _Complex double) diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-18_x.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-18_x.c index e040ecc79a7..f9dd6aa0b72 100644 --- a/gcc/testsuite/gcc.dg/compat/struct-by-value-18_x.c +++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-18_x.c @@ -19,10 +19,7 @@ TEST(Scld9, _Complex long double) TEST(Scld10, _Complex long double) TEST(Scld11, _Complex long double) TEST(Scld12, _Complex long double) -TEST(Scld13, _Complex long double) -TEST(Scld14, _Complex long double) -TEST(Scld15, _Complex long double) -TEST(Scld16, _Complex long double) + #undef T @@ -45,10 +42,7 @@ T(Scld9, _Complex long double) T(Scld10, _Complex long double) T(Scld11, _Complex long double) T(Scld12, _Complex long double) -T(Scld13, _Complex long double) -T(Scld14, _Complex long double) -T(Scld15, _Complex long double) -T(Scld16, _Complex long double) + DEBUG_FINI diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-18_y.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-18_y.c index b69425a5f4e..8c732d58273 100644 --- a/gcc/testsuite/gcc.dg/compat/struct-by-value-18_y.c +++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-18_y.c @@ -27,7 +27,4 @@ TEST(Scld9, _Complex long double) TEST(Scld10, _Complex long double) TEST(Scld11, _Complex long double) TEST(Scld12, _Complex long double) -TEST(Scld13, _Complex long double) -TEST(Scld14, _Complex long double) -TEST(Scld15, _Complex long double) -TEST(Scld16, _Complex long double) + diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-18a_main.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-18a_main.c new file mode 100644 index 00000000000..5b9dfd983b4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-18a_main.c @@ -0,0 +1,14 @@ +/* Test structures passed by value, including to a function with a
+ variable-length argument lists. All struct members are of type
+ _Complex long double. */
+
+extern void struct_by_value_18_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ struct_by_value_18a_x ();
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-18a_x.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-18a_x.c new file mode 100644 index 00000000000..72f5bbf5d44 --- /dev/null +++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-18a_x.c @@ -0,0 +1,37 @@ +#include "compat-common.h"
+
+#include "fp-struct-defs.h"
+#include "fp-struct-check.h"
+#include "fp-struct-test-by-value-x.h"
+
+DEFS(cld, _Complex long double)
+CHECKS(cld, _Complex long double)
+
+
+TEST(Scld13, _Complex long double)
+TEST(Scld14, _Complex long double)
+TEST(Scld15, _Complex long double)
+TEST(Scld16, _Complex long double)
+
+#undef T
+
+void
+struct_by_value_18a_x ()
+{
+DEBUG_INIT
+
+#define T(TYPE, MTYPE) testit##TYPE ();
+
+
+T(Scld13, _Complex long double)
+T(Scld14, _Complex long double)
+T(Scld15, _Complex long double)
+T(Scld16, _Complex long double)
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-18a_y.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-18a_y.c new file mode 100644 index 00000000000..545dcf8970f --- /dev/null +++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-18a_y.c @@ -0,0 +1,22 @@ +#include <stdarg.h>
+
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#include "fp-struct-defs.h"
+#include "fp-struct-init.h"
+#include "fp-struct-test-by-value-y.h"
+
+DEFS(cld,_Complex long double)
+INITS(cld, _Complex long double)
+
+
+TEST(Scld13, _Complex long double)
+TEST(Scld14, _Complex long double)
+TEST(Scld15, _Complex long double)
+TEST(Scld16, _Complex long double)
diff --git a/gcc/testsuite/gcc.dg/compat/struct-layout-1.exp b/gcc/testsuite/gcc.dg/compat/struct-layout-1.exp index 5de2c1e2618..992b62cdc09 100644 --- a/gcc/testsuite/gcc.dg/compat/struct-layout-1.exp +++ b/gcc/testsuite/gcc.dg/compat/struct-layout-1.exp @@ -98,7 +98,7 @@ if [info exists env(GCC_EXEC_PREFIX)] { set orig_gcc_exec_prefix_saved 1 unsetenv GCC_EXEC_PREFIX } -set status [remote_exec host "$HOSTCC $HOSTCFLAGS $generator_cmd"] +set status [remote_exec build "$HOSTCC $HOSTCFLAGS $generator_cmd"] set status [lindex $status 0] if { $orig_gcc_exec_prefix_saved } { set orig_gcc_exec_prefix_saved 0 diff --git a/gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c b/gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c index c53c3e8c2bd..f6a217e6f56 100644 --- a/gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c +++ b/gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c @@ -186,30 +186,42 @@ struct types vector_types[] = { /* vector-defs.h typedefs */ { "v8qi", TYPE_OTHER, 0, 0 }, { "v16qi", TYPE_OTHER, 0, 0 }, +{ "v32qi", TYPE_OTHER, 0, 0 }, { "v2hi", TYPE_OTHER, 0, 0 }, { "v4hi", TYPE_OTHER, 0, 0 }, { "v8hi", TYPE_OTHER, 0, 0 }, +{ "v16hi", TYPE_OTHER, 0, 0 }, { "v2si", TYPE_OTHER, 0, 0 }, { "v4si", TYPE_OTHER, 0, 0 }, +{ "v8si", TYPE_OTHER, 0, 0 }, { "v1di", TYPE_OTHER, 0, 0 }, { "v2di", TYPE_OTHER, 0, 0 }, +{ "v4di", TYPE_OTHER, 0, 0 }, { "v2sf", TYPE_OTHER, 0, 0 }, { "v4sf", TYPE_OTHER, 0, 0 }, +{ "v8sf", TYPE_OTHER, 0, 0 }, { "v16sf", TYPE_OTHER, 0, 0 }, { "v2df", TYPE_OTHER, 0, 0 }, +{ "v4df", TYPE_OTHER, 0, 0 }, { "u8qi", TYPE_OTHER, 0, 0 }, { "u16qi", TYPE_OTHER, 0, 0 }, +{ "u32qi", TYPE_OTHER, 0, 0 }, { "u2hi", TYPE_OTHER, 0, 0 }, { "u4hi", TYPE_OTHER, 0, 0 }, { "u8hi", TYPE_OTHER, 0, 0 }, +{ "u16hi", TYPE_OTHER, 0, 0 }, { "u2si", TYPE_OTHER, 0, 0 }, { "u4si", TYPE_OTHER, 0, 0 }, +{ "u8si", TYPE_OTHER, 0, 0 }, { "u1di", TYPE_OTHER, 0, 0 }, { "u2di", TYPE_OTHER, 0, 0 }, +{ "u4di", TYPE_OTHER, 0, 0 }, { "u2sf", TYPE_OTHER, 0, 0 }, { "u4sf", TYPE_OTHER, 0, 0 }, +{ "u8sf", TYPE_OTHER, 0, 0 }, { "u16sf", TYPE_OTHER, 0, 0 }, { "u2df", TYPE_OTHER, 0, 0 }, +{ "u4df", TYPE_OTHER, 0, 0 }, { "__m64", TYPE_OTHER, 0, 0 }, { "__m128", TYPE_OTHER, 0, 0 } #define NVTYPES2 (sizeof (vector_types) / sizeof (vector_types[0])) diff --git a/gcc/testsuite/gcc.dg/compat/union-m128-1_main.c b/gcc/testsuite/gcc.dg/compat/union-m128-1_main.c index 69dd34dce57..11f872154eb 100644 --- a/gcc/testsuite/gcc.dg/compat/union-m128-1_main.c +++ b/gcc/testsuite/gcc.dg/compat/union-m128-1_main.c @@ -1,6 +1,8 @@ +/* { dg-skip-if "test SSE2 support" { ! { i?86-*-* x86_64-*-* } } } */ /* { dg-options "-O" } */ -#ifdef __x86_64__ +#include "cpuid.h" + /* Test function argument passing. PR target/15301. */ extern void union_m128_1_x (void); @@ -9,13 +11,14 @@ extern void exit (int); int main () { - union_m128_1_x (); + unsigned int eax, ebx, ecx, edx; + + if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx)) + return 0; + + /* Run SSE vector test only if host has SSE2 support. */ + if (edx & bit_SSE2) + union_m128_1_x (); + exit (0); } -#else -int -main () -{ - return 0; -} -#endif diff --git a/gcc/testsuite/gcc.dg/compat/union-m128-1_x.c b/gcc/testsuite/gcc.dg/compat/union-m128-1_x.c index 06a4ef5ffdb..1f92303d95b 100644 --- a/gcc/testsuite/gcc.dg/compat/union-m128-1_x.c +++ b/gcc/testsuite/gcc.dg/compat/union-m128-1_x.c @@ -1,6 +1,5 @@ -/* { dg-options "-O" } */ +/* { dg-options "-O -msse2" } */ -#ifdef __x86_64__ #include "union-m128-1.h" SS_union_mi128 un; @@ -23,7 +22,3 @@ union_m128_1_x () foo(un); foo(st); } -#else -int dummy_x; -#endif - diff --git a/gcc/testsuite/gcc.dg/compat/union-m128-1_y.c b/gcc/testsuite/gcc.dg/compat/union-m128-1_y.c index 2b6eb0a6ee8..be9d6e8f3d5 100644 --- a/gcc/testsuite/gcc.dg/compat/union-m128-1_y.c +++ b/gcc/testsuite/gcc.dg/compat/union-m128-1_y.c @@ -1,6 +1,5 @@ -/* { dg-options "-O" } */ +/* { dg-options "-O -msse2" } */ -#ifdef __x86_64__ #include <stdlib.h> #include "union-m128-1.h" @@ -26,7 +25,3 @@ foo (SS_struct_mi128 st) || x.u [1] != 0xfedcba9876543210LL) abort (); } -#else -int dummy_y; -#endif - diff --git a/gcc/testsuite/gcc.dg/compat/vector-1_x.c b/gcc/testsuite/gcc.dg/compat/vector-1_x.c index 11995b496e5..ab4f88bf48b 100644 --- a/gcc/testsuite/gcc.dg/compat/vector-1_x.c +++ b/gcc/testsuite/gcc.dg/compat/vector-1_x.c @@ -8,13 +8,17 @@ SETUP (8, qi); SETUP (16, qi); +SETUP (32, qi); SETUP (2, hi); SETUP (4, hi); SETUP (8, hi); +SETUP (16, hi); SETUP (2, si); SETUP (4, si); +SETUP (8, si); SETUP (1, di); SETUP (2, di); +SETUP (4, di); #endif @@ -26,13 +30,17 @@ vector_1_x (void) CHECK (8, qi); CHECK (16, qi); + CHECK (32, qi); CHECK (2, hi); CHECK (4, hi); CHECK (8, hi); + CHECK (16, hi); CHECK (2, si); CHECK (4, si); + CHECK (8, si); CHECK (1, di); CHECK (2, di); + CHECK (4, di); DEBUG_FINI diff --git a/gcc/testsuite/gcc.dg/compat/vector-1_y.c b/gcc/testsuite/gcc.dg/compat/vector-1_y.c index 1cec61734b4..5a09c0eadb6 100644 --- a/gcc/testsuite/gcc.dg/compat/vector-1_y.c +++ b/gcc/testsuite/gcc.dg/compat/vector-1_y.c @@ -8,12 +8,16 @@ TEST (8, qi, 101) TEST (16, qi, 101) +TEST (32, qi, 90) TEST (2, hi, 201) TEST (4, hi, 202) TEST (8, hi, 203) +TEST (16, hi, 203) TEST (2, si, 301) TEST (4, si, 302) +TEST (8, si, 303) TEST (1, di, 401) TEST (2, di, 402) +TEST (4, di, 403) #endif diff --git a/gcc/testsuite/gcc.dg/compat/vector-1a_main.c b/gcc/testsuite/gcc.dg/compat/vector-1a_main.c new file mode 100644 index 00000000000..76fb2915e1d --- /dev/null +++ b/gcc/testsuite/gcc.dg/compat/vector-1a_main.c @@ -0,0 +1,26 @@ +/* { dg-skip-if "test SSE2 vector" { ! { i?86-*-* x86_64-*-* } } } */ + +/* Test compatibility of vector types: layout between separately-compiled + modules, parameter passing, and function return. This test uses + vectors of integer values. */ + +#include "cpuid.h" + +extern void vector_1_x (void); +extern void exit (int); +int fails; + +int +main () +{ + unsigned int eax, ebx, ecx, edx; + + if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx)) + return 0; + + /* Run SSE vector test only if host has SSE2 support. */ + if (edx & bit_SSE2) + vector_1_x (); + + exit (0); +} diff --git a/gcc/testsuite/gcc.dg/compat/vector-1a_x.c b/gcc/testsuite/gcc.dg/compat/vector-1a_x.c new file mode 100644 index 00000000000..aa0fa7f208c --- /dev/null +++ b/gcc/testsuite/gcc.dg/compat/vector-1a_x.c @@ -0,0 +1,3 @@ +/* { dg-options "-w -mno-mmx -msse2" } */ + +#include "vector-1_x.c" diff --git a/gcc/testsuite/gcc.dg/compat/vector-1a_y.c b/gcc/testsuite/gcc.dg/compat/vector-1a_y.c new file mode 100644 index 00000000000..2c88e198845 --- /dev/null +++ b/gcc/testsuite/gcc.dg/compat/vector-1a_y.c @@ -0,0 +1,3 @@ +/* { dg-options "-w -mno-mmx -msse2" } */ + +#include "vector-1_y.c" diff --git a/gcc/testsuite/gcc.dg/compat/vector-2_x.c b/gcc/testsuite/gcc.dg/compat/vector-2_x.c index de5f29c2688..d08c77fe3a0 100644 --- a/gcc/testsuite/gcc.dg/compat/vector-2_x.c +++ b/gcc/testsuite/gcc.dg/compat/vector-2_x.c @@ -10,7 +10,9 @@ SETUP (2, sf); SETUP (4, sf); SETUP (16, sf); +SETUP (8, sf); SETUP (2, df); +SETUP (4, df); #endif @@ -22,7 +24,9 @@ vector_2_x (void) CHECK (2, sf); CHECK (4, sf); + CHECK (8, sf); CHECK (16, sf); + CHECK (4, df); CHECK (2, df); DEBUG_FINI diff --git a/gcc/testsuite/gcc.dg/compat/vector-2_y.c b/gcc/testsuite/gcc.dg/compat/vector-2_y.c index 10d7a064532..fd5830c35b3 100644 --- a/gcc/testsuite/gcc.dg/compat/vector-2_y.c +++ b/gcc/testsuite/gcc.dg/compat/vector-2_y.c @@ -9,7 +9,9 @@ TEST (2, sf, 301.0) TEST (4, sf, 302.0) +TEST (8, sf, 303.0) TEST (16, sf, 304.0) TEST (2, df, 402.0) +TEST (4, df, 402.0) #endif diff --git a/gcc/testsuite/gcc.dg/compat/vector-2a_main.c b/gcc/testsuite/gcc.dg/compat/vector-2a_main.c new file mode 100644 index 00000000000..96c1111fddc --- /dev/null +++ b/gcc/testsuite/gcc.dg/compat/vector-2a_main.c @@ -0,0 +1,26 @@ +/* { dg-skip-if "test SSE2 support" { ! { i?86-*-* x86_64-*-* } } } */ + +/* Test compatibility of vector types: layout between separately-compiled + modules, parameter passing, and function return. This test uses + vectors of floating points values. */ + +#include "cpuid.h" + +extern void vector_2_x (void); +extern void exit (int); +int fails; + +int +main () +{ + unsigned int eax, ebx, ecx, edx; + + if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx)) + return 0; + + /* Run SSE vector test only if host has SSE2 support. */ + if (edx & bit_SSE2) + vector_2_x (); + + exit (0); +} diff --git a/gcc/testsuite/gcc.dg/compat/vector-2a_x.c b/gcc/testsuite/gcc.dg/compat/vector-2a_x.c new file mode 100644 index 00000000000..fcfacec04e8 --- /dev/null +++ b/gcc/testsuite/gcc.dg/compat/vector-2a_x.c @@ -0,0 +1,3 @@ +/* { dg-options "-w -mno-mmx -msse2" } */ + +#include "vector-2_x.c" diff --git a/gcc/testsuite/gcc.dg/compat/vector-2a_y.c b/gcc/testsuite/gcc.dg/compat/vector-2a_y.c new file mode 100644 index 00000000000..3797acb6a57 --- /dev/null +++ b/gcc/testsuite/gcc.dg/compat/vector-2a_y.c @@ -0,0 +1,3 @@ +/* { dg-options "-w -mno-mmx -msse2" } */ + +#include "vector-2_y.c" diff --git a/gcc/testsuite/gcc.dg/compat/vector-defs.h b/gcc/testsuite/gcc.dg/compat/vector-defs.h index 7574e28c53d..f2f050527ec 100644 --- a/gcc/testsuite/gcc.dg/compat/vector-defs.h +++ b/gcc/testsuite/gcc.dg/compat/vector-defs.h @@ -56,6 +56,20 @@ typedef float __attribute__((mode(V2DF))) v2df; #endif +typedef qi __attribute__((vector_size (32))) v32qi; +typedef hi __attribute__((vector_size (32))) v16hi; +typedef si __attribute__((vector_size (32))) v8si; +typedef di __attribute__((vector_size (32))) v4di; +typedef sf __attribute__((vector_size (32))) v8sf; +typedef df __attribute__((vector_size (32))) v4df; + +typedef union U32QI { v32qi v; qi a[32]; } u32qi; +typedef union U16HI { v16hi v; hi a[16]; } u16hi; +typedef union U8SI { v8si v; si a[8]; } u8si; +typedef union U4DI { v4di v; di a[4]; } u4di; +typedef union U8SF { v8sf v; sf a[8]; } u8sf; +typedef union U4DF { v4df v; df a[4]; } u4df; + typedef union U8QI { v8qi v; qi a[8]; } u8qi; typedef union U16QI { v16qi v; qi a[16]; } u16qi; diff --git a/gcc/testsuite/gcc.dg/const-float128-ped.c b/gcc/testsuite/gcc.dg/const-float128-ped.c index 86a630cf951..6a6b6223ce2 100644 --- a/gcc/testsuite/gcc.dg/const-float128-ped.c +++ b/gcc/testsuite/gcc.dg/const-float128-ped.c @@ -1,5 +1,5 @@ /* Test 'q' suffix with -pedantic on __float128 type constants. */ -/* { dg-do compile { target { ia64-*-* || { { i?86-*-* x86_64-*-* } && lp64 } } } } */ +/* { dg-do compile { target ia64-*-* i?86-*-* x86_64-*-* } } */ /* { dg-options "-pedantic" } */ __float128 a = 123.456789q; /* { dg-warning "non-standard suffix on floating constant" } */ diff --git a/gcc/testsuite/gcc.dg/const-float128.c b/gcc/testsuite/gcc.dg/const-float128.c index 146e0c9c986..116e4597b44 100644 --- a/gcc/testsuite/gcc.dg/const-float128.c +++ b/gcc/testsuite/gcc.dg/const-float128.c @@ -1,5 +1,5 @@ /* Test 'q' and 'Q' suffixes on __float128 type constants. */ -/* { dg-do compile { target { ia64-*-* || { { i?86-*-* x86_64-*-* } && lp64 } } } } */ +/* { dg-do compile { target ia64-*-* i?86-*-* x86_64-*-* } } */ /* { dg-options "" } */ __float128 a = 123.456789q; diff --git a/gcc/testsuite/gcc.dg/const-float80-ped.c b/gcc/testsuite/gcc.dg/const-float80-ped.c index 9cf047804a4..d1cf316dcad 100644 --- a/gcc/testsuite/gcc.dg/const-float80-ped.c +++ b/gcc/testsuite/gcc.dg/const-float80-ped.c @@ -1,6 +1,5 @@ /* Test 'w' suffix with -pedantic on __float80 type constants. */ /* { dg-do compile { target i?86-*-* x86_64-*-* ia64-*-* } } */ /* { dg-options "-pedantic" } */ -/* { dg-options "-mmmx -pedantic" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */ __float80 a = 123.456789w; /* { dg-warning "non-standard suffix on floating constant" } */ diff --git a/gcc/testsuite/gcc.dg/const-float80.c b/gcc/testsuite/gcc.dg/const-float80.c index f2a836d3e64..8ec771f8f9c 100644 --- a/gcc/testsuite/gcc.dg/const-float80.c +++ b/gcc/testsuite/gcc.dg/const-float80.c @@ -1,7 +1,6 @@ /* Test 'w' and 'W' suffixes on __float80 type constants. */ /* { dg-do compile { target i?86-*-* x86_64-*-* ia64-*-* } } */ /* { dg-options "" } */ -/* { dg-options "-mmmx" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */ __float80 a = 123.456789W; __float80 b = 123.456789w; diff --git a/gcc/testsuite/gcc.dg/cpp/20000519-1.c b/gcc/testsuite/gcc.dg/cpp/20000519-1.c index 82ab3a26861..7cd7daa3ad2 100644 --- a/gcc/testsuite/gcc.dg/cpp/20000519-1.c +++ b/gcc/testsuite/gcc.dg/cpp/20000519-1.c @@ -1,6 +1,7 @@ /* Regression test for preprocessor crash. Reported by Mathias Froehlich <frohlich@na.uni-tuebingen.de>. */ /* { dg-do preprocess } */ +/* { dg-options "-ansi" } */ #define foo #define __CAT__(a,b,c,d) a##b##c##d diff --git a/gcc/testsuite/gcc.dg/cpp/avoidpaste1.c b/gcc/testsuite/gcc.dg/cpp/avoidpaste1.c index d304a744155..3591f9c08ae 100644 --- a/gcc/testsuite/gcc.dg/cpp/avoidpaste1.c +++ b/gcc/testsuite/gcc.dg/cpp/avoidpaste1.c @@ -1,6 +1,7 @@ /* Copyright (C) 2001, 2003 Free Software Foundation, Inc. */ /* { dg-do preprocess } */ +/* { dg-options "-ansi" } */ /* This tests that we avoid accidental pasting only before and after macros and arguments, and not when the tokens are already pasted diff --git a/gcc/testsuite/gcc.dg/cpp/avoidpaste2.c b/gcc/testsuite/gcc.dg/cpp/avoidpaste2.c index 42b549c8d6c..dc5bbc7f270 100644 --- a/gcc/testsuite/gcc.dg/cpp/avoidpaste2.c +++ b/gcc/testsuite/gcc.dg/cpp/avoidpaste2.c @@ -1,6 +1,7 @@ /* Copyright (C) 2001, 2003 Free Software Foundation, Inc. */ /* { dg-do preprocess } */ +/* { dg-options "-ansi" } */ /* This tests that we avoid accidental pasting, as well as gratuitous space insertion, in various nasty places _inside_ a macro's diff --git a/gcc/testsuite/gcc.dg/cpp/c90-empty-macro-args.c b/gcc/testsuite/gcc.dg/cpp/c90-empty-macro-args.c new file mode 100644 index 00000000000..e90f8e6cb69 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/c90-empty-macro-args.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-std=c89 -pedantic" } */ + +#define f(a,b) f2(a,,b) +#define f2(a,b,c) a; b; c; +#define f3(a) a + +#define g() p() + +void p(void) {} + + +void foo(void) +{ + f(p(),p()); /* { dg-warning "macro f2 argument 2: empty macro arguments are undefined" } */ + f2(p(),,p()); /* { dg-warning "macro f2 argument 2: empty macro arguments are undefined" } */ + f3(); /* { dg-warning "macro f3 argument 1: empty macro arguments are undefined" } */ + g(); +} diff --git a/gcc/testsuite/gcc.dg/cpp/c99-empty-macro-args.c b/gcc/testsuite/gcc.dg/cpp/c99-empty-macro-args.c new file mode 100644 index 00000000000..e1e0c61ec29 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/c99-empty-macro-args.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-std=c99 -pedantic" } */ + +#define f(a,b) f2(a,,b) +#define f2(a,b,c) a; b; c; +#define f3(a) a + +#define g() p() + +void p(void) {} + + +void foo(void) +{ + f(p(),p()); + f2(p(),,p()); + f3(); + g(); +} diff --git a/gcc/testsuite/gcc.dg/lower-subreg-1.c b/gcc/testsuite/gcc.dg/lower-subreg-1.c index 01851268c11..bb35d21bb50 100644 --- a/gcc/testsuite/gcc.dg/lower-subreg-1.c +++ b/gcc/testsuite/gcc.dg/lower-subreg-1.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target { { ! mips64 } && { ! ia64-*-* } } } } */ +/* { dg-do compile { target { { { ! mips64 } && { ! ia64-*-* } } && { ! spu-*-* } } } } */ /* { dg-options "-O -fdump-rtl-subreg" } */ /* { dg-require-effective-target ilp32 } */ diff --git a/gcc/testsuite/gcc.dg/nrv3.c b/gcc/testsuite/gcc.dg/nrv3.c index 2b582c3ebe8..c28b8ec570d 100644 --- a/gcc/testsuite/gcc.dg/nrv3.c +++ b/gcc/testsuite/gcc.dg/nrv3.c @@ -3,7 +3,12 @@ /* { dg-do compile } */ /* { dg-options "-O -fdump-tree-optimized" } */ +#ifdef __SPU__ +/* SPU returns aggregates up to 1172 bytes in registers. */ +typedef struct { int x[300]; void *y; } S; +#else typedef struct { int x[20]; void *y; } S; +#endif typedef struct { int a; S b; } T; S nrv_candidate (void); void use_result (S, int); diff --git a/gcc/testsuite/gcc.dg/pr27095.c b/gcc/testsuite/gcc.dg/pr27095.c index 5ec39687a06..d274f4e8445 100644 --- a/gcc/testsuite/gcc.dg/pr27095.c +++ b/gcc/testsuite/gcc.dg/pr27095.c @@ -11,7 +11,7 @@ main (int argc, char **argv) memset (x, argc, strlen (x)); return 0; } -/* { dg-final { scan-assembler-not "(?n)strlen\(.*\n\)+.*strlen" { target { ! { powerpc*-*-darwin* hppa*-*-hpux* ia64-*-hpux* alpha*-*-* } } } } } */ +/* { dg-final { scan-assembler-not "(?n)strlen\(.*\n\)+.*strlen" { target { ! { powerpc*-*-darwin* hppa*-*-hpux* ia64-*-hpux* alpha*-*-* spu-*-* } } } } } */ /* hppa*-*-hpux* has an IMPORT statement for strlen (plus the branch). */ /* *-*-darwin* has something similar. */ /* { dg-final { scan-assembler-not "(?n)strlen\(.*\n\)+.*strlen\(.*\n\)+.*strlen" { target hppa*-*-hpux* } } } */ @@ -20,3 +20,5 @@ main (int argc, char **argv) /* { dg-final { scan-assembler-not "(?n)strlen\(.*\n\)+.*strlen\(.*\n\)+.*strlen\(.*\n\)+.*strlen" { target ia64-*-hpux* } } } */ /* alpha-*-* has a GOT load and the call. */ /* { dg-final { scan-assembler-not "(?n)jsr .*,strlen\(.*\n\)+.*jsr .*,strlen" { target alpha*-*-* } } } */ +/* spu-*-* has a branch hint and the call. */ +/* { dg-final { scan-assembler-not "(?n)brsl.*,strlen\(.*\n\)+.*brsl.*,strlen" { target spu-*-* } } } */ diff --git a/gcc/testsuite/gcc.dg/pr28243.c b/gcc/testsuite/gcc.dg/pr28243.c index c2797c0fb3f..12447a1c3d3 100644 --- a/gcc/testsuite/gcc.dg/pr28243.c +++ b/gcc/testsuite/gcc.dg/pr28243.c @@ -4,6 +4,7 @@ /* { dg-do compile } */ /* { dg-require-effective-target fpic } */ /* { dg-options "-O2 -ftracer -fPIC" } */ +/* { dg-skip-if "requires unsupported run-time relocation" { spu-*-* } { "*" } { "" } } */ struct displayfuncs { void (*init) (); diff --git a/gcc/testsuite/gcc.dg/pr35736.c b/gcc/testsuite/gcc.dg/pr35736.c new file mode 100644 index 00000000000..f411bb8a92f --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr35736.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-O -Wall" } */ + +void foo() +{ + while (1) + for (;;({ continue; })) + ; +} diff --git a/gcc/testsuite/gcc.dg/pr36227.c b/gcc/testsuite/gcc.dg/pr36227.c index d6657632b91..27fe0015505 100644 --- a/gcc/testsuite/gcc.dg/pr36227.c +++ b/gcc/testsuite/gcc.dg/pr36227.c @@ -1,12 +1,22 @@ /* { dg-do compile } */ /* { dg-options "-O2 -Wstrict-overflow=3" } */ +#if (__SIZEOF_LONG_LONG__ == __SIZEOF_POINTER__) +typedef unsigned long long ptrcast; +#elif (__SIZEOF_LONG__ == __SIZEOF_POINTER__) +typedef unsigned long ptrcast; +#elif (__SIZEOF_INT__ == __SIZEOF_POINTER__) +typedef unsigned int ptrcast; +#else +#error Add target support here +#endif volatile unsigned long * sat_add(volatile unsigned long *ptr, unsigned long i, volatile unsigned long *end) { - if ((unsigned long)ptr + i * sizeof(*ptr) > (unsigned long)ptr) /* { dg-bogus "pointer wraparound" } */ + if ((ptrcast)ptr + i * sizeof(*ptr) > (ptrcast)ptr) /* { dg-bogus "pointer wraparound" } */ return ptr + i; else return end; } + diff --git a/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128.c b/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128.c index 24decb86fdf..a4b73e9cf5d 100644 --- a/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128.c +++ b/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128.c @@ -1,6 +1,6 @@ /* Test floating-point conversions. __float128 type. */ /* Origin: Joseph Myers <joseph@codesourcery.com> */ -/* { dg-do run { target { ia64-*-* || { { i?86-*-* x86_64-*-*} && lp64 } } } } */ +/* { dg-do run { target ia64-*-* i?86-*-* x86_64-*-* } } */ /* { dg-options "" } */ #include "fp-int-convert.h" diff --git a/gcc/testsuite/gcc.dg/torture/fp-int-convert-float80.c b/gcc/testsuite/gcc.dg/torture/fp-int-convert-float80.c index e2b587c0cba..3e25f904dbe 100644 --- a/gcc/testsuite/gcc.dg/torture/fp-int-convert-float80.c +++ b/gcc/testsuite/gcc.dg/torture/fp-int-convert-float80.c @@ -2,7 +2,6 @@ /* Origin: Joseph Myers <joseph@codesourcery.com> */ /* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* } } */ /* { dg-options "" } */ -/* { dg-options "-mmmx" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */ #include "fp-int-convert.h" diff --git a/gcc/testsuite/gcc.dg/torture/ipa-pta-1.c b/gcc/testsuite/gcc.dg/torture/ipa-pta-1.c new file mode 100644 index 00000000000..c5adb259d26 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/ipa-pta-1.c @@ -0,0 +1,40 @@ +/* { dg-do compile } */ +/* { dg-options "-fipa-pta -fdump-ipa-pta" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ + +struct X { char x; char y; }; + +void bar (char *p); + +void test1 (char a, char b, char c, char d, char e, char f, char g, char h) +{ + char *p = &a; + p++; + bar (p); +} + +void test2 (struct X a, char b, char c, char d, char e, char f, char g, char h) +{ + char *p = &a.x; + p++; + bar (p); +} + +void test3 (struct X a, char b, char c, char d, char e, char f, char g, char h) +{ + char *p = &a.y; + bar (p); +} + +void test4 (int a, char b, char c, char d, char e, char f, char g, char h) +{ + char *p = (char *)&a; + p++; + p++; + p++; + p++; + bar (p); +} + +/* { dg-final { scan-ipa-dump "bar.arg0 = { test4.arg0 test3.arg0 test2.arg0 test1.arg0 }" "pta" } } */ +/* { dg-final { cleanup-ipa-dump "pta" } } */ diff --git a/gcc/testsuite/gcc.dg/torture/pr25947-1.c b/gcc/testsuite/gcc.dg/torture/pr25947-1.c index d52ef8c8e3f..8af6f8d4624 100644 --- a/gcc/testsuite/gcc.dg/torture/pr25947-1.c +++ b/gcc/testsuite/gcc.dg/torture/pr25947-1.c @@ -1,5 +1,6 @@ /* PR target/25947: define_split in cris.md caused unrecognized insn. */ /* { dg-options "-fpic" { target fpic } } */ +/* { dg-skip-if "requires unsupported run-time relocation" { spu-*-* } { "-O0" } { "" } } */ extern char *rl_line_buffer; extern int rl_point; diff --git a/gcc/testsuite/gcc.dg/torture/pr35842.c b/gcc/testsuite/gcc.dg/torture/pr35842.c index 05b26d84c11..05b26d84c11 100755..100644 --- a/gcc/testsuite/gcc.dg/torture/pr35842.c +++ b/gcc/testsuite/gcc.dg/torture/pr35842.c diff --git a/gcc/testsuite/gcc.dg/torture/pr36373-10.c b/gcc/testsuite/gcc.dg/torture/pr36373-10.c index b84e2544152..ed701772828 100644 --- a/gcc/testsuite/gcc.dg/torture/pr36373-10.c +++ b/gcc/testsuite/gcc.dg/torture/pr36373-10.c @@ -1,6 +1,14 @@ /* { dg-do run } */ +#if (__SIZEOF_LONG_LONG__ == __SIZEOF_POINTER__) +typedef unsigned long long uintptr_t; +#elif (__SIZEOF_LONG__ == __SIZEOF_POINTER__) typedef unsigned long uintptr_t; +#elif (__SIZEOF_INT__ == __SIZEOF_POINTER__) +typedef unsigned int uintptr_t; +#else +#error Add target support here +#endif void __attribute__((noinline)) foo(uintptr_t l) diff --git a/gcc/testsuite/gcc.dg/torture/pta-ptrarith-1.c b/gcc/testsuite/gcc.dg/torture/pta-ptrarith-1.c new file mode 100644 index 00000000000..2a8dc9e3037 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pta-ptrarith-1.c @@ -0,0 +1,33 @@ +/* { dg-do run } */ +/* { dg-options "-fdump-tree-alias" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ + +struct Foo { + int *p; +}; + +void __attribute__((noinline)) +foo (void *p) +{ + struct Foo *f = (struct Foo *)p - 1; + *f->p = 0; +} + +int bar (void) +{ + struct Foo f; + int i = 1; + f.p = &i; + foo (&f + 1); + return i; +} +extern void abort (void); +int main() +{ + if (bar () != 0) + abort (); + return 0; +} + +/* { dg-final { scan-tree-dump "ESCAPED = { ESCAPED NONLOCAL f .* i }" "alias" } } */ +/* { dg-final { cleanup-tree-dump "alias" } } */ diff --git a/gcc/testsuite/gcc.dg/torture/pta-ptrarith-2.c b/gcc/testsuite/gcc.dg/torture/pta-ptrarith-2.c new file mode 100644 index 00000000000..fb5b2e15ede --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pta-ptrarith-2.c @@ -0,0 +1,36 @@ +/* { dg-do run } */ +/* { dg-options "-fdump-tree-alias" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ + +struct Foo { + int **p; + int **q; +}; + +int __attribute__((noinline)) +bar (void) +{ + struct Foo f; + int j, i = 1; + char *p; + int *x = &i; + int *y = &j; + f.p = &y; + f.q = &x; + p = (char *)&f; + for (j = 0; j < sizeof (int *); ++j) + p++; + return ***(int ***)p; +} +extern void abort (void); +int main() +{ + if (bar () != 1) + abort (); + return 0; +} + +/* In theory = { i } is the correct solution. But it's not easy to scan + for that reliably, so just use what we create now. */ +/* { dg-final { scan-tree-dump "= { i j }" "alias" } } */ +/* { dg-final { cleanup-tree-dump "alias" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c index 28cdfd23181..d7aea1b8430 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c @@ -33,5 +33,5 @@ void test55 (int x, int y) that the && should be emitted (based on BRANCH_COST). Fix this by teaching dom to look through && and register all components as true. */ -/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" { xfail { ! "powerpc*-*-* cris-*-* crisv32-*-* mmix-*-* mips*-*-*" } } } } */ +/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" { xfail { ! "powerpc*-*-* cris-*-* crisv32-*-* mmix-*-* mips*-*-* m68k*-*-*" } } } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pta-callused.c b/gcc/testsuite/gcc.dg/tree-ssa/pta-callused.c new file mode 100644 index 00000000000..c2b512a12e9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pta-callused.c @@ -0,0 +1,27 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 --param max-fields-for-field-sensitive=2 -fdump-tree-alias" } */ + +struct Foo { + int *p, *q; +}; + +int foo (int ***x) __attribute__((pure)); + +int bar (int b) +{ + int i; + struct Foo f; + int *p, **q; + p = &i; + f.p = &i; + f.q = f.p; + if (b) + q = &f.p; + else + q = &f.q; + return foo (&q); +} + +/* { dg-final { scan-tree-dump "CALLUSED = { f.* i q }" "alias" } } */ +/* { dg-final { cleanup-tree-dump "alias" } } */ + diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-3.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-3.c index 3b7a547a6e7..85e444886d0 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-3.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-3.c @@ -5,7 +5,7 @@ When the condition is true, we distribute "(int) (a + b)" as "(int) a + (int) b", otherwise we keep the original. */ -/* { dg-do compile { target { ! mips64 } } } */ +/* { dg-do compile { target { { ! mips64 } && { ! spu-*-* } } } } */ /* { dg-options "-O -fwrapv -fdump-tree-fre-details" } */ /* From PR14844. */ |