diff options
author | Ian Lance Taylor <iant@golang.org> | 2021-03-11 16:12:22 -0800 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2021-03-11 16:12:22 -0800 |
commit | bc636c218f2b28da06cd1404d5b35d1f8cc43fd1 (patch) | |
tree | 764937d8460563db6132d7c75e19b95ef3ea6ea8 /gcc/testsuite | |
parent | 89d7be42db00cd0953e7d4584877cf50a56ed046 (diff) | |
parent | 7ad5a72c8bc6aa71a0d195ddfa207db01265fe0b (diff) | |
download | gcc-bc636c218f2b28da06cd1404d5b35d1f8cc43fd1.zip gcc-bc636c218f2b28da06cd1404d5b35d1f8cc43fd1.tar.gz gcc-bc636c218f2b28da06cd1404d5b35d1f8cc43fd1.tar.bz2 |
Merge from trunk revision 7ad5a72c8bc6aa71a0d195ddfa207db01265fe0b.
Diffstat (limited to 'gcc/testsuite')
468 files changed, 10567 insertions, 793 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 288ea1d..7ed0052 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,1375 @@ +2021-03-10 David Edelsohn <dje.gcc@gmail.com> + + PR target/99492 + * gcc.target/powerpc/pr99492.c: New testcase. + +2021-03-10 Harald Anlauf <anlauf@gmx.de> + + PR fortran/99205 + * gfortran.dg/data_char_4.f90: New test. + * gfortran.dg/data_char_5.f90: New test. + +2021-03-10 Segher Boessenkool <segher@kernel.crashing.org> + + * gcc.target/powerpc/pr98959.c: Add int128 and lp64 selectors. + +2021-03-10 Nathan Sidwell <nathan@acm.org> + + PR c++/99423 + * g++.dg/modules/pr99423_a.H: New. + * g++.dg/modules/pr99423_b.H: New. + +2021-03-10 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/99305 + PR testsuite/99498 + * g++.dg/opt/pr99305.C: Don't expect cast to unsigned char on + unsigned_char effective targets. + +2021-03-10 Nathan Sidwell <nathan@acm.org> + + PR c++/99508 + * g++.dg/ext/pr99508.C: New. + +2021-03-10 John David Anglin <danglin@gcc.gnu.org> + + PR testsuite/99292 + * lib/target-supports.exp (check_effective_target_lra): New. + * gcc.c-torture/compile/asmgoto-2.c: Use LRA target selector. + * gcc.c-torture/compile/asmgoto-5.c: Likewise. + * gcc.c-torture/compile/pr98096.c: Likewise. + * gcc.dg/pr97954.c: Likewise. + +2021-03-10 David Malcolm <dmalcolm@redhat.com> + + * gcc.dg/analyzer/pr94047.c: Remove "-Wno-analyzer-too-complex". + * gcc.dg/analyzer/zlib-2.c: Likewise. + +2021-03-10 Joel Hutton <joel.hutton@arm.com> + + * gcc.dg/vect/pr99102.c: Fix target selector. + +2021-03-10 Joel Hutton <joel.hutton@arm.com> + + PR target/99102 + * gcc.dg/vect/pr99102.c: New test. + +2021-03-10 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/specs/lto25.ads: New test. + +2021-03-09 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/99305 + * g++.dg/opt/pr99305.C: New test. + +2021-03-09 Segher Boessenkool <segher@kernel.crashing.org> + + * lib/target-supports.exp (check_effective_target_powerpc_sqrt): New. + (check_effective_target_sqrt_insn): Use it. + +2021-03-09 Vladimir N. Makarov <vmakarov@redhat.com> + + PR target/99454 + * gcc.target/i386/pr99454.c: New. + +2021-03-09 Eric Botcazou <ebotcazou@adacore.com> + + * gcc.dg/array-quals-1.c: Pass -fno-pie if supported. + * gcc.dg/loop-9.c: Likewise. + * gfortran.dg/pr95690.f90: Replace *-*-solaris* with sparc*-*-*. + * gnat.dg/opt39.adb: Pass --param option for Aarch64 too. + +2021-03-09 Jakub Jelinek <jakub@redhat.com> + + PR sanitizer/98920 + * c-c++-common/asan/pr98920.c: Only include regex.h if the header + exists. If REG_STARTEND macro isn't defined, just return 0 from main + instead of the actual test. + +2021-03-09 Martin Liska <mliska@suse.cz> + + PR target/99464 + * gcc.target/i386/pr99464.c: New test. + +2021-03-09 Joel Brobecker <brobecker@adacore.com> + + * gcc.target/powerpc/undef-bool-2.c: Add + dg-require-effective-target powerpc_vsx_ok directive. + * g++.dg/ext/undef-bool-1.C: Add dg-require-effective-target + powerpc_vsx_ok directive. + +2021-03-08 Harald Anlauf <anlauf@gmx.de> + + PR fortran/49278 + * gfortran.dg/parameter_data.f90: New test. + +2021-03-08 Martin Sebor <msebor@redhat.com> + + PR middle-end/98266 + * g++.dg/warn/Warray-bounds-15.C: New test. + * g++.dg/warn/Warray-bounds-18.C: New test. + * g++.dg/warn/Warray-bounds-19.C: New test. + * g++.dg/warn/Warray-bounds-20.C: New test. + * g++.dg/warn/Warray-bounds-21.C: New test. + +2021-03-08 Martin Sebor <msebor@redhat.com> + + PR middle-end/97631 + * c-c++-common/Wstringop-overflow.c: Remove unexpected warnings. + Add an xfail. + * c-c++-common/Wstringop-truncation.c: Add expected warnings. + * gcc.dg/Wstringop-overflow-10.c: Also enable -Wstringop-truncation. + * gcc.dg/Wstringop-overflow-66.c: New test. + * gcc.dg/tree-ssa/strncpy-2.c: Adjust expected warning. + +2021-03-08 Marek Polacek <polacek@redhat.com> + + PR c++/96268 + * g++.dg/cpp2a/nontype-class41.C: New test. + +2021-03-08 Nathan Sidwell <nathan@acm.org> + + PR c++/99436 + * g++.dg/modules/modules.exp (MOD_STD_LIST): Add 2b. + +2021-03-08 Nathan Sidwell <nathan@acm.org> + + * g++.dg/modules/pr99468.H: New. + +2021-03-08 Peter Bergner <bergner@linux.ibm.com> + + PR target/98959 + * gcc.target/powerpc/pr98959.c: New test. + +2021-03-08 Nathan Sidwell <nathan@acm.org> + + PR c++/99285 + * g++.dg/modules/pr99285_a.H: New. + * g++.dg/modules/pr99285_b.H: New. + +2021-03-08 Kyrylo Tkachov <kyrylo.tkachov@arm.com> + + PR target/99437 + * gcc.target/aarch64/simd/pr99437.c: New test. + +2021-03-08 Martin Liska <mliska@suse.cz> + + PR sanitizer/98920 + * c-c++-common/asan/pr98920.c: New test. + +2021-03-08 Martin Liska <mliska@suse.cz> + + PR target/99463 + * gcc.target/i386/pr99463-2.c: New test. + * gcc.target/i386/pr99463.c: New test. + +2021-03-08 Ilya Leoshkevich <iii@linux.ibm.com> + + * gcc.target/s390/vector/long-double-asm-commutative.c: New + test. + * gcc.target/s390/vector/long-double-asm-earlyclobber.c: New + test. + * gcc.target/s390/vector/long-double-asm-in-out.c: New test. + * gcc.target/s390/vector/long-double-asm-inout.c: New test. + * gcc.target/s390/vector/long-double-asm-matching.c: New test. + * gcc.target/s390/vector/long-double-asm-regmem.c: New test. + * gcc.target/s390/vector/long-double-volatile-from-i64.c: New + test. + +2021-03-08 Tobias Burnus <tobias@codesourcery.com> + + PR fortran/97927 + * gfortran.dg/module_variable_3.f90: New test. + +2021-03-07 Jakub Jelinek <jakub@redhat.com> + + PR target/99321 + * lib/target-supports.exp + (check_effective_target_assembler_march_noavx512bw): New effective + target. + * gcc.target/i386/avx512vl-pr99321-1.c: New test. + +2021-03-06 Patrick Palka <ppalka@redhat.com> + Jakub Jelinek <jakub@redhat.com> + + PR c++/99287 + * g++.dg/cpp2a/constexpr-99287.C: New test. + +2021-03-06 Patrick Palka <ppalka@redhat.com> + Jakub Jelinek <jakub@redhat.com> + + PR c++/96330 + * g++.dg/cpp1y/var-templ68.C: New test. + * g++.dg/cpp1y/var-templ68a.C: New test. + +2021-03-06 Patrick Palka <ppalka@redhat.com> + + PR c++/99365 + * g++.dg/cpp2a/concepts-partial-spec9.C: New test. + * g++.dg/cpp2a/concepts-placeholder4.C: New test. + +2021-03-06 Hans-Peter Nilsson <hp@axis.com> + + * gcc.target/cris/pr93372-1.c: Adjust expected assembler result + to allow an eliminated stack-frame. + +2021-03-05 Marek Polacek <polacek@redhat.com> + + PR c++/99374 + * g++.dg/cpp1z/noexcept-type23.C: New test. + +2021-03-05 Marek Polacek <polacek@redhat.com> + + PR c++/99120 + * g++.dg/warn/Wshadow-17.C: New test. + +2021-03-05 Jason Merrill <jason@redhat.com> + + PR c/99363 + * gcc.dg/attr-flatten-1.c: Adjust. + +2021-03-05 Jakub Jelinek <jakub@redhat.com> + + PR middle-end/99322 + * c-c++-common/gomp/pr99322.c: New test. + +2021-03-05 Nathan Sidwell <nathan@acm.org> + + PR c++/99245 + * g++.dg/modules/pr99245_a.H: New. + * g++.dg/modules/pr99245_b.H: New. + +2021-03-05 Harald Anlauf <anlauf@gmx.de> + + PR libfortran/99218 + * gfortran.dg/matmul_21.f90: New test. + +2021-03-05 Nathan Sidwell <nathan@acm.org> + + PR c++/99377 + * g++.dg/modules/pr99377_a.H: New. + * g++.dg/modules/pr99377_b.C: New. + * g++.dg/modules/pr99377_c.C: New. + +2021-03-05 Iain Sandoe <iain@sandoe.co.uk> + + PR c++/98118 + * g++.dg/coroutines/pr98118.C: New test. + +2021-03-05 Iain Sandoe <iain@sandoe.co.uk> + + PR c++/95616 + * g++.dg/coroutines/pr95616-0-no-exceptions.C: New test. + * g++.dg/coroutines/pr95616-0.C: New test. + * g++.dg/coroutines/pr95616-1-no-exceptions.C: New test. + * g++.dg/coroutines/pr95616-1.C: New test. + * g++.dg/coroutines/pr95616-2.C: New test. + * g++.dg/coroutines/pr95616-3-no-exceptions.C: New test. + * g++.dg/coroutines/pr95616-3.C: New test. + * g++.dg/coroutines/pr95616-4.C: New test. + * g++.dg/coroutines/pr95616-5.C: New test. + * g++.dg/coroutines/pr95616-6.C: New test. + +2021-03-05 Iain Sandoe <iain@sandoe.co.uk> + + PR c++/95615 + * g++.dg/coroutines/torture/pr95615-01.C: New test. + * g++.dg/coroutines/torture/pr95615-02.C: New test. + * g++.dg/coroutines/torture/pr95615-03.C: New test. + * g++.dg/coroutines/torture/pr95615-04.C: New test. + * g++.dg/coroutines/torture/pr95615-05.C: New test. + * g++.dg/coroutines/torture/pr95615.inc: New file. + +2021-03-05 Vladimir N. Makarov <vmakarov@redhat.com> + + PR target/99378 + * gcc.target/i386/pr99123-2.c: New. + +2021-03-05 Nathan Sidwell <nathan@acm.org> + + PR c++/99389 + * g++.dg/modules/pr99389_a.H: New. + * g++.dg/modules/pr99389_b.C: New. + * g++.dg/modules/pr99389_c.C: New. + +2021-03-05 Tobias Burnus <tobias@codesourcery.com> + + PR c/99137 + * c-c++-common/goacc/asyncwait-1.c: Update dg-error; add + additional test. + +2021-03-05 Tobias Burnus <tobias@codesourcery.com> + + * gfortran.dg/real4-10-real8-10.f90: Add check for real literals + with '_kind' number. + * gfortran.dg/real4-10-real8-16.f90: Likewise. + * gfortran.dg/real4-10-real8-4.f90: Likewise. + * gfortran.dg/real4-10.f90: Likewise. + * gfortran.dg/real4-16-real8-10.f90: Likewise. + * gfortran.dg/real4-16-real8-16.f90: Likewise. + * gfortran.dg/real4-16-real8-4.f90: Likewise. + * gfortran.dg/real4-16.f90: Likewise. + * gfortran.dg/real4-8-real8-10.f90: Likewise. + * gfortran.dg/real4-8-real8-16.f90: Likewise. + * gfortran.dg/real4-8-real8-4.f90: Likewise. + * gfortran.dg/real4-8.f90: Likewise. + * gfortran.dg/real8-10.f90: Likewise. + * gfortran.dg/real8-16.f90: Likewise. + * gfortran.dg/real8-4.f90: Likewise. + +2021-03-05 Hans-Peter Nilsson <hp@axis.com> + + PR debug/66668 + * gcc.dg/debug/dwarf2/stacked-qualified-types-3.c: xfail for cris-*-* + +2021-03-04 Iain Sandoe <iain@sandoe.co.uk> + + * lib/prune.exp: Prune useless output caused by a linker bug. + +2021-03-04 Jakub Jelinek <jakub@redhat.com> + + PR middle-end/93235 + * gcc.target/aarch64/pr93235.c: New test. + +2021-03-04 Martin Liska <mliska@suse.cz> + + PR gcov-profile/99105 + * gcc.dg/tree-prof/indir-call-prof-malloc.c: Use profile + correction as the wrapped malloc is called one more time + from libgcov. + * gcc.dg/tree-prof/pr97461.c: Likewise. + +2021-03-04 Jakub Jelinek <jakub@redhat.com> + + PR c++/88146 + PR c++/99362 + * g++.dg/cpp2a/nodiscard-constructor.c: Renamed to ... + * g++.dg/cpp2a/nodiscard-constructor1.C: ... this. Remove + -ftrack-macro-expansion=0 from dg-options. Don't use (?n) in + dg-warning regexps, instead replace .* with \[^\n\r]*. + * g++.dg/cpp2a/nodiscard-constructor2.C: New test. + * g++.dg/cpp2a/nodiscard-reason-only-one.C: Remove + -ftrack-macro-expansion=0 from dg-options. + * g++.dg/cpp2a/nodiscard-reason-nonstring.C: Likewise. + * g++.dg/cpp2a/nodiscard-once.C: Likewise. + +2021-03-04 Jakub Jelinek <jakub@redhat.com> + + PR c/99325 + * gcc.dg/cpp/line11.c: New test. + * gcc.dg/cpp/line12.c: New test. + +2021-03-04 Alex Coplan <alex.coplan@arm.com> + + PR target/99381 + * gcc.target/aarch64/pr99381.c: New test. + +2021-03-04 Ilya Leoshkevich <iii@linux.ibm.com> + + * gcc.target/s390/mul-signed-overflow-1.c: Compile on old + machines. + * gcc.target/s390/mul-signed-overflow-2.c: Likewise. + +2021-03-04 Nathan Sidwell <nathan@acm.org> + + PR c++/99170 + * g++.dg/modules/pr99170-1_a.H: New. + * g++.dg/modules/pr99170-1_b.C: New. + * g++.dg/modules/pr99170-2.h: New. + * g++.dg/modules/pr99170-2_a.C: New. + * g++.dg/modules/pr99170-2_b.C: New. + * g++.dg/modules/pr99170-3_a.H: New. + * g++.dg/modules/pr99170-3_b.C: New. + * g++.dg/modules/inst-2_b.C: Adjust scan. + * g++.dg/modules/inst-4_a.C: Adjust scan. + * g++.dg/modules/inst-4_b.C: Adjust scan. + * g++.dg/modules/member-def-1_b.C: Adjust scan. + * g++.dg/modules/member-def-1_c.C: Adjust scan. + * g++.dg/modules/tpl-spec-1_a.C: Adjust scan. + * g++.dg/modules/tpl-spec-1_b.C: Adjust scan. + * g++.dg/modules/tpl-spec-2_b.C: Adjust scan. + * g++.dg/modules/tpl-spec-2_c.C: Adjust scan. + * g++.dg/modules/tpl-spec-2_d.C: Adjust scan. + * g++.dg/modules/tpl-spec-3_a.C: Adjust scan. + * g++.dg/modules/tpl-spec-3_b.C: Adjust scan. + * g++.dg/modules/tpl-spec-4_a.C: Adjust scan. + * g++.dg/modules/tpl-spec-4_b.C: Adjust scan. + * g++.dg/modules/tpl-spec-5_a.C: Adjust scan. + * g++.dg/modules/tpl-spec-5_b.C: Adjust scan. + +2021-03-04 Tobias Burnus <tobias@codesourcery.com> + + PR fortran/99355 + * gfortran.dg/real4-10-real8-10.f90: New test. + * gfortran.dg/real4-10-real8-16.f90: New test. + * gfortran.dg/real4-10-real8-4.f90: New test. + * gfortran.dg/real4-10.f90: New test. + * gfortran.dg/real4-16-real8-10.f90: New test. + * gfortran.dg/real4-16-real8-16.f90: New test. + * gfortran.dg/real4-16-real8-4.f90: New test. + * gfortran.dg/real4-16.f90: New test. + * gfortran.dg/real4-8-real8-10.f90: New test. + * gfortran.dg/real4-8-real8-16.f90: New test. + * gfortran.dg/real4-8-real8-4.f90: New test. + * gfortran.dg/real4-8.f90: New test. + * gfortran.dg/real8-10.f90: New test. + * gfortran.dg/real8-16.f90: New test. + * gfortran.dg/real8-4.f90: New test. + +2021-03-04 Hans-Peter Nilsson <hp@axis.com> + + * gcc.misc-tests/outputs.exp: Enumerate tests. + +2021-03-04 Hans-Peter Nilsson <hp@axis.com> + + * gcc.misc-tests/outputs.exp: Append discriminating + suffixes to tests with duplicate names. + (outest): Assert that each running test has a unique + name. + +2021-03-04 Martin Sebor <msebor@redhat.com> + + PR middle-end/96963 + PR middle-end/94655 + * gcc.dg/Wstringop-overflow-47.c: Xfail tests. + * gcc.dg/Wstringop-overflow-65.c: New test. + * gcc.dg/Warray-bounds-69.c: Same. + +2021-03-03 Marek Polacek <polacek@redhat.com> + + PR c++/96474 + * g++.dg/cpp1z/class-deduction83.C: New test. + +2021-03-03 Jonathan Wright <jonathan.wright@arm.com> + + * gcc.target/aarch64/advsimd-intrinsics/vcvt_fXX_fXX.c: + New test. + * gcc.target/aarch64/advsimd-intrinsics/vcvtx.c: + New test. + +2021-03-03 Jonathan Wright <jonathan.wright@arm.com> + + * gcc.target/aarch64/advsimd-intrinsics/vmovn_high.c: + New test. + * gcc.target/aarch64/advsimd-intrinsics/vqmovn_high.c: + New test. + * gcc.target/aarch64/advsimd-intrinsics/vqmovun_high.c: + New test. + +2021-03-03 Jonathan Wright <jonathan.wright@arm.com> + + * gcc.target/aarch64/advsimd-intrinsics/vrshrn_high_n.c: + New test. + * gcc.target/aarch64/advsimd-intrinsics/vshrn_high_n.c: + New test. + +2021-03-03 Jonathan Wright <jonathan.wright@arm.com> + + * gcc.target/aarch64/advsimd-intrinsics/vXXXhn_high.inc: + New test template. + * gcc.target/aarch64/advsimd-intrinsics/vaddhn_high.c: + New test. + * gcc.target/aarch64/advsimd-intrinsics/vraddhn_high.c: + New test. + * gcc.target/aarch64/advsimd-intrinsics/vrsubhn_high.c: + New test. + * gcc.target/aarch64/advsimd-intrinsics/vsubhn_high.c: + New test. + +2021-03-03 Jakub Jelinek <jakub@redhat.com> + + PR c++/82959 + * g++.dg/cpp1z/eval-order10.C: New test. + +2021-03-03 Marek Polacek <polacek@redhat.com> + + PR c++/97034 + PR c++/99009 + * g++.dg/cpp1z/class-deduction81.C: New test. + * g++.dg/cpp1z/class-deduction82.C: New test. + * g++.dg/cpp2a/class-deduction-aggr8.C: New test. + * g++.dg/cpp2a/class-deduction-aggr9.C: New test. + * g++.dg/cpp2a/class-deduction-aggr10.C: New test. + +2021-03-03 Jason Merrill <jason@redhat.com> + + PR c++/95675 + * g++.dg/cpp0x/decltype-call5.C: New test. + * g++.dg/cpp0x/decltype-call6.C: New test. + +2021-03-03 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + * gcc.target/i386/pr95798-1.c: Add -fomit-frame-pointer to + dg-options. + * gcc.target/i386/pr95798-2.c: Likewise. + +2021-03-03 Nathan Sidwell <nathan@acm.org> + + PR c++/99344 + * g++.dg/modules/namespace-2_a.C + * g++.dg/modules/pr99344_a.C + * g++.dg/modules/pr99344_b.C + +2021-03-03 Jakub Jelinek <jakub@redhat.com> + + PR target/99321 + * gcc.target/i386/pr99321.c: New test. + +2021-03-03 Jakub Jelinek <jakub@redhat.com> + + PR c/99324 + * gcc.c-torture/compile/pr99324.c: New test. + +2021-03-03 Jakub Jelinek <jakub@redhat.com> + + PR target/99085 + * gcc.dg/graphite/pr99085.c: New test. + +2021-03-03 Jason Merrill <jason@redhat.com> + + PR c++/96078 + * g++.dg/ext/attr-flatten1.C: New test. + +2021-03-02 Hans-Peter Nilsson <hp@axis.com> + + * gcc.misc-tests/outputs.exp: Skip @file -save-temps + tests if target test-framework has -L or -I options. + +2021-03-02 David Malcolm <dmalcolm@redhat.com> + + PR c/99323 + * gcc.dg/pr99323-1.c: New test. + * gcc.dg/pr99323-2.c: New test. + +2021-03-02 Martin Sebor <msebor@redhat.com> + + PR c++/99251 + * g++.dg/warn/Wnonnull9.C: Expect no warnings. + * g++.dg/warn/Wnonnull12.C: New test. + +2021-03-02 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/limited5.adb: New test. + +2021-03-02 Patrick Palka <ppalka@redhat.com> + + PR c++/96443 + PR c++/96960 + * g++.dg/concepts/abbrev9.C: New test. + * g++.dg/cpp2a/concepts-lambda15.C: New test. + * g++.dg/cpp2a/concepts-placeholder3.C: New test. + * g++.dg/cpp2a/concepts-return-req2.C: New test. + * g++.dg/cpp2a/concepts-ts1.C: Add dg-bogus directive to the + call to f15 that we expect to accept. + +2021-03-02 Patrick Palka <ppalka@redhat.com> + + * g++.dg/cpp1z/auto1.C: New test. + +2021-03-02 Andreas Krebbel <krebbel@linux.ibm.com> + + * gcc.target/s390/zvector/vec-nnpa-fp16-convert.c: New test. + * gcc.target/s390/zvector/vec-nnpa-fp32-convert-1.c: New test. + * gcc.target/s390/zvector/vec_convert_from_fp16.c: New test. + * gcc.target/s390/zvector/vec_convert_to_fp16.c: New test. + * gcc.target/s390/zvector/vec_extend_to_fp32_hi.c: New test. + * gcc.target/s390/zvector/vec_extend_to_fp32_lo.c: New test. + * gcc.target/s390/zvector/vec_round_from_fp32.c: New test. + +2021-03-02 Andreas Krebbel <krebbel@linux.ibm.com> + + * lib/target-supports.exp: Add check for nnpa facility. + +2021-03-02 Andreas Krebbel <krebbel@linux.ibm.com> + + * gcc.target/s390/mul-signed-overflow-1.c: Run only on z14. + * gcc.target/s390/mul-signed-overflow-2.c: Run only on z14. + +2021-03-01 Martin Liska <mliska@suse.cz> + + PR target/99313 + * gcc.target/s390/target-attribute/pr99313.c: New test. + +2021-03-01 Nathan Sidwell <nathan@acm.org> + + PR c++/99294 + * g++.dg/modules/pr99294.h: New. + * g++.dg/modules/pr99294_a.C: New. + * g++.dg/modules/pr99294_b.C: New. + +2021-03-01 Eric Botcazou <ebotcazou@adacore.com> + + * g++.dg/eh/seh-xmm-unwind.C: New test. + +2021-02-28 Iain Sandoe <iain@sandoe.co.uk> + + * g++.dg/coroutines/pr94879-folly-1.C: Make final suspend + expression components noexcept. + * g++.dg/coroutines/pr94883-folly-2.C: Likewise. + * g++.dg/coroutines/pr95345.C: Likewise. + +2021-02-28 Jason Merrill <jason@redhat.com> + + * g++.dg/ext/attr-lambda3.C: Add missing ; + +2021-02-27 Jason Merrill <jason@redhat.com> + + PR c++/90333 + * g++.dg/ext/attr-lambda3.C: New test. + +2021-02-26 Alexandre Oliva <oliva@gnu.org> + + * gcc.target/powerpc/pr67789.c: Revert fpic target requirement + duplication. + * gcc.target/powerpc/pr83629.c: Likewise. + * gcc.target/powerpc/pr84112.c: Likewise. + +2021-02-26 Olivier Hainque <hainque@adacore.com> + + * gcc.target/powerpc/compress-float-ppc-pic.c: Add + dg-require-effective-target fpic. + * gcc.target/powerpc/ppc-eabi.c: Likewise. + * gcc.target/powerpc/pr26350.c: Likewise. + * gcc.target/powerpc/pr67789.c: Likewise. + * gcc.target/powerpc/pr79439-1.c: Likewise. + * gcc.target/powerpc/pr79439-2.c: Likewise. + * gcc.target/powerpc/pr79439-3.c: Likewise. + * gcc.target/powerpc/pr83629.c: Likewise. + * gcc.target/powerpc/pr84112.c: Likewise. + +2021-02-26 Richard Biener <rguenther@suse.de> + + PR middle-end/99281 + * g++.dg/pr99218.C: New testcase. + +2021-02-26 Jakub Jelinek <jakub@redhat.com> + + * g++.dg/cpp23/lambda-specifiers1.C: New test. + +2021-02-26 Jakub Jelinek <jakub@redhat.com> + + PR c++/95451 + * g++.dg/cpp1y/lambda-generic-95451.C: New test. + +2021-02-26 Jason Merrill <jason@redhat.com> + + PR c++/98810 + * g++.dg/cpp2a/nontype-class-defarg1.C: New test. + +2021-02-26 Aaron Sawdey <acsawdey@linux.ibm.com> + + * gcc.target/powerpc/pcrel-opt-inc-di.c: New test. + * gcc.target/powerpc/pcrel-opt-ld-df.c: New test. + * gcc.target/powerpc/pcrel-opt-ld-di.c: New test. + * gcc.target/powerpc/pcrel-opt-ld-hi.c: New test. + * gcc.target/powerpc/pcrel-opt-ld-qi.c: New test. + * gcc.target/powerpc/pcrel-opt-ld-sf.c: New test. + * gcc.target/powerpc/pcrel-opt-ld-si.c: New test. + * gcc.target/powerpc/pcrel-opt-ld-vector.c: New test. + * gcc.target/powerpc/pcrel-opt-st-df.c: New test. + * gcc.target/powerpc/pcrel-opt-st-di.c: New test. + * gcc.target/powerpc/pcrel-opt-st-hi.c: New test. + * gcc.target/powerpc/pcrel-opt-st-qi.c: New test. + * gcc.target/powerpc/pcrel-opt-st-sf.c: New test. + * gcc.target/powerpc/pcrel-opt-st-si.c: New test. + * gcc.target/powerpc/pcrel-opt-st-vector.c: New test. + +2021-02-26 Patrick Palka <ppalka@redhat.com> + + PR c++/98990 + * g++.dg/concepts/abbrev8.C: New test. + +2021-02-25 Patrick Palka <ppalka@redhat.com> + + PR c++/99213 + PR c++/94521 + * g++.dg/diagnostic/local1.C: New test. + +2021-02-25 Patrick Palka <ppalka@redhat.com> + + PR c++/99103 + * g++.dg/cpp1z/class-deduction79.C: New test. + * g++.dg/cpp1z/class-deduction80.C: New test. + +2021-02-25 Marek Polacek <polacek@redhat.com> + + DR 1312 + PR c++/99176 + * g++.dg/cpp0x/constexpr-nullptr-2.C: Adjust dg-error. + * g++.dg/cpp0x/constexpr-cast2.C: New test. + * g++.dg/cpp0x/constexpr-cast3.C: New test. + +2021-02-25 Iain Sandoe <iain@sandoe.co.uk> + + PR c++/97587 + * g++.dg/coroutines/coro1-refs-and-ctors.h: Add a CTOR with two + reference parms, to distinguish the rvalue ref. variant. + * g++.dg/coroutines/pr97587.C: New test. + +2021-02-25 Iain Sandoe <iain@sandoe.co.uk> + + PR c++/95822 + * g++.dg/coroutines/pr95822.C: New test. + +2021-02-25 Richard Earnshaw <rearnsha@arm.com> + + * gcc.target/arm/cmse/cmse-18.c: New test. + +2021-02-25 Nathan Sidwell <nathan@acm.org> + + PR c++/99166 + * g++.dg/modules/pr99166_a.X: Adjust. + * g++.dg/modules/pr99166_b.C: Adjust. + * g++.dg/modules/pr99166_c.C: Adjust. + * g++.dg/modules/pr99166_d.C: Adjust. + +2021-02-25 Hans-Peter Nilsson <hp@axis.com> + + * gfortran.dg/pr95690.f90: CRIS error appears on line 5. + +2021-02-25 Tamar Christina <tamar.christina@arm.com> + + * g++.dg/vect/simd-complex-num-null-node.cc: New test. + +2021-02-25 Vladimir N. Makarov <vmakarov@redhat.com> + + PR testsuite/99233 + * gcc.target/powerpc/pr96264.c: Run it only for powerpc64le. + +2021-02-25 Christophe Lyon <christophe.lyon@linaro.org> + + PR middle-end/97172 + * gcc.dg/pr97172-2.c: Add dg-require-effective-target shared. + +2021-02-25 Richard Biener <rguenther@suse.de> + + PR tree-optimization/99253 + * gcc.dg/vect/pr99253.c: New testcase. + +2021-02-25 Jakub Jelinek <jakub@redhat.com> + + PR target/95798 + * gcc.target/i386/pr95798-1.c: New test. + * gcc.target/i386/pr95798-2.c: New test. + +2021-02-25 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/80635 + * g++.dg/warn/pr80635-1.C: New test. + * g++.dg/warn/pr80635-2.C: New test. + +2021-02-25 David Malcolm <dmalcolm@redhat.com> + + PR analyzer/99193 + * gcc.dg/analyzer/pr99193-1.c: New test. + * gcc.dg/analyzer/pr99193-2.c: New test. + * gcc.dg/analyzer/pr99193-3.c: New test. + * gcc.dg/analyzer/realloc-1.c: New test. + +2021-02-24 Nathan Sidwell <nathan@acm.org> + + PR c++/98718 + * g++.dg/modules/pr98718_a.C: New. + * g++.dg/modules/pr98718_b.C: New. + +2021-02-24 Iain Sandoe <iain@sandoe.co.uk> + + * g++.dg/coroutines/co-await-void_type.C: Mark promise + final_suspend call as noexcept. + * g++.dg/coroutines/co-return-syntax-08-bad-return.C: Likewise. + * g++.dg/coroutines/co-return-syntax-10-movable.C: Likewise. + * g++.dg/coroutines/co-return-warning-1.C: Likewise. + * g++.dg/coroutines/co-yield-syntax-08-needs-expr.C: Likewise. + * g++.dg/coroutines/coro-bad-gro-00-class-gro-scalar-return.C: Likewise. + * g++.dg/coroutines/coro-bad-gro-01-void-gro-non-class-coro.C: Likewise. + * g++.dg/coroutines/coro-missing-gro.C: Likewise. + * g++.dg/coroutines/coro-missing-promise-yield.C: Likewise. + * g++.dg/coroutines/coro-missing-ret-value.C: Likewise. + * g++.dg/coroutines/coro-missing-ret-void.C: Likewise. + * g++.dg/coroutines/coro-missing-ueh.h: Likewise. + * g++.dg/coroutines/coro1-allocators.h: Likewise. + * g++.dg/coroutines/coro1-refs-and-ctors.h: Likewise. + * g++.dg/coroutines/coro1-ret-int-yield-int.h: Likewise. + * g++.dg/coroutines/pr94682-preview-this.C: Likewise. + * g++.dg/coroutines/pr94752.C: Likewise. + * g++.dg/coroutines/pr94760-mismatched-traits-and-promise-prev.C: Likewise. + * g++.dg/coroutines/pr94879-folly-1.C: Likewise. + * g++.dg/coroutines/pr94883-folly-2.C: Likewise. + * g++.dg/coroutines/pr95050.C: Likewise. + * g++.dg/coroutines/pr95345.C: Likewise. + * g++.dg/coroutines/pr95440.C: Likewise. + * g++.dg/coroutines/pr95591.C: Likewise. + * g++.dg/coroutines/pr95711.C: Likewise. + * g++.dg/coroutines/pr95813.C: Likewise. + * g++.dg/coroutines/symmetric-transfer-00-basic.C: Likewise. + * g++.dg/coroutines/torture/co-await-07-tmpl.C: Likewise. + * g++.dg/coroutines/torture/co-await-17-capture-comp-ref.C: Likewise. + * g++.dg/coroutines/torture/co-ret-00-void-return-is-ready.C: Likewise. + * g++.dg/coroutines/torture/co-ret-01-void-return-is-suspend.C: Likewise. + * g++.dg/coroutines/torture/co-ret-03-different-GRO-type.C: Likewise. + * g++.dg/coroutines/torture/co-ret-04-GRO-nontriv.C: Likewise. + * g++.dg/coroutines/torture/co-ret-06-template-promise-val-1.C: Likewise. + * g++.dg/coroutines/torture/co-ret-08-template-cast-ret.C: Likewise. + * g++.dg/coroutines/torture/co-ret-09-bool-await-susp.C: Likewise. + * g++.dg/coroutines/torture/co-ret-15-default-return_void.C: Likewise. + * g++.dg/coroutines/torture/co-ret-17-void-ret-coro.C: Likewise. + * g++.dg/coroutines/torture/co-yield-00-triv.C: Likewise. + * g++.dg/coroutines/torture/co-yield-03-tmpl.C: Likewise. + * g++.dg/coroutines/torture/co-yield-04-complex-local-state.C: Likewise. + * g++.dg/coroutines/torture/exceptions-test-0.C: Likewise. + * g++.dg/coroutines/torture/exceptions-test-01-n4849-a.C: Likewise. + * g++.dg/coroutines/torture/func-params-04.C: Likewise. + * g++.dg/coroutines/torture/local-var-06-structured-binding.C: Likewise. + * g++.dg/coroutines/torture/mid-suspend-destruction-0.C: Likewise. + +2021-02-24 Jakub Jelinek <jakub@redhat.com> + + PR fortran/99226 + * c-c++-common/gomp/pr99226.c: New test. + * gfortran.dg/gomp/pr99226.f90: New test. + +2021-02-24 Vladimir N. Makarov <vmakarov@redhat.com> + + PR inline-asm/99123 + * gcc.target/i386/pr99123.c: New. + +2021-02-24 Hans-Peter Nilsson <hp@axis.com> + + * gcc.dg/stack-usage-1.c: Adjust for CRIS. + +2021-02-24 Nathan Sidwell <nathan@acm.org> + + PR c++/99072 + * g++.dg/modules/pr99072.H: New. + +2021-02-24 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/98342 + * gfortran.dg/assumed_rank_21.f90 : New test. + +2021-02-24 Martin Sebor <msebor@redhat.com> + + PR middle-end/97172 + * gcc.dg/pr97172-2.c: New test. + +2021-02-24 Tamar Christina <tamar.christina@arm.com> + + PR tree-optimization/99220 + * g++.dg/vect/pr99220.cc: New test. + +2021-02-24 Tamar Christina <tamar.christina@arm.com> + + PR tree-optimization/99149 + * g++.dg/vect/pr99149.cc: Disabled on BE. + +2021-02-24 Iain Sandoe <iain@sandoe.co.uk> + + PR c++/96251 + * g++.dg/coroutines/pr96251.C: New test. + +2021-02-24 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/99225 + * gcc.c-torture/compile/pr99225.c: New test. + +2021-02-24 Tamar Christina <tamar.christina@arm.com> + + PR tree-optimization/99149 + * g++.dg/vect/pr99149.cc: New test. + +2021-02-24 Richard Biener <rguenther@suse.de> + + PR c/99224 + * gcc.dg/pr99224.c: New testcase. + +2021-02-23 Peter Bergner <bergner@linux.ibm.com> + + * gcc.target/powerpc/mma-builtin-4.c: Add tests for + __builtin_vsx_assemble_pair and __builtin_vsx_disassemble_pair. + Add __has_builtin tests for built-ins. + Update expected instruction counts. + +2021-02-23 Martin Sebor <msebor@redhat.com> + + PR c++/99074 + * g++.dg/warn/Wnonnull11.C: New test. + +2021-02-23 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/99124 + * gfortran.dg/class_defined_operator_2.f03 : New test. + * gfortran.dg/elemental_result_2.f90 : New test. + * gfortran.dg/class_assign_4.f90: Correct the non-conforming + elemental function with an allocatable result with an operator + interface with array dummies and result. + +2021-02-23 Harald Anlauf <anlauf@gmx.de> + + PR fortran/99206 + * gfortran.dg/reshape_zerosize_4.f90: New test. + +2021-02-23 Nathan Sidwell <nathan@acm.org> + + PR c++/99208 + * g++.dg/modules/pr99208_a.C: New. + * g++.dg/modules/pr99208_b.C: New. + +2021-02-23 Martin Liska <mliska@suse.cz> + + PR sanitizer/99168 + * c-c++-common/asan/pr99168.c: New test. + +2021-02-23 Patrick Palka <ppalka@redhat.com> + + PR c++/95468 + * g++.dg/template/non-dependent15.C: New test. + +2021-02-23 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/99204 + * gfortran.dg/pr99204.f90: New test. + +2021-02-23 Kewen Lin <linkw@linux.ibm.com> + + * gcc.target/powerpc/vec-init-10.c: New test. + +2021-02-23 Hans-Peter Nilsson <hp@axis.com> + + * g++.dg/warn/Wplacement-new-size-1.C, + g++.dg/warn/Wplacement-new-size-2.C, + g++.dg/warn/Wplacement-new-size-6.C: Adjust for + default_packed targets. + +2021-02-22 David Malcolm <dmalcolm@redhat.com> + + PR analyzer/99196 + * gcc.dg/analyzer/error-1.c: New test. + * gcc.dg/analyzer/error-2.c: New test. + * gcc.dg/analyzer/error-3.c: New test. + +2021-02-22 H.J. Lu <hjl.tools@gmail.com> + + PR testsuite/99173 + * c-c++-common/attr-retain-5.c: Require R_flag_in_section. + * c-c++-common/attr-retain-6.c: Likewise. + * c-c++-common/attr-retain-7.c: Likewise. + * c-c++-common/attr-retain-8.c: Likewise. + * c-c++-common/attr-retain-9.c: Likewise. + +2021-02-22 Kyrylo Tkachov <kyrylo.tkachov@arm.com> + + * gcc.target/aarch64/sve/cse_sve_vl_constants_1.c: New test. + +2021-02-22 Hans-Peter Nilsson <hp@axis.com> + + * g++.dg/warn/Warray-bounds-10.C, g++.dg/warn/Warray-bounds-11.C, + g++.dg/warn/Warray-bounds-12.C, g++.dg/warn/Warray-bounds-13.C: + Handle __INT32_TYPE__ being "long int". + +2021-02-22 Hans-Peter Nilsson <hp@axis.com> + + * gcc.target/cris/biap.c: Add a Y+=X*2 to the Y+=X*4. + +2021-02-22 Hans-Peter Nilsson <hp@axis.com> + + * gcc.target/cris/biap-mul.c: New test. + +2021-02-22 Hans-Peter Nilsson <hp@axis.com> + + * gcc.target/cris/torture/sync-reload-mul-1.c: New test. + +2021-02-22 Nathan Sidwell <nathan@acm.org> + + PR c++/99174 + * g++.dg/modules/pr99174-1_a.C: New. + * g++.dg/modules/pr99174-1_b.C: New. + * g++.dg/modules/pr99174-1_c.C: New. + * g++.dg/modules/pr99174.H: New. + +2021-02-22 Nathan Sidwell <nathan@acm.org> + + PR c++/99153 + * g++.dg/modules/pr99153_a.H: New. + * g++.dg/modules/pr99153_b.H: New. + +2021-02-22 Andre Vieira <andre.simoesdiasvieira@arm.com> + + PR rtl-optimization/98791 + * gcc.target/aarch64/sve/pr98791.c: New test. + +2021-02-22 Richard Biener <rguenther@suse.de> + + PR tree-optimization/99165 + * g++.dg/pr99165.C: New testcase. + +2021-02-21 Harald Anlauf <anlauf@gmx.de> + + * gfortran.dg/intent_optimize_3.f90: New test. + +2021-02-20 David Edelsohn <dje.gcc@gmail.com> + + * c-c++-common/attr-retain-5.c: Skip on AIX. + * c-c++-common/attr-retain-6.c: Same. + * c-c++-common/attr-retain-7.c: Same. + * c-c++-common/attr-retain-8.c: Same. + * c-c++-common/attr-retain-9.c: Same. + +2021-02-20 Ilya Leoshkevich <iii@linux.ibm.com> + + PR target/99134 + * gcc.target/s390/vector/long-double-from-decimal128.c: New test. + * gcc.target/s390/vector/long-double-from-decimal32.c: New test. + * gcc.target/s390/vector/long-double-from-decimal64.c: New test. + * gcc.target/s390/vector/long-double-to-decimal128.c: New test. + * gcc.target/s390/vector/long-double-to-decimal32.c: New test. + * gcc.target/s390/vector/long-double-to-decimal64.c: New test. + +2021-02-19 Nathan Sidwell <nathan@acm.org> + + PR c++/98741 + * g++.dg/modules/pr98741_a.H: New. + * g++.dg/modules/pr98741_b.H: New. + * g++.dg/modules/pr98741_c.C: New. + * g++.dg/modules/pr98741_d.C: New. + +2021-02-19 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR fortran/98686 + * gfortran.dg/namelist_4.f90: Modify. + * gfortran.dg/namelist_98.f90: New test. + +2021-02-19 Martin Sebor <msebor@redhat.com> + + PR c/97172 + * gcc.dg/pr97172.c: Add test cases. + +2021-02-19 Nathan Sidwell <nathan@acm.org> + + * g++.dg/modules/pr99166_a.X: New. + * g++.dg/modules/pr99166_b.C: New. + * g++.dg/modules/pr99166_c.C: New. + * g++.dg/modules/pr99166_d.C: New. + +2021-02-19 Tobias Burnus <tobias@codesourcery.com> + + PR fortran/99010 + * gfortran.dg/coarray/array_temporary-1.f90: New test. + +2021-02-19 Tobias Burnus <tobias@codesourcery.com> + + PR fortran/99146 + * gfortran.dg/dtio_36.f90: New test. + +2021-02-19 Richard Biener <rguenther@suse.de> + + PR middle-end/99122 + * gcc.dg/pr99122-3.c: New testcase. + +2021-02-19 Jakub Jelinek <jakub@redhat.com> + + PR target/98998 + * gcc.target/arm/pure-code/pr98998.c: New test. + +2021-02-19 Jakub Jelinek <jakub@redhat.com> + + PR ipa/99034 + * g++.dg/opt/pr99034.C: New test. + +2021-02-19 Tobias Burnus <tobias@codesourcery.com> + + PR fortran/99027 + * gfortran.dg/ubound_1.f90: New test. + +2021-02-19 Andre Vieira <andre.simoesdiasvieira@arm.com> + + PR target/98657 + * gcc.target/aarch64/sve/pr98657.c: New test. + +2021-02-19 Jason Merrill <jason@redhat.com> + + * g++.dg/cpp0x/decltype64.C: Change argument to const&. + +2021-02-19 David Malcolm <dmalcolm@redhat.com> + + PR jit/99126 + * jit.dg/test-trap.c: New test. + +2021-02-19 Jason Merrill <jason@redhat.com> + + PR c++/96926 + * g++.dg/cpp0x/overload4.C: New test. + +2021-02-18 Vladimir N. Makarov <vmakarov@redhat.com> + + PR rtl-optimization/96264 + * gcc.target/powerpc/pr96264.c: New. + +2021-02-18 H.J. Lu <hjl.tools@gmail.com> + + PR target/99113 + * c-c++-common/attr-retain-1.c: New test. + * c-c++-common/attr-retain-2.c: Likewise. + * c-c++-common/attr-retain-3.c: Likewise. + * c-c++-common/attr-retain-4.c: Likewise. + * c-c++-common/attr-retain-5.c: Likewise. + * c-c++-common/attr-retain-6.c: Likewise. + * c-c++-common/attr-retain-7.c: Likewise. + * c-c++-common/attr-retain-8.c: Likewise. + * c-c++-common/attr-retain-9.c: Likewise. + * c-c++-common/pr99113.c: Likewise. + * gcc.c-torture/compile/attr-retain-1.c: Likewise. + * gcc.c-torture/compile/attr-retain-2.c: Likewise. + * c-c++-common/attr-used.c: Don't expect SHF_GNU_RETAIN section. + * c-c++-common/attr-used-2.c: Likewise. + * c-c++-common/attr-used-3.c: Likewise. + * c-c++-common/attr-used-4.c: Likewise. + * c-c++-common/attr-used-9.c: Likewise. + * gcc.c-torture/compile/attr-used-retain-1.c: Likewise. + * gcc.c-torture/compile/attr-used-retain-2.c: Likewise. + * c-c++-common/attr-used-5.c: Don't expect warning for the used + attribute nor SHF_GNU_RETAIN section. + * c-c++-common/attr-used-6.c: Likewise. + * c-c++-common/attr-used-7.c: Likewise. + * c-c++-common/attr-used-8.c: Likewise. + +2021-02-18 Nathan Sidwell <nathan@acm.org> + + PR c++/99023 + * g++.dg/modules/modules.exp: Bail on cross-testing. Add support + for .X files. + * g++.dg/modules/pr99023_a.X: New. + * g++.dg/modules/pr99023_b.X: New. + +2021-02-18 Jakub Jelinek <jakub@redhat.com> + + PR c/99136 + * gcc.dg/pr99136.c: New test. + +2021-02-18 Nathan Sidwell <nathan@acm.org> + + PR c++/99023 + * g++.dg/modules/modules.exp: Remove dg-module-headers support + * g++.dg/modules/alias-2_a.H: Delete. + * g++.dg/modules/sys/alias-2_a.H: Delete. + +2021-02-18 Nathan Sidwell <nathan@acm.org> + + PR c++/99150 + * g++.dg/modules/pr99023_a.H: Delete. + * g++.dg/modules/pr99023_b.H: Delete. + +2021-02-18 Jakub Jelinek <jakub@redhat.com> + + PR c++/99132 + * g++.dg/cpp2a/constexpr-virtual18.C: New test. + +2021-02-18 Richard Biener <rguenther@suse.de> + + PR middle-end/99122 + * gcc.dg/pr99122-1.c: New testcase. + * gcc.dg/pr99122-2.c: Likewise. + +2021-02-18 Hans-Peter Nilsson <hp@axis.com> + + PR tree-optimization/99142 + * gcc.dg/tree-ssa/pr99142.c: New test. + +2021-02-18 Jakub Jelinek <jakub@redhat.com> + + PR middle-end/99109 + * g++.dg/warn/Warray-bounds-17.C: New test. + +2021-02-18 Jakub Jelinek <jakub@redhat.com> + + PR target/99104 + * gcc.dg/pr99104.c: New test. + +2021-02-17 David Malcolm <dmalcolm@redhat.com> + + PR analyzer/94596 + * gcc.dg/analyzer/pr94596.c: New test. + +2021-02-17 Nathan Sidwell <nathan@acm.org> + + PR c++/99023 + * g++.dg/modules/pr99023_a.H: New. + * g++.dg/modules/pr99023_b.H: New. + +2021-02-17 David Malcolm <dmalcolm@redhat.com> + + PR analyzer/98969 + * g++.dg/analyzer/pr99064.C: Convert dg-bogus to dg-warning. + * gcc.dg/analyzer/pr96841.c: Add -Wno-analyzer-too-complex to + options. Remove false leak directive. + * gcc.dg/analyzer/pr98969.c (test_1): Remove xfail from leak + false positive. + (test_3): New. + +2021-02-17 Julian Brown <julian@codesourcery.com> + + * gfortran.dg/goacc/array-with-dt-2.f90: Remove expected errors. + * gfortran.dg/goacc/array-with-dt-6.f90: New test. + * gfortran.dg/goacc/mapping-tests-2.f90: Update expected error. + * gfortran.dg/goacc/ref_inquiry.f90: Update expected errors. + * gfortran.dg/gomp/ref_inquiry.f90: Likewise. + +2021-02-17 Julian Brown <julian@codesourcery.com> + + * gfortran.dg/goacc/array-with-dt-1.f90: New test. + * gfortran.dg/goacc/array-with-dt-3.f90: Likewise. + * gfortran.dg/goacc/array-with-dt-4.f90: Likewise. + * gfortran.dg/goacc/array-with-dt-5.f90: Likewise. + * gfortran.dg/goacc/derived-chartypes-1.f90: Re-enable test. + * gfortran.dg/goacc/derived-chartypes-2.f90: Likewise. + * gfortran.dg/goacc/derived-classtypes-1.f95: Uncomment + previously-broken directives. + +2021-02-17 Jakub Jelinek <jakub@redhat.com> + + PR sanitizer/99106 + * g++.dg/ubsan/pr99106.C: New test. + +2021-02-17 Nathan Sidwell <nathan@acm.org> + + PR c++/99116 + * g++.dg/lookup/pr99116-1.C: New. + * g++.dg/lookup/pr99116-2.C: New. + +2021-02-17 Nathan Sidwell <nathan@acm.org> + + PR c++/99071 + * g++.dg/modules/pr99071_a.H: New. + * g++.dg/modules/pr99071_b.H: New. + +2021-02-17 Patrick Palka <ppalka@redhat.com> + + PR debug/96997 + PR c++/94034 + * g++.dg/cpp1y/constexpr-nsdmi7b.C: Adjust expected location of + "call to non-'constexpr' function" error message. + +2021-02-16 Nathan Sidwell <nathan@acm.org> + + * g++.dg/modules/pr99050_a.H: New. + * g++.dg/modules/pr99050_b.C: New. + +2021-02-16 Marek Polacek <polacek@redhat.com> + + PR c++/99062 + * gcc.dg/attr-assume_aligned-4.c: Adjust dg-warning. + * g++.dg/ext/attr-assume-aligned.C: New test. + +2021-02-16 YunQiang Su <yunqiang.su@cipunited.com> + + * gcc.target/mips/compact-branches-5.c: Force -fno-PIC. + * gcc.target/mips/compact-branches-6.c: Force -fno-PIC. + +2021-02-16 Tobias Burnus <tobias@codesourcery.com> + + * gfortran.dg/goacc/ref_inquiry.f90: New test. + * gfortran.dg/gomp/ref_inquiry.f90: New test. + +2021-02-16 Vladimir N. Makarov <vmakarov@redhat.com> + + PR inline-asm/98096 + * gcc.c-torture/compile/pr98096.c: New. + +2021-02-16 Tobias Burnus <tobias@codesourcery.com> + + PR fortran/99111 + * gfortran.dg/fmt_nonchar_1.f90: New test. + * gfortran.dg/fmt_nonchar_2.f90: New test. + +2021-02-16 Jakub Jelinek <jakub@redhat.com> + + PR target/99100 + * gcc.target/i386/pr99100.c: New test. + +2021-02-16 Hans-Peter Nilsson <hp@axis.com> + + * gcc.misc-tests/outputs.exp (outest): Fix typo "is_target". + +2021-02-15 Peter Bergner <bergner@linux.ibm.com> + + PR rtl-optimization/98872 + * gcc.target/powerpc/pr98872.c: New test. + +2021-02-15 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/99079 + * gcc.dg/fold-modpow2-2.c: New test. + * gcc.c-torture/execute/pr99079.c: New test. + +2021-02-13 Jakub Jelinek <jakub@redhat.com> + + PR rtl-optimization/98439 + * gcc.target/i386/pr98439.c: New test. + +2021-02-13 Jakub Jelinek <jakub@redhat.com> + + PR target/96166 + * gcc.target/i386/pr96166.c: New test. + +2021-02-12 Jakub Jelinek <jakub@redhat.com> + + * gcc.dg/rtl/aarch64/multi-subreg-1.c: Add dg-do compile directive + and restrict the test to aarch64-*-* target only. + +2021-02-12 Nathan Sidwell <nathan@acm.org> + + * g++.dg/modules/pr99039_a.C: New. + * g++.dg/modules/pr99039_b.C: New. + +2021-02-12 Nathan Sidwell <nathan@acm.org> + + PR c++/99040 + * g++.dg/modules/pr99040_a.C: New. + * g++.dg/modules/pr99040_b.C: New. + * g++.dg/modules/pr99040_c.C: New. + * g++.dg/modules/pr99040_d.C: New. + +2021-02-12 Nathan Sidwell <nathan@acm.org> + + PR c++/99039 + PR c++/99040 + * g++.dg/lookup/pr99039.C: New. + +2021-02-12 Steve Kargl <sgk@troutmask.apl.washington.edu> + + PR libfortran/95647 + * gfortran.dg/ieee/ieee_12.f90: New test. + +2021-02-12 Richard Sandiford <richard.sandiford@arm.com> + + * gcc.dg/rtl/aarch64/multi-subreg-1.c: New test. + +2021-02-12 Christophe Lyon <christophe.lyon@linaro.org> + + PR target/98931 + * gcc.target/arm/pr98931.c: Add -mthumb + +2021-02-12 Tobias Burnus <tobias@codesourcery.com> + + PR fortran/99043 + * gfortran.dg/assumed_rank_20.f90: New test. + +2021-02-12 Jakub Jelinek <jakub@redhat.com> + + PR c++/97742 + * g++.dg/cpp2a/concepts-requires24.C: New test. + +2021-02-12 Jason Merrill <jason@redhat.com> + + PR c++/97246 + * g++.dg/cpp2a/lambda-generic-variadic21.C: New test. + +2021-02-12 David Malcolm <dmalcolm@redhat.com> + + PR analyzer/98969 + * g++.dg/analyzer/pr99064.C: New test. + * gcc.dg/analyzer/pr98969.c: New test. + 2021-02-11 Marek Polacek <polacek@redhat.com> PR c++/95888 diff --git a/gcc/testsuite/c-c++-common/Wstringop-overflow.c b/gcc/testsuite/c-c++-common/Wstringop-overflow.c index 53f5166..5757a23 100644 --- a/gcc/testsuite/c-c++-common/Wstringop-overflow.c +++ b/gcc/testsuite/c-c++-common/Wstringop-overflow.c @@ -115,28 +115,31 @@ void test_strncpy (char **d, const char* s, int i) T (d, "123", sizeof "123"); T (d, ar, sizeof ar); - T (d, s, strlen (s)); /* { dg-warning "\\\[-Wstringop-overflow=]" } */ + /* There is no overflow in the following calls but they are diagnosed + by -Wstringop-truncation. Verify that they aren'y also diagnosed + by -Wstringop-overflow. */ + T (d, s, strlen (s)); { - int n = strlen (s); /* { dg-message "length computed here" } */ - T (d, s, n); /* { dg-warning "\\\[-Wstringop-overflow=]" } */ + int n = strlen (s); + T (d, s, n); } { - unsigned n = strlen (s); /* { dg-message "length computed here" } */ - T (d, s, n); /* { dg-warning "\\\[-Wstringop-overflow=]" } */ + unsigned n = strlen (s); + T (d, s, n); } { size_t n; - n = strlen (s); /* { dg-message "length computed here" } */ - T (d, s, n); /* { dg-warning "\\\[-Wstringop-overflow=]" } */ + n = strlen (s); + T (d, s, n); } { size_t n; - n = strlen (s) - 1; /* { dg-message "length computed here" } */ - T (d, s, n); /* { dg-warning "\\\[-Wstringop-overflow=]" } */ + n = strlen (s) - 1; + T (d, s, n); } { @@ -148,11 +151,8 @@ void test_strncpy (char **d, const char* s, int i) { /* This use of strncpy is certainly dubious and it could well be - diagnosed by -Wstringop-truncation but it isn't. That it is - diagnosed with -Wstringop-overflow is more by accident than - by design. -Wstringop-overflow considers any dependency of - the bound on strlen(s) a potential bug. */ - size_t n = i < strlen (s) ? i : strlen (s); /* { dg-message "length computed here" } */ - T (d, s, n); /* { dg-message ".strncpy\[^\n\r]* specified bound depends on the length of the source argument" } */ + diagnosed by -Wstringop-truncation but it isn't. */ + size_t n = i < strlen (s) ? i : strlen (s); /* { dg-message "length computed here" "note" { xfail *-*-* } } */ + T (d, s, n); /* { dg-message ".strncpy\[^\n\r]* specified bound depends on the length of the source argument" "pr?????" { xfail *-*-* } } */ } } diff --git a/gcc/testsuite/c-c++-common/Wstringop-truncation.c b/gcc/testsuite/c-c++-common/Wstringop-truncation.c index f29eee2..114837b 100644 --- a/gcc/testsuite/c-c++-common/Wstringop-truncation.c +++ b/gcc/testsuite/c-c++-common/Wstringop-truncation.c @@ -226,19 +226,18 @@ void test_strncpy_ptr (char *d, const char* s, const char *t, int i) } { - /* The following is likely buggy but there's no apparent truncation - so it's not diagnosed by -Wstringop-truncation. Instead, it is - diagnosed by -Wstringop-overflow (tested elsewhere). */ + /* The following truncates the terminating nul. The warning should + say that but doesn't. */ int n; n = strlen (s) - 1; - CPY (d, s, n); + CPY (d, s, n); /* { dg-warning "\\\[-Wstringop-truncation" } */ } { /* Same as above. */ size_t n; n = strlen (s) - 1; - CPY (d, s, n); + CPY (d, s, n); /* { dg-warning "\\\[-Wstringop-truncation" } */ } { diff --git a/gcc/testsuite/c-c++-common/asan/pr98920.c b/gcc/testsuite/c-c++-common/asan/pr98920.c new file mode 100644 index 0000000..789a2a3 --- /dev/null +++ b/gcc/testsuite/c-c++-common/asan/pr98920.c @@ -0,0 +1,28 @@ +/* PR sanitizer/98920 */ +/* { dg-do run } */ + +#include <stdio.h> +#include <sys/types.h> +#if __has_include(<regex.h>) +#include <regex.h> +#endif + +int main(void) +{ +#ifdef REG_STARTEND + regex_t r; + const char s[] = "ban\0ana"; + regmatch_t pmatch[10]; + pmatch[0].rm_so = 0; + pmatch[0].rm_eo = sizeof(s); + if (regcomp(&r, "ana", 0)) + return 2; + if (regexec(&r, s, sizeof(pmatch)/sizeof(pmatch[0]), pmatch, REG_STARTEND)) { + fprintf(stderr, "failed to match\n"); + regfree(&r); + return 3; + } + regfree(&r); +#endif + return 0; +} diff --git a/gcc/testsuite/c-c++-common/asan/pr99168.c b/gcc/testsuite/c-c++-common/asan/pr99168.c new file mode 100644 index 0000000..ed59ffb --- /dev/null +++ b/gcc/testsuite/c-c++-common/asan/pr99168.c @@ -0,0 +1,26 @@ +/* PR sanitizer/99168 */ +/* { dg-do run } */ + +struct my_struct +{ + unsigned long volatile x; +} __attribute__((aligned(128))); + +static int variablek[5][6] = {}; +static struct my_struct variables1 = {0UL}; +static struct my_struct variables2 __attribute__((aligned(32))) = {0UL}; + +int main() { + int i, j; + for (i = 0; i < 5; i++) { + for (j = 0; j < 6; j++) { + __builtin_printf("%d ", variablek[i][j]); + } + } + __builtin_printf("\n"); + + __builtin_printf("%lu\n", variables1.x); + __builtin_printf("%lu\n", variables2.x); + + return 0; +} diff --git a/gcc/testsuite/c-c++-common/attr-retain-1.c b/gcc/testsuite/c-c++-common/attr-retain-1.c new file mode 100644 index 0000000..d060fbf --- /dev/null +++ b/gcc/testsuite/c-c++-common/attr-retain-1.c @@ -0,0 +1,16 @@ +/* { dg-do compile { target R_flag_in_section } } */ +/* { dg-options "-O3" } */ + +static void function_declaration_before(void) + __attribute__((__used__, __retain__)); + +static void function_declaration_before(void) {} + +static void function_declaration_after(void) {} + +static void function_declaration_after(void) + __attribute__((__used__, __retain__)); + +/* { dg-final { scan-assembler "function_declaration_before" } } */ +/* { dg-final { scan-assembler "function_declaration_after" } } */ +/* { dg-final { scan-assembler "\.text.*,\"axR\"" { target R_flag_in_section } } } */ diff --git a/gcc/testsuite/c-c++-common/attr-retain-2.c b/gcc/testsuite/c-c++-common/attr-retain-2.c new file mode 100644 index 0000000..6baba84 --- /dev/null +++ b/gcc/testsuite/c-c++-common/attr-retain-2.c @@ -0,0 +1,12 @@ +/* { dg-do compile { target R_flag_in_section } } */ +/* { dg-options "-Wall -O2" } */ + +static int xyzzy __attribute__((__used__, __retain__)) = 1; + +void foo() +{ + int x __attribute__((__retain__)); /* { dg-warning "attribute ignored|unused variable" } */ +} + +/* { dg-final { scan-assembler "xyzzy" } } */ +/* { dg-final { scan-assembler "\.data.*,\"awR\"" { target R_flag_in_section } } } */ diff --git a/gcc/testsuite/c-c++-common/attr-retain-3.c b/gcc/testsuite/c-c++-common/attr-retain-3.c new file mode 100644 index 0000000..a4077a1 --- /dev/null +++ b/gcc/testsuite/c-c++-common/attr-retain-3.c @@ -0,0 +1,7 @@ +/* { dg-do compile { target R_flag_in_section } } */ +/* { dg-options "-Wall -O2 -fcommon" } */ + +static int xyzzy __attribute__((__used__, __retain__)); + +/* { dg-final { scan-assembler "xyzzy" } } */ +/* { dg-final { scan-assembler ",\"awR\"" { target R_flag_in_section } } } */ diff --git a/gcc/testsuite/c-c++-common/attr-retain-4.c b/gcc/testsuite/c-c++-common/attr-retain-4.c new file mode 100644 index 0000000..590e47c --- /dev/null +++ b/gcc/testsuite/c-c++-common/attr-retain-4.c @@ -0,0 +1,7 @@ +/* { dg-do compile { target R_flag_in_section } } */ +/* { dg-options "-Wall -O2 -fcommon" } */ + +int xyzzy __attribute__((__used__, __retain__)); + +/* { dg-final { scan-assembler "xyzzy" } } */ +/* { dg-final { scan-assembler ",\"awR\"" { target R_flag_in_section } } } */ diff --git a/gcc/testsuite/c-c++-common/attr-retain-5.c b/gcc/testsuite/c-c++-common/attr-retain-5.c new file mode 100644 index 0000000..1f3f8bf --- /dev/null +++ b/gcc/testsuite/c-c++-common/attr-retain-5.c @@ -0,0 +1,28 @@ +/* { dg-do compile { target R_flag_in_section } } */ +/* { dg-skip-if "non-ELF target" { *-*-darwin* powerpc*-*-aix* } } */ +/* { dg-options "-Wall -O2" } */ + +struct dtv_slotinfo_list +{ + struct dtv_slotinfo_list *next; +}; + +extern struct dtv_slotinfo_list *list; + +static int __attribute__ ((section ("__libc_freeres_fn"))) +free_slotinfo (struct dtv_slotinfo_list **elemp) +/* { dg-warning "'.*' without 'retain' attribute and '.*' with 'retain' attribute are placed in a section with the same name" "" { target R_flag_in_section } .-1 } */ +{ + if (!free_slotinfo (&(*elemp)->next)) + return 0; + return 1; +} + +__attribute__ ((used, retain, section ("__libc_freeres_fn"))) +static void free_mem (void) +{ + free_slotinfo (&list); +} + +/* { dg-final { scan-assembler "__libc_freeres_fn,\"ax\"" { target R_flag_in_section } } } */ +/* { dg-final { scan-assembler "__libc_freeres_fn,\"axR\"" { target R_flag_in_section } } } */ diff --git a/gcc/testsuite/c-c++-common/attr-retain-6.c b/gcc/testsuite/c-c++-common/attr-retain-6.c new file mode 100644 index 0000000..ed6cfae --- /dev/null +++ b/gcc/testsuite/c-c++-common/attr-retain-6.c @@ -0,0 +1,28 @@ +/* { dg-do compile { target R_flag_in_section } } */ +/* { dg-skip-if "non-ELF target" { *-*-darwin* powerpc*-*-aix* } } */ +/* { dg-options "-Wall -O2" } */ + +struct dtv_slotinfo_list +{ + struct dtv_slotinfo_list *next; +}; + +extern struct dtv_slotinfo_list *list; + +static int __attribute__ ((used, retain, section ("__libc_freeres_fn"))) +free_slotinfo (struct dtv_slotinfo_list **elemp) +{ + if (!free_slotinfo (&(*elemp)->next)) + return 0; + return 1; +} + +__attribute__ ((section ("__libc_freeres_fn"))) +void free_mem (void) +/* { dg-warning "'.*' without 'retain' attribute and '.*' with 'retain' attribute are placed in a section with the same name" "" { target R_flag_in_section } .-1 } */ +{ + free_slotinfo (&list); +} + +/* { dg-final { scan-assembler "__libc_freeres_fn,\"ax\"" { target R_flag_in_section } } } */ +/* { dg-final { scan-assembler "__libc_freeres_fn,\"axR\"" { target R_flag_in_section } } } */ diff --git a/gcc/testsuite/c-c++-common/attr-retain-7.c b/gcc/testsuite/c-c++-common/attr-retain-7.c new file mode 100644 index 0000000..c56d18a --- /dev/null +++ b/gcc/testsuite/c-c++-common/attr-retain-7.c @@ -0,0 +1,10 @@ +/* { dg-do compile { target R_flag_in_section } } */ +/* { dg-skip-if "non-ELF target" { *-*-darwin* powerpc*-*-aix* } } */ +/* { dg-options "-Wall -O2" } */ + +int __attribute__((used,retain,section(".data.foo"))) foo2 = 2; +int __attribute__((section(".data.foo"))) foo1 = 1; +/* { dg-warning "'.*' without 'retain' attribute and '.*' with 'retain' attribute are placed in a section with the same name" "" { target R_flag_in_section } .-1 } */ + +/* { dg-final { scan-assembler ".data.foo,\"aw\"" { target R_flag_in_section } } } */ +/* { dg-final { scan-assembler ".data.foo,\"awR\"" { target R_flag_in_section } } } */ diff --git a/gcc/testsuite/c-c++-common/attr-retain-8.c b/gcc/testsuite/c-c++-common/attr-retain-8.c new file mode 100644 index 0000000..c1a9b52 --- /dev/null +++ b/gcc/testsuite/c-c++-common/attr-retain-8.c @@ -0,0 +1,10 @@ +/* { dg-do compile { target R_flag_in_section } } */ +/* { dg-skip-if "non-ELF target" { *-*-darwin* powerpc*-*-aix* } } */ +/* { dg-options "-Wall -O2" } */ + +int __attribute__((section(".data.foo"))) foo1 = 1; +/* { dg-warning "'.*' without 'retain' attribute and '.*' with 'retain' attribute are placed in a section with the same name" "" { target R_flag_in_section } .-1 } */ +int __attribute__((used,retain,section(".data.foo"))) foo2 = 2; + +/* { dg-final { scan-assembler ".data.foo,\"aw\"" { target R_flag_in_section } } } */ +/* { dg-final { scan-assembler ".data.foo,\"awR\"" { target R_flag_in_section } } } */ diff --git a/gcc/testsuite/c-c++-common/attr-retain-9.c b/gcc/testsuite/c-c++-common/attr-retain-9.c new file mode 100644 index 0000000..e6d7c0b --- /dev/null +++ b/gcc/testsuite/c-c++-common/attr-retain-9.c @@ -0,0 +1,29 @@ +/* { dg-do compile { target R_flag_in_section } } */ +/* { dg-skip-if "non-ELF target" { *-*-darwin* powerpc*-*-aix* } } */ +/* { dg-options "-Wall -O2" } */ + +struct dtv_slotinfo_list +{ + struct dtv_slotinfo_list *next; +}; + +extern struct dtv_slotinfo_list *list; + +static int __attribute__ ((used, retain, section ("__libc_freeres_fn"))) +free_slotinfo (struct dtv_slotinfo_list **elemp) +{ + if (!free_slotinfo (&(*elemp)->next)) + return 0; + return 1; +} + +__attribute__ ((section ("__libc_freeres_fn"))) +static void free_mem (void) +/* { dg-warning "defined but not used" "" { target *-*-* } .-1 } */ +{ + free_slotinfo (&list); +} + +/* { dg-final { scan-assembler-not "__libc_freeres_fn\n" } } */ +/* { dg-final { scan-assembler-not "__libc_freeres_fn,\"ax\"" { target R_flag_in_section } } } */ +/* { dg-final { scan-assembler "__libc_freeres_fn,\"axR\"" { target R_flag_in_section } } } */ diff --git a/gcc/testsuite/c-c++-common/attr-used-2.c b/gcc/testsuite/c-c++-common/attr-used-2.c index eef2519..5849747 100644 --- a/gcc/testsuite/c-c++-common/attr-used-2.c +++ b/gcc/testsuite/c-c++-common/attr-used-2.c @@ -9,4 +9,4 @@ void foo() } /* { dg-final { scan-assembler "xyzzy" } } */ -/* { dg-final { scan-assembler "\.data.*,\"awR\"" { target R_flag_in_section } } } */ +/* { dg-final { scan-assembler-not "\.data.*,\"awR\"" { target R_flag_in_section } } } */ diff --git a/gcc/testsuite/c-c++-common/attr-used-3.c b/gcc/testsuite/c-c++-common/attr-used-3.c index ca64197..5a6ea99 100644 --- a/gcc/testsuite/c-c++-common/attr-used-3.c +++ b/gcc/testsuite/c-c++-common/attr-used-3.c @@ -4,4 +4,4 @@ static int xyzzy __attribute__((__used__)); /* { dg-final { scan-assembler "xyzzy" } } */ -/* { dg-final { scan-assembler ",\"awR\"" { target R_flag_in_section } } } */ +/* { dg-final { scan-assembler-not ",\"awR\"" { target R_flag_in_section } } } */ diff --git a/gcc/testsuite/c-c++-common/attr-used-4.c b/gcc/testsuite/c-c++-common/attr-used-4.c index 1cbc4c7..40c2c65 100644 --- a/gcc/testsuite/c-c++-common/attr-used-4.c +++ b/gcc/testsuite/c-c++-common/attr-used-4.c @@ -4,4 +4,4 @@ int xyzzy __attribute__((__used__)); /* { dg-final { scan-assembler "xyzzy" } } */ -/* { dg-final { scan-assembler ",\"awR\"" { target R_flag_in_section } } } */ +/* { dg-final { scan-assembler-not ",\"awR\"" { target R_flag_in_section } } } */ diff --git a/gcc/testsuite/c-c++-common/attr-used-5.c b/gcc/testsuite/c-c++-common/attr-used-5.c index 5b49241..448e19f 100644 --- a/gcc/testsuite/c-c++-common/attr-used-5.c +++ b/gcc/testsuite/c-c++-common/attr-used-5.c @@ -11,7 +11,6 @@ extern struct dtv_slotinfo_list *list; static int __attribute__ ((section ("__libc_freeres_fn"))) free_slotinfo (struct dtv_slotinfo_list **elemp) -/* { dg-warning "'.*' without 'used' attribute and '.*' with 'used' attribute are placed in a section with the same name" "" { target R_flag_in_section } .-1 } */ { if (!free_slotinfo (&(*elemp)->next)) return 0; @@ -25,4 +24,4 @@ static void free_mem (void) } /* { dg-final { scan-assembler "__libc_freeres_fn,\"ax\"" { target R_flag_in_section } } } */ -/* { dg-final { scan-assembler "__libc_freeres_fn,\"axR\"" { target R_flag_in_section } } } */ +/* { dg-final { scan-assembler-not "__libc_freeres_fn,\"axR\"" { target R_flag_in_section } } } */ diff --git a/gcc/testsuite/c-c++-common/attr-used-6.c b/gcc/testsuite/c-c++-common/attr-used-6.c index 3cf288d..b9974e2 100644 --- a/gcc/testsuite/c-c++-common/attr-used-6.c +++ b/gcc/testsuite/c-c++-common/attr-used-6.c @@ -19,10 +19,9 @@ free_slotinfo (struct dtv_slotinfo_list **elemp) __attribute__ ((section ("__libc_freeres_fn"))) void free_mem (void) -/* { dg-warning "'.*' without 'used' attribute and '.*' with 'used' attribute are placed in a section with the same name" "" { target R_flag_in_section } .-1 } */ { free_slotinfo (&list); } /* { dg-final { scan-assembler "__libc_freeres_fn,\"ax\"" { target R_flag_in_section } } } */ -/* { dg-final { scan-assembler "__libc_freeres_fn,\"axR\"" { target R_flag_in_section } } } */ +/* { dg-final { scan-assembler-not "__libc_freeres_fn,\"axR\"" { target R_flag_in_section } } } */ diff --git a/gcc/testsuite/c-c++-common/attr-used-7.c b/gcc/testsuite/c-c++-common/attr-used-7.c index 1721a8a..9c9862f 100644 --- a/gcc/testsuite/c-c++-common/attr-used-7.c +++ b/gcc/testsuite/c-c++-common/attr-used-7.c @@ -4,7 +4,6 @@ int __attribute__((used,section(".data.foo"))) foo2 = 2; int __attribute__((section(".data.foo"))) foo1 = 1; -/* { dg-warning "'.*' without 'used' attribute and '.*' with 'used' attribute are placed in a section with the same name" "" { target R_flag_in_section } .-1 } */ /* { dg-final { scan-assembler ".data.foo,\"aw\"" { target R_flag_in_section } } } */ -/* { dg-final { scan-assembler ".data.foo,\"awR\"" { target R_flag_in_section } } } */ +/* { dg-final { scan-assembler-not ".data.foo,\"awR\"" { target R_flag_in_section } } } */ diff --git a/gcc/testsuite/c-c++-common/attr-used-8.c b/gcc/testsuite/c-c++-common/attr-used-8.c index 20662ca..c907ab1 100644 --- a/gcc/testsuite/c-c++-common/attr-used-8.c +++ b/gcc/testsuite/c-c++-common/attr-used-8.c @@ -3,8 +3,7 @@ /* { dg-options "-Wall -O2" } */ int __attribute__((section(".data.foo"))) foo1 = 1; -/* { dg-warning "'.*' without 'used' attribute and '.*' with 'used' attribute are placed in a section with the same name" "" { target R_flag_in_section } .-1 } */ int __attribute__((used,section(".data.foo"))) foo2 = 2; /* { dg-final { scan-assembler ".data.foo,\"aw\"" { target R_flag_in_section } } } */ -/* { dg-final { scan-assembler ".data.foo,\"awR\"" { target R_flag_in_section } } } */ +/* { dg-final { scan-assembler-not ".data.foo,\"awR\"" { target R_flag_in_section } } } */ diff --git a/gcc/testsuite/c-c++-common/attr-used-9.c b/gcc/testsuite/c-c++-common/attr-used-9.c index 5847b05..049c0be 100644 --- a/gcc/testsuite/c-c++-common/attr-used-9.c +++ b/gcc/testsuite/c-c++-common/attr-used-9.c @@ -25,5 +25,5 @@ static void free_mem (void) } /* { dg-final { scan-assembler-not "__libc_freeres_fn\n" } } */ -/* { dg-final { scan-assembler-not "__libc_freeres_fn,\"ax\"" { target R_flag_in_section } } } */ -/* { dg-final { scan-assembler "__libc_freeres_fn,\"axR\"" { target R_flag_in_section } } } */ +/* { dg-final { scan-assembler "__libc_freeres_fn,\"ax\"" { target R_flag_in_section } } } */ +/* { dg-final { scan-assembler-not "__libc_freeres_fn,\"axR\"" { target R_flag_in_section } } } */ diff --git a/gcc/testsuite/c-c++-common/attr-used.c b/gcc/testsuite/c-c++-common/attr-used.c index 2036533..96c6d67 100644 --- a/gcc/testsuite/c-c++-common/attr-used.c +++ b/gcc/testsuite/c-c++-common/attr-used.c @@ -11,4 +11,4 @@ static void function_declaration_after(void) __attribute__((__used__)); /* { dg-final { scan-assembler "function_declaration_before" } } */ /* { dg-final { scan-assembler "function_declaration_after" } } */ -/* { dg-final { scan-assembler "\.text.*,\"axR\"" { target R_flag_in_section } } } */ +/* { dg-final { scan-assembler-not "\.text.*,\"axR\"" { target R_flag_in_section } } } */ diff --git a/gcc/testsuite/c-c++-common/goacc/asyncwait-1.c b/gcc/testsuite/c-c++-common/goacc/asyncwait-1.c index 2f5d476..1857d65 100644 --- a/gcc/testsuite/c-c++-common/goacc/asyncwait-1.c +++ b/gcc/testsuite/c-c++-common/goacc/asyncwait-1.c @@ -9,7 +9,7 @@ f (int N, float *a, float *b) b[ii] = a[ii]; } -#pragma acc parallel copyin (a[0:N]) copy (b[0:N]) async (1,) /* { dg-error "expected (primary-|)expression before" } */ +#pragma acc parallel copyin (a[0:N]) copy (b[0:N]) async (1,) /* { dg-error "expected '\\)' before ',' token" } */ { for (ii = 0; ii < N; ii++) b[ii] = a[ii]; @@ -21,19 +21,19 @@ f (int N, float *a, float *b) b[ii] = a[ii]; } -#pragma acc parallel copyin (a[0:N]) copy (b[0:N]) async (1,2,) /* { dg-error "expected (primary-|)expression before" } */ +#pragma acc parallel copyin (a[0:N]) copy (b[0:N]) async (1,2,) /* { dg-error "expected '\\)' before ',' token" } */ { for (ii = 0; ii < N; ii++) b[ii] = a[ii]; } -#pragma acc parallel copyin (a[0:N]) copy (b[0:N]) async (1,2 3) /* { dg-error "expected '\\)' before numeric constant" } */ +#pragma acc parallel copyin (a[0:N]) copy (b[0:N]) async (1,2 3) /* { dg-error "expected '\\)' before ',' token" } */ { for (ii = 0; ii < N; ii++) b[ii] = a[ii]; } -#pragma acc parallel copyin (a[0:N]) copy (b[0:N]) async (1,2,,) /* { dg-error "expected (primary-|)expression before" } */ +#pragma acc parallel copyin (a[0:N]) copy (b[0:N]) async (1,2,,) /* { dg-error "expected '\\)' before ',' token" } */ { for (ii = 0; ii < N; ii++) b[ii] = a[ii]; @@ -193,15 +193,15 @@ f (int N, float *a, float *b) #pragma acc wait async (1 2) /* { dg-error "expected '\\)' before numeric constant" } */ -#pragma acc wait async (1,) /* { dg-error "expected (primary-|)expression before" } */ +#pragma acc wait async (1,) /* { dg-error "expected '\\)' before ',' token" } */ #pragma acc wait async (,1) /* { dg-error "expected (primary-|)expression before" } */ -#pragma acc wait async (1,2,) /* { dg-error "expected (primary-|)expression before" } */ +#pragma acc wait async (1,2,) /* { dg-error "expected '\\)' before ',' token" } */ -#pragma acc wait async (1,2 3) /* { dg-error "expected '\\)' before numeric constant" } */ +#pragma acc wait async (1,2 3) /* { dg-error "expected '\\)' before ',' token" } */ -#pragma acc wait async (1,2,,) /* { dg-error "expected (primary-|)expression before" } */ +#pragma acc wait async (1,2,,) /* { dg-error "expected '\\)' before ',' token" } */ #pragma acc wait async (1 /* { dg-error "expected '\\)' before end of line" } */ @@ -215,3 +215,10 @@ f (int N, float *a, float *b) /* { dg-error "expected integer expression before" "" { target c } .-1 } */ /* { dg-error "expression must be integral" "" { target c++ } .-2 } */ } + +/* PR c/99137 */ +void f2 () +{ + #pragma acc parallel async(1,2) /* { dg-error "expected '\\)' before ',' token" } */ + ; +} diff --git a/gcc/testsuite/c-c++-common/gomp/pr99226.c b/gcc/testsuite/c-c++-common/gomp/pr99226.c new file mode 100644 index 0000000..cc9db62 --- /dev/null +++ b/gcc/testsuite/c-c++-common/gomp/pr99226.c @@ -0,0 +1,17 @@ +/* PR fortran/99226 */ +/* { dg-do compile } */ + +void +foo (int n) +{ + int i; + #pragma omp target /* { dg-error "construct with nested 'teams' construct contains directives outside of the 'teams' construct" } */ + { + #pragma omp teams distribute dist_schedule (static, n + 4) + for (i = 0; i < 8; i++) + ; + #pragma omp teams distribute dist_schedule (static, n + 4) + for (i = 0; i < 8; i++) + ; + } +} diff --git a/gcc/testsuite/c-c++-common/gomp/pr99322.c b/gcc/testsuite/c-c++-common/gomp/pr99322.c new file mode 100644 index 0000000..447dda8 --- /dev/null +++ b/gcc/testsuite/c-c++-common/gomp/pr99322.c @@ -0,0 +1,26 @@ +/* PR middle-end/99322 */ +/* { dg-do compile } */ + +void foo (void); +void qux (void *); + +void +bar (void) +{ + #pragma omp parallel + for (;;) + for (int i = 0; i < 8; ++i) + foo (); + { lab:; } + qux (&&lab); +} + +void +baz (void) +{ + qux (&&lab); + #pragma omp parallel + for (;;) + ; + lab:; +} diff --git a/gcc/testsuite/c-c++-common/pr99113.c b/gcc/testsuite/c-c++-common/pr99113.c new file mode 100644 index 0000000..0181401 --- /dev/null +++ b/gcc/testsuite/c-c++-common/pr99113.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-options "-Wall -O2" } */ + +static int xyzzy __attribute__((__used__)) = 1; + +/* { dg-final { scan-assembler "xyzzy" } } */ +/* { dg-final { scan-assembler-not "\.data.*,\"awR\"" { target R_flag_in_section } } } */ diff --git a/gcc/testsuite/g++.dg/analyzer/pr99064.C b/gcc/testsuite/g++.dg/analyzer/pr99064.C index a002219..9fa54f5 100644 --- a/gcc/testsuite/g++.dg/analyzer/pr99064.C +++ b/gcc/testsuite/g++.dg/analyzer/pr99064.C @@ -34,6 +34,6 @@ struct TPkcs11Token { void list_tokens() { for (__normal_iterator base = list_tokens_token_list.begin();;) { int *add_info = new int; - (*base).add_info = add_info; // { dg-bogus "leak" "PR analyzer/98969" { xfail *-*-* } } + (*base).add_info = add_info; // { dg-warning "leak" } } } diff --git a/gcc/testsuite/g++.dg/concepts/abbrev8.C b/gcc/testsuite/g++.dg/concepts/abbrev8.C new file mode 100644 index 0000000..51828b6 --- /dev/null +++ b/gcc/testsuite/g++.dg/concepts/abbrev8.C @@ -0,0 +1,22 @@ +// PR c++/98990 +// { dg-do compile { target concepts } } + +int x; + +auto& f() { return x; } +auto& f(auto) { return x; } + +using T1 = int&; +using T1 = decltype(f('a')); + +int* y; + +template <class> +struct S +{ + static auto** f() { return &y; } + static auto** f(auto) { return &y; } +}; + +using T2 = int**; +using T2 = decltype(S<void>::f('a')); diff --git a/gcc/testsuite/g++.dg/concepts/abbrev9.C b/gcc/testsuite/g++.dg/concepts/abbrev9.C new file mode 100644 index 0000000..865b44c --- /dev/null +++ b/gcc/testsuite/g++.dg/concepts/abbrev9.C @@ -0,0 +1,26 @@ +// { dg-do compile { target concepts } } + +template <class T, class U> concept same_as = __is_same(T, U); + +same_as<int> auto f(auto, auto y) { + return y; // { dg-error "deduced return type" } +} + +template <class> +struct A { + static auto g(auto x, auto y) -> same_as<decltype(x)> auto { + return y; // { dg-error "deduced return type" } + } +}; + +int main() { + f(0, 0); // { dg-bogus "" } + f("", 0); // { dg-bogus "" } + f(0, ""); // { dg-message "required from here" } + f("", ""); // { dg-message "required from here" } + + A<void>::g(0, 0); // { dg-bogus "" } + A<void>::g("", 0); // { dg-message "required from here" } + A<void>::g(0, ""); // { dg-message "required from here" } + A<void>::g("", ""); // { dg-bogus "" } +} diff --git a/gcc/testsuite/g++.dg/coroutines/co-await-void_type.C b/gcc/testsuite/g++.dg/coroutines/co-await-void_type.C index 0bb8818..370068f 100644 --- a/gcc/testsuite/g++.dg/coroutines/co-await-void_type.C +++ b/gcc/testsuite/g++.dg/coroutines/co-await-void_type.C @@ -28,7 +28,7 @@ struct resumable::promise_type { return coro_handle::from_promise(*this); } auto initial_suspend() { return std::suspend_always(); } - auto final_suspend() { return std::suspend_always(); } + auto final_suspend() noexcept { return std::suspend_always(); } void yield_value(int v) { value_ = v; } void unhandled_exception() {} }; diff --git a/gcc/testsuite/g++.dg/coroutines/co-return-syntax-08-bad-return.C b/gcc/testsuite/g++.dg/coroutines/co-return-syntax-08-bad-return.C index 9b53754..148ee45 100644 --- a/gcc/testsuite/g++.dg/coroutines/co-return-syntax-08-bad-return.C +++ b/gcc/testsuite/g++.dg/coroutines/co-return-syntax-08-bad-return.C @@ -24,7 +24,7 @@ struct Coro { ~promise_type() {} Coro get_return_object () { return Coro (handle_type::from_promise (*this)); } auto initial_suspend () { return coro::suspend_always{}; } - auto final_suspend () { return coro::suspend_always{}; } + auto final_suspend () noexcept { return coro::suspend_always{}; } void return_void () { } void unhandled_exception() { } }; diff --git a/gcc/testsuite/g++.dg/coroutines/co-return-syntax-10-movable.C b/gcc/testsuite/g++.dg/coroutines/co-return-syntax-10-movable.C index c6f36a7..0cf3c39 100644 --- a/gcc/testsuite/g++.dg/coroutines/co-return-syntax-10-movable.C +++ b/gcc/testsuite/g++.dg/coroutines/co-return-syntax-10-movable.C @@ -32,7 +32,7 @@ struct coro1 { auto get_return_object () { return handle_type::from_promise (*this);} coro::suspend_always initial_suspend () const { return {}; } - coro::suspend_always final_suspend () const { return {}; } + coro::suspend_always final_suspend () const noexcept { return {}; } void return_value(T&& v) noexcept { value = std::move(v); } void return_value(const T&) noexcept = delete; diff --git a/gcc/testsuite/g++.dg/coroutines/co-return-warning-1.C b/gcc/testsuite/g++.dg/coroutines/co-return-warning-1.C index 69e7690..b2aaba1 100644 --- a/gcc/testsuite/g++.dg/coroutines/co-return-warning-1.C +++ b/gcc/testsuite/g++.dg/coroutines/co-return-warning-1.C @@ -28,7 +28,7 @@ struct resumable::promise_type { return coro_handle::from_promise(*this); } auto initial_suspend() { return std::suspend_always(); } - auto final_suspend() { return std::suspend_always(); } + auto final_suspend() noexcept { return std::suspend_always(); } void return_value(int v) { value_ = v; } std::suspend_always yield_value(int v) { value_ = v; diff --git a/gcc/testsuite/g++.dg/coroutines/co-yield-syntax-08-needs-expr.C b/gcc/testsuite/g++.dg/coroutines/co-yield-syntax-08-needs-expr.C index 86969f7..aec1214 100644 --- a/gcc/testsuite/g++.dg/coroutines/co-yield-syntax-08-needs-expr.C +++ b/gcc/testsuite/g++.dg/coroutines/co-yield-syntax-08-needs-expr.C @@ -10,7 +10,7 @@ struct DummyYield { DummyYield (coro::coroutine_handle<> handle) : handle (handle) {} struct dummy_yield { coro::suspend_never initial_suspend() { return {}; } - coro::suspend_never final_suspend() { return {}; } + coro::suspend_never final_suspend() noexcept { return {}; } DummyYield get_return_object() { return DummyYield (coro::coroutine_handle<dummy_yield>::from_promise (*this)); } diff --git a/gcc/testsuite/g++.dg/coroutines/coro-bad-gro-00-class-gro-scalar-return.C b/gcc/testsuite/g++.dg/coroutines/coro-bad-gro-00-class-gro-scalar-return.C index bd9dec6..f9e8a5f 100644 --- a/gcc/testsuite/g++.dg/coroutines/coro-bad-gro-00-class-gro-scalar-return.C +++ b/gcc/testsuite/g++.dg/coroutines/coro-bad-gro-00-class-gro-scalar-return.C @@ -21,11 +21,11 @@ struct std::coroutine_traits<R, HandleRef, T...> { } ~promise_type () { PRINT ("Destroyed Promise"); g_promise = 0;} Thing get_return_object() { return {}; } - + //int get_return_object() { return 0; } auto initial_suspend() { return std::suspend_always{}; } - auto final_suspend() { return std::suspend_never{}; } + auto final_suspend() noexcept { return std::suspend_never{}; } void return_void() {} void unhandled_exception() {} diff --git a/gcc/testsuite/g++.dg/coroutines/coro-bad-gro-01-void-gro-non-class-coro.C b/gcc/testsuite/g++.dg/coroutines/coro-bad-gro-01-void-gro-non-class-coro.C index c31fcb5..2671ce7 100644 --- a/gcc/testsuite/g++.dg/coroutines/coro-bad-gro-01-void-gro-non-class-coro.C +++ b/gcc/testsuite/g++.dg/coroutines/coro-bad-gro-01-void-gro-non-class-coro.C @@ -19,7 +19,7 @@ struct std::coroutine_traits<R, HandleRef, T...> { auto initial_suspend() { return std::suspend_always{}; } - auto final_suspend() { return std::suspend_never{}; } + auto final_suspend() noexcept { return std::suspend_never{}; } void return_void() {} void unhandled_exception() {} diff --git a/gcc/testsuite/g++.dg/coroutines/coro-missing-gro.C b/gcc/testsuite/g++.dg/coroutines/coro-missing-gro.C index fb02e9d..44a629b 100644 --- a/gcc/testsuite/g++.dg/coroutines/coro-missing-gro.C +++ b/gcc/testsuite/g++.dg/coroutines/coro-missing-gro.C @@ -10,7 +10,7 @@ struct MissingGRO { MissingGRO (coro::coroutine_handle<> handle) : handle (handle) {} struct missing_gro { coro::suspend_never initial_suspend() { return {}; } - coro::suspend_never final_suspend() { return {}; } + coro::suspend_never final_suspend() noexcept { return {}; } void return_void () {} void unhandled_exception() { /*std::terminate();*/ }; }; diff --git a/gcc/testsuite/g++.dg/coroutines/coro-missing-promise-yield.C b/gcc/testsuite/g++.dg/coroutines/coro-missing-promise-yield.C index a85a4d5..01cc414 100644 --- a/gcc/testsuite/g++.dg/coroutines/coro-missing-promise-yield.C +++ b/gcc/testsuite/g++.dg/coroutines/coro-missing-promise-yield.C @@ -7,7 +7,7 @@ struct MissingPromiseYield { MissingPromiseYield (coro::coroutine_handle<> handle) : handle (handle) {} struct missing_yield { coro::suspend_never initial_suspend() { return {}; } - coro::suspend_never final_suspend() { return {}; } + coro::suspend_never final_suspend() noexcept { return {}; } MissingPromiseYield get_return_object() { return MissingPromiseYield (coro::coroutine_handle<missing_yield>::from_promise (*this)); } diff --git a/gcc/testsuite/g++.dg/coroutines/coro-missing-ret-value.C b/gcc/testsuite/g++.dg/coroutines/coro-missing-ret-value.C index f745fa9..91c29d3 100644 --- a/gcc/testsuite/g++.dg/coroutines/coro-missing-ret-value.C +++ b/gcc/testsuite/g++.dg/coroutines/coro-missing-ret-value.C @@ -10,7 +10,7 @@ struct MissingRetValue { MissingRetValue (coro::coroutine_handle<> handle) : handle (handle) {} struct missing_retvoid { coro::suspend_never initial_suspend() { return {}; } - coro::suspend_never final_suspend() { return {}; } + coro::suspend_never final_suspend() noexcept { return {}; } MissingRetValue get_return_object() { return MissingRetValue (coro::coroutine_handle<missing_retvoid>::from_promise (*this)); } diff --git a/gcc/testsuite/g++.dg/coroutines/coro-missing-ret-void.C b/gcc/testsuite/g++.dg/coroutines/coro-missing-ret-void.C index 8639a9d..502391a 100644 --- a/gcc/testsuite/g++.dg/coroutines/coro-missing-ret-void.C +++ b/gcc/testsuite/g++.dg/coroutines/coro-missing-ret-void.C @@ -10,7 +10,7 @@ struct MissingRetVoid { MissingRetVoid (coro::coroutine_handle<> handle) : handle (handle) {} struct missing_retvoid { coro::suspend_never initial_suspend() { return {}; } - coro::suspend_never final_suspend() { return {}; } + coro::suspend_never final_suspend() noexcept { return {}; } MissingRetVoid get_return_object() { return MissingRetVoid (coro::coroutine_handle<missing_retvoid>::from_promise (*this)); } diff --git a/gcc/testsuite/g++.dg/coroutines/coro-missing-ueh.h b/gcc/testsuite/g++.dg/coroutines/coro-missing-ueh.h index 51e6135..361003c 100644 --- a/gcc/testsuite/g++.dg/coroutines/coro-missing-ueh.h +++ b/gcc/testsuite/g++.dg/coroutines/coro-missing-ueh.h @@ -8,7 +8,7 @@ struct MissingUEH { MissingUEH (coro::coroutine_handle<> handle) : handle (handle) {} struct missing_ueh { coro::suspend_never initial_suspend() { return {}; } - coro::suspend_never final_suspend() { return {}; } + coro::suspend_never final_suspend() noexcept { return {}; } MissingUEH get_return_object() { return MissingUEH (coro::coroutine_handle<missing_ueh>::from_promise (*this)); } diff --git a/gcc/testsuite/g++.dg/coroutines/coro1-allocators.h b/gcc/testsuite/g++.dg/coroutines/coro1-allocators.h index f7a85e9..cf73dc0 100644 --- a/gcc/testsuite/g++.dg/coroutines/coro1-allocators.h +++ b/gcc/testsuite/g++.dg/coroutines/coro1-allocators.h @@ -100,7 +100,7 @@ struct coro1 { PRINT ("get initial_suspend (always)"); return suspend_always_prt{}; } - auto final_suspend () { + auto final_suspend () noexcept { PRINT ("get final_suspend (always)"); return suspend_always_prt{}; } diff --git a/gcc/testsuite/g++.dg/coroutines/coro1-refs-and-ctors.h b/gcc/testsuite/g++.dg/coroutines/coro1-refs-and-ctors.h index 5b89e7c..dd45a0e 100644 --- a/gcc/testsuite/g++.dg/coroutines/coro1-refs-and-ctors.h +++ b/gcc/testsuite/g++.dg/coroutines/coro1-refs-and-ctors.h @@ -3,10 +3,13 @@ struct coro1 { struct promise_type { promise_type () : vv(-1) { PRINT ("Promise def. CTOR"); } - promise_type (int __x) : vv(__x) { PRINTF ("Created Promise with %d\n",__x); } + promise_type (int __x) : vv(__x) { PRINTF ("promise_type1 with %d\n",__x); } promise_type (int __x, int& __y, int&& __z) : vv(__x), v2(__y), v3(__z) - { PRINTF ("Created Promise with %d, %d, %d\n", __x, __y, __z); } + { PRINTF ("promise_type2 with %d, %d, %d\n", __x, __y, __z); } + promise_type (int __x, int& __y, int& __z) + : vv(__x), v2(__y), v3(__z) + { PRINTF ("promise_type3 with %d, %d, %d\n", __x, __y, __z); } ~promise_type() { PRINT ("Destroyed Promise"); } @@ -19,7 +22,7 @@ struct coro1 { PRINT ("get initial_suspend (always)"); return suspend_always_prt{}; } - auto final_suspend () { + auto final_suspend () noexcept { PRINT ("get final_suspend (always)"); return suspend_always_prt{}; } diff --git a/gcc/testsuite/g++.dg/coroutines/coro1-ret-int-yield-int.h b/gcc/testsuite/g++.dg/coroutines/coro1-ret-int-yield-int.h index 7cf5052..826519e 100644 --- a/gcc/testsuite/g++.dg/coroutines/coro1-ret-int-yield-int.h +++ b/gcc/testsuite/g++.dg/coroutines/coro1-ret-int-yield-int.h @@ -108,7 +108,7 @@ struct coro1 { #endif #ifdef MISSING_FINAL_SUSPEND #else - auto final_suspend () { + auto final_suspend () noexcept { PRINT ("get final_suspend (always)"); return suspend_always_prt{}; } diff --git a/gcc/testsuite/g++.dg/coroutines/pr94682-preview-this.C b/gcc/testsuite/g++.dg/coroutines/pr94682-preview-this.C index ca96f37..7c4bae2a 100644 --- a/gcc/testsuite/g++.dg/coroutines/pr94682-preview-this.C +++ b/gcc/testsuite/g++.dg/coroutines/pr94682-preview-this.C @@ -13,7 +13,7 @@ struct promise promise(Class &,int) { static_assert(!std::is_pointer<Class>::value, ""); } coro::suspend_never initial_suspend() { return {}; } - coro::suspend_never final_suspend() { return {}; } + coro::suspend_never final_suspend() noexcept { return {}; } future get_return_object() { return {}; } diff --git a/gcc/testsuite/g++.dg/coroutines/pr94752.C b/gcc/testsuite/g++.dg/coroutines/pr94752.C index 89ace6a..e5e4ece 100644 --- a/gcc/testsuite/g++.dg/coroutines/pr94752.C +++ b/gcc/testsuite/g++.dg/coroutines/pr94752.C @@ -9,7 +9,7 @@ struct task { promise_type() {} task get_return_object() { return {}; } suspend_never initial_suspend() { return {}; } - suspend_never final_suspend() { return {}; } + suspend_never final_suspend() noexcept { return {}; } void return_void() {} void unhandled_exception() {} }; diff --git a/gcc/testsuite/g++.dg/coroutines/pr94760-mismatched-traits-and-promise-prev.C b/gcc/testsuite/g++.dg/coroutines/pr94760-mismatched-traits-and-promise-prev.C index 235b5e7..90a558d 100644 --- a/gcc/testsuite/g++.dg/coroutines/pr94760-mismatched-traits-and-promise-prev.C +++ b/gcc/testsuite/g++.dg/coroutines/pr94760-mismatched-traits-and-promise-prev.C @@ -14,7 +14,7 @@ struct std::coroutine_traits<R, CallOp, T...> { promise_type (CallOp op, T ...args) {} Fake get_return_object() { return {}; } std::suspend_always initial_suspend() { return {}; } - std::suspend_never final_suspend() { return {}; } + std::suspend_never final_suspend() noexcept { return {}; } void return_void() {} void unhandled_exception() {} }; diff --git a/gcc/testsuite/g++.dg/coroutines/pr94879-folly-1.C b/gcc/testsuite/g++.dg/coroutines/pr94879-folly-1.C index 7d66ce0..11bcce0 100644 --- a/gcc/testsuite/g++.dg/coroutines/pr94879-folly-1.C +++ b/gcc/testsuite/g++.dg/coroutines/pr94879-folly-1.C @@ -18,20 +18,20 @@ class i { namespace ac { template <typename> class ad { public: - bool await_ready(); - void await_resume(); - void await_suspend(std::coroutine_handle<>); + bool await_ready() noexcept; + void await_resume() noexcept; + void await_suspend(std::coroutine_handle<>) noexcept; i ae; }; } // namespace ac -template <typename ab> ac::ad<ab> operator co_await(ab); +template <typename ab> ac::ad<ab> operator co_await(ab) noexcept; class j { class l {}; public: std::g initial_suspend(); - l final_suspend(); + l final_suspend() noexcept; }; class m : public j { public: diff --git a/gcc/testsuite/g++.dg/coroutines/pr94883-folly-2.C b/gcc/testsuite/g++.dg/coroutines/pr94883-folly-2.C index 088f133..ce06cfd 100644 --- a/gcc/testsuite/g++.dg/coroutines/pr94883-folly-2.C +++ b/gcc/testsuite/g++.dg/coroutines/pr94883-folly-2.C @@ -16,15 +16,15 @@ int f; class h { class j { public: - bool await_ready(); - void await_suspend(std::coroutine_handle<>); - void await_resume(); + bool await_ready() noexcept; + void await_suspend(std::coroutine_handle<>) noexcept; + void await_resume() noexcept; }; public: void get_return_object(); std::b initial_suspend(); - j final_suspend(); + j final_suspend() noexcept; void unhandled_exception(); template <typename g> auto await_transform (g c) { return ab(f, c); } diff --git a/gcc/testsuite/g++.dg/coroutines/pr95050.C b/gcc/testsuite/g++.dg/coroutines/pr95050.C index fd1516d..2867cfc 100644 --- a/gcc/testsuite/g++.dg/coroutines/pr95050.C +++ b/gcc/testsuite/g++.dg/coroutines/pr95050.C @@ -21,7 +21,7 @@ struct task { auto get_return_object () -> task { return {}; } auto initial_suspend () -> suspend_always { return {}; } - auto final_suspend () -> suspend_always { return {}; } + auto final_suspend () noexcept -> suspend_always { return {}; } void return_void () {} void unhandled_exception () { } void thing (ret_type x) {} diff --git a/gcc/testsuite/g++.dg/coroutines/pr95345.C b/gcc/testsuite/g++.dg/coroutines/pr95345.C index 90e946d..57b95cb 100644 --- a/gcc/testsuite/g++.dg/coroutines/pr95345.C +++ b/gcc/testsuite/g++.dg/coroutines/pr95345.C @@ -9,12 +9,12 @@ using namespace std::experimental; struct dummy_coro { using promise_type = dummy_coro; - bool await_ready() { return false; } - void await_suspend(std::coroutine_handle<>) { } - void await_resume() { } + bool await_ready() noexcept { return false; } + void await_suspend(std::coroutine_handle<>) noexcept { } + void await_resume() noexcept { } dummy_coro get_return_object() { return {}; } dummy_coro initial_suspend() { return {}; } - dummy_coro final_suspend() { return {}; } + dummy_coro final_suspend() noexcept { return {}; } void return_void() { } void unhandled_exception() { } }; diff --git a/gcc/testsuite/g++.dg/coroutines/pr95440.C b/gcc/testsuite/g++.dg/coroutines/pr95440.C index 8542880..1169da4 100644 --- a/gcc/testsuite/g++.dg/coroutines/pr95440.C +++ b/gcc/testsuite/g++.dg/coroutines/pr95440.C @@ -22,7 +22,7 @@ struct task // static constexpr suspend_n initial_suspend() { return {2}; } #endif static constexpr std::suspend_always initial_suspend() { return {}; } - static constexpr std::suspend_never final_suspend() { return {}; } + static constexpr std::suspend_never final_suspend() noexcept { return {}; } static constexpr void return_void() {} static constexpr void unhandled_exception() {} }; diff --git a/gcc/testsuite/g++.dg/coroutines/pr95591.C b/gcc/testsuite/g++.dg/coroutines/pr95591.C index 664b1d3..a1a2e57 100644 --- a/gcc/testsuite/g++.dg/coroutines/pr95591.C +++ b/gcc/testsuite/g++.dg/coroutines/pr95591.C @@ -12,7 +12,7 @@ struct generator { void return_void(); void unhandled_exception(); suspend_always initial_suspend(); - suspend_always final_suspend(); + suspend_always final_suspend() noexcept; template<typename Arg> suspend_always yield_value(Arg&&) { diff --git a/gcc/testsuite/g++.dg/coroutines/pr95616-0-no-exceptions.C b/gcc/testsuite/g++.dg/coroutines/pr95616-0-no-exceptions.C new file mode 100644 index 0000000..7ce811d --- /dev/null +++ b/gcc/testsuite/g++.dg/coroutines/pr95616-0-no-exceptions.C @@ -0,0 +1,50 @@ +// { dg-additional-options "-fsyntax-only -fno-exceptions" } + +#if __has_include(<coroutine>) +#include <coroutine> +#else +#include <experimental/coroutine> +namespace std { + using namespace std::experimental; +} +#endif + +class promise; + +struct finalSuspendAwaiter { + int x; + finalSuspendAwaiter () : x(0) { } + finalSuspendAwaiter (int _x) : x(_x) { } + ~finalSuspendAwaiter() noexcept(true) { } + bool await_ready() const noexcept(true) { return false; } + void await_suspend(std::coroutine_handle<>) const noexcept(true) { } + int await_resume() const noexcept(true) { return x; } +}; + +struct finalSuspendObj { + int x; + finalSuspendObj () : x(0) { } + finalSuspendObj (int _x) : x(_x) { } + ~finalSuspendObj () noexcept(true) {} + + finalSuspendAwaiter operator co_await() const & noexcept(true) { + return {x}; + } +}; + +struct task { + struct promise_type { + task get_return_object() noexcept { return {}; } + std::suspend_never initial_suspend() noexcept { return {}; } + + finalSuspendObj final_suspend() { return {3}; } // NOTE: not declared noexcept + + void return_void() noexcept {} + void unhandled_exception() noexcept {} + }; +}; + +// OK when exceptions are disabled +task f() { + co_return; +} diff --git a/gcc/testsuite/g++.dg/coroutines/pr95616-0.C b/gcc/testsuite/g++.dg/coroutines/pr95616-0.C new file mode 100644 index 0000000..e500b6e --- /dev/null +++ b/gcc/testsuite/g++.dg/coroutines/pr95616-0.C @@ -0,0 +1,51 @@ +// { dg-additional-options "-fsyntax-only" } + +#if __has_include(<coroutine>) +#include <coroutine> +#else +#include <experimental/coroutine> +namespace std { + using namespace std::experimental; +} +#endif + +class promise; + +struct finalSuspendAwaiter { + int x; + finalSuspendAwaiter () : x(0) { } + finalSuspendAwaiter (int _x) : x(_x) { } + ~finalSuspendAwaiter() noexcept(true) { } + bool await_ready() const noexcept(true) { return false; } + void await_suspend(std::coroutine_handle<>) const noexcept(true) { } + int await_resume() const noexcept(true) { return x; } +}; + +struct finalSuspendObj { + int x; + finalSuspendObj () : x(0) { } + finalSuspendObj (int _x) : x(_x) { } + ~finalSuspendObj () noexcept(true) {} + + finalSuspendAwaiter operator co_await() const & noexcept(true) { + return {x}; + } +}; + +struct task { + struct promise_type { + task get_return_object() noexcept { return {}; } + std::suspend_never initial_suspend() noexcept { return {}; } + + finalSuspendObj final_suspend() { return {3}; } // NOTE: not declared noexcept + // { dg-error {the expression 'task::promise_type::final_suspend' is required to be non-throwing} "" { target *-*-* } .-1 } + + void return_void() noexcept {} + void unhandled_exception() noexcept {} + }; +}; + +// This should be ill-formed since final_suspend() is potentially throwing. +task f() { + co_return; +} diff --git a/gcc/testsuite/g++.dg/coroutines/pr95616-1-no-exceptions.C b/gcc/testsuite/g++.dg/coroutines/pr95616-1-no-exceptions.C new file mode 100644 index 0000000..48981e6 --- /dev/null +++ b/gcc/testsuite/g++.dg/coroutines/pr95616-1-no-exceptions.C @@ -0,0 +1,51 @@ +// { dg-additional-options "-fsyntax-only -fno-exceptions" } + +#if __has_include(<coroutine>) +#include <coroutine> +#else +#include <experimental/coroutine> +namespace std { + using namespace std::experimental; +} +#endif + +class promise; + +struct finalSuspendAwaiter { + int x; + finalSuspendAwaiter () : x(0) { } + finalSuspendAwaiter (int _x) : x(_x) { } + ~finalSuspendAwaiter() noexcept(true) { } + bool await_ready() const noexcept(true) { return false; } + void await_suspend(std::coroutine_handle<>) const noexcept(true) { } + int await_resume() const noexcept(true) { return x; } +}; + +struct finalSuspendObj { + int x; + finalSuspendObj () : x(0) { } + finalSuspendObj (int _x) : x(_x) { } + ~finalSuspendObj () noexcept(true) {} + + finalSuspendAwaiter operator co_await() const & noexcept(false) // NOTE: not declared noexcept + { + return {x}; + } +}; + +struct task { + struct promise_type { + task get_return_object() noexcept { return {}; } + std::suspend_never initial_suspend() noexcept { return {}; } + + finalSuspendObj final_suspend() noexcept { return {3}; } + + void return_void() noexcept {} + void unhandled_exception() noexcept {} + }; +}; + +// OK when exceptions are disabled. +task f() { + co_return; +} diff --git a/gcc/testsuite/g++.dg/coroutines/pr95616-1.C b/gcc/testsuite/g++.dg/coroutines/pr95616-1.C new file mode 100644 index 0000000..c398980 --- /dev/null +++ b/gcc/testsuite/g++.dg/coroutines/pr95616-1.C @@ -0,0 +1,51 @@ +// { dg-additional-options "-fsyntax-only" } + +#if __has_include(<coroutine>) +#include <coroutine> +#else +#include <experimental/coroutine> +namespace std { + using namespace std::experimental; +} +#endif + +class promise; + +struct finalSuspendAwaiter { + int x; + finalSuspendAwaiter () : x(0) { } + finalSuspendAwaiter (int _x) : x(_x) { } + ~finalSuspendAwaiter() noexcept(true) { } + bool await_ready() const noexcept(true) { return false; } + void await_suspend(std::coroutine_handle<>) const noexcept(true) { } + int await_resume() const noexcept(true) { return x; } +}; + +struct finalSuspendObj { + int x; + finalSuspendObj () : x(0) { } + finalSuspendObj (int _x) : x(_x) { } + ~finalSuspendObj () noexcept(true) {} + + finalSuspendAwaiter operator co_await() const & noexcept(false) { + // { dg-error {the expression 'finalSuspendObj::operator co_await' is required to be non-throwing} "" { target *-*-* } .-1 } + return {x}; + } +}; + +struct task { + struct promise_type { + task get_return_object() noexcept { return {}; } + std::suspend_never initial_suspend() noexcept { return {}; } + + finalSuspendObj final_suspend() noexcept { return {3}; } + + void return_void() noexcept {} + void unhandled_exception() noexcept {} + }; +}; + +// This should be ill-formed since final_suspend() is potentially throwing. +task f() { + co_return; +} diff --git a/gcc/testsuite/g++.dg/coroutines/pr95616-2.C b/gcc/testsuite/g++.dg/coroutines/pr95616-2.C new file mode 100644 index 0000000..6ad2519 --- /dev/null +++ b/gcc/testsuite/g++.dg/coroutines/pr95616-2.C @@ -0,0 +1,51 @@ +// { dg-additional-options "-fsyntax-only" } + +#if __has_include(<coroutine>) +#include <coroutine> +#else +#include <experimental/coroutine> +namespace std { + using namespace std::experimental; +} +#endif + +class promise; + +struct finalSuspendAwaiter { + int x; + finalSuspendAwaiter () : x(0) { } + finalSuspendAwaiter (int _x) : x(_x) { } + ~finalSuspendAwaiter() noexcept(false) { } + bool await_ready() const noexcept(false) { return false; } + void await_suspend(std::coroutine_handle<>) const noexcept(false) { } + int await_resume() const noexcept(false) { return x; } +}; + +struct finalSuspendObj { + int x; + finalSuspendObj () : x(0) { } + finalSuspendObj (int _x) : x(_x) { } + ~finalSuspendObj () noexcept(false) {} + // { dg-error {the expression 'finalSuspendObj::~finalSuspendObj' is required to be non-throwing} "" { target *-*-* } .-1 } + + finalSuspendAwaiter operator co_await() const & noexcept(true) { + return {x}; + } +}; + +struct task { + struct promise_type { + task get_return_object() noexcept { return {}; } + std::suspend_never initial_suspend() noexcept { return {}; } + + finalSuspendObj final_suspend() noexcept { return {3}; } // NOTE: not declared noexcept + + void return_void() noexcept {} + void unhandled_exception() noexcept {} + }; +}; + +// This should be ill-formed since final_suspend() is potentially throwing. +task f() { + co_return; +} diff --git a/gcc/testsuite/g++.dg/coroutines/pr95616-3-no-exceptions.C b/gcc/testsuite/g++.dg/coroutines/pr95616-3-no-exceptions.C new file mode 100644 index 0000000..1dcd426 --- /dev/null +++ b/gcc/testsuite/g++.dg/coroutines/pr95616-3-no-exceptions.C @@ -0,0 +1,50 @@ +// { dg-additional-options "-fsyntax-only -fno-exceptions" } + +#if __has_include(<coroutine>) +#include <coroutine> +#else +#include <experimental/coroutine> +namespace std { + using namespace std::experimental; +} +#endif + +class promise; + +struct finalSuspendAwaiter { + int x; + finalSuspendAwaiter () : x(0) { } + finalSuspendAwaiter (int _x) : x(_x) { } + ~finalSuspendAwaiter() noexcept(false) { } + bool await_ready() const noexcept(false) { return false; } + void await_suspend(std::coroutine_handle<>) const noexcept(false) { } + int await_resume() const noexcept(false) { return x; } // NOTE: not declared noexcept +}; + +struct finalSuspendObj { + int x; + finalSuspendObj () : x(0) { } + finalSuspendObj (int _x) : x(_x) { } + ~finalSuspendObj () noexcept(true) {} + + finalSuspendAwaiter operator co_await() const & noexcept(true) { + return {x}; + } +}; + +struct task { + struct promise_type { + task get_return_object() noexcept { return {}; } + std::suspend_never initial_suspend() noexcept { return {}; } + + finalSuspendObj final_suspend() noexcept { return {3}; } + + void return_void() noexcept {} + void unhandled_exception() noexcept {} + }; +}; + +// OK when exceptions are disabled +task f() { + co_return; +} diff --git a/gcc/testsuite/g++.dg/coroutines/pr95616-3.C b/gcc/testsuite/g++.dg/coroutines/pr95616-3.C new file mode 100644 index 0000000..7da1f6a --- /dev/null +++ b/gcc/testsuite/g++.dg/coroutines/pr95616-3.C @@ -0,0 +1,51 @@ +// { dg-additional-options "-fsyntax-only" } + +#if __has_include(<coroutine>) +#include <coroutine> +#else +#include <experimental/coroutine> +namespace std { + using namespace std::experimental; +} +#endif + +class promise; + +struct finalSuspendAwaiter { + int x; + finalSuspendAwaiter () : x(0) { } + finalSuspendAwaiter (int _x) : x(_x) { } + ~finalSuspendAwaiter() noexcept(false) { } + bool await_ready() const noexcept(false) { return false; } + // { dg-error {the expression 'finalSuspendAwaiter::await_ready' is required to be non-throwing} "" { target *-*-* } .-1 } + void await_suspend(std::coroutine_handle<>) const noexcept(false) { } + int await_resume() const noexcept(false) { return x; } +}; + +struct finalSuspendObj { + int x; + finalSuspendObj () : x(0) { } + finalSuspendObj (int _x) : x(_x) { } + ~finalSuspendObj () noexcept(true) {} + + finalSuspendAwaiter operator co_await() const & noexcept(true) { + return {x}; + } +}; + +struct task { + struct promise_type { + task get_return_object() noexcept { return {}; } + std::suspend_never initial_suspend() noexcept { return {}; } + + finalSuspendObj final_suspend() noexcept { return {3}; } + + void return_void() noexcept {} + void unhandled_exception() noexcept {} + }; +}; + +// This should be ill-formed since final_suspend() is potentially throwing. +task f() { + co_return; +} diff --git a/gcc/testsuite/g++.dg/coroutines/pr95616-4.C b/gcc/testsuite/g++.dg/coroutines/pr95616-4.C new file mode 100644 index 0000000..ef6a160 --- /dev/null +++ b/gcc/testsuite/g++.dg/coroutines/pr95616-4.C @@ -0,0 +1,51 @@ +// { dg-additional-options "-fsyntax-only" } + +#if __has_include(<coroutine>) +#include <coroutine> +#else +#include <experimental/coroutine> +namespace std { + using namespace std::experimental; +} +#endif + +class promise; + +struct finalSuspendAwaiter { + int x; + finalSuspendAwaiter () : x(0) { } + finalSuspendAwaiter (int _x) : x(_x) { } + ~finalSuspendAwaiter() noexcept(false) { } + bool await_ready() const noexcept(true) { return false; } + void await_suspend(std::coroutine_handle<>) const noexcept(false) { } + // { dg-error {the expression 'finalSuspendAwaiter::await_suspend' is required to be non-throwing} "" { target *-*-* } .-1 } + int await_resume() const noexcept(false) { return x; } +}; + +struct finalSuspendObj { + int x; + finalSuspendObj () : x(0) { } + finalSuspendObj (int _x) : x(_x) { } + ~finalSuspendObj () noexcept(true) {} + + finalSuspendAwaiter operator co_await() const & noexcept(true) { + return {x}; + } +}; + +struct task { + struct promise_type { + task get_return_object() noexcept { return {}; } + std::suspend_never initial_suspend() noexcept { return {}; } + + finalSuspendObj final_suspend() noexcept { return {3}; } + + void return_void() noexcept {} + void unhandled_exception() noexcept {} + }; +}; + +// This should be ill-formed since final_suspend() is potentially throwing. +task f() { + co_return; +} diff --git a/gcc/testsuite/g++.dg/coroutines/pr95616-5.C b/gcc/testsuite/g++.dg/coroutines/pr95616-5.C new file mode 100644 index 0000000..930c1a7 --- /dev/null +++ b/gcc/testsuite/g++.dg/coroutines/pr95616-5.C @@ -0,0 +1,51 @@ +// { dg-additional-options "-fsyntax-only" } + +#if __has_include(<coroutine>) +#include <coroutine> +#else +#include <experimental/coroutine> +namespace std { + using namespace std::experimental; +} +#endif + +class promise; + +struct finalSuspendAwaiter { + int x; + finalSuspendAwaiter () : x(0) { } + finalSuspendAwaiter (int _x) : x(_x) { } + ~finalSuspendAwaiter() noexcept(false) { } + bool await_ready() const noexcept(true) { return false; } + void await_suspend(std::coroutine_handle<>) const noexcept(true) { } + int await_resume() const noexcept(false) { return x; } + // { dg-error {the expression 'finalSuspendAwaiter::await_resume' is required to be non-throwing} "" { target *-*-* } .-1 } +}; + +struct finalSuspendObj { + int x; + finalSuspendObj () : x(0) { } + finalSuspendObj (int _x) : x(_x) { } + ~finalSuspendObj () noexcept(true) {} + + finalSuspendAwaiter operator co_await() const & noexcept(true) { + return {x}; + } +}; + +struct task { + struct promise_type { + task get_return_object() noexcept { return {}; } + std::suspend_never initial_suspend() noexcept { return {}; } + + finalSuspendObj final_suspend() noexcept { return {3}; } + + void return_void() noexcept {} + void unhandled_exception() noexcept {} + }; +}; + +// This should be ill-formed since final_suspend() is potentially throwing. +task f() { + co_return; +} diff --git a/gcc/testsuite/g++.dg/coroutines/pr95616-6.C b/gcc/testsuite/g++.dg/coroutines/pr95616-6.C new file mode 100644 index 0000000..e748171 --- /dev/null +++ b/gcc/testsuite/g++.dg/coroutines/pr95616-6.C @@ -0,0 +1,51 @@ +// { dg-additional-options "-fsyntax-only" } + +#if __has_include(<coroutine>) +#include <coroutine> +#else +#include <experimental/coroutine> +namespace std { + using namespace std::experimental; +} +#endif + +class promise; + +struct finalSuspendAwaiter { + int x; + finalSuspendAwaiter () : x(0) { } + finalSuspendAwaiter (int _x) : x(_x) { } + ~finalSuspendAwaiter() noexcept(false) { } + // { dg-error {the expression 'finalSuspendAwaiter::~finalSuspendAwaiter' is required to be non-throwing} "" { target *-*-* } .-1 } + bool await_ready() const noexcept(true) { return false; } + void await_suspend(std::coroutine_handle<>) const noexcept(true) { } + int await_resume() const noexcept(true) { return x; } +}; + +struct finalSuspendObj { + int x; + finalSuspendObj () : x(0) { } + finalSuspendObj (int _x) : x(_x) { } + ~finalSuspendObj () noexcept(true) {} + + finalSuspendAwaiter operator co_await() const & noexcept(true) { + return {x}; + } +}; + +struct task { + struct promise_type { + task get_return_object() noexcept { return {}; } + std::suspend_never initial_suspend() noexcept { return {}; } + + finalSuspendObj final_suspend() noexcept { return {3}; } + + void return_void() noexcept {} + void unhandled_exception() noexcept {} + }; +}; + +// This should be ill-formed since final_suspend() is potentially throwing. +task f() { + co_return; +} diff --git a/gcc/testsuite/g++.dg/coroutines/pr95711.C b/gcc/testsuite/g++.dg/coroutines/pr95711.C index f6aedb1..682a221 100644 --- a/gcc/testsuite/g++.dg/coroutines/pr95711.C +++ b/gcc/testsuite/g++.dg/coroutines/pr95711.C @@ -23,7 +23,7 @@ struct generator{ std::suspend_always initial_suspend (){ return {}; } - std::suspend_always final_suspend (){ + std::suspend_always final_suspend () noexcept { return {}; } diff --git a/gcc/testsuite/g++.dg/coroutines/pr95813.C b/gcc/testsuite/g++.dg/coroutines/pr95813.C index 445cdf1..269cba7 100644 --- a/gcc/testsuite/g++.dg/coroutines/pr95813.C +++ b/gcc/testsuite/g++.dg/coroutines/pr95813.C @@ -21,7 +21,7 @@ template <typename T, typename... Args> struct coroutine_traits<lazy<T>, Args...> { struct promise_type { suspend_always initial_suspend() const { return {}; } - suspend_always final_suspend() const { return {}; } + suspend_always final_suspend() const noexcept { return {}; } void return_value(T val) {} lazy<T> get_return_object() { return lazy<T>(); diff --git a/gcc/testsuite/g++.dg/coroutines/pr95822.C b/gcc/testsuite/g++.dg/coroutines/pr95822.C new file mode 100644 index 0000000..f6284aa --- /dev/null +++ b/gcc/testsuite/g++.dg/coroutines/pr95822.C @@ -0,0 +1,29 @@ +#include <coroutine> + +struct task { + struct promise_type { + auto initial_suspend() noexcept { return std::suspend_always{}; } + auto final_suspend() noexcept { return std::suspend_always{}; } + void return_void() {} + task get_return_object() { return task{}; } + void unhandled_exception() noexcept {} + }; + + ~task() noexcept {} + + bool await_ready() const noexcept { return false; } + void await_suspend(std::coroutine_handle<>) noexcept {} + void await_resume() noexcept {} +}; + +struct Error { + Error() { }; + ~Error() noexcept(false) {} +}; + +task g(); + +task f() { + Error error; + co_await g(); +} diff --git a/gcc/testsuite/g++.dg/coroutines/pr96251.C b/gcc/testsuite/g++.dg/coroutines/pr96251.C new file mode 100644 index 0000000..3f43504 --- /dev/null +++ b/gcc/testsuite/g++.dg/coroutines/pr96251.C @@ -0,0 +1,32 @@ +#include <coroutine> + +struct coroutine { + struct promise_type { + auto get_return_object() { return coroutine(); } + auto initial_suspend() { return std::suspend_always(); } + auto yield_value(int) { return std::suspend_always(); } + void return_void() {} + auto final_suspend() noexcept { return std::suspend_always(); } + void unhandled_exception() {} + }; +}; + +int main() { + auto f = [](auto max) -> coroutine { + for (int i = 0; i < max; ++i) { + co_yield i; + } + }; + + f(10); + + // From PR98976 + auto foo = [](auto&&) -> coroutine { + switch (42) { + case 42: + co_return; + } + }; + foo(1); + +} diff --git a/gcc/testsuite/g++.dg/coroutines/pr97587.C b/gcc/testsuite/g++.dg/coroutines/pr97587.C new file mode 100644 index 0000000..081c3a9 --- /dev/null +++ b/gcc/testsuite/g++.dg/coroutines/pr97587.C @@ -0,0 +1,32 @@ +// { dg-do run } + +#include<cassert> +#include<coroutine> + +int *parameter_addr_in_promise_ctor; + +struct return_object{ + struct promise_type{ + + promise_type(int ¶meter) + { + parameter_addr_in_promise_ctor = ¶meter; + } + + return_object get_return_object(){ return {}; } + + void return_void(){} + + auto initial_suspend(){ return std::suspend_never{}; } + auto final_suspend() noexcept { return std::suspend_never{}; } + void unhandled_exception(){} + }; +}; +return_object coroutine(int parameter = 42){ + assert(¶meter == parameter_addr_in_promise_ctor); + co_return; +} + +int main(int,char**){ + coroutine(); +} diff --git a/gcc/testsuite/g++.dg/coroutines/pr98118.C b/gcc/testsuite/g++.dg/coroutines/pr98118.C new file mode 100644 index 0000000..d09ffff --- /dev/null +++ b/gcc/testsuite/g++.dg/coroutines/pr98118.C @@ -0,0 +1,29 @@ +namespace std { +inline namespace __n4861 { +template <typename _Result, typename> struct coroutine_traits : _Result {}; +template <typename = void> struct coroutine_handle; +template <> struct coroutine_handle<> {}; +template <typename> struct coroutine_handle : coroutine_handle<> {}; +struct suspend_never { + bool await_ready() noexcept; + void await_suspend(coroutine_handle<>) noexcept; + void await_resume() noexcept; +}; +} // namespace __n4861 +} // namespace std + +struct fire_and_forget { + struct promise_type { + fire_and_forget get_return_object(); + std::suspend_never initial_suspend(); + std::suspend_never final_suspend() noexcept; + void return_void(); + void unhandled_exception(); + }; +}; + +struct bug { + ~bug(); +}; + +fire_and_forget f(bug) { co_return; } diff --git a/gcc/testsuite/g++.dg/coroutines/symmetric-transfer-00-basic.C b/gcc/testsuite/g++.dg/coroutines/symmetric-transfer-00-basic.C index b78ae20d..a959408 100644 --- a/gcc/testsuite/g++.dg/coroutines/symmetric-transfer-00-basic.C +++ b/gcc/testsuite/g++.dg/coroutines/symmetric-transfer-00-basic.C @@ -44,7 +44,7 @@ struct Loopy { } coro::suspend_always initial_suspend() { return {}; } - coro::suspend_always final_suspend() { return {}; } + coro::suspend_always final_suspend() noexcept { return {}; } void unhandled_exception() { /*std::terminate();*/ } void return_void() {} diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-await-07-tmpl.C b/gcc/testsuite/g++.dg/coroutines/torture/co-await-07-tmpl.C index 33f8e99..17dff0d 100644 --- a/gcc/testsuite/g++.dg/coroutines/torture/co-await-07-tmpl.C +++ b/gcc/testsuite/g++.dg/coroutines/torture/co-await-07-tmpl.C @@ -71,7 +71,7 @@ struct coro1 { return suspend_never_prt{}; } - auto final_suspend() { + auto final_suspend() noexcept { PRINT ("get final_suspend"); return suspend_always_prt{}; } diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-await-17-capture-comp-ref.C b/gcc/testsuite/g++.dg/coroutines/torture/co-await-17-capture-comp-ref.C index c5829c4..3eefe9e 100644 --- a/gcc/testsuite/g++.dg/coroutines/torture/co-await-17-capture-comp-ref.C +++ b/gcc/testsuite/g++.dg/coroutines/torture/co-await-17-capture-comp-ref.C @@ -20,7 +20,7 @@ struct resumable::promise_type { return coro_handle::from_promise(*this); } auto initial_suspend() { return std::suspend_never(); } - auto final_suspend() { return std::suspend_always(); } + auto final_suspend() noexcept { return std::suspend_always(); } void return_value(int x) {used = x;} void unhandled_exception() {} diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-ret-00-void-return-is-ready.C b/gcc/testsuite/g++.dg/coroutines/torture/co-ret-00-void-return-is-ready.C index f551c6e..dd0a3b7 100644 --- a/gcc/testsuite/g++.dg/coroutines/torture/co-ret-00-void-return-is-ready.C +++ b/gcc/testsuite/g++.dg/coroutines/torture/co-ret-00-void-return-is-ready.C @@ -57,7 +57,7 @@ struct coro1 { PRINT ("get initial_suspend (never) "); return suspend_never_prt{}; } - auto final_suspend () { + auto final_suspend () noexcept { PRINT ("get final_suspend (always) "); return suspend_always_prt{}; } diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-ret-01-void-return-is-suspend.C b/gcc/testsuite/g++.dg/coroutines/torture/co-ret-01-void-return-is-suspend.C index 03fc6eeb..1f4c3de 100644 --- a/gcc/testsuite/g++.dg/coroutines/torture/co-ret-01-void-return-is-suspend.C +++ b/gcc/testsuite/g++.dg/coroutines/torture/co-ret-01-void-return-is-suspend.C @@ -57,7 +57,7 @@ struct coro1 { PRINT ("get initial_suspend (always)"); return suspend_always_prt{}; } - auto final_suspend () { + auto final_suspend () noexcept { PRINT ("get final_suspend (always)"); return suspend_always_prt{}; } diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-ret-03-different-GRO-type.C b/gcc/testsuite/g++.dg/coroutines/torture/co-ret-03-different-GRO-type.C index 36da680..1a095c6 100644 --- a/gcc/testsuite/g++.dg/coroutines/torture/co-ret-03-different-GRO-type.C +++ b/gcc/testsuite/g++.dg/coroutines/torture/co-ret-03-different-GRO-type.C @@ -55,7 +55,7 @@ struct coro1 { PRINT ("get initial_suspend (always)"); return suspend_always_prt{}; } - auto final_suspend () { + auto final_suspend () noexcept { PRINT ("get final_suspend (always)"); return suspend_always_prt{}; } diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-ret-04-GRO-nontriv.C b/gcc/testsuite/g++.dg/coroutines/torture/co-ret-04-GRO-nontriv.C index 29fb942..abb789a 100644 --- a/gcc/testsuite/g++.dg/coroutines/torture/co-ret-04-GRO-nontriv.C +++ b/gcc/testsuite/g++.dg/coroutines/torture/co-ret-04-GRO-nontriv.C @@ -72,7 +72,7 @@ struct coro1 { PRINT ("get initial_suspend (always)"); return suspend_always_prt{}; } - auto final_suspend () { + auto final_suspend () noexcept { PRINT ("get final_suspend (always)"); return suspend_always_prt{}; } diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-ret-06-template-promise-val-1.C b/gcc/testsuite/g++.dg/coroutines/torture/co-ret-06-template-promise-val-1.C index 5b1acb8..91f591a 100644 --- a/gcc/testsuite/g++.dg/coroutines/torture/co-ret-06-template-promise-val-1.C +++ b/gcc/testsuite/g++.dg/coroutines/torture/co-ret-06-template-promise-val-1.C @@ -63,7 +63,7 @@ struct coro1 { PRINT ("get initial_suspend (always)"); return suspend_always_prt{}; } - auto final_suspend () const { + auto final_suspend () const noexcept { PRINT ("get final_suspend (always)"); return suspend_always_prt{}; } diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-ret-08-template-cast-ret.C b/gcc/testsuite/g++.dg/coroutines/torture/co-ret-08-template-cast-ret.C index 266bc7b..ac4cca4 100644 --- a/gcc/testsuite/g++.dg/coroutines/torture/co-ret-08-template-cast-ret.C +++ b/gcc/testsuite/g++.dg/coroutines/torture/co-ret-08-template-cast-ret.C @@ -60,7 +60,7 @@ struct coro1 { PRINT ("get initial_suspend (always)"); return suspend_always_prt{}; } - suspend_always_prt final_suspend () const { + suspend_always_prt final_suspend () const noexcept { PRINT ("get final_suspend (always)"); return suspend_always_prt{}; } diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-ret-09-bool-await-susp.C b/gcc/testsuite/g++.dg/coroutines/torture/co-ret-09-bool-await-susp.C index d14c358..3368322 100644 --- a/gcc/testsuite/g++.dg/coroutines/torture/co-ret-09-bool-await-susp.C +++ b/gcc/testsuite/g++.dg/coroutines/torture/co-ret-09-bool-await-susp.C @@ -70,7 +70,7 @@ struct coro1 { PRINT ("get initial_suspend (always, but really never) "); return suspend_always_prt{}; } - auto final_suspend () { + auto final_suspend () noexcept { PRINT ("get final_suspend (always, but never) "); return suspend_always_prt{}; } diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-ret-15-default-return_void.C b/gcc/testsuite/g++.dg/coroutines/torture/co-ret-15-default-return_void.C index 99910f3..300052c 100644 --- a/gcc/testsuite/g++.dg/coroutines/torture/co-ret-15-default-return_void.C +++ b/gcc/testsuite/g++.dg/coroutines/torture/co-ret-15-default-return_void.C @@ -28,7 +28,7 @@ public: using coro_handle = std::coroutine_handle<promise_type>; auto get_return_object() { return coro_handle::from_promise(*this); } auto initial_suspend() { return std::suspend_always(); } - auto final_suspend() { return std::suspend_always(); } + auto final_suspend() noexcept { return std::suspend_always(); } void return_void() { value_ = -1; } void unhandled_exception() {} private: diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-ret-17-void-ret-coro.C b/gcc/testsuite/g++.dg/coroutines/torture/co-ret-17-void-ret-coro.C index 01a75c1..9c9d2fa 100644 --- a/gcc/testsuite/g++.dg/coroutines/torture/co-ret-17-void-ret-coro.C +++ b/gcc/testsuite/g++.dg/coroutines/torture/co-ret-17-void-ret-coro.C @@ -21,7 +21,7 @@ struct std::coroutine_traits<R, HandleRef, T...> { auto initial_suspend() { return std::suspend_always{}; } - auto final_suspend() { return std::suspend_never{}; } + auto final_suspend() noexcept { return std::suspend_never{}; } void return_void() {} void unhandled_exception() {} diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-yield-00-triv.C b/gcc/testsuite/g++.dg/coroutines/torture/co-yield-00-triv.C index 586b6b2..15e390e 100644 --- a/gcc/testsuite/g++.dg/coroutines/torture/co-yield-00-triv.C +++ b/gcc/testsuite/g++.dg/coroutines/torture/co-yield-00-triv.C @@ -62,7 +62,7 @@ struct coro1 { PRINT ("get initial_suspend (always)"); return suspend_always_prt{}; } - auto final_suspend () { + auto final_suspend () noexcept { PRINT ("get final_suspend (always)"); return suspend_always_prt{}; } diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-yield-03-tmpl.C b/gcc/testsuite/g++.dg/coroutines/torture/co-yield-03-tmpl.C index cceee1f..45fc8d7 100644 --- a/gcc/testsuite/g++.dg/coroutines/torture/co-yield-03-tmpl.C +++ b/gcc/testsuite/g++.dg/coroutines/torture/co-yield-03-tmpl.C @@ -22,7 +22,7 @@ struct looper { return suspend_always_prt{}; } - auto final_suspend () { + auto final_suspend () noexcept { PRINT ("get final_suspend (always)"); return suspend_always_prt{}; } diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-yield-04-complex-local-state.C b/gcc/testsuite/g++.dg/coroutines/torture/co-yield-04-complex-local-state.C index d9330b3..f97bd23 100644 --- a/gcc/testsuite/g++.dg/coroutines/torture/co-yield-04-complex-local-state.C +++ b/gcc/testsuite/g++.dg/coroutines/torture/co-yield-04-complex-local-state.C @@ -25,7 +25,7 @@ struct looper { return suspend_always_prt{}; } - auto final_suspend () { + auto final_suspend () noexcept { PRINT ("get final_suspend (always)"); return suspend_always_prt{}; } diff --git a/gcc/testsuite/g++.dg/coroutines/torture/exceptions-test-0.C b/gcc/testsuite/g++.dg/coroutines/torture/exceptions-test-0.C index 164c804..85135fc 100644 --- a/gcc/testsuite/g++.dg/coroutines/torture/exceptions-test-0.C +++ b/gcc/testsuite/g++.dg/coroutines/torture/exceptions-test-0.C @@ -60,7 +60,7 @@ struct coro1 { PRINT ("get initial_suspend (always)"); return suspend_always_prt{}; } - auto final_suspend () { + auto final_suspend () noexcept { PRINT ("get final_suspend (always)"); return suspend_always_prt{}; } diff --git a/gcc/testsuite/g++.dg/coroutines/torture/exceptions-test-01-n4849-a.C b/gcc/testsuite/g++.dg/coroutines/torture/exceptions-test-01-n4849-a.C index e96b4ed..6433b62 100644 --- a/gcc/testsuite/g++.dg/coroutines/torture/exceptions-test-01-n4849-a.C +++ b/gcc/testsuite/g++.dg/coroutines/torture/exceptions-test-01-n4849-a.C @@ -87,7 +87,7 @@ struct coro1 { PRINT ("get initial_suspend (always)"); return suspend_always_susp_throws_prt(throw_control); } - auto final_suspend () { + auto final_suspend () noexcept { PRINT ("get final_suspend (always)"); return suspend_always_prt{}; } diff --git a/gcc/testsuite/g++.dg/coroutines/torture/func-params-04.C b/gcc/testsuite/g++.dg/coroutines/torture/func-params-04.C index 789e2c0..c90c152 100644 --- a/gcc/testsuite/g++.dg/coroutines/torture/func-params-04.C +++ b/gcc/testsuite/g++.dg/coroutines/torture/func-params-04.C @@ -12,6 +12,7 @@ struct nontriv { int a, b, c; nontriv (int _a, int _b, int _c) : a(_a), b(_b), c(_c) {} virtual int getA () { return a; } + ~nontriv() { a = -1; } }; struct coro1 @@ -19,12 +20,12 @@ f (nontriv t) noexcept { if (t.a > 30) { - PRINTF ("coro1: about to return %d", t.b); + PRINTF ("coro1: about to return %d\n", t.b); co_return t.b; } else if (t.a > 20) { - PRINTF ("coro1: about to co-return %d", t.c); + PRINTF ("coro1: about to co-return %d\n", t.c); co_return t.c; } else diff --git a/gcc/testsuite/g++.dg/coroutines/torture/local-var-06-structured-binding.C b/gcc/testsuite/g++.dg/coroutines/torture/local-var-06-structured-binding.C index ef3ff47..282aa7a 100644 --- a/gcc/testsuite/g++.dg/coroutines/torture/local-var-06-structured-binding.C +++ b/gcc/testsuite/g++.dg/coroutines/torture/local-var-06-structured-binding.C @@ -15,7 +15,7 @@ struct promise promise (Args&... args) {} coro::suspend_never initial_suspend() { return {}; } - coro::suspend_never final_suspend() { return {}; } + coro::suspend_never final_suspend() noexcept { return {}; } future get_return_object() { return {}; } diff --git a/gcc/testsuite/g++.dg/coroutines/torture/mid-suspend-destruction-0.C b/gcc/testsuite/g++.dg/coroutines/torture/mid-suspend-destruction-0.C index 505bfa3..63561ea 100644 --- a/gcc/testsuite/g++.dg/coroutines/torture/mid-suspend-destruction-0.C +++ b/gcc/testsuite/g++.dg/coroutines/torture/mid-suspend-destruction-0.C @@ -61,7 +61,7 @@ struct coro1 { PRINT ("get initial_suspend (always)"); return suspend_always_prt{}; } - auto final_suspend () { + auto final_suspend () noexcept { PRINT ("get final_suspend (always)"); return suspend_always_prt{}; } diff --git a/gcc/testsuite/g++.dg/coroutines/torture/pr95615-01.C b/gcc/testsuite/g++.dg/coroutines/torture/pr95615-01.C new file mode 100644 index 0000000..cf30c82 --- /dev/null +++ b/gcc/testsuite/g++.dg/coroutines/torture/pr95615-01.C @@ -0,0 +1,4 @@ +// { dg-do run } + +#define INITIAL_SUSPEND_THROWS 1 +#include "pr95615.inc" diff --git a/gcc/testsuite/g++.dg/coroutines/torture/pr95615-02.C b/gcc/testsuite/g++.dg/coroutines/torture/pr95615-02.C new file mode 100644 index 0000000..7ec0f33 --- /dev/null +++ b/gcc/testsuite/g++.dg/coroutines/torture/pr95615-02.C @@ -0,0 +1,4 @@ +// { dg-do run } + +#define PROMISE_CTOR_THROWS 1 +#include "pr95615.inc" diff --git a/gcc/testsuite/g++.dg/coroutines/torture/pr95615-03.C b/gcc/testsuite/g++.dg/coroutines/torture/pr95615-03.C new file mode 100644 index 0000000..8053335 --- /dev/null +++ b/gcc/testsuite/g++.dg/coroutines/torture/pr95615-03.C @@ -0,0 +1,4 @@ +// { dg-do run } + +#define GET_RETURN_OBJECT_THROWS 1 +#include "pr95615.inc" diff --git a/gcc/testsuite/g++.dg/coroutines/torture/pr95615-04.C b/gcc/testsuite/g++.dg/coroutines/torture/pr95615-04.C new file mode 100644 index 0000000..db5c128 --- /dev/null +++ b/gcc/testsuite/g++.dg/coroutines/torture/pr95615-04.C @@ -0,0 +1,4 @@ +// { dg-do run } + +#define INITIAL_AWAIT_READY_THROWS 1 +#include "pr95615.inc" diff --git a/gcc/testsuite/g++.dg/coroutines/torture/pr95615-05.C b/gcc/testsuite/g++.dg/coroutines/torture/pr95615-05.C new file mode 100644 index 0000000..5fd62f6 --- /dev/null +++ b/gcc/testsuite/g++.dg/coroutines/torture/pr95615-05.C @@ -0,0 +1,4 @@ +// { dg-do run } + +#define INITIAL_AWAIT_SUSPEND_THROWS 1 +#include "pr95615.inc" diff --git a/gcc/testsuite/g++.dg/coroutines/torture/pr95615.inc b/gcc/testsuite/g++.dg/coroutines/torture/pr95615.inc new file mode 100644 index 0000000..5fc2243 --- /dev/null +++ b/gcc/testsuite/g++.dg/coroutines/torture/pr95615.inc @@ -0,0 +1,128 @@ +#if __has_include(<coroutine>) +#include <coroutine> +#else +#include <experimental/coroutine> +namespace std { + using namespace std::experimental; +} +#endif +#include <cassert> +#include <cstdio> +#include <cstdlib> + +bool frame_live = false; +bool promise_live = false; +bool gro_live = false; + +struct X {}; + +int Y_live = 0; + +struct Y +{ + Y () { std::puts("Y ()"); Y_live++; } + Y (const Y&) { std::puts("Y (const Y&)"); Y_live++; } + ~Y () { std::puts("~Y ()"); Y_live--; } +}; + +struct task { + struct promise_type { + void* operator new(size_t sz) { + std::puts("operator new()"); + frame_live = true; + return ::operator new(sz); + } + + void operator delete(void* p, size_t sz) { + std::puts("operator delete"); + frame_live = false; + return ::operator delete(p, sz); + } + + promise_type() { + std::puts("promise_type()"); +#if PROMISE_CTOR_THROWS + throw X{}; +#endif + promise_live = true; + } + + ~promise_type() { + std::puts("~promise_type()"); + promise_live = false; + } + + struct awaiter { + bool await_ready() { +#if INITIAL_AWAIT_READY_THROWS + throw X{}; +#endif + return false; + } + void await_suspend(std::coroutine_handle<>) { +#if INITIAL_AWAIT_SUSPEND_THROWS + throw X{}; +#endif + } + void await_resume() { +#if INITIAL_AWAIT_RESUME_THROWS +// this would be caught by unhandled_exception () which is tested +// elsewhere. + throw X{}; +#endif + } + }; + + awaiter initial_suspend() { +#if INITIAL_SUSPEND_THROWS + throw X{}; +#endif + return {}; + } + + task get_return_object() { + std::puts("get_return_object()"); +#if GET_RETURN_OBJECT_THROWS + throw X{}; +#endif + bool gro_live = true; + return task{}; + } + + std::suspend_never final_suspend() noexcept { return {}; } + void return_void() noexcept {} + void unhandled_exception() noexcept { + std::puts("unhandled_exception()"); + } + }; + + task() { std::puts("task()"); } + ~task() { std::puts("~task()"); } + task(task&&) { std::puts("task(task&&)"); } +}; + +task f(Y Val) { + co_return; +} + +int main() { + bool failed = false; + Y Val; + try { + f(Val); + } catch (X) { + std::puts("caught X"); + if (gro_live) + std::puts("gro live"), failed = true; + if (promise_live) + std::puts("promise live"), failed = true; + if (frame_live) + std::puts("frame live"), failed = true; + } + + if (Y_live != 1) + std::printf("Y live %d\n", Y_live), failed = true; + + if (failed) + abort() ; +} diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-cast2.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-cast2.C new file mode 100644 index 0000000..7c37f6a --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-cast2.C @@ -0,0 +1,16 @@ +// DR 1312 - Simulated reinterpret_cast in constant expressions. +// PR c++/99176 +// { dg-do compile { target c++11 } } + +static int i; +constexpr void *vp0 = nullptr; +constexpr void *vpi = &i; +constexpr int *p1 = (int *) vp0; // { dg-error "cast from .void\\*. is not allowed" } +constexpr int *p2 = (int *) vpi; // { dg-error "cast from .void\\*. is not allowed" "integer_zerop" { xfail *-*-* } } +constexpr int *p3 = static_cast<int *>(vp0); // { dg-error "cast from .void\\*. is not allowed" } +constexpr int *p4 = static_cast<int *>(vpi); // { dg-error "cast from .void\\*. is not allowed" "integer_zerop" { xfail *-*-* } } +constexpr void *p5 = vp0; +constexpr void *p6 = vpi; + +constexpr int *pi = &i; +constexpr bool b = ((int *)(void *) pi == pi); // { dg-error "cast from .void\\*. is not allowed" "integer_zerop" { xfail *-*-* } } diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-cast3.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-cast3.C new file mode 100644 index 0000000..a330a99 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-cast3.C @@ -0,0 +1,14 @@ +// PR c++/99176 +// { dg-do compile { target c++11 } } + +constexpr const int *p = nullptr; +constexpr int *q1 = const_cast<int*>(p); +constexpr int *q2 = (int *)(const int *) nullptr; + +struct B { }; +struct D : B { }; +constexpr B *q3 = static_cast<B*>(nullptr); +constexpr D *pd = nullptr; +constexpr B *pb = nullptr; +constexpr B *q4 = static_cast<B*>(pd); +constexpr D *q5 = static_cast<D*>(pb); diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-nullptr-2.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-nullptr-2.C index afb4b37..92f3bbd 100644 --- a/gcc/testsuite/g++.dg/cpp0x/constexpr-nullptr-2.C +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-nullptr-2.C @@ -163,7 +163,7 @@ constexpr const void *pv2 = pv0; constexpr void *pv3 = pv2; // { dg-error "invalid conversion|not a constant expression" } constexpr const void *pv4 = pv2; -constexpr X *px4 = pv0; // { dg-error "invalid conversion|not a constant expression" } +constexpr X *px4 = pv0; // { dg-error "cast from|invalid conversion|not a constant expression" } } @@ -226,7 +226,7 @@ constexpr A *pa3 = pd0; // { dg-error "ambiguous base" } constexpr A *pa4 = static_cast<A*>(pd0); // { dg-error "ambiguous base" } constexpr B *pb1 = pa0; // { dg-error "invalid conversion|not a constant expression" } -constexpr B *pb2 = static_cast<B*>(pa0); // { dg-error "not a constant expression" } +constexpr B *pb2 = static_cast<B*>(pa0); constexpr C *pc1 = pa0; // { dg-error "invalid conversion|not a constant expression" } constexpr D *pd1 = pa0; // { dg-error "ambiguous base|invalid conversion" } diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype-call5.C b/gcc/testsuite/g++.dg/cpp0x/decltype-call5.C new file mode 100644 index 0000000..81ef6e6 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/decltype-call5.C @@ -0,0 +1,7 @@ +// PR c++/95675 +// { dg-do compile { target c++11 } } + +struct b {}; +b operator|(b, b) { return {}; } +b e, f, g; +using h = decltype(e | f | g); diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype-call6.C b/gcc/testsuite/g++.dg/cpp0x/decltype-call6.C new file mode 100644 index 0000000..4173b60 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/decltype-call6.C @@ -0,0 +1,12 @@ +// PR c++/95675 +// { dg-do compile { target c++11 } } + +struct a {}; +template <typename> struct b; +template <typename bq, typename br> struct b<bq(br)> { + decltype(bq()(br())) c; +}; +struct e { + operator a(); +}; +b<e (*(e))(a)> d; diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype64.C b/gcc/testsuite/g++.dg/cpp0x/decltype64.C index 46d1859..0cd614c 100644 --- a/gcc/testsuite/g++.dg/cpp0x/decltype64.C +++ b/gcc/testsuite/g++.dg/cpp0x/decltype64.C @@ -5,7 +5,7 @@ template<int I> struct index {}; -constexpr int recursive_impl(index<0u>) +constexpr int recursive_impl(const index<0u>&) { return 0; } diff --git a/gcc/testsuite/g++.dg/cpp0x/overload4.C b/gcc/testsuite/g++.dg/cpp0x/overload4.C new file mode 100644 index 0000000..b2f8eb1 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/overload4.C @@ -0,0 +1,174 @@ +// PR c++/96926 +// { dg-do compile { target c++11 } } + +namespace std +{ + template<typename _Tp, _Tp __v> + struct integral_constant + { + static constexpr _Tp value = __v; + typedef integral_constant<_Tp, __v> type; + }; + + template<typename _Tp, _Tp __v> + constexpr _Tp integral_constant<_Tp, __v>::value; + + typedef integral_constant<bool, true> true_type; + typedef integral_constant<bool, false> false_type; + + template<bool __v> + using bool_constant = integral_constant<bool, __v>; + + template<bool, typename, typename> + struct conditional; + + template<typename...> + struct __and_; + + template<> + struct __and_<> + : public true_type + { }; + + template<typename _B1> + struct __and_<_B1> + : public _B1 + { }; + + template<typename _B1, typename _B2> + struct __and_<_B1, _B2> + : public conditional<_B1::value, _B2, _B1>::type + { }; + + template<typename _B1, typename _B2, typename _B3, typename... _Bn> + struct __and_<_B1, _B2, _B3, _Bn...> + : public conditional<_B1::value, __and_<_B2, _B3, _Bn...>, _B1>::type + { }; + + template<typename _Tp, typename... _Args> + struct is_constructible + : public bool_constant<__is_constructible(_Tp, _Args...)> + { + }; + + template<bool, typename _Tp = void> + struct enable_if + { }; + + template<typename _Tp> + struct enable_if<true, _Tp> + { typedef _Tp type; }; + + template<bool _Cond, typename _Tp = void> + using __enable_if_t = typename enable_if<_Cond, _Tp>::type; + + template<bool _Cond, typename _Iftrue, typename _Iffalse> + struct conditional + { typedef _Iftrue type; }; + + + template<typename _Iftrue, typename _Iffalse> + struct conditional<false, _Iftrue, _Iffalse> + { typedef _Iffalse type; }; + + + template<bool, typename... _Types> + struct _TupleConstraints + { + template<typename... _UTypes> + static constexpr bool __is_implicitly_constructible() + { + // is_constructible is incomplete here, but only when + // it is also instantiated in __is_explicitly_constructible + return __and_<is_constructible<_Types, _UTypes>..., + true_type + >::value; + } + + template<typename... _UTypes> + static constexpr bool __is_explicitly_constructible() + { +#if FIX + return false; +#else + return __and_<is_constructible<_Types, _UTypes>..., + false_type + >::value; +#endif + } + }; + + template<typename... _Elements> + class tuple + { + template<bool _Cond> + using _TCC = _TupleConstraints<_Cond, _Elements...>; + + template<bool _Cond, typename... _Args> + using _ImplicitCtor = __enable_if_t< + _TCC<_Cond>::template __is_implicitly_constructible<_Args...>(), + bool>; + + template<bool _Cond, typename... _Args> + using _ExplicitCtor = __enable_if_t< + _TCC<_Cond>::template __is_explicitly_constructible<_Args...>(), + bool>; + + public: + + template<bool _NotEmpty = true, + _ImplicitCtor<_NotEmpty, const _Elements&...> = true> + constexpr + tuple(const _Elements&... __elements) + { } + + template<bool _NotEmpty = true, + _ExplicitCtor<_NotEmpty, const _Elements&...> = false> + explicit constexpr + tuple(const _Elements&... __elements) + { } + }; +} + +// first example + +template <typename SessionT> +struct SomeQuery { + SessionT& session_; + SomeQuery(SessionT& session) : session_(session) {} +}; + +template <typename SessionT> +struct Handler { + std::tuple<SomeQuery<SessionT>> queries_; + Handler(SessionT& session) : queries_(session) {} +}; + +struct Session { + Handler<Session> handler_; + Session() : handler_{*this} {} +}; + +int main() { + Session session; +} +static_assert(std::is_constructible<SomeQuery<Session>, const SomeQuery<Session>&>::value, ""); + +// second example + +template <typename T> +class DependsOnT +{ +public: + DependsOnT(T&) {} +}; + +class Test +{ +public: + Test() : test_{*this} {} + +private: + std::tuple<DependsOnT<Test>> test_; +}; +static_assert(std::is_constructible<DependsOnT<Test>, const DependsOnT<Test>&>::value, ""); diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-nsdmi7b.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-nsdmi7b.C index 86d8ab4..ec10ddd 100644 --- a/gcc/testsuite/g++.dg/cpp1y/constexpr-nsdmi7b.C +++ b/gcc/testsuite/g++.dg/cpp1y/constexpr-nsdmi7b.C @@ -20,8 +20,8 @@ bar() { A a = foo(); a.p->n = 5; - return a; // { dg-error "non-.constexpr." } -} + return a; +} // { dg-error "non-.constexpr." } constexpr int baz() diff --git a/gcc/testsuite/g++.dg/cpp1y/lambda-generic-95451.C b/gcc/testsuite/g++.dg/cpp1y/lambda-generic-95451.C new file mode 100644 index 0000000..1315c01 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/lambda-generic-95451.C @@ -0,0 +1,35 @@ +// PR c++/95451 +// { dg-do run { target c++14 } } + +extern "C" void abort (); + +struct A { + template <typename> + void foo () + { + auto b = [this] (auto) { return operator () (); } (0); + if (b != 3) + abort (); + auto c = [this] (int) { return operator () (); } (0); + if (c != 3) + abort (); + } + void bar () + { + auto d = [this] (auto) { return operator () (); } (0); + if (d != 3) + abort (); + auto e = [this] (int) { return operator () (); } (0); + if (e != 3) + abort (); + } + int operator () () { return 3; } +}; + +int +main () +{ + A a; + a.foo<void> (); + a.bar (); +} diff --git a/gcc/testsuite/g++.dg/cpp1y/var-templ68.C b/gcc/testsuite/g++.dg/cpp1y/var-templ68.C new file mode 100644 index 0000000..4c560d4 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/var-templ68.C @@ -0,0 +1,15 @@ +// PR c++/96330 +// { dg-do compile { target c++14 } } + +struct foo_t { + template <class T> static constexpr bool bar = true; +}; +constexpr foo_t foo{}; + +template <class T> +void f() { + int x = foo.bar<T>; + int y = foo_t::bar<T>; +} + +template void f<int>(); diff --git a/gcc/testsuite/g++.dg/cpp1y/var-templ68a.C b/gcc/testsuite/g++.dg/cpp1y/var-templ68a.C new file mode 100644 index 0000000..6091a03 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/var-templ68a.C @@ -0,0 +1,16 @@ +// PR c++/96330 +// { dg-do compile { target c++14 } } + +template <class> +struct foo_t { + template <class T> static constexpr bool bar = true; +}; +template <class T> constexpr foo_t<T> foo{}; + +template <class T> +void f() { + int x = foo<T>.template bar<T>; + int y = foo_t<T>::template bar<T>; +} + +template void f<int>(); diff --git a/gcc/testsuite/g++.dg/cpp1z/auto1.C b/gcc/testsuite/g++.dg/cpp1z/auto1.C new file mode 100644 index 0000000..5cc762a --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/auto1.C @@ -0,0 +1,13 @@ +// Verify that deduction failure of the decltype(auto) template parameter is +// a SFINAE error. +// { dg-do compile { target c++17 } } + +template <class> void f(); +template <class> void f(int); + +template <class T = int, decltype(auto) = &f<T>> void g(); +template <class = int> void g(); + +int main() { + g(); +} diff --git a/gcc/testsuite/g++.dg/cpp1z/class-deduction79.C b/gcc/testsuite/g++.dg/cpp1z/class-deduction79.C new file mode 100644 index 0000000..ebbe2b2 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/class-deduction79.C @@ -0,0 +1,10 @@ +// PR c++/99103 +// { dg-do compile { target c++17 } } +#include <initializer_list> + +template <class T> +struct S { S(std::initializer_list<T>); }; + +extern const S<int> x; +using type = decltype(S{x}); +using type = S<int>; // not S<S<int>> diff --git a/gcc/testsuite/g++.dg/cpp1z/class-deduction80.C b/gcc/testsuite/g++.dg/cpp1z/class-deduction80.C new file mode 100644 index 0000000..5ccfc93 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/class-deduction80.C @@ -0,0 +1,9 @@ +// PR c++/99103 +// { dg-do compile { target c++17 } } + +template <class T> struct X { T a; }; +template <class T> struct Y : X<T> {}; + +extern const Y<int> y; +using type = decltype(X{y}); +using type = X<int>; // not X<Y<int>> diff --git a/gcc/testsuite/g++.dg/cpp1z/class-deduction81.C b/gcc/testsuite/g++.dg/cpp1z/class-deduction81.C new file mode 100644 index 0000000..86a6824 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/class-deduction81.C @@ -0,0 +1,20 @@ +// PR c++/97034 +// { dg-do compile { target c++17 } } + +template <typename Z> +struct E { + template <typename T> + struct G { + T t; + G(T) { } + }; + + void fn() { G{1}; } +}; + +void +g () +{ + E<int> e; + e.fn (); +} diff --git a/gcc/testsuite/g++.dg/cpp1z/class-deduction82.C b/gcc/testsuite/g++.dg/cpp1z/class-deduction82.C new file mode 100644 index 0000000..238024c --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/class-deduction82.C @@ -0,0 +1,12 @@ +// PR c++/99009 +// { dg-do compile { target c++17 } } + +template<typename> struct B { + B(int = A()) {} + template <typename ...> struct A; +}; + +template<typename T> struct X { + template <T...> struct Y; + X() { Y y; }; +}; diff --git a/gcc/testsuite/g++.dg/cpp1z/class-deduction83.C b/gcc/testsuite/g++.dg/cpp1z/class-deduction83.C new file mode 100644 index 0000000..63eab6a --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/class-deduction83.C @@ -0,0 +1,13 @@ +// PR c++/96474 +// { dg-do compile { target c++17 } } + +template <typename = void> +struct A +{ + template <typename = void> + struct B + { + }; +}; + +A<>::B b; diff --git a/gcc/testsuite/g++.dg/cpp1z/eval-order10.C b/gcc/testsuite/g++.dg/cpp1z/eval-order10.C new file mode 100644 index 0000000..02719b7 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/eval-order10.C @@ -0,0 +1,27 @@ +// PR c++/82959 +// { dg-do run } +// { dg-additional-options -fstrong-eval-order } + +struct A {}; + +void operator && (const A x, const A) {} +void operator || (const A x, const A) {} +void operator , (const A x, const A) {} + +int i; + +A f () { if (i != 0) __builtin_abort (); i = 1; return A (); } +A g () { if (i != 1) __builtin_abort (); i = 2; return A (); } + +int +main () +{ + f () && g (); + if (i != 2) __builtin_abort (); + i = 0; + f () || g (); + if (i != 2) __builtin_abort (); + i = 0; + f (), g (); + if (i != 2) __builtin_abort (); +} diff --git a/gcc/testsuite/g++.dg/cpp1z/noexcept-type23.C b/gcc/testsuite/g++.dg/cpp1z/noexcept-type23.C new file mode 100644 index 0000000..612dd6c --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/noexcept-type23.C @@ -0,0 +1,14 @@ +// PR c++/99374 +// { dg-do compile { target c++17 } } + +struct S; +struct R; +using F1 = int (S::*)(); +using F2 = int (S::*)() noexcept; +using F3 = int (R::*)() noexcept; +using T = S; +using F4 = int (T::*)() noexcept; +F1 f21 = F2(); +F1 f41 = F4(); +F2 f12 = F1(); // { dg-error "cannot convert" } +F1 f31 = F3(); // { dg-error "cannot convert" } diff --git a/gcc/testsuite/g++.dg/cpp23/lambda-specifiers1.C b/gcc/testsuite/g++.dg/cpp23/lambda-specifiers1.C new file mode 100644 index 0000000..6729a45 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp23/lambda-specifiers1.C @@ -0,0 +1,18 @@ +// P1102R2 - Down with ()! +// { dg-do compile { target c++11 } } +// { dg-options "" } + +void +foo () +{ + auto a = [] mutable {}; // { dg-warning "parameter declaration before lambda declaration specifiers only optional with" "" { target c++20_down } } +#if __cpp_constexpr >= 201603L + auto b = [] constexpr {}; // { dg-warning "parameter declaration before lambda declaration specifiers only optional with" "" { target { c++17 && c++20_down } } } +#endif +#if __cpp_consteval >= 201811L + auto c = [] consteval {}; // { dg-warning "parameter declaration before lambda declaration specifiers only optional with" "" { target c++20_only } } +#endif + auto d = [] throw() {}; // { dg-warning "parameter declaration before lambda exception specification only optional with" "" { target c++20_down } } + auto e = [] noexcept {}; // { dg-warning "parameter declaration before lambda exception specification only optional with" "" { target c++20_down } } + auto f = [] -> int { return 0; }; // { dg-warning "parameter declaration before lambda trailing return type only optional with" "" { target c++20_down } } +} diff --git a/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr10.C b/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr10.C new file mode 100644 index 0000000..be922bb --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr10.C @@ -0,0 +1,21 @@ +// PR c++/97034 +// { dg-do compile { target c++20 } } + +namespace N { +template <typename, typename> struct S { + template <typename T, typename U> S(T, U); +}; +} // namespace N +template <int I> struct E { + template<typename U> struct M { + template <typename T> struct G { T t; }; + void fn() { G{N::S<char, int>{'a', 1}}; } + }; +}; + +void +g () +{ + E<1>::M<int> m; + m.fn (); +} diff --git a/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr8.C b/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr8.C new file mode 100644 index 0000000..3990611 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr8.C @@ -0,0 +1,19 @@ +// PR c++/97034 +// { dg-do compile { target c++20 } } + +namespace N { +template <typename, typename> struct S { + template <typename T, typename U> S(T, U); +}; +} // namespace N +template <int> struct E { + template <typename T> struct G { T t; }; + void fn() { G{N::S<char, int>{'a', 1}}; } +}; + +void +g () +{ + E<1> e; + e.fn (); +} diff --git a/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr9.C b/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr9.C new file mode 100644 index 0000000..245a04c --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr9.C @@ -0,0 +1,18 @@ +// PR c++/97034 +// { dg-do compile { target c++20 } } + +template<typename> +struct E { + template <typename T> + struct G { + T t; + }; + + void fn() { G{1}; } +}; + +void +g () { + E<int> e; + e.fn (); +} diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-lambda15.C b/gcc/testsuite/g++.dg/cpp2a/concepts-lambda15.C new file mode 100644 index 0000000..29df5d0 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/concepts-lambda15.C @@ -0,0 +1,16 @@ +// PR c++/96960 +// { dg-do compile { target c++20 } } + +template <class, class> concept C0 = true; + +template <class T> +concept C = requires(T t) { + { 42 } -> C0<char [([] { return 42; }())]>; +}; + +static_assert(C<int>); + +C0<char [([] { return 42; }())]> auto x = 42; + +int f(C0<char [([] { return 42; }())]> auto x); +int y = f(42); diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec9.C b/gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec9.C new file mode 100644 index 0000000..3dae24d --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec9.C @@ -0,0 +1,23 @@ +// PR c++/99365 +// { dg-do compile { target c++20 } } + +template <class> concept C = true; +template <class T, class U> concept D = C<T> && __is_same(T, U); + +template <class, C auto> struct A { static const int i = 0; }; +template <class T, D<T> auto V> struct A<T, V> { static const int i = 1; }; + +static_assert(A<int, 0>::i == 1); +static_assert(A<char, 0>::i == 0); +static_assert(A<int, '0'>::i == 0); +static_assert(A<char, '0'>::i == 1); + +template <class> struct O { + template <class, C auto> struct A { static const int i = 0; }; + template <class T, D<T> auto V> struct A<T, V> { static const int i = 1; }; +}; + +static_assert(O<void>::A<int, 0>::i == 1); +static_assert(O<void>::A<char, 0>::i == 0); +static_assert(O<void>::A<int, '0'>::i == 0); +static_assert(O<void>::A<char, '0'>::i == 1); diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-placeholder3.C b/gcc/testsuite/g++.dg/cpp2a/concepts-placeholder3.C new file mode 100644 index 0000000..87e3c09 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/concepts-placeholder3.C @@ -0,0 +1,19 @@ +// PR c++/96443 +// { dg-do compile { target c++20 } } + +template <class T, class U> concept same_as = __is_same(T, U); + +auto f(auto x) -> same_as<decltype(x)> auto { return 0; }; // { dg-error "constraints" } +void g(auto x) { same_as<decltype(x)> auto y = 0; } // { dg-error "constraints" } +auto h(auto x) -> same_as<decltype(x.missing)> auto { return 0; } // { dg-error "constraints|missing" } +template <class T, same_as<T> auto N> void i() {} + +int main() { + f(0); // { dg-bogus "" } + f(true); // { dg-message "required from here" } + g(0); // { dg-bogus "" } + g(true); // { dg-message "required from here" } + h(0); // { dg-message "required from here" } + i<int, 0>(); // { dg-bogus "" } + i<int, true>(); // { dg-error "no match|constraints" } +} diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-placeholder4.C b/gcc/testsuite/g++.dg/cpp2a/concepts-placeholder4.C new file mode 100644 index 0000000..9f39d45 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/concepts-placeholder4.C @@ -0,0 +1,24 @@ +// { dg-do compile { target c++20 } } + +template <class T, class U> concept same_as = __is_same(T, U); + +// this constrained placeholder type should get resolved at parse time +template <class T> same_as<bool> auto x = true; + +template <auto V> same_as<int> auto y = V; // { dg-error "constraint" } + +template <class> +struct A { + template <auto V> static inline same_as<int> auto z = V; // { dg-error "constraint" } +}; + +int main() { + x<int>; // { dg-bogus "" } + y<0>; // { dg-bogus "" } + y<'0'>; // { dg-message "required from here" } + A<void>::z<0>; // { dg-bogus "" } + A<void>::z<'0'>; // { dg-message "required from here" } +} + +// unsatisfied placeholder type constraint diagnosed at parse time +template <class T> same_as<int> auto w = true; // { dg-error "constraint" } diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-return-req2.C b/gcc/testsuite/g++.dg/cpp2a/concepts-return-req2.C new file mode 100644 index 0000000..77208bb --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/concepts-return-req2.C @@ -0,0 +1,13 @@ +// Verify we check return-type-requirements by passing the entire set of +// template arguments to normalization rather than first substituting into +// the constraint. The latter approach would induce a substitution failure and +// cause the requires-expression to evaluate to false here. +// { dg-do compile { target c++20 } } + +template <class, class> +concept C1 = true; + +template <class T> +concept C2 = requires { { 0 } -> C1<typename T::type>; }; + +static_assert(C2<int>); diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-ts1.C b/gcc/testsuite/g++.dg/cpp2a/concepts-ts1.C index 1cefe3b..a116cac 100644 --- a/gcc/testsuite/g++.dg/cpp2a/concepts-ts1.C +++ b/gcc/testsuite/g++.dg/cpp2a/concepts-ts1.C @@ -40,7 +40,7 @@ void driver() f3('a'); // { dg-error "" } f4(0, 0); f4(0, 'a'); // { dg-error "" } - f15(0); + f15(0); // { dg-bogus "" } f15('a'); // { dg-message "" } } diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-99287.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-99287.C new file mode 100644 index 0000000..c9c2ac2 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-99287.C @@ -0,0 +1,61 @@ +// PR c++/99287 +// { dg-do compile { target c++20 } } + +namespace std { +struct source_location { + static consteval source_location + current(const void *__p = __builtin_source_location()) { + source_location __ret; + __ret._M_impl = static_cast<const __impl *>(__p); + return __ret; + } + constexpr const char *function_name() { + return _M_impl ? _M_impl->_M_function_name : ""; + } + struct __impl { + const char *_M_file_name; + const char *_M_function_name; + unsigned _M_line; + unsigned _M_column; + } const *_M_impl; +}; +struct char_traits { + static constexpr long length(const char *__s) { + return __builtin_strlen(__s); + } +}; +template <typename _CharT, typename _Traits = char_traits> +class basic_string_view { +public: + using traits_type = _Traits; + using size_type = unsigned long; + constexpr basic_string_view(const _CharT *__str) + : _M_len{traits_type::length(__str)}, _M_str{__str} {} + constexpr size_type find(const _CharT *, size_type, size_type) const noexcept; + constexpr size_type find(_CharT *__str) { + long __trans_tmp_1 = traits_type::length(__str); + return find(__str, 0, __trans_tmp_1); + } + long _M_len; + const _CharT *_M_str; +}; +using string_view = basic_string_view<const char>; +template <typename _CharT, typename _Traits> +constexpr unsigned long +basic_string_view<_CharT, _Traits>::find(const _CharT *__str, size_type, + size_type __n) const noexcept { + int __trans_tmp_2; + const _CharT *__first = _M_str; + size_type __len = _M_len; + while (__len >= __n) { + __trans_tmp_2 = __builtin_memcmp(__first, __str, __n); + if (__trans_tmp_2 == 0) + return __first - _M_str; + __len = _M_str - ++__first; + } +} +} // namespace std +template <typename> consteval auto f() { + return std::string_view{std::source_location::current().function_name()}; +} +int main() { constexpr auto s = f<int>().find("int"); } diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-virtual18.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-virtual18.C new file mode 100644 index 0000000..2fbf0b2 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-virtual18.C @@ -0,0 +1,13 @@ +// PR c++/99132 +// { dg-do compile { target c++11 } } + +template <class T> struct A { T c; }; +template <class T> struct B { + A<T> d; + constexpr T operator-> () { return d.c; } + B (B &&); +}; +struct C { + virtual void foo (); + void bar (B<C *> h) { h->foo (); } +}; diff --git a/gcc/testsuite/g++.dg/cpp2a/nodiscard-constructor.c b/gcc/testsuite/g++.dg/cpp2a/nodiscard-constructor1.C index 9af4e59..6aa3314 100644 --- a/gcc/testsuite/g++.dg/cpp2a/nodiscard-constructor.c +++ b/gcc/testsuite/g++.dg/cpp2a/nodiscard-constructor1.C @@ -1,6 +1,6 @@ /* nodiscard attribute tests */ /* { dg-do compile { target c++20 } } */ -/* { dg-options "-O -ftrack-macro-expansion=0" } */ +/* { dg-options "-O" } */ struct A { [[nodiscard("bad constructor")]] A() {} }; struct B { [[nodiscard]] B() {} }; @@ -8,6 +8,6 @@ struct B { [[nodiscard]] B() {} }; void test (void) { - A{}; /* { dg-warning "(?n)nodiscard.*bad constructor" } */ - B{}; /* { dg-warning "(?n)nodiscard" } */ + A{}; /* { dg-warning "nodiscard\[^\n\r]*bad constructor" } */ + B{}; /* { dg-warning "nodiscard" } */ } diff --git a/gcc/testsuite/g++.dg/cpp2a/nodiscard-constructor2.C b/gcc/testsuite/g++.dg/cpp2a/nodiscard-constructor2.C new file mode 100644 index 0000000..3abb118 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/nodiscard-constructor2.C @@ -0,0 +1,17 @@ +// PR c++/99362 +// { dg-do compile { target c++20 } } + +struct S { + [[nodiscard]] S() {} + S(int) {} +}; + +int main() +{ + S s; + S(); // { dg-warning "ignoring return value" } + (void)(S()); + S t = 1; + S(1); + (void)(S(1)); +} diff --git a/gcc/testsuite/g++.dg/cpp2a/nodiscard-once.C b/gcc/testsuite/g++.dg/cpp2a/nodiscard-once.C index c95fa1b..c533f9c 100644 --- a/gcc/testsuite/g++.dg/cpp2a/nodiscard-once.C +++ b/gcc/testsuite/g++.dg/cpp2a/nodiscard-once.C @@ -1,6 +1,6 @@ /* nodiscard attribute tests */ /* { dg-do compile { target c++20 } } */ -/* { dg-options "-O -ftrack-macro-expansion=0" } */ +/* { dg-options "-O" } */ [[nodiscard, nodiscard]] int check1 (void); // { dg-warning "specified multiple times" } diff --git a/gcc/testsuite/g++.dg/cpp2a/nodiscard-reason-nonstring.C b/gcc/testsuite/g++.dg/cpp2a/nodiscard-reason-nonstring.C index d81baf0..091c3e5 100644 --- a/gcc/testsuite/g++.dg/cpp2a/nodiscard-reason-nonstring.C +++ b/gcc/testsuite/g++.dg/cpp2a/nodiscard-reason-nonstring.C @@ -1,6 +1,6 @@ /* nodiscard attribute tests */ /* { dg-do compile { target c++20 } } */ -/* { dg-options "-O -ftrack-macro-expansion=0" } */ +/* { dg-options "-O" } */ [[nodiscard(123)]] int check1 (void); /* { dg-error "nodiscard\[^\n\r]*must be a string constant" } */ diff --git a/gcc/testsuite/g++.dg/cpp2a/nodiscard-reason-only-one.C b/gcc/testsuite/g++.dg/cpp2a/nodiscard-reason-only-one.C index 6104a5f..01fbb37 100644 --- a/gcc/testsuite/g++.dg/cpp2a/nodiscard-reason-only-one.C +++ b/gcc/testsuite/g++.dg/cpp2a/nodiscard-reason-only-one.C @@ -1,6 +1,6 @@ /* nodiscard attribute tests */ /* { dg-do compile { target c++20 } } */ -/* { dg-options "-O -ftrack-macro-expansion=0" } */ +/* { dg-options "-O" } */ [[nodiscard("not", "allowed")]] int check1 (void); /* { dg-error "wrong number of arguments.\[^\n\r]*nodiscard" } */ diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class-defarg1.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class-defarg1.C new file mode 100644 index 0000000..85e50ff --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class-defarg1.C @@ -0,0 +1,6 @@ +// PR c++/98810 +// { dg-do compile { target c++20 } } + +template <auto> struct a {}; +template <int i, a <i> s = a <i> {}> using b = a <s>; +template <int i> constexpr auto g (const b <i> &) { return true; }; diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class41.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class41.C new file mode 100644 index 0000000..2be8843 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class41.C @@ -0,0 +1,13 @@ +// PR c++/96268 +// { dg-do compile { target c++20 } } + +template <int N> +struct static_string { char chars[N]; /* operator<=> */ }; + +template <int N> +static_string(char const(&)[N]) -> static_string<N>; + +static_string hi = {"hi"}; + +template <static_string str> struct name {}; +using Hi = name<{"hi"}>; diff --git a/gcc/testsuite/g++.dg/diagnostic/local1.C b/gcc/testsuite/g++.dg/diagnostic/local1.C new file mode 100644 index 0000000..5905b57 --- /dev/null +++ b/gcc/testsuite/g++.dg/diagnostic/local1.C @@ -0,0 +1,25 @@ +// PR c++/99213 +// { dg-do compile { target c++14 } } + +template <class T> +struct A { + template <class U> + static auto f() { + struct S1{}; + return S1{}; + } +}; + +using type = void; +using type = decltype(A<int>::f<char>()); // { dg-error "A<int>::f<char>\\(\\)::S1" } + +template <class T> +struct B { + static auto f() { + struct S2{}; + return S2{}; + } +}; + +using type = void; +using type = decltype(B<int>::f()); // { dg-error "B<int>::f\\(\\)::S2" } diff --git a/gcc/testsuite/g++.dg/eh/seh-xmm-unwind.C b/gcc/testsuite/g++.dg/eh/seh-xmm-unwind.C new file mode 100644 index 0000000..07fd805 --- /dev/null +++ b/gcc/testsuite/g++.dg/eh/seh-xmm-unwind.C @@ -0,0 +1,61 @@ +/* PR target/99234 */ +/* Test SEH unwinding of XMM register saves. */ + +/* { dg-do run { target { x86_64-*-mingw32 && lp64 } } } */ + +extern "C" void abort (void); +extern "C" void exit (int); + +void +foo (void) +{ + register __int128 xmm6 asm("xmm6") = 0; + register __int128 xmm7 asm("xmm7") = 0; + register __int128 xmm8 asm("xmm8") = 0; + register __int128 xmm9 asm("xmm9") = 0; + register __int128 xmm10 asm("xmm10") = 0; + register __int128 xmm11 asm("xmm11") = 0; + register __int128 xmm12 asm("xmm12") = 0; + register __int128 xmm13 asm("xmm13") = 0; + register __int128 xmm14 asm("xmm14") = 0; + register __int128 xmm15 asm("xmm15") = 0; + + __asm__ __volatile__ ("" : "+x" (xmm6), "+x" (xmm7), "+x" (xmm8), "+x" (xmm9), + "+x" (xmm10), "+x" (xmm11), "+x" (xmm12), "+x" (xmm13), + "+x" (xmm14), "+x" (xmm15)); + + throw 1; +} + +int +main (void) +{ + register __int128 xmm6 asm("xmm6") = 6; + register __int128 xmm7 asm("xmm7") = 7; + register __int128 xmm8 asm("xmm8") = 8; + register __int128 xmm9 asm("xmm9") = 9; + register __int128 xmm10 asm("xmm10") = 10; + register __int128 xmm11 asm("xmm11") = 11; + register __int128 xmm12 asm("xmm12") = 12; + register __int128 xmm13 asm("xmm13") = 13; + register __int128 xmm14 asm("xmm14") = 14; + register __int128 xmm15 asm("xmm15") = 15; + + __asm__ __volatile__ ("" : "+x" (xmm6), "+x" (xmm7), "+x" (xmm8), "+x" (xmm9), + "+x" (xmm10), "+x" (xmm11), "+x" (xmm12), "+x" (xmm13), + "+x" (xmm14), "+x" (xmm15)); + + try { + foo (); + } catch (...) { + __asm__ __volatile__ ("" : "+x" (xmm6), "+x" (xmm7), "+x" (xmm8), "+x" (xmm9), + "+x" (xmm10), "+x" (xmm11), "+x" (xmm12), "+x" (xmm13), + "+x" (xmm14), "+x" (xmm15)); + + if (xmm6 != 6 || xmm7 != 7 || xmm8 != 8 || xmm9 != 9 || xmm10 != 10 + || xmm11 != 11 || xmm12 != 12 || xmm13 != 13 || xmm14 != 14 || xmm15 != 15) + abort (); + } + + exit (0); +} diff --git a/gcc/testsuite/g++.dg/ext/attr-assume-aligned.C b/gcc/testsuite/g++.dg/ext/attr-assume-aligned.C new file mode 100644 index 0000000..aa57cbb --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/attr-assume-aligned.C @@ -0,0 +1,5 @@ +// PR c++/99062 +// { dg-do compile } + +#define INT_MIN (-__INT_MAX__ - 1) +void *f () __attribute__ ((assume_aligned (INT_MIN, 4))); // { dg-warning "is not positive" } diff --git a/gcc/testsuite/g++.dg/ext/attr-flatten1.C b/gcc/testsuite/g++.dg/ext/attr-flatten1.C new file mode 100644 index 0000000..5bcbfb6 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/attr-flatten1.C @@ -0,0 +1,9 @@ +// PR c++/96078 +// { dg-do compile { target c++11 } } + +struct A { + [[gnu::flatten]] A() {} + [[gnu::flatten]] ~A() {} +}; + +A a; diff --git a/gcc/testsuite/g++.dg/ext/attr-lambda3.C b/gcc/testsuite/g++.dg/ext/attr-lambda3.C new file mode 100644 index 0000000..71d1303 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/attr-lambda3.C @@ -0,0 +1,4 @@ +// PR c++/90333 +// { dg-do compile { target c++11 } } + +auto x = []() __attribute__((always_inline)) -> int { return 0; }; diff --git a/gcc/testsuite/g++.dg/ext/pr99508.C b/gcc/testsuite/g++.dg/ext/pr99508.C new file mode 100644 index 0000000..201a287 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/pr99508.C @@ -0,0 +1,20 @@ +// PR 99508, local exerns with aliased names +// { dg-do link } +int foo() +{ + void bar() asm ("bar_assembler"); + extern unsigned buzz asm("buzz_assembler"); + bar(); + return buzz; +} + +void ALIASbar () asm ("bar_assembler"); +void ALIASbar () +{ +} + +unsigned ALIASbuz asm ("buzz_assembler") = 5; + +int main () +{ +} diff --git a/gcc/testsuite/g++.dg/ext/undef-bool-1.C b/gcc/testsuite/g++.dg/ext/undef-bool-1.C index 716e06c..9cc1cd8 100644 --- a/gcc/testsuite/g++.dg/ext/undef-bool-1.C +++ b/gcc/testsuite/g++.dg/ext/undef-bool-1.C @@ -1,6 +1,7 @@ /* { dg-do compile { target { powerpc*-*-* } } } */ /* { dg-options "-O2 -DNO_WARN_X86_INTRINSICS -mvsx" } */ /* { dg-require-effective-target lp64 } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ /* Test to ensure that "bool" gets undef'd in xmmintrin.h when we require strict ANSI. */ diff --git a/gcc/testsuite/g++.dg/lookup/pr99039.C b/gcc/testsuite/g++.dg/lookup/pr99039.C new file mode 100644 index 0000000..982a991 --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/pr99039.C @@ -0,0 +1,51 @@ +// PR 99039, we need to remove the namespace-scope meaning of +// IDENTIFIER_TYPE_VALUE. + +namespace std +{ +typedef long unsigned int size_t; + +template<typename _CharT> +struct char_traits +{ + typedef _CharT char_type; + + template<typename U> + static int + compare(const char_type* __s1, const char_type* __s2, std::size_t __n); +}; + +template<typename _CharT> +template<typename U> +int +char_traits<_CharT>:: +compare(const char_type* __s1, const char_type* __s2, std::size_t __n) +{ + return 0; +} + +} + +struct CHAR_TRAITS; +namespace std +{ +typedef long unsigned int size_t; + +struct CHAR_TRAITS +{ + typedef char char_type; + + static int + compare(const char_type* __s1, const char_type* __s2, std::size_t __n); +}; + +int +CHAR_TRAITS:: +compare(const char_type* __s1, const char_type* __s2, std::size_t __n) +{ + return 0; +} + +} + +struct CHAR_TRAITS; diff --git a/gcc/testsuite/g++.dg/lookup/pr99116-1.C b/gcc/testsuite/g++.dg/lookup/pr99116-1.C new file mode 100644 index 0000000..01b483e --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/pr99116-1.C @@ -0,0 +1,25 @@ +// PR 99116 sliding hidden friends under template parm scopes + +template<int T> struct Z { + + friend struct T; // { dg-error "shadows template parameter" } +}; + +struct Y { + + template<typename S> struct A {}; + + friend struct S; +}; + +struct X +{ + struct S2 {}; + + struct In + { + friend struct S2; + }; +}; + +typedef int S2; diff --git a/gcc/testsuite/g++.dg/lookup/pr99116-2.C b/gcc/testsuite/g++.dg/lookup/pr99116-2.C new file mode 100644 index 0000000..2a4148b --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/pr99116-2.C @@ -0,0 +1,19 @@ +// PR 99116, we need to remove the namespace-scope meaning of +// IDENTIFIER_TYPE_VALUE. + +namespace __gnu_cxx +{ +template<typename _CharT> +struct char_traits +{ + static void length(); +}; + +template<typename _T> +void char_traits<_T>::length () +{ +} + +} + +struct char_traits; diff --git a/gcc/testsuite/g++.dg/modules/alias-2_a.H b/gcc/testsuite/g++.dg/modules/alias-2_a.H deleted file mode 100644 index 1befe85..0000000 --- a/gcc/testsuite/g++.dg/modules/alias-2_a.H +++ /dev/null @@ -1,9 +0,0 @@ -// { dg-additional-options "-fmodule-header -isystem [srcdir]/sys" } -// { dg-module-cmi {} } -// { dg-module-headers test sys/alias-2_a.H } -#ifndef ALIAS_2_A -#define ALIAS_2_A - -int frob (); - -#endif diff --git a/gcc/testsuite/g++.dg/modules/inst-2_b.C b/gcc/testsuite/g++.dg/modules/inst-2_b.C index 3e918bc..59e48b3 100644 --- a/gcc/testsuite/g++.dg/modules/inst-2_b.C +++ b/gcc/testsuite/g++.dg/modules/inst-2_b.C @@ -1,4 +1,4 @@ -// { dg-additional-options {-fmodules-ts -fdump-lang-module-uid-alias} } +// { dg-additional-options {-fmodules-ts -fdump-lang-module-alias} } import foo; int main () @@ -9,6 +9,6 @@ int main () return 0; } -// { dg-final { scan-lang-dump {Reading 1 pending specializations} module } } +// { dg-final { scan-lang-dump {Reading 1 pending entities keyed to '::foo'} module } } // { dg-final { scan-lang-dump {Read:-[0-9]*'s decl spec merge key \(new\) function_decl:'::foo'} module } } diff --git a/gcc/testsuite/g++.dg/modules/inst-4_a.C b/gcc/testsuite/g++.dg/modules/inst-4_a.C index e7435ec..fa94ab6 100644 --- a/gcc/testsuite/g++.dg/modules/inst-4_a.C +++ b/gcc/testsuite/g++.dg/modules/inst-4_a.C @@ -1,5 +1,5 @@ // { dg-module-do run } -// { dg-additional-options {-fmodules-ts -fdump-lang-module-graph-blocks-alias} } +// { dg-additional-options {-fmodules-ts -fdump-lang-module-graph} } export module foo; // { dg-module-cmi foo } @@ -16,5 +16,5 @@ export inline int user (int i) return x.m; } -// { dg-final { scan-lang-dump {Specialization '::TPL<int>' entity:. keyed to foo\[.\] '::template TPL'} module } } -// { dg-final { scan-lang-dump {Specialization '::TPL<int>::TPL<int>' entity:. keyed to foo\[.\] '::template TPL<T>::template TPL'} module } } +// { dg-final { scan-lang-dump {Pending specialization '::TPL<int>' entity:. section:. keyed to '::TPL'} module } } +// { dg-final { scan-lang-dump {Pending specialization '::TPL<int>::TPL<int>' entity:. section:. also keyed to '::TPL'} module } } diff --git a/gcc/testsuite/g++.dg/modules/inst-4_b.C b/gcc/testsuite/g++.dg/modules/inst-4_b.C index c83e1c1..c7b02b4 100644 --- a/gcc/testsuite/g++.dg/modules/inst-4_b.C +++ b/gcc/testsuite/g++.dg/modules/inst-4_b.C @@ -1,4 +1,4 @@ -// { dg-additional-options {-fmodules-ts -fdump-lang-module-alias-uid} } +// { dg-additional-options {-fmodules-ts -fdump-lang-module-alias} } import foo; int main () @@ -9,5 +9,5 @@ int main () return 0; } -// { dg-final { scan-lang-dump {Reading 1 pending specializations keyed to foo\[.\] '::template TPL@foo:.'} module } } +// { dg-final { scan-lang-dump {Reading 1 pending entities keyed to '::TPL'} module } } // { dg-final { scan-lang-dump {Read:-[0-9]*'s type spec merge key \(new\) type_decl:'::TPL'} module } } diff --git a/gcc/testsuite/g++.dg/modules/member-def-1_b.C b/gcc/testsuite/g++.dg/modules/member-def-1_b.C index fbe1ac4..ad4826c 100644 --- a/gcc/testsuite/g++.dg/modules/member-def-1_b.C +++ b/gcc/testsuite/g++.dg/modules/member-def-1_b.C @@ -11,4 +11,4 @@ struct frob::inner }; // { dg-final { scan-lang-dump { Cluster members:\n \[0\]=decl definition '::frob@foo:part1:1::inner'\n \[1\]=decl declaration '::frob@foo:part1:1::inner::inner'\n} module } } -// { dg-final { scan-lang-dump {Member '::frob@foo:part1:1::inner' entity:0 keyed to foo:part1\[0\] '::frob@foo:part1:1'} module } } +// { dg-final { scan-lang-dump {Pending member '::frob@foo:part1:1::inner' entity:0 section:. keyed to '::frob'} module } } diff --git a/gcc/testsuite/g++.dg/modules/member-def-1_c.C b/gcc/testsuite/g++.dg/modules/member-def-1_c.C index c7c3f6e..d4190a8 100644 --- a/gcc/testsuite/g++.dg/modules/member-def-1_c.C +++ b/gcc/testsuite/g++.dg/modules/member-def-1_c.C @@ -11,6 +11,6 @@ export auto foo () return frob::inner (); } -// { dg-final { scan-lang-dump {Reading 1 pending members keyed to foo:part1\[0\] '::frob@foo:part1:1'} module } } +// { dg-final { scan-lang-dump {Reading 1 pending entities keyed to '::frob'} module } } // { dg-final { scan-lang-dump { Cluster members:\n \[0\]=decl definition '::frob@foo:part1:1'\n \[1\]=decl definition '::frob@foo:part1:1::inner@foo:part1:1'\n \[2\]=decl declaration '::frob@foo:part1:1::inner@foo:part1:1::__dt '\n( \[.\]=decl declaration '::frob@foo:part1:1::inner@foo:part1:1::__ct '\n)* \[6\]=decl declaration '::frob@foo:part1:1::inner@foo:part1:1::inner@foo:part2:2'\n \[7\]=decl declaration '::frob@foo:part1:1::frob@foo:part1:1'\n \[8\]=decl declaration '::frob@foo:part1:1::__as_base @foo:part1:1'\n \[9\]=binding '::frob'\n} module } } // { dg-final { scan-lang-dump {Pendings 0} module } } diff --git a/gcc/testsuite/g++.dg/modules/modules.exp b/gcc/testsuite/g++.dg/modules/modules.exp index 28d627d..da7afc2 100644 --- a/gcc/testsuite/g++.dg/modules/modules.exp +++ b/gcc/testsuite/g++.dg/modules/modules.exp @@ -35,13 +35,17 @@ if ![info exists DEFAULT_CXXFLAGS] then { set DEFAULT_CXXFLAGS " -pedantic-errors -Wno-long-long" } set DEFAULT_MODFLAGS $DEFAULT_CXXFLAGS -set MOD_STD_LIST { 17 2a } +set MOD_STD_LIST { 17 2a 2b } dg-init +if {[is_remote host]} { + # remote testing not functional here :( + return +} + global module_do global module_cmis -global module_headers set DEFAULT_REPO "gcm.cache" @@ -132,39 +136,6 @@ proc module_cmi_p { src ifs } { return $res } -# Append required header unit names to module_headers var -proc dg-module-headers { args } { - if { [llength $args] != 3 } { - error "[lindex $args 0]: wrong number of arguments" - return - } -} - -proc do_module_headers { srcdir subdir std flags} { - global module_headers - foreach header $module_headers { - set kind [lindex $header 0] - set hdr [lindex $header 1] - verbose "Header $hdr $std" 1 - switch $kind { - test { - global module_cmis - set module_cmis {} - dg-test -keep-output $srcdir/$subdir/$hdr "$std" $flags - global mod_files - lappend mod_files [module_cmi_p $subdir/$hdr $module_cmis] - } - system - - user { - # FIXME - } - default { - error "$kind unknown header" - } - } - } -} - # link and maybe run a set of object files # dg-module-do WHAT WHEN proc dg-module-do { args } { @@ -277,8 +248,6 @@ proc srcdir {} { proc module-init { src } { set tmp [dg-get-options $src] set option_list {} - global module_headers - set module_headers {} set have_std 0 set std_prefix "-std=c++" @@ -295,12 +264,6 @@ proc module-init { src } { set have_std 1 } } - "dg-module-headers" { - set kind [lindex $op 2] - foreach header [lindex $op 3] { - lappend module_headers [list $kind $header] - } - } } } @@ -316,6 +279,9 @@ proc module-init { src } { return $option_list } +# cleanup any detritus from previous run +cleanup_module_files [find $DEFAULT_REPO *.gcm] + # not grouped tests, sadly tcl doesn't have negated glob foreach test [prune [lsort [find $srcdir/$subdir {*.[CH]}]] \ "$srcdir/$subdir/*_?.\[CH\]"] { @@ -324,7 +290,7 @@ foreach test [prune [lsort [find $srcdir/$subdir {*.[CH]}]] \ set std_list [module-init $test] foreach std $std_list { - do_module_headers $srcdir $subdir $std $DEFAULT_MODFLAGS + global module_cmis set module_cmis {} verbose "Testing $nshort $std" 1 dg-test $test "$std" $DEFAULT_MODFLAGS @@ -335,11 +301,11 @@ foreach test [prune [lsort [find $srcdir/$subdir {*.[CH]}]] \ } # grouped tests -foreach src [lsort [find $srcdir/$subdir {*_a.[CH}]] { +foreach src [lsort [find $srcdir/$subdir {*_a.[CHX}]] { # use the FOO_a.C name as the parallelization key if [runtest_file_p $runtests $src] { set tests [lsort [find [file dirname $src] \ - [regsub {_a.[CH]$} [file tail $src] {_[a-z].[CH]}]]] + [regsub {_a.[CHX]$} [file tail $src] {_[a-z].[CHX]}]]] set std_list [module-init $src] foreach std $std_list { @@ -347,31 +313,39 @@ foreach src [lsort [find $srcdir/$subdir {*_a.[CH}]] { global module_do set module_do {"compile" "P"} set asm_list {} - do_module_headers $srcdir $subdir $std $DEFAULT_MODFLAGS + set any_hdrs 0 + global DEFAULT_REPO + file_on_host delete $DEFAULT_REPO foreach test $tests { if { [lindex $module_do 1] != "N" } { + global module_cmis set module_cmis {} set nshort [file tail [file dirname $test]]/[file tail $test] verbose "Testing $nshort $std" 1 - if { [file extension $test] == ".C" } { - lappend asm_list [file rootname [file tail $test]].s + switch [file extension $test] { + ".C" { + lappend asm_list [file rootname [file tail $test]].s + } + ".X" { + set any_hdrs 1 + } } dg-test -keep-output $test "$std" $DEFAULT_MODFLAGS set testcase [string range $test [string length "$srcdir/"] end] lappend mod_files [module_cmi_p $testcase $module_cmis] } } - set ok 1 set testcase [regsub {_a.[CH]} $src {}] set testcase \ [string range $testcase [string length "$srcdir/"] end] - set ok [module_do_it $module_do $testcase $std $asm_list] - if { $ok } { - foreach asm $asm_list { - file_on_host delete $asm - } - cleanup_module_files $mod_files + module_do_it $module_do $testcase $std $asm_list + foreach asm $asm_list { + file_on_host delete $asm + } + if { $any_hdrs } { + set mod_files [find $DEFAULT_REPO *.gcm] } + cleanup_module_files $mod_files } } } diff --git a/gcc/testsuite/g++.dg/modules/namespace-2_a.C b/gcc/testsuite/g++.dg/modules/namespace-2_a.C index 18327e2..b2c9abb 100644 --- a/gcc/testsuite/g++.dg/modules/namespace-2_a.C +++ b/gcc/testsuite/g++.dg/modules/namespace-2_a.C @@ -32,9 +32,9 @@ export namespace explicit_export } // { dg-final { scan-lang-dump-not {Writable bindings at '::not_exported'} "module" } } -// { dg-final { scan-lang-dump {Writing namespace:[0-9] '::implicit_export', export, public} "module" } } -// { dg-final { scan-lang-dump {Writing namespace:[0-9] '::explicit_export', export, public} "module" } } -// { dg-final { scan-lang-dump {Writing namespace:[0-9] '::also_not_exported', public} "module" } } -// { dg-final { scan-lang-dump {Writing namespace:[0-9] '::explicit_export::also_exported', export, public} "module" } } +// { dg-final { scan-lang-dump {Writing namespace:[0-9] '::also_not_exported', public, purview\n} "module" } } +// { dg-final { scan-lang-dump {Writing namespace:[0-9] '::implicit_export', public, purview, export\n} "module" } } +// { dg-final { scan-lang-dump {Writing namespace:[0-9] '::explicit_export', public, purview, export\n} "module" } } +// { dg-final { scan-lang-dump {Writing namespace:[0-9] '::explicit_export::also_exported', public, purview, export\n} "module" } } // { dg-final { scan-lang-dump-not {Writing namespace:[0-9] '::not_exported'} "module" } } // { dg-final { scan-lang-dump-not {Writing namespace:[0-9] '::std'} "module" } } diff --git a/gcc/testsuite/g++.dg/modules/pr98718_a.C b/gcc/testsuite/g++.dg/modules/pr98718_a.C new file mode 100644 index 0000000..0be5f90 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr98718_a.C @@ -0,0 +1,18 @@ +// PR 98718 ICE with macro location data +// { dg-additional-options {-Wno-pedantic -fpreprocessed -fdirectives-only -fdump-lang-module-lineno -fmodules-ts} } +module ; + +# 4 "inc_a" 1 +#define _GLIBCXX_VISIBILITY(V) __attribute__ ((__visibility__ (#V))) + +namespace std _GLIBCXX_VISIBILITY(default) +{ + +} +# 11 "" 2 + +export module hello:format; +// { dg-module-cmi hello:format } + +// { dg-final { scan-lang-dump { Ordinary:4 maps hwm:[0-9]* macro:1 maps lwm:214[0-9]*} module } } +// { dg-final { scan-lang-dump { Span:2 macro:0 _GLIBCXX_VISIBILITY 10/11\*2 locations } module } } diff --git a/gcc/testsuite/g++.dg/modules/pr98718_b.C b/gcc/testsuite/g++.dg/modules/pr98718_b.C new file mode 100644 index 0000000..50679c8 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr98718_b.C @@ -0,0 +1,20 @@ +// { dg-additional-options {-Wno-pedantic -fpreprocessed -fdirectives-only -fdump-lang-module-lineno-vops -fmodules-ts} } +module ; + +# 4 "inc_b" 1 +#define _GLIBCXX_VISIBILITY(V) __attribute__ ((__visibility__ (#V))) +#define _GLIBCXX_BEGIN_NAMESPACE_VERSION +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION +} +# 11 "" 2 + +export module hello; +export import :format; +// { dg-module-cmi hello } + +// { dg-final { scan-lang-dump {Macro:0 _GLIBCXX_VISIBILITY 10/11\*2 locations } module } } +// { dg-final { scan-lang-dump { Ordinary:8 maps hwm:[0-9]* macro:2 maps lwm:214[0-9]*} module } } +// { dg-final { scan-lang-dump { Span:2 macro:0 _GLIBCXX_VISIBILITY 10/11\*2 locations } module } } +// { dg-final { scan-lang-dump { Span:4 macro:1 _GLIBCXX_VISIBILITY 10/11\*2 locations } module } } diff --git a/gcc/testsuite/g++.dg/modules/pr98741_a.H b/gcc/testsuite/g++.dg/modules/pr98741_a.H new file mode 100644 index 0000000..c8d5d66 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr98741_a.H @@ -0,0 +1,7 @@ +// PR 98741 incorrect order of module number assignments +// { dg-additional-options {-fmodule-header} } +// { dg-module-cmi {} } + +namespace foo +{ +} diff --git a/gcc/testsuite/g++.dg/modules/pr98741_b.H b/gcc/testsuite/g++.dg/modules/pr98741_b.H new file mode 100644 index 0000000..c2bdf84 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr98741_b.H @@ -0,0 +1,6 @@ +// { dg-additional-options {-fmodule-header} } +// { dg-module-cmi {} } + +namespace foo +{ +} diff --git a/gcc/testsuite/g++.dg/modules/pr98741_c.C b/gcc/testsuite/g++.dg/modules/pr98741_c.C new file mode 100644 index 0000000..60bbe32 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr98741_c.C @@ -0,0 +1,4 @@ +// { dg-additional-options {-fmodules-ts} } +export module Foo; +// { dg-module-cmi {Foo} } +import "pr98741_a.H"; diff --git a/gcc/testsuite/g++.dg/modules/pr98741_d.C b/gcc/testsuite/g++.dg/modules/pr98741_d.C new file mode 100644 index 0000000..b8f4865 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr98741_d.C @@ -0,0 +1,3 @@ +// { dg-additional-options {-fmodules-ts} } +module Foo; +import "pr98741_b.H"; diff --git a/gcc/testsuite/g++.dg/modules/pr99023_a.X b/gcc/testsuite/g++.dg/modules/pr99023_a.X new file mode 100644 index 0000000..c872d15 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99023_a.X @@ -0,0 +1,6 @@ +// PR c++/99023, ICE +// { dg-additional-options {-x c++-system-header initializer_list -fmodules-ts --param ggc-min-expand=0} } + +// { dg-prune-output {linker input file unused} } + +NO DO NOT COMPILE diff --git a/gcc/testsuite/g++.dg/modules/pr99023_b.X b/gcc/testsuite/g++.dg/modules/pr99023_b.X new file mode 100644 index 0000000..3d82f34 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99023_b.X @@ -0,0 +1,7 @@ +// PR c++/99023, ICE +// { dg-additional-options {-x c++-system-header iostream -fmodules-ts -flang-info-include-translate=<initializer_list> --param ggc-min-expand=0} } + +// { dg-prune-output {linker input file unused} } + +// { dg-regexp {[^\n]*: note: include '[^\n]*/initializer_list' translated to import\n} } +NO DO NOT COMPILE diff --git a/gcc/testsuite/g++.dg/modules/pr99039_a.C b/gcc/testsuite/g++.dg/modules/pr99039_a.C new file mode 100644 index 0000000..56041e9 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99039_a.C @@ -0,0 +1,9 @@ +// PR c++/99039 +// { dg-additional-options -fmodules-ts } +export module format; +// { dg-module-cmi format } + +export namespace NS +{ +void Format (); +} diff --git a/gcc/testsuite/g++.dg/modules/pr99039_b.C b/gcc/testsuite/g++.dg/modules/pr99039_b.C new file mode 100644 index 0000000..6fb76f5 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99039_b.C @@ -0,0 +1,9 @@ +// { dg-additional-options -fmodules-ts } +export module hello; +// { dg-module-cmi hello } +import format; + +export namespace NS +{ +using NS::Format; +} diff --git a/gcc/testsuite/g++.dg/modules/pr99040_a.C b/gcc/testsuite/g++.dg/modules/pr99040_a.C new file mode 100644 index 0000000..50c61bb --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99040_a.C @@ -0,0 +1,9 @@ +// PR c++/99040 +// { dg-additional-options -fmodules-ts } +export module format; +// { dg-module-cmi format } + +export namespace NS +{ +void Format (); +} diff --git a/gcc/testsuite/g++.dg/modules/pr99040_b.C b/gcc/testsuite/g++.dg/modules/pr99040_b.C new file mode 100644 index 0000000..e9e485d --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99040_b.C @@ -0,0 +1,5 @@ +// { dg-additional-options -fmodules-ts } +export module hello:check; +// { dg-module-cmi hello:check } + +export namespace NS {} diff --git a/gcc/testsuite/g++.dg/modules/pr99040_c.C b/gcc/testsuite/g++.dg/modules/pr99040_c.C new file mode 100644 index 0000000..a675d72 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99040_c.C @@ -0,0 +1,10 @@ +// { dg-additional-options -fmodules-ts } +export module hello; +// { dg-module-cmi hello } +export import :check; +import format; + +export namespace NS +{ +using NS::Format; +} diff --git a/gcc/testsuite/g++.dg/modules/pr99040_d.C b/gcc/testsuite/g++.dg/modules/pr99040_d.C new file mode 100644 index 0000000..ed66690 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99040_d.C @@ -0,0 +1,2 @@ +// { dg-additional-options {-fmodules-ts -fno-module-lazy} } +module hello; diff --git a/gcc/testsuite/g++.dg/modules/pr99050_a.H b/gcc/testsuite/g++.dg/modules/pr99050_a.H new file mode 100644 index 0000000..137e37f --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99050_a.H @@ -0,0 +1,4 @@ +// PR c++/99050 ICE with directives only +// { dg-additional-options -fmodule-header } +// { dg-module-cmi {} } +void f (); diff --git a/gcc/testsuite/g++.dg/modules/pr99050_b.C b/gcc/testsuite/g++.dg/modules/pr99050_b.C new file mode 100644 index 0000000..439e216 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99050_b.C @@ -0,0 +1,7 @@ +// { dg-do preprocess } +// { dg-additional-options {-fdirectives-only -fmodules-ts} } +#include "pr99050_a.H" + +int main () {} + +// { dg-final { scan-file pr99050_b.i {import "[^\n]*99050_a.H" \[\[__translated\]\];\n} } } diff --git a/gcc/testsuite/g++.dg/modules/pr99071_a.H b/gcc/testsuite/g++.dg/modules/pr99071_a.H new file mode 100644 index 0000000..44bc7c4 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99071_a.H @@ -0,0 +1,6 @@ +// PR 99071 ICE with global-module merging +// { dg-additional-options -fmodule-header } +// { dg-module-cmi {} } + +template<typename T> +void begin (T *); diff --git a/gcc/testsuite/g++.dg/modules/pr99071_b.H b/gcc/testsuite/g++.dg/modules/pr99071_b.H new file mode 100644 index 0000000..1c773d7 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99071_b.H @@ -0,0 +1,8 @@ +// PR 99071 ICE with global-module merging +// { dg-additional-options -fmodule-header } +// { dg-module-cmi {} } + +import "pr99071_a.H"; + +template<typename T> +void begin(T &); diff --git a/gcc/testsuite/g++.dg/modules/pr99072.H b/gcc/testsuite/g++.dg/modules/pr99072.H new file mode 100644 index 0000000..eda0c07 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99072.H @@ -0,0 +1,10 @@ +# 0 "REALNAME" +# 0 "<built-in>" +# 0 "<command-line>" +# 0 "<command-line>" +# 1 "/usr/include/stdc-predef.h" 1 3 4 +# 0 "<command-line>" 2 +# 1 "REALNAME" + +// { dg-additional-options {-fmodule-header -fpreprocessed -fdump-lang-module-lineno} } +// { dg-final { scan-lang-dump { 4 source file names\n Source file\[0\]=REALNAME\n Source file\[1\]=<built-in>\n Source file\[2\]=<command-line>\n Source file\[3\]=/usr/include/stdc-predef.h\n} module } } diff --git a/gcc/testsuite/g++.dg/modules/pr99153_a.H b/gcc/testsuite/g++.dg/modules/pr99153_a.H new file mode 100644 index 0000000..3eaa76b --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99153_a.H @@ -0,0 +1,11 @@ +// { dg-additional-options -fmodule-header } +// { dg-module-cmi {} } + +template<typename _T1> +struct pair +{ + inline void Frob (); +}; + +template<typename _T2> +inline void Widget (); diff --git a/gcc/testsuite/g++.dg/modules/pr99153_b.H b/gcc/testsuite/g++.dg/modules/pr99153_b.H new file mode 100644 index 0000000..5699378 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99153_b.H @@ -0,0 +1,15 @@ +// PR 99153 Mismatched flags on template and result +// { dg-additional-options -fmodule-header } +// { dg-module-cmi {} } + +import "pr99153_a.H"; + +template<class _T1> +inline void pair<_T1>::Frob() +{ } + + +template<typename _T2> +inline void Widget () +{ +} diff --git a/gcc/testsuite/g++.dg/modules/pr99166_a.X b/gcc/testsuite/g++.dg/modules/pr99166_a.X new file mode 100644 index 0000000..0649d053 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99166_a.X @@ -0,0 +1,7 @@ +// PR c++/99166, diagnostic +// { dg-additional-options {-x c++-system-header iostream -fmodules-ts -flang-info-module-cmi} } + +// { dg-regexp {[^\n]*iostream: note: writing CMI 'gcm.cache/[^[\n]*iostream.gcm'\n} } +// { dg-prune-output {linker input file unused} } + +NO DO NOT COMPILE diff --git a/gcc/testsuite/g++.dg/modules/pr99166_b.C b/gcc/testsuite/g++.dg/modules/pr99166_b.C new file mode 100644 index 0000000..ac20116 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99166_b.C @@ -0,0 +1,7 @@ +// { dg-additional-options {-fmodules-ts -flang-info-module-cmi=<iostream>} } +export module Foo; +import <iostream>; + +export void frob (); + +// { dg-regexp {In module imported at [^\n]*pr99166_b.C:[0-9:]*\n[^\n]*iostream: note: reading CMI 'gcm.cache/[^[\n]*iostream.gcm'\n} } diff --git a/gcc/testsuite/g++.dg/modules/pr99166_c.C b/gcc/testsuite/g++.dg/modules/pr99166_c.C new file mode 100644 index 0000000..424aa1d --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99166_c.C @@ -0,0 +1,4 @@ +// { dg-additional-options {-fmodules-ts -flang-info-module-cmi=Foo} } +module Foo; + +// { dg-regexp {In module imported at [^\n]*pr99166_c.C:[0-9:]*\n[^\n]*Foo: note: reading CMI 'gcm.cache/Foo.gcm'\n} } diff --git a/gcc/testsuite/g++.dg/modules/pr99166_d.C b/gcc/testsuite/g++.dg/modules/pr99166_d.C new file mode 100644 index 0000000..dbdfacc2 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99166_d.C @@ -0,0 +1,6 @@ +// { dg-additional-options {-fmodules-ts -flang-info-module-cmi} } +import Foo; + +// { dg-regexp {In module imported at [^\n]*pr99166_d.C:[0-9:]*\n[^\n]*Foo: note: reading CMI 'gcm.cache/Foo.gcm'\n} } + +// { dg-regexp {In module imported at [^\n]*pr99166_b.C:[0-9:]*,\nof module Foo, imported at [^\n]*pr99166_d.C:[0-9:]:\n[^\n]*iostream: note: reading CMI 'gcm.cache/[^[\n]*iostream.gcm'\n} } diff --git a/gcc/testsuite/g++.dg/modules/pr99170-1_a.H b/gcc/testsuite/g++.dg/modules/pr99170-1_a.H new file mode 100644 index 0000000..d9a0b8b --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99170-1_a.H @@ -0,0 +1,10 @@ +// PR 99170, pending instantiation snafu +// { dg-additional-options {-fmodule-header} } +// { dg-module-cmi {} } +namespace STD { +class string { +public: + template <typename T> + string (const T *); +}; +} diff --git a/gcc/testsuite/g++.dg/modules/pr99170-1_b.C b/gcc/testsuite/g++.dg/modules/pr99170-1_b.C new file mode 100644 index 0000000..d3d8ac9 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99170-1_b.C @@ -0,0 +1,7 @@ +// { dg-additional-options {-fmodules-ts} } +export module test; +// { dg-module-cmi test } +import "pr99170-1_a.H"; +export class A { + STD::string str{"ayyy"}; +}; diff --git a/gcc/testsuite/g++.dg/modules/pr99170-2.h b/gcc/testsuite/g++.dg/modules/pr99170-2.h new file mode 100644 index 0000000..10259d4 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99170-2.h @@ -0,0 +1,44 @@ + +namespace std +{ +typedef long unsigned int size_t; +} + +namespace __gnu_cxx +{ +template<typename _CharT> +struct char_traits +{ + typedef _CharT char_type; + + static constexpr std::size_t + length(const char_type* __s); +}; + +template<typename _CharT> +constexpr std::size_t + char_traits<_CharT>:: + length(const char_type* __p) +{ + std::size_t __i = 0; + return __i; +} +} + +namespace std +{ +template<class _CharT> +struct char_traits; + +template<> +struct char_traits<char> +{ + typedef char char_type; + + static constexpr size_t + length(const char_type* __s) + { + return __gnu_cxx::char_traits<char_type>::length(__s); + } +}; +} diff --git a/gcc/testsuite/g++.dg/modules/pr99170-2_a.C b/gcc/testsuite/g++.dg/modules/pr99170-2_a.C new file mode 100644 index 0000000..8b0b5e8 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99170-2_a.C @@ -0,0 +1,9 @@ +// pr99170 pending instantiations +// { dg-additional-options -fmodules-ts } +module; +#include "pr99170-2.h" + +export module hello; +// { dg-module-cmi hello } + +export void greeter (__gnu_cxx::char_traits<char> const &name); diff --git a/gcc/testsuite/g++.dg/modules/pr99170-2_b.C b/gcc/testsuite/g++.dg/modules/pr99170-2_b.C new file mode 100644 index 0000000..335eb1f --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99170-2_b.C @@ -0,0 +1,4 @@ +// { dg-additional-options -fmodules-ts } + +#include "pr99170-2.h" +import hello; diff --git a/gcc/testsuite/g++.dg/modules/pr99170-3_a.H b/gcc/testsuite/g++.dg/modules/pr99170-3_a.H new file mode 100644 index 0000000..6b570b5 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99170-3_a.H @@ -0,0 +1,11 @@ +// PR 99170 +// { dg-module-do link } +// { dg-additional-options -fmodule-header } +// { dg-module-cmi {} } +struct Foo +{ + Foo () {}; + +}; + +static Foo __ioinit; diff --git a/gcc/testsuite/g++.dg/modules/pr99170-3_b.C b/gcc/testsuite/g++.dg/modules/pr99170-3_b.C new file mode 100644 index 0000000..76fa71d --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99170-3_b.C @@ -0,0 +1,6 @@ +// { dg-additional-options -fmodules-ts } +import "pr99170-3_a.H"; + +int main () +{ +} diff --git a/gcc/testsuite/g++.dg/modules/pr99174-1_a.C b/gcc/testsuite/g++.dg/modules/pr99174-1_a.C new file mode 100644 index 0000000..c22b45b --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99174-1_a.C @@ -0,0 +1,8 @@ +// PR 99174 what if we import the same module twice (with no +// intervening header import)? +// { dg-additional-options -fmodules-ts } + +export module Foo; +// { dg-module-cmi Foo } + +export void Foo (); diff --git a/gcc/testsuite/g++.dg/modules/pr99174-1_b.C b/gcc/testsuite/g++.dg/modules/pr99174-1_b.C new file mode 100644 index 0000000..aaa0a94 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99174-1_b.C @@ -0,0 +1,6 @@ +// { dg-additional-options -fmodules-ts } + +export module Bar; +// { dg-module-cmi Bar } + +export void Bar (); diff --git a/gcc/testsuite/g++.dg/modules/pr99174-1_c.C b/gcc/testsuite/g++.dg/modules/pr99174-1_c.C new file mode 100644 index 0000000..58936f2 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99174-1_c.C @@ -0,0 +1,11 @@ +// { dg-additional-options -fmodules-ts } + +import Foo; +import Foo; +import Bar; + +int main () +{ + Foo (); + Bar (); +} diff --git a/gcc/testsuite/g++.dg/modules/pr99174.H b/gcc/testsuite/g++.dg/modules/pr99174.H new file mode 100644 index 0000000..62d5513 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99174.H @@ -0,0 +1,5 @@ +// { dg-additional-options -fmodule-header } +// { dg-module-cmi !{} } +import "pr99174.H"; // { dg-error "cannot import" } + +// { dg-prune-output {not writing module} } diff --git a/gcc/testsuite/g++.dg/modules/pr99208_a.C b/gcc/testsuite/g++.dg/modules/pr99208_a.C new file mode 100644 index 0000000..427c7f1 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99208_a.C @@ -0,0 +1,9 @@ +// PR 99208 typedef anonymous class +// { dg-additional-options {-Wno-pedantic -fmodules-ts} } +module; +# 5 "pr99208_a.C" 1 +typedef struct {} __mbstate_t; +# 7 "" 2 +export module hello:format; +// { dg-module-cmi {hello:format} } +export __mbstate_t v; diff --git a/gcc/testsuite/g++.dg/modules/pr99208_b.C b/gcc/testsuite/g++.dg/modules/pr99208_b.C new file mode 100644 index 0000000..0ed68d8 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99208_b.C @@ -0,0 +1,4 @@ +// { dg-additional-options {-fmodules-ts} } +export module hello; +// { dg-module-cmi hello } +export import :format; diff --git a/gcc/testsuite/g++.dg/modules/pr99245_a.H b/gcc/testsuite/g++.dg/modules/pr99245_a.H new file mode 100644 index 0000000..94c6bf1 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99245_a.H @@ -0,0 +1,5 @@ +// PR 99245 ICE writing out user of type_info +// { dg-additional-options -fmodule-header } +// { dg-module-cmi {} } + +namespace std { class type_info {}; } diff --git a/gcc/testsuite/g++.dg/modules/pr99245_b.H b/gcc/testsuite/g++.dg/modules/pr99245_b.H new file mode 100644 index 0000000..548c272 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99245_b.H @@ -0,0 +1,9 @@ +// { dg-additional-options -fmodule-header } +// { dg-module-cmi {} } +namespace std { class type_info; } + +import "pr99245_a.H"; + +namespace std { + const type_info* __cxa_exception_type () noexcept; +} diff --git a/gcc/testsuite/g++.dg/modules/pr99248.h b/gcc/testsuite/g++.dg/modules/pr99248.h new file mode 100644 index 0000000..89d8dd5 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99248.h @@ -0,0 +1,5 @@ +class locale +{ + template<typename _Cache> + friend struct __use_cache; +}; diff --git a/gcc/testsuite/g++.dg/modules/pr99248_a.H b/gcc/testsuite/g++.dg/modules/pr99248_a.H new file mode 100644 index 0000000..7f3fdda --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99248_a.H @@ -0,0 +1,5 @@ +// PR 99248 ICE with friend +// { dg-additional-options -fmodule-header } +// { dg-module-cmi {} } +#include "pr99248.h" + diff --git a/gcc/testsuite/g++.dg/modules/pr99248_b.H b/gcc/testsuite/g++.dg/modules/pr99248_b.H new file mode 100644 index 0000000..33e242d --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99248_b.H @@ -0,0 +1,7 @@ +// { dg-additional-options -fmodule-header } +// { dg-module-cmi {} } +#include "pr99248.h" +import "pr99248_a.H"; + +template<typename _Facet> +struct __use_cache; diff --git a/gcc/testsuite/g++.dg/modules/pr99285_a.H b/gcc/testsuite/g++.dg/modules/pr99285_a.H new file mode 100644 index 0000000..14d0aa0 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99285_a.H @@ -0,0 +1,11 @@ +// PR 99285 ICE with template-template-parm +// { dg-additional-options -fmodule-header } +// { dg-module-cmi {} } + +template<typename... _Tp> struct common_type; + +template<> struct common_type<> {}; + +template<typename _Tp0> struct common_type<_Tp0> {}; + +template<typename _Tp1, typename _Tp2> struct common_type<_Tp1, _Tp2> {}; diff --git a/gcc/testsuite/g++.dg/modules/pr99285_b.H b/gcc/testsuite/g++.dg/modules/pr99285_b.H new file mode 100644 index 0000000..01a8eaf --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99285_b.H @@ -0,0 +1,7 @@ +// { dg-additional-options -fmodule-header } +// { dg-module-cmi {} } +import "pr99285_a.H"; + +template<typename _Rep1, typename _Rep2, + typename _CRep = typename common_type<_Rep1, _Rep2>::type> +struct X; diff --git a/gcc/testsuite/g++.dg/modules/pr99294.h b/gcc/testsuite/g++.dg/modules/pr99294.h new file mode 100644 index 0000000..757113c --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99294.h @@ -0,0 +1,14 @@ + +template <typename T> +class basic_string; + +typedef basic_string<char> string; + +template <typename T> +class basic_string +{ + public: + string Frob (); + + basic_string (int); +}; diff --git a/gcc/testsuite/g++.dg/modules/pr99294_a.C b/gcc/testsuite/g++.dg/modules/pr99294_a.C new file mode 100644 index 0000000..ac8b9a7 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99294_a.C @@ -0,0 +1,18 @@ +// PR 99294, ICE with -fno-module-lazy on class completeness +// { dg-additional-options -fmodules-ts } + +// The instantiation of the *definition* of basic_string is used in +// importers, *after* they have instantiated a declaration of it *and* +// created type variants. + +module; + +#include "pr99294.h" + +export module foo; +// { dg-module-cmi foo } + +export inline int greeter (string const &bob) +{ + return sizeof (bob); // instantiates string +} diff --git a/gcc/testsuite/g++.dg/modules/pr99294_b.C b/gcc/testsuite/g++.dg/modules/pr99294_b.C new file mode 100644 index 0000000..30d14d1 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99294_b.C @@ -0,0 +1,12 @@ +// PR 99294, ICE with -fno-module-lazy on class completeness +// { dg-additional-options {-fmodules-ts -fno-module-lazy} } + +#include "pr99294.h" +import foo; + +string Quux () +{ + return 1; +} + +// ICED complaining about Quux RETURN_DECL during gimple expand diff --git a/gcc/testsuite/g++.dg/modules/pr99344_a.C b/gcc/testsuite/g++.dg/modules/pr99344_a.C new file mode 100644 index 0000000..e0ba1fa --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99344_a.C @@ -0,0 +1,23 @@ +// { dg-additional-options {-fmodules-ts -Wno-pedantic} } +module ; + +# 4 "bug_a.ii" 1 + +namespace STD::RANGES::INNER +{ +void Frob (); +} + +struct gnu_char_traits +{ + void Frob() + { + STD::RANGES::INNER::Frob (); + } +}; + +# 19 "" 2 + +export module hello; +// { dg-module-cmi hello } +export void greeter (gnu_char_traits const &name); diff --git a/gcc/testsuite/g++.dg/modules/pr99344_b.C b/gcc/testsuite/g++.dg/modules/pr99344_b.C new file mode 100644 index 0000000..e54ae3d --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99344_b.C @@ -0,0 +1,2 @@ +// { dg-additional-options -fmodules-ts } +import hello; diff --git a/gcc/testsuite/g++.dg/modules/pr99377_a.H b/gcc/testsuite/g++.dg/modules/pr99377_a.H new file mode 100644 index 0000000..b5e5a3f --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99377_a.H @@ -0,0 +1,21 @@ +// PR 99377 failed to stream locally instantiated member +// link failure in function `Check(Widget<int> const&)': +// bug_c.ii:(.text._Z5CheckRK6WidgetIiE[_Z5CheckRK6WidgetIiE]+0x14): undefined reference to `Widget<int>::Second() const' +// { dg-module-do link } +// { dg-additional-options -fmodule-header } +// { dg-module-cmi {} } +template<typename> +struct Widget +{ + Widget (int) { } + + bool First() const { return true; } + + bool Second () const { return true;} +}; + +inline void Frob (const Widget<int>& w) noexcept +{ + w.First (); +} + diff --git a/gcc/testsuite/g++.dg/modules/pr99377_b.C b/gcc/testsuite/g++.dg/modules/pr99377_b.C new file mode 100644 index 0000000..7782637 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99377_b.C @@ -0,0 +1,10 @@ +// { dg-additional-options -fmodules-ts } +export module Foo; +// { dg-module-cmi Foo } +import "pr99377_a.H"; + +export inline bool Check (const Widget<int>& w) +{ + return w.Second (); +} + diff --git a/gcc/testsuite/g++.dg/modules/pr99377_c.C b/gcc/testsuite/g++.dg/modules/pr99377_c.C new file mode 100644 index 0000000..287388f --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99377_c.C @@ -0,0 +1,8 @@ +// { dg-additional-options -fmodules-ts } + +import Foo; + +int main () +{ + return Check (0) ? 0 : 1; +} diff --git a/gcc/testsuite/g++.dg/modules/pr99389_a.H b/gcc/testsuite/g++.dg/modules/pr99389_a.H new file mode 100644 index 0000000..cbb64df --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99389_a.H @@ -0,0 +1,20 @@ +// PR 99389 failed to stream class specialization +// { dg-module-do link } +// { dg-additional-options "-fmodule-header" } +// { dg-module-cmi {} } +template<typename _CharT> +class basic_string_view +{ +public: + basic_string_view(const _CharT* __str) noexcept + {} + bool + empty() const noexcept + { return !_M_len; } + +private: + unsigned _M_len; +}; + +using string_view = basic_string_view<char>; + diff --git a/gcc/testsuite/g++.dg/modules/pr99389_b.C b/gcc/testsuite/g++.dg/modules/pr99389_b.C new file mode 100644 index 0000000..f8d010e --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99389_b.C @@ -0,0 +1,12 @@ +// { dg-additional-options {-fmodules-ts -fdump-lang-module } } +export module hello; +// { dg-module-cmi hello } + +import "pr99389_a.H"; + +export inline bool Check (const string_view& n) +{ + return !n.empty (); +} + +// { dg-final { scan-lang-dump {Pending specialization '::basic_string_view<char>' entity:. section:. keyed to '::basic_string_view'} module } } diff --git a/gcc/testsuite/g++.dg/modules/pr99389_c.C b/gcc/testsuite/g++.dg/modules/pr99389_c.C new file mode 100644 index 0000000..f31847d --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99389_c.C @@ -0,0 +1,7 @@ +// { dg-additional-options -fmodules-ts } +import hello; + +int main () +{ + return Check ("World") ? 0 : 1; +} diff --git a/gcc/testsuite/g++.dg/modules/pr99423_a.H b/gcc/testsuite/g++.dg/modules/pr99423_a.H new file mode 100644 index 0000000..db3406c --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99423_a.H @@ -0,0 +1,13 @@ +// PR 99423 ICE seeing GC freed entities +// { dg-additional-options -fmodule-header } +// { dg-module-cmi {} } +template<typename _T1> +struct pair +{ + pair() { } +}; + +inline pair<bool> blob () +{ + return {}; +} diff --git a/gcc/testsuite/g++.dg/modules/pr99423_b.H b/gcc/testsuite/g++.dg/modules/pr99423_b.H new file mode 100644 index 0000000..c02ab29 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99423_b.H @@ -0,0 +1,6 @@ +// { dg-additional-options {-fmodule-header --param ggc-min-expand=0 --param ggc-min-heapsize=0} } +// { dg-module-cmi {} } + +import "pr99423_a.H"; + +pair<bool> boom(); diff --git a/gcc/testsuite/g++.dg/modules/pr99468.H b/gcc/testsuite/g++.dg/modules/pr99468.H new file mode 100644 index 0000000..b6be0c3 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99468.H @@ -0,0 +1,7 @@ +// PR 99468, stupidly worded diagnostic +// { dg-additional-options -fmodule-header } + +module M; // { dg-error "module-declaration not permitted" } + +int i; +// { dg-prune-output "not writing" } diff --git a/gcc/testsuite/g++.dg/modules/pr99528.h b/gcc/testsuite/g++.dg/modules/pr99528.h new file mode 100644 index 0000000..ea5d60f --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99528.h @@ -0,0 +1,9 @@ +template<typename _Tp> +class new_allocator +{ +public: + template<typename _Tp1> + new_allocator(const new_allocator<_Tp1>&) noexcept { } +}; + +extern template class new_allocator<char>; diff --git a/gcc/testsuite/g++.dg/modules/pr99528_a.H b/gcc/testsuite/g++.dg/modules/pr99528_a.H new file mode 100644 index 0000000..08f766b --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99528_a.H @@ -0,0 +1,4 @@ +// PR 99528, ICE with template/function mismatch +// { dg-additional-options -fmodule-header } +// { dg-module-cmi {} } +#include "pr99528.h" diff --git a/gcc/testsuite/g++.dg/modules/pr99528_b.H b/gcc/testsuite/g++.dg/modules/pr99528_b.H new file mode 100644 index 0000000..48c4b4d --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99528_b.H @@ -0,0 +1,4 @@ +// { dg-additional-options -fmodule-header } +// { dg-module-cmi {} } +#include "pr99528.h" + diff --git a/gcc/testsuite/g++.dg/modules/pr99528_c.C b/gcc/testsuite/g++.dg/modules/pr99528_c.C new file mode 100644 index 0000000..ca8d867 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr99528_c.C @@ -0,0 +1,3 @@ +// { dg-additional-options {-fmodules-ts -fno-module-lazy} } +import "pr99528_a.H"; +import "pr99528_b.H"; diff --git a/gcc/testsuite/g++.dg/modules/sys/alias-2_a.H b/gcc/testsuite/g++.dg/modules/sys/alias-2_a.H deleted file mode 100644 index 5a05808..0000000 --- a/gcc/testsuite/g++.dg/modules/sys/alias-2_a.H +++ /dev/null @@ -1,9 +0,0 @@ -// { dg-additional-options "-fmodule-header -isystem [srcdir]/sys" } -// { dg-module-cmi {} } - -#ifndef ALIAS_2_A_SYS -#define ALIAS_2_A_SYS - -int frob (int); - -#endif diff --git a/gcc/testsuite/g++.dg/modules/tpl-spec-1_a.C b/gcc/testsuite/g++.dg/modules/tpl-spec-1_a.C index 26350f0..3bfb6394 100644 --- a/gcc/testsuite/g++.dg/modules/tpl-spec-1_a.C +++ b/gcc/testsuite/g++.dg/modules/tpl-spec-1_a.C @@ -17,6 +17,6 @@ template <> int foo<int> (int y) // { dg-final { scan-lang-dump {Dependencies of specialization function_decl:'::foo<int>'} module } } // { dg-final { scan-lang-dump-not {Depending definition function_decl:'::foo<int>'} module } } // { dg-final { scan-lang-dump {Cluster members:\n \[0\]=specialization declaration '::foo<int>'} module } } -// { dg-final { scan-lang-dump {Specialization '::foo<int>' entity:[0-9]* keyed to TPL\[0\] '::template foo'} module } } +// { dg-final { scan-lang-dump {Pending specialization '::foo<int>' entity:[0-9]* section:. keyed to '::foo'} module } } // { dg-final { scan-assembler {_Z3fooIiEiT_:} } } diff --git a/gcc/testsuite/g++.dg/modules/tpl-spec-1_b.C b/gcc/testsuite/g++.dg/modules/tpl-spec-1_b.C index 1f64fbb..a1dd656 100644 --- a/gcc/testsuite/g++.dg/modules/tpl-spec-1_b.C +++ b/gcc/testsuite/g++.dg/modules/tpl-spec-1_b.C @@ -14,7 +14,6 @@ int main () } // { dg-final { scan-lang-dump-not {Reading definition function_decl '::foo@TPL:.<int>'} module } } -// { dg-final { scan-lang-dump {Specialization keyed to TPL\[0\] entity:1} module } } -// { dg-final { scan-lang-dump {Reading 1 pending specializations keyed to TPL\[0\] '::template foo@TPL:1'} module } } +// { dg-final { scan-lang-dump {Reading 1 pending entities keyed to '::foo'} module } } // { dg-final { scan-assembler-not {_Z3fooIiEiT_:} } } diff --git a/gcc/testsuite/g++.dg/modules/tpl-spec-2_b.C b/gcc/testsuite/g++.dg/modules/tpl-spec-2_b.C index d137481..a8b40ca 100644 --- a/gcc/testsuite/g++.dg/modules/tpl-spec-2_b.C +++ b/gcc/testsuite/g++.dg/modules/tpl-spec-2_b.C @@ -13,6 +13,6 @@ template <> int foo<int> (int y) // { dg-final { scan-lang-dump {Dependencies of specialization function_decl:'::foo<int>'} module } } // { dg-final { scan-lang-dump-not {Depending definition function_decl:'::foo<int>'} module } } // { dg-final { scan-lang-dump {Cluster members:\n \[0\]=specialization declaration '::foo<int>'} module } } -// { dg-final { scan-lang-dump {Specialization '::foo<int>' entity:[0-9]* keyed to TPL\[.\] '::template foo@TPL:.'} module } } +// { dg-final { scan-lang-dump {Pending specialization '::foo<int>' entity:[0-9]* section:. keyed to '::foo'} module } } // { dg-final { scan-assembler {_Z3fooIiEiT_:} } } diff --git a/gcc/testsuite/g++.dg/modules/tpl-spec-2_c.C b/gcc/testsuite/g++.dg/modules/tpl-spec-2_c.C index 3b0a7c7..51b5ead 100644 --- a/gcc/testsuite/g++.dg/modules/tpl-spec-2_c.C +++ b/gcc/testsuite/g++.dg/modules/tpl-spec-2_c.C @@ -13,7 +13,7 @@ int main () return 0; } -// { dg-final { scan-lang-dump {Reading 1 pending specializations keyed to TPL\[0\] '::template foo@TPL:.'} module } } +// { dg-final { scan-lang-dump {Reading 1 pending entities keyed to '::foo'} module } } // { dg-final { scan-lang-dump-not {Reading definition function_decl '::foo@TPL:.<int>'} module } } // { dg-final { scan-assembler-not {_Z3fooIiEiT_:} } } diff --git a/gcc/testsuite/g++.dg/modules/tpl-spec-2_d.C b/gcc/testsuite/g++.dg/modules/tpl-spec-2_d.C index 4095dea..f8aae31 100644 --- a/gcc/testsuite/g++.dg/modules/tpl-spec-2_d.C +++ b/gcc/testsuite/g++.dg/modules/tpl-spec-2_d.C @@ -20,7 +20,7 @@ int two () return 0; } -// { dg-final { scan-lang-dump {Reading 1 pending specializations keyed to TPL\[0\] '::template foo@TPL:.'} module } } +// { dg-final { scan-lang-dump {Reading 1 pending entities keyed to '::foo'} module } } // { dg-final { scan-lang-dump-not {Reading definition function_decl '::foo@TPL:.<int>'} module } } // { dg-final { scan-assembler-not {_Z3fooIiEiT_:} } } diff --git a/gcc/testsuite/g++.dg/modules/tpl-spec-3_a.C b/gcc/testsuite/g++.dg/modules/tpl-spec-3_a.C index 1f3fb40..1e677fc 100644 --- a/gcc/testsuite/g++.dg/modules/tpl-spec-3_a.C +++ b/gcc/testsuite/g++.dg/modules/tpl-spec-3_a.C @@ -22,6 +22,6 @@ template <> void frob::store (int i_) // { dg-final { scan-lang-dump {Dependencies of specialization function_decl:'::frob::store<int>'} module } } // { dg-final { scan-lang-dump-not {Depending definition function_decl:'::frob::store<int>'} module } } // { dg-final { scan-lang-dump {Cluster members:\n \[0\]=specialization declaration '::frob::store<int>'} module } } -// { dg-final { scan-lang-dump {Specialization '::frob::store<int>' entity:[0-9]* keyed to TPL\[1\] '::frob::template store'} module } } +// { dg-final { scan-lang-dump {Pending specialization '::frob::store<int>' entity:[0-9]* section:. keyed to '::frob'} module } } // { dg-final { scan-assembler {_ZN4frob5storeIiEEvT_:} } } diff --git a/gcc/testsuite/g++.dg/modules/tpl-spec-3_b.C b/gcc/testsuite/g++.dg/modules/tpl-spec-3_b.C index a9cd8d7..a7105ae 100644 --- a/gcc/testsuite/g++.dg/modules/tpl-spec-3_b.C +++ b/gcc/testsuite/g++.dg/modules/tpl-spec-3_b.C @@ -17,7 +17,7 @@ int main () return 0; } -// { dg-final { scan-lang-dump {Reading 1 pending specializations keyed to TPL\[1\] '::frob@TPL:.::template store@TPL:.'} module } } +// { dg-final { scan-lang-dump {Reading 1 pending entities keyed to '::frob'} module } } // { dg-final { scan-lang-dump-not {Reading definition function_decl '::frob@TPL:.::store@TPL:.<int>'} module } } // { dg-final { scan-assembler-not {_ZN4frob5storeIiEEvT_:} } } diff --git a/gcc/testsuite/g++.dg/modules/tpl-spec-4_a.C b/gcc/testsuite/g++.dg/modules/tpl-spec-4_a.C index 29e09de..8506821 100644 --- a/gcc/testsuite/g++.dg/modules/tpl-spec-4_a.C +++ b/gcc/testsuite/g++.dg/modules/tpl-spec-4_a.C @@ -16,4 +16,4 @@ template<> struct X<int> // { dg-final { scan-lang-dump {Dependencies of specialization type_decl:'::X<int>'} module } } // { dg-final { scan-lang-dump {Cluster members:\n( \[.\]=[^\n]*'\n)* \[.\]=specialization definition '::X<int>'} module } } -// { dg-final { scan-lang-dump {Specialization '::X<int>' entity:[0-9]* keyed to TPL\[0\] '::template X'} module } } +// { dg-final { scan-lang-dump {Pending specialization '::X<int>' entity:[0-9]* section:. keyed to '::X'} module } } diff --git a/gcc/testsuite/g++.dg/modules/tpl-spec-4_b.C b/gcc/testsuite/g++.dg/modules/tpl-spec-4_b.C index 94ced9b..97aa251 100644 --- a/gcc/testsuite/g++.dg/modules/tpl-spec-4_b.C +++ b/gcc/testsuite/g++.dg/modules/tpl-spec-4_b.C @@ -14,4 +14,4 @@ int main () return 0; } -// { dg-final { scan-lang-dump {Reading 1 pending specializations keyed to TPL\[0\] '::template X@TPL:.'} module } } +// { dg-final { scan-lang-dump {Reading 1 pending entities keyed to '::X'} module } } diff --git a/gcc/testsuite/g++.dg/modules/tpl-spec-5_a.C b/gcc/testsuite/g++.dg/modules/tpl-spec-5_a.C index 08bcac2..f475b82 100644 --- a/gcc/testsuite/g++.dg/modules/tpl-spec-5_a.C +++ b/gcc/testsuite/g++.dg/modules/tpl-spec-5_a.C @@ -16,4 +16,4 @@ template<typename T> struct X<T,1> // { dg-final { scan-lang-dump {Dependency on partial template_decl:'::template X<T,0x1>' found} module } } // { dg-final { scan-lang-dump {Cluster members:\n( \[.\][^\n]*'\n)* \[.\]=partial definition '::template X<T,0x1>'} module } } -// { dg-final { scan-lang-dump {Specialization '::template X<T,0x1>' entity:[0-9]* keyed to TPL\[0\] '::template X'} module } } +// { dg-final { scan-lang-dump {Pending specialization '::template X<T,0x1>' entity:[0-9]* section:. keyed to '::X'} module } } diff --git a/gcc/testsuite/g++.dg/modules/tpl-spec-5_b.C b/gcc/testsuite/g++.dg/modules/tpl-spec-5_b.C index 8a1a557..ff3d84c 100644 --- a/gcc/testsuite/g++.dg/modules/tpl-spec-5_b.C +++ b/gcc/testsuite/g++.dg/modules/tpl-spec-5_b.C @@ -14,4 +14,4 @@ int main () return 0; } -// { dg-final { scan-lang-dump {Reading 1 pending specializations keyed to TPL\[0\] '::template X@TPL:.'} module } } +// { dg-final { scan-lang-dump {Reading 1 pending entities keyed to '::X'} module } } diff --git a/gcc/testsuite/g++.dg/opt/pr99034.C b/gcc/testsuite/g++.dg/opt/pr99034.C new file mode 100644 index 0000000..d791a14 --- /dev/null +++ b/gcc/testsuite/g++.dg/opt/pr99034.C @@ -0,0 +1,23 @@ +// PR ipa/99034 +// { dg-do compile } +// { dg-options "-O2" } + +void *b[5]; +void foo (void); +struct S { ~S (); }; + +static inline void +__attribute__((always_inline)) +bar (int d) +{ + S s; + while (d) + foo (); +} + +void +baz (void) +{ + bar (2); + __builtin_setjmp (b); +} diff --git a/gcc/testsuite/g++.dg/opt/pr99305.C b/gcc/testsuite/g++.dg/opt/pr99305.C new file mode 100644 index 0000000..6fcdef3 --- /dev/null +++ b/gcc/testsuite/g++.dg/opt/pr99305.C @@ -0,0 +1,26 @@ +// PR tree-optimization/99305 +// { dg-do compile } +// { dg-options "-O3 -fno-ipa-icf -fdump-tree-optimized" } +// { dg-final { scan-tree-dump-times " = \\\(unsigned char\\\) c_\[0-9]*\\\(D\\\);" 3 "optimized" { target { ! unsigned_char } } } } +// { dg-final { scan-tree-dump-times " = \[^\n\r]* \\+ \[0-9]*;" 3 "optimized" } } +// { dg-final { scan-tree-dump-times " = \[^\n\r]* <= 9;" 3 "optimized" } } +// { dg-final { scan-tree-dump-not "if \\\(c_\[0-9]*\\\(D\\\) \[!=]= 0\\\)" "optimized" } } +// { dg-final { scan-tree-dump-not " = PHI <" "optimized" } } + +bool +foo (char c) +{ + return c >= 48 && c <= 57; +} + +bool +bar (char c) +{ + return c != 0 && foo (c); +} + +bool +baz (char c) +{ + return c != 0 && c >= 48 && c <= 57; +} diff --git a/gcc/testsuite/g++.dg/pr99165.C b/gcc/testsuite/g++.dg/pr99165.C new file mode 100644 index 0000000..70ffd03 --- /dev/null +++ b/gcc/testsuite/g++.dg/pr99165.C @@ -0,0 +1,7 @@ +// { dg-do compile } +// { dg-options "-O2 -fnon-call-exceptions --param=max-stores-to-track=2" } + +struct A { + A() : i() {} + int i; +} *ap2 = new A[3]; diff --git a/gcc/testsuite/g++.dg/pr99218.C b/gcc/testsuite/g++.dg/pr99218.C new file mode 100644 index 0000000..477a6a2 --- /dev/null +++ b/gcc/testsuite/g++.dg/pr99218.C @@ -0,0 +1,31 @@ +// { dg-do compile } +// { dg-require-effective-target c++17 } + +struct Data +{ + Data() {} + ~Data() {} + + long long i; +}; + +struct X +{ + Data a; + int b; +}; + +template<class T> +X get(T const&) +{ + return X{}; +} + +template<class... Ts> +struct pack_type : Ts... +{}; + +int main() +{ + pack_type<X>{get(1)}; +} diff --git a/gcc/testsuite/g++.dg/template/non-dependent15.C b/gcc/testsuite/g++.dg/template/non-dependent15.C new file mode 100644 index 0000000..00dfe26 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/non-dependent15.C @@ -0,0 +1,12 @@ +// PR c++/95468 +// { dg-do compile { target c++11 } } + +struct A { + template <int N> + static constexpr int condition() { return N; } +}; + +template <int> struct B {}; + +template <class> +using T = B<A::condition<int(1)>()>; diff --git a/gcc/testsuite/g++.dg/ubsan/pr99106.C b/gcc/testsuite/g++.dg/ubsan/pr99106.C new file mode 100644 index 0000000..ccb48a9 --- /dev/null +++ b/gcc/testsuite/g++.dg/ubsan/pr99106.C @@ -0,0 +1,5 @@ +// PR sanitizer/99106 +// { dg-do compile } +// { dg-options "-fsanitize=undefined" } + +#include "../ext/flexary38.C" diff --git a/gcc/testsuite/g++.dg/vect/pr99149.cc b/gcc/testsuite/g++.dg/vect/pr99149.cc new file mode 100755 index 0000000..00ebe9d --- /dev/null +++ b/gcc/testsuite/g++.dg/vect/pr99149.cc @@ -0,0 +1,28 @@ +/* { dg-do compile { target { aarch64-*-* } } } */ +/* { dg-additional-options "-w -O3 -march=armv8.3-a -fdump-tree-slp-all" } */ + +class a { + float b; + float c; + +public: + a(float d, float e) : b(d), c(e) {} + a operator+(a d) { return a(b + d.b, c + d.c); } + a operator*(a d) { return a(b * b - c * c, b * c + c * d.b); } +}; +int f, g; +class { + a *h; + a *i; + +public: + void j() { + a k = h[0], l = i[g], m = k * i[f]; + i[g] = l + m; + i[f] = m; + } +} n; +main() { n.j(); } + +/* { dg-final { scan-tree-dump-times "stmt.*COMPLEX_MUL" 1 "slp2" } } */ +/* { dg-final { scan-tree-dump-times "stmt.*COMPLEX_FMA" 1 "slp2" } } */ diff --git a/gcc/testsuite/g++.dg/vect/pr99220.cc b/gcc/testsuite/g++.dg/vect/pr99220.cc new file mode 100755 index 0000000..b41b2d4 --- /dev/null +++ b/gcc/testsuite/g++.dg/vect/pr99220.cc @@ -0,0 +1,29 @@ +/* { dg-do compile { target { aarch64*-*-* } } } */ +/* { dg-additional-options "-w -O3 -march=armv8.3-a" } */ + +class a { + float b; + float c; + +public: + a(float d, float e) : b(d), c(e) {} + a operator+(a d) { return a(b + d.b, c + d.c); } + a operator-(a d) { return a(b - d.b, c - d.c); } + a operator*(a d) { return a(b * b - c * c, b * c + c * d.b); } +}; +long f; +a *g; +class { + a *h; + long i; + a *j; + +public: + void k() { + a l = h[0], m = g[i], n = l * g[1], o = l * j[8]; + g[i] = m + n; + g[i + 1] = m - n; + j[f] = o; + } +} p; +main() { p.k(); } diff --git a/gcc/testsuite/g++.dg/vect/simd-complex-num-null-node.cc b/gcc/testsuite/g++.dg/vect/simd-complex-num-null-node.cc new file mode 100644 index 0000000..eddf0ad --- /dev/null +++ b/gcc/testsuite/g++.dg/vect/simd-complex-num-null-node.cc @@ -0,0 +1,78 @@ +/* { dg-do compile { target { aarch64-*-* } } } */ +/* { dg-skip-if "incorrect syntax for c++98" { *-*-* } { "-std=c++98" } { "" } } */ +/* { dg-additional-options "-w -O3 -march=armv8.3-a -fdump-tree-vect-all" } */ +/* { dg-require-effective-target le } */ + +typedef struct { + float b; + float c; +} d; +namespace { +typedef int e; +template <typename, typename> struct f; +template <template <typename> class g, typename h, typename k, typename... l> +struct f<g<k, l...>, h> { + using m = g<h>; +}; +} // namespace +namespace aa { +template <typename k> class o { +public: + typedef k p; +}; +} // namespace aa +namespace ab { +template <typename k> using r = aa::o<k>; +template <typename k> class ac : public r<k> {}; +struct s { + template <typename k, typename h> struct ad : f<k, h> {}; +}; +template <typename t, typename h> using ae = typename s::ad<t, h>::m; +template <typename t> struct af { + typedef typename t::p p; + template <typename k> using u = ae<t, k>; +}; +} // namespace ab +namespace aa { +template <typename t> struct ag { + typedef ab::af<t> v; + typedef typename v::p &ah; + template <typename k> struct ai { typedef typename v::u<k> aj; }; +}; +} // namespace aa +namespace ab { +template <typename k, typename t> struct w { + typedef typename aa::ag<t>::ai<k>::aj x; + struct y {}; + typedef t ak; + w(e, ak); + y a; +}; +template <typename k, typename t = ac<k>> class al : w<k, t> { + typedef w<k, t> am; + typedef typename am::x x; + typedef aa::ag<x> an; + +public: + typedef typename an::ah ah; + typedef e ao; + typedef t ak; + al(ao ap, ak aq = ak()) : am(ar(ap, aq), aq) {} + ah operator[](ao); + ao ar(ao ap, ak) { return ap; } +}; +} // namespace ab +void as(int n, d *a, d *q) { + ab::al<d> z(n); + d acc; + for (int j = 0; j < n; ++j) { + auto at = a[j]; + auto au = q[j]; + acc.b += at.b * au.b - at.c * au.c; + acc.c += at.b * au.c + at.c * au.b; + } + z[0] = acc; +} + + +/* { dg-final { scan-tree-dump-times "stmt.*COMPLEX_MUL" 1 "vect" } } */ diff --git a/gcc/testsuite/g++.dg/warn/Warray-bounds-10.C b/gcc/testsuite/g++.dg/warn/Warray-bounds-10.C index 2246697..4deea31 100644 --- a/gcc/testsuite/g++.dg/warn/Warray-bounds-10.C +++ b/gcc/testsuite/g++.dg/warn/Warray-bounds-10.C @@ -19,9 +19,9 @@ void warn_op_new () { T (int32_t, 0, 0); // { dg-warning "array subscript 0 is outside array bounds of 'int32_t \\\[0]'" } // { dg-message "referencing an object of size \\d allocated by 'void\\\* operator new\\\(\(long \)?unsigned int\\\)'" "note" { target *-*-* } .-1 } - T (int32_t, 1, 0); // { dg-warning "array subscript 'int32_t {aka int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[1]'" } - T (int32_t, 2, 0); // { dg-warning "array subscript 'int32_t {aka int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[2]'" } - T (int32_t, 3, 0); // { dg-warning "array subscript 'int32_t {aka int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[3]'" } + T (int32_t, 1, 0); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[1]'" } + T (int32_t, 2, 0); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[2]'" } + T (int32_t, 3, 0); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[3]'" } T (int32_t, 4, 0); @@ -30,9 +30,9 @@ void warn_op_new () T (int32_t, 2, 1); // { dg-warning "array subscript 1 is outside array bounds " } T (int32_t, 3, 1); // { dg-warning "array subscript 1 is outside array bounds " } T (int32_t, 4, 1); // { dg-warning "array subscript 1 is outside array bounds " } - T (int32_t, 5, 1); // { dg-warning "array subscript 'int32_t {aka int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[5]" } - T (int32_t, 6, 1); // { dg-warning "array subscript 'int32_t {aka int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[6]" } - T (int32_t, 7, 1); // { dg-warning "array subscript 'int32_t {aka int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[7]" } + T (int32_t, 5, 1); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[5]" } + T (int32_t, 6, 1); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[6]" } + T (int32_t, 7, 1); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[7]" } T (int32_t, 8, 1); } @@ -45,9 +45,9 @@ void warn_op_array_new () T (int32_t, 0, 0); // { dg-warning "array subscript 0 is outside array bounds of 'int32_t \\\[0]'" } // { dg-message "referencing an object of size \\d allocated by 'void\\\* operator new \\\[]\\\(\(long \)?unsigned int\\\)'" "note" { target *-*-* } .-1 } - T (int32_t, 1, 0); // { dg-warning "array subscript 'int32_t {aka int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[1]'" } - T (int32_t, 2, 0); // { dg-warning "array subscript 'int32_t {aka int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[2]'" } - T (int32_t, 3, 0); // { dg-warning "array subscript 'int32_t {aka int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[3]'" } + T (int32_t, 1, 0); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[1]'" } + T (int32_t, 2, 0); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[2]'" } + T (int32_t, 3, 0); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[3]'" } T (int32_t, 4, 0); @@ -56,9 +56,9 @@ void warn_op_array_new () T (int32_t, 2, 1); // { dg-warning "array subscript 1 is outside array bounds " } T (int32_t, 3, 1); // { dg-warning "array subscript 1 is outside array bounds " } T (int32_t, 4, 1); // { dg-warning "array subscript 1 is outside array bounds " } - T (int32_t, 5, 1); // { dg-warning "array subscript 'int32_t {aka int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[5]" } - T (int32_t, 6, 1); // { dg-warning "array subscript 'int32_t {aka int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[6]" } - T (int32_t, 7, 1); // { dg-warning "array subscript 'int32_t {aka int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[7]" } + T (int32_t, 5, 1); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[5]" } + T (int32_t, 6, 1); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[6]" } + T (int32_t, 7, 1); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[7]" } T (int32_t, 8, 1); } diff --git a/gcc/testsuite/g++.dg/warn/Warray-bounds-11.C b/gcc/testsuite/g++.dg/warn/Warray-bounds-11.C index 9875e29..45d2719 100644 --- a/gcc/testsuite/g++.dg/warn/Warray-bounds-11.C +++ b/gcc/testsuite/g++.dg/warn/Warray-bounds-11.C @@ -21,9 +21,9 @@ void warn_op_new () { T (int32_t, 0, 0); // { dg-warning "array subscript 0 is outside array bounds of 'int32_t \\\[0]'" } // { dg-message "referencing an object of size \\d allocated by 'void\\\* operator new\\\(std::size_t, const std::nothrow_t.\\\)'" "note" { target *-*-* } .-1 } - T (int32_t, 1, 0); // { dg-warning "array subscript 'int32_t {aka int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[1]'" } - T (int32_t, 2, 0); // { dg-warning "array subscript 'int32_t {aka int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[2]'" } - T (int32_t, 3, 0); // { dg-warning "array subscript 'int32_t {aka int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[3]'" } + T (int32_t, 1, 0); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[1]'" } + T (int32_t, 2, 0); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[2]'" } + T (int32_t, 3, 0); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[3]'" } T (int32_t, 4, 0); @@ -32,9 +32,9 @@ void warn_op_new () T (int32_t, 2, 1); // { dg-warning "array subscript 1 is outside array bounds " } T (int32_t, 3, 1); // { dg-warning "array subscript 1 is outside array bounds " } T (int32_t, 4, 1); // { dg-warning "array subscript 1 is outside array bounds " } - T (int32_t, 5, 1); // { dg-warning "array subscript 'int32_t {aka int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[5]" } - T (int32_t, 6, 1); // { dg-warning "array subscript 'int32_t {aka int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[6]" } - T (int32_t, 7, 1); // { dg-warning "array subscript 'int32_t {aka int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[7]" } + T (int32_t, 5, 1); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[5]" } + T (int32_t, 6, 1); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[6]" } + T (int32_t, 7, 1); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[7]" } T (int32_t, 8, 1); } @@ -47,9 +47,9 @@ void warn_op_array_new () T (int32_t, 0, 0); // { dg-warning "array subscript 0 is outside array bounds of 'int32_t \\\[0]'" } // { dg-message "referencing an object of size \\d allocated by 'void\\\* operator new \\\[]\\\(std::size_t, const std::nothrow_t&\\\)'" "note" { target *-*-* } .-1 } - T (int32_t, 1, 0); // { dg-warning "array subscript 'int32_t {aka int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[1]'" } - T (int32_t, 2, 0); // { dg-warning "array subscript 'int32_t {aka int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[2]'" } - T (int32_t, 3, 0); // { dg-warning "array subscript 'int32_t {aka int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[3]'" } + T (int32_t, 1, 0); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[1]'" } + T (int32_t, 2, 0); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[2]'" } + T (int32_t, 3, 0); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[3]'" } T (int32_t, 4, 0); @@ -58,9 +58,9 @@ void warn_op_array_new () T (int32_t, 2, 1); // { dg-warning "array subscript 1 is outside array bounds " } T (int32_t, 3, 1); // { dg-warning "array subscript 1 is outside array bounds " } T (int32_t, 4, 1); // { dg-warning "array subscript 1 is outside array bounds " } - T (int32_t, 5, 1); // { dg-warning "array subscript 'int32_t {aka int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[5]" } - T (int32_t, 6, 1); // { dg-warning "array subscript 'int32_t {aka int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[6]" } - T (int32_t, 7, 1); // { dg-warning "array subscript 'int32_t {aka int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[7]" } + T (int32_t, 5, 1); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[5]" } + T (int32_t, 6, 1); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[6]" } + T (int32_t, 7, 1); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[7]" } T (int32_t, 8, 1); } diff --git a/gcc/testsuite/g++.dg/warn/Warray-bounds-12.C b/gcc/testsuite/g++.dg/warn/Warray-bounds-12.C index 9e8b604..3f1555b 100644 --- a/gcc/testsuite/g++.dg/warn/Warray-bounds-12.C +++ b/gcc/testsuite/g++.dg/warn/Warray-bounds-12.C @@ -21,9 +21,9 @@ void warn_new () { T (int32_t, 0, 0); // { dg-warning "array subscript 0 is outside array bounds of 'int32_t \\\[0]'" } // { dg-message "referencing an object of size \\d allocated by 'void\\\* operator new\\\(\(long \)?unsigned int\\\)'" "note" { target *-*-* } .-1 } - T (int32_t, 1, 0); // { dg-warning "array subscript 'int32_t {aka int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[1]'" } - T (int32_t, 2, 0); // { dg-warning "array subscript 'int32_t {aka int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[2]'" } - T (int32_t, 3, 0); // { dg-warning "array subscript 'int32_t {aka int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[3]'" } + T (int32_t, 1, 0); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[1]'" } + T (int32_t, 2, 0); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[2]'" } + T (int32_t, 3, 0); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[3]'" } T (int32_t, 4, 0); @@ -32,9 +32,9 @@ void warn_new () T (int32_t, 2, 1); // { dg-warning "array subscript 1 is outside array bounds " } T (int32_t, 3, 1); // { dg-warning "array subscript 1 is outside array bounds " } T (int32_t, 4, 1); // { dg-warning "array subscript 1 is outside array bounds " } - T (int32_t, 5, 1); // { dg-warning "array subscript 'int32_t {aka int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[5]" } - T (int32_t, 6, 1); // { dg-warning "array subscript 'int32_t {aka int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[6]" } - T (int32_t, 7, 1); // { dg-warning "array subscript 'int32_t {aka int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[7]" } + T (int32_t, 5, 1); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[5]" } + T (int32_t, 6, 1); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[6]" } + T (int32_t, 7, 1); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[7]" } T (int32_t, 8, 1); } @@ -47,9 +47,9 @@ void warn_array_new () T (int32_t, 0, 0); // { dg-warning "array subscript 0 is outside array bounds of 'int32_t \\\[0]'" } // { dg-message "referencing an object of size \\d allocated by 'void\\\* operator new \\\[]\\\(\(long \)?unsigned int\\\)'" "note" { target *-*-* } .-1 } - T (int32_t, 1, 0); // { dg-warning "array subscript 'int32_t {aka int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[1]'" } - T (int32_t, 2, 0); // { dg-warning "array subscript 'int32_t {aka int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[2]'" } - T (int32_t, 3, 0); // { dg-warning "array subscript 'int32_t {aka int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[3]'" } + T (int32_t, 1, 0); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[1]'" } + T (int32_t, 2, 0); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[2]'" } + T (int32_t, 3, 0); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[3]'" } T (int32_t, 4, 0); @@ -58,9 +58,9 @@ void warn_array_new () T (int32_t, 2, 1); // { dg-warning "array subscript 1 is outside array bounds " } T (int32_t, 3, 1); // { dg-warning "array subscript 1 is outside array bounds " } T (int32_t, 4, 1); // { dg-warning "array subscript 1 is outside array bounds " } - T (int32_t, 5, 1); // { dg-warning "array subscript 'int32_t {aka int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[5]" } - T (int32_t, 6, 1); // { dg-warning "array subscript 'int32_t {aka int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[6]" } - T (int32_t, 7, 1); // { dg-warning "array subscript 'int32_t {aka int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[7]" } + T (int32_t, 5, 1); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[5]" } + T (int32_t, 6, 1); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[6]" } + T (int32_t, 7, 1); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[7]" } T (int32_t, 8, 1); } diff --git a/gcc/testsuite/g++.dg/warn/Warray-bounds-13.C b/gcc/testsuite/g++.dg/warn/Warray-bounds-13.C index 42fb809..890620d 100644 --- a/gcc/testsuite/g++.dg/warn/Warray-bounds-13.C +++ b/gcc/testsuite/g++.dg/warn/Warray-bounds-13.C @@ -25,9 +25,9 @@ void warn_nothrow_new () { T (int32_t, 0, 0); // { dg-warning "array subscript 0 is outside array bounds of 'int32_t \\\[0]'" } // { dg-message "referencing an object of size \\d allocated by 'void\\\* operator new\\\(std::size_t, const std::nothrow_t.\\\)'" "note" { target *-*-* } .-1 } - T (int32_t, 1, 0); // { dg-warning "array subscript 'int32_t {aka int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[1]'" } - T (int32_t, 2, 0); // { dg-warning "array subscript 'int32_t {aka int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[2]'" } - T (int32_t, 3, 0); // { dg-warning "array subscript 'int32_t {aka int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[3]'" } + T (int32_t, 1, 0); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[1]'" } + T (int32_t, 2, 0); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[2]'" } + T (int32_t, 3, 0); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[3]'" } T (int32_t, 4, 0); @@ -36,9 +36,9 @@ void warn_nothrow_new () T (int32_t, 2, 1); // { dg-warning "array subscript 1 is outside array bounds " } T (int32_t, 3, 1); // { dg-warning "array subscript 1 is outside array bounds " } T (int32_t, 4, 1); // { dg-warning "array subscript 1 is outside array bounds " } - T (int32_t, 5, 1); // { dg-warning "array subscript 'int32_t {aka int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[5]" } - T (int32_t, 6, 1); // { dg-warning "array subscript 'int32_t {aka int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[6]" } - T (int32_t, 7, 1); // { dg-warning "array subscript 'int32_t {aka int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[7]" } + T (int32_t, 5, 1); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[5]" } + T (int32_t, 6, 1); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[6]" } + T (int32_t, 7, 1); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[7]" } T (int32_t, 8, 1); } @@ -51,9 +51,9 @@ void warn_nothrow_array_new () T (int32_t, 0, 0); // { dg-warning "array subscript 0 is outside array bounds of 'int32_t \\\[0]'" } // { dg-message "referencing an object of size \\d allocated by 'void\\\* operator new \\\[]\\\(std::size_t, const std::nothrow_t&\\\)'" "note" { target *-*-* } .-1 } - T (int32_t, 1, 0); // { dg-warning "array subscript 'int32_t {aka int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[1]'" } - T (int32_t, 2, 0); // { dg-warning "array subscript 'int32_t {aka int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[2]'" } - T (int32_t, 3, 0); // { dg-warning "array subscript 'int32_t {aka int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[3]'" } + T (int32_t, 1, 0); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[1]'" } + T (int32_t, 2, 0); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[2]'" } + T (int32_t, 3, 0); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[0]' is partly outside array bounds of 'unsigned char \\\[3]'" } T (int32_t, 4, 0); @@ -62,9 +62,9 @@ void warn_nothrow_array_new () T (int32_t, 2, 1); // { dg-warning "array subscript 1 is outside array bounds " } T (int32_t, 3, 1); // { dg-warning "array subscript 1 is outside array bounds " } T (int32_t, 4, 1); // { dg-warning "array subscript 1 is outside array bounds " } - T (int32_t, 5, 1); // { dg-warning "array subscript 'int32_t {aka int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[5]" } - T (int32_t, 6, 1); // { dg-warning "array subscript 'int32_t {aka int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[6]" } - T (int32_t, 7, 1); // { dg-warning "array subscript 'int32_t {aka int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[7]" } + T (int32_t, 5, 1); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[5]" } + T (int32_t, 6, 1); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[6]" } + T (int32_t, 7, 1); // { dg-warning "array subscript 'int32_t {aka (long )?int}\\\[1]' is partly outside array bounds of 'unsigned char \\\[7]" } T (int32_t, 8, 1); } diff --git a/gcc/testsuite/g++.dg/warn/Warray-bounds-15.C b/gcc/testsuite/g++.dg/warn/Warray-bounds-15.C new file mode 100644 index 0000000..455f3a0 --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/Warray-bounds-15.C @@ -0,0 +1,33 @@ +/* PR middle-end/98266 - bogus array subscript is partly outside array + bounds on virtual inheritance + { dg-do compile } + { dg-options "-O2 -Wall" } */ + +#if __cplusplus < 201103L +// This matters for the test case. +# define noexcept throw () +#endif + +struct A +{ + virtual ~A () noexcept; + const char *s; +}; + +struct B: virtual A { }; +struct C: virtual A { }; // { dg-bogus "\\\[-Warray-bounds" } + +struct D: virtual B, virtual C +{ + D (const char*); +}; + +void sink (void*); +void sink (D); + + +// Verify that accesses to the table aren't diagnosed. +void test_vtbl () +{ + sink (D ("")); +} diff --git a/gcc/testsuite/g++.dg/warn/Warray-bounds-17.C b/gcc/testsuite/g++.dg/warn/Warray-bounds-17.C new file mode 100644 index 0000000..64fbd08 --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/Warray-bounds-17.C @@ -0,0 +1,15 @@ +// PR middle-end/99109 +// { dg-do compile } +// { dg-options "-O2 -Warray-bounds" } + +typedef int A __attribute__((aligned (64))); +void foo (int *); + +void +bar (void) +{ + A b; // { dg-message "while referencing" } + int *p = &b; + int *x = (p - 1); // { dg-warning "outside array bounds" } + foo (x); +} diff --git a/gcc/testsuite/g++.dg/warn/Warray-bounds-18.C b/gcc/testsuite/g++.dg/warn/Warray-bounds-18.C new file mode 100644 index 0000000..53d93cf --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/Warray-bounds-18.C @@ -0,0 +1,167 @@ +/* PR middle-end/98266 - bogus array subscript is partly outside array + bounds on virtual inheritance + { dg-do compile } + { dg-options "-O2 -Wall" } */ + +struct A +{ + int ai, aj, aa[2]; + + virtual ~A (); +}; + +struct B: virtual A { }; +struct C: virtual A { }; + +void sink (void*); + +struct C1: virtual A +{ + int c2i, c2j, c2a[2]; + + C1 (); + ~C1 () + { // { dg-bogus "\\\[-Warray-bounds" } + c2i = __LINE__; // { dg-bogus "\\\[-Warray-bounds" } + c2j = __LINE__; // { dg-bogus "\\\[-Warray-bounds" } + c2a[0] = __LINE__; // { dg-bogus "\\\[-Warray-bounds" } + c2a[1] = __LINE__; // { dg-bogus "\\\[-Warray-bounds" } + c2a[2] = __LINE__; // { dg-warning "\\\[-Warray-bounds" } + } +}; + +struct D1: virtual B, virtual C1 +{ + D1 (); +}; + +void sink (void*); + +/* Verify that only out of bounds accesses to members of an ordinary base + class are diagnosed. Use direct array accesses. */ +void test_vmem_base_ctor_arryaccess () +{ + D1 d2; + sink (&d2); +} + + +struct C2: virtual A +{ + int c3a[2]; + + C2 (); + ~C2 () + { // { dg-bogus "\\\[-Warray-bounds" } + int *p = c3a; + *p++ = __LINE__; + *p++ = __LINE__; + *p++ = __LINE__; // { dg-warning "\\\[-Warray-bounds" } + } +}; + +struct D2: virtual B, virtual C2 +{ + D2 (); +}; + +/* Verify that only out of bounds accesses to members of an ordinary base + class are diagnosed. Use pointer accesses. */ +void test_vmem_base_dtor_ptraccess () +{ + D2 d3; + sink (&d3); +} + + +struct C3: virtual A // { dg-bogus "\\\[-Warray-bounds" } +{ + int i, j, a[2]; + + C3 (); +}; + +struct D3: virtual B, virtual C3 +{ + D3 () + { // { dg-bogus "\\\[-Warray-bounds" } + i = __LINE__; // { dg-bogus "\\\[-Warray-bounds" } + j = __LINE__; // { dg-bogus "\\\[-Warray-bounds" } + a[0] = __LINE__; // { dg-bogus "\\\[-Warray-bounds" } + a[1] = __LINE__; // { dg-bogus "\\\[-Warray-bounds" } + a[2] = __LINE__; // { dg-warning "\\\[-Warray-bounds" } + } +}; + +/* Verify that only out of bounds accesses to members of an ordinary base + class made in the ctor of a derived class are diagnosed. Use direct + array accesses. */ +void test_vmem_derived_ctor_arryaccess () +{ + D3 d4; + sink (&d4); +} + + +struct D4: virtual B, virtual C3 +{ + D4 () + { // { dg-bogus "\\\[-Warray-bounds" } + int *p = a; + *p++ = __LINE__; + *p++ = __LINE__; + *p++ = __LINE__; // { dg-warning "\\\[-Warray-bounds" } + } +}; + +/* Verify that only out of bounds accesses to members of an ordinary base + class made in the ctor of a derived class are diagnosed. Use pointer + accesses. */ +void test_vmem_derived_ctor_ptraccess () +{ + D4 d5; + sink (&d5); +} + + +struct D5: virtual B, virtual C3 // { dg-bogus "\\\[-Warray-bounds" } +{ + ~D5 () + { + i = __LINE__; // { dg-bogus "\\\[-Warray-bounds" } + j = __LINE__; // { dg-bogus "\\\[-Warray-bounds" } + a[0] = __LINE__; // { dg-bogus "\\\[-Warray-bounds" } + a[1] = __LINE__; // { dg-bogus "\\\[-Warray-bounds" } + a[2] = __LINE__; // { dg-warning "\\\[-Warray-bounds" } + } +}; + +/* Verify that only out of bounds accesses to members of an ordinary base + class made in the dtor of a derived class are diagnosed. Use pointer + accesses. */ +void test_vmem_derived_dtor_arryaccess () +{ + D5 d6; + sink (&d6); +} + + +struct D6: virtual B, virtual C3 // { dg-bogus "\\\[-Warray-bounds" } +{ + ~D6 () + { + int *p = a; + *p++ = __LINE__; + *p++ = __LINE__; + *p++ = __LINE__; // { dg-warning "\\\[-Warray-bounds" } + } +}; + +/* Verify that only out of bounds accesses to members of an ordinary base + class made in the dtor of a derived class are diagnosed. Use pointer + accesses. */ +void test_vmem_derived_dtor_ptraccess () +{ + D6 d7; + sink (&d7); +} diff --git a/gcc/testsuite/g++.dg/warn/Warray-bounds-19.C b/gcc/testsuite/g++.dg/warn/Warray-bounds-19.C new file mode 100644 index 0000000..e5fabe9 --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/Warray-bounds-19.C @@ -0,0 +1,110 @@ +/* PR middle-end/98266 - bogus array subscript is partly outside array + bounds on virtual inheritance + { dg-do compile } + { dg-options "-O2 -Wall" } */ + +void* operator new (__SIZE_TYPE__, void *p) { return p; } +void* operator new[] (__SIZE_TYPE__, void *p) { return p; } + + +struct A +{ + virtual ~A (); + int ai; +}; + +struct B: virtual A { }; + + +// Exercise access to base members by ctor of the most derived class. + +struct C1: virtual A // { dg-bogus "\\\[-Warray-bounds" } +{ + int c1i; + C1 (); +}; + +struct D1: virtual B, virtual C1 +{ + D1 () { ai = 0; c1i = 1; }; +}; + +void sink (void*); + +void nowarn_derived_ctor_access_decl () +{ + D1 d1; + sink (&d1); +} + +void nowarn_derived_ctor_access_new () +{ + D1 *p = new D1; + sink (p); +} + +void nowarn_derived_ctor_access_placement_new () +{ + char a[sizeof (D1)]; + D1 *p = new (a) D1; + sink (p); +} + +void nowarn_derived_ctor_access_new_array () +{ + D1 *p = new D1[2]; + sink (p); +} + +void nowarn_derived_ctor_access_placement_new_array () +{ + char a[sizeof (D1) * 2]; + D1 *p = new (a) D1[2]; + sink (p); +} + + +// Exercise access to base members by ctor of the second most derived class. + +struct C2: virtual A +{ + int c2i; + ~C2 () { ai = 0; c2i = 1; } // { dg-bogus "\\\[-Warray-bounds" +}; + +struct D2: virtual B, virtual C2 +{ + D2 (); +}; + +void nowarn_base_dtor_access_decl () +{ + D2 d2; + sink (&d2); +} + +void nowarn_base_dtor_access_new () +{ + D2 *p = new D2; + sink (p); +} + +void nowarn_base_dtor_access_placement_new () +{ + char a[sizeof (D2)]; + D2 *p = new (a) D2; + sink (p); +} + +void nowarn_base_dtor_access_new_array () +{ + D2 *p = new D2[2]; + sink (p); +} + +void nowarn_base_dtor_access_placement_new_array () +{ + char a[sizeof (D2) * 2]; + D2 *p = new (a) D2[2]; + sink (p); +} diff --git a/gcc/testsuite/g++.dg/warn/Warray-bounds-20.C b/gcc/testsuite/g++.dg/warn/Warray-bounds-20.C new file mode 100644 index 0000000..e142ea1 --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/Warray-bounds-20.C @@ -0,0 +1,68 @@ +/* PR middle-end/98266 - bogus array subscript is partly outside array + bounds on virtual inheritance + { dg-do compile } + { dg-options "-O2 -Wall" } */ + +void* operator new (__SIZE_TYPE__, void *p) { return p; } +void* operator new[] (__SIZE_TYPE__, void *p) { return p; } + + +struct A +{ + int ai; + virtual ~A (); +}; + +struct B: virtual A { }; + +struct C: virtual A +{ + int ci; + C (); +}; + +struct D1: virtual B, virtual C +{ + /* The warning would ideally point to the assignment but instead points + to the opening brace. */ + D1 () + { // { dg-warning "\\\[-Warray-bounds" "brace" } + ci = 0; // { dg-warning "\\\[-Warray-bounds" "assign" { xfail *-*-* } } + } +}; + +void sink (void*); + +void warn_derived_ctor_access_new_decl () +{ + char a[sizeof (D1)]; // { dg-message "referencing 'a'" "note" } + char *p = a; + ++p; + D1 *q = new (p) D1; + sink (q); +} + +void warn_derived_ctor_access_new_alloc () +{ + char *p = (char*)operator new (sizeof (D1)); // { dg-message "referencing an object of size \\d+ allocated by 'void\\\* operator new\\\(" "note" } + ++p; + D1 *q = new (p) D1; + sink (q); +} + +void warn_derived_ctor_access_new_array_decl () +{ + char b[sizeof (D1) * 2]; // { dg-message "referencing 'b'" "note" } + char *p = b; + ++p; + D1 *q = new (p) D1[2]; + sink (q); +} + +void warn_derived_ctor_access_new_array_alloc () +{ + char *p = new char[sizeof (D1) * 2]; // { dg-message "referencing an object of size \\d+ allocated by 'void\\\* operator new \\\[]\\\(" "note" } + ++p; + D1 *q = new (p) D1[2]; + sink (q); +} diff --git a/gcc/testsuite/g++.dg/warn/Warray-bounds-21.C b/gcc/testsuite/g++.dg/warn/Warray-bounds-21.C new file mode 100644 index 0000000..57bb98b --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/Warray-bounds-21.C @@ -0,0 +1,111 @@ +/* PR middle-end/98266 - bogus array subscript is partly outside array + bounds on virtual inheritance + Same as Warray-bounds-19.C with nonvirtual inheritance. + { dg-do compile } + { dg-options "-O2 -Wall" } */ + +void* operator new (__SIZE_TYPE__, void *p) { return p; } +void* operator new[] (__SIZE_TYPE__, void *p) { return p; } + + +struct A +{ + virtual ~A (); + int ai; +}; + +struct B: A { }; + + +// Exercise access to base members by ctor of the most derived class. + +struct C1: A +{ + int c1i; + C1 (); +}; + +struct D1: B, C1 +{ + D1 () { B::ai = 0; C1::ai = 1; c1i = 2; }; +}; + +void sink (void*); + +void nowarn_derived_ctor_access_decl () +{ + D1 d1; + sink (&d1); +} + +void nowarn_derived_ctor_access_new () +{ + D1 *p = new D1; + sink (p); +} + +void nowarn_derived_ctor_access_placement_new () +{ + char a[sizeof (D1)]; + D1 *p = new (a) D1; + sink (p); +} + +void nowarn_derived_ctor_access_new_array () +{ + D1 *p = new D1[2]; + sink (p); +} + +void nowarn_derived_ctor_access_placement_new_array () +{ + char a[sizeof (D1) * 2]; + D1 *p = new (a) D1[2]; + sink (p); +} + + +// Exercise access to base members by ctor of the second most derived class. + +struct C2: A +{ + int c2i; + ~C2 () { ai = 0; c2i = 1; } +}; + +struct D2: B, C2 +{ + D2 (); +}; + +void nowarn_base_dtor_access_decl () +{ + D2 d2; + sink (&d2); +} + +void nowarn_base_dtor_access_new () +{ + D2 *p = new D2; + sink (p); +} + +void nowarn_base_dtor_access_placement_new () +{ + char a[sizeof (D2)]; + D2 *p = new (a) D2; + sink (p); +} + +void nowarn_base_dtor_access_new_array () +{ + D2 *p = new D2[2]; + sink (p); +} + +void nowarn_base_dtor_access_placement_new_array () +{ + char a[sizeof (D2) * 2]; + D2 *p = new (a) D2[2]; + sink (p); +} diff --git a/gcc/testsuite/g++.dg/warn/Wnonnull11.C b/gcc/testsuite/g++.dg/warn/Wnonnull11.C new file mode 100644 index 0000000..5f1b69d --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/Wnonnull11.C @@ -0,0 +1,40 @@ +/* PR c++/99074 - gcc 8 and above is crashing with dynamic_cast<>() on null + pointer with optimization level -O1 and above + { dg-do run } + { dg-options "-O1 -Wall" } */ + +class Base +{ +public: + virtual ~Base() {} + virtual void op() = 0; +}; + +class Object: public virtual Base { }; + +class AbstractBase: public virtual Base +{ +public: + Object* _to_object () + { + return dynamic_cast<Object*>(this); // { dg-warning "\\\[-Wnonnull" "" { xfail *-*-* } } + } +}; + +class MyAbstractClass: public virtual AbstractBase +{ +public: + static MyAbstractClass* _nil () { return 0; } +}; + + +int main () +{ + MyAbstractClass *my_abs_type = MyAbstractClass::_nil (); + AbstractBase *abs_base = my_abs_type; + Object *obj = abs_base->_to_object (); + + __builtin_printf ("object is: %p\n", obj); + + return 0; +} diff --git a/gcc/testsuite/g++.dg/warn/Wnonnull12.C b/gcc/testsuite/g++.dg/warn/Wnonnull12.C new file mode 100644 index 0000000..7b26063 --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/Wnonnull12.C @@ -0,0 +1,29 @@ +/* PR c++/99251 - inconsistent -Wnonnull warning behaviour with dynamic_cast + { dg-do compile } + { dg-options "-Wall" } */ + +struct A +{ + virtual ~A (); +}; + +struct B: A +{ + int f (int); +}; + +int f1 (A *p) +{ + if (!p) + return 0; + + return (dynamic_cast<B *>(p))->f (1); +} + +int f2 (A *p) +{ + if (!p) + return 0; + + return dynamic_cast<B *>(p)->f (2); // { dg-bogus "\\\[-Wnonnull" } +} diff --git a/gcc/testsuite/g++.dg/warn/Wnonnull9.C b/gcc/testsuite/g++.dg/warn/Wnonnull9.C index b6135c4..88bf55a 100644 --- a/gcc/testsuite/g++.dg/warn/Wnonnull9.C +++ b/gcc/testsuite/g++.dg/warn/Wnonnull9.C @@ -38,13 +38,17 @@ void static_cast_const_C_ptr (B *p) void dynamic_cast_C_ptr (B *p) { - // The dynamic_cast might fail so a warning is justified. - dynamic_cast<C*>(p->bptr ())->g (); // { dg-warning "\\\[-Wnonnull" } + /* Unlike static_cast, dynamic cast may return null even for a nonnull + operand but detecting assumptions to the contrary isn't -Wnonnull's + purpose. Verify -Wnonnull isn't issued, either for the implicitly + emitted null check or for other reasons (the latter may be worth + warning for by some other warning). See also pr99251. */ + dynamic_cast<C*>(p->bptr ())->g (); // { dg-bogus "\\\[-Wnonnull" } } void dynamic_cast_const_C_ptr (B *p) { - dynamic_cast<const C*>(p->bptr ())->g (); // { dg-warning "\\\[-Wnonnull" } + dynamic_cast<const C*>(p->bptr ())->g (); // { dg-bogus "\\\[-Wnonnull" } } @@ -107,11 +111,15 @@ void static_cast_const_D_ptr (B *p) void dynamic_cast_D_ptr (B *p) { - // The dynamic_cast might fail so a warning is justified. - dynamic_cast<D*>(p->bptr ())->g (); // { dg-warning "\\\[-Wnonnull" } + /* Unlike static_cast, dynamic cast may return null even for a nonnull + operand but detecting assumptions to the contrary isn't -Wnonnull's + purpose. Verify -Wnonnull isn't issued, either for the implicitly + emitted null check or for other reasons (the latter may be worth + warning for by some other warning). See also pr99251. */ + dynamic_cast<D*>(p->bptr ())->g (); // { dg-bogus "\\\[-Wnonnull" } } void dynamic_cast_const_D_ptr (B *p) { - dynamic_cast<const D*>(p->bptr ())->g (); // { dg-warning "\\\[-Wnonnull" } + dynamic_cast<const D*>(p->bptr ())->g (); // { dg-bogus "\\\[-Wnonnull" } } diff --git a/gcc/testsuite/g++.dg/warn/Wplacement-new-size-1.C b/gcc/testsuite/g++.dg/warn/Wplacement-new-size-1.C index cec8316..1ad5c2d 100644 --- a/gcc/testsuite/g++.dg/warn/Wplacement-new-size-1.C +++ b/gcc/testsuite/g++.dg/warn/Wplacement-new-size-1.C @@ -67,8 +67,8 @@ void fBx (BAx *pbx, BAx &rbx) { BAx bax; // The uninitialized flexible array takes up the bytes of padding. - new (bax.ax.a) char; - new (bax.ax.a) Int16; + new (bax.ax.a) char; // { dg-warning "placement" "" { target default_packed } } + new (bax.ax.a) Int16; // { dg-warning "placement" "" { target default_packed } } new (bax.ax.a) Int32; // { dg-warning "placement" } new (pbx->ax.a) char; @@ -86,10 +86,10 @@ void fBx1 () static BAx bax1 = { 1, /* Ax = */ { 2, /* a[] = */ {} } }; // The empty flexible array takes up the bytes of padding. - new (bax1.ax.a) char; - new (bax1.ax.a) char[2]; - new (bax1.ax.a) Int16; - new (bax1.ax.a) char[3]; + new (bax1.ax.a) char; // { dg-warning "placement" "" { target default_packed } } + new (bax1.ax.a) char[2]; // { dg-warning "placement" "" { target default_packed } } + new (bax1.ax.a) Int16; // { dg-warning "placement" "" { target default_packed } } + new (bax1.ax.a) char[3]; // { dg-warning "placement" "" { target default_packed } } new (bax1.ax.a) char[4]; // { dg-warning "placement" } new (bax1.ax.a) Int32; // { dg-warning "placement" } } diff --git a/gcc/testsuite/g++.dg/warn/Wplacement-new-size-2.C b/gcc/testsuite/g++.dg/warn/Wplacement-new-size-2.C index e5fdfe1..a4de2b0 100644 --- a/gcc/testsuite/g++.dg/warn/Wplacement-new-size-2.C +++ b/gcc/testsuite/g++.dg/warn/Wplacement-new-size-2.C @@ -125,9 +125,9 @@ void fBx (BAx *pbx, BAx &rbx) { BAx bax; // The uninitialized flexible array takes up the bytes of padding. - new (bax.ax.a) char; - new (bax.ax.a) Int16; - new (bax.ax.a) char[3]; + new (bax.ax.a) char; // { dg-warning "placement" "" { target default_packed } } + new (bax.ax.a) Int16; // { dg-warning "placement" "" { target default_packed } } + new (bax.ax.a) char[3]; // { dg-warning "placement" "" { target default_packed } } new (bax.ax.a) Int32; // { dg-warning "placement" } new (bax.ax.a) char[4]; // { dg-warning "placement" } new (bax.ax.a) char[5]; // { dg-warning "placement" } @@ -147,10 +147,10 @@ void fBx1 () static BAx bax1 = { 1, /* Ax = */ { 2, /* a[] = */ {} } }; // The empty flexible array takes up the bytes of padding. - new (bax1.ax.a) char; - new (bax1.ax.a) char[2]; - new (bax1.ax.a) Int16; - new (bax1.ax.a) char[3]; + new (bax1.ax.a) char; // { dg-warning "placement" "" { target default_packed } } + new (bax1.ax.a) char[2]; // { dg-warning "placement" "" { target default_packed } } + new (bax1.ax.a) Int16; // { dg-warning "placement" "" { target default_packed } } + new (bax1.ax.a) char[3]; // { dg-warning "placement" "" { target default_packed } } new (bax1.ax.a) Int32; // { dg-warning "placement" } new (bax1.ax.a) char[4]; // { dg-warning "placement" } new (bax1.ax.a) char[5]; // { dg-warning "placement" } diff --git a/gcc/testsuite/g++.dg/warn/Wplacement-new-size-6.C b/gcc/testsuite/g++.dg/warn/Wplacement-new-size-6.C index 5eb63d2..86a18fa 100644 --- a/gcc/testsuite/g++.dg/warn/Wplacement-new-size-6.C +++ b/gcc/testsuite/g++.dg/warn/Wplacement-new-size-6.C @@ -18,9 +18,9 @@ void fBx1 () static BAx bax1 = { 1, /* Ax = */ { 2, /* a[] = */ { 3 } } }; // { dg-error "initialization of flexible array member in a nested context" } // The first three bytes of the flexible array member live in the padding. - new (bax1.ax.a) char; - new (bax1.ax.a) char[2]; - new (bax1.ax.a) Int16; + new (bax1.ax.a) char; // { dg-warning "placement" "" { target default_packed } } + new (bax1.ax.a) char[2]; // { dg-warning "placement" "" { target default_packed } } + new (bax1.ax.a) Int16; // { dg-warning "placement" "" { target default_packed } } new (bax1.ax.a) Int32; // { dg-warning "placement" } } @@ -29,10 +29,10 @@ void fBx2 () static BAx bax2 = { 1, /* Ax = */ { 2, /* a[] = */ { 3, 4 } } }; // { dg-error "initialization of flexible array member in a nested context" } // The first three bytes of the flexible array member live in the padding. - new (bax2.ax.a) char; - new (bax2.ax.a) char[2]; - new (bax2.ax.a) char[3]; - new (bax2.ax.a) Int16; + new (bax2.ax.a) char; // { dg-warning "placement" "" { target default_packed } } + new (bax2.ax.a) char[2]; // { dg-warning "placement" "" { target default_packed } } + new (bax2.ax.a) char[3]; // { dg-warning "placement" "" { target default_packed } } + new (bax2.ax.a) Int16; // { dg-warning "placement" "" { target default_packed } } new (bax2.ax.a) char[4]; // { dg-warning "placement" } new (bax2.ax.a) Int32; // { dg-warning "placement" } } @@ -42,10 +42,10 @@ void fBx3 () static BAx bax2 = { 1, /* Ax = */ { 3, /* a[] = */ { 4, 5, 6 } } }; // { dg-error "initialization of flexible array member in a nested context" } // The first three bytes of the flexible array member live in the padding. - new (bax2.ax.a) char; - new (bax2.ax.a) char[2]; - new (bax2.ax.a) Int16; - new (bax2.ax.a) char[3]; + new (bax2.ax.a) char; // { dg-warning "placement" "" { target default_packed } } + new (bax2.ax.a) char[2]; // { dg-warning "placement" "" { target default_packed } } + new (bax2.ax.a) Int16; // { dg-warning "placement" "" { target default_packed } } + new (bax2.ax.a) char[3]; // { dg-warning "placement" "" { target default_packed } } new (bax2.ax.a) char[4]; // { dg-warning "placement" } new (bax2.ax.a) Int32; // { dg-warning "placement" } } diff --git a/gcc/testsuite/g++.dg/warn/Wshadow-17.C b/gcc/testsuite/g++.dg/warn/Wshadow-17.C new file mode 100644 index 0000000..0dee397 --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/Wshadow-17.C @@ -0,0 +1,11 @@ +// PR c++/99120 +// { dg-options "-Wshadow" } + +struct S { + void X(); + + template<typename T> + void fn () { + enum { X }; + } +}; diff --git a/gcc/testsuite/g++.dg/warn/pr80635-1.C b/gcc/testsuite/g++.dg/warn/pr80635-1.C new file mode 100644 index 0000000..8478791 --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/pr80635-1.C @@ -0,0 +1,46 @@ +// PR tree-optimization/80635 +// { dg-do compile { target c++11 } } +// { dg-options "-O2 -Wmaybe-uninitialized" } + +using size_t = decltype (sizeof (1)); +inline void *operator new (size_t, void *p) { return p; } +template<typename T> +struct optional +{ + optional () : m_dummy (), live (false) {} + void emplace () { new (&m_item) T (); live = true; } + ~optional () { if (live) m_item.~T (); } + + union + { + struct {} m_dummy; + T m_item; + }; + bool live; +}; + +extern int get (); +extern void set (int); + +struct A +{ + A () : m (get ()) {} + ~A () { set (m); } // { dg-bogus "may be used uninitialized in this function" } + + int m; +}; + +struct B +{ + B (); + ~B (); +}; + +void func () +{ + optional<A> maybe_a; + optional<B> maybe_b; + + maybe_a.emplace (); + maybe_b.emplace (); +} diff --git a/gcc/testsuite/g++.dg/warn/pr80635-2.C b/gcc/testsuite/g++.dg/warn/pr80635-2.C new file mode 100644 index 0000000..9f57547 --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/pr80635-2.C @@ -0,0 +1,31 @@ +// PR tree-optimization/80635 +// { dg-do compile { target c++17 } } +// { dg-options "-O2 -Wmaybe-uninitialized" } + +#include <optional> + +extern int get (); +extern void set (int); + +struct A +{ + A () : m (get ()) {} + ~A () { set (m); } // { dg-bogus "may be used uninitialized in this function" } + + int m; +}; + +struct B +{ + B (); + ~B (); +}; + +void func () +{ + std::optional<A> maybe_a; + std::optional<B> maybe_b; + + maybe_a.emplace (); + maybe_b.emplace (); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/asmgoto-2.c b/gcc/testsuite/gcc.c-torture/compile/asmgoto-2.c index d2d2ac5..43e597b 100644 --- a/gcc/testsuite/gcc.c-torture/compile/asmgoto-2.c +++ b/gcc/testsuite/gcc.c-torture/compile/asmgoto-2.c @@ -1,6 +1,5 @@ /* This test should be switched off for a new target with less than 4 allocatable registers */ -/* { dg-do compile } */ -/* { dg-skip-if "Reload target" { hppa*-*-* } } */ +/* { dg-do compile { target lra } } */ int foo (void) { diff --git a/gcc/testsuite/gcc.c-torture/compile/asmgoto-5.c b/gcc/testsuite/gcc.c-torture/compile/asmgoto-5.c index ce751ce..e1574a2 100644 --- a/gcc/testsuite/gcc.c-torture/compile/asmgoto-5.c +++ b/gcc/testsuite/gcc.c-torture/compile/asmgoto-5.c @@ -1,7 +1,6 @@ /* Test to generate output reload in asm goto on x86_64. */ -/* { dg-do compile } */ +/* { dg-do compile { target lra } } */ /* { dg-skip-if "no O0" { { i?86-*-* x86_64-*-* } && { ! ia32 } } { "-O0" } { "" } } */ -/* { dg-skip-if "Reload target" { hppa*-*-* } } */ #if defined __x86_64__ #define ASM(s) asm (s) diff --git a/gcc/testsuite/gcc.c-torture/compile/attr-retain-1.c b/gcc/testsuite/gcc.c-torture/compile/attr-retain-1.c new file mode 100644 index 0000000..6cab155 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/attr-retain-1.c @@ -0,0 +1,34 @@ +/* { dg-do compile { target R_flag_in_section } } */ +/* { dg-final { scan-assembler ".text.*,\"axR\"" } } */ +/* { dg-final { scan-assembler ".bss.*,\"awR\"" } } */ +/* { dg-final { scan-assembler ".data.*,\"awR\"" } } */ +/* { dg-final { scan-assembler ".rodata.*,\"aR\"" } } */ +/* { dg-final { scan-assembler ".data.used_foo_sec,\"awR\"" } } */ + +void __attribute__((used,retain)) used_fn (void) { } +void unused_fn (void) { } +void __attribute__((hot,used,retain)) used_hot_fn (void) { } +void __attribute__((hot)) unused_hot_fn (void) { } +void __attribute__((cold,used,retain)) used_cold_fn (void) { } +void __attribute__((cold)) unused_cold_fn (void) { } +int __attribute__((used,retain)) used_bss = 0; +int __attribute__((used,retain)) used_data = 1; +const int __attribute__((used,retain)) used_rodata = 2; +int __attribute__((used,retain)) used_comm; +static int __attribute__((used,retain)) used_lcomm; + +int unused_bss = 0; +int unused_data = 1; +const int unused_rodata = 2; +int unused_comm; +static int unused_lcomm; + +/* Test switching back to the used,retained sections. */ +void __attribute__((used,retain)) used_fn2 (void) { } +int __attribute__((used,retain)) used_bss2 = 0; +int __attribute__((used,retain)) used_data2 = 1; +const int __attribute__((used,retain)) used_rodata2 = 2; +int __attribute__((used,retain)) used_comm2; +static int __attribute__((used,retain)) used_lcomm2; + +int __attribute__((used,retain,section(".data.used_foo_sec"))) used_foo = 2; diff --git a/gcc/testsuite/gcc.c-torture/compile/attr-retain-2.c b/gcc/testsuite/gcc.c-torture/compile/attr-retain-2.c new file mode 100644 index 0000000..0208ffe --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/attr-retain-2.c @@ -0,0 +1,15 @@ +/* { dg-do compile { target R_flag_in_section } } */ +/* { dg-final { scan-assembler ".text.used_fn,\"axR\"" } } */ +/* { dg-final { scan-assembler ".text.used_fn2,\"axR\"" } } */ +/* { dg-final { scan-assembler ".bss.used_bss,\"awR\"" } } */ +/* { dg-final { scan-assembler ".bss.used_bss2,\"awR\"" } } */ +/* { dg-final { scan-assembler ".data.used_data,\"awR\"" } } */ +/* { dg-final { scan-assembler ".data.used_data2,\"awR\"" } } */ +/* { dg-final { scan-assembler ".rodata.used_rodata,\"aR\"" } } */ +/* { dg-final { scan-assembler ".rodata.used_rodata2,\"aR\"" } } */ +/* { dg-final { scan-assembler ".bss.used_lcomm,\"awR\"" { target arm-*-* } } } */ +/* { dg-final { scan-assembler ".bss.used_lcomm2,\"awR\"" { target arm-*-* } } } */ +/* { dg-final { scan-assembler ".data.used_foo_sec,\"awR\"" } } */ +/* { dg-options "-ffunction-sections -fdata-sections" } */ + +#include "attr-retain-1.c" diff --git a/gcc/testsuite/gcc.c-torture/compile/attr-used-retain-1.c b/gcc/testsuite/gcc.c-torture/compile/attr-used-retain-1.c index 5f6cbca..bf5ca48 100644 --- a/gcc/testsuite/gcc.c-torture/compile/attr-used-retain-1.c +++ b/gcc/testsuite/gcc.c-torture/compile/attr-used-retain-1.c @@ -1,10 +1,10 @@ /* { dg-do compile } */ /* { dg-require-effective-target R_flag_in_section } */ -/* { dg-final { scan-assembler ".text.*,\"axR\"" } } */ -/* { dg-final { scan-assembler ".bss.*,\"awR\"" } } */ -/* { dg-final { scan-assembler ".data.*,\"awR\"" } } */ -/* { dg-final { scan-assembler ".rodata.*,\"aR\"" } } */ -/* { dg-final { scan-assembler ".data.used_foo_sec,\"awR\"" } } */ +/* { dg-final { scan-assembler-not ".text.*,\"axR\"" } } */ +/* { dg-final { scan-assembler-not ".bss.*,\"awR\"" } } */ +/* { dg-final { scan-assembler-not ".data.*,\"awR\"" } } */ +/* { dg-final { scan-assembler-not ".rodata.*,\"aR\"" } } */ +/* { dg-final { scan-assembler-not ".data.used_foo_sec,\"awR\"" } } */ void __attribute__((used)) used_fn (void) { } void unused_fn (void) { } diff --git a/gcc/testsuite/gcc.c-torture/compile/attr-used-retain-2.c b/gcc/testsuite/gcc.c-torture/compile/attr-used-retain-2.c index be5f391..7858e62 100644 --- a/gcc/testsuite/gcc.c-torture/compile/attr-used-retain-2.c +++ b/gcc/testsuite/gcc.c-torture/compile/attr-used-retain-2.c @@ -1,16 +1,16 @@ /* { dg-do compile } */ /* { dg-require-effective-target R_flag_in_section } */ -/* { dg-final { scan-assembler ".text.used_fn,\"axR\"" } } */ -/* { dg-final { scan-assembler ".text.used_fn2,\"axR\"" } } */ -/* { dg-final { scan-assembler ".bss.used_bss,\"awR\"" } } */ -/* { dg-final { scan-assembler ".bss.used_bss2,\"awR\"" } } */ -/* { dg-final { scan-assembler ".data.used_data,\"awR\"" } } */ -/* { dg-final { scan-assembler ".data.used_data2,\"awR\"" } } */ -/* { dg-final { scan-assembler ".rodata.used_rodata,\"aR\"" } } */ -/* { dg-final { scan-assembler ".rodata.used_rodata2,\"aR\"" } } */ -/* { dg-final { scan-assembler ".bss.used_lcomm,\"awR\"" { target arm-*-* } } } */ -/* { dg-final { scan-assembler ".bss.used_lcomm2,\"awR\"" { target arm-*-* } } } */ -/* { dg-final { scan-assembler ".data.used_foo_sec,\"awR\"" } } */ +/* { dg-final { scan-assembler-not ".text.used_fn,\"axR\"" } } */ +/* { dg-final { scan-assembler-not ".text.used_fn2,\"axR\"" } } */ +/* { dg-final { scan-assembler-not ".bss.used_bss,\"awR\"" } } */ +/* { dg-final { scan-assembler-not ".bss.used_bss2,\"awR\"" } } */ +/* { dg-final { scan-assembler-not ".data.used_data,\"awR\"" } } */ +/* { dg-final { scan-assembler-not ".data.used_data2,\"awR\"" } } */ +/* { dg-final { scan-assembler-not ".rodata.used_rodata,\"aR\"" } } */ +/* { dg-final { scan-assembler-not ".rodata.used_rodata2,\"aR\"" } } */ +/* { dg-final { scan-assembler-not ".bss.used_lcomm,\"awR\"" { target arm-*-* } } } */ +/* { dg-final { scan-assembler-not ".bss.used_lcomm2,\"awR\"" { target arm-*-* } } } */ +/* { dg-final { scan-assembler-not ".data.used_foo_sec,\"awR\"" } } */ /* { dg-options "-ffunction-sections -fdata-sections" } */ #include "attr-used-retain-1.c" diff --git a/gcc/testsuite/gcc.c-torture/compile/pr98096.c b/gcc/testsuite/gcc.c-torture/compile/pr98096.c new file mode 100644 index 0000000..bba3fa5 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr98096.c @@ -0,0 +1,10 @@ +/* Test for correct naming of label operands in asm goto in case of presence of + input/output operands. */ +/* { dg-do compile { target lra } } */ +int i, j; +int f(void) { + asm goto ("# %0 %2" : "+r" (i) ::: jmp); + i += 2; + asm goto ("# %0 %1 %l[jmp]" : "+r" (i), "+r" (j) ::: jmp); + jmp: return i; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/pr99225.c b/gcc/testsuite/gcc.c-torture/compile/pr99225.c new file mode 100644 index 0000000..0ef7602 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr99225.c @@ -0,0 +1,31 @@ +/* PR tree-optimization/99225 */ + +typedef int V __attribute__((vector_size (4 * sizeof (int)))); + +void +foo (V *x) +{ + x[2] = (x[0] & (1 << x[1])) != 0; +} + +void +bar (V *x) +{ + x[2] = ((1 << x[1]) & x[0]) != 0; +} + +void +baz (V *x) +{ + V a = 1 << x[1]; + V b = a & x[0]; + x[2] = b != 0; +} + +void +qux (V *x) +{ + V a = 1 << x[1]; + V b = x[0] & a; + x[2] = b != 0; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/pr99324.c b/gcc/testsuite/gcc.c-torture/compile/pr99324.c new file mode 100644 index 0000000..7a41e5c --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr99324.c @@ -0,0 +1,19 @@ +/* PR c/99324 */ + +#include <stdarg.h> + +int +foo (int x, ...) +{ + va_list a; + va_start (a, x); + int b[6] = {}; + int bar (c) + int c[1][va_arg (a, int)]; + { + return sizeof c[0]; + } + int r = bar (b); + va_end (a); + return r; +} diff --git a/gcc/testsuite/gcc.c-torture/execute/pr99079.c b/gcc/testsuite/gcc.c-torture/execute/pr99079.c new file mode 100644 index 0000000..78bb218 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr99079.c @@ -0,0 +1,18 @@ +/* PR tree-optimization/99079 */ + +__attribute__((noipa)) unsigned long long +foo (int x) +{ + unsigned long long s = 1 << x; + return 4897637220ULL % s; +} + +int +main () +{ + if (__SIZEOF_INT__ * __CHAR_BIT__ != 32) + return 0; + if (foo (31) != 4897637220ULL) + __builtin_abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-69.c b/gcc/testsuite/gcc.dg/Warray-bounds-69.c new file mode 100644 index 0000000..5a95577 --- /dev/null +++ b/gcc/testsuite/gcc.dg/Warray-bounds-69.c @@ -0,0 +1,74 @@ +/* Verify that storing a bigger vector into smaller space is diagnosed. + { dg-do compile } + { dg-options "-O2 -Warray-bounds" } */ + +typedef __INT16_TYPE__ int16_t; +typedef __attribute__ ((__vector_size__ (32))) char C32; + +typedef __attribute__ ((__vector_size__ (64))) int16_t I16_64; + +void sink (void*); + + +void nowarn_c32 (char c) +{ + extern char nowarn_a32[32]; + + void *p = nowarn_a32; + *(C32*)p = (C32){ c }; + sink (p); + + char a32[32]; + p = a32; + *(C32*)p = (C32){ c }; + sink (p); +} + +/* The invalid stores below are diagnosed by -Warray-bounds only + because it doesn't use compute_objsize(). If/when that changes + the function might need adjusting to avoid the hack put in place + to avoid false positives due to vectorization. */ + +void warn_c32 (char c) +{ + extern char warn_a32[32]; // { dg-message "'warn_a32'" "note" } + + void *p = warn_a32 + 1; + *(C32*)p = (C32){ c }; // { dg-warning "\\\[-Warray-bounds" } + + /* Verify a local variable too. */ + char a32[32]; // { dg-message "'a32'" } + p = a32 + 1; + *(C32*)p = (C32){ c }; // { dg-warning "\\\[-Warray-bounds" } + sink (p); +} + + +void nowarn_i16_64 (int16_t i) +{ + extern char nowarn_a64[64]; + + void *p = nowarn_a64; + I16_64 *q = (I16_64*)p; + *q = (I16_64){ i }; + + char a64[64]; + q = (I16_64*)a64; + *q = (I16_64){ i }; + sink (q); +} + +void warn_i16_64 (int16_t i) +{ + extern char warn_a64[64]; // { dg-message "'warn_a64'" } + + void *p = warn_a64 + 1; + I16_64 *q = (I16_64*)p; + *q = (I16_64){ i }; // { dg-warning "\\\[-Warray-bounds" } + + char a64[64]; // { dg-message "'a64'" } + p = a64 + 1; + q = (I16_64*)p; + *q = (I16_64){ i }; // { dg-warning "\\\[-Warray-bounds" } + sink (p); +} diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-10.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-10.c index 2e22130..bace08a 100644 --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-10.c +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-10.c @@ -1,5 +1,7 @@ -/* { dg-do compile } */ -/* { dg-options "-O2 -Wstringop-overflow" } */ +/* PR tree-optimization/89500 - ICE: tree check: expected integer_cst, + have ssa_name in get_len + { dg-do compile } + { dg-options "-O2 -Wstringop-overflow -Wstringop-truncation" } */ void foo (char *a) diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-47.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-47.c index cb2c329..9bfc84a 100644 --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-47.c +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-47.c @@ -24,17 +24,22 @@ void nowarn_c32 (char c) sink (p); } +/* The tests below fail as a result of the hack for PR 96963. However, + with -Wall, the invalid stores are diagnosed by -Warray-bounds which + runs before vectorization and so doesn't need the hack. If/when + -Warray changes to use compute_objsize() this will need adjusting. */ + void warn_c32 (char c) { - extern char warn_a32[32]; // { dg-message "at offset 32 into destination object 'warn_a32' of size 32" "note" } + extern char warn_a32[32]; // { dg-message "at offset 32 into destination object 'warn_a32' of size 32" "pr97027" { xfail *-*-* } } void *p = warn_a32 + 1; - *(C32*)p = (C32){ c }; // { dg-warning "writing 1 byte into a region of size 0" } + *(C32*)p = (C32){ c }; // { dg-warning "writing 1 byte into a region of size 0" "pr97027" { xfail *-*-* } } /* Verify a local variable too. */ char a32[32]; p = a32 + 1; - *(C32*)p = (C32){ c }; // { dg-warning "writing 1 byte into a region of size 0" } + *(C32*)p = (C32){ c }; // { dg-warning "writing 1 byte into a region of size 0" "pr97027" { xfail *-*-* } } sink (p); } diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-65.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-65.c new file mode 100644 index 0000000..9f82d73 --- /dev/null +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-65.c @@ -0,0 +1,98 @@ +/* PR middle-end/96963 - -Wstringop-overflow false positive with + -ftree-vectorize when assigning consecutive char struct members + { dg-do compile } + { dg-options "-O2 -Wall -ftree-vectorize" } */ + +void sink (void*); + +struct Char +{ + int i; + char c, d, e, f; + char a[2], b[2]; +}; + +void nowarn_char_assign (struct Char *p) +{ + sink (&p->c); + + /* Verify the bogus warning triggered by the tree-ssa-strlen.c pass + is not issued. */ + p->c = 1; // { dg-bogus "\\\[-Wstringop-overflow" } + p->d = 2; + p->e = 3; + p->f = 4; +} + +void nowarn_char_array_assign (struct Char *p) +{ + sink (p->a); + + p->a[0] = 1; // { dg-bogus "\\\[-Wstringop-overflow" } + p->a[1] = 2; + p->b[0] = 3; + p->b[1] = 4; +} + +void warn_char_array_assign_interior (struct Char *p) +{ + sink (p->a); + + p->a[0] = 1; + p->a[1] = 2; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Warray-bounds" + /* Warnings are only suppressed for trailing arrays. Verify + one is issued for an interior array. */ + p->a[2] = 5; // { dg-warning "\\\[-Wstringop-overflow" } +#pragma GCC diagnostic pop +} + +void warn_char_array_assign_trailing (struct Char *p) +{ + /* This is separated from warn_char_array_assign_interior because + otherwise GCC removes the store to p->a[2] as dead since it's + overwritten by p->b[0]. */ + sink (p->b); + + p->b[0] = 3; + p->b[1] = 4; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Warray-bounds" + /* Warnings are only suppressed for trailing arrays with at most + one element. Verify one is issued for a two-element array. */ + p->b[2] = 5; // { dg-warning "\\\[-Wstringop-overflow" } +#pragma GCC diagnostic pop +} + + +/* Also verify there's no warning for other types than char (even though + the problem was limited to chars and -Wstringop-overflow should only + trigger for character accesses). */ + +struct Short +{ + int i; + short c, d, e, f; + short a[2], b[2]; +}; + +void nowarn_short_assign (struct Short *p) +{ + sink (&p->c); + + p->c = 1; + p->d = 2; + p->e = 3; + p->f = 4; +} + +void nowarn_short_array_assign (struct Short *p) +{ + sink (p->a); + + p->a[0] = 1; + p->a[1] = 2; + p->b[0] = 3; + p->b[1] = 4; +} diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-66.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-66.c new file mode 100644 index 0000000..0ecf511 --- /dev/null +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-66.c @@ -0,0 +1,180 @@ +/* PR middle-end/97631 - bogus "writing one too many bytes" warning for + memcpy with strlen argument + { dg-do compile } + { dg-options "-O2 -Wall" } */ + +#define NOIPA __attribute__ ((noipa)) + +typedef __SIZE_TYPE__ size_t; + +extern void* malloc (size_t); +extern void* memcpy (void*, const void*, size_t); +extern void* memmove (void*, const void*, size_t); +extern void* memset (void*, int, size_t); +extern char* strcpy (char*, const char*); +extern char* strncpy (char*, const char*, size_t); +extern size_t strlen (const char*); + + +NOIPA char* nowarn_strcpy (char *s) +{ + size_t n = strlen (s); + char *d = malloc (n + 1); + strcpy (d, s); + return d; +} + + +NOIPA char* warn_strcpy (char *s) +{ + size_t n = strlen (s); + char *d = malloc (n); + strcpy (d, s); // { dg-warning "\\\[-Wstringop-overflow" } + return d; +} + +NOIPA char* warn_strcpy_nz (char *s) +{ + size_t n = strlen (s); + if (n == 0) + return 0; + + char *d = malloc (n); + strcpy (d, s); // { dg-warning "\\\[-Wstringop-overflow" } + return d; +} + +NOIPA char* warn_strcpy_nn (char *s) +{ + size_t n = strlen (s); + char *d = malloc (n); + if (!d) + return 0; + + strcpy (d, s); // { dg-warning "\\\[-Wstringop-overflow" } + return d; +} + +NOIPA char* warn_strcpy_nz_nn (char *s) +{ + size_t n = strlen (s); + if (n == 0) + return 0; + + char *d = malloc (n); + if (!d) + return 0; + + strcpy (d, s); // { dg-warning "\\\[-Wstringop-overflow" } + return d; +} + + +NOIPA char* nowarn_strncpy_1 (char *s) +{ + /* There's no overflow or truncation below so verify there is no + warning either. */ + size_t n = strlen (s) + 1; + char *d = malloc (n); + strncpy (d, s, n); + return d; +} + + +NOIPA char* warn_strncpy (char *s) +{ + size_t n = strlen (s); + char *d = malloc (n); + strncpy (d, s, n); // { dg-warning "\\\[-Wstringop-truncation" } + return d; +} + +NOIPA char* warn_strncpy_p1 (char *s) +{ + size_t n = strlen (s); + char *d = malloc (n + 1); + strncpy (d, s, n); // { dg-warning "\\\[-Wstringop-truncation" } + return d; +} + +NOIPA char* warn_strncpy_nz (char *s) +{ + size_t n = strlen (s); + if (n == 0) + return 0; + + char *d = malloc (n); + strncpy (d, s, n); // { dg-warning "\\\[-Wstringop-truncation" } + return d; + +} + + +NOIPA char* nowarn_memcpy (char *s) +{ + size_t n = strlen (s); + char *d = malloc (n); + memcpy (d, s, n); // { dg-bogus "\\\[-Wstringop-overflow" } + return d; +} + +NOIPA char* nowarn_memcpy_nz (char *s) +{ + size_t n = strlen (s); + if (n == 0) + return 0; + + char *d = malloc (n); + memcpy (d, s, n); // { dg-bogus "\\\[-Wstringop-overflow" } + return d; +} + +NOIPA char* nowarn_memcpy_nn (char *s) +{ + size_t n = strlen (s); + char *d = malloc (n); + if (!d) + return 0; + + memcpy (d, s, n); // { dg-bogus "\\\[-Wstringop-overflow" } + return d; +} + +NOIPA char* nowarn_memcpy_nn_nz (char *s) +{ + size_t n = strlen (s); + if (n == 0) + return 0; + + char *d = malloc (n); + if (!d) + return 0; + + memcpy (d, s, n); // { dg-bogus "\\\[-Wstringop-overflow" } + return d; + +} + + +NOIPA char* nowarn_memmove (char *s) +{ + size_t n = strlen (s); + if (n == 0) + return 0; + + char *d = malloc (n); + memmove (d, s, n); // { dg-bogus "\\\[-Wstringop-overflow" } + return d; +} + + +NOIPA char* nowarn_memset (char *s, int c) +{ + size_t n = strlen (s); + if (n == 0) + return 0; + + char *d = malloc (n); + memset (d, c, n); // { dg-bogus "\\\[-Wstringop-overflow" } + return d; +} diff --git a/gcc/testsuite/gcc.dg/analyzer/dot-output.c b/gcc/testsuite/gcc.dg/analyzer/dot-output.c index ff418b1..03405cd 100644 --- a/gcc/testsuite/gcc.dg/analyzer/dot-output.c +++ b/gcc/testsuite/gcc.dg/analyzer/dot-output.c @@ -2,7 +2,7 @@ by .dot. */ /* { dg-require-dot "" } */ -/* { dg-additional-options "-fdump-analyzer-callgraph -fdump-analyzer-exploded-graph -fdump-analyzer-state-purge -fdump-analyzer-supergraph" } */ +/* { dg-additional-options "-fdump-analyzer-callgraph -fdump-analyzer-exploded-graph -fdump-analyzer-state-purge -fdump-analyzer-supergraph -fdump-analyzer-feasibility" } */ #include <stdlib.h> diff --git a/gcc/testsuite/gcc.dg/analyzer/error-1.c b/gcc/testsuite/gcc.dg/analyzer/error-1.c new file mode 100644 index 0000000..f82a4cd --- /dev/null +++ b/gcc/testsuite/gcc.dg/analyzer/error-1.c @@ -0,0 +1,66 @@ +#include "analyzer-decls.h" + +extern int errno; + +extern void error (int __status, int __errnum, const char *__format, ...) + __attribute__ ((__format__ (__printf__, 3, 4))); + +extern void error_at_line (int __status, int __errnum, const char *__fname, + unsigned int __lineno, const char *__format, ...) + __attribute__ ((__format__ (__printf__, 5, 6))); + +/* When status is an unknown param. */ + +void test_1 (int st) +{ + error (st, errno, "test"); + __analyzer_eval (st == 0); /* { dg-warning "TRUE" } */ +} + +/* When status is known zero. */ + +void test_2 (int st) +{ + error (0, errno, "test"); + __analyzer_dump_path (); /* { dg-message "here" } */ +} + +/* When status is a non-zero known constant. */ + +void test_3 (int st) +{ + error (1, errno, "test"); + __analyzer_dump_path (); /* { dg-bogus "here" } */ +} + +/* When status has been tested against zero. */ + +void test_4 (int st) +{ + if (st) + { + error (st, errno, "nonzero branch"); + __analyzer_dump_path (); /* { dg-bogus "here" } */ + } + else + { + error (st, errno, "zero branch"); + __analyzer_dump_path (); /* { dg-message "here" } */ + } +} + +/* Similarly for error_at_line. */ + +void test_5 (int st) +{ + error_at_line (st, errno, __FILE__, __LINE__, "test"); + __analyzer_eval (st == 0); /* { dg-warning "TRUE" } */ +} + +/* Non-trivial format string. */ + +void test_6 (int st, const char *str) +{ + error (st, errno, "test: %s", str); + __analyzer_eval (st == 0); /* { dg-warning "TRUE" } */ +} diff --git a/gcc/testsuite/gcc.dg/analyzer/error-2.c b/gcc/testsuite/gcc.dg/analyzer/error-2.c new file mode 100644 index 0000000..138ab9d --- /dev/null +++ b/gcc/testsuite/gcc.dg/analyzer/error-2.c @@ -0,0 +1,48 @@ +#define NULL ((void*)0) +typedef __SIZE_TYPE__ size_t; + +extern int errno; + +extern void free (void *); +char *strdup (const char *) + __attribute__((malloc (free))); + +extern size_t strlen (const char *__s) + __attribute__ ((__nothrow__ , __leaf__)) + __attribute__ ((__pure__)) + __attribute__ ((__nonnull__ (1))); + +extern void error (int __status, int __errnum, const char *__format, ...) + __attribute__ ((__format__ (__printf__, 3, 4))); + +extern void error_at_line (int __status, int __errnum, const char *__fname, + unsigned int __lineno, const char *__format, ...) + __attribute__ ((__format__ (__printf__, 5, 6))); + +/* PR analyzer/99196; extract taken from + https://github.com/libguestfs/libguestfs/blob/f19fd566f6387ce7e4d82409528c9dde374d25e0/daemon/tar.c#L108 + (which is GPLv2 or later). */ + +extern char *read_whole_file (const char *error_file, size_t *out); + +#define EXIT_FAILURE 1 + +char *read_error_file (const char *error_file) +{ + size_t len; + char *str; + + str = read_whole_file (error_file, &len); + if (str == NULL) { + str = strdup ("(no error)"); + if (str == NULL) + error (EXIT_FAILURE, errno, "strdup"); + len = strlen (str); /* { dg-bogus "NULL" } */ + } + + /* Remove trailing \n character if any. */ + if (len > 0 && str[len-1] == '\n') + str[--len] = '\0'; + + return str; /* caller frees */ +} diff --git a/gcc/testsuite/gcc.dg/analyzer/error-3.c b/gcc/testsuite/gcc.dg/analyzer/error-3.c new file mode 100644 index 0000000..b6ab6c8 --- /dev/null +++ b/gcc/testsuite/gcc.dg/analyzer/error-3.c @@ -0,0 +1,11 @@ +/* Verify that we gracefully handle error functions that don't match + the signature of GNU's <error.h>. */ + +extern void error (void); +extern void error_at_line (void); + +void test_1 (void) +{ + error (); + error_at_line (); +} diff --git a/gcc/testsuite/gcc.dg/analyzer/feasibility-1.c b/gcc/testsuite/gcc.dg/analyzer/feasibility-1.c index c968444..83ec1ca 100644 --- a/gcc/testsuite/gcc.dg/analyzer/feasibility-1.c +++ b/gcc/testsuite/gcc.dg/analyzer/feasibility-1.c @@ -55,8 +55,7 @@ int test_6 (int a, int b) { if (!problem) problem = 2; - __analyzer_dump_path (); /* { dg-message "path" "" { xfail *-*-* } } */ - /* XFAIL is PR analyzer/96374. */ + __analyzer_dump_path (); /* { dg-message "path" } */ } return problem; } @@ -86,3 +85,16 @@ int test_6a (int a, int b, void *ptr) } return problem; } + +/* After state-merging, the shortest path skips the loop, + but the shortest feasible path enters it. */ + +void test_7 (int n) +{ + int entered_loop = 0; + int i; + for (i = 0; i < n; i++) + entered_loop = 1; + if (entered_loop) + __analyzer_dump_path (); /* { dg-message "path" } */ +} diff --git a/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias-feasibility-2.c b/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias-feasibility-2.c index 1afc6df..1484297 100644 --- a/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias-feasibility-2.c +++ b/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias-feasibility-2.c @@ -25,7 +25,5 @@ _nl_expand_alias (void) ++locale_alias_path; if (start < locale_alias_path) - __analyzer_dump_path (); /* { dg-message "path" "" { xfail *-*-* } } */ - /* XFAIL: PR analyzer/96374 - Use -fno-analyzer-feasibility to see the path. */ + __analyzer_dump_path (); /* { dg-message "path" } */ } diff --git a/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias-feasibility-3.c b/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias-feasibility-3.c index a864831..50d3388 100644 --- a/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias-feasibility-3.c +++ b/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias-feasibility-3.c @@ -41,9 +41,7 @@ read_alias_file (const char *fname, char *cp) { FILE *fp; - fp = fopen (fname, "r"); /* { dg-message "opened here" "" { xfail *-*-* } } */ - /* XFAIL: PR analyzer/96374 - Use -fno-analyzer-feasibility to see the path. */ + fp = fopen (fname, "r"); /* { dg-message "opened here" } */ if (fp == NULL) return 0; @@ -54,9 +52,7 @@ read_alias_file (const char *fname, char *cp) ++cp; if (cp[0] != '\0') - return 42; /* { dg-warning "leak of FILE 'fp'" "" { xfail *-*-* } } */ - /* XFAIL: PR analyzer/96374 - Use -fno-analyzer-feasibility to see the path. */ + return 42; /* { dg-warning "leak of FILE 'fp'" } */ fclose(fp); diff --git a/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias-feasibility.c b/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias-feasibility.c index 0d470d6..1a34d05 100644 --- a/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias-feasibility.c +++ b/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias-feasibility.c @@ -3,8 +3,6 @@ Adapted from intl/localealias.c, with all #includes removed. */ /* { dg-do "compile" } */ -/* { dg-additional-options "-fno-analyzer-feasibility" } */ -/* TODO: remove the need for this option. */ /* Handle aliases for locale names. Copyright (C) 1995-1999, 2000-2001, 2003 Free Software Foundation, Inc. diff --git a/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias.c b/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias.c index 043e45f..88d0fc1 100644 --- a/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias.c +++ b/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias.c @@ -3,8 +3,8 @@ Adapted from intl/localealias.c, with all #includes removed. */ /* { dg-do "compile" } */ -/* { dg-additional-options "-Wno-analyzer-too-complex -fno-analyzer-feasibility" } */ -/* TODO: remove the need for these options. */ +/* { dg-additional-options "-Wno-analyzer-too-complex" } */ +/* TODO: remove the need for this option. */ /* { dg-require-effective-target alloca } */ /* Handle aliases for locale names. diff --git a/gcc/testsuite/gcc.dg/analyzer/pr94047.c b/gcc/testsuite/gcc.dg/analyzer/pr94047.c index d989a25..5107ec0 100644 --- a/gcc/testsuite/gcc.dg/analyzer/pr94047.c +++ b/gcc/testsuite/gcc.dg/analyzer/pr94047.c @@ -1,7 +1,3 @@ -/* { dg-additional-options "-Wno-analyzer-too-complex" } */ -/* TODO: the above ought not to be necessary, but currently is due to a - state explosion within the for loop. */ - typedef struct list { struct list *next; diff --git a/gcc/testsuite/gcc.dg/analyzer/pr94596.c b/gcc/testsuite/gcc.dg/analyzer/pr94596.c new file mode 100644 index 0000000..055d209 --- /dev/null +++ b/gcc/testsuite/gcc.dg/analyzer/pr94596.c @@ -0,0 +1,97 @@ +/* Minimized/hacked up from openvswitch lib/conntrack.c, which had this license + header: */ +/* + * Copyright (c) 2015-2019 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +typedef __SIZE_TYPE__ size_t; +#define NULL ((void *)0) +#define false 0 + +#define OBJECT_OFFSETOF(OBJECT, MEMBER)\ + __builtin_offsetof(typeof(*(OBJECT)), MEMBER) + +#define OBJECT_CONTAINING(POINTER, OBJECT, MEMBER) \ + ((typeof(OBJECT)) (void *) \ + ((char *) (POINTER) - OBJECT_OFFSETOF(OBJECT, MEMBER))) + +#define ASSIGN_CONTAINER(OBJECT, POINTER, MEMBER) \ + ((OBJECT) = OBJECT_CONTAINING(POINTER, OBJECT, MEMBER), (void) 0) + +#define INIT_CONTAINER(OBJECT, POINTER, MEMBER) \ + ((OBJECT) = NULL, ASSIGN_CONTAINER(OBJECT, POINTER, MEMBER)) + +#define HMAP_FOR_EACH_POP(NODE, MEMBER, HMAP) \ + for (size_t bucket__ = 0; \ + INIT_CONTAINER(NODE, hmap_pop_helper__(HMAP, &bucket__), MEMBER), \ + (NODE != OBJECT_CONTAINING(NULL, NODE, MEMBER)) \ + || ((NODE = NULL), false);) + +struct hmap { + struct hmap_node **buckets; + struct hmap_node *one; + size_t mask; + size_t n; +}; + +struct hmap_node { + size_t hash; + struct hmap_node *next; +}; + +static inline void hmap_remove(struct hmap *, struct hmap_node *); + +struct hmap_node * +hmap_pop_helper__(struct hmap *hmap, size_t *bucket) { + + for (; *bucket <= hmap->mask; (*bucket)++) { + struct hmap_node *node = hmap->buckets[*bucket]; + + if (node) { + hmap_remove(hmap, node); + return node; + } + } + + return NULL; +} + +static inline void +hmap_remove(struct hmap *hmap, struct hmap_node *node) +{ + struct hmap_node **bucket = &hmap->buckets[node->hash & hmap->mask]; + while (*bucket != node) { + bucket = &(*bucket)->next; + } + *bucket = node->next; + hmap->n--; +} + +struct conntrack { + struct hmap zone_limits; +}; + +struct zone_limit { + struct hmap_node node; +}; + +void +conntrack_destroy(struct conntrack *ct) +{ + struct zone_limit *zl; + HMAP_FOR_EACH_POP (zl, node, &ct->zone_limits) { + __builtin_free(zl); + } +} diff --git a/gcc/testsuite/gcc.dg/analyzer/pr96841.c b/gcc/testsuite/gcc.dg/analyzer/pr96841.c index d9d35f3..8546661 100644 --- a/gcc/testsuite/gcc.dg/analyzer/pr96841.c +++ b/gcc/testsuite/gcc.dg/analyzer/pr96841.c @@ -1,4 +1,4 @@ -/* { dg-additional-options "-O1 -Wno-builtin-declaration-mismatch" } */ +/* { dg-additional-options "-Wno-analyzer-too-complex -O1 -Wno-builtin-declaration-mismatch" } */ int l8 (void); @@ -18,6 +18,6 @@ bv (__SIZE_TYPE__ ny) { *mf = 0; (*mf)[ny] = (int *) malloc (sizeof (int)); - th ((*mf)[ny]); /* { dg-warning "leak" } */ + th ((*mf)[ny]); } } diff --git a/gcc/testsuite/gcc.dg/analyzer/pr98969.c b/gcc/testsuite/gcc.dg/analyzer/pr98969.c index 8298f26..7e1587d 100644 --- a/gcc/testsuite/gcc.dg/analyzer/pr98969.c +++ b/gcc/testsuite/gcc.dg/analyzer/pr98969.c @@ -8,7 +8,7 @@ test_1 (long int i) { struct foo *f = (struct foo *)i; f->expr = __builtin_malloc (1024); -} /* { dg-bogus "leak" "PR analyzer/98969" { xfail *-*-* } } */ +} /* { dg-bogus "leak" } */ void test_2 (long int i) @@ -16,3 +16,10 @@ test_2 (long int i) __builtin_free (((struct foo *)i)->expr); __builtin_free (((struct foo *)i)->expr); /* { dg-warning "double-'free' of '\\*\\(\\(struct foo \\*\\)i\\)\\.expr'" } */ } + +void +test_3 (void *p) +{ + void **q = (void **)p; + *q = __builtin_malloc (1024); +} diff --git a/gcc/testsuite/gcc.dg/analyzer/pr99193-1.c b/gcc/testsuite/gcc.dg/analyzer/pr99193-1.c new file mode 100644 index 0000000..c6179e9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/analyzer/pr99193-1.c @@ -0,0 +1,65 @@ +/* Verify absence of false positive from -Wanalyzer-mismatching-deallocation + on realloc(3). + Based on https://github.com/libguestfs/libguestfs/blob/f19fd566f6387ce7e4d82409528c9dde374d25e0/daemon/command.c#L115 + which is GPLv2 or later. */ + +typedef __SIZE_TYPE__ size_t; +typedef __builtin_va_list va_list; + +#define NULL ((void *)0) + +extern void *malloc (size_t __size) + __attribute__ ((__nothrow__ , __leaf__)) + __attribute__ ((__malloc__)) + __attribute__ ((__alloc_size__ (1))); +extern void perror (const char *__s); +extern void *realloc (void *__ptr, size_t __size) + __attribute__ ((__nothrow__ , __leaf__)) + __attribute__ ((__warn_unused_result__)) + __attribute__ ((__alloc_size__ (2))); + +extern void guestfs_int_cleanup_free (void *ptr); +extern int commandrvf (char **stdoutput, char **stderror, unsigned flags, + char const* const *argv); +#define CLEANUP_FREE __attribute__((cleanup(guestfs_int_cleanup_free))) + +int +commandrf (char **stdoutput, char **stderror, unsigned flags, + const char *name, ...) +{ + va_list args; + CLEANUP_FREE const char **argv = NULL; + char *s; + int i, r; + + /* Collect the command line arguments into an array. */ + i = 2; + argv = malloc (sizeof (char *) * i); + + if (argv == NULL) { + perror ("malloc"); + return -1; + } + argv[0] = (char *) name; + argv[1] = NULL; + + __builtin_va_start (args, name); + + while ((s = __builtin_va_arg (args, char *)) != NULL) { + const char **p = realloc (argv, sizeof (char *) * (++i)); /* { dg-bogus "'free'" } */ + if (p == NULL) { + perror ("realloc"); + __builtin_va_end (args); + return -1; + } + argv = p; + argv[i-2] = s; + argv[i-1] = NULL; + } + + __builtin_va_end (args); + + r = commandrvf (stdoutput, stderror, flags, argv); + + return r; +} diff --git a/gcc/testsuite/gcc.dg/analyzer/pr99193-2.c b/gcc/testsuite/gcc.dg/analyzer/pr99193-2.c new file mode 100644 index 0000000..40e6181 --- /dev/null +++ b/gcc/testsuite/gcc.dg/analyzer/pr99193-2.c @@ -0,0 +1,68 @@ +/* Verify absence of false positive from -Wanalyzer-mismatching-deallocation + on realloc(3). + Based on https://github.com/libguestfs/libguestfs/blob/f19fd566f6387ce7e4d82409528c9dde374d25e0/df/main.c#L404 + which is GPLv2 or later. */ + +typedef __SIZE_TYPE__ size_t; +typedef __builtin_va_list va_list; + +#define NULL ((void *)0) + +extern void free (void *); +extern void *realloc (void *__ptr, size_t __size) + __attribute__ ((__nothrow__ , __leaf__)) + __attribute__ ((__warn_unused_result__)) + __attribute__ ((__alloc_size__ (2))); +char *strdup (const char *) + __attribute__((malloc (free))); + +extern void error (int __status, int __errnum, const char *__format, ...) + __attribute__ ((__format__ (__printf__, 3, 4))); + +extern int errno; + +struct drv +{ + struct drv *next; +}; + +#define EXIT_FAILURE 1 + +static char * +single_drive_display_name (struct drv *) +{ + char *result = strdup ("placeholder"); + if (!result) + __builtin_abort (); + return result; +} + +char * +make_display_name (struct drv *drvs) +{ + char *ret; + + if (drvs->next == NULL) + ret = single_drive_display_name (drvs); + else { + size_t pluses = 0; + size_t i, len; + + while (drvs->next != NULL) { + drvs = drvs->next; + pluses++; + } + + ret = single_drive_display_name (drvs); + len = __builtin_strlen (ret); + + ret = realloc (ret, len + pluses + 1); /* { dg-bogus "'free'" } */ + if (ret == NULL) + error (EXIT_FAILURE, errno, "realloc"); + for (i = len; i < len + pluses; ++i) + ret[i] = '+'; + ret[i] = '\0'; + } + + return ret; +} diff --git a/gcc/testsuite/gcc.dg/analyzer/pr99193-3.c b/gcc/testsuite/gcc.dg/analyzer/pr99193-3.c new file mode 100644 index 0000000..3e7ffd6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/analyzer/pr99193-3.c @@ -0,0 +1,48 @@ +/* Verify absence of false positive from -Wanalyzer-mismatching-deallocation + on realloc(3). + Based on https://github.com/libguestfs/libguestfs/blob/f19fd566f6387ce7e4d82409528c9dde374d25e0/daemon/debug.c#L115 + which is GPLv2 or later. */ + +typedef __SIZE_TYPE__ size_t; +typedef __builtin_va_list va_list; + +#define NULL ((void *)0) + +extern void free (void *); +extern void *realloc (void *__ptr, size_t __size) + __attribute__ ((__nothrow__ , __leaf__)) + __attribute__ ((__warn_unused_result__)) + __attribute__ ((__alloc_size__ (2))); +extern char *strdup (const char *) + __attribute__((malloc (free))); +extern char *strcat (char *__restrict __dest, const char *__restrict __src) + __attribute__ ((__nothrow__ , __leaf__)) + __attribute__ ((__nonnull__ (1, 2))); + +static char * +debug_help (const char **cmds, size_t argc, char *const *const argv) +{ + size_t len, i; + char *r, *p; + + r = strdup ("Commands supported:"); + if (!r) { + return NULL; + } + + len = __builtin_strlen (r); + for (i = 0; cmds[i] != NULL; ++i) { + len += __builtin_strlen (cmds[i]) + 1; + p = realloc (r, len + 1); /* { dg-bogus "'free'" } */ + if (p == NULL) { + free (r); + return NULL; + } + r = p; + + strcat (r, " "); + strcat (r, cmds[i]); + } + + return r; +} diff --git a/gcc/testsuite/gcc.dg/analyzer/realloc-1.c b/gcc/testsuite/gcc.dg/analyzer/realloc-1.c new file mode 100644 index 0000000..a6c6bfc --- /dev/null +++ b/gcc/testsuite/gcc.dg/analyzer/realloc-1.c @@ -0,0 +1,55 @@ +typedef __SIZE_TYPE__ size_t; + +#define NULL ((void *)0) + +extern void *malloc (size_t __size) + __attribute__ ((__nothrow__ , __leaf__)) + __attribute__ ((__malloc__)) + __attribute__ ((__alloc_size__ (1))); +extern void *realloc (void *__ptr, size_t __size) + __attribute__ ((__nothrow__ , __leaf__)) + __attribute__ ((__warn_unused_result__)) + __attribute__ ((__alloc_size__ (2))); +extern void free (void *__ptr) + __attribute__ ((__nothrow__ , __leaf__)); + +void *test_1 (void *ptr) +{ + return realloc (ptr, 1024); +} + +void *test_2 (void *ptr) +{ + void *p = malloc (1024); + p = realloc (p, 4096); + /* TODO: should warn about the leak when the above call fails (PR analyzer/99260). */ + free (p); +} + +void *test_3 (void *ptr) +{ + void *p = malloc (1024); + void *q = realloc (p, 4096); + if (q) + free (q); + else + free (p); +} + +void *test_4 (void) +{ + return realloc (NULL, 1024); +} + +int *test_5 (int *p) +{ + *p = 42; + int *q = realloc (p, sizeof(int) * 4); + *q = 43; /* { dg-warning "possibly-NULL 'q'" "PR analyzer/99260" { xfail *-*-* } } */ + return q; +} + +void test_6 (size_t sz) +{ + void *p = realloc (NULL, sz); +} /* { dg-warning "leak of 'p'" } */ diff --git a/gcc/testsuite/gcc.dg/analyzer/unknown-fns-4.c b/gcc/testsuite/gcc.dg/analyzer/unknown-fns-4.c index 3d8f82e..bd1ab1e 100644 --- a/gcc/testsuite/gcc.dg/analyzer/unknown-fns-4.c +++ b/gcc/testsuite/gcc.dg/analyzer/unknown-fns-4.c @@ -10,6 +10,6 @@ void test (void) got = 1; else if (got) - __analyzer_dump_path (); /* { dg-message "path" "" { xfail *-*-* } } */ + __analyzer_dump_path (); /* { dg-message "path" } */ } } diff --git a/gcc/testsuite/gcc.dg/analyzer/zlib-2.c b/gcc/testsuite/gcc.dg/analyzer/zlib-2.c index d0b587c..62163a0 100644 --- a/gcc/testsuite/gcc.dg/analyzer/zlib-2.c +++ b/gcc/testsuite/gcc.dg/analyzer/zlib-2.c @@ -1,5 +1,3 @@ -/* { dg-additional-options "-Wno-analyzer-too-complex" } */ - typedef void * (*alloc_func)(void * opaque, unsigned items, unsigned size); typedef void (*free_func)(void * opaque, void * address); diff --git a/gcc/testsuite/gcc.dg/array-quals-1.c b/gcc/testsuite/gcc.dg/array-quals-1.c index 5d9170e..2c04164 100644 --- a/gcc/testsuite/gcc.dg/array-quals-1.c +++ b/gcc/testsuite/gcc.dg/array-quals-1.c @@ -4,6 +4,7 @@ /* Origin: Joseph Myers <jsm@polyomino.org.uk> */ /* { dg-do compile } */ /* { dg-options "-Wno-discarded-array-qualifiers" } */ +/* { dg-additional-options "-fno-pie" { target pie } } */ /* The MMIX port always switches to the .data section at the end of a file. */ /* { dg-final { scan-assembler-not "\\.data(?!\\.rel\\.ro)" { xfail powerpc*-*-aix* mmix-*-* x86_64-*-mingw* } } } */ /* { dg-final { scan-assembler-symbol-section {^_?a$} {^\.(const|rodata|srodata)|\[RO\]} } } */ diff --git a/gcc/testsuite/gcc.dg/attr-assume_aligned-4.c b/gcc/testsuite/gcc.dg/attr-assume_aligned-4.c index 2571ab8..f6eb6dc 100644 --- a/gcc/testsuite/gcc.dg/attr-assume_aligned-4.c +++ b/gcc/testsuite/gcc.dg/attr-assume_aligned-4.c @@ -8,7 +8,7 @@ A (1) void fv_1 (void); /* { dg-warning ".assume_aligned. attribute ignore A (1) int fi_1 (void); /* { dg-warning ".assume_aligned. attribute ignored on a function returning .int." } */ -A (-1) void* fpv_m1 (void); /* { dg-warning ".assume_aligned. attribute argument -1 is not a power of 2" } */ +A (-1) void* fpv_m1 (void); /* { dg-warning ".assume_aligned. attribute argument -1 is not positive" } */ A (0) void* fpv_0 (void); /* { dg-warning ".assume_aligned. attribute argument 0 is not a power of 2" } */ @@ -23,7 +23,7 @@ A (16385) void* fpv_16kp1 (void); /* { dg-warning ".assume_aligned. attribute A (32767) void* fpv_32km1 (void); /* { dg-warning ".assume_aligned. attribute argument 32767 is not a power of 2" } */ -A (4, -1) void* fpv_4_m1 (void); /* { dg-warning ".assume_aligned. attribute argument -1 is not in the range \\\[0, 3]" } */ +A (4, -1) void* fpv_4_m1 (void); /* { dg-warning ".assume_aligned. attribute argument -1 is not positive" } */ A (4, 0) void* fpv_4_0 (void); A (4, 1) void* fpv_4_1 (void); diff --git a/gcc/testsuite/gcc.dg/attr-flatten-1.c b/gcc/testsuite/gcc.dg/attr-flatten-1.c index ecb08fc..68a194c 100644 --- a/gcc/testsuite/gcc.dg/attr-flatten-1.c +++ b/gcc/testsuite/gcc.dg/attr-flatten-1.c @@ -10,9 +10,20 @@ int fn1(int p1) } __attribute__((flatten)) __attribute__((alias("fn1"))) -int fn4(int p1); /* { dg-warning "ignored" } */ +int fn4(int p1); + +/* Again, but this time the target doesn't have the attribute. */ +int fn1a(int p1) +{ + int a = fn2(p1); + return fn3(a); +} +__attribute__((flatten)) +__attribute__((alias("fn1a"))) +int fn4a(int p1); /* { dg-warning "ignored" } */ + int test () { - return fn4(1); + return fn4(1)+fn4a(1); } diff --git a/gcc/testsuite/gcc.dg/cpp/line11.c b/gcc/testsuite/gcc.dg/cpp/line11.c new file mode 100644 index 0000000..67c6583 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/line11.c @@ -0,0 +1,6 @@ +/* PR c/99325 */ +/* { dg-do preprocess } */ +/* { dg-options "-pedantic" } */ + +#line 4294967295 /* { dg-warning "line number out of range" } */ +#pragma message "foo" diff --git a/gcc/testsuite/gcc.dg/cpp/line12.c b/gcc/testsuite/gcc.dg/cpp/line12.c new file mode 100644 index 0000000..c2e88f6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/line12.c @@ -0,0 +1,6 @@ +/* PR c/99325 */ +/* { dg-do preprocess } */ +/* { dg-options "-pedantic" } */ + +#line 9223372036854775807 /* { dg-warning "line number out of range" } */ +#pragma message "foo" diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/stacked-qualified-types-3.c b/gcc/testsuite/gcc.dg/debug/dwarf2/stacked-qualified-types-3.c index efa3fa0..98ee116 100644 --- a/gcc/testsuite/gcc.dg/debug/dwarf2/stacked-qualified-types-3.c +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/stacked-qualified-types-3.c @@ -31,4 +31,5 @@ char * _Atomic restrict h; char * _Atomic i; char * restrict j; -/* { dg-final { scan-assembler-times "DIE \\(\[^\n\]*\\) DW_TAG_(?:const|volatile|atomic|restrict)_type" 8 } } */ +/* The xfail is due to PR66668. */ +/* { dg-final { scan-assembler-times "DIE \\(\[^\n\]*\\) DW_TAG_(?:const|volatile|atomic|restrict)_type" 8 { xfail cris-*-* } } } */ diff --git a/gcc/testsuite/gcc.dg/fold-modpow2-2.c b/gcc/testsuite/gcc.dg/fold-modpow2-2.c new file mode 100644 index 0000000..803d527 --- /dev/null +++ b/gcc/testsuite/gcc.dg/fold-modpow2-2.c @@ -0,0 +1,47 @@ +/* PR tree-optimization/99079 */ +/* { dg-do compile { target { lp64 || ilp32 } } } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ + +unsigned int +foo1 (unsigned int a, unsigned int b) +{ + return a % (1 << b); +} + +int +foo2 (int b) +{ + return 371 % (1U << b); +} + +long long +foo3 (int b) +{ + return 371LL % (1U << b); +} + +unsigned long long +foo4 (unsigned long long a, int b) +{ + return a % (1U << b); +} + +unsigned +foo5 (unsigned a, int b) +{ + return a % (unsigned) (1ULL << b); +} + +int +foo6 (int b) +{ + return 371 % (int) (1ULL << b); +} + +long long +foo7 (int b) +{ + return 371LL % (1 << b); +} + +/* { dg-final { scan-tree-dump-not " % " "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/graphite/pr99085.c b/gcc/testsuite/gcc.dg/graphite/pr99085.c new file mode 100644 index 0000000..dc1c935 --- /dev/null +++ b/gcc/testsuite/gcc.dg/graphite/pr99085.c @@ -0,0 +1,20 @@ +/* PR target/99085 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fgraphite-identity -fsel-sched-pipelining -fselective-scheduling2" } */ + +void +foo (int m, int n, int o, int i) +{ + long double a2[m]; + int c2[n][o]; + int j, k; + + while (i < m) + a2[i++] = 13.132L; + + for (j = 0; j < n; j++) + for (k = 0; k < o; k++) + c2[j][k] = 1; + + __builtin_abort (); +} diff --git a/gcc/testsuite/gcc.dg/loop-9.c b/gcc/testsuite/gcc.dg/loop-9.c index 12f790a..44f7206 100644 --- a/gcc/testsuite/gcc.dg/loop-9.c +++ b/gcc/testsuite/gcc.dg/loop-9.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O1 -fdump-rtl-loop2_invariant" } */ +/* { dg-additional-options "-fno-pie" { target pie } } */ void f (double *a) diff --git a/gcc/testsuite/gcc.dg/pr97172-2.c b/gcc/testsuite/gcc.dg/pr97172-2.c new file mode 100644 index 0000000..99cc6c2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr97172-2.c @@ -0,0 +1,9 @@ +/* PR middle-end/97172 - ICE: tree code ‘ssa_name’ is not supported in LTO + streams + { dg-do link } + { dg-options "-Wall -flto -fpic -shared" } + { dg-require-effective-target fpic } + { dg-require-effective-target shared } + { dg-require-effective-target lto } */ + +#include "pr97172.c" diff --git a/gcc/testsuite/gcc.dg/pr97172.c b/gcc/testsuite/gcc.dg/pr97172.c index ab5b2e9..8ae6342 100644 --- a/gcc/testsuite/gcc.dg/pr97172.c +++ b/gcc/testsuite/gcc.dg/pr97172.c @@ -30,21 +30,52 @@ void fnp1_np1_np1 (int a[n + 1][n + 1][n + 1]); void gn (int a[n]) { fn (a); } void gnp1 (int a[n + 1]) { fnp1 (a); } +void gnd2p1 (int a[n / 2 + 1]) { fnp1 (a); } void gx_n (int a[][n]) { fx_n (a); } void gx_np1 (int a[][n + 1]) { fx_np1 (a); } +void gx_nd2p1 (int a[][n / 2 + 1]) { fx_np1 (a); } void g2_n (int a[2][n]) { f2_n (a); } void g2_np1 (int a[2][n + 1]) { f2_np1 (a); } +void g2_nd2p1 (int a[2][n / 2 + 1]) { f2_np1 (a); } void gn_3 (int a[n][3]) { fn_3 (a); } void gnp1_3 (int a[n + 1][3]) { fnp1_3 (a); } +void gnd2p1_3 (int a[n / 2 + 1][3]) { fnp1_3 (a); } void gn_n (int a[n][n]) { fn_n (a); } void gn_np1 (int a[n][n + 1]) { fn_np1 (a); } void gnp1_np1 (int a[n + 1][n + 1]) { fnp1_np1 (a); } +void gnd2p1_nd2p1 (int a[n / 2 + 1][n / 2 + 1]) { fnp1_np1 (a); } void gn_n_n (int a[n][n][n]) { fn_n_n (a); } void gn_n_np1 (int a[n][n][n + 1]) { fn_n_np1 (a); } void gn_np1_np1 (int a[n][n + 1][n + 1]) { fn_np1_np1 (a); } void gnp1_np1_np1 (int a[n + 1][n + 1][n + 1]) { fnp1_np1_np1 (a); } +void gnd2p1_nd2p1_nd2p1 (int a[n / 2 + 1][n / 2 + 1][n / 2 + 1]) +{ fnp1_np1_np1 (a); } + + +void fna3_1 (int n, + int a[n / 2 + 1], + int b[n / 2 + 1], + int c[n / 2 + 1]); + +void gna3_1 (int n, + int a[n / 2 + 1], + int b[n / 2 + 1], + int c[n / 2 + 1]) { fna3_1 (n, a, b, c); } + +void fna3_2_3_4 (int n, + int a[n / 2 + 1][n / 2 + 2], + int b[n / 2 + 1][n / 2 + 2][n / 2 + 3], + int c[n / 2 + 1][n / 2 + 2][n / 2 + 3][n / 2 + 4]); + +void gna3_2_3_4 (int n, + int a[n / 2 + 1][n / 2 + 2], + int b[n / 2 + 1][n / 2 + 2][n / 2 + 3], + int c[n / 2 + 1][n / 2 + 2][n / 2 + 3][n / 2 + 4]) +{ + fna3_2_3_4 (n, a, b, c); +} diff --git a/gcc/testsuite/gcc.dg/pr97954.c b/gcc/testsuite/gcc.dg/pr97954.c index 178e1d2..0be60f5 100644 --- a/gcc/testsuite/gcc.dg/pr97954.c +++ b/gcc/testsuite/gcc.dg/pr97954.c @@ -1,5 +1,5 @@ /* PR rtl-optimization/97954 */ -/* { dg-do compile } */ +/* { dg-do compile { target lra } } */ /* { dg-options "-O2" } */ int diff --git a/gcc/testsuite/gcc.dg/pr99104.c b/gcc/testsuite/gcc.dg/pr99104.c new file mode 100644 index 0000000..807e1da --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr99104.c @@ -0,0 +1,15 @@ +/* PR target/99104 */ +/* { dg-do compile { target int128 } } */ +/* { dg-options "-O2 -fsel-sched-pipelining -fselective-scheduling2 -funroll-loops" } */ + +__int128 a; +int b; +int foo (void); + +int __attribute__ ((simd)) +bar (void) +{ + a = ~a; + if (foo ()) + b = 0; +} diff --git a/gcc/testsuite/gcc.dg/pr99122-1.c b/gcc/testsuite/gcc.dg/pr99122-1.c new file mode 100644 index 0000000..5dfc0a8 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr99122-1.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -g -w" } */ + +void f () +{ + int n = 5; + struct { char a[n]; } x; + g (x, x); +} +int g (double x, double y) +{ + return __builtin_isgreater (x, y); +} diff --git a/gcc/testsuite/gcc.dg/pr99122-2.c b/gcc/testsuite/gcc.dg/pr99122-2.c new file mode 100644 index 0000000..2b10542 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr99122-2.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -g -w" } */ + +static int foo (); + +int +bar (int n) +{ + struct S { char a[n]; } x; + __builtin_memset (x.a, 0, n); + return foo (n, x); +} + +static inline int +foo (int n, struct T { char a[n]; } b) +{ + int r = 0, i; + for (i = 0; i < n; i++) + r += b.a[i]; + return r; +} diff --git a/gcc/testsuite/gcc.dg/pr99122-3.c b/gcc/testsuite/gcc.dg/pr99122-3.c new file mode 100644 index 0000000..6aa5b29 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr99122-3.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -g -fno-ipa-cp -w" } */ + +static int foo (); + +int +bar (int n) +{ + return foo (n, 2.0); +} + +static inline int +foo (int n, struct T { char a[n]; } b) +{ + int r = 0, i; + for (i = 0; i < n; i++) + r += b.a[i]; + return r; +} diff --git a/gcc/testsuite/gcc.dg/pr99136.c b/gcc/testsuite/gcc.dg/pr99136.c new file mode 100644 index 0000000..1bd8446 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr99136.c @@ -0,0 +1,9 @@ +/* PR c/99136 */ +/* { dg-do compile } */ +/* { dg-options "-w -fexcess-precision=standard" } */ + +void +foo (double x) +{ + return 1.0 / x; +} diff --git a/gcc/testsuite/gcc.dg/pr99224.c b/gcc/testsuite/gcc.dg/pr99224.c new file mode 100644 index 0000000..f6e9ac8 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr99224.c @@ -0,0 +1,6 @@ +/* { dg-do compile } */ + +void f (char *c, ...) +{ + __builtin_next_arg (*c); /* { dg-warning "not last named argument" } */ +} diff --git a/gcc/testsuite/gcc.dg/pr99323-1.c b/gcc/testsuite/gcc.dg/pr99323-1.c new file mode 100644 index 0000000..6fe1400 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr99323-1.c @@ -0,0 +1,17 @@ +/* Verify that fix-it printing doesn't ICE when there are multiple + fix-it hints on a very long line after LINE_MAP_MAX_COLUMN_NUMBER. */ + +/* { dg-options "-Wall -no-integrated-cpp -fdiagnostics-show-caret" } */ +/* { dg-allow-blank-lines-in-output 1 } */ +/* { dg-prune-output ".*" } */ + +typedef struct { +} REFERENCE; +#define LIM2() LIM1() +#define LIM3() LIM2() LIM2() LIM2() LIM2() LIM2() LIM2() +#define LIM4() \ + LIM3() LIM3() LIM3() LIM3() LIM3() LIM3() LIM3() LIM3() LIM3() LIM3() +#define LIM5() \ + LIM4() LIM4() LIM4() LIM4() LIM4() LIM4() LIM4() LIM4() LIM4() LIM4() +#define LIM1() DEF(), +REFERENCE references[] = {LIM5()}; diff --git a/gcc/testsuite/gcc.dg/pr99323-2.c b/gcc/testsuite/gcc.dg/pr99323-2.c new file mode 100644 index 0000000..d4075b6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr99323-2.c @@ -0,0 +1,11 @@ +/* Verify that fix-it printing doesn't ICE when there are multiple + fix-it hints on a very long line after LINE_MAP_MAX_COLUMN_NUMBER. */ + +/* { dg-options "-Wall -fdiagnostics-show-caret" } */ +/* { dg-allow-blank-lines-in-output 1 } */ +/* { dg-prune-output ".*" } */ + +typedef struct { +} REFERENCE; + +REFERENCE references[] = {DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(),} diff --git a/gcc/testsuite/gcc.dg/rtl/aarch64/multi-subreg-1.c b/gcc/testsuite/gcc.dg/rtl/aarch64/multi-subreg-1.c index d7be559..af53de2 100644 --- a/gcc/testsuite/gcc.dg/rtl/aarch64/multi-subreg-1.c +++ b/gcc/testsuite/gcc.dg/rtl/aarch64/multi-subreg-1.c @@ -1,3 +1,4 @@ +/* { dg-do compile { target aarch64-*-* } } */ /* { dg-additional-options "-O -fdump-rtl-cse1-all" } */ __int128 __RTL (startwith ("vregs")) foo (void) diff --git a/gcc/testsuite/gcc.dg/stack-usage-1.c b/gcc/testsuite/gcc.dg/stack-usage-1.c index be1254a..93cfe7c 100644 --- a/gcc/testsuite/gcc.dg/stack-usage-1.c +++ b/gcc/testsuite/gcc.dg/stack-usage-1.c @@ -103,6 +103,8 @@ #define SIZE 252 #elif defined (__csky__) # define SIZE 252 +#elif defined (__CRIS__) +# define SIZE 252 #else # define SIZE 256 #endif diff --git a/gcc/testsuite/gcc.dg/tree-prof/indir-call-prof-malloc.c b/gcc/testsuite/gcc.dg/tree-prof/indir-call-prof-malloc.c index 454e224..7bda4ae 100644 --- a/gcc/testsuite/gcc.dg/tree-prof/indir-call-prof-malloc.c +++ b/gcc/testsuite/gcc.dg/tree-prof/indir-call-prof-malloc.c @@ -1,4 +1,4 @@ -/* { dg-options "-O2 -ldl" } */ +/* { dg-options "-O2 -ldl -fprofile-correction" } */ #define _GNU_SOURCE #include <stdio.h> diff --git a/gcc/testsuite/gcc.dg/tree-prof/pr97461.c b/gcc/testsuite/gcc.dg/tree-prof/pr97461.c index 213fac9..f684be4d 100644 --- a/gcc/testsuite/gcc.dg/tree-prof/pr97461.c +++ b/gcc/testsuite/gcc.dg/tree-prof/pr97461.c @@ -1,5 +1,5 @@ /* PR gcov-profile/97461 */ -/* { dg-options "-O2 -ldl" } */ +/* { dg-options "-O2 -ldl -fprofile-correction" } */ #define _GNU_SOURCE diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr99142.c b/gcc/testsuite/gcc.dg/tree-ssa/pr99142.c new file mode 100644 index 0000000..1781a89 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr99142.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ +/* { dg-final { scan-tree-dump-not " >= 0\\)" "optimized" } } */ +int f(int a, int *b, int *d) +{ + int c = __builtin_clz(a); + + *b = c; + + if (c != 0) + *d = c; + + return c; +} diff --git a/gcc/testsuite/gcc.dg/tree-ssa/strncpy-2.c b/gcc/testsuite/gcc.dg/tree-ssa/strncpy-2.c index 2ef9cd6..e2216ab 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/strncpy-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/strncpy-2.c @@ -1,6 +1,6 @@ /* PR tree-optimization/83075 - Invalid strncpy optimization */ /* { dg-do run } */ -/* { dg-options "-O2 -Wstringop-overflow" } */ +/* { dg-options "-O2 -Wstringop-truncation" } */ typedef __SIZE_TYPE__ size_t; @@ -8,7 +8,7 @@ __attribute__((noipa)) size_t foo (char *p, char *q, size_t *r) { size_t n0 = __builtin_strlen (p); - __builtin_strncpy (q, p, n0); /* { dg-warning "specified bound depends on the length" } */ + __builtin_strncpy (q, p, n0); /* { dg-warning "\\\[-Wstringop-truncation" } */ size_t n1 = __builtin_strlen (p); *r = n0; return n1; diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-46.c b/gcc/testsuite/gcc.dg/vect/bb-slp-46.c index 8daa5c1..98b2906 100644 --- a/gcc/testsuite/gcc.dg/vect/bb-slp-46.c +++ b/gcc/testsuite/gcc.dg/vect/bb-slp-46.c @@ -24,5 +24,5 @@ int foo () /* { dg-final { scan-tree-dump "optimized: basic block" "slp2" } } */ /* { dg-final { scan-tree-dump "extracting lane for live stmt" "slp2" } } */ /* { dg-final { scan-tree-dump-times "extracting lane for live stmt" 2 "slp2" { xfail *-*-* } } } */ -/* { dg-final { scan-tree-dump-times " \\+ " 3 "optimized" } } */ -/* { dg-final { scan-tree-dump-times " \\+ " 2 "optimized" { xfail *-*-* } } } */ +/* { dg-final { scan-tree-dump-not "tem3_\[0-9\]\+ = " "optimized" } } */ +/* { dg-final { scan-tree-dump-not "tem0_\[0-9\]\+ = " "optimized" { xfail *-*-* } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/pr97428.c b/gcc/testsuite/gcc.dg/vect/pr97428.c index 49d5373..bbd743a 100644 --- a/gcc/testsuite/gcc.dg/vect/pr97428.c +++ b/gcc/testsuite/gcc.dg/vect/pr97428.c @@ -40,5 +40,7 @@ void foo_i2(dcmlx4_t dst[], const dcmlx_t src[], int n) load and store groups. */ /* { dg-final { scan-tree-dump "Detected interleaving load of size 8" "vect" } } */ /* { dg-final { scan-tree-dump "Detected interleaving store of size 16" "vect" } } */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" } } */ +/* We're not able to peel & apply re-aligning to make accesses well-aligned for !vect_hw_misalign, + but we could by peeling the stores for alignment and applying re-aligning loads. */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { xfail { ! vect_hw_misalign } } } } */ /* { dg-final { scan-tree-dump-not "gap of 6 elements" "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/pr99102.c b/gcc/testsuite/gcc.dg/vect/pr99102.c new file mode 100644 index 0000000..62d4d33 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr99102.c @@ -0,0 +1,20 @@ +/* { dg-options "-O2 -ftree-vectorize" } */ +/* { dg-additional-options "-msve-vector-bits=256" { target aarch64_sve256_hw } } */ +long a[44]; +short d, e = -7; +__attribute__((noipa)) void b(char f, short j, short k, unsigned l) { + for (int g = 0; g < 9; g += f) + for (int b = 0; b < 90; b -= k) + for (int h = 0; h < f; h++) + for (short i = 0; i < 15; i += 4) + if (!l) + a[i] = j; +} +int main() { + for (long c = 0; c < 2; ++c) + a[c] = 7; + b(9, d, e, 5); + if (!a[0]) + __builtin_abort(); +} +/* { dg-final { scan-tree-dump "MASK_SCATTER_STORE" "vect" { target aarch64_sve256_hw } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/pr99253.c b/gcc/testsuite/gcc.dg/vect/pr99253.c new file mode 100644 index 0000000..9e33450 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr99253.c @@ -0,0 +1,22 @@ +/* { dg-do run } */ + +#include "tree-vect.h" + +int a = 0; +static int b = 0; +long c = 0; + +int +main() +{ + check_vect (); + for (int d = 0; d < 8; d++) + { + a ^= c; + b = a; + a ^= 1; + } + if (a != 0 || b != 1) + __builtin_abort(); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/vect/slp-21.c b/gcc/testsuite/gcc.dg/vect/slp-21.c index 117d65c..bf8f434 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-21.c +++ b/gcc/testsuite/gcc.dg/vect/slp-21.c @@ -210,7 +210,7 @@ int main (void) Not all vect_perm targets support that, and it's a bit too specific to have its own effective-target selector, so we just test targets directly. */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 4 "vect" { target { aarch64*-*-* arm*-*-* } } } } */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target { vect_strided4 && { ! { aarch64*-*-* arm*-*-* } } } } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 4 "vect" { target { aarch64*-*-* arm*-*-* powerpc64*-*-* } } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target { vect_strided4 && { ! { aarch64*-*-* arm*-*-* powerpc64*-*-* } } } } } } */ /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target { ! { vect_strided4 } } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-complex-5.c b/gcc/testsuite/gcc.dg/vect/vect-complex-5.c index 0648637..81fdb67c 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-complex-5.c +++ b/gcc/testsuite/gcc.dg/vect/vect-complex-5.c @@ -40,4 +40,4 @@ main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { xfail { ! vect_hw_misalign } } } } */ diff --git a/gcc/testsuite/gcc.misc-tests/outputs.exp b/gcc/testsuite/gcc.misc-tests/outputs.exp index d5a9709..b2dd088 100644 --- a/gcc/testsuite/gcc.misc-tests/outputs.exp +++ b/gcc/testsuite/gcc.misc-tests/outputs.exp @@ -57,10 +57,18 @@ set gld [check_effective_target_gld] # We do not compile to an executable, because that requires naming an output. set link_options "" set dest [target_info name] +set skip_atsave 0 foreach i { ldflags libs ldscript } { if {[board_info $dest exists $i]} { set opts [board_info $dest $i] set nopts [gcc_adjust_linker_flags_list $opts] + + # Options -I<X> and -L<X> affect the behavior of @files + # wrt. temporary files. Skip @file -save-temps tests if we + # have any of them in the board-flags. + if { [string match "* -\[LI\]*" " $nopts"]} { + set skip_atsave 1 + } foreach opt $nopts { append link_options " additional_flags=$opt" } @@ -108,8 +116,16 @@ if [info exists env(MAKEFLAGS)] { # it weren't for # https://core.tcl-lang.org/tcl/tktview?name=5bbd044812), but .{i,s,o} # and .[iso] will pass even if only the .o is present. +array unset outests * proc outest { test sources opts dirs outputs } { global b srcdir subdir + global outests + + if { [info exists outests($test)] } { + error "multiple outputs.exp tests are named \"$test\", but for sanity, test-names must be unique" + } + set outests($test) 1 + set src {} foreach s $sources { lappend src $srcdir/$subdir/$b$s @@ -192,7 +208,7 @@ proc outest { test sources opts dirs outputs } { # collect2 may create <execname>.cdtor* files in -save-temps link tests, # ??? without regard to aux output naming conventions. # Limit this exception to targets that define EH_FRAME_THROUGH_COLLECT2. - if { !(([istarget powerpc*-*-aix*] || [is_target hppa*-*-hpux*]) + if { !(([istarget powerpc*-*-aix*] || [istarget hppa*-*-hpux*]) && ([string match "*.cdtor.*" $f] || [string match "*.gcc_args" $f])) } { lappend outb $f @@ -264,236 +280,238 @@ if { "$aout" != "" } then { } # Driver-chosen outputs. -outest "$b asm default 1" $sing "-S" {} {{-0.s}} -outest "$b asm default 2" $mult "-S" {} {{-1.s -2.s}} +outest "$b-1 asm default 1" $sing "-S" {} {{-0.s}} +outest "$b-2 asm default 2" $mult "-S" {} {{-1.s -2.s}} -outest "$b obj default 1" $sing "-c" {} {{-0.o}} -outest "$b obj default 2" $mult "-c" {} {{-1.o -2.o}} +outest "$b-3 obj default 1" $sing "-c" {} {{-0.o}} +outest "$b-4 obj default 2" $mult "-c" {} {{-1.o -2.o}} -outest "$b exe default 1" $sing "$oaout" {} {{$aout}} -outest "$b exe default 2" $mult "$oaout" {} {{$aout}} +outest "$b-5 exe default 1" $sing "$oaout" {} {{$aout}} +outest "$b-6 exe default 2" $mult "$oaout" {} {{$aout}} # Driver-chosen aux outputs. -outest "$b asm savetmp 1" $sing "-S -save-temps" {} {{-0.i -0.s}} -outest "$b asm savetmp 2" $mult "-S -save-temps" {} {{-1.i -1.s -2.i -2.s}} -outest "$b obj savetmp unnamed1" $sing "-c -save-temps" {} {{-0.i -0.s -0.o}} -outest "$b obj savetmp unnamed2" $mult "-c -save-temps" {} {{-1.i -1.s -1.o -2.i -2.s -2.o}} +outest "$b-7 asm savetmp 1" $sing "-S -save-temps" {} {{-0.i -0.s}} +outest "$b-8 asm savetmp 2" $mult "-S -save-temps" {} {{-1.i -1.s -2.i -2.s}} +outest "$b-9 obj savetmp unnamed1" $sing "-c -save-temps" {} {{-0.i -0.s -0.o}} +outest "$b-10 obj savetmp unnamed2" $mult "-c -save-temps" {} {{-1.i -1.s -1.o -2.i -2.s -2.o}} # Aux outputs computed within the driver, based on output name (and # input). -outest "$b cpp savetmp named0" $sing "-E -o $b-0.i -save-temps" {} {{-0.i}} -outest "$b asm savetmp named0" $sing "-S -o $b-0.s -save-temps" {} {{-0.i -0.s}} -outest "$b obj savetmp named0" $sing "-c -o $b-0.o -save-temps" {} {{-0.i -0.s -0.o}} -outest "$b cpp savetmp namedb" $sing "-E -o $b.i -save-temps" {} {{.i}} -outest "$b asm savetmp namedb" $sing "-S -o $b.s -save-temps" {} {{.i .s}} -outest "$b obj savetmp namedb" $sing "-c -o $b.o -save-temps" {} {{.i .s .o}} +outest "$b-11 cpp savetmp named0" $sing "-E -o $b-0.i -save-temps" {} {{-0.i}} +outest "$b-12 asm savetmp named0" $sing "-S -o $b-0.s -save-temps" {} {{-0.i -0.s}} +outest "$b-13 obj savetmp named0" $sing "-c -o $b-0.o -save-temps" {} {{-0.i -0.s -0.o}} +outest "$b-14 cpp savetmp namedb" $sing "-E -o $b.i -save-temps" {} {{.i}} +outest "$b-15 asm savetmp namedb" $sing "-S -o $b.s -save-temps" {} {{.i .s}} +outest "$b-16 obj savetmp namedb" $sing "-c -o $b.o -save-temps" {} {{.i .s .o}} # When linking, the executable name gets prepended to aux output # basenames, except when executable and single input share the same # basename. -outest "$b exe savetmp unnamed1" $sing "-save-temps $oaout" {} {{a--0.i a--0.s a--0.o $aout}} -outest "$b exe savetmp unnamed2" $mult "-save-temps $oaout" {} {{a--1.i a--1.s a--1.o a--2.i a--2.s a--2.o $aout}} -outest "$b exe savetmp named0" $sing "-o $b-0.exe -save-temps" {} {{-0.i -0.s -0.o -0.exe}} -outest "$b exe savetmp namedb" $sing "-o $b.exe -save-temps" {} {{--0.i --0.s --0.o .exe}} -outest "$b exe savetmp named2" $mult "-o $b.exe -save-temps" {} {{--1.i --1.s --1.o --2.i --2.s --2.o .exe}} +outest "$b-17 exe savetmp unnamed1" $sing "-save-temps $oaout" {} {{a--0.i a--0.s a--0.o $aout}} +outest "$b-18 exe savetmp unnamed2" $mult "-save-temps $oaout" {} {{a--1.i a--1.s a--1.o a--2.i a--2.s a--2.o $aout}} +outest "$b-19 exe savetmp named0" $sing "-o $b-0.exe -save-temps" {} {{-0.i -0.s -0.o -0.exe}} +outest "$b-20 exe savetmp namedb" $sing "-o $b.exe -save-temps" {} {{--0.i --0.s --0.o .exe}} +outest "$b-21 exe savetmp named2" $mult "-o $b.exe -save-temps" {} {{--1.i --1.s --1.o --2.i --2.s --2.o .exe}} # Additional files are created when an @file is used -outest "$b exe savetmp namedb" $sing "@/dev/null -o $b.exe -save-temps" {} {{--0.i --0.s --0.o .args.0 !!$gld .ld1_args !0 .exe}} -outest "$b exe savetmp named2" $mult "@/dev/null -o $b.exe -save-temps" {} {{--1.i --1.s --1.o --2.i --2.s --2.o .args.0 !!$gld .ld1_args !0 .exe}} -outest "$b exe savetmp named2" $mult "@/dev/null -I dummy -o $b.exe -save-temps" {} {{--1.i --1.s --1.o --2.i --2.s --2.o -args.0 -args.1 .args.2 !!$gld .ld1_args !0 .exe}} -outest "$b exe savetmp named2" $mult "@/dev/null -I dummy -L dummy -o $b.exe -save-temps" {} {{--1.i --1.s --1.o --2.i --2.s --2.o -args.0 -args.1 .args.2 .args.3 !!$gld .ld1_args !0 .exe}} +if !$skip_atsave { +outest "$b-22 exe savetmp namedb-2" $sing "@/dev/null -o $b.exe -save-temps" {} {{--0.i --0.s --0.o .args.0 !!$gld .ld1_args !0 .exe}} +outest "$b-23 exe savetmp named2-2" $mult "@/dev/null -o $b.exe -save-temps" {} {{--1.i --1.s --1.o --2.i --2.s --2.o .args.0 !!$gld .ld1_args !0 .exe}} +outest "$b-24 exe savetmp named2-3" $mult "@/dev/null -I dummy -o $b.exe -save-temps" {} {{--1.i --1.s --1.o --2.i --2.s --2.o -args.0 -args.1 .args.2 !!$gld .ld1_args !0 .exe}} +outest "$b-25 exe savetmp named2-4" $mult "@/dev/null -I dummy -L dummy -o $b.exe -save-temps" {} {{--1.i --1.s --1.o --2.i --2.s --2.o -args.0 -args.1 .args.2 .args.3 !!$gld .ld1_args !0 .exe}} +} # Setting the main output to a dir selects it as the default aux&dump # location. -outest "$b cpp savetmp namedir0" $sing "-E -o o/$b-0.i -save-temps" {o/} {{-0.i} {}} -outest "$b asm savetmp namedir0" $sing "-S -o o/$b-0.s -save-temps" {o/} {{-0.i -0.s} {}} -outest "$b obj savetmp namedir0" $sing "-c -o o/$b-0.o -save-temps" {o/} {{-0.i -0.s -0.o} {}} -outest "$b cpp savetmp namedir" $sing "-E -o o/$b.i -save-temps" {o/} {{.i} {}} -outest "$b asm savetmp namedir" $sing "-S -o o/$b.s -save-temps" {o/} {{.i .s} {}} -outest "$b obj savetmp namedir" $sing "-c -o o/$b.o -save-temps" {o/} {{.i .s .o} {}} -outest "$b exe savetmp namedir0" $sing "-o o/$b-0.exe -save-temps" {o/} {{-0.i -0.s -0.o -0.exe} {}} -outest "$b exe savetmp namedirb" $sing "-o o/$b.exe -save-temps" {o/} {{--0.i --0.s --0.o .exe} {}} -outest "$b exe savetmp namedir2" $mult "-o o/$b.exe -save-temps" {o/} {{--1.i --1.s --1.o --2.i --2.s --2.o .exe} {}} +outest "$b-26 cpp savetmp namedir0" $sing "-E -o o/$b-0.i -save-temps" {o/} {{-0.i} {}} +outest "$b-27 asm savetmp namedir0" $sing "-S -o o/$b-0.s -save-temps" {o/} {{-0.i -0.s} {}} +outest "$b-28 obj savetmp namedir0" $sing "-c -o o/$b-0.o -save-temps" {o/} {{-0.i -0.s -0.o} {}} +outest "$b-29 cpp savetmp namedir" $sing "-E -o o/$b.i -save-temps" {o/} {{.i} {}} +outest "$b-30 asm savetmp namedir" $sing "-S -o o/$b.s -save-temps" {o/} {{.i .s} {}} +outest "$b-31 obj savetmp namedir" $sing "-c -o o/$b.o -save-temps" {o/} {{.i .s .o} {}} +outest "$b-32 exe savetmp namedir0" $sing "-o o/$b-0.exe -save-temps" {o/} {{-0.i -0.s -0.o -0.exe} {}} +outest "$b-33 exe savetmp namedirb" $sing "-o o/$b.exe -save-temps" {o/} {{--0.i --0.s --0.o .exe} {}} +outest "$b-34 exe savetmp namedir2" $mult "-o o/$b.exe -save-temps" {o/} {{--1.i --1.s --1.o --2.i --2.s --2.o .exe} {}} # -save-temps=cwd overrides the aux output location to the current dir. -outest "$b obj savecwd unnamed1" $sing "-c -save-temps=cwd" {} {{-0.i -0.s -0.o}} -outest "$b obj savecwd unnamed2" $mult "-c -save-temps=cwd" {} {{-1.i -1.s -1.o -2.i -2.s -2.o}} -outest "$b cpp savecwd named0" $sing "-E -o $b-0.i -save-temps=cwd" {} {{-0.i}} -outest "$b asm savecwd named0" $sing "-S -o $b-0.s -save-temps=cwd" {} {{-0.i -0.s}} -outest "$b obj savecwd named0" $sing "-c -o $b-0.o -save-temps=cwd" {} {{-0.i -0.s -0.o}} -outest "$b cpp savecwd namedb" $sing "-E -o $b.i -save-temps=cwd" {} {{.i}} -outest "$b asm savecwd namedb" $sing "-S -o $b.s -save-temps=cwd" {} {{.i .s}} -outest "$b obj savecwd namedb" $sing "-c -o $b.o -save-temps=cwd" {} {{.i .s .o}} -outest "$b exe savecwd unnamed1" $sing "-save-temps=cwd $oaout" {} {{a--0.i a--0.s a--0.o $aout}} -outest "$b exe savecwd unnamed2" $mult "-save-temps=cwd $oaout" {} {{a--1.i a--1.s a--1.o a--2.i a--2.s a--2.o $aout}} -outest "$b exe savecwd named0" $sing "-o $b-0.exe -save-temps=cwd" {} {{-0.i -0.s -0.o -0.exe}} -outest "$b exe savecwd namedb" $sing "-o $b.exe -save-temps=cwd" {} {{--0.i --0.s --0.o .exe}} -outest "$b exe savecwd named2" $mult "-o $b.exe -save-temps=cwd" {} {{--1.i --1.s --1.o --2.i --2.s --2.o .exe}} - -outest "$b cpp savecwd namedir0" $sing "-E -o o/$b-0.i -save-temps=cwd" {o/} {{-0.i} {}} -outest "$b asm savecwd namedir0" $sing "-S -o o/$b-0.s -save-temps=cwd" {o/} {{-0.s} {-0.i}} -outest "$b obj savecwd namedir0" $sing "-c -o o/$b-0.o -save-temps=cwd" {o/} {{-0.o} {-0.i -0.s}} -outest "$b cpp savecwd namedir" $sing "-E -o o/$b.i -save-temps=cwd" {o/} {{.i} {}} -outest "$b asm savecwd namedir" $sing "-S -o o/$b.s -save-temps=cwd" {o/} {{.s} {.i}} -outest "$b obj savecwd namedir" $sing "-c -o o/$b.o -save-temps=cwd" {o/} {{.o} {.i .s}} -outest "$b exe savecwd namedir0" $sing "-o o/$b-0.exe -save-temps=cwd" {o/} {{-0.exe} {-0.i -0.s -0.o}} -outest "$b exe savecwd namedirb" $sing "-o o/$b.exe -save-temps=cwd" {o/} {{.exe} {--0.i --0.s --0.o}} -outest "$b exe savecwd namedir2" $mult "-o o/$b.exe -save-temps=cwd" {o/} {{.exe} {--1.i --1.s --1.o --2.i --2.s --2.o}} +outest "$b-35 obj savecwd unnamed1" $sing "-c -save-temps=cwd" {} {{-0.i -0.s -0.o}} +outest "$b-36 obj savecwd unnamed2" $mult "-c -save-temps=cwd" {} {{-1.i -1.s -1.o -2.i -2.s -2.o}} +outest "$b-37 cpp savecwd named0" $sing "-E -o $b-0.i -save-temps=cwd" {} {{-0.i}} +outest "$b-38 asm savecwd named0" $sing "-S -o $b-0.s -save-temps=cwd" {} {{-0.i -0.s}} +outest "$b-39 obj savecwd named0" $sing "-c -o $b-0.o -save-temps=cwd" {} {{-0.i -0.s -0.o}} +outest "$b-40 cpp savecwd namedb" $sing "-E -o $b.i -save-temps=cwd" {} {{.i}} +outest "$b-41 asm savecwd namedb" $sing "-S -o $b.s -save-temps=cwd" {} {{.i .s}} +outest "$b-42 obj savecwd namedb" $sing "-c -o $b.o -save-temps=cwd" {} {{.i .s .o}} +outest "$b-43 exe savecwd unnamed1" $sing "-save-temps=cwd $oaout" {} {{a--0.i a--0.s a--0.o $aout}} +outest "$b-44 exe savecwd unnamed2" $mult "-save-temps=cwd $oaout" {} {{a--1.i a--1.s a--1.o a--2.i a--2.s a--2.o $aout}} +outest "$b-45 exe savecwd named0" $sing "-o $b-0.exe -save-temps=cwd" {} {{-0.i -0.s -0.o -0.exe}} +outest "$b-46 exe savecwd namedb" $sing "-o $b.exe -save-temps=cwd" {} {{--0.i --0.s --0.o .exe}} +outest "$b-47 exe savecwd named2" $mult "-o $b.exe -save-temps=cwd" {} {{--1.i --1.s --1.o --2.i --2.s --2.o .exe}} + +outest "$b-48 cpp savecwd namedir0" $sing "-E -o o/$b-0.i -save-temps=cwd" {o/} {{-0.i} {}} +outest "$b-49 asm savecwd namedir0" $sing "-S -o o/$b-0.s -save-temps=cwd" {o/} {{-0.s} {-0.i}} +outest "$b-50 obj savecwd namedir0" $sing "-c -o o/$b-0.o -save-temps=cwd" {o/} {{-0.o} {-0.i -0.s}} +outest "$b-51 cpp savecwd namedir" $sing "-E -o o/$b.i -save-temps=cwd" {o/} {{.i} {}} +outest "$b-52 asm savecwd namedir" $sing "-S -o o/$b.s -save-temps=cwd" {o/} {{.s} {.i}} +outest "$b-53 obj savecwd namedir" $sing "-c -o o/$b.o -save-temps=cwd" {o/} {{.o} {.i .s}} +outest "$b-54 exe savecwd namedir0" $sing "-o o/$b-0.exe -save-temps=cwd" {o/} {{-0.exe} {-0.i -0.s -0.o}} +outest "$b-55 exe savecwd namedirb" $sing "-o o/$b.exe -save-temps=cwd" {o/} {{.exe} {--0.i --0.s --0.o}} +outest "$b-56 exe savecwd namedir2" $mult "-o o/$b.exe -save-temps=cwd" {o/} {{.exe} {--1.i --1.s --1.o --2.i --2.s --2.o}} # -save-temps=obj overrides the aux output location to that of the # main output -outest "$b obj saveobj unnamed1" $sing "-c -save-temps=obj" {} {{-0.i -0.s -0.o}} -outest "$b obj saveobj unnamed2" $mult "-c -save-temps=obj" {} {{-1.i -1.s -1.o -2.i -2.s -2.o}} -outest "$b cpp saveobj named0" $sing "-E -o $b-0.i -save-temps=obj" {} {{-0.i}} -outest "$b asm saveobj named0" $sing "-S -o $b-0.s -save-temps=obj" {} {{-0.i -0.s}} -outest "$b obj saveobj named0" $sing "-c -o $b-0.o -save-temps=obj" {} {{-0.i -0.s -0.o}} -outest "$b cpp saveobj namedb" $sing "-E -o $b.i -save-temps=obj" {} {{.i}} -outest "$b asm saveobj namedb" $sing "-S -o $b.s -save-temps=obj" {} {{.i .s}} -outest "$b obj saveobj namedb" $sing "-c -o $b.o -save-temps=obj" {} {{.i .s .o}} -outest "$b exe saveobj unnamed1" $sing "-save-temps=obj $oaout" {} {{a--0.i a--0.s a--0.o $aout}} -outest "$b exe saveobj unnamed2" $mult "-save-temps=obj $oaout" {} {{a--1.i a--1.s a--1.o a--2.i a--2.s a--2.o $aout}} -outest "$b exe saveobj named0" $sing "-o $b-0.exe -save-temps=obj" {} {{-0.i -0.s -0.o -0.exe}} -outest "$b exe saveobj namedb" $sing "-o $b.exe -save-temps=obj" {} {{--0.i --0.s --0.o .exe}} -outest "$b exe saveobj named2" $mult "-o $b.exe -save-temps=obj" {} {{--1.i --1.s --1.o --2.i --2.s --2.o .exe}} - -outest "$b cpp saveobj namedir0" $sing "-E -o o/$b-0.i -save-temps=obj" {o/} {{-0.i} {}} -outest "$b asm saveobj namedir0" $sing "-S -o o/$b-0.s -save-temps=obj" {o/} {{-0.i -0.s} {}} -outest "$b obj saveobj namedir0" $sing "-c -o o/$b-0.o -save-temps=obj" {o/} {{-0.i -0.s -0.o} {}} -outest "$b cpp saveobj namedir" $sing "-E -o o/$b.i -save-temps=obj" {o/} {{.i} {}} -outest "$b asm saveobj namedir" $sing "-S -o o/$b.s -save-temps=obj" {o/} {{.i .s} {}} -outest "$b obj saveobj namedir" $sing "-c -o o/$b.o -save-temps=obj" {o/} {{.i .s .o} {}} -outest "$b exe saveobj namedir0" $sing "-o o/$b-0.exe -save-temps=obj" {o/} {{-0.i -0.s -0.o -0.exe} {}} -outest "$b exe saveobj namedirb" $sing "-o o/$b.exe -save-temps=obj" {o/} {{--0.i --0.s --0.o .exe} {}} -outest "$b exe saveobj namedir2" $mult "-o o/$b.exe -save-temps=obj" {o/} {{--1.i --1.s --1.o --2.i --2.s --2.o .exe} {}} +outest "$b-57 obj saveobj unnamed1" $sing "-c -save-temps=obj" {} {{-0.i -0.s -0.o}} +outest "$b-58 obj saveobj unnamed2" $mult "-c -save-temps=obj" {} {{-1.i -1.s -1.o -2.i -2.s -2.o}} +outest "$b-59 cpp saveobj named0" $sing "-E -o $b-0.i -save-temps=obj" {} {{-0.i}} +outest "$b-60 asm saveobj named0" $sing "-S -o $b-0.s -save-temps=obj" {} {{-0.i -0.s}} +outest "$b-61 obj saveobj named0" $sing "-c -o $b-0.o -save-temps=obj" {} {{-0.i -0.s -0.o}} +outest "$b-62 cpp saveobj namedb" $sing "-E -o $b.i -save-temps=obj" {} {{.i}} +outest "$b-63 asm saveobj namedb" $sing "-S -o $b.s -save-temps=obj" {} {{.i .s}} +outest "$b-64 obj saveobj namedb" $sing "-c -o $b.o -save-temps=obj" {} {{.i .s .o}} +outest "$b-65 exe saveobj unnamed1" $sing "-save-temps=obj $oaout" {} {{a--0.i a--0.s a--0.o $aout}} +outest "$b-66 exe saveobj unnamed2" $mult "-save-temps=obj $oaout" {} {{a--1.i a--1.s a--1.o a--2.i a--2.s a--2.o $aout}} +outest "$b-67 exe saveobj named0" $sing "-o $b-0.exe -save-temps=obj" {} {{-0.i -0.s -0.o -0.exe}} +outest "$b-68 exe saveobj namedb" $sing "-o $b.exe -save-temps=obj" {} {{--0.i --0.s --0.o .exe}} +outest "$b-69 exe saveobj named2" $mult "-o $b.exe -save-temps=obj" {} {{--1.i --1.s --1.o --2.i --2.s --2.o .exe}} + +outest "$b-70 cpp saveobj namedir0" $sing "-E -o o/$b-0.i -save-temps=obj" {o/} {{-0.i} {}} +outest "$b-71 asm saveobj namedir0" $sing "-S -o o/$b-0.s -save-temps=obj" {o/} {{-0.i -0.s} {}} +outest "$b-72 obj saveobj namedir0" $sing "-c -o o/$b-0.o -save-temps=obj" {o/} {{-0.i -0.s -0.o} {}} +outest "$b-73 cpp saveobj namedir" $sing "-E -o o/$b.i -save-temps=obj" {o/} {{.i} {}} +outest "$b-74 asm saveobj namedir" $sing "-S -o o/$b.s -save-temps=obj" {o/} {{.i .s} {}} +outest "$b-75 obj saveobj namedir" $sing "-c -o o/$b.o -save-temps=obj" {o/} {{.i .s .o} {}} +outest "$b-76 exe saveobj namedir0" $sing "-o o/$b-0.exe -save-temps=obj" {o/} {{-0.i -0.s -0.o -0.exe} {}} +outest "$b-77 exe saveobj namedirb" $sing "-o o/$b.exe -save-temps=obj" {o/} {{--0.i --0.s --0.o .exe} {}} +outest "$b-78 exe saveobj namedir2" $mult "-o o/$b.exe -save-temps=obj" {o/} {{--1.i --1.s --1.o --2.i --2.s --2.o .exe} {}} # Check -dumpdir overriding by -save-temps=*, and -save-temps # non-overriding, with one catch: the presence of a given dumpdir, # even if ultimately overridden, still disables the prepending of the # executable basename to the aux&dump output basenames (or rather the # appending of the executable basename to the dumpdir). -outest "$b exe sobjovr namedir0" $sing "-o o/$b-0.exe -dumpdir no/ -save-temps=obj -save-temps" {o/} {{-0.i -0.s -0.o -0.exe} {}} -outest "$b exe sobjovr namedirb" $sing "-o o/$b.exe -dumpdir no/ -save-temps=obj -save-temps" {o/} {{-0.i -0.s -0.o .exe} {}} -outest "$b exe sobjovr namedir2" $mult "-o o/$b.exe -dumpdir no/ -save-temps=obj -save-temps" {o/} {{-1.i -1.s -1.o -2.i -2.s -2.o .exe} {}} -outest "$b exe scwdovr namedir0" $sing "-o o/$b-0.exe -dumpdir o/ -save-temps=cwd -save-temps" {o/} {{-0.exe} {-0.i -0.s -0.o}} -outest "$b exe scwdovr namedirb" $sing "-o o/$b.exe -dumpdir o/ -save-temps=cwd -save-temps" {o/} {{.exe} {-0.i -0.s -0.o}} -outest "$b exe scwdovr namedir2" $mult "-o o/$b.exe -dumpdir o/ -save-temps=cwd -save-temps" {o/} {{.exe} {-1.i -1.s -1.o -2.i -2.s -2.o}} -outest "$b exe ddstovr namedir0" $sing "-o $b-0.exe -dumpdir o/ -save-temps" {o/} {{-0.i -0.s -0.o} {-0.exe}} -outest "$b exe ddstovr namedirb" $sing "-o $b.exe -dumpdir o/ -save-temps" {o/} {{-0.i -0.s -0.o} {.exe}} -outest "$b exe ddstovr namedir2" $mult "-o $b.exe -dumpdir o/ -save-temps" {o/} {{-1.i -1.s -1.o -2.i -2.s -2.o} {.exe}} +outest "$b-79 exe sobjovr namedir0" $sing "-o o/$b-0.exe -dumpdir no/ -save-temps=obj -save-temps" {o/} {{-0.i -0.s -0.o -0.exe} {}} +outest "$b-80 exe sobjovr namedirb" $sing "-o o/$b.exe -dumpdir no/ -save-temps=obj -save-temps" {o/} {{-0.i -0.s -0.o .exe} {}} +outest "$b-81 exe sobjovr namedir2" $mult "-o o/$b.exe -dumpdir no/ -save-temps=obj -save-temps" {o/} {{-1.i -1.s -1.o -2.i -2.s -2.o .exe} {}} +outest "$b-82 exe scwdovr namedir0" $sing "-o o/$b-0.exe -dumpdir o/ -save-temps=cwd -save-temps" {o/} {{-0.exe} {-0.i -0.s -0.o}} +outest "$b-83 exe scwdovr namedirb" $sing "-o o/$b.exe -dumpdir o/ -save-temps=cwd -save-temps" {o/} {{.exe} {-0.i -0.s -0.o}} +outest "$b-84 exe scwdovr namedir2" $mult "-o o/$b.exe -dumpdir o/ -save-temps=cwd -save-temps" {o/} {{.exe} {-1.i -1.s -1.o -2.i -2.s -2.o}} +outest "$b-85 exe ddstovr namedir0" $sing "-o $b-0.exe -dumpdir o/ -save-temps" {o/} {{-0.i -0.s -0.o} {-0.exe}} +outest "$b-86 exe ddstovr namedirb" $sing "-o $b.exe -dumpdir o/ -save-temps" {o/} {{-0.i -0.s -0.o} {.exe}} +outest "$b-87 exe ddstovr namedir2" $mult "-o $b.exe -dumpdir o/ -save-temps" {o/} {{-1.i -1.s -1.o -2.i -2.s -2.o} {.exe}} # Check -dumpdir prevailing over -save-temps*. Even though -dumpdir # overrides the -save-temps=* directory selection, -save-temps remains # enabled. -outest "$b exe soddovr namedir0" $sing "-o o/$b-0.exe -save-temps=obj -dumpdir ./" {o/} {{-0.exe} {-0.i -0.s -0.o}} -outest "$b exe soddovr namedirb" $sing "-o o/$b.exe -save-temps=obj -dumpdir ./" {o/} {{.exe} {-0.i -0.s -0.o}} -outest "$b exe soddovr namedir2" $mult "-o o/$b.exe -save-temps=obj -dumpdir ./" {o/} {{.exe} {-1.i -1.s -1.o -2.i -2.s -2.o}} -outest "$b exe scddovr namedir0" $sing "-o o/$b-0.exe -save-temps=cwd -dumpdir o/" {o/} {{-0.i -0.s -0.o -0.exe} {}} -outest "$b exe scddovr namedirb" $sing "-o o/$b.exe -save-temps=cwd -dumpdir o/" {o/} {{-0.i -0.s -0.o .exe} {}} -outest "$b exe scddovr namedir2" $mult "-o o/$b.exe -save-temps=cwd -dumpdir o/" {o/} {{-1.i -1.s -1.o -2.i -2.s -2.o .exe} {}} -outest "$b exe ddstovr namedir0" $sing "-o $b-0.exe -save-temps -dumpdir o/" {o/} {{-0.i -0.s -0.o} {-0.exe}} -outest "$b exe ddstovr namedirb" $sing "-o $b.exe -save-temps -dumpdir o/" {o/} {{-0.i -0.s -0.o} {.exe}} -outest "$b exe ddstovr namedir2" $mult "-o $b.exe -save-temps -dumpdir o/" {o/} {{-1.i -1.s -1.o -2.i -2.s -2.o} {.exe}} +outest "$b-88 exe soddovr namedir0" $sing "-o o/$b-0.exe -save-temps=obj -dumpdir ./" {o/} {{-0.exe} {-0.i -0.s -0.o}} +outest "$b-89 exe soddovr namedirb" $sing "-o o/$b.exe -save-temps=obj -dumpdir ./" {o/} {{.exe} {-0.i -0.s -0.o}} +outest "$b-90 exe soddovr namedir2" $mult "-o o/$b.exe -save-temps=obj -dumpdir ./" {o/} {{.exe} {-1.i -1.s -1.o -2.i -2.s -2.o}} +outest "$b-91 exe scddovr namedir0" $sing "-o o/$b-0.exe -save-temps=cwd -dumpdir o/" {o/} {{-0.i -0.s -0.o -0.exe} {}} +outest "$b-92 exe scddovr namedirb" $sing "-o o/$b.exe -save-temps=cwd -dumpdir o/" {o/} {{-0.i -0.s -0.o .exe} {}} +outest "$b-93 exe scddovr namedir2" $mult "-o o/$b.exe -save-temps=cwd -dumpdir o/" {o/} {{-1.i -1.s -1.o -2.i -2.s -2.o .exe} {}} +outest "$b-94 exe ddstovr namedir0-2" $sing "-o $b-0.exe -save-temps -dumpdir o/" {o/} {{-0.i -0.s -0.o} {-0.exe}} +outest "$b-95 exe ddstovr namedirb-2" $sing "-o $b.exe -save-temps -dumpdir o/" {o/} {{-0.i -0.s -0.o} {.exe}} +outest "$b-96 exe ddstovr namedir2-2" $mult "-o $b.exe -save-temps -dumpdir o/" {o/} {{-1.i -1.s -1.o -2.i -2.s -2.o} {.exe}} # Compiler- and driver-generated aux and dump outputs. # -fdump-rtl-final creates a .c.???r.final dump in the compiler. # -fstack-usage creates a .su aux output in the compiler. # $gsplit_dwarf extracts a .dwo aux output from the .o in the driver. -outest "$b asm auxdump 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{-0.c.???r.final -0.su -0.s}} -outest "$b asm auxdump 2" $mult "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{-1.c.???r.final -1.su -1.s -2.c.???r.final -2.su -2.s}} -outest "$b obj auxdump unnamed1" $sing "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{-0.c.???r.final -0.su !!$gspd -0.dwo !0 -0.o}} -outest "$b obj auxdump unnamed2" $mult "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{-1.c.???r.final -1.su !!$gspd -1.dwo !0 -1.o -2.c.???r.final -2.su !!$gspd -2.dwo !0 -2.o}} - -outest "$b cpp auxdump named0" $sing "-E -o $b-0.i -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{-0.i}} -outest "$b asm auxdump named0" $sing "-S -o $b-0.s -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{-0.c.???r.final -0.su -0.s}} -outest "$b obj auxdump named0" $sing "-c -o $b-0.o -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{-0.c.???r.final -0.su !!$gspd -0.dwo !0 -0.o}} -outest "$b cpp auxdump namedb" $sing "-E -o $b.i -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{.i}} -outest "$b asm auxdump namedb" $sing "-S -o $b.s -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{.c.???r.final .su .s}} -outest "$b obj auxdump namedb" $sing "-c -o $b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{.c.???r.final .su !!$gspd .dwo !0 .o}} - -outest "$b exe auxdump unnamed1" $sing "-fdump-rtl-final -fstack-usage $gsplit_dwarf $oaout" {} {{a--0.c.???r.final a--0.su !!$gspd a--0.dwo !0 $aout}} -outest "$b exe auxdump unnamed2" $mult "-fdump-rtl-final -fstack-usage $gsplit_dwarf $oaout" {} {{a--1.c.???r.final a--1.su !!$gspd a--1.dwo !0 a--2.c.???r.final a--2.su !!$gspd a--2.dwo !0 $aout}} -outest "$b exe auxdump named0" $sing "-o $b-0.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{-0.c.???r.final -0.su !!$gspd -0.dwo !0 -0.exe}} -outest "$b exe auxdump namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{--0.c.???r.final --0.su !!$gspd --0.dwo !0 .exe}} -outest "$b exe auxdump named2" $mult "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo !0 .exe}} - -outest "$b cpp auxdump namedir0" $sing "-E -o o/$b-0.i -fdump-rtl-final -fstack-usage $gsplit_dwarf" {o/} {{-0.i} {}} -outest "$b asm auxdump namedir0" $sing "-S -o o/$b-0.s -fdump-rtl-final -fstack-usage $gsplit_dwarf" {o/} {{-0.c.???r.final -0.su -0.s} {}} -outest "$b obj auxdump namedir0" $sing "-c -o o/$b-0.o -fdump-rtl-final -fstack-usage $gsplit_dwarf" {o/} {{-0.c.???r.final -0.su !!$gspd -0.dwo !0 -0.o} {}} -outest "$b cpp auxdump namedir" $sing "-E -o o/$b.i -fdump-rtl-final -fstack-usage $gsplit_dwarf" {o/} {{.i} {}} -outest "$b asm auxdump namedir" $sing "-S -o o/$b.s -fdump-rtl-final -fstack-usage $gsplit_dwarf" {o/} {{.c.???r.final .su .s} {}} -outest "$b obj auxdump namedir" $sing "-c -o o/$b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf" {o/} {{.c.???r.final .su !!$gspd .dwo !0 .o} {}} -outest "$b exe auxdump namedir0" $sing "-o o/$b-0.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf" {o/} {{-0.c.???r.final -0.su !!$gspd -0.dwo !0 -0.exe} {}} -outest "$b exe auxdump namedirb" $sing "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf" {o/} {{--0.c.???r.final --0.su !!$gspd --0.dwo !0 .exe} {}} -outest "$b exe auxdump namedir2" $mult "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf" {o/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo !0 .exe} {}} +outest "$b-97 asm auxdump 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{-0.c.???r.final -0.su -0.s}} +outest "$b-98 asm auxdump 2" $mult "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{-1.c.???r.final -1.su -1.s -2.c.???r.final -2.su -2.s}} +outest "$b-99 obj auxdump unnamed1" $sing "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{-0.c.???r.final -0.su !!$gspd -0.dwo !0 -0.o}} +outest "$b-100 obj auxdump unnamed2" $mult "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{-1.c.???r.final -1.su !!$gspd -1.dwo !0 -1.o -2.c.???r.final -2.su !!$gspd -2.dwo !0 -2.o}} + +outest "$b-101 cpp auxdump named0" $sing "-E -o $b-0.i -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{-0.i}} +outest "$b-102 asm auxdump named0" $sing "-S -o $b-0.s -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{-0.c.???r.final -0.su -0.s}} +outest "$b-103 obj auxdump named0" $sing "-c -o $b-0.o -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{-0.c.???r.final -0.su !!$gspd -0.dwo !0 -0.o}} +outest "$b-104 cpp auxdump namedb" $sing "-E -o $b.i -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{.i}} +outest "$b-105 asm auxdump namedb" $sing "-S -o $b.s -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{.c.???r.final .su .s}} +outest "$b-106 obj auxdump namedb" $sing "-c -o $b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{.c.???r.final .su !!$gspd .dwo !0 .o}} + +outest "$b-107 exe auxdump unnamed1" $sing "-fdump-rtl-final -fstack-usage $gsplit_dwarf $oaout" {} {{a--0.c.???r.final a--0.su !!$gspd a--0.dwo !0 $aout}} +outest "$b-108 exe auxdump unnamed2" $mult "-fdump-rtl-final -fstack-usage $gsplit_dwarf $oaout" {} {{a--1.c.???r.final a--1.su !!$gspd a--1.dwo !0 a--2.c.???r.final a--2.su !!$gspd a--2.dwo !0 $aout}} +outest "$b-109 exe auxdump named0" $sing "-o $b-0.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{-0.c.???r.final -0.su !!$gspd -0.dwo !0 -0.exe}} +outest "$b-110 exe auxdump namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{--0.c.???r.final --0.su !!$gspd --0.dwo !0 .exe}} +outest "$b-111 exe auxdump named2" $mult "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo !0 .exe}} + +outest "$b-112 cpp auxdump namedir0" $sing "-E -o o/$b-0.i -fdump-rtl-final -fstack-usage $gsplit_dwarf" {o/} {{-0.i} {}} +outest "$b-113 asm auxdump namedir0" $sing "-S -o o/$b-0.s -fdump-rtl-final -fstack-usage $gsplit_dwarf" {o/} {{-0.c.???r.final -0.su -0.s} {}} +outest "$b-114 obj auxdump namedir0" $sing "-c -o o/$b-0.o -fdump-rtl-final -fstack-usage $gsplit_dwarf" {o/} {{-0.c.???r.final -0.su !!$gspd -0.dwo !0 -0.o} {}} +outest "$b-115 cpp auxdump namedir" $sing "-E -o o/$b.i -fdump-rtl-final -fstack-usage $gsplit_dwarf" {o/} {{.i} {}} +outest "$b-116 asm auxdump namedir" $sing "-S -o o/$b.s -fdump-rtl-final -fstack-usage $gsplit_dwarf" {o/} {{.c.???r.final .su .s} {}} +outest "$b-117 obj auxdump namedir" $sing "-c -o o/$b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf" {o/} {{.c.???r.final .su !!$gspd .dwo !0 .o} {}} +outest "$b-118 exe auxdump namedir0" $sing "-o o/$b-0.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf" {o/} {{-0.c.???r.final -0.su !!$gspd -0.dwo !0 -0.exe} {}} +outest "$b-119 exe auxdump namedirb" $sing "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf" {o/} {{--0.c.???r.final --0.su !!$gspd --0.dwo !0 .exe} {}} +outest "$b-120 exe auxdump namedir2" $mult "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf" {o/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo !0 .exe} {}} # Check that -save-temps doesn't break compiler aux or dumps as it # changes temp file names. -outest "$b asm auxdmps 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {} {{-0.i -0.c.???r.final -0.su -0.s}} -outest "$b asm auxdmps 2" $mult "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {} {{-1.i -1.c.???r.final -1.su -1.s -2.i -2.c.???r.final -2.su -2.s}} -outest "$b obj auxdmps unnamed1" $sing "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {} {{-0.i -0.c.???r.final -0.su -0.s !!$gspd -0.dwo !0 -0.o}} -outest "$b obj auxdmps unnamed2" $mult "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {} {{-1.i -1.c.???r.final -1.su -1.s !!$gspd -1.dwo !0 -1.o -2.i -2.c.???r.final -2.su -2.s !!$gspd -2.dwo !0 -2.o}} - -outest "$b cpp auxdmps named0" $sing "-E -o $b-0.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {} {{-0.i}} -outest "$b asm auxdmps named0" $sing "-S -o $b-0.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {} {{-0.i -0.c.???r.final -0.su -0.s}} -outest "$b obj auxdmps named0" $sing "-c -o $b-0.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {} {{-0.i -0.c.???r.final -0.su -0.s !!$gspd -0.dwo !0 -0.o}} -outest "$b cpp auxdmps namedb" $sing "-E -o $b.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {} {{.i}} -outest "$b asm auxdmps namedb" $sing "-S -o $b.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {} {{.i .c.???r.final .su .s}} -outest "$b obj auxdmps namedb" $sing "-c -o $b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {} {{.i .c.???r.final .su .s !!$gspd .dwo !0 .o}} - -outest "$b exe auxdmps unnamed1" $sing "-fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps $oaout" {} {{a--0.i a--0.c.???r.final a--0.su a--0.s !!$gspd a--0.dwo !0 a--0.o $aout}} -outest "$b exe auxdmps unnamed2" $mult "-fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps $oaout" {} {{a--1.i a--1.c.???r.final a--1.su a--1.s !!$gspd a--1.dwo !0 a--1.o a--2.i a--2.c.???r.final a--2.su a--2.s !!$gspd a--2.dwo !0 a--2.o $aout}} -outest "$b exe auxdmps named0" $sing "-o $b-0.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {} {{-0.i -0.c.???r.final -0.su -0.s !!$gspd -0.dwo !0 -0.o -0.exe}} -outest "$b exe auxdmps namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {} {{--0.i --0.c.???r.final --0.su --0.s !!$gspd --0.dwo !0 --0.o .exe}} -outest "$b exe auxdmps named2" $mult "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {} {{--1.i --1.c.???r.final --1.su --1.s !!$gspd --1.dwo !0 --1.o --2.i --2.c.???r.final --2.su --2.s !!$gspd --2.dwo !0 --2.o .exe}} - -outest "$b cpp auxdmps namedir0" $sing "-E -o o/$b-0.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {o/} {{-0.i} {}} -outest "$b asm auxdmps namedir0" $sing "-S -o o/$b-0.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {o/} {{-0.i -0.c.???r.final -0.su -0.s} {}} -outest "$b obj auxdmps namedir0" $sing "-c -o o/$b-0.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {o/} {{-0.i -0.c.???r.final -0.su -0.s !!$gspd -0.dwo !0 -0.o} {}} -outest "$b cpp auxdmps namedir" $sing "-E -o o/$b.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {o/} {{.i} {}} -outest "$b asm auxdmps namedir" $sing "-S -o o/$b.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {o/} {{.i .c.???r.final .su .s} {}} -outest "$b obj auxdmps namedir" $sing "-c -o o/$b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {o/} {{.i .c.???r.final .su .s !!$gspd .dwo !0 .o} {}} -outest "$b exe auxdmps namedir0" $sing "-o o/$b-0.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {o/} {{-0.i -0.c.???r.final -0.su -0.s !!$gspd -0.dwo !0 -0.o -0.exe} {}} -outest "$b exe auxdmps namedirb" $sing "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {o/} {{--0.i --0.c.???r.final --0.su --0.s !!$gspd --0.dwo !0 --0.o .exe} {}} -outest "$b exe auxdmps namedir2" $mult "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {o/} {{--1.i --1.c.???r.final --1.su --1.s !!$gspd --1.dwo !0 --1.o --2.i --2.c.???r.final --2.su --2.s !!$gspd --2.dwo !0 --2.o .exe} {}} +outest "$b-121 asm auxdmps 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {} {{-0.i -0.c.???r.final -0.su -0.s}} +outest "$b-122 asm auxdmps 2" $mult "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {} {{-1.i -1.c.???r.final -1.su -1.s -2.i -2.c.???r.final -2.su -2.s}} +outest "$b-123 obj auxdmps unnamed1" $sing "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {} {{-0.i -0.c.???r.final -0.su -0.s !!$gspd -0.dwo !0 -0.o}} +outest "$b-124 obj auxdmps unnamed2" $mult "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {} {{-1.i -1.c.???r.final -1.su -1.s !!$gspd -1.dwo !0 -1.o -2.i -2.c.???r.final -2.su -2.s !!$gspd -2.dwo !0 -2.o}} + +outest "$b-125 cpp auxdmps named0" $sing "-E -o $b-0.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {} {{-0.i}} +outest "$b-126 asm auxdmps named0" $sing "-S -o $b-0.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {} {{-0.i -0.c.???r.final -0.su -0.s}} +outest "$b-127 obj auxdmps named0" $sing "-c -o $b-0.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {} {{-0.i -0.c.???r.final -0.su -0.s !!$gspd -0.dwo !0 -0.o}} +outest "$b-128 cpp auxdmps namedb" $sing "-E -o $b.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {} {{.i}} +outest "$b-129 asm auxdmps namedb" $sing "-S -o $b.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {} {{.i .c.???r.final .su .s}} +outest "$b-130 obj auxdmps namedb" $sing "-c -o $b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {} {{.i .c.???r.final .su .s !!$gspd .dwo !0 .o}} + +outest "$b-131 exe auxdmps unnamed1" $sing "-fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps $oaout" {} {{a--0.i a--0.c.???r.final a--0.su a--0.s !!$gspd a--0.dwo !0 a--0.o $aout}} +outest "$b-132 exe auxdmps unnamed2" $mult "-fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps $oaout" {} {{a--1.i a--1.c.???r.final a--1.su a--1.s !!$gspd a--1.dwo !0 a--1.o a--2.i a--2.c.???r.final a--2.su a--2.s !!$gspd a--2.dwo !0 a--2.o $aout}} +outest "$b-133 exe auxdmps named0" $sing "-o $b-0.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {} {{-0.i -0.c.???r.final -0.su -0.s !!$gspd -0.dwo !0 -0.o -0.exe}} +outest "$b-134 exe auxdmps namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {} {{--0.i --0.c.???r.final --0.su --0.s !!$gspd --0.dwo !0 --0.o .exe}} +outest "$b-135 exe auxdmps named2" $mult "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {} {{--1.i --1.c.???r.final --1.su --1.s !!$gspd --1.dwo !0 --1.o --2.i --2.c.???r.final --2.su --2.s !!$gspd --2.dwo !0 --2.o .exe}} + +outest "$b-136 cpp auxdmps namedir0" $sing "-E -o o/$b-0.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {o/} {{-0.i} {}} +outest "$b-137 asm auxdmps namedir0" $sing "-S -o o/$b-0.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {o/} {{-0.i -0.c.???r.final -0.su -0.s} {}} +outest "$b-138 obj auxdmps namedir0" $sing "-c -o o/$b-0.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {o/} {{-0.i -0.c.???r.final -0.su -0.s !!$gspd -0.dwo !0 -0.o} {}} +outest "$b-139 cpp auxdmps namedir" $sing "-E -o o/$b.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {o/} {{.i} {}} +outest "$b-140 asm auxdmps namedir" $sing "-S -o o/$b.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {o/} {{.i .c.???r.final .su .s} {}} +outest "$b-141 obj auxdmps namedir" $sing "-c -o o/$b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {o/} {{.i .c.???r.final .su .s !!$gspd .dwo !0 .o} {}} +outest "$b-142 exe auxdmps namedir0" $sing "-o o/$b-0.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {o/} {{-0.i -0.c.???r.final -0.su -0.s !!$gspd -0.dwo !0 -0.o -0.exe} {}} +outest "$b-143 exe auxdmps namedirb" $sing "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {o/} {{--0.i --0.c.???r.final --0.su --0.s !!$gspd --0.dwo !0 --0.o .exe} {}} +outest "$b-144 exe auxdmps namedir2" $mult "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -save-temps" {o/} {{--1.i --1.c.???r.final --1.su --1.s !!$gspd --1.dwo !0 --1.o --2.i --2.c.???r.final --2.su --2.s !!$gspd --2.dwo !0 --2.o .exe} {}} # Check that dumpdir changes the location of non-primary outputs -outest "$b asm dumpdir 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/} {{-0.c.???r.final -0.su} {-0.s}} -outest "$b asm dumpdir 2" $mult "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/} {{-1.c.???r.final -1.su -2.c.???r.final -2.su} {-1.s -2.s}} -outest "$b obj dumpdir unnamed1" $sing "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/} {{-0.c.???r.final -0.su !!$gspd -0.dwo} {-0.o}} -outest "$b obj dumpdir unnamed2" $mult "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/} {{-1.c.???r.final -1.su !!$gspd -1.dwo !0 -2.c.???r.final -2.su !!$gspd -2.dwo} {-1.o -2.o}} - -outest "$b cpp dumpdir named0" $sing "-E -o $b-0.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/} {{} {-0.i}} -outest "$b asm dumpdir named0" $sing "-S -o $b-0.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/} {{-0.c.???r.final -0.su} {-0.s}} -outest "$b obj dumpdir named0" $sing "-c -o $b-0.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/} {{-0.c.???r.final -0.su !!$gspd -0.dwo} {-0.o}} -outest "$b cpp dumpdir namedb" $sing "-E -o $b.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/} {{} {.i}} -outest "$b asm dumpdir namedb" $sing "-S -o $b.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/} {{.c.???r.final .su} {.s}} -outest "$b obj dumpdir namedb" $sing "-c -o $b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/} {{.c.???r.final .su !!$gspd .dwo} {.o}} - -outest "$b exe dumpdir unnamed1" $sing "-fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/a- $oaout" {od/} {{a--0.c.???r.final a--0.su !!$gspd a--0.dwo} {$aout}} -outest "$b exe dumpdir unnamed2" $mult "-fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/a- $oaout" {od/} {{a--1.c.???r.final a--1.su !!$gspd a--1.dwo !0 a--2.c.???r.final a--2.su !!$gspd a--2.dwo} {$aout}} -outest "$b exe dumpdir named0" $sing "-o $b-0.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/} {{-0.c.???r.final -0.su !!$gspd -0.dwo} {-0.exe}} -outest "$b exe dumpdir namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/} {{-0.c.???r.final -0.su !!$gspd -0.dwo} {.exe}} -outest "$b exe dumpdir named2" $mult "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/} {{-1.c.???r.final -1.su !!$gspd -1.dwo !0 -2.c.???r.final -2.su !!$gspd -2.dwo} {.exe}} -outest "$b exe dumpdira namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/a-" {od/} {{a--0.c.???r.final a--0.su !!$gspd a--0.dwo} {.exe}} -outest "$b exe dumpdira named2" $mult "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/a-" {od/} {{a--1.c.???r.final a--1.su !!$gspd a--1.dwo !0 a--2.c.???r.final a--2.su !!$gspd a--2.dwo} {.exe}} -outest "$b exe dumpdirb namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/$b-" {od/} {{--0.c.???r.final --0.su !!$gspd --0.dwo} {.exe}} -outest "$b exe dumpdirb named2" $mult "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/$b-" {od/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo} {.exe}} - -outest "$b cpp dumpdir namedir0" $sing "-E -o o/$b-0.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/ o/} {{} {-0.i} {}} -outest "$b asm dumpdir namedir0" $sing "-S -o o/$b-0.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/ o/} {{-0.c.???r.final -0.su} {-0.s} {}} -outest "$b obj dumpdir namedir0" $sing "-c -o o/$b-0.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/ o/} {{-0.c.???r.final -0.su !!$gspd -0.dwo} {-0.o} {}} -outest "$b cpp dumpdir namedir" $sing "-E -o o/$b.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/ o/} {{} {.i} {}} -outest "$b asm dumpdir namedir" $sing "-S -o o/$b.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/ o/} {{.c.???r.final .su} {.s} {}} -outest "$b obj dumpdir namedir" $sing "-c -o o/$b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/ o/} {{.c.???r.final .su !!$gspd .dwo} {.o} {}} -outest "$b exe dumpdir namedir0" $sing "-o o/$b-0.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/ o/} {{-0.c.???r.final -0.su !!$gspd -0.dwo} {-0.exe} {}} -outest "$b exe dumpdir namedirb" $sing "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/ o/} {{-0.c.???r.final -0.su !!$gspd -0.dwo} {.exe} {}} -outest "$b exe dumpdir namedir2" $mult "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/ o/} {{-1.c.???r.final -1.su !!$gspd -1.dwo !0 -2.c.???r.final -2.su !!$gspd -2.dwo} {.exe} {}} -outest "$b exe dumpdira namedirb" $sing "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/a-" {od/ o/} {{a--0.c.???r.final a--0.su !!$gspd a--0.dwo} {.exe} {}} -outest "$b exe dumpdira namedir2" $mult "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/a-" {od/ o/} {{a--1.c.???r.final a--1.su !!$gspd a--1.dwo !0 a--2.c.???r.final a--2.su !!$gspd a--2.dwo} {.exe} {}} -outest "$b exe dumpdirb namedirb" $sing "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/$b-" {od/ o/} {{--0.c.???r.final --0.su !!$gspd --0.dwo} {.exe} {}} -outest "$b exe dumpdirb namedir2" $mult "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/$b-" {od/ o/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo} {.exe} {}} +outest "$b-145 asm dumpdir 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/} {{-0.c.???r.final -0.su} {-0.s}} +outest "$b-146 asm dumpdir 2" $mult "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/} {{-1.c.???r.final -1.su -2.c.???r.final -2.su} {-1.s -2.s}} +outest "$b-147 obj dumpdir unnamed1" $sing "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/} {{-0.c.???r.final -0.su !!$gspd -0.dwo} {-0.o}} +outest "$b-148 obj dumpdir unnamed2" $mult "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/} {{-1.c.???r.final -1.su !!$gspd -1.dwo !0 -2.c.???r.final -2.su !!$gspd -2.dwo} {-1.o -2.o}} + +outest "$b-149 cpp dumpdir named0" $sing "-E -o $b-0.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/} {{} {-0.i}} +outest "$b-150 asm dumpdir named0" $sing "-S -o $b-0.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/} {{-0.c.???r.final -0.su} {-0.s}} +outest "$b-151 obj dumpdir named0" $sing "-c -o $b-0.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/} {{-0.c.???r.final -0.su !!$gspd -0.dwo} {-0.o}} +outest "$b-152 cpp dumpdir namedb" $sing "-E -o $b.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/} {{} {.i}} +outest "$b-153 asm dumpdir namedb" $sing "-S -o $b.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/} {{.c.???r.final .su} {.s}} +outest "$b-154 obj dumpdir namedb" $sing "-c -o $b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/} {{.c.???r.final .su !!$gspd .dwo} {.o}} + +outest "$b-155 exe dumpdir unnamed1" $sing "-fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/a- $oaout" {od/} {{a--0.c.???r.final a--0.su !!$gspd a--0.dwo} {$aout}} +outest "$b-156 exe dumpdir unnamed2" $mult "-fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/a- $oaout" {od/} {{a--1.c.???r.final a--1.su !!$gspd a--1.dwo !0 a--2.c.???r.final a--2.su !!$gspd a--2.dwo} {$aout}} +outest "$b-157 exe dumpdir named0" $sing "-o $b-0.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/} {{-0.c.???r.final -0.su !!$gspd -0.dwo} {-0.exe}} +outest "$b-158 exe dumpdir namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/} {{-0.c.???r.final -0.su !!$gspd -0.dwo} {.exe}} +outest "$b-159 exe dumpdir named2" $mult "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/} {{-1.c.???r.final -1.su !!$gspd -1.dwo !0 -2.c.???r.final -2.su !!$gspd -2.dwo} {.exe}} +outest "$b-160 exe dumpdira namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/a-" {od/} {{a--0.c.???r.final a--0.su !!$gspd a--0.dwo} {.exe}} +outest "$b-161 exe dumpdira named2" $mult "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/a-" {od/} {{a--1.c.???r.final a--1.su !!$gspd a--1.dwo !0 a--2.c.???r.final a--2.su !!$gspd a--2.dwo} {.exe}} +outest "$b-162 exe dumpdirb namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/$b-" {od/} {{--0.c.???r.final --0.su !!$gspd --0.dwo} {.exe}} +outest "$b-163 exe dumpdirb named2" $mult "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/$b-" {od/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo} {.exe}} + +outest "$b-164 cpp dumpdir namedir0" $sing "-E -o o/$b-0.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/ o/} {{} {-0.i} {}} +outest "$b-165 asm dumpdir namedir0" $sing "-S -o o/$b-0.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/ o/} {{-0.c.???r.final -0.su} {-0.s} {}} +outest "$b-166 obj dumpdir namedir0" $sing "-c -o o/$b-0.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/ o/} {{-0.c.???r.final -0.su !!$gspd -0.dwo} {-0.o} {}} +outest "$b-167 cpp dumpdir namedir" $sing "-E -o o/$b.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/ o/} {{} {.i} {}} +outest "$b-168 asm dumpdir namedir" $sing "-S -o o/$b.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/ o/} {{.c.???r.final .su} {.s} {}} +outest "$b-169 obj dumpdir namedir" $sing "-c -o o/$b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/ o/} {{.c.???r.final .su !!$gspd .dwo} {.o} {}} +outest "$b-170 exe dumpdir namedir0" $sing "-o o/$b-0.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/ o/} {{-0.c.???r.final -0.su !!$gspd -0.dwo} {-0.exe} {}} +outest "$b-171 exe dumpdir namedirb" $sing "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/ o/} {{-0.c.???r.final -0.su !!$gspd -0.dwo} {.exe} {}} +outest "$b-172 exe dumpdir namedir2" $mult "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/" {od/ o/} {{-1.c.???r.final -1.su !!$gspd -1.dwo !0 -2.c.???r.final -2.su !!$gspd -2.dwo} {.exe} {}} +outest "$b-173 exe dumpdira namedirb" $sing "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/a-" {od/ o/} {{a--0.c.???r.final a--0.su !!$gspd a--0.dwo} {.exe} {}} +outest "$b-174 exe dumpdira namedir2" $mult "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/a-" {od/ o/} {{a--1.c.???r.final a--1.su !!$gspd a--1.dwo !0 a--2.c.???r.final a--2.su !!$gspd a--2.dwo} {.exe} {}} +outest "$b-175 exe dumpdirb namedirb" $sing "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/$b-" {od/ o/} {{--0.c.???r.final --0.su !!$gspd --0.dwo} {.exe} {}} +outest "$b-176 exe dumpdirb namedir2" $mult "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/$b-" {od/ o/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo} {.exe} {}} # Check that a -dumpbase with a dir component disregards the -dumpdir # prefix. Also, start testing -dumpbase-ext to distinguish between @@ -505,90 +523,90 @@ outest "$b exe dumpdirb namedir2" $mult "-o o/$b.exe -fdump-rtl-final -fstack-us # for them all), or when linking (the specified dumpbase is then used # as prefix instead of the linker output, and a new dumpbase is # computed per source). -outest "$b asm dbsovrdd 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/} {{.???r.final .su} {-0.s}} -outest "$b asm dbsovrddx 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b.c -dumpbase-ext .c" {od/} {{.c.???r.final .su} {-0.s}} -outest "$b asm dbsovrdd-x 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b.c" {od/} {{.c.???r.final .c.su} {-0.s}} -outest "$b asm dbsovrdd.x 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b.x" {od/} {{.x.???r.final .x.su} {-0.s}} -outest "$b asm dbsovrdd 2" $mult "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/} {{--1.c.???r.final --1.su --2.c.???r.final --2.su} {-1.s -2.s}} -outest "$b asm dbsovrddx 2" $mult "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b.x -dumpbase-ext .x" {od/} {{--1.c.???r.final --1.su --2.c.???r.final --2.su} {-1.s -2.s}} -outest "$b obj dbsovrdd unnamed1" $sing "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/} {{.???r.final .su !!$gspd .dwo} {-0.o}} -outest "$b obj dbsovrddx unnamed1" $sing "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b.c -dumpbase-ext .c" {od/} {{.c.???r.final .su !!$gspd .dwo} {-0.o}} -outest "$b obj dbsovrdd unnamed2" $mult "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo} {-1.o -2.o}} - -outest "$b cpp dbsovrdd named0" $sing "-E -o $b-0.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/} {{} {-0.i}} -outest "$b asm dbsovrdd named0" $sing "-S -o $b-0.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/} {{.???r.final .su} {-0.s}} -outest "$b obj dbsovrdd named0" $sing "-c -o $b-0.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/} {{.???r.final .su !!$gspd .dwo} {-0.o}} -outest "$b cpp dbsovrdd namedb" $sing "-E -o $b.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/} {{} {.i}} -outest "$b asm dbsovrdd namedb" $sing "-S -o $b.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/} {{.???r.final .su} {.s}} -outest "$b obj dbsovrdd namedb" $sing "-c -o $b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/} {{.???r.final .su !!$gspd .dwo} {.o}} +outest "$b-177 asm dbsovrdd 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/} {{.???r.final .su} {-0.s}} +outest "$b-178 asm dbsovrddx 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b.c -dumpbase-ext .c" {od/} {{.c.???r.final .su} {-0.s}} +outest "$b-179 asm dbsovrdd-x 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b.c" {od/} {{.c.???r.final .c.su} {-0.s}} +outest "$b-180 asm dbsovrdd.x 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b.x" {od/} {{.x.???r.final .x.su} {-0.s}} +outest "$b-181 asm dbsovrdd 2" $mult "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/} {{--1.c.???r.final --1.su --2.c.???r.final --2.su} {-1.s -2.s}} +outest "$b-182 asm dbsovrddx 2" $mult "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b.x -dumpbase-ext .x" {od/} {{--1.c.???r.final --1.su --2.c.???r.final --2.su} {-1.s -2.s}} +outest "$b-183 obj dbsovrdd unnamed1" $sing "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/} {{.???r.final .su !!$gspd .dwo} {-0.o}} +outest "$b-184 obj dbsovrddx unnamed1" $sing "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b.c -dumpbase-ext .c" {od/} {{.c.???r.final .su !!$gspd .dwo} {-0.o}} +outest "$b-185 obj dbsovrdd unnamed2" $mult "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo} {-1.o -2.o}} + +outest "$b-186 cpp dbsovrdd named0" $sing "-E -o $b-0.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/} {{} {-0.i}} +outest "$b-187 asm dbsovrdd named0" $sing "-S -o $b-0.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/} {{.???r.final .su} {-0.s}} +outest "$b-188 obj dbsovrdd named0" $sing "-c -o $b-0.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/} {{.???r.final .su !!$gspd .dwo} {-0.o}} +outest "$b-189 cpp dbsovrdd namedb" $sing "-E -o $b.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/} {{} {.i}} +outest "$b-190 asm dbsovrdd namedb" $sing "-S -o $b.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/} {{.???r.final .su} {.s}} +outest "$b-191 obj dbsovrdd namedb" $sing "-c -o $b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/} {{.???r.final .su !!$gspd .dwo} {.o}} # Nit: -dumpdir affects whether the specified dumpbase is combined # into dumpdir or taken as the output basename, even if dumpbase will # ultimately override it. -outest "$b exe dbsovrdd unnamed1" $sing "-fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b $oaout" {od/} {{.???r.final .su !!$gspd .dwo} {$aout}} -outest "$b exe dbsovrdd unnamed2" $mult "-fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/a $oaout" {od/} {{a--1.c.???r.final a--1.su !!$gspd a--1.dwo !0 a--2.c.???r.final a--2.su !!$gspd a--2.dwo} {$aout}} -outest "$b exe dbsovrdd named0" $sing "-o $b-0.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/} {{.???r.final .su !!$gspd .dwo} {-0.exe}} -outest "$b exe dbsovrdd namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b.exe -dumpbase-ext .exe" {od/} {{.exe.???r.final .su !!$gspd .dwo} {.exe}} -outest "$b exe dbsovrdd named2" $mult "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo} {.exe}} -outest "$b exe dbsovrdda namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/a" {od/} {{a.???r.final a.su !!$gspd a.dwo} {.exe}} -outest "$b exe dbsovrddac namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/a.c -dumpbase-ext .c" {od/} {{a.c.???r.final a.su !!$gspd a.dwo} {.exe}} -outest "$b exe dbsovrdda named2" $mult "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/a" {od/} {{a--1.c.???r.final a--1.su !!$gspd a--1.dwo !0 a--2.c.???r.final a--2.su !!$gspd a--2.dwo} {.exe}} - -outest "$b cpp dbsovrdd namedir0" $sing "-E -o o/$b-0.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/ o/} {{} {-0.i} {}} -outest "$b asm dbsovrdd namedir0" $sing "-S -o o/$b-0.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/ o/} {{.???r.final .su} {-0.s} {}} -outest "$b obj dbsovrdd namedir0" $sing "-c -o o/$b-0.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/ o/} {{.???r.final .su !!$gspd .dwo} {-0.o} {}} -outest "$b cpp dbsovrdd namedir" $sing "-E -o o/$b.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/ o/} {{} {.i} {}} -outest "$b asm dbsovrdd namedir" $sing "-S -o o/$b.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/ o/} {{.???r.final .su} {.s} {}} -outest "$b obj dbsovrdd namedir" $sing "-c -o o/$b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/ o/} {{.???r.final .su !!$gspd .dwo} {.o} {}} -outest "$b exe dbsovrdd namedir0" $sing "-o o/$b-0.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/ o/} {{.???r.final .su !!$gspd .dwo} {-0.exe} {}} -outest "$b exe dbsovrdd namedirb" $sing "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b.exe -dumpbase-ext .exe" {od/ o/} {{.exe.???r.final .su !!$gspd .dwo} {.exe} {}} -outest "$b exe dbsovrdd namedir2" $mult "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/ o/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo} {.exe} {}} -outest "$b exe dbsovrdda namedirb" $sing "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/a" {od/ o/} {{a.???r.final a.su !!$gspd a.dwo} {.exe} {}} -outest "$b exe dbsovrdda namedir2" $mult "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/a" {od/ o/} {{a--1.c.???r.final a--1.su !!$gspd a--1.dwo !0 a--2.c.???r.final a--2.su !!$gspd a--2.dwo} {.exe} {}} +outest "$b-192 exe dbsovrdd unnamed1" $sing "-fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b $oaout" {od/} {{.???r.final .su !!$gspd .dwo} {$aout}} +outest "$b-193 exe dbsovrdd unnamed2" $mult "-fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/a $oaout" {od/} {{a--1.c.???r.final a--1.su !!$gspd a--1.dwo !0 a--2.c.???r.final a--2.su !!$gspd a--2.dwo} {$aout}} +outest "$b-194 exe dbsovrdd named0" $sing "-o $b-0.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/} {{.???r.final .su !!$gspd .dwo} {-0.exe}} +outest "$b-195 exe dbsovrdd namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b.exe -dumpbase-ext .exe" {od/} {{.exe.???r.final .su !!$gspd .dwo} {.exe}} +outest "$b-196 exe dbsovrdd named2" $mult "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo} {.exe}} +outest "$b-197 exe dbsovrdda namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/a" {od/} {{a.???r.final a.su !!$gspd a.dwo} {.exe}} +outest "$b-198 exe dbsovrddac namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/a.c -dumpbase-ext .c" {od/} {{a.c.???r.final a.su !!$gspd a.dwo} {.exe}} +outest "$b-199 exe dbsovrdda named2" $mult "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/a" {od/} {{a--1.c.???r.final a--1.su !!$gspd a--1.dwo !0 a--2.c.???r.final a--2.su !!$gspd a--2.dwo} {.exe}} + +outest "$b-200 cpp dbsovrdd namedir0" $sing "-E -o o/$b-0.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/ o/} {{} {-0.i} {}} +outest "$b-201 asm dbsovrdd namedir0" $sing "-S -o o/$b-0.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/ o/} {{.???r.final .su} {-0.s} {}} +outest "$b-202 obj dbsovrdd namedir0" $sing "-c -o o/$b-0.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/ o/} {{.???r.final .su !!$gspd .dwo} {-0.o} {}} +outest "$b-203 cpp dbsovrdd namedir" $sing "-E -o o/$b.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/ o/} {{} {.i} {}} +outest "$b-204 asm dbsovrdd namedir" $sing "-S -o o/$b.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/ o/} {{.???r.final .su} {.s} {}} +outest "$b-205 obj dbsovrdd namedir" $sing "-c -o o/$b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/ o/} {{.???r.final .su !!$gspd .dwo} {.o} {}} +outest "$b-206 exe dbsovrdd namedir0" $sing "-o o/$b-0.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/ o/} {{.???r.final .su !!$gspd .dwo} {-0.exe} {}} +outest "$b-207 exe dbsovrdd namedirb" $sing "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b.exe -dumpbase-ext .exe" {od/ o/} {{.exe.???r.final .su !!$gspd .dwo} {.exe} {}} +outest "$b-208 exe dbsovrdd namedir2" $mult "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/$b" {od/ o/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo} {.exe} {}} +outest "$b-209 exe dbsovrdda namedirb" $sing "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/a" {od/ o/} {{a.???r.final a.su !!$gspd a.dwo} {.exe} {}} +outest "$b-210 exe dbsovrdda namedir2" $mult "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir ./ -dumpbase od/a" {od/ o/} {{a--1.c.???r.final a--1.su !!$gspd a--1.dwo !0 a--2.c.???r.final a--2.su !!$gspd a--2.dwo} {.exe} {}} # Check that a -dumpbase without a dir component adds to the -dumpdir # prefix. -outest "$b asm dbswthdd 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/} {{.???r.final .su} {-0.s}} -outest "$b asm dbswthddx 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b.c -dumpbase-ext .c" {od/} {{.c.???r.final .su} {-0.s}} -outest "$b asm dbswthdd-x 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b.c" {od/} {{.c.???r.final .c.su} {-0.s}} -outest "$b asm dbswthdd.x 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b.x" {od/} {{.x.???r.final .x.su} {-0.s}} -outest "$b asm dbswthdd 2" $mult "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/} {{--1.c.???r.final --1.su --2.c.???r.final --2.su} {-1.s -2.s}} -outest "$b asm dbswthddx 2" $mult "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b.x -dumpbase-ext .x" {od/} {{--1.c.???r.final --1.su --2.c.???r.final --2.su} {-1.s -2.s}} -outest "$b obj dbswthdd unnamed1" $sing "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/} {{.???r.final .su !!$gspd .dwo} {-0.o}} -outest "$b obj dbswthddx unnamed1" $sing "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b.c -dumpbase-ext .c" {od/} {{.c.???r.final .su !!$gspd .dwo} {-0.o}} -outest "$b obj dbswthdd unnamed2" $mult "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo} {-1.o -2.o}} - -outest "$b cpp dbswthdd named0" $sing "-E -o $b-0.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/} {{} {-0.i}} -outest "$b asm dbswthdd named0" $sing "-S -o $b-0.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/} {{.???r.final .su} {-0.s}} -outest "$b obj dbswthdd named0" $sing "-c -o $b-0.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/} {{.???r.final .su !!$gspd .dwo} {-0.o}} -outest "$b cpp dbswthdd namedb" $sing "-E -o $b.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/} {{} {.i}} -outest "$b asm dbswthdd namedb" $sing "-S -o $b.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/} {{.???r.final .su} {.s}} -outest "$b obj dbswthdd namedb" $sing "-c -o $b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/} {{.???r.final .su !!$gspd .dwo} {.o}} +outest "$b-211 asm dbswthdd 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/} {{.???r.final .su} {-0.s}} +outest "$b-212 asm dbswthddx 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b.c -dumpbase-ext .c" {od/} {{.c.???r.final .su} {-0.s}} +outest "$b-213 asm dbswthdd-x 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b.c" {od/} {{.c.???r.final .c.su} {-0.s}} +outest "$b-214 asm dbswthdd.x 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b.x" {od/} {{.x.???r.final .x.su} {-0.s}} +outest "$b-215 asm dbswthdd 2" $mult "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/} {{--1.c.???r.final --1.su --2.c.???r.final --2.su} {-1.s -2.s}} +outest "$b-216 asm dbswthddx 2" $mult "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b.x -dumpbase-ext .x" {od/} {{--1.c.???r.final --1.su --2.c.???r.final --2.su} {-1.s -2.s}} +outest "$b-217 obj dbswthdd unnamed1" $sing "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/} {{.???r.final .su !!$gspd .dwo} {-0.o}} +outest "$b-218 obj dbswthddx unnamed1" $sing "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b.c -dumpbase-ext .c" {od/} {{.c.???r.final .su !!$gspd .dwo} {-0.o}} +outest "$b-219 obj dbswthdd unnamed2" $mult "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo} {-1.o -2.o}} + +outest "$b-220 cpp dbswthdd named0" $sing "-E -o $b-0.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/} {{} {-0.i}} +outest "$b-221 asm dbswthdd named0" $sing "-S -o $b-0.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/} {{.???r.final .su} {-0.s}} +outest "$b-222 obj dbswthdd named0" $sing "-c -o $b-0.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/} {{.???r.final .su !!$gspd .dwo} {-0.o}} +outest "$b-223 cpp dbswthdd namedb" $sing "-E -o $b.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/} {{} {.i}} +outest "$b-224 asm dbswthdd namedb" $sing "-S -o $b.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/} {{.???r.final .su} {.s}} +outest "$b-225 obj dbswthdd namedb" $sing "-c -o $b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/} {{.???r.final .su !!$gspd .dwo} {.o}} # Nitty details: -dumpdir affects whether the specified dumpbase is # combined into dumpdir or taken as the output basename, even if # dumpbase will ultimately override it. -outest "$b exe dbswthdd unnamed1" $sing "-fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b $oaout" {od/} {{.???r.final .su !!$gspd .dwo} {$aout}} -outest "$b exe dbswthdd unnamed2" $mult "-fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase a $oaout" {od/} {{a--1.c.???r.final a--1.su !!$gspd a--1.dwo !0 a--2.c.???r.final a--2.su !!$gspd a--2.dwo} {$aout}} -outest "$b exe dbswthdd named0" $sing "-o $b-0.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/} {{.???r.final .su !!$gspd .dwo} {-0.exe}} -outest "$b exe dbswthdd namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b.exe -dumpbase-ext .exe" {od/} {{.exe.???r.final .su !!$gspd .dwo} {.exe}} -outest "$b exe dbswthdd named2" $mult "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo} {.exe}} -outest "$b exe dbswthdda namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase a" {od/} {{a.???r.final a.su !!$gspd a.dwo} {.exe}} -outest "$b exe dbswthddac namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase a.c -dumpbase-ext .c" {od/} {{a.c.???r.final a.su !!$gspd a.dwo} {.exe}} -outest "$b exe dbswthdda named2" $mult "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase a" {od/} {{a--1.c.???r.final a--1.su !!$gspd a--1.dwo !0 a--2.c.???r.final a--2.su !!$gspd a--2.dwo} {.exe}} - -outest "$b cpp dbswthdd namedir0" $sing "-E -o o/$b-0.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/ o/} {{} {-0.i} {}} -outest "$b asm dbswthdd namedir0" $sing "-S -o o/$b-0.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/ o/} {{.???r.final .su} {-0.s} {}} -outest "$b obj dbswthdd namedir0" $sing "-c -o o/$b-0.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/ o/} {{.???r.final .su !!$gspd .dwo} {-0.o} {}} -outest "$b cpp dbswthdd namedir" $sing "-E -o o/$b.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/ o/} {{} {.i} {}} -outest "$b asm dbswthdd namedir" $sing "-S -o o/$b.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/ o/} {{.???r.final .su} {.s} {}} -outest "$b obj dbswthdd namedir" $sing "-c -o o/$b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/ o/} {{.???r.final .su !!$gspd .dwo} {.o} {}} -outest "$b exe dbswthdd namedir0" $sing "-o o/$b-0.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/ o/} {{.???r.final .su !!$gspd .dwo} {-0.exe} {}} -outest "$b exe dbswthdd namedirb" $sing "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b.exe -dumpbase-ext .exe" {od/ o/} {{.exe.???r.final .su !!$gspd .dwo} {.exe} {}} -outest "$b exe dbswthdd namedir2" $mult "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/ o/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo} {.exe} {}} -outest "$b exe dbswthdda namedirb" $sing "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase a" {od/ o/} {{a.???r.final a.su !!$gspd a.dwo} {.exe} {}} -outest "$b exe dbswthdda namedir2" $mult "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase a" {od/ o/} {{a--1.c.???r.final a--1.su !!$gspd a--1.dwo !0 a--2.c.???r.final a--2.su !!$gspd a--2.dwo} {.exe} {}} +outest "$b-226 exe dbswthdd unnamed1" $sing "-fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b $oaout" {od/} {{.???r.final .su !!$gspd .dwo} {$aout}} +outest "$b-227 exe dbswthdd unnamed2" $mult "-fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase a $oaout" {od/} {{a--1.c.???r.final a--1.su !!$gspd a--1.dwo !0 a--2.c.???r.final a--2.su !!$gspd a--2.dwo} {$aout}} +outest "$b-228 exe dbswthdd named0" $sing "-o $b-0.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/} {{.???r.final .su !!$gspd .dwo} {-0.exe}} +outest "$b-229 exe dbswthdd namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b.exe -dumpbase-ext .exe" {od/} {{.exe.???r.final .su !!$gspd .dwo} {.exe}} +outest "$b-230 exe dbswthdd named2" $mult "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo} {.exe}} +outest "$b-231 exe dbswthdda namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase a" {od/} {{a.???r.final a.su !!$gspd a.dwo} {.exe}} +outest "$b-232 exe dbswthddac namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase a.c -dumpbase-ext .c" {od/} {{a.c.???r.final a.su !!$gspd a.dwo} {.exe}} +outest "$b-233 exe dbswthdda named2" $mult "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase a" {od/} {{a--1.c.???r.final a--1.su !!$gspd a--1.dwo !0 a--2.c.???r.final a--2.su !!$gspd a--2.dwo} {.exe}} + +outest "$b-234 cpp dbswthdd namedir0" $sing "-E -o o/$b-0.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/ o/} {{} {-0.i} {}} +outest "$b-235 asm dbswthdd namedir0" $sing "-S -o o/$b-0.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/ o/} {{.???r.final .su} {-0.s} {}} +outest "$b-236 obj dbswthdd namedir0" $sing "-c -o o/$b-0.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/ o/} {{.???r.final .su !!$gspd .dwo} {-0.o} {}} +outest "$b-237 cpp dbswthdd namedir" $sing "-E -o o/$b.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/ o/} {{} {.i} {}} +outest "$b-238 asm dbswthdd namedir" $sing "-S -o o/$b.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/ o/} {{.???r.final .su} {.s} {}} +outest "$b-239 obj dbswthdd namedir" $sing "-c -o o/$b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/ o/} {{.???r.final .su !!$gspd .dwo} {.o} {}} +outest "$b-240 exe dbswthdd namedir0" $sing "-o o/$b-0.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/ o/} {{.???r.final .su !!$gspd .dwo} {-0.exe} {}} +outest "$b-241 exe dbswthdd namedirb" $sing "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b.exe -dumpbase-ext .exe" {od/ o/} {{.exe.???r.final .su !!$gspd .dwo} {.exe} {}} +outest "$b-242 exe dbswthdd namedir2" $mult "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase $b" {od/ o/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo} {.exe} {}} +outest "$b-243 exe dbswthdda namedirb" $sing "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase a" {od/ o/} {{a.???r.final a.su !!$gspd a.dwo} {.exe} {}} +outest "$b-244 exe dbswthdda namedir2" $mult "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpdir od/ -dumpbase a" {od/ o/} {{a--1.c.???r.final a--1.su !!$gspd a--1.dwo !0 a--2.c.???r.final a--2.su !!$gspd a--2.dwo} {.exe} {}} # Check for the minor differences when -dumpbase is used without @@ -596,164 +614,166 @@ outest "$b exe dbswthdda namedir2" $mult "-o o/$b.exe -fdump-rtl-final -fstack-u # is in the single-input link tests: with the dump dir/ prefix moved # to dumpbase, and without -dumpdir we end up using -dumpbase as the # executable prefix rather than as the dumpbase for the single input. -outest "$b asm dbwoutdd 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/} {{.???r.final .su} {-0.s}} -outest "$b asm dbwoutddx 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b.c -dumpbase-ext .c" {od/} {{.c.???r.final .su} {-0.s}} -outest "$b asm dbwoutdd-x 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b.c" {od/} {{.c.???r.final .c.su} {-0.s}} -outest "$b asm dbwoutdd.x 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b.x" {od/} {{.x.???r.final .x.su} {-0.s}} -outest "$b asm dbwoutdd 2" $mult "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/} {{--1.c.???r.final --1.su --2.c.???r.final --2.su} {-1.s -2.s}} -outest "$b asm dbwoutddx 2" $mult "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b.x -dumpbase-ext .x" {od/} {{--1.c.???r.final --1.su --2.c.???r.final --2.su} {-1.s -2.s}} -outest "$b obj dbwoutdd unnamed1" $sing "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/} {{.???r.final .su !!$gspd .dwo} {-0.o}} -outest "$b obj dbwoutddx unnamed1" $sing "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b.c -dumpbase-ext .c" {od/} {{.c.???r.final .su !!$gspd .dwo} {-0.o}} -outest "$b obj dbwoutdd unnamed2" $mult "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo} {-1.o -2.o}} - -outest "$b cpp dbwoutdd named0" $sing "-E -o $b-0.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/} {{} {-0.i}} -outest "$b asm dbwoutdd named0" $sing "-S -o $b-0.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/} {{.???r.final .su} {-0.s}} -outest "$b obj dbwoutdd named0" $sing "-c -o $b-0.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/} {{.???r.final .su !!$gspd .dwo} {-0.o}} -outest "$b cpp dbwoutdd namedb" $sing "-E -o $b.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/} {{} {.i}} -outest "$b asm dbwoutdd namedb" $sing "-S -o $b.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/} {{.???r.final .su} {.s}} -outest "$b obj dbwoutdd namedb" $sing "-c -o $b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/} {{.???r.final .su !!$gspd .dwo} {.o}} - -outest "$b exe dbwoutdd unnamed1" $sing "-fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b $oaout" {od/} {{--0.c.???r.final --0.su !!$gspd --0.dwo} {$aout}} -outest "$b exe dbwoutdd unnamed2" $mult "-fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/a $oaout" {od/} {{a--1.c.???r.final a--1.su !!$gspd a--1.dwo !0 a--2.c.???r.final a--2.su !!$gspd a--2.dwo} {$aout}} -outest "$b exe dbwoutdd named0" $sing "-o $b-0.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/} {{--0.c.???r.final --0.su !!$gspd --0.dwo} {-0.exe}} -outest "$b exe dbwoutdd named0d" $sing "-o od/$b-0.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase $b" {od/} {{--0.c.???r.final --0.su !!$gspd --0.dwo !0 -0.exe} {}} -outest "$b exe dbwoutdd namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b.exe -dumpbase-ext .exe" {od/} {{--0.c.???r.final --0.su !!$gspd --0.dwo} {.exe}} -outest "$b exe dbwoutdd named2" $mult "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo} {.exe}} -outest "$b exe dbwoutdda namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/a" {od/} {{a--0.c.???r.final a--0.su !!$gspd a--0.dwo} {.exe}} -outest "$b exe dbwoutddac namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/a.c -dumpbase-ext .c" {od/} {{a--0.c.???r.final a--0.su !!$gspd a--0.dwo} {.exe}} -outest "$b exe dbwoutdda named2" $mult "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/a" {od/} {{a--1.c.???r.final a--1.su !!$gspd a--1.dwo !0 a--2.c.???r.final a--2.su !!$gspd a--2.dwo} {.exe}} - -outest "$b cpp dbwoutdd namedir0" $sing "-E -o o/$b-0.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/ o/} {{} {-0.i} {}} -outest "$b asm dbwoutdd namedir0" $sing "-S -o o/$b-0.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/ o/} {{.???r.final .su} {-0.s} {}} -outest "$b obj dbwoutdd namedir0" $sing "-c -o o/$b-0.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/ o/} {{.???r.final .su !!$gspd .dwo} {-0.o} {}} -outest "$b cpp dbwoutdd namedir" $sing "-E -o o/$b.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/ o/} {{} {.i} {}} -outest "$b asm dbwoutdd namedir" $sing "-S -o o/$b.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/ o/} {{.???r.final .su} {.s} {}} -outest "$b obj dbwoutdd namedir" $sing "-c -o o/$b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/ o/} {{.???r.final .su !!$gspd .dwo} {.o} {}} -outest "$b exe dbwoutdd namedir0" $sing "-o o/$b-0.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/ o/} {{--0.c.???r.final --0.su !!$gspd --0.dwo} {-0.exe} {}} -outest "$b exe dbwoutdd namedirb" $sing "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b.exe -dumpbase-ext .exe" {od/ o/} {{--0.c.???r.final --0.su !!$gspd --0.dwo} {.exe} {}} -outest "$b exe dbwoutdd namedir2" $mult "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/ o/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo} {.exe} {}} -outest "$b exe dbwoutdda namedirb" $sing "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/a" {od/ o/} {{a--0.c.???r.final a--0.su !!$gspd a--0.dwo} {.exe} {}} -outest "$b exe dbwoutdda namedir2" $mult "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/a" {od/ o/} {{a--1.c.???r.final a--1.su !!$gspd a--1.dwo !0 a--2.c.???r.final a--2.su !!$gspd a--2.dwo} {.exe} {}} +outest "$b-245 asm dbwoutdd 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/} {{.???r.final .su} {-0.s}} +outest "$b-246 asm dbwoutddx 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b.c -dumpbase-ext .c" {od/} {{.c.???r.final .su} {-0.s}} +outest "$b-247 asm dbwoutdd-x 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b.c" {od/} {{.c.???r.final .c.su} {-0.s}} +outest "$b-248 asm dbwoutdd.x 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b.x" {od/} {{.x.???r.final .x.su} {-0.s}} +outest "$b-249 asm dbwoutdd 2" $mult "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/} {{--1.c.???r.final --1.su --2.c.???r.final --2.su} {-1.s -2.s}} +outest "$b-250 asm dbwoutddx 2" $mult "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b.x -dumpbase-ext .x" {od/} {{--1.c.???r.final --1.su --2.c.???r.final --2.su} {-1.s -2.s}} +outest "$b-251 obj dbwoutdd unnamed1" $sing "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/} {{.???r.final .su !!$gspd .dwo} {-0.o}} +outest "$b-252 obj dbwoutddx unnamed1" $sing "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b.c -dumpbase-ext .c" {od/} {{.c.???r.final .su !!$gspd .dwo} {-0.o}} +outest "$b-253 obj dbwoutdd unnamed2" $mult "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo} {-1.o -2.o}} + +outest "$b-254 cpp dbwoutdd named0" $sing "-E -o $b-0.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/} {{} {-0.i}} +outest "$b-255 asm dbwoutdd named0" $sing "-S -o $b-0.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/} {{.???r.final .su} {-0.s}} +outest "$b-256 obj dbwoutdd named0" $sing "-c -o $b-0.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/} {{.???r.final .su !!$gspd .dwo} {-0.o}} +outest "$b-257 cpp dbwoutdd namedb" $sing "-E -o $b.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/} {{} {.i}} +outest "$b-258 asm dbwoutdd namedb" $sing "-S -o $b.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/} {{.???r.final .su} {.s}} +outest "$b-259 obj dbwoutdd namedb" $sing "-c -o $b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/} {{.???r.final .su !!$gspd .dwo} {.o}} + +outest "$b-260 exe dbwoutdd unnamed1" $sing "-fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b $oaout" {od/} {{--0.c.???r.final --0.su !!$gspd --0.dwo} {$aout}} +outest "$b-261 exe dbwoutdd unnamed2" $mult "-fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/a $oaout" {od/} {{a--1.c.???r.final a--1.su !!$gspd a--1.dwo !0 a--2.c.???r.final a--2.su !!$gspd a--2.dwo} {$aout}} +outest "$b-262 exe dbwoutdd named0" $sing "-o $b-0.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/} {{--0.c.???r.final --0.su !!$gspd --0.dwo} {-0.exe}} +outest "$b-263 exe dbwoutdd named0d" $sing "-o od/$b-0.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase $b" {od/} {{--0.c.???r.final --0.su !!$gspd --0.dwo !0 -0.exe} {}} +outest "$b-264 exe dbwoutdd namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b.exe -dumpbase-ext .exe" {od/} {{--0.c.???r.final --0.su !!$gspd --0.dwo} {.exe}} +outest "$b-265 exe dbwoutdd named2" $mult "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo} {.exe}} +outest "$b-266 exe dbwoutdda namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/a" {od/} {{a--0.c.???r.final a--0.su !!$gspd a--0.dwo} {.exe}} +outest "$b-267 exe dbwoutddac namedb" $sing "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/a.c -dumpbase-ext .c" {od/} {{a--0.c.???r.final a--0.su !!$gspd a--0.dwo} {.exe}} +outest "$b-268 exe dbwoutdda named2" $mult "-o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/a" {od/} {{a--1.c.???r.final a--1.su !!$gspd a--1.dwo !0 a--2.c.???r.final a--2.su !!$gspd a--2.dwo} {.exe}} + +outest "$b-269 cpp dbwoutdd namedir0" $sing "-E -o o/$b-0.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/ o/} {{} {-0.i} {}} +outest "$b-270 asm dbwoutdd namedir0" $sing "-S -o o/$b-0.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/ o/} {{.???r.final .su} {-0.s} {}} +outest "$b-271 obj dbwoutdd namedir0" $sing "-c -o o/$b-0.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/ o/} {{.???r.final .su !!$gspd .dwo} {-0.o} {}} +outest "$b-272 cpp dbwoutdd namedir" $sing "-E -o o/$b.i -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/ o/} {{} {.i} {}} +outest "$b-273 asm dbwoutdd namedir" $sing "-S -o o/$b.s -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/ o/} {{.???r.final .su} {.s} {}} +outest "$b-274 obj dbwoutdd namedir" $sing "-c -o o/$b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/ o/} {{.???r.final .su !!$gspd .dwo} {.o} {}} +outest "$b-275 exe dbwoutdd namedir0" $sing "-o o/$b-0.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/ o/} {{--0.c.???r.final --0.su !!$gspd --0.dwo} {-0.exe} {}} +outest "$b-276 exe dbwoutdd namedirb" $sing "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b.exe -dumpbase-ext .exe" {od/ o/} {{--0.c.???r.final --0.su !!$gspd --0.dwo} {.exe} {}} +outest "$b-277 exe dbwoutdd namedir2" $mult "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/$b" {od/ o/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo} {.exe} {}} +outest "$b-278 exe dbwoutdda namedirb" $sing "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/a" {od/ o/} {{a--0.c.???r.final a--0.su !!$gspd a--0.dwo} {.exe} {}} +outest "$b-279 exe dbwoutdda namedir2" $mult "-o o/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase od/a" {od/ o/} {{a--1.c.???r.final a--1.su !!$gspd a--1.dwo !0 a--2.c.???r.final a--2.su !!$gspd a--2.dwo} {.exe} {}} # -fcompare-debug -outest "$b obj compare-debug" $sing "-c -fcompare-debug -fdump-rtl-final -fstack-usage $gsplit_dwarf -fdump-final-insns" {} {{-0.c.???r.final -0.su -0.c.gkd -0.gk.c.???r.final !!$gspd -0.dwo !0 -0.o}} -outest "$b obj compare-debug save-temps" $sing "-c -fcompare-debug -save-temps -fdump-rtl-final -fstack-usage $gsplit_dwarf -fdump-final-insns" {} {{-0.c.???r.final -0.su -0.i -0.c.gkd -0.s -0.gk.i -0.gk.c.???r.final -0.gk.c.gkd !!$gspd -0.dwo !0 -0.o}} +outest "$b-280 obj compare-debug" $sing "-c -fcompare-debug -fdump-rtl-final -fstack-usage $gsplit_dwarf -fdump-final-insns" {} {{-0.c.???r.final -0.su -0.c.gkd -0.gk.c.???r.final !!$gspd -0.dwo !0 -0.o}} +outest "$b-281 obj compare-debug save-temps" $sing "-c -fcompare-debug -save-temps -fdump-rtl-final -fstack-usage $gsplit_dwarf -fdump-final-insns" {} {{-0.c.???r.final -0.su -0.i -0.c.gkd -0.s -0.gk.i -0.gk.c.???r.final -0.gk.c.gkd !!$gspd -0.dwo !0 -0.o}} if !$skip_lto { # -flto -outest "$b lto sing unnamed" $sing "-O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {} {{a--0.c.???i.icf !$ltop a--0.c.???r.final !0 a.wpa.???i.icf a.ltrans0.ltrans.???r.final a.ltrans0.ltrans.su $aout}} -outest "$b lto mult unnamed" $mult "-O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {} {{a--1.c.???i.icf !$ltop a--1.c.???r.final !0 a--2.c.???i.icf !$ltop a--2.c.???r.final !0 a.wpa.???i.icf a.ltrans0.ltrans.???r.final a.ltrans0.ltrans.su $aout}} -outest "$b lto sing named" $sing "-o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {} {{--0.c.???i.icf !$ltop --0.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .exe}} -outest "$b lto mult named" $mult "-o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .exe}} -outest "$b lto sing nameddir" $sing "-o dir/$b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--0.c.???i.icf !$ltop --0.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .exe} {}} -outest "$b lto mult nameddir" $mult "-o dir/$b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .exe} {}} +outest "$b-282 lto sing unnamed" $sing "-O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {} {{a--0.c.???i.icf !$ltop a--0.c.???r.final !0 a.wpa.???i.icf a.ltrans0.ltrans.???r.final a.ltrans0.ltrans.su $aout}} +outest "$b-283 lto mult unnamed" $mult "-O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {} {{a--1.c.???i.icf !$ltop a--1.c.???r.final !0 a--2.c.???i.icf !$ltop a--2.c.???r.final !0 a.wpa.???i.icf a.ltrans0.ltrans.???r.final a.ltrans0.ltrans.su $aout}} +outest "$b-284 lto sing named" $sing "-o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {} {{--0.c.???i.icf !$ltop --0.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .exe}} +outest "$b-285 lto mult named" $mult "-o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .exe}} +outest "$b-286 lto sing nameddir" $sing "-o dir/$b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--0.c.???i.icf !$ltop --0.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .exe} {}} +outest "$b-287 lto mult nameddir" $mult "-o dir/$b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .exe} {}} if $ltop { # -flto -fno-use-linker-plugin -outest "$b lto sing unnamed" $sing "-O2 -flto -fno-use-linker-plugin -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {} {{a--0.c.???i.icf a--0.c.???r.final a.wpa.???i.icf a.ltrans0.ltrans.???r.final a.ltrans0.ltrans.su $aout}} -outest "$b lto mult unnamed" $mult "-O2 -flto -fno-use-linker-plugin -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {} {{a--1.c.???i.icf a--1.c.???r.final a--2.c.???i.icf a--2.c.???r.final a.wpa.???i.icf a.ltrans0.ltrans.???r.final a.ltrans0.ltrans.su $aout}} -outest "$b lto sing named" $sing "-o $b.exe -O2 -flto -fno-use-linker-plugin -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {} {{--0.c.???i.icf --0.c.???r.final .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .exe}} -outest "$b lto mult named" $mult "-o $b.exe -O2 -flto -fno-use-linker-plugin -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {} {{--1.c.???i.icf --1.c.???r.final --2.c.???i.icf --2.c.???r.final .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .exe}} -outest "$b lto sing nameddir" $sing "-o dir/$b.exe -O2 -flto -fno-use-linker-plugin -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--0.c.???i.icf --0.c.???r.final .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .exe} {}} -outest "$b lto mult nameddir" $mult "-o dir/$b.exe -O2 -flto -fno-use-linker-plugin -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.c.???i.icf --1.c.???r.final --2.c.???i.icf --2.c.???r.final .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .exe} {}} -outest "$b lto sing unnamed" $sing "@/dev/null -O2 -flto -fno-use-linker-plugin -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage -save-temps $oaout" {} {{a--0.c.???i.icf a--0.c.???r.final a.wpa.???i.icf a.ltrans0.ltrans.???r.final a.ltrans0.ltrans.su a--0.o a--0.s a--0.i a.ltrans0.o a.ltrans.out a.ltrans0.ltrans.o a.ltrans0.ltrans_args a.args.0 a.ltrans0.ltrans.s a.wpa.args.0 a.lto_args a.ld1_args a.ltrans_args a.ltrans0.ltrans.args.0 a.ld_args $aout}} +outest "$b-288 lto sing unnamed-2" $sing "-O2 -flto -fno-use-linker-plugin -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {} {{a--0.c.???i.icf a--0.c.???r.final a.wpa.???i.icf a.ltrans0.ltrans.???r.final a.ltrans0.ltrans.su $aout}} +outest "$b-289 lto mult unnamed-2" $mult "-O2 -flto -fno-use-linker-plugin -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {} {{a--1.c.???i.icf a--1.c.???r.final a--2.c.???i.icf a--2.c.???r.final a.wpa.???i.icf a.ltrans0.ltrans.???r.final a.ltrans0.ltrans.su $aout}} +outest "$b-290 lto sing named-2" $sing "-o $b.exe -O2 -flto -fno-use-linker-plugin -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {} {{--0.c.???i.icf --0.c.???r.final .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .exe}} +outest "$b-291 lto mult named-2" $mult "-o $b.exe -O2 -flto -fno-use-linker-plugin -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {} {{--1.c.???i.icf --1.c.???r.final --2.c.???i.icf --2.c.???r.final .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .exe}} +outest "$b-292 lto sing nameddir-2" $sing "-o dir/$b.exe -O2 -flto -fno-use-linker-plugin -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--0.c.???i.icf --0.c.???r.final .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .exe} {}} +outest "$b-293 lto mult nameddir-2" $mult "-o dir/$b.exe -O2 -flto -fno-use-linker-plugin -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.c.???i.icf --1.c.???r.final --2.c.???i.icf --2.c.???r.final .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .exe} {}} +if !$skip_atsave { +outest "$b-294 lto sing unnamed-3" $sing "@/dev/null -O2 -flto -fno-use-linker-plugin -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage -save-temps $oaout" {} {{a--0.c.???i.icf a--0.c.???r.final a.wpa.???i.icf a.ltrans0.ltrans.???r.final a.ltrans0.ltrans.su a--0.o a--0.s a--0.i a.ltrans0.o a.ltrans.out a.ltrans0.ltrans.o a.ltrans0.ltrans_args a.args.0 a.ltrans0.ltrans.s a.wpa.args.0 a.lto_args a.ld1_args a.ltrans_args a.ltrans0.ltrans.args.0 a.ld_args $aout}} +} } # -dumpbase without -dumpdir. The trailing dumppfx dash after it is # combined with dumpbase turns into a period when passed to lto as # -dumpdir, because the dash is introduced by the compiler driver. -outest "$b lto sing dumpbase unnamed" $sing "-dumpbase dir/$b -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {dir/} {{--0.c.???i.icf !$ltop --0.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {$aout}} -outest "$b lto mult dumpbase unnamed" $mult "-dumpbase dir/$b -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {$aout}} -outest "$b lto sing dumpbase named" $sing "-dumpbase dir/$b -o $b-0.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--0.c.???i.icf !$ltop --0.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {-0.exe}} -outest "$b lto mult dumpbase named" $mult "-dumpbase dir/$b -o $b-1.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {-1.exe}} -outest "$b lto sing dumpbase namedb" $sing "-dumpbase dir/$b -o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--0.c.???i.icf !$ltop --0.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {.exe}} -outest "$b lto mult dumpbase namedb" $mult "-dumpbase dir/$b -o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {.exe}} +outest "$b-295 lto sing dumpbase unnamed" $sing "-dumpbase dir/$b -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {dir/} {{--0.c.???i.icf !$ltop --0.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {$aout}} +outest "$b-296 lto mult dumpbase unnamed" $mult "-dumpbase dir/$b -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {$aout}} +outest "$b-297 lto sing dumpbase named" $sing "-dumpbase dir/$b -o $b-0.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--0.c.???i.icf !$ltop --0.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {-0.exe}} +outest "$b-298 lto mult dumpbase named" $mult "-dumpbase dir/$b -o $b-1.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {-1.exe}} +outest "$b-299 lto sing dumpbase namedb" $sing "-dumpbase dir/$b -o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--0.c.???i.icf !$ltop --0.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {.exe}} +outest "$b-300 lto mult dumpbase namedb" $mult "-dumpbase dir/$b -o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {.exe}} # -dumpdir without -dumpbase. The trailing dash in -dumpdir is given # by the user, thus not replaced with a dot. -outest "$b lto sing dumpdir unnamed" $sing "-dumpdir dir/$b- -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {dir/} {{--0.c.???i.icf !$ltop --0.c.???r.final !0 -wpa.???i.icf -ltrans0.ltrans.???r.final -ltrans0.ltrans.su} {$aout}} -outest "$b lto mult dumpdir unnamed" $mult "-dumpdir dir/$b- -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 -wpa.???i.icf -ltrans0.ltrans.???r.final -ltrans0.ltrans.su} {$aout}} -outest "$b lto sing dumpdir named" $sing "-dumpdir dir/$b- -o $b-0.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--0.c.???i.icf !$ltop --0.c.???r.final !0 -wpa.???i.icf -ltrans0.ltrans.???r.final -ltrans0.ltrans.su} {-0.exe}} -outest "$b lto mult dumpdir named" $mult "-dumpdir dir/$b- -o $b-1.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 -wpa.???i.icf -ltrans0.ltrans.???r.final -ltrans0.ltrans.su} {-1.exe}} -outest "$b lto sing dumpdir namedb" $sing "-dumpdir dir/$b- -o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--0.c.???i.icf !$ltop --0.c.???r.final !0 -wpa.???i.icf -ltrans0.ltrans.???r.final -ltrans0.ltrans.su} {.exe}} -outest "$b lto mult dumpdir namedb" $mult "-dumpdir dir/$b- -o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 -wpa.???i.icf -ltrans0.ltrans.???r.final -ltrans0.ltrans.su} {.exe}} +outest "$b-301 lto sing dumpdir unnamed" $sing "-dumpdir dir/$b- -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {dir/} {{--0.c.???i.icf !$ltop --0.c.???r.final !0 -wpa.???i.icf -ltrans0.ltrans.???r.final -ltrans0.ltrans.su} {$aout}} +outest "$b-302 lto mult dumpdir unnamed" $mult "-dumpdir dir/$b- -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 -wpa.???i.icf -ltrans0.ltrans.???r.final -ltrans0.ltrans.su} {$aout}} +outest "$b-303 lto sing dumpdir named" $sing "-dumpdir dir/$b- -o $b-0.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--0.c.???i.icf !$ltop --0.c.???r.final !0 -wpa.???i.icf -ltrans0.ltrans.???r.final -ltrans0.ltrans.su} {-0.exe}} +outest "$b-304 lto mult dumpdir named" $mult "-dumpdir dir/$b- -o $b-1.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 -wpa.???i.icf -ltrans0.ltrans.???r.final -ltrans0.ltrans.su} {-1.exe}} +outest "$b-305 lto sing dumpdir namedb" $sing "-dumpdir dir/$b- -o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--0.c.???i.icf !$ltop --0.c.???r.final !0 -wpa.???i.icf -ltrans0.ltrans.???r.final -ltrans0.ltrans.su} {.exe}} +outest "$b-306 lto mult dumpdir namedb" $mult "-dumpdir dir/$b- -o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 -wpa.???i.icf -ltrans0.ltrans.???r.final -ltrans0.ltrans.su} {.exe}} # -dumpdir and non-overriding -dumpbase. -outest "$b lto dbswthdd sing unnamed" $sing "-dumpdir dir/ -dumpbase $b -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {dir/} {{!$ltop .???r.final !0 .???i.icf .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {$aout}} -outest "$b lto dbswthdd mult unnamed" $mult "-dumpdir dir/ -dumpbase $b -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {$aout}} -outest "$b lto dbswthdd sing named" $sing "-dumpdir dir/ -dumpbase $b -o $b-0.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{.???i.icf !$ltop .???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {-0.exe}} -outest "$b lto dbswthdd mult named" $mult "-dumpdir dir/ -dumpbase $b -o $b-1.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {-1.exe}} -outest "$b lto dbswthdd sing namedb" $sing "-dumpdir dir/ -dumpbase $b -o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{.???i.icf !$ltop .???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {.exe}} -outest "$b lto dbswthdd mult namedb" $mult "-dumpdir dir/ -dumpbase $b -o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {.exe}} +outest "$b-307 lto dbswthdd sing unnamed" $sing "-dumpdir dir/ -dumpbase $b -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {dir/} {{!$ltop .???r.final !0 .???i.icf .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {$aout}} +outest "$b-308 lto dbswthdd mult unnamed" $mult "-dumpdir dir/ -dumpbase $b -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {$aout}} +outest "$b-309 lto dbswthdd sing named" $sing "-dumpdir dir/ -dumpbase $b -o $b-0.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{.???i.icf !$ltop .???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {-0.exe}} +outest "$b-310 lto dbswthdd mult named" $mult "-dumpdir dir/ -dumpbase $b -o $b-1.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {-1.exe}} +outest "$b-311 lto dbswthdd sing namedb" $sing "-dumpdir dir/ -dumpbase $b -o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{.???i.icf !$ltop .???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {.exe}} +outest "$b-312 lto dbswthdd mult namedb" $mult "-dumpdir dir/ -dumpbase $b -o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {.exe}} # -dumpdir and an overriding -dumpbase. -outest "$b lto dbsovrdd sing unnamed" $sing "-dumpdir ignore/ -dumpbase dir/$b -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {dir/} {{.???i.icf !$ltop .???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {$aout}} -outest "$b lto dbsovrdd mult unnamed" $mult "-dumpdir ignore/ -dumpbase dir/$b -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {$aout}} -outest "$b lto dbsovrdd sing named" $sing "-dumpdir ignore/ -dumpbase dir/$b -o $b-0.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{.???i.icf !$ltop .???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {-0.exe}} -outest "$b lto dbsovrdd mult named" $mult "-dumpdir ignore/ -dumpbase dir/$b -o $b-1.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {-1.exe}} -outest "$b lto dbsovrdd sing namedb" $sing "-dumpdir ignore/ -dumpbase dir/$b -o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{.???i.icf !$ltop .???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {.exe}} -outest "$b lto dbsovrdd mult namedb" $mult "-dumpdir ignore/ -dumpbase dir/$b -o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {.exe}} +outest "$b-313 lto dbsovrdd sing unnamed" $sing "-dumpdir ignore/ -dumpbase dir/$b -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {dir/} {{.???i.icf !$ltop .???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {$aout}} +outest "$b-314 lto dbsovrdd mult unnamed" $mult "-dumpdir ignore/ -dumpbase dir/$b -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {$aout}} +outest "$b-315 lto dbsovrdd sing named" $sing "-dumpdir ignore/ -dumpbase dir/$b -o $b-0.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{.???i.icf !$ltop .???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {-0.exe}} +outest "$b-316 lto dbsovrdd mult named" $mult "-dumpdir ignore/ -dumpbase dir/$b -o $b-1.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {-1.exe}} +outest "$b-317 lto dbsovrdd sing namedb" $sing "-dumpdir ignore/ -dumpbase dir/$b -o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{.???i.icf !$ltop .???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {.exe}} +outest "$b-318 lto dbsovrdd mult namedb" $mult "-dumpdir ignore/ -dumpbase dir/$b -o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su} {.exe}} # Check that -dumpbase '' gets source names as dumpbases for # compilation, and output name as dumpbase for linking, regardless of # how many source files. -outest "$b lto sing empty dumpbase unnamed" $sing "-dumpbase \"\" -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {} {{-0.c.???i.icf !$ltop -0.c.???r.final !0 a.wpa.???i.icf a.ltrans0.ltrans.???r.final a.ltrans0.ltrans.su $aout}} -outest "$b lto mult empty dumpbase unnamed" $mult "-dumpbase \"\" -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {} {{-1.c.???i.icf !$ltop -1.c.???r.final !0 -2.c.???i.icf !$ltop -2.c.???r.final !0 a.wpa.???i.icf a.ltrans0.ltrans.???r.final a.ltrans0.ltrans.su $aout}} -outest "$b lto sing empty dumpbase named" $sing "-dumpbase \"\" -o dir/$b-0.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{-0.c.???i.icf !$ltop -0.c.???r.final !0 -0.wpa.???i.icf -0.ltrans0.ltrans.???r.final -0.ltrans0.ltrans.su -0.exe} {}} -outest "$b lto mult empty dumpbase named" $mult "-dumpbase \"\" -o dir/$b-1.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{-1.c.???i.icf !$ltop -1.c.???r.final !0 -2.c.???i.icf !$ltop -2.c.???r.final !0 -1.wpa.???i.icf -1.ltrans0.ltrans.???r.final -1.ltrans0.ltrans.su -1.exe} {}} -outest "$b lto sing empty dumpbase namedb" $sing "-dumpbase \"\" -o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {} {{-0.c.???i.icf !$ltop -0.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .exe}} -outest "$b lto mult empty dumpbase namedb" $mult "-dumpbase \"\" -o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {} {{-1.c.???i.icf !$ltop -1.c.???r.final !0 -2.c.???i.icf !$ltop -2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .exe}} +outest "$b-319 lto sing empty dumpbase unnamed" $sing "-dumpbase \"\" -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {} {{-0.c.???i.icf !$ltop -0.c.???r.final !0 a.wpa.???i.icf a.ltrans0.ltrans.???r.final a.ltrans0.ltrans.su $aout}} +outest "$b-320 lto mult empty dumpbase unnamed" $mult "-dumpbase \"\" -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {} {{-1.c.???i.icf !$ltop -1.c.???r.final !0 -2.c.???i.icf !$ltop -2.c.???r.final !0 a.wpa.???i.icf a.ltrans0.ltrans.???r.final a.ltrans0.ltrans.su $aout}} +outest "$b-321 lto sing empty dumpbase named" $sing "-dumpbase \"\" -o dir/$b-0.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{-0.c.???i.icf !$ltop -0.c.???r.final !0 -0.wpa.???i.icf -0.ltrans0.ltrans.???r.final -0.ltrans0.ltrans.su -0.exe} {}} +outest "$b-322 lto mult empty dumpbase named" $mult "-dumpbase \"\" -o dir/$b-1.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{-1.c.???i.icf !$ltop -1.c.???r.final !0 -2.c.???i.icf !$ltop -2.c.???r.final !0 -1.wpa.???i.icf -1.ltrans0.ltrans.???r.final -1.ltrans0.ltrans.su -1.exe} {}} +outest "$b-323 lto sing empty dumpbase namedb" $sing "-dumpbase \"\" -o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {} {{-0.c.???i.icf !$ltop -0.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .exe}} +outest "$b-324 lto mult empty dumpbase namedb" $mult "-dumpbase \"\" -o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {} {{-1.c.???i.icf !$ltop -1.c.???r.final !0 -2.c.???i.icf !$ltop -2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .exe}} # Now with -dumpdir too. -outest "$b lto sing empty dumpbase dumpdir unnamed" $sing "-dumpdir dir/$b- -dumpbase \"\" -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {dir/} {{--0.c.???i.icf !$ltop --0.c.???r.final !0 -a.wpa.???i.icf -a.ltrans0.ltrans.???r.final -a.ltrans0.ltrans.su} {$aout}} -outest "$b lto mult empty dumpbase dumpdir unnamed" $mult "-dumpdir dir/$b- -dumpbase \"\" -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 -a.wpa.???i.icf -a.ltrans0.ltrans.???r.final -a.ltrans0.ltrans.su} {$aout}} -outest "$b lto sing empty dumpbase dumpdir named" $sing "-dumpdir dir/$b- -dumpbase \"\" -o $b-0.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--0.c.???i.icf !$ltop --0.c.???r.final !0 --0.wpa.???i.icf --0.ltrans0.ltrans.???r.final --0.ltrans0.ltrans.su} {-0.exe}} -outest "$b lto mult empty dumpbase dumpdir named" $mult "-dumpdir dir/$b- -dumpbase \"\" -o $b-1.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 --1.wpa.???i.icf --1.ltrans0.ltrans.???r.final --1.ltrans0.ltrans.su} {-1.exe}} -outest "$b lto sing empty dumpbase dumpdir namedb" $sing "-dumpdir dir/$b- -dumpbase \"\" -o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--0.c.???i.icf !$ltop --0.c.???r.final !0 -.wpa.???i.icf -.ltrans0.ltrans.???r.final -.ltrans0.ltrans.su} {.exe}} -outest "$b lto mult empty dumpbase dumpdir namedb" $mult "-dumpdir dir/$b- -dumpbase \"\" -o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 -.wpa.???i.icf -.ltrans0.ltrans.???r.final -.ltrans0.ltrans.su} {.exe}} +outest "$b-325 lto sing empty dumpbase dumpdir unnamed" $sing "-dumpdir dir/$b- -dumpbase \"\" -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {dir/} {{--0.c.???i.icf !$ltop --0.c.???r.final !0 -a.wpa.???i.icf -a.ltrans0.ltrans.???r.final -a.ltrans0.ltrans.su} {$aout}} +outest "$b-326 lto mult empty dumpbase dumpdir unnamed" $mult "-dumpdir dir/$b- -dumpbase \"\" -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 -a.wpa.???i.icf -a.ltrans0.ltrans.???r.final -a.ltrans0.ltrans.su} {$aout}} +outest "$b-327 lto sing empty dumpbase dumpdir named" $sing "-dumpdir dir/$b- -dumpbase \"\" -o $b-0.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--0.c.???i.icf !$ltop --0.c.???r.final !0 --0.wpa.???i.icf --0.ltrans0.ltrans.???r.final --0.ltrans0.ltrans.su} {-0.exe}} +outest "$b-328 lto mult empty dumpbase dumpdir named" $mult "-dumpdir dir/$b- -dumpbase \"\" -o $b-1.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 --1.wpa.???i.icf --1.ltrans0.ltrans.???r.final --1.ltrans0.ltrans.su} {-1.exe}} +outest "$b-329 lto sing empty dumpbase dumpdir namedb" $sing "-dumpdir dir/$b- -dumpbase \"\" -o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--0.c.???i.icf !$ltop --0.c.???r.final !0 -.wpa.???i.icf -.ltrans0.ltrans.???r.final -.ltrans0.ltrans.su} {.exe}} +outest "$b-330 lto mult empty dumpbase dumpdir namedb" $mult "-dumpdir dir/$b- -dumpbase \"\" -o $b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.c.???i.icf !$ltop --1.c.???r.final !0 --2.c.???i.icf !$ltop --2.c.???r.final !0 -.wpa.???i.icf -.ltrans0.ltrans.???r.final -.ltrans0.ltrans.su} {.exe}} # And also with an empty -dumpdir. That's equivalent to -dumpdir ./, # overriding any dumpdir implied by the output. -outest "$b lto sing empty dumpdir empty dumpbase unnamed" $sing "-dumpdir \"\" -dumpbase \"\" -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {} {{-0.c.???i.icf !$ltop -0.c.???r.final !0 a.wpa.???i.icf a.ltrans0.ltrans.???r.final a.ltrans0.ltrans.su $aout}} -outest "$b lto mult empty dumpdir empty dumpbase unnamed" $mult "-dumpdir \"\" -dumpbase \"\" -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {} {{-1.c.???i.icf !$ltop -1.c.???r.final !0 -2.c.???i.icf !$ltop -2.c.???r.final !0 a.wpa.???i.icf a.ltrans0.ltrans.???r.final a.ltrans0.ltrans.su $aout}} -outest "$b lto sing empty dumpdir empty dumpbase named" $sing "-dumpdir \"\" -dumpbase \"\" -o dir/$b-0.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{-0.exe} {-0.c.???i.icf !$ltop -0.c.???r.final !0 -0.wpa.???i.icf -0.ltrans0.ltrans.???r.final -0.ltrans0.ltrans.su}} -outest "$b lto mult empty dumpdir empty dumpbase named" $mult "-dumpdir \"\" -dumpbase \"\" -o dir/$b-1.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{-1.exe} {-1.c.???i.icf !$ltop -1.c.???r.final !0 -2.c.???i.icf !$ltop -2.c.???r.final !0 -1.wpa.???i.icf -1.ltrans0.ltrans.???r.final -1.ltrans0.ltrans.su}} -outest "$b lto sing empty dumpdir empty dumpbase namedb" $sing "-dumpdir \"\" -dumpbase \"\" -o dir/$b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{.exe} {-0.c.???i.icf !$ltop -0.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su}} -outest "$b lto mult empty dumpdir empty dumpbase namedb" $mult "-dumpdir \"\" -dumpbase \"\" -o dir/$b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{.exe} {-1.c.???i.icf !$ltop -1.c.???r.final !0 -2.c.???i.icf !$ltop -2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su}} +outest "$b-331 lto sing empty dumpdir empty dumpbase unnamed" $sing "-dumpdir \"\" -dumpbase \"\" -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {} {{-0.c.???i.icf !$ltop -0.c.???r.final !0 a.wpa.???i.icf a.ltrans0.ltrans.???r.final a.ltrans0.ltrans.su $aout}} +outest "$b-332 lto mult empty dumpdir empty dumpbase unnamed" $mult "-dumpdir \"\" -dumpbase \"\" -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {} {{-1.c.???i.icf !$ltop -1.c.???r.final !0 -2.c.???i.icf !$ltop -2.c.???r.final !0 a.wpa.???i.icf a.ltrans0.ltrans.???r.final a.ltrans0.ltrans.su $aout}} +outest "$b-333 lto sing empty dumpdir empty dumpbase named" $sing "-dumpdir \"\" -dumpbase \"\" -o dir/$b-0.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{-0.exe} {-0.c.???i.icf !$ltop -0.c.???r.final !0 -0.wpa.???i.icf -0.ltrans0.ltrans.???r.final -0.ltrans0.ltrans.su}} +outest "$b-334 lto mult empty dumpdir empty dumpbase named" $mult "-dumpdir \"\" -dumpbase \"\" -o dir/$b-1.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{-1.exe} {-1.c.???i.icf !$ltop -1.c.???r.final !0 -2.c.???i.icf !$ltop -2.c.???r.final !0 -1.wpa.???i.icf -1.ltrans0.ltrans.???r.final -1.ltrans0.ltrans.su}} +outest "$b-335 lto sing empty dumpdir empty dumpbase namedb" $sing "-dumpdir \"\" -dumpbase \"\" -o dir/$b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{.exe} {-0.c.???i.icf !$ltop -0.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su}} +outest "$b-336 lto mult empty dumpdir empty dumpbase namedb" $mult "-dumpdir \"\" -dumpbase \"\" -o dir/$b.exe -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{.exe} {-1.c.???i.icf !$ltop -1.c.???r.final !0 -2.c.???i.icf !$ltop -2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su}} # Now -flto with -save-temps, not exhaustive. -outest "$b lto st sing empty dumpbase unnamed" $sing "-dumpbase \"\" -save-temps -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {} {{-0.i -0.s -0.o -0.c.???i.icf !$ltop -0.c.???r.final !!$ltop a.lto_wrapper_args !0 a.wpa.???i.icf a.ltrans.out a.ltrans_args !!$ltop a.res !0 a.ltrans0.o a.ltrans0.ltrans.???r.final a.ltrans0.ltrans.su a.ltrans0.ltrans.s a.ltrans0.ltrans.o a.ltrans0.ltrans_args a.ltrans0.ltrans.args.0 a.wpa.args.0 $aout}} -outest "$b lto st mult empty dumpbase unnamed" $mult "-dumpbase \"\" -save-temps -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {} {{-1.i -1.s -1.o -1.c.???i.icf !$ltop -1.c.???r.final !0 -2.i -2.s -2.o -2.c.???i.icf !$ltop -2.c.???r.final !!$ltop a.lto_wrapper_args !0 a.wpa.???i.icf a.ltrans.out a.ltrans_args !!$ltop a.res !0 a.ltrans0.o a.ltrans0.ltrans.???r.final a.ltrans0.ltrans.su a.ltrans0.ltrans.s a.ltrans0.ltrans.o a.ltrans0.ltrans_args a.ltrans0.ltrans.args.0 a.wpa.args.0 $aout}} -outest "$b lto st sing dumpdir empty dumpbase named" $sing "-dumpdir dir/ -dumpbase \"\" -o $b-0.exe -save-temps -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{-0.i -0.s -0.o -0.c.???i.icf !$ltop -0.c.???r.final !!$ltop -0.lto_wrapper_args !0 -0.wpa.???i.icf -0.ltrans.out -0.ltrans_args !!$ltop -0.res !0 -0.ltrans0.o -0.ltrans0.ltrans.???r.final -0.ltrans0.ltrans.su -0.ltrans0.ltrans.s -0.ltrans0.ltrans.o -0.ltrans0.ltrans_args -0.ltrans0.ltrans.args.0 -0.wpa.args.0} {-0.exe}} -outest "$b lto st mult dumpdir empty dumpbase named" $mult "-dumpdir dir/ -dumpbase \"\" -o $b-1.exe -save-temps -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{-1.i -1.s -1.o -1.c.???i.icf !$ltop -1.c.???r.final !0 -2.i -2.s -2.o -2.c.???i.icf !$ltop -2.c.???r.final !!$ltop -1.lto_wrapper_args !0 -1.wpa.???i.icf -1.ltrans.out -1.ltrans_args !!$ltop -1.res !0 -1.ltrans0.o -1.ltrans0.ltrans.???r.final -1.ltrans0.ltrans.su -1.ltrans0.ltrans.s -1.ltrans0.ltrans.o -1.ltrans0.ltrans_args -1.ltrans0.ltrans.args.0 -1.wpa.args.0} {-1.exe}} -outest "$b lto st sing empty dumpbase namedb" $sing "-dumpbase \"\" -o dir/$b.exe -save-temps -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{-0.i -0.s -0.o -0.c.???i.icf !$ltop -0.c.???r.final !!$ltop .lto_wrapper_args !0 .wpa.???i.icf .ltrans.out .ltrans_args !!$ltop .res !0 .ltrans0.o .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .ltrans0.ltrans.s .ltrans0.ltrans.o .ltrans0.ltrans_args .ltrans0.ltrans.args.0 .wpa.args.0 .exe} {}} -outest "$b lto st mult empty dumpbase namedb" $mult "-dumpbase \"\" -o dir/$b.exe -save-temps -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{-1.i -1.s -1.o -1.c.???i.icf !$ltop -1.c.???r.final !0 -2.i -2.s -2.o -2.c.???i.icf !$ltop -2.c.???r.final !!$ltop .lto_wrapper_args !0 .wpa.???i.icf .ltrans.out .ltrans_args !!$ltop .res !0 .ltrans0.o .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .ltrans0.ltrans.s .ltrans0.ltrans.o .ltrans0.ltrans_args .ltrans0.ltrans.args.0 .wpa.args.0 .exe} {}} +outest "$b-337 lto st sing empty dumpbase unnamed" $sing "-dumpbase \"\" -save-temps -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {} {{-0.i -0.s -0.o -0.c.???i.icf !$ltop -0.c.???r.final !!$ltop a.lto_wrapper_args !0 a.wpa.???i.icf a.ltrans.out a.ltrans_args !!$ltop a.res !0 a.ltrans0.o a.ltrans0.ltrans.???r.final a.ltrans0.ltrans.su a.ltrans0.ltrans.s a.ltrans0.ltrans.o a.ltrans0.ltrans_args a.ltrans0.ltrans.args.0 a.wpa.args.0 $aout}} +outest "$b-338 lto st mult empty dumpbase unnamed" $mult "-dumpbase \"\" -save-temps -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {} {{-1.i -1.s -1.o -1.c.???i.icf !$ltop -1.c.???r.final !0 -2.i -2.s -2.o -2.c.???i.icf !$ltop -2.c.???r.final !!$ltop a.lto_wrapper_args !0 a.wpa.???i.icf a.ltrans.out a.ltrans_args !!$ltop a.res !0 a.ltrans0.o a.ltrans0.ltrans.???r.final a.ltrans0.ltrans.su a.ltrans0.ltrans.s a.ltrans0.ltrans.o a.ltrans0.ltrans_args a.ltrans0.ltrans.args.0 a.wpa.args.0 $aout}} +outest "$b-339 lto st sing dumpdir empty dumpbase named" $sing "-dumpdir dir/ -dumpbase \"\" -o $b-0.exe -save-temps -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{-0.i -0.s -0.o -0.c.???i.icf !$ltop -0.c.???r.final !!$ltop -0.lto_wrapper_args !0 -0.wpa.???i.icf -0.ltrans.out -0.ltrans_args !!$ltop -0.res !0 -0.ltrans0.o -0.ltrans0.ltrans.???r.final -0.ltrans0.ltrans.su -0.ltrans0.ltrans.s -0.ltrans0.ltrans.o -0.ltrans0.ltrans_args -0.ltrans0.ltrans.args.0 -0.wpa.args.0} {-0.exe}} +outest "$b-340 lto st mult dumpdir empty dumpbase named" $mult "-dumpdir dir/ -dumpbase \"\" -o $b-1.exe -save-temps -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{-1.i -1.s -1.o -1.c.???i.icf !$ltop -1.c.???r.final !0 -2.i -2.s -2.o -2.c.???i.icf !$ltop -2.c.???r.final !!$ltop -1.lto_wrapper_args !0 -1.wpa.???i.icf -1.ltrans.out -1.ltrans_args !!$ltop -1.res !0 -1.ltrans0.o -1.ltrans0.ltrans.???r.final -1.ltrans0.ltrans.su -1.ltrans0.ltrans.s -1.ltrans0.ltrans.o -1.ltrans0.ltrans_args -1.ltrans0.ltrans.args.0 -1.wpa.args.0} {-1.exe}} +outest "$b-341 lto st sing empty dumpbase namedb" $sing "-dumpbase \"\" -o dir/$b.exe -save-temps -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{-0.i -0.s -0.o -0.c.???i.icf !$ltop -0.c.???r.final !!$ltop .lto_wrapper_args !0 .wpa.???i.icf .ltrans.out .ltrans_args !!$ltop .res !0 .ltrans0.o .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .ltrans0.ltrans.s .ltrans0.ltrans.o .ltrans0.ltrans_args .ltrans0.ltrans.args.0 .wpa.args.0 .exe} {}} +outest "$b-342 lto st mult empty dumpbase namedb" $mult "-dumpbase \"\" -o dir/$b.exe -save-temps -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{-1.i -1.s -1.o -1.c.???i.icf !$ltop -1.c.???r.final !0 -2.i -2.s -2.o -2.c.???i.icf !$ltop -2.c.???r.final !!$ltop .lto_wrapper_args !0 .wpa.???i.icf .ltrans.out .ltrans_args !!$ltop .res !0 .ltrans0.o .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .ltrans0.ltrans.s .ltrans0.ltrans.o .ltrans0.ltrans_args .ltrans0.ltrans.args.0 .wpa.args.0 .exe} {}} # lto save-temps without -dumpbase. -outest "$b lto st sing unnamed" $sing "-save-temps -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {} {{a--0.i a--0.s a--0.o a--0.c.???i.icf !$ltop a--0.c.???r.final !!$ltop a.lto_wrapper_args !0 a.wpa.???i.icf a.ltrans.out a.ltrans_args !!$ltop a.res !0 a.ltrans0.o a.ltrans0.ltrans.???r.final a.ltrans0.ltrans.su a.ltrans0.ltrans.s a.ltrans0.ltrans.o a.ltrans0.ltrans_args a.ltrans0.ltrans.args.0 a.wpa.args.0 $aout}} -outest "$b lto st mult unnamed" $mult "-save-temps -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {} {{a--1.i a--1.s a--1.o a--1.c.???i.icf !$ltop a--1.c.???r.final !0 a--2.i a--2.s a--2.o a--2.c.???i.icf !$ltop a--2.c.???r.final !!$ltop a.lto_wrapper_args !0 a.wpa.???i.icf a.ltrans.out a.ltrans_args !!$ltop a.res !0 a.ltrans0.o a.ltrans0.ltrans.???r.final a.ltrans0.ltrans.su a.ltrans0.ltrans.s a.ltrans0.ltrans.o a.ltrans0.ltrans_args a.ltrans0.ltrans.args.0 a.wpa.args.0 $aout}} -outest "$b lto st sing dumpdir named" $sing "-dumpdir dir/$b- -o $b-0.exe -save-temps -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--0.i --0.s --0.o --0.c.???i.icf !$ltop --0.c.???r.final !!$ltop -lto_wrapper_args !0 -wpa.???i.icf -ltrans.out -ltrans_args !!$ltop -res !0 -ltrans0.o -ltrans0.ltrans.???r.final -ltrans0.ltrans.su -ltrans0.ltrans.s -ltrans0.ltrans.o -ltrans0.ltrans_args -ltrans0.ltrans.args.0 -wpa.args.0} {-0.exe}} -outest "$b lto st mult dumpdir named" $mult "-dumpdir dir/$b- -o $b-1.exe -save-temps -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.i --1.s --1.o --1.c.???i.icf !$ltop --1.c.???r.final !0 --2.i --2.s --2.o --2.c.???i.icf !$ltop --2.c.???r.final !!$ltop -lto_wrapper_args !0 -wpa.???i.icf -ltrans.out -ltrans_args !!$ltop -res !0 -ltrans0.o -ltrans0.ltrans.???r.final -ltrans0.ltrans.su -ltrans0.ltrans.s -ltrans0.ltrans.o -ltrans0.ltrans_args -ltrans0.ltrans.args.0 -wpa.args.0} {-1.exe}} -outest "$b lto st sing namedb" $sing "-o dir/$b.exe -save-temps -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--0.i --0.s --0.o --0.c.???i.icf !$ltop --0.c.???r.final !!$ltop .lto_wrapper_args !0 .wpa.???i.icf .ltrans.out .ltrans_args !!$ltop .res !0 .ltrans0.o .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .ltrans0.ltrans.s .ltrans0.ltrans.o .ltrans0.ltrans_args .ltrans0.ltrans.args.0 .wpa.args.0 .exe} {}} -outest "$b lto st mult namedb" $mult "-o dir/$b.exe -save-temps -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.i --1.s --1.o --1.c.???i.icf !$ltop --1.c.???r.final !0 --2.i --2.s --2.o --2.c.???i.icf !$ltop --2.c.???r.final !!$ltop .lto_wrapper_args !0 .wpa.???i.icf .ltrans.out .ltrans_args !!$ltop .res !0 .ltrans0.o .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .ltrans0.ltrans.s .ltrans0.ltrans.o .ltrans0.ltrans_args .ltrans0.ltrans.args.0 .wpa.args.0 .exe} {}} +outest "$b-343 lto st sing unnamed" $sing "-save-temps -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {} {{a--0.i a--0.s a--0.o a--0.c.???i.icf !$ltop a--0.c.???r.final !!$ltop a.lto_wrapper_args !0 a.wpa.???i.icf a.ltrans.out a.ltrans_args !!$ltop a.res !0 a.ltrans0.o a.ltrans0.ltrans.???r.final a.ltrans0.ltrans.su a.ltrans0.ltrans.s a.ltrans0.ltrans.o a.ltrans0.ltrans_args a.ltrans0.ltrans.args.0 a.wpa.args.0 $aout}} +outest "$b-344 lto st mult unnamed" $mult "-save-temps -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage $oaout" {} {{a--1.i a--1.s a--1.o a--1.c.???i.icf !$ltop a--1.c.???r.final !0 a--2.i a--2.s a--2.o a--2.c.???i.icf !$ltop a--2.c.???r.final !!$ltop a.lto_wrapper_args !0 a.wpa.???i.icf a.ltrans.out a.ltrans_args !!$ltop a.res !0 a.ltrans0.o a.ltrans0.ltrans.???r.final a.ltrans0.ltrans.su a.ltrans0.ltrans.s a.ltrans0.ltrans.o a.ltrans0.ltrans_args a.ltrans0.ltrans.args.0 a.wpa.args.0 $aout}} +outest "$b-345 lto st sing dumpdir named" $sing "-dumpdir dir/$b- -o $b-0.exe -save-temps -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--0.i --0.s --0.o --0.c.???i.icf !$ltop --0.c.???r.final !!$ltop -lto_wrapper_args !0 -wpa.???i.icf -ltrans.out -ltrans_args !!$ltop -res !0 -ltrans0.o -ltrans0.ltrans.???r.final -ltrans0.ltrans.su -ltrans0.ltrans.s -ltrans0.ltrans.o -ltrans0.ltrans_args -ltrans0.ltrans.args.0 -wpa.args.0} {-0.exe}} +outest "$b-346 lto st mult dumpdir named" $mult "-dumpdir dir/$b- -o $b-1.exe -save-temps -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.i --1.s --1.o --1.c.???i.icf !$ltop --1.c.???r.final !0 --2.i --2.s --2.o --2.c.???i.icf !$ltop --2.c.???r.final !!$ltop -lto_wrapper_args !0 -wpa.???i.icf -ltrans.out -ltrans_args !!$ltop -res !0 -ltrans0.o -ltrans0.ltrans.???r.final -ltrans0.ltrans.su -ltrans0.ltrans.s -ltrans0.ltrans.o -ltrans0.ltrans_args -ltrans0.ltrans.args.0 -wpa.args.0} {-1.exe}} +outest "$b-347 lto st sing namedb" $sing "-o dir/$b.exe -save-temps -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--0.i --0.s --0.o --0.c.???i.icf !$ltop --0.c.???r.final !!$ltop .lto_wrapper_args !0 .wpa.???i.icf .ltrans.out .ltrans_args !!$ltop .res !0 .ltrans0.o .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .ltrans0.ltrans.s .ltrans0.ltrans.o .ltrans0.ltrans_args .ltrans0.ltrans.args.0 .wpa.args.0 .exe} {}} +outest "$b-348 lto st mult namedb" $mult "-o dir/$b.exe -save-temps -O2 -flto -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{--1.i --1.s --1.o --1.c.???i.icf !$ltop --1.c.???r.final !0 --2.i --2.s --2.o --2.c.???i.icf !$ltop --2.c.???r.final !!$ltop .lto_wrapper_args !0 .wpa.???i.icf .ltrans.out .ltrans_args !!$ltop .res !0 .ltrans0.o .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .ltrans0.ltrans.s .ltrans0.ltrans.o .ltrans0.ltrans_args .ltrans0.ltrans.args.0 .wpa.args.0 .exe} {}} # !$skip_lto } # PR96230 - -dumpbase "" with -dumpbase-ext, not linking -outest "$b single -c -o -db'' -dbx.c" $sing "-c -o dir/$b.o -dumpbase \"\" -dumpbase-ext .c -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{-0.c.???r.final -0.su !!$gspd -0.dwo !0 .o} {}} -outest "$b mult -c -dd -db'' -dbx.c" $mult "-c -dumpdir dir/ -dumpbase \"\" -dumpbase-ext .c -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{-1.c.???r.final -1.su !!$gspd -1.dwo !0 -2.c.???r.final -2.su !!$gspd -2.dwo} {-1.o -2.o}} -outest "$b single -c -o -db'' -dbx.x" $sing "-c -o dir/$b.o -dumpbase \"\" -dumpbase-ext .x -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{-0.c.???r.final -0.su !!$gspd -0.dwo !0 .o} {}} -outest "$b mult -c -dd -db'' -dbx.x" $mult "-c -dumpdir dir/ -dumpbase \"\" -dumpbase-ext .x -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{-1.c.???r.final -1.su !!$gspd -1.dwo !0 -2.c.???r.final -2.su !!$gspd -2.dwo} {-1.o -2.o}} +outest "$b-349 single -c -o -db'' -dbx.c" $sing "-c -o dir/$b.o -dumpbase \"\" -dumpbase-ext .c -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{-0.c.???r.final -0.su !!$gspd -0.dwo !0 .o} {}} +outest "$b-350 mult -c -dd -db'' -dbx.c" $mult "-c -dumpdir dir/ -dumpbase \"\" -dumpbase-ext .c -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{-1.c.???r.final -1.su !!$gspd -1.dwo !0 -2.c.???r.final -2.su !!$gspd -2.dwo} {-1.o -2.o}} +outest "$b-351 single -c -o -db'' -dbx.x" $sing "-c -o dir/$b.o -dumpbase \"\" -dumpbase-ext .x -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{-0.c.???r.final -0.su !!$gspd -0.dwo !0 .o} {}} +outest "$b-352 mult -c -dd -db'' -dbx.x" $mult "-c -dumpdir dir/ -dumpbase \"\" -dumpbase-ext .x -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{-1.c.???r.final -1.su !!$gspd -1.dwo !0 -2.c.???r.final -2.su !!$gspd -2.dwo} {-1.o -2.o}} # Test -dumpbase-ext without an explicit -dumpbase too. -outest "$b single -c -o -dbx.c" $sing "-c -o dir/$b.o -dumpbase-ext .c -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{.c.???r.final .su !!$gspd .dwo !0 .o} {}} -outest "$b mult -c -dd -dbx.c" $mult "-c -dumpdir dir/ -dumpbase-ext .c -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{-1.c.???r.final -1.su !!$gspd -1.dwo !0 -2.c.???r.final -2.su !!$gspd -2.dwo} {-1.o -2.o}} -outest "$b single -c -o -dbx.x" $sing "-c -o dir/$b.o -dumpbase-ext .x -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{.c.???r.final .su !!$gspd .dwo !0 .o} {}} -outest "$b mult -c -dd -dbx.x" $mult "-c -dumpdir dir/ -dumpbase-ext .x -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{-1.c.???r.final -1.su !!$gspd -1.dwo !0 -2.c.???r.final -2.su !!$gspd -2.dwo} {-1.o -2.o}} -outest "$b obj compare-debug save-temps -dbx.x" $sing "-c -fcompare-debug -save-temps -fdump-rtl-final -fstack-usage $gsplit_dwarf -fdump-final-insns -dumpbase-ext .x" {} {{-0.c.???r.final -0.su -0.i -0.c.gkd -0.s -0.gk.i -0.gk.c.???r.final -0.gk.c.gkd !!$gspd -0.dwo !0 -0.o}} +outest "$b-353 single -c -o -dbx.c" $sing "-c -o dir/$b.o -dumpbase-ext .c -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{.c.???r.final .su !!$gspd .dwo !0 .o} {}} +outest "$b-354 mult -c -dd -dbx.c" $mult "-c -dumpdir dir/ -dumpbase-ext .c -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{-1.c.???r.final -1.su !!$gspd -1.dwo !0 -2.c.???r.final -2.su !!$gspd -2.dwo} {-1.o -2.o}} +outest "$b-355 single -c -o -dbx.x" $sing "-c -o dir/$b.o -dumpbase-ext .x -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{.c.???r.final .su !!$gspd .dwo !0 .o} {}} +outest "$b-356 mult -c -dd -dbx.x" $mult "-c -dumpdir dir/ -dumpbase-ext .x -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{-1.c.???r.final -1.su !!$gspd -1.dwo !0 -2.c.???r.final -2.su !!$gspd -2.dwo} {-1.o -2.o}} +outest "$b-357 obj compare-debug save-temps -dbx.x" $sing "-c -fcompare-debug -save-temps -fdump-rtl-final -fstack-usage $gsplit_dwarf -fdump-final-insns -dumpbase-ext .x" {} {{-0.c.???r.final -0.su -0.i -0.c.gkd -0.s -0.gk.i -0.gk.c.???r.final -0.gk.c.gkd !!$gspd -0.dwo !0 -0.o}} # -dumpbase-ext is dropped if identical to -dumpbase. -outest "$b asm db=dbext 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase a -dumpbase-ext a" {} {{a.???r.final a.su -0.s}} +outest "$b-358 asm db=dbext 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwarf -dumpbase a -dumpbase-ext a" {} {{a.???r.final a.su -0.s}} # Below are examples taken from the documentation. @@ -761,64 +781,64 @@ outest "$b asm db=dbext 1" $sing "-S -fdump-rtl-final -fstack-usage $gsplit_dwar # but we want to make sure behavior matches the docs. # gcc -c foo.c ... -outest "$b doc single -c !-o" $sing "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{-0.c.???r.final -0.su !!$gspd -0.dwo !0 -0.o}} +outest "$b-359 doc single -c !-o" $sing "-c -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{-0.c.???r.final -0.su !!$gspd -0.dwo !0 -0.o}} # gcc -c foo.c -o dir/foobar.o ... -outest "$b doc single -c +-o" $sing "-c -o dir/$b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{.c.???r.final .su !!$gspd .dwo !0 .o} {}} +outest "$b-360 doc single -c +-o" $sing "-c -o dir/$b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{.c.???r.final .su !!$gspd .dwo !0 .o} {}} # gcc foo.c bar.c -o dir/foobar ... -outest "$b doc double !-c -o" $mult "-o dir/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo !0 .exe} {}} +outest "$b-361 doc double !-c -o" $mult "-o dir/$b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo !0 .exe} {}} # gcc foo.c -o dir/foo ... -outest "$b doc single !-c -o" $sing "-o dir/$b-0 -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{-0.c.???r.final -0.su !!$gspd -0.dwo !0 -0} {}} +outest "$b-362 doc single !-c -o" $sing "-o dir/$b-0 -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{-0.c.???r.final -0.su !!$gspd -0.dwo !0 -0} {}} # gcc -save-temps -S foo.c -outest "$b doc single -S -st" $sing "-save-temps -S" {} {{-0.i -0.s}} +outest "$b-363 doc single -S -st" $sing "-save-temps -S" {} {{-0.i -0.s}} # gcc -save-temps -dumpbase save-foo -c foo.c -outest "$b doc single -c -st -db" $sing "-save-temps -dumpbase $b -c" {} {{.i .s -0.o}} +outest "$b-364 doc single -c -st -db" $sing "-save-temps -dumpbase $b -c" {} {{.i .s -0.o}} # gcc foo.c -c -o dir/foo.o -dumpbase alt/foo \ # -dumpdir pfx- -save-temps=cwd ... -outest "$b doc single -c -o -db" $sing "-c -o dir/$b.o -dumpbase alt/$b -dumpdir pfx- -save-temps=cwd -fdump-rtl-final -fstack-usage $gsplit_dwarf" {alt/ dir/} {{.i .s .???r.final .su !!$gspd .dwo} {.o} {}} +outest "$b-365 doc single -c -o -db" $sing "-c -o dir/$b.o -dumpbase alt/$b -dumpdir pfx- -save-temps=cwd -fdump-rtl-final -fstack-usage $gsplit_dwarf" {alt/ dir/} {{.i .s .???r.final .su !!$gspd .dwo} {.o} {}} # gcc foo.c bar.c -c -dumpbase main ... -outest "$b doc double -c !-o -db" $mult "-c -dumpbase $b -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 -1.o --2.c.???r.final --2.su !!$gspd --2.dwo !0 -2.o}} +outest "$b-366 doc double -c !-o -db" $mult "-c -dumpbase $b -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 -1.o --2.c.???r.final --2.su !!$gspd --2.dwo !0 -2.o}} # gcc -c foo.c -o dir/foobar.o -dumpbase '' ... -outest "$b doc single -c -o -db''" $sing "-c -o dir/$b.o -dumpbase \"\" -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{-0.c.???r.final -0.su !!$gspd -0.dwo !0 .o} {}} +outest "$b-367 doc single -c -o -db''" $sing "-c -o dir/$b.o -dumpbase \"\" -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{-0.c.???r.final -0.su !!$gspd -0.dwo !0 .o} {}} if !$skip_lto { # gcc foo.c bar.c -o dir/foobar -dumpbase '' -flto ... -outest "$b doc double !-c -o -db'' -flto" $mult "-o dir/$b.exe -dumpbase \"\" -flto -O2 -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{-1.c.???i.icf !$ltop -1.c.???r.final !0 -2.c.???i.icf !$ltop -2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .exe} {}} +outest "$b-368 doc double !-c -o -db'' -flto" $mult "-o dir/$b.exe -dumpbase \"\" -flto -O2 -flto-partition=one -fdump-ipa-icf-optimized -fdump-rtl-final -fstack-usage" {dir/} {{-1.c.???i.icf !$ltop -1.c.???r.final !0 -2.c.???i.icf !$ltop -2.c.???r.final !0 .wpa.???i.icf .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .exe} {}} } # gcc foo.c -c -o dir/foo.o -dumpbase x-foo.c -dumpbase-ext .c ... -outest "$b doc single -c -o -dbx" $sing "-c -o dir/$b-0.o -dumpbase $b.c -dumpbase-ext .c -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{.c.???r.final .su !!$gspd .dwo !0 -0.o} {}} +outest "$b-369 doc single -c -o -dbx" $sing "-c -o dir/$b-0.o -dumpbase $b.c -dumpbase-ext .c -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{.c.???r.final .su !!$gspd .dwo !0 -0.o} {}} # gcc foo.c bar.c -o main.out -dumpbase-ext .out ... -outest "$b doc double !-c -o -dbx" $mult "-o $b.out -dumpbase-ext .out -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo !0 .out}} +outest "$b-370 doc double !-c -o -dbx" $mult "-o $b.out -dumpbase-ext .out -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo !0 .out}} # gcc -dumpdir pfx- -c foo.c ... -outest "$b doc single -c !-o -dd" $sing "-dumpdir $b- -c -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{--0.c.???r.final --0.su !!$gspd --0.dwo !0 -0.o}} +outest "$b-371 doc single -c !-o -dd" $sing "-dumpdir $b- -c -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{--0.c.???r.final --0.su !!$gspd --0.dwo !0 -0.o}} # gcc -dumpdir dir/ -c foo.c -o obj/bar.o ... -outest "$b doc single -c -o -dd" $sing "-dumpdir dir/ -c -o obj/$b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/ obj/} {{.c.???r.final .su !!$gspd .dwo} {.o} {}} +outest "$b-372 doc single -c -o -dd" $sing "-dumpdir dir/ -c -o obj/$b.o -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/ obj/} {{.c.???r.final .su !!$gspd .dwo} {.o} {}} # gcc -dumpdir pfx- -c foo.c -save-temps=obj ... -outest "$b doc single -c -o -dd -st=" $sing "-dumpdir $b- -c -save-temps=obj -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{-0.c.???r.final -0.su !!$gspd -0.dwo !0 -0.i -0.s -0.o}} +outest "$b-373 doc single -c -o -dd -st=" $sing "-dumpdir $b- -c -save-temps=obj -fdump-rtl-final -fstack-usage $gsplit_dwarf" {} {{-0.c.???r.final -0.su !!$gspd -0.dwo !0 -0.i -0.s -0.o}} # gcc foo.c bar.c -c -dumpdir dir/pfx- -dumpbase main ... -outest "$b doc double -c !-o -dd -db" $mult "-c -dumpdir dir/ -dumpbase $b -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo} {-1.o -2.o}} +outest "$b-374 doc double -c !-o -dd -db" $mult "-c -dumpdir dir/ -dumpbase $b -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{--1.c.???r.final --1.su !!$gspd --1.dwo !0 --2.c.???r.final --2.su !!$gspd --2.dwo} {-1.o -2.o}} # gcc foo.c -c -dumpdir dir/pfx- -dumpbase main ... -outest "$b doc single -c !-o -dd -db" $sing "-c -dumpdir dir/ -dumpbase $b -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{.???r.final .su !!$gspd .dwo} {-0.o}} +outest "$b-375 doc single -c !-o -dd -db" $sing "-c -dumpdir dir/ -dumpbase $b -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{.???r.final .su !!$gspd .dwo} {-0.o}} # gcc foo.c bar.c -dumpdir dir/pfx- -o main ... -outest "$b doc double !-c -o -dd" $mult "-dumpdir dir/ -o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{-1.c.???r.final -1.su !!$gspd -1.dwo !0 -2.c.???r.final -2.su !!$gspd -2.dwo} {.exe}} +outest "$b-376 doc double !-c -o -dd" $mult "-dumpdir dir/ -o $b.exe -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{-1.c.???r.final -1.su !!$gspd -1.dwo !0 -2.c.???r.final -2.su !!$gspd -2.dwo} {.exe}} # gcc foo.c -dumpdir alt/pfx- -o dir/main.exe -save-temps=cwd ... -outest "$b doc single !-c -o -dd -st=" $sing "-c -dumpdir dir/ -dumpbase $b -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{.???r.final .su !!$gspd .dwo} {-0.o}} +outest "$b-377 doc single !-c -o -dd -st=" $sing "-c -dumpdir dir/ -dumpbase $b -fdump-rtl-final -fstack-usage $gsplit_dwarf" {dir/} {{.???r.final .su !!$gspd .dwo} {-0.o}} gcc_parallel_test_enable 1 diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vXXXhn_high.inc b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vXXXhn_high.inc new file mode 100644 index 0000000..e77e845 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vXXXhn_high.inc @@ -0,0 +1,65 @@ +#define FNNAME1(NAME) exec_ ## NAME +#define FNNAME(NAME) FNNAME1(NAME) + +void FNNAME (INSN_NAME) (void) +{ + /* Basic test: v128_r=vXXXhn_high(v64_r, v128_a, v128_b), store result. */ +#define TEST_VXXXHN_HIGH1(INSN, T1, T2, W1, W2, N1, N2) \ + VECT_VAR(v128_r, T1, W2, N2) = INSN##_##T2##W1(VECT_VAR(v64_r, T1, W2, N1), \ + VECT_VAR(v128_a, T1, W1, N1), \ + VECT_VAR(v128_b, T1, W1, N1)); \ + vst1q_##T2##W2(VECT_VAR(result, T1, W2, N2), VECT_VAR(v128_r, T1, W2, N2)) + +#define TEST_VXXXHN_HIGH(INSN, T1, T2, W1, W2, N1, N2) \ + TEST_VXXXHN_HIGH1(INSN, T1, T2, W1, W2, N1, N2) + + DECL_VARIABLE_128BITS_VARIANTS(v128_r); + DECL_VARIABLE_64BITS_VARIANTS(v64_r); + DECL_VARIABLE_128BITS_VARIANTS(v128_a); + DECL_VARIABLE_128BITS_VARIANTS(v128_b); + + clean_results (); + + /* Fill v64_r with a value easy to recognise in the result vector. */ + VDUP(v64_r, , int, s, 8, 8, 0x5); + VDUP(v64_r, , int, s, 16, 4, 0x5); + VDUP(v64_r, , int, s, 32, 2, 0x5); + VDUP(v64_r, , uint, u, 8, 8, 0x5); + VDUP(v64_r, , uint, u, 16, 4, 0x5); + VDUP(v64_r, , uint, u, 32, 2, 0x5); + + /* Fill input v128_a and v128_b with arbitrary values. */ + VDUP(v128_a, q, int, s, 16, 8, 50*(UINT8_MAX+1)); + VDUP(v128_a, q, int, s, 32, 4, 50*(UINT16_MAX+1)); + VDUP(v128_a, q, int, s, 64, 2, 24*((uint64_t)UINT32_MAX+1)); + VDUP(v128_a, q, uint, u, 16, 8, 3*(UINT8_MAX+1)); + VDUP(v128_a, q, uint, u, 32, 4, 55*(UINT16_MAX+1)); + VDUP(v128_a, q, uint, u, 64, 2, 3*((uint64_t)UINT32_MAX+1)); + + VDUP(v128_b, q, int, s, 16, 8, (uint16_t)UINT8_MAX); + VDUP(v128_b, q, int, s, 32, 4, (uint32_t)UINT16_MAX); + VDUP(v128_b, q, int, s, 64, 2, (uint64_t)UINT32_MAX); + VDUP(v128_b, q, uint, u, 16, 8, (uint16_t)UINT8_MAX); + VDUP(v128_b, q, uint, u, 32, 4, (uint32_t)UINT16_MAX); + VDUP(v128_b, q, uint, u, 64, 2, (uint64_t)UINT32_MAX); + + TEST_VXXXHN_HIGH(INSN_NAME, int, s, 16, 8, 8, 16); + TEST_VXXXHN_HIGH(INSN_NAME, int, s, 32, 16, 4, 8); + TEST_VXXXHN_HIGH(INSN_NAME, int, s, 64, 32, 2, 4); + TEST_VXXXHN_HIGH(INSN_NAME, uint, u, 16, 8, 8, 16); + TEST_VXXXHN_HIGH(INSN_NAME, uint, u, 32, 16, 4, 8); + TEST_VXXXHN_HIGH(INSN_NAME, uint, u, 64, 32, 2, 4); + + CHECK(TEST_MSG, int, 8, 16, PRIx8, expected, ""); + CHECK(TEST_MSG, int, 16, 8, PRIx16, expected, ""); + CHECK(TEST_MSG, int, 32, 4, PRIx32, expected, ""); + CHECK(TEST_MSG, uint, 8, 16, PRIx8, expected, ""); + CHECK(TEST_MSG, uint, 16, 8, PRIx16, expected, ""); + CHECK(TEST_MSG, uint, 32, 4, PRIx32, expected, ""); +} + +int main (void) +{ + FNNAME (INSN_NAME) (); + return 0; +} diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vaddhn_high.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vaddhn_high.c new file mode 100644 index 0000000..329dd49 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vaddhn_high.c @@ -0,0 +1,32 @@ +/* { dg-skip-if "" { arm*-*-* } } */ + +#include <arm_neon.h> +#include "arm-neon-ref.h" +#include "compute-ref-data.h" + +#if defined(__cplusplus) +#include <cstdint> +#else +#include <stdint.h> +#endif + +#define INSN_NAME vaddhn_high +#define TEST_MSG "VADDHN_HIGH" + +/* Expected results. */ +VECT_VAR_DECL(expected, int, 8, 16) [] = { 0x5, 0x5, 0x5, 0x5, + 0x5, 0x5, 0x5, 0x5, + 0x32, 0x32, 0x32, 0x32, + 0x32, 0x32, 0x32, 0x32 }; +VECT_VAR_DECL(expected, int, 16, 8) [] = { 0x5, 0x5, 0x5, 0x5, + 0x32, 0x32, 0x32, 0x32 }; +VECT_VAR_DECL(expected, int, 32, 4) [] = { 0x5, 0x5, 0x18, 0x18 }; +VECT_VAR_DECL(expected, uint, 8, 16) [] = { 0x5, 0x5, 0x5, 0x5, + 0x5, 0x5, 0x5, 0x5, + 0x3, 0x3, 0x3, 0x3, + 0x3, 0x3, 0x3, 0x3 }; +VECT_VAR_DECL(expected, uint, 16, 8) [] = { 0x5, 0x5, 0x5, 0x5, + 0x37, 0x37, 0x37, 0x37 }; +VECT_VAR_DECL(expected, uint, 32, 4) [] = { 0x5, 0x5, 0x3, 0x3 }; + +#include "vXXXhn_high.inc" diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vcvt_fXX_fXX.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vcvt_fXX_fXX.c new file mode 100644 index 0000000..248f37a --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vcvt_fXX_fXX.c @@ -0,0 +1,100 @@ +/* { dg-skip-if "" { arm*-*-* } } */ + +#include <arm_neon.h> +#include "arm-neon-ref.h" +#include "compute-ref-data.h" +#include <math.h> + +/* Expected results for vcvt_f64_f32. */ +VECT_VAR_DECL (expected, hfloat, 64, 2) [] = { 0x4030000000000000, + 0x402e000000000000}; +/* Expected results for vcvt_f32_f64. */ +VECT_VAR_DECL (expected, hfloat, 32, 2) [] = { 0x3fc00000, 0x40200000 }; + +/* Expected results for vcvt_high_f64_f32. */ +VECT_VAR_DECL (expected_high, hfloat, 64, 2) [] = { 0xc02c000000000000, + 0xc02a000000000000 }; +/* Expected results for vcvt_high_f32_f64. */ +VECT_VAR_DECL (expected_high, hfloat, 32, 4) [] = { 0x40000000, 0x40000000, + 0x3fc00000, 0x40200000 }; + +void +exec_vcvt (void) +{ + clean_results (); + +#define TEST_MSG "vcvt_f64_f32" + { + VECT_VAR_DECL (buffer_src, float, 32, 2) [] = { 16.0, 15.0 }; + + DECL_VARIABLE (vector_src, float, 32, 2); + + VLOAD (vector_src, buffer_src, , float, f, 32, 2); + DECL_VARIABLE (vector_res, float, 64, 2) = + vcvt_f64_f32 (VECT_VAR (vector_src, float, 32, 2)); + vst1q_f64 (VECT_VAR (result, float, 64, 2), + VECT_VAR (vector_res, float, 64, 2)); + + CHECK_FP (TEST_MSG, float, 64, 2, PRIx64, expected, ""); + } +#undef TEST_MSG + + clean_results (); + +#define TEST_MSG "vcvt_f32_f64" + { + VECT_VAR_DECL (buffer_src, float, 64, 2) [] = { 1.500000025, 2.500000025 }; + DECL_VARIABLE (vector_src, float, 64, 2); + + VLOAD (vector_src, buffer_src, q, float, f, 64, 2); + DECL_VARIABLE (vector_res, float, 32, 2) = + vcvt_f32_f64 (VECT_VAR (vector_src, float, 64, 2)); + vst1_f32 (VECT_VAR (result, float, 32, 2), + VECT_VAR (vector_res, float, 32, 2)); + + CHECK_FP (TEST_MSG, float, 32, 2, PRIx32, expected, ""); + } +#undef TEST_MSG + + clean_results (); + +#define TEST_MSG "vcvt_high_f64_f32" + { + DECL_VARIABLE (vector_src, float, 32, 4); + VLOAD (vector_src, buffer, q, float, f, 32, 4); + DECL_VARIABLE (vector_res, float, 64, 2); + VECT_VAR (vector_res, float, 64, 2) = + vcvt_high_f64_f32 (VECT_VAR (vector_src, float, 32, 4)); + vst1q_f64 (VECT_VAR (result, float, 64, 2), + VECT_VAR (vector_res, float, 64, 2)); + CHECK_FP (TEST_MSG, float, 64, 2, PRIx64, expected_high, ""); + } +#undef TEST_MSG + + clean_results (); + +#define TEST_MSG "vcvt_high_f32_f64" + { + VECT_VAR_DECL (buffer_src, float, 64, 2) [] = { 1.500000025, 2.500000025 }; + DECL_VARIABLE (vector_low, float, 32, 2); + VDUP (vector_low, , float, f, 32, 2, 2.0); + + DECL_VARIABLE (vector_src, float, 64, 2); + VLOAD (vector_src, buffer_src, q, float, f, 64, 2); + + DECL_VARIABLE (vector_res, float, 32, 4) = + vcvt_high_f32_f64 (VECT_VAR (vector_low, float, 32, 2), + VECT_VAR (vector_src, float, 64, 2)); + vst1q_f32 (VECT_VAR (result, float, 32, 4), + VECT_VAR (vector_res, float, 32, 4)); + + CHECK_FP (TEST_MSG, float, 32, 4, PRIx32, expected_high, ""); + } +} + +int +main (void) +{ + exec_vcvt (); + return 0; +} diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vcvtx.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vcvtx.c new file mode 100644 index 0000000..8687204 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vcvtx.c @@ -0,0 +1,83 @@ +/* { dg-skip-if "" { arm*-*-* } } */ + +#include <arm_neon.h> +#include "arm-neon-ref.h" +#include "compute-ref-data.h" +#include <math.h> + +/* Expected results for vcvtx_f32_f64 and vcvtxd_f32_f64. */ +VECT_VAR_DECL (expected, hfloat, 32, 2) [] = { 0x3fc00001, 0x40200001 }; + +/* Expected results for vcvtx_high_f32_f64. */ +VECT_VAR_DECL (expected_high, hfloat, 32, 4) [] = { 0x40000000, 0x40000000, + 0x3fc00001, 0x40200001 }; + +void +exec_vcvtx (void) +{ + clean_results (); + +#define TEST_MSG "vcvtx_f32_f64" + { + VECT_VAR_DECL (buffer_src, float, 64, 2) [] = { 1.500000025, 2.500000025 }; + DECL_VARIABLE (vector_src, float, 64, 2); + + VLOAD (vector_src, buffer_src, q, float, f, 64, 2); + DECL_VARIABLE (vector_res, float, 32, 2) = + vcvtx_f32_f64 (VECT_VAR (vector_src, float, 64, 2)); + vst1_f32 (VECT_VAR (result, float, 32, 2), + VECT_VAR (vector_res, float, 32, 2)); + + CHECK_FP (TEST_MSG, float, 32, 2, PRIx32, expected, ""); + } +#undef TEST_MSG + + clean_results (); + +#define TEST_MSG "vcvtxd_f32_f64" + { + DECL_VARIABLE (vector_src, float, 32, 2); + VDUP (vector_src, , float, f, 32, 2, 0.0); + + DECL_VARIABLE (vector_res, float, 32, 2) = + vset_lane_f32(vcvtxd_f32_f64 (1.500000025), + VECT_VAR (vector_src, float, 32, 2), + 0); + VECT_VAR (vector_res, float, 32, 2) = + vset_lane_f32(vcvtxd_f32_f64 (2.500000025), + VECT_VAR (vector_res, float, 32, 2), + 1); + vst1_f32 (VECT_VAR (result, float, 32, 2), + VECT_VAR (vector_res, float, 32, 2)); + + CHECK_FP (TEST_MSG, float, 32, 2, PRIx32, expected, ""); + } +#undef TEST_MSG + + clean_results (); + +#define TEST_MSG "vcvtx_high_f32_f64" + { + VECT_VAR_DECL (buffer_src, float, 64, 2) [] = { 1.500000025, 2.500000025 }; + DECL_VARIABLE (vector_low, float, 32, 2); + VDUP (vector_low, , float, f, 32, 2, 2.0); + + DECL_VARIABLE (vector_src, float, 64, 2); + VLOAD (vector_src, buffer_src, q, float, f, 64, 2); + + DECL_VARIABLE (vector_res, float, 32, 4) = + vcvtx_high_f32_f64 (VECT_VAR (vector_low, float, 32, 2), + VECT_VAR (vector_src, float, 64, 2)); + vst1q_f32 (VECT_VAR (result, float, 32, 4), + VECT_VAR (vector_res, float, 32, 4)); + + CHECK_FP (TEST_MSG, float, 32, 4, PRIx32, expected_high, ""); + } +} + +int +main (void) +{ + exec_vcvtx (); + return 0; +} diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vmovn_high.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vmovn_high.c new file mode 100644 index 0000000..e05a40f --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vmovn_high.c @@ -0,0 +1,73 @@ +/* { dg-skip-if "" { arm*-*-* } } */ + +#include <arm_neon.h> +#include "arm-neon-ref.h" +#include "compute-ref-data.h" + +/* Expected results. */ +VECT_VAR_DECL(expected, int, 8, 16) [] = { 0x5, 0x5, 0x5, 0x5, + 0x5, 0x5, 0x5, 0x5, + 0xf0, 0xf1, 0xf2, 0xf3, + 0xf4, 0xf5, 0xf6, 0xf7 }; +VECT_VAR_DECL(expected, int, 16, 8) [] = { 0x5, 0x5, 0x5, 0x5, + 0xfff0, 0xfff1, 0xfff2, 0xfff3 }; +VECT_VAR_DECL(expected, int, 32, 4) [] = { 0x5, 0x5, 0xfffffff0, 0xfffffff1 }; +VECT_VAR_DECL(expected, uint, 8, 16) [] = { 0x5, 0x5, 0x5, 0x5, + 0x5, 0x5, 0x5, 0x5, + 0xf0, 0xf1, 0xf2, 0xf3, + 0xf4, 0xf5, 0xf6, 0xf7 }; +VECT_VAR_DECL(expected, uint, 16, 8) [] = { 0x5, 0x5, 0x5, 0x5, + 0xfff0, 0xfff1, 0xfff2, 0xfff3 }; +VECT_VAR_DECL(expected, uint, 32, 4) [] = { 0x5, 0x5, 0xfffffff0, 0xfffffff1 }; + +#define TEST_MSG "VMOVN_HIGH" +void exec_vmovn_high (void) +{ + /* Basic test: vec128_r=vmovn_high(vec64_r, vec128_x), store the result. */ +#define TEST_VMOVN_HIGH(T1, T2, W1, W2, N1, N2) \ + VECT_VAR(vec128_r, T1, W2, N2) = \ + vmovn_high_##T2##W1(VECT_VAR(vec64_r, T1, W2, N1), \ + VECT_VAR(vec128_x, T1, W1, N1)); \ + vst1q_##T2##W2(VECT_VAR(result, T1, W2, N2), VECT_VAR(vec128_r, T1, W2, N2)) + + DECL_VARIABLE_128BITS_VARIANTS(vec128_r); + DECL_VARIABLE_64BITS_VARIANTS(vec64_r); + DECL_VARIABLE_128BITS_VARIANTS(vec128_x); + + clean_results (); + + /* Fill vec64_r with a value easy to recognise in the result vector. */ + VDUP(vec64_r, , int, s, 8, 8, 0x5); + VDUP(vec64_r, , int, s, 16, 4, 0x5); + VDUP(vec64_r, , int, s, 32, 2, 0x5); + VDUP(vec64_r, , uint, u, 8, 8, 0x5); + VDUP(vec64_r, , uint, u, 16, 4, 0x5); + VDUP(vec64_r, , uint, u, 32, 2, 0x5); + + VLOAD(vec128_x, buffer, q, int, s, 16, 8); + VLOAD(vec128_x, buffer, q, int, s, 32, 4); + VLOAD(vec128_x, buffer, q, int, s, 64, 2); + VLOAD(vec128_x, buffer, q, uint, u, 16, 8); + VLOAD(vec128_x, buffer, q, uint, u, 32, 4); + VLOAD(vec128_x, buffer, q, uint, u, 64, 2); + + TEST_VMOVN_HIGH(int, s, 16, 8, 8, 16); + TEST_VMOVN_HIGH(int, s, 32, 16, 4, 8); + TEST_VMOVN_HIGH(int, s, 64, 32, 2, 4); + TEST_VMOVN_HIGH(uint, u, 16, 8, 8, 16); + TEST_VMOVN_HIGH(uint, u, 32, 16, 4, 8); + TEST_VMOVN_HIGH(uint, u, 64, 32, 2, 4); + + CHECK(TEST_MSG, int, 8, 16, PRIx8, expected, ""); + CHECK(TEST_MSG, int, 16, 8, PRIx16, expected, ""); + CHECK(TEST_MSG, int, 32, 4, PRIx32, expected, ""); + CHECK(TEST_MSG, uint, 8, 16, PRIx8, expected, ""); + CHECK(TEST_MSG, uint, 16, 8, PRIx16, expected, ""); + CHECK(TEST_MSG, uint, 32, 4, PRIx32, expected, ""); +} + +int main (void) +{ + exec_vmovn_high (); + return 0; +} diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vqmovn_high.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vqmovn_high.c new file mode 100644 index 0000000..cb4f5c8 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vqmovn_high.c @@ -0,0 +1,121 @@ +/* { dg-skip-if "" { arm*-*-* } } */ + +#include <arm_neon.h> +#include "arm-neon-ref.h" +#include "compute-ref-data.h" + +/* Expected results. */ +VECT_VAR_DECL(expected, int, 8, 16) [] = { 0x5, 0x5, 0x5, 0x5, + 0x5, 0x5, 0x5, 0x5, + 0x12, 0x12, 0x12, 0x12, + 0x12, 0x12, 0x12, 0x12 }; +VECT_VAR_DECL(expected, int, 16, 8) [] = { 0x5, 0x5, 0x5, 0x5, + 0x1278, 0x1278, 0x1278, 0x1278 }; +VECT_VAR_DECL(expected, int, 32, 4) [] = { 0x5, 0x5, 0x12345678, 0x12345678 }; +VECT_VAR_DECL(expected, uint, 8, 16) [] = { 0x5, 0x5, 0x5, 0x5, + 0x5, 0x5, 0x5, 0x5, + 0x82, 0x82, 0x82, 0x82, + 0x82, 0x82, 0x82, 0x82 }; +VECT_VAR_DECL(expected, uint, 16, 8) [] = { 0x5, 0x5, 0x5, 0x5, + 0x8765, 0x8765, 0x8765, 0x8765 }; +VECT_VAR_DECL(expected, uint, 32, 4) [] = { 0x5, 0x5, 0x87654321, 0x87654321 }; + +/* Expected results when saturation occurs. */ +VECT_VAR_DECL(expected1, int, 8, 16) [] = { 0x5, 0x5, 0x5, 0x5, + 0x5, 0x5, 0x5, 0x5, + 0x7f, 0x7f, 0x7f, 0x7f, + 0x7f, 0x7f, 0x7f, 0x7f }; +VECT_VAR_DECL(expected1, int, 16, 8) [] = { 0x5, 0x5, 0x5, 0x5, + 0x7fff, 0x7fff, 0x7fff, 0x7fff }; +VECT_VAR_DECL(expected1, int, 32, 4) [] = { 0x5, 0x5, 0x7fffffff, 0x7fffffff }; +VECT_VAR_DECL(expected1, uint, 8, 16) [] = { 0x5, 0x5, 0x5, 0x5, + 0x5, 0x5, 0x5, 0x5, + 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff }; +VECT_VAR_DECL(expected1, uint, 16, 8) [] = { 0x5, 0x5, 0x5, 0x5, + 0xffff, 0xffff, 0xffff, 0xffff }; +VECT_VAR_DECL(expected1, uint, 32, 4) [] = { 0x5, 0x5, + 0xffffffff, 0xffffffff }; + +#define TEST_MSG "VQMOVN_HIGH" +void exec_vqmovn_high (void) +{ + /* Basic test: vec128_r=vqmovn_high(vec64_r,vec128_x), store the result. */ +#define TEST_VQMOVN_HIGH(T1, T2, W1, W2, N1, N2, CMT) \ + Set_Neon_Cumulative_Sat(0, VECT_VAR(vec128_r, T1, W1, N2)); \ + VECT_VAR(vec128_r, T1, W1, N2) = \ + vqmovn_high_##T2##W2(VECT_VAR(vec64_r, T1, W1, N1), \ + VECT_VAR(vec128_x, T1, W2, N1)); \ + vst1q##_##T2##W1(VECT_VAR(result, T1, W1, N2), \ + VECT_VAR(vec128_r, T1, W1, N2)) + + DECL_VARIABLE_128BITS_VARIANTS(vec128_r); + DECL_VARIABLE_64BITS_VARIANTS(vec64_r); + DECL_VARIABLE_128BITS_VARIANTS(vec128_x); + + clean_results (); + + /* Fill vec64_r with a value easy to recognise in the result vector. */ + VDUP(vec64_r, , int, s, 8, 8, 0x5); + VDUP(vec64_r, , int, s, 16, 4, 0x5); + VDUP(vec64_r, , int, s, 32, 2, 0x5); + VDUP(vec64_r, , uint, u, 8, 8, 0x5); + VDUP(vec64_r, , uint, u, 16, 4, 0x5); + VDUP(vec64_r, , uint, u, 32, 2, 0x5); + + /* Fill input vector with arbitrary values. */ + VDUP(vec128_x, q, int, s, 16, 8, 0x12); + VDUP(vec128_x, q, int, s, 32, 4, 0x1278); + VDUP(vec128_x, q, int, s, 64, 2, 0x12345678); + VDUP(vec128_x, q, uint, u, 16, 8, 0x82); + VDUP(vec128_x, q, uint, u, 32, 4, 0x8765); + VDUP(vec128_x, q, uint, u, 64, 2, 0x87654321); + + +#define CMT "" + TEST_VQMOVN_HIGH(int, s, 8, 16, 8, 16, CMT); + TEST_VQMOVN_HIGH(int, s, 16, 32, 4, 8, CMT); + TEST_VQMOVN_HIGH(int, s, 32, 64, 2, 4, CMT); + TEST_VQMOVN_HIGH(uint, u, 8, 16, 8, 16, CMT); + TEST_VQMOVN_HIGH(uint, u, 16, 32, 4, 8, CMT); + TEST_VQMOVN_HIGH(uint, u, 32, 64, 2, 4, CMT); + + CHECK(TEST_MSG, int, 8, 16, PRIx8, expected, CMT); + CHECK(TEST_MSG, int, 16, 8, PRIx16, expected, CMT); + CHECK(TEST_MSG, int, 32, 4, PRIx32, expected, CMT); + CHECK(TEST_MSG, uint, 8, 16, PRIx8, expected, CMT); + CHECK(TEST_MSG, uint, 16, 8, PRIx16, expected, CMT); + CHECK(TEST_MSG, uint, 32, 4, PRIx32, expected, CMT); + + + /* Fill input vector with arbitrary values which cause cumulative + saturation. */ + VDUP(vec128_x, q, int, s, 16, 8, 0x1234); + VDUP(vec128_x, q, int, s, 32, 4, 0x12345678); + VDUP(vec128_x, q, int, s, 64, 2, 0x1234567890ABLL); + VDUP(vec128_x, q, uint, u, 16, 8, 0x8234); + VDUP(vec128_x, q, uint, u, 32, 4, 0x87654321); + VDUP(vec128_x, q, uint, u, 64, 2, 0x8765432187654321ULL); + +#undef CMT +#define CMT " (with saturation)" + TEST_VQMOVN_HIGH(int, s, 8, 16, 8, 16, CMT); + TEST_VQMOVN_HIGH(int, s, 16, 32, 4, 8, CMT); + TEST_VQMOVN_HIGH(int, s, 32, 64, 2, 4, CMT); + TEST_VQMOVN_HIGH(uint, u, 8, 16, 8, 16, CMT); + TEST_VQMOVN_HIGH(uint, u, 16, 32, 4, 8, CMT); + TEST_VQMOVN_HIGH(uint, u, 32, 64, 2, 4, CMT); + + CHECK(TEST_MSG, int, 8, 16, PRIx8, expected1, CMT); + CHECK(TEST_MSG, int, 16, 8, PRIx16, expected1, CMT); + CHECK(TEST_MSG, int, 32, 4, PRIx32, expected1, CMT); + CHECK(TEST_MSG, uint, 8, 16, PRIx8, expected1, CMT); + CHECK(TEST_MSG, uint, 16, 8, PRIx16, expected1, CMT); + CHECK(TEST_MSG, uint, 32, 4, PRIx32, expected1, CMT); +} + +int main (void) +{ + exec_vqmovn_high (); + return 0; +} diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vqmovun_high.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vqmovun_high.c new file mode 100644 index 0000000..7b2a0ea --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vqmovun_high.c @@ -0,0 +1,91 @@ +/* { dg-skip-if "" { arm*-*-* } } */ + +#include <arm_neon.h> +#include "arm-neon-ref.h" +#include "compute-ref-data.h" + +/* Expected results. */ +VECT_VAR_DECL(expected, uint, 8, 16) [] = { 0x5, 0x5, 0x5, 0x5, + 0x5, 0x5, 0x5, 0x5, + 0x34, 0x34, 0x34, 0x34, + 0x34, 0x34, 0x34, 0x34 }; +VECT_VAR_DECL(expected, uint, 16, 8) [] = { 0x5, 0x5, 0x5, 0x5, + 0x5678, 0x5678, 0x5678, 0x5678 }; +VECT_VAR_DECL(expected, uint, 32, 4) [] = { 0x5, 0x5, 0x12345678, 0x12345678 }; + +/* Expected results with negative input. */ +VECT_VAR_DECL(expected_neg, uint, 8, 16) [] = { 0x5, 0x5, 0x5, 0x5, + 0x5, 0x5, 0x5, 0x5, + 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0 }; +VECT_VAR_DECL(expected_neg, uint, 16, 8) [] = { 0x5, 0x5, 0x5, 0x5, + 0x0, 0x0, 0x0, 0x0 }; +VECT_VAR_DECL(expected_neg, uint, 32, 4) [] = { 0x5, 0x5, 0x0, 0x0 }; + +#define TEST_MSG "VQMOVUN_HIGH" +void exec_vqmovun_high (void) +{ + /* Basic test: vec128_r=vqmovun_high(vec64)_r, vec128_x), store result. */ +#define TEST_VQMOVUN_HIGH(T1, T2, W1, W2, N1, N2, CMT) \ + Set_Neon_Cumulative_Sat(0, VECT_VAR(vec128_r, T1, W1, N2)); \ + VECT_VAR(vec128_r, T1, W1, N2) = \ + vqmovun_high_s##W2(VECT_VAR(vec64_r, uint, W1, N1), \ + VECT_VAR(vec128_x, int, W2, N1)); \ + vst1q##_u##W1(VECT_VAR(result, T1, W1, N2), VECT_VAR(vec128_r, T1, W1, N2)) + + DECL_VARIABLE(vec64_r, uint, 8, 8); + DECL_VARIABLE(vec64_r, uint, 16, 4); + DECL_VARIABLE(vec64_r, uint, 32, 2); + + DECL_VARIABLE(vec128_x, int, 16, 8); + DECL_VARIABLE(vec128_x, int, 32, 4); + DECL_VARIABLE(vec128_x, int, 64, 2); + + DECL_VARIABLE(vec128_r, uint, 8, 16); + DECL_VARIABLE(vec128_r, uint, 16, 8); + DECL_VARIABLE(vec128_r, uint, 32, 4); + + clean_results (); + + /* Fill vec64_r with a value easy to recognise in the result vector. */ + VDUP(vec64_r, , uint, u, 8, 8, 0x5); + VDUP(vec64_r, , uint, u, 16, 4, 0x5); + VDUP(vec64_r, , uint, u, 32, 2, 0x5); + + /* Fill input vector with arbitrary values. */ + VDUP(vec128_x, q, int, s, 16, 8, 0x34); + VDUP(vec128_x, q, int, s, 32, 4, 0x5678); + VDUP(vec128_x, q, int, s, 64, 2, 0x12345678); + + +#define CMT "" + TEST_VQMOVUN_HIGH(uint, u, 8, 16, 8, 16, CMT); + TEST_VQMOVUN_HIGH(uint, u, 16, 32, 4, 8, CMT); + TEST_VQMOVUN_HIGH(uint, u, 32, 64, 2, 4, CMT); + + CHECK(TEST_MSG, uint, 8, 16, PRIx8, expected, CMT); + CHECK(TEST_MSG, uint, 16, 8, PRIx16, expected, CMT); + CHECK(TEST_MSG, uint, 32, 4, PRIx32, expected, CMT); + + /* Fill input vector with negative values. */ + VDUP(vec128_x, q, int, s, 16, 8, 0x8234); + VDUP(vec128_x, q, int, s, 32, 4, 0x87654321); + VDUP(vec128_x, q, int, s, 64, 2, 0x8765432187654321LL); + + +#undef CMT +#define CMT " (negative input)" + TEST_VQMOVUN_HIGH(uint, u, 8, 16, 8, 16, CMT); + TEST_VQMOVUN_HIGH(uint, u, 16, 32, 4, 8, CMT); + TEST_VQMOVUN_HIGH(uint, u, 32, 64, 2, 4, CMT); + + CHECK(TEST_MSG, uint, 8, 16, PRIx8, expected_neg, CMT); + CHECK(TEST_MSG, uint, 16, 8, PRIx16, expected_neg, CMT); + CHECK(TEST_MSG, uint, 32, 4, PRIx32, expected_neg, CMT); +} + +int main (void) +{ + exec_vqmovun_high (); + return 0; +} diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vraddhn_high.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vraddhn_high.c new file mode 100644 index 0000000..c0cd938 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vraddhn_high.c @@ -0,0 +1,32 @@ +/* { dg-skip-if "" { arm*-*-* } } */ + +#include <arm_neon.h> +#include "arm-neon-ref.h" +#include "compute-ref-data.h" + +#if defined(__cplusplus) +#include <cstdint> +#else +#include <stdint.h> +#endif + +#define INSN_NAME vraddhn_high +#define TEST_MSG "VRADDHN_HIGH" + +/* Expected results. */ +VECT_VAR_DECL(expected, int, 8, 16) [] = { 0x5, 0x5, 0x5, 0x5, + 0x5, 0x5, 0x5, 0x5, + 0x33, 0x33, 0x33, 0x33, + 0x33, 0x33, 0x33, 0x33 }; +VECT_VAR_DECL(expected, int, 16, 8) [] = { 0x5, 0x5, 0x5, 0x5, + 0x33, 0x33, 0x33, 0x33 }; +VECT_VAR_DECL(expected, int, 32, 4) [] = { 0x5, 0x5, 0x19, 0x19 }; +VECT_VAR_DECL(expected, uint, 8, 16) [] = { 0x5, 0x5, 0x5, 0x5, + 0x5, 0x5, 0x5, 0x5, + 0x4, 0x4, 0x4, 0x4, + 0x4, 0x4, 0x4, 0x4 }; +VECT_VAR_DECL(expected, uint, 16, 8) [] = { 0x5, 0x5, 0x5, 0x5, + 0x38, 0x38, 0x38, 0x38 }; +VECT_VAR_DECL(expected, uint, 32, 4) [] = { 0x5, 0x5, 0x4, 0x4 }; + +#include "vXXXhn_high.inc" diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vrshrn_high_n.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vrshrn_high_n.c new file mode 100644 index 0000000..b570ddc --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vrshrn_high_n.c @@ -0,0 +1,177 @@ +/* { dg-skip-if "" { arm*-*-* } } */ + +#include <arm_neon.h> +#include "arm-neon-ref.h" +#include "compute-ref-data.h" + +/* Expected results with input=0. */ +VECT_VAR_DECL(expected_0, int, 8, 16) [] = { 0x5, 0x5, 0x5, 0x5, + 0x5, 0x5, 0x5, 0x5, + 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0 }; +VECT_VAR_DECL(expected_0, int, 16, 8) [] = { 0x5, 0x5, 0x5, 0x5, + 0x0, 0x0, 0x0, 0x0 }; +VECT_VAR_DECL(expected_0, int, 32, 4) [] = { 0x5, 0x5, 0x0, 0x0 }; +VECT_VAR_DECL(expected_0, uint, 8, 16) [] = { 0x5, 0x5, 0x5, 0x5, + 0x5, 0x5, 0x5, 0x5, + 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0 }; +VECT_VAR_DECL(expected_0, uint, 16, 8) [] = { 0x5, 0x5, 0x5, 0x5, + 0x0, 0x0, 0x0, 0x0 }; +VECT_VAR_DECL(expected_0, uint, 32, 4) [] = { 0x5, 0x5, 0x0, 0x0 }; + +/* Expected results. */ +VECT_VAR_DECL(expected, int, 8, 16) [] = { 0x5, 0x5, 0x5, 0x5, + 0x5, 0x5, 0x5, 0x5, + 0xf8, 0xf9, 0xf9, 0xfa, + 0xfa, 0xfb, 0xfb, 0xfc }; +VECT_VAR_DECL(expected, int, 16, 8) [] = { 0x5, 0x5, 0x5, 0x5, + 0xfff8, 0xfff9, 0xfff9, 0xfffa }; +VECT_VAR_DECL(expected, int, 32, 4) [] = { 0x5, 0x5, 0xfffffffc, 0xfffffffc }; +VECT_VAR_DECL(expected, uint, 8, 16) [] = { 0x5, 0x5, 0x5, 0x5, + 0x5, 0x5, 0x5, 0x5, + 0xfc, 0xfc, 0xfd, 0xfd, + 0xfd, 0xfd, 0xfe, 0xfe }; +VECT_VAR_DECL(expected, uint, 16, 8) [] = { 0x5, 0x5, 0x5, 0x5, + 0xfffe, 0xfffe, 0xfffe, 0xfffe }; +VECT_VAR_DECL(expected, uint, 32, 4) [] = { 0x5, 0x5, 0xfffffffe, 0xfffffffe }; + +/* Expected results with large shift amount. */ +VECT_VAR_DECL(expected_sh_large, int, 8, 16) [] = { 0x5, 0x5, 0x5, 0x5, + 0x5, 0x5, 0x5, 0x5, + 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0 }; +VECT_VAR_DECL(expected_sh_large, int, 16, 8) [] = { 0x5, 0x5, 0x5, 0x5, + 0x0, 0x0, 0x0, 0x0 }; +VECT_VAR_DECL(expected_sh_large, int, 32, 4) [] = { 0x5, 0x5, 0x0, 0x0 }; +VECT_VAR_DECL(expected_sh_large, uint, 8, 16) [] = { 0x5, 0x5, 0x5, 0x5, + 0x5, 0x5, 0x5, 0x5, + 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0 }; +VECT_VAR_DECL(expected_sh_large, uint, 16, 8) [] = { 0x5, 0x5, 0x5, 0x5, + 0x0, 0x0, 0x0, 0x0 }; +VECT_VAR_DECL(expected_sh_large, uint, 32, 4) [] = { 0x5, 0x5, 0x0, 0x0 }; + +#define TEST_MSG "VRSHRN_HIGH_N" +void exec_vrshrn_high_n (void) +{ + /* Basic test: y=vrshrn_high_n(r,x,v), then store the result. */ +#define TEST_VRSHRN_HIGH_N(T1, T2, W1, W2, N1, N2, V) \ + VECT_VAR(vector_res, T1, W2, N2) = \ + vrshrn_high_n_##T2##W1(VECT_VAR(vector_res_lo, T1, W2, N1), \ + VECT_VAR(vector, T1, W1, N1), \ + V); \ + vst1q_##T2##W2(VECT_VAR(result, T1, W2, N2), VECT_VAR(vector_res, T1, W2, N2)) + + DECL_VARIABLE(vector_res_lo, int, 8, 8); + DECL_VARIABLE(vector_res_lo, int, 16, 4); + DECL_VARIABLE(vector_res_lo, int, 32, 2); + DECL_VARIABLE(vector_res_lo, uint, 8, 8); + DECL_VARIABLE(vector_res_lo, uint, 16, 4); + DECL_VARIABLE(vector_res_lo, uint, 32, 2); + + DECL_VARIABLE(vector, int, 16, 8); + DECL_VARIABLE(vector, int, 32, 4); + DECL_VARIABLE(vector, int, 64, 2); + DECL_VARIABLE(vector, uint, 16, 8); + DECL_VARIABLE(vector, uint, 32, 4); + DECL_VARIABLE(vector, uint, 64, 2); + + DECL_VARIABLE(vector_res, int, 8, 16); + DECL_VARIABLE(vector_res, int, 16, 8); + DECL_VARIABLE(vector_res, int, 32, 4); + DECL_VARIABLE(vector_res, uint, 8, 16); + DECL_VARIABLE(vector_res, uint, 16, 8); + DECL_VARIABLE(vector_res, uint, 32, 4); + + clean_results (); + + /* Fill vector_res_lo with a value easy to recognise in the result vector. */ + VDUP(vector_res_lo, , int, s, 8, 8, 0x5); + VDUP(vector_res_lo, , int, s, 16, 4, 0x5); + VDUP(vector_res_lo, , int, s, 32, 2, 0x5); + VDUP(vector_res_lo, , uint, u, 8, 8, 0x5); + VDUP(vector_res_lo, , uint, u, 16, 4, 0x5); + VDUP(vector_res_lo, , uint, u, 32, 2, 0x5); + + /* Fill input vector with 0, to check behavior on limits. */ + VDUP(vector, q, int, s, 16, 8, 0); + VDUP(vector, q, int, s, 32, 4, 0); + VDUP(vector, q, int, s, 64, 2, 0); + VDUP(vector, q, uint, u, 16, 8, 0); + VDUP(vector, q, uint, u, 32, 4, 0); + VDUP(vector, q, uint, u, 64, 2, 0); + + /* Choose shift amount arbitrarily. */ + TEST_VRSHRN_HIGH_N(int, s, 16, 8, 8, 16, 1); + TEST_VRSHRN_HIGH_N(int, s, 32, 16, 4, 8, 1); + TEST_VRSHRN_HIGH_N(int, s, 64, 32, 2, 4, 2); + TEST_VRSHRN_HIGH_N(uint, u, 16, 8, 8, 16, 2); + TEST_VRSHRN_HIGH_N(uint, u, 32, 16, 4, 8, 3); + TEST_VRSHRN_HIGH_N(uint, u, 64, 32, 2, 4, 3); + +#define CMT " (with input = 0)" + CHECK(TEST_MSG, int, 8, 16, PRIx8, expected_0, CMT); + CHECK(TEST_MSG, int, 16, 8, PRIx16, expected_0, CMT); + CHECK(TEST_MSG, int, 32, 4, PRIx32, expected_0, CMT); + CHECK(TEST_MSG, uint, 8, 16, PRIx8, expected_0, CMT); + CHECK(TEST_MSG, uint, 16, 8, PRIx16, expected_0, CMT); + CHECK(TEST_MSG, uint, 32, 4, PRIx32, expected_0, CMT); + + + /* Test again, with predefined input values. */ + VLOAD(vector, buffer, q, int, s, 16, 8); + VLOAD(vector, buffer, q, int, s, 32, 4); + VLOAD(vector, buffer, q, int, s, 64, 2); + VLOAD(vector, buffer, q, uint, u, 16, 8); + VLOAD(vector, buffer, q, uint, u, 32, 4); + VLOAD(vector, buffer, q, uint, u, 64, 2); + + /* Choose shift amount arbitrarily. */ + TEST_VRSHRN_HIGH_N(int, s, 16, 8, 8, 16, 1); + TEST_VRSHRN_HIGH_N(int, s, 32, 16, 4, 8, 1); + TEST_VRSHRN_HIGH_N(int, s, 64, 32, 2, 4, 2); + TEST_VRSHRN_HIGH_N(uint, u, 16, 8, 8, 16, 2); + TEST_VRSHRN_HIGH_N(uint, u, 32, 16, 4, 8, 3); + TEST_VRSHRN_HIGH_N(uint, u, 64, 32, 2, 4, 3); + +#undef CMT +#define CMT "" + CHECK(TEST_MSG, int, 8, 16, PRIx8, expected, CMT); + CHECK(TEST_MSG, int, 16, 8, PRIx16, expected, CMT); + CHECK(TEST_MSG, int, 32, 4, PRIx32, expected, CMT); + CHECK(TEST_MSG, uint, 8, 16, PRIx8, expected, CMT); + CHECK(TEST_MSG, uint, 16, 8, PRIx16, expected, CMT); + CHECK(TEST_MSG, uint, 32, 4, PRIx32, expected, CMT); + + /* Fill input arbitrary values. */ + VDUP(vector, q, int, s, 16, 8, 30); + VDUP(vector, q, int, s, 32, 4, 0); + VDUP(vector, q, int, s, 64, 2, 0); + VDUP(vector, q, uint, u, 16, 8, 0xFFF0); + VDUP(vector, q, uint, u, 32, 4, 0xFFFFFFF0); + VDUP(vector, q, uint, u, 64, 2, 0); + + /* Choose large shift amount arbitrarily. */ + TEST_VRSHRN_HIGH_N(int, s, 16, 8, 8, 16, 7); + TEST_VRSHRN_HIGH_N(int, s, 32, 16, 4, 8, 14); + TEST_VRSHRN_HIGH_N(int, s, 64, 32, 2, 4, 31); + TEST_VRSHRN_HIGH_N(uint, u, 16, 8, 8, 16, 7); + TEST_VRSHRN_HIGH_N(uint, u, 32, 16, 4, 8, 16); + TEST_VRSHRN_HIGH_N(uint, u, 64, 32, 2, 4, 3); + +#undef CMT +#define CMT " (with large shift amount)" + CHECK(TEST_MSG, int, 8, 16, PRIx8, expected_sh_large, CMT); + CHECK(TEST_MSG, int, 16, 8, PRIx16, expected_sh_large, CMT); + CHECK(TEST_MSG, int, 32, 4, PRIx32, expected_sh_large, CMT); + CHECK(TEST_MSG, uint, 8, 16, PRIx8, expected_sh_large, CMT); + CHECK(TEST_MSG, uint, 16, 8, PRIx16, expected_sh_large, CMT); + CHECK(TEST_MSG, uint, 32, 4, PRIx32, expected_sh_large, CMT); +} + +int main (void) +{ + exec_vrshrn_high_n (); + return 0; +} diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vrsubhn_high.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vrsubhn_high.c new file mode 100644 index 0000000..1928245 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vrsubhn_high.c @@ -0,0 +1,32 @@ +/* { dg-skip-if "" { arm*-*-* } } */ + +#include <arm_neon.h> +#include "arm-neon-ref.h" +#include "compute-ref-data.h" + +#if defined(__cplusplus) +#include <cstdint> +#else +#include <stdint.h> +#endif + +#define INSN_NAME vrsubhn_high +#define TEST_MSG "VRSUBHN_HIGH" + +/* Expected results. */ +VECT_VAR_DECL(expected, int, 8, 16) [] = { 0x5, 0x5, 0x5, 0x5, + 0x5, 0x5, 0x5, 0x5, + 0x31, 0x31, 0x31, 0x31, + 0x31, 0x31, 0x31, 0x31 }; +VECT_VAR_DECL(expected, int, 16, 8) [] = { 0x5, 0x5, 0x5, 0x5, + 0x31, 0x31, 0x31, 0x31 }; +VECT_VAR_DECL(expected, int, 32, 4) [] = { 0x5, 0x5, 0x17, 0x17 }; +VECT_VAR_DECL(expected, uint, 8, 16) [] = { 0x5, 0x5, 0x5, 0x5, + 0x5, 0x5, 0x5, 0x5, + 0x2, 0x2, 0x2, 0x2, + 0x2, 0x2, 0x2, 0x2 }; +VECT_VAR_DECL(expected, uint, 16, 8) [] = { 0x5, 0x5, 0x5, 0x5, + 0x36, 0x36, 0x36, 0x36 }; +VECT_VAR_DECL(expected, uint, 32, 4) [] = { 0x5, 0x5, 0x2, 0x2 }; + +#include "vXXXhn_high.inc" diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vshrn_high_n.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vshrn_high_n.c new file mode 100644 index 0000000..1652767 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vshrn_high_n.c @@ -0,0 +1,93 @@ +/* { dg-skip-if "" { arm*-*-* } } */ + +#include <arm_neon.h> +#include "arm-neon-ref.h" +#include "compute-ref-data.h" + +/* Expected results. */ +VECT_VAR_DECL(expected, int, 8, 16) [] = { 0x5, 0x5, 0x5, 0x5, + 0x5, 0x5, 0x5, 0x5, + 0xf8, 0xf8, 0xf9, 0xf9, + 0xfa, 0xfa, 0xfb, 0xfb }; +VECT_VAR_DECL(expected, int, 16, 8) [] = { 0x5, 0x5, 0x5, 0x5, + 0xfff8, 0xfff8, 0xfff9, 0xfff9 }; +VECT_VAR_DECL(expected, int, 32, 4) [] = { 0x5, 0x5, 0xfffffffc, 0xfffffffc }; +VECT_VAR_DECL(expected, uint, 8, 16) [] = { 0x5, 0x5, 0x5, 0x5, + 0x5, 0x5, 0x5, 0x5, + 0xfc, 0xfc, 0xfc, 0xfc, + 0xfd, 0xfd, 0xfd, 0xfd }; +VECT_VAR_DECL(expected, uint, 16, 8) [] = { 0x5, 0x5, 0x5, 0x5, + 0xfffe, 0xfffe, 0xfffe, 0xfffe }; +VECT_VAR_DECL(expected, uint, 32, 4) [] = { 0x5, 0x5, 0xfffffffe, 0xfffffffe }; + +#define TEST_MSG "VSHRN_HIGH_N" +void exec_vshrn_high_n (void) +{ + /* Basic test: y=vshrn_high_n(r,x,v), then store the result. */ +#define TEST_VSHRN_HIGH_N(T1, T2, W1, W2, N1, N2, V) \ + VECT_VAR(vector_res, T1, W2, N2) = \ + vshrn_high_n_##T2##W1(VECT_VAR(vector_res_lo, T1, W2, N1), \ + VECT_VAR(vector, T1, W1, N1), \ + V); \ + vst1q_##T2##W2(VECT_VAR(result, T1, W2, N2), VECT_VAR(vector_res, T1, W2, N2)) + + DECL_VARIABLE(vector_res_lo, int, 8, 8); + DECL_VARIABLE(vector_res_lo, int, 16, 4); + DECL_VARIABLE(vector_res_lo, int, 32, 2); + DECL_VARIABLE(vector_res_lo, uint, 8, 8); + DECL_VARIABLE(vector_res_lo, uint, 16, 4); + DECL_VARIABLE(vector_res_lo, uint, 32, 2); + + DECL_VARIABLE(vector, int, 16, 8); + DECL_VARIABLE(vector, int, 32, 4); + DECL_VARIABLE(vector, int, 64, 2); + DECL_VARIABLE(vector, uint, 16, 8); + DECL_VARIABLE(vector, uint, 32, 4); + DECL_VARIABLE(vector, uint, 64, 2); + + DECL_VARIABLE(vector_res, int, 8, 16); + DECL_VARIABLE(vector_res, int, 16, 8); + DECL_VARIABLE(vector_res, int, 32, 4); + DECL_VARIABLE(vector_res, uint, 8, 16); + DECL_VARIABLE(vector_res, uint, 16, 8); + DECL_VARIABLE(vector_res, uint, 32, 4); + + clean_results (); + + /* Fill vector_res_lo with a value easy to recognise in the result vector. */ + VDUP(vector_res_lo, , int, s, 8, 8, 0x5); + VDUP(vector_res_lo, , int, s, 16, 4, 0x5); + VDUP(vector_res_lo, , int, s, 32, 2, 0x5); + VDUP(vector_res_lo, , uint, u, 8, 8, 0x5); + VDUP(vector_res_lo, , uint, u, 16, 4, 0x5); + VDUP(vector_res_lo, , uint, u, 32, 2, 0x5); + + VLOAD(vector, buffer, q, int, s, 16, 8); + VLOAD(vector, buffer, q, int, s, 32, 4); + VLOAD(vector, buffer, q, int, s, 64, 2); + VLOAD(vector, buffer, q, uint, u, 16, 8); + VLOAD(vector, buffer, q, uint, u, 32, 4); + VLOAD(vector, buffer, q, uint, u, 64, 2); + + /* Choose shift amount arbitrarily. */ + TEST_VSHRN_HIGH_N(int, s, 16, 8, 8, 16, 1); + TEST_VSHRN_HIGH_N(int, s, 32, 16, 4, 8, 1); + TEST_VSHRN_HIGH_N(int, s, 64, 32, 2, 4, 2); + TEST_VSHRN_HIGH_N(uint, u, 16, 8, 8, 16, 2); + TEST_VSHRN_HIGH_N(uint, u, 32, 16, 4, 8, 3); + TEST_VSHRN_HIGH_N(uint, u, 64, 32, 2, 4, 3); + +#define CMT "" + CHECK(TEST_MSG, int, 8, 16, PRIx8, expected, CMT); + CHECK(TEST_MSG, int, 16, 8, PRIx16, expected, CMT); + CHECK(TEST_MSG, int, 32, 4, PRIx32, expected, CMT); + CHECK(TEST_MSG, uint, 8, 16, PRIx8, expected, CMT); + CHECK(TEST_MSG, uint, 16, 8, PRIx16, expected, CMT); + CHECK(TEST_MSG, uint, 32, 4, PRIx32, expected, CMT); +} + +int main (void) +{ + exec_vshrn_high_n (); + return 0; +} diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vsubhn_high.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vsubhn_high.c new file mode 100644 index 0000000..dd1ec6b --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vsubhn_high.c @@ -0,0 +1,32 @@ +/* { dg-skip-if "" { arm*-*-* } } */ + +#include <arm_neon.h> +#include "arm-neon-ref.h" +#include "compute-ref-data.h" + +#if defined(__cplusplus) +#include <cstdint> +#else +#include <stdint.h> +#endif + +#define INSN_NAME vsubhn_high +#define TEST_MSG "VSUBHN_HIGH" + +/* Expected results. */ +VECT_VAR_DECL(expected, int, 8, 16) [] = { 0x5, 0x5, 0x5, 0x5, + 0x5, 0x5, 0x5, 0x5, + 0x31, 0x31, 0x31, 0x31, + 0x31, 0x31, 0x31, 0x31 }; +VECT_VAR_DECL(expected, int, 16, 8) [] = { 0x5, 0x5, 0x5, 0x5, + 0x31, 0x31, 0x31, 0x31 }; +VECT_VAR_DECL(expected, int, 32, 4) [] = { 0x5, 0x5, 0x17, 0x17 }; +VECT_VAR_DECL(expected, uint, 8, 16) [] = { 0x5, 0x5, 0x5, 0x5, + 0x5, 0x5, 0x5, 0x5, + 0x2, 0x2, 0x2, 0x2, + 0x2, 0x2, 0x2, 0x2 }; +VECT_VAR_DECL(expected, uint, 16, 8) [] = { 0x5, 0x5, 0x5, 0x5, + 0x36, 0x36, 0x36, 0x36 }; +VECT_VAR_DECL(expected, uint, 32, 4) [] = { 0x5, 0x5, 0x2, 0x2 }; + +#include "vXXXhn_high.inc" diff --git a/gcc/testsuite/gcc.target/aarch64/pr93235.c b/gcc/testsuite/gcc.target/aarch64/pr93235.c new file mode 100644 index 0000000..829ae13 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/pr93235.c @@ -0,0 +1,12 @@ +/* PR middle-end/93235 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fno-strict-aliasing" } */ + +struct sfp16 { __fp16 f; }; +struct sfp16 +foo (short x) +{ + struct sfp16 a; + *(short*)&a.f = x; + return a; +} diff --git a/gcc/testsuite/gcc.target/aarch64/pr99381.c b/gcc/testsuite/gcc.target/aarch64/pr99381.c new file mode 100644 index 0000000..8b4c5b8 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/pr99381.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-march=armv8-a" } */ +/* PR99381: we shouldn't ICE if the user forgets -march=armv8.2-a+sve. */ + +#include <arm_sve.h> +_Bool a; +int main() +{ + a = svaddv(svptrue_b8(), svdup_s8(0)); /* { dg-error "ACLE function 'svptrue_b8' requires ISA extension 'sve'" } */ +} diff --git a/gcc/testsuite/gcc.target/aarch64/simd/pr99437.c b/gcc/testsuite/gcc.target/aarch64/simd/pr99437.c new file mode 100644 index 0000000..976fac4 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/simd/pr99437.c @@ -0,0 +1,17 @@ +/* { dg-do assemble } */ +/* { dg-options "-O" } */ + +#include <arm_neon.h> + +uint8x16_t +foo (uint16x8_t a, uint8x8_t b) +{ + return vcombine_u8 (vmovn_u16 (vshrq_n_u16 (a, 9)), b); +} + +uint8x16_t +foo2 (uint16x8_t a, uint8x8_t b) +{ + return vcombine_u8 (b, vmovn_u16 (vshrq_n_u16 (a, 15))); +} + diff --git a/gcc/testsuite/gcc.target/aarch64/sve/cse_sve_vl_constants_1.c b/gcc/testsuite/gcc.target/aarch64/sve/cse_sve_vl_constants_1.c new file mode 100644 index 0000000..dd04b66 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sve/cse_sve_vl_constants_1.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -moverride=tune=cse_sve_vl_constants" } */ + +void __attribute__((noinline, noclone)) +vadd (int *dst, int *op1, int *op2, int count) +{ + for (int i = 0; i < count; ++i) + dst[i] = op1[i] + op2[i]; +} + +/* { dg-final { scan-assembler-not {\tincw\tx[0-9]+} } } */ + diff --git a/gcc/testsuite/gcc.target/aarch64/sve/pr98657.c b/gcc/testsuite/gcc.target/aarch64/sve/pr98657.c new file mode 100644 index 0000000..592af25 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sve/pr98657.c @@ -0,0 +1,9 @@ +/* PR target/98657 */ +/* { dg-do compile } */ +/* { dg-options "-O3 -msve-vector-bits=256" } */ +extern char a[]; +void b(_Bool c[][18]) { + int d; + for (int e = 0; e < 23; e++) + a[e] = 6 >> c[1][d]; +} diff --git a/gcc/testsuite/gcc.target/aarch64/sve/pr98791.c b/gcc/testsuite/gcc.target/aarch64/sve/pr98791.c new file mode 100644 index 0000000..cc1f183 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sve/pr98791.c @@ -0,0 +1,12 @@ +/* PR rtl-optimization/98791 */ +/* { dg-do compile } */ +/* { dg-options "-O -ftree-vectorize" } */ +#include <arm_sve.h> +extern char a[11]; +extern long b[]; +void f() { + for (int d; d < 10; d++) { + a[d] = svaddv(svptrue_b8(), svdup_u8(0)); + b[d] = 0; + } +} diff --git a/gcc/testsuite/gcc.target/arm/cmse/cmse-18.c b/gcc/testsuite/gcc.target/arm/cmse/cmse-18.c new file mode 100644 index 0000000..e1ff092 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/cmse/cmse-18.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-mcmse -fdump-rtl-final-slim" } */ + +typedef void (*f)(int) __attribute__((cmse_nonsecure_call)); + +void bar(f func, int a) +{ + func(a); +} + +/* { dg-final { scan-rtl-dump "call unspec\\\[\\\[r4:SI\\\]\\\]" "final" } } */ diff --git a/gcc/testsuite/gcc.target/arm/pure-code/pr98998.c b/gcc/testsuite/gcc.target/arm/pure-code/pr98998.c new file mode 100644 index 0000000..9d7b0b2 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/pure-code/pr98998.c @@ -0,0 +1,20 @@ +/* PR target/98998 */ +/* { dg-do compile { target fstack_protector } } */ +/* { dg-options "-mpure-code -fstack-protector" } */ + +void *volatile p; + +int +main () +{ + int n = 0; + lab:; + int x[n % 1000 + 1]; + x[0] = 1; + x[n % 1000] = 2; + p = x; + n++; + if (n < 1000000) + goto lab; + return 0; +} diff --git a/gcc/testsuite/gcc.target/cris/biap-mul.c b/gcc/testsuite/gcc.target/cris/biap-mul.c new file mode 100644 index 0000000..e005463 --- /dev/null +++ b/gcc/testsuite/gcc.target/cris/biap-mul.c @@ -0,0 +1,15 @@ +/* Make sure ADDI is used for trivial multiplications too. */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ +/* { dg-final { scan-assembler-times "\taddi" 2 } } */ +/* { dg-final { scan-assembler-not "\tlsl|\tmul|\tmove|\tadd\[^i\]" } } */ + +int xyzzy (int r10) +{ + return r10 * 5; +} + +int plugh (int r10) +{ + return r10 * 3; +} diff --git a/gcc/testsuite/gcc.target/cris/biap.c b/gcc/testsuite/gcc.target/cris/biap.c index 1f3b436..f31e61c 100644 --- a/gcc/testsuite/gcc.target/cris/biap.c +++ b/gcc/testsuite/gcc.target/cris/biap.c @@ -2,10 +2,15 @@ See also PR37939. */ /* { dg-do compile } */ /* { dg-options "-O2" } */ -/* { dg-final { scan-assembler "addi" } } */ -/* { dg-final { scan-assembler-not "lsl" } } */ +/* { dg-final { scan-assembler-times "\taddi" 2 } } */ +/* { dg-final { scan-assembler-not "\tlsl|\tmul|\tmove|\tadd\[^i\]" } } */ int xyzzy (int r10, int r11) { return r11 * 4 + r10; } + +int plugh (int r10, int r11) +{ + return r11 * 2 + r10; +} diff --git a/gcc/testsuite/gcc.target/cris/pr93372-1.c b/gcc/testsuite/gcc.target/cris/pr93372-1.c index 20aa65e..bc63730 100644 --- a/gcc/testsuite/gcc.target/cris/pr93372-1.c +++ b/gcc/testsuite/gcc.target/cris/pr93372-1.c @@ -2,7 +2,16 @@ are filled. */ /* { dg-do compile } */ /* { dg-options "-O2" } */ -/* { dg-final { scan-assembler-not "\tnop" } } */ +/* { dg-final { scan-assembler-times "\tnop|addq 8,|subq 8," 2 } } */ + +/* The reason for the weird variant of scan-assembler-not "\tnop" is that we + used to have an unused DWunion temp on stack in xlshrdi3 and delay-slots for + the conditional jumps filled by the addq 8/subq setting up that, but with a + MAX_FIXED_MODE_SIZE no longer 32, but the default 64, that stack-frame is + eliminated, but we no longer have eligible insns to fill the delay-slots. + Not wanting to tweak the code in the test-case, this is second best: allowing + two nops -or- an addq 8 + subq 8 assuming code generation is otherwise + reasonably sane. */ void *f(void **p) { diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-reload-mul-1.c b/gcc/testsuite/gcc.target/cris/torture/sync-reload-mul-1.c new file mode 100644 index 0000000..836633f --- /dev/null +++ b/gcc/testsuite/gcc.target/cris/torture/sync-reload-mul-1.c @@ -0,0 +1,13 @@ +void +_gfortran_caf_event_post (unsigned int **pp, unsigned int index, + int image_index __attribute__ ((unused)), + int *stat, char *errmsg __attribute__ ((unused)), + unsigned int errmsg_len __attribute__ ((unused))) +{ + unsigned int value = 1; + unsigned int *event = *pp + index; + __atomic_fetch_add (event, value, 0); + + if(stat) + *stat = 0; +} diff --git a/gcc/testsuite/gcc.target/i386/avx2-pr99517-1.c b/gcc/testsuite/gcc.target/i386/avx2-pr99517-1.c new file mode 100644 index 0000000..f1d7f82 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx2-pr99517-1.c @@ -0,0 +1,25 @@ +/* PR ipa/99517 */ +/* { dg-do run { target avx2 } } */ +/* { dg-additional-sources "avx2-pr99517-2.c" } */ +/* { dg-options "-O2 -mavx2" } */ + +#include "avx2-check.h" + +typedef signed char v32qi __attribute__((vector_size(32))); +typedef int v4si __attribute__((vector_size(16))); +typedef long long int v4di __attribute__((vector_size(32))); +typedef double v4df __attribute__((vector_size(32))); +extern v32qi foo (v4si); +extern v32qi bar (v4si); + +static void +avx2_test (void) +{ + v4si a = { 1, -2, 3, -4 }; + __asm ("" : "+x" (a)); + v4di b = (v4di) bar (a); + v4df c = (v4df) foo (a); + if (b[0] != 1 || c[0] != 1.0 || b[1] != -2 || c[1] != -2.0 + || b[2] != 3 || c[2] != 3.0 || b[3] != -4 || c[3] != -4.0) + __builtin_abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx2-pr99517-2.c b/gcc/testsuite/gcc.target/i386/avx2-pr99517-2.c new file mode 100644 index 0000000..80bd395 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx2-pr99517-2.c @@ -0,0 +1,20 @@ +/* PR ipa/99517 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -mavx2" } */ + +typedef signed char v32qi __attribute__((vector_size(32))); +typedef int v4si __attribute__((vector_size(16))); +typedef long long int v4di __attribute__((vector_size(32))); +typedef double v4df __attribute__((vector_size(32))); + +v32qi +foo (v4si x) +{ + return (v32qi) __builtin_convertvector (x, v4df); +} + +v32qi +bar (v4si x) +{ + return (v32qi) __builtin_convertvector (x, v4di); +} diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-pr99321-1.c b/gcc/testsuite/gcc.target/i386/avx512vl-pr99321-1.c new file mode 100644 index 0000000..9da5eee --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512vl-pr99321-1.c @@ -0,0 +1,39 @@ +/* PR target/99321 */ +/* { dg-do assemble { target lp64 } } */ +/* { dg-require-effective-target avx512vl } */ +/* { dg-require-effective-target assembler_march_noavx512bw } */ +/* { dg-options "-O2 -mavx512vl -mno-avx512bw -Wa,-march=+noavx512bw" } */ + +#include <x86intrin.h> + +typedef unsigned char V1 __attribute__((vector_size (16))); +typedef unsigned char V2 __attribute__((vector_size (32))); +typedef unsigned short V3 __attribute__((vector_size (16))); +typedef unsigned short V4 __attribute__((vector_size (32))); + +void f1 (void) { register V1 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a += b; __asm ("" : : "v" (a)); } +void f2 (void) { register V2 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a += b; __asm ("" : : "v" (a)); } +void f3 (void) { register V3 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a += b; __asm ("" : : "v" (a)); } +void f4 (void) { register V4 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a += b; __asm ("" : : "v" (a)); } +void f5 (void) { register V1 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a -= b; __asm ("" : : "v" (a)); } +void f6 (void) { register V2 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a -= b; __asm ("" : : "v" (a)); } +void f7 (void) { register V3 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a -= b; __asm ("" : : "v" (a)); } +void f8 (void) { register V4 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a -= b; __asm ("" : : "v" (a)); } +void f9 (void) { register V3 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a *= b; __asm ("" : : "v" (a)); } +void f10 (void) { register V4 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a *= b; __asm ("" : : "v" (a)); } +void f11 (void) { register V1 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V1) _mm_min_epu8 ((__m128i) a, (__m128i) b); __asm ("" : : "v" (a)); } +void f12 (void) { register V2 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V2) _mm256_min_epu8 ((__m256i) a, (__m256i) b); __asm ("" : : "v" (a)); } +void f13 (void) { register V3 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V3) _mm_min_epu16 ((__m128i) a, (__m128i) b); __asm ("" : : "v" (a)); } +void f14 (void) { register V4 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V4) _mm256_min_epu16 ((__m256i) a, (__m256i) b); __asm ("" : : "v" (a)); } +void f15 (void) { register V1 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V1) _mm_min_epi8 ((__m128i) a, (__m128i) b); __asm ("" : : "v" (a)); } +void f16 (void) { register V2 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V2) _mm256_min_epi8 ((__m256i) a, (__m256i) b); __asm ("" : : "v" (a)); } +void f17 (void) { register V3 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V3) _mm_min_epi16 ((__m128i) a, (__m128i) b); __asm ("" : : "v" (a)); } +void f18 (void) { register V4 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V4) _mm256_min_epi16 ((__m256i) a, (__m256i) b); __asm ("" : : "v" (a)); } +void f19 (void) { register V1 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V1) _mm_max_epu8 ((__m128i) a, (__m128i) b); __asm ("" : : "v" (a)); } +void f20 (void) { register V2 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V2) _mm256_max_epu8 ((__m256i) a, (__m256i) b); __asm ("" : : "v" (a)); } +void f21 (void) { register V3 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V3) _mm_max_epu16 ((__m128i) a, (__m128i) b); __asm ("" : : "v" (a)); } +void f22 (void) { register V4 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V4) _mm256_max_epu16 ((__m256i) a, (__m256i) b); __asm ("" : : "v" (a)); } +void f23 (void) { register V1 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V1) _mm_max_epi8 ((__m128i) a, (__m128i) b); __asm ("" : : "v" (a)); } +void f24 (void) { register V2 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V2) _mm256_max_epi8 ((__m256i) a, (__m256i) b); __asm ("" : : "v" (a)); } +void f25 (void) { register V3 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V3) _mm_max_epi16 ((__m128i) a, (__m128i) b); __asm ("" : : "v" (a)); } +void f26 (void) { register V4 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V4) _mm256_max_epi16 ((__m256i) a, (__m256i) b); __asm ("" : : "v" (a)); } diff --git a/gcc/testsuite/gcc.target/i386/pr95798-1.c b/gcc/testsuite/gcc.target/i386/pr95798-1.c new file mode 100644 index 0000000..9a7e32d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr95798-1.c @@ -0,0 +1,29 @@ +/* PR target/95798 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -masm=att -fomit-frame-pointer" } */ +/* { dg-final { scan-assembler "1, 8\\\(%rsp,%r\[a-z0-9]*,8\\\)" { target lp64 } } } */ +/* { dg-final { scan-assembler "2, 16\\\(%rsp,%r\[a-z0-9]*,8\\\)" { target lp64 } } } */ +/* { dg-final { scan-assembler "3, 24\\\(%rsp,%r\[a-z0-9]*,8\\\)" { target lp64 } } } */ +/* { dg-final { scan-assembler "4, 32\\\(%rsp,%r\[a-z0-9]*,8\\\)" { target lp64 } } } */ +/* { dg-final { scan-assembler "5, 40\\\(%rsp,%r\[a-z0-9]*,8\\\)" { target lp64 } } } */ +/* { dg-final { scan-assembler "6, 48\\\(%rsp,%r\[a-z0-9]*,8\\\)" { target lp64 } } } */ +/* { dg-final { scan-assembler "7, 56\\\(%rsp,%r\[a-z0-9]*,8\\\)" { target lp64 } } } */ + +void bar (unsigned long long *, int); + +void +foo (int y, unsigned long long z) +{ + unsigned long long x[1024]; + unsigned long long i = y % 127; + __builtin_memset (x, -1, sizeof (x)); + x[i] = 0; + x[i + 1] = 1; + x[i + 2] = 2; + x[i + 3] = 3; + x[i + 4] = 4; + x[i + 5] = 5; + x[i + 6] = 6; + x[i + 7] = 7; + bar (x, y); +} diff --git a/gcc/testsuite/gcc.target/i386/pr95798-2.c b/gcc/testsuite/gcc.target/i386/pr95798-2.c new file mode 100644 index 0000000..c670d37 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr95798-2.c @@ -0,0 +1,29 @@ +/* PR target/95798 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -masm=att -fomit-frame-pointer" } */ +/* { dg-final { scan-assembler "1, 8\\\(%rsp,%r\[a-z0-9]*,8\\\)" { target lp64 } } } */ +/* { dg-final { scan-assembler "2, 16\\\(%rsp,%r\[a-z0-9]*,8\\\)" { target lp64 } } } */ +/* { dg-final { scan-assembler "3, 24\\\(%rsp,%r\[a-z0-9]*,8\\\)" { target lp64 } } } */ +/* { dg-final { scan-assembler "4, 32\\\(%rsp,%r\[a-z0-9]*,8\\\)" { target lp64 } } } */ +/* { dg-final { scan-assembler "5, 40\\\(%rsp,%r\[a-z0-9]*,8\\\)" { target lp64 } } } */ +/* { dg-final { scan-assembler "6, 48\\\(%rsp,%r\[a-z0-9]*,8\\\)" { target lp64 } } } */ +/* { dg-final { scan-assembler "7, 56\\\(%rsp,%r\[a-z0-9]*,8\\\)" { target lp64 } } } */ + +void bar (unsigned long long *, int); + +void +foo (unsigned int y, unsigned long long z) +{ + unsigned long long x[1024]; + unsigned long long i = y % 127; + __builtin_memset (x, -1, sizeof (x)); + x[i] = 0; + x[i + 1] = 1; + x[i + 2] = 2; + x[i + 3] = 3; + x[i + 4] = 4; + x[i + 5] = 5; + x[i + 6] = 6; + x[i + 7] = 7; + bar (x, y); +} diff --git a/gcc/testsuite/gcc.target/i386/pr96166.c b/gcc/testsuite/gcc.target/i386/pr96166.c new file mode 100644 index 0000000..4d02022 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr96166.c @@ -0,0 +1,21 @@ +/* PR target/96166 */ +/* { dg-do compile { target { ! ia32 } } } */ +/* { dg-options "-O3 -mtune=generic -masm=att" } */ +/* { dg-final { scan-assembler "rolq\\s\\\$32, \\\(%\[re]di\\\)" } } */ + +static inline void +swap (int *x, int *y) +{ + int tmp = *x; + *x = *y; + *y = tmp; +} + +void +bar (int (*x)[2]) +{ + int y[2]; + __builtin_memcpy (&y, x, sizeof *x); + swap (&y[0], &y[1]); + __builtin_memcpy (x, &y, sizeof *x); +} diff --git a/gcc/testsuite/gcc.target/i386/pr98439.c b/gcc/testsuite/gcc.target/i386/pr98439.c new file mode 100644 index 0000000..02fc40a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr98439.c @@ -0,0 +1,12 @@ +/* PR rtl-optimization/98439 */ +/* { dg-do compile } */ +/* { dg-options "-march=nehalem -O2 -fselective-scheduling2 -fno-cprop-registers" } */ + +int v; +int bar (int, int, int, int, int, int, int); + +int +foo (void) +{ + return bar (0, 0, 0, 0, 0, 0, v > 0 ? v : 0); +} diff --git a/gcc/testsuite/gcc.target/i386/pr99100.c b/gcc/testsuite/gcc.target/i386/pr99100.c new file mode 100644 index 0000000..a17fe28 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr99100.c @@ -0,0 +1,22 @@ +/* PR target/99100 */ +/* { dg-do compile } */ +/* { dg-options "-Ofast -mavx512f -fopenmp-simd -mprefer-vector-width=512" } */ +/* { dg-final { scan-assembler "_ZGVeN8v_myfunc" } } */ +/* { dg-final { scan-assembler "_ZGVeN8v_sin" } } */ + +#pragma omp declare simd notinbranch +double sin (double x); +#pragma omp declare simd simdlen(8) notinbranch +__attribute__((const)) double myfunc (double x); + +#define N 1024 +__attribute__((__aligned__ (256))) double a[N], b[N], c[N]; + +void +foo () +{ + for (int i = 0; i < N; i++) + a[i] = myfunc (b[i]); + for (int i = 0; i < N; i++) + c[i] = sin (b[i]); +} diff --git a/gcc/testsuite/gcc.target/i386/pr99123-2.c b/gcc/testsuite/gcc.target/i386/pr99123-2.c new file mode 100644 index 0000000..def4eae --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr99123-2.c @@ -0,0 +1,51 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -funroll-loops" } */ + +static inline void * +baz (void *s, unsigned long c, unsigned int count) +{ + int d0, d1; + __asm__ __volatile__ ("" + : "=&c" (d0), "=&D" (d1) + :"a" (c), "q" (count), "0" (count / 4), "" ((long) s) /// "1" + :"memory"); + return s; +} + +struct A +{ + unsigned long *a; +}; + +inline static void * +bar (struct A *x, int y) +{ + char *ptr; + + ptr = (void *) x->a[y >> 12]; + ptr += y % (1UL << 12); + return (void *) ptr; +} + +int +foo (struct A *x, unsigned int *y, int z, int u) +{ + int a, b, c, d, e; + + z += *y; + c = z + u; + a = (z >> 12) + 1; + do + { + b = (a << 12); + d = b - z; + e = c - z; + if (e < d) + d = e; + baz (bar (x, z), 0, d); + z = b; + a++; + } + while (z < c); + return 0; +} diff --git a/gcc/testsuite/gcc.target/i386/pr99123.c b/gcc/testsuite/gcc.target/i386/pr99123.c new file mode 100644 index 0000000..4f32547 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr99123.c @@ -0,0 +1,51 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +static inline void * +baz (void *s, unsigned long c, unsigned int count) +{ + int d0, d1; + __asm__ __volatile__ ("" + : "=&c" (d0), "=&D" (d1) + :"a" (c), "q" (count), "0" (count / 4), "" ((long) s) /// "1" + :"memory"); + return s; +} + +struct A +{ + unsigned long *a; +}; + +inline static void * +bar (struct A *x, int y) +{ + char *ptr; + + ptr = (void *) x->a[y >> 12]; + ptr += y % (1UL << 12); + return (void *) ptr; +} + +int +foo (struct A *x, unsigned int *y, int z, int u) +{ + int a, b, c, d, e; + + z += *y; + c = z + u; + a = (z >> 12) + 1; + do + { + b = (a << 12); + d = b - z; + e = c - z; + if (e < d) + d = e; + baz (bar (x, z), 0, d); + z = b; + a++; + } + while (z < c); + return 0; +} diff --git a/gcc/testsuite/gcc.target/i386/pr99321.c b/gcc/testsuite/gcc.target/i386/pr99321.c new file mode 100644 index 0000000..d290b67 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr99321.c @@ -0,0 +1,41 @@ +/* PR target/99321 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -mtune=btver2 -fno-tree-dce -mavx512vl -mno-avx512bw" } */ + +typedef unsigned __attribute__((__vector_size__ (8))) A; +typedef unsigned int __attribute__((__vector_size__ (8))) B; +typedef unsigned char __attribute__((__vector_size__ (16))) C; +typedef unsigned __attribute__((__vector_size__ (16))) D; +typedef unsigned int __attribute__((__vector_size__ (16))) E; +typedef unsigned __attribute__((__vector_size__ (16))) F; +typedef unsigned __attribute__((__vector_size__ (32))) G; +typedef int __attribute__((__vector_size__ (32))) H; +typedef unsigned int __attribute__((__vector_size__ (32))) I; +typedef char __attribute__((__vector_size__ (64))) J; +typedef unsigned int __attribute__((__vector_size__ (64))) K; +typedef unsigned long long __attribute__((__vector_size__ (64))) L; +unsigned char a; +unsigned b, c; +H d; +E e, f; +D g; +L h; + +A +foo0 (A i, C j, G k, B l, K m, B n, I o) +{ + J p, q = a != p; + F r = b << f; + int s = a * 15; + C t = (1 << ((C) ((C) { 80 } >=j) & sizeof (0)) | (j ^ (C) { 5 }) << (j & sizeof (0))) != 0; + L u = h; + H v = d - 40; + u ^= -(long long) n; + D w = (char) s > g; + o ^= c / o; + J x = p + q + (J) m + (J) u + (J) u; + G y = ((union { J a; G b;}) x).b + ((union { J a; G b[2];}) x).b[1] + k + v + o; + C z = ((union { G a; C b;}) y).b + ((union { G a; C b;}) y).b + j + t + (C) g + (C) w + (C) e + (C) f + (C) r; + A zz = ((union { C a; A b;}) z).b + i + l + n; + return zz; +} diff --git a/gcc/testsuite/gcc.target/i386/pr99454.c b/gcc/testsuite/gcc.target/i386/pr99454.c new file mode 100644 index 0000000..a59ba7d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr99454.c @@ -0,0 +1,43 @@ +/* { dg-do compile } */ +/* { dg-options "-O -w" } */ + +struct skb_shared_info { + short gso_size; +}; + +enum { NETDEV_TX_OK }; + +struct iphdr { + short tot_len; + int daddr; +}; + +int tg3_tso_bug(); +int netdev_priv(); +int skb_cow_head(); +int tcp_hdrlen__builtin_expect(); +struct iphdr *ip_hdr(); +int _tg3_flag(); +int tg3_tso_bug_gso_check(); + +int +tg3_start_xmit() { + int *tp = netdev_priv(); + int mss, tnapi; + struct iphdr *iph; + tnapi = mss = ((struct skb_shared_info *)0)->gso_size; + if (mss) { + int hdr_len; + if (skb_cow_head()) + iph = ip_hdr(); + hdr_len = tcp_hdrlen__builtin_expect() && _tg3_flag(); + if (tg3_tso_bug_gso_check()) + return tg3_tso_bug(tp, tnapi); + iph->tot_len = mss + hdr_len; + if (_tg3_flag(tp) || tp) + ; + else + asm("" : : "g"(iph->daddr)); + } + return 0; +} diff --git a/gcc/testsuite/gcc.target/i386/pr99463-2.c b/gcc/testsuite/gcc.target/i386/pr99463-2.c new file mode 100644 index 0000000..017ca95 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr99463-2.c @@ -0,0 +1,5 @@ +/* PR target/99463 */ +/* { dg-do compile { target { ! ia32 } } } */ +/* { dg-options "-O2 -march=sapphirerapids" } */ + +#include "uintr-1.c" diff --git a/gcc/testsuite/gcc.target/i386/pr99463.c b/gcc/testsuite/gcc.target/i386/pr99463.c new file mode 100644 index 0000000..0b29092 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr99463.c @@ -0,0 +1,5 @@ +/* PR target/99463 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -march=alderlake" } */ + +#include "hreset-1.c" diff --git a/gcc/testsuite/gcc.target/i386/pr99464.c b/gcc/testsuite/gcc.target/i386/pr99464.c new file mode 100644 index 0000000..98dd938 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr99464.c @@ -0,0 +1,15 @@ +/* PR target/99464 */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +#pragma GCC target("arch=cannonlake") + +#include <immintrin.h> + +volatile __m128i x; + +void extern +sha_test (void) +{ + x = _mm_sha1msg1_epu32 (x, x); +} diff --git a/gcc/testsuite/gcc.target/mips/compact-branches-5.c b/gcc/testsuite/gcc.target/mips/compact-branches-5.c index 90d312c..0189635 100644 --- a/gcc/testsuite/gcc.target/mips/compact-branches-5.c +++ b/gcc/testsuite/gcc.target/mips/compact-branches-5.c @@ -1,4 +1,4 @@ -/* { dg-options "-mno-abicalls -mcompact-branches=never isa_rev>=6" } */ +/* { dg-options "-mno-abicalls -fno-PIC -mcompact-branches=never isa_rev>=6" } */ void bar (int); void diff --git a/gcc/testsuite/gcc.target/mips/compact-branches-6.c b/gcc/testsuite/gcc.target/mips/compact-branches-6.c index dd35a55..36180b0 100644 --- a/gcc/testsuite/gcc.target/mips/compact-branches-6.c +++ b/gcc/testsuite/gcc.target/mips/compact-branches-6.c @@ -1,4 +1,4 @@ -/* { dg-options "-mno-abicalls -mcompact-branches=optimal isa_rev>=6" } */ +/* { dg-options "-mno-abicalls -fno-PIC -mcompact-branches=optimal isa_rev>=6" } */ void bar (int); void diff --git a/gcc/testsuite/gcc.target/powerpc/compress-float-ppc-pic.c b/gcc/testsuite/gcc.target/powerpc/compress-float-ppc-pic.c index 6be1753..8961be5 100644 --- a/gcc/testsuite/gcc.target/powerpc/compress-float-ppc-pic.c +++ b/gcc/testsuite/gcc.target/powerpc/compress-float-ppc-pic.c @@ -1,5 +1,6 @@ /* { dg-do compile { target powerpc_fprs } } */ /* { dg-options "-O2 -fpic -mdejagnu-cpu=power5" } */ +/* { dg-require-effective-target fpic } */ double foo (double x) { return x + 1.75; diff --git a/gcc/testsuite/gcc.target/powerpc/mma-builtin-4.c b/gcc/testsuite/gcc.target/powerpc/mma-builtin-4.c index f3a857b..3bedf53 100644 --- a/gcc/testsuite/gcc.target/powerpc/mma-builtin-4.c +++ b/gcc/testsuite/gcc.target/powerpc/mma-builtin-4.c @@ -13,6 +13,14 @@ foo (__vector_pair *dst, vec_t *src) } void +foo2 (__vector_pair *dst, vec_t *src) +{ + __vector_pair pair; + __builtin_vsx_assemble_pair (&pair, src[0], src[4]); + *dst = pair; +} + +void bar (vec_t *dst, __vector_pair *src) { vec_t res[2]; @@ -21,8 +29,33 @@ bar (vec_t *dst, __vector_pair *src) dst[4] = res[1]; } -/* { dg-final { scan-assembler-times {\mlxv\M} 2 } } */ -/* { dg-final { scan-assembler-times {\mlxvp\M} 1 } } */ -/* { dg-final { scan-assembler-times {\mstxv\M} 2 } } */ -/* { dg-final { scan-assembler-times {\mstxvp\M} 1 } } */ +void +bar2 (vec_t *dst, __vector_pair *src) +{ + vec_t res[2]; + __builtin_vsx_disassemble_pair (res, src); + dst[0] = res[0]; + dst[4] = res[1]; +} + +#if !__has_builtin (__builtin_vsx_assemble_pair) +# error "__has_builtin (__builtin_vsx_assemble_pair) failed" +#endif + +#if !__has_builtin (__builtin_vsx_disassemble_pair) +# error "__has_builtin (__builtin_vsx_disassemble_pair) failed" +#endif + +#if !__has_builtin (__builtin_mma_assemble_pair) +# error "__has_builtin (__builtin_mma_assemble_pair) failed" +#endif + +#if !__has_builtin (__builtin_mma_disassemble_pair) +# error "__has_builtin (__builtin_mma_disassemble_pair) failed" +#endif + +/* { dg-final { scan-assembler-times {\mlxv\M} 4 } } */ +/* { dg-final { scan-assembler-times {\mlxvp\M} 2 } } */ +/* { dg-final { scan-assembler-times {\mstxv\M} 4 } } */ +/* { dg-final { scan-assembler-times {\mstxvp\M} 2 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-inc-di.c b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-inc-di.c new file mode 100644 index 0000000..c82041c --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-inc-di.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_pcrel } */ +/* { dg-options "-O2 -mdejagnu-cpu=power10" } */ + +#define TYPE unsigned int + +/* Test whether using an external variable twice (doing an increment) prevents + the PCREL_OPT optimization. */ +extern TYPE ext; + +void +inc (void) +{ + ext++; /* No PCREL_OPT (uses address twice). */ +} + +/* { dg-final { scan-assembler-not "R_PPC64_PCREL_OPT" } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-df.c b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-df.c new file mode 100644 index 0000000..d35862f --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-df.c @@ -0,0 +1,36 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_pcrel } */ +/* { dg-options "-O2 -mdejagnu-cpu=power10" } */ + +#define TYPE double +#define LARGE 0x20000 + +/* Test whether we get the right number of PCREL_OPT optimizations for + double. */ +extern TYPE ext[]; + +TYPE +get (void) +{ + return ext[0]; /* PCREL_OPT relocation. */ +} + +TYPE +get2 (void) +{ + return ext[2]; /* PCREL_OPT relocation. */ +} + +TYPE +get_large (void) +{ + return ext[LARGE]; /* No PCREL_OPT (load is prefixed). */ +} + +TYPE +get_variable (unsigned long n) +{ + return ext[n]; /* No PCREL_OPT (load is indexed). */ +} + +/* { dg-final { scan-assembler-times "R_PPC64_PCREL_OPT" 2 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-di.c b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-di.c new file mode 100644 index 0000000..7e1ff99 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-di.c @@ -0,0 +1,42 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_pcrel } */ +/* { dg-options "-O2 -mdejagnu-cpu=power10" } */ + +#define TYPE long long +#define LARGE 0x20000 + +/* Test whether we get the right number of PCREL_OPT optimizations for long + long. */ +extern TYPE ext[]; + +TYPE +get (void) +{ + return ext[0]; /* PCREL_OPT relocation. */ +} + +TYPE +get2 (void) +{ + return ext[2]; /* PCREL_OPT relocation. */ +} + +TYPE +get_large (void) +{ + return ext[LARGE]; /* No PCREL_OPT (load is prefixed). */ +} + +TYPE +get_variable (unsigned long n) +{ + return ext[n]; /* No PCREL_OPT (load is indexed). */ +} + +double +get_double (void) +{ + return (double) ext[0]; /* PCREL_OPT relocation. */ +} + +/* { dg-final { scan-assembler-times "R_PPC64_PCREL_OPT" 3 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-hi.c b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-hi.c new file mode 100644 index 0000000..4143aeb --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-hi.c @@ -0,0 +1,42 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_pcrel } */ +/* { dg-options "-O2 -mdejagnu-cpu=power10" } */ + +#define TYPE unsigned short +#define LARGE 0x20000 + +/* Test whether we get the right number of PCREL_OPT optimizations for unsigned + short. */ +extern TYPE ext[]; + +TYPE +get (void) +{ + return ext[0]; /* PCREL_OPT relocation. */ +} + +TYPE +get2 (void) +{ + return ext[2]; /* PCREL_OPT relocation. */ +} + +TYPE +get_large (void) +{ + return ext[LARGE]; /* No PCREL_OPT (load is prefixed). */ +} + +TYPE +get_variable (unsigned long n) +{ + return ext[n]; /* No PCREL_OPT (load is indexed). */ +} + +double +get_double (void) +{ + return (double) ext[0]; /* No PCREL_OPT (LXSIHZX is indexed). */ +} + +/* { dg-final { scan-assembler-times "R_PPC64_PCREL_OPT" 2 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-qi.c b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-qi.c new file mode 100644 index 0000000..30d3236 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-qi.c @@ -0,0 +1,42 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_pcrel } */ +/* { dg-options "-O2 -mdejagnu-cpu=power10" } */ + +#define TYPE unsigned char +#define LARGE 0x20000 + +/* Test whether we get the right number of PCREL_OPT optimizations for unsigned + char. */ +extern TYPE ext[]; + +TYPE +get (void) +{ + return ext[0]; /* PCREL_OPT relocation. */ +} + +TYPE +get2 (void) +{ + return ext[2]; /* PCREL_OPT relocation. */ +} + +TYPE +get_large (void) +{ + return ext[LARGE]; /* No PCREL_OPT (load is prefixed). */ +} + +TYPE +get_variable (unsigned long n) +{ + return ext[n]; /* No PCREL_OPT (load is indexed). */ +} + +double +get_double (void) +{ + return (double) ext[0]; /* No PCREL_OPT (LXSIBZX is indexed). */ +} + +/* { dg-final { scan-assembler-times "R_PPC64_PCREL_OPT" 2 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-sf.c b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-sf.c new file mode 100644 index 0000000..9d1e2a1 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-sf.c @@ -0,0 +1,42 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_pcrel } */ +/* { dg-options "-O2 -mdejagnu-cpu=power10" } */ + +#define TYPE float +#define LARGE 0x20000 + +/* Test whether we get the right number of PCREL_OPT optimizations for + float. */ +extern TYPE ext[]; + +TYPE +get (void) +{ + return ext[0]; /* PCREL_OPT relocation. */ +} + +TYPE +get2 (void) +{ + return ext[2]; /* PCREL_OPT relocation. */ +} + +TYPE +get_large (void) +{ + return ext[LARGE]; /* No PCREL_OPT (load is prefixed). */ +} + +TYPE +get_variable (unsigned long n) +{ + return ext[n]; /* No PCREL_OPT (load is indexed). */ +} + +double +get_double (void) +{ + return (double) ext[0]; /* PCREL_OPT relocation. */ +} + +/* { dg-final { scan-assembler-times "R_PPC64_PCREL_OPT" 3 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-si.c b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-si.c new file mode 100644 index 0000000..17be6fa --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-si.c @@ -0,0 +1,41 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_pcrel } */ +/* { dg-options "-O2 -mdejagnu-cpu=power10" } */ + +#define TYPE int +#define LARGE 0x20000 + +/* Test whether we get the right number of PCREL_OPT optimizations for int. */ +extern TYPE ext[]; + +TYPE +get (void) +{ + return ext[0]; /* PCREL_OPT relocation. */ +} + +TYPE +get2 (void) +{ + return ext[2]; /* PCREL_OPT relocation. */ +} + +TYPE +get_large (void) +{ + return ext[LARGE]; /* No PCREL_OPT (load is prefixed). */ +} + +TYPE +get_variable (unsigned long n) +{ + return ext[n]; /* No PCREL_OPT (load is indexed). */ +} + +double +get_double (void) +{ + return (double) ext[0]; /* No PCREL_OPT (LFIWAX is indexed). */ +} + +/* { dg-final { scan-assembler-times "R_PPC64_PCREL_OPT" 2 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-vector.c b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-vector.c new file mode 100644 index 0000000..8c12aea --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-ld-vector.c @@ -0,0 +1,36 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_pcrel } */ +/* { dg-options "-O2 -mdejagnu-cpu=power10" } */ + +#define TYPE vector double +#define LARGE 0x20000 + +/* Test whether we get the right number of PCREL_OPT optimizations for + vector double. */ +extern TYPE ext[]; + +TYPE +get (void) +{ + return ext[0]; /* PCREL_OPT relocation. */ +} + +TYPE +get2 (void) +{ + return ext[2]; /* PCREL_OPT relocation. */ +} + +TYPE +get_large (void) +{ + return ext[LARGE]; /* No PCREL_OPT (load is prefixed). */ +} + +TYPE +get_variable (unsigned long n) +{ + return ext[n]; /* No PCREL_OPT (load is indexed). */ +} + +/* { dg-final { scan-assembler-times "R_PPC64_PCREL_OPT" 2 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-df.c b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-df.c new file mode 100644 index 0000000..d795d35 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-df.c @@ -0,0 +1,36 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_pcrel } */ +/* { dg-options "-O2 -mdejagnu-cpu=power10" } */ + +#define TYPE double +#define LARGE 0x20000 + +/* Test whether we get the right number of PCREL_OPT optimizations for + double. */ +extern TYPE ext[]; + +void +store (TYPE a) +{ + ext[0] = a; /* PCREL_OPT relocation. */ +} + +void +store2 (TYPE a) +{ + ext[2] = a; /* PCREL_OPT relocation. */ +} + +void +store_large (TYPE a) +{ + ext[LARGE] = a; /* No PCREL_OPT (store is prefixed). */ +} + +void +store_variable (TYPE a, unsigned long n) +{ + ext[n] = a; /* No PCREL_OPT (store is indexed). */ +} + +/* { dg-final { scan-assembler-times "R_PPC64_PCREL_OPT" 2 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-di.c b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-di.c new file mode 100644 index 0000000..bf57de4 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-di.c @@ -0,0 +1,36 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_pcrel } */ +/* { dg-options "-O2 -mdejagnu-cpu=power10" } */ + +#define TYPE long long +#define LARGE 0x20000 + +/* Test whether we get the right number of PCREL_OPT optimizations for long + long. */ +extern TYPE ext[]; + +void +store (TYPE a) +{ + ext[0] = a; /* PCREL_OPT relocation. */ +} + +void +store2 (TYPE a) +{ + ext[2] = a; /* PCREL_OPT relocation. */ +} + +void +store_large (TYPE a) +{ + ext[LARGE] = a; /* No PCREL_OPT (store is prefixed). */ +} + +void +store_variable (TYPE a, unsigned long n) +{ + ext[n] = a; /* No PCREL_OPT (store is indexed). */ +} + +/* { dg-final { scan-assembler-times "R_PPC64_PCREL_OPT" 2 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-hi.c b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-hi.c new file mode 100644 index 0000000..8822e76 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-hi.c @@ -0,0 +1,42 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_pcrel } */ +/* { dg-options "-O2 -mdejagnu-cpu=power10" } */ + +#define TYPE unsigned short +#define LARGE 0x20000 + +/* Test whether we get the right number of PCREL_OPT optimizations for unsigned + short. */ +extern TYPE ext[]; + +void +store (TYPE a) +{ + ext[0] = a; /* PCREL_OPT relocation. */ +} + +void +store2 (TYPE a) +{ + ext[2] = a; /* PCREL_OPT relocation. */ +} + +void +store_large (TYPE a) +{ + ext[LARGE] = a; /* No PCREL_OPT (store is prefixed). */ +} + +void +store_variable (TYPE a, unsigned long n) +{ + ext[n] = a; /* No PCREL_OPT (store is indexed). */ +} + +void +store_double (double a) +{ + ext[0] = (TYPE) a; /* No PCREL_OPT (STXIHZX is indexed). */ +} + +/* { dg-final { scan-assembler-times "R_PPC64_PCREL_OPT" 2 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-qi.c b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-qi.c new file mode 100644 index 0000000..2f75683 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-qi.c @@ -0,0 +1,42 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_pcrel } */ +/* { dg-options "-O2 -mdejagnu-cpu=power10" } */ + +#define TYPE unsigned char +#define LARGE 0x20000 + +/* Test whether we get the right number of PCREL_OPT optimizations for unsigned + char. */ +extern TYPE ext[]; + +void +store (TYPE a) +{ + ext[0] = a; /* PCREL_OPT relocation. */ +} + +void +store2 (TYPE a) +{ + ext[2] = a; /* PCREL_OPT relocation. */ +} + +void +store_large (TYPE a) +{ + ext[LARGE] = a; /* No PCREL_OPT (store is prefixed). */ +} + +void +store_variable (TYPE a, unsigned long n) +{ + ext[n] = a; /* No PCREL_OPT (store is indexed). */ +} + +void +store_double (double a) +{ + ext[0] = (TYPE) a; /* No PCREL_OPT (STXIBZX is indexed). */ +} + +/* { dg-final { scan-assembler-times "R_PPC64_PCREL_OPT" 2 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-sf.c b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-sf.c new file mode 100644 index 0000000..3dd88aa --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-sf.c @@ -0,0 +1,36 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_pcrel } */ +/* { dg-options "-O2 -mdejagnu-cpu=power10" } */ + +#define TYPE float +#define LARGE 0x20000 + +/* Test whether we get the right number of PCREL_OPT optimizations for + float. */ +extern TYPE ext[]; + +void +store (TYPE a) +{ + ext[0] = a; /* PCREL_OPT relocation. */ +} + +void +store2 (TYPE a) +{ + ext[2] = a; /* PCREL_OPT relocation. */ +} + +void +store_large (TYPE a) +{ + ext[LARGE] = a; /* No PCREL_OPT (store is prefixed). */ +} + +void +store_variable (TYPE a, unsigned long n) +{ + ext[n] = a; /* No PCREL_OPT (store is indexed). */ +} + +/* { dg-final { scan-assembler-times "R_PPC64_PCREL_OPT" 2 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-si.c b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-si.c new file mode 100644 index 0000000..78dc812 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-si.c @@ -0,0 +1,41 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_pcrel } */ +/* { dg-options "-O2 -mdejagnu-cpu=power10" } */ + +#define TYPE int +#define LARGE 0x20000 + +/* Test whether we get the right number of PCREL_OPT optimizations for int. */ +extern TYPE ext[]; + +void +store (TYPE a) +{ + ext[0] = a; /* PCREL_OPT relocation. */ +} + +void +store2 (TYPE a) +{ + ext[2] = a; /* PCREL_OPT relocation. */ +} + +void +store_large (TYPE a) +{ + ext[LARGE] = a; /* No PCREL_OPT (store is prefixed). */ +} + +void +store_variable (TYPE a, unsigned long n) +{ + ext[n] = a; /* No PCREL_OPT (store is indexed). */ +} + +void +store_double (double a) +{ + ext[0] = (TYPE) a; /* No PCREL_OPT (STFIWX is indexed). */ +} + +/* { dg-final { scan-assembler-times "R_PPC64_PCREL_OPT" 2 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-vector.c b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-vector.c new file mode 100644 index 0000000..2c602eb --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pcrel-opt-st-vector.c @@ -0,0 +1,36 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_pcrel } */ +/* { dg-options "-O2 -mdejagnu-cpu=power10" } */ + +#define TYPE vector double +#define LARGE 0x20000 + +/* Test whether we get the right number of PCREL_OPT optimizations for + vector double. */ +extern TYPE ext[]; + +void +store (TYPE a) +{ + ext[0] = a; /* PCREL_OPT relocation. */ +} + +void +store2 (TYPE a) +{ + ext[2] = a; /* PCREL_OPT relocation. */ +} + +void +store_large (TYPE a) +{ + ext[LARGE] = a; /* No PCREL_OPT (store is prefixed). */ +} + +void +store_variable (TYPE a, unsigned long n) +{ + ext[n] = a; /* No PCREL_OPT (store is indexed). */ +} + +/* { dg-final { scan-assembler-times "R_PPC64_PCREL_OPT" 2 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/ppc-eabi.c b/gcc/testsuite/gcc.target/powerpc/ppc-eabi.c index cd15586..8718430 100644 --- a/gcc/testsuite/gcc.target/powerpc/ppc-eabi.c +++ b/gcc/testsuite/gcc.target/powerpc/ppc-eabi.c @@ -2,4 +2,6 @@ /* { dg-do compile } */ /* { dg-require-effective-target powerpc_eabi_ok } */ /* { dg-options "-meabi -mrelocatable" } */ +/* { dg-require-effective-target fpic } */ + char *s = "boo"; diff --git a/gcc/testsuite/gcc.target/powerpc/pr26350.c b/gcc/testsuite/gcc.target/powerpc/pr26350.c index ee08160..76b0c0f 100644 --- a/gcc/testsuite/gcc.target/powerpc/pr26350.c +++ b/gcc/testsuite/gcc.target/powerpc/pr26350.c @@ -1,5 +1,6 @@ /* { dg-do compile { target { powerpc*-*-darwin* powerpc*-*-aix* rs6000-*-* powerpc*-*-linux* } } } */ /* { dg-options "-O2 -mlong-double-128 -fpic" } */ +/* { dg-require-effective-target fpic } */ typedef int int32_t __attribute__ ((__mode__ (__SI__))); typedef unsigned char uint8_t; diff --git a/gcc/testsuite/gcc.target/powerpc/pr79439-1.c b/gcc/testsuite/gcc.target/powerpc/pr79439-1.c index 8eb08a4..04f2f96 100644 --- a/gcc/testsuite/gcc.target/powerpc/pr79439-1.c +++ b/gcc/testsuite/gcc.target/powerpc/pr79439-1.c @@ -1,5 +1,6 @@ /* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */ /* { dg-options "-O2 -fpic -fno-reorder-blocks -fno-inline-functions -mno-pcrel" } */ +/* { dg-require-effective-target fpic } */ /* On the Linux 64-bit ABIs, we eliminate NOP in the 'rec' call even if -fpic is used. The recursive call should call the local alias. The diff --git a/gcc/testsuite/gcc.target/powerpc/pr79439-2.c b/gcc/testsuite/gcc.target/powerpc/pr79439-2.c index 9ebcf25..ec14208 100644 --- a/gcc/testsuite/gcc.target/powerpc/pr79439-2.c +++ b/gcc/testsuite/gcc.target/powerpc/pr79439-2.c @@ -1,5 +1,6 @@ /* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */ /* { dg-options "-O2 -fpic -fno-reorder-blocks -mno-pcrel" } */ +/* { dg-require-effective-target fpic } */ /* On the Linux 64-bit ABIs, we should not eliminate NOP in the 'rec' call if -fpic is used because rec can be interposed at link time (since it has an diff --git a/gcc/testsuite/gcc.target/powerpc/pr79439-3.c b/gcc/testsuite/gcc.target/powerpc/pr79439-3.c index 762ca44..0cc80f4 100644 --- a/gcc/testsuite/gcc.target/powerpc/pr79439-3.c +++ b/gcc/testsuite/gcc.target/powerpc/pr79439-3.c @@ -1,5 +1,6 @@ /* { dg-do compile { target { powerpc-*-linux* && ilp32 } } } */ /* { dg-options "-O2 -fpic -fno-reorder-blocks" } */ +/* { dg-require-effective-target fpic } */ /* Analog of pr79439-1.c for 32-bit Linux. */ diff --git a/gcc/testsuite/gcc.target/powerpc/pr96264.c b/gcc/testsuite/gcc.target/powerpc/pr96264.c new file mode 100644 index 0000000..9f7d885 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr96264.c @@ -0,0 +1,28 @@ +/* { dg-do run { target { powerpc64le-*-* } } } */ +/* { dg-options "-Os -fno-forward-propagate -fschedule-insns -fno-tree-ter -Wno-psabi" } */ +/* { dg-require-effective-target p8vector_hw } */ + +typedef unsigned char __attribute__ ((__vector_size__ (64))) v512u8; +typedef unsigned short u16; +typedef unsigned short __attribute__ ((__vector_size__ (64))) v512u16; +typedef unsigned __int128 __attribute__ ((__vector_size__ (64))) v512u128; + +v512u16 d; +v512u128 f; + +v512u8 +foo (u16 e) +{ + v512u128 g = f - -e; + d = (5 / (d + 1)) < e; + return (v512u8) g; +} + +int +main (void) +{ + v512u8 x = foo (2); + for (unsigned i = 0; i < sizeof (x); i++) + if (x[i] != (i % 16 ? 0 : 2)) + __builtin_abort (); +} diff --git a/gcc/testsuite/gcc.target/powerpc/pr98872.c b/gcc/testsuite/gcc.target/powerpc/pr98872.c new file mode 100644 index 0000000..f33ad9b --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr98872.c @@ -0,0 +1,19 @@ +/* PR target/98872 */ +/* { dg-require-effective-target power10_ok } */ +/* { dg-options "-O2 -mdejagnu-cpu=power10" } */ + +/* Verify we do not ICE on the following tests. */ + +void +foo (__vector_quad *dst) +{ + __vector_quad acc; + *dst = acc; +} + +void +bar (__vector_pair *dst) +{ + __vector_pair pair; + *dst = pair; +} diff --git a/gcc/testsuite/gcc.target/powerpc/pr98959.c b/gcc/testsuite/gcc.target/powerpc/pr98959.c new file mode 100644 index 0000000..e03f1ca --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr98959.c @@ -0,0 +1,19 @@ +/* PR target/98959 */ +/* { dg-require-effective-target int128 } */ +/* { dg-require-effective-target lp64 } */ /* for -mcmodel= */ +/* { dg-options "-fno-schedule-insns -O2 -mcmodel=small" } */ + +/* Verify we do not ICE on the following. */ + +typedef __attribute__ ((altivec (vector__))) unsigned __int128 v1ti_t; + +v1ti_t foo (v1ti_t v); + +void +bug () +{ + v1ti_t dv = { ((31415926539) << 6) }; + dv = foo (dv); + if (dv[0] != 0) + __builtin_abort (); +} diff --git a/gcc/testsuite/gcc.target/powerpc/pr99492.c b/gcc/testsuite/gcc.target/powerpc/pr99492.c new file mode 100644 index 0000000..ae36cb3 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr99492.c @@ -0,0 +1,50 @@ +/* { dg-do run { target { powerpc*-ibm-aix* } } } */ +/* { dg-options "" } */ + +void abort (void); + +struct A { + double _Complex a[64]; +}; + +struct B { + double b[64]; +}; + +struct C { + char c1; + double _Complex c2; +}; + +struct D { + char c1; + double c2; +}; + +int main() { + if (__alignof(double _Complex) != 8) + abort(); + + if (__alignof(struct A) != 8) + abort; + + if (__alignof(struct C) != 4) + abort; + + if (__builtin_offsetof(struct C, c2) != 4) + abort(); + + if (__alignof(double) != 8) + abort(); + + if (__alignof(struct B) != 8) + abort(); + + if (__alignof(struct D) != 4) + abort(); + + if (__builtin_offsetof(struct D, c2) != 4) + abort(); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/powerpc/undef-bool-2.c b/gcc/testsuite/gcc.target/powerpc/undef-bool-2.c index d4944ab..7bc5d18 100644 --- a/gcc/testsuite/gcc.target/powerpc/undef-bool-2.c +++ b/gcc/testsuite/gcc.target/powerpc/undef-bool-2.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-O2 -std=c11 -DNO_WARN_X86_INTRINSICS -mvsx" } */ /* { dg-require-effective-target lp64 } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ /* Test to ensure that "bool" gets undef'd in xmmintrin.h when we require strict ANSI. Subsequent use of bool needs stdbool.h. diff --git a/gcc/testsuite/gcc.target/powerpc/vec-init-10.c b/gcc/testsuite/gcc.target/powerpc/vec-init-10.c new file mode 100644 index 0000000..23587b3 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/vec-init-10.c @@ -0,0 +1,24 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-require-effective-target powerpc_p8vector_ok } */ +/* { dg-options "-O2 -mdejagnu-cpu=power8" } */ + +/* Check that we can optimize sldi + or to rldimi for vector int init. */ + +vector unsigned int +testu (unsigned int i1, unsigned int i2, unsigned int i3, unsigned int i4) +{ + vector unsigned int v = {i1, i2, i3, i4}; + return v; +} + +vector signed int +tests (signed int i1, signed int i2, signed int i3, signed int i4) +{ + vector signed int v = {i1, i2, i3, i4}; + return v; +} + +/* { dg-final { scan-assembler-not {\msldi\M} } } */ +/* { dg-final { scan-assembler-not {\mor\M} } } */ +/* { dg-final { scan-assembler-times {\mrldimi\M} 4 } } */ diff --git a/gcc/testsuite/gcc.target/s390/mul-signed-overflow-1.c b/gcc/testsuite/gcc.target/s390/mul-signed-overflow-1.c index fdf56d6..e8b1938 100644 --- a/gcc/testsuite/gcc.target/s390/mul-signed-overflow-1.c +++ b/gcc/testsuite/gcc.target/s390/mul-signed-overflow-1.c @@ -1,4 +1,5 @@ -/* { dg-do run } */ +/* { dg-do compile } */ +/* { dg-do run { target { s390_z14_hw } } } */ /* z14 only because we need msrkc, msc, msgrkc, msgc */ /* { dg-options "-O3 -march=z14 -mzarch --save-temps" } */ diff --git a/gcc/testsuite/gcc.target/s390/mul-signed-overflow-2.c b/gcc/testsuite/gcc.target/s390/mul-signed-overflow-2.c index d008818..01328e1 100644 --- a/gcc/testsuite/gcc.target/s390/mul-signed-overflow-2.c +++ b/gcc/testsuite/gcc.target/s390/mul-signed-overflow-2.c @@ -1,4 +1,5 @@ -/* { dg-do run } */ +/* { dg-do compile } */ +/* { dg-do run { target { s390_z14_hw } } } */ /* z14 only because we need msrkc, msc, msgrkc, msgc */ /* { dg-options "-O3 -march=z14 -mzarch --save-temps" } */ diff --git a/gcc/testsuite/gcc.target/s390/target-attribute/pr99313.c b/gcc/testsuite/gcc.target/s390/target-attribute/pr99313.c new file mode 100644 index 0000000..bd85983 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/target-attribute/pr99313.c @@ -0,0 +1,5 @@ +/* PR target/99313 */ + +#pragma GCC push_options +#pragma GCC target ("arch=z13") +#pragma GCC pop_options diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-asm-commutative.c b/gcc/testsuite/gcc.target/s390/vector/long-double-asm-commutative.c new file mode 100644 index 0000000..59d807c --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/vector/long-double-asm-commutative.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z14 -mzarch" } */ +/* { dg-do run { target { s390_z14_hw } } } */ +#include <assert.h> +#include <stdint.h> + +int +main (void) +{ + long double res, x = 40., y = 2.; + asm("lxr\t%0,%1\n" + "\taxbr\t%0,%2" + : "=&f"(res) + : "%f"(x), "f"(y)); + assert (res == 42.); +} diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-asm-earlyclobber.c b/gcc/testsuite/gcc.target/s390/vector/long-double-asm-earlyclobber.c new file mode 100644 index 0000000..5dd0275 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/vector/long-double-asm-earlyclobber.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z14 -mzarch" } */ +/* { dg-do run { target { s390_z14_hw } } } */ +#include <assert.h> +#include <stdint.h> + +int +main (void) +{ + long double res, x = 0x1.0000000000001p+0L, + exp = 1.00000000000000011102230246251564788e+0L; + asm("lzxr\t%0\n" + "\tsqxbr\t%0,%1" + : "=&f"(res) + : "f"(x)); + assert (res == exp); +} diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-asm-in-out.c b/gcc/testsuite/gcc.target/s390/vector/long-double-asm-in-out.c new file mode 100644 index 0000000..27d447f --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/vector/long-double-asm-in-out.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z14 -mzarch" } */ +/* { dg-do run { target { s390_z14_hw } } } */ +#include <assert.h> +#include <stdint.h> + +int +main (void) +{ + long double res, x = 0x1.0000000000001p+0L, + exp = 1.00000000000000011102230246251564788e+0L; + asm("sqxbr\t%0,%1" : "=f"(res) : "f"(x)); + assert (res == exp); +} diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-asm-inout.c b/gcc/testsuite/gcc.target/s390/vector/long-double-asm-inout.c new file mode 100644 index 0000000..e0b6ac5 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/vector/long-double-asm-inout.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z14 -mzarch" } */ +/* { dg-do run { target { s390_z14_hw } } } */ +#include <assert.h> +#include <stdint.h> + +int +main (void) +{ + long double res = 0x1.0000000000001p+0L, + exp = 1.00000000000000011102230246251564788e+0L; + asm("sqxbr\t%0,%0" : "+f"(res)); + assert (res == exp); +} diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-asm-matching.c b/gcc/testsuite/gcc.target/s390/vector/long-double-asm-matching.c new file mode 100644 index 0000000..c8b8c3d --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/vector/long-double-asm-matching.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z14 -mzarch" } */ +/* { dg-do run { target { s390_z14_hw } } } */ +#include <assert.h> +#include <stdint.h> + +int +main (void) +{ + long double res, x = 40., y = 2.; + asm("axbr\t%0,%2" : "=f"(res) : "0"(x), "f"(y)); + assert (res == 42.); +} diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-asm-regmem.c b/gcc/testsuite/gcc.target/s390/vector/long-double-asm-regmem.c new file mode 100644 index 0000000..314f658 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/vector/long-double-asm-regmem.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z14 -mzarch" } */ + +void +foo (long double x) +{ + asm("# %0" : "+fm"(x)); +} diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-from-decimal128.c b/gcc/testsuite/gcc.target/s390/vector/long-double-from-decimal128.c new file mode 100644 index 0000000..3cd2c68 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/vector/long-double-from-decimal128.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z14 -mzarch --save-temps" } */ +/* { dg-do run { target { s390_z14_hw } } } */ +#include <assert.h> +#include <stdint.h> + +__attribute__ ((noipa)) static long double +long_double_from_decimal128 (_Decimal128 x) +{ + return x; +} + +/* { dg-final { scan-assembler-times {\n\tpfpo\n} 1 } } */ + +int +main (void) +{ + assert (long_double_from_decimal128 ((_Decimal128) 42) == 42.L); + assert (long_double_from_decimal128 ((_Decimal128) -42) == -42.L); +} diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-from-decimal32.c b/gcc/testsuite/gcc.target/s390/vector/long-double-from-decimal32.c new file mode 100644 index 0000000..84e3c4b --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/vector/long-double-from-decimal32.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z14 -mzarch --save-temps" } */ +/* { dg-do run { target { s390_z14_hw } } } */ +#include <assert.h> +#include <stdint.h> + +__attribute__ ((noipa)) static long double +long_double_from_decimal32 (_Decimal32 x) +{ + return x; +} + +/* { dg-final { scan-assembler-times {\n\tpfpo\n} 1 } } */ + +int +main (void) +{ + assert (long_double_from_decimal32 ((_Decimal32) 42) == 42.L); + assert (long_double_from_decimal32 ((_Decimal32) -42) == -42.L); +} diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-from-decimal64.c b/gcc/testsuite/gcc.target/s390/vector/long-double-from-decimal64.c new file mode 100644 index 0000000..f855e4b --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/vector/long-double-from-decimal64.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z14 -mzarch --save-temps" } */ +/* { dg-do run { target { s390_z14_hw } } } */ +#include <assert.h> +#include <stdint.h> + +__attribute__ ((noipa)) static long double +long_double_from_decimal64 (_Decimal64 x) +{ + return x; +} + +/* { dg-final { scan-assembler-times {\n\tpfpo\n} 1 } } */ + +int +main (void) +{ + assert (long_double_from_decimal64 ((_Decimal64) 42) == 42.L); + assert (long_double_from_decimal64 ((_Decimal64) -42) == -42.L); +} diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-to-decimal128.c b/gcc/testsuite/gcc.target/s390/vector/long-double-to-decimal128.c new file mode 100644 index 0000000..5f7833a --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/vector/long-double-to-decimal128.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z14 -mzarch --save-temps" } */ +/* { dg-do run { target { s390_z14_hw } } } */ +#include <assert.h> + +__attribute__ ((noipa)) static _Decimal128 +long_double_to_decimal128 (long double x) +{ + return x; +} + +/* { dg-final { scan-assembler-times {\n\tpfpo\n} 1 } } */ + +int +main (void) +{ + assert (long_double_to_decimal128 (42.L) == (_Decimal128) 42.); + assert (long_double_to_decimal128 (-42.L) == (_Decimal128) -42.); +} diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-to-decimal32.c b/gcc/testsuite/gcc.target/s390/vector/long-double-to-decimal32.c new file mode 100644 index 0000000..f09288a --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/vector/long-double-to-decimal32.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z14 -mzarch --save-temps" } */ +/* { dg-do run { target { s390_z14_hw } } } */ +#include <assert.h> + +__attribute__ ((noipa)) static _Decimal32 +long_double_to_decimal32 (long double x) +{ + return x; +} + +/* { dg-final { scan-assembler-times {\n\tpfpo\n} 1 } } */ + +int +main (void) +{ + assert (long_double_to_decimal32 (42.L) == (_Decimal32) 42.); + assert (long_double_to_decimal32 (-42.L) == (_Decimal32) -42.); +} diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-to-decimal64.c b/gcc/testsuite/gcc.target/s390/vector/long-double-to-decimal64.c new file mode 100644 index 0000000..08aecfe --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/vector/long-double-to-decimal64.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z14 -mzarch --save-temps" } */ +/* { dg-do run { target { s390_z14_hw } } } */ +#include <assert.h> + +__attribute__ ((noipa)) static _Decimal64 +long_double_to_decimal64 (long double x) +{ + return x; +} + +/* { dg-final { scan-assembler-times {\n\tpfpo\n} 1 } } */ + +int +main (void) +{ + assert (long_double_to_decimal64 (42.L) == (_Decimal64) 42.); + assert (long_double_to_decimal64 (-42.L) == (_Decimal64) -42.); +} diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-volatile-from-i64.c b/gcc/testsuite/gcc.target/s390/vector/long-double-volatile-from-i64.c new file mode 100644 index 0000000..f448984 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/vector/long-double-volatile-from-i64.c @@ -0,0 +1,22 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z14 -mzarch --save-temps" } */ +/* { dg-do run { target { s390_z14_hw } } } */ +#include <assert.h> +#include <stdint.h> + +__attribute__ ((noipa)) static long double +long_double_volatile_from_i64 (int64_t x) +{ + static volatile long double y; + y = x; + return y; +} + +/* { dg-final { scan-assembler-times {\n\tcxgbr\t} 1 } } */ + +int +main (void) +{ + assert (long_double_volatile_from_i64 (42) == 42.L); + assert (long_double_volatile_from_i64 (-42) == -42.L); +} diff --git a/gcc/testsuite/gcc.target/s390/zvector/vec-nnpa-fp16-convert.c b/gcc/testsuite/gcc.target/s390/zvector/vec-nnpa-fp16-convert.c new file mode 100644 index 0000000..5ed7e05 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/vec-nnpa-fp16-convert.c @@ -0,0 +1,34 @@ +/* { dg-do run } */ +/* { dg-require-effective-target s390_nnpa } */ +/* { dg-options "-O3 -mzarch -march=arch14 -mzvector --save-temps" } */ + +#include <vecintrin.h> + +int +main () +{ + vector float fp1 = (vector float){ 1.0f, 2.0f, 3.0f, 4.0f }; + vector float fp2 = (vector float){ 5.0f, 6.0f, 7.0f, 8.0f }; + + vector short int tmp1 = vec_round_from_fp32 (fp1, fp2, 0); + + vector short int tmp2 = vec_convert_to_fp16 (tmp1, 0); + vector short int tmp3 = vec_convert_from_fp16 (tmp2, 0); + + vector float fp1_ret = vec_extend_to_fp32_hi (tmp3, 0); + vector float fp2_ret = vec_extend_to_fp32_lo (tmp3, 0); + + if (vec_any_ne (fp1, fp1_ret)) + __builtin_abort (); + + if (vec_any_ne (fp2, fp2_ret)) + __builtin_abort (); + + return 0; +} + +/* { dg-final { scan-assembler-times "vcrnf\t" 1 } } */ +/* { dg-final { scan-assembler-times "vcfn\t" 1 } } */ +/* { dg-final { scan-assembler-times "vcnf\t" 1 } } */ +/* { dg-final { scan-assembler-times "vclfnh\t" 1 } } */ +/* { dg-final { scan-assembler-times "vclfnl\t" 1 } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/vec-nnpa-fp32-convert-1.c b/gcc/testsuite/gcc.target/s390/zvector/vec-nnpa-fp32-convert-1.c new file mode 100644 index 0000000..321488a --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/vec-nnpa-fp32-convert-1.c @@ -0,0 +1,27 @@ +/* { dg-do run } */ +/* { dg-require-effective-target s390_nnpa } */ +/* { dg-options "-O3 -mzarch -march=arch14 -mzvector --save-temps" } */ + +#include <vecintrin.h> + +int +main () +{ + vector float fp1 = (vector float){ 1.0f, 2.0f, 3.0f, 4.0f }; + vector float fp2 = (vector float){ 5.0f, 6.0f, 7.0f, 8.0f }; + vector short int conv = vec_round_from_fp32 (fp1, fp2, 0); + vector float fp1_ret = vec_extend_to_fp32_hi (conv, 0); + vector float fp2_ret = vec_extend_to_fp32_lo (conv, 0); + + if (vec_any_ne (fp1, fp1_ret)) + __builtin_abort (); + + if (vec_any_ne (fp2, fp2_ret)) + __builtin_abort (); + + return 0; +} + +/* { dg-final { scan-assembler-times "vcrnf\t" 1 } } */ +/* { dg-final { scan-assembler-times "vclfnh\t" 1 } } */ +/* { dg-final { scan-assembler-times "vclfnl\t" 1 } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/vec_convert_from_fp16.c b/gcc/testsuite/gcc.target/s390/zvector/vec_convert_from_fp16.c new file mode 100644 index 0000000..fc7ccf0 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/vec_convert_from_fp16.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -mzarch -march=arch14 -mzvector" } */ + +#include <vecintrin.h> + +vector short int +test_vec_convert_from_fp16 (vector short int a) +{ + return vec_convert_from_fp16 (a, 0); +} + +/* { dg-final { scan-assembler-times "vcnf\t" 1 } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/vec_convert_to_fp16.c b/gcc/testsuite/gcc.target/s390/zvector/vec_convert_to_fp16.c new file mode 100644 index 0000000..7232643 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/vec_convert_to_fp16.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -mzarch -march=arch14 -mzvector" } */ + +#include <vecintrin.h> + +vector short int +test_vec_convert_to_fp16 (vector short int a) +{ + return vec_convert_to_fp16 (a, 0); +} + +/* { dg-final { scan-assembler-times "vcfn\t" 1 } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/vec_extend_to_fp32_hi.c b/gcc/testsuite/gcc.target/s390/zvector/vec_extend_to_fp32_hi.c new file mode 100644 index 0000000..feb5e78 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/vec_extend_to_fp32_hi.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -mzarch -march=arch14 -mzvector" } */ + +#include <vecintrin.h> + +vector float +test_vec_extend_to_fp32_hi (vector short int a) +{ + return vec_extend_to_fp32_hi (a, 0); +} + +/* { dg-final { scan-assembler-times "vclfnh\t" 1 } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/vec_extend_to_fp32_lo.c b/gcc/testsuite/gcc.target/s390/zvector/vec_extend_to_fp32_lo.c new file mode 100644 index 0000000..179de17 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/vec_extend_to_fp32_lo.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -mzarch -march=arch14 -mzvector" } */ + +#include <vecintrin.h> + +vector float +test_vec_extend_to_fp32_lo (vector short int a) +{ + return vec_extend_to_fp32_lo (a, 0); +} + +/* { dg-final { scan-assembler-times "vclfnl\t" 1 } } */ diff --git a/gcc/testsuite/gcc.target/s390/zvector/vec_round_from_fp32.c b/gcc/testsuite/gcc.target/s390/zvector/vec_round_from_fp32.c new file mode 100644 index 0000000..83924522 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/vec_round_from_fp32.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -mzarch -march=arch14 -mzvector" } */ + +#include <vecintrin.h> + +vector short int +test_vec_round_from_fp32 (vector float hi, vector float lo) +{ + return vec_round_from_fp32 (hi, lo, 0); +} + +/* { dg-final { scan-assembler-times "vcrnf\t" 1 } } */ diff --git a/gcc/testsuite/gfortran.dg/assumed_rank_21.f90 b/gcc/testsuite/gfortran.dg/assumed_rank_21.f90 new file mode 100644 index 0000000..ef5edbfb --- /dev/null +++ b/gcc/testsuite/gfortran.dg/assumed_rank_21.f90 @@ -0,0 +1,96 @@ +! { dg-do run } +! +! Test the fix for PR98342. +! +! Contributed by Martin Stein <mscfd@gmx.net> +! +module mod + implicit none + private + public get_tuple, sel_rank1, sel_rank2, sel_rank3 + + type, public :: tuple + integer, dimension(:), allocatable :: t +end type tuple + +contains + +function sel_rank1(x) result(s) + character(len=:), allocatable :: s + type(tuple), dimension(..), intent(in) :: x + select rank (x) + rank (0) + s = '10' + rank (1) + s = '11' + rank default + s = '?' + end select +end function sel_rank1 + +function sel_rank2(x) result(s) + character(len=:), allocatable :: s + class(tuple), dimension(..), intent(in) :: x + select rank (x) + rank (0) + s = '20' + rank (1) + s = '21' + rank default + s = '?' + end select +end function sel_rank2 + +function sel_rank3(x) result(s) + character(len=:), allocatable :: s + class(*), dimension(..), intent(in) :: x + select rank (x) + rank (0) + s = '30' + rank (1) + s = '31' + rank default + s = '?' + end select +end function sel_rank3 + +function get_tuple(t) result(a) + type(tuple) :: a + integer, dimension(:), intent(in) :: t + allocate(a%t, source=t) +end function get_tuple + +end module mod + + +program alloc_rank + use mod + implicit none + + integer, dimension(1:3) :: x + character(len=:), allocatable :: output + type(tuple) :: z + + x = [1,2,3] + z = get_tuple (x) + ! Derived type formal arg + output = sel_rank1(get_tuple (x)) ! runtime: Error in `./alloc_rank.x': + if (output .ne. '10') stop 1 + output = sel_rank1([z]) ! This worked OK + if (output .ne. '11') stop 2 + + ! Class formal arg + output = sel_rank2(get_tuple (x)) ! runtime: Error in `./alloc_rank.x': + if (output .ne. '20') stop 3 + output = sel_rank2([z]) ! This worked OK + if (output .ne. '21') stop 4 + + ! Unlimited polymorphic formal arg + output = sel_rank3(get_tuple (x)) ! runtime: Error in `./alloc_rank.x': + if (output .ne. '30') stop 5 + output = sel_rank3([z]) ! runtime: segmentation fault + if (output .ne. '31') stop 6 + + deallocate (output) + deallocate (z%t) +end program alloc_rank diff --git a/gcc/testsuite/gfortran.dg/class_assign_4.f90 b/gcc/testsuite/gfortran.dg/class_assign_4.f90 index 517e312..2a77d81 100644 --- a/gcc/testsuite/gfortran.dg/class_assign_4.f90 +++ b/gcc/testsuite/gfortran.dg/class_assign_4.f90 @@ -11,17 +11,19 @@ module m type :: t1 integer :: i CONTAINS - PROCEDURE :: add_t1 - GENERIC :: OPERATOR(+) => add_t1 end type type, extends(t1) :: t2 real :: r end type + interface operator(+) + module procedure add_t1 + end interface + contains - impure elemental function add_t1 (a, b) result (c) - class(t1), intent(in) :: a, b - class(t1), allocatable :: c + function add_t1 (a, b) result (c) + class(t1), intent(in) :: a(:), b(:) + class(t1), allocatable :: c(:) allocate (c, source = a) c%i = a%i + b%i select type (c) diff --git a/gcc/testsuite/gfortran.dg/class_defined_operator_2.f03 b/gcc/testsuite/gfortran.dg/class_defined_operator_2.f03 new file mode 100644 index 0000000..b7d53b8 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/class_defined_operator_2.f03 @@ -0,0 +1,31 @@ +! { dg-do run } +! +! Test the fix for PR99124 which used to ICE as shown. +! +! Contributed by Gerhard Steinmetz <gscfq@t-online.de> +! +module m + type t + integer :: i + contains + procedure :: f + generic :: operator(+) => f + end type +contains + elemental function f(a, b) result(c) + class(t), intent(in) :: a, b + type(t) :: c + c = t(a%i + b%i) + end +end +program p + use m + class(t), allocatable :: x(:), y(:), z + allocate (x, source = [t(1), t(2)]) + allocate (y, source = [t(1), t(2)]) + x = x(2) + y ! ICE + if (any (x%i .ne. [3, 4])) stop 1 + z = x(1) + x = z + y ! ICE + if (any (x%i .ne. [4, 5])) stop 2 +end diff --git a/gcc/testsuite/gfortran.dg/coarray/array_temporary-1.f90 b/gcc/testsuite/gfortran.dg/coarray/array_temporary-1.f90 new file mode 100644 index 0000000..454929c --- /dev/null +++ b/gcc/testsuite/gfortran.dg/coarray/array_temporary-1.f90 @@ -0,0 +1,13 @@ +! PR fortran/99010 +! +! Follow-up to PR fortran/98913 +! +! Contributed by G. Steinmetz +! +program p + integer :: x[*] + x = this_image() + if ( this_image() == 2 ) then + x = x[1] + end if +end diff --git a/gcc/testsuite/gfortran.dg/data_char_4.f90 b/gcc/testsuite/gfortran.dg/data_char_4.f90 new file mode 100644 index 0000000..ed0782c --- /dev/null +++ b/gcc/testsuite/gfortran.dg/data_char_4.f90 @@ -0,0 +1,11 @@ +! { dg-do compile } +! PR fortran/99205 - Out of memory with undefined character length +! { dg-options "-w" } + +program p + character(l) :: c(2) ! { dg-error "must have constant character length" } + data c /'a', 'b'/ + common c +end + +! { dg-error "cannot appear in the expression at" " " { target *-*-* } 6 } diff --git a/gcc/testsuite/gfortran.dg/data_char_5.f90 b/gcc/testsuite/gfortran.dg/data_char_5.f90 new file mode 100644 index 0000000..ea26687 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/data_char_5.f90 @@ -0,0 +1,15 @@ +! { dg-do compile } +! PR fortran/99205 - Issues with non-constant character length + +subroutine sub () + integer :: ll = 4 + block + character(ll) :: c(2) ! { dg-error "non-constant" } + data c /'a', 'b'/ + end block +contains + subroutine sub1 () + character(ll) :: d(2) ! { dg-error "non-constant" } + data d /'a', 'b'/ + end subroutine sub1 +end subroutine sub diff --git a/gcc/testsuite/gfortran.dg/dtio_36.f90 b/gcc/testsuite/gfortran.dg/dtio_36.f90 new file mode 100644 index 0000000..4e53581 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/dtio_36.f90 @@ -0,0 +1,33 @@ +! { dg-do compile } +! +! PR fortran/99146 +! + MODULE p + TYPE :: person + sequence + END TYPE person + INTERFACE READ(UNFORMATTED) + MODULE PROCEDURE pruf + END INTERFACE + + CONTAINS + + SUBROUTINE pruf (dtv,unit,iostat,iomsg) + type(person), INTENT(INOUT) :: dtv + INTEGER, INTENT(IN) :: unit + INTEGER, INTENT(OUT) :: iostat + CHARACTER (LEN=*), INTENT(INOUT) :: iomsg + iostat = 1 + END SUBROUTINE pruf + + END MODULE p + + PROGRAM test + USE p + TYPE (person) :: chairman + + OPEN (UNIT=71, status = 'scratch', FORM='UNFORMATTED') + + read(71) chairman + + END PROGRAM test diff --git a/gcc/testsuite/gfortran.dg/elemental_result_2.f90 b/gcc/testsuite/gfortran.dg/elemental_result_2.f90 new file mode 100644 index 0000000..490c2ef --- /dev/null +++ b/gcc/testsuite/gfortran.dg/elemental_result_2.f90 @@ -0,0 +1,33 @@ +! { dg-do compile } +! +! Test part of the fix for PR99124 which adds errors for class results +! That violate F2018, C15100. +! +! Contributed by Gerhard Steinmetz <gscfq@t-online.de> +! +module m + type t + integer :: i + contains + procedure :: f + generic :: operator(+) => f + end type +contains + elemental function f(a, b) & + result(c) ! { dg-error "shall not have an ALLOCATABLE or POINTER attribute" } + class(t), intent(in) :: a, b + class(t), allocatable :: c + c = t(a%i + b%i) + end + elemental function g(a, b) & + result(c) ! { dg-error "shall not have an ALLOCATABLE or POINTER attribute" } + class(t), intent(in) :: a, b + class(t), pointer :: c + c => null () + end + elemental function h(a, b) & ! { dg-error "must have a scalar result" } + result(c) ! { dg-error "must be dummy, allocatable or pointer" } + class(t), intent(in) :: a, b + class(t) :: c(2) + end +end diff --git a/gcc/testsuite/gfortran.dg/fmt_nonchar_1.f90 b/gcc/testsuite/gfortran.dg/fmt_nonchar_1.f90 new file mode 100644 index 0000000..431b615 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/fmt_nonchar_1.f90 @@ -0,0 +1,46 @@ +! { dg-do compile } +! +! PR fortran/99111 +! +program p + use iso_c_binding + implicit none + type t + integer :: a(1) + end type + type(t), parameter :: x(3) = [t(transfer('("he', 1)), & + t(transfer('llo ', 1)), & + t(transfer('W1")', 1))] + type t2 + procedure(), pointer, nopass :: ppt + end type t2 + type(t2) :: ppcomp(1) + interface + function fptr() + procedure(), pointer :: fptr + end function + end interface + class(t), allocatable :: cl(:) + type(c_ptr) :: cptr(1) + type(c_funptr) :: cfunptr(1) + procedure(), pointer :: proc + external proc2 + + print x ! { dg-error "Non-character non-Hollerith in FORMAT tag" } + print cl ! { dg-error "Non-character non-Hollerith in FORMAT tag" } + print cptr ! { dg-error "Non-character non-Hollerith in FORMAT tag" } + print cfunptr ! { dg-error "Non-character non-Hollerith in FORMAT tag" } + + print proc ! { dg-error "Syntax error in PRINT statement" } + print proc2 ! { dg-error "Syntax error in PRINT statement" } + print ppcomp%ppt ! { dg-error "Syntax error in PRINT statement" } + + print fptr() ! { dg-error "must be of type default-kind CHARACTER or of INTEGER" } + + call bar(1) +contains + subroutine bar (xx) + type(*) :: xx + print xx ! { dg-error "Assumed-type variable xx at ... may only be used as actual argument" } + end +end diff --git a/gcc/testsuite/gfortran.dg/fmt_nonchar_2.f90 b/gcc/testsuite/gfortran.dg/fmt_nonchar_2.f90 new file mode 100644 index 0000000..7c0f524 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/fmt_nonchar_2.f90 @@ -0,0 +1,22 @@ +! { dg-do run } +! +! PR fortran/99111 +! +program p + implicit none + type t + integer :: a(1) + end type + type(t), parameter :: x(3) = [t(transfer('("he', 1)), & + t(transfer('llo ', 1)), & + t(transfer('W1")', 1))] + + integer, parameter :: y(3) = transfer('("hello W2")', 1, size=3) + real, parameter :: z(3) = transfer('("hello W3")', 1.0, size=3) + + print y ! { dg-warning "Legacy Extension: Non-character in FORMAT" } + print z ! { dg-warning "Legacy Extension: Non-character in FORMAT" } + print x%a(1) ! { dg-warning "Legacy Extension: Non-character in FORMAT" } +end + +! { dg-output "hello W2(\n|\r\n|\r)hello W3(\n|\r\n|\r)hello W1" } diff --git a/gcc/testsuite/gfortran.dg/goacc/array-with-dt-1.f90 b/gcc/testsuite/gfortran.dg/goacc/array-with-dt-1.f90 new file mode 100644 index 0000000..4a3ff0e --- /dev/null +++ b/gcc/testsuite/gfortran.dg/goacc/array-with-dt-1.f90 @@ -0,0 +1,11 @@ +type t + integer, allocatable :: A(:,:) +end type t + +type(t), allocatable :: b(:) + +!$acc update host(b) +!$acc update host(b(:)) +!$acc update host(b(1)%A) +!$acc update host(b(1)%A(:,:)) +end diff --git a/gcc/testsuite/gfortran.dg/goacc/array-with-dt-2.f90 b/gcc/testsuite/gfortran.dg/goacc/array-with-dt-2.f90 index e4a6f31..807580d 100644 --- a/gcc/testsuite/gfortran.dg/goacc/array-with-dt-2.f90 +++ b/gcc/testsuite/gfortran.dg/goacc/array-with-dt-2.f90 @@ -4,8 +4,7 @@ end type t type(t), allocatable :: b(:) -! TODO: Remove expected errors when this is supported. -!$acc update host(b(::2)) ! { dg-error "Stride should not be specified for array section in MAP clause" } -!$acc update host(b(1)%A(::3,::4)) ! { dg-error "Stride should not be specified for array section in MAP clause" } +!$acc update host(b(::2)) +!$acc update host(b(1)%A(::3,::4)) end diff --git a/gcc/testsuite/gfortran.dg/goacc/array-with-dt-3.f90 b/gcc/testsuite/gfortran.dg/goacc/array-with-dt-3.f90 new file mode 100644 index 0000000..dcb6365 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/goacc/array-with-dt-3.f90 @@ -0,0 +1,14 @@ +type t2 + integer :: A(200,200) +end type t2 +type t + integer, allocatable :: A(:,:) +end type t + +type(t2),allocatable :: c(:) +type(t), allocatable :: d(:) + +!$acc exit data delete(c(1)%A) +!$acc exit data delete(d(1)%A) + +end diff --git a/gcc/testsuite/gfortran.dg/goacc/array-with-dt-4.f90 b/gcc/testsuite/gfortran.dg/goacc/array-with-dt-4.f90 new file mode 100644 index 0000000..637d5f5 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/goacc/array-with-dt-4.f90 @@ -0,0 +1,18 @@ +type t4 + integer, allocatable :: quux(:) +end type t4 +type t3 + type(t4), pointer :: qux(:) +end type t3 +type t2 + type(t3), allocatable :: bar(:) +end type t2 +type t + type(t2), allocatable :: foo(:) +end type t + +type(t), allocatable :: c(:) + +!$acc enter data copyin(c(5)%foo(4)%bar(3)%qux(2)%quux(:)) +!$acc exit data delete(c(5)%foo(4)%bar(3)%qux(2)%quux(:)) +end diff --git a/gcc/testsuite/gfortran.dg/goacc/array-with-dt-5.f90 b/gcc/testsuite/gfortran.dg/goacc/array-with-dt-5.f90 new file mode 100644 index 0000000..900587b --- /dev/null +++ b/gcc/testsuite/gfortran.dg/goacc/array-with-dt-5.f90 @@ -0,0 +1,12 @@ +type t2 + integer :: bar +end type t2 +type t + type(t2), pointer :: foo +end type t + +type(t) :: c + +!$acc enter data copyin(c%foo) + +end diff --git a/gcc/testsuite/gfortran.dg/goacc/array-with-dt-6.f90 b/gcc/testsuite/gfortran.dg/goacc/array-with-dt-6.f90 new file mode 100644 index 0000000..adac8e3 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/goacc/array-with-dt-6.f90 @@ -0,0 +1,10 @@ +type t + integer :: i, j +end type t +type t2 + type(t) :: b(4) +end type +type(t2) :: var(10) +!$acc update host(var(3)%b(:)%j) ! { dg-error "not a proper array section" } +!$acc update host(var(3)%b%j) ! { dg-error "not a proper array section" } +end diff --git a/gcc/testsuite/gfortran.dg/goacc/derived-chartypes-1.f90 b/gcc/testsuite/gfortran.dg/goacc/derived-chartypes-1.f90 index f7aafbf..e4d360e 100644 --- a/gcc/testsuite/gfortran.dg/goacc/derived-chartypes-1.f90 +++ b/gcc/testsuite/gfortran.dg/goacc/derived-chartypes-1.f90 @@ -1,6 +1,3 @@ -! This currently ICEs. Avoid that. -! { dg-skip-if "PR98979" { *-*-* } } - type :: type1 character(len=35) :: a end type type1 diff --git a/gcc/testsuite/gfortran.dg/goacc/derived-chartypes-2.f90 b/gcc/testsuite/gfortran.dg/goacc/derived-chartypes-2.f90 index e22fc67..cca6443 100644 --- a/gcc/testsuite/gfortran.dg/goacc/derived-chartypes-2.f90 +++ b/gcc/testsuite/gfortran.dg/goacc/derived-chartypes-2.f90 @@ -1,6 +1,3 @@ -! This currently ICEs. Avoid that. -! { dg-skip-if "PR98979" { *-*-* } } - type :: type1 character(len=35,kind=4) :: a end type type1 diff --git a/gcc/testsuite/gfortran.dg/goacc/derived-classtypes-1.f95 b/gcc/testsuite/gfortran.dg/goacc/derived-classtypes-1.f95 index e6cf09c..85a2e1d 100644 --- a/gcc/testsuite/gfortran.dg/goacc/derived-classtypes-1.f95 +++ b/gcc/testsuite/gfortran.dg/goacc/derived-classtypes-1.f95 @@ -71,7 +71,7 @@ class(type7), allocatable :: acshiela !$acc enter data copyin(bar) !$acc enter data copyin(bar%b) !$acc enter data copyin(qux) -!!$acc enter data copyin(qux%c) +!$acc enter data copyin(qux%c) !$acc enter data copyin(quux) !$acc enter data copyin(quux%d) !$acc enter data copyin(fred) @@ -86,7 +86,7 @@ class(type7), allocatable :: acshiela !$acc enter data copyin(pbar) !$acc enter data copyin(pbar%b) !$acc enter data copyin(pqux) -!!$acc enter data copyin(pqux%c) +!$acc enter data copyin(pqux%c) !$acc enter data copyin(pquux) !$acc enter data copyin(pquux%d) !$acc enter data copyin(pfred) @@ -101,7 +101,7 @@ class(type7), allocatable :: acshiela !$acc enter data copyin(cbar) !$acc enter data copyin(cbar%b) !$acc enter data copyin(cqux) -!!$acc enter data copyin(cqux%c) +!$acc enter data copyin(cqux%c) !$acc enter data copyin(cquux) !$acc enter data copyin(cquux%d) !$acc enter data copyin(cfred) @@ -116,7 +116,7 @@ class(type7), allocatable :: acshiela !$acc enter data copyin(acbar) !$acc enter data copyin(acbar%b) !$acc enter data copyin(acqux) -!!$acc enter data copyin(acqux%c) +!$acc enter data copyin(acqux%c) !$acc enter data copyin(acquux) !$acc enter data copyin(acquux%d) !$acc enter data copyin(acfred) diff --git a/gcc/testsuite/gfortran.dg/goacc/mapping-tests-2.f90 b/gcc/testsuite/gfortran.dg/goacc/mapping-tests-2.f90 index 1372f6a..6b414fb 100644 --- a/gcc/testsuite/gfortran.dg/goacc/mapping-tests-2.f90 +++ b/gcc/testsuite/gfortran.dg/goacc/mapping-tests-2.f90 @@ -24,9 +24,9 @@ subroutine foo ! Bad - we cannot do a strided access of 'x' ! No C/C++ equivalent !$acc enter data copyin(y(:)%i) -! { dg-error "Array is not contiguous" "" { target "*-*-*" } 26 } +! { dg-error "not a proper array section" "" { target "*-*-*" } 26 } ! Bad - again, a strided access !$acc enter data copyin(z(1)%cc(:)%i) -! { dg-error "Array is not contiguous" "" { target "*-*-*" } 30 } +! { dg-error "not a proper array section" "" { target "*-*-*" } 30 } end diff --git a/gcc/testsuite/gfortran.dg/goacc/ref_inquiry.f90 b/gcc/testsuite/gfortran.dg/goacc/ref_inquiry.f90 new file mode 100644 index 0000000..7f3cc4a --- /dev/null +++ b/gcc/testsuite/gfortran.dg/goacc/ref_inquiry.f90 @@ -0,0 +1,48 @@ +! Check for <var>%re, ...%im, ...%kind, ...%len +! Cf. also OpenMP's ../gomp/ref_inquiry.f90 +! Cf. OpenACC spec issue 346 +! +implicit none +type t + integer :: i + character :: c + complex :: z + complex :: zz(5) +end type t + +integer :: i +character(kind=4, len=5) :: c +complex :: z, zz(5) +type(t) :: x + +print *, is_contiguous(zz(:)%re) + +! inquiry function; expr_type != EXPR_VARIABLE: +!$acc enter data copyin(i%kind, c%len) ! { dg-error "not a proper array section" } +!$acc enter data copyin(x%i%kind) ! { dg-error "not a proper array section" } +!$acc enter data copyin(x%c%len) ! { dg-error "not a proper array section" } +!$acc update self(i%kind, c%len) ! { dg-error "not a proper array section" } +!$acc update self(x%i%kind) ! { dg-error "not a proper array section" } +!$acc update self(x%c%len) ! { dg-error "not a proper array section" } + +! EXPR_VARIABLE +!$acc enter data copyin(z%re) ! { dg-error "Unexpected complex-parts designator" } +!$acc enter data copyin(z%im) ! { dg-error "Unexpected complex-parts designator" } +!$acc enter data copyin(zz%re) ! { dg-error "not a proper array section" } +!$acc enter data copyin(zz%im) ! { dg-error "not a proper array section" } + +!$acc enter data copyin(x%z%re) ! { dg-error "Unexpected complex-parts designator" } +!$acc enter data copyin(x%z%im) ! { dg-error "Unexpected complex-parts designator" } +!$acc enter data copyin(x%zz%re) ! { dg-error "not a proper array section" } +!$acc enter data copyin(x%zz%im) ! { dg-error "not a proper array section" } + +!$acc update self(z%re) ! { dg-error "Unexpected complex-parts designator" } +!$acc update self(z%im) ! { dg-error "Unexpected complex-parts designator" } +!$acc update self(zz%re) ! { dg-error "not a proper array section" } +!$acc update self(zz%im) ! { dg-error "not a proper array section" } + +!$acc update self(x%z%re) ! { dg-error "Unexpected complex-parts designator" } +!$acc update self(x%z%im) ! { dg-error "Unexpected complex-parts designator" } +!$acc update self(x%zz%re) ! { dg-error "is not a proper array section" } +!$acc update self(x%zz%im) ! { dg-error "is not a proper array section" } +end diff --git a/gcc/testsuite/gfortran.dg/gomp/pr99226.f90 b/gcc/testsuite/gfortran.dg/gomp/pr99226.f90 new file mode 100644 index 0000000..72dbdde --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/pr99226.f90 @@ -0,0 +1,13 @@ +! PR fortran/99226 + +subroutine sub (n) + integer :: n, i + !$omp target ! { dg-error "construct with nested 'teams' construct contains directives outside of the 'teams' construct" } + !$omp teams distribute dist_schedule (static,n+4) + do i = 1, 8 + end do + !$omp teams distribute dist_schedule (static,n+4) + do i = 1, 8 + end do + !$omp end target +end diff --git a/gcc/testsuite/gfortran.dg/gomp/ref_inquiry.f90 b/gcc/testsuite/gfortran.dg/gomp/ref_inquiry.f90 new file mode 100644 index 0000000..610d9ec --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/ref_inquiry.f90 @@ -0,0 +1,35 @@ +! Check for <var>%re, ...%im, ...%kind, ...%len +! Cf. also OpenACC's ../goacc/ref_inquiry.f90 +! Cf. also OpenMP spec issue 2661 +implicit none +type t + integer :: i + character :: c + complex :: z + complex :: zz(5) +end type t + +integer :: i +character(kind=4, len=5) :: c +complex :: z, zz(5) +type(t) :: x + +print *, is_contiguous(zz(:)%re) + +! inquiry function; expr_type != EXPR_VARIABLE: +!$omp target enter data map(to: i%kind, c%len) ! { dg-error "not a proper array section" } +!$omp target enter data map(to: x%i%kind) ! { dg-error "not a proper array section" } +!$omp target enter data map(to: x%c%len) ! { dg-error "not a proper array section" } + +! EXPR_VARIABLE +!$omp target enter data map(to: z%re) ! { dg-error "Unexpected complex-parts designator" } +!$omp target enter data map(to: z%im) ! { dg-error "Unexpected complex-parts designator" } +!$omp target enter data map(to: zz%re) ! { dg-error "not a proper array section" } +!$omp target enter data map(to: zz%im) ! { dg-error "not a proper array section" } + +!$omp target enter data map(to: x%z%re) ! { dg-error "Unexpected complex-parts designator" } +!$omp target enter data map(to: x%z%im) ! { dg-error "Unexpected complex-parts designator" } +!$omp target enter data map(to: x%zz%re) ! { dg-error "not a proper array section" } +!$omp target enter data map(to: x%zz%im) ! { dg-error "not a proper array section" } + +end diff --git a/gcc/testsuite/gfortran.dg/intent_optimize_3.f90 b/gcc/testsuite/gfortran.dg/intent_optimize_3.f90 new file mode 100644 index 0000000..6ecd722 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/intent_optimize_3.f90 @@ -0,0 +1,16 @@ +! { dg-do run } +! { dg-options "-O2" } +! PR99169 - Segfault passing allocatable scalar into intent(out) dummy argument + +program p + implicit none + integer, allocatable :: i + allocate (i) + call set (i) + if (i /= 5) stop 1 +contains + subroutine set (i) + integer, intent(out) :: i + i = 5 + end subroutine set +end program p diff --git a/gcc/testsuite/gfortran.dg/matmul_21.f90 b/gcc/testsuite/gfortran.dg/matmul_21.f90 new file mode 100644 index 0000000..505f4d5 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/matmul_21.f90 @@ -0,0 +1,15 @@ +! { dg-do run } +! PR libfortran/99218 - matmul on temporary array accesses invalid memory + +program p + implicit none + integer, parameter :: nState = 300000 + integer, parameter :: nCon = 1 + real, parameter :: ZERO = 0.0 + real :: G(nCon,nState) = ZERO + real :: H(nState,nCon) = ZERO + real :: lambda(nCon) = ZERO + real :: f(nState) = ZERO + f = matmul (transpose (G), lambda) + if (f(1) /= ZERO) stop 1 +end program diff --git a/gcc/testsuite/gfortran.dg/module_variable_3.f90 b/gcc/testsuite/gfortran.dg/module_variable_3.f90 new file mode 100644 index 0000000..0dae6d5 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/module_variable_3.f90 @@ -0,0 +1,37 @@ +! { dg-do compile } +! { dg-additional-options "-fdump-tree-original" } +! +! PR fortran/97927 +! +! Did ICE due to the in tree-nested.c due to {clobber} +! + +module mpi2 + interface + subroutine MPI_Allreduce(i) + implicit none + INTEGER, OPTIONAL, INTENT(OUT) :: i + end subroutine MPI_Allreduce + end interface +end module + +module modmpi + implicit none + integer ierror ! module variable = context NAMESPACE_DECL +end module + +subroutine exxengy + use modmpi + use mpi2, only: mpi_allreduce + implicit none + + ! intent(out) implies: ierror = {clobber} + call mpi_allreduce(ierror) + +contains + subroutine zrho2 + return + end subroutine +end subroutine + +! { dg-final { scan-tree-dump "ierror = {CLOBBER};" "original" } } diff --git a/gcc/testsuite/gfortran.dg/namelist_4.f90 b/gcc/testsuite/gfortran.dg/namelist_4.f90 index 538bcea..e6681fd 100644 --- a/gcc/testsuite/gfortran.dg/namelist_4.f90 +++ b/gcc/testsuite/gfortran.dg/namelist_4.f90 @@ -23,12 +23,13 @@ CONTAINS G3=1
END FUNCTION
END module M1
- +
program P1
+implicit none
CONTAINS
! This has the additional wrinkle of a reference to the object.
INTEGER FUNCTION F1()
- NAMELIST /NML3/ F2 ! { dg-error "PROCEDURE attribute conflicts" } + NAMELIST /NML3/ F2 ! { dg-error "PROCEDURE attribute conflicts" }
! Used to ICE here
f2 = 1 ! { dg-error "is not a VALUE" }
F1=1
@@ -36,5 +37,5 @@ CONTAINS INTEGER FUNCTION F2()
F2=1
END FUNCTION
-END +END
diff --git a/gcc/testsuite/gfortran.dg/namelist_98.f90 b/gcc/testsuite/gfortran.dg/namelist_98.f90 new file mode 100644 index 0000000..19a7e86 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/namelist_98.f90 @@ -0,0 +1,11 @@ +! { dg-do compile } +! pr98686 + implicit none + real :: x, m + namelist /NML/ x, m, q ! { dg-error "must be declared before the namelist*" } + integer :: q + x = 1.0 + m = 2.0 + q = 3 + write(*, nml=NML) +end diff --git a/gcc/testsuite/gfortran.dg/parameter_data.f90 b/gcc/testsuite/gfortran.dg/parameter_data.f90 new file mode 100644 index 0000000..b95f9c9 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/parameter_data.f90 @@ -0,0 +1,13 @@ +! { dg-do compile } +! PR fortran/49278 - ICE when combining DATA with default initialization + +program p + implicit none + type t + real :: a + end type t + integer, parameter :: b = 42 + type(t), parameter :: z = t(4.0) + data b / 666 / ! { dg-error "shall not appear in a DATA statement" } + data z%a / 3.0 / ! { dg-error "shall not appear in a DATA statement" } +end diff --git a/gcc/testsuite/gfortran.dg/pr95690.f90 b/gcc/testsuite/gfortran.dg/pr95690.f90 index da809a0..47a5df9 100644 --- a/gcc/testsuite/gfortran.dg/pr95690.f90 +++ b/gcc/testsuite/gfortran.dg/pr95690.f90 @@ -2,8 +2,8 @@ module m contains subroutine s - print *, (erfc) ! { dg-error "not a floating constant" "" { target i?86-*-* x86_64-*-* *-*-solaris* } } - end ! { dg-error "not a floating constant" "" { target { ! "i?86-*-* x86_64-*-* *-*-solaris*" } } } + print *, (erfc) ! { dg-error "not a floating constant" "" { target i?86-*-* x86_64-*-* sparc*-*-* cris-*-* } } + end ! { dg-error "not a floating constant" "" { target { ! "i?86-*-* x86_64-*-* sparc*-*-* cris-*-*" } } } function erfc() end end diff --git a/gcc/testsuite/gfortran.dg/pr99204.f90 b/gcc/testsuite/gfortran.dg/pr99204.f90 new file mode 100644 index 0000000..9b6f27f --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr99204.f90 @@ -0,0 +1,10 @@ +! PR tree-optimization/99204 +! { dg-do compile } +! { dg-options "-O2 -w" } + +program pr99204 + character :: c + integer :: i = -12345678 + c = 'abc'(i:i) + print *, c +end diff --git a/gcc/testsuite/gfortran.dg/real4-10-real8-10.f90 b/gcc/testsuite/gfortran.dg/real4-10-real8-10.f90 new file mode 100644 index 0000000..1afd9ca --- /dev/null +++ b/gcc/testsuite/gfortran.dg/real4-10-real8-10.f90 @@ -0,0 +1,25 @@ +! { dg-do run { target i?86-*-* x86_64-*-* } } +! { dg-additional-options "-w -freal-4-real-10 -freal-8-real-10" } +! +! PR fortran/99355 +! PR fortran/99355 comment 10 to 13 + PR fortran/57871 +! + +program test + real :: r1 + real*4:: r2 + real(4) :: r3 + real(selected_real_kind(p=6)) :: r4 + integer, parameter :: k4 = 4, k8 = 8 + + double precision :: d1 + real*8 :: d2 + real(8) :: d3 + real(kind(1.d0)) :: d4 + real(selected_real_kind(p=15)) :: d5 + + !print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4) + !print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5) + if (any ([kind(1.0), kind(1.0_4), kind(1.0_k4), kind(r1), kind(r2), kind(r3), kind(r4)] /= 10)) stop 1 + if (any ([kind(1.d0), kind(1.0_8), kind(1.0_k8), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 10)) stop 2 +end program test diff --git a/gcc/testsuite/gfortran.dg/real4-10-real8-16.f90 b/gcc/testsuite/gfortran.dg/real4-10-real8-16.f90 new file mode 100644 index 0000000..83c5119 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/real4-10-real8-16.f90 @@ -0,0 +1,26 @@ +! { dg-do run { target i?86-*-* x86_64-*-* } } +! { dg-additional-options "-w -freal-4-real-10 -freal-8-real-16" } +! { dg-require-effective-target fortran_real_16 } +! +! PR fortran/99355 +! PR fortran/99355 comment 10 to 13 + PR fortran/57871 +! + +program test + real :: r1 + real*4:: r2 + real(4) :: r3 + real(selected_real_kind(p=6)) :: r4 + integer, parameter :: k4 = 4, k8 = 8 + + double precision :: d1 + real*8 :: d2 + real(8) :: d3 + real(kind(1.d0)) :: d4 + real(selected_real_kind(p=15)) :: d5 + + !print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4) + !print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5) + if (any ([kind(1.0), kind(1.0_4), kind(1.0_k4), kind(r1), kind(r2), kind(r3), kind(r4)] /= 10)) stop 1 + if (any ([kind(1.d0), kind(1.0_8), kind(1.0_k8), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 16)) stop 2 +end program test diff --git a/gcc/testsuite/gfortran.dg/real4-10-real8-4.f90 b/gcc/testsuite/gfortran.dg/real4-10-real8-4.f90 new file mode 100644 index 0000000..19b79e9 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/real4-10-real8-4.f90 @@ -0,0 +1,25 @@ +! { dg-do run { target i?86-*-* x86_64-*-* } } +! { dg-additional-options "-w -freal-4-real-10 -freal-8-real-4" } +! +! PR fortran/99355 +! PR fortran/99355 comment 10 to 13 + PR fortran/57871 +! + +program test + real :: r1 + real*4:: r2 + real(4) :: r3 + real(selected_real_kind(p=6)) :: r4 + integer, parameter :: k4 = 4, k8 = 8 + + double precision :: d1 + real*8 :: d2 + real(8) :: d3 + real(kind(1.d0)) :: d4 ! << this is ambiguous: kind=8 → 4 → 10 or 8 → 4; thus,excluded below + real(selected_real_kind(p=15)) :: d5 + + !print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4) + !print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5) + if (any ([kind(1.0), kind(1.0_4), kind(1.0_k4), kind(r1), kind(r2), kind(r3), kind(r4)] /= 10)) stop 1 + if (any ([kind(1.d0), kind(1.0_8), kind(1.0_k8), kind(d1), kind(d2), kind(d3), kind(d5)] /= 4)) stop 2 +end program test diff --git a/gcc/testsuite/gfortran.dg/real4-10.f90 b/gcc/testsuite/gfortran.dg/real4-10.f90 new file mode 100644 index 0000000..133af44 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/real4-10.f90 @@ -0,0 +1,25 @@ +! { dg-do run { target i?86-*-* x86_64-*-* } } +! { dg-additional-options "-w -freal-4-real-10" } +! +! PR fortran/99355 +! PR fortran/99355 comment 10 to 13 + PR fortran/57871 +! + +program test + real :: r1 + real*4:: r2 + real(4) :: r3 + real(selected_real_kind(p=6)) :: r4 + integer, parameter :: k4 = 4, k8 = 8 + + double precision :: d1 + real*8 :: d2 + real(8) :: d3 + real(kind(1.d0)) :: d4 + real(selected_real_kind(p=15)) :: d5 + + !print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4) + !print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5) + if (any ([kind(1.0), kind(1.0_4), kind(1.0_k4), kind(r1), kind(r2), kind(r3), kind(r4)] /= 10)) stop 1 + if (any ([kind(1.d0), kind(1.0_8), kind(1.0_k8), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 8)) stop 2 +end program test diff --git a/gcc/testsuite/gfortran.dg/real4-16-real8-10.f90 b/gcc/testsuite/gfortran.dg/real4-16-real8-10.f90 new file mode 100644 index 0000000..1ddefca --- /dev/null +++ b/gcc/testsuite/gfortran.dg/real4-16-real8-10.f90 @@ -0,0 +1,26 @@ +! { dg-do run { target i?86-*-* x86_64-*-* } } +! { dg-additional-options "-w -freal-4-real-16 -freal-8-real-10" } +! { dg-require-effective-target fortran_real_16 } +! +! PR fortran/99355 +! PR fortran/99355 comment 10 to 13 + PR fortran/57871 +! + +program test + real :: r1 + real*4:: r2 + real(4) :: r3 + real(selected_real_kind(p=6)) :: r4 + integer, parameter :: k4 = 4, k8 = 8 + + double precision :: d1 + real*8 :: d2 + real(8) :: d3 + real(kind(1.d0)) :: d4 + real(selected_real_kind(p=15)) :: d5 + + !print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4) + !print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5) + if (any ([kind(1.0), kind(1.0_4), kind(1.0_k4), kind(r1), kind(r2), kind(r3), kind(r4)] /= 16)) stop 1 + if (any ([kind(1.d0), kind(1.0_8), kind(1.0_k8), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 10)) stop 2 +end program test diff --git a/gcc/testsuite/gfortran.dg/real4-16-real8-16.f90 b/gcc/testsuite/gfortran.dg/real4-16-real8-16.f90 new file mode 100644 index 0000000..0e76193 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/real4-16-real8-16.f90 @@ -0,0 +1,26 @@ +! { dg-do run } +! { dg-additional-options "-w -freal-4-real-16 -freal-8-real-16" } +! { dg-require-effective-target fortran_real_16 } +! +! PR fortran/99355 +! PR fortran/99355 comment 10 to 13 + PR fortran/57871 +! + +program test + real :: r1 + real*4:: r2 + real(4) :: r3 + real(selected_real_kind(p=6)) :: r4 + integer, parameter :: k4 = 4, k8 = 8 + + double precision :: d1 + real*8 :: d2 + real(8) :: d3 + real(kind(1.d0)) :: d4 + real(selected_real_kind(p=15)) :: d5 + + !print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4) + !print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5) + if (any ([kind(1.0), kind(1.0_4), kind(1.0_k4), kind(r1), kind(r2), kind(r3), kind(r4)] /= 16)) stop 1 + if (any ([kind(1.d0), kind(1.0_8), kind(1.0_k8), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 16)) stop 2 +end program test diff --git a/gcc/testsuite/gfortran.dg/real4-16-real8-4.f90 b/gcc/testsuite/gfortran.dg/real4-16-real8-4.f90 new file mode 100644 index 0000000..3d2185b --- /dev/null +++ b/gcc/testsuite/gfortran.dg/real4-16-real8-4.f90 @@ -0,0 +1,26 @@ +! { dg-do run } +! { dg-additional-options "-w -freal-4-real-16 -freal-8-real-4" } +! { dg-require-effective-target fortran_real_16 } +! +! PR fortran/99355 +! PR fortran/99355 comment 10 to 13 + PR fortran/57871 +! + +program test + real :: r1 + real*4:: r2 + real(4) :: r3 + real(selected_real_kind(p=6)) :: r4 + integer, parameter :: k4 = 4, k8 = 8 + + double precision :: d1 + real*8 :: d2 + real(8) :: d3 + real(kind(1.d0)) :: d4 ! << this is ambiguous: kind=8 → 4 → 16 or 8 → 4; thus,excluded below + real(selected_real_kind(p=15)) :: d5 + + !print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4) + !print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5) + if (any ([kind(1.0), kind(1.0_4), kind(1.0_k4), kind(r1), kind(r2), kind(r3), kind(r4)] /= 16)) stop 1 + if (any ([kind(1.d0), kind(1.0_8), kind(1.0_k8), kind(d1), kind(d2), kind(d3), kind(d5)] /= 4)) stop 2 +end program test diff --git a/gcc/testsuite/gfortran.dg/real4-16.f90 b/gcc/testsuite/gfortran.dg/real4-16.f90 new file mode 100644 index 0000000..e07bcd4 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/real4-16.f90 @@ -0,0 +1,26 @@ +! { dg-do run } +! { dg-additional-options "-w -freal-4-real-16" } +! { dg-require-effective-target fortran_real_16 } +! +! PR fortran/99355 +! PR fortran/99355 comment 10 to 13 + PR fortran/57871 +! + +program test + real :: r1 + real*4:: r2 + real(4) :: r3 + real(selected_real_kind(p=6)) :: r4 + integer, parameter :: k4 = 4, k8 = 8 + + double precision :: d1 + real*8 :: d2 + real(8) :: d3 + real(kind(1.d0)) :: d4 + real(selected_real_kind(p=15)) :: d5 + + !print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4) + !print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5) + if (any ([kind(1.0), kind(1.0_4), kind(1.0_k4), kind(r1), kind(r2), kind(r3), kind(r4)] /= 16)) stop 1 + if (any ([kind(1.d0), kind(1.0_8), kind(1.0_k8), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 8)) stop 2 +end program test diff --git a/gcc/testsuite/gfortran.dg/real4-8-real8-10.f90 b/gcc/testsuite/gfortran.dg/real4-8-real8-10.f90 new file mode 100644 index 0000000..2d48f57 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/real4-8-real8-10.f90 @@ -0,0 +1,25 @@ +! { dg-do run { target i?86-*-* x86_64-*-* } } +! { dg-additional-options "-w -freal-4-real-8 -freal-8-real-10" } +! +! PR fortran/99355 +! PR fortran/99355 comment 10 to 13 + PR fortran/57871 +! + +program test + real :: r1 + real*4:: r2 + real(4) :: r3 + real(selected_real_kind(p=6)) :: r4 + integer, parameter :: k4 = 4, k8 = 8 + + double precision :: d1 + real*8 :: d2 + real(8) :: d3 + real(kind(1.d0)) :: d4 + real(selected_real_kind(p=15)) :: d5 + + print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4) + print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5) + if (any ([kind(r1), kind(1.0_4), kind(1.0_k4), kind(r2), kind(r3), kind(r4)] /= 8)) stop 1 + if (any ([kind(1.d0), kind(1.0_8), kind(1.0_k8), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 10)) stop 2 +end program test diff --git a/gcc/testsuite/gfortran.dg/real4-8-real8-16.f90 b/gcc/testsuite/gfortran.dg/real4-8-real8-16.f90 new file mode 100644 index 0000000..4d3e5af --- /dev/null +++ b/gcc/testsuite/gfortran.dg/real4-8-real8-16.f90 @@ -0,0 +1,26 @@ +! { dg-do run } +! { dg-additional-options "-w -freal-4-real-8 -freal-8-real-16" } +! { dg-require-effective-target fortran_real_16 } +! +! PR fortran/99355 +! PR fortran/99355 comment 10 to 13 + PR fortran/57871 +! + +program test + real :: r1 + real*4:: r2 + real(4) :: r3 + real(selected_real_kind(p=6)) :: r4 + integer, parameter :: k4 = 4, k8 = 8 + + double precision :: d1 + real*8 :: d2 + real(8) :: d3 + real(kind(1.d0)) :: d4 + real(selected_real_kind(p=15)) :: d5 + + !print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4) + !print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5) + if (any ([kind(1.0), kind(1.0_4), kind(1.0_k4), kind(r1), kind(r2), kind(r3), kind(r4)] /= 8)) stop 1 + if (any ([kind(1.d0), kind(1.0_8), kind(1.0_k8), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 16)) stop 2 +end program test diff --git a/gcc/testsuite/gfortran.dg/real4-8-real8-4.f90 b/gcc/testsuite/gfortran.dg/real4-8-real8-4.f90 new file mode 100644 index 0000000..9f18d43 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/real4-8-real8-4.f90 @@ -0,0 +1,25 @@ +! { dg-do run } +! { dg-additional-options "-w -freal-4-real-8 -freal-8-real-4" } +! +! PR fortran/99355 +! PR fortran/99355 comment 10 to 13 + PR fortran/57871 +! + +program test + real :: r1 + real*4:: r2 + real(4) :: r3 + real(selected_real_kind(p=6)) :: r4 + integer, parameter :: k4 = 4, k8 = 8 + + double precision :: d1 + real*8 :: d2 + real(8) :: d3 + real(kind(1.d0)) :: d4 ! << this is ambiguous: kind=8 → 4 → 8 or 8 → 4; thus,excluded below + real(selected_real_kind(p=15)) :: d5 + + print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4) + print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5) + if (any ([kind(1.0), kind(1.0_4), kind(1.0_k4), kind(r1), kind(r2), kind(r3), kind(r4)] /= 8)) stop 1 + if (any ([kind(1.d0), kind(1.0_8), kind(1.0_k8), kind(d1), kind(d2), kind(d3), kind(d5)] /= 4)) stop 2 +end program test diff --git a/gcc/testsuite/gfortran.dg/real4-8.f90 b/gcc/testsuite/gfortran.dg/real4-8.f90 new file mode 100644 index 0000000..f436b3d --- /dev/null +++ b/gcc/testsuite/gfortran.dg/real4-8.f90 @@ -0,0 +1,25 @@ +! { dg-do run } +! { dg-additional-options "-w -freal-4-real-8" } +! +! PR fortran/99355 +! PR fortran/99355 comment 10 to 13 + PR fortran/57871 +! + +program test + real :: r1 + real*4:: r2 + real(4) :: r3 + real(selected_real_kind(p=6)) :: r4 + integer, parameter :: k4 = 4, k8 = 8 + + double precision :: d1 + real*8 :: d2 + real(8) :: d3 + real(kind(1.d0)) :: d4 + real(selected_real_kind(p=15)) :: d5 + + !print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4) + !print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5) + if (any ([kind(1.0), kind(1.0_4), kind(1.0_k4), kind(r1), kind(r2), kind(r3), kind(r4)] /= 8)) stop 1 + if (any ([kind(1.d0), kind(1.0_8), kind(1.0_k8), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 8)) stop 2 +end program test diff --git a/gcc/testsuite/gfortran.dg/real8-10.f90 b/gcc/testsuite/gfortran.dg/real8-10.f90 new file mode 100644 index 0000000..ce85a78 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/real8-10.f90 @@ -0,0 +1,25 @@ +! { dg-do run { target i?86-*-* x86_64-*-* } } +! { dg-additional-options "-w -freal-8-real-10" } +! +! PR fortran/99355 +! PR fortran/99355 comment 10 to 13 + PR fortran/57871 +! + +program test + real :: r1 + real*4:: r2 + real(4) :: r3 + real(selected_real_kind(p=6)) :: r4 + integer, parameter :: k4 = 4, k8 = 8 + + double precision :: d1 + real*8 :: d2 + real(8) :: d3 + real(kind(1.d0)) :: d4 + real(selected_real_kind(p=15)) :: d5 + + !print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4) + !print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5) + if (any ([kind(1.0), kind(1.0_4), kind(1.0_k4), kind(r1), kind(r2), kind(r3), kind(r4)] /= 4)) stop 1 + if (any ([kind(1.d0), kind(1.0_8), kind(1.0_k8), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 10)) stop 2 +end program test diff --git a/gcc/testsuite/gfortran.dg/real8-16.f90 b/gcc/testsuite/gfortran.dg/real8-16.f90 new file mode 100644 index 0000000..b3b86c8 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/real8-16.f90 @@ -0,0 +1,26 @@ +! { dg-do run } +! { dg-additional-options "-w -freal-8-real-16" } +! { dg-require-effective-target fortran_real_16 } +! +! PR fortran/99355 +! PR fortran/99355 comment 10 to 13 + PR fortran/57871 +! + +program test + real :: r1 + real*4:: r2 + real(4) :: r3 + real(selected_real_kind(p=6)) :: r4 + integer, parameter :: k4 = 4, k8 = 8 + + double precision :: d1 + real*8 :: d2 + real(8) :: d3 + real(kind(1.d0)) :: d4 + real(selected_real_kind(p=15)) :: d5 + + !print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4) + !print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5) + if (any ([kind(1.0), kind(1.0_4), kind(1.0_k4), kind(r1), kind(r2), kind(r3), kind(r4)] /= 4)) stop 1 + if (any ([kind(1.d0), kind(1.0_8), kind(1.0_k8), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 16)) stop 2 +end program test diff --git a/gcc/testsuite/gfortran.dg/real8-4.f90 b/gcc/testsuite/gfortran.dg/real8-4.f90 new file mode 100644 index 0000000..c64c297 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/real8-4.f90 @@ -0,0 +1,25 @@ +! { dg-do run } +! { dg-additional-options "-w -freal-8-real-4" } +! +! PR fortran/99355 +! PR fortran/99355 comment 10 to 13 + PR fortran/57871 +! + +program test + real :: r1 + real*4:: r2 + real(4) :: r3 + real(selected_real_kind(p=6)) :: r4 + integer, parameter :: k4 = 4, k8 = 8 + + double precision :: d1 + real*8 :: d2 + real(8) :: d3 + real(kind(1.d0)) :: d4 + real(selected_real_kind(p=15)) :: d5 + + !print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4) + !print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5) + if (any ([kind(1.0), kind(1.0_4), kind(1.0_k4), kind(r1), kind(r2), kind(r3), kind(r4)] /= 4)) stop 1 + if (any ([kind(1.d0), kind(1.0_8), kind(1.0_k8), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 4)) stop 2 +end program test diff --git a/gcc/testsuite/gfortran.dg/reshape_zerosize_4.f90 b/gcc/testsuite/gfortran.dg/reshape_zerosize_4.f90 new file mode 100644 index 0000000..d9a0d21 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/reshape_zerosize_4.f90 @@ -0,0 +1,14 @@ +! { dg-do run } +! PR fortran/99206 - ICE in add_init_expr_to_sym, at fortran/decl.c:1980 +! Check simplifier of RESHAPE for character arrays. + +program p + character(*), parameter :: a(0) = reshape([ 'ab'], [0]) + character(*,kind=4), parameter :: c(0) = reshape([4_'cd'], [0]) + if (len (a) /= 2) stop 1 + if (len (reshape ( ['ab'], [0])) /= 2) stop 2 + if (kind(reshape ( ['ab'], [0])) /= 1) stop 3 + if (len (c) /= 2) stop 4 + if (len (reshape ([4_'cd'], [0])) /= 2) stop 5 + if (kind(reshape ([4_'cd'], [0])) /= 4) stop 6 +end diff --git a/gcc/testsuite/gfortran.dg/ubound_1.f90 b/gcc/testsuite/gfortran.dg/ubound_1.f90 new file mode 100644 index 0000000..7c588b0 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/ubound_1.f90 @@ -0,0 +1,22 @@ +! { dg-do run } +! +! PR fortran/99027 +! + program test + integer, dimension (1:3,1:6) :: array + integer, dimension (2:5,3:7,4:9,-4:2) :: array2 + + if (any ([4] /= ubound (array (1, 1:4)))) stop 1 + if (4 /= ubound (array (1, 1:4), dim=1)) stop 2 + + if (any (ubound (array2 (3,3,4,:)) /= [4+1+2])) stop 3 + if ( ubound (array2 (3,3,4,:), dim=1) /= 4+1+2 ) stop 4 + + if (any (ubound (array2 (3,:,4,:)) /= [7-3+1, 4+1+2])) stop 5 + if ( ubound (array2 (3,:,4,:), dim=1) /= 7-3+1 ) stop 6 + if ( ubound (array2 (3,:,4,:), dim=2) /= 4+1+2) stop 7 + if (any (ubound (array2 (3,:,4:4,:)) /= [7-3+1, 1, 4+1+2])) stop 8 + if ( ubound (array2 (3,:,4:4,:), dim=1) /= 7-3+1 ) stop 9 + if ( ubound (array2 (3,:,4:4,:), dim=2) /= 1 ) stop 10 + if ( ubound (array2 (3,:,4:4,:), dim=3) /= 4+1+2) stop 11 + end program test diff --git a/gcc/testsuite/gnat.dg/limited5.adb b/gcc/testsuite/gnat.dg/limited5.adb new file mode 100644 index 0000000..ded8aa3 --- /dev/null +++ b/gcc/testsuite/gnat.dg/limited5.adb @@ -0,0 +1,17 @@ +-- { dg-do compile } + +procedure Limited5 is + + type Command is limited null record; + type Command_Array is array (Positive range <>) of Command; + + function To_Commands return Command_Array is + begin + return Result : Command_Array (1 .. 2); + end To_Commands; + + The_Commands : aliased Command_Array := To_Commands; + +begin + null; +end; diff --git a/gcc/testsuite/gnat.dg/opt39.adb b/gcc/testsuite/gnat.dg/opt39.adb index f2e983f..70f1986 100644 --- a/gcc/testsuite/gnat.dg/opt39.adb +++ b/gcc/testsuite/gnat.dg/opt39.adb @@ -1,6 +1,6 @@ -- { dg-do compile } -- { dg-options "-O2 -fno-inline -fdump-tree-optimized" } --- { dg-additional-options "-cargs --param=sra-max-scalarization-size-Ospeed=32 -margs" { target powerpc*-*-* } } +-- { dg-additional-options "-cargs --param=sra-max-scalarization-size-Ospeed=32 -margs" { target aarch64-*-* powerpc*-*-* } } procedure Opt39 (I : Integer) is diff --git a/gcc/testsuite/gnat.dg/specs/lto25.ads b/gcc/testsuite/gnat.dg/specs/lto25.ads new file mode 100644 index 0000000..89876b6 --- /dev/null +++ b/gcc/testsuite/gnat.dg/specs/lto25.ads @@ -0,0 +1,12 @@ +-- { dg-do compile } +-- { dg-options "-flto" { target lto } } + +package Lto25 is + + type Enum is (One, Two, Three) with Atomic; + + type Rec is record + E : Enum := One; + end record; + +end Lto25; diff --git a/gcc/testsuite/jit.dg/test-trap.c b/gcc/testsuite/jit.dg/test-trap.c new file mode 100644 index 0000000..4eb65cd --- /dev/null +++ b/gcc/testsuite/jit.dg/test-trap.c @@ -0,0 +1,59 @@ +#include <stdlib.h> +#include <stdio.h> +#include <stddef.h> + +#include "libgccjit.h" + +#include "harness.h" + +void +create_code (gcc_jit_context *ctxt, void *user_data) +{ + /* Let's try to inject the equivalent of: + + void + test_trap (void) + { + *((int *)0) = 42; + } + */ + gcc_jit_type *void_type + = gcc_jit_context_get_type (ctxt, GCC_JIT_TYPE_VOID); + gcc_jit_type *int_type + = gcc_jit_context_get_type (ctxt, GCC_JIT_TYPE_INT); + gcc_jit_type *int_ptr_type + = gcc_jit_type_get_pointer (int_type); + + /* Build the test_fn. */ + gcc_jit_function *func + = gcc_jit_context_new_function (ctxt, NULL, + GCC_JIT_FUNCTION_EXPORTED, + void_type, + "test_trap", + 0, NULL, + 0); + + gcc_jit_block *initial = gcc_jit_function_new_block (func, "initial"); + + gcc_jit_rvalue *null_ptr + = gcc_jit_context_new_rvalue_from_ptr (ctxt, int_ptr_type, NULL); + + /* "*((int *)0) = 42;" */ + gcc_jit_block_add_assignment ( + initial, NULL, + gcc_jit_rvalue_dereference (null_ptr, NULL), + gcc_jit_context_new_rvalue_from_int (ctxt, int_type, 42)); + + gcc_jit_block_end_with_void_return (initial, NULL); +} + +void +verify_code (gcc_jit_context *ctxt, gcc_jit_result *result) +{ + typedef void (*fn_type) (void); + CHECK_NON_NULL (result); + fn_type test_array = + (fn_type)gcc_jit_result_get_code (result, "test_trap"); + CHECK_NON_NULL (test_array); + /* Don't attempt to call it. */ +} diff --git a/gcc/testsuite/lib/prune.exp b/gcc/testsuite/lib/prune.exp index a349c8a..2809f88 100644 --- a/gcc/testsuite/lib/prune.exp +++ b/gcc/testsuite/lib/prune.exp @@ -84,6 +84,9 @@ proc prune_gcc_output { text } { # Ignore harmless warnings from Xcode 4.0. regsub -all "(^|\n)\[^\n\]*ld: warning: could not create compact unwind for\[^\n\]*" $text "" text + # Ignore dsymutil warning (tool bug is actually linker) + regsub -all "(^|\n)\[^\n\]*could not find object file symbol for symbol\[^\n\]*" $text "" text + # If dg-enable-nn-line-numbers was provided, then obscure source-margin # line numbers by converting them to "NN" form. set text [maybe-handle-nn-line-numbers $text] diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index af46c77..a90c375 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -5887,6 +5887,21 @@ proc check_effective_target_powerpc_hard_double { } { } } +# Return 1 if this is a PowerPC target with hardware floating point sqrt. + +proc check_effective_target_powerpc_sqrt { } { + # We need to be PowerPC, and we need to have hardware fp enabled. + if {![check_effective_target_powerpc_fprs]} { + return 0; + } + + return [check_no_compiler_messages powerpc_sqrt object { + #ifndef _ARCH_PPCSQ + #error _ARCH_PPCSQ is not defined + #endif + } {}] +} + # Return 1 if this is a PowerPC target supporting -maltivec. proc check_effective_target_powerpc_altivec_ok { } { @@ -7581,7 +7596,7 @@ proc check_effective_target_vect_call_copysignf { } { proc check_effective_target_sqrt_insn { } { return [check_cached_effective_target sqrt_insn { expr { [istarget i?86-*-*] || [istarget x86_64-*-*] - || [istarget powerpc*-*-*] + || [check_effective_target_powerpc_sqrt] || [istarget aarch64*-*-*] || ([istarget arm*-*-*] && [check_effective_target_arm_vfp_ok]) || ([istarget s390*-*-*] @@ -8945,6 +8960,16 @@ proc check_effective_target_avx512bw { } { } "-mavx512bw" ] } +# Return 1 if -Wa,-march=+noavx512bw is supported. +proc check_effective_target_assembler_march_noavx512bw {} { + if { [istarget i?86*-*-*] || [istarget x86_64*-*-*] } { + return [check_no_compiler_messages assembler_march_noavx512bw object { + void foo (void) {} + } "-mno-avx512bw -Wa,-march=+noavx512bw"] + } + return 0 +} + # Return 1 if avx512vp2intersect instructions can be compiled. proc check_effective_target_avx512vp2intersect { } { return [check_no_compiler_messages avx512vp2intersect object { @@ -10264,6 +10289,22 @@ proc check_effective_target_s390_vxe2 { } { } "-march=arch13 -mzarch" ] } +# Same as above but for the arch14 NNPA facility. +proc check_effective_target_s390_nnpa { } { + if ![istarget s390*-*-*] then { + return 0; + } + + return [check_runtime s390_check_nnpa { + int main (void) + { + asm ("vzero %%v24\n\t" + "vcrnf %%v24,%%v24,%%v24,0,2" : : : "v24"); + return 0; + } + } "-march=arch14 -mzarch" ] +} + #For versions of ARM architectures that have hardware div insn, #disable the divmod transform @@ -10964,3 +11005,13 @@ proc check_effective_target_o_flag_in_section { } { } }] } + +# return 1 if LRA is supported. + +proc check_effective_target_lra { } { + if { [istarget hppa*-*-*] } { + return 0 + } + return 1 +} + |