diff options
Diffstat (limited to 'gcc/testsuite')
62 files changed, 832 insertions, 87 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9eb36a76045..c49e0b78fe8 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,141 @@ +2011-07-21 Uros Bizjak <ubizjak@gmail.com> + + * lib/target-supports.exp (check_avx_os_support_available): New. + (check_effective_target_avx_runtime): Use it. + +2011-07-21 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/49770 + * g++.dg/torture/pr49770.C: New testcase. + +2011-07-21 Kai Tietz <ktietz@redhat.com> + + * gcc.dg/tree-ssa/pr30978.c: adjusted. + * gcc.dg/tree-ssa/ssa-fre-6.c: Likewise. + +2011-07-21 Tobias Burnus <burnus@net-b.de> + + * gfortran.dg/coarray_lib_token_1.f90: New. + +2011-07-21 Georg-Johann Lay <avr@gjlay.de> + + * gcc.dg/pr32912-2.c: Skip for AVR. + * gcc.dg/pr44674.c: Add dg-require-profiling. + +2011-07-20 Jason Merrill <jason@redhat.com> + + * g++.dg/ext/desig2.C: New. + +2011-07-20 Michael Meissner <meissner@linux.vnet.ibm.com> + + * gcc.target/powerpc/ppc-fma-1.c: Adjust to allow non-VSX fmas to + be generated. + * gcc.target/powerpc/ppc-fma-2.c: Ditto. + * gcc.target/powerpc/recip-3.c: Ditto. + +2011-07-19 Jason Merrill <jason@redhat.com> + + PR c++/6709 (DR 743) + PR c++/42603 (DR 950) + * g++.dg/cpp0x/decltype21.C: New. + +2011-07-20 Richard Guenther <rguenther@suse.de> + + PR middle-end/18908 + * gcc.dg/tree-ssa/pr18908.c: New testcase. + * gcc.dg/tree-ssa/bitwise-sink.c: Adjust. + +2011-07-20 Chung-Lin Tang <cltang@codesourcery.com> + + * gcc.target/arm/combine-movs.c: New. + * gcc.target/arm/unsigned-extend-2.c: New. + +2011-07-19 Jason Merrill <jason@redhat.com> + + PR c++/49785 + * g++.dg/cpp0x/variadic114.C: New. + +2011-07-19 Tobias Burnus <burnus@net-b.de> + + * gfortran.dg/coarray_args_1.f90: New. + * gfortran.dg/coarray_args_2.f90: New. + +2011-07-19 Janus Weil <janus@gcc.gnu.org> + + PR fortran/49708 + * gfortran.dg/allocate_error_3.f90: New. + +2011-07-19 Richard Guenther <rguenther@suse.de> + + * gcc.dg/tree-ssa/bool-10.c: Adjust expected pattern. + * gcc.dg/tree-ssa/bool-11.c: Likewise. + * gcc.dg/torture/20110719-1.c: New testcase. + +2011-07-19 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/49768 + * gcc.c-torture/execute/pr49768.c: New test. + +2011-07-19 Ira Rosen <ira.rosen@linaro.org> + + PR tree-optimization/49771 + * gcc.dg/vect/pr49771.c: New test. + +2011-07-18 Martin Jambor <mjambor@suse.cz> + + * gcc.dg/ipa/ipa-1.c: Updated testcase dump scan. + * gcc.dg/ipa/ipa-2.c: Likewise. + * gcc.dg/ipa/ipa-3.c: Likewise and made functions static. + * gcc.dg/ipa/ipa-4.c: Updated testcase dump scan. + * gcc.dg/ipa/ipa-5.c: Likewise. + * gcc.dg/ipa/ipa-7.c: Likewise. + * gcc.dg/ipa/ipa-8.c: Updated testcase dump scan. + * gcc.dg/ipa/ipacost-1.c: Likewise. + * gcc.dg/ipa/ipacost-2.c: Likewise and increased sizes of some + functions. + * gcc.dg/ipa/ipcp-1.c: New test. + * gcc.dg/ipa/ipcp-2.c: Likewise. + * gcc.dg/tree-ssa/ipa-cp-1.c: Updated testcase. + +2011-07-18 Jakub Jelinek <jakub@redhat.com> + + PR middle-end/49675 + * gfortran.dg/pr49675.f90: New test. + +2011-07-18 Richard Guenther <rguenther@suse.de> + + * gcc.dg/torture/20110718-1.c: New testcase. + +2011-07-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + * g++.dg/ext/bitfield2.C: Remove i?86-*-netware support. + * g++.dg/ext/bitfield3.C: Likewise. + * g++.dg/ext/bitfield4.C: Likewise. + * g++.dg/ext/bitfield5.C: Likewise. + * g++.dg/other/PR23205.C: Remove *-*-netware* support. + * g++.dg/other/pr23205-2.C: Likewise. + * gcc.c-torture/compile/20001109-1.c: Remove dg-xfail-if. + * gcc.c-torture/compile/20001109-2.c: Likewise. + * gcc.dg/20040813-1.c: Remove *-*-netware* support. + * gcc.dg/bitfld-15.c: Remove i?86-*-netware support. + * gcc.dg/bitfld-16.c: Likewise. + * gcc.dg/bitfld-17.c: Likewise. + * gcc.dg/bitfld-18.c: Likewise. + * gcc.dg/builtins-config.h: Remove Netware support. + * gcc.dg/cdce1.c: Remove *-*-netware* support. Update line number. + * gcc.dg/cdce2.c: Likewise. + * gcc.dg/cpp/assert4.c: Remove netware support. + * gcc.dg/debug/pr35154.c: Remove *-*-netware* support. + * gfortran.dg/debug/pr35154-stabs.f: Remove *-*-netware* support. + + * lib/target-supports.exp (check_visibility_available): Remove + NetWare support. + (check_profiling_available): Likewise. + +2011-07-18 Ira Rosen <ira.rosen@linaro.org> + + * gcc.dg/vect/pr49038.c: Run only on targets that support mmap. + 2011-07-17 Tobias Burnus <burnus@net-b.de> Thomas Koenig <tkoenig@gcc.gnu.org> diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype21.C b/gcc/testsuite/g++.dg/cpp0x/decltype21.C new file mode 100644 index 00000000000..ee73bfbc36c --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/decltype21.C @@ -0,0 +1,18 @@ +// PR c++/6709 (DR 743) +// PR c++/42603 (DR 950) +// { dg-options -std=c++0x } + +template <class T> +T make(); + +struct p { typedef int t; }; +struct c : decltype(make<p>()) {}; + +decltype(make<p>())::t t; + +int f(); +decltype(f())::t t2; // { dg-error "not a class" } + +struct D: decltype(f()) { }; // { dg-error "not a class" } + +// { dg-prune-output "expected initializer" } diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic114.C b/gcc/testsuite/g++.dg/cpp0x/variadic114.C new file mode 100644 index 00000000000..3ffede5c507 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/variadic114.C @@ -0,0 +1,27 @@ +// PR c++/49785 +// { dg-options -std=c++0x } + +template <typename, typename ...> struct B { }; +template <typename> class A; + +template <typename R, typename ... S> +struct A <R (S ...)> : public B <R, S ...> +{ + struct C {}; + template <typename D> A (D, C = C ()) { } + R operator () (...); +}; + +template <typename R, typename ... S, typename T> +auto operator >> (A <R (S ...)>, T)->A <R (S ...)> +{ + []() {}; +} + +int +main () +{ + A <int (int, int)> a = [](int, int) {}; + auto b = []{}; + (a >> b) (3, 5); +} diff --git a/gcc/testsuite/g++.dg/ext/bitfield2.C b/gcc/testsuite/g++.dg/ext/bitfield2.C index c288cec7c33..09e0352f1d0 100644 --- a/gcc/testsuite/g++.dg/ext/bitfield2.C +++ b/gcc/testsuite/g++.dg/ext/bitfield2.C @@ -1,7 +1,7 @@ /* { dg-do compile } */ /* Remove pedantic. Allow the GCC extension to use char for bitfields. */ /* { dg-options "" } */ -/* { dg-options "-Wno-packed-bitfield-compat -mno-ms-bitfields" { target { i?86-*-netware i?86-*-mingw* x86_64-*-mingw* } } } */ +/* { dg-options "-Wno-packed-bitfield-compat -mno-ms-bitfields" { target { i?86-*-mingw* x86_64-*-mingw* } } } */ struct t /* { dg-message "note: offset of packed bit-field 't::b' has changed in GCC 4.4" "" { target pcc_bitfield_type_matters } } */ { diff --git a/gcc/testsuite/g++.dg/ext/bitfield3.C b/gcc/testsuite/g++.dg/ext/bitfield3.C index f9fb78cceee..75d290f00e1 100644 --- a/gcc/testsuite/g++.dg/ext/bitfield3.C +++ b/gcc/testsuite/g++.dg/ext/bitfield3.C @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-Wno-packed-bitfield-compat" } */ -/* { dg-options "-Wno-packed-bitfield-compat -mno-ms-bitfields" { target { i?86-*-netware i?86-*-mingw* x86_64-*-mingw* } } } */ +/* { dg-options "-Wno-packed-bitfield-compat -mno-ms-bitfields" { target { i?86-*-mingw* x86_64-*-mingw* } } } */ struct t { diff --git a/gcc/testsuite/g++.dg/ext/bitfield4.C b/gcc/testsuite/g++.dg/ext/bitfield4.C index 8562686d6eb..d707376e804 100644 --- a/gcc/testsuite/g++.dg/ext/bitfield4.C +++ b/gcc/testsuite/g++.dg/ext/bitfield4.C @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-options "" } */ -/* { dg-options "-Wno-packed-bitfield-compat -mno-ms-bitfields" { target { i?86-*-netware i?86-*-mingw* x86_64-*-mingw* } } } */ +/* { dg-options "-Wno-packed-bitfield-compat -mno-ms-bitfields" { target { i?86-*-mingw* x86_64-*-mingw* } } } */ struct t /* { dg-message "note: offset of packed bit-field 't::b' has changed in GCC 4.4" "" { target pcc_bitfield_type_matters } } */ { diff --git a/gcc/testsuite/g++.dg/ext/bitfield5.C b/gcc/testsuite/g++.dg/ext/bitfield5.C index 1d862d76975..748669543c1 100644 --- a/gcc/testsuite/g++.dg/ext/bitfield5.C +++ b/gcc/testsuite/g++.dg/ext/bitfield5.C @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-Wno-packed-bitfield-compat" } */ -/* { dg-options "-Wno-packed-bitfield-compat -mno-ms-bitfields" { target { i?86-*-netware i?86-*-mingw* x86_64-*-mingw* } } } */ +/* { dg-options "-Wno-packed-bitfield-compat -mno-ms-bitfields" { target { i?86-*-mingw* x86_64-*-mingw* } } } */ struct t { diff --git a/gcc/testsuite/g++.dg/ext/desig2.C b/gcc/testsuite/g++.dg/ext/desig2.C new file mode 100644 index 00000000000..229ae527d77 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/desig2.C @@ -0,0 +1,25 @@ +// Test for C99-style designated array initializer + +union U +{ + long l; + const char *p; +}; + +__extension__ U u = { .p = "" }; + +__extension__ int i[4] = { [0] = 1, [1] = 2 }; + +// Currently, except for unions, the C++ front end only supports +// designators that designate the element that would have been initialized +// anyway. While that's true, make sure that we get a sorry rather than +// bad code. + +struct A +{ + int i; + int j; +}; + +__extension__ A a = { .j = 1 }; // { dg-message "non-trivial" } +__extension__ int j[2] = { [1] = 1 }; // { dg-message "non-trivial" } diff --git a/gcc/testsuite/g++.dg/other/PR23205.C b/gcc/testsuite/g++.dg/other/PR23205.C index 27353544482..338079fbd93 100644 --- a/gcc/testsuite/g++.dg/other/PR23205.C +++ b/gcc/testsuite/g++.dg/other/PR23205.C @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-skip-if "No stabs" { mmix-*-* *-*-aix* *-*-netware* alpha*-*-* hppa*64*-*-* ia64-*-* *-*-vxworks } { "*" } { "" } } */ +/* { dg-skip-if "No stabs" { mmix-*-* *-*-aix* alpha*-*-* hppa*64*-*-* ia64-*-* *-*-vxworks } { "*" } { "" } } */ /* { dg-options "-gstabs+ -fno-eliminate-unused-debug-types" } */ const int foobar = 4; diff --git a/gcc/testsuite/g++.dg/other/pr23205-2.C b/gcc/testsuite/g++.dg/other/pr23205-2.C index 608108ad9a0..a4333b38630 100644 --- a/gcc/testsuite/g++.dg/other/pr23205-2.C +++ b/gcc/testsuite/g++.dg/other/pr23205-2.C @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-skip-if "No stabs" { mmix-*-* *-*-aix* *-*-netware* alpha*-*-* hppa*64*-*-* ia64-*-* } { "*" } { "" } } */ +/* { dg-skip-if "No stabs" { mmix-*-* *-*-aix* alpha*-*-* hppa*64*-*-* ia64-*-* } { "*" } { "" } } */ /* { dg-options "-gstabs+ -fno-eliminate-unused-debug-types -ftoplevel-reorder" } */ const int foobar = 4; diff --git a/gcc/testsuite/g++.dg/torture/pr49770.C b/gcc/testsuite/g++.dg/torture/pr49770.C new file mode 100644 index 00000000000..7eac9e0d9bb --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr49770.C @@ -0,0 +1,86 @@ +/* { dg-do run } */ +/* { dg-options "-std=c++0x -fno-tree-forwprop" } */ + +typedef __SIZE_TYPE__ size_t; + +template < typename > struct remove_reference; +template < typename _Tp > struct remove_reference <_Tp & > +{ + typedef _Tp type; +}; +template < typename _Tp > typename remove_reference < _Tp >::type && +move (_Tp && __t) +{ + return static_cast < typename remove_reference < _Tp >::type && >(__t); +} + +template < typename _Tp > void +stdswap (_Tp & __a, _Tp & __b) +{ + _Tp __tmp (__a); + __a = (__b); + __b = (__tmp); +} + +struct _Deque_iterator +{ + int *_M_cur; + int *_M_first; + int *_M_last; + int **_M_node; +}; + +static inline int operatorMIN (_Deque_iterator & __x, _Deque_iterator & __y) +{ + return sizeof (int) * (__x._M_node - __y._M_node - 1) + + (__x._M_cur - __x._M_first) + (__y._M_last - __y._M_cur); +} + +struct deque +{ + deque & operator = (deque && __x) + { + stdswap (_M_finish, __x._M_finish); + return *this; + } + size_t size () + { + return operatorMIN (_M_finish, _M_start); + } + +deque (): + _M_map (), _M_map_size (), _M_start (), _M_finish () + { + _M_start._M_last = _M_start._M_first + sizeof (int); + } + + int **_M_map; + size_t _M_map_size; + _Deque_iterator _M_start; + _Deque_iterator _M_finish; +}; + +struct queue +{ + deque c; + size_t size () + { + return c.size (); + } +}; + +void +test01 () +{ + queue a, b; + ++a.c._M_finish._M_cur; + b = move (a); + if (!b.size ()) + __builtin_abort (); +} + +main () +{ + test01 (); +} + diff --git a/gcc/testsuite/gcc.c-torture/compile/20001109-1.c b/gcc/testsuite/gcc.c-torture/compile/20001109-1.c index 6e513c9563f..cce8047ae8a 100644 --- a/gcc/testsuite/gcc.c-torture/compile/20001109-1.c +++ b/gcc/testsuite/gcc.c-torture/compile/20001109-1.c @@ -1,5 +1,3 @@ -/* This does not work on NetWare, which has a default of 1-byte alignment. */ -/* { dg-xfail-if "" { "*-*-netware*" } { "*" } { "" } } */ typedef struct _foo foo; extern foo bar; struct _foo { diff --git a/gcc/testsuite/gcc.c-torture/compile/20001109-2.c b/gcc/testsuite/gcc.c-torture/compile/20001109-2.c index 1448215c578..a23e56bd34b 100644 --- a/gcc/testsuite/gcc.c-torture/compile/20001109-2.c +++ b/gcc/testsuite/gcc.c-torture/compile/20001109-2.c @@ -1,5 +1,3 @@ -/* This does not work on NetWare, which has a default of 1-byte alignment. */ -/* { dg-xfail-if "" { "*-*-netware*" } { "*" } { "" } } */ extern struct foo bar; struct foo { int a; diff --git a/gcc/testsuite/gcc.c-torture/execute/pr49768.c b/gcc/testsuite/gcc.c-torture/execute/pr49768.c new file mode 100644 index 00000000000..85bc9d2a06f --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr49768.c @@ -0,0 +1,12 @@ +/* PR tree-optimization/49768 */ + +extern void abort (void); + +int +main () +{ + static struct { unsigned int : 1; unsigned int s : 1; } s = { .s = 1 }; + if (s.s != 1) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/20040813-1.c b/gcc/testsuite/gcc.dg/20040813-1.c index fa01a530208..bf87f4172cf 100644 --- a/gcc/testsuite/gcc.dg/20040813-1.c +++ b/gcc/testsuite/gcc.dg/20040813-1.c @@ -2,7 +2,7 @@ /* Contributed by Devang Patel <dpatel@apple.com> */ /* { dg-do compile } */ -/* { dg-skip-if "No stabs" { mmix-*-* *-*-aix* *-*-netware* alpha*-*-* hppa*64*-*-* ia64-*-* *-*-vxworks* } { "*" } { "" } } */ +/* { dg-skip-if "No stabs" { mmix-*-* *-*-aix* alpha*-*-* hppa*64*-*-* ia64-*-* *-*-vxworks* } { "*" } { "" } } */ /* { dg-options "-gstabs" } */ int diff --git a/gcc/testsuite/gcc.dg/binop-xor1.c b/gcc/testsuite/gcc.dg/binop-xor1.c index 53a2ce23ab3..48f6b425959 100644 --- a/gcc/testsuite/gcc.dg/binop-xor1.c +++ b/gcc/testsuite/gcc.dg/binop-xor1.c @@ -7,8 +7,5 @@ foo (int a, int b, int c) return ((a && !b && c) || (!a && b && c)); } -/* We expect to see "<bb N>"; confirm that, so that we know to count - it in the real test. */ -/* { dg-final { scan-tree-dump-times "<bb\[^>\]*>" 5 "optimized" } } */ -/* { dg-final { scan-tree-dump-times "\\\^" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "\\\^" 1 "optimized" { xfail *-*-* } } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/binop-xor3.c b/gcc/testsuite/gcc.dg/binop-xor3.c index 97c7888189a..9d3b50bd4ee 100644 --- a/gcc/testsuite/gcc.dg/binop-xor3.c +++ b/gcc/testsuite/gcc.dg/binop-xor3.c @@ -7,8 +7,5 @@ foo (int a, int b) return ((a && !b) || (!a && b)); } -/* We expect to see "<bb N>"; confirm that, so that we know to count - it in the real test. */ -/* { dg-final { scan-tree-dump-times "<bb\[^>\]*>" 1 "optimized" } } */ -/* { dg-final { scan-tree-dump-times "\\\^" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "\\\^" 1 "optimized" { xfail *-*-* } } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/bitfld-15.c b/gcc/testsuite/gcc.dg/bitfld-15.c index 03f43f2de8c..32878d74dbc 100644 --- a/gcc/testsuite/gcc.dg/bitfld-15.c +++ b/gcc/testsuite/gcc.dg/bitfld-15.c @@ -1,7 +1,6 @@ /* { dg-do compile } */ /* Remove pedantic. Allow the GCC extension to use char for bitfields. */ /* { dg-options "" } */ -/* { dg-options "-mno-ms-bitfields" { target i?86-*-netware } } */ /* { dg-options "-mno-ms-bitfields -Wno-packed-bitfield-compat" { target { i?86-*-mingw* x86_64-*-mingw* } } } */ struct t diff --git a/gcc/testsuite/gcc.dg/bitfld-16.c b/gcc/testsuite/gcc.dg/bitfld-16.c index 5ed30f74392..75d290f00e1 100644 --- a/gcc/testsuite/gcc.dg/bitfld-16.c +++ b/gcc/testsuite/gcc.dg/bitfld-16.c @@ -1,6 +1,5 @@ /* { dg-do compile } */ /* { dg-options "-Wno-packed-bitfield-compat" } */ -/* { dg-options "-Wno-packed-bitfield-compat -mno-ms-bitfields" { target i?86-*-netware } } */ /* { dg-options "-Wno-packed-bitfield-compat -mno-ms-bitfields" { target { i?86-*-mingw* x86_64-*-mingw* } } } */ struct t diff --git a/gcc/testsuite/gcc.dg/bitfld-17.c b/gcc/testsuite/gcc.dg/bitfld-17.c index 9512f5fdf2a..6dc6989df7b 100644 --- a/gcc/testsuite/gcc.dg/bitfld-17.c +++ b/gcc/testsuite/gcc.dg/bitfld-17.c @@ -1,6 +1,5 @@ /* { dg-do compile } */ /* { dg-options "" } */ -/* { dg-options "-mno-ms-bitfields" { target i?86-*-netware } } */ /* { dg-options "-mno-ms-bitfields -Wno-packed-bitfield-compat" { target { i?86-*-mingw* x86_64-*-mingw* } } } */ struct t diff --git a/gcc/testsuite/gcc.dg/bitfld-18.c b/gcc/testsuite/gcc.dg/bitfld-18.c index 067d9ae3851..748669543c1 100644 --- a/gcc/testsuite/gcc.dg/bitfld-18.c +++ b/gcc/testsuite/gcc.dg/bitfld-18.c @@ -1,6 +1,5 @@ /* { dg-do compile } */ /* { dg-options "-Wno-packed-bitfield-compat" } */ -/* { dg-options "-Wno-packed-bitfield-compat -mno-ms-bitfields" { target i?86-*-netware } } */ /* { dg-options "-Wno-packed-bitfield-compat -mno-ms-bitfields" { target { i?86-*-mingw* x86_64-*-mingw* } } } */ struct t diff --git a/gcc/testsuite/gcc.dg/builtins-config.h b/gcc/testsuite/gcc.dg/builtins-config.h index 49ec0dcc8e4..fc1ade677a2 100644 --- a/gcc/testsuite/gcc.dg/builtins-config.h +++ b/gcc/testsuite/gcc.dg/builtins-config.h @@ -15,8 +15,6 @@ /* AVR doesn't have the entire C99 runtime. */ #elif defined(__FreeBSD__) && (__FreeBSD__ < 9) /* FreeBSD up to version 8 lacks support for cexp and friends. */ -#elif defined(__netware__) -/* NetWare doesn't have the entire C99 runtime. */ #elif defined(__vxworks) /* VxWorks doesn't have a full C99 time. (cabs is missing, for example.) */ #elif defined(_WIN32) && !defined(__CYGWIN__) diff --git a/gcc/testsuite/gcc.dg/cdce1.c b/gcc/testsuite/gcc.dg/cdce1.c index 58a3ddfb3a9..3bd35ecb786 100644 --- a/gcc/testsuite/gcc.dg/cdce1.c +++ b/gcc/testsuite/gcc.dg/cdce1.c @@ -1,7 +1,6 @@ /* { dg-do run } */ /* { dg-options "-O2 -fmath-errno -fdump-tree-cdce-details -lm" } */ -/* { dg-options "-O2 -fmath-errno -fdump-tree-cdce-details" { target *-*-netware* } } */ -/* { dg-final { scan-tree-dump "cdce1.c:17: note: function call is shrink-wrapped into error conditions\." "cdce" } } */ +/* { dg-final { scan-tree-dump "cdce1.c:16: note: function call is shrink-wrapped into error conditions\." "cdce" } } */ /* { dg-final { cleanup-tree-dump "cdce" } } */ /* { dg-require-effective-target large_double } */ diff --git a/gcc/testsuite/gcc.dg/cdce2.c b/gcc/testsuite/gcc.dg/cdce2.c index eebebaa2390..a461ce7ac30 100644 --- a/gcc/testsuite/gcc.dg/cdce2.c +++ b/gcc/testsuite/gcc.dg/cdce2.c @@ -1,8 +1,7 @@ /* { dg-do run } */ /* { dg-skip-if "doubles are floats" { "avr-*-*" } { "*" } { "" } } */ /* { dg-options "-O2 -fmath-errno -fdump-tree-cdce-details -lm" } */ -/* { dg-options "-O2 -fmath-errno -fdump-tree-cdce-details" { target *-*-netware* } } */ -/* { dg-final { scan-tree-dump "cdce2.c:17: note: function call is shrink-wrapped into error conditions\." "cdce" } }*/ +/* { dg-final { scan-tree-dump "cdce2.c:16: note: function call is shrink-wrapped into error conditions\." "cdce" } }*/ /* { dg-final { cleanup-tree-dump "cdce" } } */ #include <stdlib.h> diff --git a/gcc/testsuite/gcc.dg/cpp/assert4.c b/gcc/testsuite/gcc.dg/cpp/assert4.c index ff53946c6ce..a05ef130206 100644 --- a/gcc/testsuite/gcc.dg/cpp/assert4.c +++ b/gcc/testsuite/gcc.dg/cpp/assert4.c @@ -128,14 +128,6 @@ # error #endif -#if defined __netware__ -# if !#system(netware) -# error -# endif -#elif #system(netware) -# error -#endif - /* Check for #cpu and #machine assertions. */ diff --git a/gcc/testsuite/gcc.dg/debug/pr35154.c b/gcc/testsuite/gcc.dg/debug/pr35154.c index 8706c5c295a..fa658be2cbe 100644 --- a/gcc/testsuite/gcc.dg/debug/pr35154.c +++ b/gcc/testsuite/gcc.dg/debug/pr35154.c @@ -23,7 +23,7 @@ main() optb.f2 = 'D'; i_outer = 'e'; /* { dg-do compile } */ -/* { dg-skip-if "No stabs" { mmix-*-* *-*-netware* alpha*-*-* hppa*64*-*-* ia64-*-* *-*-vxworks* } { "*" } { "" } } */ +/* { dg-skip-if "No stabs" { mmix-*-* alpha*-*-* hppa*64*-*-* ia64-*-* *-*-vxworks* } { "*" } { "" } } */ /* { dg-skip-if "stabs only" { *-*-* } { "*" } { "-gstabs" } } */ return 0; } diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-1.c b/gcc/testsuite/gcc.dg/ipa/ipa-1.c index e3212853cf5..3517b035f1c 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-1.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-1.c @@ -24,9 +24,8 @@ int main () } -/* { dg-final { scan-ipa-dump-times "versioned function" 2 "cp" } } */ +/* { dg-final { scan-ipa-dump "Creating a specialized node of f" "cp" } } */ /* { dg-final { scan-ipa-dump "replacing param a with const 7" "cp" } } */ -/* { dg-final { scan-ipa-dump "replacing param b with const 7" "cp" } } */ /* { dg-final { cleanup-ipa-dump "cp" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-2.c b/gcc/testsuite/gcc.dg/ipa/ipa-2.c index 1d57fb00828..122a4a0181a 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-2.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-2.c @@ -22,7 +22,6 @@ int main () } -/* { dg-final { scan-ipa-dump-times "versioned function" 2 "cp" } } */ +/* { dg-final { scan-ipa-dump "Creating a specialized node of f" "cp" } } */ /* { dg-final { scan-ipa-dump "replacing param a with const 7" "cp" } } */ -/* { dg-final { scan-ipa-dump "replacing param c with const 3" "cp" } } */ /* { dg-final { cleanup-ipa-dump "cp" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-3.c b/gcc/testsuite/gcc.dg/ipa/ipa-3.c index a3334c34543..e15f084b400 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-3.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-3.c @@ -7,12 +7,12 @@ #include <stdio.h> void t(void); -int g (double b, double c) +static int g (double b, double c) { t(); return (int)(b+c); } -int f (double a) +static int f (double a) { if (a > 0) g (a, 3.1); @@ -28,8 +28,9 @@ int main () } -/* { dg-final { scan-ipa-dump-times "versioned function" 2 "cp" } } */ +/* { dg-final { scan-ipa-dump "Creating a specialized node of f" "cp" } } */ /* { dg-final { scan-ipa-dump "replacing param a with const 7" "cp" } } */ +/* { dg-final { scan-ipa-dump "Creating a specialized node of g" "cp" } } */ /* { dg-final { scan-ipa-dump "replacing param b with const 7" "cp" } } */ /* { dg-final { scan-ipa-dump "replacing param c with const 3" "cp" } } */ /* { dg-final { cleanup-ipa-dump "cp" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-4.c b/gcc/testsuite/gcc.dg/ipa/ipa-4.c index 3cb0cd4d27e..88716dd8f4c 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-4.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-4.c @@ -25,6 +25,6 @@ int main () } -/* { dg-final { scan-ipa-dump-times "versioned function" 1 "cp" } } */ +/* { dg-final { scan-ipa-dump "Creating a specialized node of f" "cp" } } */ /* { dg-final { scan-ipa-dump-times "replacing param a with const 7" 1 "cp" } } */ /* { dg-final { cleanup-ipa-dump "cp" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-5.c b/gcc/testsuite/gcc.dg/ipa/ipa-5.c index 50af18e2b01..22d1be89c0e 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-5.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-5.c @@ -26,8 +26,7 @@ int main () return 0; } - -/* { dg-final { scan-ipa-dump-times "versioned function" 2 "cp" } } */ +/* { dg-final { scan-ipa-dump-times "Creating a specialized node" 2 "cp" } } */ /* { dg-final { scan-ipa-dump "replacing param c with const 3" "cp" } } */ /* { dg-final { scan-ipa-dump "replacing param a with const 7" "cp" } } */ /* { dg-final { cleanup-ipa-dump "cp" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-7.c b/gcc/testsuite/gcc.dg/ipa/ipa-7.c index 6dcc914c103..c8b510046a1 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-7.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-7.c @@ -26,8 +26,8 @@ int main () } -/* { dg-final { scan-ipa-dump-times "versioned function" 1 "cp" } } */ -/* { dg-final { scan-ipa-dump-times "replacing param a with const 7" 1 "cp" } } */ +/* { dg-final { scan-ipa-dump "Creating a specialized node of f" "cp" } } */ +/* { dg-final { scan-ipa-dump-times "replacing param . with const 7" 1 "cp" } } */ /* { dg-final { cleanup-ipa-dump "cp" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-8.c b/gcc/testsuite/gcc.dg/ipa/ipa-8.c index edea7f900b4..dcbed13a0ed 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-8.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-8.c @@ -22,8 +22,9 @@ int main () } -/* { dg-final { scan-ipa-dump-times "versioned function" 2 "cp" } } */ +/* { dg-final { scan-ipa-dump "Creating a specialized node of f" "cp" } } */ /* { dg-final { scan-ipa-dump "replacing param a with const 7" "cp" } } */ +/* { dg-final { scan-ipa-dump "Creating a specialized node of g" "cp" } } */ /* { dg-final { scan-ipa-dump "replacing param b with const 7" "cp" } } */ /* { dg-final { cleanup-ipa-dump "cp" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/ipacost-1.c b/gcc/testsuite/gcc.dg/ipa/ipacost-1.c index d91546899ea..4fce41e8235 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipacost-1.c +++ b/gcc/testsuite/gcc.dg/ipa/ipacost-1.c @@ -51,10 +51,10 @@ main() i_can_not_be_propagated_fully2 (array); } -/* { dg-final { scan-ipa-dump-times "versioned function i_can_be_propagated_fully2" 1 "cp" } } */ -/* { dg-final { scan-ipa-dump-times "versioned function i_can_be_propagated_fully " 1 "cp" } } */ -/* { dg-final { scan-ipa-dump-not "versioned function i_can_not_be_propagated_fully2" "cp" } } */ -/* { dg-final { scan-ipa-dump-not "versioned function i_can_not_be_propagated_fully " "cp" } } */ +/* { dg-final { scan-ipa-dump-times "Creating a specialized node of i_can_be_propagated_fully2" 1 "cp" } } */ +/* { dg-final { scan-ipa-dump-times "Creating a specialized node of i_can_be_propagated_fully/" 1 "cp" } } */ +/* { dg-final { scan-ipa-dump-not "Creating a specialized node of i_can_not_be_propagated_fully2" "cp" } } */ +/* { dg-final { scan-ipa-dump-not "Creating a specialized node of i_can_not_be_propagated_fully/" "cp" } } */ /* { dg-final { scan-tree-dump-not "i_can_be_propagated_fully " "optimized" } } */ /* { dg-final { scan-tree-dump-not "i_can_be_propagated_fully2 " "optimized" } } */ /* { dg-final { cleanup-ipa-dump "cp" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/ipacost-2.c b/gcc/testsuite/gcc.dg/ipa/ipacost-2.c index 6ebd6d37481..ceb524e00ae 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipacost-2.c +++ b/gcc/testsuite/gcc.dg/ipa/ipacost-2.c @@ -40,8 +40,23 @@ i_can_not_be_propagated_fully (int *a) int i_can_not_be_propagated_fully2 (int *a) { + int i; i_can_not_be_propagated_fully (a); + for (i=0;i<50;i++) + { + t(a[i] + 1); + t(a[i+1] + 1); + t(a[i+2] + 1); + t(a[i+3] + 1); + } i_can_not_be_propagated_fully (a); + for (i=0;i<50;i++) + { + t(a[i] + 2); + t(a[i+1] + 2); + t(a[i+2] + 2); + t(a[i+3] + 2); + } i_can_not_be_propagated_fully (a); } main() @@ -50,15 +65,15 @@ main() i_can_be_propagated_fully2 (array); i_can_be_propagated_fully2 (array); - for (i = 0; i < 100; i++) + for (i = 0; i < 7; i++) i_can_not_be_propagated_fully2 (array); i_can_not_be_propagated_fully2 (array); } -/* { dg-final { scan-ipa-dump-times "versioned function i_can_be_propagated_fully2" 1 "cp" } } */ -/* { dg-final { scan-ipa-dump-times "versioned function i_can_be_propagated_fully " 1 "cp" } } */ -/* { dg-final { scan-ipa-dump-times "versioned function i_can_not_be_propagated_fully2" 1 "cp" } } */ -/* { dg-final { scan-ipa-dump-times "versioned function i_can_not_be_propagated_fully " 1 "cp" } } */ +/* { dg-final { scan-ipa-dump-times "Creating a specialized node of i_can_be_propagated_fully2" 1 "cp" } } */ +/* { dg-final { scan-ipa-dump-times "Creating a specialized node of i_can_be_propagated_fully/" 1 "cp" } } */ +/* { dg-final { scan-ipa-dump-not "Creating a specialized node of i_can_not_be_propagated_fully2" "cp" } } */ +/* { dg-final { scan-ipa-dump-not "Creating a specialized node of i_can_not_be_propagated_fully/" "cp" } } */ /* { dg-final { scan-tree-dump-not "i_can_be_propagated_fully \\(" "optimized" } } */ /* { dg-final { scan-tree-dump-not "i_can_be_propagated_fully2 \\(" "optimized" } } */ /* { dg-final { cleanup-ipa-dump "cp" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/ipcp-1.c b/gcc/testsuite/gcc.dg/ipa/ipcp-1.c new file mode 100644 index 00000000000..0f50ff9276a --- /dev/null +++ b/gcc/testsuite/gcc.dg/ipa/ipcp-1.c @@ -0,0 +1,52 @@ +/* Test that IPA-CP is able to figure out that poth parameters a are constant 7 + even though f and h recursively call each other and specialize them + accordinly. */ + +/* { dg-do compile } */ +/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */ +/* { dg-add-options bind_pic_locally } */ + +extern void use_stuff (int); + +static +int g (int b, int c) +{ + int i; + + for (i = 0; i < b; i++) + use_stuff (c); +} + +static void f (int a, int x, int z); + +static void h (int z, int a) +{ + use_stuff (z); + f (a, 9, 10); + +} + +static void +f (int a, int x, int z) +{ + if (z > 1) + g (a, x); + else + h (5, a); +} + +int +main (int argc, char *argv[]) +{ + int i; + for (i = 0; i < 100; i++) + f (7, 8, argc); + return 0; +} + + +/* { dg-final { scan-ipa-dump "Creating a specialized node of f.*for all known contexts" "cp" } } */ +/* { dg-final { scan-ipa-dump "replacing param a with const 7" "cp" } } */ +/* { dg-final { cleanup-ipa-dump "cp" } } */ + + diff --git a/gcc/testsuite/gcc.dg/ipa/ipcp-2.c b/gcc/testsuite/gcc.dg/ipa/ipcp-2.c new file mode 100644 index 00000000000..c6dcdf0af52 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ipa/ipcp-2.c @@ -0,0 +1,99 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */ +/* { dg-add-options bind_pic_locally } */ + +extern int get_stuff (int); +extern void do_stuff (int); +extern void do_stuff2 (int); +extern void do_other_stuff (void); +extern int get_element (int, int, int); +extern int adjust (int, int, int, int); + +extern int count; + +int +foo (int s, int p) +{ + int c, r = 0; + + for (c = 0 ; c < count; c++) + { + r += get_stuff (s); + /* The following is just something big that can go away. */ + if (p != 0) + { + int a[64][64]; + int i, j, k; + + for (i = 0; i < 64; i++) + for (j = 0; j < 64; j++) + a[i][j] = get_element (p + c, i, j); + + for (k = 0; k < 4; k++) + { + r = r / 2; + + for (i = 1; i < 63; i++) + for (j = 62; j > 0; j--) + a[i][j] += adjust (a[i-1][j], a[i][j-1], + a[i+1][j], a[i][j+1]); + + for (i = 4; i < 64; i += 4) + for (j = 4; j < 64; j += 4) + r += a[i][j] / 4; + } + } + } + return r; +} + +int +bar (int p, int q) +{ + if (q > 0) + do_stuff (q); + else + do_stuff (-q); + + if (q % 2) + do_stuff2 (2 * q); + else + do_stuff2 (2 * (q + 1)); + + return foo (4, p); +} + +int +bah (int p, int q) +{ + int i, j; + + while (q < -20) + q += get_stuff (-q); + + for (i = 0; i < 36; i++) + for (j = 0; j < 36; j++) + do_stuff (get_stuff (q * i + 2)); + + bar (p, q); +} + +int +top1 (int q) +{ + do_other_stuff (); + return bah (0, q); +} + +int +top2 (int q) +{ + do_stuff (200); + do_other_stuff (); + return bah (16, q); +} + +/* { dg-final { scan-ipa-dump-times "Creating a specialized node of foo" 1 "cp" } } */ +/* { dg-final { scan-ipa-dump-times "replacing param p with const 0" 3 "cp" } } */ +/* { dg-final { scan-ipa-dump "replacing param s with const 4" "cp" } } */ +/* { dg-final { cleanup-ipa-dump "cp" } } */ diff --git a/gcc/testsuite/gcc.dg/pr32912-2.c b/gcc/testsuite/gcc.dg/pr32912-2.c index f3c754cc346..f29e63e7058 100644 --- a/gcc/testsuite/gcc.dg/pr32912-2.c +++ b/gcc/testsuite/gcc.dg/pr32912-2.c @@ -1,5 +1,6 @@ /* { dg-do run } */ /* { dg-options "-O2 -w" } */ +/* { dg-skip-if "TImode not supported" { "avr-*-*" } { "*" } { "" } } */ extern void abort (void); diff --git a/gcc/testsuite/gcc.dg/pr44674.c b/gcc/testsuite/gcc.dg/pr44674.c index c3f16ff20ee..c71b49ea5f6 100644 --- a/gcc/testsuite/gcc.dg/pr44674.c +++ b/gcc/testsuite/gcc.dg/pr44674.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O -fprofile-generate" } */ +/* { dg-require-profiling "-fprofile-generate" } */ void jumpfunc (void *p) diff --git a/gcc/testsuite/gcc.dg/torture/20110718-1.c b/gcc/testsuite/gcc.dg/torture/20110718-1.c new file mode 100644 index 00000000000..ccabbd91421 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/20110718-1.c @@ -0,0 +1,23 @@ +/* { dg-do run } */ + +extern void abort (void); +struct X { +#if (__SIZEOF_LONG__ != __SIZEOF_INT__) && (__SIZEOF_LONG__ == 8) + unsigned long i : 33; +#else + unsigned long i; +#endif +}; +unsigned long __attribute__((noinline)) +foo (struct X *p) +{ + return ~p->i; +} +int main() +{ + struct X x; + x.i = -1; + if (foo (&x) != 0) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/torture/20110719-1.c b/gcc/testsuite/gcc.dg/torture/20110719-1.c new file mode 100644 index 00000000000..7797e08ad2b --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/20110719-1.c @@ -0,0 +1,10 @@ +extern void abort (void); +int i; +int main() +{ + int b = i != 0; + int c = ~b; + if (c != -1) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/tree-ssa/bitwise-sink.c b/gcc/testsuite/gcc.dg/tree-ssa/bitwise-sink.c index f44529995b7..1de04bc8431 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/bitwise-sink.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/bitwise-sink.c @@ -7,5 +7,5 @@ foo (_Bool x) return (x ^ 1); } -/* { dg-final { scan-tree-dump-times "x\[^ \]* \\^ 1" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "~x" 1 "optimized" } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/bool-10.c b/gcc/testsuite/gcc.dg/tree-ssa/bool-10.c index d7bf20da81b..58d064539a7 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/bool-10.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/bool-10.c @@ -9,6 +9,6 @@ int f(_Bool x) /* There should be no != 1 which is produced by the front-end as bool_var != 1 is the same as !bool_var. */ /* { dg-final { scan-tree-dump-times "!= 1" 0 "optimized"} } */ -/* { dg-final { scan-tree-dump-times "!x" 1 "optimized"} } */ +/* { dg-final { scan-tree-dump-times "~x" 1 "optimized"} } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/bool-11.c b/gcc/testsuite/gcc.dg/tree-ssa/bool-11.c index 8d88b7e87d5..ee266c79cb9 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/bool-11.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/bool-11.c @@ -9,6 +9,6 @@ int f(_Bool x) /* There should be no == 0 which is produced by the front-end as bool_var == 0 is the same as !bool_var. */ /* { dg-final { scan-tree-dump-times "== 0" 0 "optimized"} } */ -/* { dg-final { scan-tree-dump-times "!x" 1 "optimized"} } */ +/* { dg-final { scan-tree-dump-times "~x" 1 "optimized"} } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ipa-cp-1.c b/gcc/testsuite/gcc.dg/tree-ssa/ipa-cp-1.c index 7918eb7562d..26b433823ac 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ipa-cp-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ipa-cp-1.c @@ -5,9 +5,13 @@ int very_long_function(int a) { - return very_long_function (a)/4; + if (a > 0) + return 2 * a + very_long_function (a)/4; + else + return 2 * -a + very_long_function (a)/4; } -main() + +blah () { very_long_function (1); } diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr18908.c b/gcc/testsuite/gcc.dg/tree-ssa/pr18908.c new file mode 100644 index 00000000000..cfc92fec9c4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr18908.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-O -fdump-tree-forwprop1" } */ + +_Bool f3(_Bool *p) { *p ^= 1; } + +/* We should be able to canonicalize the above to use bitwise not. */ +/* { dg-final { scan-tree-dump "~D" "forwprop1" } } */ +/* { dg-final { scan-tree-dump-not "\\\^ 1" "forwprop1" } } */ +/* { dg-final { cleanup-tree-dump "forwprop1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr30978.c b/gcc/testsuite/gcc.dg/tree-ssa/pr30978.c index 3329383cbe8..ee45e5b4fe8 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr30978.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr30978.c @@ -10,5 +10,8 @@ int foo(int a) return e; } -/* { dg-final { scan-tree-dump "e_. = a_..D. > 0;" "optimized" } } */ +/* { dg-final { scan-tree-dump-times " = " 2 "optimized" } } */ +/* One comparison and one extension to int. */ +/* { dg-final { scan-tree-dump " = a_..D. > 0;" "optimized" } } */ +/* { dg-final { scan-tree-dump "e_. = \\\(int\\\)" "optimized" } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-6.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-6.c index 65883cd14bd..18a9d9b895a 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-6.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-6.c @@ -2,5 +2,5 @@ /* { dg-options "-O -fdump-tree-fre1-details" } */ int i; int foo(void) { i = 2; int j = i * 2; int k = i + 2; return j == k; } -/* { dg-final { scan-tree-dump-times "Replaced " 5 "fre1" } } */ +/* { dg-final { scan-tree-dump-times "Replaced " 6 "fre1" } } */ /* { dg-final { cleanup-tree-dump "fre1" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/pr49038.c b/gcc/testsuite/gcc.dg/vect/pr49038.c index 91c214ffd4c..681e5d50a83 100644 --- a/gcc/testsuite/gcc.dg/vect/pr49038.c +++ b/gcc/testsuite/gcc.dg/vect/pr49038.c @@ -1,3 +1,5 @@ +/* { dg-do run { target i?86-*-linux* x86_64-*-linux* ia64-*-linux* alpha*-*-linux* powerpc*-*-linux* s390*-*-linux* sparc*-*-linux* *-*-darwin* } } */ + #include <sys/mman.h> #include <stdio.h> diff --git a/gcc/testsuite/gcc.dg/vect/pr49771.c b/gcc/testsuite/gcc.dg/vect/pr49771.c new file mode 100644 index 00000000000..777f615365c --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr49771.c @@ -0,0 +1,26 @@ +#include <stdlib.h> +#include <stdarg.h> + +static int a[1000]; + +int +foo (void) +{ + int j; + int i; + for (i = 0; i < 1000; i++) + for (j = 0; j < 1000; j++) + a[j] = a[i] + 1; + return a[0]; +} + +int +main (void) +{ + int res = foo (); + if (res != 1999) + abort (); + return 0; +} + +/* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.target/arm/combine-movs.c b/gcc/testsuite/gcc.target/arm/combine-movs.c new file mode 100644 index 00000000000..4209a331427 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/combine-movs.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-skip-if "" { arm_thumb1 } } */ +/* { dg-options "-O" } */ + +void foo (unsigned long r[], unsigned int d) +{ + int i, n = d / 32; + for (i = 0; i < n; ++i) + r[i] = 0; +} + +/* { dg-final { scan-assembler "movs\tr\[0-9\]" } } */ diff --git a/gcc/testsuite/gcc.target/arm/unsigned-extend-2.c b/gcc/testsuite/gcc.target/arm/unsigned-extend-2.c new file mode 100644 index 00000000000..b610b73617d --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/unsigned-extend-2.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_thumb2_ok } */ +/* { dg-options "-O" } */ + +unsigned short foo (unsigned short x) +{ + unsigned char i = 0; + for (i = 0; i < 8; i++) + { + x >>= 1; + x &= 0x7fff; + } + return x; +} + +/* { dg-final { scan-assembler "ands" } } */ +/* { dg-final { scan-assembler-not "uxtb" } } */ +/* { dg-final { scan-assembler-not "cmp" } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/ppc-fma-1.c b/gcc/testsuite/gcc.target/powerpc/ppc-fma-1.c index 674115a285a..a3d532485e1 100644 --- a/gcc/testsuite/gcc.target/powerpc/ppc-fma-1.c +++ b/gcc/testsuite/gcc.target/powerpc/ppc-fma-1.c @@ -3,16 +3,16 @@ /* { dg-require-effective-target powerpc_vsx_ok } */ /* { dg-options "-O3 -ftree-vectorize -mcpu=power7 -ffast-math" } */ /* { dg-final { scan-assembler-times "xvmadd" 4 } } */ -/* { dg-final { scan-assembler-times "xsmadd" 2 } } */ +/* { dg-final { scan-assembler-times "xsmadd\|fmadd\ " 2 } } */ /* { dg-final { scan-assembler-times "fmadds" 2 } } */ /* { dg-final { scan-assembler-times "xvmsub" 2 } } */ -/* { dg-final { scan-assembler-times "xsmsub" 1 } } */ +/* { dg-final { scan-assembler-times "xsmsub\|fmsub\ " 1 } } */ /* { dg-final { scan-assembler-times "fmsubs" 1 } } */ /* { dg-final { scan-assembler-times "xvnmadd" 2 } } */ -/* { dg-final { scan-assembler-times "xsnmadd" 1 } } */ +/* { dg-final { scan-assembler-times "xsnmadd\|fnmadd " 1 } } */ /* { dg-final { scan-assembler-times "fnmadds" 1 } } */ /* { dg-final { scan-assembler-times "xvnmsub" 2 } } */ -/* { dg-final { scan-assembler-times "xsnmsub" 1 } } */ +/* { dg-final { scan-assembler-times "xsnmsub\|fnmsub " 1 } } */ /* { dg-final { scan-assembler-times "fnmsubs" 1 } } */ /* All functions should generate an appropriate (a * b) + c instruction diff --git a/gcc/testsuite/gcc.target/powerpc/ppc-fma-2.c b/gcc/testsuite/gcc.target/powerpc/ppc-fma-2.c index 111b9cb098e..f732b9fa417 100644 --- a/gcc/testsuite/gcc.target/powerpc/ppc-fma-2.c +++ b/gcc/testsuite/gcc.target/powerpc/ppc-fma-2.c @@ -3,16 +3,16 @@ /* { dg-require-effective-target powerpc_vsx_ok } */ /* { dg-options "-O3 -ftree-vectorize -mcpu=power7 -ffast-math -ffp-contract=off" } */ /* { dg-final { scan-assembler-times "xvmadd" 2 } } */ -/* { dg-final { scan-assembler-times "xsmadd" 1 } } */ +/* { dg-final { scan-assembler-times "xsmadd\|fmadd\ " 1 } } */ /* { dg-final { scan-assembler-times "fmadds" 1 } } */ /* { dg-final { scan-assembler-times "xvmsub" 2 } } */ -/* { dg-final { scan-assembler-times "xsmsub" 1 } } */ +/* { dg-final { scan-assembler-times "xsmsub\|fmsub\ " 1 } } */ /* { dg-final { scan-assembler-times "fmsubs" 1 } } */ /* { dg-final { scan-assembler-times "xvnmadd" 2 } } */ -/* { dg-final { scan-assembler-times "xsnmadd" 1 } } */ +/* { dg-final { scan-assembler-times "xsnmadd\|fnmadd\ " 1 } } */ /* { dg-final { scan-assembler-times "fnmadds" 1 } } */ /* { dg-final { scan-assembler-times "xvnmsub" 2 } } */ -/* { dg-final { scan-assembler-times "xsnmsub" 1 } } */ +/* { dg-final { scan-assembler-times "xsnmsub\|fnmsub\ " 1 } } */ /* { dg-final { scan-assembler-times "fnmsubs" 1 } } */ /* Only the functions calling the bulitin should generate an appropriate (a * diff --git a/gcc/testsuite/gcc.target/powerpc/recip-3.c b/gcc/testsuite/gcc.target/powerpc/recip-3.c index c5ce539bb42..40658818047 100644 --- a/gcc/testsuite/gcc.target/powerpc/recip-3.c +++ b/gcc/testsuite/gcc.target/powerpc/recip-3.c @@ -1,9 +1,9 @@ /* { dg-do compile { target { { powerpc*-*-* } && { ! powerpc*-apple-darwin* } } } } */ /* { dg-options "-O2 -mrecip -ffast-math -mcpu=power7" } */ /* { dg-final { scan-assembler-times "xsrsqrtedp" 1 } } */ -/* { dg-final { scan-assembler-times "xsmsub.dp" 1 } } */ +/* { dg-final { scan-assembler-times "xsmsub.dp\|fmsub\ " 1 } } */ /* { dg-final { scan-assembler-times "xsmuldp" 4 } } */ -/* { dg-final { scan-assembler-times "xsnmsub.dp" 2 } } */ +/* { dg-final { scan-assembler-times "xsnmsub.dp\|fnmsub\ " 2 } } */ /* { dg-final { scan-assembler-times "frsqrtes" 1 } } */ /* { dg-final { scan-assembler-times "fmsubs" 1 } } */ /* { dg-final { scan-assembler-times "fmuls" 4 } } */ diff --git a/gcc/testsuite/gfortran.dg/allocate_error_3.f90 b/gcc/testsuite/gfortran.dg/allocate_error_3.f90 new file mode 100644 index 00000000000..7616caad380 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/allocate_error_3.f90 @@ -0,0 +1,9 @@ +! { dg-do compile } +! +! PR 49708: [4.5/4.6/4.7 Regression] ICE with allocate and no dimensions +! +! Contributed by <fnordxyz@yahoo.com> + + real, pointer :: x(:) + allocate(x) ! { dg-error "Array specification required" } +end diff --git a/gcc/testsuite/gfortran.dg/coarray_args_1.f90 b/gcc/testsuite/gfortran.dg/coarray_args_1.f90 new file mode 100644 index 00000000000..0a3cada90d2 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/coarray_args_1.f90 @@ -0,0 +1,20 @@ +! { dg-do compile } +! { dg-options "-fcoarray=single" } +! +! Argument checking +! + implicit none + type t + integer :: i + integer,allocatable :: j + end type t + + type(t), save :: x[*] + + call sub1(x%i) + call sub1(x[1]%i) ! { dg-error "must be a coarray" } +contains + subroutine sub1(y) + integer :: y[*] + end subroutine sub1 +end diff --git a/gcc/testsuite/gfortran.dg/coarray_args_2.f90 b/gcc/testsuite/gfortran.dg/coarray_args_2.f90 new file mode 100644 index 00000000000..66a5a921c66 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/coarray_args_2.f90 @@ -0,0 +1,50 @@ +! { dg-do compile } +! { dg-options "-fcoarray=single" } +! +! Check argument passing. +! Taken from Reinhold Bader's fortran_tests. +! + +module mod_rank_mismatch_02 + implicit none + integer, parameter :: ndim = 2 +contains + subroutine subr(n,w) + integer :: n + real :: w(n,*)[*] + + integer :: k, x + + if (this_image() == 0) then + x = 1.0 + do k = 1, num_images() + if (abs(w(2,1)[k] - x) > 1.0e-5) then + write(*, *) 'FAIL' + error stop + end if + x = x + 1.0 + end do + end if + + end subroutine +end module + +program rank_mismatch_02 + use mod_rank_mismatch_02 + implicit none + real :: a(ndim,2)[*] + + a = 0.0 + a(2,2) = 1.0 * this_image() + + sync all + + call subr(ndim, a(1:1,2)) ! OK + call subr(ndim, a(1,2)) ! { dg-error "must be simply contiguous" } + ! See also F08/0048 and PR 45859 about the validity + if (this_image() == 1) then + write(*, *) 'OK' + end if +end program + +! { dg-final { cleanup-modules "mod_rank_mismatch_02" } } diff --git a/gcc/testsuite/gfortran.dg/coarray_lib_token_1.f90 b/gcc/testsuite/gfortran.dg/coarray_lib_token_1.f90 new file mode 100644 index 00000000000..648a6a337a9 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/coarray_lib_token_1.f90 @@ -0,0 +1,88 @@ +! { dg-do compile } +! { dg-options "-fcoarray=lib -fdump-tree-original" } +! +! Check whether TOKEN and OFFSET are correctly propagated +! + +program main + implicit none + type t + integer(4) :: a, b + end type t + integer :: caf[*] + type(t) :: caf_dt[*] + + caf = 42 + caf_dt = t (1,2) + call sub (caf, caf_dt%b) + print *,caf, caf_dt%b + if (caf /= -99 .or. caf_dt%b /= -101) call abort () + call sub_opt () + call sub_opt (caf) + if (caf /= 124) call abort () +contains + + subroutine sub (x1, x2) + integer :: x1[*], x2[*] + + call sub2 (x1, x2) + end subroutine sub + + subroutine sub2 (y1, y2) + integer :: y1[*], y2[*] + + print *, y1, y2 + if (y1 /= 42 .or. y2 /= 2) call abort () + y1 = -99 + y2 = -101 + end subroutine sub2 + + subroutine sub_opt (z) + integer, optional :: z[*] + if (present (z)) then + if (z /= -99) call abort () + z = 124 + end if + end subroutine sub_opt + +end program main + +! SCAN TREE DUMP AND CLEANUP +! +! PROTOTYPE 1: +! +! sub (integer(kind=4) * restrict x1, integer(kind=4) * restrict x2, +! void * restrict caf_token.4, integer(kind=8) caf_offset.5, +! void * restrict caf_token.6, integer(kind=8) caf_offset.7) +! +! { dg-final { scan-tree-dump-times "sub \\(integer.kind=4. . restrict x1, integer.kind=4. . restrict x2, void . restrict caf_token.\[0-9\]+, integer.kind=.. caf_offset.\[0-9\]+, void . restrict caf_token.\[0-9\]+, integer.kind=.. caf_offset.\[0-9\]+\\)" 1 "original"} } +! +! PROTOTYPE 2: +! +! sub2 (integer(kind=4) * restrict y1, integer(kind=4) * restrict y2, +! void * restrict caf_token.0, integer(kind=8) caf_offset.1, +! void * restrict caf_token.2, integer(kind=8) caf_offset.3) +! +! { dg-final { scan-tree-dump-times "sub2 \\(integer.kind=4. . restrict y1, integer.kind=4. . restrict y2, void . restrict caf_token.\[0-9\]+, integer.kind=.. caf_offset.\[0-9\]+, void . restrict caf_token.\[0-9\]+, integer.kind=.. caf_offset.\[0-9\]+\\)" 1 "original"} } +! +! CALL 1 +! +! sub ((integer(kind=4) *) caf, &caf_dt->b, caf_token.9, 0, caf_token.10, 4); +! +! { dg-final { scan-tree-dump-times "sub \\(\[^,\]*caf, &caf_dt->b, caf_token.\[0-9\]+, 0, caf_token.\[0-9\]+, 4\\)" 1 "original"} } +! +! sub2 ((integer(kind=4) *) x1, (integer(kind=4) *) x2, +! caf_token.4, NON_LVALUE_EXPR <caf_offset.5>, +! caf_token.6, NON_LVALUE_EXPR <caf_offset.7>); +! +! { dg-final { scan-tree-dump-times "sub2 \\(\[^,\]*x1, \[^,\]*x2, caf_token.\[0-9]+, \[^,\]*caf_offset\[^,\]*, caf_token.\[0-9\]+, \[^,\]*caf_offset\[^,\]*\\)" 1 "original"} } +! +! CALL 3 +! +! { dg-final { scan-tree-dump-times "sub_opt \\(0B, 0B, 0\\)" 1 "original"} } +! +! CALL 4 +! +! { dg-final { scan-tree-dump-times "sub_opt \\(.integer.kind=4. .. caf, caf_token.\[0-9\]+, 0\\)" 1 "original"} } +! +! { dg-final { cleanup-tree-dump "original" } } diff --git a/gcc/testsuite/gfortran.dg/debug/pr35154-stabs.f b/gcc/testsuite/gfortran.dg/debug/pr35154-stabs.f index a5976331b9c..4b518fe9e4d 100644 --- a/gcc/testsuite/gfortran.dg/debug/pr35154-stabs.f +++ b/gcc/testsuite/gfortran.dg/debug/pr35154-stabs.f @@ -1,6 +1,6 @@ C Test program for common block debugging. G. Helffrich 11 July 2004. C { dg-do compile } -C { dg-skip-if "No stabs" { mmix-*-* *-*-netware* alpha*-*-* hppa*64*-*-* ia64-*-* *-*-vxworks* } { "*" } { "" } } +C { dg-skip-if "No stabs" { mmix-*-* alpha*-*-* hppa*64*-*-* ia64-*-* *-*-vxworks* } { "*" } { "" } } C { dg-skip-if "No stabs" {*-*-* } { "*" } { "-gstabs" } } common i,j common /label/l,m diff --git a/gcc/testsuite/gfortran.dg/pr49675.f90 b/gcc/testsuite/gfortran.dg/pr49675.f90 new file mode 100644 index 00000000000..06fd1b665bd --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr49675.f90 @@ -0,0 +1,6 @@ +! PR middle-end/49675 +! { dg-do compile } +! { dg-options "-finstrument-functions" } +end +! { dg-final { scan-assembler "__cyg_profile_func_enter" } } +! { dg-final { scan-assembler "__cyg_profile_func_exit" } } diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 213118503c5..bec4d6fd762 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -290,11 +290,6 @@ proc check_weak_override_available { } { # The argument is the kind of visibility, default/protected/hidden/internal. proc check_visibility_available { what_kind } { - # On NetWare, support makes no sense. - if { [istarget *-*-netware*] } { - return 0 - } - if [string match "" $what_kind] { set what_kind "hidden" } return [check_no_compiler_messages visibility_available_$what_kind object " @@ -571,7 +566,6 @@ proc check_profiling_available { test_what } { || [istarget tic6x-*-elf] || [istarget xstormy16-*] || [istarget xtensa*-*-elf] - || [istarget *-*-netware*] || [istarget *-*-rtems*] || [istarget *-*-vxworks*] } { set profiling_available_saved 0 @@ -1076,8 +1070,8 @@ proc check_sse_os_support_available { } { check_runtime_nocache sse_os_support_available { int main () { - __asm__ volatile ("movaps %xmm0,%xmm0"); - return 0; + asm volatile ("movaps %xmm0,%xmm0"); + return 0; } } "-msse" } else { @@ -1086,6 +1080,29 @@ proc check_sse_os_support_available { } { }] } +# Return 1 if the target OS supports running AVX executables, 0 +# otherwise. Cache the result. + +proc check_avx_os_support_available { } { + return [check_cached_effective_target avx_os_support_available { + # If this is not the right target then we can skip the test. + if { !([istarget x86_64-*-*] || [istarget i?86-*-*]) } { + expr 0 + } else { + # Check that OS has AVX and SSE saving enabled. + check_runtime_nocache avx_os_support_available { + int main () + { + unsigned int eax, edx; + + asm ("xgetbv" : "=a" (eax), "=d" (edx) : "c" (0)); + return (eax & 6) != 6; + } + } "" + } + }] +} + # Return 1 if the target supports executing SSE instructions, 0 # otherwise. Cache the result. @@ -1182,7 +1199,8 @@ proc check_effective_target_sse2_runtime { } { proc check_effective_target_avx_runtime { } { if { [check_effective_target_avx] - && [check_avx_hw_available] } { + && [check_avx_hw_available] + && [check_avx_os_support_available] } { return 1 } return 0 |