diff options
Diffstat (limited to 'gcc/testsuite')
185 files changed, 4574 insertions, 99 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 11da3e73dd7..4d6eb811876 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,472 @@ +2009-10-23 Jason Merrill <jason@redhat.com> + + * g++.dg/cpp0x/lambda/lambda-nested2.C: New. + + Core issue 899 + * g++.dg/cpp0x/explicit4.C: New. + +2009-10-23 Joseph Myers <joseph@codesourcery.com> + + * g++.dg/abi/rtti3.C, g++.dg/abi/thunk4.C: Skip for *-*-mingw* and + *-*-cygwin. + * g++.dg/cpp0x/lambda/lambda-mangle.C: Disable weak symbols tests + for *-*-mingw* and *-*-cygwin. + * g++.dg/opt/vt1.C: Skip for *-*-mingw* and *-*_cygwin. + * g++.dg/template/spec35.C: Disable weak symbol test for + *-*-mingw* and *-*-cygwin. + + PR testsuite/31342 + * gcc.target/i386/pic-1.c: Skip for *-*-mingw* and *-*-cygwin. + +2009-10-23 Janus Weil <janus@gcc.gnu.org> + + PR fortran/41800 + * gfortran.dg/class_10.f03: New test. + +2009-10-22 Michael Meissner <meissner@linux.vnet.ibm.com> + + PR target/41787 + * gcc.target/powerpc/vsx-vrsave.c: New file. + +2009-10-23 Joseph Myers <joseph@codesourcery.com> + + PR c/41673 + * gcc.dg/Wstrict-aliasing-bogus-vla-1.c: New test. + +2009-10-23 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/41778 + * gcc.dg/tree-ssa/ssa-pre-26.c: New testcase. + +2009-10-22 Richard Guenther <rguenther@suse.de> + + PR lto/41791 + * g++.dg/lto/20091022-2_0.C: New testcase. + +2009-10-22 Richard Guenther <rguenther@suse.de> + + PR lto/41730 + * g++.dg/lto/20091022-1_0.C: New testcase. + +2009-10-22 Jan Hubicka <jh@suse.cz> + + * gcc.c-torture/compile/pr40556.c: New testcase. + +2009-10-22 Janus Weil <janus@gcc.gnu.org> + + PR fortran/41781 + * gfortran.dg/goto_8.f90: New test case. + +2009-10-21 Sebastian Pop <sebastian.pop@amd.com> + + PR tree-optimization/41497 + * gcc.dg/tree-ssa/pr41497.c: New. + +2009-10-21 Steve Ellcey <sje@cup.hp.com> + + * g++.dg/tree-ssa/copyprop.C: Use include to define free(). + +2009-10-21 Joseph Myers <joseph@codesourcery.com> + + * gcc.dg/tls/pie-1.c: New test. + +2009-10-21 Jakub Jelinek <jakub@redhat.com> + + * g++.dg/abi/mangle33.C: New test. + +2009-10-21 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/discr22.adb: New test. + +2009-10-21 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/loop_optimization7.ad[sb]: New test. + * gnat.dg/loop_optimization7_pkg.ads: New helper. + +2009-10-21 Janus Weil <janus@gcc.gnu.org> + + PR fortran/41706 + PR fortran/41766 + * gfortran.dg/class_9.f03: Extended test case. + * gfortran.dg/select_type_7.f03: New test case. + +2009-10-20 Richard Guenther <rguenther@suse.de> + + * gcc.dg/lto/20091020-3_0.c: New testcase. + +2009-10-20 Richard Guenther <rguenther@suse.de> + + PR lto/41761 + * gcc.dg/lto/20091020-1_0.c: New testcase. + * gcc.dg/lto/20091020-1_1.c: Likewise. + * gcc.dg/lto/20091020-2_0.c: Likewise. + * gcc.dg/lto/20091020-2_1.c: Likewise. + +2009-10-20 Jakub Jelinek <jakub@redhat.com> + + PR debug/41340 + * gcc.dg/pr41340.c: New test. + +2009-10-20 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/discr21.ad[sb]: New test. + * gnat.dg/discr21_pkg.ads: New helper. + +2009-10-20 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/41706 + * gfortran.dg/class_9 : New test. + +2009-10-19 Jakub Jelinek <jakub@redhat.com> + + * gcc.dg/raw-string-1.c: New test. + * gcc.dg/raw-string-2.c: New test. + * gcc.dg/raw-string-3.c: New test. + * gcc.dg/raw-string-4.c: New test. + * gcc.dg/raw-string-5.c: New test. + * gcc.dg/raw-string-6.c: New test. + * gcc.dg/raw-string-7.c: New test. + * gcc.dg/utf8-1.c: New test. + * gcc.dg/utf8-2.c: New test. + * gcc.dg/utf-badconcat2.c: New test. + * gcc.dg/utf-dflt2.c: New test. + * gcc.dg/cpp/include6.c: New test. + * g++.dg/ext/raw-string-1.C: New test. + * g++.dg/ext/raw-string-2.C: New test. + * g++.dg/ext/raw-string-3.C: New test. + * g++.dg/ext/raw-string-4.C: New test. + * g++.dg/ext/raw-string-5.C: New test. + * g++.dg/ext/raw-string-6.C: New test. + * g++.dg/ext/raw-string-7.C: New test. + * g++.dg/ext/utf8-1.C: New test. + * g++.dg/ext/utf8-2.C: New test. + * g++.dg/ext/utf-badconcat2.C: New test. + * g++.dg/ext/utf-dflt2.C: New test. + + * gcc.dg/cleanup-13.c: New test. + +2009-10-19 Janus Weil <janus@gcc.gnu.org> + + PR fortran/41586 + * gfortran.dg/auto_dealloc_1.f90: New test case. + +2009-10-19 Jakub Jelinek <jakub@redhat.com> + + Port from redhat/gcc-4_4-branch: + 2009-10-08 Jakub Jelinek <jakub@redhat.com> + * gcc.dg/debug/vta-2.c: New test. + + 2009-09-30 Alexandre Oliva <aoliva@redhat.com> + * gcc.dg/debug/vta-1.c: New. + +2009-10-19 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/noreturn2.ad[sb]: New test. + +2009-10-19 Tobias Burnus <burnus@net-b.de> + + PR fortran/41755 + * gfortran.dg/equiv_8.f90: New test. + * gfortran.dg/class_allocate_1.f03: Remove obsolete FIXME. + +2009-10-19 Joseph Myers <joseph@codesourcery.com> + + * gcc.target/arm/neon-thumb2-move.c: New test. + +2009-10-19 Jakub Jelinek <jakub@redhat.com> + + * gcc.dg/debug/vta-3.c: New test. + +2009-10-17 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/nested_proc.adb: Rename into... + * gnat.dg/nested_proc1.adb: ...this. + * gnat.dg/nested_proc2.adb: New test. + +2009-10-17 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/noreturn1.ad[sb]: New test. + +2009-10-17 Janus Weil <janus@gcc.gnu.org> + Paul Thomas <pault@gcc.gnu.org> + + PR fortran/41629 + * gfortran.dg/class_6.f90: New test. + + PR fortran/41608 + PR fortran/41587 + * gfortran.dg/class_7.f90: New test. + + PR fortran/41618 + * gfortran.dg/class_8.f90: New test. + +2009-10-17 Richard Guenther <rguenther@suse.de> + + * gcc.dg/lto/20091017-1_0.c: New testcase. + * gcc.dg/lto/20091017-1_1.c: Likewise. + +2009-10-17 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/unchecked_convert4.adb: Add missing rep clause. + +2009-10-17 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/aggr11.adb: New test. + * gnat.dg/aggr11_pkg.ads: New helper. + +2009-10-17 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/slice8.adb: New test. + * gnat.dg/slice8_pkg1.ads: New helper. + * gnat.dg/slice8_pkg2.ads: Likewise. + * gnat.dg/slice8_pkg3.ad[sb]: Likewise. + +2009-10-17 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/unchecked_convert4.adb: New test. + +2009-10-15 Jason Merrill <jason@redhat.com> + + PR c++/38798 + * g++.dg/cpp0x/trailing5.C: New. + + * g++.dg/cpp0x/auto6.C: Rename to trailing1.C. + * g++.dg/cpp0x/auto8.C: Rename to trailing2.C. + * g++.dg/cpp0x/auto12.C: Rename to trailing3.C. + * g++.dg/cpp0x/auto13.C: Rename to trailing4.C. + +2009-10-16 Janus Weil <janus@gcc.gnu.org> + + PR fortran/41719 + * gfortran.dg/class_5.f03: New test case. + * gfortran.dg/typebound_operator_2.f03: Fixing invalid test case. + * gfortran.dg/typebound_operator_4.f03: Ditto. + +2009-10-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * g++.dg/ipa/iinline-1.C: Use dg-add-options bind_pic_locally. + * g++.dg/other/first-global.C: Likewise. + * g++.dg/parse/attr-externally-visible-1.C: Likewise. + * g++.dg/torture/pr40323.C: Likewise. + * g++.dg/tree-ssa/nothrow-1.C: Likewise. + * gcc.dg/inline-33.c: Likewise. + * gcc.dg/ipa/ipa-1.c: Likewise. + * gcc.dg/ipa/ipa-2.c: Likewise. + * gcc.dg/ipa/ipa-3.c: Likewise. + * gcc.dg/ipa/ipa-4.c: Likewise. + * gcc.dg/ipa/ipa-5.c: Likewise. + * gcc.dg/ipa/ipa-7.c: Likewise. + * gcc.dg/ipa/ipacost-2.c: Likewise. + * gcc.dg/tree-ssa/inline-3.c: Likewise. + * gcc.dg/tree-ssa/local-pure-const.c: Likewise. + * gfortran.dg/whole_file_5.f90: Likewise. + * gfortran.dg/whole_file_6.f90: Likewise. + +2009-10-16 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/41728 + * gcc.c-torture/compile/pr41728.c: New testcase. + +2009-10-16 Richard Guenther <rguenther@suse.de> + + PR lto/41598 + * gcc.dg/lto/20091016-1_0.c: New testcase. + * gcc.dg/lto/20091016-1_1.c: Likewise. + * gcc.dg/lto/20091016-1_a.h: Likewise. + +2009-10-16 Richard Guenther <rguenther@suse.de> + + PR lto/41715 + * gfortran.dg/lto/20091015-1_0.f: New testcase. + * gfortran.dg/lto/20091015-1_1.f: Likewise. + * gfortran.dg/lto/20091015-1_2.f: Likewise. + +2009-10-16 Richard Guenther <rguenther@suse.de> + + PR lto/41713 + * gfortran.dg/lto/20091016-1_0.f90: New testcase. + +2009-10-15 Jakub Jelinek <jakub@redhat.com> + + PR debug/41717 + * gcc.dg/debug/pr41717.c: New test. + +2009-10-16 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/41648 + * gfortran.dg/dynamic_dispatch_4.f03 : New test. + + PR fortran/41656 + * gfortran.dg/dynamic_dispatch_5.f03 : New test. + +2009-10-15 Michael Meissner <meissner@linux.vnet.ibm.com> + + PR target/23983 + * gcc.target/powerpc/altivec-4.c (b): Make sure altivec builtin + result used. + * g++.dg/ext/altivec-2.C (main): Ditto. + +2009-10-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * lib/target-supports.exp (add_options_for_bind_pic_locally): New. + * gcc.dg/tree-ssa/ipa-cp-1.c: Bind pic locally. + +2009-10-15 Richard Guenther <rguenther@suse.de> + + PR lto/41669 + * gcc.dg/lto/20091015-1_0.c: New testcase. + * gcc.dg/lto/20091015-1_1.c: Likewise. + * gcc.dg/lto/20091015-1_2.c: Likewise. + * gcc.dg/lto/20091015-1_a.h: Likewise. + * gcc.dg/lto/20091015-1_b.h: Likewise. + +2009-10-15 Steve Ellcey <sje@cup.hp.com> + + * gcc.dg/torture/pr41555.c: Add -std=c99 option. + +2009-10-14 Daniel Gutson <dgutson@codesourcery.com> + + * gcc.target/arm/neon/vfp-shift-a2t2.c: New test case. + +2009-10-14 Jakub Jelinek <jakub@redhat.com> + + * obj-c++.dg/layout-1.mm: Don't xfail dg-bogus on lp64, change + line from 1 to 0. + * obj-c++.dg/bitfield-1.mm: Likewise. + * obj-c++.dg/bitfield-4.mm: Likewise. + +2009-10-14 Richard Guenther <rguenther@suse.de> + + PR lto/41173 + * gcc.dg/lto/20091014-1_0.c: New testcase. + +2009-10-14 Jakub Jelinek <jakub@redhat.com> + + PR testsuite/41707 + * g++.dg/plugin/attribute_plugin-test-1.C: Expect the first + warning on line 0 instead of 1. + +2009-10-14 Richard Guenther <rguenther@suse.de> + + PR lto/41521 + * gfortran.dg/lto/pr41521_0.f90: New testcase. + * gfortran.dg/lto/pr41521_1.f90: Likewise. + +2009-10-14 Jakub Jelinek <jakub@redhat.com> + + PR preprocessor/41543 + * gcc.dg/debug/dwarf2/pr41543.c: New test. + + PR debug/41695 + * gcc.dg/debug/dwarf2/pr41695.c: New test. + +2009-10-14 Uros Bizjak <ubizjak@gmail.com> + + * gcc.target/i386/i386.exp (check_effective_target_ms_hook_prologue): + New procedure. + * gcc.target/i386/ms_hook_prologue.c: Check for ms_hook_prologue + effective target. + +2009-10-14 Jason Merrill <jason@redhat.com> + + PR c++/39866 + * g++.dg/cpp0x/defaulted14.C: New. + +2009-10-14 Larry Evans <cppljevans@suddenlink.net> + + * g++.dg/cpp0x/vt-40092.C: New. + +2009-10-14 Alexandre Oliva <aoliva@redhat.com> + + * gcc.dg/guality/pr41616-1.c: Drop -O2. + * gcc.dg/guality/pr41447-1.c: Likewise. Name main. + +2009-10-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * gfortran.dg/complex_intrinsic_8.f90: New test. + +2009-10-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * gcc.dg/torture/builtin-math-6.c: Test complex "arc" functions. + * lib/target-supports.exp (check_effective_target_mpc_arc): New. + +2009-10-14 Hans-Peter Nilsson <hp@axis.com> + + PR target/38948 + * gcc.dg/torture/pr38948.c: New test. + +2009-10-13 Steve Ellcey <sje@cup.hp.com> + + * gfortran.dg/vect/fast-math-pr38968.f90: Add timeout. + +2009-10-13 Janus Weil <janus@gcc.gnu.org> + + PR fortran/41581 + * gfortran.dg/class_allocate_2.f03: Modified. + * gfortran.dg/class_allocate_3.f03: New test case. + +2009-10-13 Richard Guenther <rguenther@suse.de> + + PR lto/41668 + * gcc.dg/lto/20091006-2_0.c: New testcase. + * gcc.dg/lto/20091006-2_1.c: Likewise. + * gcc.dg/lto/20091006-2_2.c: Likewise. + * gcc.dg/lto/20091013-1_0.c: Likewise. + * gcc.dg/lto/20091013-1_1.c: Likewise. + * gcc.dg/lto/20091013-1_2.c: Likewise. + +2009-10-13 Martin Jambor <mjambor@suse.cz> + + * gcc.c-torture/compile/pr41661.c: New test. + +2009-10-12 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR libgfortran/41683 + * gfortran.dg/fmt_error_9.f: Add check for repeat count after P. + +2009-10-12 Jason Merrill <jason@redhat.com> + + PR c++/37875 + * g++.dg/cpp0x/decltype18.C: New. + + PR c++/37766 + * g++.dg/cpp0x/fntmpdefarg1.C: New. + +2009-10-12 Janis Johnson <janis187@us.ibm.com> + + * gcc.dg/lto/20090914-2.c: Fix typos in test directives. + +2009-10-12 Alexandre Oliva <aoliva@redhat.com> + + PR debug/41343 + PR debug/41447 + PR debug/41264 + PR debug/41338 + * gcc.dg/guality/pr41447-1.c: New. + * gcc.dg/debug/pr41264-1.c: New. + * gcc.dg/debug/pr41343-1.c: New. + +2009-10-12 Hans-Peter Nilsson <hp@axis.com> + + PR target/26515 + * gcc.dg/torture/pr26515.c: New test. + +2009-10-12 Janis Johnson <janis187@us.ibm.com> + + PR testsuite/41659 + * gcc.dg/lto/20090914-2.c: Use dg-skip-if to skip test. + * lib/lto.exp (lto-get-options-main): Report error for using "target" + or "xfail" with dg-lto-do. + +2009-10-12 Stefan Dösinger <stefan@codeweavers.com> + + * gcc.target/i386/ms_hook_prologue.c: New testcase. + +2009-10-12 Michael Matz <matz@suse.de> + + * gcc.dg/plugin/one_time_plugin.c: Update test to use the cfg + pass. + 2009-10-12 Jakub Jelinek <jakub@redhat.com> PR target/41680 @@ -6,7 +475,7 @@ 2009-10-12 Dodji Seketeli <dodji@redhat.com> PR c++/41570 - * gcc/testsuite/g++.dg/debug/dwarf2/template-params-7.C: New test. + * g++.dg/debug/dwarf2/template-params-7.C: New test. 2009-10-12 Alexandre Oliva <aoliva@redhat.com> @@ -681,56 +1150,55 @@ 2009-09-29 Harsha Jagasia <harsha.jagasia@amd.com> - * gcc.target/i386/fma4-check.h - * gcc.target/i386/fma4-fma.c - * gcc.target/i386/fma4-maccXX.c - * gcc.target/i386/fma4-msubXX.c - * gcc.target/i386/fma4-nmaccXX.c - * gcc.target/i386/fma4-nmsubXX.c - * gcc.target/i386/fma4-vector.c - * gcc.target/i386/fma4-256-maccXX.c - * gcc.target/i386/fma4-256-msubXX.c - * gcc.target/i386/fma4-256-nmaccXX.c - * gcc.target/i386/fma4-256-nmsubXX.c - * gcc.target/i386/fma4-256-vector.c - * gcc.target/i386/funcspec-2.c: New file. - - * gcc.target/i386/funcspec-4.c: Test error conditions - related to FMA4. - - * gcc.target/i386/funcspec-5.c - * gcc.target/i386/funcspec-6.c - * gcc.target/i386/funcspec-8.c: Add FMA4. + * gcc.target/i386/fma4-check.h: New file. + * gcc.target/i386/fma4-fma.c: Ditto. + * gcc.target/i386/fma4-maccXX.c: Ditto. + * gcc.target/i386/fma4-msubXX.c: Ditto. + * gcc.target/i386/fma4-nmaccXX.c: Ditto. + * gcc.target/i386/fma4-nmsubXX.c: Ditto. + * gcc.target/i386/fma4-vector.c: Ditto. + * gcc.target/i386/fma4-256-maccXX.c: Ditto. + * gcc.target/i386/fma4-256-msubXX.c: Ditto. + * gcc.target/i386/fma4-256-nmaccXX.c: Ditto. + * gcc.target/i386/fma4-256-nmsubXX.c: Ditto. + * gcc.target/i386/fma4-256-vector.c: Ditto. + * gcc.target/i386/funcspec-2.c: Ditto. + + * gcc.target/i386/funcspec-4.c: Test error conditions related to FMA4. + + * gcc.target/i386/funcspec-5.c: Add FMA4. + * gcc.target/i386/funcspec-6.c: Ditto. + * gcc.target/i386/funcspec-8.c: Ditto. * gcc.target/i386/funcspec-9.c: New file. * gcc.target/i386/i386.exp: Add check_effective_target_fma4. - * gcc.target/i386/isa-10.c - * gcc.target/i386/isa-11.c - * gcc.target/i386/isa-12.c - * gcc.target/i386/isa-13.c - * gcc.target/i386/isa-2.c - * gcc.target/i386/isa-3.c - * gcc.target/i386/isa-4.c - * gcc.target/i386/isa-7.c - * gcc.target/i386/isa-8.c - * gcc.target/i386/isa-9.c: New file. - - * gcc.target/i386/isa-14.c - * gcc.target/i386/isa-1.c - * gcc.target/i386/isa-5.c - * gcc.target/i386/isa-6.c: Add FMA4. - - * gcc.target/i386/sse-12.c - * gcc.target/i386/sse-13.c - * gcc.target/i386/sse-14.c - * gcc.target/i386/sse-22.c: New file. - - * g++.dg/other/i386-2.C - * g++.dg/other/i386-3.C - * g++.dg/other/i386-5.C - * g++.dg/other/i386-6.C: Add -mfma4 in dg-options. + * gcc.target/i386/isa-10.c: New file. + * gcc.target/i386/isa-11.c: Ditto. + * gcc.target/i386/isa-12.c: Ditto. + * gcc.target/i386/isa-13.c: Ditto. + * gcc.target/i386/isa-2.c: Ditto. + * gcc.target/i386/isa-3.c: Ditto. + * gcc.target/i386/isa-4.c: Ditto. + * gcc.target/i386/isa-7.c: Ditto. + * gcc.target/i386/isa-8.c: Ditto. + * gcc.target/i386/isa-9.c: Ditto. + + * gcc.target/i386/isa-14.c: Add FMA4. + * gcc.target/i386/isa-1.c: Ditto. + * gcc.target/i386/isa-5.c: Ditto. + * gcc.target/i386/isa-6.c: Ditto. + + * gcc.target/i386/sse-12.c: New file. + * gcc.target/i386/sse-13.c: Ditto. + * gcc.target/i386/sse-14.c: Ditto. + * gcc.target/i386/sse-22.c: Ditto. + + * g++.dg/other/i386-2.C: Add -mfma4 to dg-options. + * g++.dg/other/i386-3.C: Ditto. + * g++.dg/other/i386-5.C: Ditto. + * g++.dg/other/i386-6.C: Ditto. 2009-09-29 H.J. Lu <hongjiu.lu@intel.com> @@ -753,13 +1221,14 @@ 2009-09-29 Harsha Jagasia <harsha.jagasia@amd.com> * gcc.target/i386/i386.exp: Remove check_effective_target_sse5. - * gcc.target/i386/isa-1.c - * gcc.target/i386/isa-5.c - * gcc.target/i386/isa-6.c: Remove SSE5. - * gcc.target/i386/funcspec-4.c: Remove error conditions related to SSE5. - * gcc.target/i386/avx-1.c - * gcc.target/i386/avx-2.c - * gcc.target/i386/sse-23.c: Remove comments to mmintrin-common.h. + * gcc.target/i386/isa-1.c: Remove SSE5. + * gcc.target/i386/isa-5.c: Ditto. + * gcc.target/i386/isa-6.c: Ditto. + * gcc.target/i386/funcspec-4.c: Remove error conditions + related to SSE5. + * gcc.target/i386/avx-1.c: Remove comments to mmintrin-common.h. + * gcc.target/i386/avx-2.c: Ditto. + * gcc.target/i386/sse-23.c: Ditto. * gcc.target/i386/funcspec-9.c: Delete. 2009-09-29 Jakub Jelinek <jakub@redhat.com> @@ -826,7 +1295,7 @@ 2009-09-27 Richard Henderson <rth@redhat.com> * gcc.c-torture/compile/pr41469.c: Add -fexceptions. - * testsuite/gcc.dg/tree-ssa/pr41469-1.c: New. + * gcc.dg/tree-ssa/pr41469-1.c: New. 2009-09-26 Andreas Schwab <schwab@linux-m68k.org> diff --git a/gcc/testsuite/g++.dg/abi/mangle33.C b/gcc/testsuite/g++.dg/abi/mangle33.C new file mode 100644 index 00000000000..f0a4e5012d3 --- /dev/null +++ b/gcc/testsuite/g++.dg/abi/mangle33.C @@ -0,0 +1,19 @@ +// Testcase for mangling very long names. + +#define N \ +abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklm + +namespace N { + int i; +} + +#undef N +#define N \ +abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk + +namespace N { + int j; +} + +// { dg-final { scan-assembler "_ZN4043abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklm1iE" } } +// { dg-final { scan-assembler "_ZN4041abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk1jE" } } diff --git a/gcc/testsuite/g++.dg/abi/rtti3.C b/gcc/testsuite/g++.dg/abi/rtti3.C index ee562adac59..c03e4611c0b 100644 --- a/gcc/testsuite/g++.dg/abi/rtti3.C +++ b/gcc/testsuite/g++.dg/abi/rtti3.C @@ -2,6 +2,7 @@ // necessarily the type info object // { dg-require-weak "" } +// { dg-skip-if "Linkonce not weak" { *-*-mingw* *-*-cygwin } { "*" } { "" } } // { dg-final { scan-assembler ".weak\[ \t\]_?_ZTSPP1A" { target { ! { *-*-darwin* } } } } } // { dg-final { scan-assembler-not ".weak\[ \t\]_?_ZTIPP1A" { target { ! { *-*-darwin* } } } } } // { dg-final { scan-assembler ".weak_definition\[ \t\]_?_ZTSPP1A" { target { *-*-darwin* } } } } diff --git a/gcc/testsuite/g++.dg/abi/thunk4.C b/gcc/testsuite/g++.dg/abi/thunk4.C index 79af6624d56..fa5fbd43277 100644 --- a/gcc/testsuite/g++.dg/abi/thunk4.C +++ b/gcc/testsuite/g++.dg/abi/thunk4.C @@ -1,4 +1,5 @@ // { dg-require-weak "" } +// { dg-skip-if "Linkonce not weak" { *-*-mingw* *-*-cygwin } { "*" } { "" } } // { dg-final { scan-assembler ".weak\[ \t\]_?_ZThn._N7Derived3FooEv" { target { ! { *-*-darwin* } } } } } // { dg-final { scan-assembler ".weak_definition\[ \t\]_?_ZThn._N7Derived3FooEv" { target { *-*-darwin* } } } } diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype18.C b/gcc/testsuite/g++.dg/cpp0x/decltype18.C new file mode 100644 index 00000000000..0d44586e9d2 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/decltype18.C @@ -0,0 +1,5 @@ +// PR c++/37875 +// { dg-options "-std=c++0x" } + +template <typename> struct X {}; +X<decltype(1 > 2)> x; diff --git a/gcc/testsuite/g++.dg/cpp0x/defaulted14.C b/gcc/testsuite/g++.dg/cpp0x/defaulted14.C new file mode 100644 index 00000000000..235e646780a --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/defaulted14.C @@ -0,0 +1,18 @@ +// PR c++/39866 +// { dg-options "-std=c++0x" } + +struct A { + A& operator=(const A&) = delete; // { dg-bogus "" } + + void operator=(int) {} // { dg-message "" } + void operator=(char) {} // { dg-message "" } +}; + +struct B {}; + +int main() +{ + A a; + a = B(); // { dg-error "no match" } + a = 1.0; // { dg-error "ambiguous" } +} diff --git a/gcc/testsuite/g++.dg/cpp0x/explicit4.C b/gcc/testsuite/g++.dg/cpp0x/explicit4.C new file mode 100644 index 00000000000..74726a99cad --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/explicit4.C @@ -0,0 +1,17 @@ +// Negative explicit conv test. +// { dg-options "-std=c++0x" } + +struct A { + A(const A&, int = 0); // { dg-message "candidates" } +}; +struct B +{ + explicit operator A(); +}; + +int main() +{ + B b; + (A(b)); // OK + (A(b,1)); // { dg-error "no match" } +} diff --git a/gcc/testsuite/g++.dg/cpp0x/fntmpdefarg1.C b/gcc/testsuite/g++.dg/cpp0x/fntmpdefarg1.C new file mode 100644 index 00000000000..25192ad8672 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/fntmpdefarg1.C @@ -0,0 +1,7 @@ +// PR c++/37766 +// { dg-options -std=c++0x } + +int a = 1; +template<int& b = a> void f() { + f<>(); +} diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mangle.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mangle.C index dc89d2388fb..9f7d5f3b2a9 100644 --- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mangle.C +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mangle.C @@ -10,7 +10,7 @@ inline void g(int n) { // The call operator of that type is _ZZ1giENKUlvE_clEv. // { dg-final { scan-assembler "_ZZ1giENKUlvE_clEv" } } -// { dg-final { scan-assembler "weak\[ \t\]*_?_ZZ1giENKUlvE_clEv" { target { ! { *-*-darwin* } } } } } +// { dg-final { scan-assembler "weak\[ \t\]*_?_ZZ1giENKUlvE_clEv" { target { ! { *-*-darwin* *-*-mingw* *-*-cygwin } } } } } algo([=]{return n+bef();}); // The captured entities do not participate in <lambda-sig> @@ -32,7 +32,7 @@ struct S { // Type: ZN1S1fEiiEd0_UlvE_ // Operator: _ZZN1S1fEiiEd0_NKUlvE_clEv // { dg-final { scan-assembler "_ZZN1S1fEiiEd0_NKUlvE_clEv" } } -// { dg-final { scan-assembler "weak\[ \t\]*_?_ZZN1S1fEiiEd0_NKUlvE_clEv" { target { ! { *-*-darwin* } } } } } +// { dg-final { scan-assembler "weak\[ \t\]*_?_ZZN1S1fEiiEd0_NKUlvE_clEv" { target { ! { *-*-darwin* *-*-mingw* *-*-cygwin } } } } } []{return 1;}() // Type: ZN1S1fEiiEd0_UlvE0_ // Operator: _ZZN1S1fEiiEd0_NKUlvE0_clEv @@ -53,7 +53,7 @@ template int R<int>::x; // Type of lambda in intializer of R<int>::x: N1RIiE1xMUlvE_E // Corresponding operator(): _ZNK1RIiE1xMUlvE_clEv // { dg-final { scan-assembler "_ZNK1RIiE1xMUlvE_clEv" } } -// { dg-final { scan-assembler "weak\[ \t\]*_?_ZNK1RIiE1xMUlvE_clEv" } } +// { dg-final { scan-assembler "weak\[ \t\]*_?_ZNK1RIiE1xMUlvE_clEv" { target { ! { *-*-mingw* *-*-cygwin } } } } } void bar() { diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nested2.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nested2.C new file mode 100644 index 00000000000..b7887485595 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nested2.C @@ -0,0 +1,31 @@ +// Testcase from N2998 +// { dg-options -std=c++0x } + +void f1(int i) { + int const N = 20; + auto m1 = [=]{ + int const M = 30; + auto m2 = [i]{ + int x[N][M]; // OK: N and M are not "used" + x[0][0] = i; // OK: i is explicitly captured by m2 + // and implicitly captured by m1 + }; + }; + struct s1 { + int f; + int work(int n) { + int m = n*n; + int j = 40; + auto m3 = [this,m]{ + /*auto m4=*/[&,j]{ // { dg-error "j. is not captured" } + int x = n; // { dg-error "n. is not captured" } + x += m; // OK: m implicitly captured by m4 + // and explicitly captured by m3 + x += i; // { dg-error "i. is not captured" } + x += f; // OK: this captured implicitly by m4 + // and explicitly by m3 + }; + }; + } + }; +} diff --git a/gcc/testsuite/g++.dg/cpp0x/auto6.C b/gcc/testsuite/g++.dg/cpp0x/trailing1.C index 11e73d2e716..11e73d2e716 100644 --- a/gcc/testsuite/g++.dg/cpp0x/auto6.C +++ b/gcc/testsuite/g++.dg/cpp0x/trailing1.C diff --git a/gcc/testsuite/g++.dg/cpp0x/auto8.C b/gcc/testsuite/g++.dg/cpp0x/trailing2.C index e45204fe715..e45204fe715 100644 --- a/gcc/testsuite/g++.dg/cpp0x/auto8.C +++ b/gcc/testsuite/g++.dg/cpp0x/trailing2.C diff --git a/gcc/testsuite/g++.dg/cpp0x/auto12.C b/gcc/testsuite/g++.dg/cpp0x/trailing3.C index 82d36f0d0d2..82d36f0d0d2 100644 --- a/gcc/testsuite/g++.dg/cpp0x/auto12.C +++ b/gcc/testsuite/g++.dg/cpp0x/trailing3.C diff --git a/gcc/testsuite/g++.dg/cpp0x/auto13.C b/gcc/testsuite/g++.dg/cpp0x/trailing4.C index dc7e35aabaa..dc7e35aabaa 100644 --- a/gcc/testsuite/g++.dg/cpp0x/auto13.C +++ b/gcc/testsuite/g++.dg/cpp0x/trailing4.C diff --git a/gcc/testsuite/g++.dg/cpp0x/trailing5.C b/gcc/testsuite/g++.dg/cpp0x/trailing5.C new file mode 100644 index 00000000000..b97d362be2f --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/trailing5.C @@ -0,0 +1,10 @@ +// PR c++/38798, DR 770 +// { dg-options -std=c++0x } + +struct A {}; +auto foo() -> struct A {} + +enum B {}; +auto bar() -> enum B {} + +auto baz() -> struct C {} {} // { dg-error "" } diff --git a/gcc/testsuite/g++.dg/cpp0x/vt-40092.C b/gcc/testsuite/g++.dg/cpp0x/vt-40092.C new file mode 100644 index 00000000000..063ed7e16eb --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/vt-40092.C @@ -0,0 +1,21 @@ +// { dg-do "compile" } +// { dg-options "-std=c++0x" } + +template <typename... Types> struct package {}; + +template <int ArgGen> struct wrapper_gen {}; + +template <int ArgNest> struct wrapper_nest +{ + typedef wrapper_gen<ArgNest> type_nest; +}; + +template <int... ArgPack> +struct wrapper_pack +{ + typedef package<wrapper_gen <ArgPack>...> type_pack; + // incorrect error: expansion pattern 'wrapper_gen<ArgNest>' + // contains no argument packs +}; + + diff --git a/gcc/testsuite/g++.dg/ext/altivec-2.C b/gcc/testsuite/g++.dg/ext/altivec-2.C index 299693694f6..1185a79e5ec 100644 --- a/gcc/testsuite/g++.dg/ext/altivec-2.C +++ b/gcc/testsuite/g++.dg/ext/altivec-2.C @@ -7,6 +7,8 @@ #include <altivec.h> +vector unsigned char use_lvsl; + int main (int argc, const char * argv[]) { int i = 0; @@ -17,7 +19,7 @@ int main (int argc, const char * argv[]) vec_dst(&cv, i, 0); v = vec_ld(0, &cv); v = vec_lde(0, &cf); - vec_lvsl(0, &cf); + use_lvsl = vec_lvsl(0, &cf); return 0; } diff --git a/gcc/testsuite/g++.dg/ext/raw-string-1.C b/gcc/testsuite/g++.dg/ext/raw-string-1.C new file mode 100644 index 00000000000..0e8abf8b498 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/raw-string-1.C @@ -0,0 +1,96 @@ +// { dg-do run } +// { dg-options "-std=c++0x" } + +const char s0[] = R"[a\ +\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb +c]"; +const char s1[] = "a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc"; +const char s2[] = R"*|*[a\ +b +c]" +c]*|" +c]*|*"; +const char s3[] = "ab\nc]\"\nc]*|\"\nc"; + +const char t0[] = u8R"[a\ +\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb +c]"; +const char t1[] = u8"a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc"; +const char t2[] = u8R"*|*[a\ +b +c]" +c]*|" +c]*|*"; +const char t3[] = u8"ab\nc]\"\nc]*|\"\nc"; + +const char16_t u0[] = uR"[a\ +\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb +c]"; +const char16_t u1[] = u"a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc"; +const char16_t u2[] = uR"*|*[a\ +b +c]" +c]*|" +c]*|*"; +const char16_t u3[] = u"ab\nc]\"\nc]*|\"\nc"; + +const char32_t U0[] = UR"[a\ +\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb +c]"; +const char32_t U1[] = U"a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc"; +const char32_t U2[] = UR"*|*[a\ +b +c]" +c]*|" +c]*|*"; +const char32_t U3[] = U"ab\nc]\"\nc]*|\"\nc"; + +const wchar_t L0[] = LR"[a\ +\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb +c]"; +const wchar_t L1[] = L"a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc"; +const wchar_t L2[] = LR"*|*[a\ +b +c]" +c]*|" +c]*|*"; +const wchar_t L3[] = L"ab\nc]\"\nc]*|\"\nc"; + +int +main (void) +{ + if (sizeof (s0) != sizeof (s1) + || __builtin_memcmp (s0, s1, sizeof (s0)) != 0) + __builtin_abort (); + if (sizeof (s2) != sizeof (s3) + || __builtin_memcmp (s2, s3, sizeof (s2)) != 0) + __builtin_abort (); + if (sizeof (t0) != sizeof (t1) + || __builtin_memcmp (t0, t1, sizeof (t0)) != 0) + __builtin_abort (); + if (sizeof (t2) != sizeof (t3) + || __builtin_memcmp (t2, t3, sizeof (t2)) != 0) + __builtin_abort (); + if (sizeof (u0) != sizeof (u1) + || __builtin_memcmp (u0, u1, sizeof (u0)) != 0) + __builtin_abort (); + if (sizeof (u2) != sizeof (u3) + || __builtin_memcmp (u2, u3, sizeof (u2)) != 0) + __builtin_abort (); + if (sizeof (U0) != sizeof (U1) + || __builtin_memcmp (U0, U1, sizeof (U0)) != 0) + __builtin_abort (); + if (sizeof (U2) != sizeof (U3) + || __builtin_memcmp (U2, U3, sizeof (U2)) != 0) + __builtin_abort (); + if (sizeof (L0) != sizeof (L1) + || __builtin_memcmp (L0, L1, sizeof (L0)) != 0) + __builtin_abort (); + if (sizeof (L2) != sizeof (L3) + || __builtin_memcmp (L2, L3, sizeof (L2)) != 0) + __builtin_abort (); + if (sizeof (R"*[]*") != 1 + || __builtin_memcmp (R"*[]*", "", 1) != 0) + __builtin_abort (); + return 0; +} diff --git a/gcc/testsuite/g++.dg/ext/raw-string-2.C b/gcc/testsuite/g++.dg/ext/raw-string-2.C new file mode 100644 index 00000000000..c7eb602afec --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/raw-string-2.C @@ -0,0 +1,104 @@ +// { dg-do run } +// { dg-options "-std=c++0x" } + +#define R +#define u +#define uR +#define U +#define UR +#define u8 +#define u8R +#define L +#define LR + +const char s00[] = R"[a]" "[b]"; +const char s01[] = "[a]" R"*[b]*"; +const char s02[] = R"[a]" R"[b]"; +const char s03[] = R"-[a]-" u8"[b]"; +const char s04[] = "[a]" u8R"MNOPQRSTUVWXYZ[b]MNOPQRSTUVWXYZ"; +const char s05[] = R"[a]" u8R"wxyzABCDEFGHIJKL[b]wxyzABCDEFGHIJKL"; +const char s06[] = u8R";([a];(" "[b]"; +const char s07[] = u8"[a]" R"[b]"; +const char s08[] = u8R"[a]" R"_{}#()<>%:;.?*+-[b]_{}#()<>%:;.?*+-"; +const char s09[] = u8R"/^&|~!=,"'\[a]/^&|~!=,"'\" u8"[b]"; +const char s10[] = u8"[a]" u8R"0123456789abcdef[b]0123456789abcdef"; +const char s11[] = u8R"ghijklmnopqrstuv[a]ghijklmnopqrstuv" u8R"w[b]w"; + +const char16_t u03[] = R"-[a]-" u"[b]"; +const char16_t u04[] = "[a]" uR"MNOPQRSTUVWXYZ[b]MNOPQRSTUVWXYZ"; +const char16_t u05[] = R"[a]" uR"wxyzABCDEFGHIJKL[b]wxyzABCDEFGHIJKL"; +const char16_t u06[] = uR";([a];(" "[b]"; +const char16_t u07[] = u"[a]" R"[b]"; +const char16_t u08[] = uR"[a]" R"_{}#()<>%:;.?*+-[b]_{}#()<>%:;.?*+-"; +const char16_t u09[] = uR"/^&|~!=,"'\[a]/^&|~!=,"'\" u"[b]"; +const char16_t u10[] = u"[a]" uR"0123456789abcdef[b]0123456789abcdef"; +const char16_t u11[] = uR"ghijklmnopqrstuv[a]ghijklmnopqrstuv" uR"w[b]w"; + +const char32_t U03[] = R"-[a]-" U"[b]"; +const char32_t U04[] = "[a]" UR"MNOPQRSTUVWXYZ[b]MNOPQRSTUVWXYZ"; +const char32_t U05[] = R"[a]" UR"wxyzABCDEFGHIJKL[b]wxyzABCDEFGHIJKL"; +const char32_t U06[] = UR";([a];(" "[b]"; +const char32_t U07[] = U"[a]" R"[b]"; +const char32_t U08[] = UR"[a]" R"_{}#()<>%:;.?*+-[b]_{}#()<>%:;.?*+-"; +const char32_t U09[] = UR"/^&|~!=,"'\[a]/^&|~!=,"'\" U"[b]"; +const char32_t U10[] = U"[a]" UR"0123456789abcdef[b]0123456789abcdef"; +const char32_t U11[] = UR"ghijklmnopqrstuv[a]ghijklmnopqrstuv" UR"w[b]w"; + +const wchar_t L03[] = R"-[a]-" L"[b]"; +const wchar_t L04[] = "[a]" LR"MNOPQRSTUVWXYZ[b]MNOPQRSTUVWXYZ"; +const wchar_t L05[] = R"[a]" LR"wxyzABCDEFGHIJKL[b]wxyzABCDEFGHIJKL"; +const wchar_t L06[] = LR";([a];(" "[b]"; +const wchar_t L07[] = L"[a]" R"[b]"; +const wchar_t L08[] = LR"[a]" R"_{}#()<>%:;.?*+-[b]_{}#()<>%:;.?*+-"; +const wchar_t L09[] = LR"/^&|~!=,"'\[a]/^&|~!=,"'\" L"[b]"; +const wchar_t L10[] = L"[a]" LR"0123456789abcdef[b]0123456789abcdef"; +const wchar_t L11[] = LR"ghijklmnopqrstuv[a]ghijklmnopqrstuv" LR"w[b]w"; + +int +main (void) +{ +#define TEST(str, val) \ + if (sizeof (str) != sizeof (val) \ + || __builtin_memcmp (str, val, sizeof (str)) != 0) \ + __builtin_abort () + TEST (s00, "a[b]"); + TEST (s01, "[a]b"); + TEST (s02, "ab"); + TEST (s03, "a[b]"); + TEST (s04, "[a]b"); + TEST (s05, "ab"); + TEST (s06, "a[b]"); + TEST (s07, "[a]b"); + TEST (s08, "ab"); + TEST (s09, "a[b]"); + TEST (s10, "[a]b"); + TEST (s11, "ab"); + TEST (u03, u"a[b]"); + TEST (u04, u"[a]b"); + TEST (u05, u"ab"); + TEST (u06, u"a[b]"); + TEST (u07, u"[a]b"); + TEST (u08, u"ab"); + TEST (u09, u"a[b]"); + TEST (u10, u"[a]b"); + TEST (u11, u"ab"); + TEST (U03, U"a[b]"); + TEST (U04, U"[a]b"); + TEST (U05, U"ab"); + TEST (U06, U"a[b]"); + TEST (U07, U"[a]b"); + TEST (U08, U"ab"); + TEST (U09, U"a[b]"); + TEST (U10, U"[a]b"); + TEST (U11, U"ab"); + TEST (L03, L"a[b]"); + TEST (L04, L"[a]b"); + TEST (L05, L"ab"); + TEST (L06, L"a[b]"); + TEST (L07, L"[a]b"); + TEST (L08, L"ab"); + TEST (L09, L"a[b]"); + TEST (L10, L"[a]b"); + TEST (L11, L"ab"); + return 0; +} diff --git a/gcc/testsuite/g++.dg/ext/raw-string-3.C b/gcc/testsuite/g++.dg/ext/raw-string-3.C new file mode 100644 index 00000000000..46c48620905 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/raw-string-3.C @@ -0,0 +1,58 @@ +// If c++98, the {,u,u8,U,L}R prefix should be parsed as separate +// token. +// { dg-do compile } +// { dg-options "-std=c++98" } + +const void *s0 = R"[a]"; // { dg-error "was not declared" } + // { dg-error "expected ',' or ';'" "" { target *-*-* } 6 } +const void *s1 = uR"[a]"; // { dg-error "was not declared" } + // { dg-error "expected ',' or ';'" "" { target *-*-* } 8 } +const void *s2 = UR"[a]"; // { dg-error "was not declared" } + // { dg-error "expected ',' or ';'" "" { target *-*-* } 10 } +const void *s3 = u8R"[a]"; // { dg-error "was not declared" } + // { dg-error "expected ',' or ';'" "" { target *-*-* } 12 } +const void *s4 = LR"[a]"; // { dg-error "was not declared" } + // { dg-error "expected ',' or ';'" "" { target *-*-* } 14 } + +const int i0 = R'a'; // { dg-error "was not declared" } + // { dg-error "expected ',' or ';'" "" { target *-*-* } 17 } +const int i1 = uR'a'; // { dg-error "was not declared" } + // { dg-error "expected ',' or ';'" "" { target *-*-* } 19 } +const int i2 = UR'a'; // { dg-error "was not declared" } + // { dg-error "expected ',' or ';'" "" { target *-*-* } 21 } +const int i3 = u8R'a'; // { dg-error "was not declared" } + // { dg-error "expected ',' or ';'" "" { target *-*-* } 23 } +const int i4 = LR'a'; // { dg-error "was not declared" } + // { dg-error "expected ',' or ';'" "" { target *-*-* } 25 } + +#define R "a" +#define uR "b" +#define UR "c" +#define u8R "d" +#define LR "e" + +const void *s5 = R"[a]"; +const void *s6 = uR"[a]"; +const void *s7 = UR"[a]"; +const void *s8 = u8R"[a]"; +const void *s9 = LR"[a]"; + +#undef R +#undef uR +#undef UR +#undef u8R +#undef LR + +#define R 1 + +#define uR 2 + +#define UR 3 + +#define u8R 4 + +#define LR 5 + + +const int i5 = R'a'; +const int i6 = uR'a'; +const int i7 = UR'a'; +const int i8 = u8R'a'; +const int i9 = LR'a'; + +int main () {} diff --git a/gcc/testsuite/g++.dg/ext/raw-string-4.C b/gcc/testsuite/g++.dg/ext/raw-string-4.C new file mode 100644 index 00000000000..03179befac8 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/raw-string-4.C @@ -0,0 +1,28 @@ +// R is not applicable for character literals. +// { dg-do compile } +// { dg-options "-std=c++0x" } + +const int i0 = R'a'; // { dg-error "was not declared" } + // { dg-error "expected ',' or ';'" "" { target *-*-* } 5 } +const int i1 = uR'a'; // { dg-error "was not declared" } + // { dg-error "expected ',' or ';'" "" { target *-*-* } 7 } +const int i2 = UR'a'; // { dg-error "was not declared" } + // { dg-error "expected ',' or ';'" "" { target *-*-* } 9 } +const int i3 = u8R'a'; // { dg-error "was not declared" } + // { dg-error "expected ',' or ';'" "" { target *-*-* } 11 } +const int i4 = LR'a'; // { dg-error "was not declared" } + // { dg-error "expected ',' or ';'" "" { target *-*-* } 13 } + +#define R 1 + +#define uR 2 + +#define UR 3 + +#define u8R 4 + +#define LR 5 + + +const int i5 = R'a'; +const int i6 = uR'a'; +const int i7 = UR'a'; +const int i8 = u8R'a'; +const int i9 = LR'a'; + +int main () {} diff --git a/gcc/testsuite/g++.dg/ext/raw-string-5.C b/gcc/testsuite/g++.dg/ext/raw-string-5.C new file mode 100644 index 00000000000..b815eb23b16 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/raw-string-5.C @@ -0,0 +1,23 @@ +// { dg-do compile } +// { dg-options "-std=c++0x" } + +const void *s0 = R"0123456789abcdefg[]0123456789abcdefg"; + // { dg-error "raw string delimiter longer" "" { target *-*-* } 4 } + // { dg-error "stray" "" { target *-*-* } 4 } +const void *s1 = R" [] "; + // { dg-error "invalid character" "" { target *-*-* } 7 } + // { dg-error "stray" "" { target *-*-* } 7 } +const void *s2 = R" [] "; + // { dg-error "invalid character" "" { target *-*-* } 10 } + // { dg-error "stray" "" { target *-*-* } 10 } +const void *s3 = R"][]]"; + // { dg-error "invalid character" "" { target *-*-* } 13 } + // { dg-error "stray" "" { target *-*-* } 13 } +const void *s4 = R"@[]@"; + // { dg-error "invalid character" "" { target *-*-* } 16 } + // { dg-error "stray" "" { target *-*-* } 16 } +const void *s5 = R"$[]$"; + // { dg-error "invalid character" "" { target *-*-* } 19 } + // { dg-error "stray" "" { target *-*-* } 19 } + +int main () {} diff --git a/gcc/testsuite/g++.dg/ext/raw-string-6.C b/gcc/testsuite/g++.dg/ext/raw-string-6.C new file mode 100644 index 00000000000..a97d95d5693 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/raw-string-6.C @@ -0,0 +1,5 @@ +// { dg-do compile } +// { dg-options "-std=c++0x" } + +const void *s0 = R"ouch[]ouCh"; // { dg-error "at end of input" } + // { dg-error "unterminated raw string" "" { target *-*-* } 4 } diff --git a/gcc/testsuite/g++.dg/ext/raw-string-7.C b/gcc/testsuite/g++.dg/ext/raw-string-7.C new file mode 100644 index 00000000000..0f479193433 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/raw-string-7.C @@ -0,0 +1,23 @@ +// The trailing whitespace after \ and before newline extension +// breaks full compliance for raw strings. +// { dg-do run { xfail *-*-* } } +// { dg-options "-std=c++0x" } + +// Note, there is a single space after \ on the following line. +const char *s0 = R"[\ +]"; +// { dg-bogus "backslash and newline separated by space" "" { xfail *-*-* } 7 } + +// Note, there is a single tab after \ on the following line. +const char *s1 = R"[\ +]"; +// { dg-bogus "backslash and newline separated by space" "" { xfail *-*-* } 12 } + +int +main (void) +{ + if (__builtin_strcmp (s0, "\\ \n") != 0 + || __builtin_strcmp (s1, "\\\t\n") != 0) + __builtin_abort (); + return 0; +} diff --git a/gcc/testsuite/g++.dg/ext/utf-badconcat2.C b/gcc/testsuite/g++.dg/ext/utf-badconcat2.C new file mode 100644 index 00000000000..499b323fc19 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/utf-badconcat2.C @@ -0,0 +1,15 @@ +// Test unsupported concatenation of UTF-8 string literals. +// { dg-do compile } +// { dg-options "-std=c++0x" } + +const void *s0 = u8"a" "b"; +const void *s1 = "a" u8"b"; +const void *s2 = u8"a" u8"b"; +const void *s3 = u8"a" u"b"; // { dg-error "non-standard concatenation" } +const void *s4 = u"a" u8"b"; // { dg-error "non-standard concatenation" } +const void *s5 = u8"a" U"b"; // { dg-error "non-standard concatenation" } +const void *s6 = U"a" u8"b"; // { dg-error "non-standard concatenation" } +const void *s7 = u8"a" L"b"; // { dg-error "non-standard concatenation" } +const void *s8 = L"a" u8"b"; // { dg-error "non-standard concatenation" } + +int main () {} diff --git a/gcc/testsuite/g++.dg/ext/utf-dflt2.C b/gcc/testsuite/g++.dg/ext/utf-dflt2.C new file mode 100644 index 00000000000..fd2222f672e --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/utf-dflt2.C @@ -0,0 +1,12 @@ +// In C++0x, the u8 prefix should be parsed as separate tokens. +// { dg-do compile } +// { dg-options "-std=c++98" } + +const void *s0 = u8"a"; // { dg-error "was not declared" } + // { dg-error "expected ',' or ';'" "" { target *-*-* } 5 } + +#define u8 "a" + +const void *s1 = u8"a"; + +int main () {} diff --git a/gcc/testsuite/g++.dg/ext/utf8-1.C b/gcc/testsuite/g++.dg/ext/utf8-1.C new file mode 100644 index 00000000000..203b326af79 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/utf8-1.C @@ -0,0 +1,45 @@ +// { dg-do run } +// { dg-require-iconv "ISO-8859-2" } +// { dg-options "-std=c++0x -fexec-charset=ISO-8859-2" } + +const char *str1 = "h\u00e1\U0000010Dky "; +const char *str2 = "\u010d\u00E1rky\n"; +const char *str3 = u8"h\u00e1\U0000010Dky "; +const char *str4 = u8"\u010d\u00E1rky\n"; +const char *str5 = "h\u00e1\U0000010Dky " "\u010d\u00E1rky\n"; +const char *str6 = u8"h\u00e1\U0000010Dky " "\u010d\u00E1rky\n"; +const char *str7 = "h\u00e1\U0000010Dky " u8"\u010d\u00E1rky\n"; +#define u8 +const char *str8 = u8"h\u00e1\U0000010Dky " u8"\u010d\u00E1rky\n"; + +const char latin2_1[] = "\x68\xe1\xe8\x6b\x79\x20"; +const char latin2_2[] = "\xe8\xe1\x72\x6b\x79\n"; +const char utf8_1[] = "\x68\xc3\xa1\xc4\x8d\x6b\x79\x20"; +const char utf8_2[] = "\xc4\x8d\xc3\xa1\x72\x6b\x79\n"; + +int +main (void) +{ + if (__builtin_strcmp (str1, latin2_1) != 0 + || __builtin_strcmp (str2, latin2_2) != 0 + || __builtin_strcmp (str3, utf8_1) != 0 + || __builtin_strcmp (str4, utf8_2) != 0 + || __builtin_strncmp (str5, latin2_1, sizeof (latin2_1) - 1) != 0 + || __builtin_strcmp (str5 + sizeof (latin2_1) - 1, latin2_2) != 0 + || __builtin_strncmp (str6, utf8_1, sizeof (utf8_1) - 1) != 0 + || __builtin_strcmp (str6 + sizeof (utf8_1) - 1, utf8_2) != 0 + || __builtin_strncmp (str7, utf8_1, sizeof (utf8_1) - 1) != 0 + || __builtin_strcmp (str7 + sizeof (utf8_1) - 1, utf8_2) != 0 + || __builtin_strncmp (str8, utf8_1, sizeof (utf8_1) - 1) != 0 + || __builtin_strcmp (str8 + sizeof (utf8_1) - 1, utf8_2) != 0) + __builtin_abort (); + if (sizeof ("a" u8"b"[0]) != 1 + || sizeof (u8"a" "b"[0]) != 1 + || sizeof (u8"a" u8"b"[0]) != 1 + || sizeof ("a" "\u010d") != 3 + || sizeof ("a" u8"\u010d") != 4 + || sizeof (u8"a" "\u010d") != 4 + || sizeof (u8"a" "\u010d") != 4) + __builtin_abort (); + return 0; +} diff --git a/gcc/testsuite/g++.dg/ext/utf8-2.C b/gcc/testsuite/g++.dg/ext/utf8-2.C new file mode 100644 index 00000000000..417a8bfdc1e --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/utf8-2.C @@ -0,0 +1,21 @@ +// { dg-do compile } +// { dg-options "-std=c++0x" } + +const char s0[] = u8"ab"; +const char16_t s1[] = u8"ab"; // { dg-error "from non-wide" } +const char32_t s2[] = u8"ab"; // { dg-error "from non-wide" } +const wchar_t s3[] = u8"ab"; // { dg-error "from non-wide" } + +const char t0[0] = u8"ab"; // { dg-error "chars is too long" } +const char t1[1] = u8"ab"; // { dg-error "chars is too long" } +const char t2[2] = u8"ab"; // { dg-error "chars is too long" } +const char t3[3] = u8"ab"; +const char t4[4] = u8"ab"; + +const char u0[0] = u8"\u2160."; // { dg-error "chars is too long" } +const char u1[1] = u8"\u2160."; // { dg-error "chars is too long" } +const char u2[2] = u8"\u2160."; // { dg-error "chars is too long" } +const char u3[3] = u8"\u2160."; // { dg-error "chars is too long" } +const char u4[4] = u8"\u2160."; // { dg-error "chars is too long" } +const char u5[5] = u8"\u2160."; +const char u6[6] = u8"\u2160."; diff --git a/gcc/testsuite/g++.dg/ipa/iinline-1.C b/gcc/testsuite/g++.dg/ipa/iinline-1.C index 1453c7e4658..6419ac3e8cd 100644 --- a/gcc/testsuite/g++.dg/ipa/iinline-1.C +++ b/gcc/testsuite/g++.dg/ipa/iinline-1.C @@ -2,7 +2,7 @@ inlining.. */ /* { dg-do compile } */ /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining" } */ -/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fpie" { target { ! nonpic } } } */ +/* { dg-add-options bind_pic_locally } */ extern void non_existent (const char *, int); diff --git a/gcc/testsuite/g++.dg/lto/20091022-1_0.C b/gcc/testsuite/g++.dg/lto/20091022-1_0.C new file mode 100644 index 00000000000..cb3f20a4ed2 --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/20091022-1_0.C @@ -0,0 +1,13 @@ +// { dg-lto-do link } +// { dg-extra-ld-options "-fwhole-program" } + +template <int dim> +struct AutoDerivativeFunction { + virtual void gradient_list (void); +}; +template <int dim> +void AutoDerivativeFunction<dim>::gradient_list (void) +{ +} +template class AutoDerivativeFunction<1>; +int main() {} diff --git a/gcc/testsuite/g++.dg/lto/20091022-2_0.C b/gcc/testsuite/g++.dg/lto/20091022-2_0.C new file mode 100644 index 00000000000..29ed9b6b0a0 --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/20091022-2_0.C @@ -0,0 +1,12 @@ +// { dg-lto-do link } +// { dg-lto-options {{-O3 -flto -Winline}} } + +#include <string> + +int +main() +{ + std::string i; + i = "abc"; +} + diff --git a/gcc/testsuite/g++.dg/opt/eh5.C b/gcc/testsuite/g++.dg/opt/eh5.C new file mode 100644 index 00000000000..3557ab2aa54 --- /dev/null +++ b/gcc/testsuite/g++.dg/opt/eh5.C @@ -0,0 +1,43 @@ +// PR 41377 +// { dg-do compile } +// { dg-options "-O3" } + +struct A +{ + bool foo(int*) const; +} a; + +struct B {}; + +struct B1 : B +{ + bool (A::*pmf)(int*) const; + const A* pa; + + B1() : pmf(&A::foo), pa(&a) {} + bool operator()() const { return (pa->*pmf)(new int); } +}; + +struct B2 : B +{ + B1 b1; + + B2(const B1& _b1) : b1(_b1) {} + bool operator()() const { return b1(); } +}; + +template<int> struct C +{ + void bar(B2 b2) { while (b2()) ; } + C() { bar(B2(B1())); } +}; + +void baz(int i) +{ + switch(i) + { + case 0: new C<0>; + case 1: new C<1>; + case 2: new C<2>; + } +} diff --git a/gcc/testsuite/g++.dg/opt/vt1.C b/gcc/testsuite/g++.dg/opt/vt1.C index ea74f52126f..ba871fba2d8 100644 --- a/gcc/testsuite/g++.dg/opt/vt1.C +++ b/gcc/testsuite/g++.dg/opt/vt1.C @@ -2,6 +2,7 @@ // { dg-do compile { target fpic } } // { dg-options "-O2 -fpic -fno-rtti" } // { dg-skip-if "requires unsupported run-time relocation" { spu-*-* } { "*" } { "" } } +// { dg-skip-if "No Windows PIC" { *-*-mingw* *-*-cygwin } { "*" } { "" } } // Origin: Jakub Jelinek <jakub@redhat.com> struct S diff --git a/gcc/testsuite/g++.dg/other/first-global.C b/gcc/testsuite/g++.dg/other/first-global.C index a993a9d5175..0f39a8abb73 100644 --- a/gcc/testsuite/g++.dg/other/first-global.C +++ b/gcc/testsuite/g++.dg/other/first-global.C @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fpie" { target { ! nonpic } } } */ +/* { dg-add-options bind_pic_locally } */ /* { dg-final { scan-assembler "_GLOBAL__I(_|_65535_0_)foobar" } } */ struct foo { foo (); }; diff --git a/gcc/testsuite/g++.dg/parse/attr-externally-visible-1.C b/gcc/testsuite/g++.dg/parse/attr-externally-visible-1.C index dbdab88af2d..845d873aacb 100644 --- a/gcc/testsuite/g++.dg/parse/attr-externally-visible-1.C +++ b/gcc/testsuite/g++.dg/parse/attr-externally-visible-1.C @@ -1,6 +1,6 @@ // { dg-do compile } // { dg-options "-O3 -fwhole-program" } -// { dg-options "-O3 -fwhole-program -fpie" { target { ! nonpic } } } +// { dg-add-options bind_pic_locally } // { dg-final { scan-assembler "foo1" } } // { dg-final { scan-assembler "foo2" } } // { dg-final { scan-assembler "foo3" } } diff --git a/gcc/testsuite/g++.dg/plugin/attribute_plugin-test-1.C b/gcc/testsuite/g++.dg/plugin/attribute_plugin-test-1.C index abb1328670a..1ca321d1fde 100644 --- a/gcc/testsuite/g++.dg/plugin/attribute_plugin-test-1.C +++ b/gcc/testsuite/g++.dg/plugin/attribute_plugin-test-1.C @@ -1,4 +1,4 @@ -// { dg-warning "Callback to register attributes" } +// { dg-warning "Callback to register attributes" "" { target *-*-* } 0 } void normal_func (char c, char c2); void normal_func (char __attribute__((user("param"))) c, char); diff --git a/gcc/testsuite/g++.dg/template/spec35.C b/gcc/testsuite/g++.dg/template/spec35.C index cae33ed3d1f..709ece5dd90 100644 --- a/gcc/testsuite/g++.dg/template/spec35.C +++ b/gcc/testsuite/g++.dg/template/spec35.C @@ -24,6 +24,6 @@ void instantiator () // { dg-final { scan-assembler-not ".glob(a|)l\[\t \]*_?_Z2f1IiEvT_" } } f1(0); // Expected to have static linkage - // { dg-final { scan-assembler ".weak(_definition)?\[\t \]*_?_Z2f2IiEvT_" } } + // { dg-final { scan-assembler ".weak(_definition)?\[\t \]*_?_Z2f2IiEvT_" { target { ! { *-*-mingw* *-*-cygwin } } } } } f2(0); // Expected to have weak global linkage } diff --git a/gcc/testsuite/g++.dg/torture/pr40323.C b/gcc/testsuite/g++.dg/torture/pr40323.C index adecf7fe5f3..c7ffcb5d3f1 100644 --- a/gcc/testsuite/g++.dg/torture/pr40323.C +++ b/gcc/testsuite/g++.dg/torture/pr40323.C @@ -1,7 +1,7 @@ /* Testcase for PR 40323. */ /* { dg-do compile } */ /* { dg-options "-fno-early-inlining" } */ -/* { dg-options "-fno-early-inlining -fpie" { target { ! nonpic } } } */ +/* { dg-add-options bind_pic_locally } */ extern void do_something (const char *, int); diff --git a/gcc/testsuite/g++.dg/tree-ssa/copyprop.C b/gcc/testsuite/g++.dg/tree-ssa/copyprop.C index e785755eb07..5ba193618dd 100644 --- a/gcc/testsuite/g++.dg/tree-ssa/copyprop.C +++ b/gcc/testsuite/g++.dg/tree-ssa/copyprop.C @@ -7,8 +7,8 @@ #include <map> #include <vector> #include <iostream> +#include <cstdlib> using namespace std; -extern void free (void *); template<typename _FIter, typename _Tp> _FIter lower_bound(_FIter, _FIter, _Tp&); template<class _Key> struct hash { }; template<class _Val> struct _Hashtable_node { diff --git a/gcc/testsuite/g++.dg/tree-ssa/nothrow-1.C b/gcc/testsuite/g++.dg/tree-ssa/nothrow-1.C index 4bb71589de3..33462946aed 100644 --- a/gcc/testsuite/g++.dg/tree-ssa/nothrow-1.C +++ b/gcc/testsuite/g++.dg/tree-ssa/nothrow-1.C @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-O1 -fdump-tree-cfg" } */ -/* { dg-skip-if "" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */ +/* { dg-add-options bind_pic_locally } */ + double a; void t() { diff --git a/gcc/testsuite/gcc.c-torture/compile/pr40556.c b/gcc/testsuite/gcc.c-torture/compile/pr40556.c new file mode 100644 index 00000000000..625175d7788 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr40556.c @@ -0,0 +1,11 @@ +struct A {}; + +struct A foo() +{ + return foo(); +} + +void bar() +{ + foo(); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/pr41661.c b/gcc/testsuite/gcc.c-torture/compile/pr41661.c new file mode 100644 index 00000000000..658e4288b8d --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr41661.c @@ -0,0 +1,20 @@ +/* PR tree-optimization/41661 */ +/* { dg-do compile } */ +/* { dg-options "-fno-early-inlining" } */ + +int g; + +void foo (int x) +{ + g = x; +} + +void bar (double d) +{ + foo (d == 1); +} + +void baz (int a) +{ + bar (1); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/pr41728.c b/gcc/testsuite/gcc.c-torture/compile/pr41728.c new file mode 100644 index 00000000000..df379d93010 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr41728.c @@ -0,0 +1,12 @@ +int a[8]; +int s244(void) +{ + int lrc, j; + lrc = 0; + for (j=0; j<7; j++) + if(a[j] != a[j+1]) + lrc = 1; + if (lrc != 0) + return 0; + return 1; +} diff --git a/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-vla-1.c b/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-vla-1.c new file mode 100644 index 00000000000..e9f63d36872 --- /dev/null +++ b/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-vla-1.c @@ -0,0 +1,10 @@ +/* PR 41673: bogus -Wstrict-aliasing warning from VLA dereference. */ +/* { dg-do compile } */ +/* { dg-options "-std=gnu99 -O2 -Wall" } */ + +int main(int argc, char *argv[]) +{ + float x[argc]; + float y[argc]; + return 0 == __builtin_memcpy(y, x, argc * sizeof(*x)); +} diff --git a/gcc/testsuite/gcc.dg/autopar/outer-1.c b/gcc/testsuite/gcc.dg/autopar/outer-1.c new file mode 100644 index 00000000000..913d390f684 --- /dev/null +++ b/gcc/testsuite/gcc.dg/autopar/outer-1.c @@ -0,0 +1,33 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ + +void abort (void); + +void parloop (int N) +{ + int i, j; + int x[10000][10000]; + + for (i = 0; i < N; i++) + for (j = 0; j < N; j++) + x[i][j] = i + j + 3; + + for (i = 0; i < N; i++) + for (j = 0; j < N; j++) + if (x[i][j] != i + j + 3) + abort (); +} + +int main(void) +{ + parloop(10000); + + return 0; +} + + +/* Check that outer loop is parallelized. */ +/* { dg-final { scan-tree-dump-times "parallelizing outer loop" 1 "parloops" } } */ +/* { dg-final { scan-tree-dump-times "loopfn" 5 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "parloops" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/autopar/outer-2.c b/gcc/testsuite/gcc.dg/autopar/outer-2.c new file mode 100644 index 00000000000..351b3499e89 --- /dev/null +++ b/gcc/testsuite/gcc.dg/autopar/outer-2.c @@ -0,0 +1,33 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ + +void abort (void); + +void parloop (int N) +{ + int i, j,ii; + int x[400][10][400]; + +for (ii = 0; ii < N; ii++) + for (i = 0; i < N; i++) + for (j = 0; j < N; j++) + x[i][j][ii] = ii+i + j + 3; + +for (ii = 0; ii < N; ii++) + for (i = 0; i < N;i++) + for (j = 0; j < N; j++) + if (x[i][j][ii] != ii+i + j + 3) + abort (); +} + +int main(void) +{ + parloop(400); + + return 0; +} + +/* { dg-final { scan-tree-dump-times "parallelizing outer loop" 1 "parloops" } } */ +/* { dg-final { scan-tree-dump-times "loopfn" 5 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "parloops" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/autopar/outer-3.c b/gcc/testsuite/gcc.dg/autopar/outer-3.c new file mode 100644 index 00000000000..2f1033f9830 --- /dev/null +++ b/gcc/testsuite/gcc.dg/autopar/outer-3.c @@ -0,0 +1,33 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ + +void abort (void); + +void parloop (int N) +{ + int i, j; + int x[500][500]; + + for (i = 0; i < N; i++) + for (j = 0; j < i; j++) + x[i][j] = i + j + 3; + + for (i = 0; i < N; i++) + for (j = 0; j < i; j++) + if (x[i][j] != i + j + 3) + abort (); +} + +int main(void) +{ + parloop(500); + + return 0; +} + + +/* Check that outer loop is parallelized. */ +/* { dg-final { scan-tree-dump-times "parallelizing outer loop" 1 "parloops" } } */ +/* { dg-final { scan-tree-dump-times "loopfn" 5 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "parloops" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/autopar/outer-4.c b/gcc/testsuite/gcc.dg/autopar/outer-4.c new file mode 100644 index 00000000000..56f6123385d --- /dev/null +++ b/gcc/testsuite/gcc.dg/autopar/outer-4.c @@ -0,0 +1,37 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ + +void abort (void); + +int g_sum=0; +int x[500][500]; + +__attribute__((noinline)) +void parloop (int N) +{ + int i, j; + int sum; + + /* Double reduction is currently not supported, outer loop is not + parallelized. Inner reduction is detected, inner loop is + parallelized. */ + sum = 0; + for (i = 0; i < N; i++) + for (j = 0; j < N; j++) + sum += x[i][j]; + + g_sum = sum; +} + +int main(void) +{ + parloop(500); + + return 0; +} + + +/* { dg-final { scan-tree-dump-times "parallelizing outer loop" 1 "parloops" { xfail *-*-* } } } */ +/* { dg-final { scan-tree-dump-times "loopfn" 5 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "parloops" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/autopar/outer-5.c b/gcc/testsuite/gcc.dg/autopar/outer-5.c new file mode 100644 index 00000000000..3a542988c26 --- /dev/null +++ b/gcc/testsuite/gcc.dg/autopar/outer-5.c @@ -0,0 +1,50 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ + +void abort (void); + +int x[500][500]; +int y[500]; +int g_sum=0; + +__attribute__((noinline)) +void init (int i, int j) +{ + x[i][j]=1; +} + +__attribute__((noinline)) +void parloop (int N) +{ + int i, j; + int sum; + + /* Inner cycle is currently not supported, outer loop is not + parallelized. Inner reduction is detected, inner loop is + parallelized. */ + for (i = 0; i < N; i++) + { + sum = 0; + for (j = 0; j < N; j++) + sum += x[i][j]; + y[i]=sum; + } + g_sum = sum; +} + +int main(void) +{ + int i,j; + for (i = 0; i < 500; i++) + for (j = 0; j < 500; j++) + init(i, j); + + parloop(500); + + return 0; +} + +/* { dg-final { scan-tree-dump-times "parallelizing outer loop" 1 "parloops" { xfail *-*-* } } } */ +/* { dg-final { scan-tree-dump-times "loopfn" 5 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "parloops" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/autopar/outer-6.c b/gcc/testsuite/gcc.dg/autopar/outer-6.c new file mode 100644 index 00000000000..6e027d2f69a --- /dev/null +++ b/gcc/testsuite/gcc.dg/autopar/outer-6.c @@ -0,0 +1,51 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ + +void abort (void); + +int x[500][500]; +int y[500]; +int g_sum=0; + +__attribute__((noinline)) +void init (int i, int j) +{ + x[i][j]=1; +} + +__attribute__((noinline)) +void parloop (int N) +{ + int i, j; + int sum; + + /* Outer loop reduction, outerloop is parallelized. */ + sum=0; + for (i = 0; i < N; i++) + { + for (j = 0; j < N; j++) + y[i]=x[i][j]; + sum += y[i]; + } + g_sum = sum; +} + +int main(void) +{ + int i,j; + for (i = 0; i < 500; i++) + for (j = 0; j < 500; j++) + init(i, j); + + parloop(500); + + return 0; +} + + +/* Check that outer loop is parallelized. */ +/* { dg-final { scan-tree-dump-times "parallelizing outer loop" 1 "parloops" } } */ +/* { dg-final { scan-tree-dump-times "parallelizing inner loop" 0 "parloops" } } */ +/* { dg-final { scan-tree-dump-times "loopfn" 5 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "parloops" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/cleanup-13.c b/gcc/testsuite/gcc.dg/cleanup-13.c new file mode 100644 index 00000000000..0a5a9e9153e --- /dev/null +++ b/gcc/testsuite/gcc.dg/cleanup-13.c @@ -0,0 +1,319 @@ +/* HP-UX libunwind.so doesn't provide _UA_END_OF_STACK */ +/* { dg-do run } */ +/* { dg-options "-fexceptions" } */ +/* { dg-skip-if "" { "ia64-*-hpux11.*" } { "*" } { "" } } */ +/* Verify DW_OP_* handling in the unwinder. */ + +#include <unwind.h> +#include <stdlib.h> +#include <string.h> + +/* #define OP_addr(x) 0x06, ... */ +#define OP_deref 0x06, +#define SLEB128(x) (x)&0x7f /* Assume here the value is -0x40 ... 0x3f. */ +#define ULEB128(x) (x)&0x7f /* Assume here the value is 0 ... 0x7f. */ +#define VAL1(x) (x)&0xff +#if defined (__BIG_ENDIAN__) +#define VAL2(x) ((x)>>8)&0xff,(x)&0xff +#define VAL4(x) ((x)>>24)&0xff,((x)>>16)&0xff,((x)>>8)&0xff,(x)&0xff +#define VAL8(x) ((x)>>56)&0xff,((x)>>48)&0xff,((x)>>40)&0xff,((x)>>32)&0xff,((x)>>24)&0xff,((x)>>16)&0xff,((x)>>8)&0xff,(x)&0xff +#elif defined(__LITTLE_ENDIAN__) || defined(__x86_64__) || defined(__i386__) +#define VAL2(x) (x)&0xff,((x)>>8)&0xff +#define VAL4(x) (x)&0xff,((x)>>8)&0xff,((x)>>16)&0xff,((x)>>24)&0xff +#define VAL8(x) (x)&0xff,((x)>>8)&0xff,((x)>>16)&0xff,((x)>>24)&0xff,((x)>>32)&0xff,((x)>>40)&0xff,((x)>>48)&0xff,((x)>>56)&0xff +#endif +#define OP_const1u(x) 0x08,VAL1(x), +#define OP_const1s(x) 0x09,VAL1(x), +#define OP_const2u(x) 0x0a,VAL2(x), +#define OP_const2s(x) 0x0b,VAL2(x), +#define OP_const4u(x) 0x0c,VAL4(x), +#define OP_const4s(x) 0x0d,VAL4(x), +#define OP_const8u(x) 0x0e,VAL8(x), +#define OP_const8s(x) 0x0f,VAL8(x), +#define OP_constu(x) 0x10,ULEB128(x), +#define OP_consts(x) 0x11,SLEB128(x), +#define OP_dup 0x12, +#define OP_drop 0x13, +#define OP_over 0x14, +#define OP_pick(x) 0x15,VAL1(x), +#define OP_swap 0x16, +#define OP_rot 0x17, +#define OP_xderef 0x18, +#define OP_abs 0x19, +#define OP_and 0x1a, +#define OP_div 0x1b, +#define OP_minus 0x1c, +#define OP_mod 0x1d, +#define OP_mul 0x1e, +#define OP_neg 0x1f, +#define OP_not 0x20, +#define OP_or 0x21, +#define OP_plus 0x22, +#define OP_plus_uconst(x) 0x23,ULEB128(x), +#define OP_shl 0x24, +#define OP_shr 0x25, +#define OP_shra 0x26, +#define OP_xor 0x27, +#define OP_bra(x) 0x28,VAL2(x), +#define OP_eq 0x29, +#define OP_ge 0x2a, +#define OP_gt 0x2b, +#define OP_le 0x2c, +#define OP_lt 0x2d, +#define OP_ne 0x2e, +#define OP_skip(x) 0x2f,VAL2(x), +#define OP_lit0 0x30, +#define OP_lit1 0x31, +#define OP_lit2 0x32, +#define OP_lit3 0x33, +#define OP_lit4 0x34, +#define OP_lit5 0x35, +#define OP_lit6 0x36, +#define OP_lit7 0x37, +#define OP_lit8 0x38, +#define OP_lit9 0x39, +#define OP_lit10 0x3a, +#define OP_lit11 0x3b, +#define OP_lit12 0x3c, +#define OP_lit13 0x3d, +#define OP_lit14 0x3e, +#define OP_lit15 0x3f, +#define OP_lit16 0x40, +#define OP_lit17 0x41, +#define OP_lit18 0x42, +#define OP_lit19 0x43, +#define OP_lit20 0x44, +#define OP_lit21 0x45, +#define OP_lit22 0x46, +#define OP_lit23 0x47, +#define OP_lit24 0x48, +#define OP_lit25 0x49, +#define OP_lit26 0x4a, +#define OP_lit27 0x4b, +#define OP_lit28 0x4c, +#define OP_lit29 0x4d, +#define OP_lit30 0x4e, +#define OP_lit31 0x4f, +#define OP_reg0 0x50, +#define OP_reg1 0x51, +#define OP_reg2 0x52, +#define OP_reg3 0x53, +#define OP_reg4 0x54, +#define OP_reg5 0x55, +#define OP_reg6 0x56, +#define OP_reg7 0x57, +#define OP_reg8 0x58, +#define OP_reg9 0x59, +#define OP_reg10 0x5a, +#define OP_reg11 0x5b, +#define OP_reg12 0x5c, +#define OP_reg13 0x5d, +#define OP_reg14 0x5e, +#define OP_reg15 0x5f, +#define OP_reg16 0x60, +#define OP_reg17 0x61, +#define OP_reg18 0x62, +#define OP_reg19 0x63, +#define OP_reg20 0x64, +#define OP_reg21 0x65, +#define OP_reg22 0x66, +#define OP_reg23 0x67, +#define OP_reg24 0x68, +#define OP_reg25 0x69, +#define OP_reg26 0x6a, +#define OP_reg27 0x6b, +#define OP_reg28 0x6c, +#define OP_reg29 0x6d, +#define OP_reg30 0x6e, +#define OP_reg31 0x6f, +#define OP_breg0(x) 0x70,SLEB128(x), +#define OP_breg1(x) 0x71,SLEB128(x), +#define OP_breg2(x) 0x72,SLEB128(x), +#define OP_breg3(x) 0x73,SLEB128(x), +#define OP_breg4(x) 0x74,SLEB128(x), +#define OP_breg5(x) 0x75,SLEB128(x), +#define OP_breg6(x) 0x76,SLEB128(x), +#define OP_breg7(x) 0x77,SLEB128(x), +#define OP_breg8(x) 0x78,SLEB128(x), +#define OP_breg9(x) 0x79,SLEB128(x), +#define OP_breg10(x) 0x7a,SLEB128(x), +#define OP_breg11(x) 0x7b,SLEB128(x), +#define OP_breg12(x) 0x7c,SLEB128(x), +#define OP_breg13(x) 0x7d,SLEB128(x), +#define OP_breg14(x) 0x7e,SLEB128(x), +#define OP_breg15(x) 0x7f,SLEB128(x), +#define OP_breg16(x) 0x80,SLEB128(x), +#define OP_breg17(x) 0x81,SLEB128(x), +#define OP_breg18(x) 0x82,SLEB128(x), +#define OP_breg19(x) 0x83,SLEB128(x), +#define OP_breg20(x) 0x84,SLEB128(x), +#define OP_breg21(x) 0x85,SLEB128(x), +#define OP_breg22(x) 0x86,SLEB128(x), +#define OP_breg23(x) 0x87,SLEB128(x), +#define OP_breg24(x) 0x88,SLEB128(x), +#define OP_breg25(x) 0x89,SLEB128(x), +#define OP_breg26(x) 0x8a,SLEB128(x), +#define OP_breg27(x) 0x8b,SLEB128(x), +#define OP_breg28(x) 0x8c,SLEB128(x), +#define OP_breg29(x) 0x8d,SLEB128(x), +#define OP_breg30(x) 0x8e,SLEB128(x), +#define OP_breg31(x) 0x8f,SLEB128(x), +#define OP_regx(x) 0x90,SLEB128(x), +#define OP_fbreg(x) 0x91,SLEB128(x), +#define OP_bregx(x,y) 0x92,ULEB128(x),SLEB128(y), +#define OP_piece(x) 0x93,ULEB128(x), +#define OP_deref_size(x) 0x94,VAL1(x), +#define OP_xderef_size(x) 0x95,VAL1(x), +#define OP_nop 0x96, +#define OP_nop_termination 0x96 +#define OP_push_object_address 0x97, +#define OP_call2(x) 0x98,VAL2(x), +#define OP_call4(x) 0x99,VAL4(x), +/* #define OP_call_ref(x) 0x9a,... */ +#define OP_form_tls_address(x) 0x9b, +#define OP_call_frame_cfa 0x9c, +#define OP_bit_piece(x) 0x9d,ULEB128(x), +/* #define OP_implicit_value(x...) 0x9e,... */ +#define OP_stack_value 0x9f, +#define OP_GNU_push_tls_address 0xe0, +/* #define OP_GNU_encoded_addr(x...) 0xf1, */ + +#define ASSERT_TOS_NON0 OP_bra(3) OP_skip(-3) +#define ASSERT_TOS_0 OP_lit0 OP_eq ASSERT_TOS_NON0 + +/* Initially there is CFA value on the stack, we want to + keep it there at the end. */ +#define CFI_PROGRAM \ +OP_lit0 OP_nop ASSERT_TOS_0 \ +OP_lit1 ASSERT_TOS_NON0 \ +OP_lit1 OP_const1u(1) OP_eq ASSERT_TOS_NON0 \ +OP_lit16 OP_const2u(16) OP_eq ASSERT_TOS_NON0 \ +OP_lit31 OP_const4u(31) OP_ne ASSERT_TOS_0 \ +OP_lit1 OP_neg OP_const1s(-1) OP_eq ASSERT_TOS_NON0 \ +OP_lit16 OP_neg OP_const2s(-16) OP_ne ASSERT_TOS_0 \ +OP_lit31 OP_const4s(-31) OP_neg OP_ne ASSERT_TOS_0 \ +OP_lit7 OP_dup OP_plus_uconst(2) OP_lit9 OP_eq ASSERT_TOS_NON0 \ + OP_lit7 OP_eq ASSERT_TOS_NON0 \ +OP_lit20 OP_lit1 OP_drop OP_lit20 OP_eq ASSERT_TOS_NON0 \ +OP_lit17 OP_lit19 OP_over OP_lit17 OP_eq ASSERT_TOS_NON0 \ + OP_lit19 OP_eq ASSERT_TOS_NON0 OP_lit17 OP_eq ASSERT_TOS_NON0 \ +OP_lit1 OP_lit2 OP_lit3 OP_lit4 OP_pick(2) OP_lit2 OP_eq ASSERT_TOS_NON0\ + OP_lit4 OP_eq ASSERT_TOS_NON0 OP_lit3 OP_eq ASSERT_TOS_NON0 \ + OP_pick(0) OP_lit2 OP_eq ASSERT_TOS_NON0 \ + OP_lit2 OP_eq ASSERT_TOS_NON0 OP_lit1 OP_eq ASSERT_TOS_NON0 \ +OP_lit6 OP_lit12 OP_swap OP_lit6 OP_eq ASSERT_TOS_NON0 \ + OP_lit12 OP_eq ASSERT_TOS_NON0 \ +OP_lit7 OP_lit8 OP_lit9 OP_rot OP_lit8 OP_eq ASSERT_TOS_NON0 \ + OP_lit7 OP_eq ASSERT_TOS_NON0 OP_lit9 OP_eq ASSERT_TOS_NON0 \ +OP_lit7 OP_abs OP_lit7 OP_eq ASSERT_TOS_NON0 \ +OP_const1s(-123) OP_abs OP_const1u(123) OP_eq ASSERT_TOS_NON0 \ +OP_lit3 OP_lit6 OP_and OP_lit2 OP_eq ASSERT_TOS_NON0 \ +OP_lit3 OP_lit6 OP_or OP_lit7 OP_eq ASSERT_TOS_NON0 \ +OP_lit17 OP_lit2 OP_minus OP_lit15 OP_eq ASSERT_TOS_NON0 \ +OP_const1s(-6) OP_const1s(-2) OP_div OP_lit3 OP_eq ASSERT_TOS_NON0 \ +OP_const1s(-6) OP_const1s(-4) OP_mod OP_const1s(-2) \ + OP_eq ASSERT_TOS_NON0 \ +OP_lit16 OP_lit31 OP_plus_uconst(1) OP_mul OP_const2u(512) \ + OP_eq ASSERT_TOS_NON0 \ +OP_lit5 OP_not OP_lit31 OP_and OP_lit26 OP_eq ASSERT_TOS_NON0 \ +OP_lit12 OP_lit31 OP_plus OP_const1u(43) OP_eq ASSERT_TOS_NON0 \ +OP_const1s(-6) OP_lit2 OP_plus OP_const1s(-4) OP_eq ASSERT_TOS_NON0 \ +OP_const1s(-6) OP_plus_uconst(3) OP_const1s(-3) OP_eq ASSERT_TOS_NON0 \ +OP_lit16 OP_lit4 OP_shl OP_const2u(256) OP_eq ASSERT_TOS_NON0 \ +OP_lit16 OP_lit3 OP_shr OP_lit2 OP_eq ASSERT_TOS_NON0 \ +OP_const1s(-16) OP_lit3 OP_shra OP_const1s(-2) OP_eq ASSERT_TOS_NON0 \ +OP_lit3 OP_lit6 OP_xor OP_lit5 OP_eq ASSERT_TOS_NON0 \ +OP_lit3 OP_lit6 OP_le ASSERT_TOS_NON0 \ +OP_lit3 OP_lit3 OP_le ASSERT_TOS_NON0 \ +OP_lit6 OP_lit3 OP_le ASSERT_TOS_0 \ +OP_lit3 OP_lit6 OP_lt ASSERT_TOS_NON0 \ +OP_lit3 OP_lit3 OP_lt ASSERT_TOS_0 \ +OP_lit6 OP_lit3 OP_lt ASSERT_TOS_0 \ +OP_lit3 OP_lit6 OP_ge ASSERT_TOS_0 \ +OP_lit3 OP_lit3 OP_ge ASSERT_TOS_NON0 \ +OP_lit6 OP_lit3 OP_ge ASSERT_TOS_NON0 \ +OP_lit3 OP_lit6 OP_gt ASSERT_TOS_0 \ +OP_lit3 OP_lit3 OP_gt ASSERT_TOS_0 \ +OP_lit6 OP_lit3 OP_gt ASSERT_TOS_NON0 \ +OP_const1s(-6) OP_lit1 OP_shr OP_lit0 OP_gt ASSERT_TOS_NON0 \ +OP_const1s(-6) OP_lit1 OP_shra OP_lit0 OP_lt ASSERT_TOS_NON0 + +#define CFI_ESCAPE_VAL_2(VALUES...) #VALUES +#define CFI_ESCAPE_VAL_1(VALUES...) CFI_ESCAPE_VAL_2(VALUES) +#define CFI_ESCAPE_VAL(VALUES...) CFI_ESCAPE_VAL_1(VALUES) +#define CFI_ESCAPE do { } while (0) +#define CFI_ARCH_PROGRAM OP_nop_termination +#ifdef __GCC_HAVE_DWARF2_CFI_ASM +#if defined (__x86_64__) +#undef CFI_ESCAPE +#undef CFI_ARCH_PROGRAM +#define CFI_ARCH_PROGRAM CFI_PROGRAM OP_lit8 OP_minus OP_nop_termination +unsigned char cfi_arch_program[] = { CFI_ARCH_PROGRAM }; +extern char verify_it[sizeof (cfi_arch_program) - 0x80 < 0x3f80 ? 1 : -1]; +/* DW_CFA_expression %rip, uleb128(l2-l1), l1: program DW_OP_lit8 DW_OP_minus DW_OP_nop l2: */ +#define CFI_ESCAPE \ + asm volatile (".cfi_escape 0x10, 0x10, (%P0&0x7f)+0x80, %P0>>7, " \ + CFI_ESCAPE_VAL (CFI_ARCH_PROGRAM) \ + : : "i" (sizeof (cfi_arch_program))) +#elif defined (__i386__) +#undef CFI_ESCAPE +#undef CFI_ARCH_PROGRAM +#define CFI_ARCH_PROGRAM CFI_PROGRAM OP_lit4 OP_minus OP_nop_termination +unsigned char cfi_arch_program[] = { CFI_ARCH_PROGRAM }; +extern char verify_it[sizeof (cfi_arch_program) - 0x80 < 0x3f80 ? 1 : -1]; +/* DW_CFA_expression %eip, uleb128(l2-l1), l1: program DW_OP_lit4 DW_OP_minus DW_OP_nop l2: */ +#define CFI_ESCAPE \ + asm volatile (".cfi_escape 0x10, 8, (%P0&0x7f)+0x80, %P0>>7, " \ + CFI_ESCAPE_VAL (CFI_ARCH_PROGRAM) \ + : : "i" (sizeof (cfi_arch_program))) +#endif +#endif +static _Unwind_Reason_Code +force_unwind_stop (int version, _Unwind_Action actions, + _Unwind_Exception_Class exc_class, + struct _Unwind_Exception *exc_obj, + struct _Unwind_Context *context, + void *stop_parameter) +{ + if (actions & _UA_END_OF_STACK) + abort (); + return _URC_NO_REASON; +} + +static void force_unwind () +{ + struct _Unwind_Exception *exc = malloc (sizeof (*exc)); + memset (&exc->exception_class, 0, sizeof (exc->exception_class)); + exc->exception_cleanup = 0; + +#ifndef __USING_SJLJ_EXCEPTIONS__ + _Unwind_ForcedUnwind (exc, force_unwind_stop, 0); +#else + _Unwind_SjLj_ForcedUnwind (exc, force_unwind_stop, 0); +#endif + + abort (); +} + +static void handler (void *p __attribute__((unused))) +{ + exit (0); +} + +__attribute__((noinline)) static void callme () +{ + CFI_ESCAPE; + force_unwind (); +} + +__attribute__((noinline)) static void doit () +{ + char dummy __attribute__((cleanup (handler))); + callme (); +} + +int main() +{ + doit (); + abort (); +} diff --git a/gcc/testsuite/gcc.dg/cpp/include6.c b/gcc/testsuite/gcc.dg/cpp/include6.c new file mode 100644 index 00000000000..2bb1320daa2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/include6.c @@ -0,0 +1,14 @@ +/* { dg-do preprocess } */ +/* { dg-options "-std=gnu99" } */ + +#include <stddef.h> +#include "stddef.h" +#include L"stddef.h" /* { dg-error "include expects" } */ +#include u"stddef.h" /* { dg-error "include expects" } */ +#include U"stddef.h" /* { dg-error "include expects" } */ +#include u8"stddef.h" /* { dg-error "include expects" } */ +#include R"[stddef.h]" /* { dg-error "include expects" } */ +#include LR"[stddef.h]" /* { dg-error "include expects" } */ +#include uR"[stddef.h]" /* { dg-error "include expects" } */ +#include UR"[stddef.h]" /* { dg-error "include expects" } */ +#include u8R"[stddef.h]" /* { dg-error "include expects" } */ diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr41543.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr41543.c new file mode 100644 index 00000000000..02683960bdb --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr41543.c @@ -0,0 +1,14 @@ +/* PR preprocessor/41543 */ +/* { dg-do compile } */ +/* { dg-options "-save-temps -g -O0 -dA -fno-merge-debug-strings" } */ + +#include <stdarg.h> + +int +foo (va_list ap) +{ + return va_arg (ap, int); +} + +/* { dg-final { scan-assembler-not "DW_AT_decl_file\[^\\r\\n\]*\(pr41543\.i\)" } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr41695.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr41695.c new file mode 100644 index 00000000000..d61b5a293f5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr41695.c @@ -0,0 +1,18 @@ +/* PR debug/41695 */ +/* { dg-do compile } */ +/* { dg-options "-g -O2 -dA -fno-merge-debug-strings" } */ + +int bar (int); + +void +foo (void) +{ + int b = 0; + b = bar (b); + b = bar (b); + b = bar (b); + b = bar (b); + bar (b); +} + +/* { dg-final { scan-assembler-not "LVL(\[0-9\]+)-\[^1\]\[^\\r\\n\]*Location list begin address\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*LVL\\1-1-" } } */ diff --git a/gcc/testsuite/gcc.dg/debug/pr41264-1.c b/gcc/testsuite/gcc.dg/debug/pr41264-1.c new file mode 100644 index 00000000000..b5555b554ba --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/pr41264-1.c @@ -0,0 +1,36 @@ +/* { dg-do compile } */ + +typedef unsigned int hashval_t; +static hashval_t __attribute__((always_inline)) +iterative_hash_host_wide_int (long val, hashval_t val2) +{ + hashval_t a = (hashval_t) val; + int zero = 0; + hashval_t b = (hashval_t) (val >> (sizeof (hashval_t) * 8 + zero)); + + a -= b; a -= val2; a ^= (val2>>13); + b -= val2; b -= a; b ^= (a<< 8); + val2 -= a; val2 -= b; val2 ^= ((b&0xffffffff)>>13); + a -= b; a -= val2; a ^= ((val2&0xffffffff)>>12); + b -= val2; b -= a; b = (b ^ (a<<16)) & 0xffffffff; + val2 -= a; val2 -= b; val2 = (val2 ^ (b>> 5)) & 0xffffffff; + a -= b; a -= val2; a = (a ^ (val2>> 3)) & 0xffffffff; + b -= val2; b -= a; b = (b ^ (a<<10)) & 0xffffffff; + val2 -= a; val2 -= b; val2 = (val2 ^ (b>>15)) & 0xffffffff; + return val2; +} + +hashval_t +bla (int nunits, int mode) +{ + hashval_t hashcode = 0; + + + hashcode = iterative_hash_host_wide_int (14, hashcode); + hashcode = iterative_hash_host_wide_int (nunits, hashcode); + hashcode = iterative_hash_host_wide_int (mode, hashcode); + if (nunits) + return 0; + else + return hashcode; +} diff --git a/gcc/testsuite/gcc.dg/debug/pr41343-1.c b/gcc/testsuite/gcc.dg/debug/pr41343-1.c new file mode 100644 index 00000000000..6d56380383d --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/pr41343-1.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ + +#define X(new,old) int i ## new = i ## old + i ## old; +#define Y(pfx) X(pfx ## 1, pfx) \ + X(pfx ## 2, pfx ## 1) \ + X(pfx ## 3, pfx ## 2) \ + X(pfx ## 4, pfx ## 3) \ + X(pfx ## 5, pfx ## 4) \ + X(pfx ## 6, pfx ## 5) \ + X(pfx ## 7, pfx ## 6) \ + X(pfx ## 8, pfx ## 7) \ + X(pfx ## 9, pfx ## 8) + +void foo (int i1) +{ + Y(1) + Y(11) + Y(111) + asm ("" : : "X" (i1)); +} diff --git a/gcc/testsuite/gcc.dg/debug/pr41717.c b/gcc/testsuite/gcc.dg/debug/pr41717.c new file mode 100644 index 00000000000..21250883a11 --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/pr41717.c @@ -0,0 +1,10 @@ +/* PR debug/41717 */ +/* { dg-do compile } */ + +void +foo (void) +{ + _Complex float v[1], w; + v[1] = 0.0f + 0.8fi; + w = __builtin_conjf (v[1] * v[1]); +} diff --git a/gcc/testsuite/gcc.dg/debug/vta-1.c b/gcc/testsuite/gcc.dg/debug/vta-1.c new file mode 100644 index 00000000000..414083a09c0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/vta-1.c @@ -0,0 +1,34 @@ +/* https://bugzilla.redhat.com/show_bug.cgi?id=521991#c5 + + Distilled from Linux XFS source code. foo, inlined into bar, ends + up with debug stmts referencing the addressable variable b. + Optimization made it non-addressable, and then completely optimized + away, before we got a chance to rename (and discard) the occurrence + in the debug stmt. When we did, we crashed, attempting to rename + an unreference variable. */ + +/* { dg-do compile } */ + +static inline int +foo (void *x, unsigned y) +{ + unsigned z = *(unsigned long *) x % y; + *(unsigned long *) x = *(unsigned long *) x / y; + return z; +} + +struct S +{ + unsigned t; +}; + +void +bar (struct S *x, int *y) +{ + int a = 0; + unsigned long b = x->t; + foo (&b, x->t); + for (;; a++) + if (b) + *y = 1; +} diff --git a/gcc/testsuite/gcc.dg/debug/vta-2.c b/gcc/testsuite/gcc.dg/debug/vta-2.c new file mode 100644 index 00000000000..5d44262ec76 --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/vta-2.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ + +static int +bar (void *a, unsigned int b, int n) +{ + int c = *(unsigned long *) a % b; + *(unsigned long *) a = (int) (*(unsigned long *) a) / b; + return c; +} + +int +foo (unsigned long x, int *y, int z) +{ + int level; + for (level = 0; level < *y; level++) + { + bar (&x, z, sizeof (x)); + if (x) + return *y - 1; + } +} diff --git a/gcc/testsuite/gcc.dg/debug/vta-3.c b/gcc/testsuite/gcc.dg/debug/vta-3.c new file mode 100644 index 00000000000..7d014f1bc1e --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/vta-3.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ + +int +foo (void) +{ + union { char e[8]; int i; } a, b; + char *c, *d; + unsigned int i; + c = a.e; + d = &b.e[sizeof (int) - 1]; + for (i = 0; i < sizeof (int); i++) + { + *d = *c++; + --d; + } + return b.i; +} diff --git a/gcc/testsuite/gcc.dg/guality/pr41447-1.c b/gcc/testsuite/gcc.dg/guality/pr41447-1.c new file mode 100644 index 00000000000..9bb28abe37c --- /dev/null +++ b/gcc/testsuite/gcc.dg/guality/pr41447-1.c @@ -0,0 +1,26 @@ +/* { dg-do run { xfail *-*-* } } */ +/* { dg-options "-g" } */ + +#include "guality.h" + +int a; + +int +main (int argc, char *argv[]) +{ + int tmp = a; + int tmp2 = a; + int tmp3; + int res; + GUALCHKVAL (a); + GUALCHKVAL (tmp); + GUALCHKVAL (tmp2); + a = 0; + tmp3 = tmp2; + GUALCHKVAL (a); + GUALCHKVAL (tmp); + GUALCHKVAL (tmp2); + GUALCHKVAL (tmp3); + res = tmp - tmp2 + 1; + return res; +} diff --git a/gcc/testsuite/gcc.dg/guality/pr41616-1.c b/gcc/testsuite/gcc.dg/guality/pr41616-1.c index c38d76b7c9e..24f64ab083d 100644 --- a/gcc/testsuite/gcc.dg/guality/pr41616-1.c +++ b/gcc/testsuite/gcc.dg/guality/pr41616-1.c @@ -1,5 +1,5 @@ /* { dg-do run { xfail *-*-* } } */ -/* { dg-options "-g -O2" } */ +/* { dg-options "-g" } */ #include "guality.h" diff --git a/gcc/testsuite/gcc.dg/inline-33.c b/gcc/testsuite/gcc.dg/inline-33.c index ac577e3cb88..d82ff71545b 100644 --- a/gcc/testsuite/gcc.dg/inline-33.c +++ b/gcc/testsuite/gcc.dg/inline-33.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O3 -fdump-tree-optimized" } */ -/* { dg-options "-O3 -fdump-tree-optimized -fpie" { target { ! nonpic } } } */ +/* { dg-add-options bind_pic_locally } */ int i; diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-1.c b/gcc/testsuite/gcc.dg/ipa/ipa-1.c index 76ef9a643d6..65c0a0caae3 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-1.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-1.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */ -/* { dg-skip-if "PR 25442" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */ +/* { dg-add-options bind_pic_locally } */ #include <stdio.h> int g (int b, int c) diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-2.c b/gcc/testsuite/gcc.dg/ipa/ipa-2.c index 454927a2c19..1b94bbb7bc0 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-2.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-2.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */ -/* { dg-skip-if "PR 25442" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */ +/* { dg-add-options bind_pic_locally } */ #include <stdio.h> int g (int b, int c) diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-3.c b/gcc/testsuite/gcc.dg/ipa/ipa-3.c index 6eb3da40a6f..57200a9ca5d 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-3.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-3.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */ -/* { dg-skip-if "PR 25442" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */ +/* { dg-add-options bind_pic_locally } */ /* Double constants. */ diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-4.c b/gcc/testsuite/gcc.dg/ipa/ipa-4.c index c162b2385f2..12af6a4f4d3 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-4.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-4.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */ -/* { dg-skip-if "PR 25442" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */ +/* { dg-add-options bind_pic_locally } */ #include <stdio.h> int g (int b, int c) diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-5.c b/gcc/testsuite/gcc.dg/ipa/ipa-5.c index 9e8006a2fef..0ca6ba21dce 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-5.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-5.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */ -/* { dg-skip-if "PR 25442" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */ +/* { dg-add-options bind_pic_locally } */ /* Float & short constants. */ diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-7.c b/gcc/testsuite/gcc.dg/ipa/ipa-7.c index 1c4a1709df6..b3ab0f532e4 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-7.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-7.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */ -/* { dg-skip-if "PR 25442" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */ +/* { dg-add-options bind_pic_locally } */ #include <stdio.h> void send_addr (int *); diff --git a/gcc/testsuite/gcc.dg/ipa/ipacost-2.c b/gcc/testsuite/gcc.dg/ipa/ipacost-2.c index 958059c73e6..d06c9b8a48c 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipacost-2.c +++ b/gcc/testsuite/gcc.dg/ipa/ipacost-2.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining -fdump-tree-optimized" } */ -/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining -fdump-tree-optimized -fpie" { target { ! nonpic } } } */ +/* { dg-add-options bind_pic_locally } */ int array[100]; diff --git a/gcc/testsuite/gcc.dg/lto/20090914-2_0.c b/gcc/testsuite/gcc.dg/lto/20090914-2_0.c index f78ecf8899f..906b3c44196 100644 --- a/gcc/testsuite/gcc.dg/lto/20090914-2_0.c +++ b/gcc/testsuite/gcc.dg/lto/20090914-2_0.c @@ -1,4 +1,5 @@ -/* { dg-lto-do run { target x86_64-*-* i?86-*-* } } */ +/* { dg-lto-do run } */ +/* { dg-skip-if "x86 only" { ! { x86_64-*-* i?86-*-* } } { "*" } { "" } } */ /* Doesn't work without this dummy function with -fwhopr. */ int foo(void) { } diff --git a/gcc/testsuite/gcc.dg/lto/20091006-2_0.c b/gcc/testsuite/gcc.dg/lto/20091006-2_0.c new file mode 100644 index 00000000000..f8189920cfd --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/20091006-2_0.c @@ -0,0 +1,4 @@ +/* { dg-lto-do link } */ + +extern int a[10]; +int main() { return 0; } diff --git a/gcc/testsuite/gcc.dg/lto/20091006-2_1.c b/gcc/testsuite/gcc.dg/lto/20091006-2_1.c new file mode 100644 index 00000000000..581839344c1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/20091006-2_1.c @@ -0,0 +1 @@ +int a[16]; diff --git a/gcc/testsuite/gcc.dg/lto/20091006-2_2.c b/gcc/testsuite/gcc.dg/lto/20091006-2_2.c new file mode 100644 index 00000000000..a610b2b1292 --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/20091006-2_2.c @@ -0,0 +1 @@ +extern int a[14]; diff --git a/gcc/testsuite/gcc.dg/lto/20091013-1_0.c b/gcc/testsuite/gcc.dg/lto/20091013-1_0.c new file mode 100644 index 00000000000..e1a7dc86b6b --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/20091013-1_0.c @@ -0,0 +1,21 @@ +/* { dg-lto-do link } */ +/* { dg-lto-options {{-fPIC -shared -flto} {-fPIC -shared -O2 -flto}} } */ + +void * HeapAlloc(void*,unsigned int,unsigned long); + +typedef struct tagGdiFont GdiFont; + +typedef struct tagDC { + int xunused; + GdiFont *gdiFont; + unsigned int font_code_page; +} DC; + +DC *alloc_dc_ptr( void *funcs, unsigned short magic ) +{ + DC *dc; + if (!(dc = HeapAlloc( 0, 0, sizeof(*dc) ))) return ((void *)0); + dc->gdiFont = 0; + return dc; +} + diff --git a/gcc/testsuite/gcc.dg/lto/20091013-1_1.c b/gcc/testsuite/gcc.dg/lto/20091013-1_1.c new file mode 100644 index 00000000000..68294fa62cb --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/20091013-1_1.c @@ -0,0 +1,111 @@ +typedef struct HDC__ { int unused; } *HDC; +typedef struct HFONT__ { int unused; } *HFONT; + +typedef struct +{ + unsigned int ciACP; +} CHARSETINFO, *PCHARSETINFO, *LPCHARSETINFO; + +typedef struct tagTEXTMETRICW +{ + int tmCharSet; +} TEXTMETRICW, *LPTEXTMETRICW, *PTEXTMETRICW; + +struct gdi_obj_funcs +{ + void* (*pSelectObject)( void* handle, void* hdc ); +}; + +typedef struct tagGdiFont GdiFont; + +typedef struct tagDC +{ + int xunused; + GdiFont *gdiFont; + unsigned int font_code_page; +} DC; + +extern GdiFont* WineEngCreateFontInstance(DC*, HFONT); +extern unsigned int WineEngGetTextCharsetInfo(GdiFont *font, void* fs, unsigned int flags); +extern int WineEngGetTextMetrics(GdiFont*, LPTEXTMETRICW); +extern void* alloc_gdi_handle( void *obj, unsigned short type, const struct gdi_obj_funcs *funcs ); + +enum __wine_debug_class +{ + __WINE_DBCL_FIXME, + __WINE_DBCL_ERR, + __WINE_DBCL_WARN, + __WINE_DBCL_TRACE, + + __WINE_DBCL_INIT = 7 +}; + +struct __wine_debug_channel +{ + unsigned char flags; + char name[15]; +}; + +extern int wine_dbg_log( enum __wine_debug_class cls, struct __wine_debug_channel *ch, const char *func, + const char *format, ... ) __attribute__((format (printf,4,5))); + +static struct __wine_debug_channel __wine_dbch_font = { ~0, "font" }; +static struct __wine_debug_channel * const __wine_dbch___default = &__wine_dbch_font; + +static void* FONT_SelectObject( void* handle, void* hdc ); + +static const struct gdi_obj_funcs font_funcs = +{ + FONT_SelectObject, +}; + +HFONT CreateFontIndirectW( const void *plf ) +{ + return alloc_gdi_handle( 0, 6, &font_funcs ); +} + +static void update_font_code_page( DC *dc ) +{ + CHARSETINFO csi; + int charset = (unsigned char)1; + + if (dc->gdiFont) + charset = WineEngGetTextCharsetInfo( dc->gdiFont, ((void *)0), 0 ); + + if (TranslateCharsetInfo( ((void *)(unsigned long)((unsigned long)charset)), &csi, 1) ) + dc->font_code_page = csi.ciACP; + else { + switch(charset) { + case (unsigned char)1: + dc->font_code_page = GetACP(); + break; + + case (unsigned char)246: + dc->font_code_page = 0; + break; + + default: + do { if((((__wine_dbch___default))->flags & (1 << __WINE_DBCL_FIXME))) { struct __wine_debug_channel * const __dbch = (__wine_dbch___default); const enum __wine_debug_class __dbcl = __WINE_DBCL_FIXME; wine_dbg_log( __dbcl, __dbch, __FUNCTION__, "Can't find codepage for charset %d\n", charset); } } while(0); + dc->font_code_page = 0; + break; + } + } + + do { if((((__wine_dbch___default))->flags & (1 << __WINE_DBCL_TRACE))) { struct __wine_debug_channel * const __dbch = (__wine_dbch___default); const enum __wine_debug_class __dbcl = __WINE_DBCL_TRACE; wine_dbg_log( __dbcl, __dbch, __FUNCTION__, "charset %d => cp %d\n", charset, dc->font_code_page); } } while(0); +} + +static void* FONT_SelectObject( void* handle, void* hdc ) +{ + DC *dc; + + dc->gdiFont = WineEngCreateFontInstance( dc, handle ); + update_font_code_page( dc ); + return 0; +} + +int GetTextMetricsW( HDC hdc, TEXTMETRICW *metrics ) +{ + DC * dc; + return WineEngGetTextMetrics(dc->gdiFont, metrics); +} + diff --git a/gcc/testsuite/gcc.dg/lto/20091013-1_2.c b/gcc/testsuite/gcc.dg/lto/20091013-1_2.c new file mode 100644 index 00000000000..55f8ca1b46d --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/20091013-1_2.c @@ -0,0 +1,220 @@ +typedef struct HDC__ { int unused; } *HDC; +typedef struct HFONT__ { int unused; } *HFONT; + +void* HeapAlloc(void*,unsigned int,unsigned long); + +typedef struct tagLOGFONTW +{ + int lfPitchAndFamily; + unsigned short lfFaceName[32]; +} LOGFONTW, *PLOGFONTW, *LPLOGFONTW; + +typedef struct tagGdiFont GdiFont; +typedef struct tagDC DC; + +extern unsigned int WineEngGetFontData(GdiFont*, unsigned int, unsigned int, void*, unsigned int); + +struct list +{ + struct list *next; + struct list *prev; +}; + +typedef struct FT_FaceRec_ +{ + signed long face_flags; +} FT_FaceRec, *FT_Face; + +typedef struct { } GM; + +typedef struct { } FMAT2; + +typedef struct { + unsigned int hash; + LOGFONTW lf; + int can_use_bitmap; +} FONT_DESC; + + + +typedef struct tagHFONTLIST { + struct list entry; + HFONT hfont; +} HFONTLIST; + +typedef struct { + struct list entry; + void *face; + GdiFont *font; +} CHILD_FONT; + + +struct tagGdiFont { + struct list entry; + GM **gm; + struct list hfontlist; + struct list child_fonts; + + FT_Face ft_face; + FONT_DESC font_desc; + long ppem; +}; + + + +static struct list gdi_font_list = { &(gdi_font_list), &(gdi_font_list) }; + + + + +static int get_glyph_index_linked(GdiFont *font, unsigned int c, GdiFont **linked_font, unsigned int *glyph); +static long load_VDMX(GdiFont*, long); + +extern int f1(void*,int); + +static FT_Face OpenFontFace(GdiFont *font, void *face, long width, long height) +{ + FT_Face ft_face; + + font->ppem = load_VDMX(font, height); + if(font->ppem == 0) + font->ppem = f1(ft_face, height); + return ft_face; +} + + +static GdiFont *alloc_font(void) +{ + GdiFont *ret = HeapAlloc(0, 0x00000008, sizeof(*ret)); + ret->gm = HeapAlloc(0, 0x00000008, sizeof(GM*)); + return ret; +} + + +static long load_VDMX(GdiFont *font,long height) +{ + unsigned short hdr[3]; + + WineEngGetFontData(font, 0x42424242, 0, hdr, 6); + return 0; +} + +static int fontcmp(const GdiFont *font, FONT_DESC *fd) +{ + if(font->font_desc.hash != fd->hash) return 1; + if(memcmp(&font->font_desc.lf, &fd->lf, __builtin_offsetof (LOGFONTW, lfFaceName))) return 1; + if(!font->font_desc.can_use_bitmap != !fd->can_use_bitmap) return 1; + return strcmpiW(font->font_desc.lf.lfFaceName, fd->lf.lfFaceName); +} + +static GdiFont *find_in_cache(HFONT hfont, const LOGFONTW *plf, const FMAT2 *pmat, int can_use_bitmap) +{ + GdiFont *ret; + FONT_DESC fd; + HFONTLIST *hflist; + struct list *font_elem_ptr, *hfontlist_elem_ptr; + + fd.lf = *plf; + fd.can_use_bitmap = can_use_bitmap; + + + for ((font_elem_ptr) = (&gdi_font_list)->next; (font_elem_ptr) != (&gdi_font_list); (font_elem_ptr) = (font_elem_ptr)->next) { + ret = ((struct tagGdiFont *)((char *)(font_elem_ptr) - (unsigned long)(&((struct tagGdiFont *)0)->entry))); + if(!fontcmp(ret, &fd)) { + if(!can_use_bitmap && !( ret->ft_face->face_flags & ( 1L << 0 ) )) continue; + for ((hfontlist_elem_ptr) = (&ret->hfontlist)->next; (hfontlist_elem_ptr) != (&ret->hfontlist); (hfontlist_elem_ptr) = (hfontlist_elem_ptr)->next) { + hflist = ((struct tagHFONTLIST *)((char *)(hfontlist_elem_ptr) - (unsigned long)(&((struct tagHFONTLIST *)0)->entry))); + if(hflist->hfont == hfont) + return ret; + } + hflist = HeapAlloc(0, 0, sizeof(*hflist)); + hflist->hfont = hfont; + return ret; + } + } + + while(font_elem_ptr) { + ret = ((struct tagGdiFont *)((char *)(font_elem_ptr) - (unsigned long)(&((struct tagGdiFont *)0)->entry))); + if(!fontcmp(ret, &fd)) { + if(!can_use_bitmap && !( ret->ft_face->face_flags & ( 1L << 0 ) )) continue; + hflist = HeapAlloc(0, 0, sizeof(*hflist)); + hflist->hfont = hfont; + return ret; + } + } + return ((void *)0); +} + + + + +GdiFont *WineEngCreateFontInstance(DC *dc, HFONT hfont) +{ + GdiFont *ret; + int can_use_bitmap; + LOGFONTW lf; + FMAT2 dcmat; + + if((ret = find_in_cache(hfont, &lf, &dcmat, can_use_bitmap)) != ((void *)0)) + return ret; + return alloc_font(); +} + +extern unsigned int f(void*,unsigned int g); + +static unsigned int get_glyph_index(void*font, unsigned int glyph) +{ + return f(font, glyph); +} + +unsigned int WineEngGetGlyphOutline(GdiFont *incoming_font, unsigned int glyph, unsigned int format, + void* lpgm, unsigned int buflen, void* buf, + const void* lpmat) +{ + unsigned int glyph_index; + + get_glyph_index_linked(incoming_font, glyph, &incoming_font, &glyph_index); + return 0; +} + +static int load_child_font(GdiFont *font, CHILD_FONT *child) +{ + child->font = alloc_font(); + child->font->ft_face = OpenFontFace(child->font, child->face, 0, -font->ppem); + if(!child->font->ft_face) + return 0; + return 1; +} + +static int get_glyph_index_linked(GdiFont *font, unsigned int c, GdiFont **linked_font, unsigned int *glyph) +{ + unsigned int g; + CHILD_FONT *child_font; + + for ((child_font) = ((CHILD_FONT *)((char *)((&font->child_fonts)->next) - (unsigned long)(&((CHILD_FONT *)0)->entry))); &(child_font)->entry != (&font->child_fonts); (child_font) = ((CHILD_FONT *)((char *)((child_font)->entry.next) - (unsigned long)(&((CHILD_FONT *)0)->entry)))) + { + if(!load_child_font(font, child_font)) + continue; + + g = get_glyph_index(child_font->font, c); + if(g) { + *glyph = g; + *linked_font = child_font->font; + return 1; + } + } + return 0; +} + +unsigned int WineEngGetFontData(GdiFont *font, unsigned int table, unsigned int offset, void* buf, + unsigned int cbData) +{ + unsigned long len; + load_sfnt_table(font->ft_face, table, offset, buf, &len); + return len; +} + +int WineEngGetLinkedHFont(DC *dc, unsigned short c, HFONT *new_hfont, unsigned int *glyph) { + return get_glyph_index_linked(0, 0, 0, 0); +} + diff --git a/gcc/testsuite/gcc.dg/lto/20091014-1_0.c b/gcc/testsuite/gcc.dg/lto/20091014-1_0.c new file mode 100644 index 00000000000..241dddbf81f --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/20091014-1_0.c @@ -0,0 +1,4 @@ +/* { dg-lto-do link } */ +/* { dg-lto-options {{-fPIC -shared -flto}} } */ + +/* Empty file. See PR41173. */ diff --git a/gcc/testsuite/gcc.dg/lto/20091015-1_0.c b/gcc/testsuite/gcc.dg/lto/20091015-1_0.c new file mode 100644 index 00000000000..f60e7d16a7e --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/20091015-1_0.c @@ -0,0 +1,5 @@ +/* { dg-lto-do link } */ +/* { dg-lto-options {{-fPIC -shared -O2 -flto} {-fPIC -shared -O2 -fwhopr}} } */ + +#include "20091015-1_b.h" +void diagnostic_initialize (FILE **stream) { *stream = stderr; } diff --git a/gcc/testsuite/gcc.dg/lto/20091015-1_1.c b/gcc/testsuite/gcc.dg/lto/20091015-1_1.c new file mode 100644 index 00000000000..c000518f45d --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/20091015-1_1.c @@ -0,0 +1,4 @@ +#include "20091015-1_a.h" +#include "20091015-1_b.h" +void ggc_print_common_statistics (FILE *stream) { +} diff --git a/gcc/testsuite/gcc.dg/lto/20091015-1_2.c b/gcc/testsuite/gcc.dg/lto/20091015-1_2.c new file mode 100644 index 00000000000..fd10680866a --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/20091015-1_2.c @@ -0,0 +1,5 @@ +#include "20091015-1_a.h" +#include "20091015-1_b.h" +void debug_optab_libfuncs (void) { +foo (stderr, 4 ); +} diff --git a/gcc/testsuite/gcc.dg/lto/20091015-1_a.h b/gcc/testsuite/gcc.dg/lto/20091015-1_a.h new file mode 100644 index 00000000000..61e56c9a95f --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/20091015-1_a.h @@ -0,0 +1,2 @@ +struct _IO_FILE { int _flags; +}; diff --git a/gcc/testsuite/gcc.dg/lto/20091015-1_b.h b/gcc/testsuite/gcc.dg/lto/20091015-1_b.h new file mode 100644 index 00000000000..88139027467 --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/20091015-1_b.h @@ -0,0 +1,2 @@ +typedef struct _IO_FILE FILE; +extern struct _IO_FILE *stderr; diff --git a/gcc/testsuite/gcc.dg/lto/20091016-1_0.c b/gcc/testsuite/gcc.dg/lto/20091016-1_0.c new file mode 100644 index 00000000000..942c5c6c0a4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/20091016-1_0.c @@ -0,0 +1,13 @@ +/* { dg-lto-do link } */ +/* { dg-lto-options {{-fPIC -shared -O2 -flto}} } */ + +typedef struct VEC_constructor_elt_gc { } VEC_constructor_elt_gc; +#include "20091016-1_a.h" +struct stmt_tree_s { + tree x_cur_stmt_list; +}; +void *add_stmt (struct stmt_tree_s *x) +{ + return &x->x_cur_stmt_list; +} + diff --git a/gcc/testsuite/gcc.dg/lto/20091016-1_1.c b/gcc/testsuite/gcc.dg/lto/20091016-1_1.c new file mode 100644 index 00000000000..06389b8e309 --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/20091016-1_1.c @@ -0,0 +1,18 @@ +typedef struct VEC_constructor_elt_gcx { } VEC_constructor_elt_gc; +#include "20091016-1_a.h" +struct gcc_target { + void (* builtin_vec_perm) (tree*); +}; +extern struct gcc_target targetm; +void dwarf2out_begin_prologue (tree t) +{ + (*targetm.builtin_vec_perm) (&t); +} +struct die_arg_entry_struct { + tree arg; +}; +void *gt_pch_p_20VEC_die_arg_entry_gc (struct die_arg_entry_struct *vec) +{ + return &(vec->arg); +} + diff --git a/gcc/testsuite/gcc.dg/lto/20091016-1_a.h b/gcc/testsuite/gcc.dg/lto/20091016-1_a.h new file mode 100644 index 00000000000..8eefed5cfad --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/20091016-1_a.h @@ -0,0 +1,6 @@ +typedef union tree_node *tree; +union tree_node { + tree * use; + VEC_constructor_elt_gc *elts; +}; + diff --git a/gcc/testsuite/gcc.dg/lto/20091017-1_0.c b/gcc/testsuite/gcc.dg/lto/20091017-1_0.c new file mode 100644 index 00000000000..ec4c62e4d7c --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/20091017-1_0.c @@ -0,0 +1,15 @@ +/* { dg-lto-do run } */ + +struct X { + int i; +}; +extern void foo (void *); +extern void abort (void); +int main () +{ + struct X *p; + foo(&p); + if (p != (struct X *)0) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/lto/20091017-1_1.c b/gcc/testsuite/gcc.dg/lto/20091017-1_1.c new file mode 100644 index 00000000000..23e5992bde6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/20091017-1_1.c @@ -0,0 +1,6 @@ +struct X; +void foo (void *q) +{ + struct X **p = (struct X **)q; + *p = (struct X *)0; +} diff --git a/gcc/testsuite/gcc.dg/lto/20091020-1_0.c b/gcc/testsuite/gcc.dg/lto/20091020-1_0.c new file mode 100644 index 00000000000..ef61e98b4cc --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/20091020-1_0.c @@ -0,0 +1,8 @@ +/* { dg-lto-do link } */ +/* { dg-lto-options {{-fPIC -shared -flto}} } */ + +typedef struct { + int NumPackStreams; +} CSzAr; +void cli_7unz (CSzAr db) { } + diff --git a/gcc/testsuite/gcc.dg/lto/20091020-1_1.c b/gcc/testsuite/gcc.dg/lto/20091020-1_1.c new file mode 100644 index 00000000000..899183a2459 --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/20091020-1_1.c @@ -0,0 +1,15 @@ +typedef struct { + int NumPackStreams; +} CSzAr; +typedef struct { + CSzAr db; +} CSzArEx; +int SzArEx_Init(CSzArEx *p) +{ + return p->db.NumPackStreams; +} +int SzArEx_GetFolderFullPackSize(const CSzArEx *p) +{ + return p->db.NumPackStreams; +} + diff --git a/gcc/testsuite/gcc.dg/lto/20091020-2_0.c b/gcc/testsuite/gcc.dg/lto/20091020-2_0.c new file mode 100644 index 00000000000..7dcbb2da2ca --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/20091020-2_0.c @@ -0,0 +1,18 @@ +/* { dg-lto-do link } */ +/* { dg-lto-options {{-fPIC -shared -flto}} } */ + +typedef struct { + int NumPackStreams; +} CSzAr; +typedef struct { + CSzAr db; +} CSzArEx; +int SzArEx_Init(CSzArEx *p) +{ + return p->db.NumPackStreams; +} +int SzArEx_GetFolderFullPackSize(const CSzArEx *p) +{ + return p->db.NumPackStreams; +} + diff --git a/gcc/testsuite/gcc.dg/lto/20091020-2_1.c b/gcc/testsuite/gcc.dg/lto/20091020-2_1.c new file mode 100644 index 00000000000..9174f26c35c --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/20091020-2_1.c @@ -0,0 +1,5 @@ +typedef struct { + int NumPackStreams; +} CSzAr; +void cli_7unz (CSzAr db) { } + diff --git a/gcc/testsuite/gcc.dg/lto/20091020-3_0.c b/gcc/testsuite/gcc.dg/lto/20091020-3_0.c new file mode 100644 index 00000000000..441a7b91a7f --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/20091020-3_0.c @@ -0,0 +1,20 @@ +/* { dg-lto-do assemble } */ + +typedef __SIZE_TYPE__ size_t; +static int stack_dir; +static void find_stack_direction () +{ + static char *addr = ((void *)0); + auto char dummy; + if (addr == ((void *)0)) + { + addr = &(dummy); + find_stack_direction (); + } +} +void * C_alloca (size_t size) +{ + if (stack_dir == 0) + find_stack_direction (); +} + diff --git a/gcc/testsuite/gcc.dg/plugin/one_time_plugin.c b/gcc/testsuite/gcc.dg/plugin/one_time_plugin.c index ee805174aea..4a6a8a61969 100644 --- a/gcc/testsuite/gcc.dg/plugin/one_time_plugin.c +++ b/gcc/testsuite/gcc.dg/plugin/one_time_plugin.c @@ -31,7 +31,7 @@ struct gimple_opt_pass one_pass = { { GIMPLE_PASS, - "useless", /* name */ + "cfg", /* name */ one_pass_gate, /* gate */ one_pass_exec, /* execute */ NULL, /* sub */ @@ -53,7 +53,7 @@ int plugin_init (struct plugin_name_args *plugin_info, struct register_pass_info p; p.pass = &one_pass.pass; - p.reference_pass_name = "useless"; + p.reference_pass_name = "cfg"; p.ref_pass_instance_number = 1; p.pos_op = PASS_POS_INSERT_AFTER; diff --git a/gcc/testsuite/gcc.dg/pr41340.c b/gcc/testsuite/gcc.dg/pr41340.c new file mode 100644 index 00000000000..bafa61f5185 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr41340.c @@ -0,0 +1,68 @@ +/* PR debug/41340 */ +/* { dg-do compile } */ +/* { dg-options "-O3 -g -fcompare-debug" } */ +/* { dg-options "-O3 -g -fcompare-debug -march=i686" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */ + +typedef struct { int t; } *T; +struct S1 { unsigned s1; }; +struct S2 { struct S1 s2; }; +struct S3 { unsigned s3; struct S2 **s4; }; +struct S5 { struct S2 *s5; }; + +extern void fn0 (void) __attribute__ ((__noreturn__)); +T fn6 (struct S3); +void fn7 (void); + +static inline __attribute__((always_inline)) int +fn1 (const struct S1 *x) +{ + return x->s1; +} + +static inline __attribute__((always_inline)) int +fn2 (const struct S1 *x, unsigned y) +{ + if (y >= x->s1) + fn0 (); + return 0; +} + +static inline __attribute__((always_inline)) int +fn3 (struct S3 x) +{ + return (x.s3 == fn1 (*x.s4 ? &(*x.s4)->s2 : 0)); +} + +static inline __attribute__((always_inline)) int +fn4 (struct S3 x) +{ + return fn2 (&(*x.s4)->s2, x.s3); +} + +int +fn5 (struct S3 x, T *y) +{ + if (!fn3 (x)) + { + *y = (T) (long) fn4 (x); + return 1; + } + return 0; +} + +void +test (struct S5 *x) +{ + struct S3 a; + T b; + unsigned char c = 0; + a.s4 = &x->s5; + while (fn5 (a, &b)) + if (!(b->t & 8)) + c = 1; + a.s4 = &x->s5; + while ((b = fn6 (a))) + ; + if (!c) + fn7 (); +} diff --git a/gcc/testsuite/gcc.dg/raw-string-1.c b/gcc/testsuite/gcc.dg/raw-string-1.c new file mode 100644 index 00000000000..b499e5cce69 --- /dev/null +++ b/gcc/testsuite/gcc.dg/raw-string-1.c @@ -0,0 +1,101 @@ +/* { dg-do run } */ +/* { dg-options "-std=gnu99" } */ + +#include <wchar.h> + +typedef __CHAR16_TYPE__ char16_t; +typedef __CHAR32_TYPE__ char32_t; + +const char s0[] = R"[a\ +\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb +c]"; +const char s1[] = "a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc"; +const char s2[] = R"*|*[a\ +b +c]" +c]*|" +c]*|*"; +const char s3[] = "ab\nc]\"\nc]*|\"\nc"; + +const char t0[] = u8R"[a\ +\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb +c]"; +const char t1[] = u8"a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc"; +const char t2[] = u8R"*|*[a\ +b +c]" +c]*|" +c]*|*"; +const char t3[] = u8"ab\nc]\"\nc]*|\"\nc"; + +const char16_t u0[] = uR"[a\ +\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb +c]"; +const char16_t u1[] = u"a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc"; +const char16_t u2[] = uR"*|*[a\ +b +c]" +c]*|" +c]*|*"; +const char16_t u3[] = u"ab\nc]\"\nc]*|\"\nc"; + +const char32_t U0[] = UR"[a\ +\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb +c]"; +const char32_t U1[] = U"a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc"; +const char32_t U2[] = UR"*|*[a\ +b +c]" +c]*|" +c]*|*"; +const char32_t U3[] = U"ab\nc]\"\nc]*|\"\nc"; + +const wchar_t L0[] = LR"[a\ +\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb +c]"; +const wchar_t L1[] = L"a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc"; +const wchar_t L2[] = LR"*|*[a\ +b +c]" +c]*|" +c]*|*"; +const wchar_t L3[] = L"ab\nc]\"\nc]*|\"\nc"; + +int +main (void) +{ + if (sizeof (s0) != sizeof (s1) + || __builtin_memcmp (s0, s1, sizeof (s0)) != 0) + __builtin_abort (); + if (sizeof (s2) != sizeof (s3) + || __builtin_memcmp (s2, s3, sizeof (s2)) != 0) + __builtin_abort (); + if (sizeof (t0) != sizeof (t1) + || __builtin_memcmp (t0, t1, sizeof (t0)) != 0) + __builtin_abort (); + if (sizeof (t2) != sizeof (t3) + || __builtin_memcmp (t2, t3, sizeof (t2)) != 0) + __builtin_abort (); + if (sizeof (u0) != sizeof (u1) + || __builtin_memcmp (u0, u1, sizeof (u0)) != 0) + __builtin_abort (); + if (sizeof (u2) != sizeof (u3) + || __builtin_memcmp (u2, u3, sizeof (u2)) != 0) + __builtin_abort (); + if (sizeof (U0) != sizeof (U1) + || __builtin_memcmp (U0, U1, sizeof (U0)) != 0) + __builtin_abort (); + if (sizeof (U2) != sizeof (U3) + || __builtin_memcmp (U2, U3, sizeof (U2)) != 0) + __builtin_abort (); + if (sizeof (L0) != sizeof (L1) + || __builtin_memcmp (L0, L1, sizeof (L0)) != 0) + __builtin_abort (); + if (sizeof (L2) != sizeof (L3) + || __builtin_memcmp (L2, L3, sizeof (L2)) != 0) + __builtin_abort (); + if (sizeof (R"*[]*") != 1 + || __builtin_memcmp (R"*[]*", "", 1) != 0) + __builtin_abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/raw-string-2.c b/gcc/testsuite/gcc.dg/raw-string-2.c new file mode 100644 index 00000000000..533abe2bc89 --- /dev/null +++ b/gcc/testsuite/gcc.dg/raw-string-2.c @@ -0,0 +1,109 @@ +/* { dg-do run } */ +/* { dg-options "-std=gnu99" } */ + +#include <wchar.h> + +typedef __CHAR16_TYPE__ char16_t; +typedef __CHAR32_TYPE__ char32_t; + +#define R +#define u +#define uR +#define U +#define UR +#define u8 +#define u8R +#define L +#define LR + +const char s00[] = R"[a]" "[b]"; +const char s01[] = "[a]" R"*[b]*"; +const char s02[] = R"[a]" R"[b]"; +const char s03[] = R"-[a]-" u8"[b]"; +const char s04[] = "[a]" u8R"MNOPQRSTUVWXYZ[b]MNOPQRSTUVWXYZ"; +const char s05[] = R"[a]" u8R"wxyzABCDEFGHIJKL[b]wxyzABCDEFGHIJKL"; +const char s06[] = u8R";([a];(" "[b]"; +const char s07[] = u8"[a]" R"[b]"; +const char s08[] = u8R"[a]" R"_{}#()<>%:;.?*+-[b]_{}#()<>%:;.?*+-"; +const char s09[] = u8R"/^&|~!=,"'\[a]/^&|~!=,"'\" u8"[b]"; +const char s10[] = u8"[a]" u8R"0123456789abcdef[b]0123456789abcdef"; +const char s11[] = u8R"ghijklmnopqrstuv[a]ghijklmnopqrstuv" u8R"w[b]w"; + +const char16_t u03[] = R"-[a]-" u"[b]"; +const char16_t u04[] = "[a]" uR"MNOPQRSTUVWXYZ[b]MNOPQRSTUVWXYZ"; +const char16_t u05[] = R"[a]" uR"wxyzABCDEFGHIJKL[b]wxyzABCDEFGHIJKL"; +const char16_t u06[] = uR";([a];(" "[b]"; +const char16_t u07[] = u"[a]" R"[b]"; +const char16_t u08[] = uR"[a]" R"_{}#()<>%:;.?*+-[b]_{}#()<>%:;.?*+-"; +const char16_t u09[] = uR"/^&|~!=,"'\[a]/^&|~!=,"'\" u"[b]"; +const char16_t u10[] = u"[a]" uR"0123456789abcdef[b]0123456789abcdef"; +const char16_t u11[] = uR"ghijklmnopqrstuv[a]ghijklmnopqrstuv" uR"w[b]w"; + +const char32_t U03[] = R"-[a]-" U"[b]"; +const char32_t U04[] = "[a]" UR"MNOPQRSTUVWXYZ[b]MNOPQRSTUVWXYZ"; +const char32_t U05[] = R"[a]" UR"wxyzABCDEFGHIJKL[b]wxyzABCDEFGHIJKL"; +const char32_t U06[] = UR";([a];(" "[b]"; +const char32_t U07[] = U"[a]" R"[b]"; +const char32_t U08[] = UR"[a]" R"_{}#()<>%:;.?*+-[b]_{}#()<>%:;.?*+-"; +const char32_t U09[] = UR"/^&|~!=,"'\[a]/^&|~!=,"'\" U"[b]"; +const char32_t U10[] = U"[a]" UR"0123456789abcdef[b]0123456789abcdef"; +const char32_t U11[] = UR"ghijklmnopqrstuv[a]ghijklmnopqrstuv" UR"w[b]w"; + +const wchar_t L03[] = R"-[a]-" L"[b]"; +const wchar_t L04[] = "[a]" LR"MNOPQRSTUVWXYZ[b]MNOPQRSTUVWXYZ"; +const wchar_t L05[] = R"[a]" LR"wxyzABCDEFGHIJKL[b]wxyzABCDEFGHIJKL"; +const wchar_t L06[] = LR";([a];(" "[b]"; +const wchar_t L07[] = L"[a]" R"[b]"; +const wchar_t L08[] = LR"[a]" R"_{}#()<>%:;.?*+-[b]_{}#()<>%:;.?*+-"; +const wchar_t L09[] = LR"/^&|~!=,"'\[a]/^&|~!=,"'\" L"[b]"; +const wchar_t L10[] = L"[a]" LR"0123456789abcdef[b]0123456789abcdef"; +const wchar_t L11[] = LR"ghijklmnopqrstuv[a]ghijklmnopqrstuv" LR"w[b]w"; + +int +main (void) +{ +#define TEST(str, val) \ + if (sizeof (str) != sizeof (val) \ + || __builtin_memcmp (str, val, sizeof (str)) != 0) \ + __builtin_abort () + TEST (s00, "a[b]"); + TEST (s01, "[a]b"); + TEST (s02, "ab"); + TEST (s03, "a[b]"); + TEST (s04, "[a]b"); + TEST (s05, "ab"); + TEST (s06, "a[b]"); + TEST (s07, "[a]b"); + TEST (s08, "ab"); + TEST (s09, "a[b]"); + TEST (s10, "[a]b"); + TEST (s11, "ab"); + TEST (u03, u"a[b]"); + TEST (u04, u"[a]b"); + TEST (u05, u"ab"); + TEST (u06, u"a[b]"); + TEST (u07, u"[a]b"); + TEST (u08, u"ab"); + TEST (u09, u"a[b]"); + TEST (u10, u"[a]b"); + TEST (u11, u"ab"); + TEST (U03, U"a[b]"); + TEST (U04, U"[a]b"); + TEST (U05, U"ab"); + TEST (U06, U"a[b]"); + TEST (U07, U"[a]b"); + TEST (U08, U"ab"); + TEST (U09, U"a[b]"); + TEST (U10, U"[a]b"); + TEST (U11, U"ab"); + TEST (L03, L"a[b]"); + TEST (L04, L"[a]b"); + TEST (L05, L"ab"); + TEST (L06, L"a[b]"); + TEST (L07, L"[a]b"); + TEST (L08, L"ab"); + TEST (L09, L"a[b]"); + TEST (L10, L"[a]b"); + TEST (L11, L"ab"); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/raw-string-3.c b/gcc/testsuite/gcc.dg/raw-string-3.c new file mode 100644 index 00000000000..9226411d2e0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/raw-string-3.c @@ -0,0 +1,53 @@ +/* If not gnu99, the {,u,u8,U,L}R prefix should be parsed as separate + token. */ +/* { dg-do compile } */ +/* { dg-options "" } */ + +const void *s0 = R"[a]"; /* { dg-error "undeclared" } */ + /* { dg-error "expected ',' or ';'" "" { target *-*-* } 6 } */ +const void *s1 = uR"[a]"; /* { dg-error "undeclared" } */ + /* { dg-error "expected ',' or ';'" "" { target *-*-* } 8 } */ +const void *s2 = UR"[a]"; /* { dg-error "undeclared" } */ + /* { dg-error "expected ',' or ';'" "" { target *-*-* } 10 } */ +const void *s3 = u8R"[a]"; /* { dg-error "undeclared" } */ + /* { dg-error "expected ',' or ';'" "" { target *-*-* } 12 } */ +const void *s4 = LR"[a]"; /* { dg-error "undeclared" } */ + /* { dg-error "expected ',' or ';'" "" { target *-*-* } 14 } */ + +const int i0 = R'a'; /* { dg-error "expected ',' or ';'" } */ +const int i1 = uR'a'; /* { dg-error "expected ',' or ';'" } */ +const int i2 = UR'a'; /* { dg-error "expected ',' or ';'" } */ +const int i3 = u8R'a'; /* { dg-error "expected ',' or ';'" } */ +const int i4 = LR'a'; /* { dg-error "expected ',' or ';'" } */ + +#define R "a" +#define uR "b" +#define UR "c" +#define u8R "d" +#define LR "e" + +const void *s5 = R"[a]"; +const void *s6 = uR"[a]"; +const void *s7 = UR"[a]"; +const void *s8 = u8R"[a]"; +const void *s9 = LR"[a]"; + +#undef R +#undef uR +#undef UR +#undef u8R +#undef LR + +#define R 1 + +#define uR 2 + +#define UR 3 + +#define u8R 4 + +#define LR 5 + + +const int i5 = R'a'; +const int i6 = uR'a'; +const int i7 = UR'a'; +const int i8 = u8R'a'; +const int i9 = LR'a'; + +int main () {} diff --git a/gcc/testsuite/gcc.dg/raw-string-4.c b/gcc/testsuite/gcc.dg/raw-string-4.c new file mode 100644 index 00000000000..24d56ed7464 --- /dev/null +++ b/gcc/testsuite/gcc.dg/raw-string-4.c @@ -0,0 +1,28 @@ +/* R is not applicable for character literals. */ +/* { dg-do compile } */ +/* { dg-options "-std=gnu99" } */ + +const int i0 = R'a'; /* { dg-error "undeclared" } */ + /* { dg-error "expected ',' or ';'" "" { target *-*-* } 5 } */ +const int i1 = uR'a'; /* { dg-error "undeclared" } */ + /* { dg-error "expected ',' or ';'" "" { target *-*-* } 7 } */ +const int i2 = UR'a'; /* { dg-error "undeclared" } */ + /* { dg-error "expected ',' or ';'" "" { target *-*-* } 9 } */ +const int i3 = u8R'a'; /* { dg-error "undeclared" } */ + /* { dg-error "expected ',' or ';'" "" { target *-*-* } 11 } */ +const int i4 = LR'a'; /* { dg-error "undeclared" } */ + /* { dg-error "expected ',' or ';'" "" { target *-*-* } 13 } */ + +#define R 1 + +#define uR 2 + +#define UR 3 + +#define u8R 4 + +#define LR 5 + + +const int i5 = R'a'; +const int i6 = uR'a'; +const int i7 = UR'a'; +const int i8 = u8R'a'; +const int i9 = LR'a'; + +int main () {} diff --git a/gcc/testsuite/gcc.dg/raw-string-5.c b/gcc/testsuite/gcc.dg/raw-string-5.c new file mode 100644 index 00000000000..3dbf97ded90 --- /dev/null +++ b/gcc/testsuite/gcc.dg/raw-string-5.c @@ -0,0 +1,23 @@ +/* { dg-do compile } */ +/* { dg-options "-std=gnu99" } */ + +const void *s0 = R"0123456789abcdefg[]0123456789abcdefg"; + /* { dg-error "raw string delimiter longer" "" { target *-*-* } 4 } */ + /* { dg-error "stray" "" { target *-*-* } 4 } */ +const void *s1 = R" [] "; + /* { dg-error "invalid character" "" { target *-*-* } 7 } */ + /* { dg-error "stray" "" { target *-*-* } 7 } */ +const void *s2 = R" [] "; + /* { dg-error "invalid character" "" { target *-*-* } 10 } */ + /* { dg-error "stray" "" { target *-*-* } 10 } */ +const void *s3 = R"][]]"; + /* { dg-error "invalid character" "" { target *-*-* } 13 } */ + /* { dg-error "stray" "" { target *-*-* } 13 } */ +const void *s4 = R"@[]@"; + /* { dg-error "invalid character" "" { target *-*-* } 16 } */ + /* { dg-error "stray" "" { target *-*-* } 16 } */ +const void *s5 = R"$[]$"; + /* { dg-error "invalid character" "" { target *-*-* } 19 } */ + /* { dg-error "stray" "" { target *-*-* } 19 } */ + +int main () {} diff --git a/gcc/testsuite/gcc.dg/raw-string-6.c b/gcc/testsuite/gcc.dg/raw-string-6.c new file mode 100644 index 00000000000..338087a25fd --- /dev/null +++ b/gcc/testsuite/gcc.dg/raw-string-6.c @@ -0,0 +1,5 @@ +/* { dg-do compile } */ +/* { dg-options "-std=gnu99" } */ + +const void *s0 = R"ouch[]ouCh"; /* { dg-error "expected expression at end of input" } */ + /* { dg-error "unterminated raw string" "" { target *-*-* } 4 } */ diff --git a/gcc/testsuite/gcc.dg/raw-string-7.c b/gcc/testsuite/gcc.dg/raw-string-7.c new file mode 100644 index 00000000000..5bb4bec2085 --- /dev/null +++ b/gcc/testsuite/gcc.dg/raw-string-7.c @@ -0,0 +1,23 @@ +/* The trailing whitespace after \ and before newline extension + breaks full compliance for raw strings. */ +/* { dg-do run { xfail *-*-* } } */ +/* { dg-options "-std=gnu99" } */ + +/* Note, there is a single space after \ on the following line. */ +const void *s0 = R"[\ +]"; +/* { dg-bogus "backslash and newline separated by space" "" { xfail *-*-* } 7 } */ + +/* Note, there is a single tab after \ on the following line. */ +const void *s1 = R"[\ +]"; +/* { dg-bogus "backslash and newline separated by space" "" { xfail *-*-* } 12 } */ + +int +main (void) +{ + if (__builtin_strcmp (s0, "\\ \n") != 0 + || __builtin_strcmp (s1, "\\\t\n") != 0) + __builtin_abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/tls/pie-1.c b/gcc/testsuite/gcc.dg/tls/pie-1.c new file mode 100644 index 00000000000..07eb5f1ad25 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tls/pie-1.c @@ -0,0 +1,6 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target fpic } */ +/* { dg-options "-fpie" } */ +/* { dg-require-effective-target tls } */ + +__thread int a; int b; int main() { return a = b; } diff --git a/gcc/testsuite/gcc.dg/torture/builtin-math-6.c b/gcc/testsuite/gcc.dg/torture/builtin-math-6.c index 1bf367a5deb..097a8c25d37 100644 --- a/gcc/testsuite/gcc.dg/torture/builtin-math-6.c +++ b/gcc/testsuite/gcc.dg/torture/builtin-math-6.c @@ -6,7 +6,7 @@ Origin: Kaveh R. Ghazi, January 28, 2009. */ /* { dg-do link } */ -/* { dg-require-effective-target mpc_pow } */ +/* { dg-require-effective-target mpc_arc } */ /* All references to link_error should go away at compile-time. The first number is the line number and the second is the value number @@ -180,9 +180,48 @@ extern void link_error(int, int); int main (void) { + TESTIT_COMPLEX (1, cacos, 1, CONJ(0)); + TESTIT_COMPLEX_R (1, cacos, -1, CONJ(3.141593F)); + TESTIT_COMPLEX (1, cacos, CONJ(1), 0); + TESTIT_COMPLEX_R (1, cacos, CONJ(-1), 3.141593F); + TESTIT_COMPLEX_R_ALLNEG (cacos, 3.45678F + 2.34567FI, + 0.60971F - 2.11780FI, 2.531875F - 2.117800FI, + 0.60971F + 2.11780FI, 2.531875F + 2.117800FI); + + TESTIT_COMPLEX_ALLNEG (casin, 0, + 0, -CONJ(0), CONJ(0), CONJ(-0.F)); + TESTIT_COMPLEX_R_ALLNEG (casin, 3.45678F + 2.34567FI, + 0.96107F + 2.11780FI, -0.96107F + 2.11780FI, + 0.96107F - 2.11780FI, -0.96107F - 2.11780FI); + + TESTIT_COMPLEX_ALLNEG (catan, 0, + 0, -CONJ(0), CONJ(0), CONJ(-0.F)); + TESTIT_COMPLEX_R_ALLNEG (catan, 3.45678F + 2.34567FI, + 1.37188F + 0.12997FI, -1.37188F + 0.12997FI, + 1.37188F - 0.12997FI, -1.37188F - 0.12997FI); + + TESTIT_COMPLEX (1, cacosh, 1, 0); + TESTIT_COMPLEX_R (1, cacosh, -1, 3.141593FI); + TESTIT_COMPLEX (1, cacosh, CONJ(1), CONJ(0)); + TESTIT_COMPLEX_R (1, cacosh, CONJ(-1), CONJ(3.141593FI)); + TESTIT_COMPLEX_R_ALLNEG (cacosh, 3.45678F + 2.34567FI, + 2.11780F + 0.60971FI, 2.11780F + 2.531875FI, + 2.11780F - 0.60971FI, 2.11780F - 2.531875FI); + + TESTIT_COMPLEX_ALLNEG (casinh, 0, + 0, -CONJ(0), CONJ(0), CONJ(-0.F)); + TESTIT_COMPLEX_R_ALLNEG (casinh, 3.45678F + 2.34567FI, + 2.12836F + 0.58310FI, -2.12836F + 0.58310FI, + 2.12836F - 0.58310FI, -2.12836F - 0.58310FI); + + TESTIT_COMPLEX_ALLNEG (catanh, 0, + 0, -CONJ(0), CONJ(0), CONJ(-0.F)); + TESTIT_COMPLEX_R_ALLNEG (catanh, 3.45678F + 2.34567FI, + 0.19693F + 1.43190FI, -0.19693F + 1.43190FI, + 0.19693F - 1.43190FI, -0.19693F - 1.43190FI); + TESTIT_COMPLEX_ALLNEG (csin, 0, - 0, -0.F, - CONJ(0), CONJ(-0.F)); + 0, -0.F, CONJ(0), CONJ(-0.F)); TESTIT_COMPLEX_R_ALLNEG (csin, 3.45678F + 2.34567FI, -1.633059F - 4.917448FI, 1.633059F - 4.917448FI, -1.633059F + 4.917448FI, 1.633059F + 4.917448FI); @@ -219,8 +258,8 @@ int main (void) TESTIT_COMPLEX (1, clog, 1, 0); TESTIT_COMPLEX_R (1, clog, -1, 3.141593FI); - TESTIT_COMPLEX (1, clog, CONJ(1), CONJ(0)); /* Fails with mpc-0.6. */ - TESTIT_COMPLEX_R (1, clog, CONJ(-1), CONJ(3.141593FI)); /* Fails with mpc-0.6. */ + TESTIT_COMPLEX (1, clog, CONJ(1), CONJ(0)); + TESTIT_COMPLEX_R (1, clog, CONJ(-1), CONJ(3.141593FI)); TESTIT_COMPLEX_R_ALLNEG (clog, 3.45678F + 2.34567FI, 1.429713F + 0.596199FI, 1.429713F + 2.545394FI, 1.429713F - 0.596199FI, 1.429713F - 2.545394FI); diff --git a/gcc/testsuite/gcc.dg/torture/pr26515.c b/gcc/testsuite/gcc.dg/torture/pr26515.c new file mode 100644 index 00000000000..a051e2e53c4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr26515.c @@ -0,0 +1,27 @@ +/* { dg-options "-march=v10" { target cris*-*-* } } */ +struct i +{ + long long i_size; + struct a *i_mapping; +}; +struct p +{ + struct a *mapping; + long index; +}; +extern void b (struct p*, unsigned); +extern void u (struct p*); +void +block_page_mkwrite (struct i *i, struct p *p) +{ + unsigned end = 0; + long long size = 0; + size = i->i_size; + if ((p->mapping != i->i_mapping)) + goto out_unlock; + if (((p->index + 1) << 13) > size) + end = size & ~(~(((1UL) << 13) - 1)); + b (p, end); +out_unlock: + u (p); +} diff --git a/gcc/testsuite/gcc.dg/torture/pr38948.c b/gcc/testsuite/gcc.dg/torture/pr38948.c new file mode 100644 index 00000000000..98ed493cbd7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr38948.c @@ -0,0 +1,101 @@ +/* { dg-options "-fno-tree-sra" } */ +/* { dg-options "-fno-tree-sra -march=v32" { target cris-*-* } } */ +typedef unsigned char byte; +typedef unsigned int uint; +typedef int bool; +typedef struct gs_const_string_s +{ + const byte *data; +} +gs_const_string; +struct gs_matrix_s +{ + float xx, xy, yx, yy, tx, ty; +}; +typedef struct gs_matrix_s gs_matrix; +typedef long fixed; +typedef struct gs_fixed_point_s +{ + fixed x, y; +} +gs_fixed_point; +typedef struct gs_matrix_fixed_s +{ + int x; +} +gs_matrix_fixed; +static int +append_simple (const byte * glyph, const gs_matrix_fixed * pmat, void * ppath) +{ + int numContours = + (int) (((((uint) ((glyph)[0]) << 8) + (glyph)[1]) ^ 0x8000) - 0x8000); + const byte *pends = glyph + 10; + int code = 0; + { + uint i = 0; + uint np = 0; + gs_fixed_point pt = {0}; + uint reps = 0; + for (i = 0, np = 0; i < numContours; ++i) + { + bool move = ((bool) 1); + uint last_point = + (((uint) ((pends + i * 2)[0]) << 8) + (pends + i * 2)[1]); + int off_curve = 0; + gs_fixed_point cpoints[3]; + for (; np <= last_point; --reps, ++np) + { + if (move) + { + cpoints[0] = pt; + move = ((bool) 0); + } + else + { + switch (off_curve++) + { + default: + cpoints[2].x = ((cpoints[1].x + pt.x) / 2); + cpoints[2].y = ((cpoints[1].y + pt.y) / 2); + code = + gx_path_add_curve_notes (ppath, + ((cpoints[0].x + + 2 * cpoints[1].x) / 3), + ((cpoints[0].y + + 2 * cpoints[1].y) / 3), + ((2 * cpoints[1].x + + cpoints[2].x) / 3), + ((2 * cpoints[1].y + + cpoints[2].y) / 3), + cpoints[2].x, cpoints[2].y, + 0); + cpoints[0] = cpoints[2]; + case 0: + cpoints[1] = pt; + } + } + } + } + } +} +int +append_outline (uint glyph_index, const gs_matrix_fixed *pmat, void *ppath) +{ + gs_const_string glyph_string = {0}; + int numContours = 0; + numContours = + (int) (((((uint) ((glyph_string.data)[0]) << 8) + + (glyph_string.data)[1]) ^ 0x8000) - 0x8000); + if (numContours >= 0) + return append_simple (glyph_string.data, pmat, ppath); + { + uint flags = 0; + do + { + gs_matrix_fixed mat = {0}; + gs_matrix scale_mat = {0}; + gs_matrix_multiply (&scale_mat, (const gs_matrix *) &mat, (gs_matrix *) & mat); + } + while (flags & 32); + } +} diff --git a/gcc/testsuite/gcc.dg/torture/pr41555.c b/gcc/testsuite/gcc.dg/torture/pr41555.c index 219b34275b7..c201fda0cea 100644 --- a/gcc/testsuite/gcc.dg/torture/pr41555.c +++ b/gcc/testsuite/gcc.dg/torture/pr41555.c @@ -1,4 +1,5 @@ /* { dg-do run } */ +/* { dg-options "-std=c99" } */ #include <stdint.h> #include <limits.h> diff --git a/gcc/testsuite/gcc.dg/tree-ssa/inline-3.c b/gcc/testsuite/gcc.dg/tree-ssa/inline-3.c index 13e27c307a4..511cc9e2562 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/inline-3.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/inline-3.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fdump-tree-einline2" } */ -/* { dg-options "-O2 -fdump-tree-einline2 -fpie" { target { ! nonpic } } } */ +/* { dg-add-options bind_pic_locally } */ + extern void inlined (); void inline_me_too (void); void inline_through_me (void (*ptr)(void)); diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ipa-cp-1.c b/gcc/testsuite/gcc.dg/tree-ssa/ipa-cp-1.c index 5f126363124..b9c67a62609 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ipa-cp-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ipa-cp-1.c @@ -1,5 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-O3 -fdump-tree-optimized -fno-inline" } */ +/* { dg-add-options bind_pic_locally } */ + int very_long_function(int a) { diff --git a/gcc/testsuite/gcc.dg/tree-ssa/local-pure-const.c b/gcc/testsuite/gcc.dg/tree-ssa/local-pure-const.c index 065d212cb5f..afb7ca4b0df 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/local-pure-const.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/local-pure-const.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-O1 -fdump-tree-local-pure-const1" } */ -/* { dg-options "-O1 -fdump-tree-local-pure-const1 -fpie" { target { ! nonpic } } } */ +/* { dg-add-options bind_pic_locally } */ + t(int a, int b, int c) { int *p; diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr41497.c b/gcc/testsuite/gcc.dg/tree-ssa/pr41497.c new file mode 100644 index 00000000000..e66ee846491 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr41497.c @@ -0,0 +1,27 @@ +/* { dg-do run } */ +/* { dg-options "-Os" } */ + +extern void abort (void); + +unsigned int a; +int b, c; + +void +foo (void) +{ + b = 0; + do { + for (a = -13; a == 0; a = (unsigned short)a) + c = 1; + b++; + } while (b == 0); +} + +int +main () +{ + foo (); + if (a != -13) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-26.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-26.c new file mode 100644 index 00000000000..978b7abab3a --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-26.c @@ -0,0 +1,27 @@ +/* { dg-do compile } */ +/* { dg-options "-Os -fdump-tree-pre-details" } */ + +typedef union +{ + int* data; +} SA; + +typedef struct +{ + int reserved; + char* array; +}SB; + +typedef struct +{ + int status; +}SC; + +void foo(SA* pResult, SB* method, SC* self) +{ + if (method->array[0] == 'L' && !self->status && pResult->data != 0) + pResult->data = pResult->data; +} + +/* { dg-final { scan-tree-dump "Deleted redundant store" "pre" } } */ +/* { dg-final { cleanup-tree-dump "pre" } } */ diff --git a/gcc/testsuite/gcc.dg/utf-badconcat2.c b/gcc/testsuite/gcc.dg/utf-badconcat2.c new file mode 100644 index 00000000000..ea71a7f6857 --- /dev/null +++ b/gcc/testsuite/gcc.dg/utf-badconcat2.c @@ -0,0 +1,15 @@ +/* Test unsupported concatenation of UTF-8 string literals. */ +/* { dg-do compile } */ +/* { dg-options "-std=gnu99" } */ + +void *s0 = u8"a" "b"; +void *s1 = "a" u8"b"; +void *s2 = u8"a" u8"b"; +void *s3 = u8"a" u"b"; /* { dg-error "non-standard concatenation" } */ +void *s4 = u"a" u8"b"; /* { dg-error "non-standard concatenation" } */ +void *s5 = u8"a" U"b"; /* { dg-error "non-standard concatenation" } */ +void *s6 = U"a" u8"b"; /* { dg-error "non-standard concatenation" } */ +void *s7 = u8"a" L"b"; /* { dg-error "non-standard concatenation" } */ +void *s8 = L"a" u8"b"; /* { dg-error "non-standard concatenation" } */ + +int main () {} diff --git a/gcc/testsuite/gcc.dg/utf-dflt2.c b/gcc/testsuite/gcc.dg/utf-dflt2.c new file mode 100644 index 00000000000..ab101f45b78 --- /dev/null +++ b/gcc/testsuite/gcc.dg/utf-dflt2.c @@ -0,0 +1,12 @@ +/* If not gnu99, the u8 prefix should be parsed as separate tokens. */ +/* { dg-do compile } */ +/* { dg-options "" } */ + +const void *s0 = u8"a"; /* { dg-error "undeclared" } */ + /* { dg-error "expected ',' or ';'" "" { target *-*-* } 5 } */ + +#define u8 "a" + +const void *s1 = u8"a"; + +int main () {} diff --git a/gcc/testsuite/gcc.dg/utf8-1.c b/gcc/testsuite/gcc.dg/utf8-1.c new file mode 100644 index 00000000000..e287e065688 --- /dev/null +++ b/gcc/testsuite/gcc.dg/utf8-1.c @@ -0,0 +1,45 @@ +/* { dg-do run } */ +/* { dg-require-iconv "ISO-8859-2" } */ +/* { dg-options "-std=gnu99 -fexec-charset=ISO-8859-2" } */ + +const char *str1 = "h\u00e1\U0000010Dky "; +const char *str2 = "\u010d\u00E1rky\n"; +const char *str3 = u8"h\u00e1\U0000010Dky "; +const char *str4 = u8"\u010d\u00E1rky\n"; +const char *str5 = "h\u00e1\U0000010Dky " "\u010d\u00E1rky\n"; +const char *str6 = u8"h\u00e1\U0000010Dky " "\u010d\u00E1rky\n"; +const char *str7 = "h\u00e1\U0000010Dky " u8"\u010d\u00E1rky\n"; +#define u8 +const char *str8 = u8"h\u00e1\U0000010Dky " u8"\u010d\u00E1rky\n"; + +const char latin2_1[] = "\x68\xe1\xe8\x6b\x79\x20"; +const char latin2_2[] = "\xe8\xe1\x72\x6b\x79\n"; +const char utf8_1[] = "\x68\xc3\xa1\xc4\x8d\x6b\x79\x20"; +const char utf8_2[] = "\xc4\x8d\xc3\xa1\x72\x6b\x79\n"; + +int +main (void) +{ + if (__builtin_strcmp (str1, latin2_1) != 0 + || __builtin_strcmp (str2, latin2_2) != 0 + || __builtin_strcmp (str3, utf8_1) != 0 + || __builtin_strcmp (str4, utf8_2) != 0 + || __builtin_strncmp (str5, latin2_1, sizeof (latin2_1) - 1) != 0 + || __builtin_strcmp (str5 + sizeof (latin2_1) - 1, latin2_2) != 0 + || __builtin_strncmp (str6, utf8_1, sizeof (utf8_1) - 1) != 0 + || __builtin_strcmp (str6 + sizeof (utf8_1) - 1, utf8_2) != 0 + || __builtin_strncmp (str7, utf8_1, sizeof (utf8_1) - 1) != 0 + || __builtin_strcmp (str7 + sizeof (utf8_1) - 1, utf8_2) != 0 + || __builtin_strncmp (str8, utf8_1, sizeof (utf8_1) - 1) != 0 + || __builtin_strcmp (str8 + sizeof (utf8_1) - 1, utf8_2) != 0) + __builtin_abort (); + if (sizeof ("a" u8"b"[0]) != 1 + || sizeof (u8"a" "b"[0]) != 1 + || sizeof (u8"a" u8"b"[0]) != 1 + || sizeof ("a" "\u010d") != 3 + || sizeof ("a" u8"\u010d") != 4 + || sizeof (u8"a" "\u010d") != 4 + || sizeof (u8"a" "\u010d") != 4) + __builtin_abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/utf8-2.c b/gcc/testsuite/gcc.dg/utf8-2.c new file mode 100644 index 00000000000..9c0442fde3f --- /dev/null +++ b/gcc/testsuite/gcc.dg/utf8-2.c @@ -0,0 +1,26 @@ +/* { dg-do compile } */ +/* { dg-options "-std=gnu99" } */ + +#include <wchar.h> + +typedef __CHAR16_TYPE__ char16_t; +typedef __CHAR32_TYPE__ char32_t; + +const char s0[] = u8"ab"; +const char16_t s1[] = u8"ab"; /* { dg-error "from non-wide" } */ +const char32_t s2[] = u8"ab"; /* { dg-error "from non-wide" } */ +const wchar_t s3[] = u8"ab"; /* { dg-error "from non-wide" } */ + +const char t0[0] = u8"ab"; /* { dg-warning "chars is too long" } */ +const char t1[1] = u8"ab"; /* { dg-warning "chars is too long" } */ +const char t2[2] = u8"ab"; +const char t3[3] = u8"ab"; +const char t4[4] = u8"ab"; + +const char u0[0] = u8"\u2160."; /* { dg-warning "chars is too long" } */ +const char u1[1] = u8"\u2160."; /* { dg-warning "chars is too long" } */ +const char u2[2] = u8"\u2160."; /* { dg-warning "chars is too long" } */ +const char u3[3] = u8"\u2160."; /* { dg-warning "chars is too long" } */ +const char u4[4] = u8"\u2160."; +const char u5[5] = u8"\u2160."; +const char u6[6] = u8"\u2160."; diff --git a/gcc/testsuite/gcc.target/arm/neon-thumb2-move.c b/gcc/testsuite/gcc.target/arm/neon-thumb2-move.c new file mode 100644 index 00000000000..88228513130 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/neon-thumb2-move.c @@ -0,0 +1,98 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_neon_ok } */ +/* { dg-options "-O2 -mthumb -march=armv7-a -mfloat-abi=softfp -mfpu=neon" } */ + +#include <arm_neon.h> +#include <stddef.h> + +void * +memset (DST, C, LENGTH) + void *DST; + int C; + size_t LENGTH; +{ + void* DST0 = DST; + unsigned char C_BYTE = C; + + + if (__builtin_expect(LENGTH < 4, 1)) { + size_t i = 0; + while (i < LENGTH) { + ((char*)DST)[i] = C_BYTE; + i++; + } + return DST; + } + + const char* DST_end = (char*)DST + LENGTH; + + + while ((uintptr_t)DST % 4 != 0) { + *(char*) (DST++) = C_BYTE; + } + + + uint32_t C_SHORTWORD = (uint32_t)(unsigned char)(C_BYTE) * 0x01010101; + + + if (__builtin_expect(DST_end - (char*)DST >= 16, 0)) { + while ((uintptr_t)DST % 16 != 0) { + *((uint32_t*)((char*)(DST) + (0))) = C_SHORTWORD; + DST += 4; + } + + + uint8x16_t C_WORD = vdupq_n_u8(C_BYTE); + + + + + + size_t i = 0; + LENGTH = DST_end - (char*)DST; + while (i + 16 * 16 <= LENGTH) { + *((uint8x16_t*)((char*)(DST) + (i))) = C_WORD; + *((uint8x16_t*)((char*)(DST) + (i + 16 * 1))) = C_WORD; + *((uint8x16_t*)((char*)(DST) + (i + 16 * 2))) = C_WORD; + *((uint8x16_t*)((char*)(DST) + (i + 16 * 3))) = C_WORD; + *((uint8x16_t*)((char*)(DST) + (i + 16 * 4))) = C_WORD; + *((uint8x16_t*)((char*)(DST) + (i + 16 * 5))) = C_WORD; + *((uint8x16_t*)((char*)(DST) + (i + 16 * 6))) = C_WORD; + *((uint8x16_t*)((char*)(DST) + (i + 16 * 7))) = C_WORD; + *((uint8x16_t*)((char*)(DST) + (i + 16 * 8))) = C_WORD; + *((uint8x16_t*)((char*)(DST) + (i + 16 * 9))) = C_WORD; + *((uint8x16_t*)((char*)(DST) + (i + 16 * 10))) = C_WORD; + *((uint8x16_t*)((char*)(DST) + (i + 16 * 11))) = C_WORD; + *((uint8x16_t*)((char*)(DST) + (i + 16 * 12))) = C_WORD; + *((uint8x16_t*)((char*)(DST) + (i + 16 * 13))) = C_WORD; + *((uint8x16_t*)((char*)(DST) + (i + 16 * 14))) = C_WORD; + *((uint8x16_t*)((char*)(DST) + (i + 16 * 15))) = C_WORD; + i += 16 * 16; + } + while (i + 16 * 4 <= LENGTH) { + *((uint8x16_t*)((char*)(DST) + (i))) = C_WORD; + *((uint8x16_t*)((char*)(DST) + (i + 16 * 1))) = C_WORD; + *((uint8x16_t*)((char*)(DST) + (i + 16 * 2))) = C_WORD; + *((uint8x16_t*)((char*)(DST) + (i + 16 * 3))) = C_WORD; + i += 16 * 4; + } + while (i + 16 <= LENGTH) { + *((uint8x16_t*)((char*)(DST) + (i))) = C_WORD; + i += 16; + } + DST += i; + } + + while (4 <= DST_end - (char*)DST) { + *((uint32_t*)((char*)(DST) + (0))) = C_SHORTWORD; + DST += 4; + } + + + while ((char*)DST < DST_end) { + *((char*)DST) = C_BYTE; + DST++; + } + + return DST0; +} diff --git a/gcc/testsuite/gcc.target/arm/neon/vfp-shift-a2t2.c b/gcc/testsuite/gcc.target/arm/neon/vfp-shift-a2t2.c new file mode 100644 index 00000000000..2541df84169 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/neon/vfp-shift-a2t2.c @@ -0,0 +1,27 @@ +/* Check that NEON vector shifts support immediate values == size. /* + +/* { dg-do compile } */ +/* { dg-require-effective-target arm_neon_ok } */ +/* { dg-options "-save-temps -mfpu=neon -mfloat-abi=softfp" } */ + +#include <arm_neon.h> + +uint16x8_t test_vshll_n_u8 (uint8x8_t a) +{ + return vshll_n_u8(a, 8); +} + +uint32x4_t test_vshll_n_u16 (uint16x4_t a) +{ + return vshll_n_u16(a, 16); +} + +uint64x2_t test_vshll_n_u32 (uint32x2_t a) +{ + return vshll_n_u32(a, 32); +} + +/* { dg-final { scan-assembler "vshll\.u16\[ \]+\[qQ\]\[0-9\]+, \[dD\]\[0-9\]+, #\[0-9\]+!?\(\[ \]+@\[a-zA-Z0-9 \]+\)?\n" } } */ +/* { dg-final { scan-assembler "vshll\.u32\[ \]+\[qQ\]\[0-9\]+, \[dD\]\[0-9\]+, #\[0-9\]+!?\(\[ \]+@\[a-zA-Z0-9 \]+\)?\n" } } */ +/* { dg-final { scan-assembler "vshll\.u8\[ \]+\[qQ\]\[0-9\]+, \[dD\]\[0-9\]+, #\[0-9\]+!?\(\[ \]+@\[a-zA-Z0-9 \]+\)?\n" } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc/testsuite/gcc.target/i386/i386.exp b/gcc/testsuite/gcc.target/i386/i386.exp index c7c6e12d1f4..3bfac8d6f71 100644 --- a/gcc/testsuite/gcc.target/i386/i386.exp +++ b/gcc/testsuite/gcc.target/i386/i386.exp @@ -24,6 +24,18 @@ if { ![istarget i?86*-*-*] && ![istarget x86_64-*-*] } then { # Load support procs. load_lib gcc-dg.exp +# Return 1 if attribute ms_hook_prologue is supported. +proc check_effective_target_ms_hook_prologue { } { + if { [check_effective_target_ilp32] + && [check_no_compiler_messages ms_hook_prologue object { + void __attribute__ ((__ms_hook_prologue__)) foo (); + } ""] } { + return 1 + } else { + return 0 + } +} + # Return 1 if ssse3 instructions can be compiled. proc check_effective_target_ssse3 { } { return [check_no_compiler_messages ssse3 object { diff --git a/gcc/testsuite/gcc.target/i386/ms_hook_prologue.c b/gcc/testsuite/gcc.target/i386/ms_hook_prologue.c new file mode 100644 index 00000000000..f945492dfde --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/ms_hook_prologue.c @@ -0,0 +1,29 @@ +/* Test that the ms_hook_prologue attribute generates the correct code. */ + +/* { dg-do run } */ +/* { dg-require-effective-target ms_hook_prologue } */ +/* { dg-options "-O2 -fomit-frame-pointer" } */ + +int __attribute__ ((__ms_hook_prologue__)) foo () +{ + unsigned char *ptr = (unsigned char *) foo; + + /* The NOP mov must not be optimized away by optimizations. + The push %ebp, mov %esp, %ebp must not be removed by + -fomit-frame-pointer */ + + /* movl.s %edi, %edi */ + if(*ptr++ != 0x8b) return 1; + if(*ptr++ != 0xff) return 1; + /* push %ebp */ + if(*ptr++ != 0x55) return 1; + /* movl.s %esp, %ebp */ + if(*ptr++ != 0x8b) return 1; + if(*ptr++ != 0xec) return 1; + return 0; +} + +int main () +{ + return foo(); +} diff --git a/gcc/testsuite/gcc.target/i386/pic-1.c b/gcc/testsuite/gcc.target/i386/pic-1.c index bc11de90b41..bdf6267c7d8 100644 --- a/gcc/testsuite/gcc.target/i386/pic-1.c +++ b/gcc/testsuite/gcc.target/i386/pic-1.c @@ -2,6 +2,7 @@ /* { dg-do compile } */ /* { dg-require-effective-target ilp32 } */ /* { dg-require-effective-target fpic } */ +/* { dg-skip-if "No Windows PIC" { *-*-mingw* *-*-cygwin } { "*" } { "" } } */ /* { dg-options "-fPIC" } */ int foo () diff --git a/gcc/testsuite/gcc.target/powerpc/altivec-4.c b/gcc/testsuite/gcc.target/powerpc/altivec-4.c index a5617e25b8a..2c78f6586d6 100644 --- a/gcc/testsuite/gcc.target/powerpc/altivec-4.c +++ b/gcc/testsuite/gcc.target/powerpc/altivec-4.c @@ -4,7 +4,7 @@ #define vector __attribute__((vector_size(16))) -static int vector x, y; +static int vector x, y, z; static vector signed int i,j; static vector signed short s,t; @@ -20,7 +20,7 @@ static int int1, int2; void b() { - __builtin_altivec_vadduwm (x, y); + z = __builtin_altivec_vadduwm (x, y); /* Make sure the predicates accept correct argument types. */ diff --git a/gcc/testsuite/gcc.target/vsx-vectorize-1.c b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-1.c index 2538ad987d2..2538ad987d2 100644 --- a/gcc/testsuite/gcc.target/vsx-vectorize-1.c +++ b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-1.c diff --git a/gcc/testsuite/gcc.target/vsx-vectorize-2.c b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-2.c index e558f413c92..e558f413c92 100644 --- a/gcc/testsuite/gcc.target/vsx-vectorize-2.c +++ b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-2.c diff --git a/gcc/testsuite/gcc.target/vsx-vectorize-3.c b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-3.c index b99bcca49f4..b99bcca49f4 100644 --- a/gcc/testsuite/gcc.target/vsx-vectorize-3.c +++ b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-3.c diff --git a/gcc/testsuite/gcc.target/vsx-vectorize-4.c b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-4.c index a3bd7e69674..a3bd7e69674 100644 --- a/gcc/testsuite/gcc.target/vsx-vectorize-4.c +++ b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-4.c diff --git a/gcc/testsuite/gcc.target/vsx-vectorize-5.c b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-5.c index 32d05b29829..32d05b29829 100644 --- a/gcc/testsuite/gcc.target/vsx-vectorize-5.c +++ b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-5.c diff --git a/gcc/testsuite/gcc.target/vsx-vectorize-6.c b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-6.c index c46c8a74711..c46c8a74711 100644 --- a/gcc/testsuite/gcc.target/vsx-vectorize-6.c +++ b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-6.c diff --git a/gcc/testsuite/gcc.target/vsx-vectorize-7.c b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-7.c index 3c57f937fc0..3c57f937fc0 100644 --- a/gcc/testsuite/gcc.target/vsx-vectorize-7.c +++ b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-7.c diff --git a/gcc/testsuite/gcc.target/vsx-vectorize-8.c b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-8.c index af671ee79cb..af671ee79cb 100644 --- a/gcc/testsuite/gcc.target/vsx-vectorize-8.c +++ b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-8.c diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-vrsave.c b/gcc/testsuite/gcc.target/powerpc/vsx-vrsave.c new file mode 100644 index 00000000000..83125f67fcc --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/vsx-vrsave.c @@ -0,0 +1,20 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-O2 -mcpu=power7" } */ +/* { dg-final { scan-assembler-times "mtvrsave" 2 } } */ + +/* Check whether VRSAVE is set to non-zero if VSX vector operations were + used, but it should not be set if there are no vector operations. */ + +void +generates_vrsave (vector double *a, vector double *b, vector double *c) +{ + *a = *b + *c; +} + +void +no_vrsave (double *a, double *b, double *c) +{ + *a = *b + *c; +} diff --git a/gcc/testsuite/gfortran.dg/auto_dealloc_1.f90 b/gcc/testsuite/gfortran.dg/auto_dealloc_1.f90 new file mode 100644 index 00000000000..176f87a3d34 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/auto_dealloc_1.f90 @@ -0,0 +1,59 @@ +! { dg-do compile } +! { dg-options "-fdump-tree-original" } +! +! PR 41586: Allocatable _scalars_ are never auto-deallocated +! +! Contributed by Tobias Burnus <burnus@gcc.gnu.org> + +module automatic_deallocation + + type t0 + integer :: i + end type + + type t1 + real :: pi = 3.14 + integer, allocatable :: j + end type + + type t2 + class(t0), allocatable :: k + end type t2 + +contains + + ! (1) simple allocatable scalars + subroutine a + integer, allocatable :: m + allocate (m) + m = 42 + end subroutine + + ! (2) allocatable scalar CLASS variables + subroutine b + class(t0), allocatable :: m + allocate (t0 :: m) + m%i = 43 + end subroutine + + ! (3) allocatable scalar components + subroutine c + type(t1) :: m + allocate (m%j) + m%j = 44 + end subroutine + + ! (4) allocatable scalar CLASS components + subroutine d + type(t2) :: m + allocate (t0 :: m%k) + m%k%i = 45 + end subroutine + +end module + + +! { dg-final { scan-tree-dump-times "__builtin_free" 5 "original" } } + +! { dg-final { cleanup-modules "automatic_deallocation" } } +! { dg-final { cleanup-tree-dump "original" } } diff --git a/gcc/testsuite/gfortran.dg/class_10.f03 b/gcc/testsuite/gfortran.dg/class_10.f03 new file mode 100644 index 00000000000..f238a597a65 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/class_10.f03 @@ -0,0 +1,32 @@ +! { dg-do compile } +! +! PR 41800: [OOP] ICE in fold_convert_loc, at fold-const.c:2789 +! +! Contributed by Harald Anlauf <anlauf@gmx.de> + +module abstract_gradient + + implicit none + private + + type, public, abstract :: gradient_class + contains + procedure, nopass :: inner_product + end type + +contains + + function inner_product () + class(gradient_class), pointer :: inner_product + inner_product => NULL() + end function + +end module + + + use abstract_gradient + class(gradient_class), pointer :: g_initial, ip_save + ip_save => g_initial%inner_product() ! ICE +end + +! { dg-final { cleanup-modules "abstract_gradient" } } diff --git a/gcc/testsuite/gfortran.dg/class_5.f03 b/gcc/testsuite/gfortran.dg/class_5.f03 new file mode 100644 index 00000000000..087d745aec7 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/class_5.f03 @@ -0,0 +1,31 @@ +! { dg-do compile } +! +! PR 41719: [OOP] invalid: Intrinsic assignment involving polymorphic variables +! +! Contributed by Tobias Burnus <burnus@gcc.gnu.org> + + implicit none + + type t1 + integer :: a + end type + + type, extends(t1) :: t2 + integer :: b + end type + + class(t1),pointer :: cp + type(t2) :: x + + x = t2(45,478) + allocate(t2 :: cp) + + cp = x ! { dg-error "Variable must not be polymorphic" } + + select type (cp) + type is (t2) + print *, cp%a, cp%b + end select + +end +
\ No newline at end of file diff --git a/gcc/testsuite/gfortran.dg/class_6.f03 b/gcc/testsuite/gfortran.dg/class_6.f03 new file mode 100644 index 00000000000..2f3ff62a6fa --- /dev/null +++ b/gcc/testsuite/gfortran.dg/class_6.f03 @@ -0,0 +1,21 @@ +! { dg-do run } +! +! PR 41629: [OOP] gimplification error on valid code +! +! Contributed by Janus Weil <janus@gcc.gnu.org> + + type t1 + integer :: comp + end type + + type(t1), target :: a + + class(t1) :: x + pointer :: x ! This is valid + + a%comp = 3 + x => a + print *,x%comp + if (x%comp/=3) call abort() + +end diff --git a/gcc/testsuite/gfortran.dg/class_7.f03 b/gcc/testsuite/gfortran.dg/class_7.f03 new file mode 100644 index 00000000000..ed4eeba9340 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/class_7.f03 @@ -0,0 +1,21 @@ +! { dg-do compile } +! Test fixes for PR41587 and PR41608. +! +! Contributed by Tobias Burnus <burnus@gcc.gnu.org> +! +! PR41587: used to accept the declaration of component 'foo' + type t0 + integer :: j = 42 + end type t0 + type t + integer :: i + class(t0), allocatable :: foo(3) ! { dg-error "deferred shape" } + end type t + +! PR41608: Would ICE on missing type decl + class(t1), pointer :: c ! { dg-error "before it is defined" } + + select type (c) ! { dg-error "shall be polymorphic" } + type is (t1) ! { dg-error "Unexpected" } + end select ! { dg-error "Expecting END PROGRAM" } +end diff --git a/gcc/testsuite/gfortran.dg/class_8.f03 b/gcc/testsuite/gfortran.dg/class_8.f03 new file mode 100644 index 00000000000..78f10ebe2bd --- /dev/null +++ b/gcc/testsuite/gfortran.dg/class_8.f03 @@ -0,0 +1,16 @@ +! { dg-do compile } +! Test fixes for PR41618. +! +! Contributed by Janus Weil <janus@gcc.gnu.org> +! + type t1 + integer :: comp + class(t1),pointer :: cc + end type + + class(t1) :: x ! { dg-error "must be dummy, allocatable or pointer" } + + x%comp = 3 + print *,x%comp + +end diff --git a/gcc/testsuite/gfortran.dg/class_9.f03 b/gcc/testsuite/gfortran.dg/class_9.f03 new file mode 100644 index 00000000000..5dbd4597abd --- /dev/null +++ b/gcc/testsuite/gfortran.dg/class_9.f03 @@ -0,0 +1,68 @@ +! { dg-do run } +! Test the fix for PR41706, in which arguments of class methods that +! were themselves class methods did not work. +! +! Contributed by Janus Weil <janus@gcc.gnu.org> +! +module m +type :: t + real :: v = 1.5 +contains + procedure, nopass :: a + procedure, nopass :: b + procedure, pass :: c + procedure, nopass :: d +end type + +contains + + real function a (x) + real :: x + a = 2.*x + end function + + real function b (x) + real :: x + b = 3.*x + end function + + real function c (x) + class (t) :: x + c = 4.*x%v + end function + + subroutine d (x) + real :: x + if (abs(x-3.0)>1E-3) call abort() + end subroutine + + subroutine s (x) + class(t) :: x + real :: r + r = x%a (1.1) ! worked + if (r .ne. a (1.1)) call abort + + r = x%a (b (1.2)) ! worked + if (r .ne. a(b (1.2))) call abort + + r = b ( x%a (1.3)) ! worked + if (r .ne. b(a (1.3))) call abort + + r = x%a(x%b (1.4)) ! failed + if (r .ne. a(b (1.4))) call abort + + r = x%a(x%c ()) ! failed + if (r .ne. a(c (x))) call abort + + call x%d (x%a(1.5)) ! failed + + end subroutine + +end + + use m + class(t),allocatable :: x + allocate(x) + call s (x) +end +! { dg-final { cleanup-modules "m" } } diff --git a/gcc/testsuite/gfortran.dg/class_allocate_1.f03 b/gcc/testsuite/gfortran.dg/class_allocate_1.f03 index 719d90cf8f9..67c8065794b 100644 --- a/gcc/testsuite/gfortran.dg/class_allocate_1.f03 +++ b/gcc/testsuite/gfortran.dg/class_allocate_1.f03 @@ -68,8 +68,7 @@ i = 0 allocate(t2 :: cp2) -! FIXME: Not yet supported: source=<class> -! allocate(cp, source = cp2) + allocate(cp, source = cp2) allocate(t2 :: cp3) allocate(cp, source=cp3) select type (cp) diff --git a/gcc/testsuite/gfortran.dg/class_allocate_2.f03 b/gcc/testsuite/gfortran.dg/class_allocate_2.f03 index d6a5d78bd75..754faa9a9f4 100644 --- a/gcc/testsuite/gfortran.dg/class_allocate_2.f03 +++ b/gcc/testsuite/gfortran.dg/class_allocate_2.f03 @@ -7,7 +7,7 @@ type :: t end type t class(t), allocatable :: c,d allocate(t :: d) -allocate(c,source=d) ! { dg-error "not supported yet" } +allocate(c,source=d) end type, abstract :: t diff --git a/gcc/testsuite/gfortran.dg/class_allocate_3.f03 b/gcc/testsuite/gfortran.dg/class_allocate_3.f03 new file mode 100644 index 00000000000..c6128a8ab51 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/class_allocate_3.f03 @@ -0,0 +1,39 @@ +! { dg-do run } +! +! PR 41581: [OOP] Allocation of a CLASS with SOURCE=<class> does not work +! +! Contributed by Tobias Burnus <burnus@gcc.gnu.org> + + type t + end type t + + type,extends(t) :: t2 + integer :: i = 54 + real :: r = 384.02 + end type t2 + + class(t), allocatable :: m1, m2 + + allocate(t2 :: m2) + select type(m2) + type is (t2) + print *, m2%i, m2%r + if (m2%i/=54) call abort() + if (abs(m2%r-384.02)>1E-3) call abort() + m2%i = 42 + m2%r = -4.0 + class default + call abort() + end select + + allocate(m1, source=m2) + select type(m1) + type is (t2) + print *, m1%i, m1%r + if (m1%i/=42) call abort() + if (abs(m1%r+4.0)>1E-3) call abort() + class default + call abort() + end select + +end diff --git a/gcc/testsuite/gfortran.dg/complex_intrinsic_8.f90 b/gcc/testsuite/gfortran.dg/complex_intrinsic_8.f90 new file mode 100644 index 00000000000..f9529a52334 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/complex_intrinsic_8.f90 @@ -0,0 +1,50 @@ +! { dg-do link } +! { dg-require-effective-target mpc_arc } +! +! PR fortran/33197 +! +! Fortran complex trigonometric functions: acos, asin, atan, acosh, asinh, atanh +! +! Compile-time simplifications +! +implicit none +real(4), parameter :: pi = 2*acos(0.0_4) +real(8), parameter :: pi8 = 2*acos(0.0_8) +real(4), parameter :: eps = 10*epsilon(0.0_4) +real(8), parameter :: eps8 = 10*epsilon(0.0_8) +complex(4), parameter :: z0_0 = cmplx(0.0_4, 0.0_4, kind=4) +complex(4), parameter :: z1_1 = cmplx(1.0_4, 1.0_4, kind=4) +complex(8), parameter :: z80_0 = cmplx(0.0_8, 0.0_8, kind=8) +complex(8), parameter :: z81_1 = cmplx(1.0_8, 1.0_8, kind=8) + +if (abs(acos(z0_0) - cmplx(pi/2,-0.0,4)) > eps) call link_error() +if (abs(acos(z1_1) - cmplx(0.904556894, -1.06127506,4)) > eps) call link_error() +if (abs(acos(z80_0) - cmplx(pi8/2,-0.0_8,8)) > eps8) call link_error() +if (abs(acos(z81_1) - cmplx(0.90455689430238140_8, -1.0612750619050357_8,8)) > eps8) call link_error() + +if (abs(asin(z0_0) - cmplx(0.0,0.0,4)) > eps) call link_error() +if (abs(asin(z1_1) - cmplx(0.66623943, 1.06127506,4)) > eps) call link_error() +if (abs(asin(z80_0) - cmplx(0.0_8,0.0_8,8)) > eps8) call link_error() +if (abs(asin(z81_1) - cmplx(0.66623943249251527_8, 1.0612750619050357_8,8)) > eps8) call link_error() + +if (abs(atan(z0_0) - cmplx(0.0,0.0,4)) > eps) call link_error() +if (abs(atan(z1_1) - cmplx(1.01722196, 0.40235947,4)) > eps) call link_error() +if (abs(atan(z80_0) - cmplx(0.0_8,0.0_8,8)) > eps8) call link_error() +if (abs(atan(z81_1) - cmplx(1.0172219678978514_8, 0.40235947810852507_8,8)) > eps8) call link_error() + +if (abs(acosh(z0_0) - cmplx(0.0,pi/2,4)) > eps) call link_error() +if (abs(acosh(z1_1) - cmplx(1.06127506, 0.90455689,4)) > eps) call link_error() +if (abs(acosh(z80_0) - cmplx(0.0_8,pi8/2,8)) > eps8) call link_error() +if (abs(acosh(z81_1) - cmplx(1.0612750619050357_8, 0.90455689430238140_8,8)) > eps8) call link_error() + +if (abs(asinh(z0_0) - cmplx(0.0,0.0,4)) > eps) call link_error() +if (abs(asinh(z1_1) - cmplx(1.06127506, 0.66623943,4)) > eps) call link_error() +if (abs(asinh(z80_0) - cmplx(0.0_8,0.0_8,8)) > eps8) call link_error() +if (abs(asinh(z81_1) - cmplx(1.0612750619050357_8, 0.66623943249251527_8,8)) > eps8) call link_error() + +if (abs(atanh(z0_0) - cmplx(0.0,0.0,4)) > eps) call link_error() +if (abs(atanh(z1_1) - cmplx(0.40235947, 1.01722196,4)) > eps) call link_error() +if (abs(atanh(z80_0) - cmplx(0.0_8,0.0_8,8)) > eps8) call link_error() +if (abs(atanh(z81_1) - cmplx(0.40235947810852507_8, 1.0172219678978514_8,8)) > eps8) call link_error() + +end diff --git a/gcc/testsuite/gfortran.dg/dynamic_dispatch_4.f03 b/gcc/testsuite/gfortran.dg/dynamic_dispatch_4.f03 new file mode 100644 index 00000000000..b72819acc4c --- /dev/null +++ b/gcc/testsuite/gfortran.dg/dynamic_dispatch_4.f03 @@ -0,0 +1,96 @@ +! { dg-do run } +! Tests the fix for PR41648 in which the reference a%a%getit () was wrongly +! identified as a recursive call to getit. +! +! Contributed by Salvatore Filippone <sfilippone@uniroma2.it> +! +module foo_mod + type foo + integer :: i + contains + procedure, pass(a) :: doit + procedure, pass(a) :: getit + end type foo + + private doit,getit +contains + subroutine doit(a) + class(foo) :: a + + a%i = 1 + end subroutine doit + function getit(a) result(res) + class(foo) :: a + integer :: res + + res = a%i + end function getit + +end module foo_mod + +module s_bar_mod + use foo_mod + type, extends(foo) :: s_bar + type(foo), allocatable :: a + contains + procedure, pass(a) :: doit + procedure, pass(a) :: getit + end type s_bar + private doit,getit + +contains + subroutine doit(a) + class(s_bar) :: a + allocate (a%a) + call a%a%doit() + end subroutine doit + function getit(a) result(res) + class(s_bar) :: a + integer :: res + + res = a%a%getit () * 2 + end function getit +end module s_bar_mod + +module a_bar_mod + use foo_mod + type, extends(foo) :: a_bar + type(foo), allocatable :: a(:) + contains + procedure, pass(a) :: doit + procedure, pass(a) :: getit + end type a_bar + private doit,getit + +contains + subroutine doit(a) + class(a_bar) :: a + allocate (a%a(1)) + call a%a(1)%doit () + end subroutine doit + function getit(a) result(res) + class(a_bar) :: a + integer :: res + + res = a%a(1)%getit () * 3 + end function getit +end module a_bar_mod + + use s_bar_mod + use a_bar_mod + type(foo), target :: b + type(s_bar), target :: c + type(a_bar), target :: d + class(foo), pointer :: a + a => b + call a%doit + if (a%getit () .ne. 1) call abort + a => c + call a%doit + if (a%getit () .ne. 2) call abort + a => d + call a%doit + if (a%getit () .ne. 3) call abort +end +! { dg-final { cleanup-modules "foo_mod s_bar_mod a_bar_mod" } } + diff --git a/gcc/testsuite/gfortran.dg/dynamic_dispatch_5.f03 b/gcc/testsuite/gfortran.dg/dynamic_dispatch_5.f03 new file mode 100644 index 00000000000..8533508bcdc --- /dev/null +++ b/gcc/testsuite/gfortran.dg/dynamic_dispatch_5.f03 @@ -0,0 +1,185 @@ +! { dg-do compile } +! Tests the fix for PR4164656 in which the call to a%a%scal failed to compile. +! +! Contributed by Salvatore Filippone <sfilippone@uniroma2.it> +! +module const_mod + integer, parameter :: longndig=12 + integer, parameter :: long_int_k_ = selected_int_kind(longndig) + integer, parameter :: dpk_ = kind(1.d0) + integer, parameter :: spk_ = kind(1.e0) +end module const_mod + +module base_mat_mod + use const_mod + type :: base_sparse_mat + integer, private :: m, n + integer, private :: state, duplicate + logical, private :: triangle, unitd, upper, sorted + contains + procedure, pass(a) :: get_nzeros + end type base_sparse_mat + private :: get_nzeros +contains + function get_nzeros(a) result(res) + implicit none + class(base_sparse_mat), intent(in) :: a + integer :: res + integer :: err_act + character(len=20) :: name='base_get_nzeros' + logical, parameter :: debug=.false. + res = -1 + end function get_nzeros +end module base_mat_mod + +module s_base_mat_mod + use base_mat_mod + type, extends(base_sparse_mat) :: s_base_sparse_mat + contains + procedure, pass(a) :: s_scals + procedure, pass(a) :: s_scal + generic, public :: scal => s_scals, s_scal + end type s_base_sparse_mat + private :: s_scals, s_scal + + type, extends(s_base_sparse_mat) :: s_coo_sparse_mat + + integer :: nnz + integer, allocatable :: ia(:), ja(:) + real(spk_), allocatable :: val(:) + contains + procedure, pass(a) :: get_nzeros => s_coo_get_nzeros + procedure, pass(a) :: s_scals => s_coo_scals + procedure, pass(a) :: s_scal => s_coo_scal + end type s_coo_sparse_mat + private :: s_coo_scals, s_coo_scal, s_coo_get_nzeros +contains + subroutine s_scals(d,a,info) + implicit none + class(s_base_sparse_mat), intent(in) :: a + real(spk_), intent(in) :: d + integer, intent(out) :: info + + Integer :: err_act + character(len=20) :: name='s_scals' + logical, parameter :: debug=.false. + + ! This is the base version. If we get here + ! it means the derived class is incomplete, + ! so we throw an error. + info = 700 + end subroutine s_scals + + + subroutine s_scal(d,a,info) + implicit none + class(s_base_sparse_mat), intent(in) :: a + real(spk_), intent(in) :: d(:) + integer, intent(out) :: info + + Integer :: err_act + character(len=20) :: name='s_scal' + logical, parameter :: debug=.false. + + ! This is the base version. If we get here + ! it means the derived class is incomplete, + ! so we throw an error. + info = 700 + end subroutine s_scal + + function s_coo_get_nzeros(a) result(res) + implicit none + class(s_coo_sparse_mat), intent(in) :: a + integer :: res + res = a%nnz + end function s_coo_get_nzeros + + + subroutine s_coo_scal(d,a,info) + use const_mod + implicit none + class(s_coo_sparse_mat), intent(inout) :: a + real(spk_), intent(in) :: d(:) + integer, intent(out) :: info + + Integer :: err_act,mnm, i, j, m + character(len=20) :: name='scal' + logical, parameter :: debug=.false. + info = 0 + do i=1,a%get_nzeros() + j = a%ia(i) + a%val(i) = a%val(i) * d(j) + enddo + end subroutine s_coo_scal + + subroutine s_coo_scals(d,a,info) + use const_mod + implicit none + class(s_coo_sparse_mat), intent(inout) :: a + real(spk_), intent(in) :: d + integer, intent(out) :: info + + Integer :: err_act,mnm, i, j, m + character(len=20) :: name='scal' + logical, parameter :: debug=.false. + + info = 0 + do i=1,a%get_nzeros() + a%val(i) = a%val(i) * d + enddo + end subroutine s_coo_scals +end module s_base_mat_mod + +module s_mat_mod + use s_base_mat_mod + type :: s_sparse_mat + class(s_base_sparse_mat), pointer :: a + contains + procedure, pass(a) :: s_scals + procedure, pass(a) :: s_scal + generic, public :: scal => s_scals, s_scal + end type s_sparse_mat + interface scal + module procedure s_scals, s_scal + end interface +contains + subroutine s_scal(d,a,info) + use const_mod + implicit none + class(s_sparse_mat), intent(inout) :: a + real(spk_), intent(in) :: d(:) + integer, intent(out) :: info + integer :: err_act + character(len=20) :: name='csnmi' + logical, parameter :: debug=.false. + print *, "s_scal" + call a%a%scal(d,info) + return + end subroutine s_scal + + subroutine s_scals(d,a,info) + use const_mod + implicit none + class(s_sparse_mat), intent(inout) :: a + real(spk_), intent(in) :: d + integer, intent(out) :: info + integer :: err_act + character(len=20) :: name='csnmi' + logical, parameter :: debug=.false. + print *, "s_scals" + call a%a%scal(d,info) + return + end subroutine s_scals +end module s_mat_mod + + use s_mat_mod + class (s_sparse_mat), pointer :: a + type (s_sparse_mat), target :: b + type (s_base_sparse_mat), target :: c + integer info + b%a => c + a => b + call a%scal (1.0_spk_, info) +end +! { dg-final { cleanup-modules "const_mod base_mat_mod s_base_mat_mod s_mat_mod" } } + diff --git a/gcc/testsuite/gfortran.dg/equiv_8.f90 b/gcc/testsuite/gfortran.dg/equiv_8.f90 new file mode 100644 index 00000000000..a2ed7f0349e --- /dev/null +++ b/gcc/testsuite/gfortran.dg/equiv_8.f90 @@ -0,0 +1,7 @@ +! { dg-do compile } +! +! PR fortran/41755 +! + common /uno/ aa + equivalence (aa,aaaaa) (bb,cc) ! { dg-error "Expecting a comma in EQUIVALENCE" } + end diff --git a/gcc/testsuite/gfortran.dg/fmt_error_9.f b/gcc/testsuite/gfortran.dg/fmt_error_9.f index 0f2b63b6d32..d8abb851210 100644 --- a/gcc/testsuite/gfortran.dg/fmt_error_9.f +++ b/gcc/testsuite/gfortran.dg/fmt_error_9.f @@ -22,4 +22,8 @@ write (line,'(1pd24.15e11.3)') 1.0d0, 1.234 if (line.ne." 1.000000000000000D+00 1.234E+00") call abort + str = '(1p2d24.15)' + msg = " 1.000000000000000D+00 1.233999967575073D+00That's it!" + write (line,'(1p2d24.15a)') 1.0d0, 1.234, "That's it!" + if (line.ne.msg) print *, msg end diff --git a/gcc/testsuite/gfortran.dg/goto_8.f90 b/gcc/testsuite/gfortran.dg/goto_8.f90 new file mode 100644 index 00000000000..a5f1f7f07b9 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/goto_8.f90 @@ -0,0 +1,31 @@ +! { dg-do compile } +! +! PR 41781: [OOP] bogus undefined label error with SELECT TYPE. +! +! Contributed by Salvatore Filippone <sfilippone@uniroma2.it> +! and Tobias Burnus >burnus@gcc.gnu.org> + +! 1st example: jumping out of SELECT TYPE (valid) +type bar + integer :: i +end type bar +class(bar), pointer :: var +select type(var) +class default + goto 9999 +end select +9999 continue + +! 2nd example: jumping out of BLOCK (valid) +block + goto 88 +end block +88 continue + +! 3rd example: jumping into BLOCK (invalid) +goto 99 ! { dg-error "is not in the same block" } +block + 99 continue ! { dg-error "is not in the same block" } +end block + +end diff --git a/gcc/testsuite/gfortran.dg/lto/20091015-1_0.f b/gcc/testsuite/gfortran.dg/lto/20091015-1_0.f new file mode 100644 index 00000000000..f47e1a4ac6c --- /dev/null +++ b/gcc/testsuite/gfortran.dg/lto/20091015-1_0.f @@ -0,0 +1,8 @@ +! { dg-lto-do link } +! We expect some warnings about mismatched symbol types +! { dg-extra-ld-options "-w" } + + subroutine dalie6s(iqmod6,nz,wx,cor6d) + common/dascr/iscrda(100),rscrri(100),iscrri(100),idao + call daall(iscrda,100,'$$IS ',no,nv) + end diff --git a/gcc/testsuite/gfortran.dg/lto/20091015-1_1.f b/gcc/testsuite/gfortran.dg/lto/20091015-1_1.f new file mode 100644 index 00000000000..7a64ffa6786 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/lto/20091015-1_1.f @@ -0,0 +1,4 @@ + SUBROUTINE DAALL(IC,L,CCC,NO,NV) + COMMON /main1/ eps + END + diff --git a/gcc/testsuite/gfortran.dg/lto/20091015-1_2.f b/gcc/testsuite/gfortran.dg/lto/20091015-1_2.f new file mode 100644 index 00000000000..5bfd02227fa --- /dev/null +++ b/gcc/testsuite/gfortran.dg/lto/20091015-1_2.f @@ -0,0 +1,5 @@ + program test + common/main1/ eps(2) + dimension cor6d(2,2) + call dalie6s(iqmod6,1,wx,cor6d) + end diff --git a/gcc/testsuite/gfortran.dg/lto/20091016-1_0.f90 b/gcc/testsuite/gfortran.dg/lto/20091016-1_0.f90 new file mode 100644 index 00000000000..c26ad90fbe2 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/lto/20091016-1_0.f90 @@ -0,0 +1,12 @@ +! { dg-lto-do link } +! { dg-lto-options {{-flto -g -fPIC -shared} {-O -flto -g -fPIC -shared}} } + + FUNCTION makenumberstring(x) + IMPLICIT NONE + REAL, INTENT(IN) :: x + CHARACTER(len=20) :: makenumberstring + INTEGER :: xx + xx = x**2 ! << ICE + makenumberstring = '' + END FUNCTION + diff --git a/gcc/testsuite/gfortran.dg/lto/pr41521_0.f90 b/gcc/testsuite/gfortran.dg/lto/pr41521_0.f90 new file mode 100644 index 00000000000..d882779263d --- /dev/null +++ b/gcc/testsuite/gfortran.dg/lto/pr41521_0.f90 @@ -0,0 +1,9 @@ +! { dg-lto-do link } +! { dg-lto-options {{-g -flto} {-g -O -flto}} } +program species +integer spk(2) +real eval(2) +spk = 2 +call atom(1.1,spk,eval) +end program + diff --git a/gcc/testsuite/gfortran.dg/lto/pr41521_1.f90 b/gcc/testsuite/gfortran.dg/lto/pr41521_1.f90 new file mode 100644 index 00000000000..897e7aded0a --- /dev/null +++ b/gcc/testsuite/gfortran.dg/lto/pr41521_1.f90 @@ -0,0 +1,9 @@ +subroutine atom(sol,k,eval) +real, intent(in) :: sol +integer, intent(in) :: k(2) +real, intent(out) :: eval(2) +real t1 + t1=sqrt(dble(k(1)**2)-(sol)**2) + eval(1)=sol**2/sqrt(t1)-sol**2 +end subroutine + diff --git a/gcc/testsuite/gfortran.dg/select_type_7.f03 b/gcc/testsuite/gfortran.dg/select_type_7.f03 new file mode 100644 index 00000000000..554b6cd122d --- /dev/null +++ b/gcc/testsuite/gfortran.dg/select_type_7.f03 @@ -0,0 +1,40 @@ +! { dg-do run } +! +! PR 41766: [OOP] SELECT TYPE selector as actual argument with INTENT(INOUT) +! +! Contributed by Janus Weil <janus@gcc.gnu.org> + + implicit none + + type t1 + integer :: a + end type + + type, extends(t1) :: t2 + integer :: b + end type + + class(t1),allocatable :: cp + + allocate(t2 :: cp) + + select type (cp) + type is (t2) + cp%a = 98 + cp%b = 76 + call s(cp) + print *,cp%a,cp%b + if (cp%a /= cp%b) call abort() + class default + call abort() + end select + +contains + + subroutine s(f) + type(t2), intent(inout) :: f + f%a = 3 + f%b = 3 + end subroutine + +end diff --git a/gcc/testsuite/gfortran.dg/typebound_operator_2.f03 b/gcc/testsuite/gfortran.dg/typebound_operator_2.f03 index 57b34486313..b8dc5c9d104 100644 --- a/gcc/testsuite/gfortran.dg/typebound_operator_2.f03 +++ b/gcc/testsuite/gfortran.dg/typebound_operator_2.f03 @@ -50,7 +50,6 @@ CONTAINS LOGICAL FUNCTION func (me, b) ! { dg-error "must be a SUBROUTINE" } CLASS(t), INTENT(OUT) :: me CLASS(t), INTENT(IN) :: b - me = t () func = .TRUE. END FUNCTION func diff --git a/gcc/testsuite/gfortran.dg/typebound_operator_4.f03 b/gcc/testsuite/gfortran.dg/typebound_operator_4.f03 index 1ce2b97a0d7..835ceb63ff0 100644 --- a/gcc/testsuite/gfortran.dg/typebound_operator_4.f03 +++ b/gcc/testsuite/gfortran.dg/typebound_operator_4.f03 @@ -37,7 +37,7 @@ CONTAINS PURE SUBROUTINE assign_int (dest, from) CLASS(myint), INTENT(OUT) :: dest INTEGER, INTENT(IN) :: from - dest = myint (from) + dest%value = from END SUBROUTINE assign_int TYPE(myreal) FUNCTION add_real (a, b) @@ -49,7 +49,7 @@ CONTAINS SUBROUTINE assign_real (dest, from) CLASS(myreal), INTENT(OUT) :: dest REAL, INTENT(IN) :: from - dest = myreal (from) + dest%value = from END SUBROUTINE assign_real SUBROUTINE in_module () diff --git a/gcc/testsuite/gfortran.dg/vect/fast-math-pr38968.f90 b/gcc/testsuite/gfortran.dg/vect/fast-math-pr38968.f90 index abb3c5f10df..3b8ac9defc3 100644 --- a/gcc/testsuite/gfortran.dg/vect/fast-math-pr38968.f90 +++ b/gcc/testsuite/gfortran.dg/vect/fast-math-pr38968.f90 @@ -1,3 +1,4 @@ +! { dg-timeout-factor 4.0 } program mymatmul implicit none integer, parameter :: kp = 4 diff --git a/gcc/testsuite/gfortran.dg/whole_file_5.f90 b/gcc/testsuite/gfortran.dg/whole_file_5.f90 index 07ba4411c4c..c6ad9e1b448 100644 --- a/gcc/testsuite/gfortran.dg/whole_file_5.f90 +++ b/gcc/testsuite/gfortran.dg/whole_file_5.f90 @@ -1,6 +1,6 @@ ! { dg-do "compile" } ! { dg-options "-O3 -fwhole-file -fdump-tree-optimized" } -! { dg-options "-O3 -fwhole-file -fdump-tree-optimized -fpie" { target { ! nonpic } } } +! { dg-add-options bind_pic_locally } ! ! Check that inlining of functions declared BEFORE usage works. ! If yes, then the dump does not contain a call to F(). diff --git a/gcc/testsuite/gfortran.dg/whole_file_6.f90 b/gcc/testsuite/gfortran.dg/whole_file_6.f90 index f903c7aefc5..274b8a99c6c 100644 --- a/gcc/testsuite/gfortran.dg/whole_file_6.f90 +++ b/gcc/testsuite/gfortran.dg/whole_file_6.f90 @@ -1,6 +1,6 @@ ! { dg-do "compile" } ! { dg-options "-O3 -fwhole-file -fdump-tree-optimized" } -! { dg-options "-O3 -fwhole-file -fdump-tree-optimized -fpie" { target { ! nonpic } } } +! { dg-add-options bind_pic_locally } ! ! Check that inlining of functions declared AFTER usage works. ! If yes, then the dump does not contain a call to F(). diff --git a/gcc/testsuite/gnat.dg/aggr11.adb b/gcc/testsuite/gnat.dg/aggr11.adb new file mode 100644 index 00000000000..1771d62cacb --- /dev/null +++ b/gcc/testsuite/gnat.dg/aggr11.adb @@ -0,0 +1,17 @@ +-- { dg-do compile }
+-- { dg-options "-O" }
+
+with Aggr11_Pkg; use Aggr11_Pkg;
+
+procedure Aggr11 is
+
+ A : Arr := ((1 => (Kind => No_Error, B => True),
+ 2 => (Kind => Error),
+ 3 => (Kind => Error),
+ 4 => (Kind => No_Error, B => True),
+ 5 => (Kind => No_Error, B => True),
+ 6 => (Kind => No_Error, B => True)));
+
+begin
+ null;
+end;
diff --git a/gcc/testsuite/gnat.dg/aggr11_pkg.ads b/gcc/testsuite/gnat.dg/aggr11_pkg.ads new file mode 100644 index 00000000000..37008605a30 --- /dev/null +++ b/gcc/testsuite/gnat.dg/aggr11_pkg.ads @@ -0,0 +1,14 @@ +package Aggr11_Pkg is
+
+ type Error_Type is (No_Error, Error);
+
+ type Rec (Kind : Error_Type := No_Error) is record
+ case Kind is
+ when Error => null;
+ when others => B : Boolean;
+ end case;
+ end record;
+
+ type Arr is array (1..6) of Rec;
+
+end Aggr11_Pkg;
diff --git a/gcc/testsuite/gnat.dg/discr21.adb b/gcc/testsuite/gnat.dg/discr21.adb new file mode 100644 index 00000000000..5c105cdb25c --- /dev/null +++ b/gcc/testsuite/gnat.dg/discr21.adb @@ -0,0 +1,34 @@ +-- { dg-do compile } +-- { dg-options "-gnatws -O3" } + +with Discr21_Pkg; use Discr21_Pkg; + +package body Discr21 is + + type Index is new Natural range 0 .. 100; + + type Arr is array (Index range <> ) of Position; + + type Rec(Size : Index := 1) is record + A : Arr(1 .. Size); + end record; + + Data : Rec; + + function To_V(pos : Position) return VPosition is + begin + return To_Position(pos.x, pos.y, pos.z); + end; + + procedure Read(Data : Rec) is + pos : VPosition := To_V (Data.A(1)); + begin + null; + end; + + procedure Test is + begin + Read (Data); + end; + +end Discr21; diff --git a/gcc/testsuite/gnat.dg/discr21.ads b/gcc/testsuite/gnat.dg/discr21.ads new file mode 100644 index 00000000000..8de8ed08b76 --- /dev/null +++ b/gcc/testsuite/gnat.dg/discr21.ads @@ -0,0 +1,5 @@ +package Discr21 is + + procedure Test; + +end Discr21; diff --git a/gcc/testsuite/gnat.dg/discr21_pkg.ads b/gcc/testsuite/gnat.dg/discr21_pkg.ads new file mode 100644 index 00000000000..d156df62517 --- /dev/null +++ b/gcc/testsuite/gnat.dg/discr21_pkg.ads @@ -0,0 +1,19 @@ +package Discr21_Pkg is + + type Position is record + x,y,z : Float; + end record; + + type Dim is (Two, Three); + + type VPosition (D: Dim := Three) is record + x, y : Float; + case D is + when Two => null; + when Three => z : Float; + end case; + end record; + + function To_Position (x, y, z : Float) return VPosition; + +end Discr21_Pkg; diff --git a/gcc/testsuite/gnat.dg/discr22.adb b/gcc/testsuite/gnat.dg/discr22.adb new file mode 100644 index 00000000000..af4f9ab7899 --- /dev/null +++ b/gcc/testsuite/gnat.dg/discr22.adb @@ -0,0 +1,23 @@ +-- { dg-do compile } +-- { dg-options "-gnatws" } + +procedure Discr22 is + + subtype Precision is Integer range 1 .. 5; + + type Rec(D1 : Precision; D2 : Integer) is record + case D1 is + when 1 => I : Integer; + when others => null; + end case; + end record; + for Rec use record + D1 at 0 range 0 .. 7; + end record; + + P : Precision; + X : Rec(P, 0); + +begin + null; +end; diff --git a/gcc/testsuite/gnat.dg/loop_optimization7.adb b/gcc/testsuite/gnat.dg/loop_optimization7.adb new file mode 100644 index 00000000000..16683949465 --- /dev/null +++ b/gcc/testsuite/gnat.dg/loop_optimization7.adb @@ -0,0 +1,16 @@ +-- { dg-do compile } +-- { dg-options "-O3" } +-- { dg-options "-O3 -msse" { target i?86-*-* x86_64-*-* } } + +package body Loop_Optimization7 is + + function Conv (A : Arr) return Arr is + Result : Arr; + begin + for I in A'Range loop + Result (I) := Conv (A (I)); + end loop; + return Result; + end; + +end Loop_Optimization7; diff --git a/gcc/testsuite/gnat.dg/loop_optimization7.ads b/gcc/testsuite/gnat.dg/loop_optimization7.ads new file mode 100644 index 00000000000..ab0a165ea90 --- /dev/null +++ b/gcc/testsuite/gnat.dg/loop_optimization7.ads @@ -0,0 +1,9 @@ +with Loop_Optimization7_Pkg; use Loop_Optimization7_Pkg; + +package Loop_Optimization7 is + + type Arr is array (1..8) of Rec; + + function Conv (A : Arr) return Arr; + +end Loop_Optimization7; diff --git a/gcc/testsuite/gnat.dg/loop_optimization7_pkg.ads b/gcc/testsuite/gnat.dg/loop_optimization7_pkg.ads new file mode 100644 index 00000000000..0eaefa1b0f3 --- /dev/null +++ b/gcc/testsuite/gnat.dg/loop_optimization7_pkg.ads @@ -0,0 +1,10 @@ +package Loop_Optimization7_Pkg is + pragma Pure; + + type Rec is record + F : Float; + end record; + + function Conv (Trig : Rec) return Rec; + +end Loop_Optimization7_Pkg; diff --git a/gcc/testsuite/gnat.dg/nested_proc.adb b/gcc/testsuite/gnat.dg/nested_proc1.adb index 144533c2832..b3abf262578 100644 --- a/gcc/testsuite/gnat.dg/nested_proc.adb +++ b/gcc/testsuite/gnat.dg/nested_proc1.adb @@ -2,7 +2,7 @@ -- Test that a static link is correctly passed to a subprogram which is -- indirectly called through an aggregate. -procedure Nested_Proc is +procedure Nested_Proc1 is I : Integer := 0; diff --git a/gcc/testsuite/gnat.dg/nested_proc2.adb b/gcc/testsuite/gnat.dg/nested_proc2.adb new file mode 100644 index 00000000000..b5349563a99 --- /dev/null +++ b/gcc/testsuite/gnat.dg/nested_proc2.adb @@ -0,0 +1,30 @@ +-- { dg-do compile } +-- { dg-options "-gnatws" } + +procedure Nested_Proc2 is + + type Arr is array(1..2) of Integer; + + type Rec is record + Data : Arr; + end record; + + From : Rec; + Index : Integer; + + function F (X : Arr) return Integer is + begin + return 0; + end; + + procedure Test is + begin + Index := F (From.Data); + If Index /= 0 then + raise Program_Error; + end if; + end; + +begin + Test; +end; diff --git a/gcc/testsuite/gnat.dg/noreturn1.adb b/gcc/testsuite/gnat.dg/noreturn1.adb new file mode 100644 index 00000000000..83eafe7f364 --- /dev/null +++ b/gcc/testsuite/gnat.dg/noreturn1.adb @@ -0,0 +1,15 @@ +-- { dg-compile } + +package body Noreturn1 is + + procedure Error (E : in Exception_Occurrence) is + Occurrence_Message : constant String := Exception_Message (E); + begin + if Occurrence_Message = "$" then + raise Program_Error; + else + raise Constraint_Error; + end if; + end; + +end Noreturn1; diff --git a/gcc/testsuite/gnat.dg/noreturn1.ads b/gcc/testsuite/gnat.dg/noreturn1.ads new file mode 100644 index 00000000000..c63e4399907 --- /dev/null +++ b/gcc/testsuite/gnat.dg/noreturn1.ads @@ -0,0 +1,8 @@ +with Ada.Exceptions; use Ada.Exceptions; + +package Noreturn1 is + + procedure Error (E : in Exception_Occurrence); + pragma No_Return (Error); + +end Noreturn1; diff --git a/gcc/testsuite/gnat.dg/noreturn2.adb b/gcc/testsuite/gnat.dg/noreturn2.adb new file mode 100644 index 00000000000..5caf222f29b --- /dev/null +++ b/gcc/testsuite/gnat.dg/noreturn2.adb @@ -0,0 +1,23 @@ +-- { dg-do compile } + +package body Noreturn2 is + + procedure Raise_Exception_No_Defer (Message : String); + pragma No_Return (Raise_Exception_No_Defer); + + procedure Raise_From (X : Exception_Occurrence) is + Occurrence_Message : constant String := Exception_Message (X); + begin + if Occurrence_Message = "$" then + Raise_Exception_No_Defer (Occurrence_Message); + else + Raise_Exception_No_Defer ("::" & Occurrence_Message); + end if; + end; + + procedure Raise_Exception_No_Defer (Message : String) is + begin + raise Program_Error; + end; + +end Noreturn2; diff --git a/gcc/testsuite/gnat.dg/noreturn2.ads b/gcc/testsuite/gnat.dg/noreturn2.ads new file mode 100644 index 00000000000..1aaf4e97446 --- /dev/null +++ b/gcc/testsuite/gnat.dg/noreturn2.ads @@ -0,0 +1,8 @@ +with Ada.Exceptions; use Ada.Exceptions; + +package Noreturn2 is + + procedure Raise_From (X : Exception_Occurrence); + pragma No_Return (Raise_From); + +end Noreturn2; diff --git a/gcc/testsuite/gnat.dg/slice8.adb b/gcc/testsuite/gnat.dg/slice8.adb new file mode 100644 index 00000000000..b05829d0f7b --- /dev/null +++ b/gcc/testsuite/gnat.dg/slice8.adb @@ -0,0 +1,13 @@ +-- { dg-do compile } +-- { dg-options "-gnatws" } + +with Slice8_Pkg1; +with Slice8_Pkg3; + +procedure Slice8 is + + package Bp is new Slice8_Pkg3 (Slice8_Pkg1); + +begin + null; +end; diff --git a/gcc/testsuite/gnat.dg/slice8_pkg1.ads b/gcc/testsuite/gnat.dg/slice8_pkg1.ads new file mode 100644 index 00000000000..3f433fdfb26 --- /dev/null +++ b/gcc/testsuite/gnat.dg/slice8_pkg1.ads @@ -0,0 +1,3 @@ +with Slice8_Pkg2; + +package Slice8_Pkg1 is new Slice8_Pkg2 (Line_Length => 132, Max_Lines => 1000); diff --git a/gcc/testsuite/gnat.dg/slice8_pkg2.ads b/gcc/testsuite/gnat.dg/slice8_pkg2.ads new file mode 100644 index 00000000000..a6eafc6aa18 --- /dev/null +++ b/gcc/testsuite/gnat.dg/slice8_pkg2.ads @@ -0,0 +1,23 @@ +generic + + Line_Length : Natural; + Max_Lines : Natural; + +package Slice8_Pkg2 is + + Subtype Index is Natural Range 0..Line_length; + Subtype Line_Count is Natural Range 0..Max_Lines; + + Type Line (Size : Index := 0) is + Record + Data : String (1..Size); + End Record; + + Type Lines is Array (Line_Count Range <>) of Line; + + Type Paragraph (Size : Line_Count) is + Record + Data : Lines (1..Size); + End Record; + +end Slice8_Pkg2; diff --git a/gcc/testsuite/gnat.dg/slice8_pkg3.adb b/gcc/testsuite/gnat.dg/slice8_pkg3.adb new file mode 100644 index 00000000000..3524de1f0f5 --- /dev/null +++ b/gcc/testsuite/gnat.dg/slice8_pkg3.adb @@ -0,0 +1,17 @@ +-- { dg-do compile } +-- { dg-options "-gnatws" } + +package body Slice8_Pkg3 is + + Current : Str.Lines (Str.Line_Count); + Last : Natural := 0; + + function Get return Str.Paragraph is + Result : constant Str.Paragraph := (Size => Last, + Data => Current (1..Last)); + begin + Last := 0; + return Result; + end Get; + +end Slice8_Pkg3; diff --git a/gcc/testsuite/gnat.dg/slice8_pkg3.ads b/gcc/testsuite/gnat.dg/slice8_pkg3.ads new file mode 100644 index 00000000000..a802cb72d9b --- /dev/null +++ b/gcc/testsuite/gnat.dg/slice8_pkg3.ads @@ -0,0 +1,11 @@ +with Slice8_Pkg2; + +generic + + with package Str is new Slice8_Pkg2 (<>); + +package Slice8_Pkg3 is + + function Get return Str.Paragraph; + +end Slice8_Pkg3; diff --git a/gcc/testsuite/gnat.dg/unchecked_convert4.adb b/gcc/testsuite/gnat.dg/unchecked_convert4.adb new file mode 100644 index 00000000000..8f3a1aa4efe --- /dev/null +++ b/gcc/testsuite/gnat.dg/unchecked_convert4.adb @@ -0,0 +1,24 @@ +-- { dg-do compile } + +with Unchecked_Conversion; + +procedure Unchecked_Convert4 is + + type Uint32 is mod 2**32; + + type Rec is record + I : Uint32; + end record; + for Rec'Size use 32; + pragma Atomic (Rec); + + function Conv is new Unchecked_Conversion (Uint32, Rec); + + function F return Uint32; + pragma Import (Ada, F); + + procedure Proc (R : Rec) is begin null; end; + +begin + Proc (Conv (F or 1)); +end; diff --git a/gcc/testsuite/lib/lto.exp b/gcc/testsuite/lib/lto.exp index 7f2d7ecec83..cccd64220bc 100644 --- a/gcc/testsuite/lib/lto.exp +++ b/gcc/testsuite/lib/lto.exp @@ -191,6 +191,16 @@ proc lto-get-options-main { src } { || ![string compare "dg-options" $cmd] } { warning "lto.exp does not support $cmd in primary source file" } elseif { ![string compare "dg-lto-do" $cmd] } { + if { [llength $op] > 3 } { + set kw [lindex [lindex $op 3] 0] + if [string match "target" $kw] { + perror "$src: dg-lto-do does not support \"target\"" + } elseif [string match "xfail" $kw] { + perror "$src: dg-lto-do does not support \"xfail\"" + } else { + perror "$src: dg-lto-do takes a single argument" + } + } set dgdo [lindex $op 2] verbose "dg-lto-do command for \"$op\" is $dgdo" if { ![string compare "assemble" $dgdo] } { diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 26ef7b7038e..f8e83ec0988 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -2984,6 +2984,28 @@ proc add_options_for_ieee { flags } { return $flags } +# Add to FLAGS the flags needed to enable functions to bind locally +# when using pic/PIC passes in the testsuite. + +proc add_options_for_bind_pic_locally { flags } { + if {[check_no_compiler_messages using_pic2 assembly { + #if __PIC__ != 2 + #error FOO + #endif + }]} { + return "$flags -fPIE" + } + if {[check_no_compiler_messages using_pic1 assembly { + #if __PIC__ != 1 + #error FOO + #endif + }]} { + return "$flags -fpie" + } + + return $flags +} + # Return 1 if the target provides a full C99 runtime. proc check_effective_target_c99_runtime { } { @@ -3127,6 +3149,29 @@ proc check_effective_target_mpc_pow { } { }] } +# Return 1 if the MPC library with "arc" functions is integrated with GCC, 0 otherwise. + +proc check_effective_target_mpc_arc { } { + return [check_no_compiler_messages mpc_arc executable { + extern void link_error(void); + int main () + { + if (__builtin_cacos(1) != 0) + link_error(); + if (__builtin_casin(0) != 0) + link_error(); + if (__builtin_catan(0) != 0) + link_error(); + if (__builtin_cacosh(1) != 0) + link_error(); + if (__builtin_casinh(0) != 0) + link_error(); + if (__builtin_catanh(0) != 0) + link_error(); + } + }] +} + # Return 1 if the language for the compiler under test is C. proc check_effective_target_c { } { diff --git a/gcc/testsuite/obj-c++.dg/bitfield-1.mm b/gcc/testsuite/obj-c++.dg/bitfield-1.mm index d9b65a4f453..f17d9f0baca 100644 --- a/gcc/testsuite/obj-c++.dg/bitfield-1.mm +++ b/gcc/testsuite/obj-c++.dg/bitfield-1.mm @@ -115,7 +115,7 @@ int main(void) } /* { dg-prune-output "In file included from" } Ignore this message. */ -/* { dg-bogus "padding struct to align" "PR23610" { xfail lp64 } 1 } */ +/* { dg-bogus "padding struct to align" "PR23610" { target *-*-* } 0 } */ /* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } 42 } */ /* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } 45 } */ /* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } 59 } */ diff --git a/gcc/testsuite/obj-c++.dg/bitfield-4.mm b/gcc/testsuite/obj-c++.dg/bitfield-4.mm index 72c1396d706..a2c2173085a 100644 --- a/gcc/testsuite/obj-c++.dg/bitfield-4.mm +++ b/gcc/testsuite/obj-c++.dg/bitfield-4.mm @@ -50,7 +50,7 @@ int main(void) } /* { dg-prune-output "In file included from" } Ignore this message. */ -/* { dg-bogus "padding struct to align" "PR23610" { xfail lp64 } 1 } */ +/* { dg-bogus "padding struct to align" "PR23610" { target *-*-* } 0 } */ /* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } 28 } */ /* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } 34 } */ diff --git a/gcc/testsuite/obj-c++.dg/layout-1.mm b/gcc/testsuite/obj-c++.dg/layout-1.mm index 35ffa49da3b..bc99e758f8c 100644 --- a/gcc/testsuite/obj-c++.dg/layout-1.mm +++ b/gcc/testsuite/obj-c++.dg/layout-1.mm @@ -14,4 +14,4 @@ @end /* { dg-prune-output "In output included from" } Ignore this message. */ -/* { dg-bogus "padding struct to align" "PR23610" { xfail lp64 } 1 } */ +/* { dg-bogus "padding struct to align" "PR23610" { target *-*-* } 0 } */ |