diff options
Diffstat (limited to 'gcc/testsuite')
375 files changed, 8775 insertions, 578 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b683608..a488c4d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,822 @@ +2025-03-31 Philip Herron <herron.philip@googlemail.com> + + * rust/compile/issue-3613.rs: New test. + +2025-03-31 Philip Herron <herron.philip@googlemail.com> + + * rust/compile/issue-3606.rs: New test. + +2025-03-31 Philip Herron <herron.philip@googlemail.com> + + * rust/compile/issue-3605.rs: New test. + +2025-03-31 Philip Herron <herron.philip@googlemail.com> + + * rust/compile/issue-3614.rs: New test. + +2025-03-31 Philip Herron <herron.philip@googlemail.com> + + * rust/compile/issue-3615.rs: New test. + +2025-03-31 Philip Herron <herron.philip@googlemail.com> + + * rust/compile/issue-3563.rs: New test. + +2025-03-31 Owen Avery <powerboat9.gamer@gmail.com> + + * rust/compile/macros/mbe/macro43.rs: Adjust test to pass with + name resolution 2.0. + * rust/compile/nr2/exclude: Remove macros/mbe/macro43.rs. + +2025-03-31 Philip Herron <herron.philip@googlemail.com> + + * rust/compile/issue-3588.rs: New test. + +2025-03-31 Philip Herron <herron.philip@googlemail.com> + + * rust/compile/issue-3552.rs: New test. + +2025-03-31 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> + + * rust/compile/self_import_namespace.rs: New test. + +2025-03-31 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> + + * rust/compile/nr2/exclude: Remove now passing tests from exclusion + list. + +2025-03-31 Philip Herron <herron.philip@googlemail.com> + + * rust/compile/issue-3554-1.rs: New test. + * rust/compile/issue-3554-2.rs: New test. + +2025-03-31 Philip Herron <herron.philip@googlemail.com> + + * rust/compile/nr2/exclude: nr2 puts out a different error multiple times + * rust/compile/issue-3568.rs: New test. + +2025-03-31 Philip Herron <herron.philip@googlemail.com> + + * rust/compile/issue-3566-1.rs: New test. + * rust/compile/issue-3566-2.rs: New test. + +2025-03-31 Philip Herron <herron.philip@googlemail.com> + + * rust/compile/issue-3553.rs: New test. + +2025-03-31 Philip Herron <herron.philip@googlemail.com> + + * rust/compile/issue-3567.rs: New test. + +2025-03-31 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> + + * rust/compile/issue-2905-2.rs: Import from core library into a single + file misses the crate directives. + +2025-03-31 Philip Herron <herron.philip@googlemail.com> + + * rust/compile/issue-3242.rs: no longer skip the test + +2025-03-31 Owen Avery <powerboat9.gamer@gmail.com> + + * rust/compile/issue-3541-1.rs: New test. + * rust/compile/issue-3541-2.rs: Likewise. + +2025-03-31 Arthur Cohen <arthur.cohen@embecosm.com> + + * rust/compile/cfg-core1.rs: New test. + * rust/compile/cfg-core2.rs: New test. + +2025-03-31 Owen Avery <powerboat9.gamer@gmail.com> + + * rust/compile/issue-3549.rs: New test. + +2025-03-31 Owen Avery <powerboat9.gamer@gmail.com> + + * rust/compile/const_generics_3.rs: Modify test to run with name + resolution 2.0 only and to handle the absence of a bogus + resolution error. + * rust/compile/nr2/exclude: Remove const_generics_3.rs. + +2025-03-31 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> + + * rust/compile/nr2/exclude: Remove test from exclusion list. + +2025-03-31 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> + + * rust/compile/issue-2330.rs: Use complete path from crate root. + * rust/compile/issue-1901.rs: Likewise. + * rust/compile/issue-1981.rs: Likewise. + * rust/compile/iterators1.rs: Likewise. + * rust/compile/sizeof-stray-infer-var-bug.rs: Likewise. + * rust/compile/for-loop1.rs: Likewise. + * rust/compile/for-loop2.rs: Likewise. + * rust/compile/torture/builtin_abort.rs: Likewise. + * rust/compile/torture/uninit-intrinsic-1.rs: Likewise. + +2025-03-31 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> + + * rust/compile/feature_rust_attri0.rs: Add extern + function declaration and change name to printf. + * rust/compile/nr2/exclude: Remove now passing test from exclusion + list. + +2025-03-31 Iain Buclaw <ibuclaw@gdcproject.org> + + PR d/117002 + * gdc.dg/torture/pr117002.d: New test. + +2025-03-31 Marek Polacek <polacek@redhat.com> + + PR c++/116960 + PR c++/119303 + * g++.dg/cpp2a/lambda-uneval26.C: New test. + * g++.dg/warn/undefined2.C: New test. + +2025-03-31 Andre Simoes Dias Vieira <andre.simoesdiasvieira@arm.com> + + * gcc.target/aarch64/no-sve-with-sme-1.c: New. + * gcc.target/aarch64/no-sve-with-sme-2.c: New. + * gcc.target/aarch64/no-sve-with-sme-3.c: New. + * gcc.target/aarch64/no-sve-with-sme-4.c: New. + * gcc.target/aarch64/pragma_cpp_predefs_4.c: Pass +sve2 to existing + +sme pragma. + * gcc.target/aarch64/sve/acle/general-c/binary_int_opt_single_n_2.c: + Likewise. + * gcc.target/aarch64/sve/acle/general-c/binary_opt_single_n_2.c: + Likewise. + * gcc.target/aarch64/sve/acle/general-c/binary_single_1.c: Likewise. + * gcc.target/aarch64/sve/acle/general-c/binary_za_slice_int_opt_single_1.c: + * gcc.target/aarch64/sve/acle/general-c/binary_za_slice_lane_1.c: + Likewise. + * gcc.target/aarch64/sve/acle/general-c/binary_za_slice_lane_2.c: + Likewise. + * gcc.target/aarch64/sve/acle/general-c/binary_za_slice_lane_3.c: + Likewise. + * gcc.target/aarch64/sve/acle/general-c/binary_za_slice_lane_4.c: + Likewise. + * gcc.target/aarch64/sve/acle/general-c/binary_za_slice_opt_single_1.c: + Likewise. + * gcc.target/aarch64/sve/acle/general-c/binary_za_slice_opt_single_2.c: + Likewise. + * gcc.target/aarch64/sve/acle/general-c/binary_za_slice_opt_single_3.c: + Likewise. + * gcc.target/aarch64/sve/acle/general-c/binary_za_slice_uint_opt_single_1.c: + Likewise. + * gcc.target/aarch64/sve/acle/general-c/binaryxn_2.c: Likewise. + * gcc.target/aarch64/sve/acle/general-c/clamp_1.c: Likewise. + * gcc.target/aarch64/sve/acle/general-c/compare_scalar_count_1.c: + Likewise. + * gcc.target/aarch64/sve/acle/general-c/dot_za_slice_int_lane_1.c: + Likewise. + * gcc.target/aarch64/sve/acle/general-c/dot_za_slice_lane_1.c: + Likewise. + * gcc.target/aarch64/sve/acle/general-c/dot_za_slice_lane_2.c: + Likewise. + * gcc.target/aarch64/sve/acle/general-c/dot_za_slice_uint_lane_1.c: + Likewise. + * gcc.target/aarch64/sve/acle/general-c/shift_right_imm_narrowxn_1.c: + Likewise. + * gcc.target/aarch64/sve/acle/general-c/storexn_1.c: Likewise. + * gcc.target/aarch64/sve/acle/general-c/ternary_mfloat8_lane_1.c: + Likewise. + * gcc.target/aarch64/sve/acle/general-c/ternary_mfloat8_lane_group_selection_1.c: + Likewise. + * gcc.target/aarch64/sve/acle/general-c/ternary_qq_or_011_lane_1.c: + Likewise. + * gcc.target/aarch64/sve/acle/general-c/unary_convertxn_1.c: Likewise. + * gcc.target/aarch64/sve/acle/general-c/unary_convertxn_narrow_1.c: + Likewise. + * gcc.target/aarch64/sve/acle/general-c/unary_convertxn_narrowt_1.c: + Likewise. + * gcc.target/aarch64/sve/acle/general-c/unary_za_slice_1.c: Likewise. + * gcc.target/aarch64/sve/acle/general-c/unaryxn_1.c: Likewise. + * gcc.target/aarch64/sve/acle/general-c/write_za_1.c: Likewise. + * gcc.target/aarch64/sve/acle/general-c/write_za_slice_1.c: Likewise. + +2025-03-31 Jason Merrill <jason@redhat.com> + + PR c++/119401 + * g++.dg/cpp2a/lambda-targ11.C: New test. + * g++.dg/cpp2a/lambda-targ12.C: New file. + +2025-03-31 Richard Biener <rguenther@suse.de> + + PR tree-optimization/119532 + * gcc.dg/torture/pr119532.c: New testcase. + +2025-03-31 Richard Earnshaw <rearnsha@arm.com> + + * gcc.target/arm/vect-fmaxmin-2.c: New compile test. Split from ... + * gcc.target/arm/vect-fmaxmin.c: ... here. Remove scan-assembler + subtests. For both, add -funsafe-math-optimizations. + +2025-03-31 Kyrylo Tkachov <ktkachov@nvidia.com> + + PR middle-end/119442 + * gcc.target/aarch64/vls_sve_vec_dup_1.c: New test. + +2025-03-31 Jakub Jelinek <jakub@redhat.com> + + PR c++/119518 + * g++.dg/opt/pr119518.C: New test. + +2025-03-30 Jan Hubicka <hubicka@ucw.cz> + + * g++.dg/tree-ssa/pr80331.C: New test. + * g++.dg/tree-ssa/pr87502.C: New test. + +2025-03-30 Jakub Jelinek <jakub@redhat.com> + + * gcc.target/aarch64/atomic-inst-ldlogic.c: Fix another + unbalanced {} directive problem. Add space after all + scan-assembler-times counts. + +2025-03-30 Mariam Arutunian <mariamarutunian@gmail.com> + + * gcc.target/aarch64/crc-crc32c-data16.c: Fix iteration + count to match testname. + +2025-03-30 Maciej W. Rozycki <macro@orcam.me.uk> + + PR target/117759 + * gcc.target/alpha/memclr-a2-o1-c9-ptr.c: Add + `-mno-safe-partial'. + * gcc.target/alpha/memclr-a2-o1-c9-ptr-safe-partial.c: New file. + * gcc.target/alpha/memcpy-di-unaligned-dst.c: New file. + * gcc.target/alpha/memcpy-di-unaligned-dst-safe-partial.c: New + file. + * gcc.target/alpha/memcpy-di-unaligned-dst-safe-partial-bwx.c: + New file. + * gcc.target/alpha/memcpy-si-unaligned-dst.c: New file. + * gcc.target/alpha/memcpy-si-unaligned-dst-safe-partial.c: New + file. + * gcc.target/alpha/memcpy-si-unaligned-dst-safe-partial-bwx.c: + New file. + * gcc.target/alpha/stlx0.c: Add `-mno-safe-partial'. + * gcc.target/alpha/stlx0-safe-partial.c: New file. + * gcc.target/alpha/stlx0-safe-partial-bwx.c: New file. + * gcc.target/alpha/stqx0.c: Add `-mno-safe-partial'. + * gcc.target/alpha/stqx0-safe-partial.c: New file. + * gcc.target/alpha/stqx0-safe-partial-bwx.c: New file. + * gcc.target/alpha/stwx0.c: Add `-mno-safe-partial'. + * gcc.target/alpha/stwx0-bwx.c: Add `-mno-safe-partial'. Refer + to stwx0.c rather than copying its code and also verify no LDQ_U + or STQ_U instructions have been produced. + * gcc.target/alpha/stwx0-safe-partial.c: New file. + * gcc.target/alpha/stwx0-safe-partial-bwx.c: New file. + +2025-03-30 Maciej W. Rozycki <macro@orcam.me.uk> + + PR target/117759 + * gcc.target/alpha/stb.c: New file. + * gcc.target/alpha/stb-bwa.c: New file. + * gcc.target/alpha/stb-bwx.c: New file. + * gcc.target/alpha/stba.c: New file. + * gcc.target/alpha/stba-bwa.c: New file. + * gcc.target/alpha/stba-bwx.c: New file. + * gcc.target/alpha/stw.c: New file. + * gcc.target/alpha/stw-bwa.c: New file. + * gcc.target/alpha/stw-bwx.c: New file. + * gcc.target/alpha/stwa.c: New file. + * gcc.target/alpha/stwa-bwa.c: New file. + * gcc.target/alpha/stwa-bwx.c: New file. + +2025-03-30 Tobias Burnus <tburnus@baylibre.com> + + * g++.dg/gomp/append-args-8.C: Remove bogus '3' after \.\[0-9\]+ + pattern. + +2025-03-29 Sam James <sam@gentoo.org> + + * gcc.target/arm/short-vfp-1.c: Add whitespace around brace. + +2025-03-29 Jason Merrill <jason@redhat.com> + + * g++.dg/modules/friend-9_a.C: New test. + * g++.dg/modules/friend-9_b.C: New test. + +2025-03-29 Nathaniel Shead <nathanieloshead@gmail.com> + + PR c++/118961 + * g++.dg/modules/lto-1.h: New test. + * g++.dg/modules/lto-1_a.H: New test. + * g++.dg/modules/lto-1_b.C: New test. + * g++.dg/modules/lto-1_c.C: New test. + * g++.dg/modules/lto-2_a.H: New test. + * g++.dg/modules/lto-2_b.C: New test. + * g++.dg/modules/lto-3_a.H: New test. + * g++.dg/modules/lto-3_b.C: New test. + +2025-03-28 Jakub Jelinek <jakub@redhat.com> + + * g++.dg/opt/musttail2.C (foo): Define the function instead of + just declaring it, add [[gnu::noipa]] attribute to it. + +2025-03-28 Jakub Jelinek <jakub@redhat.com> + + * lib/gfortran-dg.exp: Don't cycle through the option list if + dg-options or dg-additional-options contains -O after space, tab, + double quote or open curly bracket. + * gfortran.dg/cray_pointers_2.f90: Remove extraneous space between + dg-do and run and remove comment about it. + +2025-03-28 Gaius Mulley <gaiusmod2@gmail.com> + + PR modula2/119504 + * gm2/iso/fail/conststrarray2.mod: New test. + * gm2/iso/run/pass/constarray2.mod: New test. + * gm2/pim/pass/hexstring.mod: New test. + +2025-03-28 Andrew MacLeod <amacleod@redhat.com> + + * gcc.dg/pr110992.c: New. + * gcc.dg/pr119471.c: New. + +2025-03-28 Christophe Lyon <christophe.lyon@linaro.org> + + PR target/119133 + * gcc.dg/torture/pr119133.c: Add options for float16. + +2025-03-28 Bob Dubner <rdubner@symas.com> + + * cobol.dg/group2/Complex_EVALUATE__1_.cob: New EVALUTE testcase. + * cobol.dg/group2/Complex_EVALUATE__2_.cob: Likewise. + * cobol.dg/group2/EVALUATE_WHEN_NEGATIVE.cob: Likewise. + * cobol.dg/group2/EVALUATE_condition__2_.cob: Likewise. + * cobol.dg/group2/EVALUATE_doubled_WHEN.cob: Likewise. + * cobol.dg/group2/EVALUATE_with_WHEN_using_condition-1.cob: Likewise. + * cobol.dg/group2/Complex_EVALUATE__1_.out: Known-good data for testcase. + * cobol.dg/group2/Complex_EVALUATE__2_.out: Likewise. + * cobol.dg/group2/EVALUATE_WHEN_NEGATIVE.out: Likewise. + * cobol.dg/group2/EVALUATE_condition__2_.out: Likewise. + * cobol.dg/group2/EVALUATE_doubled_WHEN.out: Likewise. + * cobol.dg/group2/EVALUATE_with_WHEN_using_condition-1.out: Likewise. + +2025-03-28 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/119483 + * c-c++-common/pr119483-1.c: New test. + * c-c++-common/pr119483-2.c: New test. + +2025-03-28 Jakub Jelinek <jakub@redhat.com> + + PR ipa/119484 + * c-c++-common/pr119484.c: New test. + +2025-03-28 David Malcolm <dmalcolm@redhat.com> + + * gcc.target/riscv/cmo-zicbop-1.c: Fix missing space before + trailing } in dg-do directive. + * gcc.target/riscv/cmo-zicbop-2.c: Likewise. + * gcc.target/riscv/prefetch-zicbop.c: Likewise. + * gcc.target/riscv/prefetch-zihintntl.c: Likewise. + +2025-03-28 David Malcolm <dmalcolm@redhat.com> + + * gcc.target/i386/strub-pr118006.c: Fix ordering of dg-do and + dg-require- directive so that dg-do is first. + +2025-03-28 David Malcolm <dmalcolm@redhat.com> + + * gcc.target/arm/cmse/cmse-17.c: Fix missing space before trailing + "}" in dg-options. + +2025-03-28 David Malcolm <dmalcolm@redhat.com> + + * gcc.target/aarch64/saturating_arithmetic_1.c: Fix dg-do compile. + * gcc.target/aarch64/saturating_arithmetic_2.c: Likewise. + +2025-03-28 David Malcolm <dmalcolm@redhat.com> + + * g++.dg/abi/pure-virtual1.C: Fix dg-require-weak directive. + * g++.target/i386/mangling-alias1.C: Fix dg-require-ifunc + directive. + +2025-03-27 Bob Dubner <rdubner@symas.com> + + * cobol.dg/group2/ACCEPT_DATE___DAY_and_intrinsic_functions__1_.cob: New testcase. + * cobol.dg/group2/ACCEPT_DATE___DAY_and_intrinsic_functions__2_.cob: Likewise. + * cobol.dg/group2/ACCEPT_FROM_TIME___DATE___DAY___DAY-OF-WEEK__1_.cob: Likewise. + * cobol.dg/group2/ACCEPT_FROM_TIME___DATE___DAY___DAY-OF-WEEK__2_.cob: Likewise. + * cobol.dg/group2/COMP-6_arithmetic.cob: Likewise. + * cobol.dg/group2/COMP-6_numeric_test.cob: Likewise. + * cobol.dg/group2/COMP-6_used_with_DISPLAY.cob: Likewise. + * cobol.dg/group2/COMP-6_used_with_MOVE.cob: Likewise. + * cobol.dg/group2/COMPUTE_multiplication_to_FIX4.cob: Likewise. + * cobol.dg/group2/DISPLAY__Sign_ASCII__2_.cob: Likewise. + * cobol.dg/group2/DISPLAY__Sign_ASCII.cob: Likewise. + * cobol.dg/group2/Floating_continuation_indicator__1_.cob: Likewise. + * cobol.dg/group2/floating-point_ADD_FORMAT_1.cob: Likewise. + * cobol.dg/group2/floating-point_ADD_FORMAT_2.cob: Likewise. + * cobol.dg/group2/floating-point_DIVIDE_FORMAT_1.cob: Likewise. + * cobol.dg/group2/floating-point_DIVIDE_FORMAT_2.cob: Likewise. + * cobol.dg/group2/floating-point_literals.cob: Likewise. + * cobol.dg/group2/floating-point_MULTIPLY_FORMAT_1.cob: Likewise. + * cobol.dg/group2/floating-point_MULTIPLY_FORMAT_2.cob: Likewise. + * cobol.dg/group2/floating-point_SUBTRACT_FORMAT_1.cob: Likewise. + * cobol.dg/group2/floating-point_SUBTRACT_FORMAT_2.cob: Likewise. + * cobol.dg/group2/IBM_dialect_COMP_redefined_by_POINTER_as_64-bit.cob: Likewise. + * cobol.dg/group2/Indicators_______________-____D__.cob: Likewise. + * cobol.dg/group2/MULTIPLY_to_FIX4.cob: Likewise. + * cobol.dg/group2/PACKED-DECIMAL_arithmetic.cob: Likewise. + * cobol.dg/group2/PACKED-DECIMAL_basic_comp-3_comp-6__1_.cob: Likewise. + * cobol.dg/group2/PACKED-DECIMAL_basic_comp-3_comp-6__2_.cob: Likewise. + * cobol.dg/group2/PACKED-DECIMAL_dump.cob: Likewise. + * cobol.dg/group2/PACKED-DECIMAL_numeric_test__1_.cob: Likewise. + * cobol.dg/group2/PACKED-DECIMAL_numeric_test__2_.cob: Likewise. + * cobol.dg/group2/PACKED-DECIMAL_used_with_DISPLAY.cob: Likewise. + * cobol.dg/group2/PACKED-DECIMAL_used_with_INITIALIZE.cob: Likewise. + * cobol.dg/group2/PACKED-DECIMAL_used_with_MOVE.cob: Likewise. + * cobol.dg/group2/POINTER__display.cob: Likewise. + * cobol.dg/group2/Simple_floating-point_MOVE.cob: Likewise. + * cobol.dg/group2/Simple_floating-point_VALUE_and_MOVE.cob: Likewise. + * cobol.dg/group2/ACCEPT_FROM_TIME___DATE___DAY___DAY-OF-WEEK__2_.out: Known-good result. + * cobol.dg/group2/COMP-6_arithmetic.out: Likewise. + * cobol.dg/group2/COMP-6_numeric_test.out: Likewise. + * cobol.dg/group2/COMP-6_used_with_DISPLAY.out: Likewise. + * cobol.dg/group2/COMP-6_used_with_MOVE.out: Likewise. + * cobol.dg/group2/COMPUTE_multiplication_to_FIX4.out: Likewise. + * cobol.dg/group2/DISPLAY__Sign_ASCII__2_.out: Likewise. + * cobol.dg/group2/DISPLAY__Sign_ASCII.out: Likewise. + * cobol.dg/group2/Floating_continuation_indicator__1_.out: Likewise. + * cobol.dg/group2/floating-point_ADD_FORMAT_1.out: Likewise. + * cobol.dg/group2/floating-point_ADD_FORMAT_2.out: Likewise. + * cobol.dg/group2/floating-point_DIVIDE_FORMAT_1.out: Likewise. + * cobol.dg/group2/floating-point_DIVIDE_FORMAT_2.out: Likewise. + * cobol.dg/group2/floating-point_literals.out: Likewise. + * cobol.dg/group2/floating-point_MULTIPLY_FORMAT_1.out: Likewise. + * cobol.dg/group2/floating-point_MULTIPLY_FORMAT_2.out: Likewise. + * cobol.dg/group2/floating-point_SUBTRACT_FORMAT_1.out: Likewise. + * cobol.dg/group2/floating-point_SUBTRACT_FORMAT_2.out: Likewise. + * cobol.dg/group2/IBM_dialect_COMP_redefined_by_POINTER_as_64-bit.out: Likewise. + * cobol.dg/group2/Indicators_______________-____D__.out: Likewise. + * cobol.dg/group2/MULTIPLY_to_FIX4.out: Likewise. + * cobol.dg/group2/PACKED-DECIMAL_arithmetic.out: Likewise. + * cobol.dg/group2/PACKED-DECIMAL_basic_comp-3_comp-6__1_.out: Likewise. + * cobol.dg/group2/PACKED-DECIMAL_basic_comp-3_comp-6__2_.out: Likewise. + * cobol.dg/group2/PACKED-DECIMAL_dump.out: Likewise. + * cobol.dg/group2/PACKED-DECIMAL_numeric_test__1_.out: Likewise. + * cobol.dg/group2/PACKED-DECIMAL_numeric_test__2_.out: Likewise. + * cobol.dg/group2/PACKED-DECIMAL_used_with_DISPLAY.out: Likewise. + * cobol.dg/group2/PACKED-DECIMAL_used_with_INITIALIZE.out: Likewise. + * cobol.dg/group2/PACKED-DECIMAL_used_with_MOVE.out: Likewise. + * cobol.dg/group2/POINTER__display.out: Likewise. + * cobol.dg/group2/Simple_floating-point_MOVE.out: Likewise. + * cobol.dg/group2/Simple_floating-point_VALUE_and_MOVE.out: Likewise. + +2025-03-27 Jakub Jelinek <jakub@redhat.com> + + * g++.dg/strub-internal-pr112938.C: Add dg-warning for c++20. + +2025-03-27 Marek Polacek <polacek@redhat.com> + + * g++.dg/template/explicit-args6.C: Remove an extra set of {} in + a dg-message. + +2025-03-27 Dimitar Dimitrov <dimitar@dinux.eu> + + * gcc.misc-tests/gcov-31.c: Require effective target sigsetjmp. + * gcc.misc-tests/gcov-32.c: Ditto. + +2025-03-27 Marek Polacek <polacek@redhat.com> + + * g++.dg/tree-ssa/initlist-opt2.C: Match _M_range_initialize_n + instead of _M_range_initialize. + +2025-03-27 Sam James <sam@gentoo.org> + + * gfortran.dg/cray_pointers_2.f90: Restore whitespace. + +2025-03-27 Edwin Lu <ewlu@rivosinc.com> + + * gcc.target/riscv/rvv/autovec/vls/merge-4.c: Fix typo + +2025-03-27 Sam James <sam@gentoo.org> + + * gcc.target/aarch64/atomic-inst-ldlogic.c: Add another closing brace. + +2025-03-27 Sam James <sam@gentoo.org> + + * gcc.dg/analyzer/fd-datagram-socket.c: Fix 'dg-message' spelling. + * gcc.dg/analyzer/out-of-bounds-zero.c: Fix whitespace in 'dg-additional-options'. + * gcc.dg/analyzer/strchr-1.c: Fix 'dg-message' whitespace. + * gnat.dg/sso/q11.adb: Fix 'dg-output' whitespace. + +2025-03-27 Sam James <sam@gentoo.org> + + * g++.dg/warn/Winvalid-memory-model.C: Fix typo in comment. + * gcc.dg/builtin-dynamic-object-size-19.c: Ditto. + * gcc.dg/builtin-object-size-19.c: Ditto. + * gcc.dg/strlenopt-40.c: Ditto. + * gcc.dg/strlenopt-44.c: Ditto. + * gcc.dg/strlenopt-45.c: Ditto. + * gcc.dg/strlenopt-50.c: Ditto. + * gcc.dg/strlenopt-51.c: Ditto. + * gcc.dg/strlenopt-52.c: Ditto. + * gcc.dg/strlenopt-53.c: Ditto. + * gcc.dg/strlenopt-54.c: Ditto. + * gcc.dg/strlenopt-55.c: Ditto. + * gcc.dg/strlenopt-58.c: Ditto. + * gcc.dg/strlenopt-59.c: Ditto. + * gcc.dg/strlenopt-62.c: Ditto. + * gcc.dg/strlenopt-65.c: Ditto. + * gcc.dg/strlenopt-70.c: Ditto. + * gcc.dg/strlenopt-72.c: Ditto. + * gcc.dg/strlenopt-73.c: Ditto. + * gcc.dg/strlenopt-77.c: Ditto. + * gcc.dg/strlenopt-82.c: Ditto. + * gcc.dg/tree-ssa/builtin-snprintf-4.c: Ditto. + * gcc.dg/tree-ssa/builtin-snprintf-6.c: Ditto. + * gcc.dg/tree-ssa/builtin-snprintf-7.c: Ditto. + * gcc.dg/tree-ssa/builtin-sprintf-10.c: Ditto. + * gcc.dg/tree-ssa/builtin-sprintf-9.c: Ditto. + * gcc.dg/tree-ssa/phi-opt-value-5.c: Ditto. + * lib/multiline.exp: Ditto. + * lib/target-supports.exp: Ditto. + +2025-03-27 Sam James <sam@gentoo.org> + + * c-c++-common/goacc/pr69916.c: Fix unusual whitespace in dg-*. + * g++.old-deja/g++.abi/vtable2.C: Ditto. + * g++.old-deja/g++.bugs/900330_02.C: Ditto. + * g++.old-deja/g++.bugs/900406_02.C: Ditto. + * g++.old-deja/g++.bugs/900519_13.C: Ditto. + * g++.old-deja/g++.mike/p9068.C: Ditto. + * gcc.dg/20040203-1.c: Ditto. + * gcc.dg/980502-1.c: Ditto. + * gcc.dg/ipa/ipa-sra-14.c: Ditto. + * gcc.dg/pr35468.c: Ditto. + * gcc.dg/pr82597.c: Ditto. + * gcc.dg/tree-ssa/phi-opt-7.c: Ditto. + * gfortran.dg/assumed_charlen_in_main.f90: Ditto. + * gfortran.dg/cray_pointers_2.f90: Ditto. + +2025-03-27 Tobias Burnus <tburnus@baylibre.com> + + * g++.dg/gomp/append-args-1.C: Remove expected dg-sorry. + * g++.dg/gomp/append-args-8.C: New test. + +2025-03-27 Nathaniel Shead <nathanieloshead@gmail.com> + + PR c++/118920 + * g++.dg/modules/attrib-3_a.H: New test. + * g++.dg/modules/attrib-3_b.C: New test. + * g++.dg/modules/pr118920.h: New test. + * g++.dg/modules/pr118920_a.H: New test. + * g++.dg/modules/pr118920_b.H: New test. + * g++.dg/modules/pr118920_c.C: New test. + +2025-03-27 Nathaniel Shead <nathanieloshead@gmail.com> + Jason Merrill <jason@redhat.com> + + PR c++/118920 + * g++.dg/modules/tpl-friend-17.h: New test. + * g++.dg/modules/tpl-friend-17_a.C: New test. + * g++.dg/modules/tpl-friend-17_b.C: New test. + +2025-03-27 Richard Earnshaw <rearnsha@arm.com> + + * gcc.target/arm/fmaxmin.c: Move scan-assembler checks to ... + * gcc.target/arm/fmaxmin-2.c: ... here. New test. + +2025-03-27 Hu, Lin1 <lin1.hu@intel.com> + + PR target/119425 + * gcc.target/i386/pr119425.c: New test. + Co-authered-by: Hongyu Wang <hongyu.wang@intel.com> + +2025-03-27 Martin Uecker <uecker@tugraz.at> + + PR c/118765 + * gcc.dg/pr118765-2.c: New test. + * gcc.dg/pr118765-3.c: New test. + * gcc.dg/typedef-redecl3.c: New test. + +2025-03-27 Lulu Cheng <chenglulu@loongson.cn> + + PR target/119408 + * gcc.target/loongarch/pr119408.c: New test. + +2025-03-27 Sandra Loosemore <sloosemore@baylibre.com> + + * c-c++-common/gomp/append-args-interop.c: Fix declaration of base + function to be correct for pre-C23 dialects. + +2025-03-27 Sam James <sam@gentoo.org> + + PR testsuite/119489 + * g++.dg/strub-internal-pr112938.C: Adjust pattern. + +2025-03-27 Sam James <sam@gentoo.org> + + * gcc.target/arc/taux-1.c: Add missing brace. + * gcc.target/arc/taux-2.c: Ditto. + * gcc.target/i386/addr-space-1.c: Ditto. + * gcc.target/ia64/mfused-madd-vect.c: Ditto. + * gcc.target/ia64/mfused-madd.c: Ditto. + * gcc.target/ia64/mno-fused-madd-vect.c: Ditto. + * gcc.target/ia64/mno-fused-madd.c: Ditto. + * gcc.target/riscv/rvv/autovec/vls-vlmax/merge-4.c: Ditto. + * gcc.target/riscv/rvv/autovec/vls/merge-4.c: Ditto. + * gcc.target/s390/target-attribute/tattr-1.c: Ditto. + * gcc.target/s390/target-attribute/tattr-2.c: Ditto. + +2025-03-27 Sam James <sam@gentoo.org> + + PR target/98743 + PR tree-optimization/105820 + * g++.dg/cpp0x/udlit-namespace-ambiguous.C: Fix whitespace. + * g++.dg/cpp2a/constexpr-init21.C: Ditto. + * g++.dg/diagnostic/wrong-tag-1.C: Ditto. + * g++.dg/init/self1.C: Ditto. + * g++.dg/opt/pr98743.C: Add missing '}' to terminate dg directive. + * g++.dg/parse/error8.C: Fix whitespace. + * g++.dg/template/explicit-args6.C: Add missing '{' to begin dg directive. + * g++.dg/template/unify9.C: Fix whitespace. + * g++.dg/tree-ssa/pr105820.C: Ditto. + * g++.dg/warn/Wmismatched-tags-8.C: Add missing braces. + * gcc.dg/cpp/cmdlne-dM-M.c: Ditto. + * gcc.dg/tree-ssa/reassoc-32.c: Ditto. + * gcc.dg/tree-ssa/reassoc-33.c: Ditto. + * gcc.dg/tree-ssa/reassoc-34.c: Ditto. + * gcc.dg/tree-ssa/reassoc-35.c: Ditto. + * gcc.dg/tree-ssa/reassoc-36.c: Ditto. + * gcc.dg/tree-ssa/reassoc-39.c: Ditto. + * gcc.dg/tree-ssa/reassoc-41.c: Ditto. + +2025-03-27 Sam James <sam@gentoo.org> + + * g++.dg/diagnostic/unclosed-extern-c.C: Fix 'dg-message' typo. + * g++.dg/warn/Wno-attributes-1.C: Ditto. + +2025-03-27 Sam James <sam@gentoo.org> + + * g++.dg/cpp0x/gen-attrs-6.C: Surround 'target' by whitespace. + * gcc.target/aarch64/atomic-inst-ldlogic.c: Fix 'dg-final' whitespace. + * gcc.target/arm/short-vfp-1.c: Ditto. + * gcc.target/bfin/l2.c: Fix 'dg-bfin-processors' whitespace. + * gcc.target/i386/avx512fp16-vmovw-1b.c: Surround 'target' by whitespace. + * gcc.target/i386/sse2-float16-5.c: Ditto. + * gcc.target/powerpc/fold-vec-perm-longlong.c: Ditto. + +2025-03-27 Sam James <sam@gentoo.org> + + PR middle-end/93437 + * g++.dg/warn/Wstringop-overflow-5.C: Fix -Wstringop-overflow casing. + +2025-03-27 Sam James <sam@gentoo.org> + + * gfortran.dg/associate_70.f90: Replace parenthesis with '}'. + * gfortran.dg/bessel_3.f90: Drop extraneous parenthesis. + * gfortran.dg/c_funloc_tests_6.f90: Ditto. + * gfortran.dg/parity_2.f90: Ditto. + +2025-03-27 Sam James <sam@gentoo.org> + + PR ipa/98265 + * g++.dg/tree-ssa/pr98265.C: Use -std=c++14. + Use scan-tree-dump instead of scan-tree-dump-times. + +2025-03-27 Sam James <sam@gentoo.org> + + PR tree-optimization/37143 + * g++.dg/vect/pr37143.C: Move to... + * g++.dg/vect/pr37143.cc: ...here. + +2025-03-27 Sam James <sam@gentoo.org> + + PR ipa/98265 + * gcc.dg/tree-ssa/pr98265.C: Move to... + * g++.dg/tree-ssa/pr98265.C: ...here. + +2025-03-27 Sam James <sam@gentoo.org> + + PR middle-end/112938 + * g++.dg/strub-internal-pr112938.cc: Move to... + * g++.dg/strub-internal-pr112938.C: ...here. + +2025-03-26 Jørgen Kvalsvik <j@lambda.is> + + * lib/gcov.exp: Add prime paths test function. + * g++.dg/gcov/gcov-22.C: New test. + * g++.dg/gcov/gcov-23-1.h: New test. + * g++.dg/gcov/gcov-23-2.h: New test. + * g++.dg/gcov/gcov-23.C: New test. + * gcc.misc-tests/gcov-29.c: New test. + * gcc.misc-tests/gcov-30.c: New test. + * gcc.misc-tests/gcov-31.c: New test. + * gcc.misc-tests/gcov-32.c: New test. + * gcc.misc-tests/gcov-33.c: New test. + * gcc.misc-tests/gcov-34.c: New test. + +2025-03-26 Harald Anlauf <anlauf@gmx.de> + + PR fortran/118796 + * gfortran.dg/derived_result_4.f90: New test. + +2025-03-26 David Malcolm <dmalcolm@redhat.com> + + * gcc.target/powerpc/pr70243.c: Fix missing trailing " }" in + dg-do directive. + * gcc.target/powerpc/pr91903.c: Likewise. + +2025-03-26 David Malcolm <dmalcolm@redhat.com> + + * c-c++-common/gomp/metadirective-target-device-2.c: Fix missing + trailing " }" on dg-do directive. + * gcc.dg/gomp/attrs-21.c: Likewise for dg-options. + * gcc.dg/gomp/parallel-2.c: Drop ":" from dg-message. + +2025-03-26 David Malcolm <dmalcolm@redhat.com> + + * gcc.dg/ipa/pr110377.c: Fix missing trailing " }" in dg-do + directive. + * gcc.dg/plugin/infoleak-1.c: Fix dg-bogus directive. + * gcc.dg/pr101364-1.c: Fix missing trailing " }" in dg-options + directive. + * gcc.dg/pr113207.c: Fix dg-do. + * gcc.dg/sarif-output/include-chain-2.c: Fix ordering of dg-do + and dg-require-effective-target. + * gcc.dg/strub-pr118007.c: Likewise. + * gcc.dg/tanhbysinh.c: Fix missing whitespace after opening + brace and before closing brace in 6 dg-final directives. + * gcc.dg/uninit-pred-3_c.c: Fix missing whitespace after opening + brace in 6 dg-final directive. + * gcc.dg/uninit-pred-3_d.c: Likewise. + * gcc.dg/variable-sized-type-flex-array.c: Fix missing space + between dg-bogus and message in 2 places. + +2025-03-26 Jonathan Wakely <jwakely@redhat.com> + + * g++.dg/tree-ssa/initlist-opt1.C: Match _M_range_initialize_n + instead of _M_range_initialize. + +2025-03-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + * c-c++-common/gomp/metadirective-device.c + (dg-additional-options): Use on all x86 targets. Restrict to lp64. + * c-c++-common/gomp/metadirective-target-device-1.c: Likewise. + +2025-03-26 Jakub Jelinek <jakub@redhat.com> + + * gfortran.dg/gomp/append-args-interop.f90: Don't use omp_lib, + instead use iso_c_binding and define omp_interop_kind parameter + locally. + +2025-03-26 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/119417 + * gcc.dg/torture/pr119417.c: New test. + +2025-03-26 Jakub Jelinek <jakub@redhat.com> + Andi Kleen <ak@gcc.gnu.org> + + PR gcov-profile/118442 + * c-c++-common/pr118442.c: New test. + +2025-03-26 Jakub Jelinek <jakub@redhat.com> + + PR target/55583 + PR target/119465 + * gcc.target/i386/pr55583.c: Add -mno-sse -mno-mmx to + dg-additional-options. Expect 4 shrdl and 2 shldl instructions on + ia32. + +2025-03-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + * gcc.target/i386/pr117946.c: Require dfp support. + * gcc.target/i386/pr118017.c: Likewise. Use + dg-require-effective-target for both this and int128. + +2025-03-26 Jakub Jelinek <jakub@redhat.com> + + PR target/119450 + * gcc.target/i386/pr119450.c: New test. + +2025-03-26 Richard Biener <rguenther@suse.de> + + PR middle-end/118795 + * g++.dg/torture/pr118795.C: New testcase. + +2025-03-26 Sam James <sam@gentoo.org> + Andrew Pinski <quic_apinski@quicinc.com> + + PR testsuite/119382 + * gcc.dg/ipa/ipa-icf-40.c: New test. + +2025-03-26 Hu, Lin1 <lin1.hu@intel.com> + + * gcc.target/i386/avx10_2-512-convert-1.c: Modify function name + to follow the latest version. + * gcc.target/i386/avx10_2-512-vcvt2ph2bf8s-2.c: Ditto. + * gcc.target/i386/avx10_2-512-vcvt2ph2hf8s-2.c: Ditto. + * gcc.target/i386/avx10_2-512-vcvtbiasph2bf8s-2.c: Ditto. + * gcc.target/i386/avx10_2-512-vcvtbiasph2hf8s-2.c: Ditto. + * gcc.target/i386/avx10_2-512-vcvtph2bf8s-2.c: Ditto. + * gcc.target/i386/avx10_2-512-vcvtph2hf8s-2.c: Ditto. + * gcc.target/i386/avx10_2-convert-1.c: Ditto. + 2025-03-25 Bob Dubner <rdubner@symas.com> Richard Biener <rguenth@suse.de> Jakub Jelinek <jakub@redhat.com> diff --git a/gcc/testsuite/c-c++-common/goacc/pr69916.c b/gcc/testsuite/c-c++-common/goacc/pr69916.c index e037af34..5c46bb7 100644 --- a/gcc/testsuite/c-c++-common/goacc/pr69916.c +++ b/gcc/testsuite/c-c++-common/goacc/pr69916.c @@ -1,4 +1,4 @@ -/* { dg-additional-options "-O2" } */ +/* { dg-additional-options "-O2" } */ /* PR 69916, an loop determined to be empty sometime after omp-lower and before oacc-device-lower can evaporate leading to no GOACC_LOOP diff --git a/gcc/testsuite/c-c++-common/gomp/append-args-interop.c b/gcc/testsuite/c-c++-common/gomp/append-args-interop.c index 9494625..1211450 100644 --- a/gcc/testsuite/c-c++-common/gomp/append-args-interop.c +++ b/gcc/testsuite/c-c++-common/gomp/append-args-interop.c @@ -23,7 +23,7 @@ typedef enum omp_interop_t __GOMP_UINTPTR_T_ENUM float repl1(omp_interop_t, omp_interop_t, omp_interop_t); #pragma omp declare variant(repl1) match(construct={dispatch}) append_args(interop(target), interop(targetsync), interop (target)) -float base1(); +float base1(void); float test (int *a, int *b) diff --git a/gcc/testsuite/c-c++-common/gomp/metadirective-target-device-2.c b/gcc/testsuite/c-c++-common/gomp/metadirective-target-device-2.c index 24584f2..4de1921 100644 --- a/gcc/testsuite/c-c++-common/gomp/metadirective-target-device-2.c +++ b/gcc/testsuite/c-c++-common/gomp/metadirective-target-device-2.c @@ -1,4 +1,4 @@ -/* { dg-do compile */ +/* { dg-do compile } */ /* { dg-additional-options "-fdump-tree-optimized" } */ /* In configurations without offloading configured, we can resolve many diff --git a/gcc/testsuite/c-c++-common/pr119483-1.c b/gcc/testsuite/c-c++-common/pr119483-1.c new file mode 100644 index 0000000..b2d7b57 --- /dev/null +++ b/gcc/testsuite/c-c++-common/pr119483-1.c @@ -0,0 +1,29 @@ +/* PR tree-optimization/119483 */ +/* { dg-do compile { target musttail } } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ +/* { dg-final { scan-tree-dump-times "bar\[.a-z0-9]* \\\(\[^\n\r]*\\\); \\\[tail call\\\] \\\[must tail call\\\]" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "baz \\\(\[^\n\r]*\\\); \\\[tail call\\\] \\\[must tail call\\\]" 1 "optimized" } } */ + +[[gnu::noreturn]] extern void foo (void); + +[[gnu::noinline]] static int +bar (int x) +{ + (void) x; + foo (); + return 0; +} + +[[gnu::noipa]] int +baz (int x) +{ + return x + 42; +} + +int +qux (int x) +{ + if (x == 1) + [[gnu::musttail]] return bar (1); + [[gnu::musttail]] return baz (x); +} diff --git a/gcc/testsuite/c-c++-common/pr119483-2.c b/gcc/testsuite/c-c++-common/pr119483-2.c new file mode 100644 index 0000000..e7b692d --- /dev/null +++ b/gcc/testsuite/c-c++-common/pr119483-2.c @@ -0,0 +1,12 @@ +/* PR tree-optimization/119483 */ +/* { dg-do compile { target musttail } } */ +/* { dg-options "-O2" } */ + +[[noreturn]] int +foo (int x) +{ + if (x > 10) + [[gnu::musttail]] return foo (x - 1); /* { dg-warning "function declared 'noreturn' has a 'return' statement" } */ + for (;;) + ; +} diff --git a/gcc/testsuite/c-c++-common/pr119484.c b/gcc/testsuite/c-c++-common/pr119484.c new file mode 100644 index 0000000..6ae7c9a --- /dev/null +++ b/gcc/testsuite/c-c++-common/pr119484.c @@ -0,0 +1,21 @@ +/* PR ipa/119484 */ +/* { dg-do compile { target musttail } } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ +/* { dg-final { scan-tree-dump-times "bar\[.a-z0-9]* \\\(\[^\n\r]*\\\); \\\[tail call\\\] \\\[must tail call\\\]" 1 "optimized" } } */ + +void foo (int); + +[[gnu::noinline]] static int +bar (int x) +{ + foo (x); + return 0; +} + +int +baz (int x) +{ + if (x == 1) + [[gnu::musttail]] return bar (x); + return 0; +} diff --git a/gcc/testsuite/cobol.dg/group2/ACCEPT_DATE___DAY_and_intrinsic_functions__1_.cob b/gcc/testsuite/cobol.dg/group2/ACCEPT_DATE___DAY_and_intrinsic_functions__1_.cob new file mode 100644 index 0000000..69eb283 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/ACCEPT_DATE___DAY_and_intrinsic_functions__1_.cob @@ -0,0 +1,30 @@ + *> { dg-do run } + + IDENTIFICATION DIVISION. + PROGRAM-ID. prog. + DATA DIVISION. + WORKING-STORAGE SECTION. + *> one byte longer to make sure there is no garbage in + 01 WS-YYYYMMDD PIC 9(9). + 01 WS-YYYYDDD PIC 9(8). + PROCEDURE DIVISION. + ACCEPT WS-YYYYMMDD FROM DATE YYYYMMDD + END-ACCEPT + ACCEPT WS-YYYYDDD FROM DAY YYYYDDD + END-ACCEPT + IF FUNCTION INTEGER-OF-DATE (WS-YYYYMMDD) + NOT = FUNCTION INTEGER-OF-DAY (WS-YYYYDDD) + DISPLAY "DIFFERENCES FOUND!" + END-DISPLAY + DISPLAY "YYYYMMDD = " WS-YYYYMMDD ", " + "YYYYDDD = " WS-YYYYDDD + END-DISPLAY + DISPLAY "INTEGER-OF-DATE = " + FUNCTION INTEGER-OF-DATE (WS-YYYYMMDD) ", " + "INTEGER-OF-DAY = " + FUNCTION INTEGER-OF-DAY (WS-YYYYDDD) + END-DISPLAY + MOVE 1 TO RETURN-CODE + END-IF + STOP RUN. + diff --git a/gcc/testsuite/cobol.dg/group2/ACCEPT_DATE___DAY_and_intrinsic_functions__2_.cob b/gcc/testsuite/cobol.dg/group2/ACCEPT_DATE___DAY_and_intrinsic_functions__2_.cob new file mode 100644 index 0000000..7a404fd --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/ACCEPT_DATE___DAY_and_intrinsic_functions__2_.cob @@ -0,0 +1,31 @@ + *> { dg-do run } + *> { dg-set-target-env-var COB_CURRENT_DATE "2020/06/12 18:45:22" } + + IDENTIFICATION DIVISION. + PROGRAM-ID. prog. + DATA DIVISION. + WORKING-STORAGE SECTION. + *> one byte longer to make sure there is no garbage in + 01 WS-YYYYMMDD PIC 9(9). + 01 WS-YYYYDDD PIC 9(8). + PROCEDURE DIVISION. + ACCEPT WS-YYYYMMDD FROM DATE YYYYMMDD + END-ACCEPT + ACCEPT WS-YYYYDDD FROM DAY YYYYDDD + END-ACCEPT + IF FUNCTION INTEGER-OF-DATE (WS-YYYYMMDD) + NOT = FUNCTION INTEGER-OF-DAY (WS-YYYYDDD) + DISPLAY "DIFFERENCES FOUND!" + END-DISPLAY + DISPLAY "YYYYMMDD = " WS-YYYYMMDD ", " + "YYYYDDD = " WS-YYYYDDD + END-DISPLAY + DISPLAY "INTEGER-OF-DATE = " + FUNCTION INTEGER-OF-DATE (WS-YYYYMMDD) ", " + "INTEGER-OF-DAY = " + FUNCTION INTEGER-OF-DAY (WS-YYYYDDD) + END-DISPLAY + MOVE 1 TO RETURN-CODE + END-IF + STOP RUN. + diff --git a/gcc/testsuite/cobol.dg/group2/ACCEPT_FROM_TIME___DATE___DAY___DAY-OF-WEEK__1_.cob b/gcc/testsuite/cobol.dg/group2/ACCEPT_FROM_TIME___DATE___DAY___DAY-OF-WEEK__1_.cob new file mode 100644 index 0000000..6c1e479 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/ACCEPT_FROM_TIME___DATE___DAY___DAY-OF-WEEK__1_.cob @@ -0,0 +1,58 @@ + *> { dg-do run } + + IDENTIFICATION DIVISION. + PROGRAM-ID. prog. + DATA DIVISION. + WORKING-STORAGE SECTION. + *> one byte longer to make sure there is no garbage in + 01 X PIC X(9). + PROCEDURE DIVISION. + ACCEPT X FROM TIME + END-ACCEPT + IF X (1:2) >= "00" AND <= "23" AND + X (3:2) >= "00" AND <= "59" AND + X (5:2) >= "00" AND <= "60" AND + X (7:2) >= "00" AND <= "99" AND + X (9: ) = SPACE + CONTINUE + ELSE + DISPLAY "TIME " X "!" + END-DISPLAY + END-IF + ACCEPT X FROM DATE + END-ACCEPT + INSPECT X CONVERTING "012345678" TO "999999999" + IF X NOT = "999999" + DISPLAY "DATE " X "!" + END-DISPLAY + END-IF + ACCEPT X FROM DATE YYYYMMDD + END-ACCEPT + INSPECT X CONVERTING "012345678" TO "999999999" + IF X NOT = "99999999" + DISPLAY "YYYYMMDD " X "!" + END-DISPLAY + END-IF + ACCEPT X FROM DAY + END-ACCEPT + INSPECT X CONVERTING "012345678" TO "999999999" + IF X NOT = "99999" + DISPLAY "DAY " X "!" + END-DISPLAY + END-IF + ACCEPT X FROM DAY YYYYDDD + END-ACCEPT + INSPECT X CONVERTING "012345678" TO "999999999" + IF X NOT = "9999999" + DISPLAY "YYYYDDD " X "!" + END-DISPLAY + END-IF + ACCEPT X FROM DAY-OF-WEEK + END-ACCEPT + INSPECT X CONVERTING "1234567" TO "9999999" + IF X NOT = "9" + DISPLAY "DAY-OF-WEEK " X "!" + END-DISPLAY + END-IF + STOP RUN. + diff --git a/gcc/testsuite/cobol.dg/group2/ACCEPT_FROM_TIME___DATE___DAY___DAY-OF-WEEK__2_.cob b/gcc/testsuite/cobol.dg/group2/ACCEPT_FROM_TIME___DATE___DAY___DAY-OF-WEEK__2_.cob new file mode 100644 index 0000000..6014220 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/ACCEPT_FROM_TIME___DATE___DAY___DAY-OF-WEEK__2_.cob @@ -0,0 +1,74 @@ + *> { dg-do run } + *> { dg-set-target-env-var COB_CURRENT_DATE "2015/04/05 18:45:22" } + *> { dg-output-file "group2/ACCEPT_FROM_TIME___DATE___DAY___DAY-OF-WEEK__2_.out" } + + IDENTIFICATION DIVISION. + PROGRAM-ID. prog. + DATA DIVISION. + WORKING-STORAGE SECTION. + *> one byte longer to make sure there is no garbage in + 01 WS-YYYYMMDD PIC X(9). + 01 WS-YYYYDDD PIC X(8). + 01 WS-DAYOFWEEK PIC X(2). + 01 WS-DATE-TODAY. + 05 WS-TODAYS-YY PIC 9(02) VALUE 0. + 05 WS-TODAYS-MM PIC 9(02) VALUE 0. + 05 WS-TODAYS-DD PIC 9(02) VALUE 0. + + 01 WS-DATE. + 05 WS-DATE-MM PIC 9(02) VALUE 0. + 05 FILLER PIC X(01) VALUE '/'. + 05 WS-DATE-DD PIC 9(02) VALUE 0. + 05 FILLER PIC X(01) VALUE '/'. + 05 WS-DATE-YY PIC 9(02) VALUE 0. + + 01 WS-TIME-NOW. + 05 WS-NOW-HH PIC 9(02) VALUE 0. + 05 WS-NOW-MM PIC 9(02) VALUE 0. + 05 WS-NOW-SS PIC 9(02) VALUE 0. + 05 WS-NOW-HS PIC 9(02) VALUE 0. + + 01 WS-TIME. + 05 WS-TIME-HH PIC 9(02) VALUE 0. + 05 FILLER PIC X(01) VALUE ':'. + 05 WS-TIME-MM PIC 9(02) VALUE 0. + 05 FILLER PIC X(01) VALUE ':'. + 05 WS-TIME-SS PIC 9(02) VALUE 0. + + PROCEDURE DIVISION. + ACCEPT WS-DATE-TODAY FROM DATE + ACCEPT WS-TIME-NOW FROM TIME + MOVE WS-TODAYS-YY TO WS-DATE-YY + MOVE WS-TODAYS-MM TO WS-DATE-MM + MOVE WS-TODAYS-DD TO WS-DATE-DD + MOVE WS-NOW-HH TO WS-TIME-HH + MOVE WS-NOW-MM TO WS-TIME-MM + MOVE WS-NOW-SS TO WS-TIME-SS + DISPLAY 'PROCESS DATE/TIME : ' WS-DATE SPACE WS-TIME + END-DISPLAY + ACCEPT WS-YYYYMMDD FROM DATE YYYYMMDD + DISPLAY WS-YYYYMMDD(1:8) + IF WS-YYYYMMDD not = "20150405" + DISPLAY 'Wrong date DATE YYYYMMDD: ' WS-YYYYMMDD + ' expected: 20150405' + UPON STDERR + END-DISPLAY + END-IF + ACCEPT WS-YYYYDDD FROM DAY YYYYDDD + DISPLAY WS-YYYYDDD(1:7) + IF WS-YYYYDDD not = "2015095" + DISPLAY 'Wrong date YYYYDDD: ' WS-YYYYDDD + ' expected: 2015095' + UPON STDERR + END-DISPLAY + END-IF + ACCEPT WS-DAYOFWEEK FROM DAY-OF-WEEK + DISPLAY WS-DAYOFWEEK(1:1) + IF WS-DAYOFWEEK not = "7" + DISPLAY 'Wrong date DAYOFWEEK: ' WS-DAYOFWEEK + ' expected: 7' + UPON STDERR + END-DISPLAY + END-IF + STOP RUN. + diff --git a/gcc/testsuite/cobol.dg/group2/ACCEPT_FROM_TIME___DATE___DAY___DAY-OF-WEEK__2_.out b/gcc/testsuite/cobol.dg/group2/ACCEPT_FROM_TIME___DATE___DAY___DAY-OF-WEEK__2_.out new file mode 100644 index 0000000..a6ac8c4 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/ACCEPT_FROM_TIME___DATE___DAY___DAY-OF-WEEK__2_.out @@ -0,0 +1,5 @@ +PROCESS DATE/TIME : 04/05/15 18:45:22 +20150405 +2015095 +7 + diff --git a/gcc/testsuite/cobol.dg/group2/COMP-6_arithmetic.cob b/gcc/testsuite/cobol.dg/group2/COMP-6_arithmetic.cob new file mode 100644 index 0000000..6e8dc5c --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/COMP-6_arithmetic.cob @@ -0,0 +1,23 @@ + *> { dg-do run } + *> { dg-options "-dialect mf" } + *> { dg-output-file "group2/COMP-6_arithmetic.out" } + + IDENTIFICATION DIVISION. + PROGRAM-ID. prog. + DATA DIVISION. + WORKING-STORAGE SECTION. + 01 X-99 PIC 99 USAGE COMP-6. + 01 X-999 PIC 999 USAGE COMP-6. + 01 B-99 USAGE BINARY-LONG UNSIGNED. + 01 B-999 USAGE BINARY-LONG UNSIGNED. + PROCEDURE DIVISION. + MOVE 99 TO B-99 + MOVE B-99 TO X-99 + MOVE 123 TO B-999 + MOVE B-999 TO X-999 + ADD X-99 X-999 GIVING B-99 + END-ADD + DISPLAY B-99 + END-DISPLAY + STOP RUN. + diff --git a/gcc/testsuite/cobol.dg/group2/COMP-6_arithmetic.out b/gcc/testsuite/cobol.dg/group2/COMP-6_arithmetic.out new file mode 100644 index 0000000..fce98b0 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/COMP-6_arithmetic.out @@ -0,0 +1,2 @@ +0000000222 + diff --git a/gcc/testsuite/cobol.dg/group2/COMP-6_numeric_test.cob b/gcc/testsuite/cobol.dg/group2/COMP-6_numeric_test.cob new file mode 100644 index 0000000..3628628 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/COMP-6_numeric_test.cob @@ -0,0 +1,75 @@ + *> { dg-do run } + *> { dg-options "-dialect mf" } + *> { dg-output-file "group2/COMP-6_numeric_test.out" } + + IDENTIFICATION DIVISION. + PROGRAM-ID. prog. + DATA DIVISION. + WORKING-STORAGE SECTION. + 01 G. + 02 X-2 PIC X(2). + 02 N-3 REDEFINES X-2 PIC 999 USAGE COMP-6. + 02 N-4 REDEFINES X-2 PIC 9999 USAGE COMP-6. + PROCEDURE DIVISION. + MOVE X"0000" TO X-2. + IF N-3 IS NUMERIC + DISPLAY "OK" + END-DISPLAY + ELSE + DISPLAY "1 NG" + END-DISPLAY + END-IF. + IF N-4 IS NUMERIC + DISPLAY "OK" + END-DISPLAY + ELSE + DISPLAY "2 NG" + END-DISPLAY + END-IF. + MOVE X"000c" TO X-2. + IF N-3 IS NUMERIC + DISPLAY "3 NG" + END-DISPLAY + ELSE + DISPLAY "OK" + END-DISPLAY + END-IF. + IF N-4 IS NUMERIC + DISPLAY "4 NG" + END-DISPLAY + ELSE + DISPLAY "OK" + END-DISPLAY + END-IF. + MOVE X"1234" TO X-2. + IF N-3 IS NUMERIC + DISPLAY "5 NG" + END-DISPLAY + ELSE + DISPLAY "OK" + END-DISPLAY + END-IF. + IF N-4 IS NUMERIC + DISPLAY "OK" + END-DISPLAY + ELSE + DISPLAY "6 NG" + END-DISPLAY + END-IF. + MOVE X"ffff" TO X-2. + IF N-3 IS NUMERIC + DISPLAY "7 NG" + END-DISPLAY + ELSE + DISPLAY "OK" + END-DISPLAY + END-IF. + IF N-4 IS NUMERIC + DISPLAY "7 NG" + END-DISPLAY + ELSE + DISPLAY "OK" + END-DISPLAY + END-IF. + STOP RUN. + diff --git a/gcc/testsuite/cobol.dg/group2/COMP-6_numeric_test.out b/gcc/testsuite/cobol.dg/group2/COMP-6_numeric_test.out new file mode 100644 index 0000000..09117b6 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/COMP-6_numeric_test.out @@ -0,0 +1,9 @@ +OK +OK +OK +OK +OK +OK +OK +OK + diff --git a/gcc/testsuite/cobol.dg/group2/COMP-6_used_with_DISPLAY.cob b/gcc/testsuite/cobol.dg/group2/COMP-6_used_with_DISPLAY.cob new file mode 100644 index 0000000..33d048e --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/COMP-6_used_with_DISPLAY.cob @@ -0,0 +1,25 @@ + *> { dg-do run } + *> { dg-options "-dialect mf" } + *> { dg-output-file "group2/COMP-6_used_with_DISPLAY.out" } + + IDENTIFICATION DIVISION. + PROGRAM-ID. prog. + DATA DIVISION. + WORKING-STORAGE SECTION. + 01 X-99 PIC 99 USAGE COMP-6. + 01 X-999 PIC 999 USAGE COMP-6. + PROCEDURE DIVISION. + MOVE 0 TO X-99. + DISPLAY X-99 + END-DISPLAY. + MOVE 99 TO X-99. + DISPLAY X-99 + END-DISPLAY. + MOVE 0 TO X-999. + DISPLAY X-999 + END-DISPLAY. + MOVE 123 TO X-999. + DISPLAY X-999 + END-DISPLAY. + STOP RUN. + diff --git a/gcc/testsuite/cobol.dg/group2/COMP-6_used_with_DISPLAY.out b/gcc/testsuite/cobol.dg/group2/COMP-6_used_with_DISPLAY.out new file mode 100644 index 0000000..901408e --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/COMP-6_used_with_DISPLAY.out @@ -0,0 +1,5 @@ +00 +99 +000 +123 + diff --git a/gcc/testsuite/cobol.dg/group2/COMP-6_used_with_MOVE.cob b/gcc/testsuite/cobol.dg/group2/COMP-6_used_with_MOVE.cob new file mode 100644 index 0000000..9f319fa --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/COMP-6_used_with_MOVE.cob @@ -0,0 +1,34 @@ + *> { dg-do run } + *> { dg-options "-dialect mf" } + *> { dg-output-file "group2/COMP-6_used_with_MOVE.out" } + + IDENTIFICATION DIVISION. + PROGRAM-ID. prog. + DATA DIVISION. + WORKING-STORAGE SECTION. + 01 X-99 PIC 99 USAGE COMP-6. + 01 X-999 PIC 999 USAGE COMP-6. + 01 B-99 USAGE BINARY-LONG. + 01 B-999 USAGE BINARY-LONG. + PROCEDURE DIVISION. + MOVE 0 TO B-99. + MOVE B-99 TO X-99. + DISPLAY X-99 + END-DISPLAY. + MOVE 99 TO B-99. + MOVE B-99 TO X-99. + DISPLAY X-99 + END-DISPLAY. + MOVE 0 TO B-999. + MOVE B-999 TO X-999. + DISPLAY X-999 + END-DISPLAY. + MOVE 123 TO B-999. + MOVE B-999 TO X-999. + DISPLAY X-999 + END-DISPLAY. + MOVE B-999 TO X-99. + DISPLAY X-99 + END-DISPLAY. + STOP RUN. + diff --git a/gcc/testsuite/cobol.dg/group2/COMP-6_used_with_MOVE.out b/gcc/testsuite/cobol.dg/group2/COMP-6_used_with_MOVE.out new file mode 100644 index 0000000..19f3704 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/COMP-6_used_with_MOVE.out @@ -0,0 +1,6 @@ +00 +99 +000 +123 +23 + diff --git a/gcc/testsuite/cobol.dg/group2/COMPUTE_multiplication_to_FIX4.cob b/gcc/testsuite/cobol.dg/group2/COMPUTE_multiplication_to_FIX4.cob new file mode 100644 index 0000000..4ea8b35 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/COMPUTE_multiplication_to_FIX4.cob @@ -0,0 +1,154 @@ + *> { dg-do run } + *> { dg-output-file "group2/COMPUTE_multiplication_to_FIX4.out" } + + IDENTIFICATION DIVISION. + PROGRAM-ID. onsize. + DATA DIVISION. + WORKING-STORAGE SECTION. + 01 FIX4DISPLAY PIC 9(4) DISPLAY. + 01 FIX8DISPLAY PIC 9(8) DISPLAY VALUE 12345678. + 01 FIX8BINARY PIC 9(8) BINARY VALUE 12345678. + 01 FIX8PACKED PIC 9(8) PACKED-DECIMAL VALUE 12345678. + 01 FIX8NUMEDT PIC 9(8).0 VALUE 12345678. + 01 FLOATSHORT FLOAT-SHORT VALUE 12345678. + 01 FLOATLONG FLOAT-LONG VALUE 12345678. + 01 FLOATEXT FLOAT-EXTENDED VALUE 12345678. + + PROCEDURE DIVISION. + + *> FIX8DISPLAY + DISPLAY "COMPUTE FIX4DISPLAY = FIX8DISPLAY without SIZE ERROR" + MOVE 9876 TO FIX4DISPLAY + COMPUTE FIX4DISPLAY = FIX8DISPLAY + DISPLAY "FIX4DISPLAY is " FIX4DISPLAY + DISPLAY "Should be 5678" + DISPLAY "." + + DISPLAY "COMPUTE FIX4DISPLAY = FIX8DISPLAY with SIZE ERROR" + COMPUTE FIX4DISPLAY = FIX8DISPLAY + MOVE 9876 TO FIX4DISPLAY + COMPUTE FIX4DISPLAY = FIX8DISPLAY + ON SIZE ERROR Display "Proper size error" + NOT ON SIZE ERROR Display "Improper no error" + END-COMPUTE + DISPLAY "FIX4DISPLAY is " FIX4DISPLAY + DISPLAY "Should be 9876" + DISPLAY "." + + *> FIX8BINARY + + DISPLAY "COMPUTE FIX4DISPLAY = FIX8BINARY without SIZE ERROR" + COMPUTE FIX4DISPLAY = FIX8BINARY + DISPLAY "FIX4DISPLAY is " FIX4DISPLAY + DISPLAY "Should be 5678" + DISPLAY "." + + DISPLAY "COMPUTE FIX4DISPLAY = FIX8BINARY with SIZE ERROR" + COMPUTE FIX4DISPLAY = FIX8BINARY + MOVE 9876 TO FIX4DISPLAY + COMPUTE FIX4DISPLAY = FIX8BINARY + ON SIZE ERROR Display "Proper size error" + NOT ON SIZE ERROR Display "Improper no error" + END-COMPUTE + DISPLAY "FIX4DISPLAY is " FIX4DISPLAY + DISPLAY "Should be 9876" + DISPLAY "." + + *> FIX8PACKED + + DISPLAY "COMPUTE FIX4DISPLAY = FIX8PACKED without SIZE ERROR" + COMPUTE FIX4DISPLAY = FIX8PACKED + DISPLAY "FIX4DISPLAY is " FIX4DISPLAY + DISPLAY "Should be 5678" + DISPLAY "." + + DISPLAY "COMPUTE FIX4DISPLAY = FIX8PACKED with SIZE ERROR" + COMPUTE FIX4DISPLAY = FIX8PACKED + MOVE 9876 TO FIX4DISPLAY + COMPUTE FIX4DISPLAY = FIX8PACKED + ON SIZE ERROR Display "Proper size error" + NOT ON SIZE ERROR Display "Improper no error" + END-COMPUTE + DISPLAY "FIX4DISPLAY is " FIX4DISPLAY + DISPLAY "Should be 9876" + DISPLAY "." + + *> FIX8NUMEDT + + DISPLAY "COMPUTE FIX4DISPLAY = FIX8NUMEDT without SIZE ERROR" + COMPUTE FIX4DISPLAY = FIX8NUMEDT + DISPLAY "FIX4DISPLAY is " FIX4DISPLAY + DISPLAY "Should be 5678" + DISPLAY "." + + DISPLAY "COMPUTE FIX4DISPLAY = FIX8NUMEDT with SIZE ERROR" + COMPUTE FIX4DISPLAY = FIX8NUMEDT + MOVE 9876 TO FIX4DISPLAY + COMPUTE FIX4DISPLAY = FIX8NUMEDT + ON SIZE ERROR Display "Proper size error" + NOT ON SIZE ERROR Display "Improper no error" + END-COMPUTE + DISPLAY "FIX4DISPLAY is " FIX4DISPLAY + DISPLAY "Should be 9876" + DISPLAY "." + + *> FLOATSHORT + + DISPLAY "COMPUTE FIX4DISPLAY = FLOATSHORT without SIZE ERROR" + COMPUTE FIX4DISPLAY = FLOATSHORT + DISPLAY "FIX4DISPLAY is " FIX4DISPLAY + DISPLAY "Should be 5678" + DISPLAY "." + + DISPLAY "COMPUTE FIX4DISPLAY = FLOATSHORT with SIZE ERROR" + COMPUTE FIX4DISPLAY = FLOATSHORT + MOVE 9876 TO FIX4DISPLAY + COMPUTE FIX4DISPLAY = FLOATSHORT + ON SIZE ERROR Display "Proper size error" + NOT ON SIZE ERROR Display "Improper no error" + END-COMPUTE + DISPLAY "FIX4DISPLAY is " FIX4DISPLAY + DISPLAY "Should be 9876" + DISPLAY "." + + *> FLOATLONG + + DISPLAY "COMPUTE FIX4DISPLAY = FLOATLONG without SIZE ERROR" + COMPUTE FIX4DISPLAY = FLOATLONG + DISPLAY "FIX4DISPLAY is " FIX4DISPLAY + DISPLAY "Should be 5678" + DISPLAY "." + + DISPLAY "COMPUTE FIX4DISPLAY = FLOATLONG with SIZE ERROR" + COMPUTE FIX4DISPLAY = FLOATLONG + MOVE 9876 TO FIX4DISPLAY + COMPUTE FIX4DISPLAY = FLOATLONG + ON SIZE ERROR Display "Proper size error" + NOT ON SIZE ERROR Display "Improper no error" + END-COMPUTE + DISPLAY "FIX4DISPLAY is " FIX4DISPLAY + DISPLAY "Should be 9876" + DISPLAY "." + + *> FLOATEXT + + DISPLAY "COMPUTE FIX4DISPLAY = FLOATEXT without SIZE ERROR" + COMPUTE FIX4DISPLAY = FLOATEXT + DISPLAY "FIX4DISPLAY is " FIX4DISPLAY + DISPLAY "Should be 5678" + DISPLAY "." + + DISPLAY "COMPUTE FIX4DISPLAY = FLOATEXT with SIZE ERROR" + COMPUTE FIX4DISPLAY = FLOATEXT + MOVE 9876 TO FIX4DISPLAY + COMPUTE FIX4DISPLAY = FLOATEXT + ON SIZE ERROR Display "Proper size error" + NOT ON SIZE ERROR Display "Improper no error" + END-COMPUTE + DISPLAY "FIX4DISPLAY is " FIX4DISPLAY + DISPLAY "Should be 9876" + DISPLAY ".". + + STOP RUN. + END PROGRAM onsize. + diff --git a/gcc/testsuite/cobol.dg/group2/COMPUTE_multiplication_to_FIX4.out b/gcc/testsuite/cobol.dg/group2/COMPUTE_multiplication_to_FIX4.out new file mode 100644 index 0000000..8970a6c --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/COMPUTE_multiplication_to_FIX4.out @@ -0,0 +1,64 @@ +COMPUTE FIX4DISPLAY = FIX8DISPLAY without SIZE ERROR +FIX4DISPLAY is 5678 +Should be 5678 +. +COMPUTE FIX4DISPLAY = FIX8DISPLAY with SIZE ERROR +Proper size error +FIX4DISPLAY is 9876 +Should be 9876 +. +COMPUTE FIX4DISPLAY = FIX8BINARY without SIZE ERROR +FIX4DISPLAY is 5678 +Should be 5678 +. +COMPUTE FIX4DISPLAY = FIX8BINARY with SIZE ERROR +Proper size error +FIX4DISPLAY is 9876 +Should be 9876 +. +COMPUTE FIX4DISPLAY = FIX8PACKED without SIZE ERROR +FIX4DISPLAY is 5678 +Should be 5678 +. +COMPUTE FIX4DISPLAY = FIX8PACKED with SIZE ERROR +Proper size error +FIX4DISPLAY is 9876 +Should be 9876 +. +COMPUTE FIX4DISPLAY = FIX8NUMEDT without SIZE ERROR +FIX4DISPLAY is 5678 +Should be 5678 +. +COMPUTE FIX4DISPLAY = FIX8NUMEDT with SIZE ERROR +Proper size error +FIX4DISPLAY is 9876 +Should be 9876 +. +COMPUTE FIX4DISPLAY = FLOATSHORT without SIZE ERROR +FIX4DISPLAY is 5678 +Should be 5678 +. +COMPUTE FIX4DISPLAY = FLOATSHORT with SIZE ERROR +Proper size error +FIX4DISPLAY is 9876 +Should be 9876 +. +COMPUTE FIX4DISPLAY = FLOATLONG without SIZE ERROR +FIX4DISPLAY is 5678 +Should be 5678 +. +COMPUTE FIX4DISPLAY = FLOATLONG with SIZE ERROR +Proper size error +FIX4DISPLAY is 9876 +Should be 9876 +. +COMPUTE FIX4DISPLAY = FLOATEXT without SIZE ERROR +FIX4DISPLAY is 5678 +Should be 5678 +. +COMPUTE FIX4DISPLAY = FLOATEXT with SIZE ERROR +Proper size error +FIX4DISPLAY is 9876 +Should be 9876 +. + diff --git a/gcc/testsuite/cobol.dg/group2/Complex_EVALUATE__1_.cob b/gcc/testsuite/cobol.dg/group2/Complex_EVALUATE__1_.cob new file mode 100644 index 0000000..a070d16 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/Complex_EVALUATE__1_.cob @@ -0,0 +1,46 @@ + *> { dg-do run } + *> { dg-output-file "group2/Complex_EVALUATE__1_.out" } + + identification division. + function-id. bumper. + data division. + working-storage section. + 77 bump pic 9999 value zero. + linkage section. + 77 bumped pic 9999. + procedure division returning bumped. + add 1 to bump. + move bump to bumped. + goback. + end function bumper. + + identification division. + program-id. prog. + environment division. + configuration section. + repository. + function bumper. + data division. + working-storage section. + 77 bump pic 9999 value zero. + 77 bump1 pic 9999 value zero. + 77 bump2 pic 9999 value zero. + 77 bump3 pic 9999 value zero. + procedure division. + move function bumper to bump + display bump + move function bumper to bump + display bump + move function bumper to bump + display bump + evaluate function bumper also function bumper also function bumper + when 4 also 5 also 6 + display "properly 4 also 5 also 6" + when 7 also 8 also 9 + display "IMPROPERLY 6 then 7 then 8" + when other + display "we don't know what's going on" + end-evaluate + goback. + end program prog. + diff --git a/gcc/testsuite/cobol.dg/group2/Complex_EVALUATE__1_.out b/gcc/testsuite/cobol.dg/group2/Complex_EVALUATE__1_.out new file mode 100644 index 0000000..d634a79 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/Complex_EVALUATE__1_.out @@ -0,0 +1,5 @@ +0001 +0002 +0003 +properly 4 also 5 also 6 + diff --git a/gcc/testsuite/cobol.dg/group2/Complex_EVALUATE__2_.cob b/gcc/testsuite/cobol.dg/group2/Complex_EVALUATE__2_.cob new file mode 100644 index 0000000..0e88d74 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/Complex_EVALUATE__2_.cob @@ -0,0 +1,52 @@ + *> { dg-do run } + *> { dg-output-file "group2/Complex_EVALUATE__2_.out" } + + identification division. + function-id. bumper. + data division. + working-storage section. + 77 bump pic 9999 value zero. + linkage section. + 77 bumped pic 9999. + procedure division returning bumped. + add 1 to bump. + move bump to bumped. + display " bumper is returning " bumped + goback. + end function bumper. + + identification division. + program-id. prog. + environment division. + configuration section. + repository. + function bumper. + data division. + working-storage section. + 77 bump pic 9999 value zero. + procedure division. + display " Prime the pump with three calls to bumper" + move function bumper to bump + move function bumper to bump + move function bumper to bump + display " Three calls to BUMPER should follow" + evaluate function bumper also function bumper also function bumper + when 4 also 5 also 6 + display "properly 4 also 5 also 6" + when 7 also 8 also 9 + display "IMPROPERLY 7 also 8 also 9" + when other + display "IMPROPERLY we don't know what's going on" + end-evaluate + display " Three more calls to BUMPER should follow" + evaluate function bumper also function bumper also function bumper + when 4 also 5 also 6 + display "IMPROPERLY 4 also 5 also 6" + when 7 also 8 also 9 + display "properly 7 also 8 also 9" + when other + display "IMPROPERLY we don't know what's going on" + end-evaluate + goback. + end program prog. + diff --git a/gcc/testsuite/cobol.dg/group2/Complex_EVALUATE__2_.out b/gcc/testsuite/cobol.dg/group2/Complex_EVALUATE__2_.out new file mode 100644 index 0000000..b0e9bdb --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/Complex_EVALUATE__2_.out @@ -0,0 +1,15 @@ + Prime the pump with three calls to bumper + bumper is returning 0001 + bumper is returning 0002 + bumper is returning 0003 + Three calls to BUMPER should follow + bumper is returning 0004 + bumper is returning 0005 + bumper is returning 0006 +properly 4 also 5 also 6 + Three more calls to BUMPER should follow + bumper is returning 0007 + bumper is returning 0008 + bumper is returning 0009 +properly 7 also 8 also 9 + diff --git a/gcc/testsuite/cobol.dg/group2/DISPLAY__Sign_ASCII.cob b/gcc/testsuite/cobol.dg/group2/DISPLAY__Sign_ASCII.cob new file mode 100644 index 0000000..6225c20 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/DISPLAY__Sign_ASCII.cob @@ -0,0 +1,40 @@ + *> { dg-do run } + *> { dg-output-file "group2/DISPLAY__Sign_ASCII.out" } + + IDENTIFICATION DIVISION. + PROGRAM-ID. prog. + DATA DIVISION. + WORKING-STORAGE SECTION. + 01 G. + 02 X PIC X(5). + 02 X-9 REDEFINES X PIC 9(4). + 02 X-S9 REDEFINES X PIC S9(4). + 02 X-S9-L REDEFINES X PIC S9(4) LEADING. + 02 X-S9-LS REDEFINES X PIC S9(4) LEADING SEPARATE. + 02 X-S9-T REDEFINES X PIC S9(4) TRAILING. + 02 X-S9-TS REDEFINES X PIC S9(4) TRAILING SEPARATE. + PROCEDURE DIVISION. + MOVE ZERO TO X. MOVE 1234 TO X-9. DISPLAY X + END-DISPLAY. + MOVE ZERO TO X. MOVE 1234 TO X-S9. DISPLAY X + END-DISPLAY. + MOVE ZERO TO X. MOVE -1234 TO X-S9. DISPLAY X + END-DISPLAY. + MOVE ZERO TO X. MOVE 1234 TO X-S9-L. DISPLAY X + END-DISPLAY. + MOVE ZERO TO X. MOVE -1234 TO X-S9-L. DISPLAY X + END-DISPLAY. + MOVE ZERO TO X. MOVE 1234 TO X-S9-LS. DISPLAY X + END-DISPLAY. + MOVE ZERO TO X. MOVE -1234 TO X-S9-LS. DISPLAY X + END-DISPLAY. + MOVE ZERO TO X. MOVE 1234 TO X-S9-T. DISPLAY X + END-DISPLAY. + MOVE ZERO TO X. MOVE -1234 TO X-S9-T. DISPLAY X + END-DISPLAY. + MOVE ZERO TO X. MOVE 1234 TO X-S9-TS. DISPLAY X + END-DISPLAY. + MOVE ZERO TO X. MOVE -1234 TO X-S9-TS. DISPLAY X + END-DISPLAY. + STOP RUN. + diff --git a/gcc/testsuite/cobol.dg/group2/DISPLAY__Sign_ASCII.out b/gcc/testsuite/cobol.dg/group2/DISPLAY__Sign_ASCII.out new file mode 100644 index 0000000..bda63c7 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/DISPLAY__Sign_ASCII.out @@ -0,0 +1,12 @@ +12340 +12340 +123t0 +12340 +q2340 ++1234 +-1234 +12340 +123t0 +1234+ +1234- + diff --git a/gcc/testsuite/cobol.dg/group2/DISPLAY__Sign_ASCII__2_.cob b/gcc/testsuite/cobol.dg/group2/DISPLAY__Sign_ASCII__2_.cob new file mode 100644 index 0000000..585e60c --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/DISPLAY__Sign_ASCII__2_.cob @@ -0,0 +1,38 @@ + *> { dg-do run } + *> { dg-output-file "group2/DISPLAY__Sign_ASCII__2_.out" } + + IDENTIFICATION DIVISION. + PROGRAM-ID. prog. + DATA DIVISION. + WORKING-STORAGE SECTION. + 01 G. + 02 X PIC X(10). + 02 X-S99 REDEFINES X PIC S99. + 02 X-S9 REDEFINES X PIC S9 OCCURS 10. + PROCEDURE DIVISION. + MOVE 0 TO X-S9(1). + MOVE 1 TO X-S9(2). + MOVE 2 TO X-S9(3). + MOVE 3 TO X-S9(4). + MOVE 4 TO X-S9(5). + MOVE 5 TO X-S9(6). + MOVE 6 TO X-S9(7). + MOVE 7 TO X-S9(8). + MOVE 8 TO X-S9(9). + MOVE 9 TO X-S9(10). + DISPLAY X NO ADVANCING + END-DISPLAY. + MOVE -10 TO X-S99. MOVE X(2:1) TO X(1:1). + MOVE -1 TO X-S9(2). + MOVE -2 TO X-S9(3). + MOVE -3 TO X-S9(4). + MOVE -4 TO X-S9(5). + MOVE -5 TO X-S9(6). + MOVE -6 TO X-S9(7). + MOVE -7 TO X-S9(8). + MOVE -8 TO X-S9(9). + MOVE -9 TO X-S9(10). + DISPLAY X NO ADVANCING + END-DISPLAY. + STOP RUN. + diff --git a/gcc/testsuite/cobol.dg/group2/DISPLAY__Sign_ASCII__2_.out b/gcc/testsuite/cobol.dg/group2/DISPLAY__Sign_ASCII__2_.out new file mode 100644 index 0000000..6717b6e --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/DISPLAY__Sign_ASCII__2_.out @@ -0,0 +1 @@ +0123456789pqrstuvwxy diff --git a/gcc/testsuite/cobol.dg/group2/EVALUATE_WHEN_NEGATIVE.cob b/gcc/testsuite/cobol.dg/group2/EVALUATE_WHEN_NEGATIVE.cob new file mode 100644 index 0000000..798f18b --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/EVALUATE_WHEN_NEGATIVE.cob @@ -0,0 +1,16 @@ + *> { dg-do run } + *> { dg-output-file "group2/EVALUATE_WHEN_NEGATIVE.out" } + + identification division. + program-id. prog. + data division. + working-storage section. + 77 num pic s9. + procedure division. + move -1 to num + evaluate num + when negative + display "negative" + end-evaluate. + end program prog. + diff --git a/gcc/testsuite/cobol.dg/group2/EVALUATE_WHEN_NEGATIVE.out b/gcc/testsuite/cobol.dg/group2/EVALUATE_WHEN_NEGATIVE.out new file mode 100644 index 0000000..126adb7 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/EVALUATE_WHEN_NEGATIVE.out @@ -0,0 +1,2 @@ +negative + diff --git a/gcc/testsuite/cobol.dg/group2/EVALUATE_condition__2_.cob b/gcc/testsuite/cobol.dg/group2/EVALUATE_condition__2_.cob new file mode 100644 index 0000000..84bc885 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/EVALUATE_condition__2_.cob @@ -0,0 +1,38 @@ + *> { dg-do run } + *> { dg-output-file "group2/EVALUATE_condition__2_.out" } + + IDENTIFICATION DIVISION. + PROGRAM-ID. prog. + DATA DIVISION. + WORKING-STORAGE SECTION. + 01 XVAL PIC X VALUE '_'. + 88 UNDERSCORE VALUE '_'. + PROCEDURE DIVISION. + DISPLAY 'Next line should be "UNDERSCORE evaluates to TRUE"' + EVALUATE TRUE + WHEN NOT UNDERSCORE + DISPLAY + "***IMPROPERLY*** NOT UNDERSCORE evaluates to TRUE" + END-DISPLAY + END-EVALUATE. + EVALUATE TRUE + WHEN UNDERSCORE + DISPLAY "UNDERSCORE evaluates to TRUE" + END-DISPLAY + END-EVALUATE. + + DISPLAY + 'Next line should be "NOT UNDERSCORE evaluates to FALSE"' + EVALUATE FALSE + WHEN NOT UNDERSCORE + DISPLAY "NOT UNDERSCORE evaluates to FALSE" + END-DISPLAY + END-EVALUATE. + EVALUATE FALSE + WHEN UNDERSCORE + DISPLAY + "***IMPROPERLY*** UNDERSCORE evaluates to FALSE" + END-DISPLAY + END-EVALUATE. + STOP RUN. + diff --git a/gcc/testsuite/cobol.dg/group2/EVALUATE_condition__2_.out b/gcc/testsuite/cobol.dg/group2/EVALUATE_condition__2_.out new file mode 100644 index 0000000..adff5ca --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/EVALUATE_condition__2_.out @@ -0,0 +1,5 @@ +Next line should be "UNDERSCORE evaluates to TRUE" +UNDERSCORE evaluates to TRUE +Next line should be "NOT UNDERSCORE evaluates to FALSE" +NOT UNDERSCORE evaluates to FALSE + diff --git a/gcc/testsuite/cobol.dg/group2/EVALUATE_doubled_WHEN.cob b/gcc/testsuite/cobol.dg/group2/EVALUATE_doubled_WHEN.cob new file mode 100644 index 0000000..50ff958 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/EVALUATE_doubled_WHEN.cob @@ -0,0 +1,30 @@ + *> { dg-do run } + *> { dg-output-file "group2/EVALUATE_doubled_WHEN.out" } + + identification division. + program-id. prog. + data division. + working-storage section. + 77 eval pic x(4). + procedure division. + move "open" to eval + display "about to EVALUATE eval " """" eval """" + evaluate true + when eval = 'open' + when eval = 'OPEN' + display "Good: We got us an " """" eval """" + when other + display "BAD!!! It shoulda been " """" eval """" + end-evaluate + move "OPEN" to eval + display "about to EVALUATE eval " """" eval """" + evaluate true + when eval = 'open' + when eval = 'OPEN' + display "Good: We got us an " """" eval """" + when other + display "BAD!!! It shoulda been " """" eval """" + end-evaluate + goback. + end program prog. + diff --git a/gcc/testsuite/cobol.dg/group2/EVALUATE_doubled_WHEN.out b/gcc/testsuite/cobol.dg/group2/EVALUATE_doubled_WHEN.out new file mode 100644 index 0000000..c4fa148 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/EVALUATE_doubled_WHEN.out @@ -0,0 +1,5 @@ +about to EVALUATE eval "open" +Good: We got us an "open" +about to EVALUATE eval "OPEN" +Good: We got us an "OPEN" + diff --git a/gcc/testsuite/cobol.dg/group2/EVALUATE_with_WHEN_using_condition-1.cob b/gcc/testsuite/cobol.dg/group2/EVALUATE_with_WHEN_using_condition-1.cob new file mode 100644 index 0000000..ed4c89a --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/EVALUATE_with_WHEN_using_condition-1.cob @@ -0,0 +1,18 @@ + *> { dg-do run } + *> { dg-output-file "group2/EVALUATE_with_WHEN_using_condition-1.out" } + + IDENTIFICATION DIVISION. + PROGRAM-ID. prog. + DATA DIVISION. + WORKING-STORAGE SECTION. + 77 var-1 PIC 99V9. + 88 var-1-big VALUE 20 THRU 40. + 88 var-1-huge VALUE 40 THRU 99. + PROCEDURE DIVISION. + EVALUATE TRUE *> not: var-1 + WHEN var-1-big DISPLAY "big" + WHEN var-1-huge DISPLAY "huge" + WHEN OTHER DISPLAY "not" + END-EVALUATE. + END PROGRAM prog. + diff --git a/gcc/testsuite/cobol.dg/group2/EVALUATE_with_WHEN_using_condition-1.out b/gcc/testsuite/cobol.dg/group2/EVALUATE_with_WHEN_using_condition-1.out new file mode 100644 index 0000000..3043bcc --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/EVALUATE_with_WHEN_using_condition-1.out @@ -0,0 +1,2 @@ +not + diff --git a/gcc/testsuite/cobol.dg/group2/Floating_continuation_indicator__1_.cob b/gcc/testsuite/cobol.dg/group2/Floating_continuation_indicator__1_.cob new file mode 100644 index 0000000..53211b2 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/Floating_continuation_indicator__1_.cob @@ -0,0 +1,21 @@ + *> { dg-do run } + *> { dg-options "-ffixed-form" } + *> { dg-output-file "group2/Floating_continuation_indicator__1_.out" } + IDENTIFICATION DIVISION. + * testing floating continuation literals ("'-" and '"-') + PROGRAM-ID. FF2. + PROCEDURE DIVISION. + DISPLAY "hello "- + "world.". + DISPLAY 'hello '- + 'world.'. + DISPLAY "hello "- + * non-interrupting comment + "world.". + DISPLAY 'hello '- + *> non-interrupting comment + + 'world.'. + EXIT PROGRAM. + + diff --git a/gcc/testsuite/cobol.dg/group2/Floating_continuation_indicator__1_.out b/gcc/testsuite/cobol.dg/group2/Floating_continuation_indicator__1_.out new file mode 100644 index 0000000..fe031c3 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/Floating_continuation_indicator__1_.out @@ -0,0 +1,5 @@ +hello world. +hello world. +hello world. +hello world. + diff --git a/gcc/testsuite/cobol.dg/group2/IBM_dialect_COMP_redefined_by_POINTER_as_64-bit.cob b/gcc/testsuite/cobol.dg/group2/IBM_dialect_COMP_redefined_by_POINTER_as_64-bit.cob new file mode 100644 index 0000000..071b88a --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/IBM_dialect_COMP_redefined_by_POINTER_as_64-bit.cob @@ -0,0 +1,34 @@ + *> { dg-do run } + *> { dg-options "-dialect ibm" } + *> { dg-output-file "group2/IBM_dialect_COMP_redefined_by_POINTER_as_64-bit.out" } + + identification division. + program-id. prog. + data division. + working-storage section. + *> This is a test of the "-dialect ibm" special interpretation of a common + *> construction in IBM mainframe code. That machine is a 32-bit + *> big-endian architecture. We are assuming a 64-bit little-endian + *> x86_64 architecture. So, the COMP PIC S8(8) would usually be an 32-bit + *> big-endian value. But "-dialect ibm" means that the following + *> REDEFINES USAGE POINTER causes the prior "COMP" to actually be defined + *> as a 64-bit little-endian binary value. + 77 pointer-value COMP PIC S9(8) VALUE ZERO. + 77 point-at REDEFINES pointer-value USAGE POINTER. + procedure division. + *> The following value is 0x123456789 + move 4886718345 to pointer-value + display point-at " should be 0x0000000123456789" + set point-at down by 4886718345 + display point-at " should be 0x0000000000000000" + set point-at down by 4886718345 + display point-at " should be 0xfffffffedcba9877" + set point-at up by 4886718345 + display point-at " should be 0x0000000000000000" + subtract 1 from pointer-value + display point-at " should be 0xffffffffffffffff" + add 1 to pointer-value + display point-at " should be 0x0000000000000000" + goback. + end program prog. + diff --git a/gcc/testsuite/cobol.dg/group2/IBM_dialect_COMP_redefined_by_POINTER_as_64-bit.out b/gcc/testsuite/cobol.dg/group2/IBM_dialect_COMP_redefined_by_POINTER_as_64-bit.out new file mode 100644 index 0000000..cd7fa5b --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/IBM_dialect_COMP_redefined_by_POINTER_as_64-bit.out @@ -0,0 +1,7 @@ +0x0000000123456789 should be 0x0000000123456789 +0x0000000000000000 should be 0x0000000000000000 +0xfffffffedcba9877 should be 0xfffffffedcba9877 +0x0000000000000000 should be 0x0000000000000000 +0xffffffffffffffff should be 0xffffffffffffffff +0x0000000000000000 should be 0x0000000000000000 + diff --git a/gcc/testsuite/cobol.dg/group2/Indicators_______________-____D__.cob b/gcc/testsuite/cobol.dg/group2/Indicators_______________-____D__.cob new file mode 100644 index 0000000..fe988ee --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/Indicators_______________-____D__.cob @@ -0,0 +1,26 @@ + *> { dg-do run } + *> { dg-options "-ffixed-form" } + *> { dg-output-file "group2/Indicators_______________-____D__.out" } + + IDENTIFICATION DIVISION. + PROGRAM-ID. FF2. + *Asterisk in correct column + / + PROCEDURE DIVISION. + DISPLAY "gekk + -"os rule". + DISPLAY "gerb + * ISO says blank and comment lines do not interfere with + * literal continuation + + -"ils don't rule". + * "D" is a deprecated feature of COBOL dropped from + * the ISO-IEC standard. Lines with "D" in the indicator + * column were enabled when OBJECT COMPUTER contained + * "WITH DEBUG MODE". Otherwise they were treated as + * comments. This behavior is a "vendor extension" to + * the current standard but allows old code to be used + * as it was prior to the deprecation. + D DISPLAY 'Should not display'. + EXIT PROGRAM. + diff --git a/gcc/testsuite/cobol.dg/group2/Indicators_______________-____D__.out b/gcc/testsuite/cobol.dg/group2/Indicators_______________-____D__.out new file mode 100644 index 0000000..8ad4d0a --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/Indicators_______________-____D__.out @@ -0,0 +1,3 @@ +gekkos rule +gerbils don't rule + diff --git a/gcc/testsuite/cobol.dg/group2/MULTIPLY_to_FIX4.cob b/gcc/testsuite/cobol.dg/group2/MULTIPLY_to_FIX4.cob new file mode 100644 index 0000000..1f9b8dc --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/MULTIPLY_to_FIX4.cob @@ -0,0 +1,101 @@ + *> { dg-do run } + *> { dg-output-file "group2/MULTIPLY_to_FIX4.out" } + + IDENTIFICATION DIVISION. + PROGRAM-ID. onsize. + DATA DIVISION. + WORKING-STORAGE SECTION. + 01 FIX4DISPLAY PIC 9(4) DISPLAY. + 01 FIX4PACKED PIC 9(4) PACKED-DECIMAL. + 01 FIX4BINARY PIC 9(4) BINARY. + 01 FIX4COMP5 PIC 9(4) COMP-5. + 01 FLTSHORT FLOAT-SHORT. + 01 FLTLONG FLOAT-LONG. + 01 FLTEXT FLOAT-EXTENDED. + + PROCEDURE DIVISION. + + DISPLAY "Checking size error on FIX4DISPLAY" + MOVE 1 TO FIX4DISPLAY + PERFORM 10 TIMEs + DISPLAY " FIX4DISPLAY is : " FIX4DISPLAY + MULTIPLY 10 BY FIX4DISPLAY + ON SIZE ERROR DISPLAY " Got size error" GO TO DONE1 + END-MULTIPLY + END-PERFORM. + DONE1. + DISPLAY " Final is : " FIX4DISPLAY + DISPLAY "." + + DISPLAY "Checking size error on FIX4PACKED" + MOVE 1 TO FIX4PACKED + PERFORM 10 TIMEs + DISPLAY " FIX4PACKED is : " FIX4PACKED + MULTIPLY 10 BY FIX4PACKED + ON SIZE ERROR DISPLAY " Got size error" GO TO DONE2 + END-MULTIPLY + END-PERFORM. + DONE2. + DISPLAY " Final is : " FIX4PACKED + DISPLAY "." + + DISPLAY "Checking size error on FIX4BINARY" + MOVE 1 TO FIX4BINARY + PERFORM 10 TIMEs + DISPLAY " FIX4BINARY is : " FIX4BINARY + MULTIPLY 10 BY FIX4BINARY + ON SIZE ERROR DISPLAY " Got size error" GO TO DONE3 + END-MULTIPLY + END-PERFORM. + DONE3. + DISPLAY " Final is : " FIX4BINARY + DISPLAY "." + + DISPLAY "Checking size error on FIX4COMP5" + MOVE 1 TO FIX4COMP5 + PERFORM 10 TIMEs + DISPLAY " FIX4COMP5 is : " FIX4COMP5 + MULTIPLY 10 BY FIX4COMP5 + ON SIZE ERROR DISPLAY " Got size error" GO TO DONE4 + END-MULTIPLY + END-PERFORM. + DONE4. + DISPLAY " Final is : " FIX4COMP5 + DISPLAY "." + + DISPLAY "Checking size error on FLTSHORT" + MOVE 1.E34 TO FLTSHORT + PERFORM 10 TIMEs + DISPLAY " FLTSHORT is : " FLTSHORT + MULTIPLY 10 BY FLTSHORT + ON SIZE ERROR DISPLAY " Got size error" GO TO DONE5 + END-MULTIPLY + END-PERFORM. + DONE5. + DISPLAY " Final is : " FLTSHORT + DISPLAY "." + + MOVE 1.E304 TO FLTLONG + PERFORM 1000 TIMEs + DISPLAY " FLTLONG is : " FLTLONG + MULTIPLY 10 BY FLTLONG + ON SIZE ERROR DISPLAY " Got size error" GO TO DONE6 + END-MULTIPLY + END-PERFORM. + DONE6. + DISPLAY " Final is : " FLTLONG + DISPLAY "." + + MOVE 1.E4928 TO FLTEXT + PERFORM 10 TIMEs + DISPLAY " FLTEXT is : " FLTEXT + MULTIPLY 10 BY FLTEXT + ON SIZE ERROR DISPLAY " Got size error" GO TO DONE7 + END-MULTIPLY + END-PERFORM. + DONE7. + DISPLAY " Final is : " FLTEXT + DISPLAY ".". + + END PROGRAM onsize. + diff --git a/gcc/testsuite/cobol.dg/group2/MULTIPLY_to_FIX4.out b/gcc/testsuite/cobol.dg/group2/MULTIPLY_to_FIX4.out new file mode 100644 index 0000000..90cf292 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/MULTIPLY_to_FIX4.out @@ -0,0 +1,58 @@ +Checking size error on FIX4DISPLAY + FIX4DISPLAY is : 0001 + FIX4DISPLAY is : 0010 + FIX4DISPLAY is : 0100 + FIX4DISPLAY is : 1000 + Got size error + Final is : 1000 +. +Checking size error on FIX4PACKED + FIX4PACKED is : 0001 + FIX4PACKED is : 0010 + FIX4PACKED is : 0100 + FIX4PACKED is : 1000 + Got size error + Final is : 1000 +. +Checking size error on FIX4BINARY + FIX4BINARY is : 0001 + FIX4BINARY is : 0010 + FIX4BINARY is : 0100 + FIX4BINARY is : 1000 + Got size error + Final is : 1000 +. +Checking size error on FIX4COMP5 + FIX4COMP5 is : 0001 + FIX4COMP5 is : 0010 + FIX4COMP5 is : 0100 + FIX4COMP5 is : 1000 + Got size error + Final is : 1000 +. +Checking size error on FLTSHORT + FLTSHORT is : 9.99999979E+33 + FLTSHORT is : 9.999999419E+34 + FLTSHORT is : 9.999999617E+35 + FLTSHORT is : 9.999999934E+36 + FLTSHORT is : 9.99999968E+37 + Got size error + Final is : 9.99999968E+37 +. + FLTLONG is : 9.99999999999999939E+303 + FLTLONG is : 9.99999999999999939E+304 + FLTLONG is : 9.99999999999999861E+305 + FLTLONG is : 9.99999999999999861E+306 + FLTLONG is : 9.99999999999999811E+307 + Got size error + Final is : 9.99999999999999811E+307 +. + FLTEXT is : 9.999999999999999999999999999999999576E+4927 + FLTEXT is : 9.999999999999999999999999999999999856E+4928 + FLTEXT is : 1.000000000000000000000000000000000053E+4930 + FLTEXT is : 1.000000000000000000000000000000000124E+4931 + FLTEXT is : 1.000000000000000000000000000000000124E+4932 + Got size error + Final is : 1.000000000000000000000000000000000124E+4932 +. + diff --git a/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_arithmetic.cob b/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_arithmetic.cob new file mode 100644 index 0000000..09303a2 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_arithmetic.cob @@ -0,0 +1,24 @@ + *> { dg-do run } + *> { dg-output-file "group2/PACKED-DECIMAL_arithmetic.out" } + + IDENTIFICATION DIVISION. + PROGRAM-ID. prog. + DATA DIVISION. + WORKING-STORAGE SECTION. + 01 X PIC 99 USAGE PACKED-DECIMAL VALUE 0. + 01 Y PIC 99 USAGE PACKED-DECIMAL VALUE 9. + PROCEDURE DIVISION. + COMPUTE X = 1 + END-COMPUTE. + DISPLAY X + END-DISPLAY. + COMPUTE X = Y + END-COMPUTE. + DISPLAY X + END-DISPLAY. + COMPUTE X = X + Y + END-COMPUTE. + DISPLAY X + END-DISPLAY. + STOP RUN. + diff --git a/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_arithmetic.out b/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_arithmetic.out new file mode 100644 index 0000000..79f7d9d --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_arithmetic.out @@ -0,0 +1,4 @@ +01 +09 +18 + diff --git a/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_basic_comp-3_comp-6__1_.cob b/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_basic_comp-3_comp-6__1_.cob new file mode 100644 index 0000000..f718cf4 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_basic_comp-3_comp-6__1_.cob @@ -0,0 +1,52 @@ + *> { dg-do run } + *> { dg-options "-dialect mf" } + *> { dg-output-file "group2/PACKED-DECIMAL_basic_comp-3_comp-6__1_.out" } + + IDENTIFICATION DIVISION. + PROGRAM-ID. prog. + DATA DIVISION. + WORKING-STORAGE SECTION. + 01 x1 PIC 9 COMP-3. + 01 x2 PIC 99 COMP-3. + 01 x3 PIC 999 COMP-3. + 01 x4 PIC 9999 COMP-3. + 01 x5 PIC 99999 COMP-3. + 01 x6 PIC 999999 COMP-3. + 01 y1 PIC 9 COMP-6. + 01 y2 PIC 99 COMP-6. + 01 y3 PIC 999 COMP-6. + 01 y4 PIC 9999 COMP-6. + 01 y5 PIC 99999 COMP-6. + 01 y6 PIC 999999 COMP-6. + procedure division. + display "check lengths of comp-3" + display FUNCTION LENGTH(x1) " should be 1" + display FUNCTION LENGTH(x2) " should be 2" + display FUNCTION LENGTH(x3) " should be 2" + display FUNCTION LENGTH(x4) " should be 3" + display FUNCTION LENGTH(x5) " should be 3" + display FUNCTION LENGTH(x6) " should be 4" + display "check lengths of comp-6" + display FUNCTION LENGTH(y1) " should be 1" + display FUNCTION LENGTH(y2) " should be 1" + display FUNCTION LENGTH(y3) " should be 2" + display FUNCTION LENGTH(y4) " should be 2" + display FUNCTION LENGTH(y5) " should be 3" + display FUNCTION LENGTH(y6) " should be 3" + move 654321 to x1 x2 x3 x4 x5 x6 y1 y2 y3 y4 y5 y6 + display "results of MOVE TO COMP-3" + display x1 + display x2 + display x3 + display x4 + display x5 + display x6 + display "results of MOVE TO COMP-6" + display y1 + display y2 + display y3 + display y4 + display y5 + display y6 + goback. + diff --git a/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_basic_comp-3_comp-6__1_.out b/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_basic_comp-3_comp-6__1_.out new file mode 100644 index 0000000..ae8169d --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_basic_comp-3_comp-6__1_.out @@ -0,0 +1,29 @@ +check lengths of comp-3 +1 should be 1 +2 should be 2 +2 should be 2 +3 should be 3 +3 should be 3 +4 should be 4 +check lengths of comp-6 +1 should be 1 +1 should be 1 +2 should be 2 +2 should be 2 +3 should be 3 +3 should be 3 +results of MOVE TO COMP-3 +1 +21 +321 +4321 +54321 +654321 +results of MOVE TO COMP-6 +1 +21 +321 +4321 +54321 +654321 + diff --git a/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_basic_comp-3_comp-6__2_.cob b/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_basic_comp-3_comp-6__2_.cob new file mode 100644 index 0000000..52a4e0a --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_basic_comp-3_comp-6__2_.cob @@ -0,0 +1,41 @@ + *> { dg-do run } + *> { dg-options "-dialect mf" } + *> { dg-output-file "group2/PACKED-DECIMAL_basic_comp-3_comp-6__2_.out" } + + identification division. + program-id. prog. + data division. + working-storage section. + 01 vars. + 05 var1d . + 10 var01 pic 99v99 comp-3 value 43.21 . + 10 filler binary-double value zero . + 05 var1 redefines var1d pointer . + 05 var2d . + 10 var02 pic s99v99 comp-3 value 43.21 . + 10 filler binary-double value zero . + 05 var2 redefines var2d pointer . + 05 var3d . + 10 var03 pic s99v99 comp-3 value -43.21 . + 10 filler binary-double value zero . + 05 var3 redefines var3d pointer . + 05 var4d . + 10 var04 pic 99v99 comp-6 value 43.21 . + 10 filler binary-double value zero . + 05 var4 redefines var4d pointer . + procedure division. + display length of var01 space var1 space space var01 + display length of var02 space var2 space var02 + display length of var03 space var3 space var03 + display length of var04 space var4 space space var04 + move 12.34 to var01 + move 12.34 to var02 + move 12.34 to var03 + move 12.34 to var04 + display function length(var01) space var1 space space var01 + display function length(var02) space var2 space var02 + display function length(var03) space var3 space var03 + display function length(var04) space var4 space space var04 + goback. + end program prog. + diff --git a/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_basic_comp-3_comp-6__2_.out b/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_basic_comp-3_comp-6__2_.out new file mode 100644 index 0000000..6acdee4 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_basic_comp-3_comp-6__2_.out @@ -0,0 +1,9 @@ +3 0x00000000001f3204 43.21 +3 0x00000000001c3204 +43.21 +3 0x00000000001d3204 -43.21 +2 0x0000000000002143 43.21 +3 0x00000000004f2301 12.34 +3 0x00000000004c2301 +12.34 +3 0x00000000004c2301 +12.34 +2 0x0000000000003412 12.34 + diff --git a/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_dump.cob b/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_dump.cob new file mode 100644 index 0000000..f4c7550 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_dump.cob @@ -0,0 +1,486 @@ + *> { dg-do run } + *> { dg-output-file "group2/PACKED-DECIMAL_dump.out" } + + IDENTIFICATION DIVISION. + PROGRAM-ID. prog. + DATA DIVISION. + WORKING-STORAGE SECTION. + 01 G-1. + 02 X-1 PIC 9(1) VALUE 1 + COMP-3. + 02 FILLER PIC X(18) VALUE SPACE. + 01 G-2. + 02 X-2 PIC 9(2) VALUE 12 + COMP-3. + 02 FILLER PIC X(18) VALUE SPACE. + 01 G-3. + 02 X-3 PIC 9(3) VALUE 123 + COMP-3. + 02 FILLER PIC X(18) VALUE SPACE. + 01 G-4. + 02 X-4 PIC 9(4) VALUE 1234 + COMP-3. + 02 FILLER PIC X(18) VALUE SPACE. + 01 G-5. + 02 X-5 PIC 9(5) VALUE 12345 + COMP-3. + 02 FILLER PIC X(18) VALUE SPACE. + 01 G-6. + 02 X-6 PIC 9(6) VALUE 123456 + COMP-3. + 02 FILLER PIC X(18) VALUE SPACE. + 01 G-7. + 02 X-7 PIC 9(7) VALUE 1234567 + COMP-3. + 02 FILLER PIC X(18) VALUE SPACE. + 01 G-8. + 02 X-8 PIC 9(8) VALUE 12345678 + COMP-3. + 02 FILLER PIC X(18) VALUE SPACE. + 01 G-9. + 02 X-9 PIC 9(9) VALUE 123456789 + COMP-3. + 02 FILLER PIC X(18) VALUE SPACE. + 01 G-10. + 02 X-10 PIC 9(10) VALUE 1234567890 + COMP-3. + 02 FILLER PIC X(18) VALUE SPACE. + 01 G-11. + 02 X-11 PIC 9(11) VALUE 12345678901 + COMP-3. + 02 FILLER PIC X(18) VALUE SPACE. + 01 G-12. + 02 X-12 PIC 9(12) VALUE 123456789012 + COMP-3. + 02 FILLER PIC X(18) VALUE SPACE. + 01 G-13. + 02 X-13 PIC 9(13) VALUE 1234567890123 + COMP-3. + 02 FILLER PIC X(18) VALUE SPACE. + 01 G-14. + 02 X-14 PIC 9(14) VALUE 12345678901234 + COMP-3. + 02 FILLER PIC X(18) VALUE SPACE. + 01 G-15. + 02 X-15 PIC 9(15) VALUE 123456789012345 + COMP-3. + 02 FILLER PIC X(18) VALUE SPACE. + 01 G-16. + 02 X-16 PIC 9(16) VALUE 1234567890123456 + COMP-3. + 02 FILLER PIC X(18) VALUE SPACE. + 01 G-17. + 02 X-17 PIC 9(17) VALUE 12345678901234567 + COMP-3. + 02 FILLER PIC X(18) VALUE SPACE. + 01 G-18. + 02 X-18 PIC 9(18) VALUE 123456789012345678 + COMP-3. + 02 FILLER PIC X(18) VALUE SPACE. + 01 G-S1. + 02 X-S1 PIC S9(1) VALUE -1 + COMP-3. + 02 FILLER PIC X(18) VALUE SPACE. + 01 G-S2. + 02 X-S2 PIC S9(2) VALUE -12 + COMP-3. + 02 FILLER PIC X(18) VALUE SPACE. + 01 G-S3. + 02 X-S3 PIC S9(3) VALUE -123 + COMP-3. + 02 FILLER PIC X(18) VALUE SPACE. + 01 G-S4. + 02 X-S4 PIC S9(4) VALUE -1234 + COMP-3. + 02 FILLER PIC X(18) VALUE SPACE. + 01 G-S5. + 02 X-S5 PIC S9(5) VALUE -12345 + COMP-3. + 02 FILLER PIC X(18) VALUE SPACE. + 01 G-S6. + 02 X-S6 PIC S9(6) VALUE -123456 + COMP-3. + 02 FILLER PIC X(18) VALUE SPACE. + 01 G-S7. + 02 X-S7 PIC S9(7) VALUE -1234567 + COMP-3. + 02 FILLER PIC X(18) VALUE SPACE. + 01 G-S8. + 02 X-S8 PIC S9(8) VALUE -12345678 + COMP-3. + 02 FILLER PIC X(18) VALUE SPACE. + 01 G-S9. + 02 X-S9 PIC S9(9) VALUE -123456789 + COMP-3. + 02 FILLER PIC X(18) VALUE SPACE. + 01 G-S10. + 02 X-S10 PIC S9(10) VALUE -1234567890 + COMP-3. + 02 FILLER PIC X(18) VALUE SPACE. + 01 G-S11. + 02 X-S11 PIC S9(11) VALUE -12345678901 + COMP-3. + 02 FILLER PIC X(18) VALUE SPACE. + 01 G-S12. + 02 X-S12 PIC S9(12) VALUE -123456789012 + COMP-3. + 02 FILLER PIC X(18) VALUE SPACE. + 01 G-S13. + 02 X-S13 PIC S9(13) VALUE -1234567890123 + COMP-3. + 02 FILLER PIC X(18) VALUE SPACE. + 01 G-S14. + 02 X-S14 PIC S9(14) VALUE -12345678901234 + COMP-3. + 02 FILLER PIC X(18) VALUE SPACE. + 01 G-S15. + 02 X-S15 PIC S9(15) VALUE -123456789012345 + COMP-3. + 02 FILLER PIC X(18) VALUE SPACE. + 01 G-S16. + 02 X-S16 PIC S9(16) VALUE -1234567890123456 + COMP-3. + 02 FILLER PIC X(18) VALUE SPACE. + 01 G-S17. + 02 X-S17 PIC S9(17) VALUE -12345678901234567 + COMP-3. + 02 FILLER PIC X(18) VALUE SPACE. + 01 G-S18. + 02 X-S18 PIC S9(18) VALUE -123456789012345678 + COMP-3. + 02 FILLER PIC X(18) VALUE SPACE. + PROCEDURE DIVISION. + *> Dump all values + CALL "dump" USING G-1 + END-CALL. + CALL "dump" USING G-2 + END-CALL. + CALL "dump" USING G-3 + END-CALL. + CALL "dump" USING G-4 + END-CALL. + CALL "dump" USING G-5 + END-CALL. + CALL "dump" USING G-6 + END-CALL. + CALL "dump" USING G-7 + END-CALL. + CALL "dump" USING G-8 + END-CALL. + CALL "dump" USING G-9 + END-CALL. + CALL "dump" USING G-10 + END-CALL. + CALL "dump" USING G-11 + END-CALL. + CALL "dump" USING G-12 + END-CALL. + CALL "dump" USING G-13 + END-CALL. + CALL "dump" USING G-14 + END-CALL. + CALL "dump" USING G-15 + END-CALL. + CALL "dump" USING G-16 + END-CALL. + CALL "dump" USING G-17 + END-CALL. + CALL "dump" USING G-18 + END-CALL. + CALL "dump" USING G-S1 + END-CALL. + CALL "dump" USING G-S2 + END-CALL. + CALL "dump" USING G-S3 + END-CALL. + CALL "dump" USING G-S4 + END-CALL. + CALL "dump" USING G-S5 + END-CALL. + CALL "dump" USING G-S6 + END-CALL. + CALL "dump" USING G-S7 + END-CALL. + CALL "dump" USING G-S8 + END-CALL. + CALL "dump" USING G-S9 + END-CALL. + CALL "dump" USING G-S10 + END-CALL. + CALL "dump" USING G-S11 + END-CALL. + CALL "dump" USING G-S12 + END-CALL. + CALL "dump" USING G-S13 + END-CALL. + CALL "dump" USING G-S14 + END-CALL. + CALL "dump" USING G-S15 + END-CALL. + CALL "dump" USING G-S16 + END-CALL. + CALL "dump" USING G-S17 + END-CALL. + CALL "dump" USING G-S18 + END-CALL. + INITIALIZE X-1. + CALL "dump" USING G-1 + END-CALL. + INITIALIZE X-2. + CALL "dump" USING G-2 + END-CALL. + INITIALIZE X-3. + CALL "dump" USING G-3 + END-CALL. + INITIALIZE X-4. + CALL "dump" USING G-4 + END-CALL. + INITIALIZE X-5. + CALL "dump" USING G-5 + END-CALL. + INITIALIZE X-6. + CALL "dump" USING G-6 + END-CALL. + INITIALIZE X-7. + CALL "dump" USING G-7 + END-CALL. + INITIALIZE X-8. + CALL "dump" USING G-8 + END-CALL. + INITIALIZE X-9. + CALL "dump" USING G-9 + END-CALL. + INITIALIZE X-10. + CALL "dump" USING G-10 + END-CALL. + INITIALIZE X-11. + CALL "dump" USING G-11 + END-CALL. + INITIALIZE X-12. + CALL "dump" USING G-12 + END-CALL. + INITIALIZE X-13. + CALL "dump" USING G-13 + END-CALL. + INITIALIZE X-14. + CALL "dump" USING G-14 + END-CALL. + INITIALIZE X-15. + CALL "dump" USING G-15 + END-CALL. + INITIALIZE X-16. + CALL "dump" USING G-16 + END-CALL. + INITIALIZE X-17. + CALL "dump" USING G-17 + END-CALL. + INITIALIZE X-18. + CALL "dump" USING G-18 + END-CALL. + INITIALIZE X-S1. + CALL "dump" USING G-S1 + END-CALL. + INITIALIZE X-S2. + CALL "dump" USING G-S2 + END-CALL. + INITIALIZE X-S3. + CALL "dump" USING G-S3 + END-CALL. + INITIALIZE X-S4. + CALL "dump" USING G-S4 + END-CALL. + INITIALIZE X-S5. + CALL "dump" USING G-S5 + END-CALL. + INITIALIZE X-S6. + CALL "dump" USING G-S6 + END-CALL. + INITIALIZE X-S7. + CALL "dump" USING G-S7 + END-CALL. + INITIALIZE X-S8. + CALL "dump" USING G-S8 + END-CALL. + INITIALIZE X-S9. + CALL "dump" USING G-S9 + END-CALL. + INITIALIZE X-S10. + CALL "dump" USING G-S10 + END-CALL. + INITIALIZE X-S11. + CALL "dump" USING G-S11 + END-CALL. + INITIALIZE X-S12. + CALL "dump" USING G-S12 + END-CALL. + INITIALIZE X-S13. + CALL "dump" USING G-S13 + END-CALL. + INITIALIZE X-S14. + CALL "dump" USING G-S14 + END-CALL. + INITIALIZE X-S15. + CALL "dump" USING G-S15 + END-CALL. + INITIALIZE X-S16. + CALL "dump" USING G-S16 + END-CALL. + INITIALIZE X-S17. + CALL "dump" USING G-S17 + END-CALL. + INITIALIZE X-S18. + CALL "dump" USING G-S18 + END-CALL. + MOVE ZERO TO X-1. + CALL "dump" USING G-1 + END-CALL. + MOVE ZERO TO X-2. + CALL "dump" USING G-2 + END-CALL. + MOVE ZERO TO X-3. + CALL "dump" USING G-3 + END-CALL. + MOVE ZERO TO X-4. + CALL "dump" USING G-4 + END-CALL. + MOVE ZERO TO X-5. + CALL "dump" USING G-5 + END-CALL. + MOVE ZERO TO X-6. + CALL "dump" USING G-6 + END-CALL. + MOVE ZERO TO X-7. + CALL "dump" USING G-7 + END-CALL. + MOVE ZERO TO X-8. + CALL "dump" USING G-8 + END-CALL. + MOVE ZERO TO X-9. + CALL "dump" USING G-9 + END-CALL. + MOVE ZERO TO X-10. + CALL "dump" USING G-10 + END-CALL. + MOVE ZERO TO X-11. + CALL "dump" USING G-11 + END-CALL. + MOVE ZERO TO X-12. + CALL "dump" USING G-12 + END-CALL. + MOVE ZERO TO X-13. + CALL "dump" USING G-13 + END-CALL. + MOVE ZERO TO X-14. + CALL "dump" USING G-14 + END-CALL. + MOVE ZERO TO X-15. + CALL "dump" USING G-15 + END-CALL. + MOVE ZERO TO X-16. + CALL "dump" USING G-16 + END-CALL. + MOVE ZERO TO X-17. + CALL "dump" USING G-17 + END-CALL. + MOVE ZERO TO X-18. + CALL "dump" USING G-18 + END-CALL. + MOVE ZERO TO X-S1. + CALL "dump" USING G-S1 + END-CALL. + MOVE ZERO TO X-S2. + CALL "dump" USING G-S2 + END-CALL. + MOVE ZERO TO X-S3. + CALL "dump" USING G-S3 + END-CALL. + MOVE ZERO TO X-S4. + CALL "dump" USING G-S4 + END-CALL. + MOVE ZERO TO X-S5. + CALL "dump" USING G-S5 + END-CALL. + MOVE ZERO TO X-S6. + CALL "dump" USING G-S6 + END-CALL. + MOVE ZERO TO X-S7. + CALL "dump" USING G-S7 + END-CALL. + MOVE ZERO TO X-S8. + CALL "dump" USING G-S8 + END-CALL. + MOVE ZERO TO X-S9. + CALL "dump" USING G-S9 + END-CALL. + MOVE ZERO TO X-S10. + CALL "dump" USING G-S10 + END-CALL. + MOVE ZERO TO X-S11. + CALL "dump" USING G-S11 + END-CALL. + MOVE ZERO TO X-S12. + CALL "dump" USING G-S12 + END-CALL. + MOVE ZERO TO X-S13. + CALL "dump" USING G-S13 + END-CALL. + MOVE ZERO TO X-S14. + CALL "dump" USING G-S14 + END-CALL. + MOVE ZERO TO X-S15. + CALL "dump" USING G-S15 + END-CALL. + MOVE ZERO TO X-S16. + CALL "dump" USING G-S16 + END-CALL. + MOVE ZERO TO X-S17. + CALL "dump" USING G-S17 + END-CALL. + MOVE ZERO TO X-S18. + CALL "dump" USING G-S18 + END-CALL. + STOP RUN. + END PROGRAM prog. + IDENTIFICATION DIVISION. + PROGRAM-ID. dump. + DATA DIVISION. + WORKING-STORAGE SECTION. + 01 HEXCHARS. + 02 HEXCHART PIC X(16) VALUE "0123456789abcdef". + 02 HEXCHAR REDEFINES HEXCHART PIC X OCCURS 16. + 01 BYTE-TO-DUMP PIC X(1). + 01 FILLER. + 02 DUMPER1 PIC 9999 COMP-5. + 02 DUMPER2 REDEFINES DUMPER1 PIC X(1). + 01 THE-BYTE PIC 99. + 01 LADVANCE PIC 9. + LINKAGE SECTION. + 01 G-VAL PIC X(20). + 01 G-PTR REDEFINES G-VAL USAGE POINTER. + PROCEDURE DIVISION USING G-VAL. + MOVE 1 TO THE-BYTE + MOVE 0 TO LADVANCE + PERFORM UNTIL THE-BYTE GREATER THAN 10 + MOVE G-VAL(THE-BYTE:1) TO BYTE-TO-DUMP + IF THE-BYTE EQUAL TO 10 MOVE 1 TO LADVANCE END-IF + PERFORM DUMP-BYTE + ADD 1 TO THE-BYTE + END-PERFORM. + GOBACK. + DUMP-BYTE. + MOVE ZERO TO DUMPER1 + MOVE BYTE-TO-DUMP TO DUMPER2 + DIVIDE DUMPER1 BY 16 GIVING DUMPER1 + ADD 1 TO DUMPER1 + DISPLAY HEXCHAR(DUMPER1) NO ADVANCING. + MOVE ZERO TO DUMPER1 + MOVE BYTE-TO-DUMP TO DUMPER2 + MOVE FUNCTION MOD(DUMPER1 16) TO DUMPER1 + ADD 1 TO DUMPER1 + IF LADVANCE EQUAL TO 1 THEN + DISPLAY HEXCHAR(DUMPER1) + ELSE + DISPLAY HEXCHAR(DUMPER1) NO ADVANCING + END-IF. + END PROGRAM dump. + diff --git a/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_dump.out b/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_dump.out new file mode 100644 index 0000000..31a5a79 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_dump.out @@ -0,0 +1,109 @@ +1f202020202020202020 +012f2020202020202020 +123f2020202020202020 +01234f20202020202020 +12345f20202020202020 +0123456f202020202020 +1234567f202020202020 +012345678f2020202020 +123456789f2020202020 +01234567890f20202020 +12345678901f20202020 +0123456789012f202020 +1234567890123f202020 +012345678901234f2020 +123456789012345f2020 +01234567890123456f20 +12345678901234567f20 +0123456789012345678f +1d202020202020202020 +012d2020202020202020 +123d2020202020202020 +01234d20202020202020 +12345d20202020202020 +0123456d202020202020 +1234567d202020202020 +012345678d2020202020 +123456789d2020202020 +01234567890d20202020 +12345678901d20202020 +0123456789012d202020 +1234567890123d202020 +012345678901234d2020 +123456789012345d2020 +01234567890123456d20 +12345678901234567d20 +0123456789012345678d +0f202020202020202020 +000f2020202020202020 +000f2020202020202020 +00000f20202020202020 +00000f20202020202020 +0000000f202020202020 +0000000f202020202020 +000000000f2020202020 +000000000f2020202020 +00000000000f20202020 +00000000000f20202020 +0000000000000f202020 +0000000000000f202020 +000000000000000f2020 +000000000000000f2020 +00000000000000000f20 +00000000000000000f20 +0000000000000000000f +0c202020202020202020 +000c2020202020202020 +000c2020202020202020 +00000c20202020202020 +00000c20202020202020 +0000000c202020202020 +0000000c202020202020 +000000000c2020202020 +000000000c2020202020 +00000000000c20202020 +00000000000c20202020 +0000000000000c202020 +0000000000000c202020 +000000000000000c2020 +000000000000000c2020 +00000000000000000c20 +00000000000000000c20 +0000000000000000000c +0f202020202020202020 +000f2020202020202020 +000f2020202020202020 +00000f20202020202020 +00000f20202020202020 +0000000f202020202020 +0000000f202020202020 +000000000f2020202020 +000000000f2020202020 +00000000000f20202020 +00000000000f20202020 +0000000000000f202020 +0000000000000f202020 +000000000000000f2020 +000000000000000f2020 +00000000000000000f20 +00000000000000000f20 +0000000000000000000f +0c202020202020202020 +000c2020202020202020 +000c2020202020202020 +00000c20202020202020 +00000c20202020202020 +0000000c202020202020 +0000000c202020202020 +000000000c2020202020 +000000000c2020202020 +00000000000c20202020 +00000000000c20202020 +0000000000000c202020 +0000000000000c202020 +000000000000000c2020 +000000000000000c2020 +00000000000000000c20 +00000000000000000c20 +0000000000000000000c + diff --git a/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_numeric_test__1_.cob b/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_numeric_test__1_.cob new file mode 100644 index 0000000..a117325 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_numeric_test__1_.cob @@ -0,0 +1,119 @@ + *> { dg-do run } + *> { dg-output-file "group2/PACKED-DECIMAL_numeric_test__1_.out" } + + IDENTIFICATION DIVISION. + PROGRAM-ID. prog. + DATA DIVISION. + WORKING-STORAGE SECTION. + 01 G. + 02 X-2 PIC X(2). + 02 N-2 REDEFINES X-2 PIC 999 USAGE PACKED-DECIMAL. + 02 N-S2 REDEFINES X-2 PIC S999 USAGE PACKED-DECIMAL. + PROCEDURE DIVISION. + MOVE X"0000" TO X-2. + IF N-2 IS NUMERIC + DISPLAY "1 NG" + END-DISPLAY + ELSE + DISPLAY "OK" + END-DISPLAY + END-IF. + IF N-S2 IS NUMERIC + DISPLAY "2 NG" + END-DISPLAY + ELSE + DISPLAY "OK" + END-DISPLAY + END-IF. + MOVE X"000c" TO X-2. + IF N-2 IS NUMERIC + DISPLAY "3 NG" + END-DISPLAY + ELSE + DISPLAY "OK" + END-DISPLAY + END-IF. + IF N-S2 IS NUMERIC + DISPLAY "OK" + END-DISPLAY + ELSE + DISPLAY "4 NG" + END-DISPLAY + END-IF. + MOVE X"000d" TO X-2. + IF N-2 IS NUMERIC + DISPLAY "5 NG" + END-DISPLAY + ELSE + DISPLAY "OK" + END-DISPLAY + END-IF. + IF N-S2 IS NUMERIC + DISPLAY "OK" + END-DISPLAY + ELSE + DISPLAY "6 NG" + END-DISPLAY + END-IF. + MOVE X"000f" TO X-2. + IF N-2 IS NUMERIC + DISPLAY "OK" + END-DISPLAY + ELSE + DISPLAY "7 NG" + END-DISPLAY + END-IF. + IF N-S2 IS NUMERIC + DISPLAY "8 NG" + END-DISPLAY + ELSE + DISPLAY "OK" + END-DISPLAY + END-IF. + MOVE X"1234" TO X-2. + IF N-2 IS NUMERIC + DISPLAY "9 NG" + END-DISPLAY + ELSE + DISPLAY "OK" + END-DISPLAY + END-IF. + IF N-S2 IS NUMERIC + DISPLAY "10 NG" + END-DISPLAY + ELSE + DISPLAY "OK" + END-DISPLAY + END-IF. + MOVE X"999f" TO X-2. + IF N-2 IS NUMERIC + DISPLAY "OK" + END-DISPLAY + ELSE + DISPLAY "11 NG" + END-DISPLAY + END-IF. + IF N-S2 IS NUMERIC + DISPLAY "12 NG" + END-DISPLAY + ELSE + DISPLAY "OK" + END-DISPLAY + END-IF. + MOVE X"ffff" TO X-2. + IF N-2 IS NUMERIC + DISPLAY "13 NG" + END-DISPLAY + ELSE + DISPLAY "OK" + END-DISPLAY + END-IF. + IF N-S2 IS NUMERIC + DISPLAY "14 NG" + END-DISPLAY + ELSE + DISPLAY "OK" + END-DISPLAY + END-IF. + STOP RUN. + diff --git a/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_numeric_test__1_.out b/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_numeric_test__1_.out new file mode 100644 index 0000000..b2fdeb2 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_numeric_test__1_.out @@ -0,0 +1,15 @@ +OK +OK +OK +OK +OK +OK +OK +OK +OK +OK +OK +OK +OK +OK + diff --git a/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_numeric_test__2_.cob b/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_numeric_test__2_.cob new file mode 100644 index 0000000..7c7d2b0 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_numeric_test__2_.cob @@ -0,0 +1,91 @@ + *> { dg-do run } + *> { dg-output-file "group2/PACKED-DECIMAL_numeric_test__2_.out" } + + IDENTIFICATION DIVISION. + PROGRAM-ID. prog. + DATA DIVISION. + WORKING-STORAGE SECTION. + 01 G. + 02 X-2 PIC X(2). + 02 N-2 REDEFINES X-2 PIC 999 USAGE PACKED-DECIMAL. + 02 N-S2 REDEFINES X-2 PIC S999 USAGE PACKED-DECIMAL. + PROCEDURE DIVISION. + MOVE X"0000" TO X-2. + IF N-2 IS NUMERIC + DISPLAY "NG 1" + ELSE + DISPLAY "OK" + END-IF. + IF N-S2 IS NUMERIC + DISPLAY "NG 2" + ELSE + DISPLAY "OK" + END-IF. + MOVE X"000c" TO X-2. + IF N-2 IS NUMERIC + DISPLAY "NG 3" + ELSE + DISPLAY "OK" + END-IF. + IF N-S2 IS NUMERIC + DISPLAY "OK" + ELSE + DISPLAY "NG 4" + END-IF. + MOVE X"000d" TO X-2. + IF N-2 IS NUMERIC + DISPLAY "NG 5" + ELSE + DISPLAY "OK" + END-IF. + IF N-S2 IS NUMERIC + DISPLAY "OK" + ELSE + DISPLAY "NG 6" + END-IF. + MOVE X"000f" TO X-2. + IF N-2 IS NUMERIC + DISPLAY "OK" + ELSE + DISPLAY "NG 7" + END-IF. + IF N-S2 IS NUMERIC + DISPLAY "NG 8" + ELSE + DISPLAY "OK" + END-IF. + MOVE X"1234" TO X-2. + IF N-2 IS NUMERIC + DISPLAY "NG 9" + ELSE + DISPLAY "OK" + END-IF. + IF N-S2 IS NUMERIC + DISPLAY "NG 10" + ELSE + DISPLAY "OK" + END-IF. + MOVE X"999f" TO X-2. + IF N-2 IS NUMERIC + DISPLAY "OK" + ELSE + DISPLAY "NG 11" + END-IF. + IF N-S2 IS NUMERIC + DISPLAY "NG 12" + ELSE + DISPLAY "OK" + END-IF. + MOVE X"ffff" TO X-2. + IF N-2 IS NUMERIC + DISPLAY "NG 13" + ELSE + DISPLAY "OK" + END-IF. + IF N-S2 IS NUMERIC + DISPLAY "NG 14" + ELSE + DISPLAY "OK" + END-IF. + STOP RUN. + diff --git a/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_numeric_test__2_.out b/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_numeric_test__2_.out new file mode 100644 index 0000000..b2fdeb2 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_numeric_test__2_.out @@ -0,0 +1,15 @@ +OK +OK +OK +OK +OK +OK +OK +OK +OK +OK +OK +OK +OK +OK + diff --git a/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_used_with_DISPLAY.cob b/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_used_with_DISPLAY.cob new file mode 100644 index 0000000..4b3d391 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_used_with_DISPLAY.cob @@ -0,0 +1,38 @@ + *> { dg-do run } + *> { dg-output-file "group2/PACKED-DECIMAL_used_with_DISPLAY.out" } + + IDENTIFICATION DIVISION. + PROGRAM-ID. prog. + DATA DIVISION. + WORKING-STORAGE SECTION. + 01 X-99 PIC 99 USAGE PACKED-DECIMAL. + 01 X-S99 PIC S99 USAGE PACKED-DECIMAL. + 01 X-999 PIC 999 USAGE PACKED-DECIMAL. + 01 X-S999 PIC S999 USAGE PACKED-DECIMAL. + PROCEDURE DIVISION. + MOVE 0 TO X-99. + DISPLAY X-99 + END-DISPLAY. + MOVE 99 TO X-99. + DISPLAY X-99 + END-DISPLAY. + MOVE 0 TO X-S99. + DISPLAY X-S99 + END-DISPLAY. + MOVE -1 TO X-S99. + DISPLAY X-S99 + END-DISPLAY. + MOVE 0 TO X-999. + DISPLAY X-999 + END-DISPLAY. + MOVE 123 TO X-999. + DISPLAY X-999 + END-DISPLAY. + MOVE 0 TO X-S999. + DISPLAY X-S999 + END-DISPLAY. + MOVE -123 TO X-S999. + DISPLAY X-S999 + END-DISPLAY. + STOP RUN. + diff --git a/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_used_with_DISPLAY.out b/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_used_with_DISPLAY.out new file mode 100644 index 0000000..4d26a95 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_used_with_DISPLAY.out @@ -0,0 +1,9 @@ +00 +99 ++00 +-01 +000 +123 ++000 +-123 + diff --git a/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_used_with_INITIALIZE.cob b/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_used_with_INITIALIZE.cob new file mode 100644 index 0000000..5bd324b --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_used_with_INITIALIZE.cob @@ -0,0 +1,26 @@ + *> { dg-do run } + *> { dg-output-file "group2/PACKED-DECIMAL_used_with_INITIALIZE.out" } + + IDENTIFICATION DIVISION. + PROGRAM-ID. prog. + DATA DIVISION. + WORKING-STORAGE SECTION. + 01 X-99 PIC 99 USAGE PACKED-DECIMAL. + 01 X-S99 PIC S99 USAGE PACKED-DECIMAL. + 01 X-999 PIC 999 USAGE PACKED-DECIMAL. + 01 X-S999 PIC S999 USAGE PACKED-DECIMAL. + PROCEDURE DIVISION. + INITIALIZE X-99. + DISPLAY X-99 + END-DISPLAY. + INITIALIZE X-S99. + DISPLAY X-S99 + END-DISPLAY. + INITIALIZE X-999. + DISPLAY X-999 + END-DISPLAY. + INITIALIZE X-S999. + DISPLAY X-S999 + END-DISPLAY. + STOP RUN. + diff --git a/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_used_with_INITIALIZE.out b/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_used_with_INITIALIZE.out new file mode 100644 index 0000000..ff3759e --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_used_with_INITIALIZE.out @@ -0,0 +1,5 @@ +00 ++00 +000 ++000 + diff --git a/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_used_with_MOVE.cob b/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_used_with_MOVE.cob new file mode 100644 index 0000000..cfdc8db --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_used_with_MOVE.cob @@ -0,0 +1,40 @@ + *> { dg-do run } + *> { dg-output-file "group2/PACKED-DECIMAL_used_with_MOVE.out" } + + IDENTIFICATION DIVISION. + PROGRAM-ID. prog. + DATA DIVISION. + WORKING-STORAGE SECTION. + 01 X-99 PIC 99 USAGE PACKED-DECIMAL. + 01 X-S99 PIC S99 USAGE PACKED-DECIMAL. + 01 X-999 PIC 999 USAGE PACKED-DECIMAL. + 01 X-S999 PIC S999 USAGE PACKED-DECIMAL. + 01 C-P1234 PIC 9999 VALUE 1234. + 01 C-N1234 PIC S9999 VALUE -1234. + PROCEDURE DIVISION. + MOVE C-P1234 TO X-99. + DISPLAY X-99 + END-DISPLAY. + MOVE C-P1234 TO X-S99. + DISPLAY X-S99 + END-DISPLAY. + MOVE C-P1234 TO X-999. + DISPLAY X-999 + END-DISPLAY. + MOVE C-P1234 TO X-S999. + DISPLAY X-S999 + END-DISPLAY. + MOVE C-N1234 TO X-99. + DISPLAY X-99 + END-DISPLAY. + MOVE C-N1234 TO X-S99. + DISPLAY X-S99 + END-DISPLAY. + MOVE C-N1234 TO X-999. + DISPLAY X-999 + END-DISPLAY. + MOVE C-N1234 TO X-S999. + DISPLAY X-S999 + END-DISPLAY. + STOP RUN. + diff --git a/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_used_with_MOVE.out b/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_used_with_MOVE.out new file mode 100644 index 0000000..ddb1080 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/PACKED-DECIMAL_used_with_MOVE.out @@ -0,0 +1,9 @@ +34 ++34 +234 ++234 +34 +-34 +234 +-234 + diff --git a/gcc/testsuite/cobol.dg/group2/POINTER__display.cob b/gcc/testsuite/cobol.dg/group2/POINTER__display.cob new file mode 100644 index 0000000..46a7cb1 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/POINTER__display.cob @@ -0,0 +1,18 @@ + *> { dg-do run } + *> { dg-output-file "group2/POINTER__display.out" } + + IDENTIFICATION DIVISION. + PROGRAM-ID. prog. + DATA DIVISION. + WORKING-STORAGE SECTION. + 01 PTR USAGE POINTER VALUE NULL. + PROCEDURE DIVISION. + DISPLAY PTR + END-DISPLAY. + SET PTR UP BY 1 + DISPLAY PTR + SET PTR DOWN BY 1 + DISPLAY PTR + END-DISPLAY. + STOP RUN. + diff --git a/gcc/testsuite/cobol.dg/group2/POINTER__display.out b/gcc/testsuite/cobol.dg/group2/POINTER__display.out new file mode 100644 index 0000000..c8ee9bc --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/POINTER__display.out @@ -0,0 +1,4 @@ +0x0000000000000000 +0x0000000000000001 +0x0000000000000000 + diff --git a/gcc/testsuite/cobol.dg/group2/Simple_floating-point_MOVE.cob b/gcc/testsuite/cobol.dg/group2/Simple_floating-point_MOVE.cob new file mode 100644 index 0000000..50f9ffa --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/Simple_floating-point_MOVE.cob @@ -0,0 +1,48 @@ + *> { dg-do run } + *> { dg-output-file "group2/Simple_floating-point_MOVE.out" } + + IDENTIFICATION DIVISION. + PROGRAM-ID. float-move. + DATA DIVISION. + WORKING-STORAGE SECTION. + 01 S1 PIC 999V99 DISPLAY VALUE 123.45 . + 01 S2 PIC 999V99 COMP VALUE 123.45 . + 01 S3 PIC 999V99 COMP-3 VALUE 123.45 . + 01 S4 PIC 999V99 COMP-5 VALUE 123.45 . + 01 S5 FLOAT-SHORT VALUE 123.45 . + 01 S6 FLOAT-LONG VALUE 123.45 . + 01 S7 FLOAT-EXTENDED VALUE 123.45 . + 01 D1 PIC 999V99 DISPLAY . + 01 D2 PIC 999V99 COMP . + 01 D3 PIC 999V99 COMP-3 . + 01 D4 PIC 999V99 COMP-5 . + 01 D5 FLOAT-SHORT . + 01 D6 FLOAT-LONG . + 01 D7 FLOAT-EXTENDED . + PROCEDURE DIVISION. + MOVE S1 TO D1 D2 D3 D4 D5 D6 D7 + PERFORM DISPLAY-D. + MOVE S2 TO D1 D2 D3 D4 D5 D6 D7 + PERFORM DISPLAY-D. + MOVE S3 TO D1 D2 D3 D4 D5 D6 D7 + PERFORM DISPLAY-D. + MOVE S4 TO D1 D2 D3 D4 D5 D6 D7 + PERFORM DISPLAY-D. + MOVE S5 TO D1 D2 D3 D4 D5 D6 D7 + PERFORM DISPLAY-D. + MOVE S6 TO D1 D2 D3 D4 D5 D6 D7 + PERFORM DISPLAY-D. + MOVE S7 TO D1 D2 D3 D4 D5 D6 D7 + PERFORM DISPLAY-D. + GOBACK. + DISPLAY-D. + DISPLAY D1 SPACE + D2 SPACE + D3 SPACE + D4 SPACE + D5 SPACE + D6 SPACE + D7 . + MOVE 0 TO D1 D2 D3 D4 D5 D6 D7. + END PROGRAM float-move. + diff --git a/gcc/testsuite/cobol.dg/group2/Simple_floating-point_MOVE.out b/gcc/testsuite/cobol.dg/group2/Simple_floating-point_MOVE.out new file mode 100644 index 0000000..fb07251 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/Simple_floating-point_MOVE.out @@ -0,0 +1,8 @@ +123.45 123.45 123.45 123.45 123.4499969 123.450000000000003 123.4500000000000000000000000000000025 +123.45 123.45 123.45 123.45 123.4499969 123.450000000000003 123.4500000000000000000000000000000025 +123.45 123.45 123.45 123.45 123.4499969 123.450000000000003 123.4500000000000000000000000000000025 +123.45 123.45 123.45 123.45 123.4499969 123.450000000000003 123.4500000000000000000000000000000025 +123.44 123.45 123.44 123.45 123.4499969 123.449996948242188 123.4499969482421875 +123.45 123.45 123.45 123.45 123.4499969 123.450000000000003 123.4500000000000028421709430404007435 +123.45 123.45 123.45 123.45 123.4499969 123.450000000000003 123.4500000000000000000000000000000025 + diff --git a/gcc/testsuite/cobol.dg/group2/Simple_floating-point_VALUE_and_MOVE.cob b/gcc/testsuite/cobol.dg/group2/Simple_floating-point_VALUE_and_MOVE.cob new file mode 100644 index 0000000..42d5954 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/Simple_floating-point_VALUE_and_MOVE.cob @@ -0,0 +1,176 @@ + *> { dg-do run } + *> { dg-output-file "group2/Simple_floating-point_VALUE_and_MOVE.out" } + + IDENTIFICATION DIVISION. + PROGRAM-ID. float-demo. + DATA DIVISION. + WORKING-STORAGE SECTION. + 01 P-1 PIC 999PPPPPP COMP-5 VALUE 123000000. + 01 C-1A COMP-1 VALUE 12.3456E-7. + 01 C-1B COMP-1 VALUE 12.3456E-6. + 01 C-1C COMP-1 VALUE 12.3456E-5. + 01 C-1D COMP-1 VALUE 12.3456E-4. + 01 C-1E COMP-1 VALUE 12.3456E-3. + 01 C-1F COMP-1 VALUE 12.3456E-2. + 01 C-1G COMP-1 VALUE 12.3456E-1. + 01 C-1H COMP-1 VALUE 12.3456E0 . + 01 C-1I COMP-1 VALUE 12.3456E1 . + 01 C-1J COMP-1 VALUE 12.3456E2 . + 01 C-1K COMP-1 VALUE 12.3456E3 . + 01 C-1L COMP-1 VALUE 12.3456E4 . + 01 C-1M COMP-1 VALUE 12.3456E5 . + 01 C-1N COMP-1 VALUE 12.3456E6 . + 01 C-1O COMP-1 VALUE 12.3456E7 . + 01 C-1P COMP-1 VALUE 12.3456E8 . + 01 C-1Q COMP-1 VALUE 12.3456E9 . + 01 C-1R COMP-1 VALUE 12.3456E10. + 01 C-1S COMP-1 VALUE 12.3456E11. + 01 C-2A COMP-2 VALUE 12.3456789098765E-7. + 01 C-2B COMP-2 VALUE 12.3456789098765E-6. + 01 C-2C COMP-2 VALUE 12.3456789098765E-5. + 01 C-2D COMP-2 VALUE 12.3456789098765E-4. + 01 C-2E COMP-2 VALUE 12.3456789098765E-3. + 01 C-2F COMP-2 VALUE 12.3456789098765E-2. + 01 C-2G COMP-2 VALUE 12.3456789098765E-1. + 01 C-2H COMP-2 VALUE 12.3456789098765E0 . + 01 C-2I COMP-2 VALUE 12.3456789098765E1 . + 01 C-2J COMP-2 VALUE 12.3456789098765E2 . + 01 C-2K COMP-2 VALUE 12.3456789098765E3 . + 01 C-2L COMP-2 VALUE 12.3456789098765E4 . + 01 C-2M COMP-2 VALUE 12.3456789098765E5 . + 01 C-2N COMP-2 VALUE 12.3456789098765E6 . + 01 C-2O COMP-2 VALUE 12.3456789098765E7 . + 01 C-2P COMP-2 VALUE 12.3456789098765E8 . + 01 C-2Q COMP-2 VALUE 12.3456789098765E9 . + 01 C-2R COMP-2 VALUE 12.3456789098765E10. + 01 C-2S COMP-2 VALUE 12.3456789098765E11. + 01 C-2T COMP-2 VALUE 12.3456789098765E12. + 01 C-2U COMP-2 VALUE 12.3456789098765E13. + 01 C-2V COMP-2 VALUE 12.3456789098765E14. + 01 C-2W COMP-2 VALUE 12.3456789098765E15. + 01 C-2X COMP-2 VALUE 12.3456789098765E16. + 01 C-EA FLOAT-EXTENDED VALUE 11.11222233334444995555666677778888E-7. + 01 C-EB FLOAT-EXTENDED VALUE 11.11222233334444995555666677778888E-6. + 01 C-EC FLOAT-EXTENDED VALUE 11.11222233334444995555666677778888E-5. + 01 C-ED FLOAT-EXTENDED VALUE 11.11222233334444995555666677778888E-4. + 01 C-EE FLOAT-EXTENDED VALUE 11.11222233334444995555666677778888E-3. + 01 C-EF FLOAT-EXTENDED VALUE 11.11222233334444995555666677778888E-2. + 01 C-EG FLOAT-EXTENDED VALUE 11.11222233334444995555666677778888E-1. + 01 C-EH FLOAT-EXTENDED VALUE 11.11222233334444995555666677778888E0 . + 01 C-EI FLOAT-EXTENDED VALUE 11.11222233334444995555666677778888E1 . + 01 C-EJ FLOAT-EXTENDED VALUE 11.11222233334444995555666677778888E2 . + 01 C-EK FLOAT-EXTENDED VALUE 11.11222233334444995555666677778888E3 . + 01 C-EL FLOAT-EXTENDED VALUE 11.11222233334444995555666677778888E4 . + 01 C-EM FLOAT-EXTENDED VALUE 11.11222233334444995555666677778888E5 . + 01 C-EN FLOAT-EXTENDED VALUE 11.11222233334444995555666677778888E6 . + 01 C-EO FLOAT-EXTENDED VALUE 11.11222233334444995555666677778888E7 . + 01 C-EP FLOAT-EXTENDED VALUE 11.11222233334444995555666677778888E8 . + 01 C-EQ FLOAT-EXTENDED VALUE 11.11222233334444995555666677778888E9 . + 01 C-ER FLOAT-EXTENDED VALUE 11.11222233334444995555666677778888E10. + 01 C-ES FLOAT-EXTENDED VALUE 11.11222233334444995555666677778888E11. + 01 C-ET FLOAT-EXTENDED VALUE 11.11222233334444995555666677778888E12. + 01 C-EU FLOAT-EXTENDED VALUE 11.11222233334444995555666677778888E13. + 01 C-EV FLOAT-EXTENDED VALUE 11.11222233334444995555666677778888E14. + 01 C-EW FLOAT-EXTENDED VALUE 11.11222233334444995555666677778888E15. + 01 C-EX FLOAT-EXTENDED VALUE 11.11222233334444995555666677778888E16. + 01 A PIC X(24). + PROCEDURE DIVISION. + DISPLAY "Variations on COMP-1 12." + MOVE 12.E-7 TO C-1A . + MOVE 12.E-6 TO C-1B . + MOVE 12.E-5 TO C-1C . + MOVE 12.E-4 TO C-1D . + MOVE 12.E-3 TO C-1E . + MOVE 12.E-2 TO C-1F . + MOVE 12.E-1 TO C-1G . + MOVE 12.E0 TO C-1H . + MOVE 12.E1 TO C-1I . + MOVE 12.E2 TO C-1J . + MOVE 12.E3 TO C-1K . + MOVE 12.E4 TO C-1L . + MOVE 12.E5 TO C-1M . + MOVE 12.E6 TO C-1N . + MOVE 12.E7 TO C-1O . + MOVE 12.E8 TO C-1P . + MOVE 12.E9 TO C-1Q . + MOVE 12.E10 TO C-1R . + MOVE 12.E11 TO C-1S . + PERFORM DISPLAY-COMP-1. + DISPLAY "Variations on COMP-2 12.3456789098765" + PERFORM DISPLAY-COMP-2. + DISPLAY "Variations on COMP-2 12." + MOVE 12.E-7 TO C-2A . + MOVE 12.E-6 TO C-2B . + MOVE 12.E-5 TO C-2C . + MOVE 12.E-4 TO C-2D . + MOVE 12.E-3 TO C-2E . + MOVE 12.E-2 TO C-2F . + MOVE 12.E-1 TO C-2G . + MOVE 12.E0 TO C-2H . + MOVE 12.E1 TO C-2I . + MOVE 12.E2 TO C-2J . + MOVE 12.E3 TO C-2K . + MOVE 12.E4 TO C-2L . + MOVE 12.E5 TO C-2M . + MOVE 12.E6 TO C-2N . + MOVE 12.E7 TO C-2O . + MOVE 12.E8 TO C-2P . + MOVE 12.E9 TO C-2Q . + MOVE 12.E10 TO C-2R . + MOVE 12.E11 TO C-2S . + MOVE 12.E12 TO C-2T . + MOVE 12.E13 TO C-2U . + MOVE 12.E14 TO C-2V . + MOVE 12.E15 TO C-2W . + MOVE 12.E16 TO C-2X . + PERFORM DISPLAY-COMP-2. + DISPLAY "Variations on FLOAT-EXTENDED 11.11222233334444995555666677778888" + PERFORM DISPLAY-EXTENDED. + GOBACK. + DISPLAY-COMP-1. + DISPLAY C-1A + DISPLAY C-1B + DISPLAY C-1C + DISPLAY C-1D + DISPLAY C-1E + DISPLAY C-1F + DISPLAY C-1G + DISPLAY C-1H + DISPLAY C-1I + DISPLAY C-1J + DISPLAY C-1K + DISPLAY C-1L + DISPLAY C-1M + DISPLAY C-1N. + DISPLAY-COMP-2. + DISPLAY C-2A + DISPLAY C-2B + DISPLAY C-2C + DISPLAY C-2D + DISPLAY C-2E + DISPLAY C-2F + DISPLAY C-2G + DISPLAY C-2H + DISPLAY C-2I + DISPLAY C-2J + DISPLAY C-2K + DISPLAY C-2L + DISPLAY C-2M + DISPLAY C-2N. + DISPLAY-EXTENDED. + DISPLAY C-EA + DISPLAY C-EB + DISPLAY C-EC + DISPLAY C-ED + DISPLAY C-EE + DISPLAY C-EF + DISPLAY C-EG + DISPLAY C-EH + DISPLAY C-EI + DISPLAY C-EJ + DISPLAY C-EK + DISPLAY C-EL + DISPLAY C-EM + DISPLAY C-EN. + END PROGRAM float-demo. + diff --git a/gcc/testsuite/cobol.dg/group2/Simple_floating-point_VALUE_and_MOVE.out b/gcc/testsuite/cobol.dg/group2/Simple_floating-point_VALUE_and_MOVE.out new file mode 100644 index 0000000..bf1afbf --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/Simple_floating-point_VALUE_and_MOVE.out @@ -0,0 +1,61 @@ +Variations on COMP-1 12. +1.200000042E-06 +1.200000042E-05 +0.000119999997 +0.001200000057 +0.0120000001 +0.1199999973 +1.200000048 +12 +120 +1200 +12000 +120000 +1.2E+06 +1.2E+07 +Variations on COMP-2 12.3456789098765 +1.23456789098764994E-06 +1.23456789098764994E-05 +0.000123456789098764987 +0.00123456789098764998 +0.0123456789098764994 +0.123456789098764994 +1.23456789098765007 +12.3456789098765007 +123.456789098765 +1234.56789098764989 +12345.6789098765003 +123456.789098765003 +1.23456789098765003E+06 +1.23456789098764993E+07 +Variations on COMP-2 12. +1.19999999999999995E-06 +1.20000000000000003E-05 +0.000120000000000000003 +0.00119999999999999989 +0.0120000000000000002 +0.119999999999999996 +1.19999999999999996 +12 +120 +1200 +12000 +120000 +1.2E+06 +1.2E+07 +Variations on FLOAT-EXTENDED 11.11222233334444995555666677778888 +1.111222233334444995555666677778887977E-06 +1.11122223333444499555566667777888794E-05 +0.0001111222233334444995555666677778887999 +0.001111222233334444995555666677778888046 +0.01111222233334444995555666677778887971 +0.1111222233334444995555666677778887971 +1.111222233334444995555666677778887923 +11.11222233334444995555666677778888 +111.1222233334444995555666677778888062 +1111.222233334444995555666677778888012 +11112.22233334444995555666677778888052 +111122.2233334444995555666677778887957 +1.111222233334444995555666677778887982E+06 +1.111222233334444995555666677778888023E+07 + diff --git a/gcc/testsuite/cobol.dg/group2/floating-point_ADD_FORMAT_1.cob b/gcc/testsuite/cobol.dg/group2/floating-point_ADD_FORMAT_1.cob new file mode 100644 index 0000000..442888b --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/floating-point_ADD_FORMAT_1.cob @@ -0,0 +1,90 @@ + *> { dg-do run } + *> { dg-output-file "group2/floating-point_ADD_FORMAT_1.out" } + + IDENTIFICATION DIVISION. + PROGRAM-ID. float-arith1. + DATA DIVISION. + WORKING-STORAGE SECTION. + 01 S1 PIC 999V99 DISPLAY VALUE 123.45 . + 01 S2 PIC 999V99 COMP VALUE 123.45 . + 01 S3 PIC 999V99 COMP-3 VALUE 123.45 . + 01 S4 PIC 999V99 COMP-5 VALUE 123.45 . + 01 S5 FLOAT-SHORT VALUE 123.45 . + 01 S6 FLOAT-LONG VALUE 123.45 . + 01 S7 FLOAT-EXTENDED VALUE 123.45 . + 01 D1 PIC 999V99 DISPLAY . + 01 D2 PIC 999V99 COMP . + 01 D3 PIC 999V99 COMP-3 . + 01 D4 PIC 999V99 COMP-5 . + 01 D5 FLOAT-SHORT . + 01 D6 FLOAT-LONG . + 01 D7 FLOAT-EXTENDED . + PROCEDURE DIVISION. + MOVE S1 TO D1 ADD S1 TO D1 + MOVE S2 TO D2 ADD S2 TO D2 + MOVE S3 TO D3 ADD S3 TO D3 + MOVE S4 TO D4 ADD S4 TO D4 + MOVE S5 TO D5 ADD S5 TO D5 + MOVE S6 TO D6 ADD S6 TO D6 + MOVE S7 TO D7 ADD S7 TO D7 + PERFORM DISPLAY-D. + MOVE S1 TO D1 ADD S2 TO D1 + MOVE S2 TO D2 ADD S3 TO D2 + MOVE S3 TO D3 ADD S4 TO D3 + MOVE S4 TO D4 ADD S5 TO D4 + MOVE S5 TO D5 ADD S6 TO D5 + MOVE S6 TO D6 ADD S7 TO D6 + MOVE S7 TO D7 ADD S1 TO D7 + PERFORM DISPLAY-D. + MOVE S1 TO D1 ADD S3 TO D1 + MOVE S2 TO D2 ADD S4 TO D2 + MOVE S3 TO D3 ADD S5 TO D3 + MOVE S4 TO D4 ADD S6 TO D4 + MOVE S5 TO D5 ADD S7 TO D5 + MOVE S6 TO D6 ADD S1 TO D6 + MOVE S7 TO D7 ADD S2 TO D7 + PERFORM DISPLAY-D. + MOVE S1 TO D1 ADD S4 TO D1 + MOVE S2 TO D2 ADD S5 TO D2 + MOVE S3 TO D3 ADD S6 TO D3 + MOVE S4 TO D4 ADD S7 TO D4 + MOVE S5 TO D5 ADD S1 TO D5 + MOVE S6 TO D6 ADD S2 TO D6 + MOVE S7 TO D7 ADD S3 TO D7 + PERFORM DISPLAY-D. + MOVE S1 TO D1 ADD S5 TO D1 + MOVE S2 TO D2 ADD S6 TO D2 + MOVE S3 TO D3 ADD S7 TO D3 + MOVE S4 TO D4 ADD S1 TO D4 + MOVE S5 TO D5 ADD S2 TO D5 + MOVE S6 TO D6 ADD S3 TO D6 + MOVE S7 TO D7 ADD S4 TO D7 + PERFORM DISPLAY-D. + MOVE S1 TO D1 ADD S6 TO D1 + MOVE S2 TO D2 ADD S7 TO D2 + MOVE S3 TO D3 ADD S1 TO D3 + MOVE S4 TO D4 ADD S2 TO D4 + MOVE S5 TO D5 ADD S3 TO D5 + MOVE S6 TO D6 ADD S4 TO D6 + MOVE S7 TO D7 ADD S5 TO D7 + PERFORM DISPLAY-D. + MOVE S1 TO D1 ADD S7 TO D1 + MOVE S2 TO D2 ADD S1 TO D2 + MOVE S3 TO D3 ADD S2 TO D3 + MOVE S4 TO D4 ADD S3 TO D4 + MOVE S5 TO D5 ADD S4 TO D5 + MOVE S6 TO D6 ADD S5 TO D6 + MOVE S7 TO D7 ADD S6 TO D7 + PERFORM DISPLAY-D. + GOBACK. + DISPLAY-D. + DISPLAY D1 SPACE + D2 SPACE + D3 SPACE + D4 SPACE + D5 SPACE + D6 SPACE + D7 . + MOVE 0 TO D1 D2 D3 D4 D5 D6 D7. + END PROGRAM float-arith1. + diff --git a/gcc/testsuite/cobol.dg/group2/floating-point_ADD_FORMAT_1.out b/gcc/testsuite/cobol.dg/group2/floating-point_ADD_FORMAT_1.out new file mode 100644 index 0000000..d48643c --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/floating-point_ADD_FORMAT_1.out @@ -0,0 +1,8 @@ +246.90 246.90 246.90 246.90 246.8999939 246.900000000000006 246.9000000000000000000000000000000049 +246.90 246.90 246.90 246.89 246.8999939 246.900000000000006 246.9000000000000000000000000000000049 +246.90 246.90 246.89 246.90 246.8999939 246.900000000000006 246.9000000000000000000000000000000049 +246.90 246.89 246.90 246.90 246.8999939 246.900000000000006 246.9000000000000000000000000000000049 +246.89 246.90 246.90 246.90 246.8999939 246.900000000000006 246.9000000000000000000000000000000049 +246.90 246.90 246.90 246.90 246.8999939 246.900000000000006 246.8999969482421874999999999999999901 +246.90 246.90 246.90 246.90 246.8999939 246.899996948242176 246.9000000000000028421709430404007336 + diff --git a/gcc/testsuite/cobol.dg/group2/floating-point_ADD_FORMAT_2.cob b/gcc/testsuite/cobol.dg/group2/floating-point_ADD_FORMAT_2.cob new file mode 100644 index 0000000..ef3f730 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/floating-point_ADD_FORMAT_2.cob @@ -0,0 +1,96 @@ + *> { dg-do run } + *> { dg-output-file "group2/floating-point_ADD_FORMAT_2.out" } + + IDENTIFICATION DIVISION. + PROGRAM-ID. float-add2. + DATA DIVISION. + WORKING-STORAGE SECTION. + 01 S1 PIC 999V99 DISPLAY VALUE 123.45 . + 01 S2 PIC 999V99 COMP VALUE 123.45 . + 01 S3 PIC 999V99 COMP-3 VALUE 123.45 . + 01 S4 PIC 999V99 COMP-5 VALUE 123.45 . + 01 S5 FLOAT-SHORT VALUE 123.45 . + 01 S6 FLOAT-LONG VALUE 123.45 . + 01 S7 FLOAT-EXTENDED VALUE 123.45 . + 01 D1 PIC 999V99 DISPLAY VALUE 543.21 . + 01 D2 PIC 999V99 COMP VALUE 543.21 . + 01 D3 PIC 999V99 COMP-3 VALUE 543.21 . + 01 D4 PIC 999V99 COMP-5 VALUE 543.21 . + 01 D5 FLOAT-SHORT VALUE 543.21 . + 01 D6 FLOAT-LONG VALUE 543.21 . + 01 D7 FLOAT-EXTENDED VALUE 543.21 . + 01 X1 PIC 999V99 DISPLAY . + 01 X2 PIC 999V99 COMP . + 01 X3 PIC 999V99 COMP-3 . + 01 X4 PIC 999V99 COMP-5 . + 01 X5 FLOAT-SHORT . + 01 X6 FLOAT-LONG . + 01 X7 FLOAT-EXTENDED . + PROCEDURE DIVISION. + ADD S1 TO D1 GIVING X1 + ADD S2 TO D2 GIVING X2 + ADD S3 TO D3 GIVING X3 + ADD S4 TO D4 GIVING X4 + ADD S5 TO D5 GIVING X5 + ADD S6 TO D6 GIVING X6 + ADD S7 TO D7 GIVING X7 + PERFORM DISPLAY-X. + ADD S2 TO D1 GIVING X1 + ADD S3 TO D2 GIVING X2 + ADD S4 TO D3 GIVING X3 + ADD S5 TO D4 GIVING X4 + ADD S6 TO D5 GIVING X5 + ADD S7 TO D6 GIVING X6 + ADD S1 TO D7 GIVING X7 + PERFORM DISPLAY-X. + ADD S3 TO D1 GIVING X1 + ADD S4 TO D2 GIVING X2 + ADD S5 TO D3 GIVING X3 + ADD S6 TO D4 GIVING X4 + ADD S7 TO D5 GIVING X5 + ADD S1 TO D6 GIVING X6 + ADD S2 TO D7 GIVING X7 + PERFORM DISPLAY-X. + ADD S4 TO D1 GIVING X1 + ADD S5 TO D2 GIVING X2 + ADD S6 TO D3 GIVING X3 + ADD S7 TO D4 GIVING X4 + ADD S1 TO D5 GIVING X5 + ADD S2 TO D6 GIVING X6 + ADD S3 TO D7 GIVING X7 + PERFORM DISPLAY-X. + ADD S5 TO D1 GIVING X1 + ADD S6 TO D2 GIVING X2 + ADD S7 TO D3 GIVING X3 + ADD S1 TO D4 GIVING X4 + ADD S2 TO D5 GIVING X5 + ADD S3 TO D6 GIVING X6 + ADD S4 TO D7 GIVING X7 + PERFORM DISPLAY-X. + ADD S6 TO D1 GIVING X1 + ADD S7 TO D2 GIVING X2 + ADD S1 TO D3 GIVING X3 + ADD S2 TO D4 GIVING X4 + ADD S3 TO D5 GIVING X5 + ADD S4 TO D6 GIVING X6 + ADD S5 TO D7 GIVING X7 + PERFORM DISPLAY-X. + ADD S7 TO D1 GIVING X1 + ADD S1 TO D2 GIVING X2 + ADD S2 TO D3 GIVING X3 + ADD S3 TO D4 GIVING X4 + ADD S4 TO D5 GIVING X5 + ADD S5 TO D6 GIVING X6 + ADD S6 TO D7 GIVING X7 + PERFORM DISPLAY-X. + GOBACK. + DISPLAY-X. + DISPLAY X1 SPACE + X2 SPACE + X3 SPACE + X4 SPACE + X5 SPACE + X6 SPACE + X7 . + END PROGRAM float-add2. + diff --git a/gcc/testsuite/cobol.dg/group2/floating-point_ADD_FORMAT_2.out b/gcc/testsuite/cobol.dg/group2/floating-point_ADD_FORMAT_2.out new file mode 100644 index 0000000..933b56d --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/floating-point_ADD_FORMAT_2.out @@ -0,0 +1,8 @@ +666.66 666.66 666.66 666.66 666.6600342 666.660000000000082 666.660000000000000000000000000000071 +666.66 666.66 666.66 666.65 666.6600342 666.660000000000082 666.660000000000000000000000000000071 +666.66 666.66 666.65 666.66 666.6600342 666.660000000000082 666.660000000000000000000000000000071 +666.66 666.65 666.66 666.66 666.6600342 666.660000000000082 666.660000000000000000000000000000071 +666.65 666.66 666.66 666.66 666.6600342 666.660000000000082 666.660000000000000000000000000000071 +666.66 666.66 666.66 666.66 666.6600342 666.660000000000082 666.6599969482421875000000000000000316 +666.66 666.66 666.66 666.66 666.6600342 666.659996948242224 666.660000000000002842170943040400775 + diff --git a/gcc/testsuite/cobol.dg/group2/floating-point_DIVIDE_FORMAT_1.cob b/gcc/testsuite/cobol.dg/group2/floating-point_DIVIDE_FORMAT_1.cob new file mode 100644 index 0000000..efe3d97 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/floating-point_DIVIDE_FORMAT_1.cob @@ -0,0 +1,90 @@ + *> { dg-do run } + *> { dg-output-file "group2/floating-point_DIVIDE_FORMAT_1.out" } + + IDENTIFICATION DIVISION. + PROGRAM-ID. float-div1. + DATA DIVISION. + WORKING-STORAGE SECTION. + 01 S1 PIC 999V99 DISPLAY VALUE 1.1 . + 01 S2 PIC 999V99 COMP VALUE 1.1 . + 01 S3 PIC 999V99 COMP-3 VALUE 1.1 . + 01 S4 PIC 999V99 COMP-5 VALUE 1.1 . + 01 S5 FLOAT-SHORT VALUE 1.1 . + 01 S6 FLOAT-LONG VALUE 1.1 . + 01 S7 FLOAT-EXTENDED VALUE 1.1 . + 01 D1 PIC 999V99 DISPLAY VALUE 611.05. + 01 D2 PIC 999V99 COMP VALUE 611.05. + 01 D3 PIC 999V99 COMP-3 VALUE 611.05. + 01 D4 PIC 999V99 COMP-5 VALUE 611.05. + 01 D5 FLOAT-SHORT VALUE 611.05. + 01 D6 FLOAT-LONG VALUE 611.05. + 01 D7 FLOAT-EXTENDED VALUE 611.05. + PROCEDURE DIVISION. + DIVIDE S1 INTO D1 + DIVIDE S2 INTO D2 + DIVIDE S3 INTO D3 + DIVIDE S4 INTO D4 + DIVIDE S5 INTO D5 + DIVIDE S6 INTO D6 + DIVIDE S7 INTO D7 + PERFORM DISPLAY-D. + DIVIDE S1 INTO D2 + DIVIDE S2 INTO D3 + DIVIDE S3 INTO D4 + DIVIDE S4 INTO D5 + DIVIDE S5 INTO D6 + DIVIDE S6 INTO D7 + DIVIDE S7 INTO D1 + PERFORM DISPLAY-D. + DIVIDE S1 INTO D3 + DIVIDE S2 INTO D4 + DIVIDE S3 INTO D5 + DIVIDE S4 INTO D6 + DIVIDE S5 INTO D7 + DIVIDE S6 INTO D1 + DIVIDE S7 INTO D2 + PERFORM DISPLAY-D. + DIVIDE S1 INTO D4 + DIVIDE S2 INTO D5 + DIVIDE S3 INTO D6 + DIVIDE S4 INTO D7 + DIVIDE S5 INTO D1 + DIVIDE S6 INTO D2 + DIVIDE S7 INTO D3 + PERFORM DISPLAY-D. + DIVIDE S1 INTO D5 + DIVIDE S2 INTO D6 + DIVIDE S3 INTO D7 + DIVIDE S4 INTO D1 + DIVIDE S5 INTO D2 + DIVIDE S6 INTO D3 + DIVIDE S7 INTO D4 + PERFORM DISPLAY-D. + DIVIDE S1 INTO D6 + DIVIDE S2 INTO D7 + DIVIDE S3 INTO D1 + DIVIDE S4 INTO D2 + DIVIDE S5 INTO D3 + DIVIDE S6 INTO D4 + DIVIDE S7 INTO D5 + PERFORM DISPLAY-D. + DIVIDE S1 INTO D7 + DIVIDE S2 INTO D1 + DIVIDE S3 INTO D2 + DIVIDE S4 INTO D3 + DIVIDE S5 INTO D4 + DIVIDE S6 INTO D5 + DIVIDE S7 INTO D6 + PERFORM DISPLAY-D. + GOBACK. + DISPLAY-D. + DISPLAY D1 SPACE + D2 SPACE + D3 SPACE + D4 SPACE + D5 SPACE + D6 SPACE + D7 . + INITIALIZE D1 D2 D3 D4 D5 D6 D7 ALL VALUE. + END PROGRAM float-div1. + diff --git a/gcc/testsuite/cobol.dg/group2/floating-point_DIVIDE_FORMAT_1.out b/gcc/testsuite/cobol.dg/group2/floating-point_DIVIDE_FORMAT_1.out new file mode 100644 index 0000000..cc7a177 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/floating-point_DIVIDE_FORMAT_1.out @@ -0,0 +1,8 @@ +555.50 555.50 555.50 555.50 555.5 555.499999999999886 555.4999999999999999999999999999999014 +555.49 555.50 555.50 555.50 555.5 555.499987959861983 555.4999999999999551469898051436793168 +555.49 555.49 555.50 555.50 555.5 555.5 555.4999879598620163340565002169066332 +555.49 555.49 555.49 555.50 555.5 555.5 555.4999999999999999999999999999999014 +555.50 555.49 555.49 555.49 555.5 555.5 555.4999999999999999999999999999999014 +555.50 555.50 555.49 555.49 555.5 555.5 555.4999999999999999999999999999999014 +555.50 555.50 555.50 555.49 555.5 555.5 555.4999999999999999999999999999999014 + diff --git a/gcc/testsuite/cobol.dg/group2/floating-point_DIVIDE_FORMAT_2.cob b/gcc/testsuite/cobol.dg/group2/floating-point_DIVIDE_FORMAT_2.cob new file mode 100644 index 0000000..068844b --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/floating-point_DIVIDE_FORMAT_2.cob @@ -0,0 +1,96 @@ + *> { dg-do run } + *> { dg-output-file "group2/floating-point_DIVIDE_FORMAT_2.out" } + + IDENTIFICATION DIVISION. + PROGRAM-ID. float-DIVIDE2. + DATA DIVISION. + WORKING-STORAGE SECTION. + 01 S1 PIC 999V99 DISPLAY VALUE 123.21 . + 01 S2 PIC 999V99 COMP VALUE 123.21 . + 01 S3 PIC 999V99 COMP-3 VALUE 123.21 . + 01 S4 PIC 999V99 COMP-5 VALUE 123.21 . + 01 S5 FLOAT-SHORT VALUE 123.21 . + 01 S6 FLOAT-LONG VALUE 123.21 . + 01 S7 FLOAT-EXTENDED VALUE 123.21 . + 01 D1 PIC 999V99 DISPLAY VALUE 111.00 . + 01 D2 PIC 999V99 COMP VALUE 111.00 . + 01 D3 PIC 999V99 COMP-3 VALUE 111.00 . + 01 D4 PIC 999V99 COMP-5 VALUE 111.00 . + 01 D5 FLOAT-SHORT VALUE 111.00 . + 01 D6 FLOAT-LONG VALUE 111.00 . + 01 D7 FLOAT-EXTENDED VALUE 111.00 . + 01 X1 PIC 999V99 DISPLAY . + 01 X2 PIC 999V99 COMP . + 01 X3 PIC 999V99 COMP-3 . + 01 X4 PIC 999V99 COMP-5 . + 01 X5 FLOAT-SHORT . + 01 X6 FLOAT-LONG . + 01 X7 FLOAT-EXTENDED . + PROCEDURE DIVISION. + DIVIDE S1 BY D1 GIVING X1 + DIVIDE S2 BY D2 GIVING X2 + DIVIDE S3 BY D3 GIVING X3 + DIVIDE S4 BY D4 GIVING X4 + DIVIDE S5 BY D5 GIVING X5 + DIVIDE S6 BY D6 GIVING X6 + DIVIDE S7 BY D7 GIVING X7 + PERFORM DISPLAY-X. + DIVIDE S2 BY D1 GIVING X1 + DIVIDE S3 BY D2 GIVING X2 + DIVIDE S4 BY D3 GIVING X3 + DIVIDE S5 BY D4 GIVING X4 + DIVIDE S6 BY D5 GIVING X5 + DIVIDE S7 BY D6 GIVING X6 + DIVIDE S1 BY D7 GIVING X7 + PERFORM DISPLAY-X. + DIVIDE S3 BY D1 GIVING X1 + DIVIDE S4 BY D2 GIVING X2 + DIVIDE S5 BY D3 GIVING X3 + DIVIDE S6 BY D4 GIVING X4 + DIVIDE S7 BY D5 GIVING X5 + DIVIDE S1 BY D6 GIVING X6 + DIVIDE S2 BY D7 GIVING X7 + PERFORM DISPLAY-X. + DIVIDE S4 BY D1 GIVING X1 + DIVIDE S5 BY D2 GIVING X2 + DIVIDE S6 BY D3 GIVING X3 + DIVIDE S7 BY D4 GIVING X4 + DIVIDE S1 BY D5 GIVING X5 + DIVIDE S2 BY D6 GIVING X6 + DIVIDE S3 BY D7 GIVING X7 + PERFORM DISPLAY-X. + DIVIDE S5 BY D1 GIVING X1 + DIVIDE S6 BY D2 GIVING X2 + DIVIDE S7 BY D3 GIVING X3 + DIVIDE S1 BY D4 GIVING X4 + DIVIDE S2 BY D5 GIVING X5 + DIVIDE S3 BY D6 GIVING X6 + DIVIDE S4 BY D7 GIVING X7 + PERFORM DISPLAY-X. + DIVIDE S6 BY D1 GIVING X1 + DIVIDE S7 BY D2 GIVING X2 + DIVIDE S1 BY D3 GIVING X3 + DIVIDE S2 BY D4 GIVING X4 + DIVIDE S3 BY D5 GIVING X5 + DIVIDE S4 BY D6 GIVING X6 + DIVIDE S5 BY D7 GIVING X7 + PERFORM DISPLAY-X. + DIVIDE S7 BY D1 GIVING X1 + DIVIDE S1 BY D2 GIVING X2 + DIVIDE S2 BY D3 GIVING X3 + DIVIDE S3 BY D4 GIVING X4 + DIVIDE S4 BY D5 GIVING X5 + DIVIDE S5 BY D6 GIVING X6 + DIVIDE S6 BY D7 GIVING X7 + PERFORM DISPLAY-X. + GOBACK. + DISPLAY-X. + DISPLAY X1 SPACE + X2 SPACE + X3 SPACE + X4 SPACE + X5 SPACE + X6 SPACE + X7 . + END PROGRAM float-DIVIDE2. + diff --git a/gcc/testsuite/cobol.dg/group2/floating-point_DIVIDE_FORMAT_2.out b/gcc/testsuite/cobol.dg/group2/floating-point_DIVIDE_FORMAT_2.out new file mode 100644 index 0000000..1723f56 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/floating-point_DIVIDE_FORMAT_2.out @@ -0,0 +1,8 @@ +001.11 001.11 001.11 001.11 1.110000014 1.10999999999999988 1.109999999999999999999999999999999892 +001.11 001.11 001.11 001.10 1.110000014 1.1100000000000001 1.109999999999999999999999999999999892 +001.11 001.11 001.10 001.10 1.110000014 1.1100000000000001 1.109999999999999999999999999999999892 +001.11 001.10 001.10 001.10 1.110000014 1.1100000000000001 1.109999999999999999999999999999999892 +001.10 001.10 001.10 001.11 1.110000014 1.1100000000000001 1.109999999999999999999999999999999892 +001.10 001.10 001.11 001.11 1.110000014 1.1100000000000001 1.10999999175200591216216216216216224 +001.10 001.11 001.11 001.11 1.110000014 1.10999999175200581 1.109999999999999943668684011811877144 + diff --git a/gcc/testsuite/cobol.dg/group2/floating-point_MULTIPLY_FORMAT_1.cob b/gcc/testsuite/cobol.dg/group2/floating-point_MULTIPLY_FORMAT_1.cob new file mode 100644 index 0000000..4365a40 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/floating-point_MULTIPLY_FORMAT_1.cob @@ -0,0 +1,90 @@ + *> { dg-do run } + *> { dg-output-file "group2/floating-point_MULTIPLY_FORMAT_1.out" } + + IDENTIFICATION DIVISION. + PROGRAM-ID. float-mult1. + DATA DIVISION. + WORKING-STORAGE SECTION. + 01 S1 PIC 999V99 DISPLAY VALUE 1.2 . + 01 S2 PIC 999V99 COMP VALUE 1.2 . + 01 S3 PIC 999V99 COMP-3 VALUE 1.2 . + 01 S4 PIC 999V99 COMP-5 VALUE 1.2 . + 01 S5 FLOAT-SHORT VALUE 1.2 . + 01 S6 FLOAT-LONG VALUE 1.2 . + 01 S7 FLOAT-EXTENDED VALUE 1.2 . + 01 D1 PIC 999V99 DISPLAY VALUE 1.1. + 01 D2 PIC 999V99 COMP VALUE 1.1. + 01 D3 PIC 999V99 COMP-3 VALUE 1.1. + 01 D4 PIC 999V99 COMP-5 VALUE 1.1. + 01 D5 FLOAT-SHORT VALUE 1.1. + 01 D6 FLOAT-LONG VALUE 1.1. + 01 D7 FLOAT-EXTENDED VALUE 1.1. + PROCEDURE DIVISION. + MULTIPLY S1 BY D1 + MULTIPLY S2 BY D2 + MULTIPLY S3 BY D3 + MULTIPLY S4 BY D4 + MULTIPLY S5 BY D5 + MULTIPLY S6 BY D6 + MULTIPLY S7 BY D7 + PERFORM DISPLAY-D. + MULTIPLY S1 BY D2 + MULTIPLY S2 BY D3 + MULTIPLY S3 BY D4 + MULTIPLY S4 BY D5 + MULTIPLY S5 BY D6 + MULTIPLY S6 BY D7 + MULTIPLY S7 BY D1 + PERFORM DISPLAY-D. + MULTIPLY S1 BY D3 + MULTIPLY S2 BY D4 + MULTIPLY S3 BY D5 + MULTIPLY S4 BY D6 + MULTIPLY S5 BY D7 + MULTIPLY S6 BY D1 + MULTIPLY S7 BY D2 + PERFORM DISPLAY-D. + MULTIPLY S1 BY D4 + MULTIPLY S2 BY D5 + MULTIPLY S3 BY D6 + MULTIPLY S4 BY D7 + MULTIPLY S5 BY D1 + MULTIPLY S6 BY D2 + MULTIPLY S7 BY D3 + PERFORM DISPLAY-D. + MULTIPLY S1 BY D5 + MULTIPLY S2 BY D6 + MULTIPLY S3 BY D7 + MULTIPLY S4 BY D1 + MULTIPLY S5 BY D2 + MULTIPLY S6 BY D3 + MULTIPLY S7 BY D4 + PERFORM DISPLAY-D. + MULTIPLY S1 BY D6 + MULTIPLY S2 BY D7 + MULTIPLY S3 BY D1 + MULTIPLY S4 BY D2 + MULTIPLY S5 BY D3 + MULTIPLY S6 BY D4 + MULTIPLY S7 BY D5 + PERFORM DISPLAY-D. + MULTIPLY S1 BY D7 + MULTIPLY S2 BY D1 + MULTIPLY S3 BY D2 + MULTIPLY S4 BY D3 + MULTIPLY S5 BY D4 + MULTIPLY S6 BY D5 + MULTIPLY S7 BY D6 + PERFORM DISPLAY-D. + GOBACK. + DISPLAY-D. + DISPLAY D1 SPACE + D2 SPACE + D3 SPACE + D4 SPACE + D5 SPACE + D6 SPACE + D7 . + INITIALIZE D1 D2 D3 D4 D5 D6 D7 ALL VALUE. + END PROGRAM float-mult1. + diff --git a/gcc/testsuite/cobol.dg/group2/floating-point_MULTIPLY_FORMAT_1.out b/gcc/testsuite/cobol.dg/group2/floating-point_MULTIPLY_FORMAT_1.out new file mode 100644 index 0000000..2722545 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/floating-point_MULTIPLY_FORMAT_1.out @@ -0,0 +1,8 @@ +001.32 001.32 001.32 001.32 1.320000052 1.32000000000000006 1.320000000000000000000000000000000054 +001.32 001.32 001.32 001.32 1.320000052 1.3200000524520874 1.319999999999999951150186916493112221 +001.31 001.32 001.32 001.32 1.320000052 1.32000000000000006 1.32000005245208740234375 +001.32 001.31 001.32 001.32 1.320000052 1.32000000000000006 1.320000000000000000000000000000000054 +001.32 001.32 001.31 001.32 1.320000052 1.32000000000000006 1.320000000000000000000000000000000054 +001.32 001.32 001.32 001.31 1.320000052 1.32000000000000006 1.320000000000000000000000000000000054 +001.32 001.32 001.32 001.32 1.320000052 1.32000000000000006 1.320000000000000000000000000000000054 + diff --git a/gcc/testsuite/cobol.dg/group2/floating-point_MULTIPLY_FORMAT_2.cob b/gcc/testsuite/cobol.dg/group2/floating-point_MULTIPLY_FORMAT_2.cob new file mode 100644 index 0000000..183f1af --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/floating-point_MULTIPLY_FORMAT_2.cob @@ -0,0 +1,96 @@ + *> { dg-do run } + *> { dg-output-file "group2/floating-point_MULTIPLY_FORMAT_2.out" } + + IDENTIFICATION DIVISION. + PROGRAM-ID. float-MULTIPLY2. + DATA DIVISION. + WORKING-STORAGE SECTION. + 01 S1 PIC 999V99 DISPLAY VALUE 111.00 . + 01 S2 PIC 999V99 COMP VALUE 111.00 . + 01 S3 PIC 999V99 COMP-3 VALUE 111.00 . + 01 S4 PIC 999V99 COMP-5 VALUE 111.00 . + 01 S5 FLOAT-SHORT VALUE 111.00 . + 01 S6 FLOAT-LONG VALUE 111.00 . + 01 S7 FLOAT-EXTENDED VALUE 111.00 . + 01 D1 PIC 999V99 DISPLAY VALUE 1.11 . + 01 D2 PIC 999V99 COMP VALUE 1.11 . + 01 D3 PIC 999V99 COMP-3 VALUE 1.11 . + 01 D4 PIC 999V99 COMP-5 VALUE 1.11 . + 01 D5 FLOAT-SHORT VALUE 1.11 . + 01 D6 FLOAT-LONG VALUE 1.11 . + 01 D7 FLOAT-EXTENDED VALUE 1.11 . + 01 X1 PIC 999V99 DISPLAY . + 01 X2 PIC 999V99 COMP . + 01 X3 PIC 999V99 COMP-3 . + 01 X4 PIC 999V99 COMP-5 . + 01 X5 FLOAT-SHORT . + 01 X6 FLOAT-LONG . + 01 X7 FLOAT-EXTENDED . + PROCEDURE DIVISION. + MULTIPLY S1 BY D1 GIVING X1 + MULTIPLY S2 BY D2 GIVING X2 + MULTIPLY S3 BY D3 GIVING X3 + MULTIPLY S4 BY D4 GIVING X4 + MULTIPLY S5 BY D5 GIVING X5 + MULTIPLY S6 BY D6 GIVING X6 + MULTIPLY S7 BY D7 GIVING X7 + PERFORM DISPLAY-X. + MULTIPLY S2 BY D1 GIVING X1 + MULTIPLY S3 BY D2 GIVING X2 + MULTIPLY S4 BY D3 GIVING X3 + MULTIPLY S5 BY D4 GIVING X4 + MULTIPLY S6 BY D5 GIVING X5 + MULTIPLY S7 BY D6 GIVING X6 + MULTIPLY S1 BY D7 GIVING X7 + PERFORM DISPLAY-X. + MULTIPLY S3 BY D1 GIVING X1 + MULTIPLY S4 BY D2 GIVING X2 + MULTIPLY S5 BY D3 GIVING X3 + MULTIPLY S6 BY D4 GIVING X4 + MULTIPLY S7 BY D5 GIVING X5 + MULTIPLY S1 BY D6 GIVING X6 + MULTIPLY S2 BY D7 GIVING X7 + PERFORM DISPLAY-X. + MULTIPLY S4 BY D1 GIVING X1 + MULTIPLY S5 BY D2 GIVING X2 + MULTIPLY S6 BY D3 GIVING X3 + MULTIPLY S7 BY D4 GIVING X4 + MULTIPLY S1 BY D5 GIVING X5 + MULTIPLY S2 BY D6 GIVING X6 + MULTIPLY S3 BY D7 GIVING X7 + PERFORM DISPLAY-X. + MULTIPLY S5 BY D1 GIVING X1 + MULTIPLY S6 BY D2 GIVING X2 + MULTIPLY S7 BY D3 GIVING X3 + MULTIPLY S1 BY D4 GIVING X4 + MULTIPLY S2 BY D5 GIVING X5 + MULTIPLY S3 BY D6 GIVING X6 + MULTIPLY S4 BY D7 GIVING X7 + PERFORM DISPLAY-X. + MULTIPLY S6 BY D1 GIVING X1 + MULTIPLY S7 BY D2 GIVING X2 + MULTIPLY S1 BY D3 GIVING X3 + MULTIPLY S2 BY D4 GIVING X4 + MULTIPLY S3 BY D5 GIVING X5 + MULTIPLY S4 BY D6 GIVING X6 + MULTIPLY S5 BY D7 GIVING X7 + PERFORM DISPLAY-X. + MULTIPLY S7 BY D1 GIVING X1 + MULTIPLY S1 BY D2 GIVING X2 + MULTIPLY S2 BY D3 GIVING X3 + MULTIPLY S3 BY D4 GIVING X4 + MULTIPLY S4 BY D5 GIVING X5 + MULTIPLY S5 BY D6 GIVING X6 + MULTIPLY S6 BY D7 GIVING X7 + PERFORM DISPLAY-X. + GOBACK. + DISPLAY-X. + DISPLAY X1 SPACE + X2 SPACE + X3 SPACE + X4 SPACE + X5 SPACE + X6 SPACE + X7 . + END PROGRAM float-MULTIPLY2. + diff --git a/gcc/testsuite/cobol.dg/group2/floating-point_MULTIPLY_FORMAT_2.out b/gcc/testsuite/cobol.dg/group2/floating-point_MULTIPLY_FORMAT_2.out new file mode 100644 index 0000000..c8f6231 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/floating-point_MULTIPLY_FORMAT_2.out @@ -0,0 +1,8 @@ +123.21 123.21 123.21 123.21 123.2099991 123.210000000000008 123.2100000000000000000000000000000069 +123.21 123.21 123.21 123.21 123.2099991 123.210000000000008 123.2100000000000000000000000000000069 +123.21 123.21 123.21 123.21 123.2099991 123.210000000000008 123.2100000000000000000000000000000069 +123.21 123.21 123.21 123.21 123.2099991 123.210000000000008 123.2100000000000000000000000000000069 +123.21 123.21 123.21 123.21 123.2099991 123.210000000000008 123.2100000000000000000000000000000069 +123.21 123.21 123.21 123.21 123.2099991 123.210000000000008 123.2100000000000000000000000000000069 +123.21 123.21 123.21 123.21 123.2099991 123.210000000000008 123.2100000000000000000000000000000069 + diff --git a/gcc/testsuite/cobol.dg/group2/floating-point_SUBTRACT_FORMAT_1.cob b/gcc/testsuite/cobol.dg/group2/floating-point_SUBTRACT_FORMAT_1.cob new file mode 100644 index 0000000..7ba8161 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/floating-point_SUBTRACT_FORMAT_1.cob @@ -0,0 +1,90 @@ + *> { dg-do run } + *> { dg-output-file "group2/floating-point_SUBTRACT_FORMAT_1.out" } + + IDENTIFICATION DIVISION. + PROGRAM-ID. float-sub1. + DATA DIVISION. + WORKING-STORAGE SECTION. + 01 S1 PIC 999V99 DISPLAY VALUE 111.11 . + 01 S2 PIC 999V99 COMP VALUE 111.11 . + 01 S3 PIC 999V99 COMP-3 VALUE 111.11 . + 01 S4 PIC 999V99 COMP-5 VALUE 111.11 . + 01 S5 FLOAT-SHORT VALUE 111.11 . + 01 S6 FLOAT-LONG VALUE 111.11 . + 01 S7 FLOAT-EXTENDED VALUE 111.11 . + 01 D1 PIC 999V99 DISPLAY VALUE 666.66. + 01 D2 PIC 999V99 COMP VALUE 666.66. + 01 D3 PIC 999V99 COMP-3 VALUE 666.66. + 01 D4 PIC 999V99 COMP-5 VALUE 666.66. + 01 D5 FLOAT-SHORT VALUE 666.66. + 01 D6 FLOAT-LONG VALUE 666.66. + 01 D7 FLOAT-EXTENDED VALUE 666.66. + PROCEDURE DIVISION. + SUBTRACT S1 FROM D1 + SUBTRACT S1 FROM D2 + SUBTRACT S1 FROM D3 + SUBTRACT S1 FROM D4 + SUBTRACT S1 FROM D5 + SUBTRACT S1 FROM D6 + SUBTRACT S1 FROM D7 + PERFORM DISPLAY-D. + SUBTRACT S2 FROM D2 + SUBTRACT S2 FROM D3 + SUBTRACT S2 FROM D4 + SUBTRACT S2 FROM D5 + SUBTRACT S2 FROM D6 + SUBTRACT S2 FROM D7 + SUBTRACT S2 FROM D1 + PERFORM DISPLAY-D. + SUBTRACT S3 FROM D3 + SUBTRACT S3 FROM D4 + SUBTRACT S3 FROM D5 + SUBTRACT S3 FROM D6 + SUBTRACT S3 FROM D7 + SUBTRACT S3 FROM D1 + SUBTRACT S3 FROM D2 + PERFORM DISPLAY-D. + SUBTRACT S4 FROM D4 + SUBTRACT S4 FROM D5 + SUBTRACT S4 FROM D6 + SUBTRACT S4 FROM D7 + SUBTRACT S4 FROM D1 + SUBTRACT S4 FROM D2 + SUBTRACT S4 FROM D3 + PERFORM DISPLAY-D. + SUBTRACT S5 FROM D5 + SUBTRACT S5 FROM D6 + SUBTRACT S5 FROM D7 + SUBTRACT S5 FROM D1 + SUBTRACT S5 FROM D2 + SUBTRACT S5 FROM D3 + SUBTRACT S5 FROM D4 + PERFORM DISPLAY-D. + SUBTRACT S6 FROM D6 + SUBTRACT S6 FROM D7 + SUBTRACT S6 FROM D1 + SUBTRACT S6 FROM D2 + SUBTRACT S6 FROM D3 + SUBTRACT S6 FROM D4 + SUBTRACT S6 FROM D5 + PERFORM DISPLAY-D. + SUBTRACT S7 FROM D7 + SUBTRACT S7 FROM D1 + SUBTRACT S7 FROM D2 + SUBTRACT S7 FROM D3 + SUBTRACT S7 FROM D4 + SUBTRACT S7 FROM D5 + SUBTRACT S7 FROM D6 + PERFORM DISPLAY-D. + GOBACK. + DISPLAY-D. + DISPLAY D1 SPACE + D2 SPACE + D3 SPACE + D4 SPACE + D5 SPACE + D6 SPACE + D7 . + INITIALIZE D1 D2 D3 D4 D5 D6 D7 ALL VALUE. + END PROGRAM float-sub1. + diff --git a/gcc/testsuite/cobol.dg/group2/floating-point_SUBTRACT_FORMAT_1.out b/gcc/testsuite/cobol.dg/group2/floating-point_SUBTRACT_FORMAT_1.out new file mode 100644 index 0000000..39978ac --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/floating-point_SUBTRACT_FORMAT_1.out @@ -0,0 +1,8 @@ +555.55 555.55 555.55 555.55 555.5499878 555.549999999999955 555.5499999999999999999999999999999606 +555.55 555.55 555.55 555.55 555.5499878 555.549999999999955 555.5499999999999999999999999999999606 +555.55 555.55 555.55 555.55 555.5499878 555.549999999999955 555.5499999999999999999999999999999606 +555.55 555.55 555.55 555.55 555.5499878 555.549999999999955 555.5499999999999999999999999999999606 +555.54 555.54 555.54 555.54 555.5499878 555.549999389648406 555.5499993896484374999999999999999724 +555.55 555.55 555.55 555.55 555.5499878 555.549999999999955 555.5500000000000005684341886080801211 +555.54 555.54 555.54 555.54 555.5499878 555.549999999999955 555.5499999999999999999999999999999606 + diff --git a/gcc/testsuite/cobol.dg/group2/floating-point_SUBTRACT_FORMAT_2.cob b/gcc/testsuite/cobol.dg/group2/floating-point_SUBTRACT_FORMAT_2.cob new file mode 100644 index 0000000..fa7d6a1 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/floating-point_SUBTRACT_FORMAT_2.cob @@ -0,0 +1,96 @@ + *> { dg-do run } + *> { dg-output-file "group2/floating-point_SUBTRACT_FORMAT_2.out" } + + IDENTIFICATION DIVISION. + PROGRAM-ID. float-SUBTRACT2. + DATA DIVISION. + WORKING-STORAGE SECTION. + 01 S1 PIC 999V99 DISPLAY VALUE 123.45 . + 01 S2 PIC 999V99 COMP VALUE 123.45 . + 01 S3 PIC 999V99 COMP-3 VALUE 123.45 . + 01 S4 PIC 999V99 COMP-5 VALUE 123.45 . + 01 S5 FLOAT-SHORT VALUE 123.45 . + 01 S6 FLOAT-LONG VALUE 123.45 . + 01 S7 FLOAT-EXTENDED VALUE 123.45 . + 01 D1 PIC 999V99 DISPLAY VALUE 678.55 . + 01 D2 PIC 999V99 COMP VALUE 678.55 . + 01 D3 PIC 999V99 COMP-3 VALUE 678.55 . + 01 D4 PIC 999V99 COMP-5 VALUE 678.55 . + 01 D5 FLOAT-SHORT VALUE 678.55 . + 01 D6 FLOAT-LONG VALUE 678.55 . + 01 D7 FLOAT-EXTENDED VALUE 678.55 . + 01 X1 PIC 999V99 DISPLAY . + 01 X2 PIC 999V99 COMP . + 01 X3 PIC 999V99 COMP-3 . + 01 X4 PIC 999V99 COMP-5 . + 01 X5 FLOAT-SHORT . + 01 X6 FLOAT-LONG . + 01 X7 FLOAT-EXTENDED . + PROCEDURE DIVISION. + SUBTRACT S1 FROM D1 GIVING X1 + SUBTRACT S2 FROM D2 GIVING X2 + SUBTRACT S3 FROM D3 GIVING X3 + SUBTRACT S4 FROM D4 GIVING X4 + SUBTRACT S5 FROM D5 GIVING X5 + SUBTRACT S6 FROM D6 GIVING X6 + SUBTRACT S7 FROM D7 GIVING X7 + PERFORM DISPLAY-X. + SUBTRACT S2 FROM D1 GIVING X1 + SUBTRACT S3 FROM D2 GIVING X2 + SUBTRACT S4 FROM D3 GIVING X3 + SUBTRACT S5 FROM D4 GIVING X4 + SUBTRACT S6 FROM D5 GIVING X5 + SUBTRACT S7 FROM D6 GIVING X6 + SUBTRACT S1 FROM D7 GIVING X7 + PERFORM DISPLAY-X. + SUBTRACT S3 FROM D1 GIVING X1 + SUBTRACT S4 FROM D2 GIVING X2 + SUBTRACT S5 FROM D3 GIVING X3 + SUBTRACT S6 FROM D4 GIVING X4 + SUBTRACT S7 FROM D5 GIVING X5 + SUBTRACT S1 FROM D6 GIVING X6 + SUBTRACT S2 FROM D7 GIVING X7 + PERFORM DISPLAY-X. + SUBTRACT S4 FROM D1 GIVING X1 + SUBTRACT S5 FROM D2 GIVING X2 + SUBTRACT S6 FROM D3 GIVING X3 + SUBTRACT S7 FROM D4 GIVING X4 + SUBTRACT S1 FROM D5 GIVING X5 + SUBTRACT S2 FROM D6 GIVING X6 + SUBTRACT S3 FROM D7 GIVING X7 + PERFORM DISPLAY-X. + SUBTRACT S5 FROM D1 GIVING X1 + SUBTRACT S6 FROM D2 GIVING X2 + SUBTRACT S7 FROM D3 GIVING X3 + SUBTRACT S1 FROM D4 GIVING X4 + SUBTRACT S2 FROM D5 GIVING X5 + SUBTRACT S3 FROM D6 GIVING X6 + SUBTRACT S4 FROM D7 GIVING X7 + PERFORM DISPLAY-X. + SUBTRACT S6 FROM D1 GIVING X1 + SUBTRACT S7 FROM D2 GIVING X2 + SUBTRACT S1 FROM D3 GIVING X3 + SUBTRACT S2 FROM D4 GIVING X4 + SUBTRACT S3 FROM D5 GIVING X5 + SUBTRACT S4 FROM D6 GIVING X6 + SUBTRACT S5 FROM D7 GIVING X7 + PERFORM DISPLAY-X. + SUBTRACT S7 FROM D1 GIVING X1 + SUBTRACT S1 FROM D2 GIVING X2 + SUBTRACT S2 FROM D3 GIVING X3 + SUBTRACT S3 FROM D4 GIVING X4 + SUBTRACT S4 FROM D5 GIVING X5 + SUBTRACT S5 FROM D6 GIVING X6 + SUBTRACT S6 FROM D7 GIVING X7 + PERFORM DISPLAY-X. + GOBACK. + DISPLAY-X. + DISPLAY X1 SPACE + X2 SPACE + X3 SPACE + X4 SPACE + X5 SPACE + X6 SPACE + X7 . + END PROGRAM float-SUBTRACT2. + diff --git a/gcc/testsuite/cobol.dg/group2/floating-point_SUBTRACT_FORMAT_2.out b/gcc/testsuite/cobol.dg/group2/floating-point_SUBTRACT_FORMAT_2.out new file mode 100644 index 0000000..e0bf4c9 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/floating-point_SUBTRACT_FORMAT_2.out @@ -0,0 +1,8 @@ +555.10 555.10 555.10 555.10 555.0999756 555.100000000000023 555.1000000000000000000000000000000197 +555.10 555.10 555.10 555.10 555.0999756 555.100000000000023 555.1000000000000000000000000000000197 +555.10 555.10 555.10 555.10 555.0999756 555.100000000000023 555.1000000000000000000000000000000197 +555.10 555.10 555.10 555.10 555.0999756 555.100000000000023 555.1000000000000000000000000000000197 +555.10 555.10 555.10 555.10 555.0999756 555.100000000000023 555.1000000000000000000000000000000197 +555.10 555.10 555.10 555.10 555.0999756 555.100000000000023 555.1000000000000000000000000000000197 +555.10 555.10 555.10 555.10 555.0999756 555.100000000000023 555.1000000000000000000000000000000197 + diff --git a/gcc/testsuite/cobol.dg/group2/floating-point_literals.cob b/gcc/testsuite/cobol.dg/group2/floating-point_literals.cob new file mode 100644 index 0000000..51d823207 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/floating-point_literals.cob @@ -0,0 +1,48 @@ + *> { dg-do run } + *> { dg-output-file "group2/floating-point_literals.out" } + + IDENTIFICATION DIVISION. + PROGRAM-ID. float-literal. + DATA DIVISION. + WORKING-STORAGE SECTION. + 01 D1 PIC 999V9999 DISPLAY . + 01 D2 PIC 999V9999 COMP . + 01 D3 PIC 999V9999 COMP-3 . + 01 D4 PIC 999V9999 COMP-5 . + 01 D5 FLOAT-SHORT . + 01 D6 FLOAT-LONG . + 01 D7 FLOAT-EXTENDED . + PROCEDURE DIVISION. + DISPLAY -555 + DISPLAY -555.55 + DISPLAY -555.55e206 + DISPLAY 555 + DISPLAY 555.55 + DISPLAY 555.55e206 + MOVE 333.33 TO D1 + MOVE 333.33 TO D2 + MOVE 333.33 TO D3 + MOVE 333.33 TO D4 + MOVE 333.33e20 TO D5 + MOVE 333.33e100 TO D6 + MOVE 333.33e200 TO D7 + PERFORM DISPLAY-D. + ADD 222.22 TO D1 + ADD 222.22 TO D2 + ADD 222.22 TO D3 + ADD 222.22 TO D4 + ADD 222.22e20 TO D5 + ADD 222.22e100 TO D6 + ADD 222.22e200 TO D7 + PERFORM DISPLAY-D. + GOBACK. + DISPLAY-D. + DISPLAY D1 SPACE + D2 SPACE + D3 SPACE + D4 SPACE + D5 SPACE + D6 SPACE + D7 . + END PROGRAM float-literal. + diff --git a/gcc/testsuite/cobol.dg/group2/floating-point_literals.out b/gcc/testsuite/cobol.dg/group2/floating-point_literals.out new file mode 100644 index 0000000..6417d01 --- /dev/null +++ b/gcc/testsuite/cobol.dg/group2/floating-point_literals.out @@ -0,0 +1,9 @@ +-555 +-555.55 +-5.5555E+208 +555 +555.55 +5.5555E+208 +333.3300 333.3300 333.3300 333.3300 3.333300083E+22 3.33329999999999994E+102 3.333300000000000000000000000000000168E+202 +555.5500 555.5500 555.5500 555.5500 5.555499988E+22 5.55549999999999973E+102 5.555500000000000000000000000000000029E+202 + diff --git a/gcc/testsuite/g++.dg/abi/pure-virtual1.C b/gcc/testsuite/g++.dg/abi/pure-virtual1.C index 59eaf22..ce7cd70 100644 --- a/gcc/testsuite/g++.dg/abi/pure-virtual1.C +++ b/gcc/testsuite/g++.dg/abi/pure-virtual1.C @@ -1,6 +1,6 @@ // Test that we don't need libsupc++ just for __cxa_pure_virtual. // { dg-do link } -// { dg-require-weak } +// { dg-require-weak "" } // { dg-additional-options "-fno-rtti -nostdlib++" } // { dg-additional-options "-Wl,-undefined,dynamic_lookup" { target *-*-darwin* } } // { dg-xfail-if "AIX weak" { powerpc-ibm-aix* } } diff --git a/gcc/testsuite/g++.dg/cpp0x/gen-attrs-6.C b/gcc/testsuite/g++.dg/cpp0x/gen-attrs-6.C index 54071d5..d166add 100644 --- a/gcc/testsuite/g++.dg/cpp0x/gen-attrs-6.C +++ b/gcc/testsuite/g++.dg/cpp0x/gen-attrs-6.C @@ -4,7 +4,7 @@ // // Written by Richard Henderson, 26 May 2002. -// { dg-do link { target c++11} } +// { dg-do link { target c++11 } } extern void foo [[gnu::nothrow]] (); extern void link_error(); diff --git a/gcc/testsuite/g++.dg/cpp0x/udlit-namespace-ambiguous.C b/gcc/testsuite/g++.dg/cpp0x/udlit-namespace-ambiguous.C index c67be390..1ba4c8d 100644 --- a/gcc/testsuite/g++.dg/cpp0x/udlit-namespace-ambiguous.C +++ b/gcc/testsuite/g++.dg/cpp0x/udlit-namespace-ambiguous.C @@ -1,9 +1,9 @@ // { dg-do compile { target c++11 } } -int operator""_t (long long unsigned); // { dg-message "note: candidate"} +int operator""_t (long long unsigned); // { dg-message "note: candidate" } namespace foo { - int operator""_t (long long unsigned); // { dg-message "note: candidate"} + int operator""_t (long long unsigned); // { dg-message "note: candidate" } } using namespace foo; diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-init21.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-init21.C index f5e1b3e..1014292 100644 --- a/gcc/testsuite/g++.dg/cpp2a/constexpr-init21.C +++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-init21.C @@ -20,7 +20,7 @@ constexpr A<int> a4(4); // { dg-error "not a constant expression|incompletely in struct s { int n; }; constexpr A<s> b; -constexpr A<s> b0(0); // { dg-error "not a constant expression|incompletely initialized" } +constexpr A<s> b0(0); // { dg-error "not a constant expression|incompletely initialized" } struct empty {}; constexpr A<empty> c; diff --git a/gcc/testsuite/g++.dg/cpp2a/lambda-targ11.C b/gcc/testsuite/g++.dg/cpp2a/lambda-targ11.C new file mode 100644 index 0000000..9f2f743 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/lambda-targ11.C @@ -0,0 +1,13 @@ +// PR c++/119401 +// { dg-do compile { target c++20 } } + +template <auto> +struct B {}; +template <int N> +struct A { + void f(B<[]{}>) {} +}; +auto t = &A<0>::f; + +// A<0>::f(B<A<0>::{lambda()#1}{}>) +// { dg-final { scan-assembler "_ZN1AILi0EE1fE1BIXtlNS0_UlvE_EEEE" { xfail *-*-* } } } diff --git a/gcc/testsuite/g++.dg/cpp2a/lambda-targ12.C b/gcc/testsuite/g++.dg/cpp2a/lambda-targ12.C new file mode 100644 index 0000000..bb3f701 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/lambda-targ12.C @@ -0,0 +1,13 @@ +// PR c++/119401 +// { dg-do compile { target c++20 } } + +template <class> +struct B {}; +template <int N> +struct A { + void f(B<decltype([]{})>) {} +}; +auto t = &A<0>::f; + +// A<0>::f(B<A<0>::{lambda()#1}>) +// { dg-final { scan-assembler "_ZN1AILi0EE1fE1BINS0_UlvE_EE" { xfail *-*-* } } } diff --git a/gcc/testsuite/g++.dg/cpp2a/lambda-uneval26.C b/gcc/testsuite/g++.dg/cpp2a/lambda-uneval26.C new file mode 100644 index 0000000..3e3097b --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/lambda-uneval26.C @@ -0,0 +1,10 @@ +// PR c++/116960 +// { dg-do compile { target c++20 } } + +template<auto> +using Foo = decltype([](auto) { return 0; }(0)); + +template<typename...> +Foo<[] {}> foo() {} // { dg-warning "no return statement" } + +auto t = foo(); diff --git a/gcc/testsuite/g++.dg/diagnostic/unclosed-extern-c.C b/gcc/testsuite/g++.dg/diagnostic/unclosed-extern-c.C index 4dad8a2..a5ca8de 100644 --- a/gcc/testsuite/g++.dg/diagnostic/unclosed-extern-c.C +++ b/gcc/testsuite/g++.dg/diagnostic/unclosed-extern-c.C @@ -9,5 +9,5 @@ void bar (void); // { dg-message "1: 'extern .C.' linkage started here" "" { target *-*-* } open_extern_c } void test (void); -// { message "12: to match this '.'" "" { target *-*-* } open_extern_c } +// { dg-message "12: to match this '.'" "" { target *-*-* } open_extern_c } /* { dg-error "18:expected '.' at end of input" "" { target *-*-* } .-2 } */ diff --git a/gcc/testsuite/g++.dg/diagnostic/wrong-tag-1.C b/gcc/testsuite/g++.dg/diagnostic/wrong-tag-1.C index 2cf75f8..05ad326 100644 --- a/gcc/testsuite/g++.dg/diagnostic/wrong-tag-1.C +++ b/gcc/testsuite/g++.dg/diagnostic/wrong-tag-1.C @@ -1,4 +1,4 @@ // Origin PR c++/51427 -typedef struct _GMutex GMutex; // { dg-message "previously declared here"} +typedef struct _GMutex GMutex; // { dg-message "previously declared here" } typedef union _GMutex GMutex; // { dg-error "tag used in naming" } diff --git a/gcc/testsuite/g++.dg/gcov/gcov-22.C b/gcc/testsuite/g++.dg/gcov/gcov-22.C new file mode 100644 index 0000000..69e0728 --- /dev/null +++ b/gcc/testsuite/g++.dg/gcov/gcov-22.C @@ -0,0 +1,170 @@ +/* { dg-options "--coverage -fpath-coverage" } */ +/* { dg-do compile } */ + +#include <stdexcept> + +/* This test is a collection of odd CFG shapes which has been shown to + trigger ICEs. */ + +/* A hard abort-like exit could lead to paths with only the exit node, + which would then be an empty path after entry/exit prunng. + + BEGIN paths + summary: 0/1 */ +void xabort () { __builtin_exit (0); } +/* END */ + +/* Unconditional exceptions have the same effect as aborts + w.r.t. empty paths. */ +int throws (int) { throw std::runtime_error("exception"); } + +int _setjmp (void **); +/* Bad instrumentation would give + 'error: returns_twice call is not first in basic block 3'. + + BEGIN paths + summary: 0/1 */ +void set_jmp () +/* END */ +{ + _setjmp (0); +} + +/* From g++.dg/torture/pr83482.C */ +void a(); +struct b { + virtual long c() { return 0L; } + void m_fn2() { c(); } +} d; + +/* BEGIN paths + summary: 0/3 */ +void e() { +/* END */ + d.m_fn2(); + try { + a(); + _setjmp(0); + } catch (...) { + } +} + +/* BEGIN paths + summary: 0/1 */ +void multiple_setjmp () +/* END */ +{ + _setjmp (0); + _setjmp (0); +} + +/* loop_setjmp and loop_setjmp_continue are based on patterns found in + expat-2.5.0 tests/minicheck.c srunner_run_all. */ +void loop_setjmp (int n) +{ + for (int i = 0; i < n; ++i) + _setjmp (0); +} + +void loop_setjmp_continue (int n) +{ + for (int i = 0; i < n; ++i) + { + if (i < n / 4) + if (_setjmp (0)) + continue; + + if (_setjmp (0)) + continue; + + if (i < n / 2) + if (_setjmp (0)) + continue; + } +} + +void loop_setjmp_infinite (int n) +{ + for (;;) + _setjmp (0); +} + +/* BEGIN paths + summary: 0/2 */ +void multiple_conditional_setjmp (int a) +/* END */ +{ + if (a) + _setjmp (0); + else + _setjmp (0); + + _setjmp (0); +} + +/* Infinite loops can create CFGs that are a bit different, e.g. no edge for + skipping or brekaing out of the loop. */ +int id (int x) { return x; } +int infinite1 () +{ + for (int c = 0; ; c++) id (c); +} + +void infinite2 () +{ + for (;;) {} +} + +/* This function has multiple SCCs (loops), but one has too many internal paths + (2^32). If the scc-internal-paths is not limited this function will not + compile in reasonable time. */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wcoverage-too-many-paths" +void too_many_paths_single_scc (int x) +{ + int z = 0; + int c = 0; + + for (int i = 0; i != x; ++i) + for (int k = i; k != x; ++k) + c++; + + for (int i = 0; i != 100; ++i) + { + if (z + i + 0 < x) z++; + if (z + i + 1 < x) z++; + if (z + i + 2 < x) z++; + if (z + i + 3 < x) z++; + if (z + i + 4 < x) z++; + if (z + i + 5 < x) z++; + if (z + i + 6 < x) z++; + if (z + i + 7 < x) z++; + if (z + i + 8 < x) z++; + if (z + i + 9 < x) z++; + if (z + i + 10 < x) z++; + if (z + i + 11 < x) z++; + if (z + i + 12 < x) z++; + if (z + i + 13 < x) z++; + if (z + i + 14 < x) z++; + if (z + i + 15 < x) z++; + if (z + i + 16 < x) z++; + if (z + i + 17 < x) z++; + if (z + i + 18 < x) z++; + if (z + i + 19 < x) z++; + if (z + i + 20 < x) z++; + if (z + i + 21 < x) z++; + if (z + i + 22 < x) z++; + if (z + i + 23 < x) z++; + if (z + i + 24 < x) z++; + if (z + i + 25 < x) z++; + if (z + i + 26 < x) z++; + if (z + i + 27 < x) z++; + if (z + i + 28 < x) z++; + if (z + i + 29 < x) z++; + if (z + i + 30 < x) z++; + if (z + i + 31 < x) z++; + } +} +#pragma GCC diagnostic pop + +/* { dg-final { run-gcov prime-paths { --prime-paths gcov-22.C } } } */ diff --git a/gcc/testsuite/g++.dg/gcov/gcov-23-1.h b/gcc/testsuite/g++.dg/gcov/gcov-23-1.h new file mode 100644 index 0000000..ae38cad --- /dev/null +++ b/gcc/testsuite/g++.dg/gcov/gcov-23-1.h @@ -0,0 +1,9 @@ +#include <string> +struct fst { + static fst& instance () + { + static fst self; + return self; + } + std::string data; +}; diff --git a/gcc/testsuite/g++.dg/gcov/gcov-23-2.h b/gcc/testsuite/g++.dg/gcov/gcov-23-2.h new file mode 100644 index 0000000..89dd0dd --- /dev/null +++ b/gcc/testsuite/g++.dg/gcov/gcov-23-2.h @@ -0,0 +1,9 @@ +#include <string> +struct snd { + static snd& instance () + { + static snd self; + return self; + } + std::string data; +}; diff --git a/gcc/testsuite/g++.dg/gcov/gcov-23.C b/gcc/testsuite/g++.dg/gcov/gcov-23.C new file mode 100644 index 0000000..60fe9e0 --- /dev/null +++ b/gcc/testsuite/g++.dg/gcov/gcov-23.C @@ -0,0 +1,30 @@ +/* { dg-options "-fpath-coverage --coverage" } */ +/* { dg-do run { target native } } */ + +#include "gcov-23-1.h" +#include "gcov-23-2.h" + +/* This tests a very specific interaction between destructors of static objects + and gcov's inlining aware printing of prime paths. The source of the + problem is that gcc will reuse the compiler generated destructor gimple stmt + from the first static-object destructor, and its location will be recorded + in the .gcno file. This would lead to an empty block.locations vector since + the stmt is not anchored to a source line (being generated and all), but the + block itself would be originating in a different file. + + Without properly guarding the block.loc.lines access this code caused a + segfault in gcov. The class needed a non-trivial member or otherwise + non-trivial constructor to emit approximately + + __cxxabiv1::__cxa_atexit (__dt_comp , &self, &__dso_handle); + + Triggering the failure needed the path to also be printed, so it is + important to request both covered and uncovered paths. */ + +int main () +{ + fst::instance().data = "foo"; + snd::instance().data = "bar"; +} + +/* { dg-final { run-gcov { --prime-paths-source=both --prime-paths-lines=both gcov-23.C } } } */ diff --git a/gcc/testsuite/g++.dg/gomp/append-args-1.C b/gcc/testsuite/g++.dg/gomp/append-args-1.C index 25ea4c2..4e13905 100644 --- a/gcc/testsuite/g++.dg/gomp/append-args-1.C +++ b/gcc/testsuite/g++.dg/gomp/append-args-1.C @@ -97,10 +97,10 @@ test (int *a, int *b) #pragma omp dispatch base99 (); - #pragma omp dispatch interop ( obj1 ) // { dg-message "sorry" } + #pragma omp dispatch interop ( obj1 ) base2<int *, omp_interop_t> (b, omp_interop_none); - #pragma omp dispatch interop ( obj1 ) // { dg-message "sorry" } + #pragma omp dispatch interop ( obj1 ) base2<int *, int *> (b, a); #pragma omp dispatch interop ( obj1 ) diff --git a/gcc/testsuite/g++.dg/gomp/append-args-8.C b/gcc/testsuite/g++.dg/gomp/append-args-8.C new file mode 100644 index 0000000..786a2b3 --- /dev/null +++ b/gcc/testsuite/g++.dg/gomp/append-args-8.C @@ -0,0 +1,93 @@ +/* { dg-additional-options "-fdump-tree-gimple" } */ + +/* The following definitions are in omp_lib, which cannot be included +gcc/testsuite/g++.dg/gomp/append-args-1.C in gcc/testsuite/ */ + +#if __cplusplus >= 201103L +# define __GOMP_UINTPTR_T_ENUM : __UINTPTR_TYPE__ +#else +# define __GOMP_UINTPTR_T_ENUM +#endif + +typedef enum omp_interop_t __GOMP_UINTPTR_T_ENUM +{ + omp_interop_none = 0, + __omp_interop_t_max__ = __UINTPTR_MAX__ +} omp_interop_t; + + +template<typename T, typename T2, typename T3> +void repl2(T, T2, T3, T3); +#pragma omp declare variant(repl2) match(construct={dispatch}) adjust_args(need_device_ptr : y) \ + append_args(interop(target, targetsync, prefer_type(1)), \ + interop(prefer_type({fr(3), attr("ompx_nop")},{fr(2)},{attr("ompx_all")}))) +template<typename T, typename T2> +void base2(T x, T2 y); + + + +template<typename T, typename T2> +void repl3(T, T2, T2, T2, ...); +#pragma omp declare variant(repl3) match(construct={dispatch}) \ + append_args( interop(target, prefer_type("cuda", "hsa")), \ + interop(targetsync), \ + interop(prefer_type({attr("ompx_nop")})) ) +template<typename T> +void base3(T, ...); + + + + +float +test (int *a, int *b) +{ + omp_interop_t obj1, obj2; + float x, y; + + #pragma omp dispatch interop ( obj1 ) + base2<int *, int *> (b, a); + + #pragma omp dispatch nocontext(1) + base3<int*>(a, 1, 2, "abc"); + + #pragma omp dispatch + base3<int*>(a, 1, 2, "abc"); + + return x; +} + +/* { dg-final { scan-tree-dump-times "base3<int\\*> \\(a, 1, 2, \"abc\"\\);" 1 "gimple" } } */ + +/* { dg-final { scan-tree-dump-times "unsigned.* \\* interopobjs.\[0-9\]+\\\[1\\\];" 1 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "unsigned.* \\* interopobjs.\[0-9\]+\\\[3\\\];" 1 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "int tgt_tgtsync.\[0-9\]+\\\[1\\\];" 1 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "int tgt_tgtsync.\[0-9\]+\\\[3\\\];" 1 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "const char \\* pref_type.\[0-9\]+\\\[1\\\];" 1 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "const char \\* pref_type.\[0-9\]+\\\[3\\\];" 1 "gimple" } } */ + +/* { dg-final { scan-tree-dump-times "interopobjs.\[0-9\]+\\\[0\\\] = &interop\\.\[0-9\]+;" 2 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "interopobjs.\[0-9\]+\\\[1\\\] = &interop\\.\[0-9\]+;" 1 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "interopobjs.\[0-9\]+\\\[2\\\] = &interop\\.\[0-9\]+;" 1 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "tgt_tgtsync.\[0-9\]+\\\[0\\\] = 0;" 1 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "tgt_tgtsync.\[0-9\]+\\\[0\\\] = 1;" 1 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "tgt_tgtsync.\[0-9\]+\\\[1\\\] = 2;" 1 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "tgt_tgtsync.\[0-9\]+\\\[2\\\] = 0;" 1 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "pref_type.\[0-9\]+\\\[0\\\] = \"\\\\x80\\\\x03\\\\x80ompx_nop\\\\x00\\\\x00\\\\x80\\\\x02\\\\x80\\\\x00\\\\x80\\\\x80ompx_all\\\\x00\\\\x00\";" 1 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "pref_type.\[0-9\]+\\\[0\\\] = \"\\\\x80\\\\x01\\\\x80\\\\x00\\\\x80\\\\x07\\\\x80\\\\x00\";" 1 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "pref_type.\[0-9\]+\\\[1\\\] = 0B;" 1 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "pref_type.\[0-9\]+\\\[2\\\] = \"\\\\x80\\\\x80ompx_nop\\\\x00\\\\x00\";" 1 "gimple" } } */ + + +/* { dg-final { scan-tree-dump-times "D\.\[0-9\]+ = __builtin_omp_get_interop_int \\(obj1, -5, 0B\\);" 1 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "D\.\[0-9\]+ = __builtin_omp_get_default_device \\(\\);" 1 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "__builtin_omp_set_default_device \\(D\.\[0-9\]+\\);" 2 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "D\.\[0-9\]+ = __builtin_omp_get_mapped_ptr \\(a, D\.\[0-9\]+\\);" 1 "gimple" } } */ + +/* { dg-final { scan-tree-dump-times "__builtin_GOMP_interop \\(D\.\[0-9\]+, 1, interopobjs\.\[0-9\], tgt_tgtsync\.\[0-9\]+, pref_type.2, 0, 0B, 0, 0B, 0, 0B\\);" 1 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "repl2<int\\*, int\\*, omp_interop_t> \\(b, D\.\[0-9\]+, obj1, interop\.\[0-9\]+\\);" 1 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "__builtin_GOMP_interop \\(D\.\[0-9\]+, 0, 0B, 0B, 0B, 0, 0B, 1, interopobjs\.\[0-9\]+, 0, 0B\\);" 1 "gimple" } } */ + + +/* { dg-final { scan-tree-dump-times "__builtin_GOMP_interop \\(-5, 0, 0B, 0B, 0B, 0, 0B, 3, interopobjs\.\[0-9\]+, 0, 0B\\);" 1 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "repl3<int\\*, omp_interop_t> \\(a, interop\.\[0-9\]+, interop\.\[0-9\]+, interop\.\[0-9\]+, 1, 2, \"abc\"\\);" 1 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "__builtin_GOMP_interop \\(-5, 3, interopobjs\.\[0-9\]+, tgt_tgtsync\.\[0-9\]+, pref_type\.\[0-9\]+, 0, 0B, 0, 0B, 0, 0B\\);" 1 "gimple" } } */ diff --git a/gcc/testsuite/g++.dg/init/self1.C b/gcc/testsuite/g++.dg/init/self1.C index 2fc5aa6..f9e9951 100644 --- a/gcc/testsuite/g++.dg/init/self1.C +++ b/gcc/testsuite/g++.dg/init/self1.C @@ -9,7 +9,7 @@ void f(__SIZE_TYPE__) { int main() { - int* const savepos = sizeof(*savepos) ? 0 : 0; /* { dg-error "invalid conversion" "convert" { target c++11 } } */ + int* const savepos = sizeof(*savepos) ? 0 : 0; /* { dg-error "invalid conversion" "convert" { target c++11 } } */ f (sizeof (*savepos)); diff --git a/gcc/testsuite/g++.dg/modules/attrib-3_a.H b/gcc/testsuite/g++.dg/modules/attrib-3_a.H new file mode 100644 index 0000000..d1f672a --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/attrib-3_a.H @@ -0,0 +1,16 @@ +// PR c++/118920 +// { dg-additional-options "-fmodule-header" } +// { dg-module-cmi {} } + +struct [[gnu::abi_tag("a", "b")]] A; +struct [[gnu::abi_tag("a", "b")]] B; +struct [[gnu::abi_tag("c")]] C; +struct D; +struct E; + +[[gnu::abi_tag("f")]] void f(); +void g(); +[[gnu::abi_tag("x", "y")]] void h(); + +[[gnu::abi_tag("test", "some", "more")]] extern int i; +[[gnu::abi_tag("test", "some", "more")]] extern int j; diff --git a/gcc/testsuite/g++.dg/modules/attrib-3_b.C b/gcc/testsuite/g++.dg/modules/attrib-3_b.C new file mode 100644 index 0000000..557c18b --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/attrib-3_b.C @@ -0,0 +1,30 @@ +// PR c++/118920 +// { dg-additional-options "-fmodules -fno-module-lazy" } + +struct A {}; // { dg-message "existing declaration here" } +struct [[gnu::abi_tag("b", "a")]] B; // OK +struct [[gnu::abi_tag("x")]] C; // { dg-message "existing declaration here" } +struct [[gnu::abi_tag("d")]] D; // { dg-message "existing declaration here" } + +void f(); // { dg-message "existing declaration here" } +[[gnu::abi_tag("g")]] void g(); // { dg-message "existing declaration here" } +[[gnu::abi_tag("y", "x")]] void h(); // OK + +[[gnu::abi_tag("more", "test")]] extern int i; // { dg-message "existing declaration here" } +[[gnu::abi_tag("more", "test", "really", "some")]] extern int j; // { dg-message "existing declaration here" } + +import "attrib-3_a.H"; + +struct [[gnu::abi_tag("e")]] E; // { dg-error "adds abi tag" } + +// { dg-error "mismatching abi tags for .struct A." "" { target *-*-* } 0 } +// B is OK +// { dg-error "mismatching abi tags for .struct C." "" { target *-*-* } 0 } +// { dg-error "mismatching abi tags for .struct D." "" { target *-*-* } 0 } + +// { dg-error "mismatching abi tags for .void f()." "" { target *-*-* } 0 } +// { dg-error "mismatching abi tags for .void g()." "" { target *-*-* } 0 } +// h is OK + +// { dg-error "mismatching abi tags for .i." "" { target *-*-* } 0 } +// { dg-error "mismatching abi tags for .j." "" { target *-*-* } 0 } diff --git a/gcc/testsuite/g++.dg/modules/friend-9_a.C b/gcc/testsuite/g++.dg/modules/friend-9_a.C new file mode 100644 index 0000000..ca95027 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/friend-9_a.C @@ -0,0 +1,13 @@ +// { dg-additional-options -fmodules } +// { dg-module-cmi M } +// { dg-module-do link } + +export module M; + +export template <class T> struct A +{ + template <class U> friend void f (U); +}; + +template <class U> +void f(U u) { } diff --git a/gcc/testsuite/g++.dg/modules/friend-9_b.C b/gcc/testsuite/g++.dg/modules/friend-9_b.C new file mode 100644 index 0000000..9f58379 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/friend-9_b.C @@ -0,0 +1,13 @@ +// { dg-additional-options -fmodules } + +// Check that f and A are mangled as attached to M. +// void f@M<A@M<main::loc> >(A@M<main::loc>) +// { dg-final { scan-assembler "_ZW1M1fIS_1AIZ4mainE3locEEvT_" } } + +import M; + +int main() +{ + struct loc {}; + f(A<loc>()); +} diff --git a/gcc/testsuite/g++.dg/modules/lto-1.h b/gcc/testsuite/g++.dg/modules/lto-1.h new file mode 100644 index 0000000..935f1de --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/lto-1.h @@ -0,0 +1,13 @@ +template <typename> struct S { + S() {} +}; +template <typename> inline int x = 0; + +extern template struct S<char>; +extern template int x<char>; + +template <typename> int* foo() { + static int x; + return &x; +}; +extern template int* foo<char>(); diff --git a/gcc/testsuite/g++.dg/modules/lto-1_a.H b/gcc/testsuite/g++.dg/modules/lto-1_a.H new file mode 100644 index 0000000..6ea294d --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/lto-1_a.H @@ -0,0 +1,9 @@ +// PR c++/118961 +// { dg-additional-options "-fmodule-header" } +// { dg-module-cmi {} } +// Test explicit instantiations get emitted with LTO + +#include "lto-1.h" +template struct S<char>; +template int x<char>; +template int* foo<char>(); diff --git a/gcc/testsuite/g++.dg/modules/lto-1_b.C b/gcc/testsuite/g++.dg/modules/lto-1_b.C new file mode 100644 index 0000000..75d9a801 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/lto-1_b.C @@ -0,0 +1,9 @@ +// PR c++/118961 +// { dg-require-effective-target lto } +// { dg-additional-options "-fmodules -flto" } + +#include "lto-1.h" + +S<char> s; +int y = x<char>; +int* p = foo<char>(); diff --git a/gcc/testsuite/g++.dg/modules/lto-1_c.C b/gcc/testsuite/g++.dg/modules/lto-1_c.C new file mode 100644 index 0000000..ffd4595 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/lto-1_c.C @@ -0,0 +1,8 @@ +// PR c++/118961 +// { dg-module-do link } +// { dg-require-effective-target lto } +// { dg-additional-options "-fmodules -fno-module-lazy -flto" } + +#include "lto-1_a.H" + +int main() {} diff --git a/gcc/testsuite/g++.dg/modules/lto-2_a.H b/gcc/testsuite/g++.dg/modules/lto-2_a.H new file mode 100644 index 0000000..f817329 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/lto-2_a.H @@ -0,0 +1,11 @@ +// PR c++/118961 +// { dg-additional-options "-fmodule-header -std=c++20" } +// { dg-module-cmi {} } +// Test we correctly emit the bodies of cloned constructors. + +template <typename> +struct S { + S() requires true {} +}; + +inline S<int> foo() { return {}; } diff --git a/gcc/testsuite/g++.dg/modules/lto-2_b.C b/gcc/testsuite/g++.dg/modules/lto-2_b.C new file mode 100644 index 0000000..340ff48 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/lto-2_b.C @@ -0,0 +1,9 @@ +// PR c++/118961 +// { dg-module-do link } +// { dg-require-effective-target lto } +// { dg-additional-options "-fmodules -flto -std=c++20" } + +import "lto-2_a.H"; +int main() { + foo(); +} diff --git a/gcc/testsuite/g++.dg/modules/lto-3_a.H b/gcc/testsuite/g++.dg/modules/lto-3_a.H new file mode 100644 index 0000000..be63699 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/lto-3_a.H @@ -0,0 +1,6 @@ +// PR c++/118961 +// { dg-additional-options "-fmodule-header -std=c++20" } +// { dg-module-cmi {} } +// We shouldn't ICE when linking against the standard library. + +#include <string> diff --git a/gcc/testsuite/g++.dg/modules/lto-3_b.C b/gcc/testsuite/g++.dg/modules/lto-3_b.C new file mode 100644 index 0000000..f459596 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/lto-3_b.C @@ -0,0 +1,10 @@ +// PR c++/118961 +// { dg-module-do link } +// { dg-require-effective-target lto } +// { dg-additional-options "-fmodules -flto -static -std=c++20" } + +import "lto-3_a.H"; + +int main() { + std::string m_message; +} diff --git a/gcc/testsuite/g++.dg/modules/pr118920.h b/gcc/testsuite/g++.dg/modules/pr118920.h new file mode 100644 index 0000000..73d38b5 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr118920.h @@ -0,0 +1,3 @@ +template <typename T> struct out_ptr_t { + operator int() const; +}; diff --git a/gcc/testsuite/g++.dg/modules/pr118920_a.H b/gcc/testsuite/g++.dg/modules/pr118920_a.H new file mode 100644 index 0000000..75023b3 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr118920_a.H @@ -0,0 +1,4 @@ +// { dg-additional-options "-fmodule-header" } +// { dg-module-cmi {} } + +#include "pr118920.h" diff --git a/gcc/testsuite/g++.dg/modules/pr118920_b.H b/gcc/testsuite/g++.dg/modules/pr118920_b.H new file mode 100644 index 0000000..23e37a6 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr118920_b.H @@ -0,0 +1,12 @@ +// { dg-additional-options "-fmodule-header" } +// { dg-module-cmi {} } + +template <typename T> struct __shared_ptr { + template <typename> friend struct out_ptr_t; +}; +inline namespace __cxx11 __attribute__((__abi_tag__)) { + struct _Impl; +} +struct path { + __shared_ptr<_Impl> _M_impl; +}; diff --git a/gcc/testsuite/g++.dg/modules/pr118920_c.C b/gcc/testsuite/g++.dg/modules/pr118920_c.C new file mode 100644 index 0000000..b1b6c71 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr118920_c.C @@ -0,0 +1,5 @@ +// { dg-additional-options "-fmodules -fno-module-lazy" } + +#include "pr118920.h" +import "pr118920_b.H"; +import "pr118920_a.H"; diff --git a/gcc/testsuite/g++.dg/modules/tpl-friend-17.h b/gcc/testsuite/g++.dg/modules/tpl-friend-17.h new file mode 100644 index 0000000..429ab3d --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/tpl-friend-17.h @@ -0,0 +1,8 @@ +// PR c++/118920 + +template <typename> struct unique_ptr { + template <typename> friend class out_ptr_t; +}; +template <typename> struct shared_ptr { + template <typename> friend class out_ptr_t; +}; diff --git a/gcc/testsuite/g++.dg/modules/tpl-friend-17_a.C b/gcc/testsuite/g++.dg/modules/tpl-friend-17_a.C new file mode 100644 index 0000000..7c5a3ac --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/tpl-friend-17_a.C @@ -0,0 +1,9 @@ +// PR c++/118920 +// { dg-additional-options "-fmodules" } +// { dg-module-cmi M } + +module; +#include "tpl-friend-17.h" +export module M; +unique_ptr<int> s; +export template <typename> void foo() { shared_ptr<int> u; } diff --git a/gcc/testsuite/g++.dg/modules/tpl-friend-17_b.C b/gcc/testsuite/g++.dg/modules/tpl-friend-17_b.C new file mode 100644 index 0000000..33586e6 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/tpl-friend-17_b.C @@ -0,0 +1,11 @@ +// PR c++/118920 +// { dg-additional-options "-fmodules" } + +#include "tpl-friend-17.h" +import M; + +int main() { + // instantiating shared_ptr<int> should find previously generated + // out_ptr_t template from the unique_ptr<int> instantiation + foo<int>(); +} diff --git a/gcc/testsuite/g++.dg/opt/musttail2.C b/gcc/testsuite/g++.dg/opt/musttail2.C index ee55c1a..d12fcb2 100644 --- a/gcc/testsuite/g++.dg/opt/musttail2.C +++ b/gcc/testsuite/g++.dg/opt/musttail2.C @@ -4,7 +4,12 @@ // { dg-final { scan-tree-dump-times " \[^\n\r]* = foo \\\(\[^\n\r]*\\\); \\\[tail call\\\] \\\[must tail call\\\]" 1 "optimized" } } struct S { S () {} }; -char *foo (S); + +[[gnu::noipa]] char * +foo (S) +{ + return 0; +} char * bar (S) diff --git a/gcc/testsuite/g++.dg/opt/pr119518.C b/gcc/testsuite/g++.dg/opt/pr119518.C new file mode 100644 index 0000000..152b880 --- /dev/null +++ b/gcc/testsuite/g++.dg/opt/pr119518.C @@ -0,0 +1,20 @@ +// PR c++/119518 +// { dg-do compile } +// { dg-options "-O2 -fdump-tree-optimized" } +// { dg-final { scan-tree-dump "S::~S \\\(&s\\\)" "optimized" } } + +[[gnu::noipa, noreturn]] void +foo () +{ + for (;;) + ; +} + +struct S { ~S (); }; + +void +bar () +{ + S s; + foo (); +} diff --git a/gcc/testsuite/g++.dg/opt/pr98743.C b/gcc/testsuite/g++.dg/opt/pr98743.C index 41f476f..9380ff2 100644 --- a/gcc/testsuite/g++.dg/opt/pr98743.C +++ b/gcc/testsuite/g++.dg/opt/pr98743.C @@ -1,6 +1,6 @@ // Test for value-initialization via {} // { dg-do run { target c++11 } } -/* { dg-options "-Og -fno-early-inlining -finline-small-functions -fpack-struct" */ +/* { dg-options "-Og -fno-early-inlining -finline-small-functions -fpack-struct" } */ void * operator new (__SIZE_TYPE__, void *p) { return p; } void * operator new[] (__SIZE_TYPE__, void *p) { return p; } diff --git a/gcc/testsuite/g++.dg/parse/error8.C b/gcc/testsuite/g++.dg/parse/error8.C index 135f078..14b2c86 100644 --- a/gcc/testsuite/g++.dg/parse/error8.C +++ b/gcc/testsuite/g++.dg/parse/error8.C @@ -1,5 +1,5 @@ // PR c++/13438 -// { dg-options "-fshow-column" } +// { dg-options "-fshow-column" } struct A { friend typename struct B; }; diff --git a/gcc/testsuite/g++.dg/strub-internal-pr112938.cc b/gcc/testsuite/g++.dg/strub-internal-pr112938.C index 5a74bec..7d7023c 100644 --- a/gcc/testsuite/g++.dg/strub-internal-pr112938.cc +++ b/gcc/testsuite/g++.dg/strub-internal-pr112938.C @@ -3,10 +3,10 @@ /* { dg-require-effective-target strub } */ bool __attribute__ ((__strub__ ("internal"))) -f(bool i, volatile bool j) +f(bool i, volatile bool j) /* { dg-warning "'volatile'-qualified parameter is deprecated" "" { target c++20 } } */ { return (i ^ j) == j; } /* Check for two dereferences of the indirected volatile j parm. */ -/* { dg-final { scan-tree-dump-times {={v} \*j_[0-9][0-9]*(D)} 2 "optimized" } } */ +/* { dg-final { scan-tree-dump-times {={v} \*j_[0-9+]\(D\)} 2 "optimized" } } */ diff --git a/gcc/testsuite/g++.dg/template/explicit-args6.C b/gcc/testsuite/g++.dg/template/explicit-args6.C index 311a767..18663d7b 100644 --- a/gcc/testsuite/g++.dg/template/explicit-args6.C +++ b/gcc/testsuite/g++.dg/template/explicit-args6.C @@ -20,7 +20,7 @@ constexpr unsigned frob() { static_assert(N == 1, "user-friendly diagnostic"); // { dg-error "user-friendly" } - // dg-message { "-1 == 1" "" { target *-*-* } .-1 } + // { dg-message "-1 == 1" "" { target *-*-* } .-1 } // narrowing check, reject negative values return unsigned{N}; // { dg-prune-output "narrowing" } diff --git a/gcc/testsuite/g++.dg/template/unify9.C b/gcc/testsuite/g++.dg/template/unify9.C index ee18b86..e743762 100644 --- a/gcc/testsuite/g++.dg/template/unify9.C +++ b/gcc/testsuite/g++.dg/template/unify9.C @@ -13,6 +13,6 @@ struct X { const X *x; int main () { - f (*x, &X::g); // { dg-error "no matching function" } + f (*x, &X::g); // { dg-error "no matching function" } // { dg-message "(candidate|incompatible cv-qualifiers)" "candidate note" { target *-*-* } .-1 } } diff --git a/gcc/testsuite/g++.dg/tree-ssa/initlist-opt2.C b/gcc/testsuite/g++.dg/tree-ssa/initlist-opt2.C index 8080e9f..bc9b6cf 100644 --- a/gcc/testsuite/g++.dg/tree-ssa/initlist-opt2.C +++ b/gcc/testsuite/g++.dg/tree-ssa/initlist-opt2.C @@ -4,7 +4,7 @@ // { dg-skip-if "requires hosted libstdc++ for string" { ! hostedlib } } // Test that we do range-initialization from const char *. -// { dg-final { scan-tree-dump {_M_range_initialize<const char\* const\*>} "gimple" } } +// { dg-final { scan-tree-dump {_M_range_initialize_n<const char\* const\*} "gimple" } } // And that the backing array is static. // { dg-final { scan-tree-dump {static const char.*72} "gimple" } } diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr105820.C b/gcc/testsuite/g++.dg/tree-ssa/pr105820.C index 507950f..4d4c055 100644 --- a/gcc/testsuite/g++.dg/tree-ssa/pr105820.C +++ b/gcc/testsuite/g++.dg/tree-ssa/pr105820.C @@ -1,5 +1,5 @@ // { dg-do compile } -// { dg-options "-O2 -fstrict-enums --param case-values-threshold=1"} +// { dg-options "-O2 -fstrict-enums --param case-values-threshold=1" } typedef int basic_block; diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr80331.C b/gcc/testsuite/g++.dg/tree-ssa/pr80331.C new file mode 100644 index 0000000..8503450 --- /dev/null +++ b/gcc/testsuite/g++.dg/tree-ssa/pr80331.C @@ -0,0 +1,8 @@ +// { dg-do compile } +// { dg-additional-options "-O2 -fdump-tree-optimized" } +#include<string> +int sain() { + const std::string remove_me("remove_me"); + return 0; +} +// { dg-final { scan-tree-dump-not "remove_me" "optimized" } } diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr87502.C b/gcc/testsuite/g++.dg/tree-ssa/pr87502.C new file mode 100644 index 0000000..ad3e9d2 --- /dev/null +++ b/gcc/testsuite/g++.dg/tree-ssa/pr87502.C @@ -0,0 +1,15 @@ +// { dg-do compile } +// { dg-additional-options "-O2 -fdump-tree-optimized" } +#include <string> + + +__attribute__ ((pure)) +extern int foo (const std::string &); + +int +bar () +{ + return foo ("abc") + foo (std::string("abc")); +} +// We used to add terminating zero explicitely instead of using fact +// that memcpy source is already 0 terminated. diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr98265.C b/gcc/testsuite/g++.dg/tree-ssa/pr98265.C index 9c798e6..d4872d6 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr98265.C +++ b/gcc/testsuite/g++.dg/tree-ssa/pr98265.C @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-optimized" } */ +/* { dg-options "-O2 -std=c++14 -fdump-tree-optimized" } */ extern void __assert_fail(const char*, const char*, int, const char*); namespace Eigen { enum { AutoAlign }; @@ -345,4 +345,4 @@ Eigen::Matrix<float, 3, 1> should_inline(float x, float y, float z, // We should inline everything to should_inline -/* { dg-final { scan-tree-dump-times "Function" "optimized" } } */ +/* { dg-final { scan-tree-dump "Function" "optimized" } } */ diff --git a/gcc/testsuite/g++.dg/vect/pr37143.C b/gcc/testsuite/g++.dg/vect/pr37143.cc index a2c41a9..a2c41a9 100644 --- a/gcc/testsuite/g++.dg/vect/pr37143.C +++ b/gcc/testsuite/g++.dg/vect/pr37143.cc diff --git a/gcc/testsuite/g++.dg/warn/Winvalid-memory-model.C b/gcc/testsuite/g++.dg/warn/Winvalid-memory-model.C index 5357d54..0ef2c75 100644 --- a/gcc/testsuite/g++.dg/warn/Winvalid-memory-model.C +++ b/gcc/testsuite/g++.dg/warn/Winvalid-memory-model.C @@ -1,6 +1,6 @@ /* PR middle-end/99612 - Missing warning on incorrect memory order without -Wsystem-headers - Verify warings for basic atomic functions with no optimization. + Verify warnings for basic atomic functions with no optimization. { dg-do compile { target c++11 } } { dg-options "-O0 -Wall" } */ diff --git a/gcc/testsuite/g++.dg/warn/Wmismatched-tags-8.C b/gcc/testsuite/g++.dg/warn/Wmismatched-tags-8.C index 0ebca3d..082564d 100644 --- a/gcc/testsuite/g++.dg/warn/Wmismatched-tags-8.C +++ b/gcc/testsuite/g++.dg/warn/Wmismatched-tags-8.C @@ -4,7 +4,7 @@ #pragma GCC diagnostic push #pragma GCC diagnostic error "-Wmismatched-tags" -class A; // { dg-message "first declared" +class A; // { dg-message "first declared" } struct A; // { dg-error "\\\[-Werror=mismatched-tags" } #pragma GCC diagnostic ignored "-Wmismatched-tags" @@ -12,11 +12,11 @@ class B; // { dg-bogus "first declared" } struct B; #pragma GCC diagnostic warning "-Wmismatched-tags" -class C; // { dg-message "first declared" +class C; // { dg-message "first declared" } struct C; // { dg-warning "\\\[-Wmismatched-tags" } #pragma GCC diagnostic pop -class D; // { dg-message "first declared" +class D; // { dg-message "first declared" } struct D; // { dg-warning "\\\[-Wmismatched-tags" } // { dg-prune-output "some warnings being treated as errors" } diff --git a/gcc/testsuite/g++.dg/warn/Wno-attributes-1.C b/gcc/testsuite/g++.dg/warn/Wno-attributes-1.C index 863ca5c..9ac61b4 100644 --- a/gcc/testsuite/g++.dg/warn/Wno-attributes-1.C +++ b/gcc/testsuite/g++.dg/warn/Wno-attributes-1.C @@ -36,11 +36,11 @@ foo () class S { [[foo::bar]] friend int bar (S &); // { dg-warning "attribute ignored" } - // { dsg-message "an attribute that appertains to a friend declaration that is not a definition is ignored" "" { target *-*-* } .-1 } + // { dg-message "an attribute that appertains to a friend declaration that is not a definition is ignored" "" { target *-*-* } .-1 } [[bar::foo, foo::bar, baz::qux]] friend int baz (S &); // { dg-warning "attribute ignored" } - // { dsg-message "an attribute that appertains to a friend declaration that is not a definition is ignored" "" { target *-*-* } .-1 } + // { dg-message "an attribute that appertains to a friend declaration that is not a definition is ignored" "" { target *-*-* } .-1 } [[bar::foo, bar::bar, baz::qux]] friend int qux (S &); // { dg-warning "attribute ignored" } - // { dsg-message "an attribute that appertains to a friend declaration that is not a definition is ignored" "" { target *-*-* } .-1 } + // { dg-message "an attribute that appertains to a friend declaration that is not a definition is ignored" "" { target *-*-* } .-1 } public: int s; }; diff --git a/gcc/testsuite/g++.dg/warn/Wstringop-overflow-5.C b/gcc/testsuite/g++.dg/warn/Wstringop-overflow-5.C index 3e905fc..e6adb70 100644 --- a/gcc/testsuite/g++.dg/warn/Wstringop-overflow-5.C +++ b/gcc/testsuite/g++.dg/warn/Wstringop-overflow-5.C @@ -24,7 +24,7 @@ extern Bucket _Bucket_default_instance_; Bucket::Bucket () { memset (&_has_bits_, 0, sizeof _has_bits_); - memset (&cumulative_count_, 0, // { dg-bogus "\\\[-Warray-bounds|-wstringop-overflow" } + memset (&cumulative_count_, 0, // { dg-bogus "\\\[-Warray-bounds|-Wstringop-overflow" } static_cast<size_t>(reinterpret_cast<char*>(&upper_bound_) - reinterpret_cast<char*>(&cumulative_count_)) + sizeof upper_bound_); diff --git a/gcc/testsuite/g++.dg/warn/undefined2.C b/gcc/testsuite/g++.dg/warn/undefined2.C new file mode 100644 index 0000000..1b2ec35 --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/undefined2.C @@ -0,0 +1,14 @@ +// PR c++/119303 + +template <class> struct c { + enum { d = 4 }; +}; +template <bool> struct e { + typedef void g; +}; +template <class _Tp> +inline typename e<!c<_Tp>::d>::g bar(_Tp); // { dg-warning "used but never defined" } + +int x; + +void foo() { bar(x); } diff --git a/gcc/testsuite/g++.old-deja/g++.abi/vtable2.C b/gcc/testsuite/g++.old-deja/g++.abi/vtable2.C index 96533e0..762277d 100644 --- a/gcc/testsuite/g++.old-deja/g++.abi/vtable2.C +++ b/gcc/testsuite/g++.old-deja/g++.abi/vtable2.C @@ -1,4 +1,4 @@ -// { dg-do run } +// { dg-do run } // { dg-options "-Wno-attribute-alias -fno-strict-aliasing" } // Origin: Mark Mitchell <mark@codesourcery.com> diff --git a/gcc/testsuite/g++.old-deja/g++.bugs/900330_02.C b/gcc/testsuite/g++.old-deja/g++.bugs/900330_02.C index f1591b2..4f2f831 100644 --- a/gcc/testsuite/g++.old-deja/g++.bugs/900330_02.C +++ b/gcc/testsuite/g++.old-deja/g++.bugs/900330_02.C @@ -1,4 +1,4 @@ -// { dg-do assemble } +// { dg-do assemble } // g++ 1.37.1 bug 900330_02 // The C++ Reference Manual says in section 13.1: diff --git a/gcc/testsuite/g++.old-deja/g++.bugs/900406_02.C b/gcc/testsuite/g++.old-deja/g++.bugs/900406_02.C index bcbffeb..dcce14c 100644 --- a/gcc/testsuite/g++.old-deja/g++.bugs/900406_02.C +++ b/gcc/testsuite/g++.old-deja/g++.bugs/900406_02.C @@ -1,4 +1,4 @@ -// { dg-do run } +// { dg-do run } // g++ bug 900406_02 // g++ fails to correctly parse some type specifications within casts. diff --git a/gcc/testsuite/g++.old-deja/g++.bugs/900519_13.C b/gcc/testsuite/g++.old-deja/g++.bugs/900519_13.C index 6b8260d..91293bf 100644 --- a/gcc/testsuite/g++.old-deja/g++.bugs/900519_13.C +++ b/gcc/testsuite/g++.old-deja/g++.bugs/900519_13.C @@ -1,4 +1,4 @@ -// { dg-do assemble } +// { dg-do assemble } // g++ 1.37.1 bug 900519_13 // If multiple inheritance creates a situation in which a given name is diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p9068.C b/gcc/testsuite/g++.old-deja/g++.mike/p9068.C index a33f60f..b12bdb4 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/p9068.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/p9068.C @@ -1,4 +1,4 @@ -// { dg-do assemble } +// { dg-do assemble } // prms-id: 9068 struct ostream { diff --git a/gcc/testsuite/g++.target/i386/mangling-alias1.C b/gcc/testsuite/g++.target/i386/mangling-alias1.C index 70264e2..2d7a25a 100644 --- a/gcc/testsuite/g++.target/i386/mangling-alias1.C +++ b/gcc/testsuite/g++.target/i386/mangling-alias1.C @@ -1,6 +1,6 @@ // PR c++/114992 // { dg-do compile { target { c++11 && x86_64-*-* } } } -// { dg-require-ifunc } +// { dg-require-ifunc "" } template <typename Callable> __attribute__((target_clones("avx2", "default"))) diff --git a/gcc/testsuite/gcc.dg/20040203-1.c b/gcc/testsuite/gcc.dg/20040203-1.c index 59c824e..b92c0ec 100644 --- a/gcc/testsuite/gcc.dg/20040203-1.c +++ b/gcc/testsuite/gcc.dg/20040203-1.c @@ -1,6 +1,6 @@ /* PR/13994; bug_cond2 was rejected on gcc up to version 3.4.x */ -/* { dg-do compile }*/ -/* { dg-options "-std=gnu89" }*/ +/* { dg-do compile } */ +/* { dg-options "-std=gnu89" } */ struct s { char c[1]; }; struct s a; diff --git a/gcc/testsuite/gcc.dg/980502-1.c b/gcc/testsuite/gcc.dg/980502-1.c index f06491c..6a64c76 100644 --- a/gcc/testsuite/gcc.dg/980502-1.c +++ b/gcc/testsuite/gcc.dg/980502-1.c @@ -1,4 +1,4 @@ -/* { dg-do compile }*/ +/* { dg-do compile } */ /* { dg-options "-O2" } */ char *const f(void) diff --git a/gcc/testsuite/gcc.dg/analyzer/fd-datagram-socket.c b/gcc/testsuite/gcc.dg/analyzer/fd-datagram-socket.c index 8d32e85..37c7159 100644 --- a/gcc/testsuite/gcc.dg/analyzer/fd-datagram-socket.c +++ b/gcc/testsuite/gcc.dg/analyzer/fd-datagram-socket.c @@ -102,7 +102,7 @@ void test_listen_on_datagram_socket_with_bind (const char *sockname) memset (&addr, 0, sizeof (addr)); addr.sun_family = AF_UNIX; strncpy (addr.sun_path, sockname, sizeof(addr.sun_path) - 1); - if (bind (fd, (struct sockaddr *)&addr, sizeof (addr)) == -1) /* { dg message "datagram socket bound here" } */ + if (bind (fd, (struct sockaddr *)&addr, sizeof (addr)) == -1) /* { dg-message "datagram socket bound here" } */ { close (fd); return; diff --git a/gcc/testsuite/gcc.dg/analyzer/out-of-bounds-zero.c b/gcc/testsuite/gcc.dg/analyzer/out-of-bounds-zero.c index 201ca00..6e62a9d 100644 --- a/gcc/testsuite/gcc.dg/analyzer/out-of-bounds-zero.c +++ b/gcc/testsuite/gcc.dg/analyzer/out-of-bounds-zero.c @@ -1,4 +1,4 @@ -/* { dg-additional-options "-Wno-stringop-overflow"} */ +/* { dg-additional-options "-Wno-stringop-overflow" } */ /* -Wstringop-overflow= triggers on test5. */ #include <stdint.h> diff --git a/gcc/testsuite/gcc.dg/analyzer/strchr-1.c b/gcc/testsuite/gcc.dg/analyzer/strchr-1.c index 08c429d..181f182 100644 --- a/gcc/testsuite/gcc.dg/analyzer/strchr-1.c +++ b/gcc/testsuite/gcc.dg/analyzer/strchr-1.c @@ -16,13 +16,13 @@ const char* test_literal (int x) void test_2 (const char *s, int c) { - char *p = __builtin_strchr (s, c); /* { dg-message "when '__builtin_strchr' returns NULL"} */ + char *p = __builtin_strchr (s, c); /* { dg-message "when '__builtin_strchr' returns NULL" } */ *p = 'A'; /* { dg-warning "dereference of NULL 'p'" "null deref" } */ } void test_3 (const char *s, int c) { - char *p = strchr (s, c); /* { dg-message "when 'strchr' returns NULL"} */ + char *p = strchr (s, c); /* { dg-message "when 'strchr' returns NULL" } */ *p = 'A'; /* { dg-warning "dereference of NULL 'p'" "null deref" } */ } diff --git a/gcc/testsuite/gcc.dg/builtin-dynamic-object-size-19.c b/gcc/testsuite/gcc.dg/builtin-dynamic-object-size-19.c index 44141a3..950466b 100644 --- a/gcc/testsuite/gcc.dg/builtin-dynamic-object-size-19.c +++ b/gcc/testsuite/gcc.dg/builtin-dynamic-object-size-19.c @@ -20,7 +20,7 @@ typedef __SIZE_TYPE__ size_t; /* Macro to emit a call to function named call_in_true_branch_not_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM(expr) \ if (!(expr)) FAIL (in_true_branch_not_eliminated); else (void)0 diff --git a/gcc/testsuite/gcc.dg/builtin-object-size-19.c b/gcc/testsuite/gcc.dg/builtin-object-size-19.c index 1aab1ef..090d422 100644 --- a/gcc/testsuite/gcc.dg/builtin-object-size-19.c +++ b/gcc/testsuite/gcc.dg/builtin-object-size-19.c @@ -17,7 +17,7 @@ typedef __SIZE_TYPE__ size_t; /* Macro to emit a call to function named call_in_true_branch_not_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM(expr) \ if (!(expr)) FAIL (in_true_branch_not_eliminated); else (void)0 diff --git a/gcc/testsuite/gcc.dg/cpp/cmdlne-dM-M.c b/gcc/testsuite/gcc.dg/cpp/cmdlne-dM-M.c index 0cd9011..6a89c25 100644 --- a/gcc/testsuite/gcc.dg/cpp/cmdlne-dM-M.c +++ b/gcc/testsuite/gcc.dg/cpp/cmdlne-dM-M.c @@ -12,4 +12,4 @@ int variable; /* { dg-final { scan-file cmdlne-dM-M.i "(^|\\n)#define foo bar($|\\n)" } } { dg-final { scan-file-not cmdlne-dM-M.i "variable" } } - { dg-final { scan-file cmdlne-dM-M.i "(^|\\n)cmdlne-dM-M\[^\\n\]*:( *\\\\\\n)?\[^\\n\]*cmdlne-dM-M.c"} } */ + { dg-final { scan-file cmdlne-dM-M.i "(^|\\n)cmdlne-dM-M\[^\\n\]*:( *\\\\\\n)?\[^\\n\]*cmdlne-dM-M.c" } } */ diff --git a/gcc/testsuite/gcc.dg/gomp/attrs-21.c b/gcc/testsuite/gcc.dg/gomp/attrs-21.c index 551fe6c..e572f21 100644 --- a/gcc/testsuite/gcc.dg/gomp/attrs-21.c +++ b/gcc/testsuite/gcc.dg/gomp/attrs-21.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fopenmp -std=c23" */ +/* { dg-options "-fopenmp -std=c23" } */ void foo () diff --git a/gcc/testsuite/gcc.dg/gomp/parallel-2.c b/gcc/testsuite/gcc.dg/gomp/parallel-2.c index b2d653d..38875ad 100644 --- a/gcc/testsuite/gcc.dg/gomp/parallel-2.c +++ b/gcc/testsuite/gcc.dg/gomp/parallel-2.c @@ -8,7 +8,7 @@ void foo() { #pragma omp parallel { - #pragma omp parallel default(none) // { dg-message: "note: enclosing 'parallel'" } + #pragma omp parallel default(none) // { dg-message "note: enclosing 'parallel'" } { i++; // { dg-error "not specified" } } diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-sra-14.c b/gcc/testsuite/gcc.dg/ipa/ipa-sra-14.c index 75619c6..81bfd3c 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-sra-14.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-sra-14.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-O2 -fipa-sra -fdump-ipa-sra" } */ +/* { dg-options "-O2 -fipa-sra -fdump-ipa-sra" } */ /* Check of a transitive recursive structure split. */ diff --git a/gcc/testsuite/gcc.dg/ipa/pr110377.c b/gcc/testsuite/gcc.dg/ipa/pr110377.c index 63120a9..76faef5 100644 --- a/gcc/testsuite/gcc.dg/ipa/pr110377.c +++ b/gcc/testsuite/gcc.dg/ipa/pr110377.c @@ -1,4 +1,4 @@ -/* { dg-do compile */ +/* { dg-do compile } */ /* { dg-options "-O2 -fdump-ipa-cp" } */ int test3(int); __attribute__ ((noinline)) diff --git a/gcc/testsuite/gcc.dg/plugin/infoleak-1.c b/gcc/testsuite/gcc.dg/plugin/infoleak-1.c index 4c5a86a..07e3101 100644 --- a/gcc/testsuite/gcc.dg/plugin/infoleak-1.c +++ b/gcc/testsuite/gcc.dg/plugin/infoleak-1.c @@ -69,7 +69,7 @@ void test_2d (void __user *dst, u32 a) { struct s2 s = {0}; s.i = a; - copy_to_user(dst, &s, sizeof (struct s2)); /* { dg-bogus" } */ + copy_to_user(dst, &s, sizeof (struct s2)); /* { dg-bogus "" } */ } struct empty {}; diff --git a/gcc/testsuite/gcc.dg/pr101364-1.c b/gcc/testsuite/gcc.dg/pr101364-1.c index e7c94a0..c2e3211 100644 --- a/gcc/testsuite/gcc.dg/pr101364-1.c +++ b/gcc/testsuite/gcc.dg/pr101364-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-std=c90 "} */ +/* { dg-options "-std=c90" } */ void fruit(); /* { dg-message "previous declaration" } */ void fruit( /* { dg-error "conflicting types for" } */ diff --git a/gcc/testsuite/gcc.dg/pr110992.c b/gcc/testsuite/gcc.dg/pr110992.c new file mode 100644 index 0000000..05e9b92 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr110992.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-evrp" } */ + +void foo (int); + +int f(unsigned b, short c) +{ + int bt = b; + int bt1 = bt; + int t = bt1 & -(c!=0); + // int t = bt1 * (c!=0); + + if (!t) return 0; + foo(bt == 0); + return 0; +} + +/* { dg-final { scan-tree-dump-times "foo \\(0\\)" 1 "evrp" } } */ diff --git a/gcc/testsuite/gcc.dg/pr113207.c b/gcc/testsuite/gcc.dg/pr113207.c index 81f53d8..a8bc80d 100644 --- a/gcc/testsuite/gcc.dg/pr113207.c +++ b/gcc/testsuite/gcc.dg/pr113207.c @@ -1,4 +1,4 @@ -/* { dg-compile } */ +/* { dg-do compile } */ /* { dg-require-effective-target lto } */ /* { dg-options "-flto -fchecking" } */ diff --git a/gcc/testsuite/gcc.dg/pr118765-2.c b/gcc/testsuite/gcc.dg/pr118765-2.c new file mode 100644 index 0000000..0c3e498 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr118765-2.c @@ -0,0 +1,33 @@ +/* { dg-do "compile" } */ +/* { dg-options "-std=gnu23" } */ + +typedef struct q { int x; } q_t; +typedef struct q { int x; } q_t; +typedef struct q { int x; } q_t; +typedef struct q { int x; } q_t; +typedef struct q { int x; } q_t; + +typedef struct r r_t; +typedef struct r r_t; +typedef struct r r_t; +typedef struct r r_t; +typedef struct r r_t; + +extern struct s { int x; } s; +extern struct s { int x; } s; +extern struct s { int x; } s; +extern struct s { int x; } s; +extern struct s { int x; } s; + +struct t { int x; }; +struct t { int x; }; +struct t { int x; }; +struct t { int x; }; +struct t { int x; }; + +typedef enum e { E = 1 } e_t; +typedef enum e { E = 1 } e_t; +typedef enum e { E = 1 } e_t; +typedef enum e { E = 1 } e_t; +typedef enum e { E = 1 } e_t; + diff --git a/gcc/testsuite/gcc.dg/pr118765-3.c b/gcc/testsuite/gcc.dg/pr118765-3.c new file mode 100644 index 0000000..e86d110 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr118765-3.c @@ -0,0 +1,33 @@ +/* { dg-do "compile" } */ +/* { dg-options "-std=gnu23" } */ + +typedef struct q { int x; } q_t; +typedef struct q q_t; +typedef struct q { int x; } q_t; +typedef struct q q_t; +typedef struct q { int x; } q_t; + +typedef struct r r_t; +typedef struct r r_t; +typedef struct r r_t; +typedef struct r r_t; +typedef struct r r_t; + +extern struct s { int x; } s; +extern struct s s; +extern struct s { int x; } s; +extern struct s s; +extern struct s { int x; } s; + +struct t { int x; }; +struct t; +struct t { int x; }; +struct t; +struct t { int x; }; + +typedef enum e { E = 1 } e_t; +typedef enum e_t; /* { dg-warning "useless storage class specifier in empty declaration" } */ +typedef enum e { E = 1 } e_t; +typedef enum e_t; /* { dg-warning "empty declaration with storage class specifier does not redeclare tag" } */ +typedef enum e { E = 1 } e_t; + diff --git a/gcc/testsuite/gcc.dg/pr119471.c b/gcc/testsuite/gcc.dg/pr119471.c new file mode 100644 index 0000000..4c55d85 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr119471.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-evrp" } */ + +int fa(int a, int b) +{ + int c = a * b; + if (c != 0) + return (a != 0); + return 0; +} +int fb(int a, int b) +{ + int c = a * b; + if (c != 0) + return (b != 0); + return 0; +} + +/* { dg-final { scan-tree-dump-times "PHI <1" 2 "evrp" } } */ diff --git a/gcc/testsuite/gcc.dg/pr35468.c b/gcc/testsuite/gcc.dg/pr35468.c index 085c073..1bd7a9d 100644 --- a/gcc/testsuite/gcc.dg/pr35468.c +++ b/gcc/testsuite/gcc.dg/pr35468.c @@ -1,5 +1,5 @@ /* PR tree-optimization/35468 */ -/* { dg-do compile }*/ +/* { dg-do compile } */ /* { dg-options "-O2 -fno-tree-dce" } */ char *const f(void) diff --git a/gcc/testsuite/gcc.dg/pr82597.c b/gcc/testsuite/gcc.dg/pr82597.c index 98ae264..5c034f3 100644 --- a/gcc/testsuite/gcc.dg/pr82597.c +++ b/gcc/testsuite/gcc.dg/pr82597.c @@ -1,5 +1,5 @@ /* PR rtl-optimization/82597 */ -/* { dg-do compile }*/ +/* { dg-do compile } */ /* { dg-options "-O2 -funroll-loops" } */ int pb; diff --git a/gcc/testsuite/gcc.dg/sarif-output/include-chain-2.c b/gcc/testsuite/gcc.dg/sarif-output/include-chain-2.c index d5e3b0c..643a709 100644 --- a/gcc/testsuite/gcc.dg/sarif-output/include-chain-2.c +++ b/gcc/testsuite/gcc.dg/sarif-output/include-chain-2.c @@ -1,6 +1,6 @@ +/* { dg-do compile } */ /* { dg-require-effective-target analyzer } */ /* { dg-options "-fanalyzer -fdiagnostics-format=sarif-file" } */ -/* { dg-do compile } */ /* Verify that SARIF output can capture chains of include files in diagnostic paths within result locations. diff --git a/gcc/testsuite/gcc.dg/strlenopt-40.c b/gcc/testsuite/gcc.dg/strlenopt-40.c index 7a97ebb..3e61c71 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-40.c +++ b/gcc/testsuite/gcc.dg/strlenopt-40.c @@ -19,7 +19,7 @@ /* Macros to emit a call to funcation named call_in_{true,false}_branch_not_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM_TRUE(expr) \ if (!(expr)) FAIL (in_true_branch_not_eliminated); else (void)0 @@ -30,7 +30,7 @@ /* Macro to emit a call to a function named call_made_in_{true,false}_branch_on_line_NNN() for each call that's expected to be retained. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that the expected number of both kinds of calls appears in output (a pair for each line with the invocation of the KEEP() macro. */ #define KEEP(expr) \ diff --git a/gcc/testsuite/gcc.dg/strlenopt-44.c b/gcc/testsuite/gcc.dg/strlenopt-44.c index 0af78ac..239695c 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-44.c +++ b/gcc/testsuite/gcc.dg/strlenopt-44.c @@ -17,7 +17,7 @@ /* Macro to emit a call to funcation named call_in_true_branch_not_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ASSERT_ELIM(expr) \ if (!(expr)) FAIL (in_true_branch_not_eliminated); else (void)0 @@ -25,7 +25,7 @@ /* Macro to emit a call to a function named call_made_in_{true,false}_branch_on_line_NNN() for each call that's expected to be retained. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that the expected number of both kinds of calls appears in output (a pair for each line with the invocation of the KEEP() macro. */ #define ASSERT_KEEP(expr) \ diff --git a/gcc/testsuite/gcc.dg/strlenopt-45.c b/gcc/testsuite/gcc.dg/strlenopt-45.c index 31c1e53..61637b9 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-45.c +++ b/gcc/testsuite/gcc.dg/strlenopt-45.c @@ -26,7 +26,7 @@ extern size_t strnlen (const char *, size_t); /* Macro to emit a call to funcation named call_in_true_branch_not_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM(expr) \ if (!(expr)) FAIL (in_true_branch_not_eliminated); else (void)0 @@ -34,7 +34,7 @@ extern size_t strnlen (const char *, size_t); /* Macro to emit a call to a function named call_made_in_{true,false}_branch_on_line_NNN() for each call that's expected to be retained. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that the expected number of both kinds of calls appears in output (a pair for each line with the invocation of the KEEP() macro. */ #define KEEP(expr) \ diff --git a/gcc/testsuite/gcc.dg/strlenopt-50.c b/gcc/testsuite/gcc.dg/strlenopt-50.c index 8e7c9db..b78ffba 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-50.c +++ b/gcc/testsuite/gcc.dg/strlenopt-50.c @@ -17,7 +17,7 @@ /* Macro to emit a call to funcation named call_in_true_branch_not_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM(expr) \ if (!(expr)) FAIL (in_true_branch_not_eliminated); else (void)0 diff --git a/gcc/testsuite/gcc.dg/strlenopt-51.c b/gcc/testsuite/gcc.dg/strlenopt-51.c index 22a8938..7b5d261 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-51.c +++ b/gcc/testsuite/gcc.dg/strlenopt-51.c @@ -17,7 +17,7 @@ /* Macro to emit a call to funcation named call_in_true_branch_not_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM(expr) \ if (!(expr)) FAIL (in_true_branch_not_eliminated, __COUNTER__); else (void)0 diff --git a/gcc/testsuite/gcc.dg/strlenopt-52.c b/gcc/testsuite/gcc.dg/strlenopt-52.c index 97b3da7..29727dd 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-52.c +++ b/gcc/testsuite/gcc.dg/strlenopt-52.c @@ -16,7 +16,7 @@ /* Macro to emit a call to funcation named call_in_true_branch_not_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM(expr) \ if (!(expr)) FAIL (in_true_branch_not_eliminated); else (void)0 diff --git a/gcc/testsuite/gcc.dg/strlenopt-53.c b/gcc/testsuite/gcc.dg/strlenopt-53.c index 489c22b..298665c 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-53.c +++ b/gcc/testsuite/gcc.dg/strlenopt-53.c @@ -17,7 +17,7 @@ /* Macro to emit a call to funcation named call_in_true_branch_not_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM(expr) \ if (!(expr)) FAIL (in_true_branch_not_eliminated); else (void)0 diff --git a/gcc/testsuite/gcc.dg/strlenopt-54.c b/gcc/testsuite/gcc.dg/strlenopt-54.c index d4e57ff..1044162 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-54.c +++ b/gcc/testsuite/gcc.dg/strlenopt-54.c @@ -16,7 +16,7 @@ /* Macro to emit a call to function named call_in_true_branch_not_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM(expr) \ if (!(expr)) FAIL (in_true_branch_not_eliminated); else (void)0 diff --git a/gcc/testsuite/gcc.dg/strlenopt-55.c b/gcc/testsuite/gcc.dg/strlenopt-55.c index ca89ecd..6b54db8 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-55.c +++ b/gcc/testsuite/gcc.dg/strlenopt-55.c @@ -157,7 +157,7 @@ const char ax_100_3[] = { '1', '2', '3', [100] = '\0' }; /* Macro to emit a call to funcation named call_in_true_branch_not_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM(expr) \ if (!(expr)) FAIL (in_true_branch_not_eliminated); else (void)0 diff --git a/gcc/testsuite/gcc.dg/strlenopt-58.c b/gcc/testsuite/gcc.dg/strlenopt-58.c index 034961c..6bfc389 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-58.c +++ b/gcc/testsuite/gcc.dg/strlenopt-58.c @@ -24,7 +24,7 @@ extern void* memchr (const void*, int, size_t); /* Macro to emit a call to funcation named call_in_true_branch_not_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM(expr) \ if (!(expr)) FAIL (in_true_branch_not_eliminated); else (void)0 diff --git a/gcc/testsuite/gcc.dg/strlenopt-59.c b/gcc/testsuite/gcc.dg/strlenopt-59.c index 9bacf87..58bb74b 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-59.c +++ b/gcc/testsuite/gcc.dg/strlenopt-59.c @@ -20,7 +20,7 @@ extern __SIZE_TYPE__ strlen (const char*); /* Macros to emit a call to funcation named call_failed_to_be_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM(expr) \ if ((expr)) FAIL (test_not_eliminated); else (void)0 diff --git a/gcc/testsuite/gcc.dg/strlenopt-62.c b/gcc/testsuite/gcc.dg/strlenopt-62.c index 0e09a7a..38edfde 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-62.c +++ b/gcc/testsuite/gcc.dg/strlenopt-62.c @@ -21,7 +21,7 @@ typedef __INT32_TYPE__ int32_t; /* Macro to emit a call to funcation named call_in_true_branch_not_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM(expr) \ if (!(expr)) FAIL (in_true_branch_not_eliminated, __COUNTER__); else (void)0 diff --git a/gcc/testsuite/gcc.dg/strlenopt-65.c b/gcc/testsuite/gcc.dg/strlenopt-65.c index 521d7ac..23c69ef 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-65.c +++ b/gcc/testsuite/gcc.dg/strlenopt-65.c @@ -17,7 +17,7 @@ /* Macro to emit a call to function named call_in_true_branch_not_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM_IF_TRUE(expr) \ if (!(expr)) FAIL (in_true_branch_not_eliminated); else (void)0 @@ -25,7 +25,7 @@ /* Macro to emit a call to a function named call_made_in_{true,false}_branch_on_line_NNN() for each call that's expected to be retained. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that the expected number of both kinds of calls appears in output (a pair for each line with the invocation of the KEEP() macro. */ #define TEST_KEEP(expr) \ diff --git a/gcc/testsuite/gcc.dg/strlenopt-70.c b/gcc/testsuite/gcc.dg/strlenopt-70.c index 0853023..b2dac9a 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-70.c +++ b/gcc/testsuite/gcc.dg/strlenopt-70.c @@ -28,7 +28,7 @@ typedef __UINT64_TYPE__ uint64_t; /* Macros to emit a call to function named call_failed_to_be_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM(expr) \ if ((expr)) FAIL (not_eliminated); else (void)0 diff --git a/gcc/testsuite/gcc.dg/strlenopt-72.c b/gcc/testsuite/gcc.dg/strlenopt-72.c index 9c00a95..b1ae20d 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-72.c +++ b/gcc/testsuite/gcc.dg/strlenopt-72.c @@ -26,7 +26,7 @@ /* Macros to emit a call to function named call_failed_to_be_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM(expr) \ if ((expr)) FAIL (not_eliminated); else (void)0 diff --git a/gcc/testsuite/gcc.dg/strlenopt-73.c b/gcc/testsuite/gcc.dg/strlenopt-73.c index 6e15303..f439247 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-73.c +++ b/gcc/testsuite/gcc.dg/strlenopt-73.c @@ -26,7 +26,7 @@ /* Macros to emit a call to function named call_failed_to_be_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM(expr) \ if ((expr)) FAIL (not_eliminated); else (void)0 diff --git a/gcc/testsuite/gcc.dg/strlenopt-77.c b/gcc/testsuite/gcc.dg/strlenopt-77.c index 76cd11d..44d2bc6 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-77.c +++ b/gcc/testsuite/gcc.dg/strlenopt-77.c @@ -17,7 +17,7 @@ /* Macro to emit a call to function named call_in_true_branch_not_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ASSERT_ELIM(expr) \ if (!!(expr)) FAIL (in_true_branch_not_eliminated); else (void)0 diff --git a/gcc/testsuite/gcc.dg/strlenopt-82.c b/gcc/testsuite/gcc.dg/strlenopt-82.c index 8070f6c..e1e60f4 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-82.c +++ b/gcc/testsuite/gcc.dg/strlenopt-82.c @@ -21,7 +21,7 @@ /* Macro to emit a call to function named call_in_true_branch_not_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM(expr) \ if (!(expr)) FAIL (in_true_branch_not_eliminated); else (void)0 @@ -29,7 +29,7 @@ /* Macro to emit a call to a function named call_made_in_{true,false}_branch_on_line_NNN() for each call that's expected to be retained. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that the expected number of both kinds of calls appears in output (a pair for each line with the invocation of the KEEP() macro. */ #define KEEP(expr) \ diff --git a/gcc/testsuite/gcc.dg/strub-pr118007.c b/gcc/testsuite/gcc.dg/strub-pr118007.c index 51f4824..92cd31e 100644 --- a/gcc/testsuite/gcc.dg/strub-pr118007.c +++ b/gcc/testsuite/gcc.dg/strub-pr118007.c @@ -1,5 +1,5 @@ -/* { dg-require-effective-target strub } */ /* { dg-do compile } */ +/* { dg-require-effective-target strub } */ /* { dg-options "-fstrub=all -O2" } */ void rb_ec_error_print(struct rb_execution_context_struct *volatile) {} /* { dg-warning "declared inside parameter list" } */ diff --git a/gcc/testsuite/gcc.dg/tanhbysinh.c b/gcc/testsuite/gcc.dg/tanhbysinh.c index 9dbe133..74fdd52 100644 --- a/gcc/testsuite/gcc.dg/tanhbysinh.c +++ b/gcc/testsuite/gcc.dg/tanhbysinh.c @@ -30,12 +30,12 @@ tanhbysinhl_ (long double x) /* There must be no calls to sinh or atanh */ /* There must be calls to cosh */ -/* {dg-final { scan-tree-dump-not "sinh " "optimized" } } */ -/* {dg-final { scan-tree-dump-not "tanh " "optimized" }} */ -/* {dg-final { scan-tree-dump-not "sinhf " "optimized" } } */ -/* {dg-final { scan-tree-dump-not "tanhf " "optimized" }} */ -/* {dg-final { scan-tree-dump-not "sinhl " "optimized" } } */ -/* {dg-final { scan-tree-dump-not "tanhl " "optimized" }} */ +/* { dg-final { scan-tree-dump-not "sinh " "optimized" } } */ +/* { dg-final { scan-tree-dump-not "tanh " "optimized" } } */ +/* { dg-final { scan-tree-dump-not "sinhf " "optimized" } } */ +/* { dg-final { scan-tree-dump-not "tanhf " "optimized" } } */ +/* { dg-final { scan-tree-dump-not "sinhl " "optimized" } } */ +/* { dg-final { scan-tree-dump-not "tanhl " "optimized" } } */ /* { dg-final { scan-tree-dump "cosh " "optimized" } } */ /* { dg-final { scan-tree-dump "coshf " "optimized" } } */ /* { dg-final { scan-tree-dump "coshl " "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/torture/pr119133.c b/gcc/testsuite/gcc.dg/torture/pr119133.c index 5369bec..f0c8f73 100644 --- a/gcc/testsuite/gcc.dg/torture/pr119133.c +++ b/gcc/testsuite/gcc.dg/torture/pr119133.c @@ -1,5 +1,6 @@ /* { dg-additional-options "-fno-tree-ter" } */ /* { dg-require-effective-target float16 } */ +/* { dg-add-options float16 } */ int foo(_Float16 f, int i) diff --git a/gcc/testsuite/gcc.dg/torture/pr119532.c b/gcc/testsuite/gcc.dg/torture/pr119532.c new file mode 100644 index 0000000..bba2e45 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr119532.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target fixed_point } */ + +extern _Fract sinuhk_deg (unsigned short _Accum); + +_Fract cosuhk_deg (unsigned short _Accum deg) +{ + unsigned short _Accum _90_deg = 90uhk; + __asm ("" : "+r" (_90_deg)); + + return deg <= _90_deg + ? sinuhk_deg (_90_deg - deg) + : -sinuhk_deg (deg - _90_deg); +} diff --git a/gcc/testsuite/gcc.dg/tree-ssa/builtin-snprintf-4.c b/gcc/testsuite/gcc.dg/tree-ssa/builtin-snprintf-4.c index 97a385e..d25a960 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/builtin-snprintf-4.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/builtin-snprintf-4.c @@ -26,7 +26,7 @@ extern int vsnprintf (char*, size_t, const char*, va_list); /* Macro to emit a call to function named call_in_true_branch_not_eliminated_on_line_NNN() for each expression that's expected to fold to false but that - GCC does not fold. The dg-final scan-tree-dump-time directive + GCC does not fold. The dg-final scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM(expr) \ @@ -35,7 +35,7 @@ extern int vsnprintf (char*, size_t, const char*, va_list); /* Macro to emit a call to a function named call_made_in_{true,false}_branch_on_line_NNN() for each call that's expected to be retained. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that the expected number of both kinds of calls appears in output (a pair for each line with the invocation of the KEEP() macro. */ #define KEEP(expr) \ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/builtin-snprintf-6.c b/gcc/testsuite/gcc.dg/tree-ssa/builtin-snprintf-6.c index df09c81..806a1f4 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/builtin-snprintf-6.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/builtin-snprintf-6.c @@ -23,7 +23,7 @@ int snprintf (char * restrict, size_t, const char *restrict, ...); /* Macro to emit a call to funcation named call_in_true_branch_not_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM(expr) \ if (!(expr)) FAIL (in_true_branch_not_eliminated, __COUNTER__); else (void)0 diff --git a/gcc/testsuite/gcc.dg/tree-ssa/builtin-snprintf-7.c b/gcc/testsuite/gcc.dg/tree-ssa/builtin-snprintf-7.c index bf5072e..f7cb280 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/builtin-snprintf-7.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/builtin-snprintf-7.c @@ -25,7 +25,7 @@ void sink (void*, ...); /* Macro to emit a call to funcation named call_in_true_branch_not_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define VERIFY_ELIM(expr) \ if (!(expr)) FAIL (in_true_branch_not_eliminated, __COUNTER__); else (void)0 @@ -33,7 +33,7 @@ void sink (void*, ...); /* Macro to emit a call to a function named call_made_in_{true,false}_branch_on_line_NNN() for each call that's expected to be retained. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that the expected number of both kinds of calls appears in output (a pair for each line with the invocation of the KEEP() macro. */ #define VERIFY_KEEP(expr) \ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-10.c b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-10.c index 489af62..73e807f 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-10.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-10.c @@ -21,7 +21,7 @@ extern int snprintf (char*, size_t, const char*, ...); /* Macro to emit a call to funcation named call_in_true_branch_not_eliminated_on_line_NNN() for each call that's expected to be eliminated. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM(expr) \ if (!(expr)) FAIL (in_true_branch_not_eliminated); else (void)0 @@ -29,7 +29,7 @@ extern int snprintf (char*, size_t, const char*, ...); /* Macro to emit a call to a function named call_made_in_{true,false}_branch_on_line_NNN() for each call that's expected to be retained. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that the expected number of both kinds of calls appears in output (a pair for each line with the invocation of the KEEP() macro. */ #define KEEP(expr) \ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-9.c b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-9.c index 3be18c7..fca7800 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-9.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-9.c @@ -20,7 +20,7 @@ extern int snprintf (char*, size_t, const char*, ...); /* Macro to emit a call to funcation named call_in_true_branch_not_eliminated_on_line_NNN() for each expression that's expected to fold to false but that - GCC does not fold. The dg-final scan-tree-dump-time directive + GCC does not fold. The dg-final scan-tree-dump-times directive at the bottom of the test verifies that no such call appears in output. */ #define ELIM(expr) \ @@ -29,7 +29,7 @@ extern int snprintf (char*, size_t, const char*, ...); /* Macro to emit a call to a function named call_made_in_{true,false}_branch_on_line_NNN() for each call that's expected to be retained. The dg-final - scan-tree-dump-time directive at the bottom of the test verifies + scan-tree-dump-times directive at the bottom of the test verifies that the expected number of both kinds of calls appears in output (a pair for each line with the invocation of the KEEP() macro. */ #define KEEP(expr) \ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-7.c b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-7.c index 3ee43e5..9b180d5 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-7.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-7.c @@ -16,7 +16,7 @@ int f(int t, int c) } /* There should be no ifs as this is converted into `(t != 0) & (c != 0)`. -/* { dg-final { scan-tree-dump-not "if" "optimized" } }*/ +/* { dg-final { scan-tree-dump-not "if" "optimized" } } */ /* { dg-final { scan-tree-dump-times "\[^\r\n\]*_\[0-9\]* = c_\[0-9\]*.D. != 0" 1 "optimized" } } */ /* { dg-final { scan-tree-dump-times "\[^\r\n\]*_\[0-9\]* = t_\[0-9\]*.D. != 0" 1 "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-value-5.c b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-value-5.c index 8062eb1..12ba475 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-value-5.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-value-5.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* PR treee-optimization/114894 */ +/* PR tree-optimization/114894 */ /* Phi-OPT should be able to optimize these without sinking being invoked. */ /* { dg-options "-O -fdump-tree-phiopt2 -fdump-tree-phiopt3 -fdump-tree-optimized -fno-tree-sink" } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-32.c b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-32.c index 093e7a5..545f316 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-32.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-32.c @@ -25,4 +25,4 @@ int main () return 0; } -/* { dg-final { scan-tree-dump-times "Optimizing range tests .* 26" 1 "reassoc1"} }*/ +/* { dg-final { scan-tree-dump-times "Optimizing range tests .* 26" 1 "reassoc1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-33.c b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-33.c index fa661d9..a89e068 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-33.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-33.c @@ -23,4 +23,4 @@ main () __builtin_abort (); return 0; } -/* { dg-final { scan-tree-dump-times "Optimizing range tests" 3 "reassoc1"} }*/ +/* { dg-final { scan-tree-dump-times "Optimizing range tests" 3 "reassoc1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-34.c b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-34.c index a4da8f7..1c4041b 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-34.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-34.c @@ -20,4 +20,4 @@ int main () __builtin_abort (); return 0; } -/* { dg-final { scan-tree-dump-times "Optimizing range tests" 1 "reassoc1"} }*/ +/* { dg-final { scan-tree-dump-times "Optimizing range tests" 1 "reassoc1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-35.c b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-35.c index dde5d84..a81846c 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-35.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-35.c @@ -22,4 +22,4 @@ main () return 0; } -/* { dg-final { scan-tree-dump-times "Optimizing range tests" 1 "reassoc1"} }*/ +/* { dg-final { scan-tree-dump-times "Optimizing range tests" 1 "reassoc1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-36.c b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-36.c index ffea714..a0489b9 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-36.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-36.c @@ -21,4 +21,4 @@ int main () return 0; } -/* { dg-final { scan-tree-dump-times "Optimizing range tests" 1 "reassoc1"} }*/ +/* { dg-final { scan-tree-dump-times "Optimizing range tests" 1 "reassoc1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-39.c b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-39.c index 9befe18..de75566 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-39.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-39.c @@ -104,4 +104,4 @@ f13 (double x) /* Can't reassoc here. */ return bar (tmp1 * tmp2, tmp2); } -/* { dg-final { scan-tree-dump-times "Optimizing copysign" 12 "reassoc1"} }*/ +/* { dg-final { scan-tree-dump-times "Optimizing copysign" 12 "reassoc1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-41.c b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-41.c index 8a18b88..9624c75 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-41.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-41.c @@ -18,4 +18,4 @@ f2 (double y) return (-1.2 * __builtin_copysign (1.1, y)); } -/* { dg-final { scan-tree-dump-times "Optimizing copysign" 2 "reassoc1"} }*/ +/* { dg-final { scan-tree-dump-times "Optimizing copysign" 2 "reassoc1" } } */ diff --git a/gcc/testsuite/gcc.dg/typedef-redecl3.c b/gcc/testsuite/gcc.dg/typedef-redecl3.c new file mode 100644 index 0000000..a2424d6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/typedef-redecl3.c @@ -0,0 +1,23 @@ +/* { dg-do compile } */ +/* { dg-options "" } */ + +#define N 64 + +struct f { int x; }; +typedef struct f T; +typedef struct f T __attribute__((aligned (N))); +typedef struct f T __attribute__((aligned (N * 2))); +typedef struct f T __attribute__((aligned (N))); +typedef struct f T; + +_Static_assert (_Alignof (T) == N * 2, "N * 2"); + +enum g { A = 1 }; +typedef enum g S; +typedef enum g S __attribute__((aligned (N))); +typedef enum g S __attribute__((aligned (N * 2))); +typedef enum g S __attribute__((aligned (N))); +typedef enum g S; + +_Static_assert (_Alignof (S) == N * 2, "N * 2"); + diff --git a/gcc/testsuite/gcc.dg/uninit-pred-3_c.c b/gcc/testsuite/gcc.dg/uninit-pred-3_c.c index 1309790..2125448 100644 --- a/gcc/testsuite/gcc.dg/uninit-pred-3_c.c +++ b/gcc/testsuite/gcc.dg/uninit-pred-3_c.c @@ -23,6 +23,6 @@ int foo (int n, int m, int r) if (r > 0) if (flag < 0) - blah(v); /* {dg-bogus "uninitialized" "bogus warning" } */ + blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */ return 0; } diff --git a/gcc/testsuite/gcc.dg/uninit-pred-3_d.c b/gcc/testsuite/gcc.dg/uninit-pred-3_d.c index 9f93876..272e46b 100644 --- a/gcc/testsuite/gcc.dg/uninit-pred-3_d.c +++ b/gcc/testsuite/gcc.dg/uninit-pred-3_d.c @@ -23,6 +23,6 @@ int foo (int n, int m, int r) if (r > 0) if (flag == -1) - blah(v); /* {dg-bogus "uninitialized" "bogus warning" } */ + blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */ return 0; } diff --git a/gcc/testsuite/gcc.dg/variable-sized-type-flex-array.c b/gcc/testsuite/gcc.dg/variable-sized-type-flex-array.c index 3924937..2267af5 100644 --- a/gcc/testsuite/gcc.dg/variable-sized-type-flex-array.c +++ b/gcc/testsuite/gcc.dg/variable-sized-type-flex-array.c @@ -26,6 +26,6 @@ union flex_union_mid1 { int a; struct outer_flex_mid1 b; }; /* { dg-bogus "struc struct flexn { int n; int data[8]; }; struct out_flex_endn { int m; struct flexn flex_data; }; /* { dg-bogus "structure containing a flexible array member is not at the end of another structure" } */ -struct out_flex_midn { struct flexn flex_data; int m; }; /* { dg-bogus"structure containing a flexible array member is not at the end of another structure" } */ -struct outer_flex_midn { struct out_flex_midn out_flex_data; int p; }; /* { dg-bogus"structure containing a flexible array member is not at the end of another structure" } */ +struct out_flex_midn { struct flexn flex_data; int m; }; /* { dg-bogus "structure containing a flexible array member is not at the end of another structure" } */ +struct outer_flex_midn { struct out_flex_midn out_flex_data; int p; }; /* { dg-bogus "structure containing a flexible array member is not at the end of another structure" } */ union flex_union_midn { int a; struct outer_flex_midn b; }; /* { dg-bogus "structure containing a flexible array member is not at the end of another structure" } */ diff --git a/gcc/testsuite/gcc.misc-tests/gcov-29.c b/gcc/testsuite/gcc.misc-tests/gcov-29.c new file mode 100644 index 0000000..320570e --- /dev/null +++ b/gcc/testsuite/gcc.misc-tests/gcov-29.c @@ -0,0 +1,869 @@ +/* { dg-options "--coverage -fpath-coverage" } */ +/* { dg-do run { target native } } */ + +void +pathcov001a () +{ + /* Empty functions should not be problematic. */ +} + +/* Straight line, which should have only one path. */ +/* BEGIN paths + summary: 1/1 +*/ +void +pathcov001b () +/* END */ +{ + int a = 0; + ++a; +} + +/* Same as b, but not executed. */ +/* BEGIN paths + summary: 0/1 + expect: 33 +*/ +void +pathcov001c () +/* END */ +{ + int a = 0; + ++a; +} + +/* 002 is a simple baseline test, with no complicated control flow and no + loops, run with different combinations of inputs that tests the paths in + isolation. */ +/* BEGIN paths + summary: 0/2 + expect: 48(true) 49 52 + expect: 48(false) 51 52 +*/ +void +pathcov002a (int a) +/* END */ +{ + int v = 0; + if (a) + v++; + else + v--; +} + +/* BEGIN paths + summary: 1/2 + expect: 63(false) 66 67 +*/ +void +pathcov002c (int a) +/* END */ +{ + int v = 0; + if (a) + v++; + else + v--; +} + +/* BEGIN paths + summary: 1/2 + expect: 78(true) 79 82 +*/ +void +pathcov002b (int a) +/* END */ +{ + int v = 0; + if (a) + v++; + else + v--; +} + +/* Identical to 002*, but run for both inputs. This should achieve full + coverage. + + BEGIN paths + summary: 2/2 +*/ +void +pathcov002d (int a) +/* END */ +{ + int v = 0; + if (a) + v++; + else + v--; +} + +/* Test individual control flow structures in isolation. */ + +/* BEGIN paths + summary: 0/2 + expect: 112(true) 113 114 + expect: 112(false) 114 +*/ +void +pathcov003a (int a) +/* END */ +{ + if (a) + a++; +} + +/* BEGIN paths + summary: 0/2 + expect: 125(true) 126 129 + expect: 125(false) 128 129 +*/ +void +pathcov003b (int a) +/* END */ +{ + if (a) + a++; + else + a--; +} + +/* BEGIN paths + summary: 0/3 + expect: 141(true) 142 147 + expect: 141(false) 143(true) 144 147 + expect: 141(false) 143(false) 146 147 +*/ +void +pathcov003c (int a) +/* END */ +{ + if (a > 10) + a++; + else if (a > 20) + a--; + else + a += 2; +} + +/* BEGIN paths + summary: 0/5 + expect: 162 162(true) 163 + expect: 162 162(false) 164 + expect: 163 162(true) 163 + expect: 163 162(false) 164 + expect: 162(true) 163 162 +*/ +void +pathcov003d (int a) +/* END */ +{ + int x = 0; + for (int i = 0; i < a; ++i) + ++x; +} + +/* BEGIN paths + summary: 0/5 + expect: 180 180(true) 181 + expect: 180 180(false) 182 + expect: 181 180(true) 181 + expect: 181 180(false) 182 + expect: 180(true) 181 180 +*/ +void +pathcov003e (int a) +/* END */ +{ + int x = 0; + int i = 0; + while (i++ < a) + x++; +} + +/* BEGIN paths + summary: 0/2 + expect: 194 197(false) 198 + expect: 197(true) 197 +*/ +void +pathcov003f (int a) +/* END */ +{ + int x = 0; + int i = 0; + do { + x++; + } while (i++ < a); +} + +/* BEGIN paths + summary: 0/5 + expect: 213 216(true) 220 + expect: 213 216(false) 222 + expect: 216(true) 220 216 + expect: 220 216(true) 220 + expect: 220 216(false) 222 +*/ +void +pathcov003g (int a) +/* END */ +{ + int i = 0; + int x = 0; + +top: + if (i < a) + { + x++; + i++; + goto top; + } +} + +/* This example has a good mix of control flow structures which makes it nice + at identifying problems with the bookeeping/instrumentation. */ + +/* BEGIN paths + summary: 0/9 + expect: 243(false) 247 247(true) 247(true) 249(true) 250 253 + expect: 243(false) 247 247(true) 247(false) 253 + expect: 243(false) 247 247(false) 253 + expect: 243(true) 253 + expect: 249(false) 247(true) 247(true) 249 + expect: 249(false) 247(true) 247(false) 253 + expect: 247(true) 247(true) 249(false) 247 + expect: 247(true) 249(false) 247(true) 247 + expect: 247(true) 249(false) 247(false) 253 +*/ +void +pathcov004a (int a, int b, int c, int d) +/* END */ +{ + if (a) + {} + else + { + while (b-- > 0 && c-- > 0) + { + if (d) + break; + } + } +} + +/* BEGIN paths + args: (1, 0, 0, 0) + summary: 1/9 */ +void +pathcov004b (int a, int b, int c, int d) +/* END */ +{ + if (a) + {} + else + { + while (b-- > 0 && c-- > 0) + { + if (d) + break; + } + } +} + +/* BEGIN paths + args: (0, 0, 0, 0) + summary: 1/9 */ +void +pathcov004c (int a, int b, int c, int d) +/* END */ +{ + if (a) + {} + else + { + while (b-- > 0 && c-- > 0) + { + if (d) + break; + } + } +} + +/* BEGIN paths + args: (0, 1, 0, 0) + summary: 1/9 */ +void +pathcov004d (int a, int b, int c, int d) +/* END */ +{ + if (a) + {} + else + { + while (b-- > 0 && c-- > 0) + { + if (d) + break; + } + } +} + +/* BEGIN paths + args: (0, 1, 1, 0) + summary: 2/9 */ +void +pathcov004e (int a, int b, int c, int d) +/* END */ +{ + if (a) + {} + else + { + while (b-- > 0 && c-- > 0) + { + if (d) + break; + } + } +} + +/* BEGIN paths + args: (0, 2, 1, 0) + summary: 3/9 */ +void +pathcov004f (int a, int b, int c, int d) +/* END */ +{ + if (a) + {} + else + { + while (b-- > 0 && c-- > 0) + { + if (d) + break; + } + } +} + +/* Funny loop exits. */ + +/* BEGIN paths + summary: 0/14 +*/ +void +pathcov005a (int a, int b, int c) +/* END */ +{ + while (a) + { + if (b) + return; + while (c--) + a++; + } +} + +void +pathcov005b (int a, int b, int c) +/* END */ +{ + if (a) + goto loop; + + while (b > 0) + { + b--; +loop: + while (c--) + a++; + } +} + +void +pathcov005c (int a, int b, int c) +/* END */ +{ + while (a-- > 0) c++; + while (b-- > 0) c++; +} + +/* BEGIN paths + summary: 0/67 + + This is a sanity check and baseline and should not be executed. + + With >64 cases we should have >64 paths which guarantees we cannot fit the + full bitset within a in a single gcov type. We want to only update the + relevant counters because extra instructions are expensive in compile time + and binary bloat, and verify that only taken paths are recorded. */ +void +pathcov006a (int a) +/* END */ +{ + int x = 0; + switch (a) + { + case 0: x++; break; + case 1: x++; break; + case 2: x++; break; + case 3: x++; break; + case 4: x++; break; + case 5: x++; break; + case 6: x++; break; + case 7: x++; break; + case 8: x++; break; + case 9: x++; break; + case 10: x++; break; + case 11: x++; break; + case 12: x++; break; + case 13: x++; break; + case 14: x++; break; + case 15: x++; break; + case 16: x++; break; + case 17: x++; break; + case 18: x++; break; + case 19: x++; break; + case 20: x++; break; + case 21: x++; break; + case 22: x++; break; + case 23: x++; break; + case 24: x++; break; + case 25: x++; break; + case 26: x++; break; + case 27: x++; break; + case 28: x++; break; + case 29: x++; break; + case 30: x++; break; + case 31: x++; break; + case 32: x++; break; + case 33: x++; break; + case 34: x++; break; + case 35: x++; break; + case 36: x++; break; + case 37: x++; break; + case 38: x++; break; + case 39: x++; break; + case 40: x++; break; + case 41: x++; break; + case 42: x++; break; + case 43: x++; break; + case 44: x++; break; + case 45: x++; break; + case 46: x++; break; + case 47: x++; break; + case 48: x++; break; + case 49: x++; break; + case 50: x++; break; + case 51: x++; break; + case 52: x++; break; + case 53: x++; break; + case 54: x++; break; + case 55: x++; break; + case 56: x++; break; + case 57: x++; break; + case 58: x++; break; + case 59: x++; break; + case 60: x++; break; + case 61: x++; break; + case 62: x++; break; + case 63: x++; break; + case 64: x++; break; + case 65: x++; break; + } +} + +/* BEGIN paths + args: (0) + summary: 1/67 +*/ +void +pathcov006b (int a) +/* END */ +{ + int x = 0; + switch (a) + { + case 0: x++; break; + case 1: x++; break; + case 2: x++; break; + case 3: x++; break; + case 4: x++; break; + case 5: x++; break; + case 6: x++; break; + case 7: x++; break; + case 8: x++; break; + case 9: x++; break; + case 10: x++; break; + case 11: x++; break; + case 12: x++; break; + case 13: x++; break; + case 14: x++; break; + case 15: x++; break; + case 16: x++; break; + case 17: x++; break; + case 18: x++; break; + case 19: x++; break; + case 20: x++; break; + case 21: x++; break; + case 22: x++; break; + case 23: x++; break; + case 24: x++; break; + case 25: x++; break; + case 26: x++; break; + case 27: x++; break; + case 28: x++; break; + case 29: x++; break; + case 30: x++; break; + case 31: x++; break; + case 32: x++; break; + case 33: x++; break; + case 34: x++; break; + case 35: x++; break; + case 36: x++; break; + case 37: x++; break; + case 38: x++; break; + case 39: x++; break; + case 40: x++; break; + case 41: x++; break; + case 42: x++; break; + case 43: x++; break; + case 44: x++; break; + case 45: x++; break; + case 46: x++; break; + case 47: x++; break; + case 48: x++; break; + case 49: x++; break; + case 50: x++; break; + case 51: x++; break; + case 52: x++; break; + case 53: x++; break; + case 54: x++; break; + case 55: x++; break; + case 56: x++; break; + case 57: x++; break; + case 58: x++; break; + case 59: x++; break; + case 60: x++; break; + case 61: x++; break; + case 62: x++; break; + case 63: x++; break; + case 64: x++; break; + case 65: x++; break; + } +} + +/* BEGIN paths + args: (64) + summary: 1/67 */ +void +pathcov006c (int a) +/* END */ +{ + int x = 0; + switch (a) + { + case 0: x++; break; + case 1: x++; break; + case 2: x++; break; + case 3: x++; break; + case 4: x++; break; + case 5: x++; break; + case 6: x++; break; + case 7: x++; break; + case 8: x++; break; + case 9: x++; break; + case 10: x++; break; + case 11: x++; break; + case 12: x++; break; + case 13: x++; break; + case 14: x++; break; + case 15: x++; break; + case 16: x++; break; + case 17: x++; break; + case 18: x++; break; + case 19: x++; break; + case 20: x++; break; + case 21: x++; break; + case 22: x++; break; + case 23: x++; break; + case 24: x++; break; + case 25: x++; break; + case 26: x++; break; + case 27: x++; break; + case 28: x++; break; + case 29: x++; break; + case 30: x++; break; + case 31: x++; break; + case 32: x++; break; + case 33: x++; break; + case 34: x++; break; + case 35: x++; break; + case 36: x++; break; + case 37: x++; break; + case 38: x++; break; + case 39: x++; break; + case 40: x++; break; + case 41: x++; break; + case 42: x++; break; + case 43: x++; break; + case 44: x++; break; + case 45: x++; break; + case 46: x++; break; + case 47: x++; break; + case 48: x++; break; + case 49: x++; break; + case 50: x++; break; + case 51: x++; break; + case 52: x++; break; + case 53: x++; break; + case 54: x++; break; + case 55: x++; break; + case 56: x++; break; + case 57: x++; break; + case 58: x++; break; + case 59: x++; break; + case 60: x++; break; + case 61: x++; break; + case 62: x++; break; + case 63: x++; break; + case 64: x++; break; + case 65: x++; break; + } +} + +/* BEGIN paths + args: (2, 65) + summary: 2/67 + + In this case we should record a path in both halves of the accumulator + bitsets. Note that the paths don't overlap with the single-half examples in + 006b and 006c to reduce the chance of accidental passes. */ +void +pathcov006d (int a) +/* END */ +{ + int x = 0; + switch (a) + { + case 0: x++; break; + case 1: x++; break; + case 2: x++; break; + case 3: x++; break; + case 4: x++; break; + case 5: x++; break; + case 6: x++; break; + case 7: x++; break; + case 8: x++; break; + case 9: x++; break; + case 10: x++; break; + case 11: x++; break; + case 12: x++; break; + case 13: x++; break; + case 14: x++; break; + case 15: x++; break; + case 16: x++; break; + case 17: x++; break; + case 18: x++; break; + case 19: x++; break; + case 20: x++; break; + case 21: x++; break; + case 22: x++; break; + case 23: x++; break; + case 24: x++; break; + case 25: x++; break; + case 26: x++; break; + case 27: x++; break; + case 28: x++; break; + case 29: x++; break; + case 30: x++; break; + case 31: x++; break; + case 32: x++; break; + case 33: x++; break; + case 34: x++; break; + case 35: x++; break; + case 36: x++; break; + case 37: x++; break; + case 38: x++; break; + case 39: x++; break; + case 40: x++; break; + case 41: x++; break; + case 42: x++; break; + case 43: x++; break; + case 44: x++; break; + case 45: x++; break; + case 46: x++; break; + case 47: x++; break; + case 48: x++; break; + case 49: x++; break; + case 50: x++; break; + case 51: x++; break; + case 52: x++; break; + case 53: x++; break; + case 54: x++; break; + case 55: x++; break; + case 56: x++; break; + case 57: x++; break; + case 58: x++; break; + case 59: x++; break; + case 60: x++; break; + case 61: x++; break; + case 62: x++; break; + case 63: x++; break; + case 64: x++; break; + case 65: x++; break; + } +} + +/* BEGIN paths + args: (66) + summary: 1/67 + + This case should hit the empty default. */ +void +pathcov006e (int a) +/* END */ +{ + int x = 0; + switch (a) + { + case 0: x++; break; + case 1: x++; break; + case 2: x++; break; + case 3: x++; break; + case 4: x++; break; + case 5: x++; break; + case 6: x++; break; + case 7: x++; break; + case 8: x++; break; + case 9: x++; break; + case 10: x++; break; + case 11: x++; break; + case 12: x++; break; + case 13: x++; break; + case 14: x++; break; + case 15: x++; break; + case 16: x++; break; + case 17: x++; break; + case 18: x++; break; + case 19: x++; break; + case 20: x++; break; + case 21: x++; break; + case 22: x++; break; + case 23: x++; break; + case 24: x++; break; + case 25: x++; break; + case 26: x++; break; + case 27: x++; break; + case 28: x++; break; + case 29: x++; break; + case 30: x++; break; + case 31: x++; break; + case 32: x++; break; + case 33: x++; break; + case 34: x++; break; + case 35: x++; break; + case 36: x++; break; + case 37: x++; break; + case 38: x++; break; + case 39: x++; break; + case 40: x++; break; + case 41: x++; break; + case 42: x++; break; + case 43: x++; break; + case 44: x++; break; + case 45: x++; break; + case 46: x++; break; + case 47: x++; break; + case 48: x++; break; + case 49: x++; break; + case 50: x++; break; + case 51: x++; break; + case 52: x++; break; + case 53: x++; break; + case 54: x++; break; + case 55: x++; break; + case 56: x++; break; + case 57: x++; break; + case 58: x++; break; + case 59: x++; break; + case 60: x++; break; + case 61: x++; break; + case 62: x++; break; + case 63: x++; break; + case 64: x++; break; + case 65: x++; break; + default: + } +} + +void *alloc (int) { return 0; } +void *getcwd (void *, int) { return 0; } +void release (void *) {} + +/* Based on gnu_getcwd from tree.c. This function crashed in early + development, and is mostly useful as a regression test. + + BEGIN paths + summary: 0/8 */ +void *gnu_getcwd() +/* END */ +{ + int size = 100; + void *buffer = alloc (size); + + while (1) { + void *value = getcwd (buffer, size); + if (value != 0) return buffer; + size *= 2; + release (buffer); + buffer = (void *) alloc (size); + } +} + +/* BEGIN paths + summary: 0/5 */ +void pathcov007a (int a) +/* END */ +{ + goto mid; + while (1) + { + a--; + mid: + a--; + if (a < -5) + break; + a--; + } +} + +int +main () +{ + pathcov001a (); + pathcov001b (); + /* not called: pathcov001c (); */ + + /* not called: pathcov002a (); */ + pathcov002b (0); + pathcov002c (1); + pathcov002d (0); + pathcov002d (1); + + pathcov004b (1, 0, 0, 0); + pathcov004c (0, 0, 0, 0); + pathcov004d (0, 1, 0, 0); + pathcov004e (0, 1, 1, 0); + pathcov004f (0, 2, 1, 0); + + /* not called: pathcov006a (); */ + pathcov006b (0); + pathcov006c (64); + pathcov006d (2); + pathcov006d (65); + pathcov006e (66); +} + +/* { dg-final { run-gcov prime-paths { --prime-paths-lines gcov-29.c } } } */ diff --git a/gcc/testsuite/gcc.misc-tests/gcov-30.c b/gcc/testsuite/gcc.misc-tests/gcov-30.c new file mode 100644 index 0000000..dbc1681 --- /dev/null +++ b/gcc/testsuite/gcc.misc-tests/gcov-30.c @@ -0,0 +1,869 @@ +/* { dg-options "--coverage -fpath-coverage -fprofile-update=atomic" } */ +/* { dg-do run { target native } } */ + +void +pathcov001a () +{ + /* Empty functions should not be problematic. */ +} + +/* Straight line, which should have only one path. */ +/* BEGIN paths + summary: 1/1 +*/ +void +pathcov001b () +/* END */ +{ + int a = 0; + ++a; +} + +/* Same as b, but not executed. */ +/* BEGIN paths + summary: 0/1 + expect: 33 +*/ +void +pathcov001c () +/* END */ +{ + int a = 0; + ++a; +} + +/* 002 is a simple baseline test, with no complicated control flow and no + loops, run with different combinations of inputs that tests the paths in + isolation. */ +/* BEGIN paths + summary: 0/2 + expect: 48(true) 49 52 + expect: 48(false) 51 52 +*/ +void +pathcov002a (int a) +/* END */ +{ + int v = 0; + if (a) + v++; + else + v--; +} + +/* BEGIN paths + summary: 1/2 + expect: 63(false) 66 67 +*/ +void +pathcov002c (int a) +/* END */ +{ + int v = 0; + if (a) + v++; + else + v--; +} + +/* BEGIN paths + summary: 1/2 + expect: 78(true) 79 82 +*/ +void +pathcov002b (int a) +/* END */ +{ + int v = 0; + if (a) + v++; + else + v--; +} + +/* Identical to 002*, but run for both inputs. This should achieve full + coverage. + + BEGIN paths + summary: 2/2 +*/ +void +pathcov002d (int a) +/* END */ +{ + int v = 0; + if (a) + v++; + else + v--; +} + +/* Test individual control flow structures in isolation. */ + +/* BEGIN paths + summary: 0/2 + expect: 112(true) 113 114 + expect: 112(false) 114 +*/ +void +pathcov003a (int a) +/* END */ +{ + if (a) + a++; +} + +/* BEGIN paths + summary: 0/2 + expect: 125(true) 126 129 + expect: 125(false) 128 129 +*/ +void +pathcov003b (int a) +/* END */ +{ + if (a) + a++; + else + a--; +} + +/* BEGIN paths + summary: 0/3 + expect: 141(true) 142 147 + expect: 141(false) 143(true) 144 147 + expect: 141(false) 143(false) 146 147 +*/ +void +pathcov003c (int a) +/* END */ +{ + if (a > 10) + a++; + else if (a > 20) + a--; + else + a += 2; +} + +/* BEGIN paths + summary: 0/5 + expect: 162 162(true) 163 + expect: 162 162(false) 164 + expect: 163 162(true) 163 + expect: 163 162(false) 164 + expect: 162(true) 163 162 +*/ +void +pathcov003d (int a) +/* END */ +{ + int x = 0; + for (int i = 0; i < a; ++i) + ++x; +} + +/* BEGIN paths + summary: 0/5 + expect: 180 180(true) 181 + expect: 180 180(false) 182 + expect: 181 180(true) 181 + expect: 181 180(false) 182 + expect: 180(true) 181 180 +*/ +void +pathcov003e (int a) +/* END */ +{ + int x = 0; + int i = 0; + while (i++ < a) + x++; +} + +/* BEGIN paths + summary: 0/2 + expect: 194 197(false) 198 + expect: 197(true) 197 +*/ +void +pathcov003f (int a) +/* END */ +{ + int x = 0; + int i = 0; + do { + x++; + } while (i++ < a); +} + +/* BEGIN paths + summary: 0/5 + expect: 213 216(true) 220 + expect: 213 216(false) 222 + expect: 216(true) 220 216 + expect: 220 216(true) 220 + expect: 220 216(false) 222 +*/ +void +pathcov003g (int a) +/* END */ +{ + int i = 0; + int x = 0; + +top: + if (i < a) + { + x++; + i++; + goto top; + } +} + +/* This example has a good mix of control flow structures which makes it nice + at identifying problems with the bookeeping/instrumentation. */ + +/* BEGIN paths + summary: 0/9 + expect: 243(false) 247 247(true) 247(true) 249(true) 250 253 + expect: 243(false) 247 247(true) 247(false) 253 + expect: 243(false) 247 247(false) 253 + expect: 243(true) 253 + expect: 249(false) 247(true) 247(true) 249 + expect: 249(false) 247(true) 247(false) 253 + expect: 247(true) 247(true) 249(false) 247 + expect: 247(true) 249(false) 247(true) 247 + expect: 247(true) 249(false) 247(false) 253 +*/ +void +pathcov004a (int a, int b, int c, int d) +/* END */ +{ + if (a) + {} + else + { + while (b-- > 0 && c-- > 0) + { + if (d) + break; + } + } +} + +/* BEGIN paths + args: (1, 0, 0, 0) + summary: 1/9 */ +void +pathcov004b (int a, int b, int c, int d) +/* END */ +{ + if (a) + {} + else + { + while (b-- > 0 && c-- > 0) + { + if (d) + break; + } + } +} + +/* BEGIN paths + args: (0, 0, 0, 0) + summary: 1/9 */ +void +pathcov004c (int a, int b, int c, int d) +/* END */ +{ + if (a) + {} + else + { + while (b-- > 0 && c-- > 0) + { + if (d) + break; + } + } +} + +/* BEGIN paths + args: (0, 1, 0, 0) + summary: 1/9 */ +void +pathcov004d (int a, int b, int c, int d) +/* END */ +{ + if (a) + {} + else + { + while (b-- > 0 && c-- > 0) + { + if (d) + break; + } + } +} + +/* BEGIN paths + args: (0, 1, 1, 0) + summary: 2/9 */ +void +pathcov004e (int a, int b, int c, int d) +/* END */ +{ + if (a) + {} + else + { + while (b-- > 0 && c-- > 0) + { + if (d) + break; + } + } +} + +/* BEGIN paths + args: (0, 2, 1, 0) + summary: 3/9 */ +void +pathcov004f (int a, int b, int c, int d) +/* END */ +{ + if (a) + {} + else + { + while (b-- > 0 && c-- > 0) + { + if (d) + break; + } + } +} + +/* Funny loop exits. */ + +/* BEGIN paths + summary: 0/14 +*/ +void +pathcov005a (int a, int b, int c) +/* END */ +{ + while (a) + { + if (b) + return; + while (c--) + a++; + } +} + +void +pathcov005b (int a, int b, int c) +/* END */ +{ + if (a) + goto loop; + + while (b > 0) + { + b--; +loop: + while (c--) + a++; + } +} + +void +pathcov005c (int a, int b, int c) +/* END */ +{ + while (a-- > 0) c++; + while (b-- > 0) c++; +} + +/* BEGIN paths + summary: 0/67 + + This is a sanity check and baseline and should not be executed. + + With >64 cases we should have >64 paths which guarantees we cannot fit the + full bitset within a in a single gcov type. We want to only update the + relevant counters because extra instructions are expensive in compile time + and binary bloat, and verify that only taken paths are recorded. */ +void +pathcov006a (int a) +/* END */ +{ + int x = 0; + switch (a) + { + case 0: x++; break; + case 1: x++; break; + case 2: x++; break; + case 3: x++; break; + case 4: x++; break; + case 5: x++; break; + case 6: x++; break; + case 7: x++; break; + case 8: x++; break; + case 9: x++; break; + case 10: x++; break; + case 11: x++; break; + case 12: x++; break; + case 13: x++; break; + case 14: x++; break; + case 15: x++; break; + case 16: x++; break; + case 17: x++; break; + case 18: x++; break; + case 19: x++; break; + case 20: x++; break; + case 21: x++; break; + case 22: x++; break; + case 23: x++; break; + case 24: x++; break; + case 25: x++; break; + case 26: x++; break; + case 27: x++; break; + case 28: x++; break; + case 29: x++; break; + case 30: x++; break; + case 31: x++; break; + case 32: x++; break; + case 33: x++; break; + case 34: x++; break; + case 35: x++; break; + case 36: x++; break; + case 37: x++; break; + case 38: x++; break; + case 39: x++; break; + case 40: x++; break; + case 41: x++; break; + case 42: x++; break; + case 43: x++; break; + case 44: x++; break; + case 45: x++; break; + case 46: x++; break; + case 47: x++; break; + case 48: x++; break; + case 49: x++; break; + case 50: x++; break; + case 51: x++; break; + case 52: x++; break; + case 53: x++; break; + case 54: x++; break; + case 55: x++; break; + case 56: x++; break; + case 57: x++; break; + case 58: x++; break; + case 59: x++; break; + case 60: x++; break; + case 61: x++; break; + case 62: x++; break; + case 63: x++; break; + case 64: x++; break; + case 65: x++; break; + } +} + +/* BEGIN paths + args: (0) + summary: 1/67 +*/ +void +pathcov006b (int a) +/* END */ +{ + int x = 0; + switch (a) + { + case 0: x++; break; + case 1: x++; break; + case 2: x++; break; + case 3: x++; break; + case 4: x++; break; + case 5: x++; break; + case 6: x++; break; + case 7: x++; break; + case 8: x++; break; + case 9: x++; break; + case 10: x++; break; + case 11: x++; break; + case 12: x++; break; + case 13: x++; break; + case 14: x++; break; + case 15: x++; break; + case 16: x++; break; + case 17: x++; break; + case 18: x++; break; + case 19: x++; break; + case 20: x++; break; + case 21: x++; break; + case 22: x++; break; + case 23: x++; break; + case 24: x++; break; + case 25: x++; break; + case 26: x++; break; + case 27: x++; break; + case 28: x++; break; + case 29: x++; break; + case 30: x++; break; + case 31: x++; break; + case 32: x++; break; + case 33: x++; break; + case 34: x++; break; + case 35: x++; break; + case 36: x++; break; + case 37: x++; break; + case 38: x++; break; + case 39: x++; break; + case 40: x++; break; + case 41: x++; break; + case 42: x++; break; + case 43: x++; break; + case 44: x++; break; + case 45: x++; break; + case 46: x++; break; + case 47: x++; break; + case 48: x++; break; + case 49: x++; break; + case 50: x++; break; + case 51: x++; break; + case 52: x++; break; + case 53: x++; break; + case 54: x++; break; + case 55: x++; break; + case 56: x++; break; + case 57: x++; break; + case 58: x++; break; + case 59: x++; break; + case 60: x++; break; + case 61: x++; break; + case 62: x++; break; + case 63: x++; break; + case 64: x++; break; + case 65: x++; break; + } +} + +/* BEGIN paths + args: (64) + summary: 1/67 */ +void +pathcov006c (int a) +/* END */ +{ + int x = 0; + switch (a) + { + case 0: x++; break; + case 1: x++; break; + case 2: x++; break; + case 3: x++; break; + case 4: x++; break; + case 5: x++; break; + case 6: x++; break; + case 7: x++; break; + case 8: x++; break; + case 9: x++; break; + case 10: x++; break; + case 11: x++; break; + case 12: x++; break; + case 13: x++; break; + case 14: x++; break; + case 15: x++; break; + case 16: x++; break; + case 17: x++; break; + case 18: x++; break; + case 19: x++; break; + case 20: x++; break; + case 21: x++; break; + case 22: x++; break; + case 23: x++; break; + case 24: x++; break; + case 25: x++; break; + case 26: x++; break; + case 27: x++; break; + case 28: x++; break; + case 29: x++; break; + case 30: x++; break; + case 31: x++; break; + case 32: x++; break; + case 33: x++; break; + case 34: x++; break; + case 35: x++; break; + case 36: x++; break; + case 37: x++; break; + case 38: x++; break; + case 39: x++; break; + case 40: x++; break; + case 41: x++; break; + case 42: x++; break; + case 43: x++; break; + case 44: x++; break; + case 45: x++; break; + case 46: x++; break; + case 47: x++; break; + case 48: x++; break; + case 49: x++; break; + case 50: x++; break; + case 51: x++; break; + case 52: x++; break; + case 53: x++; break; + case 54: x++; break; + case 55: x++; break; + case 56: x++; break; + case 57: x++; break; + case 58: x++; break; + case 59: x++; break; + case 60: x++; break; + case 61: x++; break; + case 62: x++; break; + case 63: x++; break; + case 64: x++; break; + case 65: x++; break; + } +} + +/* BEGIN paths + args: (2, 65) + summary: 2/67 + + In this case we should record a path in both halves of the accumulator + bitsets. Note that the paths don't overlap with the single-half examples in + 006b and 006c to reduce the chance of accidental passes. */ +void +pathcov006d (int a) +/* END */ +{ + int x = 0; + switch (a) + { + case 0: x++; break; + case 1: x++; break; + case 2: x++; break; + case 3: x++; break; + case 4: x++; break; + case 5: x++; break; + case 6: x++; break; + case 7: x++; break; + case 8: x++; break; + case 9: x++; break; + case 10: x++; break; + case 11: x++; break; + case 12: x++; break; + case 13: x++; break; + case 14: x++; break; + case 15: x++; break; + case 16: x++; break; + case 17: x++; break; + case 18: x++; break; + case 19: x++; break; + case 20: x++; break; + case 21: x++; break; + case 22: x++; break; + case 23: x++; break; + case 24: x++; break; + case 25: x++; break; + case 26: x++; break; + case 27: x++; break; + case 28: x++; break; + case 29: x++; break; + case 30: x++; break; + case 31: x++; break; + case 32: x++; break; + case 33: x++; break; + case 34: x++; break; + case 35: x++; break; + case 36: x++; break; + case 37: x++; break; + case 38: x++; break; + case 39: x++; break; + case 40: x++; break; + case 41: x++; break; + case 42: x++; break; + case 43: x++; break; + case 44: x++; break; + case 45: x++; break; + case 46: x++; break; + case 47: x++; break; + case 48: x++; break; + case 49: x++; break; + case 50: x++; break; + case 51: x++; break; + case 52: x++; break; + case 53: x++; break; + case 54: x++; break; + case 55: x++; break; + case 56: x++; break; + case 57: x++; break; + case 58: x++; break; + case 59: x++; break; + case 60: x++; break; + case 61: x++; break; + case 62: x++; break; + case 63: x++; break; + case 64: x++; break; + case 65: x++; break; + } +} + +/* BEGIN paths + args: (66) + summary: 1/67 + + This case should hit the empty default. */ +void +pathcov006e (int a) +/* END */ +{ + int x = 0; + switch (a) + { + case 0: x++; break; + case 1: x++; break; + case 2: x++; break; + case 3: x++; break; + case 4: x++; break; + case 5: x++; break; + case 6: x++; break; + case 7: x++; break; + case 8: x++; break; + case 9: x++; break; + case 10: x++; break; + case 11: x++; break; + case 12: x++; break; + case 13: x++; break; + case 14: x++; break; + case 15: x++; break; + case 16: x++; break; + case 17: x++; break; + case 18: x++; break; + case 19: x++; break; + case 20: x++; break; + case 21: x++; break; + case 22: x++; break; + case 23: x++; break; + case 24: x++; break; + case 25: x++; break; + case 26: x++; break; + case 27: x++; break; + case 28: x++; break; + case 29: x++; break; + case 30: x++; break; + case 31: x++; break; + case 32: x++; break; + case 33: x++; break; + case 34: x++; break; + case 35: x++; break; + case 36: x++; break; + case 37: x++; break; + case 38: x++; break; + case 39: x++; break; + case 40: x++; break; + case 41: x++; break; + case 42: x++; break; + case 43: x++; break; + case 44: x++; break; + case 45: x++; break; + case 46: x++; break; + case 47: x++; break; + case 48: x++; break; + case 49: x++; break; + case 50: x++; break; + case 51: x++; break; + case 52: x++; break; + case 53: x++; break; + case 54: x++; break; + case 55: x++; break; + case 56: x++; break; + case 57: x++; break; + case 58: x++; break; + case 59: x++; break; + case 60: x++; break; + case 61: x++; break; + case 62: x++; break; + case 63: x++; break; + case 64: x++; break; + case 65: x++; break; + default: + } +} + +void *alloc (int) { return 0; } +void *getcwd (void *, int) { return 0; } +void release (void *) {} + +/* Based on gnu_getcwd from tree.c. This function crashed in early + development, and is mostly useful as a regression test. + + BEGIN paths + summary: 0/8 */ +void *gnu_getcwd() +/* END */ +{ + int size = 100; + void *buffer = alloc (size); + + while (1) { + void *value = getcwd (buffer, size); + if (value != 0) return buffer; + size *= 2; + release (buffer); + buffer = (void *) alloc (size); + } +} + +/* BEGIN paths + summary: 0/5 */ +void pathcov007a (int a) +/* END */ +{ + goto mid; + while (1) + { + a--; + mid: + a--; + if (a < -5) + break; + a--; + } +} + +int +main () +{ + pathcov001a (); + pathcov001b (); + /* not called: pathcov001c (); */ + + /* not called: pathcov002a (); */ + pathcov002b (0); + pathcov002c (1); + pathcov002d (0); + pathcov002d (1); + + pathcov004b (1, 0, 0, 0); + pathcov004c (0, 0, 0, 0); + pathcov004d (0, 1, 0, 0); + pathcov004e (0, 1, 1, 0); + pathcov004f (0, 2, 1, 0); + + /* not called: pathcov006a (); */ + pathcov006b (0); + pathcov006c (64); + pathcov006d (2); + pathcov006d (65); + pathcov006e (66); +} + +/* { dg-final { run-gcov prime-paths { --prime-paths-lines gcov-30.c } } } */ diff --git a/gcc/testsuite/gcc.misc-tests/gcov-31.c b/gcc/testsuite/gcc.misc-tests/gcov-31.c new file mode 100644 index 0000000..6c42d34 --- /dev/null +++ b/gcc/testsuite/gcc.misc-tests/gcov-31.c @@ -0,0 +1,36 @@ +/* { dg-options "--coverage -fpath-coverage" } */ +/* { dg-do compile } */ +/* { dg-require-effective-target sigsetjmp } */ + +/* A collection of odd crashes and regressions observed when building arbitrary + programs. */ + +#include <setjmp.h> + +/* Based on bash-5.2/trap.c run_pending_traps. This revealed a case where + adding IOR failed because there was no to replace in the phi. */ +extern void jump_to_top_level (int) __attribute__((__noreturn__)); +extern sigjmp_buf return_catch; +extern int running_trap; +void +run_pending_traps () +{ + int sig; + if (running_trap > 0) + jump_to_top_level (2); + + for (sig = 1; sig < (64 + 1) ; sig++) + __sigsetjmp ((return_catch), 0); +} + +/* Distilled from alsalib-1.2.11 pcm/pcm_route.c. */ +void +snd_pcm_route_convert1_many() +{ + void *top = &&fst; + void *mid = &&snd; + int sample = 0; + fst: + snd: + goto *mid; +} diff --git a/gcc/testsuite/gcc.misc-tests/gcov-32.c b/gcc/testsuite/gcc.misc-tests/gcov-32.c new file mode 100644 index 0000000..cb8da01 --- /dev/null +++ b/gcc/testsuite/gcc.misc-tests/gcov-32.c @@ -0,0 +1,25 @@ +/* { dg-options "--coverage -fpath-coverage -g -O2" } */ +/* { dg-do compile } */ +/* { dg-require-effective-target sigsetjmp } */ + +#include <setjmp.h> + +extern sigjmp_buf jmpbuf; +typedef void (*sfun) (void); +extern sfun getfn (int); + +/* This distilled srunner setup/teardown functions in check-0.15.2. The + combination of setjmp, optimization, and debug statements causes a problem + if the gimple statement iterator is not positioned correctely before adding + instrumentation code. */ + +extern void +debug_after_labels (int *itr) +{ + for (; *itr; ++itr) + { + sfun fn = getfn (*itr); + if (setjmp (jmpbuf) == 0) + fn (); + } +} diff --git a/gcc/testsuite/gcc.misc-tests/gcov-33.c b/gcc/testsuite/gcc.misc-tests/gcov-33.c new file mode 100644 index 0000000..ecfa8c2 --- /dev/null +++ b/gcc/testsuite/gcc.misc-tests/gcov-33.c @@ -0,0 +1,27 @@ +/* { dg-options "--coverage -fpath-coverage" } */ +/* { dg-do run { target native } } */ + +/* BEGIN paths + summary: 1/2 + expect covered: 13(true) 14 17 +*/ +void +covered (int a) +/* END */ +{ + int v = 0; + if (a) + v++; + else + v--; +} + +/* BEGIN paths + summary: 1/1 + expect covered: 24 */ +int main () +{ + covered (1); +} + +/* { dg-final { run-gcov prime-paths { --prime-paths-lines=covered gcov-33.c } } } */ diff --git a/gcc/testsuite/gcc.misc-tests/gcov-34.c b/gcc/testsuite/gcc.misc-tests/gcov-34.c new file mode 100644 index 0000000..e3c04e0 --- /dev/null +++ b/gcc/testsuite/gcc.misc-tests/gcov-34.c @@ -0,0 +1,29 @@ +/* { dg-options "--coverage -fpath-coverage" } */ +/* { dg-do run { target native } } */ + +/* BEGIN paths + summary: 1/2 + expect covered: 14(true) 15 18 + expect: 14(false) 17 18 +*/ +void +covered (int a) +/* END */ +{ + int v = 0; + if (a) + v++; + else + v--; +} + +/* BEGIN paths + summary: 1/1 + expect covered: 24 +*/ +int main () +{ + covered (1); +} + +/* { dg-final { run-gcov prime-paths { --prime-paths-lines=both gcov-34.c } } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/atomic-inst-ldlogic.c b/gcc/testsuite/gcc.target/aarch64/atomic-inst-ldlogic.c index 4879d52..ccb89ce 100644 --- a/gcc/testsuite/gcc.target/aarch64/atomic-inst-ldlogic.c +++ b/gcc/testsuite/gcc.target/aarch64/atomic-inst-ldlogic.c @@ -101,54 +101,54 @@ TEST (xor_load_notreturn, XOR_LOAD_NORETURN) /* Load-OR. */ -/* { dg-final { scan-assembler-times "ldsetb\t" 8} } */ -/* { dg-final { scan-assembler-times "ldsetab\t" 16} } */ -/* { dg-final { scan-assembler-times "ldsetlb\t" 8} } */ -/* { dg-final { scan-assembler-times "ldsetalb\t" 16} } */ +/* { dg-final { scan-assembler-times "ldsetb\t" 8 } } */ +/* { dg-final { scan-assembler-times "ldsetab\t" 16 } } */ +/* { dg-final { scan-assembler-times "ldsetlb\t" 8 } } */ +/* { dg-final { scan-assembler-times "ldsetalb\t" 16 } } */ -/* { dg-final { scan-assembler-times "ldseth\t" 8} } */ -/* { dg-final { scan-assembler-times "ldsetah\t" 16} } */ -/* { dg-final { scan-assembler-times "ldsetlh\t" 8} } */ -/* { dg-final { scan-assembler-times "ldsetalh\t" 16} } */ +/* { dg-final { scan-assembler-times "ldseth\t" 8 } } */ +/* { dg-final { scan-assembler-times "ldsetah\t" 16 } } */ +/* { dg-final { scan-assembler-times "ldsetlh\t" 8 } } */ +/* { dg-final { scan-assembler-times "ldsetalh\t" 16 } } */ -/* { dg-final { scan-assembler-times "ldset\t" 16} } */ -/* { dg-final { scan-assembler-times "ldseta\t" 32} } */ -/* { dg-final { scan-assembler-times "ldsetl\t" 16} } */ -/* { dg-final { scan-assembler-times "ldsetal\t" 32} } */ +/* { dg-final { scan-assembler-times "ldset\t" 16 } } */ +/* { dg-final { scan-assembler-times "ldseta\t" 32 } } */ +/* { dg-final { scan-assembler-times "ldsetl\t" 16 } } */ +/* { dg-final { scan-assembler-times "ldsetal\t" 32 } } */ /* Load-AND. */ -/* { dg-final { scan-assembler-times "ldclrb\t" 8} } */ -/* { dg-final { scan-assembler-times "ldclrab\t" 16} } */ -/* { dg-final { scan-assembler-times "ldclrlb\t" 8} } */ -/* { dg-final { scan-assembler-times "ldclralb\t" 16} } */ +/* { dg-final { scan-assembler-times "ldclrb\t" 8 } } */ +/* { dg-final { scan-assembler-times "ldclrab\t" 16 } } */ +/* { dg-final { scan-assembler-times "ldclrlb\t" 8 } } */ +/* { dg-final { scan-assembler-times "ldclralb\t" 16 } } */ -/* { dg-final { scan-assembler-times "ldclrh\t" 8} } */ -/* { dg-final { scan-assembler-times "ldclrah\t" 16} } */ -/* { dg-final { scan-assembler-times "ldclrlh\t" 8} } */ -/* { dg-final { scan-assembler-times "ldclralh\t" 16} } */ +/* { dg-final { scan-assembler-times "ldclrh\t" 8 } } */ +/* { dg-final { scan-assembler-times "ldclrah\t" 16 } } */ +/* { dg-final { scan-assembler-times "ldclrlh\t" 8 } } */ +/* { dg-final { scan-assembler-times "ldclralh\t" 16 } } */ -/* { dg-final { scan-assembler-times "ldclr\t" 16} */ -/* { dg-final { scan-assembler-times "ldclra\t" 32} } */ -/* { dg-final { scan-assembler-times "ldclrl\t" 16} } */ -/* { dg-final { scan-assembler-times "ldclral\t" 32} } */ +/* { dg-final { scan-assembler-times "ldclr\t" 16 } } */ +/* { dg-final { scan-assembler-times "ldclra\t" 32 } } */ +/* { dg-final { scan-assembler-times "ldclrl\t" 16 } } */ +/* { dg-final { scan-assembler-times "ldclral\t" 32 } } */ /* Load-XOR. */ -/* { dg-final { scan-assembler-times "ldeorb\t" 8} } */ -/* { dg-final { scan-assembler-times "ldeorab\t" 16} } */ -/* { dg-final { scan-assembler-times "ldeorlb\t" 8} } */ -/* { dg-final { scan-assembler-times "ldeoralb\t" 16} } */ +/* { dg-final { scan-assembler-times "ldeorb\t" 8 } } */ +/* { dg-final { scan-assembler-times "ldeorab\t" 16 } } */ +/* { dg-final { scan-assembler-times "ldeorlb\t" 8 } } */ +/* { dg-final { scan-assembler-times "ldeoralb\t" 16 } } */ -/* { dg-final { scan-assembler-times "ldeorh\t" 8} } */ -/* { dg-final { scan-assembler-times "ldeorah\t" 16} } */ -/* { dg-final { scan-assembler-times "ldeorlh\t" 8} } */ -/* { dg-final { scan-assembler-times "ldeoralh\t" 16} } */ +/* { dg-final { scan-assembler-times "ldeorh\t" 8 } } */ +/* { dg-final { scan-assembler-times "ldeorah\t" 16 } } */ +/* { dg-final { scan-assembler-times "ldeorlh\t" 8 } } */ +/* { dg-final { scan-assembler-times "ldeoralh\t" 16 } } */ -/* { dg-final { scan-assembler-times "ldeor\t" 16} */ -/* { dg-final { scan-assembler-times "ldeora\t" 32} } */ -/* { dg-final { scan-assembler-times "ldeorl\t" 16} } */ -/* { dg-final { scan-assembler-times "ldeoral\t" 32} } */ +/* { dg-final { scan-assembler-times "ldeor\t" 16 } } */ +/* { dg-final { scan-assembler-times "ldeora\t" 32 } } */ +/* { dg-final { scan-assembler-times "ldeorl\t" 16 } } */ +/* { dg-final { scan-assembler-times "ldeoral\t" 32 } } */ /* { dg-final { scan-assembler-not "ldaxr\t" } } */ /* { dg-final { scan-assembler-not "stlxr\t" } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/crc-crc32c-data16.c b/gcc/testsuite/gcc.target/aarch64/crc-crc32c-data16.c index d82e625..db08136 100644 --- a/gcc/testsuite/gcc.target/aarch64/crc-crc32c-data16.c +++ b/gcc/testsuite/gcc.target/aarch64/crc-crc32c-data16.c @@ -10,7 +10,7 @@ uint32_t _crc32_O0 (uint32_t crc, uint16_t data) { int i; crc = crc ^ data; - for (i = 0; i < 8; i++) { + for (i = 0; i < 16; i++) { if (crc & 1) crc = (crc >> 1) ^ 0x82F63B78; else @@ -24,7 +24,7 @@ uint32_t _crc32 (uint32_t crc, uint16_t data) { int i; crc = crc ^ data; - for (i = 0; i < 8; i++) { + for (i = 0; i < 16; i++) { if (crc & 1) crc = (crc >> 1) ^ 0x82F63B78; else diff --git a/gcc/testsuite/gcc.target/aarch64/no-sve-with-sme-1.c b/gcc/testsuite/gcc.target/aarch64/no-sve-with-sme-1.c new file mode 100644 index 0000000..e5bb2d9 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/no-sve-with-sme-1.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-skip-if "Do not override mcpu or march" { *-*-* } { -mcpu=* -march=* } { "" } } */ +/* { dg-options { "-march=armv8-a+sme" } } */ +/* { dg-message "sorry, unimplemented: no support for 'sme' without 'sve2'" "" { target *-*-* } 0 } */ +int main (void) +{ + return 0; +} diff --git a/gcc/testsuite/gcc.target/aarch64/no-sve-with-sme-2.c b/gcc/testsuite/gcc.target/aarch64/no-sve-with-sme-2.c new file mode 100644 index 0000000..13f09b3 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/no-sve-with-sme-2.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-message "sorry, unimplemented: no support for 'sme' without 'sve2'" "" { target *-*-* } 0 } */ + +#pragma GCC target ("arch=armv8.2-a+ssve-fp8fma") + +int main (void) +{ + return 0; +} diff --git a/gcc/testsuite/gcc.target/aarch64/no-sve-with-sme-3.c b/gcc/testsuite/gcc.target/aarch64/no-sve-with-sme-3.c new file mode 100644 index 0000000..9e3cbeb --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/no-sve-with-sme-3.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-message "sorry, unimplemented: no support for 'sme' without 'sve2'" "" { target *-*-* } 0 } */ + +int __attribute__ ((target( "arch=armv8.2-a+ssve-fp8fma"))) main (void) +{ + return 0; +} + diff --git a/gcc/testsuite/gcc.target/aarch64/no-sve-with-sme-4.c b/gcc/testsuite/gcc.target/aarch64/no-sve-with-sme-4.c new file mode 100644 index 0000000..04a33a7 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/no-sve-with-sme-4.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-skip-if "Do not override mcpu or march" { *-*-* } { -mcpu=* -march=* } { "" } } */ +/* { dg-options { "-march=armv8-a" } } */ +/* { dg-message "sorry, unimplemented: no support for 'sme' without 'sve2'" "" { target *-*-* } 0 } */ + +#pragma GCC target "+sme" + +int main (void) +{ + return 0; +} diff --git a/gcc/testsuite/gcc.target/aarch64/pragma_cpp_predefs_4.c b/gcc/testsuite/gcc.target/aarch64/pragma_cpp_predefs_4.c index 97d68b9..dcac6d5 100644 --- a/gcc/testsuite/gcc.target/aarch64/pragma_cpp_predefs_4.c +++ b/gcc/testsuite/gcc.target/aarch64/pragma_cpp_predefs_4.c @@ -46,7 +46,7 @@ #error Foo #endif -#pragma GCC target "+sme" +#pragma GCC target "+sve2+sme" #ifndef __ARM_FEATURE_SME #error Foo #endif @@ -66,7 +66,7 @@ #error Foo #endif -#pragma GCC target "+nothing+sme" +#pragma GCC target "+nothing+sve2+sme" #ifdef __ARM_FEATURE_SME_I16I64 #error Foo #endif @@ -80,7 +80,7 @@ #error Foo #endif -#pragma GCC target "+nothing+sme-i16i64" +#pragma GCC target "+nothing+sve2+sme-i16i64" #ifndef __ARM_FEATURE_SME_I16I64 #error Foo #endif @@ -91,7 +91,7 @@ #error Foo #endif -#pragma GCC target "+nothing+sme-b16b16" +#pragma GCC target "+nothing+sve2+sme-b16b16" #ifndef __ARM_FEATURE_SME_B16B16 #error Foo #endif @@ -105,7 +105,7 @@ #error Foo #endif -#pragma GCC target "+nothing+sme-f16f16" +#pragma GCC target "+nothing+sve2+sme-f16f16" #ifndef __ARM_FEATURE_SME_F16F16 #error Foo #endif @@ -116,7 +116,7 @@ #error Foo #endif -#pragma GCC target "+nothing+sme-f64f64" +#pragma GCC target "+nothing+sve2+sme-f64f64" #ifndef __ARM_FEATURE_SME_F64F64 #error Foo #endif @@ -160,7 +160,7 @@ #error Foo #endif -#pragma GCC target "+nothing+sve-b16b16+sme2" +#pragma GCC target "+nothing+sve2+sve-b16b16+sme2" #ifndef __ARM_FEATURE_SVE_B16B16 #error Foo #endif @@ -168,7 +168,7 @@ #error Foo #endif -#pragma GCC target "+nothing+sme2p1" +#pragma GCC target "+nothing+sve2+sme2p1" #ifndef __ARM_FEATURE_SME #error Foo #endif diff --git a/gcc/testsuite/gcc.target/aarch64/saturating_arithmetic_1.c b/gcc/testsuite/gcc.target/aarch64/saturating_arithmetic_1.c index 2ac0c37..acd2e11 100644 --- a/gcc/testsuite/gcc.target/aarch64/saturating_arithmetic_1.c +++ b/gcc/testsuite/gcc.target/aarch64/saturating_arithmetic_1.c @@ -1,4 +1,4 @@ -/* { dg-do-compile } */ +/* { dg-do compile } */ /* { dg-options "-O2 --save-temps -fno-schedule-insns2" } */ /* { dg-final { check-function-bodies "**" "" "" } } */ @@ -33,4 +33,4 @@ #define UMAX UCHAR_MAX #define UMIN 0 -#include "saturating_arithmetic.inc"
\ No newline at end of file +#include "saturating_arithmetic.inc" diff --git a/gcc/testsuite/gcc.target/aarch64/saturating_arithmetic_2.c b/gcc/testsuite/gcc.target/aarch64/saturating_arithmetic_2.c index 2a55aa9..86c88f8 100644 --- a/gcc/testsuite/gcc.target/aarch64/saturating_arithmetic_2.c +++ b/gcc/testsuite/gcc.target/aarch64/saturating_arithmetic_2.c @@ -1,4 +1,4 @@ -/* { dg-do-compile } */ +/* { dg-do compile } */ /* { dg-options "-O2 --save-temps -fno-schedule-insns2" } */ /* { dg-final { check-function-bodies "**" "" "" } } */ @@ -33,4 +33,4 @@ #define UMAX USHRT_MAX #define UMIN 0 -#include "saturating_arithmetic.inc"
\ No newline at end of file +#include "saturating_arithmetic.inc" diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_int_opt_single_n_2.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_int_opt_single_n_2.c index 976d5af..7150d37 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_int_opt_single_n_2.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_int_opt_single_n_2.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ -#pragma GCC target "+sme2" +#pragma GCC target "+sve2+sme2" #include <arm_sve.h> diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_opt_single_n_2.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_opt_single_n_2.c index 5cc8a4c..2823264 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_opt_single_n_2.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_opt_single_n_2.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ -#pragma GCC target "+sme2" +#pragma GCC target "+sve2+sme2" #include <arm_sve.h> diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_single_1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_single_1.c index aa7633b..52f2c09 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_single_1.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_single_1.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ -#pragma GCC target "+sme2" +#pragma GCC target "+sve2+sme2" #include <arm_sve.h> diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_za_slice_int_opt_single_1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_za_slice_int_opt_single_1.c index 01cd88f..0e88c14 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_za_slice_int_opt_single_1.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_za_slice_int_opt_single_1.c @@ -2,7 +2,7 @@ #include <arm_sme.h> -#pragma GCC target ("+sme2") +#pragma GCC target ("+sve2+sme2") void f1 (svbool_t pg, svint16_t s16, svint8_t s8, svuint8_t u8, diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_za_slice_lane_1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_za_slice_lane_1.c index 937d992..2c60d50 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_za_slice_lane_1.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_za_slice_lane_1.c @@ -2,7 +2,7 @@ #include <arm_sme.h> -#pragma GCC target ("+sme2") +#pragma GCC target ("+sve2+sme2") void f1 (svbool_t pg, svint16_t s16, svuint16_t u16, svint32_t s32, svuint32_t u32, diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_za_slice_lane_2.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_za_slice_lane_2.c index 126a764..dd90ebc 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_za_slice_lane_2.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_za_slice_lane_2.c @@ -2,7 +2,7 @@ #include <arm_sme.h> -#pragma GCC target ("+sme2") +#pragma GCC target ("+sve2+sme2") void f1 (svbool_t pg, svint16_t s16, svuint16_t u16, svint32_t s32, svuint32_t u32, diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_za_slice_lane_3.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_za_slice_lane_3.c index 17bed0c..f53cc55 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_za_slice_lane_3.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_za_slice_lane_3.c @@ -2,7 +2,7 @@ #include <arm_sme.h> -#pragma GCC target ("+sme2") +#pragma GCC target ("+sve2+sme2") void f1 (svbool_t pg, svint16_t s16, svuint16_t u16, svint32_t s32, svuint32_t u32, diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_za_slice_lane_4.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_za_slice_lane_4.c index d2a67c6..83c659d 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_za_slice_lane_4.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_za_slice_lane_4.c @@ -2,7 +2,7 @@ #include <arm_sme.h> -#pragma GCC target ("+sme2") +#pragma GCC target ("+sve2+sme2") void f1 (svint8_t s8, svuint8_t u8, svint16_t s16, svuint16_t u16, diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_za_slice_opt_single_1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_za_slice_opt_single_1.c index 8307a28..a361f7f 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_za_slice_opt_single_1.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_za_slice_opt_single_1.c @@ -2,7 +2,7 @@ #include <arm_sme.h> -#pragma GCC target ("+sme2") +#pragma GCC target ("+sve2+sme2") void f1 (svbool_t pg, svint16_t s16, svint32_t s32, svuint32_t u32, diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_za_slice_opt_single_2.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_za_slice_opt_single_2.c index 181f509..959e222 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_za_slice_opt_single_2.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_za_slice_opt_single_2.c @@ -2,7 +2,7 @@ #include <arm_sme.h> -#pragma GCC target ("+sme2") +#pragma GCC target ("+sve2+sme2") void f1 (svbool_t pg, svint16_t s16, svint32_t s32, svuint32_t u32, diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_za_slice_opt_single_3.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_za_slice_opt_single_3.c index 8c8414e..9cc42c0 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_za_slice_opt_single_3.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_za_slice_opt_single_3.c @@ -2,7 +2,7 @@ #include <arm_sme.h> -#pragma GCC target ("+sme2+nosme-i16i64") +#pragma GCC target ("+sve2+sme2+nosme-i16i64") void f1 (svint32x2_t s32x2, svuint32x2_t u32x2, diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_za_slice_uint_opt_single_1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_za_slice_uint_opt_single_1.c index b00c043..b289c9c 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_za_slice_uint_opt_single_1.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binary_za_slice_uint_opt_single_1.c @@ -2,7 +2,7 @@ #include <arm_sme.h> -#pragma GCC target ("+sme2") +#pragma GCC target ("+sve2+sme2") void f1 (svbool_t pg, svuint16_t u16, svint8_t s8, svuint8_t u8, diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binaryxn_2.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binaryxn_2.c index 600b7fc..4f8ebf8 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binaryxn_2.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/binaryxn_2.c @@ -2,7 +2,7 @@ #include <arm_sve.h> -#pragma GCC target "+sme2" +#pragma GCC target "+sve2+sme2" void f1 (svbool_t pg, svcount_t pn, svuint8_t u8, svint16_t s16, diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/clamp_1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/clamp_1.c index 07e22d2..958c40a 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/clamp_1.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/clamp_1.c @@ -2,7 +2,7 @@ #include <arm_sve.h> -#pragma GCC target "+sme2" +#pragma GCC target "+sve2+sme2" void f1 (svcount_t pn, svfloat16_t f16, svint16_t s16, svfloat32_t f32, diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/compare_scalar_count_1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/compare_scalar_count_1.c index 47077f7..4a4222c 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/compare_scalar_count_1.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/compare_scalar_count_1.c @@ -3,7 +3,7 @@ #include <arm_sve.h> #include <stdbool.h> -#pragma GCC target "+sme2" +#pragma GCC target "+sve2+sme2" enum signed_enum { SA = -1, SB }; enum unsigned_enum { UA, UB }; diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/dot_za_slice_int_lane_1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/dot_za_slice_int_lane_1.c index ca2a039..aed92b5 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/dot_za_slice_int_lane_1.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/dot_za_slice_int_lane_1.c @@ -2,7 +2,7 @@ #include <arm_sme.h> -#pragma GCC target ("+sme2") +#pragma GCC target ("+sve2+sme2") void f1 (svbool_t pg, svint8_t s8, svuint8_t u8, svint16_t s16, svuint16_t u16, diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/dot_za_slice_lane_1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/dot_za_slice_lane_1.c index e37d24a..bb40868 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/dot_za_slice_lane_1.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/dot_za_slice_lane_1.c @@ -2,7 +2,7 @@ #include <arm_sme.h> -#pragma GCC target ("+sme2") +#pragma GCC target ("+sve2+sme2") void f1 (svbool_t pg, svint8_t s8, svuint8_t u8, svint16_t s16, svuint16_t u16, diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/dot_za_slice_lane_2.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/dot_za_slice_lane_2.c index 7af3c6f..7d57bd1 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/dot_za_slice_lane_2.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/dot_za_slice_lane_2.c @@ -2,7 +2,7 @@ #include <arm_sme.h> -#pragma GCC target ("+sme2") +#pragma GCC target ("+sve2+sme2") void f1 (svbool_t pg, svint8_t s8, svuint8_t u8, svint16_t s16, svuint16_t u16, diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/dot_za_slice_uint_lane_1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/dot_za_slice_uint_lane_1.c index 2efa2eb..cba11a4 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/dot_za_slice_uint_lane_1.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/dot_za_slice_uint_lane_1.c @@ -2,7 +2,7 @@ #include <arm_sme.h> -#pragma GCC target ("+sme2") +#pragma GCC target ("+sve2+sme2") void f1 (svbool_t pg, svint8_t s8, svuint8_t u8, svint16_t s16, svuint16_t u16, diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/shift_right_imm_narrowxn_1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/shift_right_imm_narrowxn_1.c index ab5602f..685d070 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/shift_right_imm_narrowxn_1.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/shift_right_imm_narrowxn_1.c @@ -2,7 +2,7 @@ #include <arm_sve.h> -#pragma GCC target ("+sme2") +#pragma GCC target ("+sve2+sme2") void f1 (svboolx2_t pgx2, diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/storexn_1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/storexn_1.c index 7ad4ca8..ba0096b 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/storexn_1.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/storexn_1.c @@ -3,7 +3,7 @@ #include <arm_sve.h> -#pragma GCC target "+sme2" +#pragma GCC target "+sve2+sme2" struct s { signed char x; }; diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/ternary_mfloat8_lane_1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/ternary_mfloat8_lane_1.c index 6bdd3c0..c01710f 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/ternary_mfloat8_lane_1.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/ternary_mfloat8_lane_1.c @@ -2,7 +2,7 @@ #include <arm_sve.h> -#pragma GCC target ("arch=armv8.2-a+ssve-fp8fma") +#pragma GCC target ("arch=armv8.2-a+sve2+ssve-fp8fma") void f1 (svfloat16_t f16, svmfloat8_t f8, fpm_t fpm, diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/ternary_mfloat8_lane_group_selection_1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/ternary_mfloat8_lane_group_selection_1.c index f6fce2f..fecaf98 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/ternary_mfloat8_lane_group_selection_1.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/ternary_mfloat8_lane_group_selection_1.c @@ -2,7 +2,7 @@ #include <arm_sve.h> -#pragma GCC target ("arch=armv8.2-a+ssve-fp8fma+ssve-fp8dot4+ssve-fp8dot2") +#pragma GCC target ("arch=armv8.2-a+sve2+ssve-fp8fma+ssve-fp8dot4+ssve-fp8dot2") void f1 (svfloat16_t f16, svmfloat8_t f8, fpm_t fpm, diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/ternary_qq_or_011_lane_1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/ternary_qq_or_011_lane_1.c index b8968c8..5579e0d 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/ternary_qq_or_011_lane_1.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/ternary_qq_or_011_lane_1.c @@ -2,7 +2,7 @@ #include <arm_sve.h> -#pragma GCC target "+sme2" +#pragma GCC target "+sve2+sme2" void f1 (svbool_t pg, svint8_t s8, svuint8_t u8, svint16_t s16, svuint16_t u16, diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/unary_convertxn_1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/unary_convertxn_1.c index 85f8b45..e14ec71 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/unary_convertxn_1.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/unary_convertxn_1.c @@ -1,6 +1,6 @@ #include <arm_sve.h> -#pragma GCC target "+sme2" +#pragma GCC target "+sve2+sme2" void test (svbool_t pg, float f, svint8_t s8, svfloat32_t f32, diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/unary_convertxn_narrow_1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/unary_convertxn_narrow_1.c index d312e85..e93cc64 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/unary_convertxn_narrow_1.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/unary_convertxn_narrow_1.c @@ -1,6 +1,6 @@ #include <arm_sve.h> -#pragma GCC target "+sme2+fp8" +#pragma GCC target "+sve2+sme2+fp8" void test (svfloat16x2_t f16x2, svbfloat16x2_t bf16x2, svfloat32x2_t f32x2, diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/unary_convertxn_narrowt_1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/unary_convertxn_narrowt_1.c index ab97eef..da828f0 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/unary_convertxn_narrowt_1.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/unary_convertxn_narrowt_1.c @@ -1,6 +1,6 @@ #include <arm_sve.h> -#pragma GCC target "+sme2+fp8" +#pragma GCC target "+sve2+sme2+fp8" void test (svmfloat8_t f8, svfloat32x2_t f32x2, fpm_t fpm0, diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/unary_za_slice_1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/unary_za_slice_1.c index e02fe54..c3052a0 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/unary_za_slice_1.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/unary_za_slice_1.c @@ -2,7 +2,7 @@ #include <arm_sme.h> -#pragma GCC target ("+sme2") +#pragma GCC target ("+sve2+sme2") void f1 (svbool_t pg, svint32_t s32, svint16x2_t s16x2, svint32x2_t s32x2, diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/unaryxn_1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/unaryxn_1.c index f478945..e9656bc 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/unaryxn_1.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/unaryxn_1.c @@ -1,6 +1,6 @@ #include <arm_sve.h> -#pragma GCC target "+sme2" +#pragma GCC target "+sve2+sme2" void test (svfloat32_t f32, svfloat32x2_t f32x2, svfloat32x3_t f32x3, diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/write_za_1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/write_za_1.c index 3a45b58..95ead96 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/write_za_1.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/write_za_1.c @@ -2,7 +2,7 @@ #include <arm_sme.h> -#pragma GCC target "+sme2" +#pragma GCC target "+sve2+sme2" void f1 (svint8_t s8, svint8x2_t s8x2, svint8x3_t s8x3, svint8x4_t s8x4, diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/write_za_slice_1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/write_za_slice_1.c index dedd4b1..dae8892 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/write_za_slice_1.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/write_za_slice_1.c @@ -2,7 +2,7 @@ #include <arm_sme.h> -#pragma GCC target "+sme2" +#pragma GCC target "+sve2+sme2" void f1 (svint8_t s8, svint8x2_t s8x2, svint8x3_t s8x3, svint8x4_t s8x4, diff --git a/gcc/testsuite/gcc.target/aarch64/vls_sve_vec_dup_1.c b/gcc/testsuite/gcc.target/aarch64/vls_sve_vec_dup_1.c new file mode 100644 index 0000000..ada0d4f --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/vls_sve_vec_dup_1.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=armv8.2-a+sve -msve-vector-bits=128" } */ + +float fasten_main_etot_0; +void fasten_main() { + for (int l = 0; l < 2;) { + int phphb_nz; + for (; l < 32; l++) { + float dslv_e = l && phphb_nz; + fasten_main_etot_0 += dslv_e; + } + } +} + +/* { dg-final { scan-assembler-not {bfi\tw\[0-9\]+} } } */ diff --git a/gcc/testsuite/gcc.target/alpha/memclr-a2-o1-c9-ptr-safe-partial.c b/gcc/testsuite/gcc.target/alpha/memclr-a2-o1-c9-ptr-safe-partial.c new file mode 100644 index 0000000..15dc1b1 --- /dev/null +++ b/gcc/testsuite/gcc.target/alpha/memclr-a2-o1-c9-ptr-safe-partial.c @@ -0,0 +1,22 @@ +/* { dg-do compile } */ +/* { dg-options "-mbwx -msafe-partial" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +#include "memclr-a2-o1-c9-ptr.c" + +/* Expect assembly such as: + + stb $31,1($16) + stw $31,2($16) + stw $31,4($16) + stw $31,6($16) + stw $31,8($16) + + that is with a byte store at offset 1, followed by word stores at + offsets 2, 4, 6, and 8. */ + +/* { dg-final { scan-assembler-times "\\sstb\\s\\\$31,1\\\(\\\$16\\\)\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sstw\\s\\\$31,2\\\(\\\$16\\\)\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sstw\\s\\\$31,4\\\(\\\$16\\\)\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sstw\\s\\\$31,6\\\(\\\$16\\\)\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sstw\\s\\\$31,8\\\(\\\$16\\\)\\s" 1 } } */ diff --git a/gcc/testsuite/gcc.target/alpha/memclr-a2-o1-c9-ptr.c b/gcc/testsuite/gcc.target/alpha/memclr-a2-o1-c9-ptr.c index 3f7edc8..0ff1049 100644 --- a/gcc/testsuite/gcc.target/alpha/memclr-a2-o1-c9-ptr.c +++ b/gcc/testsuite/gcc.target/alpha/memclr-a2-o1-c9-ptr.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mbwx" } */ +/* { dg-options "-mbwx -mno-safe-partial" } */ /* { dg-skip-if "" { *-*-* } { "-O0" } } */ typedef unsigned int __attribute__ ((mode (QI))) int08_t; diff --git a/gcc/testsuite/gcc.target/alpha/memcpy-di-unaligned-dst-safe-partial-bwx.c b/gcc/testsuite/gcc.target/alpha/memcpy-di-unaligned-dst-safe-partial-bwx.c new file mode 100644 index 0000000..1626261 --- /dev/null +++ b/gcc/testsuite/gcc.target/alpha/memcpy-di-unaligned-dst-safe-partial-bwx.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-msafe-partial -mbwx" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +#include "memcpy-di-unaligned-dst.c" + +/* { dg-final { scan-assembler-times "\\sldq\\s" 7 } } */ +/* { dg-final { scan-assembler-times "\\sstb\\s" 16 } } */ +/* { dg-final { scan-assembler-times "\\sstq_u\\s" 6 } } */ +/* { dg-final { scan-assembler-not "\\sldq_l\\s" } } */ +/* { dg-final { scan-assembler-not "\\sldq_u\\s" } } */ +/* { dg-final { scan-assembler-not "\\sstq\\s" } } */ +/* { dg-final { scan-assembler-not "\\sstq_c\\s" } } */ diff --git a/gcc/testsuite/gcc.target/alpha/memcpy-di-unaligned-dst-safe-partial.c b/gcc/testsuite/gcc.target/alpha/memcpy-di-unaligned-dst-safe-partial.c new file mode 100644 index 0000000..869fdf3 --- /dev/null +++ b/gcc/testsuite/gcc.target/alpha/memcpy-di-unaligned-dst-safe-partial.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-msafe-partial -mno-bwx" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +#include "memcpy-di-unaligned-dst.c" + +/* { dg-final { scan-assembler-times "\\sldq\\s" 7 } } */ +/* { dg-final { scan-assembler-times "\\sldq_l\\s" 2 } } */ +/* { dg-final { scan-assembler-times "\\sstq_c\\s" 2 } } */ +/* { dg-final { scan-assembler-times "\\sstq_u\\s" 6 } } */ +/* { dg-final { scan-assembler-not "\\sldq_u\\s" } } */ +/* { dg-final { scan-assembler-not "\\sstq\\s" } } */ diff --git a/gcc/testsuite/gcc.target/alpha/memcpy-di-unaligned-dst.c b/gcc/testsuite/gcc.target/alpha/memcpy-di-unaligned-dst.c index 5e9b5c3..373e2aa 100644 --- a/gcc/testsuite/gcc.target/alpha/memcpy-di-unaligned-dst.c +++ b/gcc/testsuite/gcc.target/alpha/memcpy-di-unaligned-dst.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "" } */ +/* { dg-options "-mno-safe-partial" } */ /* { dg-skip-if "" { *-*-* } { "-O0" } } */ unsigned long unaligned_src_di[9] = { [0 ... 8] = 0xfefdfcfbfaf9f8f7 }; diff --git a/gcc/testsuite/gcc.target/alpha/memcpy-si-unaligned-dst-safe-partial-bwx.c b/gcc/testsuite/gcc.target/alpha/memcpy-si-unaligned-dst-safe-partial-bwx.c new file mode 100644 index 0000000..2464005 --- /dev/null +++ b/gcc/testsuite/gcc.target/alpha/memcpy-si-unaligned-dst-safe-partial-bwx.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-msafe-partial -mbwx" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +#include "memcpy-si-unaligned-dst.c" + +/* { dg-final { scan-assembler-times "\\sldl\\s" 15 } } */ +/* { dg-final { scan-assembler-times "\\sstb\\s" 20 } } */ +/* { dg-final { scan-assembler-times "\\sstq_u\\s" 6 } } */ +/* { dg-final { scan-assembler-not "\\sldq_l\\s" } } */ +/* { dg-final { scan-assembler-not "\\sldq_u\\s" } } */ +/* { dg-final { scan-assembler-not "\\sstl\\s" } } */ +/* { dg-final { scan-assembler-not "\\sstq_c\\s" } } */ diff --git a/gcc/testsuite/gcc.target/alpha/memcpy-si-unaligned-dst-safe-partial.c b/gcc/testsuite/gcc.target/alpha/memcpy-si-unaligned-dst-safe-partial.c new file mode 100644 index 0000000..6c9f877 --- /dev/null +++ b/gcc/testsuite/gcc.target/alpha/memcpy-si-unaligned-dst-safe-partial.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-msafe-partial -mno-bwx" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +#include "memcpy-si-unaligned-dst.c" + +/* { dg-final { scan-assembler-times "\\sldl\\s" 15 } } */ +/* { dg-final { scan-assembler-times "\\sldq_l\\s" 4 } } */ +/* { dg-final { scan-assembler-times "\\sstq_c\\s" 4 } } */ +/* { dg-final { scan-assembler-times "\\sstq_u\\s" 6 } } */ +/* { dg-final { scan-assembler-not "\\sldq_u\\s" } } */ +/* { dg-final { scan-assembler-not "\\sstl\\s" } } */ diff --git a/gcc/testsuite/gcc.target/alpha/memcpy-si-unaligned-dst.c b/gcc/testsuite/gcc.target/alpha/memcpy-si-unaligned-dst.c index a2efade..aef4e59 100644 --- a/gcc/testsuite/gcc.target/alpha/memcpy-si-unaligned-dst.c +++ b/gcc/testsuite/gcc.target/alpha/memcpy-si-unaligned-dst.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "" } */ +/* { dg-options "-mno-safe-partial" } */ /* { dg-skip-if "" { *-*-* } { "-O0" } } */ unsigned int unaligned_src_si[17] = { [0 ... 16] = 0xfefdfcfb }; diff --git a/gcc/testsuite/gcc.target/alpha/stb-bwa.c b/gcc/testsuite/gcc.target/alpha/stb-bwa.c new file mode 100644 index 0000000..d7a45db --- /dev/null +++ b/gcc/testsuite/gcc.target/alpha/stb-bwa.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "-mno-bwx -msafe-bwa" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +void +stb (char *p, char v) +{ + *p = v; +} + +/* Expect assembly such as: + + bic $16,7,$2 + insbl $17,$16,$17 +$L2: + ldq_l $1,0($2) + mskbl $1,$16,$1 + bis $17,$1,$1 + stq_c $1,0($2) + beq $1,$L2 + + with address masking. */ + +/* { dg-final { scan-assembler-times "\\sldq_l\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sstq_c\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sinsbl\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\smskbl\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sbic\\s\\\$\[0-9\]+,7,\\\$\[0-9\]+\\s" 1 } } */ diff --git a/gcc/testsuite/gcc.target/alpha/stb-bwx.c b/gcc/testsuite/gcc.target/alpha/stb-bwx.c new file mode 100644 index 0000000..556397b --- /dev/null +++ b/gcc/testsuite/gcc.target/alpha/stb-bwx.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-mbwx" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +void +stb (char *p, char v) +{ + *p = v; +} + +/* Expect assembly such as: + + stb $17,0($16) + */ + +/* { dg-final { scan-assembler-times "\\sstb\\s\\\$17,0\\\(\\\$16\\\)\\s" 1 } } */ diff --git a/gcc/testsuite/gcc.target/alpha/stb.c b/gcc/testsuite/gcc.target/alpha/stb.c new file mode 100644 index 0000000..4953bc4 --- /dev/null +++ b/gcc/testsuite/gcc.target/alpha/stb.c @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* { dg-options "-mno-bwx -mno-safe-bwa" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +void +stb (char *p, char v) +{ + *p = v; +} + +/* Expect assembly such as: + + insbl $17,$16,$17 + ldq_u $1,0($16) + mskbl $1,$16,$1 + bis $17,$1,$17 + stq_u $17,0($16) + + without address masking. */ + +/* { dg-final { scan-assembler-times "\\sldq_u\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sstq_u\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sinsbl\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\smskbl\\s" 1 } } */ +/* { dg-final { scan-assembler-not "\\sbic\\s\\\$\[0-9\]+,7,\\\$\[0-9\]+\\s" } } */ diff --git a/gcc/testsuite/gcc.target/alpha/stba-bwa.c b/gcc/testsuite/gcc.target/alpha/stba-bwa.c new file mode 100644 index 0000000..07cf954 --- /dev/null +++ b/gcc/testsuite/gcc.target/alpha/stba-bwa.c @@ -0,0 +1,35 @@ +/* { dg-do compile } */ +/* { dg-options "-mno-bwx -msafe-bwa" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +typedef union + { + int i; + char c; + } +char_a; + +void +stba (char_a *p, char v) +{ + p->c = v; +} + +/* Expect assembly such as: + + and $17,0xff,$17 +$L2: + ldl_l $1,0($16) + bic $1,255,$1 + bis $17,$1,$1 + stl_c $1,0($16) + beq $1,$L2 + + without any INSBL or MSKBL instructions and without address masking. */ + +/* { dg-final { scan-assembler-times "\\sldl_l\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sstl_c\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sand\\s\\\$\[0-9\]+,0xff,\\\$\[0-9\]+\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sbic\\s\\\$\[0-9\]+,255,\\\$\[0-9\]+\\s" 1 } } */ +/* { dg-final { scan-assembler-not "\\sbic\\s\\\$\[0-9\]+,7,\\\$\[0-9\]+\\s" } } */ +/* { dg-final { scan-assembler-not "\\s(?:insbl|mskbl)\\s" } } */ diff --git a/gcc/testsuite/gcc.target/alpha/stba-bwx.c b/gcc/testsuite/gcc.target/alpha/stba-bwx.c new file mode 100644 index 0000000..08b51b1 --- /dev/null +++ b/gcc/testsuite/gcc.target/alpha/stba-bwx.c @@ -0,0 +1,23 @@ +/* { dg-do compile } */ +/* { dg-options "-mbwx" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +typedef union + { + int i; + char c; + } +char_a; + +void +stba (char_a *p, char v) +{ + p->c = v; +} + +/* Expect assembly such as: + + stb $17,0($16) + */ + +/* { dg-final { scan-assembler-times "\\sstb\\s\\\$17,0\\\(\\\$16\\\)\\s" 1 } } */ diff --git a/gcc/testsuite/gcc.target/alpha/stba.c b/gcc/testsuite/gcc.target/alpha/stba.c new file mode 100644 index 0000000..fe7856c --- /dev/null +++ b/gcc/testsuite/gcc.target/alpha/stba.c @@ -0,0 +1,33 @@ +/* { dg-do compile } */ +/* { dg-options "-mno-bwx -mno-safe-bwa" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +typedef union + { + int i; + char c; + } +char_a; + +void +stba (char_a *p, char v) +{ + p->c = v; +} + +/* Expect assembly such as: + + and $17,0xff,$17 + ldl $1,0($16) + bic $1,255,$1 + bis $17,$1,$17 + stl $17,0($16) + + without any INSBL or MSKBL instructions and without address masking. */ + +/* { dg-final { scan-assembler-times "\\sldl\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sstl\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sand\\s\\\$\[0-9\]+,0xff,\\\$\[0-9\]+\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sbic\\s\\\$\[0-9\]+,255,\\\$\[0-9\]+\\s" 1 } } */ +/* { dg-final { scan-assembler-not "\\sbic\\s\\\$\[0-9\]+,7,\\\$\[0-9\]+\\s" } } */ +/* { dg-final { scan-assembler-not "\\s(?:insbl|mskbl)\\s" } } */ diff --git a/gcc/testsuite/gcc.target/alpha/stlx0-safe-partial-bwx.c b/gcc/testsuite/gcc.target/alpha/stlx0-safe-partial-bwx.c new file mode 100644 index 0000000..70df631 --- /dev/null +++ b/gcc/testsuite/gcc.target/alpha/stlx0-safe-partial-bwx.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-mbwx -msafe-partial" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +#include "stlx0.c" + +/* Expect assembly such as: + + stb $31,0($16) + stb $31,1($16) + stb $31,2($16) + stb $31,3($16) + + without any LDQ_U or STQ_U instructions. */ + +/* { dg-final { scan-assembler-times "\\sstb\\s" 4 } } */ +/* { dg-final { scan-assembler-not "\\s(?:ldq_u|stq_u)\\s" } } */ diff --git a/gcc/testsuite/gcc.target/alpha/stlx0-safe-partial.c b/gcc/testsuite/gcc.target/alpha/stlx0-safe-partial.c new file mode 100644 index 0000000..dc3e86d --- /dev/null +++ b/gcc/testsuite/gcc.target/alpha/stlx0-safe-partial.c @@ -0,0 +1,29 @@ +/* { dg-do compile } */ +/* { dg-options "-mno-bwx -msafe-partial" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +#include "stlx0.c" + +/* Expect assembly such as: + + lda $2,3($16) + bic $2,7,$2 +$L2: + ldq_l $1,0($2) + msklh $1,$16,$1 + stq_c $1,0($2) + beq $1,$L2 + bic $16,7,$2 +$L3: + ldq_l $1,0($2) + mskll $1,$16,$1 + stq_c $1,0($2) + beq $1,$L3 + + without any INSLH, INSLL, BIS, LDQ_U, or STQ_U instructions. */ + +/* { dg-final { scan-assembler-times "\\sldq_l\\s" 2 } } */ +/* { dg-final { scan-assembler-times "\\smsklh\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\smskll\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sstq_c\\s" 2 } } */ +/* { dg-final { scan-assembler-not "\\s(?:bis|inslh|insll|ldq_u|stq_u)\\s" } } */ diff --git a/gcc/testsuite/gcc.target/alpha/stlx0.c b/gcc/testsuite/gcc.target/alpha/stlx0.c index 876eceb..3b340bc 100644 --- a/gcc/testsuite/gcc.target/alpha/stlx0.c +++ b/gcc/testsuite/gcc.target/alpha/stlx0.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "" } */ +/* { dg-options "-mno-safe-partial" } */ /* { dg-skip-if "" { *-*-* } { "-O0" } } */ typedef struct { int v __attribute__ ((packed)); } intx; diff --git a/gcc/testsuite/gcc.target/alpha/stqx0-safe-partial-bwx.c b/gcc/testsuite/gcc.target/alpha/stqx0-safe-partial-bwx.c new file mode 100644 index 0000000..62f6c78 --- /dev/null +++ b/gcc/testsuite/gcc.target/alpha/stqx0-safe-partial-bwx.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-mbwx -msafe-partial" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +#include "stqx0.c" + +/* Expect assembly such as: + + stb $31,0($16) + stb $31,1($16) + stb $31,2($16) + stb $31,3($16) + stb $31,4($16) + stb $31,5($16) + stb $31,6($16) + stb $31,7($16) + + without any LDQ_U or STQ_U instructions. */ + +/* { dg-final { scan-assembler-times "\\sstb\\s" 8 } } */ +/* { dg-final { scan-assembler-not "\\s(?:ldq_u|stq_u)\\s" } } */ diff --git a/gcc/testsuite/gcc.target/alpha/stqx0-safe-partial.c b/gcc/testsuite/gcc.target/alpha/stqx0-safe-partial.c new file mode 100644 index 0000000..7aa9e80 --- /dev/null +++ b/gcc/testsuite/gcc.target/alpha/stqx0-safe-partial.c @@ -0,0 +1,29 @@ +/* { dg-do compile } */ +/* { dg-options "-mno-bwx -msafe-partial" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +#include "stqx0.c" + +/* Expect assembly such as: + + lda $2,7($16) + bic $2,7,$2 +$L2: + ldq_l $1,0($2) + mskqh $1,$16,$1 + stq_c $1,0($2) + beq $1,$L2 + bic $16,7,$2 +$L3: + ldq_l $1,0($2) + mskql $1,$16,$1 + stq_c $1,0($2) + beq $1,$L3 + + without any INSLH, INSLL, BIS, LDQ_U, or STQ_U instructions. */ + +/* { dg-final { scan-assembler-times "\\sldq_l\\s" 2 } } */ +/* { dg-final { scan-assembler-times "\\smskqh\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\smskql\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sstq_c\\s" 2 } } */ +/* { dg-final { scan-assembler-not "\\s(?:bis|insqh|insql|ldq_u|stq_u)\\s" } } */ diff --git a/gcc/testsuite/gcc.target/alpha/stqx0.c b/gcc/testsuite/gcc.target/alpha/stqx0.c index 042cdf0..80261a8 100644 --- a/gcc/testsuite/gcc.target/alpha/stqx0.c +++ b/gcc/testsuite/gcc.target/alpha/stqx0.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "" } */ +/* { dg-options "-mno-safe-partial" } */ /* { dg-skip-if "" { *-*-* } { "-O0" } } */ typedef struct { long v __attribute__ ((packed)); } longx; diff --git a/gcc/testsuite/gcc.target/alpha/stw-bwa.c b/gcc/testsuite/gcc.target/alpha/stw-bwa.c new file mode 100644 index 0000000..8b764b3 --- /dev/null +++ b/gcc/testsuite/gcc.target/alpha/stw-bwa.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "-mno-bwx -msafe-bwa" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +void +stw (short *p, short v) +{ + *p = v; +} + +/* Expect assembly such as: + + bic $16,7,$2 + inswl $17,$16,$17 +$L2: + ldq_l $1,0($2) + mskwl $1,$16,$1 + bis $17,$1,$1 + stq_c $1,0($2) + beq $1,$L2 + + with address masking. */ + +/* { dg-final { scan-assembler-times "\\sldq_l\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sstq_c\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sinswl\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\smskwl\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sbic\\s\\\$\[0-9\]+,7,\\\$\[0-9\]+\\s" 1 } } */ diff --git a/gcc/testsuite/gcc.target/alpha/stw-bwx.c b/gcc/testsuite/gcc.target/alpha/stw-bwx.c new file mode 100644 index 0000000..b4f18ad --- /dev/null +++ b/gcc/testsuite/gcc.target/alpha/stw-bwx.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-mbwx" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +void +stw (short *p, short v) +{ + *p = v; +} + +/* Expect assembly such as: + + stw $17,0($16) + */ + +/* { dg-final { scan-assembler-times "\\sstw\\s\\\$17,0\\\(\\\$16\\\)\\s" 1 } } */ diff --git a/gcc/testsuite/gcc.target/alpha/stw.c b/gcc/testsuite/gcc.target/alpha/stw.c new file mode 100644 index 0000000..655fdd9 --- /dev/null +++ b/gcc/testsuite/gcc.target/alpha/stw.c @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* { dg-options "-mno-bwx -mno-safe-bwa" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +void +stw (short *p, short v) +{ + *p = v; +} + +/* Expect assembly such as: + + inswl $17,$16,$17 + ldq_u $1,0($16) + mskwl $1,$16,$1 + bis $17,$1,$17 + stq_u $17,0($16) + + without address masking. */ + +/* { dg-final { scan-assembler-times "\\sldq_u\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sstq_u\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sinswl\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\smskwl\\s" 1 } } */ +/* { dg-final { scan-assembler-not "\\sbic\\s\\\$\[0-9\]+,7,\\\$\[0-9\]+\\s" } } */ diff --git a/gcc/testsuite/gcc.target/alpha/stwa-bwa.c b/gcc/testsuite/gcc.target/alpha/stwa-bwa.c new file mode 100644 index 0000000..9ee226e2 --- /dev/null +++ b/gcc/testsuite/gcc.target/alpha/stwa-bwa.c @@ -0,0 +1,35 @@ +/* { dg-do compile } */ +/* { dg-options "-mno-bwx -msafe-bwa" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +typedef union + { + int i; + short c; + } +short_a; + +void +stwa (short_a *p, short v) +{ + p->c = v; +} + +/* Expect assembly such as: + + zapnot $17,3,$17 +$L2: + ldl_l $1,0($16) + zapnot $1,252,$1 + bis $17,$1,$1 + stl_c $1,0($16) + beq $1,$L2 + + without any INSWL or MSKWL instructions and without address masking. */ + +/* { dg-final { scan-assembler-times "\\sldl_l\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sstl_c\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\szapnot\\s\\\$\[0-9\]+,3,\\\$\[0-9\]+\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\szapnot\\s\\\$\[0-9\]+,252,\\\$\[0-9\]+\\s" 1 } } */ +/* { dg-final { scan-assembler-not "\\sbic\\s\\\$\[0-9\]+,7,\\\$\[0-9\]+\\s" } } */ +/* { dg-final { scan-assembler-not "\\s(?:inswl|mskwl)\\s" } } */ diff --git a/gcc/testsuite/gcc.target/alpha/stwa-bwx.c b/gcc/testsuite/gcc.target/alpha/stwa-bwx.c new file mode 100644 index 0000000..6331d62 --- /dev/null +++ b/gcc/testsuite/gcc.target/alpha/stwa-bwx.c @@ -0,0 +1,23 @@ +/* { dg-do compile } */ +/* { dg-options "-mbwx" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +typedef union + { + int i; + short c; + } +short_a; + +void +stwa (short_a *p, short v) +{ + p->c = v; +} + +/* Expect assembly such as: + + stw $17,0($16) + */ + +/* { dg-final { scan-assembler-times "\\sstw\\s\\\$17,0\\\(\\\$16\\\)\\s" 1 } } */ diff --git a/gcc/testsuite/gcc.target/alpha/stwa.c b/gcc/testsuite/gcc.target/alpha/stwa.c new file mode 100644 index 0000000..6b273cf --- /dev/null +++ b/gcc/testsuite/gcc.target/alpha/stwa.c @@ -0,0 +1,33 @@ +/* { dg-do compile } */ +/* { dg-options "-mno-bwx -mno-safe-bwa" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +typedef union + { + int i; + short c; + } +short_a; + +void +stwa (short_a *p, short v) +{ + p->c = v; +} + +/* Expect assembly such as: + + zapnot $17,3,$17 + ldl $1,0($16) + zapnot $1,252,$1 + bis $17,$1,$17 + stl $17,0($16) + + without any INSWL or MSKWL instructions and without address masking. */ + +/* { dg-final { scan-assembler-times "\\sldl\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sstl\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\szapnot\\s\\\$\[0-9\]+,3,\\\$\[0-9\]+\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\szapnot\\s\\\$\[0-9\]+,252,\\\$\[0-9\]+\\s" 1 } } */ +/* { dg-final { scan-assembler-not "\\sbic\\s\\\$\[0-9\]+,7,\\\$\[0-9\]+\\s" } } */ +/* { dg-final { scan-assembler-not "\\s(?:inswl|mskwl)\\s" } } */ diff --git a/gcc/testsuite/gcc.target/alpha/stwx0-bwx.c b/gcc/testsuite/gcc.target/alpha/stwx0-bwx.c index bba31df..6256f82 100644 --- a/gcc/testsuite/gcc.target/alpha/stwx0-bwx.c +++ b/gcc/testsuite/gcc.target/alpha/stwx0-bwx.c @@ -1,19 +1,15 @@ /* { dg-do compile } */ -/* { dg-options "-mbwx" } */ +/* { dg-options "-mbwx -mno-safe-partial" } */ /* { dg-skip-if "" { *-*-* } { "-O0" } } */ -typedef struct { short v __attribute__ ((packed)); } shortx; - -void -stwx0 (shortx *p) -{ - p->v = 0; -} +#include "stwx0.c" /* Expect assembly such as: stb $31,0($16) stb $31,1($16) - */ + + without any LDQ_U or STQ_U instructions. */ /* { dg-final { scan-assembler-times "\\sstb\\s\\\$31," 2 } } */ +/* { dg-final { scan-assembler-not "\\s(?:ldq_u|stq_u)\\s" } } */ diff --git a/gcc/testsuite/gcc.target/alpha/stwx0-safe-partial-bwx.c b/gcc/testsuite/gcc.target/alpha/stwx0-safe-partial-bwx.c new file mode 100644 index 0000000..031d4c6 --- /dev/null +++ b/gcc/testsuite/gcc.target/alpha/stwx0-safe-partial-bwx.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-mbwx -msafe-partial" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +#include "stwx0.c" + +/* Expect assembly such as: + + stb $31,0($16) + stb $31,1($16) + + without any LDQ_U or STQ_U instructions. */ + +/* { dg-final { scan-assembler-times "\\sstb\\s\\\$31," 2 } } */ +/* { dg-final { scan-assembler-not "\\s(?:ldq_u|stq_u)\\s" } } */ diff --git a/gcc/testsuite/gcc.target/alpha/stwx0-safe-partial.c b/gcc/testsuite/gcc.target/alpha/stwx0-safe-partial.c new file mode 100644 index 0000000..3d0eedd --- /dev/null +++ b/gcc/testsuite/gcc.target/alpha/stwx0-safe-partial.c @@ -0,0 +1,29 @@ +/* { dg-do compile } */ +/* { dg-options "-mno-bwx -msafe-partial" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +#include "stwx0.c" + +/* Expect assembly such as: + + lda $2,1($16) + bic $2,7,$2 +$L2: + ldq_l $1,0($2) + mskwh $1,$16,$1 + stq_c $1,0($2) + beq $1,$L2 + bic $16,7,$2 +$L3: + ldq_l $1,0($2) + mskwl $1,$16,$1 + stq_c $1,0($2) + beq $1,$L3 + + without any INSWH, INSWL, BIS, LDQ_U, or STQ_U instructions. */ + +/* { dg-final { scan-assembler-times "\\sldq_l\\s" 2 } } */ +/* { dg-final { scan-assembler-times "\\smskwh\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\smskwl\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sstq_c\\s" 2 } } */ +/* { dg-final { scan-assembler-not "\\s(?:bis|inswh|inswl|ldq_u|stq_u)\\s" } } */ diff --git a/gcc/testsuite/gcc.target/alpha/stwx0.c b/gcc/testsuite/gcc.target/alpha/stwx0.c index d60d33f..ad4e716 100644 --- a/gcc/testsuite/gcc.target/alpha/stwx0.c +++ b/gcc/testsuite/gcc.target/alpha/stwx0.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mno-bwx" } */ +/* { dg-options "-mno-bwx -mno-safe-partial" } */ /* { dg-skip-if "" { *-*-* } { "-O0" } } */ typedef struct { short v __attribute__ ((packed)); } shortx; diff --git a/gcc/testsuite/gcc.target/arc/taux-1.c b/gcc/testsuite/gcc.target/arc/taux-1.c index a2b7778..41b0fc4 100644 --- a/gcc/testsuite/gcc.target/arc/taux-1.c +++ b/gcc/testsuite/gcc.target/arc/taux-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 */ +/* { dg-options "-O1" } */ #define __aux() __attribute__((aux)) diff --git a/gcc/testsuite/gcc.target/arc/taux-2.c b/gcc/testsuite/gcc.target/arc/taux-2.c index 5644bcd..3e57ac8 100644 --- a/gcc/testsuite/gcc.target/arc/taux-2.c +++ b/gcc/testsuite/gcc.target/arc/taux-2.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 */ +/* { dg-options "-O1" } */ #define __aux(r) __attribute__((aux(r))) static volatile __aux(0x1000) int var; diff --git a/gcc/testsuite/gcc.target/arm/cmse/cmse-17.c b/gcc/testsuite/gcc.target/arm/cmse/cmse-17.c index a2cce09..c5be810 100644 --- a/gcc/testsuite/gcc.target/arm/cmse/cmse-17.c +++ b/gcc/testsuite/gcc.target/arm/cmse/cmse-17.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mcmse"} */ +/* { dg-options "-mcmse" } */ #include <arm_cmse.h> diff --git a/gcc/testsuite/gcc.target/arm/fmaxmin-2.c b/gcc/testsuite/gcc.target/arm/fmaxmin-2.c new file mode 100644 index 0000000..a9990e1 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/fmaxmin-2.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_arch_v8a_hard_ok } */ +/* { dg-options "-O2 -fno-inline" } */ +/* { dg-add-options arm_arch_v8a_hard } */ + +#include "fmaxmin.x" + +/* { dg-final { scan-assembler-times "vmaxnm.f32\ts\[0-9\]+, s\[0-9\]+, s\[0-9\]+" 1 } } */ +/* { dg-final { scan-assembler-times "vminnm.f32\ts\[0-9\]+, s\[0-9\]+, s\[0-9\]+" 1 } } */ + +/* { dg-final { scan-assembler-times "vmaxnm.f64\td\[0-9\]+, d\[0-9\]+, d\[0-9\]+" 1 } } */ +/* { dg-final { scan-assembler-times "vminnm.f64\td\[0-9\]+, d\[0-9\]+, d\[0-9\]+" 1 } } */ diff --git a/gcc/testsuite/gcc.target/arm/fmaxmin.c b/gcc/testsuite/gcc.target/arm/fmaxmin.c index 5a6fb80..7f30c12 100644 --- a/gcc/testsuite/gcc.target/arm/fmaxmin.c +++ b/gcc/testsuite/gcc.target/arm/fmaxmin.c @@ -1,13 +1,6 @@ /* { dg-do run } */ /* { dg-require-effective-target arm_v8_neon_hw } */ -/* { dg-options "-O2 -fno-inline -march=armv8-a -save-temps" } */ +/* { dg-options "-O2 -fno-inline" } */ /* { dg-add-options arm_v8_neon } */ #include "fmaxmin.x" - -/* { dg-final { scan-assembler-times "vmaxnm.f32\ts\[0-9\]+, s\[0-9\]+, s\[0-9\]+" 1 } } */ -/* { dg-final { scan-assembler-times "vminnm.f32\ts\[0-9\]+, s\[0-9\]+, s\[0-9\]+" 1 } } */ - -/* { dg-final { scan-assembler-times "vmaxnm.f64\td\[0-9\]+, d\[0-9\]+, d\[0-9\]+" 1 } } */ -/* { dg-final { scan-assembler-times "vminnm.f64\td\[0-9\]+, d\[0-9\]+, d\[0-9\]+" 1 } } */ - diff --git a/gcc/testsuite/gcc.target/arm/short-vfp-1.c b/gcc/testsuite/gcc.target/arm/short-vfp-1.c index 3ca1ffc..18d38a5 100644 --- a/gcc/testsuite/gcc.target/arm/short-vfp-1.c +++ b/gcc/testsuite/gcc.target/arm/short-vfp-1.c @@ -38,8 +38,8 @@ test_sihi (short x) return (int)x; } -/* {dg-final { scan-assembler-times {vcvt\.s32\.f32\ts[0-9]+,s[0-9]+} 2 }} */ -/* {dg-final { scan-assembler-times {vcvt\.f32\.s32\ts[0-9]+,s[0-9]+} 2 }} */ -/* {dg-final { scan-assembler-times {vmov\tr[0-9]+,s[0-9]+} 2 }} */ -/* {dg-final { scan-assembler-times {vmov\ts[0-9]+,r[0-9]+} 2 }} */ -/* {dg-final { scan-assembler-times {sxth\tr[0-9]+,r[0-9]+} 2 }} */ +/* { dg-final { scan-assembler-times {vcvt\.s32\.f32\ts[0-9]+,s[0-9]+} 2 } } */ +/* { dg-final { scan-assembler-times {vcvt\.f32\.s32\ts[0-9]+,s[0-9]+} 2 } } */ +/* { dg-final { scan-assembler-times {vmov\tr[0-9]+,s[0-9]+} 2 } } */ +/* { dg-final { scan-assembler-times {vmov\ts[0-9]+,r[0-9]+} 2 } } */ +/* { dg-final { scan-assembler-times {sxth\tr[0-9]+,r[0-9]+} 2 } } */ diff --git a/gcc/testsuite/gcc.target/arm/vect-fmaxmin-2.c b/gcc/testsuite/gcc.target/arm/vect-fmaxmin-2.c new file mode 100644 index 0000000..57b0a3a --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/vect-fmaxmin-2.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_arch_v8a_hard_ok } */ +/* { dg-options "-O2 -ftree-vectorize -funsafe-math-optimizations -fno-inline -save-temps" } */ +/* { dg-add-options arm_arch_v8a_hard } */ + +#include "fmaxmin.x" + +/* { dg-final { scan-assembler-times "vmaxnm.f32\tq\[0-9\]+, q\[0-9\]+, q\[0-9\]+" 1 } } */ +/* { dg-final { scan-assembler-times "vminnm.f32\tq\[0-9\]+, q\[0-9\]+, q\[0-9\]+" 1 } } */ + +/* NOTE: There are no double precision vector versions of vmaxnm/vminnm. */ +/* { dg-final { scan-assembler-times "vmaxnm.f64\td\[0-9\]+, d\[0-9\]+, d\[0-9\]+" 1 } } */ +/* { dg-final { scan-assembler-times "vminnm.f64\td\[0-9\]+, d\[0-9\]+, d\[0-9\]+" 1 } } */ + diff --git a/gcc/testsuite/gcc.target/arm/vect-fmaxmin.c b/gcc/testsuite/gcc.target/arm/vect-fmaxmin.c index ba45c4d..89dc14b 100644 --- a/gcc/testsuite/gcc.target/arm/vect-fmaxmin.c +++ b/gcc/testsuite/gcc.target/arm/vect-fmaxmin.c @@ -1,14 +1,6 @@ /* { dg-do run } */ /* { dg-require-effective-target arm_v8_neon_hw } */ -/* { dg-options "-O2 -ftree-vectorize -fno-inline -march=armv8-a -save-temps" } */ +/* { dg-options "-O2 -ftree-vectorize -fno-inline -funsafe-math-optimizations" } */ /* { dg-add-options arm_v8_neon } */ #include "fmaxmin.x" - -/* { dg-final { scan-assembler-times "vmaxnm.f32\tq\[0-9\]+, q\[0-9\]+, q\[0-9\]+" 1 } } */ -/* { dg-final { scan-assembler-times "vminnm.f32\tq\[0-9\]+, q\[0-9\]+, q\[0-9\]+" 1 } } */ - -/* NOTE: There are no double precision vector versions of vmaxnm/vminnm. */ -/* { dg-final { scan-assembler-times "vmaxnm.f64\td\[0-9\]+, d\[0-9\]+, d\[0-9\]+" 1 } } */ -/* { dg-final { scan-assembler-times "vminnm.f64\td\[0-9\]+, d\[0-9\]+, d\[0-9\]+" 1 } } */ - diff --git a/gcc/testsuite/gcc.target/bfin/l2.c b/gcc/testsuite/gcc.target/bfin/l2.c index 56f64cc..2d39c46 100644 --- a/gcc/testsuite/gcc.target/bfin/l2.c +++ b/gcc/testsuite/gcc.target/bfin/l2.c @@ -1,5 +1,5 @@ /* { dg-do run { target bfin-*-linux-uclibc } } */ -/* { dg-bfin-processors bf544 bf547 bf548 bf549 bf561} */ +/* { dg-bfin-processors bf544 bf547 bf548 bf549 bf561 } */ #if defined(__ADSPBF544__) #define L2_START 0xFEB00000 diff --git a/gcc/testsuite/gcc.target/i386/addr-space-1.c b/gcc/testsuite/gcc.target/i386/addr-space-1.c index 1e13147..9a5ce9c 100644 --- a/gcc/testsuite/gcc.target/i386/addr-space-1.c +++ b/gcc/testsuite/gcc.target/i386/addr-space-1.c @@ -1,4 +1,4 @@ -/* { dg-do compile */ +/* { dg-do compile } */ /* { dg-options "-O2" } */ /* { dg-final { scan-assembler "movl\[ \t\]%gs:\\((%eax|%rax)\\), %eax" } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vmovw-1b.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vmovw-1b.c index a96007d..9b08f5a 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16-vmovw-1b.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vmovw-1b.c @@ -1,4 +1,4 @@ -/* { dg-do run {target avx512fp16} } */ +/* { dg-do run { target avx512fp16 } } */ /* { dg-options "-O2 -mavx512fp16" } */ static void do_test (void); diff --git a/gcc/testsuite/gcc.target/i386/pr119425.c b/gcc/testsuite/gcc.target/i386/pr119425.c new file mode 100644 index 0000000..b926979 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr119425.c @@ -0,0 +1,37 @@ +/* PR target/119425 */ +/* { dg-do compile { target { ! ia32 } } } */ +/* { dg-options "-Os -fno-vect-cost-model -ftree-slp-vectorize -mavxneconvert -mapxf" } */ +extern long K512[]; +extern long sha512_block_data_order_ctx[]; + +#define Ch(x, y, z) ~x &z +#define ROUND_00_15(i, a, b, c, d, e, f, g, h) \ + T1 += ~e & g + K512[i]; \ +h = 0; \ +d += h += T1 +#define ROUND_16_80(i, j, a, b, c, d, e, f, g, h, X) \ + ROUND_00_15(i + j, , , , d, e, , g, h) + +unsigned sha512_block_data_order_f, sha512_block_data_order_g; + +void +sha512_block_data_order() +{ + unsigned a, b, c, d, e, h, T1; + int i = 6; + for (; i < 80; i += 6) { + ROUND_16_80(i, 0, , , , d, e, , , h, ); + ROUND_16_80(i, 11, , , , a, b, , d, e, ); + ROUND_16_80(i, 12, , , , h, a, , c, d, ); + ROUND_16_80(i, 13, , , , sha512_block_data_order_g, h, , b, c, ); + ROUND_16_80(i, 14, , , , sha512_block_data_order_f, + sha512_block_data_order_g, , a, b, ); + ROUND_16_80(i, 15, , , , e, sha512_block_data_order_f, , , a, ); + + } + sha512_block_data_order_ctx[0] += a; + sha512_block_data_order_ctx[1] += b; + sha512_block_data_order_ctx[2] += c; + sha512_block_data_order_ctx[3] += d; + +} diff --git a/gcc/testsuite/gcc.target/i386/pr119473.c b/gcc/testsuite/gcc.target/i386/pr119473.c new file mode 100644 index 0000000..574c921 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr119473.c @@ -0,0 +1,26 @@ +/* PR target/119473 */ +/* { dg-do compile { target { ! ia32 } } } */ +/* { dg-options "-O2 -mapxf -m64 -mvaes" } */ + +typedef char __v32qi __attribute__ ((__vector_size__(32))); +typedef long long __m256i __attribute__((__vector_size__(32), __aligned__(32))); + +typedef union +{ + __v32qi qi[8]; +} tmp_u; + + +void foo () +{ + register tmp_u *tdst __asm__("%rdx"); + register tmp_u *src1 __asm__("%rcx"); + register tmp_u *src2 __asm__("%r26"); + + tdst->qi[0] = __builtin_ia32_vaesdec_v32qi(src1->qi[0], src2->qi[0]); + tdst->qi[0] = __builtin_ia32_vaesdeclast_v32qi(src1->qi[0], src2->qi[0]); + tdst->qi[0] = __builtin_ia32_vaesenc_v32qi(src1->qi[0], src2->qi[0]); + tdst->qi[0] = __builtin_ia32_vaesenclast_v32qi(src1->qi[0], src2->qi[0]); +} + +/* { dg-final { scan-assembler-not "\\\(%r26\\\), " } } */ diff --git a/gcc/testsuite/gcc.target/i386/sse2-float16-5.c b/gcc/testsuite/gcc.target/i386/sse2-float16-5.c index c3ed23b..8207842 100644 --- a/gcc/testsuite/gcc.target/i386/sse2-float16-5.c +++ b/gcc/testsuite/gcc.target/i386/sse2-float16-5.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target ia32} } */ +/* { dg-do compile { target ia32 } } */ /* { dg-options "-O2 -mno-sse2" } */ _Float16 a; diff --git a/gcc/testsuite/gcc.target/i386/strub-pr118006.c b/gcc/testsuite/gcc.target/i386/strub-pr118006.c index f116790..88f66c1 100644 --- a/gcc/testsuite/gcc.target/i386/strub-pr118006.c +++ b/gcc/testsuite/gcc.target/i386/strub-pr118006.c @@ -1,5 +1,5 @@ -/* { dg-require-effective-target strub } */ /* { dg-do compile } */ +/* { dg-require-effective-target strub } */ /* { dg-options "-fstrub=all -O2 -mno-accumulate-outgoing-args" } */ __attribute__((noipa)) diff --git a/gcc/testsuite/gcc.target/ia64/mfused-madd-vect.c b/gcc/testsuite/gcc.target/ia64/mfused-madd-vect.c index 5bf6976..d1dc3c1 100644 --- a/gcc/testsuite/gcc.target/ia64/mfused-madd-vect.c +++ b/gcc/testsuite/gcc.target/ia64/mfused-madd-vect.c @@ -1,4 +1,4 @@ -/* { dg-do compile */ +/* { dg-do compile } */ /* { dg-options "-O2 -ftree-vectorize" } */ /* { dg-final { scan-assembler-not "fpmpy" } } */ diff --git a/gcc/testsuite/gcc.target/ia64/mfused-madd.c b/gcc/testsuite/gcc.target/ia64/mfused-madd.c index 8ecb31f..04fd95a 100644 --- a/gcc/testsuite/gcc.target/ia64/mfused-madd.c +++ b/gcc/testsuite/gcc.target/ia64/mfused-madd.c @@ -1,4 +1,4 @@ -/* { dg-do compile */ +/* { dg-do compile } */ /* { dg-options "-O2" } */ /* { dg-final { scan-assembler-not "fmpy" } } */ /* { dg-final { scan-assembler-not "fadd" } } */ diff --git a/gcc/testsuite/gcc.target/ia64/mno-fused-madd-vect.c b/gcc/testsuite/gcc.target/ia64/mno-fused-madd-vect.c index 10b047b..a80ce8b 100644 --- a/gcc/testsuite/gcc.target/ia64/mno-fused-madd-vect.c +++ b/gcc/testsuite/gcc.target/ia64/mno-fused-madd-vect.c @@ -1,4 +1,4 @@ -/* { dg-do compile */ +/* { dg-do compile } */ /* { dg-options "-O2 -ffp-contract=off -ftree-vectorize" } */ /* { dg-final { scan-assembler "fpmpy" } } */ diff --git a/gcc/testsuite/gcc.target/ia64/mno-fused-madd.c b/gcc/testsuite/gcc.target/ia64/mno-fused-madd.c index 487519a..1f29225 100644 --- a/gcc/testsuite/gcc.target/ia64/mno-fused-madd.c +++ b/gcc/testsuite/gcc.target/ia64/mno-fused-madd.c @@ -1,4 +1,4 @@ -/* { dg-do compile */ +/* { dg-do compile } */ /* { dg-options "-O2 -ffp-contract=off" } */ /* { dg-final { scan-assembler-not "fma" } } */ /* { dg-final { scan-assembler-not "fms" } } */ diff --git a/gcc/testsuite/gcc.target/loongarch/pr119408.c b/gcc/testsuite/gcc.target/loongarch/pr119408.c new file mode 100644 index 0000000..f46399a --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/pr119408.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -Wno-pedantic" } */ + +__float128 a; +__float128 b; +void +test (void) +{ + a = 1.11111111Q; + b = 1.434345q; +} + diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-longlong.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-longlong.c index 06d6c1b..4facb82 100644 --- a/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-longlong.c +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-perm-longlong.c @@ -1,7 +1,7 @@ /* Verify that overloaded built-ins for vec_perm with long long inputs produce the right code. */ -/* { dg-do compile {target lp64} } */ +/* { dg-do compile { target lp64 } } */ // 'long long' in Altivec types is invalid without -mvsx. /* { dg-options "-mvsx -O2" } */ /* { dg-require-effective-target powerpc_vsx } */ diff --git a/gcc/testsuite/gcc.target/powerpc/pr70243.c b/gcc/testsuite/gcc.target/powerpc/pr70243.c index 1152518..512c199 100644 --- a/gcc/testsuite/gcc.target/powerpc/pr70243.c +++ b/gcc/testsuite/gcc.target/powerpc/pr70243.c @@ -1,4 +1,4 @@ -/* { dg-do compile */ +/* { dg-do compile } */ /* { dg-options "-O2 -mvsx" } */ /* { dg-require-effective-target powerpc_vsx } */ diff --git a/gcc/testsuite/gcc.target/powerpc/pr91903.c b/gcc/testsuite/gcc.target/powerpc/pr91903.c index d70a0c6..b147d0e 100644 --- a/gcc/testsuite/gcc.target/powerpc/pr91903.c +++ b/gcc/testsuite/gcc.target/powerpc/pr91903.c @@ -1,4 +1,4 @@ -/* { dg-do compile */ +/* { dg-do compile } */ /* { dg-options "-mdejagnu-cpu=power8 -mvsx" } */ /* { dg-require-effective-target powerpc_vsx } */ diff --git a/gcc/testsuite/gcc.target/riscv/cmo-zicbop-1.c b/gcc/testsuite/gcc.target/riscv/cmo-zicbop-1.c index 9718115..581b5db 100644 --- a/gcc/testsuite/gcc.target/riscv/cmo-zicbop-1.c +++ b/gcc/testsuite/gcc.target/riscv/cmo-zicbop-1.c @@ -1,4 +1,4 @@ -/* { dg-do compile target { { rv64-*-*}}} */ +/* { dg-do compile { target rv64-*-* } } */ /* { dg-options "-march=rv64gc_zicbop -mabi=lp64" } */ void foo (char *p) diff --git a/gcc/testsuite/gcc.target/riscv/cmo-zicbop-2.c b/gcc/testsuite/gcc.target/riscv/cmo-zicbop-2.c index 4871a97..3f7c1a4 100644 --- a/gcc/testsuite/gcc.target/riscv/cmo-zicbop-2.c +++ b/gcc/testsuite/gcc.target/riscv/cmo-zicbop-2.c @@ -1,4 +1,4 @@ -/* { dg-do compile target { { rv32-*-*}}} */ +/* { dg-do compile { target rv64-*-* } } */ /* { dg-options "-march=rv32gc_zicbop -mabi=ilp32" } */ void foo (char *p) diff --git a/gcc/testsuite/gcc.target/riscv/prefetch-zicbop.c b/gcc/testsuite/gcc.target/riscv/prefetch-zicbop.c index 0faa120..44da4b2 100644 --- a/gcc/testsuite/gcc.target/riscv/prefetch-zicbop.c +++ b/gcc/testsuite/gcc.target/riscv/prefetch-zicbop.c @@ -1,4 +1,4 @@ -/* { dg-do compile target { { rv64-*-*}}} */ +/* { dg-do compile { target rv64-*-* } } */ /* { dg-options "-march=rv64gc_zicbop -mabi=lp64" } */ void foo (char *p) diff --git a/gcc/testsuite/gcc.target/riscv/prefetch-zihintntl.c b/gcc/testsuite/gcc.target/riscv/prefetch-zihintntl.c index 78a3afe..43439d7 100644 --- a/gcc/testsuite/gcc.target/riscv/prefetch-zihintntl.c +++ b/gcc/testsuite/gcc.target/riscv/prefetch-zihintntl.c @@ -1,4 +1,4 @@ -/* { dg-do compile target { { rv64-*-*}}} */ +/* { dg-do compile { target rv64-*-* } } */ /* { dg-options "-march=rv64gc_zicbop_zihintntl -mabi=lp64" } */ void foo (char *p) diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr111391-2.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr111391-2.c index 1f170c9..32db3a6 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr111391-2.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr111391-2.c @@ -3,7 +3,7 @@ #include "pr111391-1.c" -/* { dg-final { scan-assembler-times {vsetivli\s+zero,\s*2,\s*e32,\s*mf2,\s*t[au],\s*m[au]} 1 } } +/* { dg-final { scan-assembler-times {vsetivli\s+zero,\s*2,\s*e32,\s*m1,\s*t[au],\s*m[au]} 1 } } */ /* { dg-final { scan-assembler-times {vmv\.x\.s} 2 } } */ /* { dg-final { scan-assembler-times {vslidedown.vi\s+v[0-9]+,\s*v[0-9]+,\s*1} 1 } } */ /* { dg-final { scan-assembler-times {slli\s+[a-x0-9]+,[a-x0-9]+,32} 1 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls-vlmax/merge-4.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls-vlmax/merge-4.c index 3095a6d..a043b33 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls-vlmax/merge-4.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls-vlmax/merge-4.c @@ -119,4 +119,4 @@ merge10 (vnx16df x, vnx16df y, vnx16df *out) *(vnx16df*)out = v; } -/* dg-final scan-assembler-times {\tvmerge.vvm} 11 */ +/* { dg-final { scan-assembler-times {\tvmerge.vvm} 11 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/merge-4.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/merge-4.c index 1dfd828..4ae341a 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/merge-4.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/merge-4.c @@ -3,6 +3,6 @@ #include "../vls-vlmax/merge-4.c" -/* dg-final scan-assembler-times {\tvmerge.vvm} 11 */ +/* { dg-final { scan-assembler-times {\tvmerge.vvm} 11 } } */ /* { dg-final { scan-assembler-not {\tvms} } } */ /* { dg-final { scan-assembler-times {\tvlm.v} 11 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/abi-14.c b/gcc/testsuite/gcc.target/riscv/rvv/base/abi-14.c index 163152a..222d8c2 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/base/abi-14.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/abi-14.c @@ -1,20 +1,20 @@ /* { dg-do compile } */ /* { dg-options "-O3 -march=rv32gc_zve32x_zvl64b -mabi=ilp32d" } */ -void f___rvv_int8mf8x2_t () {__rvv_int8mf8x2_t t;} -void f___rvv_uint8mf8x2_t () {__rvv_uint8mf8x2_t t;} -void f___rvv_int8mf8x3_t () {__rvv_int8mf8x3_t t;} -void f___rvv_uint8mf8x3_t () {__rvv_uint8mf8x3_t t;} -void f___rvv_int8mf8x4_t () {__rvv_int8mf8x4_t t;} -void f___rvv_uint8mf8x4_t () {__rvv_uint8mf8x4_t t;} -void f___rvv_int8mf8x5_t () {__rvv_int8mf8x5_t t;} -void f___rvv_uint8mf8x5_t () {__rvv_uint8mf8x5_t t;} -void f___rvv_int8mf8x6_t () {__rvv_int8mf8x6_t t;} -void f___rvv_uint8mf8x6_t () {__rvv_uint8mf8x6_t t;} -void f___rvv_int8mf8x7_t () {__rvv_int8mf8x7_t t;} -void f___rvv_uint8mf8x7_t () {__rvv_uint8mf8x7_t t;} -void f___rvv_int8mf8x8_t () {__rvv_int8mf8x8_t t;} -void f___rvv_uint8mf8x8_t () {__rvv_uint8mf8x8_t t;} +void f___rvv_int8mf8x2_t () {__rvv_int8mf8x2_t t;} /* { dg-error {unknown type name '__rvv_int8mf8x2_t'} } */ +void f___rvv_uint8mf8x2_t () {__rvv_uint8mf8x2_t t;} /* { dg-error {unknown type name '__rvv_uint8mf8x2_t'} } */ +void f___rvv_int8mf8x3_t () {__rvv_int8mf8x3_t t;} /* { dg-error {unknown type name '__rvv_int8mf8x3_t'} } */ +void f___rvv_uint8mf8x3_t () {__rvv_uint8mf8x3_t t;} /* { dg-error {unknown type name '__rvv_uint8mf8x3_t'} } */ +void f___rvv_int8mf8x4_t () {__rvv_int8mf8x4_t t;} /* { dg-error {unknown type name '__rvv_int8mf8x4_t'} } */ +void f___rvv_uint8mf8x4_t () {__rvv_uint8mf8x4_t t;} /* { dg-error {unknown type name '__rvv_uint8mf8x4_t'} } */ +void f___rvv_int8mf8x5_t () {__rvv_int8mf8x5_t t;} /* { dg-error {unknown type name '__rvv_int8mf8x5_t'} } */ +void f___rvv_uint8mf8x5_t () {__rvv_uint8mf8x5_t t;} /* { dg-error {unknown type name '__rvv_uint8mf8x5_t'} } */ +void f___rvv_int8mf8x6_t () {__rvv_int8mf8x6_t t;} /* { dg-error {unknown type name '__rvv_int8mf8x6_t'} } */ +void f___rvv_uint8mf8x6_t () {__rvv_uint8mf8x6_t t;} /* { dg-error {unknown type name '__rvv_uint8mf8x6_t'} } */ +void f___rvv_int8mf8x7_t () {__rvv_int8mf8x7_t t;} /* { dg-error {unknown type name '__rvv_int8mf8x7_t'} } */ +void f___rvv_uint8mf8x7_t () {__rvv_uint8mf8x7_t t;} /* { dg-error {unknown type name '__rvv_uint8mf8x7_t'} } */ +void f___rvv_int8mf8x8_t () {__rvv_int8mf8x8_t t;} /* { dg-error {unknown type name '__rvv_int8mf8x8_t'} } */ +void f___rvv_uint8mf8x8_t () {__rvv_uint8mf8x8_t t;} /* { dg-error {unknown type name '__rvv_uint8mf8x8_t'} } */ void f___rvv_int8mf4x2_t () {__rvv_int8mf4x2_t t;} void f___rvv_uint8mf4x2_t () {__rvv_uint8mf4x2_t t;} void f___rvv_int8mf4x3_t () {__rvv_int8mf4x3_t t;} @@ -65,20 +65,20 @@ void f___rvv_int8m2x4_t () {__rvv_int8m2x4_t t;} void f___rvv_uint8m2x4_t () {__rvv_uint8m2x4_t t;} void f___rvv_int8m4x2_t () {__rvv_int8m4x2_t t;} void f___rvv_uint8m4x2_t () {__rvv_uint8m4x2_t t;} -void f___rvv_int16mf4x2_t () {__rvv_int16mf4x2_t t;} -void f___rvv_uint16mf4x2_t () {__rvv_uint16mf4x2_t t;} -void f___rvv_int16mf4x3_t () {__rvv_int16mf4x3_t t;} -void f___rvv_uint16mf4x3_t () {__rvv_uint16mf4x3_t t;} -void f___rvv_int16mf4x4_t () {__rvv_int16mf4x4_t t;} -void f___rvv_uint16mf4x4_t () {__rvv_uint16mf4x4_t t;} -void f___rvv_int16mf4x5_t () {__rvv_int16mf4x5_t t;} -void f___rvv_uint16mf4x5_t () {__rvv_uint16mf4x5_t t;} -void f___rvv_int16mf4x6_t () {__rvv_int16mf4x6_t t;} -void f___rvv_uint16mf4x6_t () {__rvv_uint16mf4x6_t t;} -void f___rvv_int16mf4x7_t () {__rvv_int16mf4x7_t t;} -void f___rvv_uint16mf4x7_t () {__rvv_uint16mf4x7_t t;} -void f___rvv_int16mf4x8_t () {__rvv_int16mf4x8_t t;} -void f___rvv_uint16mf4x8_t () {__rvv_uint16mf4x8_t t;} +void f___rvv_int16mf4x2_t () {__rvv_int16mf4x2_t t;} /* { dg-error {unknown type name '__rvv_int16mf4x2_t'} } */ +void f___rvv_uint16mf4x2_t () {__rvv_uint16mf4x2_t t;} /* { dg-error {unknown type name '__rvv_uint16mf4x2_t'} } */ +void f___rvv_int16mf4x3_t () {__rvv_int16mf4x3_t t;} /* { dg-error {unknown type name '__rvv_int16mf4x3_t'} } */ +void f___rvv_uint16mf4x3_t () {__rvv_uint16mf4x3_t t;} /* { dg-error {unknown type name '__rvv_uint16mf4x3_t'} } */ +void f___rvv_int16mf4x4_t () {__rvv_int16mf4x4_t t;} /* { dg-error {unknown type name '__rvv_int16mf4x4_t'} } */ +void f___rvv_uint16mf4x4_t () {__rvv_uint16mf4x4_t t;} /* { dg-error {unknown type name '__rvv_uint16mf4x4_t'} } */ +void f___rvv_int16mf4x5_t () {__rvv_int16mf4x5_t t;} /* { dg-error {unknown type name '__rvv_int16mf4x5_t'} } */ +void f___rvv_uint16mf4x5_t () {__rvv_uint16mf4x5_t t;} /* { dg-error {unknown type name '__rvv_uint16mf4x5_t'} } */ +void f___rvv_int16mf4x6_t () {__rvv_int16mf4x6_t t;} /* { dg-error {unknown type name '__rvv_int16mf4x6_t'} } */ +void f___rvv_uint16mf4x6_t () {__rvv_uint16mf4x6_t t;} /* { dg-error {unknown type name '__rvv_uint16mf4x6_t'} } */ +void f___rvv_int16mf4x7_t () {__rvv_int16mf4x7_t t;} /* { dg-error {unknown type name '__rvv_int16mf4x7_t'} } */ +void f___rvv_uint16mf4x7_t () {__rvv_uint16mf4x7_t t;} /* { dg-error {unknown type name '__rvv_uint16mf4x7_t'} } */ +void f___rvv_int16mf4x8_t () {__rvv_int16mf4x8_t t;} /* { dg-error {unknown type name '__rvv_int16mf4x8_t'} } */ +void f___rvv_uint16mf4x8_t () {__rvv_uint16mf4x8_t t;} /* { dg-error {unknown type name '__rvv_uint16mf4x8_t'} } */ void f___rvv_int16mf2x2_t () {__rvv_int16mf2x2_t t;} void f___rvv_uint16mf2x2_t () {__rvv_uint16mf2x2_t t;} void f___rvv_int16mf2x3_t () {__rvv_int16mf2x3_t t;} @@ -115,20 +115,20 @@ void f___rvv_int16m2x4_t () {__rvv_int16m2x4_t t;} void f___rvv_uint16m2x4_t () {__rvv_uint16m2x4_t t;} void f___rvv_int16m4x2_t () {__rvv_int16m4x2_t t;} void f___rvv_uint16m4x2_t () {__rvv_uint16m4x2_t t;} -void f___rvv_int32mf2x2_t () {__rvv_int32mf2x2_t t;} -void f___rvv_uint32mf2x2_t () {__rvv_uint32mf2x2_t t;} -void f___rvv_int32mf2x3_t () {__rvv_int32mf2x3_t t;} -void f___rvv_uint32mf2x3_t () {__rvv_uint32mf2x3_t t;} -void f___rvv_int32mf2x4_t () {__rvv_int32mf2x4_t t;} -void f___rvv_uint32mf2x4_t () {__rvv_uint32mf2x4_t t;} -void f___rvv_int32mf2x5_t () {__rvv_int32mf2x5_t t;} -void f___rvv_uint32mf2x5_t () {__rvv_uint32mf2x5_t t;} -void f___rvv_int32mf2x6_t () {__rvv_int32mf2x6_t t;} -void f___rvv_uint32mf2x6_t () {__rvv_uint32mf2x6_t t;} -void f___rvv_int32mf2x7_t () {__rvv_int32mf2x7_t t;} -void f___rvv_uint32mf2x7_t () {__rvv_uint32mf2x7_t t;} -void f___rvv_int32mf2x8_t () {__rvv_int32mf2x8_t t;} -void f___rvv_uint32mf2x8_t () {__rvv_uint32mf2x8_t t;} +void f___rvv_int32mf2x2_t () {__rvv_int32mf2x2_t t;} /* { dg-error {unknown type name '__rvv_int32mf2x2_t'} } */ +void f___rvv_uint32mf2x2_t () {__rvv_uint32mf2x2_t t;} /* { dg-error {unknown type name '__rvv_uint32mf2x2_t'} } */ +void f___rvv_int32mf2x3_t () {__rvv_int32mf2x3_t t;} /* { dg-error {unknown type name '__rvv_int32mf2x3_t'} } */ +void f___rvv_uint32mf2x3_t () {__rvv_uint32mf2x3_t t;} /* { dg-error {unknown type name '__rvv_uint32mf2x3_t'} } */ +void f___rvv_int32mf2x4_t () {__rvv_int32mf2x4_t t;} /* { dg-error {unknown type name '__rvv_int32mf2x4_t'} } */ +void f___rvv_uint32mf2x4_t () {__rvv_uint32mf2x4_t t;} /* { dg-error {unknown type name '__rvv_uint32mf2x4_t'} } */ +void f___rvv_int32mf2x5_t () {__rvv_int32mf2x5_t t;} /* { dg-error {unknown type name '__rvv_int32mf2x5_t'} } */ +void f___rvv_uint32mf2x5_t () {__rvv_uint32mf2x5_t t;} /* { dg-error {unknown type name '__rvv_uint32mf2x5_t'} } */ +void f___rvv_int32mf2x6_t () {__rvv_int32mf2x6_t t;} /* { dg-error {unknown type name '__rvv_int32mf2x6_t'} } */ +void f___rvv_uint32mf2x6_t () {__rvv_uint32mf2x6_t t;} /* { dg-error {unknown type name '__rvv_uint32mf2x6_t'} } */ +void f___rvv_int32mf2x7_t () {__rvv_int32mf2x7_t t;} /* { dg-error {unknown type name '__rvv_int32mf2x7_t'} } */ +void f___rvv_uint32mf2x7_t () {__rvv_uint32mf2x7_t t;} /* { dg-error {unknown type name '__rvv_uint32mf2x7_t'} } */ +void f___rvv_int32mf2x8_t () {__rvv_int32mf2x8_t t;} /* { dg-error {unknown type name '__rvv_int32mf2x8_t'} } */ +void f___rvv_uint32mf2x8_t () {__rvv_uint32mf2x8_t t;} /* { dg-error {unknown type name '__rvv_uint32mf2x8_t'} } */ void f___rvv_int32m1x2_t () {__rvv_int32m1x2_t t;} void f___rvv_uint32m1x2_t () {__rvv_uint32m1x2_t t;} void f___rvv_int32m1x3_t () {__rvv_int32m1x3_t t;} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/abi-16.c b/gcc/testsuite/gcc.target/riscv/rvv/base/abi-16.c index 9e962a7..2762b7a 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/base/abi-16.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/abi-16.c @@ -1,20 +1,20 @@ /* { dg-do compile } */ /* { dg-options "-O3 -march=rv32gc_zve32f_zvl64b -mabi=ilp32d" } */ -void f___rvv_int8mf8x2_t () {__rvv_int8mf8x2_t t;} -void f___rvv_uint8mf8x2_t () {__rvv_uint8mf8x2_t t;} -void f___rvv_int8mf8x3_t () {__rvv_int8mf8x3_t t;} -void f___rvv_uint8mf8x3_t () {__rvv_uint8mf8x3_t t;} -void f___rvv_int8mf8x4_t () {__rvv_int8mf8x4_t t;} -void f___rvv_uint8mf8x4_t () {__rvv_uint8mf8x4_t t;} -void f___rvv_int8mf8x5_t () {__rvv_int8mf8x5_t t;} -void f___rvv_uint8mf8x5_t () {__rvv_uint8mf8x5_t t;} -void f___rvv_int8mf8x6_t () {__rvv_int8mf8x6_t t;} -void f___rvv_uint8mf8x6_t () {__rvv_uint8mf8x6_t t;} -void f___rvv_int8mf8x7_t () {__rvv_int8mf8x7_t t;} -void f___rvv_uint8mf8x7_t () {__rvv_uint8mf8x7_t t;} -void f___rvv_int8mf8x8_t () {__rvv_int8mf8x8_t t;} -void f___rvv_uint8mf8x8_t () {__rvv_uint8mf8x8_t t;} +void f___rvv_int8mf8x2_t () {__rvv_int8mf8x2_t t;} /* { dg-error {unknown type name '__rvv_int8mf8x2_t'} } */ +void f___rvv_uint8mf8x2_t () {__rvv_uint8mf8x2_t t;} /* { dg-error {unknown type name '__rvv_uint8mf8x2_t'} } */ +void f___rvv_int8mf8x3_t () {__rvv_int8mf8x3_t t;} /* { dg-error {unknown type name '__rvv_int8mf8x3_t'} } */ +void f___rvv_uint8mf8x3_t () {__rvv_uint8mf8x3_t t;} /* { dg-error {unknown type name '__rvv_uint8mf8x3_t'} } */ +void f___rvv_int8mf8x4_t () {__rvv_int8mf8x4_t t;} /* { dg-error {unknown type name '__rvv_int8mf8x4_t'} } */ +void f___rvv_uint8mf8x4_t () {__rvv_uint8mf8x4_t t;} /* { dg-error {unknown type name '__rvv_uint8mf8x4_t'} } */ +void f___rvv_int8mf8x5_t () {__rvv_int8mf8x5_t t;} /* { dg-error {unknown type name '__rvv_int8mf8x5_t'} } */ +void f___rvv_uint8mf8x5_t () {__rvv_uint8mf8x5_t t;} /* { dg-error {unknown type name '__rvv_uint8mf8x5_t'} } */ +void f___rvv_int8mf8x6_t () {__rvv_int8mf8x6_t t;} /* { dg-error {unknown type name '__rvv_int8mf8x6_t'} } */ +void f___rvv_uint8mf8x6_t () {__rvv_uint8mf8x6_t t;} /* { dg-error {unknown type name '__rvv_uint8mf8x6_t'} } */ +void f___rvv_int8mf8x7_t () {__rvv_int8mf8x7_t t;} /* { dg-error {unknown type name '__rvv_int8mf8x7_t'} } */ +void f___rvv_uint8mf8x7_t () {__rvv_uint8mf8x7_t t;} /* { dg-error {unknown type name '__rvv_uint8mf8x7_t'} } */ +void f___rvv_int8mf8x8_t () {__rvv_int8mf8x8_t t;} /* { dg-error {unknown type name '__rvv_int8mf8x8_t'} } */ +void f___rvv_uint8mf8x8_t () {__rvv_uint8mf8x8_t t;} /* { dg-error {unknown type name '__rvv_uint8mf8x8_t'} } */ void f___rvv_int8mf4x2_t () {__rvv_int8mf4x2_t t;} void f___rvv_uint8mf4x2_t () {__rvv_uint8mf4x2_t t;} void f___rvv_int8mf4x3_t () {__rvv_int8mf4x3_t t;} @@ -65,20 +65,20 @@ void f___rvv_int8m2x4_t () {__rvv_int8m2x4_t t;} void f___rvv_uint8m2x4_t () {__rvv_uint8m2x4_t t;} void f___rvv_int8m4x2_t () {__rvv_int8m4x2_t t;} void f___rvv_uint8m4x2_t () {__rvv_uint8m4x2_t t;} -void f___rvv_int16mf4x2_t () {__rvv_int16mf4x2_t t;} -void f___rvv_uint16mf4x2_t () {__rvv_uint16mf4x2_t t;} -void f___rvv_int16mf4x3_t () {__rvv_int16mf4x3_t t;} -void f___rvv_uint16mf4x3_t () {__rvv_uint16mf4x3_t t;} -void f___rvv_int16mf4x4_t () {__rvv_int16mf4x4_t t;} -void f___rvv_uint16mf4x4_t () {__rvv_uint16mf4x4_t t;} -void f___rvv_int16mf4x5_t () {__rvv_int16mf4x5_t t;} -void f___rvv_uint16mf4x5_t () {__rvv_uint16mf4x5_t t;} -void f___rvv_int16mf4x6_t () {__rvv_int16mf4x6_t t;} -void f___rvv_uint16mf4x6_t () {__rvv_uint16mf4x6_t t;} -void f___rvv_int16mf4x7_t () {__rvv_int16mf4x7_t t;} -void f___rvv_uint16mf4x7_t () {__rvv_uint16mf4x7_t t;} -void f___rvv_int16mf4x8_t () {__rvv_int16mf4x8_t t;} -void f___rvv_uint16mf4x8_t () {__rvv_uint16mf4x8_t t;} +void f___rvv_int16mf4x2_t () {__rvv_int16mf4x2_t t;} /* { dg-error {unknown type name '__rvv_int16mf4x2_t'} } */ +void f___rvv_uint16mf4x2_t () {__rvv_uint16mf4x2_t t;} /* { dg-error {unknown type name '__rvv_uint16mf4x2_t'} } */ +void f___rvv_int16mf4x3_t () {__rvv_int16mf4x3_t t;} /* { dg-error {unknown type name '__rvv_int16mf4x3_t'} } */ +void f___rvv_uint16mf4x3_t () {__rvv_uint16mf4x3_t t;} /* { dg-error {unknown type name '__rvv_uint16mf4x3_t'} } */ +void f___rvv_int16mf4x4_t () {__rvv_int16mf4x4_t t;} /* { dg-error {unknown type name '__rvv_int16mf4x4_t'} } */ +void f___rvv_uint16mf4x4_t () {__rvv_uint16mf4x4_t t;} /* { dg-error {unknown type name '__rvv_uint16mf4x4_t'} } */ +void f___rvv_int16mf4x5_t () {__rvv_int16mf4x5_t t;} /* { dg-error {unknown type name '__rvv_int16mf4x5_t'} } */ +void f___rvv_uint16mf4x5_t () {__rvv_uint16mf4x5_t t;} /* { dg-error {unknown type name '__rvv_uint16mf4x5_t'} } */ +void f___rvv_int16mf4x6_t () {__rvv_int16mf4x6_t t;} /* { dg-error {unknown type name '__rvv_int16mf4x6_t'} } */ +void f___rvv_uint16mf4x6_t () {__rvv_uint16mf4x6_t t;} /* { dg-error {unknown type name '__rvv_uint16mf4x6_t'} } */ +void f___rvv_int16mf4x7_t () {__rvv_int16mf4x7_t t;} /* { dg-error {unknown type name '__rvv_int16mf4x7_t'} } */ +void f___rvv_uint16mf4x7_t () {__rvv_uint16mf4x7_t t;} /* { dg-error {unknown type name '__rvv_uint16mf4x7_t'} } */ +void f___rvv_int16mf4x8_t () {__rvv_int16mf4x8_t t;} /* { dg-error {unknown type name '__rvv_int16mf4x8_t'} } */ +void f___rvv_uint16mf4x8_t () {__rvv_uint16mf4x8_t t;} /* { dg-error {unknown type name '__rvv_uint16mf4x8_t'} } */ void f___rvv_int16mf2x2_t () {__rvv_int16mf2x2_t t;} void f___rvv_uint16mf2x2_t () {__rvv_uint16mf2x2_t t;} void f___rvv_int16mf2x3_t () {__rvv_int16mf2x3_t t;} @@ -115,20 +115,20 @@ void f___rvv_int16m2x4_t () {__rvv_int16m2x4_t t;} void f___rvv_uint16m2x4_t () {__rvv_uint16m2x4_t t;} void f___rvv_int16m4x2_t () {__rvv_int16m4x2_t t;} void f___rvv_uint16m4x2_t () {__rvv_uint16m4x2_t t;} -void f___rvv_int32mf2x2_t () {__rvv_int32mf2x2_t t;} -void f___rvv_uint32mf2x2_t () {__rvv_uint32mf2x2_t t;} -void f___rvv_int32mf2x3_t () {__rvv_int32mf2x3_t t;} -void f___rvv_uint32mf2x3_t () {__rvv_uint32mf2x3_t t;} -void f___rvv_int32mf2x4_t () {__rvv_int32mf2x4_t t;} -void f___rvv_uint32mf2x4_t () {__rvv_uint32mf2x4_t t;} -void f___rvv_int32mf2x5_t () {__rvv_int32mf2x5_t t;} -void f___rvv_uint32mf2x5_t () {__rvv_uint32mf2x5_t t;} -void f___rvv_int32mf2x6_t () {__rvv_int32mf2x6_t t;} -void f___rvv_uint32mf2x6_t () {__rvv_uint32mf2x6_t t;} -void f___rvv_int32mf2x7_t () {__rvv_int32mf2x7_t t;} -void f___rvv_uint32mf2x7_t () {__rvv_uint32mf2x7_t t;} -void f___rvv_int32mf2x8_t () {__rvv_int32mf2x8_t t;} -void f___rvv_uint32mf2x8_t () {__rvv_uint32mf2x8_t t;} +void f___rvv_int32mf2x2_t () {__rvv_int32mf2x2_t t;} /* { dg-error {unknown type name '__rvv_int32mf2x2_t'} } */ +void f___rvv_uint32mf2x2_t () {__rvv_uint32mf2x2_t t;} /* { dg-error {unknown type name '__rvv_uint32mf2x2_t'} } */ +void f___rvv_int32mf2x3_t () {__rvv_int32mf2x3_t t;} /* { dg-error {unknown type name '__rvv_int32mf2x3_t'} } */ +void f___rvv_uint32mf2x3_t () {__rvv_uint32mf2x3_t t;} /* { dg-error {unknown type name '__rvv_uint32mf2x3_t'} } */ +void f___rvv_int32mf2x4_t () {__rvv_int32mf2x4_t t;} /* { dg-error {unknown type name '__rvv_int32mf2x4_t'} } */ +void f___rvv_uint32mf2x4_t () {__rvv_uint32mf2x4_t t;} /* { dg-error {unknown type name '__rvv_uint32mf2x4_t'} } */ +void f___rvv_int32mf2x5_t () {__rvv_int32mf2x5_t t;} /* { dg-error {unknown type name '__rvv_int32mf2x5_t'} } */ +void f___rvv_uint32mf2x5_t () {__rvv_uint32mf2x5_t t;} /* { dg-error {unknown type name '__rvv_uint32mf2x5_t'} } */ +void f___rvv_int32mf2x6_t () {__rvv_int32mf2x6_t t;} /* { dg-error {unknown type name '__rvv_int32mf2x6_t'} } */ +void f___rvv_uint32mf2x6_t () {__rvv_uint32mf2x6_t t;} /* { dg-error {unknown type name '__rvv_uint32mf2x6_t'} } */ +void f___rvv_int32mf2x7_t () {__rvv_int32mf2x7_t t;} /* { dg-error {unknown type name '__rvv_int32mf2x7_t'} } */ +void f___rvv_uint32mf2x7_t () {__rvv_uint32mf2x7_t t;} /* { dg-error {unknown type name '__rvv_uint32mf2x7_t'} } */ +void f___rvv_int32mf2x8_t () {__rvv_int32mf2x8_t t;} /* { dg-error {unknown type name '__rvv_int32mf2x8_t'} } */ +void f___rvv_uint32mf2x8_t () {__rvv_uint32mf2x8_t t;} /* { dg-error {unknown type name '__rvv_uint32mf2x8_t'} } */ void f___rvv_int32m1x2_t () {__rvv_int32m1x2_t t;} void f___rvv_uint32m1x2_t () {__rvv_uint32m1x2_t t;} void f___rvv_int32m1x3_t () {__rvv_int32m1x3_t t;} @@ -179,13 +179,13 @@ void f___rvv_float16m1_t () {__rvv_float16m1_t t;} /* { dg-error {unknown type n void f___rvv_float16m2_t () {__rvv_float16m2_t t;} /* { dg-error {unknown type name '__rvv_float16m2_t'} } */ void f___rvv_float16m4_t () {__rvv_float16m4_t t;} /* { dg-error {unknown type name '__rvv_float16m4_t'} } */ void f___rvv_float16m8_t () {__rvv_float16m8_t t;} /* { dg-error {unknown type name '__rvv_float16m8_t'} } */ -void f___rvv_float32mf2x2_t () {__rvv_float32mf2x2_t t;} -void f___rvv_float32mf2x3_t () {__rvv_float32mf2x3_t t;} -void f___rvv_float32mf2x4_t () {__rvv_float32mf2x4_t t;} -void f___rvv_float32mf2x5_t () {__rvv_float32mf2x5_t t;} -void f___rvv_float32mf2x6_t () {__rvv_float32mf2x6_t t;} -void f___rvv_float32mf2x7_t () {__rvv_float32mf2x7_t t;} -void f___rvv_float32mf2x8_t () {__rvv_float32mf2x8_t t;} +void f___rvv_float32mf2x2_t () {__rvv_float32mf2x2_t t;} /* { dg-error {unknown type name '__rvv_float32mf2x2_t'} } */ +void f___rvv_float32mf2x3_t () {__rvv_float32mf2x3_t t;} /* { dg-error {unknown type name '__rvv_float32mf2x3_t'} } */ +void f___rvv_float32mf2x4_t () {__rvv_float32mf2x4_t t;} /* { dg-error {unknown type name '__rvv_float32mf2x4_t'} } */ +void f___rvv_float32mf2x5_t () {__rvv_float32mf2x5_t t;} /* { dg-error {unknown type name '__rvv_float32mf2x5_t'} } */ +void f___rvv_float32mf2x6_t () {__rvv_float32mf2x6_t t;} /* { dg-error {unknown type name '__rvv_float32mf2x6_t'} } */ +void f___rvv_float32mf2x7_t () {__rvv_float32mf2x7_t t;} /* { dg-error {unknown type name '__rvv_float32mf2x7_t'} } */ +void f___rvv_float32mf2x8_t () {__rvv_float32mf2x8_t t;} /* { dg-error {unknown type name '__rvv_float32mf2x8_t'} } */ void f___rvv_float32m1x2_t () {__rvv_float32m1x2_t t;} void f___rvv_float32m1x3_t () {__rvv_float32m1x3_t t;} void f___rvv_float32m1x4_t () {__rvv_float32m1x4_t t;} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/abi-18.c b/gcc/testsuite/gcc.target/riscv/rvv/base/abi-18.c index 402e8f6..95b760f 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/base/abi-18.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/abi-18.c @@ -1,20 +1,20 @@ /* { dg-do compile } */ /* { dg-options "-O3 -march=rv32gc_zve32x_zvl64b_zvfhmin -mabi=ilp32d" } */ -void f___rvv_int8mf8x2_t () {__rvv_int8mf8x2_t t;} -void f___rvv_uint8mf8x2_t () {__rvv_uint8mf8x2_t t;} -void f___rvv_int8mf8x3_t () {__rvv_int8mf8x3_t t;} -void f___rvv_uint8mf8x3_t () {__rvv_uint8mf8x3_t t;} -void f___rvv_int8mf8x4_t () {__rvv_int8mf8x4_t t;} -void f___rvv_uint8mf8x4_t () {__rvv_uint8mf8x4_t t;} -void f___rvv_int8mf8x5_t () {__rvv_int8mf8x5_t t;} -void f___rvv_uint8mf8x5_t () {__rvv_uint8mf8x5_t t;} -void f___rvv_int8mf8x6_t () {__rvv_int8mf8x6_t t;} -void f___rvv_uint8mf8x6_t () {__rvv_uint8mf8x6_t t;} -void f___rvv_int8mf8x7_t () {__rvv_int8mf8x7_t t;} -void f___rvv_uint8mf8x7_t () {__rvv_uint8mf8x7_t t;} -void f___rvv_int8mf8x8_t () {__rvv_int8mf8x8_t t;} -void f___rvv_uint8mf8x8_t () {__rvv_uint8mf8x8_t t;} +void f___rvv_int8mf8x2_t () {__rvv_int8mf8x2_t t;} /* { dg-error {unknown type name '__rvv_int8mf8x2_t'} } */ +void f___rvv_uint8mf8x2_t () {__rvv_uint8mf8x2_t t;} /* { dg-error {unknown type name '__rvv_uint8mf8x2_t'} } */ +void f___rvv_int8mf8x3_t () {__rvv_int8mf8x3_t t;} /* { dg-error {unknown type name '__rvv_int8mf8x3_t'} } */ +void f___rvv_uint8mf8x3_t () {__rvv_uint8mf8x3_t t;} /* { dg-error {unknown type name '__rvv_uint8mf8x3_t'} } */ +void f___rvv_int8mf8x4_t () {__rvv_int8mf8x4_t t;} /* { dg-error {unknown type name '__rvv_int8mf8x4_t'} } */ +void f___rvv_uint8mf8x4_t () {__rvv_uint8mf8x4_t t;} /* { dg-error {unknown type name '__rvv_uint8mf8x4_t'} } */ +void f___rvv_int8mf8x5_t () {__rvv_int8mf8x5_t t;} /* { dg-error {unknown type name '__rvv_int8mf8x5_t'} } */ +void f___rvv_uint8mf8x5_t () {__rvv_uint8mf8x5_t t;} /* { dg-error {unknown type name '__rvv_uint8mf8x5_t'} } */ +void f___rvv_int8mf8x6_t () {__rvv_int8mf8x6_t t;} /* { dg-error {unknown type name '__rvv_int8mf8x6_t'} } */ +void f___rvv_uint8mf8x6_t () {__rvv_uint8mf8x6_t t;} /* { dg-error {unknown type name '__rvv_uint8mf8x6_t'} } */ +void f___rvv_int8mf8x7_t () {__rvv_int8mf8x7_t t;} /* { dg-error {unknown type name '__rvv_int8mf8x7_t'} } */ +void f___rvv_uint8mf8x7_t () {__rvv_uint8mf8x7_t t;} /* { dg-error {unknown type name '__rvv_uint8mf8x7_t'} } */ +void f___rvv_int8mf8x8_t () {__rvv_int8mf8x8_t t;} /* { dg-error {unknown type name '__rvv_int8mf8x8_t'} } */ +void f___rvv_uint8mf8x8_t () {__rvv_uint8mf8x8_t t;} /* { dg-error {unknown type name '__rvv_uint8mf8x8_t'} } */ void f___rvv_int8mf4x2_t () {__rvv_int8mf4x2_t t;} void f___rvv_uint8mf4x2_t () {__rvv_uint8mf4x2_t t;} void f___rvv_int8mf4x3_t () {__rvv_int8mf4x3_t t;} @@ -65,20 +65,20 @@ void f___rvv_int8m2x4_t () {__rvv_int8m2x4_t t;} void f___rvv_uint8m2x4_t () {__rvv_uint8m2x4_t t;} void f___rvv_int8m4x2_t () {__rvv_int8m4x2_t t;} void f___rvv_uint8m4x2_t () {__rvv_uint8m4x2_t t;} -void f___rvv_int16mf4x2_t () {__rvv_int16mf4x2_t t;} -void f___rvv_uint16mf4x2_t () {__rvv_uint16mf4x2_t t;} -void f___rvv_int16mf4x3_t () {__rvv_int16mf4x3_t t;} -void f___rvv_uint16mf4x3_t () {__rvv_uint16mf4x3_t t;} -void f___rvv_int16mf4x4_t () {__rvv_int16mf4x4_t t;} -void f___rvv_uint16mf4x4_t () {__rvv_uint16mf4x4_t t;} -void f___rvv_int16mf4x5_t () {__rvv_int16mf4x5_t t;} -void f___rvv_uint16mf4x5_t () {__rvv_uint16mf4x5_t t;} -void f___rvv_int16mf4x6_t () {__rvv_int16mf4x6_t t;} -void f___rvv_uint16mf4x6_t () {__rvv_uint16mf4x6_t t;} -void f___rvv_int16mf4x7_t () {__rvv_int16mf4x7_t t;} -void f___rvv_uint16mf4x7_t () {__rvv_uint16mf4x7_t t;} -void f___rvv_int16mf4x8_t () {__rvv_int16mf4x8_t t;} -void f___rvv_uint16mf4x8_t () {__rvv_uint16mf4x8_t t;} +void f___rvv_int16mf4x2_t () {__rvv_int16mf4x2_t t;} /* { dg-error {unknown type name '__rvv_int16mf4x2_t'} } */ +void f___rvv_uint16mf4x2_t () {__rvv_uint16mf4x2_t t;} /* { dg-error {unknown type name '__rvv_uint16mf4x2_t'} } */ +void f___rvv_int16mf4x3_t () {__rvv_int16mf4x3_t t;} /* { dg-error {unknown type name '__rvv_int16mf4x3_t'} } */ +void f___rvv_uint16mf4x3_t () {__rvv_uint16mf4x3_t t;} /* { dg-error {unknown type name '__rvv_uint16mf4x3_t'} } */ +void f___rvv_int16mf4x4_t () {__rvv_int16mf4x4_t t;} /* { dg-error {unknown type name '__rvv_int16mf4x4_t'} } */ +void f___rvv_uint16mf4x4_t () {__rvv_uint16mf4x4_t t;} /* { dg-error {unknown type name '__rvv_uint16mf4x4_t'} } */ +void f___rvv_int16mf4x5_t () {__rvv_int16mf4x5_t t;} /* { dg-error {unknown type name '__rvv_int16mf4x5_t'} } */ +void f___rvv_uint16mf4x5_t () {__rvv_uint16mf4x5_t t;} /* { dg-error {unknown type name '__rvv_uint16mf4x5_t'} } */ +void f___rvv_int16mf4x6_t () {__rvv_int16mf4x6_t t;} /* { dg-error {unknown type name '__rvv_int16mf4x6_t'} } */ +void f___rvv_uint16mf4x6_t () {__rvv_uint16mf4x6_t t;} /* { dg-error {unknown type name '__rvv_uint16mf4x6_t'} } */ +void f___rvv_int16mf4x7_t () {__rvv_int16mf4x7_t t;} /* { dg-error {unknown type name '__rvv_int16mf4x7_t'} } */ +void f___rvv_uint16mf4x7_t () {__rvv_uint16mf4x7_t t;} /* { dg-error {unknown type name '__rvv_uint16mf4x7_t'} } */ +void f___rvv_int16mf4x8_t () {__rvv_int16mf4x8_t t;} /* { dg-error {unknown type name '__rvv_int16mf4x8_t'} } */ +void f___rvv_uint16mf4x8_t () {__rvv_uint16mf4x8_t t;} /* { dg-error {unknown type name '__rvv_uint16mf4x8_t'} } */ void f___rvv_int16mf2x2_t () {__rvv_int16mf2x2_t t;} void f___rvv_uint16mf2x2_t () {__rvv_uint16mf2x2_t t;} void f___rvv_int16mf2x3_t () {__rvv_int16mf2x3_t t;} @@ -115,20 +115,20 @@ void f___rvv_int16m2x4_t () {__rvv_int16m2x4_t t;} void f___rvv_uint16m2x4_t () {__rvv_uint16m2x4_t t;} void f___rvv_int16m4x2_t () {__rvv_int16m4x2_t t;} void f___rvv_uint16m4x2_t () {__rvv_uint16m4x2_t t;} -void f___rvv_int32mf2x2_t () {__rvv_int32mf2x2_t t;} -void f___rvv_uint32mf2x2_t () {__rvv_uint32mf2x2_t t;} -void f___rvv_int32mf2x3_t () {__rvv_int32mf2x3_t t;} -void f___rvv_uint32mf2x3_t () {__rvv_uint32mf2x3_t t;} -void f___rvv_int32mf2x4_t () {__rvv_int32mf2x4_t t;} -void f___rvv_uint32mf2x4_t () {__rvv_uint32mf2x4_t t;} -void f___rvv_int32mf2x5_t () {__rvv_int32mf2x5_t t;} -void f___rvv_uint32mf2x5_t () {__rvv_uint32mf2x5_t t;} -void f___rvv_int32mf2x6_t () {__rvv_int32mf2x6_t t;} -void f___rvv_uint32mf2x6_t () {__rvv_uint32mf2x6_t t;} -void f___rvv_int32mf2x7_t () {__rvv_int32mf2x7_t t;} -void f___rvv_uint32mf2x7_t () {__rvv_uint32mf2x7_t t;} -void f___rvv_int32mf2x8_t () {__rvv_int32mf2x8_t t;} -void f___rvv_uint32mf2x8_t () {__rvv_uint32mf2x8_t t;} +void f___rvv_int32mf2x2_t () {__rvv_int32mf2x2_t t;} /* { dg-error {unknown type name '__rvv_int32mf2x2_t'} } */ +void f___rvv_uint32mf2x2_t () {__rvv_uint32mf2x2_t t;} /* { dg-error {unknown type name '__rvv_uint32mf2x2_t'} } */ +void f___rvv_int32mf2x3_t () {__rvv_int32mf2x3_t t;} /* { dg-error {unknown type name '__rvv_int32mf2x3_t'} } */ +void f___rvv_uint32mf2x3_t () {__rvv_uint32mf2x3_t t;} /* { dg-error {unknown type name '__rvv_uint32mf2x3_t'} } */ +void f___rvv_int32mf2x4_t () {__rvv_int32mf2x4_t t;} /* { dg-error {unknown type name '__rvv_int32mf2x4_t'} } */ +void f___rvv_uint32mf2x4_t () {__rvv_uint32mf2x4_t t;} /* { dg-error {unknown type name '__rvv_uint32mf2x4_t'} } */ +void f___rvv_int32mf2x5_t () {__rvv_int32mf2x5_t t;} /* { dg-error {unknown type name '__rvv_int32mf2x5_t'} } */ +void f___rvv_uint32mf2x5_t () {__rvv_uint32mf2x5_t t;} /* { dg-error {unknown type name '__rvv_uint32mf2x5_t'} } */ +void f___rvv_int32mf2x6_t () {__rvv_int32mf2x6_t t;} /* { dg-error {unknown type name '__rvv_int32mf2x6_t'} } */ +void f___rvv_uint32mf2x6_t () {__rvv_uint32mf2x6_t t;} /* { dg-error {unknown type name '__rvv_uint32mf2x6_t'} } */ +void f___rvv_int32mf2x7_t () {__rvv_int32mf2x7_t t;} /* { dg-error {unknown type name '__rvv_int32mf2x7_t'} } */ +void f___rvv_uint32mf2x7_t () {__rvv_uint32mf2x7_t t;} /* { dg-error {unknown type name '__rvv_uint32mf2x7_t'} } */ +void f___rvv_int32mf2x8_t () {__rvv_int32mf2x8_t t;} /* { dg-error {unknown type name '__rvv_int32mf2x8_t'} } */ +void f___rvv_uint32mf2x8_t () {__rvv_uint32mf2x8_t t;} /* { dg-error {unknown type name '__rvv_uint32mf2x8_t'} } */ void f___rvv_int32m1x2_t () {__rvv_int32m1x2_t t;} void f___rvv_uint32m1x2_t () {__rvv_uint32m1x2_t t;} void f___rvv_int32m1x3_t () {__rvv_int32m1x3_t t;} @@ -173,13 +173,13 @@ void f___rvv_int64m2x4_t () {__rvv_int64m2x4_t t;} /* { dg-error {unknown type n void f___rvv_uint64m2x4_t () {__rvv_uint64m2x4_t t;} /* { dg-error {unknown type name '__rvv_uint64m2x4_t'} } */ void f___rvv_int64m4x2_t () {__rvv_int64m4x2_t t;} /* { dg-error {unknown type name '__rvv_int64m4x2_t'} } */ void f___rvv_uint64m4x2_t () {__rvv_uint64m4x2_t t;} /* { dg-error {unknown type name '__rvv_uint64m4x2_t'} } */ -void f___rvv_float16mf4x2_t () {__rvv_float16mf4x2_t t;} -void f___rvv_float16mf4x3_t () {__rvv_float16mf4x3_t t;} -void f___rvv_float16mf4x4_t () {__rvv_float16mf4x4_t t;} -void f___rvv_float16mf4x5_t () {__rvv_float16mf4x5_t t;} -void f___rvv_float16mf4x6_t () {__rvv_float16mf4x6_t t;} -void f___rvv_float16mf4x7_t () {__rvv_float16mf4x7_t t;} -void f___rvv_float16mf4x8_t () {__rvv_float16mf4x8_t t;} +void f___rvv_float16mf4x2_t () {__rvv_float16mf4x2_t t;} /* { dg-error {unknown type name '__rvv_float16mf4x2_t'} } */ +void f___rvv_float16mf4x3_t () {__rvv_float16mf4x3_t t;} /* { dg-error {unknown type name '__rvv_float16mf4x3_t'} } */ +void f___rvv_float16mf4x4_t () {__rvv_float16mf4x4_t t;} /* { dg-error {unknown type name '__rvv_float16mf4x4_t'} } */ +void f___rvv_float16mf4x5_t () {__rvv_float16mf4x5_t t;} /* { dg-error {unknown type name '__rvv_float16mf4x5_t'} } */ +void f___rvv_float16mf4x6_t () {__rvv_float16mf4x6_t t;} /* { dg-error {unknown type name '__rvv_float16mf4x6_t'} } */ +void f___rvv_float16mf4x7_t () {__rvv_float16mf4x7_t t;} /* { dg-error {unknown type name '__rvv_float16mf4x7_t'} } */ +void f___rvv_float16mf4x8_t () {__rvv_float16mf4x8_t t;} /* { dg-error {unknown type name '__rvv_float16mf4x8_t'} } */ void f___rvv_float16mf2x2_t () {__rvv_float16mf2x2_t t;} void f___rvv_float16mf2x3_t () {__rvv_float16mf2x3_t t;} void f___rvv_float16mf2x4_t () {__rvv_float16mf2x4_t t;} @@ -198,13 +198,13 @@ void f___rvv_float16m2x2_t () {__rvv_float16m2x2_t t;} void f___rvv_float16m2x3_t () {__rvv_float16m2x3_t t;} void f___rvv_float16m2x4_t () {__rvv_float16m2x4_t t;} void f___rvv_float16m4x2_t () {__rvv_float16m4x2_t t;} -void f___rvv_float32mf2x2_t () {__rvv_float32mf2x2_t t;} -void f___rvv_float32mf2x3_t () {__rvv_float32mf2x3_t t;} -void f___rvv_float32mf2x4_t () {__rvv_float32mf2x4_t t;} -void f___rvv_float32mf2x5_t () {__rvv_float32mf2x5_t t;} -void f___rvv_float32mf2x6_t () {__rvv_float32mf2x6_t t;} -void f___rvv_float32mf2x7_t () {__rvv_float32mf2x7_t t;} -void f___rvv_float32mf2x8_t () {__rvv_float32mf2x8_t t;} +void f___rvv_float32mf2x2_t () {__rvv_float32mf2x2_t t;} /* { dg-error {unknown type name '__rvv_float32mf2x2_t'} } */ +void f___rvv_float32mf2x3_t () {__rvv_float32mf2x3_t t;} /* { dg-error {unknown type name '__rvv_float32mf2x3_t'} } */ +void f___rvv_float32mf2x4_t () {__rvv_float32mf2x4_t t;} /* { dg-error {unknown type name '__rvv_float32mf2x4_t'} } */ +void f___rvv_float32mf2x5_t () {__rvv_float32mf2x5_t t;} /* { dg-error {unknown type name '__rvv_float32mf2x5_t'} } */ +void f___rvv_float32mf2x6_t () {__rvv_float32mf2x6_t t;} /* { dg-error {unknown type name '__rvv_float32mf2x6_t'} } */ +void f___rvv_float32mf2x7_t () {__rvv_float32mf2x7_t t;} /* { dg-error {unknown type name '__rvv_float32mf2x7_t'} } */ +void f___rvv_float32mf2x8_t () {__rvv_float32mf2x8_t t;} /* { dg-error {unknown type name '__rvv_float32mf2x8_t'} } */ void f___rvv_float32m1x2_t () {__rvv_float32m1x2_t t;} void f___rvv_float32m1x3_t () {__rvv_float32m1x3_t t;} void f___rvv_float32m1x4_t () {__rvv_float32m1x4_t t;} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/vsetvl_zve32-1.c b/gcc/testsuite/gcc.target/riscv/rvv/base/vsetvl_zve32-1.c new file mode 100644 index 0000000..f6899c3 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/vsetvl_zve32-1.c @@ -0,0 +1,73 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32imafc_zve32f_zvl128b -mabi=ilp32 -O2" } */ + +struct S0 +{ + unsigned a : 15; + int b; + int c; +}; + +struct S1 +{ + struct S0 s0; + int e; +}; + +struct Z +{ + char c; + int z; +} __attribute__((packed)); + +union U +{ + struct S1 s1; + struct Z z; +}; + +int __attribute__((noinline, noclone)) +return_zero (void) +{ + return 0; +} + +volatile union U gu; +struct S0 gs; + +int __attribute__((noinline, noclone)) +check_outcome () +{ + if (gs.a != 6 + || gs.b != 80000) + __builtin_abort (); +} + +int +main (int argc, char *argv[]) +{ + union U u; + struct S1 m; + struct S0 l; + + if (return_zero ()) + u.z.z = 20000; + else + { + u.s1.s0.a = 6; + u.s1.s0.b = 80000; + u.s1.e = 2; + + m = u.s1; + m.s0.c = 0; + l = m.s0; + gs = l; + } + + gu = u; + check_outcome (); + return 0; +} + +/* { dg-final { scan-assembler {vsetivli\s+zero,\s*2,\s*e32,\s*m1,\s*t[au],\s*m[au]} } } */ +/* { dg-final { scan-assembler {vsetivli\s+zero,\s*4,\s*e32,\s*m1,\s*t[au],\s*m[au]} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/vsetvl_zve32-2.c b/gcc/testsuite/gcc.target/riscv/rvv/base/vsetvl_zve32-2.c new file mode 100644 index 0000000..dd81f8b --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/vsetvl_zve32-2.c @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g_zve32x_zvl128b -mabi=lp64d -O3" } */ +/* { dg-final { check-function-bodies "**" "" } } */ + +typedef unsigned int V2SI __attribute__((vector_size(8))); + +V2SI v1, v2; + +/* Make sure we won't use mf2 mode even vector register is OK to hold for + ELEN=32. */ +void foo1() +{ +/* +** foo1: +** ... +** vsetivli zero,2,e32,m1,ta,ma +** ... +** vle32\.v v[0-9]+,0\([a-x][0-9]+\) +** ... +** vse32\.v v[0-9]+,0\([a-x][0-9]+\) +** ... +** ret +*/ + v1 = v2; +} diff --git a/gcc/testsuite/gcc.target/s390/target-attribute/tattr-1.c b/gcc/testsuite/gcc.target/s390/target-attribute/tattr-1.c index ff57344..7344af3 100644 --- a/gcc/testsuite/gcc.target/s390/target-attribute/tattr-1.c +++ b/gcc/testsuite/gcc.target/s390/target-attribute/tattr-1.c @@ -1,6 +1,6 @@ /* Functional tests for the "target" attribute and pragma. */ -/* { dg-do compile */ +/* { dg-do compile } */ /* { dg-require-effective-target target_attribute } */ /* { dg-options "-O3 -march=zEC12 -mzarch" } */ diff --git a/gcc/testsuite/gcc.target/s390/target-attribute/tattr-2.c b/gcc/testsuite/gcc.target/s390/target-attribute/tattr-2.c index 739c2ea..3a6e4bb 100644 --- a/gcc/testsuite/gcc.target/s390/target-attribute/tattr-2.c +++ b/gcc/testsuite/gcc.target/s390/target-attribute/tattr-2.c @@ -1,6 +1,6 @@ /* Functional tests for the "target" attribute and pragma. */ -/* { dg-do compile */ +/* { dg-do compile } */ /* { dg-require-effective-target target_attribute } */ /* { dg-options "-O3 -march=zEC12 -mno-htm -fno-ipa-icf" } */ diff --git a/gcc/testsuite/gdc.dg/torture/pr117002.d b/gcc/testsuite/gdc.dg/torture/pr117002.d new file mode 100644 index 0000000..5b8c19e --- /dev/null +++ b/gcc/testsuite/gdc.dg/torture/pr117002.d @@ -0,0 +1,28 @@ +// { dg-do compile } +// { dg-additional-options "-Warray-bounds" } +extern(C++) class C117002 +{ + ubyte[4] not_multiple_of_8; +} + +int pr117002a(void *p) +{ + auto init = __traits(initSymbol, C117002); + if (init.ptr + init.length <= p) + return 1; + return 0; +} + +void pr117002b(void *p) +{ + auto init = __traits(initSymbol, C117002); + p[0 .. init.length] = init[]; +} + +void pr117002c() +{ + scope var = new C117002; + void *p = cast(void*)var; + auto init = __traits(initSymbol, C117002); + p[0 .. __traits(classInstanceSize, C117002)] = init[]; +} diff --git a/gcc/testsuite/gfortran.dg/associate_70.f90 b/gcc/testsuite/gfortran.dg/associate_70.f90 index ddb38b8..6f8f5d6a 100644 --- a/gcc/testsuite/gfortran.dg/associate_70.f90 +++ b/gcc/testsuite/gfortran.dg/associate_70.f90 @@ -1,5 +1,5 @@ ! { dg-do run } -! ( dg-options "-Wuninitialized" ) +! { dg-options "-Wuninitialized" } ! ! Test fix for PR115700 comment 5, in which ‘.tmp1’ is used uninitialized and ! both normal and scalarized array references did not work correctly. diff --git a/gcc/testsuite/gfortran.dg/assumed_charlen_in_main.f90 b/gcc/testsuite/gfortran.dg/assumed_charlen_in_main.f90 index f4bb701..695a580 100644 --- a/gcc/testsuite/gfortran.dg/assumed_charlen_in_main.f90 +++ b/gcc/testsuite/gfortran.dg/assumed_charlen_in_main.f90 @@ -20,7 +20,7 @@ end subroutine poobar program test character(len=*), parameter :: foo = 'test' ! Parameters must work. character(len=4) :: bar = foo - character(len=*) :: foobar = 'This should fail' ! { dg-error "must be a dummy" } + character(len=*) :: foobar = 'This should fail' ! { dg-error "must be a dummy" } print *, bar call poobar () end diff --git a/gcc/testsuite/gfortran.dg/bessel_3.f90 b/gcc/testsuite/gfortran.dg/bessel_3.f90 index 51e11e9..4191d24 100644 --- a/gcc/testsuite/gfortran.dg/bessel_3.f90 +++ b/gcc/testsuite/gfortran.dg/bessel_3.f90 @@ -6,7 +6,7 @@ ! IMPLICIT NONE print *, SIN (1.0) -print *, BESSEL_J0(1.0) ! { dg-error "has no IMPLICIT type" }) +print *, BESSEL_J0(1.0) ! { dg-error "has no IMPLICIT type" } print *, BESSEL_J1(1.0) ! { dg-error "has no IMPLICIT type" } print *, BESSEL_JN(1,1.0) ! { dg-error "has no IMPLICIT type|Type mismatch" } print *, BESSEL_JN(1,2,1.0) ! { dg-error "has no IMPLICIT type|Type mismatch|More actual than formal" } diff --git a/gcc/testsuite/gfortran.dg/c_funloc_tests_6.f90 b/gcc/testsuite/gfortran.dg/c_funloc_tests_6.f90 index 45d0955..d8c8039 100644 --- a/gcc/testsuite/gfortran.dg/c_funloc_tests_6.f90 +++ b/gcc/testsuite/gfortran.dg/c_funloc_tests_6.f90 @@ -20,7 +20,7 @@ procedure(sub), pointer :: fsub integer, external :: noCsub procedure(integer), pointer :: fint -cp = c_funloc (sub) ! { dg-error "Cannot convert TYPE.c_funptr. to TYPE.c_ptr." }) +cp = c_funloc (sub) ! { dg-error "Cannot convert TYPE.c_funptr. to TYPE.c_ptr." } cfp = c_loc (int) ! { dg-error "Cannot convert TYPE.c_ptr. to TYPE.c_funptr." } call c_f_pointer (cfp, int) ! { dg-error "Argument CPTR at .1. to C_F_POINTER shall have the type TYPE.C_PTR." } diff --git a/gcc/testsuite/gfortran.dg/cray_pointers_2.f90 b/gcc/testsuite/gfortran.dg/cray_pointers_2.f90 index 4351874..e646fc8 100644 --- a/gcc/testsuite/gfortran.dg/cray_pointers_2.f90 +++ b/gcc/testsuite/gfortran.dg/cray_pointers_2.f90 @@ -1,6 +1,4 @@ -! Using two spaces between dg-do and run is a hack to keep gfortran-dg-runtest -! from cycling through optimization options for this expensive test. -! { dg-do run } +! { dg-do run } ! { dg-options "-O3 -fcray-pointer -fbounds-check -fno-inline" } ! { dg-timeout-factor 4 } ! diff --git a/gcc/testsuite/gfortran.dg/derived_result_4.f90 b/gcc/testsuite/gfortran.dg/derived_result_4.f90 new file mode 100644 index 0000000..12ab190 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/derived_result_4.f90 @@ -0,0 +1,38 @@ +! { dg-do compile } +! { dg-additional-options "-Wall -Wno-return-type -Wno-unused-variable" } +! +! PR fortran/118796 - bogus recursion with DT default initialization + +module m1 + implicit none + + type :: t1 + type(integer) :: f1 = 0 + end type t1 + + TYPE :: c1 + contains + procedure, public :: z + END TYPE c1 + +contains + ! type-bound procedure z has a default initialization + function z( this ) + type(t1) :: z + class(c1), intent(in) :: this + end function z +end module m1 + +module m2 + use m1, only : c1 +contains + function z() result(field) + end function z +end module m2 + +module m3 + use m1, only : c1 +contains + function z() + end function z +end module m3 diff --git a/gcc/testsuite/gfortran.dg/parity_2.f90 b/gcc/testsuite/gfortran.dg/parity_2.f90 index 5ff11da..9a8e035 100644 --- a/gcc/testsuite/gfortran.dg/parity_2.f90 +++ b/gcc/testsuite/gfortran.dg/parity_2.f90 @@ -6,7 +6,7 @@ ! Check implementation of PARITY ! implicit none -print *, parity([real ::]) ! { dg-error "must be LOGICAL" }) +print *, parity([real ::]) ! { dg-error "must be LOGICAL" } print *, parity([integer ::]) ! { dg-error "must be LOGICAL" } print *, parity([logical ::]) print *, parity(.true.) ! { dg-error "must be an array" } diff --git a/gcc/testsuite/gm2/iso/fail/conststrarray2.mod b/gcc/testsuite/gm2/iso/fail/conststrarray2.mod new file mode 100644 index 0000000..ab101d4 --- /dev/null +++ b/gcc/testsuite/gm2/iso/fail/conststrarray2.mod @@ -0,0 +1,30 @@ +MODULE conststrarray2 ; + +FROM libc IMPORT printf, exit ; + +CONST + HelloWorld = Hello + " " + World ; + Hello = "Hello" ; + World = "World" ; + + +(* + Assert - +*) + +PROCEDURE Assert (result: BOOLEAN) ; +BEGIN + IF NOT result + THEN + printf ("assertion failed\n") ; + exit (1) + END +END Assert ; + + +VAR + ch: CHAR ; +BEGIN + ch := HelloWorld[4] ; + Assert (ch = 'o') +END conststrarray2. diff --git a/gcc/testsuite/gm2/iso/run/pass/constarray2.mod b/gcc/testsuite/gm2/iso/run/pass/constarray2.mod new file mode 100644 index 0000000..19beb6f --- /dev/null +++ b/gcc/testsuite/gm2/iso/run/pass/constarray2.mod @@ -0,0 +1,33 @@ +MODULE constarray2 ; + +FROM libc IMPORT printf, exit ; + +TYPE + arraytype = ARRAY [0..11] OF CHAR ; + +CONST + Hello = "Hello" ; + World = "World" ; + HelloWorld = arraytype {Hello + " " + World} ; + + +(* + Assert - +*) + +PROCEDURE Assert (result: BOOLEAN) ; +BEGIN + IF NOT result + THEN + printf ("assertion failed\n") ; + exit (1) + END +END Assert ; + + +VAR + ch: CHAR ; +BEGIN + ch := HelloWorld[4] ; + Assert (ch = 'o') +END constarray2. diff --git a/gcc/testsuite/gm2/pim/pass/hexstring.mod b/gcc/testsuite/gm2/pim/pass/hexstring.mod new file mode 100644 index 0000000..9299282 --- /dev/null +++ b/gcc/testsuite/gm2/pim/pass/hexstring.mod @@ -0,0 +1,16 @@ +MODULE hexstring ; + +CONST + HexDigits = "0123456789ABCDEF" ; + +TYPE + ArrayType = ARRAY [0..HIGH (HexDigits)] OF CHAR ; + +CONST + HexArray = ArrayType { HexDigits } ; + +VAR + four: CHAR ; +BEGIN + four := HexArray[4] +END hexstring. diff --git a/gcc/testsuite/gnat.dg/sso/q11.adb b/gcc/testsuite/gnat.dg/sso/q11.adb index 22ac557..39853ef 100644 --- a/gcc/testsuite/gnat.dg/sso/q11.adb +++ b/gcc/testsuite/gnat.dg/sso/q11.adb @@ -31,7 +31,7 @@ begin Put ("B2 :"); Dump (B2'Address, R2'Max_Size_In_Storage_Elements); New_Line; - -- { dg-output "B2 : 12 34 56 78 00 ab 00 12 00 cd 00 34 00 ef 00 56.*\n"} + -- { dg-output "B2 : 12 34 56 78 00 ab 00 12 00 cd 00 34 00 ef 00 56.*\n" } if A1.I /= B1.I or A1.A(1) /= B1.A(1) then raise Program_Error; diff --git a/gcc/testsuite/lib/gcov.exp b/gcc/testsuite/lib/gcov.exp index c1aceec..ae42c39 100644 --- a/gcc/testsuite/lib/gcov.exp +++ b/gcc/testsuite/lib/gcov.exp @@ -537,6 +537,112 @@ proc verify-filters { testname testcase file expected unexpected } { return [expr [llength $ex] + [llength $unex]] } +proc verify-prime-paths { testname testcase file } { + set failed 0 + set fd [open $file r] + + set expected_n -1 + set expected_m -1 + set recording 0 + set expected "" + + while { [gets $fd line] >= 0 } { + regexp "^\[^:\]+: *(\[0-9\]+):" "$line" all lineno + set prefix "$testname line $lineno" + + if {[regexp "BEGIN *paths" $line]} { + set recording 1 + set expected "" + set expected_covered "" + set expected_n -1 + set expected_m -1 + set seen "" + continue + } + + if { $recording != 1 } { + continue + } + + if [regexp {summary: *(\d+)/(\d+)} $line _ n m] { + set expected_n $n + set expected_m $m + } + + if [regexp "expect: *(.*)" $line all ln] { + set cases "" + set ln [regsub -all {\s+} $ln " "] + foreach case [split $ln " "] { + lappend cases $case + } + lappend expected $cases + } + + if [regexp "expect covered: *(.*)" $line all ln] { + set cases "" + set ln [regsub -all {\s+} $ln " "] + foreach case [split $ln " "] { + lappend cases $case + } + lappend expected_covered $cases + } + + if [regexp "END" $line] { + if {$recording != 1} { + incr failed + fail "unexpected END at line $lineno, missing BEGIN" + + # Abort the test if there is a mismatch, to avoid creating + # unecessary errors. At this point the test itself is broken. + break + } + set recording 0 + + if {[llength $expected] > 0} { + incr failed + fail "expected: '$expected'" + } + + if {[llength $expected_covered] > 0} { + incr failed + fail "expected covered: '$expected_covered'" + } + } + + if [regexp {paths covered (\d+) of (\d+)} $line _ n m] { + if { $n ne $expected_n || $m ne $expected_m } { + incr failed + fail "$prefix: expected $expected_n/$expected_m covered paths, was $n/$m" + } + } + + if [regexp {path *\d+ not covered: lines (.*)} $line _ path] { + set pathl "" + foreach ln [split $path " "] { + if [regexp {\s*(.*)\s*} $ln _ key] { + lappend pathl $key + } + } + set i [lsearch $expected $pathl] + set expected [lreplace $expected $i $i] + } + + if [regexp {path *\d+ covered: lines (.*)} $line _ path] { + set pathl "" + foreach ln [split $path " "] { + if [regexp {\s*(.*)\s*} $ln _ key] { + lappend pathl $key + } + } + set i [lsearch $expected_covered $pathl] + set expected_covered [lreplace $expected_covered $i $i] + } + } + + close $fd + return $failed +} + proc gcov-pytest-format-line { args } { global subdir @@ -610,6 +716,7 @@ proc run-gcov { args } { set gcov_verify_calls 0 set gcov_verify_branches 0 set gcov_verify_conditions 0 + set gcov_verify_prime_paths 0 set gcov_verify_lines 1 set gcov_verify_intermediate 0 set gcov_verify_filters 0 @@ -627,6 +734,8 @@ proc run-gcov { args } { set gcov_verify_filters 1 set verify_filters_expected [lindex $a 1] set verify_filters_unexpected [lindex $a 2] + } elseif { $a == "prime-paths" } { + set gcov_verify_prime_paths 1 } elseif { $a == "intermediate" } { set gcov_verify_intermediate 1 set gcov_verify_calls 0 @@ -707,6 +816,11 @@ proc run-gcov { args } { } else { set cdfailed 0 } + if { $gcov_verify_prime_paths } { + set ppfailed [verify-prime-paths $testname $testcase $testcase.gcov] + } else { + set ppfailed 0 + } if { $gcov_verify_calls } { set cfailed [verify-calls $testname $testcase $testcase.gcov] } else { @@ -726,12 +840,12 @@ proc run-gcov { args } { # Report whether the gcov test passed or failed. If there were # multiple failures then the message is a summary. - set tfailed [expr $lfailed + $bfailed + $cdfailed + $cfailed + $ifailed + $ffailed] + set tfailed [expr $lfailed + $bfailed + $cdfailed + $ppfailed + $cfailed + $ifailed + $ffailed] if { $xfailed } { setup_xfail "*-*-*" } if { $tfailed > 0 } { - fail "$testname gcov: $lfailed failures in line counts, $bfailed in branch percentages, $cdfailed in condition/decision, $cfailed in return percentages, $ifailed in intermediate format, $ffailed failed in filters" + fail "$testname gcov: $lfailed failures in line counts, $bfailed in branch percentages, $cdfailed in condition/decision, $ppfailed in prime-paths, $cfailed in return percentages, $ifailed in intermediate format, $ffailed failed in filters" if { $xfailed } { clean-gcov $testcase } diff --git a/gcc/testsuite/lib/gfortran-dg.exp b/gcc/testsuite/lib/gfortran-dg.exp index a516bab..4abf2fe 100644 --- a/gcc/testsuite/lib/gfortran-dg.exp +++ b/gcc/testsuite/lib/gfortran-dg.exp @@ -149,7 +149,13 @@ proc gfortran-dg-runtest { testcases flags default-extra-flags } { # look if this is dg-do run test, in which case # we cycle through the option list, otherwise we don't if [expr [search_for $test "dg-do run"]] { - set option_list $torture_with_loops + if { [ expr [search_for $test "dg-options*\[ \t\"\{]-O"] ] \ + || [ expr [search_for $test \ + "dg-additional-options*\[ \t\"\{]-O"] ] } { + set option_list [list { -O } ] + } else { + set option_list $torture_with_loops + } } else { set option_list [list { -O } ] } diff --git a/gcc/testsuite/lib/multiline.exp b/gcc/testsuite/lib/multiline.exp index 22b5e0e..08fd969 100644 --- a/gcc/testsuite/lib/multiline.exp +++ b/gcc/testsuite/lib/multiline.exp @@ -17,7 +17,7 @@ # Testing of multiline output # We have pre-existing testcases like this: -# |typedef struct _GMutex GMutex; // { dg-message "previously declared here"} +# |typedef struct _GMutex GMutex; // { dg-message "previously declared here" } # (using "|" here to indicate the start of a line), # generating output like this: # |gcc/testsuite/g++.dg/diagnostic/wrong-tag-1.C:4:16: note: 'struct _GMutex' was previously declared here @@ -27,7 +27,7 @@ # To handle rich error-reporting, we want to be able to verify that we # get output like this: # |gcc/testsuite/g++.dg/diagnostic/wrong-tag-1.C:4:16: note: 'struct _GMutex' was previously declared here -# | typedef struct _GMutex GMutex; // { dg-message "previously declared here"} +# | typedef struct _GMutex GMutex; // { dg-message "previously declared here" } # | ^~~~~~~ # where the compiler's first line of output is as before, but in # which it then echoes the source lines, adding annotations. diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index e90c090..ee4138a 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -2078,7 +2078,7 @@ proc check_effective_target_riscv_zvfh { } { # Return 1 if the target arch supports half float, 0 otherwise. # Note, this differs from the test performed by -# /* dg-skip-if "" { *-*-* } { "*" } { "-march=rv*zfh*" } */ +# /* { dg-skip-if "" { *-*-* } { "*" } { "-march=rv*zfh*" } } */ # in that it takes default behaviour into account. # Cache the result. diff --git a/gcc/testsuite/rust/compile/cfg-core1.rs b/gcc/testsuite/rust/compile/cfg-core1.rs new file mode 100644 index 0000000..7780cc9 --- /dev/null +++ b/gcc/testsuite/rust/compile/cfg-core1.rs @@ -0,0 +1,12 @@ +// { dg-additional-options "-frust-cfg=A -frust-cfg=B" } + +#[cfg_attr(A, cfg(B))] +struct Foo0; + +#[cfg_attr(A, cfg(C))] +struct Bar0; + +fn main() { + let a = Foo0; + let a = Bar0; // { dg-error "cannot find value" } +} diff --git a/gcc/testsuite/rust/compile/cfg-core2.rs b/gcc/testsuite/rust/compile/cfg-core2.rs new file mode 100644 index 0000000..e346edd --- /dev/null +++ b/gcc/testsuite/rust/compile/cfg-core2.rs @@ -0,0 +1,12 @@ +// { dg-additional-options "-frust-cfg=B" } + +#[cfg(not(any(A, B)))] +struct Foo0; + +#[cfg(not(any(A, C)))] +struct Bar0; + +fn main() { + let a = Foo0; // { dg-error "cannot find value" } + let a = Bar0; +} diff --git a/gcc/testsuite/rust/compile/const_generics_3.rs b/gcc/testsuite/rust/compile/const_generics_3.rs index e4e9008..524d48d 100644 --- a/gcc/testsuite/rust/compile/const_generics_3.rs +++ b/gcc/testsuite/rust/compile/const_generics_3.rs @@ -1,10 +1,12 @@ -// { dg-additional-options "-w" } +// { dg-additional-options "-w -frust-name-resolution-2.0" } + +#[lang = "sized"] +trait Sized {} const M: usize = 4; struct Foo<T, const N: usize = 1> { - // FIXME: This error is bogus. But having it means parsing is valid! - value: [i32; N], // { dg-error "cannot find value .N. in this scope" } + value: [T; N], } fn main() { diff --git a/gcc/testsuite/rust/compile/feature_rust_attri0.rs b/gcc/testsuite/rust/compile/feature_rust_attri0.rs index 9c11f56..1937acf 100644 --- a/gcc/testsuite/rust/compile/feature_rust_attri0.rs +++ b/gcc/testsuite/rust/compile/feature_rust_attri0.rs @@ -1,3 +1,7 @@ +extern "C" { + fn printf(s: *const i8, ...); +} + #[rustc_builtin_macro] //{ dg-error "internal implementation detail. " "" { target *-*-* } } macro_rules! line { () => {{}}; @@ -5,7 +9,7 @@ macro_rules! line { fn main() -> i32 { let a = line!(); - print(a); + printf("%d\0" as *const str as *const i8, a); 0 } diff --git a/gcc/testsuite/rust/compile/for-loop1.rs b/gcc/testsuite/rust/compile/for-loop1.rs index 1023ecd..21e0399 100644 --- a/gcc/testsuite/rust/compile/for-loop1.rs +++ b/gcc/testsuite/rust/compile/for-loop1.rs @@ -102,30 +102,30 @@ mod ptr { #[lang = "const_ptr"] impl<T> *const T { pub unsafe fn offset(self, count: isize) -> *const T { - intrinsics::offset(self, count) + crate::intrinsics::offset(self, count) } } #[lang = "mut_ptr"] impl<T> *mut T { pub unsafe fn offset(self, count: isize) -> *mut T { - intrinsics::offset(self, count) as *mut T + crate::intrinsics::offset(self, count) as *mut T } } pub unsafe fn swap_nonoverlapping<T>(x: *mut T, y: *mut T, count: usize) { let x = x as *mut u8; let y = y as *mut u8; - let len = mem::size_of::<T>() * count; + let len = crate::mem::size_of::<T>() * count; swap_nonoverlapping_bytes(x, y, len) } pub unsafe fn swap_nonoverlapping_one<T>(x: *mut T, y: *mut T) { // For types smaller than the block optimization below, // just swap directly to avoid pessimizing codegen. - if mem::size_of::<T>() < 32 { + if crate::mem::size_of::<T>() < 32 { let z = read(x); - intrinsics::copy_nonoverlapping(y, x, 1); + crate::intrinsics::copy_nonoverlapping(y, x, 1); write(y, z); } else { swap_nonoverlapping(x, y, 1); @@ -133,12 +133,12 @@ mod ptr { } pub unsafe fn write<T>(dst: *mut T, src: T) { - intrinsics::move_val_init(&mut *dst, src) + crate::intrinsics::move_val_init(&mut *dst, src) } pub unsafe fn read<T>(src: *const T) -> T { - let mut tmp: T = mem::uninitialized(); - intrinsics::copy_nonoverlapping(src, &mut tmp, 1); + let mut tmp: T = crate::mem::uninitialized(); + crate::intrinsics::copy_nonoverlapping(src, &mut tmp, 1); tmp } @@ -146,7 +146,7 @@ mod ptr { struct Block(u64, u64, u64, u64); struct UnalignedBlock(u64, u64, u64, u64); - let block_size = mem::size_of::<Block>(); + let block_size = crate::mem::size_of::<Block>(); // Loop through x & y, copying them `Block` at a time // The optimizer should unroll the loop fully for most types @@ -155,31 +155,31 @@ mod ptr { while i + block_size <= len { // Create some uninitialized memory as scratch space // Declaring `t` here avoids aligning the stack when this loop is unused - let mut t: Block = mem::uninitialized(); + let mut t: Block = crate::mem::uninitialized(); let t = &mut t as *mut _ as *mut u8; let x = x.offset(i as isize); let y = y.offset(i as isize); // Swap a block of bytes of x & y, using t as a temporary buffer // This should be optimized into efficient SIMD operations where available - intrinsics::copy_nonoverlapping(x, t, block_size); - intrinsics::copy_nonoverlapping(y, x, block_size); - intrinsics::copy_nonoverlapping(t, y, block_size); + crate::intrinsics::copy_nonoverlapping(x, t, block_size); + crate::intrinsics::copy_nonoverlapping(y, x, block_size); + crate::intrinsics::copy_nonoverlapping(t, y, block_size); i += block_size; } if i < len { // Swap any remaining bytes - let mut t: UnalignedBlock = mem::uninitialized(); + let mut t: UnalignedBlock = crate::mem::uninitialized(); let rem = len - i; let t = &mut t as *mut _ as *mut u8; let x = x.offset(i as isize); let y = y.offset(i as isize); - intrinsics::copy_nonoverlapping(x, t, rem); - intrinsics::copy_nonoverlapping(y, x, rem); - intrinsics::copy_nonoverlapping(t, y, rem); + crate::intrinsics::copy_nonoverlapping(x, t, rem); + crate::intrinsics::copy_nonoverlapping(y, x, rem); + crate::intrinsics::copy_nonoverlapping(t, y, rem); } } } @@ -194,7 +194,7 @@ mod mem { pub fn swap<T>(x: &mut T, y: &mut T) { unsafe { - ptr::swap_nonoverlapping_one(x, y); + crate::ptr::swap_nonoverlapping_one(x, y); } } @@ -204,7 +204,7 @@ mod mem { } pub unsafe fn uninitialized<T>() -> T { - intrinsics::uninit() + crate::intrinsics::uninit() } } @@ -214,25 +214,25 @@ macro_rules! impl_uint { impl $ty { pub fn wrapping_add(self, rhs: Self) -> Self { unsafe { - intrinsics::wrapping_add(self, rhs) + crate::intrinsics::wrapping_add(self, rhs) } } pub fn wrapping_sub(self, rhs: Self) -> Self { unsafe { - intrinsics::wrapping_sub(self, rhs) + crate::intrinsics::wrapping_sub(self, rhs) } } pub fn rotate_left(self, n: u32) -> Self { unsafe { - intrinsics::rotate_left(self, n as Self) + crate::intrinsics::rotate_left(self, n as Self) } } pub fn rotate_right(self, n: u32) -> Self { unsafe { - intrinsics::rotate_right(self, n as Self) + crate::intrinsics::rotate_right(self, n as Self) } } @@ -243,7 +243,7 @@ macro_rules! impl_uint { } } - pub const fn from_le_bytes(bytes: [u8; mem::size_of::<Self>()]) -> Self { + pub const fn from_le_bytes(bytes: [u8; crate::mem::size_of::<Self>()]) -> Self { Self::from_le(Self::from_ne_bytes(bytes)) } @@ -254,8 +254,8 @@ macro_rules! impl_uint { } } - pub const fn from_ne_bytes(bytes: [u8; mem::size_of::<Self>()]) -> Self { - unsafe { mem::transmute(bytes) } + pub const fn from_ne_bytes(bytes: [u8; crate::mem::size_of::<Self>()]) -> Self { + unsafe { crate::mem::transmute(bytes) } } pub fn checked_add(self, rhs: Self) -> Option<Self> { @@ -268,7 +268,7 @@ macro_rules! impl_uint { } pub fn overflowing_add(self, rhs: Self) -> (Self, bool) { - let (a, b) = unsafe { intrinsics::add_with_overflow(self as $ty, rhs as $ty) }; + let (a, b) = unsafe { crate::intrinsics::add_with_overflow(self as $ty, rhs as $ty) }; (a as Self, b) } } @@ -384,12 +384,12 @@ macro_rules! step_identical_methods { () => { #[inline] fn replace_one(&mut self) -> Self { - mem::replace(self, 1) + crate::mem::replace(self, 1) } #[inline] fn replace_zero(&mut self) -> Self { - mem::replace(self, 0) + crate::mem::replace(self, 0) } #[inline] @@ -505,7 +505,7 @@ impl<A: Step> Iterator for Range<A> { // and this won't actually result in an extra check in an optimized build. match self.start.add_usize(1) { Option::Some(mut n) => { - mem::swap(&mut n, &mut self.start); + crate::mem::swap(&mut n, &mut self.start); Option::Some(n) } Option::None => Option::None, diff --git a/gcc/testsuite/rust/compile/for-loop2.rs b/gcc/testsuite/rust/compile/for-loop2.rs index d18bddd..a0ad066 100644 --- a/gcc/testsuite/rust/compile/for-loop2.rs +++ b/gcc/testsuite/rust/compile/for-loop2.rs @@ -102,30 +102,30 @@ mod ptr { #[lang = "const_ptr"] impl<T> *const T { pub unsafe fn offset(self, count: isize) -> *const T { - intrinsics::offset(self, count) + crate::intrinsics::offset(self, count) } } #[lang = "mut_ptr"] impl<T> *mut T { pub unsafe fn offset(self, count: isize) -> *mut T { - intrinsics::offset(self, count) as *mut T + crate::intrinsics::offset(self, count) as *mut T } } pub unsafe fn swap_nonoverlapping<T>(x: *mut T, y: *mut T, count: usize) { let x = x as *mut u8; let y = y as *mut u8; - let len = mem::size_of::<T>() * count; + let len = crate::mem::size_of::<T>() * count; swap_nonoverlapping_bytes(x, y, len) } pub unsafe fn swap_nonoverlapping_one<T>(x: *mut T, y: *mut T) { // For types smaller than the block optimization below, // just swap directly to avoid pessimizing codegen. - if mem::size_of::<T>() < 32 { + if crate::mem::size_of::<T>() < 32 { let z = read(x); - intrinsics::copy_nonoverlapping(y, x, 1); + crate::intrinsics::copy_nonoverlapping(y, x, 1); write(y, z); } else { swap_nonoverlapping(x, y, 1); @@ -133,12 +133,12 @@ mod ptr { } pub unsafe fn write<T>(dst: *mut T, src: T) { - intrinsics::move_val_init(&mut *dst, src) + crate::intrinsics::move_val_init(&mut *dst, src) } pub unsafe fn read<T>(src: *const T) -> T { - let mut tmp: T = mem::uninitialized(); - intrinsics::copy_nonoverlapping(src, &mut tmp, 1); + let mut tmp: T = crate::mem::uninitialized(); + crate::intrinsics::copy_nonoverlapping(src, &mut tmp, 1); tmp } @@ -146,7 +146,7 @@ mod ptr { struct Block(u64, u64, u64, u64); struct UnalignedBlock(u64, u64, u64, u64); - let block_size = mem::size_of::<Block>(); + let block_size = crate::mem::size_of::<Block>(); // Loop through x & y, copying them `Block` at a time // The optimizer should unroll the loop fully for most types @@ -155,31 +155,31 @@ mod ptr { while i + block_size <= len { // Create some uninitialized memory as scratch space // Declaring `t` here avoids aligning the stack when this loop is unused - let mut t: Block = mem::uninitialized(); + let mut t: Block = crate::mem::uninitialized(); let t = &mut t as *mut _ as *mut u8; let x = x.offset(i as isize); let y = y.offset(i as isize); // Swap a block of bytes of x & y, using t as a temporary buffer // This should be optimized into efficient SIMD operations where available - intrinsics::copy_nonoverlapping(x, t, block_size); - intrinsics::copy_nonoverlapping(y, x, block_size); - intrinsics::copy_nonoverlapping(t, y, block_size); + crate::intrinsics::copy_nonoverlapping(x, t, block_size); + crate::intrinsics::copy_nonoverlapping(y, x, block_size); + crate::intrinsics::copy_nonoverlapping(t, y, block_size); i += block_size; } if i < len { // Swap any remaining bytes - let mut t: UnalignedBlock = mem::uninitialized(); + let mut t: UnalignedBlock = crate::mem::uninitialized(); let rem = len - i; let t = &mut t as *mut _ as *mut u8; let x = x.offset(i as isize); let y = y.offset(i as isize); - intrinsics::copy_nonoverlapping(x, t, rem); - intrinsics::copy_nonoverlapping(y, x, rem); - intrinsics::copy_nonoverlapping(t, y, rem); + crate::intrinsics::copy_nonoverlapping(x, t, rem); + crate::intrinsics::copy_nonoverlapping(y, x, rem); + crate::intrinsics::copy_nonoverlapping(t, y, rem); } } } @@ -194,7 +194,7 @@ mod mem { pub fn swap<T>(x: &mut T, y: &mut T) { unsafe { - ptr::swap_nonoverlapping_one(x, y); + crate::ptr::swap_nonoverlapping_one(x, y); } } @@ -204,7 +204,7 @@ mod mem { } pub unsafe fn uninitialized<T>() -> T { - intrinsics::uninit() + crate::intrinsics::uninit() } } @@ -214,25 +214,25 @@ macro_rules! impl_uint { impl $ty { pub fn wrapping_add(self, rhs: Self) -> Self { unsafe { - intrinsics::wrapping_add(self, rhs) + crate::intrinsics::wrapping_add(self, rhs) } } pub fn wrapping_sub(self, rhs: Self) -> Self { unsafe { - intrinsics::wrapping_sub(self, rhs) + crate::intrinsics::wrapping_sub(self, rhs) } } pub fn rotate_left(self, n: u32) -> Self { unsafe { - intrinsics::rotate_left(self, n as Self) + crate::intrinsics::rotate_left(self, n as Self) } } pub fn rotate_right(self, n: u32) -> Self { unsafe { - intrinsics::rotate_right(self, n as Self) + crate::intrinsics::rotate_right(self, n as Self) } } @@ -243,7 +243,7 @@ macro_rules! impl_uint { } } - pub const fn from_le_bytes(bytes: [u8; mem::size_of::<Self>()]) -> Self { + pub const fn from_le_bytes(bytes: [u8; crate::mem::size_of::<Self>()]) -> Self { Self::from_le(Self::from_ne_bytes(bytes)) } @@ -254,8 +254,8 @@ macro_rules! impl_uint { } } - pub const fn from_ne_bytes(bytes: [u8; mem::size_of::<Self>()]) -> Self { - unsafe { mem::transmute(bytes) } + pub const fn from_ne_bytes(bytes: [u8; crate::mem::size_of::<Self>()]) -> Self { + unsafe { crate::mem::transmute(bytes) } } pub fn checked_add(self, rhs: Self) -> Option<Self> { @@ -268,7 +268,7 @@ macro_rules! impl_uint { } pub fn overflowing_add(self, rhs: Self) -> (Self, bool) { - let (a, b) = unsafe { intrinsics::add_with_overflow(self as $ty, rhs as $ty) }; + let (a, b) = unsafe { crate::intrinsics::add_with_overflow(self as $ty, rhs as $ty) }; (a as Self, b) } } @@ -384,12 +384,12 @@ macro_rules! step_identical_methods { () => { #[inline] fn replace_one(&mut self) -> Self { - mem::replace(self, 1) + crate::mem::replace(self, 1) } #[inline] fn replace_zero(&mut self) -> Self { - mem::replace(self, 0) + crate::mem::replace(self, 0) } #[inline] @@ -505,7 +505,7 @@ impl<A: Step> Iterator for Range<A> { // and this won't actually result in an extra check in an optimized build. match self.start.add_usize(1) { Option::Some(mut n) => { - mem::swap(&mut n, &mut self.start); + crate::mem::swap(&mut n, &mut self.start); Option::Some(n) } Option::None => Option::None, @@ -536,10 +536,12 @@ impl<I: Iterator> IntoIterator for I { pub fn main() { // make sure we can desugar for-loops inside other blocks - + if true { for _ in 20usize..40usize { - unsafe { puts("loop\0" as *const str as *const i8); } + unsafe { + puts("loop\0" as *const str as *const i8); + } } } } diff --git a/gcc/testsuite/rust/compile/issue-1901.rs b/gcc/testsuite/rust/compile/issue-1901.rs index cfd8ef4..b43e34f 100644 --- a/gcc/testsuite/rust/compile/issue-1901.rs +++ b/gcc/testsuite/rust/compile/issue-1901.rs @@ -13,14 +13,14 @@ mod ptr { #[lang = "const_ptr"] impl<T> *const T { pub unsafe fn offset(self, count: isize) -> *const T { - intrinsics::offset(self, count) + crate::intrinsics::offset(self, count) } } #[lang = "mut_ptr"] impl<T> *mut T { pub unsafe fn offset(self, count: isize) -> *mut T { - intrinsics::offset(self, count) as *mut T + crate::intrinsics::offset(self, count) as *mut T } } } diff --git a/gcc/testsuite/rust/compile/issue-1981.rs b/gcc/testsuite/rust/compile/issue-1981.rs index bfd8d2c..de9588c 100644 --- a/gcc/testsuite/rust/compile/issue-1981.rs +++ b/gcc/testsuite/rust/compile/issue-1981.rs @@ -16,30 +16,30 @@ mod ptr { #[lang = "const_ptr"] impl<T> *const T { pub unsafe fn offset(self, count: isize) -> *const T { - intrinsics::offset(self, count) + crate::intrinsics::offset(self, count) } } #[lang = "mut_ptr"] impl<T> *mut T { pub unsafe fn offset(self, count: isize) -> *mut T { - intrinsics::offset(self, count) as *mut T + crate::intrinsics::offset(self, count) as *mut T } } pub unsafe fn swap_nonoverlapping<T>(x: *mut T, y: *mut T, count: usize) { let x = x as *mut u8; let y = y as *mut u8; - let len = mem::size_of::<T>() * count; + let len = crate::mem::size_of::<T>() * count; swap_nonoverlapping_bytes(x, y, len) } pub unsafe fn swap_nonoverlapping_one<T>(x: *mut T, y: *mut T) { // For types smaller than the block optimization below, // just swap directly to avoid pessimizing codegen. - if mem::size_of::<T>() < 32 { + if crate::mem::size_of::<T>() < 32 { let z = read(x); - intrinsics::copy_nonoverlapping(y, x, 1); + crate::intrinsics::copy_nonoverlapping(y, x, 1); write(y, z); } else { swap_nonoverlapping(x, y, 1); @@ -47,12 +47,12 @@ mod ptr { } pub unsafe fn write<T>(dst: *mut T, src: T) { - intrinsics::move_val_init(&mut *dst, src) + crate::intrinsics::move_val_init(&mut *dst, src) } pub unsafe fn read<T>(src: *const T) -> T { - let mut tmp: T = mem::uninitialized(); - intrinsics::copy_nonoverlapping(src, &mut tmp, 1); + let mut tmp: T = crate::mem::uninitialized(); + crate::intrinsics::copy_nonoverlapping(src, &mut tmp, 1); tmp } @@ -60,7 +60,7 @@ mod ptr { struct Block(u64, u64, u64, u64); struct UnalignedBlock(u64, u64, u64, u64); - let block_size = mem::size_of::<Block>(); + let block_size = crate::mem::size_of::<Block>(); // Loop through x & y, copying them `Block` at a time // The optimizer should unroll the loop fully for most types @@ -69,31 +69,31 @@ mod ptr { while i + block_size <= len { // Create some uninitialized memory as scratch space // Declaring `t` here avoids aligning the stack when this loop is unused - let mut t: Block = mem::uninitialized(); + let mut t: Block = crate::mem::uninitialized(); let t = &mut t as *mut _ as *mut u8; let x = x.offset(i as isize); let y = y.offset(i as isize); // Swap a block of bytes of x & y, using t as a temporary buffer // This should be optimized into efficient SIMD operations where available - intrinsics::copy_nonoverlapping(x, t, block_size); - intrinsics::copy_nonoverlapping(y, x, block_size); - intrinsics::copy_nonoverlapping(t, y, block_size); + crate::intrinsics::copy_nonoverlapping(x, t, block_size); + crate::intrinsics::copy_nonoverlapping(y, x, block_size); + crate::intrinsics::copy_nonoverlapping(t, y, block_size); i += block_size; } if i < len { // Swap any remaining bytes - let mut t: UnalignedBlock = mem::uninitialized(); + let mut t: UnalignedBlock = crate::mem::uninitialized(); let rem = len - i; let t = &mut t as *mut _ as *mut u8; let x = x.offset(i as isize); let y = y.offset(i as isize); - intrinsics::copy_nonoverlapping(x, t, rem); - intrinsics::copy_nonoverlapping(y, x, rem); - intrinsics::copy_nonoverlapping(t, y, rem); + crate::intrinsics::copy_nonoverlapping(x, t, rem); + crate::intrinsics::copy_nonoverlapping(y, x, rem); + crate::intrinsics::copy_nonoverlapping(t, y, rem); } } } @@ -106,7 +106,7 @@ mod mem { pub fn swap<T>(x: &mut T, y: &mut T) { unsafe { - ptr::swap_nonoverlapping_one(x, y); + crate::ptr::swap_nonoverlapping_one(x, y); } } @@ -116,7 +116,7 @@ mod mem { } pub unsafe fn uninitialized<T>() -> T { - intrinsics::uninit() + crate::intrinsics::uninit() } } @@ -126,7 +126,7 @@ trait Step { impl Step for i32 { fn replace_zero(&mut self) -> Self { - mem::replace(self, 0) + crate::mem::replace(self, 0) } } diff --git a/gcc/testsuite/rust/compile/issue-2330.rs b/gcc/testsuite/rust/compile/issue-2330.rs index 97c1503..6ab46c7 100644 --- a/gcc/testsuite/rust/compile/issue-2330.rs +++ b/gcc/testsuite/rust/compile/issue-2330.rs @@ -95,30 +95,30 @@ mod ptr { #[lang = "const_ptr"] impl<T> *const T { pub unsafe fn offset(self, count: isize) -> *const T { - intrinsics::offset(self, count) + crate::intrinsics::offset(self, count) } } #[lang = "mut_ptr"] impl<T> *mut T { pub unsafe fn offset(self, count: isize) -> *mut T { - intrinsics::offset(self, count) as *mut T + crate::intrinsics::offset(self, count) as *mut T } } pub unsafe fn swap_nonoverlapping<T>(x: *mut T, y: *mut T, count: usize) { let x = x as *mut u8; let y = y as *mut u8; - let len = mem::size_of::<T>() * count; + let len = crate::mem::size_of::<T>() * count; swap_nonoverlapping_bytes(x, y, len) } pub unsafe fn swap_nonoverlapping_one<T>(x: *mut T, y: *mut T) { // For types smaller than the block optimization below, // just swap directly to avoid pessimizing codegen. - if mem::size_of::<T>() < 32 { + if crate::mem::size_of::<T>() < 32 { let z = read(x); - intrinsics::copy_nonoverlapping(y, x, 1); + crate::intrinsics::copy_nonoverlapping(y, x, 1); write(y, z); } else { swap_nonoverlapping(x, y, 1); @@ -126,12 +126,12 @@ mod ptr { } pub unsafe fn write<T>(dst: *mut T, src: T) { - intrinsics::move_val_init(&mut *dst, src) + crate::intrinsics::move_val_init(&mut *dst, src) } pub unsafe fn read<T>(src: *const T) -> T { - let mut tmp: T = mem::uninitialized(); - intrinsics::copy_nonoverlapping(src, &mut tmp, 1); + let mut tmp: T = crate::mem::uninitialized(); + crate::intrinsics::copy_nonoverlapping(src, &mut tmp, 1); tmp } @@ -139,7 +139,7 @@ mod ptr { struct Block(u64, u64, u64, u64); struct UnalignedBlock(u64, u64, u64, u64); - let block_size = mem::size_of::<Block>(); + let block_size = crate::mem::size_of::<Block>(); // Loop through x & y, copying them `Block` at a time // The optimizer should unroll the loop fully for most types @@ -148,31 +148,31 @@ mod ptr { while i + block_size <= len { // Create some uninitialized memory as scratch space // Declaring `t` here avoids aligning the stack when this loop is unused - let mut t: Block = mem::uninitialized(); + let mut t: Block = crate::mem::uninitialized(); let t = &mut t as *mut _ as *mut u8; let x = x.offset(i as isize); let y = y.offset(i as isize); // Swap a block of bytes of x & y, using t as a temporary buffer // This should be optimized into efficient SIMD operations where available - intrinsics::copy_nonoverlapping(x, t, block_size); - intrinsics::copy_nonoverlapping(y, x, block_size); - intrinsics::copy_nonoverlapping(t, y, block_size); + crate::intrinsics::copy_nonoverlapping(x, t, block_size); + crate::intrinsics::copy_nonoverlapping(y, x, block_size); + crate::intrinsics::copy_nonoverlapping(t, y, block_size); i += block_size; } if i < len { // Swap any remaining bytes - let mut t: UnalignedBlock = mem::uninitialized(); + let mut t: UnalignedBlock = crate::mem::uninitialized(); let rem = len - i; let t = &mut t as *mut _ as *mut u8; let x = x.offset(i as isize); let y = y.offset(i as isize); - intrinsics::copy_nonoverlapping(x, t, rem); - intrinsics::copy_nonoverlapping(y, x, rem); - intrinsics::copy_nonoverlapping(t, y, rem); + crate::intrinsics::copy_nonoverlapping(x, t, rem); + crate::intrinsics::copy_nonoverlapping(y, x, rem); + crate::intrinsics::copy_nonoverlapping(t, y, rem); } } } @@ -185,7 +185,7 @@ mod mem { pub fn swap<T>(x: &mut T, y: &mut T) { unsafe { - ptr::swap_nonoverlapping_one(x, y); + crate::ptr::swap_nonoverlapping_one(x, y); } } @@ -195,6 +195,6 @@ mod mem { } pub unsafe fn uninitialized<T>() -> T { - intrinsics::uninit() + crate::intrinsics::uninit() } } diff --git a/gcc/testsuite/rust/compile/issue-2905-2.rs b/gcc/testsuite/rust/compile/issue-2905-2.rs index 83c54ed..1c9516d 100644 --- a/gcc/testsuite/rust/compile/issue-2905-2.rs +++ b/gcc/testsuite/rust/compile/issue-2905-2.rs @@ -17,10 +17,10 @@ pub mod core { } pub mod slice { - use core::marker::PhantomData; - use core::option::Option; + use crate::core::marker::PhantomData; + use crate::core::option::Option; - impl<T> core::iter::IntoIterator for &[T] { + impl<T> crate::core::iter::IntoIterator for &[T] { type Item = &T; type IntoIter = Weird<T>; @@ -108,7 +108,7 @@ pub mod core { } pub mod iter { - use option::Option; + use crate::core::option::Option; pub trait IntoIterator { type Item; diff --git a/gcc/testsuite/rust/compile/issue-3242.rs b/gcc/testsuite/rust/compile/issue-3242.rs index 468497a..a4542aea0 100644 --- a/gcc/testsuite/rust/compile/issue-3242.rs +++ b/gcc/testsuite/rust/compile/issue-3242.rs @@ -1,5 +1,4 @@ #[lang = "sized"] -// { dg-skip-if "" { *-*-* } } pub trait Sized {} trait Foo<T> { diff --git a/gcc/testsuite/rust/compile/issue-3541-1.rs b/gcc/testsuite/rust/compile/issue-3541-1.rs new file mode 100644 index 0000000..6b47b7e --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-3541-1.rs @@ -0,0 +1,5 @@ +impl B for u32 { + const BAR: i32; // { dg-error "associated constant in .impl." } +} + +trait B {} diff --git a/gcc/testsuite/rust/compile/issue-3541-2.rs b/gcc/testsuite/rust/compile/issue-3541-2.rs new file mode 100644 index 0000000..9f17eed --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-3541-2.rs @@ -0,0 +1,3 @@ +trait B { + const BAR: i32; +} diff --git a/gcc/testsuite/rust/compile/issue-3549.rs b/gcc/testsuite/rust/compile/issue-3549.rs new file mode 100644 index 0000000..cedbb5a --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-3549.rs @@ -0,0 +1,3 @@ +fn main() { + r#""#; +} diff --git a/gcc/testsuite/rust/compile/issue-3552.rs b/gcc/testsuite/rust/compile/issue-3552.rs new file mode 100644 index 0000000..9a4451b14b --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-3552.rs @@ -0,0 +1,14 @@ +trait Foo { + const BAR: u32; +} + +const TRAIT_REF_BAR: u32 = <Foo>::BAR; +// { dg-error "no default expression on trait constant" "" { target *-*-* } .-1 } + +struct GlobalTraitRef; + +impl Foo for GlobalTraitRef { + const BAR: u32 = TRAIT_REF_BAR; +} + +fn main() {} diff --git a/gcc/testsuite/rust/compile/issue-3553.rs b/gcc/testsuite/rust/compile/issue-3553.rs new file mode 100644 index 0000000..546f3c1 --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-3553.rs @@ -0,0 +1,18 @@ +trait Foo { + fn f(&self) -> isize; +} + +trait Bar: Foo { + fn g(&self) -> isize; +} + +struct A { + x: isize, +} + +impl Bar for A { + // { dg-error "the trait bound .A: Foo. is not satisfied .E0277." "" { target *-*-* } .-1 } + fn g(&self) -> isize { + self.f() + } +} diff --git a/gcc/testsuite/rust/compile/issue-3554-1.rs b/gcc/testsuite/rust/compile/issue-3554-1.rs new file mode 100644 index 0000000..a66be35 --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-3554-1.rs @@ -0,0 +1,8 @@ +trait Tr { + fn foo(); + + fn bar(&self) { + self.foo() + // { dg-error "no method named .foo. found in the current scope .E0599." "" { target *-*-* } .-1 } + } +} diff --git a/gcc/testsuite/rust/compile/issue-3554-2.rs b/gcc/testsuite/rust/compile/issue-3554-2.rs new file mode 100644 index 0000000..e455a8b --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-3554-2.rs @@ -0,0 +1,18 @@ +#[lang = "sized"] +pub trait Sized {} + +#[lang = "fn_once"] +pub trait FnOnce<Args> { + #[lang = "fn_once_output"] + type Output; + + extern "rust-call" fn call_once(self, args: Args) -> Self::Output; +} +trait Tr { + fn foo(); + + fn bar(&self) { + (|| self.foo())() + // { dg-error "no method named .foo. found in the current scope .E0599." "" { target *-*-* } .-1 } + } +} diff --git a/gcc/testsuite/rust/compile/issue-3563.rs b/gcc/testsuite/rust/compile/issue-3563.rs new file mode 100644 index 0000000..46e7624 --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-3563.rs @@ -0,0 +1,17 @@ +pub struct AA { + pub data: [u8; 10], +} + +impl AA { + pub const fn new() -> Self { + let mut res: AA = AA { data: [0; 10] }; + res.data[0] = 5; + res + } +} + +static mut BB: AA = AA::new(); + +fn main() { + let _ptr = unsafe { &mut BB }; +} diff --git a/gcc/testsuite/rust/compile/issue-3566-1.rs b/gcc/testsuite/rust/compile/issue-3566-1.rs new file mode 100644 index 0000000..b7e5be0 --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-3566-1.rs @@ -0,0 +1,8 @@ +mod a { + pub mod b { + + pub fn f(x: [u8; { 100 }]) -> [u8; { 100 }] { + x + } + } +} diff --git a/gcc/testsuite/rust/compile/issue-3566-2.rs b/gcc/testsuite/rust/compile/issue-3566-2.rs new file mode 100644 index 0000000..3f3ea73 --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-3566-2.rs @@ -0,0 +1,22 @@ +// run-pass + +#![allow(H8)] +#![allow(dead_code)] + + +// pretty-expanded FIXME #23616 + +mod a { + pub mod b { + pub type t = isize; + + pub fn f(x: [u8; { let s = 17; 100 }]) -> [u8; { let z = 18; 100 }] { + //~^ WARN unused variable: `s` + //~| WARN unused variable: `z` + x +} + } +} + +pub fn main() { //~ ERROR cannot move out + } diff --git a/gcc/testsuite/rust/compile/issue-3567.rs b/gcc/testsuite/rust/compile/issue-3567.rs new file mode 100644 index 0000000..021d9c2 --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-3567.rs @@ -0,0 +1,4 @@ +fn main() { + let _: &[i8] = &[i8]; + // { dg-error "expected value .E0423." "" { target *-*-* } .-1 } +} diff --git a/gcc/testsuite/rust/compile/issue-3568.rs b/gcc/testsuite/rust/compile/issue-3568.rs new file mode 100644 index 0000000..222a174 --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-3568.rs @@ -0,0 +1,7 @@ +pub type T = (); +mod foo { + pub use super::T; +} + +pub use foo::super::foo::S as T; +// { dg-error ".super. can only be used in start position" "" { target *-*-* } .-1 } diff --git a/gcc/testsuite/rust/compile/issue-3588.rs b/gcc/testsuite/rust/compile/issue-3588.rs new file mode 100644 index 0000000..744d967 --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-3588.rs @@ -0,0 +1,5 @@ +const FOO: i32 = if true { [1, 2, 3] } else { [2, 3, 4] }[0]; + +pub fn test() -> i32 { + FOO +} diff --git a/gcc/testsuite/rust/compile/issue-3605.rs b/gcc/testsuite/rust/compile/issue-3605.rs new file mode 100644 index 0000000..05e6e48 --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-3605.rs @@ -0,0 +1,5 @@ +enum Foo<'a> {} + +enum Bar<'a> { + in_band_def_explicit_impl(Foo<'a>), +} diff --git a/gcc/testsuite/rust/compile/issue-3606.rs b/gcc/testsuite/rust/compile/issue-3606.rs new file mode 100644 index 0000000..73b0bd6 --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-3606.rs @@ -0,0 +1,6 @@ +// { dg-options "-w" } +#[repr()] +pub struct Coord { + x: u32, + y: u32, +} diff --git a/gcc/testsuite/rust/compile/issue-3613.rs b/gcc/testsuite/rust/compile/issue-3613.rs new file mode 100644 index 0000000..f2e1092 --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-3613.rs @@ -0,0 +1,18 @@ +mod m1 { + pub enum Baz4 { + foo1, + foo2, + } +} + +fn bar(x: m1::foo) { + // { dg-error "unknown reference for resolved name: .foo." "" { target *-*-* } .-1 } + match x { + m1::foo::foo1 => {} + // { dg-error "failed to type resolve root segment" "" { target *-*-* } .-1 } + m1::NodePosition::foo2 => {} + // { dg-error "failed to type resolve root segment" "" { target *-*-* } .-1 } + } +} + +pub fn main() {} diff --git a/gcc/testsuite/rust/compile/issue-3614.rs b/gcc/testsuite/rust/compile/issue-3614.rs new file mode 100644 index 0000000..350a7e4 --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-3614.rs @@ -0,0 +1,3 @@ +#[repr] // { dg-error "malformed .repr. attribute" } + +struct _B {} diff --git a/gcc/testsuite/rust/compile/issue-3615.rs b/gcc/testsuite/rust/compile/issue-3615.rs new file mode 100644 index 0000000..e5c5072 --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-3615.rs @@ -0,0 +1,7 @@ +pub trait Trait { + pub fn nrvo(init: fn()) -> [u8; 4096] { + let mut buf = [0; 4096]; + + buf + } +} diff --git a/gcc/testsuite/rust/compile/iterators1.rs b/gcc/testsuite/rust/compile/iterators1.rs index 1141758..2ea3d74 100644 --- a/gcc/testsuite/rust/compile/iterators1.rs +++ b/gcc/testsuite/rust/compile/iterators1.rs @@ -98,30 +98,30 @@ mod ptr { #[lang = "const_ptr"] impl<T> *const T { pub unsafe fn offset(self, count: isize) -> *const T { - intrinsics::offset(self, count) + crate::intrinsics::offset(self, count) } } #[lang = "mut_ptr"] impl<T> *mut T { pub unsafe fn offset(self, count: isize) -> *mut T { - intrinsics::offset(self, count) as *mut T + crate::intrinsics::offset(self, count) as *mut T } } pub unsafe fn swap_nonoverlapping<T>(x: *mut T, y: *mut T, count: usize) { let x = x as *mut u8; let y = y as *mut u8; - let len = mem::size_of::<T>() * count; + let len = crate::mem::size_of::<T>() * count; swap_nonoverlapping_bytes(x, y, len) } pub unsafe fn swap_nonoverlapping_one<T>(x: *mut T, y: *mut T) { // For types smaller than the block optimization below, // just swap directly to avoid pessimizing codegen. - if mem::size_of::<T>() < 32 { + if crate::mem::size_of::<T>() < 32 { let z = read(x); - intrinsics::copy_nonoverlapping(y, x, 1); + crate::intrinsics::copy_nonoverlapping(y, x, 1); write(y, z); } else { swap_nonoverlapping(x, y, 1); @@ -129,12 +129,12 @@ mod ptr { } pub unsafe fn write<T>(dst: *mut T, src: T) { - intrinsics::move_val_init(&mut *dst, src) + crate::intrinsics::move_val_init(&mut *dst, src) } pub unsafe fn read<T>(src: *const T) -> T { - let mut tmp: T = mem::uninitialized(); - intrinsics::copy_nonoverlapping(src, &mut tmp, 1); + let mut tmp: T = crate::mem::uninitialized(); + crate::intrinsics::copy_nonoverlapping(src, &mut tmp, 1); tmp } @@ -142,7 +142,7 @@ mod ptr { struct Block(u64, u64, u64, u64); struct UnalignedBlock(u64, u64, u64, u64); - let block_size = mem::size_of::<Block>(); + let block_size = crate::mem::size_of::<Block>(); // Loop through x & y, copying them `Block` at a time // The optimizer should unroll the loop fully for most types @@ -151,31 +151,31 @@ mod ptr { while i + block_size <= len { // Create some uninitialized memory as scratch space // Declaring `t` here avoids aligning the stack when this loop is unused - let mut t: Block = mem::uninitialized(); + let mut t: Block = crate::mem::uninitialized(); let t = &mut t as *mut _ as *mut u8; let x = x.offset(i as isize); let y = y.offset(i as isize); // Swap a block of bytes of x & y, using t as a temporary buffer // This should be optimized into efficient SIMD operations where available - intrinsics::copy_nonoverlapping(x, t, block_size); - intrinsics::copy_nonoverlapping(y, x, block_size); - intrinsics::copy_nonoverlapping(t, y, block_size); + crate::intrinsics::copy_nonoverlapping(x, t, block_size); + crate::intrinsics::copy_nonoverlapping(y, x, block_size); + crate::intrinsics::copy_nonoverlapping(t, y, block_size); i += block_size; } if i < len { // Swap any remaining bytes - let mut t: UnalignedBlock = mem::uninitialized(); + let mut t: UnalignedBlock = crate::mem::uninitialized(); let rem = len - i; let t = &mut t as *mut _ as *mut u8; let x = x.offset(i as isize); let y = y.offset(i as isize); - intrinsics::copy_nonoverlapping(x, t, rem); - intrinsics::copy_nonoverlapping(y, x, rem); - intrinsics::copy_nonoverlapping(t, y, rem); + crate::intrinsics::copy_nonoverlapping(x, t, rem); + crate::intrinsics::copy_nonoverlapping(y, x, rem); + crate::intrinsics::copy_nonoverlapping(t, y, rem); } } } @@ -190,7 +190,7 @@ mod mem { pub fn swap<T>(x: &mut T, y: &mut T) { unsafe { - ptr::swap_nonoverlapping_one(x, y); + crate::ptr::swap_nonoverlapping_one(x, y); } } @@ -200,7 +200,7 @@ mod mem { } pub unsafe fn uninitialized<T>() -> T { - intrinsics::uninit() + crate::intrinsics::uninit() } } @@ -210,30 +210,30 @@ macro_rules! impl_uint { impl $ty { pub fn wrapping_add(self, rhs: Self) -> Self { unsafe { - intrinsics::wrapping_add(self, rhs) + crate::intrinsics::wrapping_add(self, rhs) } } pub fn wrapping_sub(self, rhs: Self) -> Self { unsafe { - intrinsics::wrapping_sub(self, rhs) + crate::intrinsics::wrapping_sub(self, rhs) } } pub fn rotate_left(self, n: u32) -> Self { unsafe { - intrinsics::rotate_left(self, n as Self) + crate::intrinsics::rotate_left(self, n as Self) } } pub fn rotate_right(self, n: u32) -> Self { unsafe { - intrinsics::rotate_right(self, n as Self) + crate::intrinsics::rotate_right(self, n as Self) } } - pub const fn from_ne_bytes(bytes: [u8; mem::size_of::<Self>()]) -> Self { - unsafe { mem::transmute(bytes) } + pub const fn from_ne_bytes(bytes: [u8; crate::mem::size_of::<Self>()]) -> Self { + unsafe { crate::mem::transmute(bytes) } } pub fn checked_add(self, rhs: Self) -> Option<Self> { @@ -246,7 +246,7 @@ macro_rules! impl_uint { } pub fn overflowing_add(self, rhs: Self) -> (Self, bool) { - let (a, b) = unsafe { intrinsics::add_with_overflow(self as $ty, rhs as $ty) }; + let (a, b) = unsafe { crate::intrinsics::add_with_overflow(self as $ty, rhs as $ty) }; (a as Self, b) } } @@ -362,12 +362,12 @@ macro_rules! step_identical_methods { () => { #[inline] fn replace_one(&mut self) -> Self { - mem::replace(self, 1) + crate::mem::replace(self, 1) } #[inline] fn replace_zero(&mut self) -> Self { - mem::replace(self, 0) + crate::mem::replace(self, 0) } #[inline] @@ -482,7 +482,7 @@ impl<A: Step> Iterator for Range<A> { // and this won't actually result in an extra check in an optimized build. match self.start.add_usize(1) { Option::Some(mut n) => { - mem::swap(&mut n, &mut self.start); + crate::mem::swap(&mut n, &mut self.start); Option::Some(n) } Option::None => Option::None, diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro43.rs b/gcc/testsuite/rust/compile/macros/mbe/macro43.rs index fbc36a9..0a7f038 100644 --- a/gcc/testsuite/rust/compile/macros/mbe/macro43.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro43.rs @@ -1,3 +1,10 @@ +use Option::{None, Some}; + +enum Option<T> { + None, + Some(T) +} + macro_rules! nonzero_integers { ( $( $Ty: ident($Int: ty); )+ ) => { $( @@ -14,7 +21,7 @@ macro_rules! nonzero_integers { // not all derive macros are implemented yet, and this test does not test these anyways // #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)] #[repr(transparent)] - pub struct $Ty(NonZero<$Int>); + pub struct $Ty($Int); impl $Ty { /// Create a non-zero without checking the value. @@ -25,7 +32,7 @@ macro_rules! nonzero_integers { #[stable(feature = "nonzero", since = "1.28.0")] #[inline] pub const unsafe fn new_unchecked(n: $Int) -> Self { - $Ty(NonZero(n)) + $Ty(n) } /// Create a non-zero if the given value is not zero. @@ -33,7 +40,7 @@ macro_rules! nonzero_integers { #[inline] pub fn new(n: $Int) -> Option<Self> { if n != 0 { - Some($Ty(NonZero(n))) + Some($Ty(n)) } else { None } @@ -43,7 +50,7 @@ macro_rules! nonzero_integers { #[stable(feature = "nonzero", since = "1.28.0")] #[inline] pub fn get(self) -> $Int { - self.0 .0 + self.0 } } diff --git a/gcc/testsuite/rust/compile/nr2/exclude b/gcc/testsuite/rust/compile/nr2/exclude index fed7bde..19bf6f8 100644 --- a/gcc/testsuite/rust/compile/nr2/exclude +++ b/gcc/testsuite/rust/compile/nr2/exclude @@ -1,19 +1,10 @@ canonical_paths1.rs cfg1.rs -const_generics_3.rs -feature_rust_attri0.rs generics9.rs -issue-1901.rs -issue-1981.rs issue-2043.rs -issue-2330.rs issue-2812.rs -issue-850.rs -issue-855.rs issue-3315-2.rs -iterators1.rs lookup_err1.rs -macros/mbe/macro43.rs macros/mbe/macro6.rs multiple_bindings1.rs multiple_bindings2.rs @@ -22,7 +13,6 @@ privacy8.rs pub_restricted_1.rs pub_restricted_2.rs pub_restricted_3.rs -sizeof-stray-infer-var-bug.rs undeclared_label.rs use_1.rs while_break_expr.rs @@ -32,15 +22,12 @@ derive_clone_enum3.rs derive-debug1.rs derive-default1.rs issue-3402-1.rs -for-loop1.rs -for-loop2.rs issue-3403.rs derive-eq-invalid.rs derive-hash1.rs torture/alt_patterns1.rs -torture/builtin_abort.rs torture/loop4.rs torture/loop8.rs torture/name_resolve1.rs -torture/uninit-intrinsic-1.rs +issue-3568.rs # please don't delete the trailing newline diff --git a/gcc/testsuite/rust/compile/self_import_namespace.rs b/gcc/testsuite/rust/compile/self_import_namespace.rs new file mode 100644 index 0000000..2d9b2ed --- /dev/null +++ b/gcc/testsuite/rust/compile/self_import_namespace.rs @@ -0,0 +1,14 @@ +// { dg-additional-options "-frust-name-resolution-2.0" } + +mod bar { + pub mod foo {} + pub fn foo() {} +} + +// This only imports the module `foo`. The function `foo` lives in +// the value namespace and is not imported. +use bar::foo::{self}; + +fn main() { + foo(); // { dg-error "expected value" } +} diff --git a/gcc/testsuite/rust/compile/sizeof-stray-infer-var-bug.rs b/gcc/testsuite/rust/compile/sizeof-stray-infer-var-bug.rs index 8275691..c46a97d 100644 --- a/gcc/testsuite/rust/compile/sizeof-stray-infer-var-bug.rs +++ b/gcc/testsuite/rust/compile/sizeof-stray-infer-var-bug.rs @@ -14,6 +14,6 @@ mod ptr { pub unsafe fn swap_nonoverlapping<T>(x: *mut T, y: *mut T, count: usize) { let x = x as *mut T; let y = y as *mut T; - let len = mem::size_of::<T>() * count; + let len = crate::mem::size_of::<T>() * count; } } diff --git a/gcc/testsuite/rust/compile/torture/builtin_abort.rs b/gcc/testsuite/rust/compile/torture/builtin_abort.rs index 3112cdc..919caa4 100644 --- a/gcc/testsuite/rust/compile/torture/builtin_abort.rs +++ b/gcc/testsuite/rust/compile/torture/builtin_abort.rs @@ -12,7 +12,7 @@ mod intrinsics { } } -pub fn main () -> i32 { - abort(); +pub fn main() -> i32 { + crate::intrinsics::abort(); 0 } diff --git a/gcc/testsuite/rust/compile/torture/uninit-intrinsic-1.rs b/gcc/testsuite/rust/compile/torture/uninit-intrinsic-1.rs index fa329c6..af1cb54 100644 --- a/gcc/testsuite/rust/compile/torture/uninit-intrinsic-1.rs +++ b/gcc/testsuite/rust/compile/torture/uninit-intrinsic-1.rs @@ -11,7 +11,7 @@ mod intrinsics { mod mem { pub unsafe fn uninitialized<T>() -> T { - intrinsics::uninit() + crate::intrinsics::uninit() } } @@ -21,6 +21,6 @@ struct Foo(i32, i32); impl Foo { pub fn new() -> Self { - unsafe { mem::uninitialized::<Foo>() } + unsafe { crate::mem::uninitialized::<Foo>() } } } |