diff options
Diffstat (limited to 'gcc-4.6/gcc/testsuite')
239 files changed, 6158 insertions, 139 deletions
diff --git a/gcc-4.6/gcc/testsuite/ChangeLog b/gcc-4.6/gcc/testsuite/ChangeLog index b45862434..d0a8456cd 100644 --- a/gcc-4.6/gcc/testsuite/ChangeLog +++ b/gcc-4.6/gcc/testsuite/ChangeLog @@ -1,12 +1,866 @@ -2011-08-08 Martin Jambor <mjambor@suse.cz> +2012-01-06 Richard Sandiford <richard.sandiford@linaro.org> + + PR middle-end/48660 + * g++.dg/pr48660.C: New test. + +2012-01-06 Eric Botcazou <ebotcazou@adacore.com> + + * ada/acats/overflow.lst: Add cb20004. + +2012-01-05 Eric Botcazou <ebotcazou@adacore.com> + + * gcc.c-torture/execute/20120104-1.c: New test. + +2012-01-04 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/49651 + * gcc.dg/tree-ssa/pta-ptrarith-1.c: Adjust. + * gcc.dg/tree-ssa/pta-ptrarith-2.c: Likewise. + +2012-01-03 Richard Guenther <rguenther@suse.de> + + Backport from mainline + 2011-11-10 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/51042 + * gcc.dg/torture/pr51042.c: New testcase. + +2012-01-03 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/51070 + * gcc.dg/torture/pr51070.c: New testcase. + * gcc.dg/torture/pr51070-2.c: Likewise. + +2011-12-20 Dodji Seketeli <dodji@redhat.com> + + PR debug/49951 + * g++.dg/gcov/gcov-2.C: Adjust. + +2012-01-01 Thomas König <tkoenig@gcc.gnu.org> + + Backport from trunk + PR fortran/51502 + * lib/gcc-dg.exp (scan-module-absence): New function. + * gfortran.dg/implicit_pure_2.f90: New test. + +2011-12-28 Michael Meissner <meissner@linux.vnet.ibm.com> + + Backport from mainline + 2011-12-28 Michael Meissner <meissner@linux.vnet.ibm.com> + + PR target/51623 + * gcc.target/powerpc/pr51623.c: New file. + +2011-12-28 Uros Bizjak <ubizjak@gmail.com> + + * gcc.dg/torture/pr50396.c: Use dg-add-options ieee. + +2011-12-23 Richard Guenther <rguenther@suse.de> + + PR rtl-optimization/50396 + * gcc.dg/torture/pr50396.c: New testcase. + +2011-12-22 Doug Kwan <dougkwan@google.com> + + Backport from mainline + 2011-11-20 Joey Ye <joey.ye@arm.com> + + * gcc.dg/volatile-bitfields-1.c: New. + +2011-12-21 Richard Earnshaw <rearnsha@arm.com> + + PR target/51643 + * gcc.target/arm/sibcall-2.c: New test. + +2011-12-19 Martin Jambor <mjambor@suse.cz> + + PR tree-optimization/51583 + * gcc.dg/tree-ssa/pr51583.c: New test. + +2011-12-16 Jason Merrill <jason@redhat.com> + + PR c++/51416 + * g++.dg/cpp0x/auto31.C: New. + +2011-12-16 Jason Merrill <jason@redhat.com> + + PR c++/51331 + * g++.dg/init/value10.C: New. + +2011-12-15 H.J. Lu <hongjiu.lu@intel.com> + + Backport from mainline. + 2011-10-28 Chung-Lin Tang <cltang@codesourcery.com> + + PR rtl-optimization/49720 + * g++.dg/torture/pr49720.C: New test. + +2011-12-14 Jason Merrill <jason@redhat.com> + + PR c++/51248 + * g++.dg/other/enum2.C: New. + +2011-12-13 Jason Merrill <jason@redhat.com> + + PR c++/51406 + PR c++/51161 + * g++.dg/cpp0x/rv-cast3.C: New. + * g++.dg/cpp0x/rv-cast4.C: New. + +2011-12-12 Jakub Jelinek <jakub@redhat.com> + + PR testsuite/51511 + * gcc.dg/pr45819.c: Add -w to dg-options. + + Backported from mainline + 2011-12-11 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/51485 + * g++.dg/vect/pr51485.cc: New test. + +2011-12-12 Eric Botcazou <ebotcazou@adacore.com> + + * gcc.c-torture/execute/20111212-1.c: New test. + +2011-12-11 Tobias Burnus <burnus@net-b.de> + + PR fortran/50923 + * gfortran.dg/warn_function_without_result_2.f90: New. + +2011-12-11 Thomas Koenig <tkoenig@gcc.gnu.org> + + PR fortran/51338 + Backport from trunk + * gfortran.dg/assumed_charlen_substring_1.f90: New test. + +2011-12-09 Jakub Jelinek <jakub@redhat.com> + + Backport from mainline + 2011-12-08 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/51466 + * gcc.c-torture/execute/pr51466.c: New test. + + 2011-11-28 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/50078 + * gcc.dg/pr50078.c: New test. + +2011-12-09 Kazu Hirata <kazu@codesourcery.com> + + Backport from mainline: + + 2011-12-05 Kazu Hirata <kazu@codesourcery.com> + + PR target/51408 + * gcc.dg/pr51408.c: New. + +2011-12-08 Tobias Burnus <burnus@net-b.de> + + PR fortran/51448 + * gfortran.dg/realloc_on_assign_8.f90: New. + +2011-12-08 Teresa Johnson <tejohnson@google.com> + + * gcc.target/i386/movdi-rex64.c: Remove unnecessary + unused label. + +2011-12-08 Teresa Johnson <tejohnson@google.com> + + * gcc.target/i386/movdi-rex64.c: Remove unnecessary + -Wwrite-strings option. + +2011-12-08 Teresa Johnson <tejohnson@google.com> + + * gcc.target/i386/movdi-rex64.c: New. + +2011-12-08 Jakub Jelinek <jakub@redhat.com> + + Backport from mainline + 2011-12-05 Jakub Jelinek <jakub@redhat.com> + + PR debug/51410 + * gcc.dg/debug/dwarf2/pr51410.c: New test. + + PR c/51339 + * gcc.dg/gomp/pr51339.c: New test. + + 2011-12-05 Jakub Jelinek <jakub@redhat.com> + Eric Botcazou <ebotcazou@adacore.com> + + PR middle-end/51323 + PR middle-end/50074 + * gcc.c-torture/execute/pr51323.c: New test. + + 2011-11-30 Jakub Jelinek <jakub@redhat.com> + + PR rtl-optimization/48721 + * gcc.target/i386/pr48721.c: New test. + +2011-12-08 Eric Botcazou <ebotcazou@adacore.com> + + * gcc.c-torture/execute/20111208-1.c: New test. + + Backport from mainline + 2011-09-25 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/frame_overflow.ads: New. + * gnat.dg/frame_overflow.adb: Adjust. + * gnat.dg/specs/addr1.ads: Likewise. + +2011-12-06 Tobias Burnus <burnus@net-b.de> + + PR fortran/51435 + * gfortran.dg/default_initialization_5.f90: New. + +2011-12-06 Martin Jambor <mjambor@suse.cz> + + PR tree-optimization/50622 + * g++.dg/tree-ssa/pr50622.C: New test. + +2011-12-04 Uros Bizjak <ubizjak@gmail.com> + Jérémie Detrey <Jeremie.Detrey@loria.fr> + + PR target/51393 + * gcc.target/i386/pr51393.c: New test. + +2011-12-03 Tobias Burnus <burnus@net-b.de> + + PR fortran/50684 + * gfortran.dg/move_alloc_8.f90: New. + +2011-11-25 Tobias Burnus <burnus@net-b.de> + + PR fortran/50408 + * gfortran.dg/whole_file_35.f90: New. + +2011-11-24 Tobias Burnus <burnus@net-b.de> + + PR fortran/51218 + * resolve.c (pure_subroutine): If called subroutine is + impure, unset implicit_pure. + (resolve_function): Move impure check to simplify code. + +2011-11-22 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/51265 + * g++.dg/cpp0x/decltype36.C: New. + +2011-11-19 Eric Botcazou <ebotcazou@adacore.com> + + * gcc.dg/delay-slot-2.c: New test. + +2011-11-18 Joseph Myers <joseph@codesourcery.com> + + * gcc.dg/cpp/assert4.c: Test __linux__, not __gnu_linux__. + +2011-11-18 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/51150 + * g++.dg/cpp0x/pr51150.C: New. + +2011-11-16 Richard Earnshaw <rearnsha@arm.com> + Bernd Schmidt <bernds@coudesourcery.com> + Sebastian Huber <sebastian.huber@embedded-brains.de> + + PR target/49641 + * gcc.target/arm/pr49641.c: New test. + +2011-11-10 Jakub Jelinek <jakub@redhat.com> + + PR middle-end/51077 + * gcc.c-torture/compile/pr51077.c: New test. + +2011-11-07 Jason Merrill <jason@redhat.com> + + PR c++/50870 + * g++.dg/cpp0x/decltype35.C: New. + +2011-11-04 Eric Botcazou <ebotcazou@adacore.com> + + * g++.dg/other/offsetof7.C: New test. + +2011-11-02 Bernd Schmidt <bernds@codesourcery.com> + + * gcc.c-torture/compile/20110907.c: New file. + +2011-10-29 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/50901 + * g++.dg/cpp0x/pr50901.C: New. + +2011-10-27 Uros Bizjak <ubizjak@gmail.com> + Steven G. Kargl <kargl@gcc.gnu.org> + + PR target/50875 + * gfortran.dg/pr50875.f90: New test. + +2011-10-26 Release Manager + + * GCC 4.6.2 released. + +2011-10-23 Uros Bizjak <ubizjak@gmail.com> + + PR target/50788 + * gcc.target/i386/pr50788.c: New test. + +2011-10-20 Uros Bizjak <ubizjak@gmail.com> + + * gcc.dg/ipa/ipa-sra-2.c: Add dg-require-effective-target + non_strict_align. + * gcc.dg/ipa/ipa-sra-6.c: Ditto. + +2011-10-19 Jason Merrill <jason@redhat.com> + + PR c++/50793 + * g++.dg/init/value9.C: New. + +2011-10-19 Jason Merrill <jason@redhat.com> + + PR c++/50787 + * g++.dg/init/ref20.C: New. + +2011-10-19 Jason Merrill <jason@redhat.com> + + PR c++/50787 + * g++.dg/init/ref20.C: New. + +2011-10-18 Jason Merrill <jason@redhat.com> + + PR c++/50531 + * g++.dg/cpp0x/defaulted32.C: New. + +2011-10-17 Janus Weil <janus@gcc.gnu.org> + + PR fortran/47023 + * gfortran.dg/c_kind_tests_3.f03: New. + +2011-10-15 Janus Weil <janus@gcc.gnu.org> + + PR fortran/50570 + * gfortran.dg/pointer_intent_5.f90: New. + +2011-10-15 Nicola Pero <nicola.pero@meta-innovation.com> + + Backport from mainline + 2011-06-06 Nicola Pero <nicola.pero@meta-innovation.com> + + PR objc-++/48275 + * obj-c++.dg/property/cxx-property-1.mm: New. + * obj-c++.dg/property/cxx-property-2.mm: New. + +2011-10-15 Tobias Burnus <burnus@net-b.de> + + PR fortran/50718 + * trans-expr.c (gfc_conv_procedure_call): Fix -fcheck=pointer + for dummy arguments with VALUE attribute. + +2011-10-14 Richard Guenther <rguenther@suse.de> + + Backport from mainline + 2011-10-14 Richard Guenther <rguenther@suse.de> + + * gcc.dg/torture/pr50723.c: New testcase. + + 2011-10-13 Richard Guenther <rguenther@suse.de> + + * gcc.target/i386/pr50712.c: New testcase. + +2011-10-13 Jason Merrill <jason@redhat.com> + + PR c++/50618 + * g++.dg/init/vbase1.C: New. + +2011-10-12 Janus Weil <janus@gcc.gnu.org> + + PR fortran/50659 + * gfortran.dg/proc_decl_27.f90: New. + +2011-10-12 Paul Koning <pkoning@gcc.gnu.org> + + PR tree-optimization/50189 + * g++.dg/torture/pr50189.C: New testcase. + +2011-10-12 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/50700 + * gcc.dg/builtin-object-size-12.c: New testcase. + +2011-10-12 Joseph Myers <joseph@codesourcery.com> + + PR c/50565 + * gcc.c-torture/compile/pr50565-1.c, + gcc.c-torture/compile/pr50565-2.c: New tests. + +2011-10-11 Jason Merrill <jason@redhat.com> + + * g++.dg/cpp0x/initlist-49216.C: New. + +2011-10-11 Janis Johnson <janisjo@codesourcery.com> + + PR c++/44473 + * g++.dg/dfp/44473-1.C: New test. + * g++.dg/dfp/44473-2.C: New test. + * g++.dg/dfp/mangle-1.C: New test. + * g++.dg/dfp/mangle-2.C: New test. + * g++.dg/dfp/mangle-3.C: New test. + * g++.dg/dfp/mangle-4.C: New test. + * g++.dg/dfp/mangle-5.C: New test. + +2011-10-11 Tobias Burnus <burnus@net-b.de> + + PR fortran/50273 + * gfortran.dg/common_16.f90: New. + +2011-10-07 Janus Weil <janus@gcc.gnu.org> + + PR fortran/50585 + * gfortran.dg/assumed_charlen_arg_2.f90: New. + + PR fortran/50625 + * gfortran.dg/class_46.f03: New. + +2011-10-07 Bernd Schmidt <bernds@codesourcery.com> + + PR target/49049 + * gcc.c-torture/compile/pr49049.c: New test. + +2011-10-06 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/49279 + * gcc.c-torture/execute/pr49279.c: New test. + +2011-10-04 Janus Weil <janus@gcc.gnu.org> + + PR fortran/48706 + * gfortran.dg/extends_12.f03: New. + +2011-09-30 Jakub Jelinek <jakub@redhat.com> + + PR inline-asm/50571 + * gcc.dg/pr50571.c: New test. + +2011-09-26 Jason Merrill <jason@redhat.com> + + PR c++/46105 + * g++.dg/template/partial12.C: New. + + PR c++/50508 + * g++.dg/cpp0x/constexpr-typedef1.C: New. + +2011-09-26 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/50472 + * gcc.dg/torture/pr50472.c: New testcase. + +2011-09-23 Jason Merrill <jason@redhat.com> + + Core 253 + * g++.dg/init/const8.C: New. + * g++.dg/cpp0x/constexpr-object1.C: Add a data member. + * g++.dg/cpp0x/defaulted2.C: Likewise. + * g++.dg/cpp0x/pr42844-2.C: Likewise. + * g++.dg/init/pr42844.C: Likewise. + + * lib/prune.exp: Prune "note"s. + +2011-09-25 Ira Rosen <ira.rosen@linaro.org> + + PR tree-optimization/50413 + * g++.dg/vect/vect.exp: Run slp-pr* tests with + -fdump-tree-slp-details. Run other tests with + -fdump-tree-vect-details. + * g++.dg/vect/slp-pr50413.cc: New. + +2011-09-25 Ira Rosen <ira.rosen@linaro.org> + + PR tree-optimization/50412 + * gfortran.dg/vect/pr50412.f90: New. + +2011-09-22 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/50491 + * g++.dg/cpp0x/pr50491.C: New. + +2011-09-22 Steven G. Kargl <kargl@gcc.gnu.org> + + PR testsuite/50487 + * gfortran.dg/bessel_6.f90: Fix tolerance test. + +2011-09-22 Uros Bizjak <ubizjak@gmail.com> + + PR target/50464 + * g++.dg/other/pr50464.C: New test. + +2011-09-19 Martin Jambor <mjambor@suse.cz> + + PR middle-end/49886 + * gcc.dg/torture/pr49886.c: Remove XFAILs. + * gcc.dg/torture/pr50287.c: New test. + +2011-09-17 Jason Merrill <jason@redhat.com> + + PR c++/50442 + Revert: + PR c++/49267 + * g++.dg/cpp0x/rv-conv1.C: New. + +2011-09-16 Jason Merrill <jason@redhat.com> + + PR c++/50424 + * g++.dg/eh/defarg1.C: New. + +2011-09-13 Dodji Seketeli <dodji@redhat.com> + + PR c++/48320 + * g++.dg/cpp0x/variadic116.C: New test case. + +2011-09-11 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/atomic5.ad[sb]: New test. + +2011-09-08 Martin Jambor <mjambor@suse.cz> + + Backport from mainline + 2011-09-07 Martin Jambor <mjambor@suse.cz> + + PR tree-optimization/49911 + * g++.dg/tree-ssa/pr49911.C: New test. + +2011-09-08 Richard Guenther <rguenther@suse.de> + + Backport from mainline + 2011-07-04 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/49518 + PR tree-optimization/49628 + * g++.dg/torture/pr49628.C: New testcase. + * gcc.dg/torture/pr49518.c: Likewise. + +2011-09-08 Jakub Jelinek <jakub@redhat.com> + + PR target/50310 + * gcc.c-torture/execute/ieee/pr50310.c: New test. + * gcc.dg/pr50310-2.c: New test. + +2011-09-07 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/50309 + * g++.dg/cpp0x/noexcept11.C: New. + +2011-09-06 Michael Meissner <meissner@linux.vnet.ibm.com> + + Backport from trunk + * g++.dg/ext/altivec-17.C: Fix dg-error to match current compiler. + +2011-09-06 Eric Botcazou <ebotcazou@adacore.com> + + * gcc.c-torture/compile/20110906-1.c: New test. + +2011-09-06 Martin Jambor <mjambor@suse.cz> + + * gcc.c-torture/execute/pr49886.c: Move to... + * gcc.dg/torture/pr49886.c: ...here. Xfail run test for -O2 and above. + +2011-09-04 Jason Merrill <jason@redhat.com> + + PR c++/49267 + * g++.dg/cpp0x/rv-conv1.C: New. + +2011-09-05 Jakub Jelinek <jakub@redhat.com> + + * gcc.dg/compat/struct-layout-1_test.h: Decrease bitfield size + to work even with -fshort-enums. + +2011-09-02 Martin Jambor <mjambor@suse.cz> + + PR middle-end/49886 + * gcc.c-torture/execute/pr49886.c: New testcase. + * gfortran.fortran-torture/compile/pr50260.f90: Likewise. + +2011-09-01 Ira Rosen <ira.rosen@linaro.org> + + PR tree-optimization/50178 + * gfortran.dg/vect/pr50178.f90: New test. + +2011-08-29 Jakub Jelinek <jakub@redhat.com> + Jason Merrill <jason@redhat.com> + + * g++.dg/dfp/base.C: New test. + +2011-08-30 Jason Merrill <jason@redhat.com> + + PR c++/50089 + * g++.dg/cpp0x/lambda/lambda-qualified.C: New. + + PR c++/50220 + * g++.dg/cpp0x/lambda/lambda-50220.C: New. + + PR c++/50234 + * g++.dg/cpp0x/constexpr-value3.C: New. + +2011-08-29 Jason Merrill <jason@redhat.com> + + PR c++/50224 + * g++.dg/cpp0x/lambda/lambda-use2.C: New. + +2011-08-29 Thomas Koenig <tkoenig@gcc.gnu.org> + + Backport from trunk + PR libfortran/50192 + * gfortran.dg/widechar_compare_1.f90: New test. + +2011-08-27 Uros Bizjak <ubizjak@gmail.com> + + PR target/50202 + * gcc.target/i386/pr50202.c: New test. + +2011-08-26 Mikael Morin <mikael.morin@gcc.gnu.org> + + PR fortran/50050 + * gfortran.dg/pointer_comp_init_1.f90: New test. + +2011-08-26 Jakub Jelinek <jakub@redhat.com> + + PR c/50179 + * c-c++-common/Wunused-var-14.c: New test. + +2011-08-25 Jason Merrill <jason@redhat.com> + + PR c++/50157 + * g++.dg/cpp0x/sfinae27.C: New. + +2011-08-25 Tobias Burnus <burnus@net-b.de> + + PR fortran/50163 + * gfortran.dg/initialization_28.f90: New. + +2011-08-23 Jason Merrill <jason@redhat.com> + + PR c++/50024 + * g++.dg/cpp0x/constexpr-initlist5.C: New. + +2011-08-23 Jakub Jelinek <jakub@redhat.com> + + PR c++/46862 + * g++.dg/dfp/nofields.C: New test. + +2011-08-22 Mikael Morin <mikael.morin@gcc.gnu.org> + + PR fortran/50050 + * gfortran.dg/alloc_comp_initializer_3.f90: New test. + +2011-08-22 Thomas Koenig <tkoenig@gcc.gnu.org> + + Backport from trunk + PR fortran/50130 + * gfortran.dg/zero_stride_1.f90: New test. + +2011-08-20 Mikael Morin <mikael.morin@sfr.fr> + + PR fortran/50129 + * gfortran.dg/where_3.f90: New test. + +2011-08-20 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/48739 + * gcc.dg/pr48739-1.c: New test. + * gcc.dg/pr48739-2.c: New test. + +2011-08-19 Tobias Burnus <burnus@net-b.de> + + PR fortran/50109 + * gfortran.dg/namelist_73.f90: New. + +2011-08-18 Jakub Jelinek <jakub@redhat.com> + + PR target/50092 + * gcc.dg/torture/pr50092.c: New test. + +2011-08-16 Jason Merrill <jason@redhat.com> + + PR c++/50086 + * g++.dg/cpp0x/variadic-unresolved.C: New. + + PR c++/50054 + * g++.dg/cpp0x/initlist56.C: New. + +2011-08-12 David Li <davidxl@google.com> + + * g++.dg/abi/vbase15.C: New test. + +2011-08-09 Martin Jambor <mjambor@suse.cz> PR middle-end/49923 * gcc.dg/tree-ssa/pr49923.c: New test. +2011-08-05 Jason Merrill <jason@redhat.com> + + PR c++/48993 + * g++.dg/cpp0x/constexpr-48089.C: Add cases. + + PR c++/49921 + * g++.dg/cpp0x/decltype31.C: New. + + PR c++/49669 + * g++.dg/init/array28.C: New. + + PR c++/49988 + * g++.dg/cpp0x/constexpr-non-const-arg3.C: New. + +2011-08-05 Janus Weil <janus@gcc.gnu.org> + + PR fortran/49112 + * gfortran.dg/abstract_type_6.f03: Modified. + * gfortran.dg/typebound_proc_24.f03: New. + +2011-08-03 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/49948 + * gcc.dg/pr49948.c: New test. + +2011-08-03 Daniel Kraft <d@domob.eu> + + PR fortran/49885 + * gfortran.dg/auto_char_dummy_array_3.f90: New test. + +2011-08-02 Jason Merrill <jason@redhat.com> + + PR c++/43886 + * g++.dg/cpp0x/lambda/lambda-defarg2.C: New. + + PR c++/49593 + * g++.dg/cpp0x/variadic115.C: New. + + PR c++/49803 + * g++.dg/cpp0x/union5.C: New. + + PR c++/49924 + * g++.dg/cpp0x/constexpr-array4.C: New. + + PR c++/49260 + * g++.dg/cpp0x/lambda/lambda-eh2.C: Change options. + +2011-07-31 Uros Bizjak <ubizjak@gmail.com> + + PR target/49920 + * gcc.target/i386/pr49920.c: New test. + +2011-07-30 Thomas Koenig <tkoenig@gcc.gnu.org> + + Backport from trunk. + PR fortran/48876 + * gfortran.dg/string_5.f90: New test. + +2011-07-29 Wei Guozhi <carrot@google.com> + + Backported from mainline + 2011-07-29 Wei Guozhi <carrot@google.com> + + PR rtl-optimization/49799 + * gcc.dg/pr49799.c: New test case. + +2011-07-28 Jakub Jelinek <jakub@redhat.com> + + PR debug/49871 + * gcc.dg/debug/dwarf2/pr49871.c: New test. + +2011-07-28 Tobias Burnus <burnus@net-b.de> + + PR fortran/45586 + * gfortran.dg/lto/pr45586-2_0.f90: New. + 2011-07-27 Jeffrey Yasskin <jyasskin@google.com> * g++.old-deja/g++.pt/crash60.C: Updated. +2011-07-27 Jakub Jelinek <jakub@redhat.com> + + PR target/49866 + * gcc.target/i386/pr49866.c: New test. + +2011-07-27 Tobias Burnus <burnus@net-b.de> + + Backported from mainline + 2011-07-23 Tobias Burnus <burnus@net-b.de> + + PR fortran/49791 + * gfortran.dg/namelist_72.f: New. + +2011-07-27 Uros Bizjak <ubizjak@gmail.com> + + * gcc.target/i386/avx-os-support.h: New. + * gcc.target/i386/avx-check.h: Include avx-os-support.h + (main): Check avx_os_support before the test is run. + * gcc.target/i386/aes-avx-check.h: Ditto. + * gcc.target/i386/pclmul-avx-check.h: Ditto. + +2011-07-26 Ira Rosen <ira.rosen@linaro.org> + + * gcc.dg/vect/vect-70.c: Reduce the data size to fit SPU local store. + +2011-07-25 Andrew Pinski <apinski@cavium.com> + + PR tree-opt/49671 + * gcc.dg/tree-ssa/pr49671-1.c: New testcase. + * gcc.dg/tree-ssa/pr49671-2.c: New testcase. + +2011-07-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + PR testsuite/49753 + * g++.dg/torture/pr49309.C: Add -fpreprocessed to dg-options. + + Revert: + 2011-07-15 Jakub Jelinek <jakub@redhat.com> + + PR testsuite/49753 + * g++.dg/torture/pr49309.C: Remove. + +2011-07-23 Janus Weil <janus@gcc.gnu.org> + + PR fortran/49708 + * gfortran.dg/allocate_error_3.f90: New. + +2011-07-22 Uros Bizjak <ubizjak@gmail.com> + + * lib/target-supports.exp (check_ifunc_available): Rewrite. + +2011-07-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + PR debug/47393 + * g++.dg/debug/dwarf2/icf.C: XFAIL some scan-assembler on + mips-sgi-irix*. + +2011-07-22 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/45819 + * gcc.dg/pr45819.c: New testcase. + +2011-07-21 Uros Bizjak <ubizjak@gmail.com> + + * lib/target-supports.exp (check_avx_os_support_available): New. + (check_effective_target_avx_runtime): Use it. + +2011-07-19 Jason Merrill <jason@redhat.com> + + PR c++/49785 + * g++.dg/cpp0x/variadic114.C: New. + +2011-07-19 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/49768 + * gcc.c-torture/execute/pr49768.c: New test. + +2011-07-18 Mikael Morin <mikael.morin@sfr.fr> + + PR fortran/49648 + * gfortran.dg/result_in_spec_4.f90: New test. + +2011-07-18 Jakub Jelinek <jakub@redhat.com> + + PR middle-end/49675 + * gfortran.dg/pr49675.f90: New test. + 2011-07-17 Eric Botcazou <ebotcazou@adacore.com> * gnat.dg/pointer_controlled.adb: New test. diff --git a/gcc-4.6/gcc/testsuite/ChangeLog.google-4_6 b/gcc-4.6/gcc/testsuite/ChangeLog.google-4_6 index 15808132a..01f5e18c8 100644 --- a/gcc-4.6/gcc/testsuite/ChangeLog.google-4_6 +++ b/gcc-4.6/gcc/testsuite/ChangeLog.google-4_6 @@ -1,8 +1,181 @@ -2011-12-05 Jing Yu <jingyu@google.com> +2012-02-10 Wei Guozhi <carrot@google.com> + Backported r183933 from mainline + 2012-02-06 Jakub Jelinek <jakub@redhat.com> + + * gcc.c-torture/execute/pr52129.c: New test. + +2011-01-31 Dehao Chen <dehao@google.com> + + * gcc.dg/predict-1.c: Check if LOOP_IV_COMPARE static predict + heuristic is working properly. + * gcc.dg/predict-2.c: Likewise. + * gcc/dg/predict-3.c: Likewise. + * gcc/dg/predict-4.c: Likewise. + +2012-01-09 DeLesley Hutchins <delesley@google.com> + + * g++.dg/thread-ann/thread_annot_lock-82.C: Update error + message to account for fixed reporting of implicit + destructor calls. + +2012-01-04 Sterling Augustine <saugustine@google.com> + + Backport r182443 from google/main. + + * g++.dg/ext/pretty3.C: Likewise. + * g++.dg/pr44486.C: Likewise. + * g++.dg/warn/Wuninitializable-member.C: Likewise. + * g++.dg/warn/pr35711.C: Likewise. + * g++.old-deja/g++.pt/memtemp77.C: Likewise. + +2011-12-17 Easwaran Raman <eraman@google.com> + Backport r182443 from google/main. + + 2011-12-17 Easwaran Raman <eraman@google.com> + + * g++.dg/other/sized-delete-1.C: New test. + +2011-12-16 Dehao Chen <dehao@google.com> + + * gcc.dg/inline-dump.c: New test. + +2011-11-30 Doug Kwan <dougkwan@google.com> Backport r171347 and r181549 from trunk. 2011-11-20 Joey Ye <joey.ye@arm.com> + * gcc.dg/volatile-bitfields-1.c: New. + +2011-11-18 Diego Novillo <dnovillo@google.com> + + * g++.dg/pr51151.C: New. + +2011-11-18 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/51150 + * g++.dg/cpp0x/pr51150.C: New. + +2011-11-10 DeLesley Hutchins <delesley@google.com> + + * g++.dg/thread-ann/thread_annot_lock-85.C: + New regression test + +2011-11-10 DeLesley Hutchins <delesley@google.com> + + * g++.dg/thread-ann/thread_annot_lock-84.C: + New regression test. + +2011-11-04 DeLesley Hutchins <delesley@google.com> + * g++.dg/thread-ann/thread_annot_lock-82.C: + Expanded regression test + +2011-11-02 Jeffrey Yasskin <jyasskin@google.com> + + Backport from rev 176665 + + 2011-07-22 Jason Merrill <jason@redhat.com> + + PR c++/49793 + * g++.dg/cpp0x/initlist55.C: New. + +2011-10-28 Jeffrey Yasskin <jyasskin@google.com> + + google ref 5514746; backport of r179121 + + Modified locally to only block static const literals in -pedantic + mode. + + * g++.dg/cpp0x/constexpr-static8_nonpedantic.C: New. + + 2011-09-23 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/50258 + * g++.dg/cpp0x/constexpr-static8.C: New. + +2011-10-20 Diego Novillo <dnovillo@google.com> + + * gcc.dg/inline_1.c: Remove expected extra errors. + * gcc.dg/inline_2.c: Likewise. + * gcc.dg/inline_3.c: Likewise. + * gcc.dg/inline_3.c: Likewise. + * gcc.dg/unroll_1.c: Likewise. + * gcc.dg/unroll_2.c: Likewise. + * gcc.dg/unroll_3.c: Likewise. + * gcc.dg/unroll_4.c: Likewise. + + +2011-10-17 Dehao Chen <dehao@google.com> + + * gcc.dg/record-gcc-switches-in-elf-1.c: New test. + +2011-10-14 DeLesley Hutchins <delesley@google.com> + + * g++.dg/thread-ann/thread_annot_lock-83.C: + Added a second regression test to the same file. + +2011-10-14 DeLesley Hutchins <delesley@google.com> + + * g++.dg/thread-ann/thread_annot_lock-83.C: + New regression test + +2011-09-30 Easwaran Raman <eraman@google.com> + + * gcc.dg/sample-profile-generate-1.c: New test. + +2011-09-30 Sriraman Tallam <tmsriram@google.com> + + * testsuite/gcc.dg/builtin_target.c: Remove. + * testsuite/gcc.target/i386/builtin_target.c: New file. + +2011-09-30 Sriraman Tallam <tmsriram@google.com> + + * testsuite/gcc.dg/builtin_target.c: Specify target as ix86 or + x86_64. + +2011-09-30 Sriraman Tallam <tmsriram@google.com> + + * testsuite/g++.dg/tree-prof/callgraph-profiles/C: + Add dg-require-section-exclude. + * testsuite/lib/target-supports.exp (check_ifunc_available): New proc. + * testsuite/lib/target-supports-dg.exp (dg-require-section-exclude): + New proc. + +2011-9-30 DeLesley Hutchins <delesley@google.com> + + * testsuite/g++.dg/thread-ann/thread_annot_lock-82.C: + New regression test. + +2011-09-29 DeLesley Hutchins <delesley@google.com> + + * testsuite/g++.dg/thread-ann/thread_annot_lock-81.C + New regression test. + +2011-09-28 Guozhi Wei <carrot@google.com> + + Backport r178628 from trunk. + 2011-09-07 Jiangning Liu <jiangning.liu@arm.com> + + PR tree-optimization/46021 + * gcc.dg/tree-ssa/20040204-1.c: Don't XFAIL on arm*-*-*. + +2011-09-22 Paolo Carlini <paolo.carlini@oracle.com> + + Backport r179110 from gcc-4_6-branch. + + * g++.dg/cpp0x/pr50491.C: New. + +2011-09-22 Sriraman Tallam <tmsriram@google.com> + + * g++.dg/tree-prof/callgraph-profiles.C: New test. + +2011-9-13 DeLesley Hutchins <delesley@google.com> + + * g++.dg/thread-ann/thread_annot_lock-79.C: new test cases + +2011-09-01 Sriraman Tallam <tmsriram@google.com> + + * gcc.dg/builtin_target.c: New test. + 2011-08-17 Guozhi Wei <carrot@google.com> Backport r177357 from trunk. diff --git a/gcc-4.6/gcc/testsuite/ChangeLog.google-main b/gcc-4.6/gcc/testsuite/ChangeLog.google-main index 1565a1285..248bc621b 100644 --- a/gcc-4.6/gcc/testsuite/ChangeLog.google-main +++ b/gcc-4.6/gcc/testsuite/ChangeLog.google-main @@ -1,3 +1,8 @@ +2012-01-30 Han Shen <shenhan@google.com> + + * gcc.dg/fstack-protector-strong.c: New test. + * g++.dg/fstack-protector-strong.C: New test. + 2011-06-16 Sharad Singhai <singhai@google.com> * testsuite/lib/gcov.exp: Handle intermediate format. diff --git a/gcc-4.6/gcc/testsuite/ada/acats/overflow.lst b/gcc-4.6/gcc/testsuite/ada/acats/overflow.lst index 3685a4d80..fb76ef177 100644 --- a/gcc-4.6/gcc/testsuite/ada/acats/overflow.lst +++ b/gcc-4.6/gcc/testsuite/ada/acats/overflow.lst @@ -14,3 +14,4 @@ c46014a c460008 c460011 c4a012b +cb20004 diff --git a/gcc-4.6/gcc/testsuite/c-c++-common/Wunused-var-14.c b/gcc-4.6/gcc/testsuite/c-c++-common/Wunused-var-14.c new file mode 100644 index 000000000..389febae8 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/c-c++-common/Wunused-var-14.c @@ -0,0 +1,13 @@ +/* PR c/50179 */ +/* { dg-options "-Wunused" } */ +/* { dg-do compile } */ + +void bar (int, ...); + +char * +foo (void) +{ + bar (1, (__extension__ ({ static char b[2]; b[0] = 1; b; }))); + bar (1, ({ static char c[2]; c[0] = 1; c; })); + return ({ static char d[2]; d[0] = 1; d; }); +} diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/auto31.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/auto31.C new file mode 100644 index 000000000..2c74b72df --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/auto31.C @@ -0,0 +1,12 @@ +// PR c++/51416 +// { dg-options "-std=c++0x" } + +template<typename T, typename... U> void foo(T, U... u) +{ + auto foo(u...); // { dg-error "auto" } +} + +void bar() +{ + foo(0); +} diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/constexpr-48089.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/constexpr-48089.C index fc69cfef6..5124f7c7f 100644 --- a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/constexpr-48089.C +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/constexpr-48089.C @@ -22,3 +22,29 @@ struct R { }; constexpr R r; // { dg-bogus "" "" { xfail *-*-* } } + +// Ill-formed (no diagnostic required) +struct T { + int i; + constexpr int f() { return i; } + constexpr T(): i(0) { } + constexpr T(const T& t) : i(f()) { } // { dg-message "" } +}; + +constexpr T t1; +// Ill-formed (diagnostic required) +constexpr T t2(t1); // { dg-error "" } + +// Well-formed +struct U { + int i, j; + constexpr int f(int _i) { return _i; } + constexpr int g() { return i; } + constexpr U(): i(0), j(0) { } + constexpr U(const U& t) : i(f(t.i)),j(0) { } // { dg-bogus "" "" { xfail *-*-* } } + constexpr U(int _i) : i(_i),j(g()) { } // { dg-bogus "" "" { xfail *-*-* } } +}; + +constexpr U u1; +constexpr U u2(u1); // { dg-bogus "" "" { xfail *-*-* } } +constexpr U u3(1); // { dg-bogus "" "" { xfail *-*-* } } diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/constexpr-98.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/constexpr-98.C index 4ae3944c3..1a0189b56 100644 --- a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/constexpr-98.C +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/constexpr-98.C @@ -1,4 +1,4 @@ // { dg-options "-std=c++98" } -constexpr int i = 42; // { dg-message "std=c\\+\\+0x" } +constexpr int i = 42; // { dg-message "std=c\\+\\+11" } // { dg-error "constexpr" "" { target *-*-* } 3 } diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/constexpr-array4.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/constexpr-array4.C new file mode 100644 index 000000000..9aeb75d6b --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/constexpr-array4.C @@ -0,0 +1,14 @@ +// PR c++/49924 +// { dg-options -std=c++0x } + +struct A { constexpr A() { } }; + +struct B { + A array[1]; //non-static member array of a literal type w constexpr ctor + constexpr B() : array{} { } // here is the problem +}; + +int main() +{ + constexpr B b{}; // won't compile +} diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/constexpr-initlist5.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/constexpr-initlist5.C new file mode 100644 index 000000000..97f039998 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/constexpr-initlist5.C @@ -0,0 +1,15 @@ +// PR c++/50024 +// { dg-options -std=c++0x } + +template< class T > +struct Container +{ + Container(){ + int* ptr = new int{}; + } +}; + +int main() { + Container< int > c; +} + diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/constexpr-non-const-arg3.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/constexpr-non-const-arg3.C new file mode 100644 index 000000000..581be6d15 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/constexpr-non-const-arg3.C @@ -0,0 +1,23 @@ +// PR c++/49988 +// { dg-options -std=c++0x } +// { dg-do run } + +template<int ... I> struct X { }; + +struct A { + char data[3]; + template<int ... I> + constexpr + A(const char (&s)[3], X<I...> x) : data{ s[I]...} { } +}; +struct B { + A a; + B(const char (&s)[3]) : a{s,X<0,1,2>{}} { } +}; + +int main() +{ + B b{"12"}; + if (b.a.data[0] != '1') + return 1; +} diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/constexpr-object1.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/constexpr-object1.C index 3af85095f..4ff398bf1 100644 --- a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/constexpr-object1.C +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/constexpr-object1.C @@ -7,7 +7,7 @@ // p 1 constexpr specifier // objects, static const data -struct A1 { }; // { dg-message "no user-provided default constructor" } +struct A1 { int i; }; // { dg-message "no user-provided default constructor" } constexpr int i1 = 1024; constexpr A1 a1 = A1(); diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/constexpr-static8.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/constexpr-static8.C new file mode 100644 index 000000000..35c3f25c5 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/constexpr-static8.C @@ -0,0 +1,7 @@ +// PR c++/50258 +// { dg-options "-std=c++0x -pedantic" } + +struct Foo { + static const double d = 3.14; // { dg-warning "constexpr" } +}; +const double Foo::d; diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/constexpr-static8_nonpedantic.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/constexpr-static8_nonpedantic.C new file mode 100644 index 000000000..28d34a1d7 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/constexpr-static8_nonpedantic.C @@ -0,0 +1,7 @@ +// PR c++/50258 +// { dg-options "-std=c++0x" } + +struct Foo { + static const double d = 3.14; // no warning +}; +const double Foo::d; diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/constexpr-typedef1.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/constexpr-typedef1.C new file mode 100644 index 000000000..2719e3aea --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/constexpr-typedef1.C @@ -0,0 +1,11 @@ +// PR c++/50508 +// { dg-options -std=c++0x } + +template <class T> + struct integral_constant { + typedef T value_type; + constexpr operator value_type() { return true; } + }; + +static constexpr bool value = integral_constant<bool>() + && true; diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/constexpr-value3.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/constexpr-value3.C new file mode 100644 index 000000000..38d89936e --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/constexpr-value3.C @@ -0,0 +1,10 @@ +// PR c++/50234 +// { dg-options -std=c++0x } + +#define SA(X) static_assert((X),#X) + +struct A { int i; }; + +constexpr int f(A a) { return a.i; } + +SA(f({}) == 0); diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/decltype31.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/decltype31.C new file mode 100644 index 000000000..b9817eb9e --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/decltype31.C @@ -0,0 +1,13 @@ +// PR c++/49921 +// { dg-options -std=c++0x } + +struct Local +{ + void f(); +}; + +Local *l; +void (Local::*ptr)(); +decltype((l->*ptr)) i; // { dg-error "member function" } + +// { dg-prune-output "invalid type in declaration" } diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/decltype35.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/decltype35.C new file mode 100644 index 000000000..d1fd47638 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/decltype35.C @@ -0,0 +1,15 @@ +// PR c++/50870 +// { dg-options -std=c++0x } + +template <class V> + struct impl + { + template <class T> static T create(); + }; + +template <class T, class U, class V, class + = decltype(impl<V>::template create<T>() + -> impl<V>::template create<U>())> +struct tester { }; + +tester<impl<float>*, int, float> ti; diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/decltype36.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/decltype36.C new file mode 100644 index 000000000..f3dfed992 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/decltype36.C @@ -0,0 +1,21 @@ +// PR c++/51265 +// { dg-options -std=c++0x } + +struct Funny +{ + int print(int); +}; + +template<typename X> +void c(); + +template<typename X, X ff> +void xx() +{ + c<decltype(ff)>(); +} + +int main() +{ + xx<int(Funny::*)(int), &Funny::print>(); +} diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/defaulted2.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/defaulted2.C index 1f400f4fa..e3aac8f1a 100644 --- a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/defaulted2.C +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/defaulted2.C @@ -17,7 +17,8 @@ void g() = delete; // { dg-error "redefinition" } struct B // { dg-message "user-provided default constructor" } { - B() = default; // { dg-message "not user-provided" } + int i; + B() = default; // { dg-message "not user-provided" } }; const B b; // { dg-error "uninitialized const" } diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/defaulted32.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/defaulted32.C new file mode 100644 index 000000000..351cdae11 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/defaulted32.C @@ -0,0 +1,21 @@ +// PR c++/50531 +// { dg-options -std=c++0x } + +template <typename T> +class DataFilter +{ + public: + inline virtual ~DataFilter(); +}; + +template<typename T> +inline DataFilter<T>::~DataFilter() = default; + +class ARCalculator : public DataFilter<ARCalculator> +{ + public: + virtual void dataStart(int, int); +}; + +void ARCalculator::dataStart(int, int) +{} diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/initlist-49216.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/initlist-49216.C new file mode 100644 index 000000000..4bf608229 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/initlist-49216.C @@ -0,0 +1,6 @@ +// PR c++/49216 +// { dg-options -std=c++0x } + +int main() { + new int[1]{}; +} diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/initlist17.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/initlist17.C index 86371e819..6ea08d150 100644 --- a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/initlist17.C +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/initlist17.C @@ -1,4 +1,4 @@ -// { dg-options "-std=c++0x" } +// { dg-options "-std=c++0x -pedantic-errors" } void f(int i); diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/initlist36.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/initlist36.C index 94624c977..a703b4590 100644 --- a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/initlist36.C +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/initlist36.C @@ -1,5 +1,5 @@ // PR c++/44358 -// { dg-options "-std=c++0x" } +// { dg-options "-std=c++0x -pedantic-errors" } #include <initializer_list> diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/initlist5.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/initlist5.C index 32caac382..dbd17ecbb 100644 --- a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/initlist5.C +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/initlist5.C @@ -1,5 +1,5 @@ // Test for narrowing diagnostics -// { dg-options "-std=c++0x" } +// { dg-options "-std=c++0x -pedantic-errors" } #include <initializer_list> diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/initlist57.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/initlist57.C new file mode 100644 index 000000000..d945a4689 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/initlist57.C @@ -0,0 +1,8 @@ +// PR c++/50054 +// { dg-options -std=c++0x } + +void g( const int& (a)[1] ) {} // { dg-error "array of references" } + +int main () { + g( { 1, 2 } ); // { dg-error "initializer list" } +} diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/initlist7.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/initlist7.C index 7913ed7ed..55a037186 100644 --- a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/initlist7.C +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/initlist7.C @@ -1,5 +1,5 @@ // PR c++/37932 -// { dg-options "-std=c++0x" } +// { dg-options "-std=c++0x -pedantic-errors" } typedef enum { AA=1, BB=2 } my_enum; diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-50220.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-50220.C new file mode 100644 index 000000000..240143cf6 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-50220.C @@ -0,0 +1,9 @@ +// PR c++/50220 +// { dg-options -std=c++0x } + +template<typename Foo> struct Foobar {}; + +void foobar(const Foobar<void>& obj) +{ + [obj](){}(); +} diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-defarg2.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-defarg2.C new file mode 100644 index 000000000..f47c5ba27 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-defarg2.C @@ -0,0 +1,7 @@ +// PR c++/43886 +// { dg-options -std=c++0x } + +void f2() { + int i = 1; + void g5(int = ([]{ return sizeof i; })()); +} diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-eh2.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-eh2.C index 1490a2508..0c94b554f 100644 --- a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-eh2.C +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-eh2.C @@ -1,5 +1,6 @@ // PR c++/47263 -// { dg-options -std=c++0x } +// PR c++/49260 +// { dg-options "-std=c++0x -fno-asynchronous-unwind-tables -fno-dwarf2-cfi-asm" } // { dg-do run } #include <exception> diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-qualified.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-qualified.C new file mode 100644 index 000000000..ef041c2bb --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-qualified.C @@ -0,0 +1,17 @@ +// PR c++/50089 +// { dg-options -std=c++0x } + +struct TestBase +{ + void foo() {} +}; + +struct Test : TestBase +{ + void foo() + { + [this]{ + /*this->*/TestBase::foo(); // ICE without this-> + }(); + } +}; diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-use2.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-use2.C new file mode 100644 index 000000000..695a0b432 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-use2.C @@ -0,0 +1,11 @@ +// PR c++/50224 +// { dg-options "-std=c++0x -Wunused-parameter" } + +struct T; + +void m(T& t) // ERROR here +{ + [&]{ + t; // ``t`` is referenced here + }; +} diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/noexcept11.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/noexcept11.C new file mode 100644 index 000000000..eba2c4080 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/noexcept11.C @@ -0,0 +1,4 @@ +// PR c++/50309 +// { dg-options -std=c++0x } + +void foo () noexcept () { } // { dg-error "expected" } diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/pr42844-2.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/pr42844-2.C index 5af4ff217..4425aacf6 100644 --- a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/pr42844-2.C +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/pr42844-2.C @@ -4,6 +4,7 @@ struct A // { dg-message "user-provided default constructor" } { + int i; A() = default; // { dg-message "not user-provided" } }; @@ -14,17 +15,20 @@ struct Base struct Derived : Base // { dg-message "user-provided default constructor" } { + int i; Derived() = default; // { dg-message "not user-provided" } }; struct Derived2 : Base // { dg-message "user-provided default constructor" } { + int i; Derived2() = default; // { dg-message "not user-provided" } Derived2( Derived2 const& ) = default; }; struct Derived3 : Base // { dg-message "user-provided default constructor" } { + int i; Derived3( Derived3 const& ) = default; Derived3() = default; // { dg-message "not user-provided" } }; diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/pr50491.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/pr50491.C new file mode 100644 index 000000000..48e7a1f74 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/pr50491.C @@ -0,0 +1,17 @@ +// { dg-options "-std=c++0x" } + +struct GrandParent { + void *get(); +}; + +template<class OBJ> +struct Parent : public GrandParent{ +}; + +template<typename T> +struct Child : public Parent<T> { + using GrandParent::get; + void Foo() { + void* ex = get(); + } +}; diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/pr50901.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/pr50901.C new file mode 100644 index 000000000..439c15cc1 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/pr50901.C @@ -0,0 +1,9 @@ +// { dg-options "-std=c++0x" } + +template<class T> int foo(int a) +{ + const unsigned b = a < 0 ? -a : a; + return 0; +} + +int i = foo<float>(1); diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/pr51150.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/pr51150.C new file mode 100644 index 000000000..37eb166b4 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/pr51150.C @@ -0,0 +1,20 @@ +// PR c++/51150 +// { dg-options "-std=c++0x" } + +struct Clock { + double Now(); +}; +template <class T> void Foo(Clock* clock) { + const int now = clock->Now(); +} + +template void Foo<float>(Clock*); + +template <class T> void Boo(int val) { + const int now1 = (double)(val); + const int now2 = const_cast<double>(val); // { dg-error "invalid" } + const int now3 = static_cast<double>(val); + const int now4 = reinterpret_cast<double>(val); // { dg-error "invalid" } +} + +template void Boo<float>(int); diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/rv-cast3.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/rv-cast3.C new file mode 100644 index 000000000..e7d5b6d34 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/rv-cast3.C @@ -0,0 +1,18 @@ +// PR c++/51406 +// { dg-do run } +// { dg-options "-std=c++0x" } + +extern "C" int printf(const char *,...); +extern "C" void abort(); + +struct A { int a; A() : a(1) {} }; +struct B { int b; B() : b(2) {} }; +struct X : A, B {}; + +int main() { + X x; + int a=static_cast<A&&>(x).a; + int b=static_cast<B&&>(x).b; + // printf ("%d %d\n", a, b); + if (a!=1 || b!=2) abort(); +} diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/rv-cast4.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/rv-cast4.C new file mode 100644 index 000000000..8f4a56bf9 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/rv-cast4.C @@ -0,0 +1,13 @@ +// PR c++/51161 +// { dg-options "-std=c++0x" } + +struct A{}; +struct B : A{}; +struct C : A{}; +struct D : B, C{}; + +int main() +{ + D d; + static_cast<A &&>(d); // { dg-error "ambiguous" } +} diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/sfinae27.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/sfinae27.C new file mode 100644 index 000000000..93327ba9c --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/sfinae27.C @@ -0,0 +1,20 @@ +// PR c++/50157 +// { dg-options -std=c++0x } + +template<class T> +T val(); + +template<class T, class Arg, class = + decltype(::new T(val<Arg>())) +> +auto test(int) -> char; + +template<class, class> +auto test(...) -> char (&)[2]; + +struct P { + explicit operator bool(); // (#13) +}; + +typedef decltype(test<bool, P>(0)) type; // OK +typedef decltype(test<float, P>(0)) type2; // Error (#17) diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/union5.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/union5.C new file mode 100644 index 000000000..423b34823 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/union5.C @@ -0,0 +1,23 @@ +// PR c++/49803 +// { dg-options -std=c++0x } + +struct X +{ + X() = delete; +}; + +union Y +{ + // N3291=11-0061 12.6.2/8 says no initialization of + // of other variant members (i.e. m_x) should + // be performed. + Y() : m_char1{ } + { } + + struct + { + char m_char1; + }; + + X m_x; +}; diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/variadic-unresolved.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/variadic-unresolved.C new file mode 100644 index 000000000..a8463de19 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/variadic-unresolved.C @@ -0,0 +1,12 @@ +// PR c++/50086 +// { dg-options -std=c++0x } + +template<typename T> void tfun(); +template<typename T> void fun1(T); +template<typename... Types> void fun2(Types... args); + +int main() +{ + fun1(tfun<int>); // ok + fun2(tfun<int>); // error: unresolved overloaded function type +} diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/variadic103.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/variadic103.C index 6d12331d0..9d6b5ea20 100644 --- a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/variadic103.C +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/variadic103.C @@ -5,7 +5,7 @@ T&& create(); template<class T, class... Args> void test() { - T t(create<Args>()...); // { dg-error "unknown bound" } + T t(create<Args>()...); // { dg-error "incomplete" } (void) t; } diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/variadic114.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/variadic114.C new file mode 100644 index 000000000..3ffede5c5 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/variadic114.C @@ -0,0 +1,27 @@ +// PR c++/49785 +// { dg-options -std=c++0x } + +template <typename, typename ...> struct B { }; +template <typename> class A; + +template <typename R, typename ... S> +struct A <R (S ...)> : public B <R, S ...> +{ + struct C {}; + template <typename D> A (D, C = C ()) { } + R operator () (...); +}; + +template <typename R, typename ... S, typename T> +auto operator >> (A <R (S ...)>, T)->A <R (S ...)> +{ + []() {}; +} + +int +main () +{ + A <int (int, int)> a = [](int, int) {}; + auto b = []{}; + (a >> b) (3, 5); +} diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/variadic115.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/variadic115.C new file mode 100644 index 000000000..fa032e3b0 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/variadic115.C @@ -0,0 +1,19 @@ +// PR c++/49593 +// { dg-options -std=c++0x } + +template<typename... T> void f(T...) { } + +template<typename... Args> +static void +g(Args&&... args) +{ + f( static_cast<Args>(args)... ); + f( (Args)args... ); + f( Args(args)... ); + f( Args{args}... ); +} + +int main() +{ + g(1, '2', 3.0); +} diff --git a/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/variadic116.C b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/variadic116.C new file mode 100644 index 000000000..079d751cb --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/cpp0x/variadic116.C @@ -0,0 +1,32 @@ +// Origin: PR c++/48320 +// { dg-options -std=c++0x } + +template<class... T> +struct tuple +{ + typedef int type; +}; + +template<int... Indices> +struct indices +{ +}; + +template<unsigned i, class Tuple> +struct tuple_element +{ + typedef Tuple type; +}; + +template<class Tuple, + int... Indices, + class Result = tuple<typename tuple_element<Indices, Tuple>::type...> > +Result +f(Tuple&&, indices<Indices...>); + + +void +foo() +{ + f(tuple<int, char, unsigned> (), indices<2, 1, 0> ()); +} diff --git a/gcc-4.6/gcc/testsuite/g++.dg/debug/dwarf2/icf.C b/gcc-4.6/gcc/testsuite/g++.dg/debug/dwarf2/icf.C index af2c112b6..523ee8700 100644 --- a/gcc-4.6/gcc/testsuite/g++.dg/debug/dwarf2/icf.C +++ b/gcc-4.6/gcc/testsuite/g++.dg/debug/dwarf2/icf.C @@ -40,11 +40,11 @@ test2(A* a) // Verify that we get .debug_dcall and .debug_vcall tables generated // and that we see entries for both virtual calls. -// { dg-final { scan-assembler "\\.section.*\.debug_dcall" } } +// { dg-final { scan-assembler "\\.section.*\.debug_dcall" { xfail mips-sgi-irix* } } } // { dg-final { scan-assembler "\\.section.*\.debug_vcall" } } -// { dg-final { scan-assembler "New caller" } } -// { dg-final { scan-assembler "Caller DIE offset" } } +// { dg-final { scan-assembler "New caller" { xfail mips-sgi-irix* } } } +// { dg-final { scan-assembler "Caller DIE offset" { xfail mips-sgi-irix* } } } // { dg-final { scan-assembler "Point of call" } } -// { dg-final { scan-assembler "Callee DIE offset" } } +// { dg-final { scan-assembler "Callee DIE offset" { xfail mips-sgi-irix* } } } // { dg-final { scan-assembler "0\[ \t\]+.*Vtable slot" } } // { dg-final { scan-assembler "0x1\[ \t\]+.*Vtable slot" } } diff --git a/gcc-4.6/gcc/testsuite/g++.dg/dfp/44473-1.C b/gcc-4.6/gcc/testsuite/g++.dg/dfp/44473-1.C new file mode 100644 index 000000000..38689fa16 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/dfp/44473-1.C @@ -0,0 +1,122 @@ +/* { dg-do assemble } */ + +/* Minimized from the testcase in PR c++/44473; mangling of decimal types + did not include CV qualifiers. */ + +namespace std +{ + namespace decimal + { + class decimal32 + { + public: + typedef float __decfloat32 __attribute__ ((mode (SD))); + explicit decimal32 (float __r):__val (__r) {} + private: + __decfloat32 __val; + }; + }; + + template <typename _BI1, typename _BI2> + _BI2 copy_backward (_BI1 __first, _BI2 __result); +} + +namespace __gnu_cxx +{ + template <typename _Iterator, typename _Container> + class __normal_iterator + { + public: + explicit __normal_iterator (const _Iterator & __i) {} + const _Iterator & base () const {} + }; + + template <typename _IteratorL, typename _IteratorR, typename _Container> + bool operator== (const __normal_iterator <_IteratorL, _Container> &__lhs, + const __normal_iterator <_IteratorR, _Container> &__rhs) + { + return __lhs.base () == __rhs.base (); + } + + template <typename _Tp> + class new_allocator + { + public: + typedef _Tp *pointer; + typedef const _Tp *const_pointer; + template <typename _Tp1> + struct rebind + { + typedef new_allocator <_Tp1> other; + }; + }; +} + +namespace std +{ + template <typename _Tp> + class allocator:public __gnu_cxx::new_allocator <_Tp> {}; + + template <typename _Tp, typename _Alloc> + struct _Vector_base + { + typedef typename _Alloc::template rebind <_Tp>::other _Tp_alloc_type; + struct _Vector_impl:public _Tp_alloc_type + { + typename _Tp_alloc_type::pointer _M_finish; + }; + public: _Vector_impl _M_impl; + }; + + template <typename _Tp, typename _Alloc = std::allocator <_Tp> > + class vector:protected _Vector_base <_Tp, _Alloc> + { + typedef _Vector_base <_Tp, _Alloc> _Base; + typedef typename _Base::_Tp_alloc_type _Tp_alloc_type; + public: + typedef _Tp value_type; + typedef typename _Tp_alloc_type::pointer pointer; + typedef typename _Tp_alloc_type::const_pointer const_pointer; + typedef __gnu_cxx::__normal_iterator <pointer, vector> iterator; + typedef __gnu_cxx::__normal_iterator <const_pointer, vector> + const_iterator; + const_iterator begin () const; + iterator end () + { + return iterator (this->_M_impl._M_finish); + } + const_iterator end () const + { + return const_iterator (this->_M_impl._M_finish); + } + bool empty () const + { + return begin () == end (); + } + void push_back (const value_type & __x) + { + _M_insert_aux (end ()); + } + void _M_insert_aux (iterator __position); + }; + + template <typename _Tp, typename _Alloc> + void vector <_Tp, _Alloc>::_M_insert_aux (iterator __position) + { + std::copy_backward (__position.base (), this->_M_impl._M_finish - 1); + } +} + +std::vector <std::decimal::decimal32> vec; + +int +foo () +{ + return (vec.empty ()) ? 1 : 0; +} + +bool +bar () +{ + vec.push_back (std::decimal::decimal32 (0)); +} diff --git a/gcc-4.6/gcc/testsuite/g++.dg/dfp/44473-2.C b/gcc-4.6/gcc/testsuite/g++.dg/dfp/44473-2.C new file mode 100644 index 000000000..311f62299 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/dfp/44473-2.C @@ -0,0 +1,25 @@ +// { dg-do compile } + +// Mangling of classes from std::decimal are special-cased. + +namespace std { + namespace decimal { + class decimal64 { + public: + typedef float __decfloat64 __attribute__ ((mode (DD))); + explicit decimal64 (int __r):__val (__r) {} + private: + __decfloat64 __val; + }; + } +} + +int bar (const std::decimal::decimal64 & x) { } + +int foo () +{ + std::decimal::decimal64 x(0); + bar (x); +} + +// { dg-final { scan-assembler "_Z3barRKDd:" } } diff --git a/gcc-4.6/gcc/testsuite/g++.dg/dfp/base.C b/gcc-4.6/gcc/testsuite/g++.dg/dfp/base.C new file mode 100644 index 000000000..3e5dc50ba --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/dfp/base.C @@ -0,0 +1,23 @@ +// PR c++/50207 +// { dg-do compile } + +namespace std +{ + namespace decimal + { + template <class _Fmt> struct _FmtTraits; + class decimal32; + template <> struct _FmtTraits <decimal32> + { + static const long _NumBytes = 4UL; + }; + template <class _Tr> class _DecBase + { + unsigned char _Bytes[_Tr::_NumBytes]; + }; + class decimal32 : public _DecBase <_FmtTraits <decimal32> > // { dg-error "has base" } + { + decimal32 () { } + }; + } +} diff --git a/gcc-4.6/gcc/testsuite/g++.dg/dfp/mangle-1.C b/gcc-4.6/gcc/testsuite/g++.dg/dfp/mangle-1.C new file mode 100644 index 000000000..455d3e4c0 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/dfp/mangle-1.C @@ -0,0 +1,40 @@ +// { dg-do compile } + +// Mangling of classes from std::decimal are special-cased. +// Derived from g++.dg/abi/mangle13.C. + +namespace std { + namespace decimal { + class decimal64 { + public: + typedef float __decfloat64 __attribute__ ((mode (DD))); + explicit decimal64 (float __r):__val (__r) {} + private: + __decfloat64 __val; + }; + } +} + +struct A { + template <typename T> std::decimal::decimal64 f (); + std::decimal::decimal64 operator+(); + operator std::decimal::decimal64 (); + template <typename T> + std::decimal::decimal64 operator-(); +}; + +typedef std::decimal::decimal64 (A::*P)(); + +template <P> struct S {}; + +template <typename T> void g (S<&T::template f<std::decimal::decimal64> >) {} +template <typename T> void g (S<&T::operator+ >) {} +template <typename T> void g (S<&T::operator std::decimal::decimal64>) {} +template <typename T> void g (S<&T::template operator- <std::decimal::decimal64> >) {} + +template void g<A> (S<&A::f<std::decimal::decimal64> >); +template void g<A> (S<&A::operator+>); +template void g<A> (S<&A::operator std::decimal::decimal64>); + +// { dg-final { scan-assembler "\n?_Z1gI1AEv1SIXadsrT_1fIDdEEE\[: \t\n\]" } } +// { dg-final { scan-assembler "\n?_Z1gI1AEv1SIXadsrT_plEE\[: \t\n\]" } } diff --git a/gcc-4.6/gcc/testsuite/g++.dg/dfp/mangle-2.C b/gcc-4.6/gcc/testsuite/g++.dg/dfp/mangle-2.C new file mode 100644 index 000000000..1af9aa1a0 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/dfp/mangle-2.C @@ -0,0 +1,28 @@ +// { dg-do compile } + +// Mangling of classes from std::decimal are special-cased. +// Derived from g++.dg/abi/mangle15.C. + +namespace std { + namespace decimal { + class decimal64 { + public: + typedef float __decfloat64 __attribute__ ((mode (DD))); + explicit decimal64 (float __r):__val (__r) {} + private: + __decfloat64 __val; + }; + } +} + +struct A { + template <typename T> std::decimal::decimal64 f (); +}; + +typedef std::decimal::decimal64 (A::*P)(); + +template <P> struct S {}; + +void g (S<&A::f<std::decimal::decimal64> >) {} + +// { dg-final { scan-assembler "\n?_Z1g1SIXadL_ZN1A1fIDdEEDdvEEE\[: \t\n\]" } } diff --git a/gcc-4.6/gcc/testsuite/g++.dg/dfp/mangle-3.C b/gcc-4.6/gcc/testsuite/g++.dg/dfp/mangle-3.C new file mode 100644 index 000000000..c716ed0e9 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/dfp/mangle-3.C @@ -0,0 +1,28 @@ +// { dg-do compile } + +// Mangling of classes from std::decimal are special-cased. +// Derived from g++.dg/abi/mangle20-1.C. + +namespace std { + namespace decimal { + class decimal64 { + public: + typedef float __decfloat64 __attribute__ ((mode (DD))); + explicit decimal64 (int __r):__val (__r) {} + private: + __decfloat64 __val; + }; + } +} + +template <int I> void f(std::decimal::decimal64 (*)[2]) {} +template <int I> void g(std::decimal::decimal64 (*)[I+2]) {} + +static const std::decimal::decimal64 I(1); +static const std::decimal::decimal64 J(2); + +template void f<1>(std::decimal::decimal64 (*)[2]); +template void g<1>(std::decimal::decimal64 (*)[3]); + +// { dg-final { scan-assembler "\n_?_Z1fILi1EEvPA2_Dd\[: \t\n\]" } } +// { dg-final { scan-assembler "\n_?_Z1gILi1EEvPAplT_Li2E_Dd\[: \t\n\]" } } diff --git a/gcc-4.6/gcc/testsuite/g++.dg/dfp/mangle-4.C b/gcc-4.6/gcc/testsuite/g++.dg/dfp/mangle-4.C new file mode 100644 index 000000000..899d5661c --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/dfp/mangle-4.C @@ -0,0 +1,35 @@ +// { dg-do compile } + +// Mangling of classes from std::decimal are special-cased. +// Derived from g++.dg/abi/mangle30.C. + +namespace std { + namespace decimal { + class decimal64 { + public: + typedef float __decfloat64 __attribute__ ((mode (DD))); + explicit decimal64 (int __r):__val (__r) {} + private: + __decfloat64 __val; + }; + } +} + +struct A +{ + template <class T> + struct B + { + typedef T myT; + }; +}; + +template <class T> +void f (T t, typename T::template B<std::decimal::decimal64>::myT u, typename T::template B<int>::myT v); + +void foo () +{ + f (A(), std::decimal::decimal64(0), 1); +} + +// { dg-final { scan-assembler "_Z1fI1AEvT_NS1_1BIDdE3myTENS2_IiE3myTE" } } diff --git a/gcc-4.6/gcc/testsuite/g++.dg/dfp/mangle-5.C b/gcc-4.6/gcc/testsuite/g++.dg/dfp/mangle-5.C new file mode 100644 index 000000000..794577f86 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/dfp/mangle-5.C @@ -0,0 +1,29 @@ +// { dg-do compile } + +// Mangling of classes from std::decimal are special-cased. +// Derived from g++.dg/abi/mangle35.C. + +namespace std { + namespace decimal { + class decimal128 { + public: + typedef float __decfloat128 __attribute__ ((mode (TD))); + explicit decimal128 (int __r):__val (__r) {} + private: + __decfloat128 __val; + }; + } +} + +template<void (*)()> struct A {}; + +template<typename> void foo(); + +template<typename T> A<foo<T> > bar(); + +void baz() +{ + bar<std::decimal::decimal128>(); +} + +// { dg-final { scan-assembler "_Z3barIDeE1AIX3fooIT_EEEv" } } diff --git a/gcc-4.6/gcc/testsuite/g++.dg/dfp/nofields.C b/gcc-4.6/gcc/testsuite/g++.dg/dfp/nofields.C new file mode 100644 index 000000000..7234672d4 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/dfp/nofields.C @@ -0,0 +1,19 @@ +// PR c++/46862 +// { dg-do compile } + +namespace std +{ + namespace decimal + { + class decimal32 { }; // { dg-error "does not have any fields" } + class decimal64 { }; // { dg-error "does not have any fields" } + class decimal128 { }; // { dg-error "does not have any fields" } + } +} + +void +foo (std::decimal::decimal32 x, + std::decimal::decimal64 y, + std::decimal::decimal128 z) +{ +} diff --git a/gcc-4.6/gcc/testsuite/g++.dg/eh/defarg1.C b/gcc-4.6/gcc/testsuite/g++.dg/eh/defarg1.C new file mode 100644 index 000000000..5c6e4df49 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/eh/defarg1.C @@ -0,0 +1,10 @@ +// PR c++/50424 +// { dg-do run } + +int f() { throw 1; } +void g( int = f() ) { } +void h() { g(); } +int main() +{ + try { h(); } catch (int) { } +} diff --git a/gcc-4.6/gcc/testsuite/g++.dg/ext/altivec-17.C b/gcc-4.6/gcc/testsuite/g++.dg/ext/altivec-17.C index 54eff8a24..099f8742e 100644 --- a/gcc-4.6/gcc/testsuite/g++.dg/ext/altivec-17.C +++ b/gcc-4.6/gcc/testsuite/g++.dg/ext/altivec-17.C @@ -12,5 +12,5 @@ typedef vector__ bool__ int bool_simd_type; void Foo (bool_simd_type const &a) { - simd_type const &v = a; // { dg-error "'const simd_type&' from expression of type 'const bool_simd_type'" } + simd_type const &v = a; // { dg-error "invalid initialization of reference of type" } } diff --git a/gcc-4.6/gcc/testsuite/g++.dg/ext/pretty3.C b/gcc-4.6/gcc/testsuite/g++.dg/ext/pretty3.C index 01b14579a..e59d77e1e 100644 --- a/gcc-4.6/gcc/testsuite/g++.dg/ext/pretty3.C +++ b/gcc-4.6/gcc/testsuite/g++.dg/ext/pretty3.C @@ -16,4 +16,4 @@ int main () { printf ("%s\n", D<int>().foo (0)); } -// { dg-final { scan-assembler "const char\\* D<U>::foo\\(typename B<U>::X\\)" } } +// { dg-final { scan-assembler "char const\\* D<U>::foo\\(typename B<U>::X\\)" } } diff --git a/gcc-4.6/gcc/testsuite/g++.dg/fstack-protector-strong.C b/gcc-4.6/gcc/testsuite/g++.dg/fstack-protector-strong.C new file mode 100644 index 000000000..a4f0f8163 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/fstack-protector-strong.C @@ -0,0 +1,35 @@ +/* Test that stack protection is done on chosen functions. */ + +/* { dg-do compile { target i?86-*-* x86_64-*-* } } */ +/* { dg-options "-O2 -fstack-protector-strong" } */ + +class A +{ +public: + A() {} + ~A() {} + void method(); + int state; +}; + +/* Frame address exposed to A::method via "this". */ +int +foo1 () +{ + A a; + a.method (); + return a.state; +} + +/* Possible destroying foo2's stack via &a. */ +int +global_func (A& a); + +/* Frame address exposed to global_func. */ +int foo2 () +{ + A a; + return global_func (a); +} + +/* { dg-final { scan-assembler-times "stack_chk_fail" 2 } } */ diff --git a/gcc-4.6/gcc/testsuite/g++.dg/gcov/gcov-2.C b/gcc-4.6/gcc/testsuite/g++.dg/gcov/gcov-2.C index 6d002f5d2..66d8af39b 100644 --- a/gcc-4.6/gcc/testsuite/g++.dg/gcov/gcov-2.C +++ b/gcc-4.6/gcc/testsuite/g++.dg/gcov/gcov-2.C @@ -20,7 +20,7 @@ private: void foo() { - C c; /* count(2) */ + C c; /* count(1) */ c.seti (1); /* count(1) */ } diff --git a/gcc-4.6/gcc/testsuite/g++.dg/init/array28.C b/gcc-4.6/gcc/testsuite/g++.dg/init/array28.C new file mode 100644 index 000000000..8cf19ba43 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/init/array28.C @@ -0,0 +1,7 @@ +// PR c++/49669 + +struct Foo { explicit Foo(int) { } }; +struct Goo { + Goo() : x(Foo(4), Foo(5)) { } // { dg-error "array" } + Foo x[2]; +}; diff --git a/gcc-4.6/gcc/testsuite/g++.dg/init/const8.C b/gcc-4.6/gcc/testsuite/g++.dg/init/const8.C new file mode 100644 index 000000000..4eb293d65 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/init/const8.C @@ -0,0 +1,11 @@ +// DR 234 - it should be OK to leave off the initializer of a const +// variable if the default constructor fully initializes the object. + +struct A { }; +const A a; + +struct B { A a; }; +const B b; + +struct C { virtual void f(); }; +const C c; diff --git a/gcc-4.6/gcc/testsuite/g++.dg/init/pr42844.C b/gcc-4.6/gcc/testsuite/g++.dg/init/pr42844.C index 7b423ccb6..299a30a91 100644 --- a/gcc-4.6/gcc/testsuite/g++.dg/init/pr42844.C +++ b/gcc-4.6/gcc/testsuite/g++.dg/init/pr42844.C @@ -6,19 +6,19 @@ struct A A(){} }; -struct B : A {}; // { dg-message "user-provided default constructor" } +struct B : A { int i; }; // { dg-message "user-provided default constructor" } -struct C : A {}; // { dg-message "user-provided default constructor" } +struct C : A { int i; }; // { dg-message "user-provided default constructor" } struct D : B { D() {} }; -struct E {}; // { dg-message "user-provided default constructor" } +struct E { int i; }; // { dg-message "user-provided default constructor" } template <class T> -struct F : A {}; // { dg-message "user-provided default constructor" } +struct F : A { T t; }; // { dg-message "user-provided default constructor" } template <class T> -struct G {}; // { dg-message "user-provided default constructor" } +struct G { T t; }; // { dg-message "user-provided default constructor" } void f () { @@ -41,9 +41,9 @@ void f () extern G<int> const gext; } -struct H {}; // { dg-message "user-provided default constructor" } +struct H { int i; }; // { dg-message "user-provided default constructor" } -struct I : A {}; // { dg-message "user-provided default constructor" } +struct I : A { int i; }; // { dg-message "user-provided default constructor" } template <class T> void g () diff --git a/gcc-4.6/gcc/testsuite/g++.dg/init/ref20.C b/gcc-4.6/gcc/testsuite/g++.dg/init/ref20.C new file mode 100644 index 000000000..b64cb57e0 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/init/ref20.C @@ -0,0 +1,8 @@ +// PR c++/50787 +// { dg-do run } + +int main() { + const int Ci = 0; + const int &rCi = Ci; + if (!(&Ci == &rCi)) __builtin_abort(); +} diff --git a/gcc-4.6/gcc/testsuite/g++.dg/init/value10.C b/gcc-4.6/gcc/testsuite/g++.dg/init/value10.C new file mode 100644 index 000000000..2066410a0 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/init/value10.C @@ -0,0 +1,27 @@ +// PR c++/51331 +// { dg-do run } + +struct A { + A(): x(10) {} + virtual ~A() {} + + int x; +}; + +struct B: public virtual A { +}; + +struct C: public virtual A { +}; + +struct D: public B, virtual public C { + D(): B(), C() {} // note an explicit call to C() which is auto-generated +}; + +int main() { + D* d = new D(); + + // Crashes here with the following message: + // *** glibc detected *** ./test: free(): invalid next size (fast) + delete d; +} diff --git a/gcc-4.6/gcc/testsuite/g++.dg/init/value9.C b/gcc-4.6/gcc/testsuite/g++.dg/init/value9.C new file mode 100644 index 000000000..4899bd810 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/init/value9.C @@ -0,0 +1,32 @@ +// PR c++/50793 +// { dg-do run } + +struct NonTrivial +{ + NonTrivial() { } +}; + +struct S +{ + NonTrivial nt; + int i; +}; + +int f(S s) +{ + s.i = 0xdeadbeef; + return s.i; +} + +int g(S s = S()) +{ + return s.i; +} + +int main() +{ + f(S()); // make stack dirty + + if ( g() ) + __builtin_abort(); +} diff --git a/gcc-4.6/gcc/testsuite/g++.dg/init/vbase1.C b/gcc-4.6/gcc/testsuite/g++.dg/init/vbase1.C new file mode 100644 index 000000000..bbfd58f5c --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/init/vbase1.C @@ -0,0 +1,39 @@ +// PR c++/50618 +// { dg-do run } + +struct Base +{ + const int text; + Base():text(1) {} + Base(int aText) + : text(aText) {} +}; +struct SubA : public virtual Base +{ +protected: + int x; +public: + SubA(int aX) + : x(aX) {} +}; +class SubB : public virtual Base +{}; +struct Diamond : public SubA, public SubB +{ + Diamond(int text) + : Base(text), SubA(5), SubB() {} + + void printText() + { + if(text != 2) + __builtin_abort(); + if(x!=5) + __builtin_abort(); + } +}; + +int main(int, char**) +{ + Diamond x(2); + x.printText(); +} diff --git a/gcc-4.6/gcc/testsuite/g++.dg/mversn10.C b/gcc-4.6/gcc/testsuite/g++.dg/mversn10.C index adfbc1370..9d9bcd564 100644 --- a/gcc-4.6/gcc/testsuite/g++.dg/mversn10.C +++ b/gcc-4.6/gcc/testsuite/g++.dg/mversn10.C @@ -49,6 +49,6 @@ main () return 0; } -/* { dg-final { scan-tree-dump "dispatchv_clone_0" "optimized" } } */ -/* { dg-final { scan-tree-dump "dispatchv_clone_1" "optimized" } } */ +/* { dg-final { scan-tree-dump "dispatchv\.clone\.0" "optimized" } } */ +/* { dg-final { scan-tree-dump "dispatchv\.clone\.1" "optimized" } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc-4.6/gcc/testsuite/g++.dg/mversn10a.C b/gcc-4.6/gcc/testsuite/g++.dg/mversn10a.C index cf510f95c..738bfa932 100644 --- a/gcc-4.6/gcc/testsuite/g++.dg/mversn10a.C +++ b/gcc-4.6/gcc/testsuite/g++.dg/mversn10a.C @@ -32,6 +32,6 @@ fn2 () return 0; } -/* { dg-final { scan-tree-dump "dispatchv_clone_0" "optimized" } } */ -/* { dg-final { scan-tree-dump "dispatchv_clone_1" "optimized" } } */ +/* { dg-final { scan-tree-dump "dispatchv\.clone\.0" "optimized" } } */ +/* { dg-final { scan-tree-dump "dispatchv\.clone\.1" "optimized" } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc-4.6/gcc/testsuite/g++.dg/mversn16.C b/gcc-4.6/gcc/testsuite/g++.dg/mversn16.C index d19dca9b8..0fca33a62 100644 --- a/gcc-4.6/gcc/testsuite/g++.dg/mversn16.C +++ b/gcc-4.6/gcc/testsuite/g++.dg/mversn16.C @@ -35,5 +35,5 @@ int main () return 0; } -/* { dg-final { scan-tree-dump "dispatchv_clone" "optimized" } } */ +/* { dg-final { scan-tree-dump "dispatchv\.clone" "optimized" } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc-4.6/gcc/testsuite/g++.dg/mversn8.C b/gcc-4.6/gcc/testsuite/g++.dg/mversn8.C index 39c953bfc..d66867033 100644 --- a/gcc-4.6/gcc/testsuite/g++.dg/mversn8.C +++ b/gcc-4.6/gcc/testsuite/g++.dg/mversn8.C @@ -38,8 +38,8 @@ main (int argc, char **argv) return (*ptr)(); } -/* { dg-final { scan-tree-dump "dispatchv_clone_0" "optimized" } } */ -/* { dg-final { scan-tree-dump "dispatchv_clone_1" "optimized" } } */ -/* { dg-final { scan-tree-dump "main_clone_0" "optimized" } } */ -/* { dg-final { scan-tree-dump "main_clone_1" "optimized" } } */ +/* { dg-final { scan-tree-dump "dispatchv\.clone\.0" "optimized" } } */ +/* { dg-final { scan-tree-dump "dispatchv\.clone\.1" "optimized" } } */ +/* { dg-final { scan-tree-dump "main\.clone\.0" "optimized" } } */ +/* { dg-final { scan-tree-dump "main\.clone\.1" "optimized" } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc-4.6/gcc/testsuite/g++.dg/other/enum2.C b/gcc-4.6/gcc/testsuite/g++.dg/other/enum2.C new file mode 100644 index 000000000..3a28f2532 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/other/enum2.C @@ -0,0 +1,3 @@ +// PR c++/51248 + +enum E { e = sizeof(const E*) }; diff --git a/gcc-4.6/gcc/testsuite/g++.dg/other/offsetof7.C b/gcc-4.6/gcc/testsuite/g++.dg/other/offsetof7.C new file mode 100644 index 000000000..0ce2ee02a --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/other/offsetof7.C @@ -0,0 +1,17 @@ +// PR c++/50608 +// Testcase by <dberger@oubliette.org> +// { dg-do compile } + +struct A { + int offset; +}; + +struct B: public A { +}; + +struct C { + A a; + B b; +}; + +int fails = __builtin_offsetof (C, b.offset); diff --git a/gcc-4.6/gcc/testsuite/g++.dg/other/pr50464.C b/gcc-4.6/gcc/testsuite/g++.dg/other/pr50464.C new file mode 100644 index 000000000..8c6721373 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/other/pr50464.C @@ -0,0 +1,170 @@ +// { dg-do compile { target i?86-*-* x86_64-*-* } } +// { dg-options "-O3 -mxop" } + +typedef long unsigned int size_t; +typedef unsigned long ulong_t; +typedef signed long slong_t; + + template<typename _Iterator> + struct iterator_traits + { + typedef typename _Iterator::reference reference; + }; + + template<typename _Tp> + struct iterator_traits<_Tp*> + { + typedef _Tp& reference; + }; + + template<typename _Iterator, typename _Container> + class __normal_iterator + { + protected: + _Iterator _M_current; + typedef iterator_traits<_Iterator> __traits_type; + + public: + typedef typename __traits_type::reference reference; + + explicit + __normal_iterator(const _Iterator& __i) : _M_current(__i) { } + + reference + operator*() const + { return *_M_current; } + + __normal_iterator& + operator++() + { + ++_M_current; + return *this; + } + + const _Iterator& + base() const + { return _M_current; } + }; + + template<typename _Iterator, typename _Container> + inline bool + operator!=(const __normal_iterator<_Iterator, _Container>& __lhs, + const __normal_iterator<_Iterator, _Container>& __rhs) + { return __lhs.base() != __rhs.base(); } + + template<typename _Tp> + class allocator + { + public: + typedef _Tp* pointer; + typedef _Tp value_type; + + template<typename _Tp1> + struct rebind + { typedef allocator<_Tp1> other; }; + + pointer allocate(size_t __n, const void* = 0) + { + return static_cast<_Tp*>(::operator new(__n * sizeof(_Tp))); + } + }; + + template<typename _Tp, typename _Alloc> + struct _Vector_base + { + typedef typename _Alloc::template rebind<_Tp>::other _Tp_alloc_type; + + struct _Vector_impl + : public _Tp_alloc_type + { + typename _Tp_alloc_type::pointer _M_start; + typename _Tp_alloc_type::pointer _M_finish; + typename _Tp_alloc_type::pointer _M_end_of_storage; + + _Vector_impl(_Tp_alloc_type const& __a) { } + }; + + public: + typedef _Alloc allocator_type; + + _Vector_base(size_t __n, const allocator_type& __a) + : _M_impl(__a) + { + this->_M_impl._M_start = this->_M_allocate(__n); + this->_M_impl._M_finish = this->_M_impl._M_start; + this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n; + } + + public: + _Vector_impl _M_impl; + + typename _Tp_alloc_type::pointer + _M_allocate(size_t __n) + { return __n != 0 ? _M_impl.allocate(__n) : 0; } + + }; + + template<typename _Tp, typename _Alloc = allocator<_Tp> > + class vector : protected _Vector_base<_Tp, _Alloc> + { + typedef _Vector_base<_Tp, _Alloc> _Base; + typedef typename _Base::_Tp_alloc_type _Tp_alloc_type; + + public: + typedef _Tp value_type; + typedef typename _Tp_alloc_type::pointer pointer; + typedef __normal_iterator<pointer, vector> iterator; + typedef _Alloc allocator_type; + + protected: + using _Base::_M_allocate; + using _Base::_M_impl; + + public: + + explicit + vector(size_t __n, const value_type& __value = value_type(), + const allocator_type& __a = allocator_type()) + : _Base(__n, __a) + { _M_fill_initialize(__n, __value); } + + iterator begin() + { return iterator(this->_M_impl._M_start); } + + iterator end() + { return iterator(this->_M_impl._M_finish); } + + protected: + void + _M_fill_initialize(size_t __n, const value_type& __value) + { + this->_M_impl._M_finish = this->_M_impl._M_end_of_storage; + } + }; + + template<typename _InputIterator, typename _OutputIterator, typename _Tp> + _OutputIterator + replace_copy(_InputIterator __first, _InputIterator __last, + _OutputIterator __result, + const _Tp& __old_value, const _Tp& __new_value) + { + ; + for (; __first != __last; ++__first, ++__result) + if (*__first == __old_value) + *__result = __new_value; + else + *__result = *__first; + return __result; + } + +extern size_t shape_rank; + +void createDataspaceIdentifier() +{ + vector< ulong_t > dataspaceDims( shape_rank ); + vector< ulong_t > maxDataspaceDims( shape_rank ); + + replace_copy( + dataspaceDims.begin(), dataspaceDims.end(), + maxDataspaceDims.begin(), ulong_t( 0 ), ((ulong_t)(slong_t)(-1)) ); +} diff --git a/gcc-4.6/gcc/testsuite/g++.dg/other/sized-delete-1.C b/gcc-4.6/gcc/testsuite/g++.dg/other/sized-delete-1.C new file mode 100644 index 000000000..76f861af3 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/other/sized-delete-1.C @@ -0,0 +1,14 @@ +// { dg-do link} +// { dg-options "-O -fsized-delete" } +// { dg-final { scan-assembler "_ZdlPv\[mj\]" } } +struct A +{ + int a[100]; +}; + +int main(void) +{ + A *a = new A; + delete a; + return 0; +} diff --git a/gcc-4.6/gcc/testsuite/g++.dg/pr44486.C b/gcc-4.6/gcc/testsuite/g++.dg/pr44486.C index 01e84289f..1a23d57b5 100644 --- a/gcc-4.6/gcc/testsuite/g++.dg/pr44486.C +++ b/gcc-4.6/gcc/testsuite/g++.dg/pr44486.C @@ -7,4 +7,4 @@ namespace { S f() { const char * s = __PRETTY_FUNCTION__; return S(); } } int main() { f(); } -// { dg-final { scan-assembler "S \{anonymous\}::f" } } +// { dg-final { scan-assembler "S \\(anonymous namespace\\)::f" } } diff --git a/gcc-4.6/gcc/testsuite/g++.dg/pr48660.C b/gcc-4.6/gcc/testsuite/g++.dg/pr48660.C new file mode 100644 index 000000000..37b61741a --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/pr48660.C @@ -0,0 +1,22 @@ +template<int N> struct val { char a[N]; }; + +class Base +{ +public: + virtual val<1> get1() const = 0; + virtual val<2> get2() const = 0; + virtual val<3> get3() const = 0; + virtual val<4> get4() const = 0; +}; + +class Derived : public virtual Base +{ +public: + virtual val<1> get1() const { return foo->get1(); } + virtual val<2> get2() const { return foo->get2(); } + virtual val<3> get3() const { return foo->get3(); } + virtual val<4> get4() const { return foo->get4(); } + Base *foo; +}; + +Base* make() { return new Derived; } diff --git a/gcc-4.6/gcc/testsuite/g++.dg/pr51151.C b/gcc-4.6/gcc/testsuite/g++.dg/pr51151.C new file mode 100644 index 000000000..804498b5f --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/pr51151.C @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-Woverflow" } */ +template<typename T> class C { +public: + void f() { + m = c2 + 1; + } + static const long unsigned int c1 = 7; + static const int c2 = c1 - 1; + int m; +}; +template class C<int>; diff --git a/gcc-4.6/gcc/testsuite/g++.dg/template/partial12.C b/gcc-4.6/gcc/testsuite/g++.dg/template/partial12.C new file mode 100644 index 000000000..05a3eca97 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/template/partial12.C @@ -0,0 +1,27 @@ +// PR c++/46105 + +template< typename T > +struct empty { // support class is like stripped-down enable_if + typedef void type; +}; + +template< class T, typename v = void > // v is always void! +struct element { + typedef typename T::value_type type; +}; + +template< class T > // T in deduced context, T::element_type is SFINAE: +struct element< T, typename empty< typename T::element_type >::type > { + typedef typename T::element_type type; +}; + +template< class T > +struct element< T const, typename empty< typename T::element_type >::type > { + typedef typename T::element_type const type; +}; + +struct has_et { + typedef int element_type; +}; + +element<has_et const>::type ip = 0; diff --git a/gcc-4.6/gcc/testsuite/g++.dg/thread-ann/thread_annot_lock-79.C b/gcc-4.6/gcc/testsuite/g++.dg/thread-ann/thread_annot_lock-79.C index 8558670f0..b3c93b4b7 100644 --- a/gcc-4.6/gcc/testsuite/g++.dg/thread-ann/thread_annot_lock-79.C +++ b/gcc-4.6/gcc/testsuite/g++.dg/thread-ann/thread_annot_lock-79.C @@ -75,3 +75,27 @@ void foo3() (new FooDerived)->doSomething(); } +class FooNodef; + +// test case for cast from undefined type +void foo4(FooNodef *f) { + ((Foo*) f)->doSomething(); +} + + +// Regression test for canonicalization of subexpressions that refer to +// lockable objects. +class LOCKABLE Base { +public: + Mutex mu_; + virtual void baseMethod() SHARED_LOCKS_REQUIRED(mu_) = 0; +}; + +class Derived : public Base { +public: + void foo() SHARED_LOCKS_REQUIRED(mu_); +}; + +void Derived::foo() { + baseMethod(); +} diff --git a/gcc-4.6/gcc/testsuite/g++.dg/thread-ann/thread_annot_lock-81.C b/gcc-4.6/gcc/testsuite/g++.dg/thread-ann/thread_annot_lock-81.C new file mode 100644 index 000000000..5db3ccc1c --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/thread-ann/thread_annot_lock-81.C @@ -0,0 +1,17 @@ +// Test template methods in the presence of cloned constructors. +// Regression test for bugfix. +// { dg-do compile } +// { dg-options "-Wthread-safety -O" } + +#include "thread_annot_common.h" + +Mutex mu_; +Mutex mu2_; + +class Foo { + Foo() LOCKS_EXCLUDED(mu_) { } + + template <class T> + void bar(T* t) LOCKS_EXCLUDED(mu2_) { } +}; + diff --git a/gcc-4.6/gcc/testsuite/g++.dg/thread-ann/thread_annot_lock-82.C b/gcc-4.6/gcc/testsuite/g++.dg/thread-ann/thread_annot_lock-82.C new file mode 100644 index 000000000..556bab676 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/thread-ann/thread_annot_lock-82.C @@ -0,0 +1,48 @@ +// Regression tests: fix ICE issues when IPA-SRA deletes formal +// function parameters. +// { dg-do compile } +// { dg-options "-Wthread-safety -O3" } + +#include "thread_annot_common.h" + +class Foo; +void do_something(void* a); + +class Foo { + Mutex mu_; + int a GUARDED_BY(mu_); + int b; + + // with optimization turned on, ipa-sra should eliminate the hidden + // "this" argument, thus invalidating EXCLUSIVE_LOCKS_REQUIRED. + inline void clone_me_ipasra(Foo* f) EXCLUSIVE_LOCKS_REQUIRED(mu_) { + do_something(f); + } + + void foo(Foo* f); + void bar(); +}; + +void Foo::foo(Foo* f) { + mu_.Lock(); + // in the cloned version, it looks like the required lock is f->mu_ + // we should detect this and ignore the attribute. + clone_me_ipasra(f); + mu_.Unlock(); +} + + +class SCOPED_LOCKABLE DummyMutexLock { +public: + // IPA-SRA should kill the parameters to these functions + explicit DummyMutexLock(Mutex* mutex) EXCLUSIVE_LOCK_FUNCTION(mutex) {} + ~DummyMutexLock() UNLOCK_FUNCTION() {} +}; + + +void Foo::bar() { + // Matches two warnings: + DummyMutexLock dlock(&mu_); // { dg-warning "lock attribute has been removed by optimization" } + a = 1; // warning here should be suppressed, due to errors handling dlock + b = 2; // { dg-warning "unlock attribute has been removed by optimization" } +} diff --git a/gcc-4.6/gcc/testsuite/g++.dg/thread-ann/thread_annot_lock-83.C b/gcc-4.6/gcc/testsuite/g++.dg/thread-ann/thread_annot_lock-83.C new file mode 100644 index 000000000..35e58c09e --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/thread-ann/thread_annot_lock-83.C @@ -0,0 +1,55 @@ +// Regression test for two bugfixes. +// Bugfix 1: Shared locks are not properly removed from locksets +// if a "universal lock" is present. +// Bugfix 2: Canonicalization does not properly store the lock in +// the hash table if the lock function is attached to a base class. +// { dg-do compile } +// { dg-options "-Wthread-safety" } + +#include "thread_annot_common.h" + +class Foo; + +/* Bugfix 1 */ +class Bar { +public: + Foo* foo; + Mutex mu_; + + // foo->mu_ is not visible at this point in the code. + // so the attribute will become a "universal lock." + void bar() EXCLUSIVE_LOCKS_REQUIRED(foo->mu_); +}; + + +class Foo { +public: + Mutex mu_; + int a; +}; + + +void Bar::bar() { + ReaderMutexLock rlock(&mu_); +} + + +/* Bugfix 2 */ +class LOCKABLE Base { +public: + Mutex mu_; + + void Lock() EXCLUSIVE_LOCK_FUNCTION() { mu_.Lock(); } + void Unlock() UNLOCK_FUNCTION() { mu_.Unlock(); } +}; + +class Derived : public Base { +public: + int b; +}; + +void doSomething(Derived *d) { + d->Lock(); + d->Unlock(); +}; + diff --git a/gcc-4.6/gcc/testsuite/g++.dg/thread-ann/thread_annot_lock-84.C b/gcc-4.6/gcc/testsuite/g++.dg/thread-ann/thread_annot_lock-84.C new file mode 100644 index 000000000..323b4e303 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/thread-ann/thread_annot_lock-84.C @@ -0,0 +1,29 @@ +// Test lock expressions involving array elements. +// { dg-do compile } +// { dg-options "-Wthread-safety" } + +#include "thread_annot_common.h" + +struct Foo { + Mutex mu_; + int a GUARDED_BY(mu_); + + static void foo1(Foo* foos, int n); + static void foo2(Foo* foos, int n); +}; + +void Foo::foo1(Foo* foos, int n) { + for (int i = 0; i < n; ++i) { + foos[i].mu_.Lock(); + foos[i].a = 0; + foos[i].mu_.Unlock(); + } +} + +void Foo::foo2(Foo* foos, int n) { + for (int i = 0; i < n-1; ++i) { + foos[i].mu_.Lock(); + foos[i+1].a = 0; // { dg-warning "Writing to variable" } + foos[i].mu_.Unlock(); + } +} diff --git a/gcc-4.6/gcc/testsuite/g++.dg/thread-ann/thread_annot_lock-85.C b/gcc-4.6/gcc/testsuite/g++.dg/thread-ann/thread_annot_lock-85.C new file mode 100644 index 000000000..c553e81d6 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/thread-ann/thread_annot_lock-85.C @@ -0,0 +1,22 @@ +// Regression test, handle trylock on virtual method. +// { dg-do compile } +// { dg-options "-Wthread-safety" } + +#include "thread_annot_common.h" + +class LOCKABLE Lock { + public: + virtual ~Lock() {} + virtual bool TryLock() EXCLUSIVE_TRYLOCK_FUNCTION(true) { return true; } + void Unlock() UNLOCK_FUNCTION() {} +}; + + +void foo() { + Lock x; + Lock *p = &x; + if (p->TryLock()) { + p->Unlock(); + } +} + diff --git a/gcc-4.6/gcc/testsuite/g++.dg/torture/pr49309.C b/gcc-4.6/gcc/testsuite/g++.dg/torture/pr49309.C new file mode 100644 index 000000000..a34537792 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/torture/pr49309.C @@ -0,0 +1,15 @@ +// PR tree-optimization/49309 +// { dg-do compile } +// { dg-options "-fpreprocessed -fmudflap" } + +struct A +{ + int i; + + A(); + A(const A&); +}; + +inline void foo(A a) { a = A(); } + +void bar() { foo(A()); } diff --git a/gcc-4.6/gcc/testsuite/g++.dg/torture/pr49628.C b/gcc-4.6/gcc/testsuite/g++.dg/torture/pr49628.C new file mode 100644 index 000000000..4bc6543a3 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/torture/pr49628.C @@ -0,0 +1,37 @@ +/* { dg-do compile } */ + +#include <vector> + +template <int rank, int dim> class Tensor; +template <int dim> class Tensor<1,dim> { +public: + explicit Tensor (const bool initialize = true); + Tensor (const Tensor<1,dim> &); + Tensor<1,dim> & operator = (const Tensor<1,dim> &); + double values[(dim!=0) ? (dim) : 1]; +}; +template <int dim> +inline Tensor<1,dim> & Tensor<1,dim>::operator = (const Tensor<1,dim> &p) +{ + for (unsigned int i=0; i<dim; ++i) + values[i] = p.values[i]; +}; +template <int dim> class Quadrature { +public: + const unsigned int n_quadrature_points; +}; +class MappingQ1 +{ + class InternalData { + public: + std::vector<Tensor<1,3> > shape_derivatives; + unsigned int n_shape_functions; + }; + void compute_data (const Quadrature<3> &quadrature, InternalData &data) + const; +}; +void MappingQ1::compute_data (const Quadrature<3> &q, InternalData &data) const +{ + const unsigned int n_q_points = q.n_quadrature_points; + data.shape_derivatives.resize(data.n_shape_functions * n_q_points); +} diff --git a/gcc-4.6/gcc/testsuite/g++.dg/torture/pr49720.C b/gcc-4.6/gcc/testsuite/g++.dg/torture/pr49720.C new file mode 100644 index 000000000..c5da7ba67 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/torture/pr49720.C @@ -0,0 +1,8 @@ +/* { dg-do compile } */ + +extern char t_start[], t_end[], t_size[]; +bool foo (void) +{ + long size = reinterpret_cast<long>(t_size); + return (size == t_end - t_start); +} diff --git a/gcc-4.6/gcc/testsuite/g++.dg/torture/pr50189.C b/gcc-4.6/gcc/testsuite/g++.dg/torture/pr50189.C new file mode 100644 index 000000000..06f1d3695 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/torture/pr50189.C @@ -0,0 +1,121 @@ +// { dg-do run } +// { dg-options "-fstrict-enums" } + +extern "C" void abort (void); +class CCUTILS_KeyedScalarLevelPosition +{ +public: + + typedef enum + { + UNINITED = 0, + AT_BEGIN = 1, + AT_END = 2, + AT_KEY = 3 + + } position_t; + + bool is_init() const + { return(m_timestamp != UNINITED); } + + bool is_at_begin() const + { return(m_timestamp == AT_BEGIN); } + + position_t get_state() const + { + return((m_timestamp >= AT_KEY) + ? AT_KEY + : ((position_t)m_timestamp)); + } + + void set_at_begin() + { m_timestamp = AT_BEGIN; } + + unsigned int get_index() const + { return(m_index); } + + void set_pos(unsigned int a_index, unsigned int a_timestmap) + { + m_index = a_index; + m_timestamp = a_timestmap; + } + + bool check_pos(unsigned int a_num_entries, unsigned int a_timestamp) const + { + if (get_state() != AT_KEY) + return(false); + + if (m_timestamp != a_timestamp) + return(false); + + return(m_index < a_num_entries); + } + + void set_not_init() + { m_timestamp = 0; } + +private: + + unsigned int m_timestamp; + unsigned int m_index; + +}; + +class CCUTILS_KeyedScalarPosition +{ +public: + + CCUTILS_KeyedScalarLevelPosition m_L1; + CCUTILS_KeyedScalarLevelPosition m_L2; +}; + +class baz +{ +public: + int *n[20]; + unsigned int m_cur_array_len; + unsigned int m_timestamp; + + unsigned int _get_timestamp() const + { return(m_timestamp); } + + bool _check_L1_pos(const CCUTILS_KeyedScalarPosition &a_position) const + { + return(a_position.m_L1.check_pos( + m_cur_array_len, _get_timestamp())); + } + + void *next (CCUTILS_KeyedScalarPosition &); +}; + +void * baz::next (CCUTILS_KeyedScalarPosition &a_position) +{ + if (a_position.m_L1.is_at_begin() || (!a_position.m_L1.is_init())) + { + a_position.m_L1.set_pos(0, _get_timestamp()); + a_position.m_L2.set_at_begin(); + } + else if (!_check_L1_pos(a_position)) + return(0); + + return n[a_position.m_L1.get_index ()]; +} + +int main (int, char **) +{ + baz obj; + CCUTILS_KeyedScalarPosition a_pos; + void *ret; + int n[5]; + + obj.n[0] = n; + obj.m_cur_array_len = 1; + obj.m_timestamp = 42; + + a_pos.m_L1.set_pos (0, 42); + + ret = obj.next (a_pos); + if (ret == 0) + abort (); + return 0; +} diff --git a/gcc-4.6/gcc/testsuite/g++.dg/tree-prof/callgraph-profiles.C b/gcc-4.6/gcc/testsuite/g++.dg/tree-prof/callgraph-profiles.C new file mode 100644 index 000000000..d9583097c --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/tree-prof/callgraph-profiles.C @@ -0,0 +1,30 @@ +/* Verify if call-graph profile sections are created + with -fcallgraph-profiles-sections. */ +/* { dg-options "-O2 -fcallgraph-profiles-sections -ffunction-sections --save-temps" } */ +/* { dg-require-section-exclude "" } */ + +int __attribute__ ((noinline)) +foo () +{ + return 1; +} + +int __attribute__ ((noinline)) +bar () +{ + return 0; +} + +int main () +{ + int sum; + for (int i = 0; i< 1000; i++) + { + sum = foo () + bar(); + } + return sum * bar (); +} + +/* { dg-final-use { scan-assembler "\.gnu\.callgraph\.text\.main" } } */ +/* { dg-final-use { scan-assembler "\.string \"1000\"" } } */ +/* { dg-final-use { cleanup-saved-temps } } */ diff --git a/gcc-4.6/gcc/testsuite/g++.dg/tree-prof/mversn15.C b/gcc-4.6/gcc/testsuite/g++.dg/tree-prof/mversn15.C index 54b4e57a1..cdbb70ed1 100644 --- a/gcc-4.6/gcc/testsuite/g++.dg/tree-prof/mversn15.C +++ b/gcc-4.6/gcc/testsuite/g++.dg/tree-prof/mversn15.C @@ -18,6 +18,6 @@ main () return ret - 1000; } -/* { dg-final-use { scan-tree-dump "main_clone" "optimized" } } */ +/* { dg-final-use { scan-tree-dump "main\.clone" "optimized" } } */ /* { dg-final-use { scan-tree-dump "return 0" "optimized" } } */ /* { dg-final-use { cleanup-tree-dump "optimized" } } */ diff --git a/gcc-4.6/gcc/testsuite/g++.dg/tree-ssa/dom-invalid.C b/gcc-4.6/gcc/testsuite/g++.dg/tree-ssa/dom-invalid.C index 5513d3650..91f43ae8c 100644 --- a/gcc-4.6/gcc/testsuite/g++.dg/tree-ssa/dom-invalid.C +++ b/gcc-4.6/gcc/testsuite/g++.dg/tree-ssa/dom-invalid.C @@ -1,7 +1,7 @@ // PR tree-optimization/39557 // invalid post-dom info leads to infinite loop // { dg-do run } -// { dg-options "-Wall -fno-exceptions -O2 -fprofile-use -fno-rtti" } +// { dg-options "-Wall -fno-exceptions -O2 -fprofile-use -fopt-info -fno-rtti" } struct C { diff --git a/gcc-4.6/gcc/testsuite/g++.dg/tree-ssa/pr49911.C b/gcc-4.6/gcc/testsuite/g++.dg/tree-ssa/pr49911.C new file mode 100644 index 000000000..520a7750d --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/tree-ssa/pr49911.C @@ -0,0 +1,41 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fstrict-enums -fno-rtti -fno-exceptions -fno-strict-aliasing -fdump-tree-vrp2" } */ + + +extern void JS_Assert(); +typedef enum { +eax, ecx, edx, ebx, esp, ebp, +esi, edi } +RegisterID; +union StateRemat { + RegisterID reg_; + int offset_; +}; +static StateRemat FromRegister(RegisterID reg) { + StateRemat sr; + sr.reg_ = reg; + return sr; +} +static StateRemat FromAddress3(int address) { + StateRemat sr; + sr.offset_ = address; + //sr.offset_ = 0; + if (address < 46 && address >= 0) { + JS_Assert(); + } + return sr; +} +struct FrameState { + StateRemat dataRematInfo2(bool y, int z) { + if (y) return FromRegister(RegisterID(1)); + return FromAddress3(z); + } +}; +FrameState frame; +StateRemat x; +void jsop_setelem(bool y, int z) { + x = frame.dataRematInfo2(y, z); +} + +/* { dg-final { scan-tree-dump-times "Folding predicate.*45" 0 "vrp2"} } */ +/* { dg-final { cleanup-tree-dump "vrp2" } } */ diff --git a/gcc-4.6/gcc/testsuite/g++.dg/tree-ssa/pr50622.C b/gcc-4.6/gcc/testsuite/g++.dg/tree-ssa/pr50622.C new file mode 100644 index 000000000..d7f4fa74b --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/tree-ssa/pr50622.C @@ -0,0 +1,30 @@ +// { dg-do compile } +// { dg-options "-O2" } + +typedef __complex__ double Value; +struct LorentzVector +{ + LorentzVector & operator+=(const LorentzVector & a) { + theX += a.theX; + theY += a.theY; + theZ += a.theZ; + theT += a.theT; + return *this; + } + + Value theX; + Value theY; + Value theZ; + Value theT; +}; + +inline LorentzVector +operator+(LorentzVector a, const LorentzVector & b) { + return a += b; +} + +Value ex, et; +LorentzVector sum() { + LorentzVector v1; v1.theX =ex; v1.theY =ex+et; v1.theZ =ex-et; v1.theT =et; + return v1+v1; +} diff --git a/gcc-4.6/gcc/testsuite/g++.dg/vect/pr51485.cc b/gcc-4.6/gcc/testsuite/g++.dg/vect/pr51485.cc new file mode 100644 index 000000000..d57d7596d --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/vect/pr51485.cc @@ -0,0 +1,14 @@ +/* { dg-do compile } */ + +struct A { A (); unsigned int a; }; +double bar (A a) throw () __attribute__((pure)); + +void +foo (unsigned int x, double *y, A *z) +{ + unsigned int i; + for (i = 0; i < x; i++) + y[i] = bar (z[i]); +} + +/* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc-4.6/gcc/testsuite/g++.dg/vect/slp-pr50413.cc b/gcc-4.6/gcc/testsuite/g++.dg/vect/slp-pr50413.cc new file mode 100644 index 000000000..e7bdf1f1c --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/vect/slp-pr50413.cc @@ -0,0 +1,165 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target vect_int } */ + +typedef unsigned long long UInt64; + +typedef struct struct128 +{ + UInt64 uint64_lower; + UInt64 uint64_upper; +} +STRUCT_128; + +typedef union uint128_bitmap +{ + STRUCT_128 uint128; + + struct + { + UInt64 b00 : 1; + UInt64 b01 : 1; + UInt64 b02 : 1; + UInt64 b03 : 1; + UInt64 b04 : 1; + UInt64 b05 : 1; + UInt64 b06 : 1; + UInt64 b07 : 1; + UInt64 b08 : 1; + UInt64 b09 : 1; + UInt64 b10 : 1; + UInt64 b11 : 1; + UInt64 b12 : 1; + UInt64 b13 : 1; + UInt64 b14 : 1; + UInt64 b15 : 1; + UInt64 b16 : 1; + UInt64 b17 : 1; + UInt64 b18 : 1; + UInt64 b19 : 1; + UInt64 b20 : 1; + UInt64 b21 : 1; + UInt64 b22 : 1; + UInt64 b23 : 1; + UInt64 b24 : 1; + UInt64 b25 : 1; + UInt64 b26 : 1; + UInt64 b27 : 1; + UInt64 b28 : 1; + UInt64 b29 : 1; + UInt64 b30 : 1; + UInt64 b31 : 1; + UInt64 b32 : 1; + UInt64 b33 : 1; + UInt64 b34 : 1; + UInt64 b35 : 1; + UInt64 b36 : 1; + UInt64 b37 : 1; + UInt64 b38 : 1; + UInt64 b39 : 1; + UInt64 b40 : 1; + UInt64 b41 : 1; + UInt64 b42 : 1; + UInt64 b43 : 1; + UInt64 b44 : 1; + UInt64 b45 : 1; + UInt64 b46 : 1; + UInt64 b47 : 1; + UInt64 b48 : 1; + UInt64 b49 : 1; + UInt64 b50 : 1; + UInt64 b51 : 1; + UInt64 b52 : 1; + UInt64 b53 : 1; + UInt64 b54 : 1; + UInt64 b55 : 1; + UInt64 b56 : 1; + UInt64 b57 : 1; + UInt64 b58 : 1; + UInt64 b59 : 1; + UInt64 b60 : 1; + UInt64 b61 : 1; + UInt64 b62 : 1; + UInt64 b63 : 1; + UInt64 b64 : 1; + UInt64 b65 : 1; + UInt64 b66 : 1; + UInt64 b67 : 1; + UInt64 b68 : 1; + UInt64 b69 : 1; + UInt64 b70 : 1; + UInt64 b71 : 1; + UInt64 b72 : 1; + UInt64 b73 : 1; + UInt64 b74 : 1; + UInt64 b75 : 1; + UInt64 b76 : 1; + UInt64 b77 : 1; + UInt64 b78 : 1; + UInt64 b79 : 1; + UInt64 b80 : 1; + UInt64 b81 : 1; + UInt64 b82 : 1; + UInt64 b83 : 1; + UInt64 b84 : 1; + UInt64 b85 : 1; + UInt64 b86 : 1; + UInt64 b87 : 1; + UInt64 b88 : 1; + UInt64 b89 : 1; + UInt64 b90 : 1; + UInt64 b91 : 1; + UInt64 b92 : 1; + UInt64 b93 : 1; + UInt64 b94 : 1; + UInt64 b95 : 1; + UInt64 b96 : 1; + UInt64 b97 : 1; + UInt64 b98 : 1; + UInt64 b99 : 1; + UInt64 b100 : 1; + UInt64 b101 : 1; + UInt64 b102 : 1; + UInt64 b103 : 1; + UInt64 b104 : 1; + UInt64 b105 : 1; + UInt64 b106 : 1; + UInt64 b107 : 1; + UInt64 b108 : 1; + UInt64 b109 : 1; + UInt64 b110 : 1; + UInt64 b111 : 1; + UInt64 b112 : 1; + UInt64 b113 : 1; + UInt64 b114 : 1; + UInt64 b115 : 1; + UInt64 b116 : 1; + UInt64 b117 : 1; + UInt64 b118 : 1; + UInt64 b119 : 1; + UInt64 b120 : 1; + UInt64 b121 : 1; + UInt64 b122 : 1; + UInt64 b123 : 1; + UInt64 b124 : 1; + UInt64 b125 : 1; + UInt64 b126 : 1; + UInt64 b127 : 1; + } + bitmap; +} +UInt128_BITMAP; + +UInt128_BITMAP V; + +void shift(unsigned char t) +{ + V.uint128.uint64_lower = (V.uint128.uint64_lower >> 1); + V.bitmap.b63 = V.bitmap.b64; + V.uint128.uint64_upper = (V.uint128.uint64_upper >> 1); + + V.bitmap.b96 = t; +} + +/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 0 "slp" } } */ +/* { dg-final { cleanup-tree-dump "slp" } } */ + diff --git a/gcc-4.6/gcc/testsuite/g++.dg/vect/vect.exp b/gcc-4.6/gcc/testsuite/g++.dg/vect/vect.exp index 9a03f6c42..ac22f4b01 100644 --- a/gcc-4.6/gcc/testsuite/g++.dg/vect/vect.exp +++ b/gcc-4.6/gcc/testsuite/g++.dg/vect/vect.exp @@ -40,8 +40,13 @@ global DEFAULT_VECTCFLAGS set DEFAULT_VECTCFLAGS "" # These flags are used for all targets. -lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize" "-fno-vect-cost-model" \ - "-ftree-vectorizer-verbose=4" "-fdump-tree-vect-stats" +lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize" "-fno-vect-cost-model" + +set VECT_SLP_CFLAGS $DEFAULT_VECTCFLAGS + +lappend DEFAULT_VECTCFLAGS "-fdump-tree-vect-details" +lappend VECT_SLP_CFLAGS "-fdump-tree-slp-details" + # Skip these tests for targets that do not support generating vector # code. Set additional target-dependent vector flags, which can be @@ -54,8 +59,10 @@ if ![check_vect_support_and_set_flags] { dg-init # Main loop. -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{c,cc,S} ]] \ +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/pr*.{c,cc,S} ]] \ "" $DEFAULT_VECTCFLAGS +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/slp-pr*.{c,cc,S} ]] \ + "" $VECT_SLP_CFLAGS #### Tests with special options global SAVED_DEFAULT_VECTCFLAGS diff --git a/gcc-4.6/gcc/testsuite/g++.dg/warn/Wuninitializable-member.C b/gcc-4.6/gcc/testsuite/g++.dg/warn/Wuninitializable-member.C index 1c37e3ea0..9d889e1d6 100644 --- a/gcc-4.6/gcc/testsuite/g++.dg/warn/Wuninitializable-member.C +++ b/gcc-4.6/gcc/testsuite/g++.dg/warn/Wuninitializable-member.C @@ -8,7 +8,7 @@ public: }; class Y { - const int var;// { dg-warning "non-static const member 'const int Y::var' in class without a constructor" } + const int var;// { dg-warning "non-static const member 'int const Y::var' in class without a constructor" } public: int g(){ return 2*var; } }; diff --git a/gcc-4.6/gcc/testsuite/g++.dg/warn/pr35711.C b/gcc-4.6/gcc/testsuite/g++.dg/warn/pr35711.C index 653269c0e..7c1be1c4e 100644 --- a/gcc-4.6/gcc/testsuite/g++.dg/warn/pr35711.C +++ b/gcc-4.6/gcc/testsuite/g++.dg/warn/pr35711.C @@ -4,5 +4,5 @@ int* foo (volatile int *p) { - return (int*)p; // { dg-warning "cast from type 'volatile int\\*' to type 'int\\*' casts away qualifiers" } + return (int*)p; // { dg-warning "cast from type 'int volatile\\*' to type 'int\\*' casts away qualifiers" } } diff --git a/gcc-4.6/gcc/testsuite/g++.old-deja/g++.oliva/ChangeLog b/gcc-4.6/gcc/testsuite/g++.old-deja/g++.oliva/ChangeLog index 1a84a36eb..c6781e2a6 100644 --- a/gcc-4.6/gcc/testsuite/g++.old-deja/g++.oliva/ChangeLog +++ b/gcc-4.6/gcc/testsuite/g++.old-deja/g++.oliva/ChangeLog @@ -1,3 +1,7 @@ +2011-10-26 Release Manager + + * GCC 4.6.2 released. + 2011-06-27 Release Manager * GCC 4.6.1 released. diff --git a/gcc-4.6/gcc/testsuite/g++.old-deja/g++.pt/memtemp77.C b/gcc-4.6/gcc/testsuite/g++.old-deja/g++.pt/memtemp77.C index e3ca5298d..2839e3b7f 100644 --- a/gcc-4.6/gcc/testsuite/g++.old-deja/g++.pt/memtemp77.C +++ b/gcc-4.6/gcc/testsuite/g++.old-deja/g++.pt/memtemp77.C @@ -19,7 +19,7 @@ const char* S3<char>::h(int) { return __PRETTY_FUNCTION__; } int main() { if (strcmp (S3<double>::h(7), - "static const char* S3<T>::h(U) [with U = int, T = double]") == 0) + "static char const* S3<T>::h(U) [with U = int, T = double]") == 0) return 0; else return 1; diff --git a/gcc-4.6/gcc/testsuite/gcc.c-torture/compile/20110906-1.c b/gcc-4.6/gcc/testsuite/gcc.c-torture/compile/20110906-1.c new file mode 100644 index 000000000..50ea9e241 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.c-torture/compile/20110906-1.c @@ -0,0 +1,22 @@ +/* PR middle-end/50266 */ +/* Testcase by <bero@arklinux.org> */ + +struct a { + unsigned int a; + unsigned int b; +}; + +struct a *const p = (struct a *)0x4A004100; + +void foo(void) +{ + unsigned int i = 0; + unsigned int *const x[] = { + &p->a, + &p->b, + 0 + }; + + (*(volatile unsigned int *)((x[i])) + = (unsigned int)((unsigned int)((*(volatile unsigned int *)(x[i]))))); +} diff --git a/gcc-4.6/gcc/testsuite/gcc.c-torture/compile/20110913-1.c b/gcc-4.6/gcc/testsuite/gcc.c-torture/compile/20110913-1.c new file mode 100644 index 000000000..e435a14b2 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.c-torture/compile/20110913-1.c @@ -0,0 +1,26 @@ +struct ieee754_double { + double d; +}; +extern const float __exp_deltatable[178]; +float __ieee754_expf (float x) +{ + static const float himark = 88.72283935546875; + static const float lomark = -103.972084045410; + if (__builtin_isless(x, himark) && __builtin_isgreater(x, lomark)) + { + int tval; + double x22, t, result, dx; + float delta; + struct ieee754_double ex2_u; + dx -= t; + tval = (int) (t * 512.0); + if (t >= 0) + delta = - __exp_deltatable[tval]; + else + delta = __exp_deltatable[-tval]; + x22 = (0.5000000496709180453 * dx + 1.0000001192102037084) * dx + delta; + result = x22 * ex2_u.d + ex2_u.d; + return (float) result; + } + return x; +} diff --git a/gcc-4.6/gcc/testsuite/gcc.c-torture/compile/pr49049.c b/gcc-4.6/gcc/testsuite/gcc.c-torture/compile/pr49049.c new file mode 100644 index 000000000..a24b2a41c --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.c-torture/compile/pr49049.c @@ -0,0 +1,28 @@ +__extension__ typedef unsigned long long int uint64_t; + +static int +sub (int a, int b) +{ + return a - b; +} + +static uint64_t +add (uint64_t a, uint64_t b) +{ + return a + b; +} + +int *ptr; + +int +foo (uint64_t arg1, int *arg2) +{ + int j; + for (; j < 1; j++) + { + *arg2 |= sub ( sub (sub (j || 1 ^ 0x1, 1), arg1 < 0x1 <= + sub (1, *ptr & j)), + (sub ( j != 1 || sub (j && j, 1) >= 0, + add (!j > arg1, 0x35DLL)))); + } +} diff --git a/gcc-4.6/gcc/testsuite/gcc.c-torture/compile/pr50565-1.c b/gcc-4.6/gcc/testsuite/gcc.c-torture/compile/pr50565-1.c new file mode 100644 index 000000000..cdaad294f --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.c-torture/compile/pr50565-1.c @@ -0,0 +1,4 @@ +struct s { char p[2]; }; +static struct s v; +const int o0 = (int) ((void *) &v.p[0] - (void *) &v) + 0U; +const int o1 = (int) ((void *) &v.p[0] - (void *) &v) + 1U; diff --git a/gcc-4.6/gcc/testsuite/gcc.c-torture/compile/pr50565-2.c b/gcc-4.6/gcc/testsuite/gcc.c-torture/compile/pr50565-2.c new file mode 100644 index 000000000..2d30e8802 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.c-torture/compile/pr50565-2.c @@ -0,0 +1,4 @@ +struct s { char p[2]; }; +static struct s v; +const int o0 = (int) ((void *) &v.p[0] - (void *) &v) + 0; +const int o1 = (int) ((void *) &v.p[0] - (void *) &v) + 1; diff --git a/gcc-4.6/gcc/testsuite/gcc.c-torture/compile/pr51077.c b/gcc-4.6/gcc/testsuite/gcc.c-torture/compile/pr51077.c new file mode 100644 index 000000000..de2b97e58 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.c-torture/compile/pr51077.c @@ -0,0 +1,15 @@ +/* PR middle-end/51077 */ + +struct S { unsigned char s, t[256]; }; + +void +foo (const struct S *x, struct S *y, int z) +{ + int i; + for (i = 0; i < 8; i++) + { + const struct S *a = &x[i]; + __builtin___memcpy_chk (y->t, a->t, z, __builtin_object_size (y->t, 0)); + y = (struct S *) &y->t[z]; + } +} diff --git a/gcc-4.6/gcc/testsuite/gcc.c-torture/execute/20111208-1.c b/gcc-4.6/gcc/testsuite/gcc.c-torture/execute/20111208-1.c new file mode 100644 index 000000000..8bcb10acc --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.c-torture/execute/20111208-1.c @@ -0,0 +1,94 @@ +/* PR tree-optimization/51315 */ +/* Reported by Jurij Smakov <jurij@wooyd.org> */ + +typedef unsigned int size_t; + +extern void *memcpy (void *__restrict __dest, + __const void *__restrict __src, size_t __n) + __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); + +extern size_t strlen (__const char *__s) + __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); + +typedef short int int16_t; +typedef int int32_t; + +extern void abort (void); + +int a; + +static void __attribute__ ((noinline,noclone)) +do_something (int item) +{ + a = item; +} + +int +pack_unpack (char *s, char *p) +{ + char *send, *pend; + char type; + int integer_size; + + send = s + strlen (s); + pend = p + strlen (p); + + while (p < pend) + { + type = *p++; + + switch (type) + { + case 's': + integer_size = 2; + goto unpack_integer; + + case 'l': + integer_size = 4; + goto unpack_integer; + + unpack_integer: + switch (integer_size) + { + case 2: + { + union + { + int16_t i; + char a[sizeof (int16_t)]; + } + v; + memcpy (v.a, s, sizeof (int16_t)); + s += sizeof (int16_t); + do_something (v.i); + } + break; + + case 4: + { + union + { + int32_t i; + char a[sizeof (int32_t)]; + } + v; + memcpy (v.a, s, sizeof (int32_t)); + s += sizeof (int32_t); + do_something (v.i); + } + break; + } + break; + } + } + return (int) *s; +} + +int +main (void) +{ + int n = pack_unpack ("\200\001\377\376\035\300", "sl"); + if (n != 0) + abort (); + return 0; +} diff --git a/gcc-4.6/gcc/testsuite/gcc.c-torture/execute/20111212-1.c b/gcc-4.6/gcc/testsuite/gcc.c-torture/execute/20111212-1.c new file mode 100644 index 000000000..c46e6e946 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.c-torture/execute/20111212-1.c @@ -0,0 +1,34 @@ +/* PR tree-optimization/50569 */ +/* Reported by Paul Koning <pkoning@gcc.gnu.org> */ +/* Reduced testcase by Mikael Pettersson <mikpe@it.uu.se> */ + +struct event { + struct { + unsigned int sec; + } sent __attribute__((packed)); +}; + +void __attribute__((noinline,noclone)) frob_entry(char *buf) +{ + struct event event; + + __builtin_memcpy(&event, buf, sizeof(event)); + if (event.sent.sec < 64) { + event.sent.sec = -1U; + __builtin_memcpy(buf, &event, sizeof(event)); + } +} + +int main(void) +{ + union { + char buf[1 + sizeof(struct event)]; + int align; + } u; + + __builtin_memset(&u, 0, sizeof u); + + frob_entry(&u.buf[1]); + + return 0; +} diff --git a/gcc-4.6/gcc/testsuite/gcc.c-torture/execute/20120105-1.c b/gcc-4.6/gcc/testsuite/gcc.c-torture/execute/20120105-1.c new file mode 100644 index 000000000..115ba1509 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.c-torture/execute/20120105-1.c @@ -0,0 +1,24 @@ +struct __attribute__((packed)) S +{ + int a, b, c; +}; + +static int __attribute__ ((noinline,noclone)) +extract(const char *p) +{ + struct S s; + __builtin_memcpy (&s, p, sizeof(struct S)); + return s.a; +} + +volatile int i; + +int main (void) +{ + char p[sizeof(struct S) + 1]; + + __builtin_memset (p, 0, sizeof(struct S) + 1); + i = extract (p + 1); + + return 0; +} diff --git a/gcc-4.6/gcc/testsuite/gcc.c-torture/execute/ieee/pr50310.c b/gcc-4.6/gcc/testsuite/gcc.c-torture/execute/ieee/pr50310.c new file mode 100644 index 000000000..8d323ca78 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.c-torture/execute/ieee/pr50310.c @@ -0,0 +1,73 @@ +/* PR target/50310 */ + +extern void abort (void); +double s1[4], s2[4], s3[64]; + +void +foo (void) +{ + int i; + for (i = 0; i < 4; i++) + s3[0 * 4 + i] = __builtin_isgreater (s1[i], s2[i]) ? -1.0 : 0.0; + for (i = 0; i < 4; i++) + s3[1 * 4 + i] = (!__builtin_isgreater (s1[i], s2[i])) ? -1.0 : 0.0; + for (i = 0; i < 4; i++) + s3[2 * 4 + i] = __builtin_isgreaterequal (s1[i], s2[i]) ? -1.0 : 0.0; + for (i = 0; i < 4; i++) + s3[3 * 4 + i] = (!__builtin_isgreaterequal (s1[i], s2[i])) ? -1.0 : 0.0; + for (i = 0; i < 4; i++) + s3[4 * 4 + i] = __builtin_isless (s1[i], s2[i]) ? -1.0 : 0.0; + for (i = 0; i < 4; i++) + s3[5 * 4 + i] = (!__builtin_isless (s1[i], s2[i])) ? -1.0 : 0.0; + for (i = 0; i < 4; i++) + s3[6 * 4 + i] = __builtin_islessequal (s1[i], s2[i]) ? -1.0 : 0.0; + for (i = 0; i < 4; i++) + s3[7 * 4 + i] = (!__builtin_islessequal (s1[i], s2[i])) ? -1.0 : 0.0; + for (i = 0; i < 4; i++) + s3[8 * 4 + i] = __builtin_islessgreater (s1[i], s2[i]) ? -1.0 : 0.0; + for (i = 0; i < 4; i++) + s3[9 * 4 + i] = (!__builtin_islessgreater (s1[i], s2[i])) ? -1.0 : 0.0; + for (i = 0; i < 4; i++) + s3[10 * 4 + i] = __builtin_isunordered (s1[i], s2[i]) ? -1.0 : 0.0; + for (i = 0; i < 4; i++) + s3[11 * 4 + i] = (!__builtin_isunordered (s1[i], s2[i])) ? -1.0 : 0.0; + for (i = 0; i < 4; i++) + s3[12 * 4 + i] = s1[i] > s2[i] ? -1.0 : 0.0; + for (i = 0; i < 4; i++) + s3[13 * 4 + i] = s1[i] <= s2[i] ? -1.0 : 0.0; + for (i = 0; i < 4; i++) + s3[14 * 4 + i] = s1[i] < s2[i] ? -1.0 : 0.0; + for (i = 0; i < 4; i++) + s3[15 * 4 + i] = s1[i] >= s2[i] ? -1.0 : 0.0; +} + +int +main () +{ + int i; + s1[0] = 5.0; + s1[1] = 6.0; + s1[2] = 5.0; + s1[3] = __builtin_nan (""); + s2[0] = 6.0; + s2[1] = 5.0; + s2[2] = 5.0; + s2[3] = 5.0; + asm volatile ("" : : : "memory"); + foo (); + asm volatile ("" : : : "memory"); + for (i = 0; i < 16 * 4; i++) + if (i >= 12 * 4 && (i & 3) == 3) + { + if (s3[i] != 0.0) abort (); + } + else + { + static int masks[] = { 2, 2|4, 1, 1|4, 1|2, 8, 2, 1 }; + if (s3[i] + != (((1 << (i & 3)) & ((i & 4) ? ~masks[i / 8] : masks[i / 8])) + ? -1.0 : 0.0)) + abort (); + } + return 0; +} diff --git a/gcc-4.6/gcc/testsuite/gcc.c-torture/execute/pr49279.c b/gcc-4.6/gcc/testsuite/gcc.c-torture/execute/pr49279.c new file mode 100644 index 000000000..7f2c0d221 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.c-torture/execute/pr49279.c @@ -0,0 +1,35 @@ +/* PR tree-optimization/49279 */ +extern void abort (void); + +struct S { int a; int *__restrict p; }; + +__attribute__((noinline, noclone)) +struct S *bar (struct S *p) +{ + struct S *r; + asm volatile ("" : "=r" (r) : "0" (p) : "memory"); + return r; +} + +__attribute__((noinline, noclone)) +int +foo (int *p, int *q) +{ + struct S s, *t; + s.a = 1; + s.p = p; + t = bar (&s); + t->p = q; + s.p[0] = 0; + t->p[0] = 1; + return s.p[0]; +} + +int +main () +{ + int a, b; + if (foo (&a, &b) != 1) + abort (); + return 0; +} diff --git a/gcc-4.6/gcc/testsuite/gcc.c-torture/execute/pr49768.c b/gcc-4.6/gcc/testsuite/gcc.c-torture/execute/pr49768.c new file mode 100644 index 000000000..85bc9d2a0 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.c-torture/execute/pr49768.c @@ -0,0 +1,12 @@ +/* PR tree-optimization/49768 */ + +extern void abort (void); + +int +main () +{ + static struct { unsigned int : 1; unsigned int s : 1; } s = { .s = 1 }; + if (s.s != 1) + abort (); + return 0; +} diff --git a/gcc-4.6/gcc/testsuite/gcc.c-torture/execute/pr51323.c b/gcc-4.6/gcc/testsuite/gcc.c-torture/execute/pr51323.c new file mode 100644 index 000000000..929579983 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.c-torture/execute/pr51323.c @@ -0,0 +1,35 @@ +/* PR middle-end/51323 */ + +extern void abort (void); +struct S { int a, b, c; }; +int v; + +__attribute__((noinline, noclone)) void +foo (int x, int y, int z) +{ + if (x != v || y != 0 || z != 9) + abort (); +} + +static inline int +baz (const struct S *p) +{ + return p->b; +} + +__attribute__((noinline, noclone)) void +bar (int x, struct S y) +{ + foo (baz (&y), 0, x); +} + +int +main () +{ + struct S s; + v = 3; s.a = v - 1; s.b = v; s.c = v + 1; + bar (9, s); + v = 17; s.a = v - 1; s.b = v; s.c = v + 1; + bar (9, s); + return 0; +} diff --git a/gcc-4.6/gcc/testsuite/gcc.c-torture/execute/pr51466.c b/gcc-4.6/gcc/testsuite/gcc.c-torture/execute/pr51466.c new file mode 100644 index 000000000..aa0b7fd4f --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.c-torture/execute/pr51466.c @@ -0,0 +1,43 @@ +/* PR tree-optimization/51466 */ + +extern void abort (void); + +__attribute__((noinline, noclone)) int +foo (int i) +{ + volatile int v[4]; + int *p; + v[i] = 6; + p = (int *) &v[i]; + return *p; +} + +__attribute__((noinline, noclone)) int +bar (int i) +{ + volatile int v[4]; + int *p; + v[i] = 6; + p = (int *) &v[i]; + *p = 8; + return v[i]; +} + +__attribute__((noinline, noclone)) int +baz (int i) +{ + volatile int v[4]; + int *p; + v[i] = 6; + p = (int *) &v[0]; + *p = 8; + return v[i]; +} + +int +main () +{ + if (foo (3) != 6 || bar (2) != 8 || baz (0) != 8 || baz (1) != 6) + abort (); + return 0; +} diff --git a/gcc-4.6/gcc/testsuite/gcc.c-torture/execute/pr52129.c b/gcc-4.6/gcc/testsuite/gcc.c-torture/execute/pr52129.c new file mode 100644 index 000000000..a60bfa8bb --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.c-torture/execute/pr52129.c @@ -0,0 +1,28 @@ +/* PR target/52129 */ + +extern void abort (void); +struct S { void *p; unsigned int q; }; +struct T { char a[64]; char b[64]; } t; + +__attribute__((noinline, noclone)) int +foo (void *x, struct S s, void *y, void *z) +{ + if (x != &t.a[2] || s.p != &t.b[5] || s.q != 27 || y != &t.a[17] || z != &t.b[17]) + abort (); + return 29; +} + +__attribute__((noinline, noclone)) int +bar (void *x, void *y, void *z, struct S s, int t, struct T *u) +{ + return foo (x, s, &u->a[t], &u->b[t]); +} + +int +main () +{ + struct S s = { &t.b[5], 27 }; + if (bar (&t.a[2], (void *) 0, (void *) 0, s, 17, &t) != 29) + abort (); + return 0; +} diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/automversn_1.c b/gcc-4.6/gcc/testsuite/gcc.dg/automversn_1.c new file mode 100644 index 000000000..849a72638 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.dg/automversn_1.c @@ -0,0 +1,27 @@ +/* Check that the auto_clone pass works correctly. Function foo must be cloned + because it is hot and has a vectorizable store. */ + +/* { dg-options "-O2 -ftree-vectorize -mvarch=core2 -fdump-tree-auto_clone" } */ +/* { dg-do run } */ + +char a[16]; + +int __attribute__ ((hot)) __attribute__ ((noinline)) +foo (void) +{ + int i; + for (i = 0; i< 16; i++) + a[i] = 0; + return 0; +} + +int +main () +{ + return foo (); +} + + +/* { dg-final { scan-tree-dump "foo\.autoclone\.original" "auto_clone" } } */ +/* { dg-final { scan-tree-dump "foo\.autoclone\.0" "auto_clone" } } */ +/* { dg-final { cleanup-tree-dump "auto_clone" } } */ diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/builtin-object-size-12.c b/gcc-4.6/gcc/testsuite/gcc.dg/builtin-object-size-12.c new file mode 100644 index 000000000..b21eb0071 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.dg/builtin-object-size-12.c @@ -0,0 +1,19 @@ +/* { dg-do run } */ +/* { dg-options "-O2" } */ + +extern void abort (void); +struct S { + int len; + char s[0]; +}; +int main() +{ + char buf[sizeof (struct S) + 32]; + if (__builtin_object_size (((struct S *)&buf[0])->s, 1) != 32) + abort (); + if (__builtin_object_size (((struct S *)&buf[1])->s, 1) != 31) + abort (); + if (__builtin_object_size (((struct S *)&buf[64])->s, 0) != 0) + abort (); + return 0; +} diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/compat/struct-layout-1_test.h b/gcc-4.6/gcc/testsuite/gcc.dg/compat/struct-layout-1_test.h index 4a70dfd06..affddcaef 100644 --- a/gcc-4.6/gcc/testsuite/gcc.dg/compat/struct-layout-1_test.h +++ b/gcc-4.6/gcc/testsuite/gcc.dg/compat/struct-layout-1_test.h @@ -1,5 +1 @@ -#if (__SIZEOF_INT__ >= 4) -T(0,enum E2 a:31;,B(0,a,e2_m1,e2_0)) -#else -T(0,enum E2 a:15;,B(0,a,e2_m1,e2_0)) -#endif +T(0,enum E2 a:7;,B(0,a,e2_m1,e2_0)) diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/cpp/assert4.c b/gcc-4.6/gcc/testsuite/gcc.dg/cpp/assert4.c index 0bd88ce06..e6d0b2c50 100644 --- a/gcc-4.6/gcc/testsuite/gcc.dg/cpp/assert4.c +++ b/gcc-4.6/gcc/testsuite/gcc.dg/cpp/assert4.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2006, 2008 Free Software Foundation, Inc. +/* Copyright (C) 2003, 2006, 2008, 2009, 2011 Free Software Foundation, Inc. Test builtin preprocessor assertions. By Kaveh Ghazi <ghazi@caip.rutgers.edu>. */ @@ -7,7 +7,7 @@ /* Check for #system assertions. */ -#if defined __gnu_linux__ +#if defined __linux__ # if !#system(linux) || !#system(unix) || !#system(posix) # error # endif diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/debug/dwarf2/pr49871.c b/gcc-4.6/gcc/testsuite/gcc.dg/debug/dwarf2/pr49871.c new file mode 100644 index 000000000..c1a58c4bd --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.dg/debug/dwarf2/pr49871.c @@ -0,0 +1,12 @@ +/* PR debug/49871 */ +/* { dg-do compile } */ +/* { dg-options "-gdwarf-3 -dA -fno-merge-debug-strings" } */ + +struct S +{ + char a[1 << 16]; + int b; +} s; + +/* { dg-final { scan-assembler "\\(DW_AT_data_member_location\\)\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\\(DW_FORM_udata\\)" } } */ +/* { dg-final { scan-assembler-not "\\(DW_AT_data_member_location\\)\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\\(DW_FORM_data\[48\]\\)" } } */ diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/debug/dwarf2/pr51410.c b/gcc-4.6/gcc/testsuite/gcc.dg/debug/dwarf2/pr51410.c new file mode 100644 index 000000000..957c152b4 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.dg/debug/dwarf2/pr51410.c @@ -0,0 +1,13 @@ +/* PR debug/51410 */ +/* { dg-do compile } */ +/* { dg-options "-O0 -gdwarf-2 -dA -fno-merge-debug-strings" } */ + +int x; + +int +foo (void) +{ + return x; +} + +/* { dg-final { scan-assembler-times "\\(DIE\[^\\r\\n\]*DW_TAG_variable\\)" 1 } } */ diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/delay-slot-2.c b/gcc-4.6/gcc/testsuite/gcc.dg/delay-slot-2.c new file mode 100644 index 000000000..79faf81c7 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.dg/delay-slot-2.c @@ -0,0 +1,116 @@ +/* PR rtl-optimization/51187 */ +/* Reported by Jurij Smakov <jurij@wooyd.org> */ + +/* { dg-do compile } */ +/* { dg-options "-g -O2" } */ + +extern int printf (__const char *__restrict __format, ...); +extern void print_c_condition (const char *); + +enum decision_type +{ + DT_num_insns, + DT_mode, DT_code, DT_veclen, + DT_elt_zero_int, DT_elt_one_int, DT_elt_zero_wide, DT_elt_zero_wide_safe, + DT_const_int, + DT_veclen_ge, DT_dup, DT_pred, DT_c_test, + DT_accept_op, DT_accept_insn +}; + +struct decision_test +{ + struct decision_test *next; + enum decision_type type; + + union + { + int num_insns; + + struct + { + const char *name; + } pred; + + const char *c_test; + int veclen; + int dup; + long intval; + int opno; + + struct { + int code_number; + int lineno; + int num_clobbers_to_add; + } insn; + } u; +}; + +enum routine_type { + RECOG, SPLIT, PEEPHOLE2 +}; + +void +write_cond (struct decision_test *p, int depth, + enum routine_type subroutine_type) +{ + switch (p->type) + { + case DT_num_insns: + printf ("peep2_current_count >= %d", p->u.num_insns); + break; + + case DT_code: + printf ("GET_CODE (x%d) == ", depth); + break; + + case DT_veclen: + printf ("XVECLEN (x%d, 0) == %d", depth, p->u.veclen); + break; + + case DT_elt_zero_int: + printf ("XINT (x%d, 0) == %d", depth, (int) p->u.intval); + break; + + case DT_elt_one_int: + printf ("XINT (x%d, 1) == %d", depth, (int) p->u.intval); + break; + + case DT_elt_zero_wide: + case DT_elt_zero_wide_safe: + printf ("XWINT (x%d, 0) == ", depth); + print_host_wide_int (p->u.intval); + break; + + case DT_const_int: + printf ("x%d == const_int_rtx[MAX_SAVED_CONST_INT + (%d)]", + depth, (int) p->u.intval); + break; + + case DT_veclen_ge: + printf ("XVECLEN (x%d, 0) >= %d", depth, p->u.veclen); + break; + + case DT_dup: + printf ("rtx_equal_p (x%d, operands[%d])", depth, p->u.dup); + break; + + case DT_pred: + printf ("%s (x%d)", p->u.pred.name, depth); + break; + + case DT_c_test: + print_c_condition (p->u.c_test); + break; + + case DT_accept_insn: + ((void)(__builtin_expect(!(subroutine_type == RECOG), 0) ? __builtin_unreachable(), 0 : 0)); + ((void)(__builtin_expect(!(p->u.insn.num_clobbers_to_add), 0) ? __builtin_unreachable(), 0 : 0)); + printf ("pnum_clobbers != NULL"); + break; + + default: + __builtin_unreachable(); + } +} + +/* { dg-final { scan-assembler "printf" } } */ diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/fstack-protector-strong.c b/gcc-4.6/gcc/testsuite/gcc.dg/fstack-protector-strong.c new file mode 100644 index 000000000..5a5cf98a7 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.dg/fstack-protector-strong.c @@ -0,0 +1,135 @@ +/* Test that stack protection is done on chosen functions. */ + +/* { dg-do compile { target i?86-*-* x86_64-*-* } } */ +/* { dg-options "-O2 -fstack-protector-strong" } */ + +#include<string.h> +#include<stdlib.h> + +extern int g0; +extern int* pg0; +int +goo (int *); +int +hoo (int); + +/* Function frame address escaped function call. */ +int +foo1 () +{ + int i; + return goo (&i); +} + +struct ArrayStruct +{ + int a; + int array[10]; +}; + +struct AA +{ + int b; + struct ArrayStruct as; +}; + +/* Function frame contains array. */ +int +foo2 () +{ + struct AA aa; + int i; + for (i = 0; i < 10; ++i) + { + aa.as.array[i] = i * (i-1) + i / 2; + } + return aa.as.array[5]; +} + +/* Address computation based on a function frame address. */ +int +foo3 () +{ + int a; + int *p; + p = &a + 5; + return goo (p); +} + +/* Address cast based on a function frame address. */ +int +foo4 () +{ + int a; + return goo (g0 << 2 ? (int *)(3 * (long)(void *)(&a)) : 0); +} + +/* Address cast based on a local array. */ +int +foo5 () +{ + short array[10]; + return goo ((int *)(array + 5)); +} + +struct BB +{ + int one; + int two; + int three; +}; + +/* Address computaton based on a function frame address.*/ +int +foo6 () +{ + struct BB bb; + return goo (&bb.one + sizeof(int)); +} + +/* Function frame address escaped via global variable. */ +int +foo7 () +{ + int a; + pg0 = &a; + goo (pg0); + return *pg0; +} + +/* Check that this covers -fstack-protector. */ +int +foo8 () +{ + char base[100]; + memcpy ((void *)base, (const void *)pg0, 105); + return (int)(base[32]); +} + +/* Check that this covers -fstack-protector. */ +int +foo9 () +{ + char* p = alloca (100); + return goo ((int *)(p + 50)); +} + +int +global2 (struct BB* pbb); + +/* Address taken on struct. */ +int +foo10 () +{ + struct BB bb; + int i; + bb.one = global2 (&bb); + for (i = 0; i < 10; ++i) + { + bb.two = bb.one + bb.two; + bb.three = bb.one + bb.two + bb.three; + } + return bb.three; +} + +/* { dg-final { scan-assembler-times "stack_chk_fail" 10 } } */ diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/gomp/pr51339.c b/gcc-4.6/gcc/testsuite/gcc.dg/gomp/pr51339.c new file mode 100644 index 000000000..198e4c13e --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.dg/gomp/pr51339.c @@ -0,0 +1,15 @@ +/* PR c/51339 */ +/* { dg-do compile } */ +/* { dg-options "-fopenmp" } */ + +char g[] = "g"; + +void +foo (void) +{ +#pragma omp parallel sections firstprivate (g) lastprivate (g) + { + #pragma omp section + g[0] = 'h'; + } +} diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/inline-dump.c b/gcc-4.6/gcc/testsuite/gcc.dg/inline-dump.c new file mode 100644 index 000000000..f08bd005a --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.dg/inline-dump.c @@ -0,0 +1,11 @@ +/* Verify that -fopt-info can output correct inline info. */ +/* { dg-do compile } */ +/* { dg-options "-Wall -fopt-info -O2 -fno-early-inlining" } */ +static inline int leaf() { + int i, ret = 0; + for (i = 0; i < 10; i++) + ret += i; + return ret; +} +static inline int foo(void) { return leaf(); } /* { dg-message "note: leaf inlined into bar .via inline instance foo." } */ +int bar(void) { return foo(); } /* { dg-message "note: foo inlined into bar" } */ diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/inline_1.c b/gcc-4.6/gcc/testsuite/gcc.dg/inline_1.c index 08ccb86f6..0ab4986a6 100644 --- a/gcc-4.6/gcc/testsuite/gcc.dg/inline_1.c +++ b/gcc-4.6/gcc/testsuite/gcc.dg/inline_1.c @@ -20,4 +20,3 @@ int foo2 (void) /* { dg-final { scan-tree-dump-times "bar" 5 "optimized" } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ -/* { dg-excess-errors "extra notes" } */ diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/inline_2.c b/gcc-4.6/gcc/testsuite/gcc.dg/inline_2.c index efdc76a98..0803aebc6 100644 --- a/gcc-4.6/gcc/testsuite/gcc.dg/inline_2.c +++ b/gcc-4.6/gcc/testsuite/gcc.dg/inline_2.c @@ -20,4 +20,3 @@ int foo2 (void) /* { dg-final { scan-tree-dump-times "bar" 5 "optimized" } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ -/* { dg-excess-errors "extra notes" } */ diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/inline_3.c b/gcc-4.6/gcc/testsuite/gcc.dg/inline_3.c index 70a23665d..6d5f3654a 100644 --- a/gcc-4.6/gcc/testsuite/gcc.dg/inline_3.c +++ b/gcc-4.6/gcc/testsuite/gcc.dg/inline_3.c @@ -20,4 +20,3 @@ int foo2 (void) /* { dg-final { scan-tree-dump-times "bar" 5 "optimized" } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ -/* { dg-excess-errors "extra notes" } */ diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/inline_4.c b/gcc-4.6/gcc/testsuite/gcc.dg/inline_4.c index 9a85242a4..ca8049545 100644 --- a/gcc-4.6/gcc/testsuite/gcc.dg/inline_4.c +++ b/gcc-4.6/gcc/testsuite/gcc.dg/inline_4.c @@ -20,4 +20,3 @@ int foo2 (void) /* { dg-final { scan-tree-dump-times "bar" 4 "optimized" } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ -/* { dg-excess-errors "extra notes" } */ diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/ipa/ipa-sra-2.c b/gcc-4.6/gcc/testsuite/gcc.dg/ipa/ipa-sra-2.c index 3437a81aa..c6b4d63aa 100644 --- a/gcc-4.6/gcc/testsuite/gcc.dg/ipa/ipa-sra-2.c +++ b/gcc-4.6/gcc/testsuite/gcc.dg/ipa/ipa-sra-2.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fipa-sra -fdump-tree-eipa_sra-details" } */ +/* { dg-require-effective-target non_strict_align } */ struct bovid { diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/ipa/ipa-sra-6.c b/gcc-4.6/gcc/testsuite/gcc.dg/ipa/ipa-sra-6.c index 603829491..487e72ef4 100644 --- a/gcc-4.6/gcc/testsuite/gcc.dg/ipa/ipa-sra-6.c +++ b/gcc-4.6/gcc/testsuite/gcc.dg/ipa/ipa-sra-6.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fipa-sra -fdump-tree-eipa_sra-slim" } */ +/* { dg-require-effective-target non_strict_align } */ struct bovid { diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/mversn2.c b/gcc-4.6/gcc/testsuite/gcc.dg/mversn2.c index 070487da8..a08948cb8 100644 --- a/gcc-4.6/gcc/testsuite/gcc.dg/mversn2.c +++ b/gcc-4.6/gcc/testsuite/gcc.dg/mversn2.c @@ -39,9 +39,9 @@ main () return fn1 (); } -/* { dg-final { scan-tree-dump "fn1_clone_1" "optimized" } } */ -/* { dg-final { scan-tree-dump "dispatch_clone_0" "optimized" } } */ -/* { dg-final { scan-tree-dump "dispatch_clone_1" "optimized" } } */ -/* { dg-final { scan-tree-dump-not "main_clone_0" "optimized" } } */ -/* { dg-final { scan-tree-dump-not "main_clone_1" "optimized" } } */ +/* { dg-final { scan-tree-dump "fn1\.clone\.1" "optimized" } } */ +/* { dg-final { scan-tree-dump "dispatch\.clone\.0" "optimized" } } */ +/* { dg-final { scan-tree-dump "dispatch\.clone\.1" "optimized" } } */ +/* { dg-final { scan-tree-dump-not "main\.clone\.0" "optimized" } } */ +/* { dg-final { scan-tree-dump-not "main\.clone\.1" "optimized" } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/pr26570.c b/gcc-4.6/gcc/testsuite/gcc.dg/pr26570.c index 5768d32cc..71c16f207 100644 --- a/gcc-4.6/gcc/testsuite/gcc.dg/pr26570.c +++ b/gcc-4.6/gcc/testsuite/gcc.dg/pr26570.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fprofile-generate -fprofile-use" } */ +/* { dg-options "-O2 -fprofile-generate -fprofile-use -fopt-info" } */ unsigned test (unsigned a, unsigned b) { diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/pr32773.c b/gcc-4.6/gcc/testsuite/gcc.dg/pr32773.c index e9cdd4c37..19a90195a 100644 --- a/gcc-4.6/gcc/testsuite/gcc.dg/pr32773.c +++ b/gcc-4.6/gcc/testsuite/gcc.dg/pr32773.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O -fprofile-use" } */ -/* { dg-options "-O -m4 -fprofile-use" { target sh-*-* } } */ +/* { dg-options "-O -fprofile-use -fopt-info" } */ +/* { dg-options "-O -m4 -fprofile-use -fopt-info" { target sh-*-* } } */ void foo (int *p) { diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/pr40209.c b/gcc-4.6/gcc/testsuite/gcc.dg/pr40209.c index f367f7c24..afe131fc5 100644 --- a/gcc-4.6/gcc/testsuite/gcc.dg/pr40209.c +++ b/gcc-4.6/gcc/testsuite/gcc.dg/pr40209.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fprofile-use" } */ +/* { dg-options "-O2 -fprofile-use -fopt-info" } */ void process(const char *s); diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/pr45819.c b/gcc-4.6/gcc/testsuite/gcc.dg/pr45819.c new file mode 100644 index 000000000..4979fd328 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.dg/pr45819.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-optimized -w" } */ + +struct ehci_regs { + char x; + unsigned int port_status[0]; +} __attribute__ ((packed)); + +struct ehci_hcd { + struct ehci_regs *regs; +}; + +int ehci_hub_control (struct ehci_hcd *ehci, int wIndex) +{ + unsigned int *status_reg = &ehci->regs->port_status[wIndex]; + return *(volatile unsigned int *)status_reg; +} + +/* { dg-final { scan-tree-dump "={v}" "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/pr48739-1.c b/gcc-4.6/gcc/testsuite/gcc.dg/pr48739-1.c new file mode 100644 index 000000000..4dcdca977 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.dg/pr48739-1.c @@ -0,0 +1,27 @@ +/* PR tree-optimization/48739 */ +/* { dg-do compile } */ +/* { dg-require-effective-target pthread } */ +/* { dg-options "-O1 -ftree-parallelize-loops=2 -fno-tree-dominator-opts" } */ + +extern int g; +extern void bar (void); + +int +foo (int x) +{ + int a, b, *c = (int *) 0; + for (a = 0; a < 10; ++a) + { + bar (); + for (b = 0; b < 5; ++b) + { + x = 0; + c = &x; + g = 1; + } + } + *c = x; + for (x = 0; x != 10; x++) + ; + return g; +} diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/pr48739-2.c b/gcc-4.6/gcc/testsuite/gcc.dg/pr48739-2.c new file mode 100644 index 000000000..c79f4e86a --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.dg/pr48739-2.c @@ -0,0 +1,27 @@ +/* PR tree-optimization/48739 */ +/* { dg-do compile } */ +/* { dg-require-effective-target pthread } */ +/* { dg-options "-O1 -ftree-parallelize-loops=2 -fno-tree-dominator-opts" } */ + +extern int g, v[10]; +extern void bar (void); + +int +foo (int x) +{ + int a, b, *c = (int *) 0; + for (a = 0; a < 10; ++a) + { + bar (); + for (b = 0; b < 5; ++b) + { + x = 0; + c = &x; + g = 1; + } + } + *c = x; + for (x = 0; x != 10; x++) + v[x] = x; + return g; +} diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/pr49799.c b/gcc-4.6/gcc/testsuite/gcc.dg/pr49799.c new file mode 100644 index 000000000..61ac261be --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.dg/pr49799.c @@ -0,0 +1,25 @@ +/* PR rtl-optimization/49799 */ +/* { dg-do assemble } */ +/* { dg-options "-O2 -w" } */ + +static __inline int bar(int a) +{ + int tmp; + + if (a <= 0) a ^= 0xFFFFFFFF; + + return tmp - 1; +} + +void foo(short *K) +{ + short tmp; + short *pptr, P[14]; + + pptr = P; + tmp = bar(*K); + *pptr = (*K << tmp) >> 16; + + if (*P < tmp) + *K++ = 0; +} diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/pr49948.c b/gcc-4.6/gcc/testsuite/gcc.dg/pr49948.c new file mode 100644 index 000000000..f74239380 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.dg/pr49948.c @@ -0,0 +1,22 @@ +/* PR tree-optimization/49948 */ +/* { dg-do compile } */ +/* { dg-options "-O3 -ftree-parallelize-loops=2" } */ + +extern int a, *b; +int +foo (void) +{ + int c, d = 8, *e[8], i; + if (a <= 7) + { + for (i = 0; i < 8; ++i) + e[i] = &c; + while (--d) + { + a = 0; + b = e[0]; + } + return 0; + } + return b == &d; +} diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/pr50078.c b/gcc-4.6/gcc/testsuite/gcc.dg/pr50078.c new file mode 100644 index 000000000..a8aee43fb --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.dg/pr50078.c @@ -0,0 +1,14 @@ +/* PR tree-optimization/50078 */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +unsigned nonvolvar[2]; + +void +test (int arg) +{ + unsigned v = *(volatile unsigned *) (&nonvolvar[arg]); + *(volatile unsigned *) (&nonvolvar[arg]) = v; +} + +/* { dg-final { scan-assembler-times "movl\[^\n\r\]*nonvolvar" 2 { target { { i?86-*-* x86_64-*-* } && nonpic } } } } */ diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/pr50310-2.c b/gcc-4.6/gcc/testsuite/gcc.dg/pr50310-2.c new file mode 100644 index 000000000..29621729e --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.dg/pr50310-2.c @@ -0,0 +1,47 @@ +/* PR target/50310 */ +/* { dg-do run } */ +/* { dg-options "-O3" } */ +/* { dg-options "-O3 -mavx" { target avx_runtime } } */ + +double s1[4], s2[4], s3[64]; + +int +main (void) +{ + int i; + asm volatile ("" : : : "memory"); + for (i = 0; i < 4; i++) + s3[0 * 4 + i] = __builtin_isgreater (s1[i], s2[i]) ? -1.0 : 0.0; + for (i = 0; i < 4; i++) + s3[1 * 4 + i] = (!__builtin_isgreater (s1[i], s2[i])) ? -1.0 : 0.0; + for (i = 0; i < 4; i++) + s3[2 * 4 + i] = __builtin_isgreaterequal (s1[i], s2[i]) ? -1.0 : 0.0; + for (i = 0; i < 4; i++) + s3[3 * 4 + i] = (!__builtin_isgreaterequal (s1[i], s2[i])) ? -1.0 : 0.0; + for (i = 0; i < 4; i++) + s3[4 * 4 + i] = __builtin_isless (s1[i], s2[i]) ? -1.0 : 0.0; + for (i = 0; i < 4; i++) + s3[5 * 4 + i] = (!__builtin_isless (s1[i], s2[i])) ? -1.0 : 0.0; + for (i = 0; i < 4; i++) + s3[6 * 4 + i] = __builtin_islessequal (s1[i], s2[i]) ? -1.0 : 0.0; + for (i = 0; i < 4; i++) + s3[7 * 4 + i] = (!__builtin_islessequal (s1[i], s2[i])) ? -1.0 : 0.0; + for (i = 0; i < 4; i++) + s3[8 * 4 + i] = __builtin_islessgreater (s1[i], s2[i]) ? -1.0 : 0.0; + for (i = 0; i < 4; i++) + s3[9 * 4 + i] = (!__builtin_islessgreater (s1[i], s2[i])) ? -1.0 : 0.0; + for (i = 0; i < 4; i++) + s3[10 * 4 + i] = __builtin_isunordered (s1[i], s2[i]) ? -1.0 : 0.0; + for (i = 0; i < 4; i++) + s3[11 * 4 + i] = (!__builtin_isunordered (s1[i], s2[i])) ? -1.0 : 0.0; + for (i = 0; i < 4; i++) + s3[12 * 4 + i] = s1[i] > s2[i] ? -1.0 : 0.0; + for (i = 0; i < 4; i++) + s3[13 * 4 + i] = s1[i] >= s2[i] ? -1.0 : 0.0; + for (i = 0; i < 4; i++) + s3[14 * 4 + i] = s1[i] < s2[i] ? -1.0 : 0.0; + for (i = 0; i < 4; i++) + s3[15 * 4 + i] = s1[i] <= s2[i] ? -1.0 : 0.0; + asm volatile ("" : : : "memory"); + return 0; +} diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/pr50571.c b/gcc-4.6/gcc/testsuite/gcc.dg/pr50571.c new file mode 100644 index 000000000..3fb4310d6 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.dg/pr50571.c @@ -0,0 +1,11 @@ +/* PR inline-asm/50571 */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +static const int var[4] = { 1, 2, 3, 4 }; + +void +foo (void) +{ + __asm volatile ("" : : "m" (*(int *) var)); +} diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/pr51408.c b/gcc-4.6/gcc/testsuite/gcc.dg/pr51408.c new file mode 100644 index 000000000..2cc5cf967 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.dg/pr51408.c @@ -0,0 +1,22 @@ +/* This testcase used to fail because of a bug in + arm.md:*minmax_arithsi. */ + +/* { dg-do run } */ +/* { dg-options "-O1" } */ + +extern void abort (void); + +int __attribute__((noinline)) +foo (int a, int b) +{ + int max = (b > 0) ? b : 0; + return max - a; +} + +int +main (void) +{ + if (foo (3, -1) != -3) + abort (); + return 0; +} diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/predict-1.c b/gcc-4.6/gcc/testsuite/gcc.dg/predict-1.c new file mode 100644 index 000000000..0469a2b5e --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.dg/predict-1.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-profile_estimate" } */ + +extern int global; + +int bar(int); + +void foo (int bound) +{ + int i, ret = 0; + for (i = 0; i < bound; i++) + { + if (i > bound - 2) + global += bar (i); + } +} + +/* { dg-final { scan-tree-dump "loop iv compare heuristics" "profile_estimate"} } */ +/* { dg-final { cleanup-tree-dump "profile_estimate" } } */ diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/predict-2.c b/gcc-4.6/gcc/testsuite/gcc.dg/predict-2.c new file mode 100644 index 000000000..32b09da73 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.dg/predict-2.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-profile_estimate" } */ + +extern int global; + +int bar(int); + +void foo (int bound) +{ + int i, ret = 0; + for (i = 0; i < bound; i++) + { + if (i > bound * bound ) + global += bar (i); + } +} + +/* { dg-final { scan-tree-dump-not "loop iv compare heuristics" "profile_estimate"} } */ +/* { dg-final { cleanup-tree-dump "profile_estimate" } } */ diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/predict-3.c b/gcc-4.6/gcc/testsuite/gcc.dg/predict-3.c new file mode 100644 index 000000000..f34a77a25 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.dg/predict-3.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-profile_estimate" } */ + +extern int global; + +int bar(int); + +void foo (int bound) +{ + int i, ret = 0; + for (i = 0; i <= bound; i++) + { + if (i != bound) + global += bar (i); + } +} + +/* { dg-final { scan-tree-dump "loop iv compare heuristics" "profile_estimate"} } */ +/* { dg-final { cleanup-tree-dump "profile_estimate" } } */ diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/predict-4.c b/gcc-4.6/gcc/testsuite/gcc.dg/predict-4.c new file mode 100644 index 000000000..6ff19fb18 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.dg/predict-4.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-profile_estimate" } */ + +extern int global; + +int bar(int); + +void foo (int bound) +{ + int i, ret = 0; + for (i = 0; i < 10; i++) + { + if (i < 5) + global += bar (i); + } +} + +/* { dg-final { scan-tree-dump "loop iv compare heuristics" "profile_estimate"} } */ +/* { dg-final { cleanup-tree-dump "profile_estimate" } } */ diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/record-gcc-switches-in-elf-1.c b/gcc-4.6/gcc/testsuite/gcc.dg/record-gcc-switches-in-elf-1.c new file mode 100644 index 000000000..d79662059 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.dg/record-gcc-switches-in-elf-1.c @@ -0,0 +1,16 @@ +/* { dg-do compile} */ +/* { dg-options "-frecord-gcc-switches-in-elf -Dtest -dA" } */ + +void foobar(int); + +void +foo (void) +{ + int i; + for (i = 0; i < 100; i++) + { + foobar(i); + } +} + +/* { dg-final { scan-assembler-times "Dtest" 1 } } */ diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/sample-profile-generate-1.c b/gcc-4.6/gcc/testsuite/gcc.dg/sample-profile-generate-1.c new file mode 100644 index 000000000..89f17eaf6 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.dg/sample-profile-generate-1.c @@ -0,0 +1,26 @@ +/* { dg-do compile} */ +/* { dg-options "-O2 -fprofile-generate -fprofile-generate-sampling" } */ + +void foobar(int); + +void +foo (void) +{ + int i; + for (i = 0; i < 100; i++) + { + foobar(i); + } +} + +void +bar (void) +{ + int i; + for (i = 0; i < 100; i++) + { + foobar(i); + } +} + +/* { dg-final { cleanup-coverage-files } } */ diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/torture/pr49518.c b/gcc-4.6/gcc/testsuite/gcc.dg/torture/pr49518.c new file mode 100644 index 000000000..84a10fbbe --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.dg/torture/pr49518.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ + +int a, b; +struct S { unsigned int s, t, u; } c, d = { 0, 1, 0 }; + +void +test (unsigned char z) +{ + char e[] = {0, 0, 0, 0, 1}; + for (c.s = 1; c.s; c.s++) + { + b = e[c.s]; + if (a) + break; + b = z >= c.u; + if (d.t) + break; + } +} diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/torture/pr49886.c b/gcc-4.6/gcc/testsuite/gcc.dg/torture/pr49886.c new file mode 100644 index 000000000..f0e8e60d3 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.dg/torture/pr49886.c @@ -0,0 +1,102 @@ +/* { dg-do run } */ + +struct PMC { + unsigned flags; +}; + +typedef struct Pcc_cell +{ + struct PMC *p; + long bla; + long type; +} Pcc_cell; + +int gi; +int cond; + +extern void abort (); +extern void never_ever(int interp, struct PMC *pmc) + __attribute__((noinline,noclone)); + +void never_ever (int interp, struct PMC *pmc) +{ + abort (); +} + +static void mark_cell(int * interp, Pcc_cell *c) + __attribute__((__nonnull__(1))); + +static void +mark_cell(int * interp, Pcc_cell *c) +{ + if (!cond) + return; + + if (c && c->type == 4 && c->p + && !(c->p->flags & (1<<18))) + never_ever(gi + 1, c->p); + if (c && c->type == 4 && c->p + && !(c->p->flags & (1<<17))) + never_ever(gi + 2, c->p); + if (c && c->type == 4 && c->p + && !(c->p->flags & (1<<16))) + never_ever(gi + 3, c->p); + if (c && c->type == 4 && c->p + && !(c->p->flags & (1<<15))) + never_ever(gi + 4, c->p); + if (c && c->type == 4 && c->p + && !(c->p->flags & (1<<14))) + never_ever(gi + 5, c->p); + if (c && c->type == 4 && c->p + && !(c->p->flags & (1<<13))) + never_ever(gi + 6, c->p); + if (c && c->type == 4 && c->p + && !(c->p->flags & (1<<12))) + never_ever(gi + 7, c->p); + if (c && c->type == 4 && c->p + && !(c->p->flags & (1<<11))) + never_ever(gi + 8, c->p); + if (c && c->type == 4 && c->p + && !(c->p->flags & (1<<10))) + never_ever(gi + 9, c->p); +} + +static void +foo(int * interp, Pcc_cell *c) +{ + mark_cell(interp, c); +} + +static struct Pcc_cell * +__attribute__((noinline,noclone)) +getnull(void) +{ + return (struct Pcc_cell *) 0; +} + + +int main() +{ + int i; + + cond = 1; + for (i = 0; i < 100; i++) + foo (&gi, getnull ()); + return 0; +} + + +void +bar_1 (int * interp, Pcc_cell *c) +{ + c->bla += 1; + mark_cell(interp, c); +} + +void +bar_2 (int * interp, Pcc_cell *c) +{ + c->bla += 2; + mark_cell(interp, c); +} + diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/torture/pr50092.c b/gcc-4.6/gcc/testsuite/gcc.dg/torture/pr50092.c new file mode 100644 index 000000000..c8a929b2c --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.dg/torture/pr50092.c @@ -0,0 +1,15 @@ +/* PR target/50092 */ +/* { dg-do compile { target lp64 } } */ + +volatile int v; + +void bar (long double); +void baz (_Complex long double *); + +void +foo (void) +{ + _Complex long double w[100000000]; + bar ((long double) v / 2147483648.0); + baz (w); +} diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/torture/pr50287.c b/gcc-4.6/gcc/testsuite/gcc.dg/torture/pr50287.c new file mode 100644 index 000000000..1f61293a5 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.dg/torture/pr50287.c @@ -0,0 +1,109 @@ +/* { dg-do compile } */ + +struct PMC { + unsigned flags; +}; + +struct PVC { + unsigned flags, other_stuff; +}; + + +typedef struct Pcc_cell +{ + struct PMC *p; + long bla; + long type; +} Pcc_cell; + +int gi; +int cond; + +struct PVC g_pvc; + +extern void abort (); +extern void never_ever(int interp, struct PMC *pmc) + __attribute__((noinline,noclone)); + +void never_ever (int interp, struct PMC *pmc) +{ + abort (); +} + +static void mark_cell(int * interp, Pcc_cell *c, struct PVC pvc) + __attribute__((__nonnull__(1))); + +static void +mark_cell(int * interp, Pcc_cell *c, struct PVC pvc) +{ + if (!cond) + return; + + if (c && c->type == 4 && c->p + && !(c->p->flags & (1<<8))) + never_ever(gi + 1, c->p); + if (c && c->type == 4 && c->p + && !(c->p->flags & (1<<7))) + never_ever(gi + 2, c->p); + if (c && c->type == 4 && c->p + && !(c->p->flags & (1<<6))) + never_ever(gi + 3, c->p); + if (c && c->type == 4 && c->p + && !(c->p->flags & (1<<5))) + never_ever(gi + 4, c->p); + if (c && c->type == 4 && c->p + && !(c->p->flags & (1<<4))) + never_ever(gi + 5, c->p); + if (c && c->type == 4 && c->p + && !(c->p->flags & (1<<3))) + never_ever(gi + 6, c->p); + if (c && c->type == 4 && c->p + && !(c->p->flags & (1<<2))) + never_ever(gi + 7, c->p); + if (c && c->type == 4 && c->p + && !(c->p->flags & (1<<1))) + never_ever(gi + 8, c->p); + if (c && c->type == 4 && c->p + && !(c->p->flags & (1<<9))) + never_ever(gi + 9, c->p); +} + +static void +foo(int * interp, Pcc_cell *c) +{ + mark_cell(interp, c, g_pvc); +} + +static struct Pcc_cell * +__attribute__((noinline,noclone)) +getnull(void) +{ + return (struct Pcc_cell *) 0; +} + + +int main() +{ + int i; + + cond = 1; + for (i = 0; i < 100; i++) + foo (&gi, getnull ()); + return 0; +} + + +void +bar_1 (int * interp, Pcc_cell *c) +{ + c->bla += 1; + mark_cell(interp, c, g_pvc); +} + +void +bar_2 (int * interp, Pcc_cell *c, struct PVC pvc) +{ + c->bla += 2; + mark_cell(interp, c, pvc); +} + diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/torture/pr50396.c b/gcc-4.6/gcc/testsuite/gcc.dg/torture/pr50396.c new file mode 100644 index 000000000..aa17ebdaa --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.dg/torture/pr50396.c @@ -0,0 +1,22 @@ +/* { dg-do run } */ +/* { dg-add-options ieee } */ + +extern void abort (void); +typedef float vf128 __attribute__((vector_size(16))); +typedef float vf64 __attribute__((vector_size(8))); +int main() +{ +#if !__FINITE_MATH_ONLY__ +#if __FLT_HAS_QUIET_NAN__ + vf128 v = (vf128){ 0.f, 0.f, 0.f, 0.f }; + vf64 u = (vf64){ 0.f, 0.f }; + v = v / (vf128){ 0.f, 0.f, 0.f, 0.f }; + if (v[0] == v[0]) + abort (); + u = u / (vf64){ 0.f, 0.f }; + if (u[0] == u[0]) + abort (); +#endif +#endif + return 0; +} diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/torture/pr50472.c b/gcc-4.6/gcc/testsuite/gcc.dg/torture/pr50472.c new file mode 100644 index 000000000..280f2c4ea --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.dg/torture/pr50472.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-fdump-tree-optimized" } */ + +static const unsigned int foo = 1; +unsigned int test( void ) +{ + const volatile unsigned int *bar = &foo; + return ( *bar ); +} + +/* { dg-final { scan-tree-dump-not "return 1" "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/torture/pr50723.c b/gcc-4.6/gcc/testsuite/gcc.dg/torture/pr50723.c new file mode 100644 index 000000000..24e490fc6 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.dg/torture/pr50723.c @@ -0,0 +1,26 @@ +/* { dg-do compile } */ + +typedef short unsigned int wchar_t; +typedef unsigned int size_t; +int* _errno(void); +int WideCharToMultiByte (wchar_t *); +int __attribute__ ((__nonnull__ (1))) +__wcrtomb_cp (char *dst, wchar_t wc, const unsigned int cp, + const unsigned int mb_max) +{ + if (cp == 0) { + if (wc > 255) + (*_errno()) = 42; + return 1; + } + else + return WideCharToMultiByte (&wc); +} +void wcsrtombs (char *dst, const wchar_t *pwc, unsigned int cp, + unsigned int mb_max) +{ + if ((__wcrtomb_cp (dst, *pwc, cp, mb_max)) <= 0) + return; + if ((__wcrtomb_cp (dst, *pwc, cp, mb_max)) <= 0) + return; +} diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/torture/pr51042.c b/gcc-4.6/gcc/testsuite/gcc.dg/torture/pr51042.c new file mode 100644 index 000000000..05961c4ac --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.dg/torture/pr51042.c @@ -0,0 +1,22 @@ +/* { dg-do compile } */ + +int a, b; + +void +foo (int x) +{ + int e[2]; + int d; + while (x) + { + for (d = 0; d <= 1; d = 1) + if (e[a]) + break; + for (b = 0; b <= 0; b = 1) + { + e[a] = a; + if (a) + break; + } + } +} diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/torture/pr51070-2.c b/gcc-4.6/gcc/testsuite/gcc.dg/torture/pr51070-2.c new file mode 100644 index 000000000..f21eb3acb --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.dg/torture/pr51070-2.c @@ -0,0 +1,35 @@ +/* { dg-do compile } */ +/* { dg-options "-fno-inline" } */ + +int +func_4 (int si1, int si2) +{ + return si1; +} + +int +func_14 (int left, int right) +{ + return 1; +} + +int +func_37 (int left, int right) +{ + return left; +} + +int g_92[1024]; +int g_95[1024]; +int g_224; +int g_352[1024]; +int +func_9 () +{ + for (; g_224; g_224 += 1) + { + g_95[0] = func_4 (func_37 (g_92[g_224], 0), 0); + g_92[g_224] = 0, g_352[g_224] = func_14 (0, 0); + } + return 0; +} diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/torture/pr51070.c b/gcc-4.6/gcc/testsuite/gcc.dg/torture/pr51070.c new file mode 100644 index 000000000..cc06a90c8 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.dg/torture/pr51070.c @@ -0,0 +1,34 @@ +/* { dg-do compile } */ + +int +func_4 (int si1, int si2) +{ + return si1; +} + +int +func_14 (int left, int right) +{ + return 1; +} + +int +func_37 (int left, int right) +{ + return left; +} + +int g_92[1024]; +int g_95[1024]; +int g_224; +int g_352[1024]; +int +func_9 () +{ + for (; g_224; g_224 += 1) + { + g_95[0] = func_4 (func_37 (g_92[g_224], 0), 0); + g_92[g_224] = 0, g_352[g_224] = func_14 (0, 0); + } + return 0; +} diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/tree-prof/inliner-1.c b/gcc-4.6/gcc/testsuite/gcc.dg/tree-prof/inliner-1.c index b5340b56d..73fde1967 100644 --- a/gcc-4.6/gcc/testsuite/gcc.dg/tree-prof/inliner-1.c +++ b/gcc-4.6/gcc/testsuite/gcc.dg/tree-prof/inliner-1.c @@ -1,4 +1,4 @@ -/* { dg-options "-O2 -fdump-tree-optimized" } */ +/* { dg-options "-O2 -fno-inline-hot-caller -fdump-tree-optimized" } */ int a; int b[100]; void abort (void); @@ -34,7 +34,7 @@ main () return 0; } -/* cold function should be inlined, while hot function should not. +/* cold function should be not inlined, while hot function should be. Look for "cold_function () [tail call];" call statement not for the declaration or other apperances of the string in dump. */ /* { dg-final-use { scan-tree-dump "cold_function ..;" "optimized"} } */ diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/tree-prof/lipo/inliner-1_0.c b/gcc-4.6/gcc/testsuite/gcc.dg/tree-prof/lipo/inliner-1_0.c index b5340b56d..532c4e53d 100644 --- a/gcc-4.6/gcc/testsuite/gcc.dg/tree-prof/lipo/inliner-1_0.c +++ b/gcc-4.6/gcc/testsuite/gcc.dg/tree-prof/lipo/inliner-1_0.c @@ -1,4 +1,4 @@ -/* { dg-options "-O2 -fdump-tree-optimized" } */ +/* { dg-options "-O2 -fno-inline-hot-caller -fdump-tree-optimized" } */ int a; int b[100]; void abort (void); @@ -34,7 +34,7 @@ main () return 0; } -/* cold function should be inlined, while hot function should not. +/* cold function should not be inlined, while hot function should be. Look for "cold_function () [tail call];" call statement not for the declaration or other apperances of the string in dump. */ /* { dg-final-use { scan-tree-dump "cold_function ..;" "optimized"} } */ diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c b/gcc-4.6/gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c index 45e44a1b2..470b585fd 100644 --- a/gcc-4.6/gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c +++ b/gcc-4.6/gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c @@ -33,5 +33,5 @@ void test55 (int x, int y) that the && should be emitted (based on BRANCH_COST). Fix this by teaching dom to look through && and register all components as true. */ -/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" { xfail { ! "alpha*-*-* powerpc*-*-* cris-*-* crisv32-*-* hppa*-*-* i?86-*-* mmix-*-* mips*-*-* m68k*-*-* moxie-*-* sparc*-*-* spu-*-* x86_64-*-*" } } } } */ +/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" { xfail { ! "alpha*-*-* arm*-*-* powerpc*-*-* cris-*-* crisv32-*-* hppa*-*-* i?86-*-* mmix-*-* mips*-*-* m68k*-*-* moxie-*-* sparc*-*-* spu-*-* x86_64-*-*" } } } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/tree-ssa/pr49671-1.c b/gcc-4.6/gcc/testsuite/gcc.dg/tree-ssa/pr49671-1.c new file mode 100644 index 000000000..acc9980db --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.dg/tree-ssa/pr49671-1.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ +volatile int t; +static inline int cvmx_atomic_get32(volatile int *ptr) +{ + return *ptr; +} +void f(void) +{ + while (!cvmx_atomic_get32(&t)) + ; +} + +/* { dg-final { scan-tree-dump "\{v\}" "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ + + diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/tree-ssa/pr49671-2.c b/gcc-4.6/gcc/testsuite/gcc.dg/tree-ssa/pr49671-2.c new file mode 100644 index 000000000..ba5a9d99c --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.dg/tree-ssa/pr49671-2.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ +int t; +static inline int cvmx_atomic_get32(int *ptr) +{ + return *(volatile int*)ptr; +} +void f(void) +{ + while (!cvmx_atomic_get32(&t)) + ; +} + +/* { dg-final { scan-tree-dump "\{v\}" "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ + + diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/tree-ssa/pr51583.c b/gcc-4.6/gcc/testsuite/gcc.dg/tree-ssa/pr51583.c new file mode 100644 index 000000000..2c4ec4723 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.dg/tree-ssa/pr51583.c @@ -0,0 +1,34 @@ +/* { dg-do compile } */ +/* { dg-options "-O1" } */ + +typedef __complex__ double Value; + +union U +{ + Value v; + char c[sizeof(Value)]; +}; + +struct S +{ + union U u; + int i,j; +}; + +Value gv; +int gi, gj; + +Value foo (void) +{ + struct S s,t; + + t.i = gi; + t.j = gj; + t.u.v = gv; + t.u.c[0] = 0; + + s = t; + __imag__ s.u.v += s.i; + + return s.u.v; +} diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-1.c b/gcc-4.6/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-1.c index 6db9ba0d8..2a60e1daa 100644 --- a/gcc-4.6/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-1.c +++ b/gcc-4.6/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fno-tree-ccp -fdump-tree-ealias" } */ +/* { dg-options "-O2 -fno-tree-forwprop -fno-tree-ccp -fdump-tree-ealias" } */ extern void abort (void); struct X { diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-2.c b/gcc-4.6/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-2.c index 85b96b190..ddf934bf8 100644 --- a/gcc-4.6/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-2.c +++ b/gcc-4.6/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-2.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fno-tree-ccp -fdump-tree-ealias" } */ +/* { dg-options "-O2 -fno-tree-forwprop -fno-tree-ccp -fdump-tree-ealias" } */ extern void abort (void); struct X { diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/unroll_1.c b/gcc-4.6/gcc/testsuite/gcc.dg/unroll_1.c index 3e8e7a55f..23e241bfc 100644 --- a/gcc-4.6/gcc/testsuite/gcc.dg/unroll_1.c +++ b/gcc-4.6/gcc/testsuite/gcc.dg/unroll_1.c @@ -30,4 +30,3 @@ int foo2(void) /* { dg-final { scan-rtl-dump-times "Decided to peel loop completely" 2 "loop2_unroll" } } */ /* { dg-final { cleanup-rtl-dump "loop2_unroll" } } */ -/* { dg-excess-errors "extra notes" } */ diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/unroll_2.c b/gcc-4.6/gcc/testsuite/gcc.dg/unroll_2.c index 12912cf77..9fdec57d6 100644 --- a/gcc-4.6/gcc/testsuite/gcc.dg/unroll_2.c +++ b/gcc-4.6/gcc/testsuite/gcc.dg/unroll_2.c @@ -30,4 +30,3 @@ int foo2(void) /* { dg-final { scan-rtl-dump-times "Decided to peel loop completely" 1 "loop2_unroll" } } */ /* { dg-final { cleanup-rtl-dump "loop2_unroll" } } */ -/* { dg-excess-errors "extra notes" } */ diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/unroll_3.c b/gcc-4.6/gcc/testsuite/gcc.dg/unroll_3.c index d86ed552a..cc9a4fbcc 100644 --- a/gcc-4.6/gcc/testsuite/gcc.dg/unroll_3.c +++ b/gcc-4.6/gcc/testsuite/gcc.dg/unroll_3.c @@ -30,4 +30,3 @@ int foo2(void) /* { dg-final { scan-rtl-dump-times "Decided to peel loop completely" 1 "loop2_unroll" } } */ /* { dg-final { cleanup-rtl-dump "loop2_unroll" } } */ -/* { dg-excess-errors "extra notes" } */ diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/unroll_4.c b/gcc-4.6/gcc/testsuite/gcc.dg/unroll_4.c index 7c70157f5..4484f0481 100644 --- a/gcc-4.6/gcc/testsuite/gcc.dg/unroll_4.c +++ b/gcc-4.6/gcc/testsuite/gcc.dg/unroll_4.c @@ -30,4 +30,3 @@ int foo2(void) /* { dg-final { scan-rtl-dump-times "Decided to peel loop completely" 1 "loop2_unroll" } } */ /* { dg-final { cleanup-rtl-dump "loop2_unroll" } } */ -/* { dg-excess-errors "extra notes" } */ diff --git a/gcc-4.6/gcc/testsuite/gcc.dg/vect/vect-70.c b/gcc-4.6/gcc/testsuite/gcc.dg/vect/vect-70.c index e3ebdcab8..24677c2f8 100644 --- a/gcc-4.6/gcc/testsuite/gcc.dg/vect/vect-70.c +++ b/gcc-4.6/gcc/testsuite/gcc.dg/vect/vect-70.c @@ -7,7 +7,7 @@ struct s{ int m; - int n[N][N][N]; + int n[N/6][N/6][N]; }; struct test1{ diff --git a/gcc-4.6/gcc/testsuite/gcc.target/arm/pr49641.c b/gcc-4.6/gcc/testsuite/gcc.target/arm/pr49641.c new file mode 100644 index 000000000..7f9b3769c --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.target/arm/pr49641.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-mthumb -O2" } */ +/* { dg-require-effective-target arm_thumb1_ok } */ +/* { dg-final { scan-assembler-not "stmia\[\\t \]*r3!\[^\\n]*r3" } } */ +typedef struct { + void *t1, *t2, *t3; +} z; +extern volatile int y; +static inline void foo(z *x) { + x->t1 = &x->t2; + x->t2 = ((void *)0); + x->t3 = &x->t1; +} +extern z v; +void bar (void) { + y = 0; + foo(&v); +} diff --git a/gcc-4.6/gcc/testsuite/gcc.target/arm/sibcall-2.c b/gcc-4.6/gcc/testsuite/gcc.target/arm/sibcall-2.c new file mode 100644 index 000000000..921c0f302 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.target/arm/sibcall-2.c @@ -0,0 +1,12 @@ +/* { dg-require-effective-target arm_eabi } */ +/* { dg-do compile } */ +/* { dg-options "-O2 -mabi=aapcs" } */ + + +extern void __attribute__((weak)) wfunc(void); +void main(void) +{ + wfunc(); /* Must not tail-call. */ +} + +/* { dg-final { scan-assembler-not "b\[\\t \]+wfunc" } } */ diff --git a/gcc-4.6/gcc/testsuite/gcc.target/i386/aes-avx-check.h b/gcc-4.6/gcc/testsuite/gcc.target/i386/aes-avx-check.h index 36a038ea3..f2a4ead40 100644 --- a/gcc-4.6/gcc/testsuite/gcc.target/i386/aes-avx-check.h +++ b/gcc-4.6/gcc/testsuite/gcc.target/i386/aes-avx-check.h @@ -3,6 +3,7 @@ #endif #include <stdlib.h> #include "cpuid.h" +#include "avx-os-support.h" static void aes_avx_test (void); @@ -22,8 +23,9 @@ main () return 0; /* Run AES + AVX test only if host has AES + AVX support. */ - if ((ecx & (bit_AVX | bit_OSXSAVE | bit_AES)) - == (bit_AVX | bit_OSXSAVE | bit_AES)) + if (((ecx & (bit_AVX | bit_OSXSAVE | bit_AES)) + == (bit_AVX | bit_OSXSAVE | bit_AES)) + && avx_os_support ()) { do_test (); #ifdef DEBUG diff --git a/gcc-4.6/gcc/testsuite/gcc.target/i386/avx-check.h b/gcc-4.6/gcc/testsuite/gcc.target/i386/avx-check.h index b15584ad2..7ddca9d7b 100644 --- a/gcc-4.6/gcc/testsuite/gcc.target/i386/avx-check.h +++ b/gcc-4.6/gcc/testsuite/gcc.target/i386/avx-check.h @@ -1,6 +1,7 @@ #include <stdlib.h> #include "cpuid.h" #include "m256-check.h" +#include "avx-os-support.h" static void avx_test (void); @@ -20,7 +21,8 @@ main () return 0; /* Run AVX test only if host has AVX support. */ - if ((ecx & (bit_AVX | bit_OSXSAVE)) == (bit_AVX | bit_OSXSAVE)) + if (((ecx & (bit_AVX | bit_OSXSAVE)) == (bit_AVX | bit_OSXSAVE)) + && avx_os_support ()) { do_test (); #ifdef DEBUG diff --git a/gcc-4.6/gcc/testsuite/gcc.target/i386/avx-os-support.h b/gcc-4.6/gcc/testsuite/gcc.target/i386/avx-os-support.h new file mode 100644 index 000000000..21d332f7d --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.target/i386/avx-os-support.h @@ -0,0 +1,10 @@ +/* Check if the OS supports executing AVX instructions. */ + +static int +avx_os_support (void) +{ + unsigned int eax, edx; + + __asm__ ("xgetbv" : "=a" (eax), "=d" (edx) : "c" (0)); + return (eax & 6) == 6; +} diff --git a/gcc-4.6/gcc/testsuite/gcc.target/i386/builtin_target.c b/gcc-4.6/gcc/testsuite/gcc.target/i386/builtin_target.c new file mode 100644 index 000000000..fc1014fa8 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.target/i386/builtin_target.c @@ -0,0 +1,61 @@ +/* This test checks if the __builtin_cpu_* calls are recognized. */ + +/* { dg-do run } */ + +int +fn1 () +{ + if (__builtin_cpu_supports_cmov () < 0) + return -1; + if (__builtin_cpu_supports_mmx () < 0) + return -1; + if (__builtin_cpu_supports_popcount () < 0) + return -1; + if (__builtin_cpu_supports_sse () < 0) + return -1; + if (__builtin_cpu_supports_sse2 () < 0) + return -1; + if (__builtin_cpu_supports_sse3 () < 0) + return -1; + if (__builtin_cpu_supports_ssse3 () < 0) + return -1; + if (__builtin_cpu_supports_sse4_1 () < 0) + return -1; + if (__builtin_cpu_supports_sse4_2 () < 0) + return -1; + if (__builtin_cpu_is_amd () < 0) + return -1; + if (__builtin_cpu_is_intel () < 0) + return -1; + if (__builtin_cpu_is_intel_atom () < 0) + return -1; + if (__builtin_cpu_is_intel_core2 () < 0) + return -1; + if (__builtin_cpu_is_intel_corei7 () < 0) + return -1; + if (__builtin_cpu_is_intel_corei7_nehalem () < 0) + return -1; + if (__builtin_cpu_is_intel_corei7_westmere () < 0) + return -1; + if (__builtin_cpu_is_intel_corei7_sandybridge () < 0) + return -1; + if (__builtin_cpu_is_amdfam10 () < 0) + return -1; + if (__builtin_cpu_is_amdfam10_barcelona () < 0) + return -1; + if (__builtin_cpu_is_amdfam10_shanghai () < 0) + return -1; + if (__builtin_cpu_is_amdfam10_istanbul () < 0) + return -1; + if (__builtin_cpu_is_amdfam15_bdver1 () < 0) + return -1; + if (__builtin_cpu_is_amdfam15_bdver2 () < 0) + return -1; + + return 0; +} + +int main () +{ + return fn1 (); +} diff --git a/gcc-4.6/gcc/testsuite/gcc.target/i386/movdi-rex64.c b/gcc-4.6/gcc/testsuite/gcc.target/i386/movdi-rex64.c new file mode 100644 index 000000000..c9102028a --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.target/i386/movdi-rex64.c @@ -0,0 +1,11 @@ +/* { dg-do compile { target *-*-linux* } } */ +/* { dg-options "-fPIE" } */ + +char *strcpy (char *dest, const char *src); + +static __thread char buffer[25]; +const char * error_message (void) +{ + strcpy (buffer, "Unknown code "); + return 0; +} diff --git a/gcc-4.6/gcc/testsuite/gcc.target/i386/pclmul-avx-check.h b/gcc-4.6/gcc/testsuite/gcc.target/i386/pclmul-avx-check.h index 750e25c50..5eed2e220 100644 --- a/gcc-4.6/gcc/testsuite/gcc.target/i386/pclmul-avx-check.h +++ b/gcc-4.6/gcc/testsuite/gcc.target/i386/pclmul-avx-check.h @@ -3,6 +3,7 @@ #endif #include <stdlib.h> #include "cpuid.h" +#include "avx-os-support.h" static void pclmul_avx_test (void); @@ -22,8 +23,9 @@ main () return 0; /* Run PCLMUL + AVX test only if host has PCLMUL + AVX support. */ - if ((ecx & (bit_AVX | bit_OSXSAVE | bit_PCLMUL)) - == (bit_AVX | bit_OSXSAVE | bit_PCLMUL)) + if (((ecx & (bit_AVX | bit_OSXSAVE | bit_PCLMUL)) + == (bit_AVX | bit_OSXSAVE | bit_PCLMUL)) + && avx_os_support ()) { do_test (); #ifdef DEBUG diff --git a/gcc-4.6/gcc/testsuite/gcc.target/i386/pr48721.c b/gcc-4.6/gcc/testsuite/gcc.target/i386/pr48721.c new file mode 100644 index 000000000..f37a16949 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.target/i386/pr48721.c @@ -0,0 +1,51 @@ +/* PR rtl-optimization/48721 */ +/* { dg-do compile } */ +/* { dg-options "-O -foptimize-sibling-calls -fsched2-use-superblocks -fschedule-insns2 -mtune=core2" } */ + +extern unsigned char a[]; +extern int b[], d[], e[], f[], g[], *h[], m[], *n[], o[]; +extern char c[]; + +struct S +{ + unsigned char s1; + int s2, s3, s4, s5, s6, s7, s8; +}; + +__attribute__((noinline, noclone)) int +foo (int x) +{ + return 0; +} + +int +bar (int x, struct S *y) +{ + int z; + switch (x) + { + case 1: + case 2: + { + int t2, t4, t5, t6, t7, t8; + z = o[y->s8 * 6]; + t8 = *n[m[x] * 5]; + t4 = *h[y->s7]; + t7 = z; + z = g[f[x] + y->s6]; + t6 = e[y->s5]; + t5 = d[c[x] + y->s3 * 17]; + if (z) + t2 = b[z]; + if (a[z] != y->s1) + return foo (x); + y->s8 = t8; + y->s4 = t4; + y->s7 = t7; + y->s6 = t6; + y->s5 = t5; + y->s2 = t2; + } + } + return 0; +} diff --git a/gcc-4.6/gcc/testsuite/gcc.target/i386/pr49866.c b/gcc-4.6/gcc/testsuite/gcc.target/i386/pr49866.c new file mode 100644 index 000000000..823305df7 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.target/i386/pr49866.c @@ -0,0 +1,23 @@ +/* PR target/49866 */ +/* { dg-do assemble } */ +/* { dg-options "-O2 -mcmodel=large" { target lp64 } } */ + +void fn (void *, int, int); +int fn2 (void); +void baz (int); + +static void +foo (void *x, int y) +{ + int i; + for (i = 0; i < y; i++) + fn (x, fn2 (), i); +} + +void +bar (int u, int v, int w, void *x) +{ + baz (u); + foo (x, w); + baz (u); +} diff --git a/gcc-4.6/gcc/testsuite/gcc.target/i386/pr49920.c b/gcc-4.6/gcc/testsuite/gcc.target/i386/pr49920.c new file mode 100644 index 000000000..416e7a478 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.target/i386/pr49920.c @@ -0,0 +1,23 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ +/* { dg-require-effective-target ilp32 } */ + +typedef __SIZE_TYPE__ size_t; +extern void *malloc (size_t); + +register unsigned int MR_mr0 asm ("esi"); +register unsigned int MR_mr1 asm ("edi"); + +void ml_backend__ml_closure_gen_module11 (void) +{ + unsigned int MR_tempr1, MR_tempr2, MR_tempr3; + + MR_tempr1 = (unsigned int)((char *) malloc (sizeof (unsigned int)) + 4); + MR_tempr3 = ((unsigned int *) MR_mr0)[0]; + + ((unsigned int *) (MR_tempr1 - 4))[0] = MR_tempr3; + + MR_tempr2 = (unsigned int)((char *) malloc (2 * sizeof (unsigned int))); + + ((unsigned int *) MR_tempr2)[1] = MR_tempr1; +} diff --git a/gcc-4.6/gcc/testsuite/gcc.target/i386/pr50202.c b/gcc-4.6/gcc/testsuite/gcc.target/i386/pr50202.c new file mode 100644 index 000000000..2023ec86d --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.target/i386/pr50202.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-O -fno-tree-dse -fno-dce -msse4" } */ +/* { dg-require-effective-target sse4 } */ + +typedef char __v16qi __attribute__ ((__vector_size__ (16))); + +__v16qi v; +int i; + +void +foo (void) +{ + i = __builtin_ia32_pcmpistri128 (v, v, 255); + i = 255; +} diff --git a/gcc-4.6/gcc/testsuite/gcc.target/i386/pr50712.c b/gcc-4.6/gcc/testsuite/gcc.target/i386/pr50712.c new file mode 100644 index 000000000..f08a94453 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.target/i386/pr50712.c @@ -0,0 +1,33 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target ilp32 } */ +/* { dg-options "-O2" } */ + +typedef __builtin_va_list __va_list; +typedef __va_list __gnuc_va_list; +typedef __gnuc_va_list va_list; +struct MSVCRT__iobuf { }; +typedef struct MSVCRT__iobuf MSVCRT_FILE; +typedef union _printf_arg { } printf_arg; +MSVCRT_FILE MSVCRT__iob[20]; +int pf_print_a (va_list *); +int __attribute__((__cdecl__)) +MSVCRT_vfprintf_s(MSVCRT_FILE* file, const char *format, va_list valist) +{ + if(!((file != ((void *)0)) + || (MSVCRT__invalid_parameter(((void *)0), ((void *)0), + ((void *)0), 0, 0),0))) + return -1; + return pf_printf_a(&valist); +} +int __attribute__((__cdecl__)) +MSVCRT_vprintf_s(const char *format, va_list valist) +{ + return MSVCRT_vfprintf_s((MSVCRT__iob+1),format,valist); +} +int __attribute__((__cdecl__)) +MSVCRT_fprintf_s(MSVCRT_FILE* file, const char *format, ...) +{ + va_list valist; + va_start (valist, format); + return MSVCRT_vfprintf_s(file, format, valist); +} diff --git a/gcc-4.6/gcc/testsuite/gcc.target/i386/pr50788.c b/gcc-4.6/gcc/testsuite/gcc.target/i386/pr50788.c new file mode 100644 index 000000000..29a19634c --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.target/i386/pr50788.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mavx -fpeel-loops -fstack-protector-all" } */ + +typedef long long __m256i __attribute__ ((__vector_size__ (32))); +typedef double __m256d __attribute__ ((__vector_size__ (32))); + +__m256d foo (__m256d *__P, __m256i __M) +{ + return __builtin_ia32_maskloadpd256 ( __P, __M); +} diff --git a/gcc-4.6/gcc/testsuite/gcc.target/i386/pr51393.c b/gcc-4.6/gcc/testsuite/gcc.target/i386/pr51393.c new file mode 100644 index 000000000..ac167396e --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.target/i386/pr51393.c @@ -0,0 +1,22 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-O -mavx" } */ + +#include "avx-check.h" +#include <immintrin.h> + +static void +__attribute__((noinline)) +avx_test (void) +{ + long long in = 0x800000000ll; + long long out; + + __m256i zero = _mm256_setzero_si256(); + __m256i tmp = _mm256_insert_epi64 (zero, in, 0); + out = _mm256_extract_epi64(tmp, 0); + + if (in != out) + abort (); +} diff --git a/gcc-4.6/gcc/testsuite/gcc.target/powerpc/pr51623.c b/gcc-4.6/gcc/testsuite/gcc.target/powerpc/pr51623.c new file mode 100644 index 000000000..37b7d6557 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gcc.target/powerpc/pr51623.c @@ -0,0 +1,123 @@ +/* PR target/51623 */ +/* { dg-do compile { target { { powerpc*-*-linux* && ilp32 } || { powerpc-*-eabi* } } } } */ +/* { dg-options "-mrelocatable -ffreestanding" } */ + +/* This generated an error, since the compiler was calling + unlikely_text_section_p in a context where it wasn't valid. */ + +typedef long long loff_t; +typedef unsigned size_t; + + +struct mtd_info { + unsigned writesize; + unsigned oobsize; + const char *name; +}; + +extern int strcmp(const char *,const char *); +extern char * strchr(const char *,int); + +struct cmd_tbl_s { + char *name; +}; + + +int printf(const char *fmt, ...) __attribute__ ((format (__printf__, 1, 2))); +void* malloc(size_t); +void free(void*); + + +extern int nand_curr_device; +extern struct mtd_info nand_info[]; + +static int nand_dump(struct mtd_info *nand, unsigned long off, int only_oob) +{ + int i; + unsigned char *datbuf, *oobbuf, *p; + + datbuf = malloc(nand->writesize + nand->oobsize); + oobbuf = malloc(nand->oobsize); + off &= ~(nand->writesize - 1); + + printf("Page %08lx dump:\n", off); + i = nand->writesize >> 4; + p = datbuf; + + while (i--) { + if (!only_oob) + printf("\t%02x %02x %02x %02x %02x %02x %02x %02x" + " %02x %02x %02x %02x %02x %02x %02x %02x\n", + p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], + p[8], p[9], p[10], p[11], p[12], p[13], p[14], + p[15]); + p += 16; + } + + i = nand->oobsize >> 3; + free(datbuf); + free(oobbuf); + + return 0; +} + +int do_nand(struct cmd_tbl_s * cmdtp, int flag, int argc, char *argv[]) +{ + int dev; + unsigned long off; + char *cmd, *s; + struct mtd_info *nand; + + if (argc < 2) + goto usage; + + cmd = argv[1]; + + if (strcmp(cmd, "info") == 0) { + putc('\n'); + return 0; + } + + if (strcmp(cmd, "device") == 0) { + if (argc < 3) { + putc('\n'); + } + dev = (int)simple_strtoul(argv[2], ((void *)0), 10); + nand_curr_device = dev; + return 0; + } + + if (strcmp(cmd, "bad") != 0 && strcmp(cmd, "erase") != 0 ) + goto usage; + + if (nand_curr_device < 0 ) { + return 1; + } + nand = &nand_info[nand_curr_device]; + + if (strcmp(cmd, "erase") == 0 || strcmp(cmd, "scrub") == 0) { + int clean = argc > 2 && !strcmp("clean", argv[2]); + int scrub = !strcmp(cmd, "scrub"); + return 0; + } + + if (strncmp(cmd, "dump", 4) == 0) { + if (argc < 3) + goto usage; + + s = strchr(cmd, '.'); + off = (int)simple_strtoul(argv[2], ((void *)0), 16); + + if (s != ((void *)0) && strcmp(s, ".oob") == 0) + nand_dump(nand, off, 1); + else + nand_dump(nand, off, 0); + + return 0; + } +usage: + cmd_usage(cmdtp); + return 1; +} + +void *ptr = do_nand; diff --git a/gcc-4.6/gcc/testsuite/gfortran.dg/abstract_type_6.f03 b/gcc-4.6/gcc/testsuite/gfortran.dg/abstract_type_6.f03 index 53116dfb3..de1cea363 100644 --- a/gcc-4.6/gcc/testsuite/gfortran.dg/abstract_type_6.f03 +++ b/gcc-4.6/gcc/testsuite/gfortran.dg/abstract_type_6.f03 @@ -31,7 +31,7 @@ TYPE, EXTENDS(middle) :: bottom CONTAINS ! useful proc to satisfy deferred procedure in top. Because we've ! extended middle we wouldn't get told off if we forgot this. - PROCEDURE :: proc_a => bottom_a + PROCEDURE :: proc_a => bottom_a ! { dg-error "must be a module procedure" } ! calls middle%proc_b and then provides extra behaviour PROCEDURE :: proc_b => bottom_b ! calls top_c and then provides extra behaviour diff --git a/gcc-4.6/gcc/testsuite/gfortran.dg/alloc_comp_initializer_3.f90 b/gcc-4.6/gcc/testsuite/gfortran.dg/alloc_comp_initializer_3.f90 new file mode 100644 index 000000000..014b069e5 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gfortran.dg/alloc_comp_initializer_3.f90 @@ -0,0 +1,15 @@ +! { dg-do compile } +! +! PR fortran/50050 +! Out of bound whilst releasing initialization of allocate object +! +! Contributed by someone <sigurdkn@gmail.com> + +program bug + implicit none + type foo + integer, pointer :: a => null() + end type + type(foo), dimension(:,:), allocatable :: data + allocate(data(1:1,1)) ! This used to lead to an ICE +end program diff --git a/gcc-4.6/gcc/testsuite/gfortran.dg/allocate_error_3.f90 b/gcc-4.6/gcc/testsuite/gfortran.dg/allocate_error_3.f90 new file mode 100644 index 000000000..7616caad3 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gfortran.dg/allocate_error_3.f90 @@ -0,0 +1,9 @@ +! { dg-do compile } +! +! PR 49708: [4.5/4.6/4.7 Regression] ICE with allocate and no dimensions +! +! Contributed by <fnordxyz@yahoo.com> + + real, pointer :: x(:) + allocate(x) ! { dg-error "Array specification required" } +end diff --git a/gcc-4.6/gcc/testsuite/gfortran.dg/assumed_charlen_arg_2.f90 b/gcc-4.6/gcc/testsuite/gfortran.dg/assumed_charlen_arg_2.f90 new file mode 100644 index 000000000..e9481d8ec --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gfortran.dg/assumed_charlen_arg_2.f90 @@ -0,0 +1,16 @@ +! { dg-do compile } +! +! PR 50585: [4.6/4.7 Regression] ICE with assumed length character array argument +! +! Contributed by Stuart Mentzer <sgm@objexx.com> + +SUBROUTINE SUB1( str ) + IMPLICIT NONE + CHARACTER(len=*) :: str(2) + CALL SUB2( str(1)(:3) ) +END SUBROUTINE + +SUBROUTINE SUB2( str ) + IMPLICIT NONE + CHARACTER(*) :: str +END SUBROUTINE diff --git a/gcc-4.6/gcc/testsuite/gfortran.dg/auto_char_dummy_array_3.f90 b/gcc-4.6/gcc/testsuite/gfortran.dg/auto_char_dummy_array_3.f90 new file mode 100644 index 000000000..053956cab --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gfortran.dg/auto_char_dummy_array_3.f90 @@ -0,0 +1,25 @@ +! { dg-do run } + +! PR fortran/49885 +! Check that character arrays with non-constant char-length are handled +! correctly. + +! Contributed by Daniel Kraft <d@domob.eu>, +! based on original test case and variant by Tobias Burnus in comment 2. + +PROGRAM main + IMPLICIT NONE + + CALL s (10) + +CONTAINS + + SUBROUTINE s (nb) + INTEGER :: nb + CHARACTER(MAX (80, nb)) :: bad_rec(1) + + bad_rec(1)(1:2) = 'abc' + IF (bad_rec(1)(1:2) /= 'ab') CALL abort () + END SUBROUTINE s + +END PROGRAM main diff --git a/gcc-4.6/gcc/testsuite/gfortran.dg/bessel_6.f90 b/gcc-4.6/gcc/testsuite/gfortran.dg/bessel_6.f90 index 3c1a6f418..1671d1118 100644 --- a/gcc-4.6/gcc/testsuite/gfortran.dg/bessel_6.f90 +++ b/gcc-4.6/gcc/testsuite/gfortran.dg/bessel_6.f90 @@ -12,7 +12,7 @@ implicit none real,parameter :: values(*) = [0.0, 0.5, 1.0, 0.9, 1.8,2.0,3.0,4.0,4.25,8.0,34.53, 475.78] real,parameter :: myeps(size(values)) = epsilon(0.0) & - * [2, 7, 5, 6, 9, 12, 12, 7, 7, 8, 75, 15 ] + * [2, 7, 5, 6, 9, 12, 12, 7, 7, 8, 92, 15 ] ! The following is sufficient for me - the values above are a bit ! more tolerant ! * [0, 5, 3, 4, 6, 7, 7, 5, 5, 6, 66, 4 ] diff --git a/gcc-4.6/gcc/testsuite/gfortran.dg/c_kind_tests_3.f03 b/gcc-4.6/gcc/testsuite/gfortran.dg/c_kind_tests_3.f03 new file mode 100644 index 000000000..5d5f3ab19 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gfortran.dg/c_kind_tests_3.f03 @@ -0,0 +1,11 @@ +! { dg-do compile } +! +! PR 47023: [4.6/4.7 regression] C_Sizeof: Rejects valid code +! +! Contributed by <florian.rathgeber@gmail.com> + + use iso_c_binding + real(c_double) x + print *, c_sizeof(x) + print *, c_sizeof(0.0_c_double) +end diff --git a/gcc-4.6/gcc/testsuite/gfortran.dg/class_46.f03 b/gcc-4.6/gcc/testsuite/gfortran.dg/class_46.f03 new file mode 100644 index 000000000..4719c252f --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gfortran.dg/class_46.f03 @@ -0,0 +1,18 @@ +! { dg-do run } +! +! PR 50625: [4.6/4.7 Regression][OOP] ALLOCATABLE attribute lost for module CLASS variables +! +! Contributed by Tobias Burnus <burnus@gcc.gnu.org> + +module m +type t +end type t +class(t), allocatable :: x +end module m + +use m +implicit none +if (allocated(x)) call abort() +end + +! { dg-final { cleanup-modules "m" } } diff --git a/gcc-4.6/gcc/testsuite/gfortran.dg/common_16.f90 b/gcc-4.6/gcc/testsuite/gfortran.dg/common_16.f90 new file mode 100644 index 000000000..3314e80ef --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gfortran.dg/common_16.f90 @@ -0,0 +1,12 @@ +! { dg-do compile } +! { dg-options "-pedantic -mdalign" { target sh*-*-* } } +! +! PR fortran/50273 +! +subroutine test() + character :: a + integer :: b + character :: c + common /global_var/ a, b, c ! { dg-warning "Padding of 3 bytes required before 'b' in COMMON" } + print *, a, b, c +end subroutine test diff --git a/gcc-4.6/gcc/testsuite/gfortran.dg/default_initialization_5.f90 b/gcc-4.6/gcc/testsuite/gfortran.dg/default_initialization_5.f90 new file mode 100644 index 000000000..11927619d --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gfortran.dg/default_initialization_5.f90 @@ -0,0 +1,66 @@ +! { dg-do run } +! { dg-options "-fdump-tree-original" } +! +! PR fortran/51435 +! +! Contributed by darmar.xxl@gmail.com +! +module arr_m + type arr_t + real(8), dimension(:), allocatable :: rsk + end type + type arr_t2 + integer :: a = 77 + end type +end module arr_m +!********************* +module list_m + use arr_m + implicit none + + type(arr_t2), target :: tgt + + type my_list + type(arr_t), pointer :: head => null() + end type my_list + type my_list2 + type(arr_t2), pointer :: head => tgt + end type my_list2 +end module list_m +!*********************** +module worker_mod + use list_m + implicit none + + type data_all_t + type(my_list) :: my_data + end type data_all_t + type data_all_t2 + type(my_list2) :: my_data + end type data_all_t2 +contains + subroutine do_job() + type(data_all_t) :: dum + type(data_all_t2) :: dum2 + + if (associated(dum%my_data%head)) then + call abort() + else + print *, 'OK: do_job my_data%head is NOT associated' + end if + + if (dum2%my_data%head%a /= 77) & + call abort() + end subroutine +end module +!*************** +program hello + use worker_mod + implicit none + call do_job() +end program + +! { dg-final { scan-tree-dump-times "my_data.head = 0B" 1 "original" } } +! { dg-final { scan-tree-dump-times "my_data.head = &tgt" 1 "original" } } +! { dg-final { cleanup-tree-dump "original" } } +! { dg-final { cleanup-modules "arr_m list_m worker_mod" } } diff --git a/gcc-4.6/gcc/testsuite/gfortran.dg/extends_12.f03 b/gcc-4.6/gcc/testsuite/gfortran.dg/extends_12.f03 new file mode 100644 index 000000000..a93f6d0f1 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gfortran.dg/extends_12.f03 @@ -0,0 +1,24 @@ +! { dg-do compile } +! +! PR 48706: Type extension inside subroutine +! +! Contributed by Tobias Burnus <burnus@gcc.gnu.org> + +module mod_diff_01 + implicit none + type :: foo + end type +contains + subroutine create_ext + type, extends(foo) :: foo_e + end type + end subroutine +end module + +program diff_01 + use mod_diff_01 + implicit none + call create_ext() +end program + +! { dg-final { cleanup-modules "mod_diff_01" } } diff --git a/gcc-4.6/gcc/testsuite/gfortran.dg/implicit_pure_1.f90 b/gcc-4.6/gcc/testsuite/gfortran.dg/implicit_pure_1.f90 new file mode 100644 index 000000000..d4a5a364e --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gfortran.dg/implicit_pure_1.f90 @@ -0,0 +1,53 @@ +! { dg-do run } +! +! PR fortran/51218 +! +! Contributed by Harald Anlauf +! + +module a + implicit none + integer :: neval = 0 +contains + subroutine inc_eval + neval = neval + 1 + end subroutine inc_eval +end module a + +module b + use a + implicit none +contains + function f(x) ! Should be implicit pure + real :: f + real, intent(in) :: x + f = x + end function f + + function g(x) ! Should NOT be implicit pure + real :: g + real, intent(in) :: x + call inc_eval + g = x + end function g +end module b + +program gfcbug114a + use a + use b + implicit none + real :: x = 1, y = 1, t, u, v, w + if (neval /= 0) call abort () + t = f(x)*f(y) + if (neval /= 0) call abort () + u = f(x)*f(y) + f(x)*f(y) + if (neval /= 0) call abort () + v = g(x)*g(y) + if (neval /= 2) call abort () + w = g(x)*g(y) + g(x)*g(y) + if (neval /= 6) call abort () + if (t /= 1.0 .or. u /= 2.0 .or. v /= 1.0 .or. w /= 2) call abort () +end program gfcbug114a + +! { dg-final { scan-module "b" "IMPLICIT_PURE" } } +! { dg-final { cleanup-modules "b" } } diff --git a/gcc-4.6/gcc/testsuite/gfortran.dg/implicit_pure_2.f90 b/gcc-4.6/gcc/testsuite/gfortran.dg/implicit_pure_2.f90 new file mode 100644 index 000000000..496e856e0 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gfortran.dg/implicit_pure_2.f90 @@ -0,0 +1,17 @@ +! { dg-do compile } +! PR 51502 - this was wrongly detected to be implicit pure. +module m + integer :: i +contains + subroutine foo(x) + integer, intent(inout) :: x + outer: block + block + i = 5 + end block + end block outer + end subroutine foo +end module m + +! { dg-final { scan-module-absence "m" "IMPLICIT_PURE" } } +! { dg-final { cleanup-modules "m" } } diff --git a/gcc-4.6/gcc/testsuite/gfortran.dg/initialization_28.f90 b/gcc-4.6/gcc/testsuite/gfortran.dg/initialization_28.f90 new file mode 100644 index 000000000..f5330534a --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gfortran.dg/initialization_28.f90 @@ -0,0 +1,9 @@ +! { dg-do compile } +! +! PR fortran/50163 +! +! Contributed by Philip Mason +! +character(len=2) :: xx ='aa' +integer :: iloc=index(xx,'bb') ! { dg-error "has not been declared or is a variable" } +end diff --git a/gcc-4.6/gcc/testsuite/gfortran.dg/lto/pr45586-2_0.f90 b/gcc-4.6/gcc/testsuite/gfortran.dg/lto/pr45586-2_0.f90 new file mode 100644 index 000000000..52e2bb1e6 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gfortran.dg/lto/pr45586-2_0.f90 @@ -0,0 +1,34 @@ +! { dg-lto-do link } +! +! PR fortran/45586 (comment 53) +! + +MODULE M1 + INTEGER, PARAMETER :: dp=8 + TYPE realspace_grid_type + REAL(KIND=dp), DIMENSION ( :, :, : ), ALLOCATABLE :: r + END TYPE realspace_grid_type + TYPE realspace_grid_p_type + TYPE(realspace_grid_type), POINTER :: rs_grid + END TYPE realspace_grid_p_type + TYPE realspaces_grid_p_type + TYPE(realspace_grid_p_type), DIMENSION(:), POINTER :: rs + END TYPE realspaces_grid_p_type +END MODULE + +MODULE M2 + USE M1 +CONTAINS + SUBROUTINE S1() + INTEGER :: i,j + TYPE(realspaces_grid_p_type), DIMENSION(:), POINTER :: rs_gauge + REAL(dp), DIMENSION(:, :, :), POINTER :: y + y=>rs_gauge(i)%rs(j)%rs_grid%r + END SUBROUTINE +END MODULE + +USE M2 + CALL S1() +END + +! { dg-final { cleanup-modules "m1 m2" } } diff --git a/gcc-4.6/gcc/testsuite/gfortran.dg/move_alloc_8.f90 b/gcc-4.6/gcc/testsuite/gfortran.dg/move_alloc_8.f90 new file mode 100644 index 000000000..2fa530666 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gfortran.dg/move_alloc_8.f90 @@ -0,0 +1,106 @@ +! { dg-do compile } +! +! PR fortran/50684 +! +! Module "bug" contributed by Martin Steghöfer. +! + +MODULE BUG + TYPE MY_TYPE + INTEGER, ALLOCATABLE :: VALUE + END TYPE +CONTAINS + SUBROUTINE POINTER_INTENT_IN_BUG_WORKING(POINTER_INTENT_IN_VARIABLE) + TYPE(MY_TYPE), POINTER, INTENT(IN) :: POINTER_INTENT_IN_VARIABLE + TYPE(MY_TYPE), POINTER :: POINTER_VARIABLE_LOCAL + INTEGER, ALLOCATABLE :: LOCAL_VALUE + + POINTER_VARIABLE_LOCAL=>POINTER_INTENT_IN_VARIABLE + CALL MOVE_ALLOC(POINTER_VARIABLE_LOCAL%VALUE, LOCAL_VALUE) + + RETURN + END SUBROUTINE POINTER_INTENT_IN_BUG_WORKING + + SUBROUTINE POINTER_INTENT_IN_BUG_FAILING(POINTER_INTENT_IN_VARIABLE) + TYPE(MY_TYPE), POINTER, INTENT(IN) :: POINTER_INTENT_IN_VARIABLE + INTEGER, ALLOCATABLE :: LOCAL_VALUE + + CALL MOVE_ALLOC(POINTER_INTENT_IN_VARIABLE%VALUE, LOCAL_VALUE) + + RETURN + END SUBROUTINE POINTER_INTENT_IN_BUG_FAILING +end module bug + +subroutine test1() + TYPE MY_TYPE + INTEGER, ALLOCATABLE :: VALUE + END TYPE +CONTAINS + SUBROUTINE sub (dt) + type(MY_TYPE), intent(in) :: dt + INTEGER, ALLOCATABLE :: lv + call move_alloc(dt%VALUE, lv) ! { dg-error "cannot be INTENT.IN." } + END SUBROUTINE +end subroutine test1 + +subroutine test2 (x, px) + implicit none + type t + integer, allocatable :: a + end type t + + type t2 + type(t), pointer :: ptr + integer, allocatable :: a + end type t2 + + type(t2), intent(in) :: x + type(t2), pointer, intent(in) :: px + + integer, allocatable :: a + type(t2), pointer :: ta + + call move_alloc (px, ta) ! { dg-error "cannot be INTENT.IN." } + call move_alloc (x%a, a) ! { dg-error "cannot be INTENT.IN." } + call move_alloc (x%ptr%a, a) ! OK (3) + call move_alloc (px%a, a) ! OK (4) + call move_alloc (px%ptr%a, a) ! OK (5) +end subroutine test2 + +subroutine test3 (x, px) + implicit none + type t + integer, allocatable :: a + end type t + + type t2 + class(t), pointer :: ptr + integer, allocatable :: a + end type t2 + + type(t2), intent(in) :: x + class(t2), pointer, intent(in) :: px + + integer, allocatable :: a + class(t2), pointer :: ta + + call move_alloc (px, ta) ! { dg-error "cannot be INTENT.IN." } + call move_alloc (x%a, a) ! { dg-error "cannot be INTENT.IN." } + call move_alloc (x%ptr%a, a) ! OK (6) + call move_alloc (px%a, a) ! OK (7) + call move_alloc (px%ptr%a, a) ! OK (8) +end subroutine test3 + +subroutine test4() + TYPE MY_TYPE + INTEGER, ALLOCATABLE :: VALUE + END TYPE +CONTAINS + SUBROUTINE sub (dt) + CLASS(MY_TYPE), intent(in) :: dt + INTEGER, ALLOCATABLE :: lv + call move_alloc(dt%VALUE, lv) ! { dg-error "cannot be INTENT.IN." } + END SUBROUTINE +end subroutine test4 + +! { dg-final { cleanup-modules "bug" } } diff --git a/gcc-4.6/gcc/testsuite/gfortran.dg/namelist_72.f b/gcc-4.6/gcc/testsuite/gfortran.dg/namelist_72.f new file mode 100644 index 000000000..22c088076 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gfortran.dg/namelist_72.f @@ -0,0 +1,33 @@ +! { dg-do run } +! +! PR fortran/49791 +! +! Contributed by Elliott Sales de Andrade +! + program namelist_test + + dimension xpos(5000), ypos(5000) + namelist /geometry/ xpos, ypos + + xpos = -huge(xpos) + ypos = -huge(ypos) + + open(unit=4,file='geometry.in') + write(4,'(a)') '$geometry' + write(4,'(a)') ' xpos(1)= 0.00, 0.10, 0.20, 0.30, 0.40,' + write(4,'(a)') ' ypos(1)= 0.50, 0.60, 0.70, 0.80, 0.90,' + write(4,'(a)') '$end' + + close(4) + + open (unit=4,file='geometry.in',status='old',form='formatted') + read (4,geometry) + close(4, status='delete') + + !print *, 'xpos', xpos(1:10), 'ypos', ypos(1:10) + + if (any (xpos(1:5) /= [0.00, 0.10, 0.20, 0.30, 0.40]))call abort() + if (any (ypos(1:5) /= [0.50, 0.60, 0.70, 0.80, 0.90]))call abort() + if (any (xpos(6:) /= -huge(xpos))) call abort () + if (any (ypos(6:) /= -huge(ypos))) call abort () + end diff --git a/gcc-4.6/gcc/testsuite/gfortran.dg/namelist_73.f90 b/gcc-4.6/gcc/testsuite/gfortran.dg/namelist_73.f90 new file mode 100644 index 000000000..8fc88aa1e --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gfortran.dg/namelist_73.f90 @@ -0,0 +1,28 @@ +! { dg-do run } +! +! PR fortran/50109 +! +! Contributed by Jim Hanson +! + program namelist_test + + integer nfp + namelist /indata/ nfp + + nfp = 99 + open(unit=4, status='scratch') + write(4,'(a)') '$indata' + write(4,'(a)') 'NFP = 5,' + write(4,'(a)') "! " + write(4,'(a)') "! " + write(4,'(a)') "! " + write(4,'(a)') '/' + + rewind(4) + read (4,nml=indata) + close(4) + +! write(*,*) nfp + if (nfp /= 5) call abort() + + end diff --git a/gcc-4.6/gcc/testsuite/gfortran.dg/pointer_check_11.f90 b/gcc-4.6/gcc/testsuite/gfortran.dg/pointer_check_11.f90 new file mode 100644 index 000000000..b6aa79ae2 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gfortran.dg/pointer_check_11.f90 @@ -0,0 +1,24 @@ +! { dg-do run } +! { dg-options "-fcheck=all" } +! +! { dg-shouldfail "Pointer check" } +! { dg-output "Fortran runtime error: Pointer actual argument 'y' is not associated" } +! +! +! PR fortran/50718 +! +! Was failing (ICE) with -fcheck=pointer if the dummy had the value attribute. + +type t + integer :: p +end type t + +type(t), pointer :: y => null() + +call sub(y) ! Invalid: Nonassociated pointer + +contains + subroutine sub (x) + type(t), value :: x + end subroutine +end diff --git a/gcc-4.6/gcc/testsuite/gfortran.dg/pointer_check_12.f90 b/gcc-4.6/gcc/testsuite/gfortran.dg/pointer_check_12.f90 new file mode 100644 index 000000000..cfef70e59 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gfortran.dg/pointer_check_12.f90 @@ -0,0 +1,22 @@ +! { dg-do run } +! { dg-options "-fcheck=all" } +! +! { dg-shouldfail "Pointer check" } +! { dg-output "Fortran runtime error: Pointer actual argument 'p' is not associated" } +! +! PR fortran/50718 +! +! Was failing with -fcheck=pointer: Segfault at run time + +integer, pointer :: p => null() + +call sub2(%val(p)) ! Invalid: Nonassociated pointer +end + +! Not quite correct dummy, but if one uses VALUE, gfortran +! complains about a missing interface - which we cannot use +! if we want to use %VAL(). + +subroutine sub2(p) + integer :: p +end subroutine sub2 diff --git a/gcc-4.6/gcc/testsuite/gfortran.dg/pointer_comp_init_1.f90 b/gcc-4.6/gcc/testsuite/gfortran.dg/pointer_comp_init_1.f90 new file mode 100644 index 000000000..44f360e98 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gfortran.dg/pointer_comp_init_1.f90 @@ -0,0 +1,30 @@ +! { dg-do compile } +! +! PR fortran/50050 +! ICE whilst trying to access NULL shape. + +! Reduced from the FoX library http://www1.gly.bris.ac.uk/~walker/FoX/ +! Contributed by Andrew Benson <abenson@its.caltech.edu> + +module m_common_attrs + implicit none + + type dict_item + end type dict_item + + type dict_item_ptr + type(dict_item), pointer :: d => null() + end type dict_item_ptr + +contains + + subroutine add_item_to_dict() + type(dict_item_ptr), pointer :: tempList(:) + integer :: n + + allocate(tempList(0:n+1)) + end subroutine add_item_to_dict + +end module m_common_attrs + +! { dg-final { cleanup-modules "m_common_attrs" } } diff --git a/gcc-4.6/gcc/testsuite/gfortran.dg/pointer_intent_5.f90 b/gcc-4.6/gcc/testsuite/gfortran.dg/pointer_intent_5.f90 new file mode 100644 index 000000000..c4e3c7a3c --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gfortran.dg/pointer_intent_5.f90 @@ -0,0 +1,24 @@ +! { dg-do run } +! +! PR 50570: [4.6/4.7 Regression] Incorrect error for assignment to intent(in) pointer +! +! Contributed by Bill Long <longb@cray.com> + +program bots_sparselu_pointer_intent_in + + implicit none + integer, pointer :: array(:) + + allocate(array(4)) + array = 0 + call sub(array) + if (sum(array)/=1) call abort + +contains + + subroutine sub(dummy) + integer, pointer, intent(in) :: dummy(:) + dummy(1) = 1 + end subroutine sub + +end program diff --git a/gcc-4.6/gcc/testsuite/gfortran.dg/pr49675.f90 b/gcc-4.6/gcc/testsuite/gfortran.dg/pr49675.f90 new file mode 100644 index 000000000..06fd1b665 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gfortran.dg/pr49675.f90 @@ -0,0 +1,6 @@ +! PR middle-end/49675 +! { dg-do compile } +! { dg-options "-finstrument-functions" } +end +! { dg-final { scan-assembler "__cyg_profile_func_enter" } } +! { dg-final { scan-assembler "__cyg_profile_func_exit" } } diff --git a/gcc-4.6/gcc/testsuite/gfortran.dg/pr50875.f90 b/gcc-4.6/gcc/testsuite/gfortran.dg/pr50875.f90 new file mode 100644 index 000000000..6b4476c14 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gfortran.dg/pr50875.f90 @@ -0,0 +1,39 @@ +! { dg-do compile { target { i?86-*-* x86_64-*-* } } } +! { dg-options "-O3 -mavx" } +! +! PR fortran/50875.f90 + +module test + + implicit none + + integer, parameter :: dp=kind(1.d0) + + integer :: P = 2 + + real(kind=dp), allocatable :: real_array_A(:),real_array_B(:,:) + complex(kind=dp), allocatable :: cmplx_array_A(:) + +contains + + subroutine routine_A + + integer :: i + + allocate(cmplx_array_A(P),real_array_B(P,P),real_array_A(P)) + + real_array_A = 1 + real_array_B = 1 + + do i = 1, p + cmplx_array_A = cmplx(real_array_B(:,i),0.0_dp,dp) + cmplx_array_A = cmplx_array_A * exp(cmplx(0.0_dp,real_array_A+1)) + end do + + deallocate(cmplx_array_A,real_array_B,real_array_A) + + end subroutine routine_A + +end module test + +! { dg-final { cleanup-modules "test" } } diff --git a/gcc-4.6/gcc/testsuite/gfortran.dg/proc_decl_27.f90 b/gcc-4.6/gcc/testsuite/gfortran.dg/proc_decl_27.f90 new file mode 100644 index 000000000..30ff4def3 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gfortran.dg/proc_decl_27.f90 @@ -0,0 +1,25 @@ +! { dg-do compile } +! +! PR 50659: [4.5/4.6/4.7 Regression] [F03] ICE on invalid with procedure interface +! +! Contributed by Andrew Benson <abenson@caltech.edu> + +module m1 + integer :: arrSize +end module + +module m2 +contains + function Proc (arg) + use m1 + double precision, dimension(arrSize) :: proc + double precision :: arg + end function +end + + use m2 + implicit none + procedure(Proc) :: Proc_Get +end + +! { dg-final { cleanup-modules "m1 m2" } } diff --git a/gcc-4.6/gcc/testsuite/gfortran.dg/realloc_on_assign_8.f90 b/gcc-4.6/gcc/testsuite/gfortran.dg/realloc_on_assign_8.f90 new file mode 100644 index 000000000..4f7d28895 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gfortran.dg/realloc_on_assign_8.f90 @@ -0,0 +1,17 @@ +! { dg-do compile } +! +! PR fortran/51448 +! +! Contribued by François Willot +! + PROGRAM MAIN + IMPLICIT NONE + TYPE mytype + REAL b(2) + END TYPE mytype + TYPE(mytype) a + DOUBLE PRECISION, ALLOCATABLE :: x(:) + ALLOCATE(x(2)) + a%b=0.0E0 + x=a%b + END diff --git a/gcc-4.6/gcc/testsuite/gfortran.dg/result_in_spec_4.f90 b/gcc-4.6/gcc/testsuite/gfortran.dg/result_in_spec_4.f90 new file mode 100644 index 000000000..3f0e9a379 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gfortran.dg/result_in_spec_4.f90 @@ -0,0 +1,27 @@ +! { dg-do compile } +! +! PR fortran/49648 +! ICE for calls to a use-associated function returning an array whose spec +! depends on a function call. + +! Contributed by Tobias Burnus <burnus@net-b.de> + +module m2 + COMPLEX, SAVE, ALLOCATABLE :: P(:) +contains + FUNCTION getPhaseMatrix() RESULT(PM) + COMPLEX:: PM(SIZE(P),3) + PM=0.0 + END FUNCTION +end module m2 + +module m + use m2 +contains + SUBROUTINE gf_generateEmbPot() + COMPLEX :: sigma2(3,3) + sigma2 = MATMUL(getPhaseMatrix(), sigma2) + END SUBROUTINE +end module m + +! { dg-final { cleanup-modules "m m2" } } diff --git a/gcc-4.6/gcc/testsuite/gfortran.dg/string_5.f90 b/gcc-4.6/gcc/testsuite/gfortran.dg/string_5.f90 new file mode 100644 index 000000000..87ec70942 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gfortran.dg/string_5.f90 @@ -0,0 +1,7 @@ +! { dg-do compile } +! PR fortran/48876 - this used to segfault. +! Test case contributed by mhp77 (a) gmx.at. +program test + character :: string = "string"( : -1 ) +end program test + diff --git a/gcc-4.6/gcc/testsuite/gfortran.dg/typebound_proc_24.f03 b/gcc-4.6/gcc/testsuite/gfortran.dg/typebound_proc_24.f03 new file mode 100644 index 000000000..f200e0efb --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gfortran.dg/typebound_proc_24.f03 @@ -0,0 +1,32 @@ +! { dg-do compile } +! +! PR 49112: [4.6/4.7 Regression] [OOP] Missing type-bound procedure, "duplicate save" warnings and internal compiler error +! +! Contributed by John <jwmwalrus@gmail.com> + +module datetime_mod + + implicit none + + type :: DateTime + integer :: year, month, day + contains + procedure :: getFormattedString + end type + + type(DateTime) :: ISO_REFERENCE_DATE = DateTime(1875, 5, 20) + +contains + + character function getFormattedString(dt) + class(DateTime) :: dt + end function + + subroutine test + type(DateTime) :: dt + print *,dt%getFormattedString() + end subroutine + +end module + +! { dg-final { cleanup-modules "datetime_mod" } } diff --git a/gcc-4.6/gcc/testsuite/gfortran.dg/vect/pr50178.f90 b/gcc-4.6/gcc/testsuite/gfortran.dg/vect/pr50178.f90 new file mode 100644 index 000000000..e24ce5b15 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gfortran.dg/vect/pr50178.f90 @@ -0,0 +1,29 @@ +! { dg-do compile } + +module yemdyn + implicit none + integer, parameter :: jpim = selected_int_kind(9) + integer, parameter :: jprb = selected_real_kind(13,300) + real(kind=jprb) :: elx + real(kind=jprb), allocatable :: xkcoef(:) + integer(kind=jpim),allocatable :: ncpln(:), npne(:) +end module yemdyn + +subroutine suedyn + + use yemdyn + + implicit none + + integer(kind=jpim) :: jm, jn + real(kind=jprb) :: zjm, zjn, zxxx + + jn=0 + do jm=0,ncpln(jn) + zjm=real(jm,jprb) / elx + xkcoef(npne(jn)+jm) = - zxxx*(zjm**2)**0.5_jprb + end do + +end subroutine suedyn + +! { dg-final { cleanup-tree-dump "vect" } } diff --git a/gcc-4.6/gcc/testsuite/gfortran.dg/vect/pr50412.f90 b/gcc-4.6/gcc/testsuite/gfortran.dg/vect/pr50412.f90 new file mode 100644 index 000000000..4f95741f7 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gfortran.dg/vect/pr50412.f90 @@ -0,0 +1,12 @@ +! { dg-do compile } + + DOUBLE PRECISION AK,AI,AAE + COMMON/com/AK(36),AI(4,4),AAE(8,4),ii,jj + DO 20 II=1,4 + DO 21 JJ=1,4 + AK(n)=AK(n)-AAE(I,II)*AI(II,JJ) + 21 CONTINUE + 20 CONTINUE + END + +! { dg-final { cleanup-tree-dump "vect" } } diff --git a/gcc-4.6/gcc/testsuite/gfortran.dg/warn_function_without_result_2.f90 b/gcc-4.6/gcc/testsuite/gfortran.dg/warn_function_without_result_2.f90 new file mode 100644 index 000000000..25fd0b73a --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gfortran.dg/warn_function_without_result_2.f90 @@ -0,0 +1,19 @@ +! { dg-do compile } +! { dg-options "-Wall" } +! +! PR fortran/50923 +! +module m +contains + integer pure function f() ! { dg-warning "Return value of function 'f' at .1. not set" } + end function f + integer pure function g() result(h) ! { dg-warning "Return value 'h' of function 'g' declared at .1. not set" } + end function g + integer pure function i() + i = 7 + end function i + integer pure function j() result(k) + k = 8 + end function j +end module m +! { dg-final { cleanup-modules "mod" } } diff --git a/gcc-4.6/gcc/testsuite/gfortran.dg/where_3.f90 b/gcc-4.6/gcc/testsuite/gfortran.dg/where_3.f90 new file mode 100644 index 000000000..1507ad982 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gfortran.dg/where_3.f90 @@ -0,0 +1,15 @@ +! { dg-do compile } +! +! PR fortran/50129 +! ICE after reporting an error on a masked ELSEWHERE statement following an +! unmasked one. +! +! Contributed by Joost Van de Vondele <Joost.VandeVondele@pci.uzh.ch> + +INTEGER :: I(3) +WHERE (I>2) +ELSEWHERE +ELSEWHERE (I<1) ! { dg-error "follows previous unmasked ELSEWHERE" } +END WHERE +END + diff --git a/gcc-4.6/gcc/testsuite/gfortran.dg/whole_file_35.f90 b/gcc-4.6/gcc/testsuite/gfortran.dg/whole_file_35.f90 new file mode 100644 index 000000000..46a886551 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gfortran.dg/whole_file_35.f90 @@ -0,0 +1,28 @@ +! { dg-do compile } +! +! PR fortran/50408 +! +! Contributed by Vittorio Zecca +! + module m + type int + integer :: val + end type int + interface ichar + module procedure uch + end interface + contains + function uch (c) + character (len=1), intent (in) :: c + type (int) :: uch + intrinsic ichar + uch%val = 127 - ichar (c) + end function uch + end module m + + program p + use m + print *,ichar('~') ! must print "1" + end program p + +! { dg-final { cleanup-modules "m" } } diff --git a/gcc-4.6/gcc/testsuite/gfortran.dg/widechar_compare_1.f90 b/gcc-4.6/gcc/testsuite/gfortran.dg/widechar_compare_1.f90 new file mode 100644 index 000000000..44101104c --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gfortran.dg/widechar_compare_1.f90 @@ -0,0 +1,10 @@ +! { dg-do run } +! PR 50192 - on little-endian systems, this used to fail. +program main + character(kind=4,len=2) :: c1, c2 + c1 = 4_' ' + c2 = 4_' ' + c1(1:1) = transfer(257, mold=c1(1:1)) + c2(1:1) = transfer(64, mold=c2(1:1)) + if (c1 < c2) call abort +end program main diff --git a/gcc-4.6/gcc/testsuite/gfortran.dg/zero_stride_1.f90 b/gcc-4.6/gcc/testsuite/gfortran.dg/zero_stride_1.f90 new file mode 100644 index 000000000..c5f6cc724 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gfortran.dg/zero_stride_1.f90 @@ -0,0 +1,7 @@ +! { dg-do compile } +! PR 50130 - this caused an ICE. Test case supplied by Joost +! VandeVondele. +integer, parameter :: a(10)=0 +integer, parameter :: b(10)=a(1:10:0) ! { dg-error "Illegal stride of zero" } +END + diff --git a/gcc-4.6/gcc/testsuite/gfortran.fortran-torture/compile/pr50260.f90 b/gcc-4.6/gcc/testsuite/gfortran.fortran-torture/compile/pr50260.f90 new file mode 100644 index 000000000..10f26184b --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gfortran.fortran-torture/compile/pr50260.f90 @@ -0,0 +1,48 @@ +MODULE cp_parser_methods + INTEGER, PARAMETER :: default_string_length=80 + INTEGER, PARAMETER :: default_path_length=250 + TYPE ilist_type + LOGICAL :: in_use + END TYPE ilist_type + TYPE cp_parser_type + CHARACTER(LEN=default_path_length) :: ifn + INTEGER :: icol,icol1,icol2 + TYPE(ilist_type), POINTER :: ilist + END TYPE cp_parser_type + TYPE cp_error_type + END TYPE cp_error_type +CONTAINS + FUNCTION cts(i) RESULT(res) + CHARACTER(len=6) :: res + END FUNCTION cts + FUNCTION parser_location(parser,error) RESULT(res) + TYPE(cp_parser_type), POINTER :: parser + TYPE(cp_error_type), INTENT(inout) :: error + CHARACTER(len=default_path_length+default_string_length) :: res + LOGICAL :: failure + IF (.NOT. failure) THEN + res="file:'"//TRIM(parser%ifn)//"' line:"//cts(parser%icol) + END IF + END FUNCTION parser_location + SUBROUTINE parser_get_integer(parser,at_end, error) + TYPE(cp_parser_type), POINTER :: parser + TYPE(cp_error_type), INTENT(inout) :: error + LOGICAL :: failure, my_at_end + IF (.NOT.failure) THEN + IF (.NOT.parser%ilist%in_use) THEN + CALL cp_assert("A"// TRIM(parser_location(parser,error))) + END IF + END IF + END SUBROUTINE parser_get_integer + SUBROUTINE parser_get_string(parser,at_end,error) + TYPE(cp_parser_type), POINTER :: parser + LOGICAL, INTENT(out), OPTIONAL :: at_end + TYPE(cp_error_type), INTENT(inout) :: error + LOGICAL :: failure, my_at_end + IF (.NOT.failure) THEN + IF (PRESENT(at_end)) THEN + CALL cp_assert("s"//TRIM(parser_location(parser,error))) + END IF + END IF + END SUBROUTINE parser_get_string +END MODULE cp_parser_methods diff --git a/gcc-4.6/gcc/testsuite/gnat.dg/atomic5.adb b/gcc-4.6/gcc/testsuite/gnat.dg/atomic5.adb new file mode 100644 index 000000000..efbed4e34 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gnat.dg/atomic5.adb @@ -0,0 +1,20 @@ +package body Atomic5 is + + function Create return R is + begin + return (A => 0, B => 1, C => 2, D => 4); + end; + + procedure Proc1 is + I : Unsigned_32; + begin + I := Conv(Create); + end; + + procedure Proc2 is + I : Unsigned_32; + begin + I := Conv(R'(A => 0, B => 1, C => 2, D => 4)); + end; + +end Atomic5; diff --git a/gcc-4.6/gcc/testsuite/gnat.dg/atomic5.ads b/gcc-4.6/gcc/testsuite/gnat.dg/atomic5.ads new file mode 100644 index 000000000..3f653fa11 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gnat.dg/atomic5.ads @@ -0,0 +1,25 @@ +-- { dg-do compile } + +with Unchecked_Conversion; + +package Atomic5 is + + type Byte is mod 2 ** 8; + for Byte'Size use 8; + + type Unsigned_32 is mod 2 ** 32; + for Unsigned_32'Size use 32; + + type R is record + A,B,C,D : Byte; + end record; + for R'Alignment use 4; + pragma Atomic (R); + + function Conv is new Unchecked_Conversion (R, Unsigned_32); + + procedure Proc1; + + procedure Proc2; + +end Atomic5; diff --git a/gcc-4.6/gcc/testsuite/gnat.dg/frame_overflow.adb b/gcc-4.6/gcc/testsuite/gnat.dg/frame_overflow.adb index e1ff4d365..1e7405fa5 100644 --- a/gcc-4.6/gcc/testsuite/gnat.dg/frame_overflow.adb +++ b/gcc-4.6/gcc/testsuite/gnat.dg/frame_overflow.adb @@ -1,27 +1,20 @@ -- { dg-do compile } -with System; +package body Frame_Overflow is -procedure frame_overflow is - - type Bitpos_Range_T is range 1..2**(System.Word_Size-1)-1; - type Bitmap_Array_T is array (Bitpos_Range_T) of Boolean; - - type Bitmap_T is record - Bits : Bitmap_Array_T := (others => False); - end record; - - function + function -- { dg-error "too large" } Set_In (Bitmap : Bitmap_T; Bitpos : Bitpos_Range_T) return Bitmap_T is - Result: Bitmap_T := Bitmap; -- { dg-error "Storage_Error" } + Result: Bitmap_T := Bitmap; begin Result.Bits (Bitpos) := True; return Result; end; - function Negate (Bitmap : Bitmap_T) return Bitmap_T is - Result: Bitmap_T; -- { dg-error "Storage_Error" } + function -- { dg-error "too large" } + Negate (Bitmap : Bitmap_T) return Bitmap_T + is + Result: Bitmap_T; begin for E in Bitpos_Range_T loop Result.Bits (E) := not Bitmap.Bits (E); @@ -29,6 +22,4 @@ procedure frame_overflow is return Result; end; -begin - null; -end; +end Frame_Overflow; diff --git a/gcc-4.6/gcc/testsuite/gnat.dg/frame_overflow.ads b/gcc-4.6/gcc/testsuite/gnat.dg/frame_overflow.ads new file mode 100644 index 000000000..898e37a67 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/gnat.dg/frame_overflow.ads @@ -0,0 +1,17 @@ +with System; + +package Frame_Overflow is + + type Bitpos_Range_T is range 1..2**(System.Word_Size-1)-1; + type Bitmap_Array_T is array (Bitpos_Range_T) of Boolean; + + type Bitmap_T is record + Bits : Bitmap_Array_T := (others => False); + end record; + + function + Set_In (Bitmap : Bitmap_T; Bitpos : Bitpos_Range_T) return Bitmap_T; + + function Negate (Bitmap : Bitmap_T) return Bitmap_T; + +end Frame_Overflow; diff --git a/gcc-4.6/gcc/testsuite/gnat.dg/specs/addr1.ads b/gcc-4.6/gcc/testsuite/gnat.dg/specs/addr1.ads index 83d432cff..ed048f68e 100644 --- a/gcc-4.6/gcc/testsuite/gnat.dg/specs/addr1.ads +++ b/gcc-4.6/gcc/testsuite/gnat.dg/specs/addr1.ads @@ -15,7 +15,7 @@ package Addr1 is end record; for Rec2'Size use 64; - A: Arr (1 .. 12); + A: Arr (1 .. 4); Obj1: Rec1; for Obj1'Address use A'Address; -- { dg-bogus "alignment" } diff --git a/gcc-4.6/gcc/testsuite/lib/gcc-dg.exp b/gcc-4.6/gcc/testsuite/lib/gcc-dg.exp index 4cdfa3e02..450f27804 100644 --- a/gcc-4.6/gcc/testsuite/lib/gcc-dg.exp +++ b/gcc-4.6/gcc/testsuite/lib/gcc-dg.exp @@ -565,6 +565,24 @@ proc scan-module { args } { } } +# Scan Fortran modules for absence of a given regexp. +# +# Argument 0 is the module name +# Argument 1 is the regexp to match +proc scan-module-absence { args } { + set modfilename [string tolower [lindex $args 0]].mod + set fd [open $modfilename r] + set text [read $fd] + close $fd + + upvar 2 name testcase + if [regexp -- [lindex $args 1] $text] { + fail "$testcase scan-module [lindex $args 1]" + } else { + pass "$testcase scan-module [lindex $args 1]" + } +} + # Verify that the compiler output file exists, invoked via dg-final. proc output-exists { args } { # Process an optional target or xfail list. diff --git a/gcc-4.6/gcc/testsuite/lib/prune.exp b/gcc-4.6/gcc/testsuite/lib/prune.exp index 4e08bf3d1..093d4f708 100644 --- a/gcc-4.6/gcc/testsuite/lib/prune.exp +++ b/gcc-4.6/gcc/testsuite/lib/prune.exp @@ -30,6 +30,9 @@ proc prune_gcc_output { text } { regsub -all "(^|\n)Please submit.*instructions\[^\n\]*" $text "" text regsub -all "(^|\n)\[0-9\]\[0-9\]* errors\." $text "" text + # Ignore informational notes. + regsub -all "(^|\n)\[^\n\]*: note: \[^\n\]*" $text "" text + # Ignore harmless -fpic warnings. regsub -all "(^|\n)\[^\n\]*: warning: -f(pic|PIC) ignored for target\[^\n\]*" $text "" text regsub -all "(^|\n)\[^\n\]*: warning: -f(pic|PIC)( and -fpic are| is)? not supported\[^\n\]*" $text "" text diff --git a/gcc-4.6/gcc/testsuite/lib/target-supports-dg.exp b/gcc-4.6/gcc/testsuite/lib/target-supports-dg.exp index 99cffe03c..c9aa0cf12 100644 --- a/gcc-4.6/gcc/testsuite/lib/target-supports-dg.exp +++ b/gcc-4.6/gcc/testsuite/lib/target-supports-dg.exp @@ -100,6 +100,16 @@ proc dg-require-ifunc { args } { } } +# If this target does not support the section exclude "e" attribute, +# skip this test. + +proc dg-require-section-exclude { args } { + if { ![ check_section_exclude_available ] } { + upvar dg-do-what dg-do-what + set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"] + } +} + # If this target's linker does not support the --gc-sections flag, # skip this test. diff --git a/gcc-4.6/gcc/testsuite/lib/target-supports.exp b/gcc-4.6/gcc/testsuite/lib/target-supports.exp index a90786178..8bd72ef84 100644 --- a/gcc-4.6/gcc/testsuite/lib/target-supports.exp +++ b/gcc-4.6/gcc/testsuite/lib/target-supports.exp @@ -370,45 +370,28 @@ proc check_alias_available { } { return $alias_available_saved } -############################### -# proc check_ifunc_available { } -############################### - -# Determine if the target toolchain supports the ifunc attribute. - -# Returns 1 if the target supports ifunc. Returns 0 if the target -# does not support ifunc. +# Returns 1 if the target toolchain supports ifunc, 0 otherwise. proc check_ifunc_available { } { - global ifunc_available_saved - global tool - - if [info exists ifunc_available_saved] { - verbose "check_ifunc_available returning saved $ifunc_available_saved" 2 - } else { - set src ifunc[pid].c - set obj ifunc[pid].o - verbose "check_ifunc_available compiling testfile $src" 2 - set f [open $src "w"] - puts $f "#endif" - puts $f "#ifdef __cplusplus\nextern \"C\"\n#endif" - puts $f "void g() {}" - puts $f "void f() __attribute__((ifunc(\"g\")));" - close $f - set lines [${tool}_target_compile $src $obj object ""] - file delete $src - remote_file build delete $obj + return [check_no_compiler_messages ifunc_available object { + #ifdef __cplusplus + extern "C" + #endif + void g() {} + void f() __attribute__((ifunc("g"))); + }] +} - if [string match "" $lines] then { - set ifunc_available_saved 1 - } else { - set ifunc_available_saved 0 - } +# Returns true if tool chain supports "e" section attribute. - verbose "check_ifunc_available returning $ifunc_available_saved" 2 - } - - return $ifunc_available_saved +proc check_section_exclude_available { } { + return [check_runtime_nocache section_exclude_available { + asm(".section \".gnu.callgraph.text.main\", \"e\""); + int main() + { + return 0; + } + }] } # Returns true if --gc-sections is supported on the target. @@ -465,7 +448,7 @@ proc check_effective_target_trampolines { } { } if { [istarget avr-*-*] || [istarget hppa2.0w-hp-hpux11.23] - || [istarget hppa64-hp-hpux11.23] } { + || [istarget hppa64-hp-hpux11.23] } { return 0; } return 1 @@ -1054,8 +1037,8 @@ proc check_sse_os_support_available { } { check_runtime_nocache sse_os_support_available { int main () { - __asm__ volatile ("movss %xmm2,%xmm1"); - return 0; + asm volatile ("movss %xmm2,%xmm1"); + return 0; } } "-msse" } else { @@ -1064,6 +1047,29 @@ proc check_sse_os_support_available { } { }] } +# Return 1 if the target OS supports running AVX executables, 0 +# otherwise. Cache the result. + +proc check_avx_os_support_available { } { + return [check_cached_effective_target avx_os_support_available { + # If this is not the right target then we can skip the test. + if { !([istarget x86_64-*-*] || [istarget i?86-*-*]) } { + expr 0 + } else { + # Check that OS has AVX and SSE saving enabled. + check_runtime_nocache avx_os_support_available { + int main () + { + unsigned int eax, edx; + + asm ("xgetbv" : "=a" (eax), "=d" (edx) : "c" (0)); + return (eax & 6) != 6; + } + } "" + } + }] +} + # Return 1 if the target supports executing SSE instructions, 0 # otherwise. Cache the result. @@ -1160,7 +1166,8 @@ proc check_effective_target_sse2_runtime { } { proc check_effective_target_avx_runtime { } { if { [check_effective_target_avx] - && [check_avx_hw_available] } { + && [check_avx_hw_available] + && [check_avx_os_support_available] } { return 1 } return 0 diff --git a/gcc-4.6/gcc/testsuite/obj-c++.dg/property/cxx-property-1.mm b/gcc-4.6/gcc/testsuite/obj-c++.dg/property/cxx-property-1.mm new file mode 100644 index 000000000..3c6f93e2a --- /dev/null +++ b/gcc-4.6/gcc/testsuite/obj-c++.dg/property/cxx-property-1.mm @@ -0,0 +1,10 @@ +/* Testcase from PR obj-c++/48275. */ +/* { dg-do compile } */ + +@interface Test +{ + int ns; +} +@property (getter=namespace) int ns; + +@end diff --git a/gcc-4.6/gcc/testsuite/obj-c++.dg/property/cxx-property-2.mm b/gcc-4.6/gcc/testsuite/obj-c++.dg/property/cxx-property-2.mm new file mode 100644 index 000000000..4e085b398 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/obj-c++.dg/property/cxx-property-2.mm @@ -0,0 +1,22 @@ +/* { dg-do compile } */ + +/* All these C++ keywords are acceptable in ObjC method names, hence + should be accepted for property getters and setters. */ + +@interface Test +{ + Class isa; +} +@property (getter=namespace) int p0; +@property (setter=namespace:) int p1; +@property (getter=and) int p2; +@property (setter=and:) int p3; +@property (getter=class) int p4; +@property (setter=class:) int p5; +@property (getter=new) int p6; +@property (setter=new:) int p7; +@property (getter=delete) int p8; +@property (setter=delete:) int p9; +@property (getter=delete) int p10; +@property (setter=delete:) int p11; +@end |