diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-09-11 14:52:16 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-09-11 14:52:16 +0000 |
commit | 699456467ce74df6879e7d9baf48b774eae32ac6 (patch) | |
tree | 15b58ac6468105ef8a7eda80cf951f303edd8380 /gcc/testsuite | |
parent | 3665047ec31ad754105881dcace2c477fffbe507 (diff) | |
download | gcc-699456467ce74df6879e7d9baf48b774eae32ac6.tar.gz |
2008-09-11 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r140286
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@140290 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
29 files changed, 509 insertions, 6 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 185c066b9ba..85bb2a598b7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,89 @@ +2008-09-11 Ira Rosen <irar@il.ibm.com> + + PR tree-optimization/37474 + * gcc.dg/vect/pr37474.c: New test. + +2008-09-11 Andreas Schwab <schwab@suse.de> + + * gcc.target/m68k/xgot-1.c: Add -mcpu=5206 to select a ColdFire + target. + +2008-09-11 Jakub Jelinek <jakub@redhat.com> + + PR target/37382 + * gcc.c-torture/compile/pr37382.c: New test. + +2008-09-11 Daniel Kraft <d@domob.eu> + + PR fortran/36214 + * gfortran.dg/boz_9.f90: Corrected test. + * gfortran.dg/boz_13.f90: New test. + * gfortran.dg/boz_14.f90: New test. + +2008-09-10 Jakub Jelinek <jakub@redhat.com> + + PR target/36904 + * gcc.target/powerpc/altivec-27.c: New test. + +2008-09-10 Andrew Pinski <andrew_pinski@playstation.sony.com> + + PR middle-end/37333 + * gcc.c-torture/compile/20080910-1.c: New testcase. + +2008-09-10 Richard Guenther <rguenther@suse.de> + + PR middle-end/37432 + * gcc.c-torture/compile/pr37432.c: New testcase. + +2008-09-10 H.J. Lu <hongjiu.lu@intel.com> + + PR target/37434: + * gcc.target/i386/pr37434-1.c: New. + * gcc.target/i386/pr37434-2.c: Likewise. + * gcc.target/i386/pr37434-3.c: Likewise. + * gcc.target/i386/pr37434-4.c: Likewise. + * gcc.target/i386/sse2-set-v8hi-1a.c: Likewise. + * gcc.target/i386/sse2-set-v8hi-2a.c: Likewise. + * gcc.target/i386/sse4_1-set-v16qi-1a.c: Likewise. + * gcc.target/i386/sse4_1-set-v16qi-2a.c: Likewise. + * gcc.target/i386/sse4_1-set-v16qi-3a.c: Likewise. + +2008-09-10 Tobias Burnus <burnus@net-b.de> + + PR fortran/37420 + * gfortran.dg/warn_unused_var.f90: New test. + * gfortran.dg/warn_unused_var.f90: Add cleanup-modules. + +2008-09-10 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/37353 + * gcc.dg/pr37353.c: New test. + +2008-09-10 Martin Michlmayr <tbm@cyrius.com> + Ira Rosen <irar@il.ibm.com> + + PR tree-optimization/37385 + * gcc.dg/vect/pr37385.c: New test. + +2008-09-09 H.J. Lu <hongjiu.lu@intel.com> + + PR rtl-optimization/37435 + * gcc.dg/dfp/pr37435.c: New. + +2008-09-09 Jakub Jelinek <jakub@redhat.com> + + PR c++/37417 + * g++.dg/ext/vla5.C: New test. + + PR middle-end/37356 + * g++.dg/tree-ssa/pr37356.C: New test. + + PR target/37438 + * gcc.dg/pr37438.c: New test. + + PR c++/37389 + * g++.dg/parse/enum4.C: New test. + 2008-09-09 Daniel Kraft <d@domob.eu> PR fortran/37429 @@ -595,7 +681,7 @@ * gcc.target/mips/octeon-bbit-3.c: New test. 2008-08-28 Manuel Lopez-Ibanez <manu@gcc.gnu.org> - Andrew Pinski <pinskia@gcc.gnu.org> + Andrew Pinski <pinskia@gcc.gnu.org> PR 18050 * gcc.dg/Wsequence-point-pr18050.c: New. diff --git a/gcc/testsuite/g++.dg/cpp0x/auto6.C b/gcc/testsuite/g++.dg/cpp0x/auto6.C index a574f54758f..713583a1a48 100644 --- a/gcc/testsuite/g++.dg/cpp0x/auto6.C +++ b/gcc/testsuite/g++.dg/cpp0x/auto6.C @@ -6,7 +6,10 @@ auto f() -> int } template<class T, class U> -auto add(T t, U u) -> decltype (t+u); +auto add(T t, U u) -> decltype (t+u) +{ + return t+u; +} template<class T, class U> decltype(T()+U()) add2(T t, U u); diff --git a/gcc/testsuite/g++.dg/ext/vla5.C b/gcc/testsuite/g++.dg/ext/vla5.C new file mode 100644 index 00000000000..021d4846946 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/vla5.C @@ -0,0 +1,10 @@ +// PR c++/37417 +// Testcase by Martin Michlmayr <tbm@cyrius.com> +// { dg-do compile } +// { dg-options "-O" } + +void +test (int a) +{ + new (char[a]); +} diff --git a/gcc/testsuite/g++.dg/parse/enum4.C b/gcc/testsuite/g++.dg/parse/enum4.C new file mode 100644 index 00000000000..6a20ea9cbf4 --- /dev/null +++ b/gcc/testsuite/g++.dg/parse/enum4.C @@ -0,0 +1,10 @@ +// PR c++/37389 +// { dg-do compile } +// { dg-options "-std=gnu++98" } + +enum +{ + A = 9223372036854775807ULL * 2 + 1, + B = B0, // { dg-error "was not declared|overflow" } + C = C0 // { dg-error "was not declared" } +}; diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr37356.C b/gcc/testsuite/g++.dg/tree-ssa/pr37356.C new file mode 100644 index 00000000000..45b99a037b9 --- /dev/null +++ b/gcc/testsuite/g++.dg/tree-ssa/pr37356.C @@ -0,0 +1,34 @@ +// PR middle-end/37356 */ +// { dg-do compile } +// { dg-options "-O" } + +bool foo (); +int bar (); + +bool +baz (int v) +{ + return v == bar (); +} + +struct A +{ + A () { baz (1) || foo (); } +}; + +struct B +{ + static A get () { return A (); } + B (const int &x) { } + B () : b (get ()) { } + A b; +}; + +B c; + +void +test () +{ + int d; + c = d; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/20080910-1.c b/gcc/testsuite/gcc.c-torture/compile/20080910-1.c new file mode 100644 index 00000000000..bf32775d401 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/20080910-1.c @@ -0,0 +1,56 @@ +/* This used to crash IRA with -O3 -fPIC. + See PR 37333. */ +struct yy_buffer_state { + int yy_is_interactive; +}; +static struct yy_buffer_state * * yy_buffer_stack = 0; +static int yy_n_chars; +int orafce_sql_yyleng; +unsigned char *yy_c_buf_p = 0; +extern char *orafce_sql_yytext; +static const int yy_ec[256] = { }; +short yy_accept[155], yy_base[193] = { }, yy_def[193] = { }; +short yy_chk[738] = { }; +unsigned char *yy_last_accepting_cpos; +int orafce_sql_yylex (int a) +{ + register int yy_current_state; + unsigned char *yy_cp, *yy_bp; + register int yy_act; + while ( 1 ) { + do { + char yy_c = yy_ec[*yy_cp]; + if ( yy_accept[yy_current_state] ) + yy_last_accepting_cpos = yy_cp; + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + yy_current_state = yy_def[yy_current_state]; + } while ( yy_current_state != 154 ); +yy_find_action: + yy_act = yy_accept[yy_current_state]; + *yy_cp = '\0'; + switch ( yy_act ) { + case 2: + *yy_cp = 1; + return 265; + case 24: + case 25: + addlit(orafce_sql_yytext, orafce_sql_yyleng); + case 26: + addlit(orafce_sql_yytext, orafce_sql_yyleng); + case 53: + yy_fatal_error( "flex scanner jammed" ); + break; + case 54: + yy_cp = ++(yy_c_buf_p); + unsigned long n = 0; + if ( yy_buffer_stack[0]->yy_is_interactive ) + for ( ; _IO_getc () != (-1) ; ++n ) + yy_n_chars = n; + if (a == 0) + { + yy_current_state = yy_get_previous_state( ); + goto yy_find_action; + } + } + } +} diff --git a/gcc/testsuite/gcc.c-torture/compile/pr37382.c b/gcc/testsuite/gcc.c-torture/compile/pr37382.c new file mode 100644 index 00000000000..47525bcf956 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr37382.c @@ -0,0 +1,16 @@ +/* PR target/37382 */ + +void baz (char *); +int c; + +void +bar (void) +{ + char a[2]; + int *ip = &c; + char *p = a, *q = (char *) &ip; + const char *r = q + 2; + for (; q != r; p++, q++) + *p = *q; + baz (a); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/pr37432.c b/gcc/testsuite/gcc.c-torture/compile/pr37432.c new file mode 100644 index 00000000000..747ec34c8f3 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr37432.c @@ -0,0 +1,9 @@ +static void print_wkb_byte(unsigned char val) { + print_wkb_bytes((unsigned char *)&val, 1, 1); +} +void InsertMultiPoint(int b) { + char a = 1; + if (b) a = 0; + print_wkb_byte(a); +} + diff --git a/gcc/testsuite/gcc.dg/dfp/pr37435.c b/gcc/testsuite/gcc.dg/dfp/pr37435.c new file mode 100644 index 00000000000..98acc9c118b --- /dev/null +++ b/gcc/testsuite/gcc.dg/dfp/pr37435.c @@ -0,0 +1,11 @@ +/* { dg-do compile { target fpic } } */ +/* { dg-options "-std=gnu99 -O2 -fPIC" } */ + +volatile _Decimal32 d; +volatile int i; + +void foo() +{ + d += i; + d += i; +} diff --git a/gcc/testsuite/gcc.dg/pr37353.c b/gcc/testsuite/gcc.dg/pr37353.c new file mode 100644 index 00000000000..07d73d0ebe7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr37353.c @@ -0,0 +1,15 @@ +/* PR tree-optimization/37353 */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +extern double exp (double); + +#define A exp (arg); +#define B A A A A A A A A A A +#define C B B B B B B B B B B + +void +foo (double arg) +{ + C +} diff --git a/gcc/testsuite/gcc.dg/pr37438.c b/gcc/testsuite/gcc.dg/pr37438.c new file mode 100644 index 00000000000..a6e366dc3c3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr37438.c @@ -0,0 +1,21 @@ +/* PR target/37438 */ +/* { dg-do compile } */ +/* { dg-options "-Os" } */ +/* { dg-options "-Os -march=i486" { target { { i686-*-* x86_64-*-* } && ilp32 } } } */ + +extern int bar (unsigned long long int); +extern int baz (const char *, unsigned int, unsigned short); + +int +foo (unsigned long long int x) +{ + return (x & 0xff) | ((unsigned int) (x >> 12) & ~0xff); +} + +int +test (const char *v, unsigned int w, unsigned long long int x) +{ + unsigned short k; + k = ((bar (x) & 0xff) << 8) | (foo (x) & 0xff); + return baz (v, w, k); +} diff --git a/gcc/testsuite/gcc.dg/vect/pr37385.c b/gcc/testsuite/gcc.dg/vect/pr37385.c new file mode 100644 index 00000000000..d6a477e634c --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr37385.c @@ -0,0 +1,20 @@ +/* Testcase by Martin Michlmayr <tbm@cyrius.com> */ +/* { dg-do compile } */ +/* { dg-require-effective-target vect_int } */ + +typedef int int_t; +typedef void (*fun_t) (int); +fun_t fun_tab[400] __attribute__ ((__aligned__(16))); + +void foo (int_t a); + +void +bar () +{ + int i; + + for (i = 0; i < 400; i++) + fun_tab[i] = foo; +} + +/* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/pr37474.c b/gcc/testsuite/gcc.dg/vect/pr37474.c new file mode 100644 index 00000000000..b6d01c269dc --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr37474.c @@ -0,0 +1,38 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target vect_int } */ + +#include <stdarg.h> + +#define M00 100 +#define M10 216 +#define M01 1322 +#define M11 13 +#define M02 74 +#define M12 191 + +#define N 16 + +void foo (unsigned int *__restrict__ pInput, unsigned int *__restrict__ pOutput) +{ + unsigned int i, a, b, c, d, e, f; + + for (i = 0; i < N / 3; i++) + { + a = *pInput++; + b = *pInput++; + c = *pInput++; + d = *pInput++; + e = *pInput++; + f = *pInput++; + + a = a + d; + b = b + e; + c = c + f; + + *pOutput++ = M00 * a + M01 * b + M02 * c; + *pOutput++ = M10 * a + M11 * b + M12 * c; + } +} + +/* { dg-final { cleanup-tree-dump "vect" } } */ + diff --git a/gcc/testsuite/gcc.target/i386/pr37434-1.c b/gcc/testsuite/gcc.target/i386/pr37434-1.c new file mode 100644 index 00000000000..b556bf0848e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr37434-1.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -msse2" } */ + +typedef short __v8hi __attribute__ ((__vector_size__ (16))); +typedef long long __m128i __attribute__ ((__vector_size__ (16))); +__m128i Set_AC4R_SETUP_I( const short *val ) { + short D2073 = *val; + short D2076 = *(val + 2); + short D2079 = *(val + 4); + __v8hi D2094 = {D2073, D2076, D2079, 0, D2073, D2076, D2079, 0}; + return (__m128i)D2094; +} diff --git a/gcc/testsuite/gcc.target/i386/pr37434-2.c b/gcc/testsuite/gcc.target/i386/pr37434-2.c new file mode 100644 index 00000000000..00ff9fd2e6c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr37434-2.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mtune=core2 -msse2" } */ + +typedef short __v8hi __attribute__ ((__vector_size__ (16))); +typedef long long __m128i __attribute__ ((__vector_size__ (16))); +__m128i Set_AC4R_SETUP_I( const short *val ) { + short D2073 = *val; + short D2076 = *(val + 2); + short D2079 = *(val + 4); + __v8hi D2094 = {D2073, D2076, D2079, 0, D2073, D2076, D2079, 0}; + return (__m128i)D2094; +} + +/* { dg-final { scan-assembler "pinsrw" } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr37434-3.c b/gcc/testsuite/gcc.target/i386/pr37434-3.c new file mode 100644 index 00000000000..916c99fe02f --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr37434-3.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target sse4 } */ +/* { dg-options "-O2 -msse4.1" } */ + +typedef char __v16qi __attribute__ ((__vector_size__ (16))); +typedef long long __m128i __attribute__ ((__vector_size__ (16))); +__m128i Set_AC4R_SETUP_I( const char *val ) { + char D2073 = *val; + char D2074 = *(val + 1); + char D2075 = *(val + 2); + char D2076 = *(val + 3); + char D2077 = *(val + 4); + char D2078 = *(val + 5); + char D2079 = *(val + 6); + __v16qi D2094 = {D2073, D2074, D2075, D2076, D2077, D2078, D2079, 0, + D2073, D2074, D2075, D2076, D2077, D2078, D2079, 0}; + return (__m128i)D2094; +} diff --git a/gcc/testsuite/gcc.target/i386/pr37434-4.c b/gcc/testsuite/gcc.target/i386/pr37434-4.c new file mode 100644 index 00000000000..15f8292b029 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr37434-4.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target sse4 } */ +/* { dg-options "-O2 -mtune=core2 -msse4.1" } */ + +typedef char __v16qi __attribute__ ((__vector_size__ (16))); +typedef long long __m128i __attribute__ ((__vector_size__ (16))); +__m128i Set_AC4R_SETUP_I( const char *val ) { + char D2073 = *val; + char D2074 = *(val + 1); + char D2075 = *(val + 2); + char D2076 = *(val + 3); + char D2077 = *(val + 4); + char D2078 = *(val + 5); + char D2079 = *(val + 6); + __v16qi D2094 = {D2073, D2074, D2075, D2076, D2077, D2078, D2079, 0, + D2073, D2074, D2075, D2076, D2077, D2078, D2079, 0}; + return (__m128i)D2094; +} + +/* { dg-final { scan-assembler "pinsrb" } } */ diff --git a/gcc/testsuite/gcc.target/i386/sse2-set-v8hi-1a.c b/gcc/testsuite/gcc.target/i386/sse2-set-v8hi-1a.c new file mode 100644 index 00000000000..816c19e20f8 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-set-v8hi-1a.c @@ -0,0 +1,7 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -mtune=core2 -msse2" } */ + +#define CHECK_H "sse2-check.h" +#define TEST sse2_test + +#include "set-v8hi-1.h" diff --git a/gcc/testsuite/gcc.target/i386/sse2-set-v8hi-2a.c b/gcc/testsuite/gcc.target/i386/sse2-set-v8hi-2a.c new file mode 100644 index 00000000000..b5103ac1d75 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-set-v8hi-2a.c @@ -0,0 +1,7 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -mtune=core2 -msse2" } */ + +#define CHECK_H "sse2-check.h" +#define TEST sse2_test + +#include "set-v8hi-2.h" diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-set-v16qi-1a.c b/gcc/testsuite/gcc.target/i386/sse4_1-set-v16qi-1a.c new file mode 100644 index 00000000000..b8612962dea --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse4_1-set-v16qi-1a.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target sse4 } */ +/* { dg-options "-O2 -mtune=core2 -msse4.1" } */ + +#define CHECK_H "sse4_1-check.h" +#define TEST sse4_1_test + +#include "set-v16qi-1.h" diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-set-v16qi-2a.c b/gcc/testsuite/gcc.target/i386/sse4_1-set-v16qi-2a.c new file mode 100644 index 00000000000..21f1692cdf7 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse4_1-set-v16qi-2a.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target sse4 } */ +/* { dg-options "-O2 -mtune=core2 -msse4.1" } */ + +#define CHECK_H "sse4_1-check.h" +#define TEST sse4_1_test + +#include "set-v16qi-2.h" diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-set-v16qi-3a.c b/gcc/testsuite/gcc.target/i386/sse4_1-set-v16qi-3a.c new file mode 100644 index 00000000000..1065a843a58 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse4_1-set-v16qi-3a.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target sse4 } */ +/* { dg-options "-O2 -mtune=core2 -msse4.1" } */ + +#define CHECK_H "sse4_1-check.h" +#define TEST sse4_1_test + +#include "set-v16qi-3.h" diff --git a/gcc/testsuite/gcc.target/m68k/xgot-1.c b/gcc/testsuite/gcc.target/m68k/xgot-1.c index f7dd6c939ac..e7bc5fb6012 100644 --- a/gcc/testsuite/gcc.target/m68k/xgot-1.c +++ b/gcc/testsuite/gcc.target/m68k/xgot-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fpic -mxgot" } */ +/* { dg-options "-fpic -mxgot -mcpu=5206" } */ /* { dg-final { scan-assembler "foo@GOT,\%\[ad\]\[0-7\]" } } */ extern int foo; diff --git a/gcc/testsuite/gcc.target/powerpc/altivec-27.c b/gcc/testsuite/gcc.target/powerpc/altivec-27.c new file mode 100644 index 00000000000..7db0ea01f2c --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/altivec-27.c @@ -0,0 +1,32 @@ +/* { dg-do compile { target powerpc*-*-* } } */ +/* { dg-require-effective-target powerpc_altivec_ok } */ +/* { dg-options "-maltivec" } */ + +#define f0() void x0 (vector float x) { } +f0 () + +#define f1(type) void x1##type (vector type x) { } +f1 (float) + +#define f2(v, type) void x2##type (v type x) { } +f2 (vector, float) + +#define f3(type) void x3##type (vector bool type x) { } +f3 (int) + +#define f4(v, type) void x4##type (v bool type x) { } +f4 (vector, int) + +#define f5(b, type) void x5##type (vector b type x) { } +f5 (bool, int) + +#define f6(v, b, type) void x6##type (v b type x) { } +f6 (vector, bool, int) + +#define f7(v, b, type) void x7##type (v type b x) { } +f7 (vector, bool, int) + +int vector = 6; + +#define v1(v) int x8 (int v) { return v; } +v1(vector) diff --git a/gcc/testsuite/gfortran.dg/boz_13.f90 b/gcc/testsuite/gfortran.dg/boz_13.f90 new file mode 100644 index 00000000000..a522f82ec87 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/boz_13.f90 @@ -0,0 +1,13 @@ +! { dg-do run } + +! PR fortran/36214 +! For BOZ-initialization of floats, the precision used to be wrong sometimes. + +implicit none + real, parameter :: r = 0.0 + real(kind=8), parameter :: rd = real (z'00000000& + &402953FD', 8) + + if (real (z'00000000& + &402953FD', 8) /= rd) call abort +end diff --git a/gcc/testsuite/gfortran.dg/boz_14.f90 b/gcc/testsuite/gfortran.dg/boz_14.f90 new file mode 100644 index 00000000000..a6690ce9f9d --- /dev/null +++ b/gcc/testsuite/gfortran.dg/boz_14.f90 @@ -0,0 +1,18 @@ +! { dg-do run } + +! PR fortran/36214 +! For BOZ-initialization of floats, the precision used to be wrong sometimes. + + implicit none + real(4) r + real(8) rd + complex(8) z + rd = & + real (b'00000000000000000000000000000000& + &01000000001010010101001111111101',8) + z = & + cmplx(b'00000000000000000000000000000000& + &01000000001010010101001111111101',0,8) + r = 0. + if (z /= rd) call abort + end diff --git a/gcc/testsuite/gfortran.dg/boz_9.f90 b/gcc/testsuite/gfortran.dg/boz_9.f90 index e1b0592e67a..1488c6dc8be 100644 --- a/gcc/testsuite/gfortran.dg/boz_9.f90 +++ b/gcc/testsuite/gfortran.dg/boz_9.f90 @@ -22,13 +22,13 @@ complex :: z2 = cmplx(5.0, o'01245') if (r2c /= 13107.0) call abort() if (rc /= 1.83668190E-41) call abort() -if (dc /= 0.30102999566398120) call abort() +if (dc /= 0.30102999566398120d0) call abort() if (real(z1c) /= 2.94272678E-44 .or. aimag(z1c) /= -4.0) call abort() if (real(z2c) /= 5.0 .or. aimag(z2c) /= 9.48679060E-43) call abort() if (r2 /= 13107.0) call abort() if (r /= 1.83668190E-41) call abort() -if (d /= 0.30102999566398120) call abort() +if (d /= 0.30102999566398120d0) call abort() if (real(z1) /= 2.94272678E-44 .or. aimag(z1) /= -4.0) call abort() if (real(z2) /= 5.0 .or. aimag(z2) /= 9.48679060E-43) call abort() @@ -40,7 +40,7 @@ z2 = cmplx(5.0, o'01245') if (r2 /= 13107.0) call abort() if (r /= 1.83668190E-41) call abort() -if (d /= 0.30102999566398120) call abort() +if (d /= 0.30102999566398120d0) call abort() if (real(z1) /= 2.94272678E-44 .or. aimag(z1) /= -4.0) call abort() if (real(z2) /= 5.0 .or. aimag(z2) /= 9.48679060E-43) call abort() diff --git a/gcc/testsuite/gfortran.dg/implicit_12.f90 b/gcc/testsuite/gfortran.dg/implicit_12.f90 index 8136a183971..4e9c256d286 100644 --- a/gcc/testsuite/gfortran.dg/implicit_12.f90 +++ b/gcc/testsuite/gfortran.dg/implicit_12.f90 @@ -21,3 +21,5 @@ program startest if('#'//Q2//'#' /='#abcdefghijkl#') call abort() call sub('ABCDEFGHIJKLM') ! len=13 end program startest + +! { dg-final { cleanup-modules "mod" } } diff --git a/gcc/testsuite/gfortran.dg/warn_unused_var.f90 b/gcc/testsuite/gfortran.dg/warn_unused_var.f90 new file mode 100644 index 00000000000..1858e685240 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/warn_unused_var.f90 @@ -0,0 +1,7 @@ +! { dg-do compile } +! { dg-options "-Wunused-variable" } +! +! PR fortran/37420 +! +integer :: i ! { dg-warning "Unused variable" } +end |