diff options
Diffstat (limited to 'gcc/testsuite')
184 files changed, 3022 insertions, 859 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8fcfca90cbf..d2877e72304 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,8 +1,465 @@ +2012-04-22 Tobias Burnus <burnus@net-b.de> + + PR fortran/53051 + * gfortran.dg/read_float_4.f90: New. + +2012-04-21 Manuel López-Ibáñez <manu@gcc.gnu.org> + + PR 35441 + * c-c++-common/pr35441.C: New. + +2012-04-20 Ian Lance Taylor <iant@google.com> + + * go.test/go-test.exp (go-set-goarch): Recognize powerpc*-*-*. + (go-gc-tests): Skip nilptr.go on powerpc*-*-*. + +2012-04-20 Uros Bizjak <ubizjak@gmail.com> + + * gcc.target/x86_64/abi/avx/test_passing_unions.c: Avoid undefined + array access. + * gcc.target/x86_64/abi/avx/test_passing_structs.c: Likewise. + +2012-04-20 Bill Schmidt <wschmidt@linux.vnet.ibm.com> + + PR rtl-optimization/44214 + * gcc.dg/pr44214-1.c: New test. + * gcc.dg/pr44214-2.c: Likewise. + * gcc.dg/pr44214-3.c: Likewise. + +2012-04-20 Richard Guenther <rguenther@suse.de> + + * g++.dg/torture/20120420-1.C: New testcase. + +2012-04-19 Steven Bosscher <steven@gcc.gnu.org> + + * gcc.target/i386/pr45830.c: Update scan-tree-dump. + +2012-04-19 Christian Bruel <christian.bruel@st.com> + + * gcc.dg/pr52283.c: New test. + +2012-04-19 Manuel López-Ibáñez <manu@gcc.gnu.org> + + * gcc.dg/pr37985.c: New test. + +2012-04-19 Richard Guenther <rguenther@suse.de> + + PR rtl-optimization/44688 + * gcc.dg/var-expand1.c: Increase array size to make unrolling + possibly profitable. + +2012-04-18 Bill Schmidt <wschmidt@linux.vnet.ibm.com> + + PR tree-optimization/52976 + gfortran.dg/reassoc_11.f: New test. + +2012-04-18 Bill Schmidt <wschmidt@linux.vnet.ibm.com> + + PR tree-optimization/52976 + gfortran.dg/reassoc_7.f: New test. + gfortran.dg/reassoc_8.f: Likewise. + gfortran.dg/reassoc_9.f: Likewise. + gfortran.dg/reassoc_10.f: Likewise. + +2012-04-18 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/52422 + * g++.dg/cpp0x/sfinae33.C: New. + * g++.dg/cpp0x/sfinae34.C: Likewise. + +2012-04-18 Joey Ye <joey.ye@arm.com> + + * gcc.target/arm/thumb1-imm.c: Skip it in non-thumb1 target. + +2012-04-18 Richard Guenther <rguenther@suse.de> + + * gcc.target/x86_64/abi/test_passing_unions.c: Avoid undefined + array access. + * gcc.target/x86_64/abi/test_passing_structs.c: Likewise. + * gcc.target/i386/avx256-unaligned-load-4.c: Fix array sizes. + +2012-04-17 Tom de Vries <tom@codesourcery.com> + + * g++.dg/pr51264-4.C: New test. + +2012-04-17 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/52599 + * g++.dg/cpp0x/constexpr-ctor10.C: New. + +2012-04-17 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/53003 + * g++.dg/parse/crash59.C: New. + +2012-04-17 Michael Matz <matz@suse.de> + + PR tree-optimization/18437 + * gfortran.dg/vect/rnflow-trs2a2.f90: New test. + +2012-04-17 Richard Guenther <rguenther@suse.de> + + PR middle-end/53011 + * g++.dg/torture/pr53011.C: New testcase. + +2012-04-16 Jason Merrill <jason@redhat.com> + + PR c++/38543 + * g++.dg/cpp0x/variadic131.C: New. + + PR c++/52008 + * g++.dg/cpp0x/variadic130.C: New. + + PR c++/50830 + * g++.dg/cpp0x/variadic129.C: New. + + PR c++/50303 + * g++.dg/cpp0x/variadic128.C: New. + +2012-04-16 Tobias Burnus <burnus@net-b.de> + + PR fortran/52864 + * gfortran.dg/pointer_intent_6.f90: New. + +2012-04-16 Tobias Burnus <burnus@net-b.de> + + PR fortran/52916 + * gfortran.dg/public_private_module_3.f90: Use dg-additional-sources + to include public_private_module_4.f90. + * gfortran.dg/public_private_module_4.f90: Skip this test on all + targets. + +2012-04-16 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/49152 + * g++.dg/diagnostic/operator1.C: New. + * g++.dg/ext/label5.C: Adjust. + * g++.dg/ext/va-arg1.C: Likewise. + * g++.dg/other/error20.C: Likewise. + * g++.dg/other/error20.C: Likewise. + * g++.dg/other/error16.C: Likewise. + * g++.dg/other/error10.C: Likewise. + * g++.dg/parse/error30.C: Likewise. + * g++.dg/cpp0x/lambda/lambda-err1.C: Likewise. + +2012-04-16 Jason Merrill <jason@redhat.com> + + PR c++/51148 + * g++.dg/cpp0x/variadic127.C: New. + +2012-04-16 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + * lib/plugin-support.exp (plugin-test-execute): Properly determine + testcase name. + Use fail, pass instead of unresolved. + Don't log $optstr. + + PR testsuite/52948 + * g++.dg/plugin/dumb_plugin.c (pass_dumb_plugin_example): Remove + TODO_dump_func. + * g++.dg/plugin/selfassign.c (pass_warn_self_assign): Likewise. + * gcc.dg/plugin/one_time_plugin.c (one_pass): Likewise. + * gcc.dg/plugin/selfassign.c (pass_warn_self_assign): Likewise. + +2012-04-16 Janus Weil <janus@gcc.gnu.org> + + PR fortran/52968 + * gfortran.dg/typebound_call_23.f03: New test case. + +2012-04-15 Jason Merrill <jason@redhat.com> + + PR c++/47220 + * g++.dg/cpp0x/variadic126.C: New. + + PR c++/52380 + * g++.dg/cpp0x/variadic125.C: New. + + PR c++/52292 + * g++.dg/cpp0x/variadic124.C: New. + + PR c++/52706 + * g++.dg/cpp0x/nullptr27.C: New. + + PR c++/52818 + * g++.dg/warn/format8.C: New. + +2012-04-15 Janus Weil <janus@gcc.gnu.org> + + PR fortran/51082 + * gfortran.dg/proc_ptr_comp_34.f90: New test case. + +2012-04-14 Tobias Burnus <burnus@net-b.de> + + PR fortran/52916 + PR fortran/40973 + * gfortran.dg/public_private_module_3.f90: New. + * gfortran.dg/public_private_module_4.f90: New. + +2012-04-14 Tom de Vries <tom@codesourcery.com> + + * gcc.dg/superblock.c: New test. + +2012-04-14 Tom de Vries <tom@codesourcery.com> + + * gcc.dg/pr51879-12.c: New test. + +2012-04-13 Jason Merrill <jason@redhat.com> + + PR c++/52824 + * g++.dg/cpp0x/variadic123.C: New. + * g++.dg/cpp0x/alias-decl-15.C: Remove dg-errors. + + PR c++/52905 + * g++.dg/cpp0x/initlist-ctor1.C: New. + + PR c++/52915 + * g++.dg/other/anon-union2.C: New. + +2012-04-13 Martin Jambor <mjambor@suse.cz> + + PR middle-end/52939 + * g++.dg/ipa/pr52939.C: New test. + +2012-04-13 Tom de Vries <tom@codesourcery.com> + + * gcc.dg/pr52734.c: New test. + +2012-04-13 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/52969 + * gcc.dg/torture/pr52969.c: New testcase. + +2012-04-13 Richard Guenther <rguenther@suse.de> + + PR c/52549 + * gcc.dg/pr52549.c: New testcase. + +2012-04-13 Richard Guenther <rguenther@suse.de> + + PR c/52862 + * gcc.dg/pr52862.c: New testcase. + +2012-04-13 Joey Ye <joey.ye@arm.com> + + * gcc.target/arm/thumb1-imm.c: New testcase. + +2012-04-12 Uros Bizjak <ubizjak@gmail.com> + + PR target/52932 + * gcc.target/i386/avx2-vpermps-1.c (avx2_test): Use __m256i type for + second function argument. + * gcc.target/i386/avx2-vpermps-2.c (init_permps): Update declaration. + (calc_permps): Update declaration. Calculate result correctly. + (avx2_test): Change src2 type to union256i_d. + * gcc.target/i386/avx2-vpermd-2.c (calc_permd): Calculate result + correctly. + +2012-04-12 Michael Meissner <meissner@linux.vnet.ibm.com> + + PR target/52775 + * gcc.target/powerpc/pr52775.c: New file. + +2012-04-12 Bill Schmidt <wschmidt@linux.vnet.ibm.com> + + PR tree-optimization/18589 + * gcc.dg/tree-ssa/pr18589-1.c: New test. + * gcc.dg/tree-ssa/pr18589-2.c: Likewise. + * gcc.dg/tree-ssa/pr18589-3.c: Likewise. + * gcc.dg/tree-ssa/pr18589-4.c: Likewise. + * gcc.dg/tree-ssa/pr18589-5.c: Likewise. + * gcc.dg/tree-ssa/pr18589-6.c: Likewise. + * gcc.dg/tree-ssa/pr18589-7.c: Likewise. + * gcc.dg/tree-ssa/pr18589-8.c: Likewise. + * gcc.dg/tree-ssa/pr18589-9.c: Likewise. + * gcc.dg/tree-ssa/pr18589-10.c: Likewise. + +2012-04-12 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/52943 + * gcc.dg/torture/pr52943.c: New testcase. + +2012-04-12 Oleg Endo <olegendo@gcc.gnu.org> + + PR target/50751 + * gcc/target/sh/pr50751-4.c: New. + * gcc/target/sh/pr50751-5.c: New. + * gcc/target/sh/pr50751-6.c: New. + * gcc/target/sh/pr50751-7.c: New. + +2012-04-11 Fabien Chêne <fabien@gcc.gnu.org> + + PR c++/52465 + * g++.dg/lookup/using52.C: New. + +2012-04-11 Manuel López-Ibáñez <manu@gcc.gnu.org> + + * lib/prune.exp (TEST_ALWAYS_FLAGS): If undefined, set to empty. + +2012-04-11 H.J. Lu <hongjiu.lu@intel.com> + + PR rtl-optimization/52876 + * gcc.target/i386/pr52876.c: New. + +2012-04-11 Bernd Schmidt <bernds@codesourcery.com> + + * gcc.dg/c99-const-expr-9.c (old_offsetof): Insert a cast to + __UINTPTR_TYPE__. + * gcc.c-torture/execute/pr15296.c (intptr_t): Likewise, with + __INTPTR_TYPE__. + * gcc.dg/pr14092-1.c (intptr_t): Likewise. + * gcc.dg/tree-ssa/foldcast-1.c (ssize_t): Likewise. + * gcc.dg/c90-const-expr-6.c (intptr_t): New typedef to replace ... + (ptrdiff_t): ... this. All uses changed. + * gcc.dg/c99-const-expr-6.c (intptr_t, ptrdiff_t): Likewise. + * gcc.dg/torture/pta-escape-1.c (foo): Change arg type to + __INTPTR_TYPE__. + (main): Cast argument to __INTPTR_TYPE__. + * gcc.dg/20041106-1.c (main): Cast to __UINTPTR_TYPE__ rather than + size_t. + * gcc.dg/mallign.c (main): Likewise. + * gcc.dg/pr38700.c (foo): Likewise. + * gcc.dg/long-long-cst1.c (t): Likewise. + * gcc.dg/c99-const-expr-10.c (p, q, f, h, h2): Likewise. + * gcc.dg/array-10.c (c0, c1, c2, c3, c4, c5): Likewise. + * gcc.dg/pointer-arith-10.c (foo): Likewise. + * gcc.dg/pr25682.c (d, foo): Likewise. + * gcc.dg/format/cast-1.c (f): Likewise. + * gcc.dg/c90-const-expr-10.c + * gcc.dg/pr41551.c (uintptr_t): New typedef, replacing... + (size_t): ...this. All uses changed. + * gcc.c-torture/execute/pr22098-1.c (uintptr_t): Likewise. + * gcc.c-torture/execute/pr22098-2.c (uintptr_t): Likewise. + * gcc.c-torture/execute/pr22098-3.c (uintptr_t): Likewise. + * gcc.dg/pr34856.c (uintptr_t): Likewise. + * gcc.dg/sequence-pt-1.c: Likewise. + * gcc.dg/c90-const-expr-9.c (uintptr_t): Likewise. + * gcc.dg/max-1.c (intptr_t): Likewise, replacing ssize_t. + * gcc.dg/pr39074.c (intptr_t): Define using __INTPTR_TYPE__. + * gcc.dg/pr30744-1.c (my_intptr_t): New typedef. Replace all uses + of ptrdiff_t with it. + * gcc.dg/inline-23.c (my_intptr_t): Likewise. + * gcc.dg/pr37561.c (p): Use __INTPTR_TYPE__. + * gcc.dg/vla-11.c (foo11b): Use __UINTPTR_TYPE__. + +2012-04-11 Jason Merrill <jason@redhat.com> + + PR debug/45088 + * g++.dg/debug/dwarf2/self-ref-1.C: Define virtual destructor. + * g++.dg/debug/dwarf2/self-ref-1.C: Likewise. + + PR c++/52906 + * g++.dg/ext/attrib45.C: New. + + * g++.dg/eh/dtor3.C: New. + +2012-04-11 Richard Guenther <rguenther@suse.de> + + PR middle-end/52621 + * gfortran.dg/pr52621.f90: New testcase. + +2012-04-11 Richard Guenther <rguenther@suse.de> + + PR middle-end/52918 + * g++.dg/torture/pr52918-1.C: New testcase. + * g++.dg/torture/pr52918-2.C: Likewise. + +2012-04-11 Tobias Burnus <burnus@net-b.de> + + PR fortran/52729 + * gfortran.dg/block_11.f90: New. + +2012-04-11 Nick Clifton <nickc@redhat.com> + + * gcc.dg/stack-usage-1.c (SIZE): Define for the RL78. + +2012-04-11 Peter Bergner <bergner@vnet.ibm.com> + + PR target/16458 + * gcc.target/powerpc/pr16458-1.c: New test. + * gcc.target/powerpc/pr16458-2.c: Likewise. + * gcc.target/powerpc/pr16458-3.c: Likewise. + * gcc.target/powerpc/pr16458-4.c: Likewise. + +2012-04-11 Eric Botcazou <ebotcazou@adacore.com> + + * gcc.dg/builtin-bswap-1.c: Test __builtin_bswap16 & __builtin_bswap64. + * gcc.dg/builtin-bswap-4.c: Test __builtin_bswap16. + * gcc.dg/builtin-bswap-5.c: Likewise. + * gcc.target/i386/builtin-bswap-4.c: New test. + +2012-04-11 Manuel López-Ibáñez <manu@gcc.gnu.org> + + PR 24985 + * lib/prune.exp: Add -fno-diagnostics-show-caret. + +2012-04-11 Richard Guenther <rguenther@suse.de> + + PR rtl-optimization/52881 + * gcc.dg/torture/pr52881.c: New testcase. + * gcc.dg/torture/pr52913.c: Likewise. + +2012-04-11 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/52912 + * gcc.dg/torture/pr52912.c: New testcase. + +2010-04-10 Michael Matz <matz@suse.de> + + * gcc.dg/vect/vect-outer-1-big-array.c: Adjust. + * gcc.dg/vect/vect-outer-1.c: Adjust. + * gcc.dg/vect/vect-outer-1a-big-array.c: Adjust. + * gcc.dg/vect/vect-outer-1a.c: Adjust. + * gcc.dg/vect/vect-outer-1b-big-array.c: Adjust. + * gcc.dg/vect/vect-outer-1b.c: Adjust. + * gcc.dg/vect/vect-outer-2b.c: Adjust. + * gcc.dg/vect/vect-outer-3b.c: Adjust. + +2012-04-10 Ulrich Weigand <ulrich.weigand@linaro.org> + + PR tree-optimization/52870 + * gcc.dg/vect/pr52870.c: New test. + 2012-04-09 Mike Stump <mikestump@comcast.net> * g++.dg/cpp0x/udlit-raw-op.C: Don't use CRLF endings. * gcc.dg/tree-ssa/vrp59.c: Likewise. * gcc.dg/tree-ssa/vrp60.c: Likewise. + * gnat.dg/aggr11.adb: Likewise. + * gnat.dg/aggr11_pkg.ads: Likewise. + * gnat.dg/aggr15.adb: Likewise. + * gnat.dg/aggr15.ads: Likewise. + * gnat.dg/aggr17.adb: Likewise. + * gnat.dg/aggr18.adb: Likewise. + * gnat.dg/array14.adb: Likewise. + * gnat.dg/array14.ads: Likewise. + * gnat.dg/array14_pkg.ads: Likewise. + * gnat.dg/array19.adb: Likewise. + * gnat.dg/array19.ads: Likewise. + * gnat.dg/discr27.adb: Likewise. + * gnat.dg/discr27.ads: Likewise. + * gnat.dg/discr35.adb: Likewise. + * gnat.dg/discr35.ads: Likewise. + * gnat.dg/discr6.adb: Likewise. + * gnat.dg/discr6_pkg.ads: Likewise. + * gnat.dg/import1.adb: Likewise. + * gnat.dg/import1.ads: Likewise. + * gnat.dg/loop_address2.adb: Likewise. + * gnat.dg/opt7.adb: Likewise. + * gnat.dg/opt7.ads: Likewise. + * gnat.dg/pointer_variable_bounds.adb: Likewise. + * gnat.dg/pointer_variable_bounds.ads: Likewise. + * gnat.dg/rep_clause2.adb: Likewise. + * gnat.dg/rep_clause2.ads: Likewise. + * gnat.dg/slice2.adb: Likewise. + * gnat.dg/slice2.ads: Likewise. + * gnat.dg/slice6.adb: Likewise. + * gnat.dg/slice6_pkg.ads: Likewise. + * gnat.dg/specs/unchecked_union2.ads: Likewise. + * gnat.dg/taft_type2.adb: Likewise. + * gnat.dg/taft_type2.ads: Likewise. + * gnat.dg/taft_type2_pkg.ads: Likewise. + * gnat.dg/volatile10.adb: Likewise. + * gnat.dg/volatile10_pkg.ads: Likewise. * gcc.dg/dll-8.c: Remove execute permissions. * g++.dg/ext/dllexport5.C: Likewise. @@ -11,7 +468,7 @@ PR lto/52722 PR lto/51765 - PR lto/52634 + PR lto/52634 * gcc.dg/lto/pr52634_1.c: New testcase. * gcc.dg/lto/pr52634_0.c: New testcase. @@ -370,7 +827,7 @@ int32plus. * gcc.dg/torture/pr48124-4.c: Ditto: * gcc.dg/torture/pr52530.c: Use long instead of int if int=16. - + 2012-03-20 Jason Merrill <jason@redhat.com> PR c++/52510 @@ -465,11 +922,11 @@ 2012-03-15 Janne Blomqvist <jb@gcc.gnu.org> - PR libfortran/52434 - PR libfortran/48878 - PR libfortran/38199 - * gfortran.dg/edit_real_1.f90: Don't assume roundTiesToAway. - * gfortran.dg/round_1.f03: Likewise. + PR libfortran/52434 + PR libfortran/48878 + PR libfortran/38199 + * gfortran.dg/edit_real_1.f90: Don't assume roundTiesToAway. + * gfortran.dg/round_1.f03: Likewise. 2012-03-15 Jakub Jelinek <jakub@redhat.com> Andrew Pinski <apinski@cavium.com> @@ -1632,7 +2089,7 @@ 2012-02-06 Andrey Belevantsev <abel@ispras.ru> - * gcc.dg/pr48374.c: Actually add the test I forgot + * gcc.dg/pr48374.c: Actually add the test I forgot in the 2012-01-25 commit. 2012-02-05 Thomas König <tkoenig@gcc.gnu.org> @@ -2040,7 +2497,7 @@ * gcc.dg/lto/trans-mem-3_1.c: Provide correct argument types for TM builtins. -2012-01-25 Georg-Johann Lay <avr@gjlay.de> +2012-01-25 Georg-Johann Lay <avr@gjlay.de> * gcc.target/avr/torture/int24-mul.c: Rename __pgm to __flash. diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-15.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-15.C index 2bc9b11843d..b23e4029f79 100644 --- a/gcc/testsuite/g++.dg/cpp0x/alias-decl-15.C +++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-15.C @@ -2,7 +2,7 @@ // { dg-options "-std=c++0x" } template<class U, class V> //#1 -struct foo {}; // { dg-error "provided for|foo" } +struct foo {}; template<class U, class V=char> struct P {}; @@ -10,8 +10,8 @@ struct P {}; template<template<class... U> class... TT> struct bar { template<class... Args> - using mem = P<TT<Args...>...>;//#2 { dg-error "wrong number of|arguments" } + using mem = P<TT<Args...>...>;//#2 }; -bar<foo>::mem<int, char> b;//#3 { dg-error "invalid type" } +bar<foo>::mem<int, char> b;//#3 diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor10.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor10.C new file mode 100644 index 00000000000..c1279e2b7fc --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor10.C @@ -0,0 +1,6 @@ +// PR c++/52599 +// { dg-options -std=c++11 } + +struct foo { + constexpr foo() try { } catch(...) { }; // { dg-error "constructor" } +}; diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist-ctor1.C b/gcc/testsuite/g++.dg/cpp0x/initlist-ctor1.C new file mode 100644 index 00000000000..82031cbcc84 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/initlist-ctor1.C @@ -0,0 +1,13 @@ +// PR c++/52905 +// { dg-options -std=c++11 } + +#include <initializer_list> + +enum E { e1, e2 }; +struct A +{ + A(std::initializer_list<E>); // { dg-message "A::A" } + A(int, E); // { dg-message "A::A" } +}; + +A a{e1,2}; // { dg-error "" } diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-err1.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-err1.C index ebf0cbd078d..932ff1bee92 100644 --- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-err1.C +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-err1.C @@ -4,5 +4,5 @@ void foo() { int x[1]; - [x]{} = 0; // { dg-error "lambda closure" } + [x]{} = 0; // { dg-error "lambda" } } diff --git a/gcc/testsuite/g++.dg/cpp0x/nullptr27.C b/gcc/testsuite/g++.dg/cpp0x/nullptr27.C new file mode 100644 index 00000000000..1b86868aa19 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/nullptr27.C @@ -0,0 +1,8 @@ +// PR c++/52706 +// { dg-options "-std=c++11 -fabi-version=0" } +// { dg-final { scan-assembler "_Z1fIDnLDn0EEiT_" } } + +template<class T, decltype(nullptr) = nullptr> +int f(T); + +int i2 = f(nullptr); // 17 diff --git a/gcc/testsuite/g++.dg/cpp0x/pr39639.C b/gcc/testsuite/g++.dg/cpp0x/pr39639.C index 4fd8b56fd30..0838a0ba25f 100644 --- a/gcc/testsuite/g++.dg/cpp0x/pr39639.C +++ b/gcc/testsuite/g++.dg/cpp0x/pr39639.C @@ -2,6 +2,7 @@ // Origin: PR c++/39639 // { dg-do compile } // { dg-options "-std=c++0x" } +// { dg-prune-output "template argument 1 is invalid" } template <class... Types> struct S diff --git a/gcc/testsuite/g++.dg/cpp0x/sfinae33.C b/gcc/testsuite/g++.dg/cpp0x/sfinae33.C new file mode 100644 index 00000000000..3a5e6f77dfb --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/sfinae33.C @@ -0,0 +1,27 @@ +// PR c++/52422 +// { dg-options -std=c++11 } + +template<class T> +struct add_rval_ref +{ + typedef T&& type; +}; + +template<> +struct add_rval_ref<void> +{ + typedef void type; +}; + +template<class T> +typename add_rval_ref<T>::type create(); + +template<class T, + class = decltype(create<T>()()) +> +auto f(int) -> char(&)[1]; + +template<class> +auto f(...) -> char(&)[2]; + +static_assert(sizeof(f<void>(0)) != 1, ""); diff --git a/gcc/testsuite/g++.dg/cpp0x/sfinae34.C b/gcc/testsuite/g++.dg/cpp0x/sfinae34.C new file mode 100644 index 00000000000..d5d1ca4646b --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/sfinae34.C @@ -0,0 +1,27 @@ +// PR c++/52422 +// { dg-options -std=c++11 } + +template<class T> +struct add_rval_ref +{ + typedef T&& type; +}; + +template<> +struct add_rval_ref<void> +{ + typedef void type; +}; + +template<class T> +typename add_rval_ref<T>::type create(); + +template<class T, class U, + class = decltype( (create<T>().*create<U>())() ) +> +auto f(int) -> char(&)[1]; + +template<class, class> +auto f(...) -> char(&)[2]; + +static_assert(sizeof(f<void, void>(0)) != 1, ""); diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic123.C b/gcc/testsuite/g++.dg/cpp0x/variadic123.C new file mode 100644 index 00000000000..f0ab9fc22a1 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/variadic123.C @@ -0,0 +1,14 @@ +// PR c++/52824 +// { dg-do compile { target c++11 } } + +template<typename G, typename H> +struct foo +{}; + +template<typename... G> +struct bar : foo<G...> +{}; + +int main() { + bar<int, float> f; +} diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic124.C b/gcc/testsuite/g++.dg/cpp0x/variadic124.C new file mode 100644 index 00000000000..8ddc810b313 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/variadic124.C @@ -0,0 +1,29 @@ +// PR c++/52292 +// { dg-options -std=c++11 } + +template <template <typename...> class T> +struct foo { + template <typename... U> + foo(T<U...> x) { } +}; + +template <typename T> +struct bar { + bar(T x) : value(x) { } + + T value; +}; + +struct generic : private foo<bar> { + template <typename T> + generic(bar<T> x) : foo(x) + { + } + +}; + +int main() +{ + bar<int> x(32); + generic y(x); // FAILS +} diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic125.C b/gcc/testsuite/g++.dg/cpp0x/variadic125.C new file mode 100644 index 00000000000..89fd6b00d14 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/variadic125.C @@ -0,0 +1,25 @@ +// PR c++/52380 +// { dg-do compile { target c++11 } } + +template<typename T> +struct S +{ + template<typename U> + struct Unary // Line 5 + {}; + + template<unsigned, typename... Args> + struct Dispatch // Line 9 + : public Unary<Args...> + {}; + + template<typename... Args> + struct Variadic + : public Dispatch<sizeof...(Args), Args...> + {}; +}; + +int main() +{ + S<void>::Variadic<void> z; +} diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic126.C b/gcc/testsuite/g++.dg/cpp0x/variadic126.C new file mode 100644 index 00000000000..513c7e54a07 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/variadic126.C @@ -0,0 +1,8 @@ +// PR c++/47220 +// { dg-do compile { target c++11 } } + +template < typename ... > struct A; + +struct B : A < // { dg-error "invalid" } +{ +}; diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic127.C b/gcc/testsuite/g++.dg/cpp0x/variadic127.C new file mode 100644 index 00000000000..2e0d593ac9b --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/variadic127.C @@ -0,0 +1,15 @@ +// PR c++/51148 +// { dg-do compile { target c++11 } } + +template<typename... Types> +struct S +{}; + +template<typename... Types> +struct T +{ + friend class S<Types>; // { dg-error "parameter packs not expanded" } +}; + +int main() +{} diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic128.C b/gcc/testsuite/g++.dg/cpp0x/variadic128.C new file mode 100644 index 00000000000..8c2d3b23359 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/variadic128.C @@ -0,0 +1,16 @@ +// PR c++/50303 +// { dg-do compile { target c++11 } } + +template<typename Interface> +struct A1 { +}; + +template<template<class I> class... Actions> +void g2() { + g2<Actions...>(); +} + +int main() +{ + g2<A1>(); +} diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic129.C b/gcc/testsuite/g++.dg/cpp0x/variadic129.C new file mode 100644 index 00000000000..7118301418a --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/variadic129.C @@ -0,0 +1,19 @@ +// PR c++/50830 +// { dg-do compile { target c++11 } } + +template<template<class> class...> +struct list_templates {}; + +template<class> +struct aa {}; + +template<class... T> +struct test {}; + +template<template<class> class... F, class T> +struct test<list_templates<F...>, T> +{ + struct inner {}; +}; + +test<list_templates<aa>, int> a4; // error diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic130.C b/gcc/testsuite/g++.dg/cpp0x/variadic130.C new file mode 100644 index 00000000000..f73c8b5126c --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/variadic130.C @@ -0,0 +1,8 @@ +// PR c++/52008 +// { dg-do compile { target c++11 } } + +template <int I, typename T, typename... Ts> +struct A; + +template<typename... Ts> +struct A<0, Ts...>; // { dg-error "not more specialized" } diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic131.C b/gcc/testsuite/g++.dg/cpp0x/variadic131.C new file mode 100644 index 00000000000..3006f87ed23 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/variadic131.C @@ -0,0 +1,11 @@ +// PR c++/38543 +// { dg-do compile { target c++11 } } + +template< typename ... T > void foo( T ... args ); +template<> void foo( ){} +template<> void foo(int,double){} +int main() +{ + foo( 0, 0.0 ); + return 55; +} diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/pr52260.C b/gcc/testsuite/g++.dg/debug/dwarf2/pr52260.C index 9ab2589ce11..024afc8bc54 100644 --- a/gcc/testsuite/g++.dg/debug/dwarf2/pr52260.C +++ b/gcc/testsuite/g++.dg/debug/dwarf2/pr52260.C @@ -22,7 +22,7 @@ namespace A { template <typename T> struct I : H <T> {}; - template <typename ...> struct J; + template <typename ...> struct J {}; template <typename> struct K; struct L { @@ -36,7 +36,7 @@ namespace A template <typename T, typename B2, typename ... B4> struct N <T (B4 ...), B2> : L::M <B2> {}; template <typename T, typename ... B4> - struct K <T (B4 ...)> :J <,>, L + struct K <T (B4 ...)> :J <>, L { typedef T O (B4 ...); struct P {}; diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/self-ref-1.C b/gcc/testsuite/g++.dg/debug/dwarf2/self-ref-1.C index 81bcb2775aa..06db9dcf636 100644 --- a/gcc/testsuite/g++.dg/debug/dwarf2/self-ref-1.C +++ b/gcc/testsuite/g++.dg/debug/dwarf2/self-ref-1.C @@ -5,7 +5,7 @@ struct A { - virtual ~A(); + virtual ~A(){} }; struct B : public A diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/self-ref-2.C b/gcc/testsuite/g++.dg/debug/dwarf2/self-ref-2.C index b1c5401da07..d5463c03e22 100644 --- a/gcc/testsuite/g++.dg/debug/dwarf2/self-ref-2.C +++ b/gcc/testsuite/g++.dg/debug/dwarf2/self-ref-2.C @@ -6,7 +6,7 @@ template<class T> struct A { - virtual ~A(); + virtual ~A(){} }; struct B : public A<int> diff --git a/gcc/testsuite/g++.dg/eh/dtor3.C b/gcc/testsuite/g++.dg/eh/dtor3.C new file mode 100644 index 00000000000..ed9e6d94449 --- /dev/null +++ b/gcc/testsuite/g++.dg/eh/dtor3.C @@ -0,0 +1,36 @@ +// Red Hat bug 750545 +// { dg-do run { target c++98 } } + +class excep {}; +class A +{ +public: + ~A() { throw excep(); } +}; + +class B +{ + A a; +}; + +class C +{ + B b; +}; + +void f() +{ + C* c = new C(); + + try + { + delete c; + } + catch(...) + {} +} + +int main() +{ + f(); +} diff --git a/gcc/testsuite/g++.dg/ext/attrib45.C b/gcc/testsuite/g++.dg/ext/attrib45.C new file mode 100644 index 00000000000..0be1322cab2 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/attrib45.C @@ -0,0 +1,3 @@ +// PR c++/52906 + +__attribute__ ((__deprecated__)); // { dg-error "does not declare anything" } diff --git a/gcc/testsuite/g++.dg/ext/label5.C b/gcc/testsuite/g++.dg/ext/label5.C index fc611cd4159..34ca90d87b3 100644 --- a/gcc/testsuite/g++.dg/ext/label5.C +++ b/gcc/testsuite/g++.dg/ext/label5.C @@ -2,5 +2,5 @@ // PR c++/24052 struct A { }; -int main() { b: A() && && b; } // { dg-error "A\\(\\) && && *b" } +int main() { b: A() && && b; } // { dg-error "operand types are 'A' and 'void\\*'" } // { dg-message "candidate|operator&&|no known conversion" "additional" { target *-*-* } 5 } diff --git a/gcc/testsuite/g++.dg/ext/va-arg1.C b/gcc/testsuite/g++.dg/ext/va-arg1.C index 079db2e5c6e..5606128e5f7 100644 --- a/gcc/testsuite/g++.dg/ext/va-arg1.C +++ b/gcc/testsuite/g++.dg/ext/va-arg1.C @@ -4,5 +4,5 @@ struct A {}; void foo() { - ++__builtin_va_arg(0, A); // { dg-error "'\\+\\+va_arg\\(0, A\\)'" } + ++__builtin_va_arg(0, A); // { dg-error "operand type is 'A'" } } diff --git a/gcc/testsuite/g++.dg/ipa/pr52939.C b/gcc/testsuite/g++.dg/ipa/pr52939.C new file mode 100644 index 00000000000..e120827bd1d --- /dev/null +++ b/gcc/testsuite/g++.dg/ipa/pr52939.C @@ -0,0 +1,58 @@ +/* Verify that we do not ICE on invalid devirtualizations (which might + be OK at run-time because never executed). */ +/* { dg-do run } */ +/* { dg-options "-O3 -fno-early-inlining -fno-inline" } */ + +extern "C" void abort (void); + +class A +{ +public: + int data; + virtual int foo (int i); +}; + +class B : public A +{ +public: + virtual int foo (int i); + virtual int bar (int i); +}; + +int A::foo (int i) +{ + return i + 1; +} + +int B::foo (int i) +{ + return i + 2; +} + +int B::bar (int i) +{ + return i + 3; +} + +static int middleman (class A *obj, int i) +{ + class B *b = (class B *) obj; + + if (i != 1) + return b->bar (i); + else + return i; +} + +int __attribute__ ((noinline,noclone)) get_input(void) +{ + return 1; +} + +int main (int argc, char *argv[]) +{ + class A o; + if (middleman (&o, get_input ()) != 1) + abort (); + return 0; +} diff --git a/gcc/testsuite/g++.dg/lookup/using52.C b/gcc/testsuite/g++.dg/lookup/using52.C new file mode 100644 index 00000000000..bf2620714e8 --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/using52.C @@ -0,0 +1,16 @@ +// { dg-do compile } +// PR c++/52645 + +class A +{ +protected: + struct B {}; +}; + +class C : A +{ +protected: + using A::B; + + struct D : public B {}; +}; diff --git a/gcc/testsuite/g++.dg/other/anon-union2.C b/gcc/testsuite/g++.dg/other/anon-union2.C new file mode 100644 index 00000000000..31bb74fa99c --- /dev/null +++ b/gcc/testsuite/g++.dg/other/anon-union2.C @@ -0,0 +1,10 @@ +// PR c++/52915 + +struct S { + int val; + S(int v) : val(v) {} +}; + +void f() { + union { S a; }; // { dg-error "constructor|no match" } +} diff --git a/gcc/testsuite/g++.dg/other/error10.C b/gcc/testsuite/g++.dg/other/error10.C index 5c17277abbf..546a4d65c4a 100644 --- a/gcc/testsuite/g++.dg/other/error10.C +++ b/gcc/testsuite/g++.dg/other/error10.C @@ -6,10 +6,9 @@ template<int> struct A {}; template<int N> void foo(const A<N> &a) -{ -A<N>(a); } // { dg-error "\\(\\* & a\\)" "" } +{ -A<N>(a); } // { dg-error "operand type is 'A<0>'" } void bar() { foo(A<0>()); // { dg-message "required from here" "" } } - diff --git a/gcc/testsuite/g++.dg/other/error16.C b/gcc/testsuite/g++.dg/other/error16.C index 1e34647145d..38c0fd63fd1 100644 --- a/gcc/testsuite/g++.dg/other/error16.C +++ b/gcc/testsuite/g++.dg/other/error16.C @@ -10,5 +10,5 @@ typedef Outer<X> XOuter; int main() { Outer<int> ab; - ab.foo() == 1; // { dg-error "ab.Outer" } + ab.foo() == 1; // { dg-error "operand types are 'Outer<int>::Inner' and 'int'" } } diff --git a/gcc/testsuite/g++.dg/other/error20.C b/gcc/testsuite/g++.dg/other/error20.C index f3b17aa196a..bb7d7b3b078 100644 --- a/gcc/testsuite/g++.dg/other/error20.C +++ b/gcc/testsuite/g++.dg/other/error20.C @@ -8,6 +8,6 @@ struct A // { dg-message "operator=|no known conversion" } void bar (A& a) { - a.foo () = 0; // { dg-error "A::foo\\(\\) = 0" } + a.foo () = 0; // { dg-error "operand types are 'A' and 'int'" } // { dg-message "candidate" "candidate note" { target *-*-* } 11 } } diff --git a/gcc/testsuite/g++.dg/parse/crash59.C b/gcc/testsuite/g++.dg/parse/crash59.C new file mode 100644 index 00000000000..e5e62986a3e --- /dev/null +++ b/gcc/testsuite/g++.dg/parse/crash59.C @@ -0,0 +1,3 @@ +// PR c++/53003 + +struct A{ void a{} return b // { dg-error "function definition|expected" } diff --git a/gcc/testsuite/g++.dg/parse/error30.C b/gcc/testsuite/g++.dg/parse/error30.C index 26c55c49c68..aabdcc701c5 100644 --- a/gcc/testsuite/g++.dg/parse/error30.C +++ b/gcc/testsuite/g++.dg/parse/error30.C @@ -8,5 +8,5 @@ struct A A(int); }; -A a = -A(); // { dg-error "10:no match for.*operator-.*in.*-A\\(\\)" } -A b = -A(5); // { dg-error "11:no match for.*operator-.*in.*-A\\(5\\)" } +A a = -A(); // { dg-error "operand type is 'A'" } +A b = -A(5); // { dg-error "operand type is 'A'" } diff --git a/gcc/testsuite/g++.dg/plugin/dumb_plugin.c b/gcc/testsuite/g++.dg/plugin/dumb_plugin.c index 5bbd5d790fe..8913e8694e3 100644 --- a/gcc/testsuite/g++.dg/plugin/dumb_plugin.c +++ b/gcc/testsuite/g++.dg/plugin/dumb_plugin.c @@ -72,7 +72,7 @@ static struct gimple_opt_pass pass_dumb_plugin_example = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func /* todo_flags_finish */ + 0 /* todo_flags_finish */ } }; diff --git a/gcc/testsuite/g++.dg/plugin/selfassign.c b/gcc/testsuite/g++.dg/plugin/selfassign.c index 84d2801d202..feb4130e532 100644 --- a/gcc/testsuite/g++.dg/plugin/selfassign.c +++ b/gcc/testsuite/g++.dg/plugin/selfassign.c @@ -276,7 +276,7 @@ static struct gimple_opt_pass pass_warn_self_assign = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func /* todo_flags_finish */ + 0 /* todo_flags_finish */ } }; diff --git a/gcc/testsuite/g++.dg/pr51264-4.C b/gcc/testsuite/g++.dg/pr51264-4.C new file mode 100644 index 00000000000..58a1b14c409 --- /dev/null +++ b/gcc/testsuite/g++.dg/pr51264-4.C @@ -0,0 +1,30 @@ +/* { dg-do compile } */ +/* { dg-options "-O0 -Werror -Wreturn-type" } */ + +/* Test-case from http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25973#c4. */ + +struct Block +{ + public: + Block (); + ~Block (); +}; + +bool func (bool bar) +{ + Block block; + bool foo = false; + + if (!foo || bar) + do + { + return true; + } + while (0); + else + do + { + return false; + } + while (0); +} diff --git a/gcc/testsuite/g++.dg/torture/20120420-1.C b/gcc/testsuite/g++.dg/torture/20120420-1.C new file mode 100644 index 00000000000..ada0ab67e93 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/20120420-1.C @@ -0,0 +1,29 @@ +// { dg-do compile } + +int g, *gp[100]; +struct V { + int* x; + int y; +}; + +void foo (V **p, V* end, int i) +{ + *p = 0; + V* pp = *p; + int s = 100; + for (; pp < end; ) + { + pp++; + (pp-1)->x = &g; + if (g) + { + if (g>10) + g++; + int *t = (int*) operator new (100); + (pp-1)->x = t; + } + else + s--; + gp[end-pp] = (pp-1)->x + s; + } +} diff --git a/gcc/testsuite/g++.dg/torture/pr52918-1.C b/gcc/testsuite/g++.dg/torture/pr52918-1.C new file mode 100644 index 00000000000..9e7b21ba6a3 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr52918-1.C @@ -0,0 +1,39 @@ +// { dg-do compile } + +typedef __SIZE_TYPE__ size_t; +class bad_alloc { }; +typedef struct { +} __gthread_mutex_t; +int __gthread_mutex_unlock (__gthread_mutex_t *__mutex); +class __concurrence_unlock_error { +}; +inline void __throw_concurrence_unlock_error() { + throw __concurrence_unlock_error(); +} +class __mutex { + __gthread_mutex_t _M_mutex; +public: + void unlock() { + if (__gthread_mutex_unlock(&_M_mutex) != 0) + __throw_concurrence_unlock_error(); + } +}; +class free_list { + typedef __mutex __mutex_type; + __mutex_type& _M_get_mutex(); + void _M_get(size_t __sz) throw(bad_alloc); +}; +void free_list::_M_get(size_t __sz) throw(bad_alloc) +{ + __mutex_type& __bfl_mutex = _M_get_mutex(); + __bfl_mutex.unlock(); + int __ctr = 2; + while (__ctr) { + size_t* __ret = 0; + --__ctr; + try { + __ret = (size_t*) (::operator new(__sz + sizeof(size_t))); + } + catch(const bad_alloc&) { } + } +} diff --git a/gcc/testsuite/g++.dg/torture/pr52918-2.C b/gcc/testsuite/g++.dg/torture/pr52918-2.C new file mode 100644 index 00000000000..ba31295e41e --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr52918-2.C @@ -0,0 +1,40 @@ +// { dg-do compile } + +typedef __SIZE_TYPE__ size_t; +void* __cxa_allocate_exception(size_t) throw(); +typedef struct { } __gthread_mutex_t; +extern int __gthr_win32_mutex_unlock (__gthread_mutex_t *); +int __gthread_mutex_lock (__gthread_mutex_t *__mutex); +int __gthread_mutex_unlock (__gthread_mutex_t *__mutex); +void __throw_concurrence_lock_error(); +void __throw_concurrence_unlock_error(); +class __mutex { + __gthread_mutex_t _M_mutex; +public: + void lock() { + if (__gthread_mutex_lock(&_M_mutex) != 0) + __throw_concurrence_lock_error(); + } + void unlock() { + if (__gthread_mutex_unlock(&_M_mutex) != 0) + __throw_concurrence_unlock_error(); + } +}; +class __scoped_lock { + typedef __mutex __mutex_type; + __mutex_type& _M_device; +public: + explicit __scoped_lock(__mutex_type& __name) : _M_device(__name) { + _M_device.lock(); + } + ~__scoped_lock() throw() { + _M_device.unlock(); + } +}; +__mutex emergency_mutex; +void * __cxa_allocate_exception(size_t thrown_size) throw() +{ + void *ret; + if (! ret) + __scoped_lock sentry(emergency_mutex); +} diff --git a/gcc/testsuite/g++.dg/torture/pr53011.C b/gcc/testsuite/g++.dg/torture/pr53011.C new file mode 100644 index 00000000000..2cd8a60332d --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr53011.C @@ -0,0 +1,66 @@ +// { dg-do compile } + +extern "C" class WvFastString; +typedef WvFastString& WvStringParm; +struct WvFastString { + ~WvFastString(); + operator char* () {} +}; +class WvString : WvFastString {}; +class WvAddr {}; +class WvIPAddr : WvAddr {}; +struct WvIPNet : WvIPAddr { + bool is_default() {} +}; +template<class T, bool> struct WvTraits_Helper { + static void release(T *obj) { + delete obj; + } +}; +template<class From> struct WvTraits { + static void release(From *obj) { + WvTraits_Helper<From, 0>::release(obj); + } +}; +struct WvLink { + void *data; + WvLink *next; + bool autofree; + WvLink(bool, int) : autofree() {} + bool get_autofree() {} + + void unlink() { + delete this; + } +}; +struct WvListBase { + WvLink head, *tail; + WvListBase() : head(0, 0) {} +}; +template<class T> struct WvList : WvListBase { + ~WvList() { + zap(); + } + + void zap(bool destroy = 1) { + while (head.next) unlink_after(&head, destroy); + } + + void unlink_after(WvLink *after, bool destroy) { + WvLink *next = 0; + T *obj = (destroy && next->get_autofree()) ? + static_cast<T*>(next->data) : 0; + + if (tail) tail = after; + next->unlink(); + WvTraits<T>::release(obj); + } +}; +typedef WvList<WvString>WvStringListBase; +class WvStringList : WvStringListBase {}; +class WvSubProc { + WvStringList last_args, env; +}; +void addroute(WvIPNet& dest, WvStringParm table) { + if (dest.is_default() || (table != "default")) WvSubProc checkProc; +} diff --git a/gcc/testsuite/g++.dg/warn/format8.C b/gcc/testsuite/g++.dg/warn/format8.C new file mode 100644 index 00000000000..ffceb797a7d --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/format8.C @@ -0,0 +1,7 @@ +// PR c++/52818 +// { dg-options "-pedantic-errors -Wformat" } + +extern "C" int printf (const char *, ...); +void f() { + printf("%lf", 0.0); // { dg-warning "%lf" "" { target c++98 } } +} diff --git a/gcc/testsuite/gcc.c-torture/execute/pr15296.c b/gcc/testsuite/gcc.c-torture/execute/pr15296.c index d2468e425af..a3b53cb976e 100644 --- a/gcc/testsuite/gcc.c-torture/execute/pr15296.c +++ b/gcc/testsuite/gcc.c-torture/execute/pr15296.c @@ -3,7 +3,7 @@ fall-through code, while that register held a pointer used in code at the branch target. */ -typedef int __attribute__ ((mode (__pointer__))) intptr_t; +typedef __INTPTR_TYPE__ intptr_t; typedef intptr_t W; union u0 { diff --git a/gcc/testsuite/gcc.c-torture/execute/pr22098-1.c b/gcc/testsuite/gcc.c-torture/execute/pr22098-1.c index 142530f62c1..7e876fa8cd1 100644 --- a/gcc/testsuite/gcc.c-torture/execute/pr22098-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/pr22098-1.c @@ -1,13 +1,13 @@ extern void abort (void); extern void exit (int); -typedef __SIZE_TYPE__ size_t; +typedef __UINTPTR_TYPE__ uintptr_t; int main (void) { int a = 0; int *p; - size_t b; - b = (size_t)(p = &(int []){0, 1, 2}[++a]); + uintptr_t b; + b = (uintptr_t)(p = &(int []){0, 1, 2}[++a]); if (a != 1 || *p != 1 || *(int *)b != 1) abort (); exit (0); diff --git a/gcc/testsuite/gcc.c-torture/execute/pr22098-2.c b/gcc/testsuite/gcc.c-torture/execute/pr22098-2.c index 249647dc570..035a755a522 100644 --- a/gcc/testsuite/gcc.c-torture/execute/pr22098-2.c +++ b/gcc/testsuite/gcc.c-torture/execute/pr22098-2.c @@ -1,13 +1,13 @@ extern void abort (void); extern void exit (int); -typedef __SIZE_TYPE__ size_t; +typedef __UINTPTR_TYPE__ uintptr_t; int main (void) { int a = 0; int *p; - size_t b; - b = (size_t)(p = &(int []){0, 1, 2}[1]); + uintptr_t b; + b = (uintptr_t)(p = &(int []){0, 1, 2}[1]); if (*p != 1 || *(int *)b != 1) abort (); exit (0); diff --git a/gcc/testsuite/gcc.c-torture/execute/pr22098-3.c b/gcc/testsuite/gcc.c-torture/execute/pr22098-3.c index 4c8a1c62ce0..4f37be86c8c 100644 --- a/gcc/testsuite/gcc.c-torture/execute/pr22098-3.c +++ b/gcc/testsuite/gcc.c-torture/execute/pr22098-3.c @@ -1,6 +1,6 @@ extern void abort (void); extern void exit (int); -typedef __SIZE_TYPE__ size_t; +typedef __UINTPTR_TYPE__ uintptr_t; int n = 0; int f (void) { return ++n; } int @@ -8,8 +8,8 @@ main (void) { int a = 0; int *p; - size_t b; - b = (size_t)(p = &(int []){0, f(), 2}[1]); + uintptr_t b; + b = (uintptr_t)(p = &(int []){0, f(), 2}[1]); if (*p != 1 || *(int *)b != 1 || n != 1) abort (); exit (0); diff --git a/gcc/testsuite/gcc.dg/20041106-1.c b/gcc/testsuite/gcc.dg/20041106-1.c index f83e835ed1d..f33ba01c8cd 100644 --- a/gcc/testsuite/gcc.dg/20041106-1.c +++ b/gcc/testsuite/gcc.dg/20041106-1.c @@ -21,7 +21,7 @@ int main () struct S *s; ptr = malloc (3*ps); - page = (char *)(((size_t)ptr + (ps - 1)) & -ps); + page = (char *)(((__UINTPTR_TYPE__)ptr + (ps - 1)) & -ps); munmap (page + ps, ps); s = (struct S *)(page + ps - sizeof(struct S)); diff --git a/gcc/testsuite/gcc.dg/array-10.c b/gcc/testsuite/gcc.dg/array-10.c index 3b4d512ba5a..44457d12c06 100644 --- a/gcc/testsuite/gcc.dg/array-10.c +++ b/gcc/testsuite/gcc.dg/array-10.c @@ -13,12 +13,12 @@ struct b3 { int x[a]; }; /* { dg-error "17:at file scope" } */ struct b4 { int (*x)[a]; }; /* { dg-error "19:at file scope" } */ typeof (int [a]) b5; /* { dg-error "at file scope|outside of any function" } */ -int c0[(__SIZE_TYPE__)&a]; /* { dg-error "5:at file scope" } */ -int (*c1)[(__SIZE_TYPE__)&a]; /* { dg-error "7:at file scope" } */ -int (*c2())[(__SIZE_TYPE__)&a]; /* { dg-error "7:at file scope" } */ -struct c3 { int x[(__SIZE_TYPE__)&a]; }; /* { dg-error "17:at file scope" } */ -struct c4 { int (*x)[(__SIZE_TYPE__)&a]; }; /* { dg-error "19:at file scope" } */ -typeof (int [(__SIZE_TYPE__)&a]) c5; /* { dg-error "34:at file scope" } */ +int c0[(__UINTPTR_TYPE__)&a]; /* { dg-error "5:at file scope" } */ +int (*c1)[(__UINTPTR_TYPE__)&a]; /* { dg-error "7:at file scope" } */ +int (*c2())[(__UINTPTR_TYPE__)&a]; /* { dg-error "7:at file scope" } */ +struct c3 { int x[(__UINTPTR_TYPE__)&a]; }; /* { dg-error "17:at file scope" } */ +struct c4 { int (*x)[(__UINTPTR_TYPE__)&a]; }; /* { dg-error "19:at file scope" } */ +typeof (int [(__UINTPTR_TYPE__)&a]) c5; /* { dg-error "37:at file scope" } */ int d0[1/0]; /* { dg-error "5:at file scope" } */ /* { dg-warning "9:division by zero" "" { target *-*-* } 23 } */ diff --git a/gcc/testsuite/gcc.dg/builtin-bswap-1.c b/gcc/testsuite/gcc.dg/builtin-bswap-1.c index 6b4a805536c..724ba1e9847 100644 --- a/gcc/testsuite/gcc.dg/builtin-bswap-1.c +++ b/gcc/testsuite/gcc.dg/builtin-bswap-1.c @@ -5,11 +5,29 @@ #include <stdint.h> -uint32_t foo (uint32_t a) +uint16_t foo16 (uint16_t a) { - int b; + uint16_t b; + + b = __builtin_bswap16 (a); + + return b; +} + +uint32_t foo32 (uint32_t a) +{ + uint32_t b; b = __builtin_bswap32 (a); return b; } + +uint64_t foo64 (uint64_t a) +{ + uint64_t b; + + b = __builtin_bswap64 (a); + + return b; +} diff --git a/gcc/testsuite/gcc.dg/builtin-bswap-4.c b/gcc/testsuite/gcc.dg/builtin-bswap-4.c index 03e190ad782..da8ee68cd51 100644 --- a/gcc/testsuite/gcc.dg/builtin-bswap-4.c +++ b/gcc/testsuite/gcc.dg/builtin-bswap-4.c @@ -16,11 +16,19 @@ return result; \ } \ +MAKE_FUN(16, uint16_t); MAKE_FUN(32, uint32_t); MAKE_FUN(64, uint64_t); extern void abort (void); +#define NUMS16 \ + { \ + 0x0000, \ + 0x1122, \ + 0xffff, \ + } + #define NUMS32 \ { \ 0x00000000UL, \ @@ -35,6 +43,9 @@ extern void abort (void); 0xffffffffffffffffULL, \ } +uint16_t uint16_ts[] = + NUMS16; + uint32_t uint32_ts[] = NUMS32; @@ -48,6 +59,10 @@ main (void) { int i; + for (i = 0; i < N(uint16_ts); i++) + if (__builtin_bswap16 (uint16_ts[i]) != my_bswap16 (uint16_ts[i])) + abort (); + for (i = 0; i < N(uint32_ts); i++) if (__builtin_bswap32 (uint32_ts[i]) != my_bswap32 (uint32_ts[i])) abort (); diff --git a/gcc/testsuite/gcc.dg/builtin-bswap-5.c b/gcc/testsuite/gcc.dg/builtin-bswap-5.c index ccac9663334..b29931e4e10 100644 --- a/gcc/testsuite/gcc.dg/builtin-bswap-5.c +++ b/gcc/testsuite/gcc.dg/builtin-bswap-5.c @@ -6,6 +6,9 @@ main (void) /* Test constant folding. */ extern void link_error (void); + if (__builtin_bswap16(0xaabb) != 0xbbaa) + link_error (); + if (__builtin_bswap32(0xaabbccdd) != 0xddccbbaa) link_error (); diff --git a/gcc/testsuite/gcc.dg/c90-const-expr-6.c b/gcc/testsuite/gcc.dg/c90-const-expr-6.c index c432cca6343..50239ce2eba 100644 --- a/gcc/testsuite/gcc.dg/c90-const-expr-6.c +++ b/gcc/testsuite/gcc.dg/c90-const-expr-6.c @@ -4,13 +4,13 @@ /* { dg-do compile } */ /* { dg-options "-std=iso9899:1990 -pedantic-errors" } */ -__extension__ typedef __PTRDIFF_TYPE__ ptrdiff_t; +__extension__ typedef __INTPTR_TYPE__ intptr_t; /* PR 29116. */ int n = 0, p[n * 0 + 1]; /* { dg-error "variabl|can't be evaluated" } */ /* PR 31871. */ -extern int c[1 + ((ptrdiff_t) (void *) 0)]; /* { dg-error "variab|can't be evaluated" } */ +extern int c[1 + ((intptr_t) (void *) 0)]; /* { dg-error "variab|can't be evaluated" } */ /* Implicit conversions from floating-point constants are not OK, although explicit ones are. */ @@ -34,7 +34,7 @@ struct s { }; enum e { - E = (1 + ((ptrdiff_t) (void *) 0)), /* { dg-error "constant" } */ + E = (1 + ((intptr_t) (void *) 0)), /* { dg-error "constant" } */ E2 = 0 }; @@ -46,7 +46,7 @@ enum f { void f (int a) { - int v[1 + ((ptrdiff_t) (void *) 0)]; /* { dg-error "variab|can't be evaluated" } */ + int v[1 + ((intptr_t) (void *) 0)]; /* { dg-error "variab|can't be evaluated" } */ switch (a) { case (n * 0 + 1): /* { dg-error "constant" } */ diff --git a/gcc/testsuite/gcc.dg/c90-const-expr-9.c b/gcc/testsuite/gcc.dg/c90-const-expr-9.c index a06cdd951b2..0d5d8c1ae00 100644 --- a/gcc/testsuite/gcc.dg/c90-const-expr-9.c +++ b/gcc/testsuite/gcc.dg/c90-const-expr-9.c @@ -15,8 +15,9 @@ struct t { }; __extension__ typedef __SIZE_TYPE__ size_t; +__extension__ typedef __UINTPTR_TYPE__ uintptr_t; -#define old_offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) +#define old_offsetof(TYPE, MEMBER) ((size_t) (uintptr_t) &((TYPE *)0)->MEMBER) enum e { E1 = old_offsetof (struct s, a), /* { dg-error "constant" } */ diff --git a/gcc/testsuite/gcc.dg/c99-const-expr-6.c b/gcc/testsuite/gcc.dg/c99-const-expr-6.c index 1a31ddc40c4..ca602438d35 100644 --- a/gcc/testsuite/gcc.dg/c99-const-expr-6.c +++ b/gcc/testsuite/gcc.dg/c99-const-expr-6.c @@ -8,7 +8,7 @@ int n = 0, p[n * 0 + 1]; /* { dg-error "variabl" } */ /* PR 31871. */ -extern int c[1 + ((__PTRDIFF_TYPE__) (void *) 0)]; /* { dg-error "variab" } */ +extern int c[1 + ((__INTPTR_TYPE__) (void *) 0)]; /* { dg-error "variab" } */ /* Implicit conversions from floating-point constants are not OK, although explicit ones are. */ @@ -32,7 +32,7 @@ struct s { }; enum e { - E = (1 + ((__PTRDIFF_TYPE__) (void *) 0)), /* { dg-error "constant" } */ + E = (1 + ((__INTPTR_TYPE__) (void *) 0)), /* { dg-error "constant" } */ E2 = 0 }; diff --git a/gcc/testsuite/gcc.dg/c99-const-expr-9.c b/gcc/testsuite/gcc.dg/c99-const-expr-9.c index 48f43edece6..a0a6a9635c3 100644 --- a/gcc/testsuite/gcc.dg/c99-const-expr-9.c +++ b/gcc/testsuite/gcc.dg/c99-const-expr-9.c @@ -14,7 +14,7 @@ struct t { int b[2]; }; -#define old_offsetof(TYPE, MEMBER) ((__SIZE_TYPE__) &((TYPE *)0)->MEMBER) +#define old_offsetof(TYPE, MEMBER) ((__SIZE_TYPE__)(__UINTPTR_TYPE__) &((TYPE *)0)->MEMBER) enum e { E1 = old_offsetof (struct s, a), /* { dg-error "constant" } */ diff --git a/gcc/testsuite/gcc.dg/format/cast-1.c b/gcc/testsuite/gcc.dg/format/cast-1.c index 03e624a5cca..5d1d47709b7 100644 --- a/gcc/testsuite/gcc.dg/format/cast-1.c +++ b/gcc/testsuite/gcc.dg/format/cast-1.c @@ -11,6 +11,6 @@ void f (int x) { printf("%s", x); /* { dg-warning "format" } */ - printf((char *)(size_t)"%s", x); /* { dg-warning "format" } */ + printf((char *)(__UINTPTR_TYPE__)"%s", x); /* { dg-warning "format" } */ printf((char *)(char)"%s", x); /* { dg-warning "cast from pointer to integer of different size" } */ } diff --git a/gcc/testsuite/gcc.dg/inline-23.c b/gcc/testsuite/gcc.dg/inline-23.c index 55bd72a59e6..2829ecbf7e1 100644 --- a/gcc/testsuite/gcc.dg/inline-23.c +++ b/gcc/testsuite/gcc.dg/inline-23.c @@ -3,16 +3,19 @@ /* Make sure we can inline a varargs function whose variable arguments are not used. See PR32493. */ #include <stddef.h> + +typedef __INTPTR_TYPE__ my_intptr_t; + static inline __attribute__((always_inline)) void __check_printsym_format(const char *fmt, ...) { } static inline __attribute__((always_inline)) void print_symbol(const char *fmt, -ptrdiff_t addr) +my_intptr_t addr) { __check_printsym_format(fmt, ""); } void do_initcalls(void **call) { - print_symbol(": %s()", (ptrdiff_t) *call); + print_symbol(": %s()", (my_intptr_t) *call); } diff --git a/gcc/testsuite/gcc.dg/long-long-cst1.c b/gcc/testsuite/gcc.dg/long-long-cst1.c index 7c60648d281..800d6d64b9f 100644 --- a/gcc/testsuite/gcc.dg/long-long-cst1.c +++ b/gcc/testsuite/gcc.dg/long-long-cst1.c @@ -7,7 +7,7 @@ extern void abort(); struct st{ int _mark; }; -unsigned long long t = ((int)(__SIZE_TYPE__)&(((struct st*)16)->_mark) - 32); +unsigned long long t = ((int)(__UINTPTR_TYPE__)&(((struct st*)16)->_mark) - 32); int main() { diff --git a/gcc/testsuite/gcc.dg/mallign.c b/gcc/testsuite/gcc.dg/mallign.c index 6a0041e6466..349cdaa343f 100644 --- a/gcc/testsuite/gcc.dg/mallign.c +++ b/gcc/testsuite/gcc.dg/mallign.c @@ -9,7 +9,7 @@ typedef int word __attribute__((mode(word))); int main() { - if ((size_t)malloc (1) & (sizeof(word)-1)) + if ((__UINTPTR_TYPE__)malloc (1) & (sizeof(word)-1)) abort (); return 0; } diff --git a/gcc/testsuite/gcc.dg/max-1.c b/gcc/testsuite/gcc.dg/max-1.c index 40f2145c038..9823dca597e 100644 --- a/gcc/testsuite/gcc.dg/max-1.c +++ b/gcc/testsuite/gcc.dg/max-1.c @@ -7,19 +7,16 @@ /* m32c has varying sized pointers */ /* { dg-skip-if "" { "m32c-*-*" } { "*" } { "-mcpu=m32c" "-mcpu=m32cm" } } */ -/* Kludge to make it signed. */ -#define unsigned signed -__extension__ typedef __SIZE_TYPE__ ssize_t; -#undef unsigned +__extension__ typedef __INTPTR_TYPE__ intptr_t; extern void abort (void); -ssize_t fff[10]; +intptr_t fff[10]; -void f(ssize_t a, ssize_t b) +void f(intptr_t a, intptr_t b) { - ssize_t crcc = b; - ssize_t d = *((ssize_t*)(a+1)); + intptr_t crcc = b; + intptr_t d = *((intptr_t*)(a+1)); int i; a = d >= b? d:b; @@ -32,11 +29,11 @@ void f(ssize_t a, ssize_t b) /* The variable a cannot be a local variable as we get better aliasing now and decide that the store to a is dead. The better aliasing comes from better representation of pointer arithmetic. */ -ssize_t a = 10; +intptr_t a = 10; int main(void) { int i; - f((ssize_t)(&a)-1,0); + f((intptr_t)(&a)-1,0); for(i = 0;i<10;i++) if (fff[i]!=10) abort (); diff --git a/gcc/testsuite/gcc.dg/plugin/one_time_plugin.c b/gcc/testsuite/gcc.dg/plugin/one_time_plugin.c index 2c4cd497192..4bd99f12830 100644 --- a/gcc/testsuite/gcc.dg/plugin/one_time_plugin.c +++ b/gcc/testsuite/gcc.dg/plugin/one_time_plugin.c @@ -42,7 +42,7 @@ struct gimple_opt_pass one_pass = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func /* todo_flags_finish */ + 0 /* todo_flags_finish */ } }; diff --git a/gcc/testsuite/gcc.dg/plugin/selfassign.c b/gcc/testsuite/gcc.dg/plugin/selfassign.c index 84d2801d202..feb4130e532 100644 --- a/gcc/testsuite/gcc.dg/plugin/selfassign.c +++ b/gcc/testsuite/gcc.dg/plugin/selfassign.c @@ -276,7 +276,7 @@ static struct gimple_opt_pass pass_warn_self_assign = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func /* todo_flags_finish */ + 0 /* todo_flags_finish */ } }; diff --git a/gcc/testsuite/gcc.dg/pointer-arith-10.c b/gcc/testsuite/gcc.dg/pointer-arith-10.c index 220891e2097..52b1989ef93 100644 --- a/gcc/testsuite/gcc.dg/pointer-arith-10.c +++ b/gcc/testsuite/gcc.dg/pointer-arith-10.c @@ -1,9 +1,9 @@ /* { dg-do compile } */ /* { dg-options "-fdump-tree-original" } */ -char *foo(char *p, __SIZE_TYPE__ i) +char *foo(char *p, __UINTPTR_TYPE__ i) { - return (char *)i + (__SIZE_TYPE__)p; + return (char *)i + (__UINTPTR_TYPE__)p; } /* { dg-final { scan-tree-dump "p +" "original" } } */ diff --git a/gcc/testsuite/gcc.dg/pr14092-1.c b/gcc/testsuite/gcc.dg/pr14092-1.c index 927ecf6aa3b..1c103ccb312 100644 --- a/gcc/testsuite/gcc.dg/pr14092-1.c +++ b/gcc/testsuite/gcc.dg/pr14092-1.c @@ -6,7 +6,7 @@ /* Define this so that we are more portable. The testcase in the PR failed on 64-bit hosts. */ -typedef int __attribute__ ((mode (__pointer__))) intptr_t; +typedef __INTPTR_TYPE__ intptr_t; typedef struct _PLCI { unsigned char x; diff --git a/gcc/testsuite/gcc.dg/pr25682.c b/gcc/testsuite/gcc.dg/pr25682.c index 8c51d82403a..e8cab1d05e5 100644 --- a/gcc/testsuite/gcc.dg/pr25682.c +++ b/gcc/testsuite/gcc.dg/pr25682.c @@ -11,7 +11,7 @@ struct S }; char c[(char *) &((struct S *) 0)->b - (char *) 0]; /* { dg-warning "variably modified" } */ -char d[(__SIZE_TYPE__) &((struct S *) 8)->b]; /* { dg-warning "variably modified" } */ +char d[(__UINTPTR_TYPE__) &((struct S *) 8)->b]; /* { dg-warning "variably modified" } */ char e[sizeof (c) == __builtin_offsetof (struct S, b) ? 1 : -1]; char f[sizeof (d) == __builtin_offsetof (struct S, b) + 8 ? 1 : -1]; @@ -21,7 +21,7 @@ void foo (void) { char g[(char *) &((struct S *) 0)->b - (char *) 0]; - char h[(__SIZE_TYPE__) &((struct S *) 8)->b]; + char h[(__UINTPTR_TYPE__) &((struct S *) 8)->b]; char i[sizeof (g) == __builtin_offsetof (struct S, b) ? 1 : -1]; char j[sizeof (h) == __builtin_offsetof (struct S, b) + 8 ? 1 : -1]; bar (g, h); diff --git a/gcc/testsuite/gcc.dg/pr30744-1.c b/gcc/testsuite/gcc.dg/pr30744-1.c index a35c5526aa1..f08f3be172a 100644 --- a/gcc/testsuite/gcc.dg/pr30744-1.c +++ b/gcc/testsuite/gcc.dg/pr30744-1.c @@ -2,15 +2,17 @@ /* { dg-options "-O2" } */ #include <stddef.h> +typedef __INTPTR_TYPE__ my_intptr_t; + typedef struct { - ptrdiff_t unique; + my_intptr_t unique; } G; void r(G* n) { - ptrdiff_t p; - if (((G *) ((void *)((~(ptrdiff_t)(p))))) != ((void *)0)) { - ((G *) ((void *)((~(ptrdiff_t)(p)))))->unique = n->unique; + my_intptr_t p; + if (((G *) ((void *)((~(my_intptr_t)(p))))) != ((void *)0)) { + ((G *) ((void *)((~(my_intptr_t)(p)))))->unique = n->unique; } } diff --git a/gcc/testsuite/gcc.dg/pr34856.c b/gcc/testsuite/gcc.dg/pr34856.c index 6bfc704774f..62041e248ba 100644 --- a/gcc/testsuite/gcc.dg/pr34856.c +++ b/gcc/testsuite/gcc.dg/pr34856.c @@ -3,7 +3,7 @@ /* { dg-options "-O2 -msse2" { target { i?86-*-* x86_64-*-* } } } */ /* { dg-options "-O2 -maltivec" { target { powerpc*-*-linux* && powerpc_altivec_ok } } } */ -typedef unsigned __attribute__ ((__mode__ (__pointer__))) uintptr_t; +typedef __UINTPTR_TYPE__ uintptr_t; #undef __vector #define __vector __attribute__ ((__vector_size__ (16))) diff --git a/gcc/testsuite/gcc.dg/pr37561.c b/gcc/testsuite/gcc.dg/pr37561.c index ec712a7841d..3ad826329f9 100644 --- a/gcc/testsuite/gcc.dg/pr37561.c +++ b/gcc/testsuite/gcc.dg/pr37561.c @@ -1,7 +1,7 @@ /* PR c++/37561 */ /* { dg-do compile } */ -__extension__ __PTRDIFF_TYPE__ p; +__extension__ __INTPTR_TYPE__ p; char q; void diff --git a/gcc/testsuite/gcc.dg/pr37985.c b/gcc/testsuite/gcc.dg/pr37985.c new file mode 100644 index 00000000000..93e640b4a36 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr37985.c @@ -0,0 +1,8 @@ +/* PR c37985 */ +/* { dg-do compile } */ +/* { dg-options " -Wall -Wextra " } */ +unsigned char foo(unsigned char a) +{ + a >> 2; /* { dg-warning "no effect" } */ + return a; +} diff --git a/gcc/testsuite/gcc.dg/pr38700.c b/gcc/testsuite/gcc.dg/pr38700.c index bfa75b0c7cb..ebece7f0ff4 100644 --- a/gcc/testsuite/gcc.dg/pr38700.c +++ b/gcc/testsuite/gcc.dg/pr38700.c @@ -5,7 +5,7 @@ int foo () { - __SIZE_TYPE__ s = __builtin_expect ((__SIZE_TYPE__)&&L, 0); + __UINTPTR_TYPE__ s = __builtin_expect ((__UINTPTR_TYPE__)&&L, 0); L: return 0; } diff --git a/gcc/testsuite/gcc.dg/pr41551.c b/gcc/testsuite/gcc.dg/pr41551.c index e24fbc33db4..2f2ad2be97e 100644 --- a/gcc/testsuite/gcc.dg/pr41551.c +++ b/gcc/testsuite/gcc.dg/pr41551.c @@ -3,10 +3,10 @@ /* Make sure we do not ICE. */ -__extension__ typedef __SIZE_TYPE__ size_t; +__extension__ typedef __UINTPTR_TYPE__ uintptr_t; int main(void) { int var, *p = &var; - return (double)(size_t)(p); + return (double)(uintptr_t)(p); } diff --git a/gcc/testsuite/gcc.dg/pr44214-1.c b/gcc/testsuite/gcc.dg/pr44214-1.c new file mode 100644 index 00000000000..292ce57c30e --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr44214-1.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -freciprocal-math -fdump-tree-ccp1" } */ + +typedef double v2df __attribute__ ((vector_size (16))); + +void do_div (v2df *a, v2df *b) +{ + *a = *b / (v2df) { 2.0, 3.0 }; +} + +/* Constant folding should multiply *b by the reciprocals of the + vector elements. The fold does not take place for generic + vectors until the first CCP pass. The string " * " occurs 3 + times: one multiply and two indirect parameters. */ + +/* { dg-final { scan-tree-dump-times " \\\* " 3 "ccp1" } } */ +/* { dg-final { scan-tree-dump-times " / " 0 "ccp1" } } */ +/* { dg-final { cleanup-tree-dump "ccp1" } } */ diff --git a/gcc/testsuite/gcc.dg/pr44214-2.c b/gcc/testsuite/gcc.dg/pr44214-2.c new file mode 100644 index 00000000000..7e8581a2bb3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr44214-2.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -freciprocal-math -fdump-tree-original" } */ + +void do_div (_Complex double *a, _Complex double *b) +{ + *a = *b / (4.0 - 5.0fi); +} + +/* Constant folding should multiply *b by the reciprocal of 4 - 5i + = 4/41 + (5/41)i. */ + +/* { dg-final { scan-tree-dump-times " \\\* " 1 "original" } } */ +/* { dg-final { scan-tree-dump-times " / " 0 "original" } } */ +/* { dg-final { cleanup-tree-dump "original" } } */ diff --git a/gcc/testsuite/gcc.dg/pr44214-3.c b/gcc/testsuite/gcc.dg/pr44214-3.c new file mode 100644 index 00000000000..46d5ee8c78e --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr44214-3.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-ccp1" } */ + +typedef double v2df __attribute__ ((vector_size (16))); + +void do_div (v2df *a, v2df *b) +{ + *a = *b / (v2df) { 2.0, 2.0 }; +} + +/* Since 2.0 has an exact reciprocal, constant folding should multiply *b + by the reciprocals of the vector elements. As a result there should be + one vector multiply and zero divides in the optimized code. The fold + does not take place for generic vectors until the first CCP pass. The + string " * " occurs 3 times: one multiply and two indirect parameters. */ + +/* { dg-final { scan-tree-dump-times " \\\* " 3 "ccp1" } } */ +/* { dg-final { scan-tree-dump-times " / " 0 "ccp1" } } */ +/* { dg-final { cleanup-tree-dump "ccp1" } } */ diff --git a/gcc/testsuite/gcc.dg/pr51879-12.c b/gcc/testsuite/gcc.dg/pr51879-12.c new file mode 100644 index 00000000000..1b25e296fbf --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr51879-12.c @@ -0,0 +1,29 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-pre" } */ + +__attribute__((pure)) int bar (int); +__attribute__((pure)) int bar2 (int); +void baz (int); + +int x, z; + +void +foo (int y) +{ + int a = 0; + if (y == 6) + { + a += bar (7); + a += bar2 (6); + } + else + { + a += bar2 (6); + a += bar (7); + } + baz (a); +} + +/* { dg-final { scan-tree-dump-times "bar \\(" 1 "pre"} } */ +/* { dg-final { scan-tree-dump-times "bar2 \\(" 1 "pre"} } */ +/* { dg-final { cleanup-tree-dump "pre" } } */ diff --git a/gcc/testsuite/gcc.dg/pr52283.c b/gcc/testsuite/gcc.dg/pr52283.c new file mode 100644 index 00000000000..33785a598e2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr52283.c @@ -0,0 +1,16 @@ +/* Test for case labels not integer constant expressions but folding + to integer constants (used in Linux kernel). */ +/* { dg-do compile } */ + +extern unsigned int u; + +void +b (int c) +{ + switch (c) + { + case (int) (2 | ((4 < 8) ? 8 : u)): + ; + } +} + diff --git a/gcc/testsuite/gcc.dg/pr52549.c b/gcc/testsuite/gcc.dg/pr52549.c new file mode 100644 index 00000000000..89ec2aaf6cc --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr52549.c @@ -0,0 +1,6 @@ +/* { dg-do compile } */ + +_mark (long obj, int i, char *a) +{ + (char *)&(((long *)(obj)) [i]) - a; +} diff --git a/gcc/testsuite/gcc.dg/pr52734.c b/gcc/testsuite/gcc.dg/pr52734.c new file mode 100644 index 00000000000..a6894954e71 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr52734.c @@ -0,0 +1,35 @@ +/* { dg-do run } */ +/* { dg-options "-O2" } */ + +int bbb = 0; + +int __attribute__((noinline,noclone)) aaa(void) +{ + ++bbb; + return 0; +} + +int __attribute__((noinline,noclone)) ccc(void) +{ + int ddd; + /* bbb == 0 */ + if (aaa()) + return bbb; + + /* bbb == 1 */ + ddd = bbb; + /* bbb == ddd == 1 */ + if (aaa ()) + return 0; + /* bbb == 2, ddd == 1 */ + + return ddd; +} + +int main(void) +{ + if (ccc() != 1) + __builtin_abort(); + return 0; +} + diff --git a/gcc/testsuite/gcc.dg/pr52862.c b/gcc/testsuite/gcc.dg/pr52862.c new file mode 100644 index 00000000000..febe7a8289b --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr52862.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-O" } */ + +void ASMAtomicWritePtrVoid(const void *pv); +void rtThreadDestroy(void) +{ + void * const pvTypeChecked = ((void *)0); + ASMAtomicWritePtrVoid((void *)(pvTypeChecked)); +} diff --git a/gcc/testsuite/gcc.dg/sequence-pt-1.c b/gcc/testsuite/gcc.dg/sequence-pt-1.c index 05eee82c176..2e22b662a46 100644 --- a/gcc/testsuite/gcc.dg/sequence-pt-1.c +++ b/gcc/testsuite/gcc.dg/sequence-pt-1.c @@ -15,7 +15,7 @@ extern int fnb (int, int); extern int fnc (int *); extern int sprintf (char *, const char *, ...); -typedef __SIZE_TYPE__ size_t; +typedef __UINTPTR_TYPE__ uintptr_t; void foo (int a, int b, int n, int p, int *ptr, struct s *sptr, @@ -32,9 +32,9 @@ foo (int a, int b, int n, int p, int *ptr, struct s *sptr, ap[++n] = bp[--n]; /* { dg-warning "undefined" "sequence point warning" } */ cp[n][n] = cp[n][n]++; /* { dg-warning "undefined" "sequence point warning" } */ cp[n][p] = cp[n][n++]; /* { dg-warning "undefined" "sequence point warning" } */ - *ptr++ = (size_t)ptr++; /* { dg-warning "undefined" "sequence point warning" } */ + *ptr++ = (uintptr_t)ptr++; /* { dg-warning "undefined" "sequence point warning" } */ sptr->a = sptr->a++; /* { dg-warning "undefined" "sequence point warning" } */ - sptr->a = (size_t)(sptr++); /* { dg-warning "undefined" "sequence point warning" } */ + sptr->a = (uintptr_t)(sptr++); /* { dg-warning "undefined" "sequence point warning" } */ *ptr++ = fn (*ptr); /* { dg-warning "undefined" "sequence point warning" } */ a = b = a++; /* { dg-warning "undefined" "sequence point warning" } */ b = a = --b; /* { dg-warning "undefined" "sequence point warning" } */ diff --git a/gcc/testsuite/gcc.dg/stack-usage-1.c b/gcc/testsuite/gcc.dg/stack-usage-1.c index c852f78f5cd..78bb51d9bb2 100644 --- a/gcc/testsuite/gcc.dg/stack-usage-1.c +++ b/gcc/testsuite/gcc.dg/stack-usage-1.c @@ -58,6 +58,8 @@ # define SIZE 224 #elif defined (__epiphany__) # define SIZE (256 - __EPIPHANY_STACK_OFFSET__) +#elif defined (__RL78__) +# define SIZE 254 #else # define SIZE 256 #endif diff --git a/gcc/testsuite/gcc.dg/superblock.c b/gcc/testsuite/gcc.dg/superblock.c new file mode 100644 index 00000000000..2b9aedfdac4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/superblock.c @@ -0,0 +1,23 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fno-asynchronous-unwind-tables -fsched2-use-superblocks -fdump-rtl-sched2 -fdump-rtl-bbro" } */ + +typedef int aligned __attribute__ ((aligned (64))); +extern void abort (void); + +int bar (void *p); + +void +foo (void) +{ + char *p = __builtin_alloca (13); + aligned i; + + if (bar (p) || bar (&i)) + abort (); +} + +/* { dg-final { scan-rtl-dump-times "0 uses" 0 "bbro"} } */ +/* { dg-final { scan-rtl-dump-times "ADVANCING TO" 2 "sched2"} } */ +/* { dg-final { cleanup-rtl-dump "bbro" } } */ +/* { dg-final { cleanup-rtl-dump "sched2" } } */ + diff --git a/gcc/testsuite/gcc.dg/torture/pr39074.c b/gcc/testsuite/gcc.dg/torture/pr39074.c index 4775062d964..89c4ac6ca9f 100644 --- a/gcc/testsuite/gcc.dg/torture/pr39074.c +++ b/gcc/testsuite/gcc.dg/torture/pr39074.c @@ -2,7 +2,7 @@ /* { dg-options "-fdump-tree-alias" } */ /* { dg-skip-if "" { *-*-* } { "-O0" "-fno-fat-lto-objects" } { "" } } */ -typedef __PTRDIFF_TYPE__ intptr_t; +typedef __INTPTR_TYPE__ intptr_t; int i; void __attribute__((noinline)) diff --git a/gcc/testsuite/gcc.dg/torture/pr52881.c b/gcc/testsuite/gcc.dg/torture/pr52881.c new file mode 100644 index 00000000000..c101c80338d --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr52881.c @@ -0,0 +1,35 @@ +/* { dg-do compile } */ + +int a, b, c, d, e, f, h, i, j, k, l, m, n, o; +static int g; +int +fn1 () { + for (;; ++f) + if (e) + break; + return 0; +} +unsigned char fn2 (); +void +fn3 () { +lbl_220: + if (j) { +lbl_221: + l = (g || b) <= fn1 (); + for (;;) { + g = 0; + fn2 (); + if (k) + goto lbl_220; + break; + } + if (l) + goto lbl_221; + } +} +unsigned char +fn2 () { + o = d ? 0 : c; + h = m | a % o != n; + return i; +} diff --git a/gcc/testsuite/gcc.dg/torture/pr52912.c b/gcc/testsuite/gcc.dg/torture/pr52912.c new file mode 100644 index 00000000000..3ae57588f26 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr52912.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ + +int a, b, c; +static int +fn1 (p1) +{ +lbl_549: + if (p1) + goto lbl_549; + return 0; +} + +void +fn2 () +{ + b = (c && a) > fn1 (c) >= c; +} diff --git a/gcc/testsuite/gcc.dg/torture/pr52913.c b/gcc/testsuite/gcc.dg/torture/pr52913.c new file mode 100644 index 00000000000..ad99884bfed --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr52913.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ + +int a, b, c, d, e; +void +fn1 () +{ +lbl_101: + e = 0; +lbl_274: + for (c = 0; c < 1; c = a) + if (d) + if (b) + goto lbl_101; + else + break; + d = 1; + goto lbl_274; +} diff --git a/gcc/testsuite/gcc.dg/torture/pr52943.c b/gcc/testsuite/gcc.dg/torture/pr52943.c new file mode 100644 index 00000000000..da35c9d184b --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr52943.c @@ -0,0 +1,20 @@ +/* { dg-do run } */ + +extern void abort (void); +int a[] = { 0, 0, 0, 6 }; + +int b; +int +main () +{ + for (;;) + { + b = 3; + for (; b; b -= 1) + a[b] = a[3] > 1; + break; + } + if (a[1] != 0) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/torture/pr52969.c b/gcc/testsuite/gcc.dg/torture/pr52969.c new file mode 100644 index 00000000000..05331d93f34 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr52969.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-ftree-loop-if-convert-stores" } */ + +int a, b; +float xsum[100]; +void foo (float *cluster) +{ + int j; + for (; a ; ++j) { + xsum[j] = cluster[j]; + if (xsum[j] > 0) + xsum[j] = 0; + } + if (xsum[0]) + b = 0; +} diff --git a/gcc/testsuite/gcc.dg/torture/pta-escape-1.c b/gcc/testsuite/gcc.dg/torture/pta-escape-1.c index dbfd4c9d387..d3cb25437cc 100644 --- a/gcc/testsuite/gcc.dg/torture/pta-escape-1.c +++ b/gcc/testsuite/gcc.dg/torture/pta-escape-1.c @@ -9,7 +9,7 @@ bar (void) *p = 1; } int __attribute__((noinline,noclone)) -foo (__SIZE_TYPE__ addr) +foo (__INTPTR_TYPE__ addr) { int i; /* q points to ANYTHING */ @@ -25,7 +25,7 @@ extern void abort (void); int main() { - if (foo ((__SIZE_TYPE__)&p) != 1) + if (foo ((__INTPTR_TYPE__)&p) != 1) abort (); return 0; } diff --git a/gcc/testsuite/gcc.dg/tree-ssa/foldcast-1.c b/gcc/testsuite/gcc.dg/tree-ssa/foldcast-1.c index 08b827c1d3b..9444f0be204 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/foldcast-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/foldcast-1.c @@ -1,7 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-fdump-tree-original" } */ -typedef int ssize_t __attribute__((mode(pointer))); +typedef __INTPTR_TYPE__ ssize_t; ssize_t foo (ssize_t x) { return (ssize_t)(char *)x; diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr18589-1.c b/gcc/testsuite/gcc.dg/tree-ssa/pr18589-1.c new file mode 100644 index 00000000000..48c904d0f8f --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr18589-1.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -ffast-math -fdump-tree-optimized" } */ + +double baz (double x, double y) +{ + return x * x * x * x * y * y * y * y; +} + +/* { dg-final { scan-tree-dump-times " \\* " 3 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr18589-10.c b/gcc/testsuite/gcc.dg/tree-ssa/pr18589-10.c new file mode 100644 index 00000000000..4a6120abd6d --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr18589-10.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -ffast-math -fdump-tree-optimized" } */ + +double baz (double x, double y, double z) +{ + return (__builtin_pow (x, 4.0) * __builtin_pow (y, 2.0) + * __builtin_pow (z, 4.0)); +} + +/* { dg-final { scan-tree-dump-times " \\* " 5 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr18589-2.c b/gcc/testsuite/gcc.dg/tree-ssa/pr18589-2.c new file mode 100644 index 00000000000..d8b7fca00ee --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr18589-2.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -ffast-math -fdump-tree-optimized" } */ + +double baz (double x, double y) +{ + return x * y * y * x * y * x * x * y; +} + +/* { dg-final { scan-tree-dump-times " \\* " 3 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr18589-3.c b/gcc/testsuite/gcc.dg/tree-ssa/pr18589-3.c new file mode 100644 index 00000000000..26c1893bae7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr18589-3.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -ffast-math -fdump-tree-optimized" } */ + +double baz (double x, double y, double z) +{ + return x * x * y * y * y * z * z * z * z; +} + +/* { dg-final { scan-tree-dump-times " \\* " 5 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr18589-4.c b/gcc/testsuite/gcc.dg/tree-ssa/pr18589-4.c new file mode 100644 index 00000000000..55c2d43b397 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr18589-4.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -ffast-math -fdump-tree-optimized" } */ + +double baz (double x, double y, double z, double u) +{ + return x * x * y * y * y * z * z * z * z * u; +} + +/* { dg-final { scan-tree-dump-times " \\* " 6 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr18589-5.c b/gcc/testsuite/gcc.dg/tree-ssa/pr18589-5.c new file mode 100644 index 00000000000..ea60f8eca1c --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr18589-5.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -ffast-math -fdump-tree-optimized" } */ + +double baz (double x, double y, double z, double u) +{ + return x * x * x * y * y * y * z * z * z * z * u * u * u * u; +} + +/* { dg-final { scan-tree-dump-times " \\* " 6 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr18589-6.c b/gcc/testsuite/gcc.dg/tree-ssa/pr18589-6.c new file mode 100644 index 00000000000..5044020cf44 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr18589-6.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -ffast-math -fdump-tree-optimized" } */ + +double baz (double x, double y) +{ + return __builtin_pow (x, 3.0) * __builtin_pow (y, 4.0); +} + +/* { dg-final { scan-tree-dump-times " \\* " 4 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr18589-7.c b/gcc/testsuite/gcc.dg/tree-ssa/pr18589-7.c new file mode 100644 index 00000000000..d4c5241583a --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr18589-7.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -ffast-math -fdump-tree-optimized" } */ + +float baz (float x, float y) +{ + return x * x * x * x * y * y * y * y; +} + +/* { dg-final { scan-tree-dump-times " \\* " 3 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr18589-8.c b/gcc/testsuite/gcc.dg/tree-ssa/pr18589-8.c new file mode 100644 index 00000000000..5335fa229e8 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr18589-8.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -ffast-math -fdump-tree-optimized" } */ + +long double baz (long double x, long double y) +{ + return x * x * x * x * y * y * y * y; +} + +/* { dg-final { scan-tree-dump-times " \\* " 3 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr18589-9.c b/gcc/testsuite/gcc.dg/tree-ssa/pr18589-9.c new file mode 100644 index 00000000000..08d5798e2cd --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr18589-9.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -ffast-math -fdump-tree-optimized" } */ + +double baz (double x, double y, double z) +{ + return (__builtin_pow (x, 3.0) * __builtin_pow (y, 2.0) + * __builtin_pow (z, 5.0)); +} + +/* { dg-final { scan-tree-dump-times " \\* " 6 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/var-expand1.c b/gcc/testsuite/gcc.dg/var-expand1.c index 3904407c44d..a784ea1a041 100644 --- a/gcc/testsuite/gcc.dg/var-expand1.c +++ b/gcc/testsuite/gcc.dg/var-expand1.c @@ -6,7 +6,7 @@ extern void abort (void); -float array[10] = { 1,2,3,4,5,6,7,8,9,10 }; +float array[30] = { 1,2,3,4,5,6,7,8,9,10 }; int foo (int n) { diff --git a/gcc/testsuite/gcc.dg/vect/pr52870.c b/gcc/testsuite/gcc.dg/vect/pr52870.c new file mode 100644 index 00000000000..38518508bf6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr52870.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-O1 -ftree-vectorize" } */ + +long +test (int *x) +{ + unsigned long sx, xprec; + + sx = *x >= 0 ? *x : -*x; + + xprec = sx * 64; + + if (sx < 16384) + foo (sx); + + return xprec; +} diff --git a/gcc/testsuite/gcc.dg/vect/vect-outer-1-big-array.c b/gcc/testsuite/gcc.dg/vect/vect-outer-1-big-array.c index 804c3867bd0..b896faa7f95 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-outer-1-big-array.c +++ b/gcc/testsuite/gcc.dg/vect/vect-outer-1-big-array.c @@ -22,6 +22,6 @@ foo (){ } /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail *-*-* } } } */ -/* { dg-final { scan-tree-dump-times "strided access in outer loop" 1 "vect" { xfail vect_multiple_sizes } } } */ -/* { dg-final { scan-tree-dump-times "strided access in outer loop" 2 "vect" { target vect_multiple_sizes } } } */ +/* { dg-final { scan-tree-dump-times "grouped access in outer loop" 1 "vect" { xfail vect_multiple_sizes } } } */ +/* { dg-final { scan-tree-dump-times "grouped access in outer loop" 2 "vect" { target vect_multiple_sizes } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-outer-1.c b/gcc/testsuite/gcc.dg/vect/vect-outer-1.c index 2ce8f8ebac8..2abcb179458 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-outer-1.c +++ b/gcc/testsuite/gcc.dg/vect/vect-outer-1.c @@ -22,6 +22,6 @@ foo (){ } /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail *-*-* } } } */ -/* { dg-final { scan-tree-dump-times "strided access in outer loop" 1 "vect" { xfail vect_multiple_sizes } } } */ -/* { dg-final { scan-tree-dump-times "strided access in outer loop" 2 "vect" { target vect_multiple_sizes } } } */ +/* { dg-final { scan-tree-dump-times "grouped access in outer loop" 1 "vect" { xfail vect_multiple_sizes } } } */ +/* { dg-final { scan-tree-dump-times "grouped access in outer loop" 2 "vect" { target vect_multiple_sizes } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-outer-1a-big-array.c b/gcc/testsuite/gcc.dg/vect/vect-outer-1a-big-array.c index 9b418fabaa9..0a53c25484a 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-outer-1a-big-array.c +++ b/gcc/testsuite/gcc.dg/vect/vect-outer-1a-big-array.c @@ -20,6 +20,6 @@ foo (){ } /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail *-*-* } } } */ -/* { dg-final { scan-tree-dump-times "strided access in outer loop" 1 "vect" { xfail vect_multiple_sizes } } } */ -/* { dg-final { scan-tree-dump-times "strided access in outer loop" 2 "vect" { target vect_multiple_sizes } } } */ +/* { dg-final { scan-tree-dump-times "grouped access in outer loop" 1 "vect" { xfail vect_multiple_sizes } } } */ +/* { dg-final { scan-tree-dump-times "grouped access in outer loop" 2 "vect" { target vect_multiple_sizes } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-outer-1a.c b/gcc/testsuite/gcc.dg/vect/vect-outer-1a.c index a9b786e235c..acd504c9e0b 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-outer-1a.c +++ b/gcc/testsuite/gcc.dg/vect/vect-outer-1a.c @@ -20,6 +20,6 @@ foo (){ } /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail *-*-* } } } */ -/* { dg-final { scan-tree-dump-times "strided access in outer loop" 1 "vect" { xfail vect_multiple_sizes } } } */ -/* { dg-final { scan-tree-dump-times "strided access in outer loop" 2 "vect" { target vect_multiple_sizes } } } */ +/* { dg-final { scan-tree-dump-times "grouped access in outer loop" 1 "vect" { xfail vect_multiple_sizes } } } */ +/* { dg-final { scan-tree-dump-times "grouped access in outer loop" 2 "vect" { target vect_multiple_sizes } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-outer-1b-big-array.c b/gcc/testsuite/gcc.dg/vect/vect-outer-1b-big-array.c index 48b7180784e..551c89fba38 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-outer-1b-big-array.c +++ b/gcc/testsuite/gcc.dg/vect/vect-outer-1b-big-array.c @@ -22,6 +22,6 @@ foo (){ } /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail *-*-* } } } */ -/* { dg-final { scan-tree-dump-times "strided access in outer loop" 1 "vect" { xfail vect_multiple_sizes } } } */ -/* { dg-final { scan-tree-dump-times "strided access in outer loop" 2 "vect" { target vect_multiple_sizes } } } */ +/* { dg-final { scan-tree-dump-times "grouped access in outer loop" 1 "vect" { xfail vect_multiple_sizes } } } */ +/* { dg-final { scan-tree-dump-times "grouped access in outer loop" 2 "vect" { target vect_multiple_sizes } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-outer-1b.c b/gcc/testsuite/gcc.dg/vect/vect-outer-1b.c index 815758c766f..c475a5e443e 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-outer-1b.c +++ b/gcc/testsuite/gcc.dg/vect/vect-outer-1b.c @@ -22,6 +22,6 @@ foo (){ } /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail *-*-* } } } */ -/* { dg-final { scan-tree-dump-times "strided access in outer loop" 1 "vect" { xfail vect_multiple_sizes } } } */ -/* { dg-final { scan-tree-dump-times "strided access in outer loop" 2 "vect" { target vect_multiple_sizes } } } */ +/* { dg-final { scan-tree-dump-times "grouped access in outer loop" 1 "vect" { xfail vect_multiple_sizes } } } */ +/* { dg-final { scan-tree-dump-times "grouped access in outer loop" 2 "vect" { target vect_multiple_sizes } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-outer-2b.c b/gcc/testsuite/gcc.dg/vect/vect-outer-2b.c index cb62881f004..2b3351626ec 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-outer-2b.c +++ b/gcc/testsuite/gcc.dg/vect/vect-outer-2b.c @@ -37,6 +37,6 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "strided access in outer loop" 1 "vect" { xfail vect_multiple_sizes } } } */ -/* { dg-final { scan-tree-dump-times "strided access in outer loop" 2 "vect" { target vect_multiple_sizes } } } */ +/* { dg-final { scan-tree-dump-times "grouped access in outer loop" 1 "vect" { xfail vect_multiple_sizes } } } */ +/* { dg-final { scan-tree-dump-times "grouped access in outer loop" 2 "vect" { target vect_multiple_sizes } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-outer-3b.c b/gcc/testsuite/gcc.dg/vect/vect-outer-3b.c index fda8727bf68..4a86af28d8a 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-outer-3b.c +++ b/gcc/testsuite/gcc.dg/vect/vect-outer-3b.c @@ -49,6 +49,6 @@ int main (void) } /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail *-*-* } } } */ -/* { dg-final { scan-tree-dump-times "strided access in outer loop" 2 "vect" { xfail vect_multiple_sizes } } } */ -/* { dg-final { scan-tree-dump-times "strided access in outer loop" 4 "vect" { target vect_multiple_sizes } } } */ +/* { dg-final { scan-tree-dump-times "grouped access in outer loop" 2 "vect" { xfail vect_multiple_sizes } } } */ +/* { dg-final { scan-tree-dump-times "grouped access in outer loop" 4 "vect" { target vect_multiple_sizes } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vla-11.c b/gcc/testsuite/gcc.dg/vla-11.c index 8948e6b77a3..9c23e860a53 100644 --- a/gcc/testsuite/gcc.dg/vla-11.c +++ b/gcc/testsuite/gcc.dg/vla-11.c @@ -7,7 +7,7 @@ /* { dg-options "-std=c99 -pedantic-errors" } */ void foo11a(int x[sizeof(int *(*)[*])]); /* { dg-warning "not in a declaration" } */ -void foo11b(__SIZE_TYPE__ x, int y[(__SIZE_TYPE__)(int (*)[*])x]); /* { dg-warning "not in a declaration" } */ +void foo11b(__SIZE_TYPE__ x, int y[(__UINTPTR_TYPE__)(int (*)[*])x]); /* { dg-warning "not in a declaration" } */ void foo11c(struct s { int (*x)[*]; } *y); /* { dg-error "a member of a structure or union cannot have a variably modified type" "variably modified" } */ /* { dg-warning "'struct s' declared inside parameter list" "struct decl" { target *-*-* } 11 } */ /* { dg-warning "its scope is only this definition or declaration" "struct scope" { target *-*-* } 11 } */ diff --git a/gcc/testsuite/gcc.target/arm/thumb1-imm.c b/gcc/testsuite/gcc.target/arm/thumb1-imm.c new file mode 100644 index 00000000000..6d950aa182c --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/thumb1-imm.c @@ -0,0 +1,12 @@ +/* Check for thumb1 imm [255-510] moves. */ +/* { dg-require-effective-target arm_thumb1_ok } */ +/* { dg-options "-Os" } */ +/* { dg-skip-if "" { ! { arm_thumb1 } } } */ + +int f() +{ + return 257; +} + +/* { dg-final { scan-assembler-not "ldr" } } */ + diff --git a/gcc/testsuite/gcc.target/i386/avx2-vpermd-2.c b/gcc/testsuite/gcc.target/i386/avx2-vpermd-2.c index 4a4e73c78fb..a663337e9a9 100644 --- a/gcc/testsuite/gcc.target/i386/avx2-vpermd-2.c +++ b/gcc/testsuite/gcc.target/i386/avx2-vpermd-2.c @@ -29,8 +29,8 @@ calc_permd (int *src1, int *src2, int *dst) memcpy (dst, src1, 32); for (i = 0; i < 8; i++) { - temp = src1[i]; - dst[i] = src2[temp & 7]; + temp = src2[i]; + dst[i] = src1[temp & 7]; } } diff --git a/gcc/testsuite/gcc.target/i386/avx2-vpermps-1.c b/gcc/testsuite/gcc.target/i386/avx2-vpermps-1.c index 3346b23531f..bf436599d54 100644 --- a/gcc/testsuite/gcc.target/i386/avx2-vpermps-1.c +++ b/gcc/testsuite/gcc.target/i386/avx2-vpermps-1.c @@ -5,9 +5,10 @@ #include <immintrin.h> __m256 x; +__m256i y; void extern avx2_test (void) { - x = _mm256_permutevar8x32_ps (x, x); + x = _mm256_permutevar8x32_ps (x, y); } diff --git a/gcc/testsuite/gcc.target/i386/avx2-vpermps-2.c b/gcc/testsuite/gcc.target/i386/avx2-vpermps-2.c index f145aa1d214..4190189a89c 100644 --- a/gcc/testsuite/gcc.target/i386/avx2-vpermps-2.c +++ b/gcc/testsuite/gcc.target/i386/avx2-vpermps-2.c @@ -8,7 +8,7 @@ #define NUM 10 static void -init_permps (float *src1, float *src2, int seed) +init_permps (float *src1, int *src2, int seed) { int i, sign = 1; @@ -21,24 +21,24 @@ init_permps (float *src1, float *src2, int seed) } static void -calc_permps (float *src1, float *src2, float *dst) +calc_permps (float *src1, int *src2, float *dst) { int i; unsigned temp; - unsigned *idx = (int *) src1; memcpy (dst, src1, 32); for (i = 0; i < 8; i++) { - temp = idx[i]; - dst[i] = src2[temp & 7]; + temp = src2[i]; + dst[i] = src1[temp & 7]; } } static void avx2_test (void) { - union256 src1, src2, dst; + union256 src1, dst; + union256i_d src2; float dst_ref[8]; int i; diff --git a/gcc/testsuite/gcc.target/i386/avx256-unaligned-load-4.c b/gcc/testsuite/gcc.target/i386/avx256-unaligned-load-4.c index 0d3ef333120..2c087a17e37 100644 --- a/gcc/testsuite/gcc.target/i386/avx256-unaligned-load-4.c +++ b/gcc/testsuite/gcc.target/i386/avx256-unaligned-load-4.c @@ -3,7 +3,7 @@ #define N 1024 -float a[N], b[N+3]; +float a[N+3], b[N]; void avx_test (void) diff --git a/gcc/testsuite/gcc.target/i386/builtin-bswap-4.c b/gcc/testsuite/gcc.target/i386/builtin-bswap-4.c new file mode 100644 index 00000000000..65198aee89e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/builtin-bswap-4.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ +/* { dg-final { scan-assembler-not "bswap\[ \t\]" } } */ + +short foo (short x) +{ + return __builtin_bswap16 (x); +} diff --git a/gcc/testsuite/gcc.target/i386/pr45830.c b/gcc/testsuite/gcc.target/i386/pr45830.c index a74d4345464..85d5a3c5ab0 100644 --- a/gcc/testsuite/gcc.target/i386/pr45830.c +++ b/gcc/testsuite/gcc.target/i386/pr45830.c @@ -26,6 +26,6 @@ foo (int *a) } } -/* { dg-final { scan-tree-dump "Expanding as bit test is preferable" "switchconv" } } */ +/* { dg-final { scan-tree-dump "expanding as bit test is preferable" "switchconv" } } */ /* { dg-final { scan-assembler-not "CSWTCH" } } */ /* { dg-final { cleanup-tree-dump "switchconv" } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr52876.c b/gcc/testsuite/gcc.target/i386/pr52876.c new file mode 100644 index 00000000000..6d5e47a94d0 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr52876.c @@ -0,0 +1,25 @@ +/* { dg-do run { target { x32 } } } */ +/* { dg-options "-O2 -mx32 -maddress-mode=long" } */ + +extern void abort (void); + +long long li; + +long long +__attribute__ ((noinline)) +testfunc (void* addr) +{ + li = (long long)(int)addr; + li &= 0xffffffff; + return li; +} + +int main (void) +{ + volatile long long rv_test; + rv_test = testfunc((void*)0x87651234); + if (rv_test != 0x87651234ULL) + abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/powerpc/pr16458-1.c b/gcc/testsuite/gcc.target/powerpc/pr16458-1.c new file mode 100644 index 00000000000..45b8c75c069 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr16458-1.c @@ -0,0 +1,18 @@ +/* Test cse'ing of unsigned compares. */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +/* { dg-final { scan-assembler-not "cmpw" } } */ +/* { dg-final { scan-assembler-times "cmplw" 1 } } */ + +unsigned int a, b; + +int +foo (void) +{ + if (a == b) return 1; + if (a > b) return 2; + if (a < b) return 3; + if (a != b) return 4; + return 0; +} diff --git a/gcc/testsuite/gcc.target/powerpc/pr16458-2.c b/gcc/testsuite/gcc.target/powerpc/pr16458-2.c new file mode 100644 index 00000000000..95e97de5560 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr16458-2.c @@ -0,0 +1,18 @@ +/* Test cse'ing of unsigned compares. */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +/* { dg-final { scan-assembler-not "cmpw" } } */ +/* { dg-final { scan-assembler-times "cmplw" 1 } } */ + +unsigned int *a, *b; + +int +foo (void) +{ + if (*a == *b) return 1; + if (*a > *b) return 2; + if (*a < *b) return 3; + if (*a != *b) return 4; + return 0; +} diff --git a/gcc/testsuite/gcc.target/powerpc/pr16458-3.c b/gcc/testsuite/gcc.target/powerpc/pr16458-3.c new file mode 100644 index 00000000000..740d61dcc74 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr16458-3.c @@ -0,0 +1,41 @@ +/* Test cse'ing of unsigned compares. */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fno-jump-tables" } */ + +/* { dg-final { scan-assembler-not "cmpwi" } } */ +/* { dg-final { scan-assembler-times "cmplwi" 5 } } */ + +extern int case0 (void); +extern int case1 (void); +extern int case2 (void); +extern int case3 (void); +extern int case4 (void); + +enum CASE_VALUES +{ + CASE0 = 1, + CASE1, + CASE2, + CASE3, + CASE4 +}; + +int +foo (enum CASE_VALUES index) +{ + switch (index) + { + case CASE0: + return case0 (); + case CASE1: + return case1 (); + case CASE2: + return case2 (); + case CASE3: + return case3 (); + case CASE4: + return case4 (); + } + + return 0; +} diff --git a/gcc/testsuite/gcc.target/powerpc/pr16458-4.c b/gcc/testsuite/gcc.target/powerpc/pr16458-4.c new file mode 100644 index 00000000000..8db43e82384 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr16458-4.c @@ -0,0 +1,44 @@ +/* Test cse'ing of unsigned compares. */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fno-jump-tables" } */ + +/* The following tests fail due to an issue in expand not + attaching an type expression information on *index's reg rtx. */ + +/* { dg-final { scan-assembler-not "cmpwi" } } */ +/* { dg-final { scan-assembler-times "cmplwi" 5 } } */ + +extern int case0 (void); +extern int case1 (void); +extern int case2 (void); +extern int case3 (void); +extern int case4 (void); + +enum CASE_VALUES +{ + CASE0 = 1, + CASE1, + CASE2, + CASE3, + CASE4 +}; + +int +foo (enum CASE_VALUES *index) +{ + switch (*index) + { + case CASE0: + return case0 (); + case CASE1: + return case1 (); + case CASE2: + return case2 (); + case CASE3: + return case3 (); + case CASE4: + return case4 (); + } + + return 0; +} diff --git a/gcc/testsuite/gcc.target/powerpc/pr52775.c b/gcc/testsuite/gcc.target/powerpc/pr52775.c new file mode 100644 index 00000000000..4027819ee63 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr52775.c @@ -0,0 +1,16 @@ +/* { dg-do compile { target { powerpc*-*-* && ilp32 } } } */ +/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */ +/* { dg-options "-O1 -mcpu=power4" } */ +/* { dg-final { scan-assembler-times "fcfid" 2 } } */ + +double +int_to_double (int *p) +{ + return (double)*p; +} + +double +long_long_to_double (long long *p) +{ + return (double)*p; +} diff --git a/gcc/testsuite/gcc.target/sh/pr50751-4.c b/gcc/testsuite/gcc.target/sh/pr50751-4.c new file mode 100644 index 00000000000..f3f0357707a --- /dev/null +++ b/gcc/testsuite/gcc.target/sh/pr50751-4.c @@ -0,0 +1,30 @@ +/* Check that the mov.w displacement addressing insn is generated. + If the insn is generated as expected, there should be no address + calculations outside the mov insns. */ +/* { dg-do compile { target "sh*-*-*" } } */ +/* { dg-options "-O1" } */ +/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } } */ +/* { dg-final { scan-assembler-not "add|sub" } } */ + +void +testfunc_00 (const short* ap, short* bp, short val) +{ + bp[0] = ap[15]; + bp[2] = ap[5]; + bp[9] = ap[7]; + bp[0] = ap[15]; + bp[4] = val; + bp[14] = val; +} + +void +testfunc_01 (volatile const short* ap, volatile short* bp, short val) +{ + bp[0] = ap[15]; + bp[2] = ap[5]; + bp[9] = ap[7]; + bp[0] = ap[15]; + bp[4] = val; + bp[14] = val; +} + diff --git a/gcc/testsuite/gcc.target/sh/pr50751-5.c b/gcc/testsuite/gcc.target/sh/pr50751-5.c new file mode 100644 index 00000000000..48d5403b2d4 --- /dev/null +++ b/gcc/testsuite/gcc.target/sh/pr50751-5.c @@ -0,0 +1,27 @@ +/* Check that the mov.w displacement addressing insn is generated and the + base address is adjusted only once. On SH2A this test is skipped because + there is a 4 byte mov.w insn that can handle larger displacements. Thus + on SH2A the base address will not be adjusted in this case. */ +/* { dg-do compile { target "sh*-*-*" } } */ +/* { dg-options "-O1" } */ +/* { dg-skip-if "" { "sh*-*-*" } { "-m5*" "-m2a*" } { "" } } */ +/* { dg-final { scan-assembler-times "add" 2 } } */ + +void +testfunc_00 (const short* ap, short* bp) +{ + bp[0] = ap[15]; + bp[2] = ap[5]; + bp[9] = ap[7]; + bp[0] = ap[25]; +} + +void +testfunc_01 (volatile const short* ap, volatile short* bp) +{ + bp[0] = ap[15]; + bp[2] = ap[5]; + bp[9] = ap[7]; + bp[0] = ap[25]; +} + diff --git a/gcc/testsuite/gcc.target/sh/pr50751-6.c b/gcc/testsuite/gcc.target/sh/pr50751-6.c new file mode 100644 index 00000000000..83fb5abeafe --- /dev/null +++ b/gcc/testsuite/gcc.target/sh/pr50751-6.c @@ -0,0 +1,26 @@ +/* Check that on SH2A the 4 byte mov.w displacement insn is generated to + handle larger displacements. If it is generated correctly, there should + be no base address adjustments outside the mov.w insns. */ +/* { dg-do compile { target "sh*-*-*" } } */ +/* { dg-options "-O1" } */ +/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m2a*" } } */ +/* { dg-final { scan-assembler-not "add|sub" } } */ + +void +testfunc_00 (const short* ap, short* bp) +{ + bp[100] = ap[15]; + bp[200] = ap[50]; + bp[900] = ap[71]; + bp[0] = ap[25]; +} + +void +testfunc_01 (volatile const short* ap, volatile short* bp) +{ + bp[100] = ap[15]; + bp[200] = ap[50]; + bp[900] = ap[71]; + bp[0] = ap[25]; +} + diff --git a/gcc/testsuite/gcc.target/sh/pr50751-7.c b/gcc/testsuite/gcc.target/sh/pr50751-7.c new file mode 100644 index 00000000000..859cba42f61 --- /dev/null +++ b/gcc/testsuite/gcc.target/sh/pr50751-7.c @@ -0,0 +1,35 @@ +/* Check that mov.b and mov.w displacement insns are generated. + If this is working properly, there should be no base address adjustments + outside the mov insns. */ +/* { dg-do compile { target "sh*-*-*" } } */ +/* { dg-options "-O1" } */ +/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } } */ +/* { dg-final { scan-assembler-not "add|sub" } } */ + +typedef struct +{ + char a; + char b; + char c; + char d; + + short e; + short f; + + int g; + int h; +} X; + +void +testfunc_00 (X* x) +{ + x->g = x->b | x->c; + x->h = x->e | x->f; + x->d = x->g; + x->f = x->h; +} + +int testfunc_01 (X* x) +{ + return x->b | x->e | x->g; +} diff --git a/gcc/testsuite/gcc.target/x86_64/abi/avx/test_passing_structs.c b/gcc/testsuite/gcc.target/x86_64/abi/avx/test_passing_structs.c index 9a8f71dbb8f..7dbf6a59bbb 100644 --- a/gcc/testsuite/gcc.target/x86_64/abi/avx/test_passing_structs.c +++ b/gcc/testsuite/gcc.target/x86_64/abi/avx/test_passing_structs.c @@ -53,7 +53,7 @@ avx_test (void) clear_struct_registers; for (i = 0; i < 8; i++) - fregs.ymm0._m256[i] = m256s[i].x; + (&fregs.ymm0)[i]._m256[0] = m256s[i].x; num_fregs = 8; WRAP_CALL (check_struct_passing1)(m256s[0], m256s[1], m256s[2], m256s[3], m256s[4], m256s[5], m256s[6], m256s[7]); diff --git a/gcc/testsuite/gcc.target/x86_64/abi/avx/test_passing_unions.c b/gcc/testsuite/gcc.target/x86_64/abi/avx/test_passing_unions.c index f83209b2767..127dd5f3014 100644 --- a/gcc/testsuite/gcc.target/x86_64/abi/avx/test_passing_unions.c +++ b/gcc/testsuite/gcc.target/x86_64/abi/avx/test_passing_unions.c @@ -113,7 +113,7 @@ avx_test (void) clear_struct_registers; for (i = 0; i < 8; i++) - fregs.ymm0._m256[i] = u1[i].x; + (&fregs.ymm0)[i]._m256[0] = u1[i].x; num_fregs = 8; check_union_passing1(u1[0], u1[1], u1[2], u1[3], u1[4], u1[5], u1[6], u1[7]); @@ -122,7 +122,7 @@ avx_test (void) for (i = 0; i < 8; i++) { u2[i].x = u1[i].x; - fregs.ymm0._m256[i] = u2[i].x; + (&fregs.ymm0)[i]._m256[0] = u2[i].x; } num_fregs = 8; check_union_passing2(u2[0], u2[1], u2[2], u2[3], @@ -132,7 +132,7 @@ avx_test (void) for (i = 0; i < 8; i++) { u3[i].x = u1[i].x; - fregs.ymm0._m256[i] = u3[i].x; + (&fregs.ymm0)[i]._m256[0] = u3[i].x; } num_fregs = 8; check_union_passing3(u3[0], u3[1], u3[2], u3[3], diff --git a/gcc/testsuite/gcc.target/x86_64/abi/test_passing_structs.c b/gcc/testsuite/gcc.target/x86_64/abi/test_passing_structs.c index 299bc80caba..ad6d835ba03 100644 --- a/gcc/testsuite/gcc.target/x86_64/abi/test_passing_structs.c +++ b/gcc/testsuite/gcc.target/x86_64/abi/test_passing_structs.c @@ -216,7 +216,7 @@ main (void) for (i = 0; i < 8; i++) { m128s[i].x = (__m128){32+i, 0, i, 0}; - fregs.xmm0._m128[i] = m128s[i].x; + (&fregs.xmm0)[i]._m128[0] = m128s[i].x; } num_fregs = 8; clear_float_hardware_registers; diff --git a/gcc/testsuite/gcc.target/x86_64/abi/test_passing_unions.c b/gcc/testsuite/gcc.target/x86_64/abi/test_passing_unions.c index 1e3e85fdb50..cff244abb97 100644 --- a/gcc/testsuite/gcc.target/x86_64/abi/test_passing_unions.c +++ b/gcc/testsuite/gcc.target/x86_64/abi/test_passing_unions.c @@ -206,7 +206,7 @@ main (void) for (i = 0; i < 8; i++) { u4[i].x = (__m128){32+i, 0, i, 0}; - fregs.xmm0._m128[i] = u4[i].x; + (&fregs.xmm0)[i]._m128[0] = u4[i].x; } num_fregs = 8; clear_float_hardware_registers; diff --git a/gcc/testsuite/gfortran.dg/block_11.f90 b/gcc/testsuite/gfortran.dg/block_11.f90 new file mode 100644 index 00000000000..83c6519d970 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/block_11.f90 @@ -0,0 +1,68 @@ +! { dg-do link } +! +! PR fortran/52729 +! +! Based on a contribution of Andrew Benson +! +module testMod + type testType + end type testType +contains + subroutine testSub() + implicit none + procedure(double precision ), pointer :: r + class (testType ), pointer :: testObject + double precision :: testVal + + ! Failed as testFunc was BT_UNKNOWN + select type (testObject) + class is (testType) + testVal=testFunc() + r => testFunc + end select + return + end subroutine testSub + + double precision function testFunc() + implicit none + return + end function testFunc +end module testMod + +module testMod2 + implicit none +contains + subroutine testSub() + procedure(double precision ), pointer :: r + double precision :: testVal + ! Failed as testFunc was BT_UNKNOWN + block + r => testFunc + testVal=testFunc() + end block + end subroutine testSub + + double precision function testFunc() + end function testFunc +end module testMod2 + +module m3 + implicit none +contains + subroutine my_test() + procedure(), pointer :: ptr + ! Before the fix, one had the link error + ! "undefined reference to `sub.1909'" + block + ptr => sub + call sub() + end block + end subroutine my_test + subroutine sub(a) + integer, optional :: a + end subroutine sub +end module m3 + +end + +! { dg-final { cleanup-modules "testmod testmod2 m3" } } diff --git a/gcc/testsuite/gfortran.dg/pointer_intent_6.f90 b/gcc/testsuite/gfortran.dg/pointer_intent_6.f90 new file mode 100644 index 00000000000..56c7de5ebba --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pointer_intent_6.f90 @@ -0,0 +1,19 @@ +! { dg-do compile } +! +! PR fortran/52864 +! +! Assigning to an intent(in) pointer (which is valid). +! + program test + type PoisFFT_Solver3D + complex, dimension(:,:,:), & + pointer :: work => null() + end type PoisFFT_Solver3D + contains + subroutine PoisFFT_Solver3D_FullPeriodic(D, p) + type(PoisFFT_Solver3D), intent(in) :: D + real, intent(in), pointer :: p(:) + D%work(i,j,k) = 0.0 + p = 0.0 + end subroutine + end diff --git a/gcc/testsuite/gfortran.dg/pr52621.f90 b/gcc/testsuite/gfortran.dg/pr52621.f90 new file mode 100644 index 00000000000..d305e4db9b6 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr52621.f90 @@ -0,0 +1,20 @@ +! { dg-do compile } +! { dg-options "-O2 -fprefetch-loop-arrays" } + + SUBROUTINE GHDSYM(IZ,IS,LMMAX,S,LMS,Y,L2M,DRL,NLAY2,K0,DCUT)!, +! + COMPLEX Y(L2M,L2M),H(33),S(LMS) + COMPLEX RU,CI,CZ,K0,FF,Z,Z1,Z2,Z3,ST +! + DO 140 KK=1,4 + DO 130 L=1,L2M + L1=L*L-L + DO 120 M=1,L + IPM=L1+M + IMM=L1-M+2 + S(IPM)=S(IPM)+Z3*Y(L,M) + IF (M.NE.1) S(IMM)=S(IMM)+Z3*Y(M-1,L)*CSGN +120 CONTINUE +130 CONTINUE +140 CONTINUE + END diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_comp_34.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_comp_34.f90 new file mode 100644 index 00000000000..031f74418ca --- /dev/null +++ b/gcc/testsuite/gfortran.dg/proc_ptr_comp_34.f90 @@ -0,0 +1,30 @@ +! { dg-do run } +! +! PR 51082: [F03] Wrong result for a pointer to a proc-pointer component +! +! Contributed by Tobias Burnus <burnus@gcc.gnu.org> + +program ala + implicit none + + type process_list + procedure(ala1), pointer, nopass :: process + end type + + type(process_list), target :: p_list + type(process_list), pointer :: p + + p_list%process => ala1 + p => p_list + + write(*,*) p_list%process(1.0) + write(*,*) p%process(1.0) !!!! failed + +contains + + real function ala1(x) + real, intent(in) :: x + ala1 = x + end function + +end program diff --git a/gcc/testsuite/gfortran.dg/public_private_module_3.f90 b/gcc/testsuite/gfortran.dg/public_private_module_3.f90 new file mode 100644 index 00000000000..03f00c200e7 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/public_private_module_3.f90 @@ -0,0 +1,59 @@ +! { dg-do link } +! { dg-additional-sources public_private_module_4.f90 } +! +! PR fortran/52916 +! Cf. PR fortran/40973 +! +! Ensure that PRIVATE specific functions do not get +! marked as TREE_PUBLIC() = 0, if the generic name is +! PUBLIC. +! +module m + interface gen + module procedure bar + end interface gen + + type t + end type t + + interface operator(.myop.) + module procedure my_op + end interface + + interface operator(+) + module procedure my_plus + end interface + + interface assignment(=) + module procedure my_assign + end interface + + private :: bar, my_op, my_plus, my_assign +contains + subroutine bar() + print *, "bar" + end subroutine bar + function my_op(op1, op2) result(res) + type(t) :: res + type(t), intent(in) :: op1, op2 + end function my_op + function my_plus(op1, op2) result(res) + type(t) :: res + type(t), intent(in) :: op1, op2 + end function my_plus + subroutine my_assign(lhs, rhs) + type(t), intent(out) :: lhs + type(t), intent(in) :: rhs + end subroutine my_assign +end module m + +module m2 + type t2 + contains + procedure, nopass :: func => foo + end type t2 + private :: foo +contains + subroutine foo() + end subroutine foo +end module m2 diff --git a/gcc/testsuite/gfortran.dg/public_private_module_4.f90 b/gcc/testsuite/gfortran.dg/public_private_module_4.f90 new file mode 100644 index 00000000000..82600e46b04 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/public_private_module_4.f90 @@ -0,0 +1,23 @@ +! { dg-do compile { target skip-all-targets } } +! +! To be used by public_private_module_3.f90 +! +! PR fortran/52916 +! Cf. PR fortran/40973 +! +! Ensure that PRIVATE specific functions do not get +! marked as TREE_PUBLIC() = 0, if the generic name is +! PUBLIC. +! +use m +use m2 +implicit none + +type(t) :: a, b, c +type(t2) :: x + +call gen() +a = b + (c .myop. a) + +call x%func() +end diff --git a/gcc/testsuite/gfortran.dg/read_float_4.f90 b/gcc/testsuite/gfortran.dg/read_float_4.f90 new file mode 100644 index 00000000000..01a0de8c04f --- /dev/null +++ b/gcc/testsuite/gfortran.dg/read_float_4.f90 @@ -0,0 +1,18 @@ +! { dg-do run } +! +! PR libgfortran/53051 +! +! Check that reading "4.0q0" works, i.e. floating-point +! numbers which use "q" to indicate the exponential. +! (Which is a vendor extension.) +! + character(len=20) :: str + real :: r + integer :: i + + r = 0 + str = '1.0q0' + read(str, *, iostat=i) r + if (r /= 1.0 .or. i /= 0) call abort() + !print *, r + end diff --git a/gcc/testsuite/gfortran.dg/reassoc_10.f b/gcc/testsuite/gfortran.dg/reassoc_10.f new file mode 100644 index 00000000000..698e2c49bb4 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/reassoc_10.f @@ -0,0 +1,17 @@ +! { dg-do compile } +! { dg-options "-O3 -ffast-math -fdump-tree-optimized" } + + SUBROUTINE S55199(P,Q,Dvdph) + implicit none + real(8) :: c1,c2,c3,P,Q,Dvdph + c1=0.1d0 + c2=0.2d0 + c3=0.3d0 + Dvdph = c1 + 2.*P*c2 + 3.*P**2*Q**3*c3 + END + +! There should be five multiplies following un-distribution +! and power expansion. + +! { dg-final { scan-tree-dump-times " \\\* " 5 "optimized" } } +! { dg-final { cleanup-tree-dump "optimized" } } diff --git a/gcc/testsuite/gfortran.dg/reassoc_11.f b/gcc/testsuite/gfortran.dg/reassoc_11.f new file mode 100644 index 00000000000..242201680b3 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/reassoc_11.f @@ -0,0 +1,17 @@ +! { dg-do compile } +! { dg-options "-O3 -ffast-math" } + +! This tests only for compile-time failure, which formerly occurred +! when a __builtin_powi was introduced by reassociation in a bad place. + + SUBROUTINE GRDURBAN(URBWSTR, ZIURB, GRIDHT) + + IMPLICIT NONE + INTEGER :: I + REAL :: SW2, URBWSTR, ZIURB, GRIDHT(87) + + SAVE + + SW2 = 1.6*(GRIDHT(I)/ZIURB)**0.667*URBWSTR**2 + + END diff --git a/gcc/testsuite/gfortran.dg/reassoc_7.f b/gcc/testsuite/gfortran.dg/reassoc_7.f new file mode 100644 index 00000000000..4f70ef6f9dd --- /dev/null +++ b/gcc/testsuite/gfortran.dg/reassoc_7.f @@ -0,0 +1,16 @@ +! { dg-do compile } +! { dg-options "-O3 -ffast-math -fdump-tree-optimized" } + + SUBROUTINE S55199(P,Dvdph) + implicit none + real(8) :: c1,c2,c3,P,Dvdph + c1=0.1d0 + c2=0.2d0 + c3=0.3d0 + Dvdph = c1 + 2.*P*c2 + 3.*P**2*c3 + END + +! There should be two multiplies following un-distribution. + +! { dg-final { scan-tree-dump-times " \\\* " 2 "optimized" } } +! { dg-final { cleanup-tree-dump "optimized" } } diff --git a/gcc/testsuite/gfortran.dg/reassoc_8.f b/gcc/testsuite/gfortran.dg/reassoc_8.f new file mode 100644 index 00000000000..4a6ea72f220 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/reassoc_8.f @@ -0,0 +1,17 @@ +! { dg-do compile } +! { dg-options "-O3 -ffast-math -fdump-tree-optimized" } + + SUBROUTINE S55199(P,Dvdph) + implicit none + real(8) :: c1,c2,c3,P,Dvdph + c1=0.1d0 + c2=0.2d0 + c3=0.3d0 + Dvdph = c1 + 2.*P**2*c2 + 3.*P**3*c3 + END + +! There should be three multiplies following un-distribution +! and power expansion. + +! { dg-final { scan-tree-dump-times " \\\* " 3 "optimized" } } +! { dg-final { cleanup-tree-dump "optimized" } } diff --git a/gcc/testsuite/gfortran.dg/reassoc_9.f b/gcc/testsuite/gfortran.dg/reassoc_9.f new file mode 100644 index 00000000000..53950ee9bc9 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/reassoc_9.f @@ -0,0 +1,17 @@ +! { dg-do compile } +! { dg-options "-O3 -ffast-math -fdump-tree-optimized" } + + SUBROUTINE S55199(P,Dvdph) + implicit none + real(8) :: c1,c2,c3,P,Dvdph + c1=0.1d0 + c2=0.2d0 + c3=0.3d0 + Dvdph = c1 + 2.*P**2*c2 + 3.*P**4*c3 + END + +! There should be three multiplies following un-distribution +! and power expansion. + +! { dg-final { scan-tree-dump-times " \\\* " 3 "optimized" } } +! { dg-final { cleanup-tree-dump "optimized" } } diff --git a/gcc/testsuite/gfortran.dg/typebound_call_23.f03 b/gcc/testsuite/gfortran.dg/typebound_call_23.f03 new file mode 100644 index 00000000000..5baa26179d4 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/typebound_call_23.f03 @@ -0,0 +1,28 @@ +! { dg-do compile } +! +! PR 52968: [OOP] Call to type-bound procedure wrongly rejected +! +! Contributed by Reuben Budiardja <reubendb@gmail.com> + +module SolverModule + + type :: SolverType + class ( EquationTemplate ), pointer :: Equation + end type + + type :: EquationTemplate + contains + procedure, nopass :: Evaluate + end type + +contains + + subroutine Evaluate () + end subroutine + + subroutine Solve + type ( SolverType ) :: S + call S % Equation % Evaluate () + end subroutine + +end module diff --git a/gcc/testsuite/gfortran.dg/vect/rnflow-trs2a2.f90 b/gcc/testsuite/gfortran.dg/vect/rnflow-trs2a2.f90 new file mode 100644 index 00000000000..1d13cea80e0 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/vect/rnflow-trs2a2.f90 @@ -0,0 +1,33 @@ +! { dg-do compile } +! { dg-require-effective-target vect_double } + + function trs2a2 (j, k, u, d, m) +! matrice de transition intermediaire, partant de k sans descendre +! sous j. R = IjU(I-Ik)DIj, avec Ii = deltajj, j >= i. +! alternative: trs2a2 = 0 +! trs2a2 (j:k-1, j:k-1) = matmul (utrsft (j:k-1,j:k-1), +! dtrsft (j:k-1,j:k-1)) +! + real, dimension (1:m,1:m) :: trs2a2 ! resultat + real, dimension (1:m,1:m) :: u, d ! matrices utrsft, dtrsft + integer, intent (in) :: j, k, m ! niveaux vallee pic +! +!##### following line replaced by Prentice to make less system dependent +! real (kind = kind (1.0d0)) :: dtmp + real (kind = selected_real_kind (10,50)) :: dtmp +! + trs2a2 = 0.0 + do iclw1 = j, k - 1 + do iclw2 = j, k - 1 + dtmp = 0.0d0 + do iclww = j, k - 1 + dtmp = dtmp + u (iclw1, iclww) * d (iclww, iclw2) + enddo + trs2a2 (iclw1, iclw2) = dtmp + enddo + enddo + return + end function trs2a2 + +! { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } +! { dg-final { cleanup-tree-dump "vect" } } diff --git a/gcc/testsuite/gnat.dg/aggr11.adb b/gcc/testsuite/gnat.dg/aggr11.adb index 1771d62cacb..12547063c66 100644 --- a/gcc/testsuite/gnat.dg/aggr11.adb +++ b/gcc/testsuite/gnat.dg/aggr11.adb @@ -1,17 +1,17 @@ --- { dg-do compile }
--- { dg-options "-O" }
-
-with Aggr11_Pkg; use Aggr11_Pkg;
-
-procedure Aggr11 is
-
- A : Arr := ((1 => (Kind => No_Error, B => True),
- 2 => (Kind => Error),
- 3 => (Kind => Error),
- 4 => (Kind => No_Error, B => True),
- 5 => (Kind => No_Error, B => True),
- 6 => (Kind => No_Error, B => True)));
-
-begin
- null;
-end;
+-- { dg-do compile } +-- { dg-options "-O" } + +with Aggr11_Pkg; use Aggr11_Pkg; + +procedure Aggr11 is + + A : Arr := ((1 => (Kind => No_Error, B => True), + 2 => (Kind => Error), + 3 => (Kind => Error), + 4 => (Kind => No_Error, B => True), + 5 => (Kind => No_Error, B => True), + 6 => (Kind => No_Error, B => True))); + +begin + null; +end; diff --git a/gcc/testsuite/gnat.dg/aggr11_pkg.ads b/gcc/testsuite/gnat.dg/aggr11_pkg.ads index 37008605a30..139c9efdac6 100644 --- a/gcc/testsuite/gnat.dg/aggr11_pkg.ads +++ b/gcc/testsuite/gnat.dg/aggr11_pkg.ads @@ -1,14 +1,14 @@ -package Aggr11_Pkg is
-
- type Error_Type is (No_Error, Error);
-
- type Rec (Kind : Error_Type := No_Error) is record
- case Kind is
- when Error => null;
- when others => B : Boolean;
- end case;
- end record;
-
- type Arr is array (1..6) of Rec;
-
-end Aggr11_Pkg;
+package Aggr11_Pkg is + + type Error_Type is (No_Error, Error); + + type Rec (Kind : Error_Type := No_Error) is record + case Kind is + when Error => null; + when others => B : Boolean; + end case; + end record; + + type Arr is array (1..6) of Rec; + +end Aggr11_Pkg; diff --git a/gcc/testsuite/gnat.dg/aggr15.adb b/gcc/testsuite/gnat.dg/aggr15.adb index e69e9d346e1..a4eeb231ac2 100644 --- a/gcc/testsuite/gnat.dg/aggr15.adb +++ b/gcc/testsuite/gnat.dg/aggr15.adb @@ -1,18 +1,18 @@ --- { dg-do compile }
--- { dg-options "-gnatws" }
-
-package body Aggr15 is
-
- function CREATE return DATA_T is
- D : DATA_T;
- begin
- return D;
- end;
-
- function ALL_CREATE return ALL_DATA_T is
- C : constant ALL_DATA_T := (others => (others => Create));
- begin
- return C;
- end;
-
-end Aggr15;
+-- { dg-do compile } +-- { dg-options "-gnatws" } + +package body Aggr15 is + + function CREATE return DATA_T is + D : DATA_T; + begin + return D; + end; + + function ALL_CREATE return ALL_DATA_T is + C : constant ALL_DATA_T := (others => (others => Create)); + begin + return C; + end; + +end Aggr15; diff --git a/gcc/testsuite/gnat.dg/aggr15.ads b/gcc/testsuite/gnat.dg/aggr15.ads index 23f26a8df7d..70eb22398ee 100644 --- a/gcc/testsuite/gnat.dg/aggr15.ads +++ b/gcc/testsuite/gnat.dg/aggr15.ads @@ -1,15 +1,15 @@ -package Aggr15 is
-
- type T is tagged record
- I : Integer;
- end record;
-
- type DATA_T is record
- D : T;
- end record;
-
- type ALL_DATA_T is array (1..2, 1..2) of DATA_T;
-
- function ALL_CREATE return ALL_DATA_T;
-
-end Aggr15;
+package Aggr15 is + + type T is tagged record + I : Integer; + end record; + + type DATA_T is record + D : T; + end record; + + type ALL_DATA_T is array (1..2, 1..2) of DATA_T; + + function ALL_CREATE return ALL_DATA_T; + +end Aggr15; diff --git a/gcc/testsuite/gnat.dg/aggr17.adb b/gcc/testsuite/gnat.dg/aggr17.adb index 3ba41985f72..89e385e7983 100644 --- a/gcc/testsuite/gnat.dg/aggr17.adb +++ b/gcc/testsuite/gnat.dg/aggr17.adb @@ -1,28 +1,28 @@ --- { dg-do compile }
--- { dg-options "-gnatws" }
-
-procedure Aggr17 is
-
- type Enum is (A, B);
-
- type Rec (D : Enum := Enum'First) is record
- case D is
- when A => X : Integer;
- when B => null;
- end case;
- end record;
- for Rec'Size use 128;
- pragma Volatile (Rec);
-
- type Config_T (D : Enum := Enum'First) is record
- N : Natural;
- R : Rec (D);
- end record;
-
- C : constant Config_T := (D => A, N => 1, R => (D => A, X => 0));
-
- type Arr is array (Natural range 1 .. C.N) of Boolean;
-
-begin
- null;
-end;
+-- { dg-do compile } +-- { dg-options "-gnatws" } + +procedure Aggr17 is + + type Enum is (A, B); + + type Rec (D : Enum := Enum'First) is record + case D is + when A => X : Integer; + when B => null; + end case; + end record; + for Rec'Size use 128; + pragma Volatile (Rec); + + type Config_T (D : Enum := Enum'First) is record + N : Natural; + R : Rec (D); + end record; + + C : constant Config_T := (D => A, N => 1, R => (D => A, X => 0)); + + type Arr is array (Natural range 1 .. C.N) of Boolean; + +begin + null; +end; diff --git a/gcc/testsuite/gnat.dg/aggr18.adb b/gcc/testsuite/gnat.dg/aggr18.adb index 511add8a17d..6b5281e4164 100644 --- a/gcc/testsuite/gnat.dg/aggr18.adb +++ b/gcc/testsuite/gnat.dg/aggr18.adb @@ -1,28 +1,28 @@ --- { dg-do compile }
--- { dg-options "-gnatws" }
-
-procedure Aggr18 is
-
- type Enum is (A, B);
-
- type Rec (D : Enum := Enum'First) is record
- case D is
- when A => X : Integer;
- when B => null;
- end case;
- end record;
- for Rec'Size use 128;
- pragma Volatile (Rec);
-
- type Config_T (D : Enum := Enum'First) is record
- N : Natural;
- R : Rec (D);
- end record;
-
- C : Config_T := (D => A, N => 1, R => (D => A, X => 0));
-
- type Arr is array (Natural range 1 .. C.N) of Boolean;
-
-begin
- null;
-end;
+-- { dg-do compile } +-- { dg-options "-gnatws" } + +procedure Aggr18 is + + type Enum is (A, B); + + type Rec (D : Enum := Enum'First) is record + case D is + when A => X : Integer; + when B => null; + end case; + end record; + for Rec'Size use 128; + pragma Volatile (Rec); + + type Config_T (D : Enum := Enum'First) is record + N : Natural; + R : Rec (D); + end record; + + C : Config_T := (D => A, N => 1, R => (D => A, X => 0)); + + type Arr is array (Natural range 1 .. C.N) of Boolean; + +begin + null; +end; diff --git a/gcc/testsuite/gnat.dg/array14.adb b/gcc/testsuite/gnat.dg/array14.adb index aed29015a9a..2d45cf10db4 100644 --- a/gcc/testsuite/gnat.dg/array14.adb +++ b/gcc/testsuite/gnat.dg/array14.adb @@ -1,35 +1,35 @@ --- { dg-do compile }
--- { dg-options "-gnatws" }
-
-with Array14_Pkg; use Array14_Pkg;
-
-package body Array14 is
-
- package Nested is
-
- Length : constant SSE.Storage_Count := Length2;
-
- subtype Encoded_Index_Type is SSE.Storage_Count range 1 .. Length;
- subtype Encoded_Type is SSE.Storage_Array (Encoded_Index_Type'Range);
-
- procedure Encode (Input : in Integer; Output : out Encoded_Type);
-
- end;
-
- package body Nested is
-
- procedure Encode (Input : in Integer; Output : out Encoded_Type) is
- begin
- Encode2 (Input, Output);
- end;
-
- end;
-
- procedure Init is
- O : Nested.Encoded_Type;
- for O'Alignment use 4;
- begin
- null;
- end;
-
-end Array14;
+-- { dg-do compile } +-- { dg-options "-gnatws" } + +with Array14_Pkg; use Array14_Pkg; + +package body Array14 is + + package Nested is + + Length : constant SSE.Storage_Count := Length2; + + subtype Encoded_Index_Type is SSE.Storage_Count range 1 .. Length; + subtype Encoded_Type is SSE.Storage_Array (Encoded_Index_Type'Range); + + procedure Encode (Input : in Integer; Output : out Encoded_Type); + + end; + + package body Nested is + + procedure Encode (Input : in Integer; Output : out Encoded_Type) is + begin + Encode2 (Input, Output); + end; + + end; + + procedure Init is + O : Nested.Encoded_Type; + for O'Alignment use 4; + begin + null; + end; + +end Array14; diff --git a/gcc/testsuite/gnat.dg/array14.ads b/gcc/testsuite/gnat.dg/array14.ads index 9d38eeb8895..051a52e56ae 100644 --- a/gcc/testsuite/gnat.dg/array14.ads +++ b/gcc/testsuite/gnat.dg/array14.ads @@ -1,5 +1,5 @@ -package Array14 is
-
- procedure Init;
-
-end Array14;
+package Array14 is + + procedure Init; + +end Array14; diff --git a/gcc/testsuite/gnat.dg/array14_pkg.ads b/gcc/testsuite/gnat.dg/array14_pkg.ads index 804090586e3..7186c5dc82c 100644 --- a/gcc/testsuite/gnat.dg/array14_pkg.ads +++ b/gcc/testsuite/gnat.dg/array14_pkg.ads @@ -1,16 +1,16 @@ -with System.Storage_Elements;
-
-package Array14_Pkg is
-
- package SSE renames System.Storage_Elements;
-
- function Parity_Byte_Count return SSE.Storage_Count;
-
- Length2 : constant SSE.Storage_Count := Parity_Byte_Count;
-
- subtype Encoded_Index_Type2 is SSE.Storage_Count range 1 .. Length2;
- subtype Encoded_Type2 is SSE.Storage_Array (Encoded_Index_Type2'Range);
-
- procedure Encode2 (Input : in Integer; Output : out Encoded_Type2);
-
-end Array14_Pkg;
+with System.Storage_Elements; + +package Array14_Pkg is + + package SSE renames System.Storage_Elements; + + function Parity_Byte_Count return SSE.Storage_Count; + + Length2 : constant SSE.Storage_Count := Parity_Byte_Count; + + subtype Encoded_Index_Type2 is SSE.Storage_Count range 1 .. Length2; + subtype Encoded_Type2 is SSE.Storage_Array (Encoded_Index_Type2'Range); + + procedure Encode2 (Input : in Integer; Output : out Encoded_Type2); + +end Array14_Pkg; diff --git a/gcc/testsuite/gnat.dg/array19.adb b/gcc/testsuite/gnat.dg/array19.adb index 56b05d6490b..8667a3f0650 100644 --- a/gcc/testsuite/gnat.dg/array19.adb +++ b/gcc/testsuite/gnat.dg/array19.adb @@ -1,34 +1,34 @@ --- { dg-do compile }
-
-package body Array19 is
-
- function N return Integer is
- begin
- return 1;
- end;
-
- type Array_Type is array (1 .. N) of Float;
-
- type Enum is (One, Two);
-
- type Rec (D : Enum := Enum'First) is record
- case D is
- when One => null;
- when Two => A : Array_Type;
- end case;
- end record;
-
- procedure Proc is
-
- R : Rec;
-
- function F return Array_Type is
- begin
- return (others => 0.0);
- end F;
-
- begin
- R.A := F;
- end;
-
-end Array19;
+-- { dg-do compile } + +package body Array19 is + + function N return Integer is + begin + return 1; + end; + + type Array_Type is array (1 .. N) of Float; + + type Enum is (One, Two); + + type Rec (D : Enum := Enum'First) is record + case D is + when One => null; + when Two => A : Array_Type; + end case; + end record; + + procedure Proc is + + R : Rec; + + function F return Array_Type is + begin + return (others => 0.0); + end F; + + begin + R.A := F; + end; + +end Array19; diff --git a/gcc/testsuite/gnat.dg/array19.ads b/gcc/testsuite/gnat.dg/array19.ads index 48947f590fa..fa24aae08ac 100644 --- a/gcc/testsuite/gnat.dg/array19.ads +++ b/gcc/testsuite/gnat.dg/array19.ads @@ -1,5 +1,5 @@ -package Array19 is
-
- procedure Proc;
-
-end Array19;
+package Array19 is + + procedure Proc; + +end Array19; diff --git a/gcc/testsuite/gnat.dg/discr27.adb b/gcc/testsuite/gnat.dg/discr27.adb index 875fe435b66..4b77f8efab9 100644 --- a/gcc/testsuite/gnat.dg/discr27.adb +++ b/gcc/testsuite/gnat.dg/discr27.adb @@ -1,33 +1,33 @@ --- { dg-do compile }
-
-package body Discr27 is
-
- subtype Index is Positive range 1..4096;
-
- function F return String is
- S : String(1..1) := (others =>'w');
- begin
- return S;
- end;
-
- type Enum is (One, Two);
-
- type Rec (D : Enum := One; Len : Index := 1) is record
- case D is
- when One => I : Integer;
- when Two => A : String(1..Len);
- end case;
- end record;
-
- procedure Nothing is
- M : constant String := F;
- C : constant Rec := (Two, M'Length, M);
- begin
- null;
- end;
-
- procedure Proc is begin
- null;
- end;
-
-end Discr27;
+-- { dg-do compile } + +package body Discr27 is + + subtype Index is Positive range 1..4096; + + function F return String is + S : String(1..1) := (others =>'w'); + begin + return S; + end; + + type Enum is (One, Two); + + type Rec (D : Enum := One; Len : Index := 1) is record + case D is + when One => I : Integer; + when Two => A : String(1..Len); + end case; + end record; + + procedure Nothing is + M : constant String := F; + C : constant Rec := (Two, M'Length, M); + begin + null; + end; + + procedure Proc is begin + null; + end; + +end Discr27; diff --git a/gcc/testsuite/gnat.dg/discr27.ads b/gcc/testsuite/gnat.dg/discr27.ads index 247134a9916..1d3c4e99979 100644 --- a/gcc/testsuite/gnat.dg/discr27.ads +++ b/gcc/testsuite/gnat.dg/discr27.ads @@ -1,5 +1,5 @@ -package Discr27 is
-
- procedure Proc;
-
-end Discr27;
+package Discr27 is + + procedure Proc; + +end Discr27; diff --git a/gcc/testsuite/gnat.dg/discr35.adb b/gcc/testsuite/gnat.dg/discr35.adb index 8b73773bac0..16bacd6c19b 100644 --- a/gcc/testsuite/gnat.dg/discr35.adb +++ b/gcc/testsuite/gnat.dg/discr35.adb @@ -1,17 +1,17 @@ --- { dg-do compile }
-
-package body Discr35 is
-
- procedure Proc1 is
- R : Rec2 := Null_Rec2;
- begin
- null;
- end;
-
- procedure Proc2 is
- R : Rec2;
- begin
- R := Null_Rec2;
- end;
-
-end Discr35;
+-- { dg-do compile } + +package body Discr35 is + + procedure Proc1 is + R : Rec2 := Null_Rec2; + begin + null; + end; + + procedure Proc2 is + R : Rec2; + begin + R := Null_Rec2; + end; + +end Discr35; diff --git a/gcc/testsuite/gnat.dg/discr35.ads b/gcc/testsuite/gnat.dg/discr35.ads index beb2c40fd9c..7cde6cd66c7 100644 --- a/gcc/testsuite/gnat.dg/discr35.ads +++ b/gcc/testsuite/gnat.dg/discr35.ads @@ -1,25 +1,25 @@ -package Discr35 is
-
- type Rec1 is tagged null record;
-
- type Enum is (One, Two);
-
- type Rec2 (D : Enum := One) is
- record
- case D is
- when One => null;
- when Two => R : Rec1;
- end case;
- end record;
-
- Null_Rec2 : Constant Rec2;
-
- procedure Proc1;
-
- procedure Proc2;
-
-private
-
- Null_Rec2 : Constant Rec2 := (D => One);
-
-end Discr35;
+package Discr35 is + + type Rec1 is tagged null record; + + type Enum is (One, Two); + + type Rec2 (D : Enum := One) is + record + case D is + when One => null; + when Two => R : Rec1; + end case; + end record; + + Null_Rec2 : Constant Rec2; + + procedure Proc1; + + procedure Proc2; + +private + + Null_Rec2 : Constant Rec2 := (D => One); + +end Discr35; diff --git a/gcc/testsuite/gnat.dg/discr6.adb b/gcc/testsuite/gnat.dg/discr6.adb index 441b19bdf29..52a94b1d6ad 100644 --- a/gcc/testsuite/gnat.dg/discr6.adb +++ b/gcc/testsuite/gnat.dg/discr6.adb @@ -1,33 +1,33 @@ --- { dg-do compile }
--- { dg-options "-gnatdm -gnatws" }
-
-with Discr6_Pkg;
-
-procedure Discr6 is
-
- type T_Bit is range 0..1;
- type T_Entier_16 is range -2**15 .. 2**15-1;
-
- package My_Q is new Discr6_Pkg(T_Entier_16);
-
- type T_Valeur is (BIT, Entier_16);
-
- type R(D : T_Valeur) is record
- case D is
- when BIT => V_BIT : T_Bit;
- when Entier_16 => V_E16 : T_Entier_16;
- end case;
- end record;
- for R use record
- V_BIT at 0 range 0..7;
- V_E16 at 0 range 0..15;
- D at 8 range 0..7;
- end record;
- for R'size use 128;
-
- A : R(Entier_16);
- I : Integer;
-
-begin
- I := My_Q.X(A.V_E16);
-end;
+-- { dg-do compile } +-- { dg-options "-gnatdm -gnatws" } + +with Discr6_Pkg; + +procedure Discr6 is + + type T_Bit is range 0..1; + type T_Entier_16 is range -2**15 .. 2**15-1; + + package My_Q is new Discr6_Pkg(T_Entier_16); + + type T_Valeur is (BIT, Entier_16); + + type R(D : T_Valeur) is record + case D is + when BIT => V_BIT : T_Bit; + when Entier_16 => V_E16 : T_Entier_16; + end case; + end record; + for R use record + V_BIT at 0 range 0..7; + V_E16 at 0 range 0..15; + D at 8 range 0..7; + end record; + for R'size use 128; + + A : R(Entier_16); + I : Integer; + +begin + I := My_Q.X(A.V_E16); +end; diff --git a/gcc/testsuite/gnat.dg/discr6_pkg.ads b/gcc/testsuite/gnat.dg/discr6_pkg.ads index 11d713c244d..81404d4613f 100644 --- a/gcc/testsuite/gnat.dg/discr6_pkg.ads +++ b/gcc/testsuite/gnat.dg/discr6_pkg.ads @@ -1,16 +1,16 @@ -generic
-
- type T(<>) is private;
-
-package Discr6_Pkg is
-
- function X (A : T) return Integer;
-
- pragma Interface(C, X);
- pragma IMPORT_FUNCTION (
- INTERNAL => X,
- EXTERNAL => X,
- PARAMETER_TYPES => (T),
- MECHANISM => (Descriptor(S)));
-
-end Discr6_Pkg;
+generic + + type T(<>) is private; + +package Discr6_Pkg is + + function X (A : T) return Integer; + + pragma Interface(C, X); + pragma IMPORT_FUNCTION ( + INTERNAL => X, + EXTERNAL => X, + PARAMETER_TYPES => (T), + MECHANISM => (Descriptor(S))); + +end Discr6_Pkg; diff --git a/gcc/testsuite/gnat.dg/import1.adb b/gcc/testsuite/gnat.dg/import1.adb index 4e4056098b5..6de432dcab4 100644 --- a/gcc/testsuite/gnat.dg/import1.adb +++ b/gcc/testsuite/gnat.dg/import1.adb @@ -1,17 +1,17 @@ --- { dg-do compile }
--- { dg-options "-g" }
-
-package body Import1 is
-
- procedure Create (Bounds : Arr) is
- type Bound_Array is array (Bounds'Range) of Integer;
-
- procedure Proc (Ptr : access Bound_Array);
- pragma Import (C, Proc);
-
- Temp : aliased Bound_Array;
- begin
- Proc (Temp'Access);
- end;
-
-end Import1;
+-- { dg-do compile } +-- { dg-options "-g" } + +package body Import1 is + + procedure Create (Bounds : Arr) is + type Bound_Array is array (Bounds'Range) of Integer; + + procedure Proc (Ptr : access Bound_Array); + pragma Import (C, Proc); + + Temp : aliased Bound_Array; + begin + Proc (Temp'Access); + end; + +end Import1; diff --git a/gcc/testsuite/gnat.dg/import1.ads b/gcc/testsuite/gnat.dg/import1.ads index cb00a0caf40..3afcfcc83da 100644 --- a/gcc/testsuite/gnat.dg/import1.ads +++ b/gcc/testsuite/gnat.dg/import1.ads @@ -1,7 +1,7 @@ -package Import1 is
-
- type Arr is array (Positive range <>) of Integer;
-
- procedure Create (Bounds : Arr);
-
-end Import1;
+package Import1 is + + type Arr is array (Positive range <>) of Integer; + + procedure Create (Bounds : Arr); + +end Import1; diff --git a/gcc/testsuite/gnat.dg/loop_address2.adb b/gcc/testsuite/gnat.dg/loop_address2.adb index aa955d771b2..57bed171ecd 100644 --- a/gcc/testsuite/gnat.dg/loop_address2.adb +++ b/gcc/testsuite/gnat.dg/loop_address2.adb @@ -1,26 +1,26 @@ --- { dg-do compile }
--- { dg-options "-O" }
-
-with System, Ada.Unchecked_Conversion;
-with System.Storage_Elements; use System.Storage_Elements;
-
-procedure Loop_Address2 is
-
- type Ptr is access all Integer;
-
- function To_Ptr is new Ada.Unchecked_Conversion (System.Address, Ptr);
-
- function F (BM : System.Address; I : Integer) return System.Address is
- begin
- return BM + Storage_Offset (4*I);
- end;
-
- B : Integer;
- P : Ptr;
-
-begin
- for I in 0 .. 2 loop
- P := To_Ptr (F (B'Address, I));
- P.all := 0;
- end loop;
-end ;
+-- { dg-do compile } +-- { dg-options "-O" } + +with System, Ada.Unchecked_Conversion; +with System.Storage_Elements; use System.Storage_Elements; + +procedure Loop_Address2 is + + type Ptr is access all Integer; + + function To_Ptr is new Ada.Unchecked_Conversion (System.Address, Ptr); + + function F (BM : System.Address; I : Integer) return System.Address is + begin + return BM + Storage_Offset (4*I); + end; + + B : Integer; + P : Ptr; + +begin + for I in 0 .. 2 loop + P := To_Ptr (F (B'Address, I)); + P.all := 0; + end loop; +end ; diff --git a/gcc/testsuite/gnat.dg/opt7.adb b/gcc/testsuite/gnat.dg/opt7.adb index da3b0e6dfa2..51b56f32bf2 100644 --- a/gcc/testsuite/gnat.dg/opt7.adb +++ b/gcc/testsuite/gnat.dg/opt7.adb @@ -1,44 +1,44 @@ --- { dg-do compile }
--- { dg-options "-Os -g" }
-
-with Opt7_Pkg;
-
-package body Opt7 is
-
- procedure Parse (Str : String;
- Time_Type : out time_t;
- Abs_Time : out Time;
- Delt_Time : out Duration) is
- Year : Year_Number;
- Month : Month_Number;
- Day : Day_Number;
- Minute : Integer := 0;
- Idx : Integer := Str'First;
- Ch : Character := Str (Idx);
- Current_Time : Time;
-
- begin
- if Ch = '-' then
- Time_Type := Absolute_Time;
- Current_Time := Clock;
- Day := Ada.Calendar.Day (Current_Time);
- Month := Ada.Calendar.Month (Current_Time);
- Year := Ada.Calendar.Year (Current_Time);
- else
- Time_Type := Delta_Time;
- end if;
- while Ch in '0' .. '9' loop
- Minute := Minute + Character'Pos (Ch);
- Idx := Idx + 1;
- Ch := Str (Idx);
- end loop;
- if Time_Type = Absolute_Time then
- Abs_Time := Time_Of (Year, Month, Day, Day_Duration (1));
- else
- Delt_Time := Duration (Float (Minute));
- end if;
- exception
- when others => Opt7_Pkg.My_Raise_Exception;
- end;
-
-end Opt7;
+-- { dg-do compile } +-- { dg-options "-Os -g" } + +with Opt7_Pkg; + +package body Opt7 is + + procedure Parse (Str : String; + Time_Type : out time_t; + Abs_Time : out Time; + Delt_Time : out Duration) is + Year : Year_Number; + Month : Month_Number; + Day : Day_Number; + Minute : Integer := 0; + Idx : Integer := Str'First; + Ch : Character := Str (Idx); + Current_Time : Time; + + begin + if Ch = '-' then + Time_Type := Absolute_Time; + Current_Time := Clock; + Day := Ada.Calendar.Day (Current_Time); + Month := Ada.Calendar.Month (Current_Time); + Year := Ada.Calendar.Year (Current_Time); + else + Time_Type := Delta_Time; + end if; + while Ch in '0' .. '9' loop + Minute := Minute + Character'Pos (Ch); + Idx := Idx + 1; + Ch := Str (Idx); + end loop; + if Time_Type = Absolute_Time then + Abs_Time := Time_Of (Year, Month, Day, Day_Duration (1)); + else + Delt_Time := Duration (Float (Minute)); + end if; + exception + when others => Opt7_Pkg.My_Raise_Exception; + end; + +end Opt7; diff --git a/gcc/testsuite/gnat.dg/opt7.ads b/gcc/testsuite/gnat.dg/opt7.ads index c9803532670..99224bf3612 100644 --- a/gcc/testsuite/gnat.dg/opt7.ads +++ b/gcc/testsuite/gnat.dg/opt7.ads @@ -1,12 +1,12 @@ -with Ada.Calendar; use Ada.Calendar;
-
-package Opt7 is
-
- type time_t is (Absolute_Time, Delta_Time);
-
- procedure Parse (Str : String;
- Time_Type : out time_t;
- Abs_Time : out Time;
- Delt_Time : out Duration);
-
-end Opt7;
+with Ada.Calendar; use Ada.Calendar; + +package Opt7 is + + type time_t is (Absolute_Time, Delta_Time); + + procedure Parse (Str : String; + Time_Type : out time_t; + Abs_Time : out Time; + Delt_Time : out Duration); + +end Opt7; diff --git a/gcc/testsuite/gnat.dg/pointer_variable_bounds.adb b/gcc/testsuite/gnat.dg/pointer_variable_bounds.adb index 5cc838a383e..43d683e0420 100644 --- a/gcc/testsuite/gnat.dg/pointer_variable_bounds.adb +++ b/gcc/testsuite/gnat.dg/pointer_variable_bounds.adb @@ -1,26 +1,26 @@ --- { dg-do compile }
--- { dg-options "-gnatws" }
-
-package body pointer_variable_bounds is
-
- function COMPONENT_DAT(BP : in BUNDLE_POINTER_TYPE; CP : in COMP_POINTER_TYPE) return HALF_INTEGER is
- type CP_TYPE is access COMP_POINTER_TYPE;
- type CD_TYPE is access HALF_INTEGER;
- CD : CD_TYPE;
- begin
- return CD.all;
- end;
-
- procedure BUNDLE_DAT(BP : in BUNDLE_POINTER_TYPE) is
- N0 : C_POINTER_TYPE := COMPONENT_DAT(BP, 4);
- begin
- null;
- end;
-
- procedure SEQUENCE_DAT(BP : in BUNDLE_POINTER_TYPE) is
- N0 : C_POINTER_TYPE := COMPONENT_DAT(BP, 4);
- begin
- null;
- end;
-
-end pointer_variable_bounds;
+-- { dg-do compile } +-- { dg-options "-gnatws" } + +package body pointer_variable_bounds is + + function COMPONENT_DAT(BP : in BUNDLE_POINTER_TYPE; CP : in COMP_POINTER_TYPE) return HALF_INTEGER is + type CP_TYPE is access COMP_POINTER_TYPE; + type CD_TYPE is access HALF_INTEGER; + CD : CD_TYPE; + begin + return CD.all; + end; + + procedure BUNDLE_DAT(BP : in BUNDLE_POINTER_TYPE) is + N0 : C_POINTER_TYPE := COMPONENT_DAT(BP, 4); + begin + null; + end; + + procedure SEQUENCE_DAT(BP : in BUNDLE_POINTER_TYPE) is + N0 : C_POINTER_TYPE := COMPONENT_DAT(BP, 4); + begin + null; + end; + +end pointer_variable_bounds; diff --git a/gcc/testsuite/gnat.dg/pointer_variable_bounds.ads b/gcc/testsuite/gnat.dg/pointer_variable_bounds.ads index b18c354077d..39d502ab3ca 100644 --- a/gcc/testsuite/gnat.dg/pointer_variable_bounds.ads +++ b/gcc/testsuite/gnat.dg/pointer_variable_bounds.ads @@ -1,16 +1,16 @@ -with pointer_variable_bounds_q; use pointer_variable_bounds_q;
-
-package pointer_variable_bounds is
-
- type HALF_INTEGER is range -32768 .. 32767;
- subtype HALF_NATURAL is HALF_INTEGER range 0 .. 32767;
-
- MAX_COMPS : constant HALF_NATURAL := HALF_NATURAL(A_MAX_COMPS);
- subtype COMP_POINTER_TYPE is HALF_NATURAL range 0 .. MAX_COMPS;
- subtype BUNDLE_POINTER_TYPE is HALF_NATURAL range 0 .. 1;
- subtype C_POINTER_TYPE is HALF_NATURAL range 0 .. 1;
-
- procedure BUNDLE_DAT(BP : in BUNDLE_POINTER_TYPE);
- procedure SEQUENCE_DAT(BP : in BUNDLE_POINTER_TYPE);
-
-end pointer_variable_bounds;
+with pointer_variable_bounds_q; use pointer_variable_bounds_q; + +package pointer_variable_bounds is + + type HALF_INTEGER is range -32768 .. 32767; + subtype HALF_NATURAL is HALF_INTEGER range 0 .. 32767; + + MAX_COMPS : constant HALF_NATURAL := HALF_NATURAL(A_MAX_COMPS); + subtype COMP_POINTER_TYPE is HALF_NATURAL range 0 .. MAX_COMPS; + subtype BUNDLE_POINTER_TYPE is HALF_NATURAL range 0 .. 1; + subtype C_POINTER_TYPE is HALF_NATURAL range 0 .. 1; + + procedure BUNDLE_DAT(BP : in BUNDLE_POINTER_TYPE); + procedure SEQUENCE_DAT(BP : in BUNDLE_POINTER_TYPE); + +end pointer_variable_bounds; diff --git a/gcc/testsuite/gnat.dg/rep_clause2.adb b/gcc/testsuite/gnat.dg/rep_clause2.adb index b6cd49f9f98..1c26e1255b1 100644 --- a/gcc/testsuite/gnat.dg/rep_clause2.adb +++ b/gcc/testsuite/gnat.dg/rep_clause2.adb @@ -1,10 +1,10 @@ --- { dg-do compile }
-
-package body Rep_Clause2 is
-
- procedure Assign (From : Data; Offset : Positive; I : Index; To : out Bit_Array) is
- begin
- To (Offset .. Offset + 7) := Bit_Array (Conv (From.D(I).S.N));
- end;
-
-end Rep_Clause2;
+-- { dg-do compile } + +package body Rep_Clause2 is + + procedure Assign (From : Data; Offset : Positive; I : Index; To : out Bit_Array) is + begin + To (Offset .. Offset + 7) := Bit_Array (Conv (From.D(I).S.N)); + end; + +end Rep_Clause2; diff --git a/gcc/testsuite/gnat.dg/rep_clause2.ads b/gcc/testsuite/gnat.dg/rep_clause2.ads index cc8b33e8b4c..c4d07236899 100644 --- a/gcc/testsuite/gnat.dg/rep_clause2.ads +++ b/gcc/testsuite/gnat.dg/rep_clause2.ads @@ -1,53 +1,53 @@ -with Unchecked_Conversion;
-
-package Rep_Clause2 is
-
- type Tiny is range 0 .. 3;
- for Tiny'Size use 2;
-
- type Small is range 0 .. 255;
- for Small'Size use 8;
-
- type Small_Data is record
- D : Tiny;
- N : Small;
- end record;
- pragma Pack (Small_Data);
-
- type Chunk is
- record
- S : Small_Data;
- C : Character;
- end record;
-
- for Chunk use record
- S at 0 range 0 .. 15;
- C at 2 range 0 .. 7;
- end record;
-
- type Index is range 1 .. 10;
-
- type Data_Array is array (Index) of Chunk;
- for Data_Array'Alignment use 2;
- pragma Pack (Data_Array);
-
- type Data is record
- D : Data_Array;
- end record;
-
- type Bit is range 0 .. 1;
- for Bit'Size use 1;
-
- type Bit_Array is array (Positive range <>) of Bit;
- pragma Pack (Bit_Array);
-
- type Byte is new Bit_Array (1 .. 8);
- for Byte'Size use 8;
- for Byte'Alignment use 1;
-
- function Conv
- is new Unchecked_Conversion(Source => Small, Target => Byte);
-
- procedure Assign (From : Data; Offset : Positive; I : Index; To : out Bit_Array);
-
-end Rep_Clause2;
+with Unchecked_Conversion; + +package Rep_Clause2 is + + type Tiny is range 0 .. 3; + for Tiny'Size use 2; + + type Small is range 0 .. 255; + for Small'Size use 8; + + type Small_Data is record + D : Tiny; + N : Small; + end record; + pragma Pack (Small_Data); + + type Chunk is + record + S : Small_Data; + C : Character; + end record; + + for Chunk use record + S at 0 range 0 .. 15; + C at 2 range 0 .. 7; + end record; + + type Index is range 1 .. 10; + + type Data_Array is array (Index) of Chunk; + for Data_Array'Alignment use 2; + pragma Pack (Data_Array); + + type Data is record + D : Data_Array; + end record; + + type Bit is range 0 .. 1; + for Bit'Size use 1; + + type Bit_Array is array (Positive range <>) of Bit; + pragma Pack (Bit_Array); + + type Byte is new Bit_Array (1 .. 8); + for Byte'Size use 8; + for Byte'Alignment use 1; + + function Conv + is new Unchecked_Conversion(Source => Small, Target => Byte); + + procedure Assign (From : Data; Offset : Positive; I : Index; To : out Bit_Array); + +end Rep_Clause2; diff --git a/gcc/testsuite/gnat.dg/slice2.adb b/gcc/testsuite/gnat.dg/slice2.adb index ab73074313e..87c0bcd8790 100644 --- a/gcc/testsuite/gnat.dg/slice2.adb +++ b/gcc/testsuite/gnat.dg/slice2.adb @@ -1,13 +1,13 @@ --- { dg-do compile }
--- { dg-options "-O" }
-
-package body Slice2 is
-
- function F (I : R1) return R2 is
- Val : R2;
- begin
- Val.Text (1 .. 8) := I.Text (1 .. 8);
- return Val;
- end F;
-
-end Slice2;
+-- { dg-do compile } +-- { dg-options "-O" } + +package body Slice2 is + + function F (I : R1) return R2 is + Val : R2; + begin + Val.Text (1 .. 8) := I.Text (1 .. 8); + return Val; + end F; + +end Slice2; diff --git a/gcc/testsuite/gnat.dg/slice2.ads b/gcc/testsuite/gnat.dg/slice2.ads index f1b8674fb8e..d1f943a80cf 100644 --- a/gcc/testsuite/gnat.dg/slice2.ads +++ b/gcc/testsuite/gnat.dg/slice2.ads @@ -1,14 +1,14 @@ -package Slice2 is
-
- type R1 is record
- Text : String (1 .. 30);
- end record;
-
- type R2 is record
- Text : String (1 .. 8);
- B : Boolean := True;
- end record;
-
- function F (I : R1) return R2;
-
-end Slice2;
+package Slice2 is + + type R1 is record + Text : String (1 .. 30); + end record; + + type R2 is record + Text : String (1 .. 8); + B : Boolean := True; + end record; + + function F (I : R1) return R2; + +end Slice2; diff --git a/gcc/testsuite/gnat.dg/slice6.adb b/gcc/testsuite/gnat.dg/slice6.adb index 8d96bbf8cf3..de71ac608ef 100644 --- a/gcc/testsuite/gnat.dg/slice6.adb +++ b/gcc/testsuite/gnat.dg/slice6.adb @@ -1,23 +1,23 @@ --- { dg-do compile }
--- { dg-options "-gnatws" }
-
-with Slice6_Pkg; use Slice6_Pkg;
-
-procedure Slice6 is
-
- procedure Send (V_LENGTH : SHORT_INTEGER) is
-
- V : Integer;
-
- V_BLOCK : T_BLOCK (1 .. 4096);
- for V_BLOCK use at V'Address;
-
- V_MSG : T_MSG ;
-
- begin
- V_MSG := (V_LENGTH, 1, V_BLOCK (1 .. V_LENGTH));
- end;
-
-begin
- null;
-end;
+-- { dg-do compile } +-- { dg-options "-gnatws" } + +with Slice6_Pkg; use Slice6_Pkg; + +procedure Slice6 is + + procedure Send (V_LENGTH : SHORT_INTEGER) is + + V : Integer; + + V_BLOCK : T_BLOCK (1 .. 4096); + for V_BLOCK use at V'Address; + + V_MSG : T_MSG ; + + begin + V_MSG := (V_LENGTH, 1, V_BLOCK (1 .. V_LENGTH)); + end; + +begin + null; +end; diff --git a/gcc/testsuite/gnat.dg/slice6_pkg.ads b/gcc/testsuite/gnat.dg/slice6_pkg.ads index 3154c2959a6..ef2047311a9 100644 --- a/gcc/testsuite/gnat.dg/slice6_pkg.ads +++ b/gcc/testsuite/gnat.dg/slice6_pkg.ads @@ -1,15 +1,15 @@ -package Slice6_Pkg is
-
- subtype LENGTH_RANGE is SHORT_INTEGER range 0 .. 8184;
-
- type T_BLOCK is array (SHORT_INTEGER range <>) of SHORT_SHORT_INTEGER;
- for T_BLOCK'alignment use 4;
-
- type T_MSG (V_LENGTH : LENGTH_RANGE := 0) is
- record
- HEADER : Integer;
- DATAS : T_BLOCK (1 .. V_LENGTH) := (others => 0);
- end record;
- for T_MSG'alignment use 4;
-
-end Slice6_Pkg;
+package Slice6_Pkg is + + subtype LENGTH_RANGE is SHORT_INTEGER range 0 .. 8184; + + type T_BLOCK is array (SHORT_INTEGER range <>) of SHORT_SHORT_INTEGER; + for T_BLOCK'alignment use 4; + + type T_MSG (V_LENGTH : LENGTH_RANGE := 0) is + record + HEADER : Integer; + DATAS : T_BLOCK (1 .. V_LENGTH) := (others => 0); + end record; + for T_MSG'alignment use 4; + +end Slice6_Pkg; diff --git a/gcc/testsuite/gnat.dg/specs/unchecked_union2.ads b/gcc/testsuite/gnat.dg/specs/unchecked_union2.ads index f13421cc474..4ed3493f676 100644 --- a/gcc/testsuite/gnat.dg/specs/unchecked_union2.ads +++ b/gcc/testsuite/gnat.dg/specs/unchecked_union2.ads @@ -1,30 +1,30 @@ --- { dg-do compile }
-
-package Unchecked_Union2 is
-
- type Small_Int is range 0 .. 2**19 - 1;
-
- type R1 (B : Boolean := True) is record
- case B is
- when True => Data1 : Small_Int;
- when False => Data2 : Small_Int;
- end case;
- end record;
-
- for R1 use record
- Data1 at 0 range 0 .. 18;
- Data2 at 0 range 0 .. 18;
- end record;
- for R1'Size use 24;
-
- pragma Unchecked_Union (R1);
-
- type R2 is record
- Data : R1;
- end record;
-
- for R2 use record
- Data at 0 range 3 .. 26;
- end record;
-
-end Unchecked_Union2;
+-- { dg-do compile } + +package Unchecked_Union2 is + + type Small_Int is range 0 .. 2**19 - 1; + + type R1 (B : Boolean := True) is record + case B is + when True => Data1 : Small_Int; + when False => Data2 : Small_Int; + end case; + end record; + + for R1 use record + Data1 at 0 range 0 .. 18; + Data2 at 0 range 0 .. 18; + end record; + for R1'Size use 24; + + pragma Unchecked_Union (R1); + + type R2 is record + Data : R1; + end record; + + for R2 use record + Data at 0 range 3 .. 26; + end record; + +end Unchecked_Union2; diff --git a/gcc/testsuite/gnat.dg/taft_type2.adb b/gcc/testsuite/gnat.dg/taft_type2.adb index c855ab6e967..3a7a318cf6a 100644 --- a/gcc/testsuite/gnat.dg/taft_type2.adb +++ b/gcc/testsuite/gnat.dg/taft_type2.adb @@ -1,22 +1,22 @@ --- { dg-do compile }
--- { dg-options "-g" }
-
-with Taft_Type2_Pkg; use Taft_Type2_Pkg;
-
-package body Taft_Type2 is
-
- procedure Proc is
- A : T;
-
- function F return T is
- My_T : T;
- begin
- My_T := Open;
- return My_T;
- end;
-
- begin
- A := F;
- end;
-
-end Taft_Type2;
+-- { dg-do compile } +-- { dg-options "-g" } + +with Taft_Type2_Pkg; use Taft_Type2_Pkg; + +package body Taft_Type2 is + + procedure Proc is + A : T; + + function F return T is + My_T : T; + begin + My_T := Open; + return My_T; + end; + + begin + A := F; + end; + +end Taft_Type2; diff --git a/gcc/testsuite/gnat.dg/taft_type2.ads b/gcc/testsuite/gnat.dg/taft_type2.ads index 539c1069875..812bc93b946 100644 --- a/gcc/testsuite/gnat.dg/taft_type2.ads +++ b/gcc/testsuite/gnat.dg/taft_type2.ads @@ -1,5 +1,5 @@ -package Taft_Type2 is
-
- procedure Proc;
-
-end Taft_Type2;
+package Taft_Type2 is + + procedure Proc; + +end Taft_Type2; diff --git a/gcc/testsuite/gnat.dg/taft_type2_pkg.ads b/gcc/testsuite/gnat.dg/taft_type2_pkg.ads index 689b3f1a6a8..ffacda289cc 100644 --- a/gcc/testsuite/gnat.dg/taft_type2_pkg.ads +++ b/gcc/testsuite/gnat.dg/taft_type2_pkg.ads @@ -1,12 +1,12 @@ -package Taft_Type2_Pkg is
-
- type T is private;
-
- function Open return T;
-
-private
-
- type Buffer_T;
- type T is access Buffer_T;
-
-end Taft_Type2_Pkg;
+package Taft_Type2_Pkg is + + type T is private; + + function Open return T; + +private + + type Buffer_T; + type T is access Buffer_T; + +end Taft_Type2_Pkg; diff --git a/gcc/testsuite/gnat.dg/volatile10.adb b/gcc/testsuite/gnat.dg/volatile10.adb index 5f295b96644..945d562d570 100644 --- a/gcc/testsuite/gnat.dg/volatile10.adb +++ b/gcc/testsuite/gnat.dg/volatile10.adb @@ -1,10 +1,10 @@ --- { dg-do compile }
-
-with Volatile10_Pkg; use Volatile10_Pkg;
-
-procedure Volatile10 is
- N : Num;
-begin
- N := F.N1;
- N := F.N2;
-end;
+-- { dg-do compile } + +with Volatile10_Pkg; use Volatile10_Pkg; + +procedure Volatile10 is + N : Num; +begin + N := F.N1; + N := F.N2; +end; diff --git a/gcc/testsuite/gnat.dg/volatile10_pkg.ads b/gcc/testsuite/gnat.dg/volatile10_pkg.ads index 3ad2a79635c..2bdd4104618 100644 --- a/gcc/testsuite/gnat.dg/volatile10_pkg.ads +++ b/gcc/testsuite/gnat.dg/volatile10_pkg.ads @@ -1,29 +1,29 @@ -package Volatile10_Pkg is
-
- type Num is mod 2**9;
-
- type Rec is record
- B1 : Boolean;
- N1 : Num;
- B2 : Boolean;
- N2 : Num;
- B3 : Boolean;
- B4 : Boolean;
- B5 : Boolean;
- B6 : Boolean;
- B7 : Boolean;
- B8 : Boolean;
- B9 : Boolean;
- B10 : Boolean;
- B11 : Boolean;
- B12 : Boolean;
- B13 : Boolean;
- B14 : Boolean;
- end record;
- pragma Pack (Rec);
- for Rec'Size use 32;
- pragma Volatile(Rec);
-
- function F return Rec;
-
-end Volatile10_Pkg;
+package Volatile10_Pkg is + + type Num is mod 2**9; + + type Rec is record + B1 : Boolean; + N1 : Num; + B2 : Boolean; + N2 : Num; + B3 : Boolean; + B4 : Boolean; + B5 : Boolean; + B6 : Boolean; + B7 : Boolean; + B8 : Boolean; + B9 : Boolean; + B10 : Boolean; + B11 : Boolean; + B12 : Boolean; + B13 : Boolean; + B14 : Boolean; + end record; + pragma Pack (Rec); + for Rec'Size use 32; + pragma Volatile(Rec); + + function F return Rec; + +end Volatile10_Pkg; diff --git a/gcc/testsuite/go.test/go-test.exp b/gcc/testsuite/go.test/go-test.exp index c55924431d3..943a7f1a1a7 100644 --- a/gcc/testsuite/go.test/go-test.exp +++ b/gcc/testsuite/go.test/go-test.exp @@ -217,6 +217,13 @@ proc go-set-goarch { } { return "" } } + "powerpc*-*-*" { + if [check_effective_target_ilp32] { + set goarch "ppc" + } else { + set goarch "ppc64" + } + } "sparc*-*-*" { if [check_effective_target_ilp32] { set goarch "sparc" @@ -302,7 +309,7 @@ proc go-gc-tests { } { } # Handle certain tests in a target-dependant way. - if { [istarget "alpha*-*-*"] || [istarget "sparc*-*-solaris*"] } { + if { [istarget "alpha*-*-*"] || [istarget "sparc*-*-solaris*"] || [istarget "powerpc*-*-*"] } { if { [string match "*go.test/test/nilptr.go" $test] } { untested $test continue diff --git a/gcc/testsuite/lib/plugin-support.exp b/gcc/testsuite/lib/plugin-support.exp index 7d04bf17fc0..fcbbb675c58 100644 --- a/gcc/testsuite/lib/plugin-support.exp +++ b/gcc/testsuite/lib/plugin-support.exp @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Free Software Foundation, Inc. +# Copyright (C) 2009, 2010, 2012 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -70,7 +70,8 @@ proc plugin-test-execute { plugin_src plugin_tests } { set base [file rootname $basename] set plugin_lib $base.so - verbose "Test the plugin $basename" 1 + set testcase [dg-trim-dirname $srcdir $plugin_src] + verbose "Test the plugin $testcase" 1 # Build the plugin itself set extra_flags [plugin-get-options $plugin_src] @@ -113,8 +114,12 @@ proc plugin-test-execute { plugin_src plugin_tests } { set_ld_library_path_env_vars if { $status != 0 } then { - unresolved "$basename compilation, $optstr" + fail "$testcase compilation" + # Strictly, this is wrong: the tests compiled with the plugin should + # become unresolved instead. return + } else { + pass "$testcase compilation" } # Compile the input source files with the plugin diff --git a/gcc/testsuite/lib/prune.exp b/gcc/testsuite/lib/prune.exp index 68a77b6ac48..60a4bd4b994 100644 --- a/gcc/testsuite/lib/prune.exp +++ b/gcc/testsuite/lib/prune.exp @@ -17,6 +17,11 @@ # Prune messages from gcc that aren't useful. +if ![info exists TEST_ALWAYS_FLAGS] { + set TEST_ALWAYS_FLAGS "" +} +set TEST_ALWAYS_FLAGS "-fno-diagnostics-show-caret $TEST_ALWAYS_FLAGS" + proc prune_gcc_output { text } { #send_user "Before:$text\n" |