diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-11-03 20:17:38 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-11-03 20:17:38 +0000 |
commit | 2b2b3bd8d96c3193c8d9bc606ee1b5b3c9b47000 (patch) | |
tree | 81e969bd3646dc338eed81f44730a7c467aebe3b /gcc/testsuite | |
parent | d4f000ef87b18faf42726f23e17b15a8f14fe618 (diff) | |
download | gcc-2b2b3bd8d96c3193c8d9bc606ee1b5b3c9b47000.tar.gz |
2008-11-03 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r141555
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@141561 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
30 files changed, 884 insertions, 45 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 85e97f3277c..06893ecd5b9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,12 +1,114 @@ +2008-11-03 Richard Guenther <rguenther@suse.de> + Jakub Jelinek <jakub@redhat.com> + + PR middle-end/37573 + * gcc.c-torture/execute/pr37573.c: New testcase. + +2008-11-03 Jakub Jelinek <jakub@redhat.com> + + PR middle-end/37858 + * gcc.dg/pr37858.c: New test. + +2008-11-03 Tobias Burnus <burnus@net-b.de> + + PR fortran/37821 + * gfortran.dg/include_4.f90: New. + * gfortran.dg/include_5.f90: New. + * gfortran.dg/include_4.inc: New. + +2008-11-03 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/37445 + * gfortran.dg/host_assoc_call_3.f90: New test. + * gfortran.dg/host_assoc_call_4.f90: New test. + * gfortran.dg/host_assoc_function_4.f90: New test. + +2008-11-02 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/37542 + * gcc.dg/tree-ssa/ssa-pre-22.c: New testcase. + * gcc.c-torture/compile/20081101-1.c: Likewise. + +2008-11-02 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/37991 + * gcc.c-torture/compile/pr37991.c: New testcase. + +2008-11-01 Hans-Peter Nilsson <hp@axis.com> + + PR target/37939 + * gcc.target/cris/biap.c: New test. + +2008-11-01 Janus Weil <janus@gcc.gnu.org> + + PR fortran/36426 + * gfortran.dg/proc_decl_19.f90: New. + +2008-11-01 Steven G. Kargl <kargls@comcast.net> + + PR fortran/19925 + * gfortran.dg/initialization_20.f90: New test. + * gfortran.dg/initialization_21.f90: Ditto. + +2008-11-01 Daniel Kraft <d@domob.eu> + + PR fortran/35681 + * gfortran.dg/mvbits_4.f90: New test. + +2008-11-01 Janus Weil <janus@gcc.gnu.org> + + PR fortran/36322 + PR fortran/36463 + * gfortran.dg/proc_decl_17.f90: New. + * gfortran.dg/proc_decl_18.f90: New. + +2008-11-01 Richard Guenther <rguenther@suse.de> + + PR middle-end/37976 + * gcc.c-torture/compile/pr37976.c: New testcase. + +2008-11-01 Dennis Wassel <dennis.wassel@gmail.com> + + PR fortran/37159 + * gfortran.dg/random_seed_1.f90: New testcase. + +2008-10-31 Manuel López-Ibáñez <manu@gcc.gnu.org> + + * gcc.dg/cpp/Wsignprom.c: Add column numbers. + * gcc.dg/cpp/if-mpar.c: Likewise. + +2008-10-31 Jakub Jelinek <jakub@redhat.com> + + PR c++/37967 + * g++.dg/cpp0x/auto8.C: New test. + + PR c++/37965 + * g++.dg/cpp0x/auto7.C: New test. + +2008-10-31 Mikael Morin <mikael.morin@tele2.fr> + + PR fortran/35840 + * gfortran.dg/write_check4.f90: New test. + +2008-10-31 Mikael Morin <mikael.morin@tele2.fr> + + PR fortran/35820 + * gfortran.dg/nested_forall_1.f: New test. + +2008-10-30 Steven G. Kargl <kargls@comcast.net> + + PR fortran/37930 + * gfortran.dg/int_conv_2.f90: New test. + 2008-10-30 Mikael Morin <mikael.morin@tele2.fr> - PR fortran/37903 - * gfortran.dg/vector_subscript_4.f90: New test. + PR fortran/37903 + * gfortran.dg/vector_subscript_4.f90: New test. 2008-10-30 Mikael Morin <mikael.morin@tele2.fr> - PR fortran/37749 - * gfortran.dg/vector_subscript__5.f90: New test. + PR fortran/37749 + * gfortran.dg/vector_subscript__5.f90: New test. 2008-10-30 Jakub Jelinek <jakub@redhat.com> @@ -27,7 +129,7 @@ 2008-10-29 Steve Ellcey <sje@cup.hp.com> PR middle-end/37339 - * gcc.dg/pr33545-3.c: Remove. + * gcc.dg/pr33645-3.c: Remove. 2008-10-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org> @@ -184,7 +286,7 @@ * gcc.dg/tree-ssa/alias-19.c: New testcase. 2008-10-20 Manuel López-Ibáñez <manu@gcc.gnu.org> - + PR 12603 * gcc.dg/pr12603.c: New testcase. @@ -200,13 +302,13 @@ 2008-10-19 Paul Thomas <pault@gcc.gnu.org> - PR fortran/37723 - * gfortran.dg/dependency_22.f90: New test. + PR fortran/37723 + * gfortran.dg/dependency_22.f90: New test. 2008-10-18 Danny Smith <dannysmith@users.sourceforge.net> * gcc.dg/dll-2.c: Revert 2008-08-09 change (R138893): Change - "dg-message" back to "dg-warning". + "dg-message" back to "dg-warning". * gcc.dg/dll-3.c: Likewise. 2008-10-16 Alexander Monakov <amonakov@ispras.ru> @@ -606,7 +708,7 @@ to avoid pointer truncation warning. 2008-09-26 Dorit Nuzman <dorit@il.ibm.com> - + PR tree-optimization/37574 * gcc.dg/vect/ggc-pr37574.c: New test. * gcc.dg/vect/vect.exp: Compile some tests with ggc flags. @@ -719,7 +821,7 @@ PR rtl-optimization/33642 * gcc.c-torture/compile/pr11832.c: Extend XFAIL to powerpc*-*-*. * gcc.c-torture/compile/pr33009.c: Likewise. - + 2008-09-22 Richard Guenther <rguenther@suse.de> PR tree-optimization/37145 @@ -752,7 +854,7 @@ PR rtl-optimization/33642 * gcc.c-torture/compile/pr11832.c: XFAIL on sh*-*-*. * gcc.c-torture/compile/pr33009.c: Likewise. - + 2008-09-21 Paul Thomas <pault@gcc.gnu.org> PR fortran/37583 @@ -791,10 +893,10 @@ * gcc.dg/tree-ssa/vector-3.c: New test. 2008-09-18 Bob Wilson <bob.wilson@acm.org> - + * gcc.c-torture/compile/pr11832.c: xfail on xtensa*-*-*. * gcc.c-torture/compile/pr33009.c: Likewise. - + 2008-09-18 Janis Johnson <janis187@us.ibm.com> PR testsuite/25241 @@ -1717,7 +1819,7 @@ PR c++/37342 * g++.dg/other/canon-37342.C: New. - + 2008-09-05 Joseph Myers <joseph@codesourcery.com> * gcc.c-torture/compile/20080903-1.c: New test. @@ -1893,7 +1995,7 @@ * gfortran.dg/graphite/scop-{1,2}.f: New. * gfortran.dg/graphite/block-{1,3,4}.f90: New. * gfortran.dg/graphite/graphite.exp: New. - + 2008-09-02 Richard Guenther <rguenther@suse.de> PR tree-optimization/37327 @@ -2886,7 +2988,7 @@ * gcc.dg/assign-warn-1.c: Update. * gcc.dg/dfp/composite-type.c: Update. * gcc.dg/noncompile/20020213-1.c: Update. - + 2008-08-28 Daniel Kraft <d@domob.eu> * gfortran.dg/typebound_call_1.f03: New test. @@ -3278,7 +3380,7 @@ (check_effective_target_vect_long_long): Remove spu-*-*. * gcc.dg/vect/vect-multitypes-16.c: Make init loop unvectorizable. * gcc.dg/vect/slp-widen-mult-u8.c: Likewise. - + 2008-08-20 Richard Guenther <rguenther@suse.de> * gcc.dg/tree-ssa/pr20701.c: Scan vrp1 dump. @@ -3465,7 +3567,7 @@ * gcc.dg/pr30551.c: Likewise. * g++.dg/warn/pr30551-2.C: Likewise. * g++.dg/warn/pr30551.C: Likewise. - + 2008-08-14 Janus Weil <janus@gcc.gnu.org> PR fortran/36705 @@ -3578,7 +3680,7 @@ * g++.dg/warn/pr35635.C: New. * g++.dg/warn/Wconversion-integer.C: Update. * g++.dg/warn/Wsign-conversion.C: Update. - + 2008-08-13 Richard Guenther <rguenther@suse.de> PR tree-optimization/15255 @@ -3605,7 +3707,7 @@ 2008-08-12 Paolo Carlini <paolo.carlini@oracle.com> * g++.old-deja/g++.other/decl5.C: Expand new expected errors. - + 2008-08-12 Paolo Carlini <paolo.carlini@oracle.com> PR c++/37087 @@ -3712,7 +3814,7 @@ PR c++/12242 * g++.dg/warn/pr12242.C: New. - + 2008-08-09 Manuel Lopez-Ibanez <manu@gcc.gnu.org> PR 36901 @@ -3768,13 +3870,13 @@ * gcc.dg/redecl-5.c: Update. * gcc.dg/qual-return-3.c: Update. * gcc.dg/label-decl-4.c: Update. - + 2008-08-09 Manuel Lopez-Ibanez <manu@gcc.gnu.org> PR 7651 * g++.dg/warn/Wuninitializable-member.C: New. * g++.dg/warn/Wuninitializable-member-no.C: New. - + 2008-08-08 Manuel Lopez-Ibanez <manu@gcc.gnu.org> PR 28875 @@ -3846,7 +3948,7 @@ PR 26785 * g++.dg/warn/pr26785.C: New. - + 2008-08-06 Victor Kaplansky <victork@il.ibm.com> * gcc.dg/vect/costmodel/ppc/costmodel-slp-34.c: New test. @@ -3856,7 +3958,7 @@ PR 8715 * gcc.dg/pr8715.c: New. * g++.dg/warn/pr8715.C: New. - + 2008-08-06 Marc Gauthier <marc@tensilica.com> * lib/target-supports.exp (check_profiling_available): Match more @@ -4012,7 +4114,7 @@ * gnat.dg/raise_from_pure.ad[bs], * gnat.dg/wrap_raise_from_pure.ad[bs]: Support for ... * gnat.dg/test_raise_from_pure.adb: New test. - + 2008-07-31 Adam Nemet <anemet@caviumnetworks.com> * gcc.target/mips/ext-1.c: New test. @@ -4229,7 +4331,7 @@ PR 34389 * gcc.dg/Wconversion-pr34389.c: New. * g++.dg/warn/Wconversion-pr34389.C: New. - + 2008-07-29 Steve Ellcey <sje@cup.hp.com> * gcc.dg/pr32370.c: Force 64 bits on IA64. @@ -4266,7 +4368,7 @@ PR 34985 * gcc.dg/pr34985.c: New. * g++.dg/warn/pr34985.C: New. - + 2008-07-29 Daniel Kraft <d@domob.eu> PR fortran/36403 @@ -4386,7 +4488,7 @@ PR 35058 * gcc.dg/Wdeclaration-after-statement-3.c: New. * gcc/testsuite/gcc.dg/Wpointer-arith.c: New. - + 2008-07-22 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libfortran/36852 @@ -4410,7 +4512,7 @@ PR 28079 * gcc.dg/cpp/line6.c: New. - + 2008-07-21 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> * gfortran.dg/fmt_g0_3.f08: Fix typo in expected error message. diff --git a/gcc/testsuite/g++.dg/cpp0x/auto7.C b/gcc/testsuite/g++.dg/cpp0x/auto7.C new file mode 100644 index 00000000000..9ef5a80eb1d --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/auto7.C @@ -0,0 +1,13 @@ +// PR c++/37965 +// Negative test for auto +// { dg-options "-std=c++0x" } + +auto i = 6; +auto j; // { dg-error "has no initializer" } + +template<int> struct A +{ + static auto k = 7; + static auto l; // { dg-error "has no initializer" } + auto m; // { dg-error "has no initializer" } +}; diff --git a/gcc/testsuite/g++.dg/cpp0x/auto8.C b/gcc/testsuite/g++.dg/cpp0x/auto8.C new file mode 100644 index 00000000000..d724d79f0d7 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/auto8.C @@ -0,0 +1,16 @@ +// PR c++/37967 +// Negative test for auto +// { dg-options "-std=c++0x" } + +auto f1 () -> int; +auto f2 (); // { dg-error "without late return type" } +int f3 () -> int; // { dg-error "with auto type specifier" } +auto *f4 () -> int; // { dg-error "not using auto" } + +struct A +{ + auto f5 () const -> int; + auto f6 (); // { dg-error "without late return type" } + int f7 () -> int; // { dg-error "with auto type specifier" } + auto *f8 () -> int; // { dg-error "not using auto" } +}; diff --git a/gcc/testsuite/gcc.c-torture/compile/20081101-1.c b/gcc/testsuite/gcc.c-torture/compile/20081101-1.c new file mode 100644 index 00000000000..0e484d0624f --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/20081101-1.c @@ -0,0 +1,12 @@ +int foo (int i, int b) +{ + int mask; + int result; + if (b) + mask = -1; + else + mask = 0; + result = i + 1; + result = result & mask; + return result; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/pr37976.c b/gcc/testsuite/gcc.c-torture/compile/pr37976.c new file mode 100644 index 00000000000..6b2ba63c0f2 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr37976.c @@ -0,0 +1,6 @@ +void percent_x(int ch, char *p, char* ok_chars) +{ + char *cp = ch == 'a' ? p : ""; + for (;*(cp += __builtin_strspn (cp, ok_chars));) + ; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/pr37991.c b/gcc/testsuite/gcc.c-torture/compile/pr37991.c new file mode 100644 index 00000000000..f374ea98540 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr37991.c @@ -0,0 +1,14 @@ +typedef int Int32; +void use_it(int); +void FindAndReadSignature(int processedSize) +{ + int numPrevBytes = 1; + for (;;) + { + int numBytesInBuffer = numPrevBytes + processedSize; + Int32 numTests = numBytesInBuffer - 1; + use_it (numTests); + numPrevBytes = numBytesInBuffer - numTests; + } +} + diff --git a/gcc/testsuite/gcc.c-torture/execute/pr37573.c b/gcc/testsuite/gcc.c-torture/execute/pr37573.c new file mode 100644 index 00000000000..589191035b9 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr37573.c @@ -0,0 +1,65 @@ +/* PR tree-optimization/37573 */ + +struct S +{ + unsigned int *a; + unsigned int b; + unsigned int c[624]; +}; + +static unsigned char __attribute__((noinline)) +foo (struct S *s) +{ + unsigned int r; + if (!--s->b) + { + unsigned int *c = s->c; + unsigned int i; + s->a = c; + for (i = 0; i < 227; i++) + c[i] = ((((c[i] ^ c[i + 1]) & 0x7ffffffe) ^ c[i]) >> 1) + ^ ((0 - (c[i + 1] & 1)) & 0x9908b0df) ^ c[i + 397]; + } + r = *(s->a++); + r ^= (r >> 11); + r ^= ((r & 0xff3a58ad) << 7); + r ^= ((r & 0xffffdf8c) << 15); + r ^= (r >> 18); + return (unsigned char) (r >> 1); +} + +static void __attribute__((noinline)) +bar (unsigned char *p, unsigned int q, unsigned int r) +{ + struct S s; + unsigned int i; + unsigned int *c = s.c; + *c = r; + for (i = 1; i < 624; i++) + c[i] = i + 0x6c078965 * ((c[i - 1] >> 30) ^ c[i - 1]); + s.b = 1; + while (q--) + *p++ ^= foo (&s); +}; + +static unsigned char p[23] = { + 0xc0, 0x49, 0x17, 0x32, 0x62, 0x1e, 0x2e, 0xd5, 0x4c, 0x19, 0x28, 0x49, + 0x91, 0xe4, 0x72, 0x83, 0x91, 0x3d, 0x93, 0x83, 0xb3, 0x61, 0x38 +}; + +static unsigned char q[23] = { + 0x3e, 0x41, 0x55, 0x54, 0x4f, 0x49, 0x54, 0x20, 0x55, 0x4e, 0x49, 0x43, + 0x4f, 0x44, 0x45, 0x20, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x3c +}; + +int +main (void) +{ + unsigned int s; + s = 23; + bar (p, s, s + 0xa25e); + if (__builtin_memcmp (p, q, s) != 0) + __builtin_abort (); + return 0; +} + diff --git a/gcc/testsuite/gcc.dg/cpp/Wsignprom.c b/gcc/testsuite/gcc.dg/cpp/Wsignprom.c index 44b5667b3f2..7cdbccb3cac 100644 --- a/gcc/testsuite/gcc.dg/cpp/Wsignprom.c +++ b/gcc/testsuite/gcc.dg/cpp/Wsignprom.c @@ -1,26 +1,26 @@ /* { dg-do preprocess } */ -/* { dg-options "-Wall" } */ +/* { dg-options "-Wall -fshow-column" } */ /* Test that -Wall emits the warnings about integer promotion changing the sign of an operand. */ -#if -1 > 0U /* { dg-warning "changes sign when promoted" } */ +#if -1 > 0U /* { dg-warning "5:changes sign when promoted" } */ #endif -#if 0U + -1 /* { dg-warning "changes sign when promoted" } */ +#if 0U + -1 /* { dg-warning "10:changes sign when promoted" } */ #endif -#if 0U * -1 /* { dg-warning "changes sign when promoted" } */ +#if 0U * -1 /* { dg-warning "10:changes sign when promoted" } */ #endif -#if 1U / -2 /* { dg-warning "changes sign when promoted" } */ +#if 1U / -2 /* { dg-warning "10:changes sign when promoted" } */ #endif -#if -1 % 1U /* { dg-warning "changes sign when promoted" } */ +#if -1 % 1U /* { dg-warning "5:changes sign when promoted" } */ #endif -#if 1 ? 0U : -1 /* { dg-warning "changes sign when promoted" } */ +#if 1 ? 0U : -1 /* { dg-warning "14:changes sign when promoted" } */ #endif -#if 1 ? -1 : 0U /* { dg-warning "changes sign when promoted" } */ +#if 1 ? -1 : 0U /* { dg-warning "9:changes sign when promoted" } */ #endif diff --git a/gcc/testsuite/gcc.dg/cpp/if-mpar.c b/gcc/testsuite/gcc.dg/cpp/if-mpar.c index df200bbbab4..633cefcb442 100644 --- a/gcc/testsuite/gcc.dg/cpp/if-mpar.c +++ b/gcc/testsuite/gcc.dg/cpp/if-mpar.c @@ -4,21 +4,27 @@ missing parenthesis message. */ /* { dg-do preprocess } */ +/* { dg-options "-fshow-column" } */ +#if (1 /* { dg-error "5:missing '\\)'" "missing ')' no. 1" } */ +#endif + +#if 2 * (3 + 4 /* { dg-error "9:missing '\\)'" "missing ')' no. 2" } */ +#endif -#if (1 /* { dg-error "missing '\\)'" "missing ')' no. 1" } */ +#if (2)) /* { dg-error "8:missing '\\('" "missing '(' no. 1" } */ #endif -#if 2 * (3 + 4 /* { dg-error "missing '\\)'" "missing ')' no. 2" } */ +#if ) /* { dg-error "5:missing '\\('" "missing '(' no. 2" } */ #endif -#if (2)) /* { dg-error "missing '\\('" "missing '(' no. 1" } */ +#if 4) /* { dg-error "6:missing '\\('" "missing '(' no. 3" } */ #endif -#if ) /* { dg-error "missing '\\('" "missing '(' no. 2" } */ +#if ( /* { dg-error "5:missing '\\)'" "missing ')' no. 3" } */ #endif -#if 4) /* { dg-error "missing '\\('" "missing '(' no. 3" } */ +#if ((2 + 3) + 5 /* { dg-error "5:missing '\\)'" "missing ')' no. 3" } */ #endif -#if ( /* { dg-error "missing '\\)'" "missing ')' no. 3" } */ +#if ((2 + 3 + 5 /* { dg-error "6:missing '\\)'" "missing ')' no. 3" } */ #endif diff --git a/gcc/testsuite/gcc.dg/graphite/pr37684.c b/gcc/testsuite/gcc.dg/graphite/pr37684.c new file mode 100644 index 00000000000..35c32911c30 --- /dev/null +++ b/gcc/testsuite/gcc.dg/graphite/pr37684.c @@ -0,0 +1,65 @@ +/* { dg-options "-O2 -floop-block -fdump-tree-graphite-all" } */ + +typedef struct _IO_FILE FILE; +struct _IO_marker { +}; +enum __codecvt_result +{ + __codecvt_noconv +}; +struct _IO_FILE { +}; +extern struct _IO_FILE *stderr; + +typedef + struct { + unsigned int avail_in; + unsigned int avail_out; + void *state; + void *(*bzalloc)(void *,int,int); + void *opaque; + } + bz_stream; +extern int BZ2_bzCompressInit ( + bz_stream* strm, + int blockSize100k, + int verbosity, + int workFactor + ); +typedef unsigned char Bool; +typedef int Int32; +typedef unsigned int UInt32; + +typedef + struct { + Int32 mode; + Int32 state; + UInt32* arr1; + UInt32* arr2; + UInt32* ftab; + Int32 nblock; + Int32 nblockMAX; + Bool inUse[256]; + Int32 blockNo; + } + EState; + +void prepare_new_block ( EState* s ) +{ + Int32 i; + for (i = 0; i < 256; i++) s->inUse[i] = ((Bool)0); + s->blockNo++; +} + +int BZ2_bzCompressInit + ( bz_stream* strm, + int blockSize100k, + int verbosity, + int workFactor ) +{ + EState* s; + s = (strm->bzalloc)(strm->opaque,(sizeof(EState)),1); + if (s->arr1 == ((void *)0) || s->arr2 == ((void *)0) || s->ftab == ((void *)0)) { + } + prepare_new_block ( s ); +} diff --git a/gcc/testsuite/gcc.dg/pr37858.c b/gcc/testsuite/gcc.dg/pr37858.c new file mode 100644 index 00000000000..4a827eebd12 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr37858.c @@ -0,0 +1,11 @@ +/* PR middle-end/37858 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-ipa-early_local_cleanups -dv" } */ + +int +main (void) +{ + return 0; +} + +/* { dg-final { cleanup-ipa-dump "early_local_cleanups" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr36908.c b/gcc/testsuite/gcc.dg/tree-ssa/pr36908.c new file mode 100644 index 00000000000..a135bcff238 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr36908.c @@ -0,0 +1,65 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -ftree-loop-distribution" } */ +#define NULL ((void *)0) + +typedef unsigned int size_t; +extern void *foo(size_t nelem, size_t elsize); +extern void bar (char*, ...); + +typedef struct alt_state *alt_state_t; +typedef struct state *state_t; + +struct alt_state +{ + alt_state_t next_alt_state; +}; + +static alt_state_t first_free_alt_state = NULL; + +static void +free_alt_state (alt_state_t alt_state) +{ + if (alt_state == NULL) + return; + alt_state->next_alt_state = first_free_alt_state; + first_free_alt_state = alt_state; +} + +/* The function frees list started with node ALT_STATE_LIST. */ +static void +free_alt_states (alt_state_t alt_states_list) +{ + alt_state_t curr_alt_state; + alt_state_t next_alt_state; + + for (curr_alt_state = alt_states_list; + curr_alt_state != NULL; + curr_alt_state = next_alt_state) + { + next_alt_state = curr_alt_state->next_alt_state; + free_alt_state (curr_alt_state); + } +} + +int +main (void) +{ + int i; + alt_state_t state, act_state; + + act_state = state = foo (1, sizeof (struct alt_state)); + for (i = 0; i < 2; i ++) + { + act_state->next_alt_state = foo (1, sizeof (struct alt_state)); + act_state = act_state->next_alt_state; + } + + free_alt_states (state); + + for (act_state = first_free_alt_state; + act_state != NULL; + act_state = act_state->next_alt_state) + bar ("going from %p to %p\n", act_state, act_state->next_alt_state); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-22.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-22.c new file mode 100644 index 00000000000..3a1697e6c76 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-22.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-pre-stats" } */ + +int foo (int i, int b) +{ + int j = 1; + if (b) + j = i; + return j - i; +} + +/* { dg-final { scan-tree-dump "Eliminated: 1" "pre" } } */ +/* { dg-final { cleanup-tree-dump "pre" } } */ diff --git a/gcc/testsuite/gcc.target/cris/biap.c b/gcc/testsuite/gcc.target/cris/biap.c new file mode 100644 index 00000000000..1f3b4368a36 --- /dev/null +++ b/gcc/testsuite/gcc.target/cris/biap.c @@ -0,0 +1,11 @@ +/* Make sure ADDI is combined and emitted successfully. + See also PR37939. */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ +/* { dg-final { scan-assembler "addi" } } */ +/* { dg-final { scan-assembler-not "lsl" } } */ + +int xyzzy (int r10, int r11) +{ + return r11 * 4 + r10; +} diff --git a/gcc/testsuite/gfortran.dg/host_assoc_call_3.f90 b/gcc/testsuite/gfortran.dg/host_assoc_call_3.f90 new file mode 100644 index 00000000000..6646270e5ac --- /dev/null +++ b/gcc/testsuite/gfortran.dg/host_assoc_call_3.f90 @@ -0,0 +1,44 @@ +! { dg-do compile } +! +! PR fortran/37445, in which the contained 'putaline' would be +! ignored and no specific interface found in the generic version. +! +! Contributed by Norman S Clerman < clerman@fuse.net> +! +MODULE M1 + INTERFACE putaline + MODULE PROCEDURE S1,S2 + END INTERFACE +CONTAINS + SUBROUTINE S1(I) + END SUBROUTINE + SUBROUTINE S2(F) + END SUBROUTINE +END MODULE + +MODULE M2 + USE M1 +CONTAINS + SUBROUTINE S3 + integer :: check = 0 + CALL putaline() + if (check .ne. 1) call abort + CALL putaline("xx") + if (check .ne. 2) call abort +! CALL putaline(1.0) ! => this now causes an error, as it should + CONTAINS + SUBROUTINE putaline(x) + character, optional :: x + if (present(x)) then + check = 2 + else + check = 1 + end if + END SUBROUTINE + END SUBROUTINE +END MODULE + + USE M2 + CALL S3 +END +! { dg-final { cleanup-modules "M1 M2" } } diff --git a/gcc/testsuite/gfortran.dg/host_assoc_call_4.f90 b/gcc/testsuite/gfortran.dg/host_assoc_call_4.f90 new file mode 100644 index 00000000000..f97a644e688 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/host_assoc_call_4.f90 @@ -0,0 +1,48 @@ +! { dg-do compile } +! +! PR fortran/37445, in which the first version of the fix regressed on the +! calls to GetBasicElementData; picking up the local GetBasicElementData instead. +! +! Contributed by Norman S Clerman < clerman@fuse.net> +! and reduced by Tobias Burnus <burnus@gcc.gnu.org> +! +MODULE ErrElmnt + IMPLICIT NONE + TYPE :: TErrorElement + integer :: i + end type TErrorElement +contains + subroutine GetBasicData ( AnElement, ProcedureName, ErrorNumber, & + Level, Message, ReturnStat) + type (TErrorElement) :: AnElement + character (*, 1), optional :: & + ProcedureName + integer (4), optional :: ErrorNumber + character (*, 1), optional :: Level + character (*, 1), optional :: Message + integer (4), optional :: ReturnStat + end subroutine GetBasicData +end module ErrElmnt + +MODULE ErrorMod + USE ErrElmnt, only: GetBasicElementData => GetBasicData , TErrorElement + IMPLICIT NONE +contains + subroutine GetBasicData () + integer (4) :: CallingStat, LocalErrorNum + character (20, 1) :: LocalErrorMessage + character (20, 1) :: LocalProcName + character (20, 1) :: Locallevel + type (TErrorElement) :: AnElement + call GetBasicElementData (AnElement, LocalProcName, LocalErrorNum, LocalLevel, LocalErrorMessage, CallingStat) + end subroutine GetBasicData + SUBROUTINE WH_ERR () + integer (4) :: ErrorNumber, CallingStat + character (20, 1) :: ProcedureName + character (20, 1) :: ErrorLevel + character (20, 1) :: ErrorMessage + type (TErrorElement) :: TargetElement + call GetBasicElementData (TargetElement, ProcedureName, ErrorNumber, ErrorLevel, ErrorMessage, CallingStat) + end subroutine WH_ERR +end module ErrorMod +! { dg-final { cleanup-modules "ErrElmnt ErrorMod" } } diff --git a/gcc/testsuite/gfortran.dg/host_assoc_function_4.f90 b/gcc/testsuite/gfortran.dg/host_assoc_function_4.f90 new file mode 100644 index 00000000000..799eb007870 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/host_assoc_function_4.f90 @@ -0,0 +1,30 @@ +! { dg-do run } +! +! PR fortran/37445, in which the contained 's1' would be +! ignored and the use+host associated version used. +! +! Contributed by Norman S Clerman < clerman@fuse.net> +! +MODULE M1 +CONTAINS + integer function S1 () + s1 = 0 + END function +END MODULE + +MODULE M2 + USE M1 +CONTAINS + SUBROUTINE S2 + if (s1 () .ne. 1) call abort + CONTAINS + integer function S1 () + s1 = 1 + END function + END SUBROUTINE +END MODULE + + USE M2 + CALL S2 +END +! { dg-final { cleanup-modules "M1 M2" } } diff --git a/gcc/testsuite/gfortran.dg/include_4.f90 b/gcc/testsuite/gfortran.dg/include_4.f90 new file mode 100644 index 00000000000..cf1efb159ad --- /dev/null +++ b/gcc/testsuite/gfortran.dg/include_4.f90 @@ -0,0 +1,12 @@ +! { dg-do compile } +! +! PR fortran/37821 +! +! Ensure that for #include "..." and for include the +! current directory/directory of the source file is +! included. See also include_5.f90 + +subroutine one() + include "include_4.inc" + integer(i4) :: i +end subroutine one diff --git a/gcc/testsuite/gfortran.dg/include_4.inc b/gcc/testsuite/gfortran.dg/include_4.inc new file mode 100644 index 00000000000..37b646774da --- /dev/null +++ b/gcc/testsuite/gfortran.dg/include_4.inc @@ -0,0 +1,4 @@ +! Used by include_4.f90 and include_5.f90 +! PR fortran/37821 +! +integer, parameter :: i4 = 4 diff --git a/gcc/testsuite/gfortran.dg/include_5.f90 b/gcc/testsuite/gfortran.dg/include_5.f90 new file mode 100644 index 00000000000..2bfd2bb09dd --- /dev/null +++ b/gcc/testsuite/gfortran.dg/include_5.f90 @@ -0,0 +1,18 @@ +! { dg-do compile } +! { dg-options "-cpp" } +! +! PR fortran/37821 +! +! Ensure that for #include "..." and for include the +! current directory/directory of the source file is +! included. + +subroutine one() + include "include_4.inc" + integer(i4) :: i +end subroutine one + +subroutine two() +# include "include_4.inc" + integer(i4) :: i +end subroutine two diff --git a/gcc/testsuite/gfortran.dg/initialization_20.f90 b/gcc/testsuite/gfortran.dg/initialization_20.f90 new file mode 100644 index 00000000000..47d552834ae --- /dev/null +++ b/gcc/testsuite/gfortran.dg/initialization_20.f90 @@ -0,0 +1,10 @@ +! { dg-do compile } +! Test for PR19925 +! +program pr19925 + implicit none + integer j + integer, parameter :: n = 100000 + integer, parameter :: i(n)=(/(j,j=1,n)/) ! { dg-error "number of elements" } + print *, i(5) +end program pr19925 diff --git a/gcc/testsuite/gfortran.dg/initialization_21.f90 b/gcc/testsuite/gfortran.dg/initialization_21.f90 new file mode 100644 index 00000000000..d4344767982 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/initialization_21.f90 @@ -0,0 +1,11 @@ +! { dg-do compile } +! { dg-options "-fmax-array-constructor=100000" } +! Test for PR19925 +! +program pr19925 + implicit none + integer j + integer, parameter :: n = 100000 + integer, parameter :: i(n) = (/ (j, j=1, n) /) + print *, i(5) +end program pr19925 diff --git a/gcc/testsuite/gfortran.dg/int_conv_2.f90 b/gcc/testsuite/gfortran.dg/int_conv_2.f90 new file mode 100644 index 00000000000..ce5f5a21712 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/int_conv_2.f90 @@ -0,0 +1,7 @@ +! { dg-do compile } +! PR fortran/37930 +program test + implicit none + integer i + i = transfer(-1,1.0) ! { dg-error "Conversion" } +end program test diff --git a/gcc/testsuite/gfortran.dg/mvbits_4.f90 b/gcc/testsuite/gfortran.dg/mvbits_4.f90 new file mode 100644 index 00000000000..b8d32140c78 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/mvbits_4.f90 @@ -0,0 +1,33 @@ +! { dg-do run } + +! PR fortran/35681 +! Check that dependencies of MVBITS arguments are resolved correctly by using +! temporaries if both arguments refer to the same variable. + + integer, dimension(10) :: ila1 = (/1,2,3,4,5,6,7,8,9,10/) + integer, dimension(20) :: ila2 + integer, dimension(10), target :: ila3 + integer, pointer :: ila3_ptr(:) + integer, parameter :: SHOULD_BE(10) = (/17,18,11,4,13,22,7,16,9,18/) + integer, parameter :: INDEX_VECTOR(10) = (/9,9,6,2,4,9,2,9,6,10/) + + ila2(2:20:2) = ila1 + ila3 = ila1 + + ! Argument is already packed. + call mvbits (ila1(INDEX_VECTOR), 2, 4, ila1, 3) + write (*,'(10(I3))') ila1 + if (any (ila1 /= SHOULD_BE)) call abort () + + ! Argument is not packed. + call mvbits (ila2(2*INDEX_VECTOR), 2, 4, ila2(2:20:2), 3) + write (*,'(10(I3))') ila2(2:20:2) + if (any (ila2(2:20:2) /= SHOULD_BE)) call abort () + + ! Pointer and target + ila3_ptr => ila3 + call mvbits (ila3(INDEX_VECTOR), 2, 4, ila3_ptr, 3) + write (*,'(10(I3))') ila3 + if (any (ila3 /= SHOULD_BE)) call abort () + + end diff --git a/gcc/testsuite/gfortran.dg/nested_forall_1.f b/gcc/testsuite/gfortran.dg/nested_forall_1.f new file mode 100644 index 00000000000..6aa66ee97a7 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/nested_forall_1.f @@ -0,0 +1,38 @@ +! { dg-do compile } +! +! PR fortran/35820 +! +! Memory leak(s) while resolving forall constructs. +! +! Contributed by Dick Hendrickson <dick.hendrickson@gmail.com> + + MODULE TESTS + INTEGER,PARAMETER,PUBLIC :: I1_KV = KIND(1) + INTEGER,PARAMETER,PUBLIC :: R1_KV = KIND(1.0) + INTEGER, PRIVATE :: J1,J2 + INTEGER,PARAMETER,PUBLIC :: S1 = 10, S2 = 9 + CONTAINS + SUBROUTINE SA0136(RDA,IDA,BDA) + REAL(R1_KV) RDA(S1) + INTEGER(I1_KV) IDA(S1,S2) + INTEGER(I1_KV) ICA(S1,S2) + REAL(R1_KV) RCA(S1) +! T E S T S T A T E M E N T S + FORALL (J1 = 1:S1) + RDA(J1) = RCA(J1) + 1.0_R1_KV + FORALL (J2 = 1:S2) + IDA(J1,J2) = ICA(J1,J2) + 1 + END FORALL + FORALL (J2 = 1:S2) + IDA(J1,J2) = ICA(J1,J2) + END FORALL + ENDFORALL + FORALL (J1 = 1:S1) + RDA(J1) = RCA(J1) + FORALL (J2 = 1:S2) + IDA(J1,J2) = ICA(J1,J2) + END FORALL + END FORALL + END SUBROUTINE + END MODULE TESTS +! { dg-final { cleanup-modules "tests" } } diff --git a/gcc/testsuite/gfortran.dg/proc_decl_17.f90 b/gcc/testsuite/gfortran.dg/proc_decl_17.f90 new file mode 100644 index 00000000000..858022a43fa --- /dev/null +++ b/gcc/testsuite/gfortran.dg/proc_decl_17.f90 @@ -0,0 +1,68 @@ +! { dg-do run } +! +! PR 36322/36463 +! +! Original code by James Van Buskirk. +! Modified by Janus Weil <janus@gcc.gnu.org> + +module m + + use ISO_C_BINDING + + character, allocatable, save :: my_message(:) + + abstract interface + function abs_fun(x) + use ISO_C_BINDING + import my_message + integer(C_INT) x(:) + character(size(my_message),C_CHAR) abs_fun(size(x)) + end function abs_fun + end interface + +contains + + function foo(y) + implicit none + integer(C_INT) :: y(:) + character(size(my_message),C_CHAR) :: foo(size(y)) + integer i,j + do i=1,size(y) + do j=1,size(my_message) + foo(i)(j:j) = achar(iachar(my_message(j))+y(i)) + end do + end do + end function + + subroutine check(p,a) + integer a(:) + procedure(abs_fun) :: p + character(size(my_message),C_CHAR) :: c(size(a)) + integer k,l,m + c = p(a) + m=iachar('a') + do k=1,size(a) + do l=1,size(my_message) + if (c(k)(l:l) /= achar(m)) call abort() + m = m + 1 + end do + end do + end subroutine + +end module + +program prog + +use m + +integer :: i(4) = (/0,6,12,18/) + +allocate(my_message(1:6)) + +my_message = (/'a','b','c','d','e','f'/) + +call check(foo,i) + +end program + +! { dg-final { cleanup-modules "m" } } diff --git a/gcc/testsuite/gfortran.dg/proc_decl_18.f90 b/gcc/testsuite/gfortran.dg/proc_decl_18.f90 new file mode 100644 index 00000000000..46493eb9e0f --- /dev/null +++ b/gcc/testsuite/gfortran.dg/proc_decl_18.f90 @@ -0,0 +1,63 @@ +! { dg-do run } +! +! PR 36322/36463 +! +! Contributed by Janus Weil <janus@gcc.gnu.org> + +module m + +contains + + pure integer function mysize(a) + integer,intent(in) :: a(:) + mysize = size(a) + end function + +end module + + +program prog + +use m +implicit none + +abstract interface + function abs_fun(x,sz) + integer :: x(:) + interface + pure integer function sz(b) + integer,intent(in) :: b(:) + end function + end interface + integer :: abs_fun(sz(x)) + end function +end interface + +procedure(abs_fun) :: p + +integer :: k,j(3),i(3) = (/1,2,3/) + +j = p(i,mysize) + +do k=1,mysize(i) + if (j(k) /= 2*i(k)) call abort() +end do + +end + + function p(y,asz) + implicit none + integer,intent(in) :: y(:) + interface + pure integer function asz(c) + integer,intent(in) :: c(:) + end function + end interface + integer :: p(asz(y)) + integer l + do l=1,asz(y) + p(l) = y(l)*2 + end do + end function + +! { dg-final { cleanup-modules "m" } } diff --git a/gcc/testsuite/gfortran.dg/proc_decl_19.f90 b/gcc/testsuite/gfortran.dg/proc_decl_19.f90 new file mode 100644 index 00000000000..1e85a7dbaef --- /dev/null +++ b/gcc/testsuite/gfortran.dg/proc_decl_19.f90 @@ -0,0 +1,23 @@ +! { dg-do compile } +! +! PR 36426 +! +! Contributed by Tobias Burnus <burnus@gcc.gnu.org> + +abstract interface + function foo(x) + character(len=*) :: x + character(len=len(x)) :: foo + end function foo +end interface +procedure(foo) :: bar + +abstract interface + character function abs_fun() + end function +end interface +procedure(abs_fun):: x + +character(len=20) :: str +str = bar("Hello") +end diff --git a/gcc/testsuite/gfortran.dg/random_seed_1.f90 b/gcc/testsuite/gfortran.dg/random_seed_1.f90 new file mode 100644 index 00000000000..510badf7d68 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/random_seed_1.f90 @@ -0,0 +1,14 @@ +! { dg-do compile } + +! Emit a diagnostic for too small PUT array at compile time +! See PR fortran/37159 + +! Possible improvement: +! Provide a separate testcase for systems that support REAL(16), +! to test the minimum size of 12 (instead of 8). + +PROGRAM random_seed_1 + IMPLICIT NONE + INTEGER :: small(7) + CALL RANDOM_SEED(PUT=small) ! { dg-error "is too small" } +END PROGRAM random_seed_1 diff --git a/gcc/testsuite/gfortran.dg/write_check4.f90 b/gcc/testsuite/gfortran.dg/write_check4.f90 new file mode 100644 index 00000000000..f418ba8fbf0 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/write_check4.f90 @@ -0,0 +1,17 @@ +! { dg-do compile } +! +! PR fortran/35840 +! +! The asynchronous specifier for a data transfer statement shall be +! an initialization expression +! +! Contributed by Tobias Burnus <burnus@gcc.gnu.org> +! + character(2) :: no + no = "no" + open (unit=10, asynchronous = no) ! Ok, it isn't a transfer stmt + write(*,*, asynchronous="Y"//"E"//trim("S ")) ! Ok, it is an init expr + write(*,*, asynchronous=no) ! { dg-error "must be an initialization expression" } + read (*,*, asynchronous="Y"//"e"//trim("S ")) + read (*,*, asynchronous=no) ! { dg-error "must be an initialization expression" } +end |