diff options
author | jamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-06-13 15:17:39 +0000 |
---|---|---|
committer | jamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-06-13 15:17:39 +0000 |
commit | 34d0ee70079ea0967450877b1a6c5281569d0366 (patch) | |
tree | 9bd5a49bb3343abd5000ffbc7851f900f1ca9952 /gcc/testsuite | |
parent | d9228815af51731ff57cb606a336b4ce2050ce7e (diff) | |
parent | cacbd54ab615677114faf3efbf8c71bbec4d431e (diff) | |
download | gcc-34d0ee70079ea0967450877b1a6c5281569d0366.tar.gz |
Merged trunk revision 249127 into the hsa branch
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/hsa@249161 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
376 files changed, 4812 insertions, 752 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4eb53a7ce1b..6568326db63 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,811 @@ +2017-06-12 Tamar Christina <tamar.christina@arm.com> + + * gcc.target/aarch64/inline-lrint_1.c: Broaden regexp. + * gcc.target/aarch64/inline-lrint_2.c: Likewise. + * gcc.target/aarch64/no-inline-lrint_1.c: Likewise. + * gcc.target/aarch64/no-inline-lrint_2.c: Likewise. + +2017-06-12 Tamar Christina <tamar.christina@arm.com> + + * gcc.target/arm/sdiv_costs_1.c: Require arm_v8_vfp_ok. + +2017-06-12 Tamar Christina <tamar.christina@arm.com> + + * gcc.target/arm/sdiv_costs_1.c: Disable on softfloat. + +2017-06-12 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/81003 + * gcc.c-torture/compile/pr81003.c: New test. + +2017-06-12 Richard Biener <rguenther@suse.de> + + PR tree-optimization/81053 + * gcc.dg/torture/pr81053.c: New testcase. + +2017-06-10 Thomas Koenig <tkoenig@gcc.gnu.org> + + PR fortran/80988 + * gfortran.dg/implied_do_io_3.f90: New test. + +2017-06-10 Tom de Vries <tom@codesourcery.com> + + * lib/target-supports.exp (check_effective_target_signal): New proc. + * lib/gcc.exp (gcc_target_compile): Remove appending of + -DSIGNAL_SUPPRESS to additional_flags. + * gcc.c-torture/execute/ieee/ieee.exp: Add -DSIGNAL_SUPPRESS to + additional_flags if effective target signal is not supported by the + target. + * gcc.c-torture/execute/20101011-1.c: Same. + * gcc.dg/c99-stdint-1.c: Same. + * gcc.dg/c99-stdint-2.c: Same. + * gcc.dg/c99-stdint-5.c: Same. + * gcc.dg/c99-stdint-6.c: Same. + * gcc.dg/stdint-width-1.c: Same. + +2017-06-10 Tom de Vries <tom@codesourcery.com> + + * lib/target-supports.exp (check_effective_target_stack_size) + (dg-effective-target-value): New proc. + * lib/gcc.exp (gcc_target_compile): Remove adding of DSTACK_SIZE to + additional_flags. + * lib/objc.exp (objc_target_compile): Same. + * lib/profopt.exp (profopt-get-options): Allow dg-additional-options. + * g++.old-deja/g++.eh/badalloc1.C: Add -DSTACK_SIZE=<value> using + dg-additional-options. + * gcc.c-torture/compile/20080806-1.c: Same. + * gcc.c-torture/compile/920723-1.c: Same. + * gcc.c-torture/compile/930621-1.c: Same. + * gcc.c-torture/compile/991214-2.c: Same. + * gcc.c-torture/compile/bcopy.c: Same. + * gcc.c-torture/compile/memtst.c: Same. + * gcc.c-torture/compile/msp.c: Same. + * gcc.c-torture/compile/stuct.c: Same. + * gcc.c-torture/execute/20011008-3.c: Same. + * gcc.c-torture/execute/20030209-1.c: Same. + * gcc.c-torture/execute/20031012-1.c: Same. + * gcc.c-torture/execute/20040805-1.c: Same. + * gcc.c-torture/execute/920410-1.c: Same. + * gcc.c-torture/execute/920501-7.c: Same. + * gcc.c-torture/execute/921113-1.c: Same. + * gcc.c-torture/execute/921202-1.c: Same. + * gcc.c-torture/execute/921208-2.c: Same. + * gcc.c-torture/execute/930106-1.c: Same. + * gcc.c-torture/execute/930406-1.c: Same. + * gcc.c-torture/execute/950221-1.c: Same. + * gcc.c-torture/execute/960521-1.c: Same. + * gcc.c-torture/execute/980605-1.c: Same. + * gcc.c-torture/execute/comp-goto-1.c: Same. + * gcc.c-torture/execute/comp-goto-2.c: Same. + * gcc.c-torture/execute/memcpy-1.c: Same. + * gcc.c-torture/execute/multi-ix.c: Same. + * gcc.c-torture/execute/nestfunc-4.c: Same. + * gcc.c-torture/execute/pr20621-1.c: Same. + * gcc.c-torture/execute/pr23135.c: Same. + * gcc.c-torture/execute/pr28982b.c: Same. + * gcc.dg/loop-3.c: Same. + * gcc.dg/struct-ret-3.c: Same. + * gcc.dg/torture/stackalign/comp-goto-1.c: Same. + * gcc.dg/torture/stackalign/non-local-goto-4.c: Same. + * gcc.dg/tree-prof/comp-goto-1.c: Same. + * gcc.dg/tree-prof/pr44777.c: Same. + +2017-06-09 David Malcolm <dmalcolm@redhat.com> + + * gcc.dg/plugin/diagnostic-test-show-locus-bw.c + (test_mutually_exclusive_suggestions): New test function. + * gcc.dg/plugin/diagnostic-test-show-locus-generate-patch.c + (test_mutually_exclusive_suggestions): New test function. + * gcc.dg/plugin/diagnostic-test-show-locus-parseable-fixits.c + (test_mutually_exclusive_suggestions): New test function. + * gcc.dg/plugin/diagnostic_plugin_test_show_locus.c + (test_show_locus): Add special-case for + "test_mutually_exclusive_suggestions". + +2017-06-09 Ian Lance Taylor <iant@golang.org> + + * gcc.dg/tree-prof/split-1.c: New test. + +2017-06-09 Jan Hubicka <hubicka@ucw.cz> + + * gcc.dg/predict-14.c: Avoid cold function detection. + * gcc.target/i386/umod-3.c: Likewise. + +2017-06-09 Tamar Christina <tamar.christina@arm.com> + + * gcc.target/aarch64/lrint-matherr.h: New. + * gcc.target/aarch64/inline-lrint_1.c: New. + * gcc.target/aarch64/inline-lrint_2.c: New. + * gcc.target/aarch64/no-inline-lrint_1.c: New. + * gcc.target/aarch64/no-inline-lrint_2.c: New. + +2017-06-09 Tamar Christina <tamar.christina@arm.com> + + * gcc.target/arm/sdiv_costs_1.c: New. + +2017-06-09 Tom de Vries <tom@codesourcery.com> + + PR target/80855 + * gcc.target/nvptx/label-values.c: New test. + +2017-06-09 Thomas Preud'homme <thomas.preudhomme@arm.com> + + * lib/target-supports.exp (check_effective_target_arm_arch_FUNC_ok): + Test for null definitions instead of them being undefined. Add entry + for ARMv7VE. Reindent entry for ARMv8-M Baseline. Add comment warning + about using the effective target for architecture extension. + (check_effective_target_arm_arch_v7ve_ok): Remove. + (add_options_for_arm_arch_v7ve): Likewise. + +2017-06-09 Richard Biener <rguenther@suse.de> + + PR tree-optimization/66623 + * gcc.dg/vect/pr66623.c: New testcase. + +2017-06-09 Richard Biener <rguenther@suse.de> + + PR tree-optimization/79483 + * gcc.dg/graphite/pr79483.c: New testcase. + +2017-06-09 Richard Biener <rguenther@suse.de> + + PR middle-end/81007 + * g++.dg/pr81007.C: New testcase. + +2017-06-09 Jakub Jelinek <jakub@redhat.com> + + * gcc.target/i386/mpx/hard-reg-1-nov.c (mpx_test): Use "esp" + instead of "rsp" for -m32. + * gcc.target/i386/mpx/hard-reg-2-lbv.c: Require sse2_runtime effective + target, add -msse2 to dg-options. + * gcc.target/i386/mpx/hard-reg-2-nov.c: Likewise. + * gcc.target/i386/mpx/hard-reg-2-ubv.c: Likewise. + +2017-06-09 Segher Boessenkool <segher@kernel.crashing.org> + + PR target/80966 + * gcc.target/powerpc/stack-limit.c: New testcase. + +2017-06-08 Will Schmidt <will_schmidt@vnet.ibm.com> + + * testsuite/gcc.target/powerpc/fold-vec-logical-eqv-char.c: New. + * testsuite/gcc.target/powerpc/fold-vec-logical-eqv-float.c: New. + * testsuite/gcc.target/powerpc/fold-vec-logical-eqv-floatdouble.c: New. + * testsuite/gcc.target/powerpc/fold-vec-logical-eqv-int.c: New. + * testsuite/gcc.target/powerpc/fold-vec-logical-eqv-longlong.c: New. + * testsuite/gcc.target/powerpc/fold-vec-logical-eqv-short.c: New. + +2017-06-08 Jakub Jelinek <jakub@redhat.com> + + PR c/81006 + * c-c++-common/gomp/pr81006.c: New test. + + PR c++/81011 + * g++.dg/gomp/pr81011.C: New test. + + PR middle-end/81005 + * c-c++-common/ubsan/align-10.c: New test. + * c-c++-common/ubsan/null-13.c: New test. + +2017-06-08 Uros Bizjak <ubizjak@gmail.com> + + PR target/81015 + * gcc.target/i386/pr59874-1.c (foo): Call __builtin_ctzs. + * gcc.target/i386/pr59874-2.c (foo): Call __builtin_clzs. + * gcc.target/i386/pr81015.c: New test. + +2017-06-08 Tom de Vries <tom@codesourcery.com> + + * gcc.c-torture/compile/930506-2.c: Use dg-require-effective-target + trampolines instead of NO_TRAMPOLINES. + * gcc.c-torture/execute/20000822-1.c: Same. + * gcc.c-torture/execute/920428-2.c: Same. + * gcc.c-torture/execute/920501-7.c: Same. + * gcc.c-torture/execute/920612-2.c: Same. + * gcc.c-torture/execute/921017-1.c: Same. + * gcc.c-torture/execute/921215-1.c: Same. + * gcc.c-torture/execute/931002-1.c: Same. + * gcc.c-torture/execute/comp-goto-2.c: Same. + * gcc.c-torture/execute/nestfunc-1.c: Same. + * gcc.c-torture/execute/nestfunc-2.c: Same. + * gcc.c-torture/execute/nestfunc-3.c: Same. + * gcc.c-torture/execute/nestfunc-5.c: Same. + * gcc.c-torture/execute/nestfunc-6.c: Same. + * gcc.c-torture/execute/pr24135.c: Same. + * gcc.dg/Wtrampolines.c: Same. + * gcc.dg/torture/stackalign/comp-goto-1.c: Same. + * gcc.dg/torture/stackalign/nested-5.c: Same. + * gcc.dg/torture/stackalign/nested-6.c: Same. + * gcc.dg/torture/stackalign/non-local-goto-3.c: Same. + * gcc.dg/torture/stackalign/non-local-goto-4.c: Same. + * gcc.dg/torture/stackalign/non-local-goto-5.c: Same. + * gcc.dg/trampoline-1.c: Same. + * gcc.dg/tree-prof/pr44777.c: Same. + * gcc.target/i386/pr67770.c: Same. + * lib/gcc.exp (gcc_target_compile): Remove appending of + -DNO_TRAMPOLINES to additional_flags. + * lib/objc.exp (objc_target_compile): Same. + +2017-06-08 Tom de Vries <tom@codesourcery.com> + + * lib/target-supports.exp (check_effective_target_trampolines): Test for + 'gcc,no_trampolines' instead of 'no_trampolines'. + +2017-06-08 Alexander Ivchenko <alexander.ivchenko@intel.com> + + PR middle-end/79988 + * gcc.target/i386/mpx/pr79988.c: New test. + +2017-06-08 Alexander Ivchenko <alexander.ivchenko@intel.com> + + * gcc.target/i386/mpx/hard-reg-2-lbv.c: New test. + * gcc.target/i386/mpx/hard-reg-2-nov.c: New test. + * gcc.target/i386/mpx/hard-reg-2-ubv.c: New test. + +2017-06-08 Jan Hubicka <hubicka@ucw.cz> + + * g++.dg/tree-ssa/counts-1.C: New testcase. + * gcc.dg/tree-ssa/counts-1.c: New testcase. + +2017-08-08 Julia Koval <julia.koval@intel.com> + + * gcc.target/i386/avx512bw-vpmovswb-1.c: Add new intrinsics to test. + * gcc.target/i386/avx512bw-vpmovswb-2.c: Ditto. + * gcc.target/i386/avx512bw-vpmovuswb-1.c: Ditto. + * gcc.target/i386/avx512bw-vpmovuswb-2.c: Ditto. + * gcc.target/i386/avx512bw-vpmovwb-1.c: Ditto. + * gcc.target/i386/avx512bw-vpmovwb-2.c: Ditto. + +2017-06-08 Marek Polacek <polacek@redhat.com> + + PR sanitize/80932 + * c-c++-common/ubsan/pr80932.c: Test with ints, not with long ints. + +2017-08-08 Julia Koval <julia.koval@intel.com> + + PR target/73350,80862 + * gcc.target/i386/pr73350.c: New test. + +2017-06-08 Richard Biener <rguenther@suse.de> + + PR tree-optimization/80928 + * gcc.dg/vect/slp-perm-8.c: Do not expect check loop to be vectorized. + +2017-06-07 Carl Love <cel@us.ibm.com> + + * gcc.target/powerpc/builtins-3.c: Fix vec_mule, vec_mulo test cases. + +2017-06-07 Jonathan Wakely <jwakely@redhat.com> + + PR c++/80990 + * g++.dg/cpp1z/class-deduction39.C: New. + +2017-06-07 Marek Polacek <polacek@redhat.com> + + PR sanitizer/80932 + * c-c++-common/ubsan/pr80932.c: New test. + +2017-06-07 Bin Cheng <bin.cheng@arm.com> + + * gcc.target/i386/l_fma_double_1.c: Adjust test strings. + * gcc.target/i386/l_fma_double_2.c: Ditto. + * gcc.target/i386/l_fma_double_3.c: Ditto. + * gcc.target/i386/l_fma_double_4.c: Ditto. + * gcc.target/i386/l_fma_double_5.c: Ditto. + * gcc.target/i386/l_fma_double_6.c: Ditto. + * gcc.target/i386/l_fma_float_1.c: Ditto. + * gcc.target/i386/l_fma_float_2.c: Ditto. + * gcc.target/i386/l_fma_float_3.c: Ditto. + * gcc.target/i386/l_fma_float_4.c: Ditto. + * gcc.target/i386/l_fma_float_5.c: Ditto. + * gcc.target/i386/l_fma_float_6.c: Ditto. + +2017-06-07 Tamar Christina <tamar.christina@arm.com> + + * gcc.target/aarch64/sdiv_costs_1.c: New. + +2017-06-07 Richard Biener <rguenther@suse.de> + + PR tree-optimization/80928 + * gcc.dg/vect/slp-13.c: Adjust patterns with vect_pack_trunc. + * gcc.dg/vect/slp-13-big-array.c: Likewise. + +2017-06-07 Richard Biener <rguenther@suse.de> + + PR tree-optimization/80928 + * gcc.dg/vect/slp-perm-8.c: Avoid vectorizing loop computing + check_results. + +2017-06-06 Nathan Sidwell <nathan@acm.org> + + * g++.dg/pr45330.C: Add inline namespace case. + +2017-06-06 Thomas Koenig <tkoenig@gcc.gnu.org> + + PR fortran/80975 + * gfortran.dg/matmul_16.f90: New test. + * gfortran.dg/inline_matmul_18.f90: New test. + +2017-06-06 Marek Polacek <polacek@redhat.com> + + PR c/79983 + * gcc.dg/pr79983.c: New test. + +2017-06-06 David S. Miller <davem@davemloft.net> + + * gcc.target/sparc/sparc-ret-3.c: New test. + +2017-06-06 Tom de Vries <tom@codesourcery.com> + + * gcc.c-torture/compile/20000326-2.c: Use dg-require-effective-target + label_values instead of NO_LABEL_VALUES. + * gcc.c-torture/compile/920301-1.c: Same. + * gcc.c-torture/compile/920501-1.c: Same. + * gcc.c-torture/compile/941014-4.c: Same. + * gcc.c-torture/compile/labels-1.c: Same. + * gcc.c-torture/compile/pr18903.c: Same. + * gcc.c-torture/execute/920302-1.c: Same. + * gcc.c-torture/execute/920415-1.c: Same. + * gcc.c-torture/execute/920428-2.c: Same. + * gcc.c-torture/execute/920501-3.c: Same. + * gcc.c-torture/execute/920501-4.c: Same. + * gcc.c-torture/execute/920501-5.c: Same. + * gcc.c-torture/execute/920501-7.c: Same. + * gcc.c-torture/execute/920721-4.c: Same. + * gcc.c-torture/execute/980526-1.c: Same. + * gcc.c-torture/execute/990208-1.c: Same. + * gcc.c-torture/execute/comp-goto-1.c: Same. + * gcc.c-torture/execute/comp-goto-2.c: Same. + * gcc.dg/torture/stackalign/comp-goto-1.c: Same. + * gcc.dg/torture/stackalign/non-local-goto-4.c: Same. + * gcc.dg/torture/stackalign/non-local-goto-5.c: Same. + * gcc.dg/tree-prof/comp-goto-1.c: Same. + * gcc.dg/tree-prof/pr44777.c: Same. + * gcc.misc-tests/bprob-2.c: Same. + * gcc.misc-tests/gcov-3.c: Same. + * lib/gcc.exp (gcc_target_compile): Remove appending of + -DNO_LABEL_VALUES to additional_flags. + * lib/objc.exp (objc_target_compile): Same. + * lib/target-supports.exp (check_effective_target_label_values): Test on + 'target_info exists gcc,no_label_values' instead of NO_LABEL_VALUES. + +2017-06-06 Kyrylo Tkachov <kyrylo.tkachov@arm.com> + + * gcc.target/aarch64/atomic_cmp_exchange_zero_reg_1.c: New test. + +2017-06-06 Richard Biener <rguenther@suse.de> + + PR tree-optimization/80974 + * gcc.dg/torture/pr80974.c: New testcase. + +2017-06-06 Thomas Preud'homme <thomas.preudhomme@arm.com> + + * gcc.dg/utf16-4.c: Accept "long unsigned int" as well as + "unsigned int" in conversation warning on line 15. + +2017-06-06 Richard Biener <rguenther@suse.de> + + PR tree-optimization/80928 + * gcc.dg/vect/pr80928.c: New testcase. + * gcc.dg/vect/slp-13-big-array.c: Remove XFAILs. + * gcc.dg/vect/slp-13.c: Likewise. + * gcc.dg/vect/slp-perm-9.c: Prevent vectorization of check loop. + +2017-06-05 David Malcolm <dmalcolm@redhat.com> + + * g++.dg/plugin/comment_plugin.c: New test plugin. + * g++.dg/plugin/comments-1.C: New test file. + * g++.dg/plugin/plugin.exp (plugin_test_list): Add the above. + +2017-06-05 Bernd Edlinger <bernd.edlinger@hotmail.de> + + * gcc.misc-tests/gcov-1a.c: New test. + +2017-06-05 Michael Meissner <meissner@linux.vnet.ibm.com> + + * gcc.target/powerpc/clone1.c: New test. + +2017-06-05 Janus Weil <janus@gcc.gnu.org> + + PR fortran/70601 + * gfortran.dg/proc_ptr_comp_50.f90: New test. + +2017-06-05 Nicolas Koenig <koenigni@student.ethz.ch> + + PR fortran/35339 + * gfortran.dg/implied_do_io_1.f90: New Test. + * gfortran.dg/implied_do_io_2.f90: New Test. + +2017-06-05 Renlin Li <renlin.li@arm.com> + + * c-c++-common/Wfloat-conversion.c: Add large_long_double target + selector to related line. + +2017-06-05 Jan Hubicka <hubicka@ucw.cz> + + * gcc.dg/tree-prof/cold_partition_label.c: Update template. + +2017-06-05 Kyrylo Tkachov <kyrylo.tkachov@arm.com> + + * gcc.target/aarch64/store_lane0_str_1.c: New test. + +2017-06-05 Kyrylo Tkachov <kyrylo.tkachov@arm.com> + + * gcc.target/aarch64/subs_compare_2.c: New test. + +2017-06-05 Kyrylo Tkachov <kyrylo.tkachov@arm.com> + + * gcc.target/aarch64/subs_compare_1.c: New test. + +2017-06-05 Chenghua Xu <paul.hua.gm@gmail.com> + + * gcc.target/mips/div-9.c: Delete duplicate test. + * gcc.target/mips/div-10.c: Ditto. + * gcc.target/mips/div-11.c: Ditto. + * gcc.target/mips/div-12.c: Ditto. + +2017-05-23 Jan Hubicka <hubicka@ucw.cz> + + * gcc.dg/tree-ssa/attr-hotcold-2.c: Update template. + +2017-06-04 Dominique d'Humieres <dominiq@lps.ens.fr> + + * lib/fortran-modules.exp (igrep): New procedure, case insensitive + vesrion of the dejagnu grep. + (list-module-names): Use it and adjust the regular expressions for + modules and submodules. + * gfortran.dg/prof/prof.exp: Cleanup modules. + * gfortran.dg/allocate_class_4.f90: Remove cleanup-(sub)?modules + directives. + * gfortran.dg/altreturn_8.f90: Likewise. + * gfortran.dg/associate_12.f90: Likewise. + * gfortran.dg/c_f_pointer_shape_test.f90: Likewise. + * gfortran.dg/charlen_15.f90: Likewise. + * gfortran.dg/class_4a.f03: Likewise. + * gfortran.dg/class_54.f90: Likewise. + * gfortran.dg/class_dummy_4.f03: Likewise. + * gfortran.dg/class_dummy_5.f90: Likewise. + * gfortran.dg/constructor_9.f90: Likewise. + * gfortran.dg/dec_structure_15.f90: Likewise. + * gfortran.dg/do_check_8.f90: Likewise. + * gfortran.dg/dtio_26.f03: Likewise. + * gfortran.dg/dynamic_dispatch_12.f90: Likewise. + * gfortran.dg/equiv_9.f90: Likewise. + * gfortran.dg/extends_15.f90: Likewise. + * gfortran.dg/finalize_22.f90: Likewise. + * gfortran.dg/finalize_23.f90: Likewise. + * gfortran.dg/generic_26.f90: Likewise. + * gfortran.dg/generic_27.f90: Likewise. + * gfortran.dg/namelist_76.f90: Likewise. + * gfortran.dg/pointer_init_8.f90: Likewise. + * gfortran.dg/pr61318.f90: Likewise. + * gfortran.dg/pr77260_1.f90: Likewise. + * gfortran.dg/pr77260_2.f90: Likewise. + * gfortran.dg/pr77420_3.f90: Likewise. + * gfortran.dg/proc_ptr_39.f90: Likewise. + * gfortran.dg/proc_ptr_41.f90: Likewise. + * gfortran.dg/proc_ptr_42.f90: Likewise. + * gfortran.dg/proc_ptr_comp_43.f90: Likewise. + * gfortran.dg/submodule_1.f08: Likewise. + * gfortran.dg/submodule_10.f08: Likewise. + * gfortran.dg/submodule_14.f08: Likewise. + * gfortran.dg/submodule_15.f08: Likewise. + * gfortran.dg/submodule_2.f08: Likewise. + * gfortran.dg/submodule_5.f08: Likewise. + * gfortran.dg/submodule_6.f08: Likewise. + * gfortran.dg/submodule_7.f08: Likewise. + * gfortran.dg/submodule_8.f08: Likewise. + * gfortran.dg/submodule_9.f08: Likewise. + * gfortran.dg/transfer_class_2.f90: Likewise. + * gfortran.dg/typebound_assignment_7.f90: Likewise. + * gfortran.dg/typebound_call_24.f03: Likewise. + * gfortran.dg/typebound_call_25.f90: Likewise. + * gfortran.dg/typebound_deferred_1.f90: Likewise. + * gfortran.dg/typebound_generic_12.f03: Likewise. + * gfortran.dg/typebound_generic_13.f03: Likewise. + * gfortran.dg/typebound_generic_14.f03: Likewise. + * gfortran.dg/typebound_generic_15.f90: Likewise. + * gfortran.dg/typebound_operator_16.f03: Likewise. + * gfortran.dg/typebound_operator_18.f90: Likewise. + * gfortran.dg/typebound_operator_20.f90: Likewise. + * gfortran.dg/typebound_override_3.f90: Likewise. + * gfortran.dg/typebound_override_4.f90: Likewise. + * gfortran.dg/typebound_override_5.f90: Likewise. + * gfortran.dg/typebound_override_6.f90: Likewise. + * gfortran.dg/typebound_override_7.f90: Likewise. + * gfortran.dg/typebound_proc_28.f03: Likewise. + * gfortran.dg/typebound_proc_29.f90: Likewise. + * gfortran.dg/typebound_proc_30.f90: Likewise. + * gfortran.dg/typebound_proc_31.f90: Likewise. + * gfortran.dg/typebound_proc_32.f90: Likewise. + * gfortran.dg/typebound_proc_33.f90: Likewise. + * gfortran.dg/unlimited_polymorphic_16.f90: Likewise. + * gfortran.dg/unlimited_polymorphic_19.f90: Likewise. + * gfortran.dg/unlimited_polymorphic_24.f03: Likewise. + * gfortran.dg/use_only_3.f90: Likewise. + * gfortran.dg/use_without_only_1.f90: Likewise. + * gfortran.dg/warn_unused_function.f90: Likewise. + * gfortran.dg/warn_unused_function_2.f90: Likewise. + * gfortran.dg/ieee/ieee_8.f90: Likewise. + +2017-06-04 Marek Polacek <polacek@redhat.com> + + PR c/80919 + * gcc.dg/format/pr80919.c: New test. + +2017-06-02 Martin Sebor <msebor@redhat.com> + + PR c/80892 + * c-c++-common/Wfloat-conversion-2.c: New test. + +2017-06-02 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/68754 + * g++.dg/cpp1y/constexpr-68754.C: New. + +2017-06-02 Carl Love <cel@us.ibm.com> + + * gcc.target/powerpc/builtins-3-runnable.c: New file of runnable tests + for the new built-ins. + +2017-06-02 Sudakshina Das <sudi.das@arm.com> + + * gcc.target/aarch64/cmp_shifted_reg_1.c: New. + +2017-06-02 Will Schmidt <will_schmidt@vnet.ibm.com> + + * gcc.target/powerpc/fold-vec-minmax-char.c: New. + * gcc.target/powerpc/fold-vec-minmax-floatdouble.c: New. + * gcc.target/powerpc/fold-vec-minmax-int.c: New. + * gcc.target/powerpc/fold-vec-minmax-longlong.c: New. + * gcc.target/powerpc/fold-vec-minmax-short.c: New. + +2017-06-02 Kyrylo Tkachov <kyrylo.tkachov@arm.com> + + * gcc.target/aarch64/hfmode_ins_1.c: New test. + +2017-06-02 Kyrylo Tkachov <kyrylo.tkachov@arm.com> + + * gcc.target/aarch64/atomic_cmp_exchange_zero_strong_1.c: New test. + +2017-06-02 Will Schmidt <will_schmidt@vnet.ibm.com> + + * gcc.target/powerpc/fold-vec-abs-char.c: New. + * gcc.target/powerpc/fold-vec-abs-floatdouble.c: New. + * gcc.target/powerpc/fold-vec-abs-int.c: New. + * gcc.target/powerpc/fold-vec-abs-longlong.c: New. + * gcc.target/powerpc/fold-vec-abs-short.c: New. + * gcc.target/powerpc/fold-vec-abs-char-fwrapv.c: New. + * gcc.target/powerpc/fold-vec-abs-int-fwrapv.c: New. + * gcc.target/powerpc/fold-vec-abs-longlong-fwrapv.c: New. + * gcc.target/powerpc/fold-vec-abs-short-fwrapv.c: New. + +2017-06-02 Nathan Sidwell <nathan@acm.org> + + * g++.dg/pr45330.C: Adjust. Check breadth-firstness. + +2017-06-02 Jakub Jelinek <jakub@redhat.com> + + PR rtl-optimization/80903 + * gcc.dg/pr80903.c: New test. + + PR fortran/80918 + * gfortran.dg/gomp/pr80918.f90: New test. + +2017-06-02 Bernd Edlinger <bernd.edlinger@hotmail.de> + + * c-c++-common/Wsizeof-pointer-div.c: New test. + * gcc.dg/Wsizeof-pointer-memaccess1.c: Add test cases with parens. + * gcc.dg/torture/Wsizeof-pointer-memaccess1.c: Likewise. + * gcc.target/i386/sse-init-v4hi-1.c: Fix test case. + * gcc.target/i386/sse-init-v4sf-1.c: Likewise. + * gcc.target/i386/sse-set-ps-1.c: Likewise. + * gcc.target/i386/sse2-init-v16qi-1.c: Likewise. + * gcc.target/i386/sse2-init-v2di-1.c: Likewise. + * gcc.target/i386/sse2-init-v4si-1.c: Likewise. + * gcc.target/i386/sse2-init-v8hi-1.c: Likewise. + * gcc.target/i386/sse2-set-epi32-1.c: Likewise. + * gcc.target/i386/sse2-set-epi64x-1.c: Likewise. + * gcc.target/i386/sse4_1-init-v16qi-1.c: Likewise. + * gcc.target/i386/sse4_1-init-v2di-1.c: Likewise. + * gcc.target/i386/sse4_1-init-v4sf-1.c: Likewise. + * gcc.target/i386/sse4_1-init-v4si-1.c: Likewise. + * gcc.target/i386/sse4_1-set-epi32-1.c: Likewise. + * gcc.target/i386/sse4_1-set-epi64x-1.c: Likewise. + * gcc.target/i386/sse4_1-set-ps-1.c: Likewise. + +2017-06-01 Will Schmidt <will_schmidt@vnet.ibm.com> + + * gcc.target/powerpc/fold-vec-logical-ors-longlong.c: + Update the target to power8-vector. + +2017-06-01 David Malcolm <dmalcolm@redhat.com> + + * lib/gcc-dg.exp: Ensure GCC_COLORS is unset. + +2017-06-01 Pierre-Marie de Rodat <derodat@adacore.com> + + * debug12.adb, debug12.ads: New testcase. + +2017-06-01 Martin Jambor <mjambor@suse.cz> + + PR tree-optimization/80898 + * gcc.dg/tree-ssa/pr80898.c: New test. + * gcc.dg/tree-ssa/pr80898-2.c: Likewise. + +2017-06-01 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/80896 + * g++.dg/cpp1z/nodiscard5.C: New. + +2017-06-01 Claudiu Zissulescu <claziss@synopsys.com> + + * gcc.target/arc/pr9001195952.c: New test. + +2017-06-01 Tom de Vries <tom@codesourcery.com> + + * c-c++-common/pr43395.c: Add dg-require-effective-target label_values. + * gcc.c-torture/compile/asmgoto-1.c: Same. + * gcc.dg/20000707-1.c: Same. + * gcc.dg/pr38700.c: Same. + * gcc.dg/pr70169.c: Same. + * gcc.dg/pr80112.c: Same. + * gcc.dg/torture/pr51071-2.c: Same. + * gcc.dg/torture/pr51071.c: Same. + * gcc.dg/tree-ssa/alias-34.c: Same. + +2017-06-01 Pierre-Marie de Rodat <derodat@adacore.com> + + * gnat.dg/debug11.adb: New testcase. + +2017-06-01 Richard Biener <rguenther@suse.de> + + PR middle-end/66313 + * c-c++-common/ubsan/pr66313.c: New testcase. + * gcc.dg/tree-ssa/loop-15.c: Adjust. + +2017-05-31 Steven Munroe <munroesj@gcc.gnu.org> + + * gcc.target/powerpc/bmi2-pdep32-1.c: Add -mcpu=power7 to + dg-options. Change dg-require-effective-target powerpc_vsx_ok + to vsx_hw. Add dg-skip-if directive to disable this test if + -mcpu overridden. + * gcc.target/powerpc/bmi2-pdep64-1.c: Likewise. + * gcc.target/powerpc/bmi2-pext32-1.c: Likewise. + * gcc.target/powerpc/bmi2-pext64-1.c: Likewise. + * gcc.target/powerpc/bmi2-pext64-1a.c: Add -mcpu=power7 + to dg-option. Add dg-skip-if directive to disable this test + for darwin. Add dg-skip-if directive to disable this test if + -mcpu overridden. + +2017-05-31 Sebastian Peryt <sebastian.peryt@intel.com> + + * gcc.target/i386/avx512f-vmaxsd-1.c (_mm_mask_max_sd) + (_mm_maskz_max_sd): Test new intrinsics. + * gcc.target/i386/avx512f-vmaxsd-2.c (_mm_mask_max_sd) + (_mm_maskz_max_sd): Test new intrinsics. + * gcc.target/i386/avx512f-vmaxss-1.c (_mm_mask_max_ss) + (_mm_maskz_max_ss): Test new intrinsics. + * gcc.target/i386/avx512f-vmaxss-2.c (_mm_mask_max_ss) + (_mm_maskz_max_ss): Test new intrinsics. + * gcc.target/i386/avx512f-vminsd-1.c (_mm_mask_min_sd) + (_mm_maskz_min_sd): Test new intrinsics. + * gcc.target/i386/avx512f-vminsd-2.c (_mm_mask_min_sd) + (_mm_maskz_min_sd): Test new intrinsics. + * gcc.target/i386/avx512f-vminss-1.c (_mm_mask_min_ss) + (_mm_maskz_min_ss): Test new intrinsics. + * gcc.target/i386/avx512f-vminss-2.c (_mm_mask_min_ss) + (_mm_maskz_min_ss): Test new intrinsics. + +2017-05-31 Nathan Sidwell <nathan@acm.org> + + * g++.dg/lookup/lambda1.C New. + +2017-05-31 Bin Cheng <bin.cheng@arm.com> + + * gcc.dg/tree-ssa/ivopt_mult_4.c: Explicitly check comparison + on pointer should not be replaced. + +2017-05-31 Mikhail Maltsev <maltsevm@gmail.com> + + PR testsuite/80580 + * gcc.dg/gimplefe-error-7.c: New test. + +2017-05-31 Graham Markall <graham.markall@embecosm.com> + + * gcc.target/arc/add_n-combine.c: New test. + * gcc.target/arc/sub_n-combine.c: New test. + +2017-05-31 Richard Biener <rguenther@suse.de> + + PR target/80880 + * gcc.target/i386/pr80880.c: New testcase. + +2017-05-31 Richard Sandiford <richard.sandiford@linaro.org> + + * gcc.dg/vect/vect-103.c: Update wording of dump message. + +2017-05-31 Bin Cheng <bin.cheng@arm.com> + + * gcc.dg/vect/pr80815-3.c: New test. + +2017-05-31 Richard Biener <rguenther@suse.de> + + PR tree-optimization/80906 + * gcc.dg/graphite/pr80906.c: New testcase. + +2017-05-30 Tom de Vries <tom@codesourcery.com> + + PR testsuite/80910 + * gcc.target/x86_64/abi/ms-sysv/ms-sysv.exp: Exit with status + unsupported if host compiler does not support c++11. + (host_supports_c++11): New proc. + +2017-05-30 Martin Sebor <msebor@redhat.com> + + PR c/80731 + * g++.dg/ext/utf16-4.C: Relax test. + * gcc.dg/fixed-point/int-warning.c: Adjust. + +2017-05-30 David Malcolm <dmalcolm@redhat.com> + + * g++.dg/plugin/plugin.exp (plugin_test_list): Add... + * g++.dg/plugin/show-template-tree-color-no-elide-type.C: New + test case. + * g++.dg/plugin/show-template-tree-color.C: New test case. + * g++.dg/plugin/show_template_tree_color_plugin.c: New plugin. + * g++.dg/template/show-template-tree-2.C: New test case. + * g++.dg/template/show-template-tree-3.C: New test case. + * g++.dg/template/show-template-tree-4.C: New test case. + * g++.dg/template/show-template-tree-no-elide-type.C: New test case. + * g++.dg/template/show-template-tree.C: New test case. + +2017-05-30 Segher Boessenkool <segher@kernel.crashing.org> + + * gcc.target/powerpc/shift-dot.c: Delete -mgen-cell-microcode from + dg-options. + * gfortran.dg/pr80107.f: Delete testcase. + +2017-05-30 Uros Bizjak <ubizjak@gmail.com> + + PR target/80833 + * gcc.target/i386/pr80833-1.c: New test. + * gcc.target/i386/pr80833-2.c: Ditto. + +2017-05-30 Nathan Sidwell <nathan@acm.org> + + PR c++/80913 + * g++.dg/lookup/pr80913.C: New. + +2017-05-30 Richard Biener <rguenther@suse.de> + + PR middle-end/80901 + * gcc.dg/torture/pr80901.c: New testcase. + +2017-05-30 Robin Dapp <rdapp@linux.vnet.ibm.com> + + * gcc.target/s390/vector/vec-nopeel-2.c: New test. + +2017-05-30 Jozef Lawrynowicz <jozef.l@somniumtech.com> + + PR target/78838 + * gcc.target/msp430/interrupt_fn_placement.c: New test. + +2017-05-30 Richard Biener <rguenther@suse.de> + + PR middle-end/80876 + * gcc.dg/torture/pr80876.c: New testcase. + +2017-05-29 Nathan Sidwell <nathan@acm.org> + + PR c++/80891 (#5) + * g++.dg/lookup/pr80891-5.C: New. + +2017-05-29 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR libgfortran/53029 + * gfortran.dg/read_5.f90: New test. + 2017-05-29 Nathan Sidwell <nathan@acm.org> PR c++/80891 (#4) diff --git a/gcc/testsuite/c-c++-common/Wfloat-conversion.c b/gcc/testsuite/c-c++-common/Wfloat-conversion.c index e9899bce12b..c33a2a60c98 100644 --- a/gcc/testsuite/c-c++-common/Wfloat-conversion.c +++ b/gcc/testsuite/c-c++-common/Wfloat-conversion.c @@ -39,8 +39,8 @@ void h (void) vfloat = vdouble; /* { dg-warning "conversion from .double. to .float. may change value" } */ ffloat (vlongdouble); /* { dg-warning "conversion from .long double. to .float. may change value" } */ vfloat = vlongdouble; /* { dg-warning "conversion from .long double. to .float. may change value" } */ - fdouble (vlongdouble); /* { dg-warning "conversion from .long double. to .double. may change value" } */ - vdouble = vlongdouble; /* { dg-warning "conversion from .long double. to .double. may change value" } */ + fdouble (vlongdouble); /* { dg-warning "conversion from .long double. to .double. may change value" "" { target large_long_double } } */ + vdouble = vlongdouble; /* { dg-warning "conversion from .long double. to .double. may change value" "" { target large_long_double } } */ fsi (3.1f); /* { dg-warning "conversion from .float. to .int. changes value" } */ si = 3.1f; /* { dg-warning "conversion from .float. to .int. changes value" } */ diff --git a/gcc/testsuite/c-c++-common/Wsizeof-pointer-div.c b/gcc/testsuite/c-c++-common/Wsizeof-pointer-div.c new file mode 100644 index 00000000000..83116183902 --- /dev/null +++ b/gcc/testsuite/c-c++-common/Wsizeof-pointer-div.c @@ -0,0 +1,42 @@ +/* Test -Wsizeof-pointer-div warnings. */ +/* { dg-do compile } */ +/* { dg-options "-Wall" } */ + +int +f1 (int *array) +{ + int i; + i = sizeof array / sizeof *array; /* { dg-warning "does not compute the number of array elements" } */ + i += sizeof array / sizeof array[0]; /* { dg-warning "does not compute the number of array elements" } */ + i += sizeof(array) / sizeof(*array); /* { dg-warning "does not compute the number of array elements" } */ + i += sizeof(array) / sizeof(array[0]); /* { dg-warning "does not compute the number of array elements" } */ + i += (sizeof(array)) / (sizeof(array[0])); /* { dg-warning "does not compute the number of array elements" } */ + i += sizeof(array) / sizeof(int); /* { dg-warning "does not compute the number of array elements" } */ + i += sizeof(array) / sizeof(char); + i += sizeof(*array) / sizeof(char); + i += sizeof(array[0]) / sizeof(char); + return i; +} + +int +f2 (void) +{ + int array[10]; + int i; + i = sizeof array / sizeof *array; + i += sizeof array / sizeof array[0]; + i += sizeof(array) / sizeof(*array); + i += sizeof(array) / sizeof(array[0]); + i += (sizeof(array)) / (sizeof(array[0])); + i += sizeof(array) / sizeof(int); + i += sizeof(array) / sizeof(char); + i += sizeof(*array) / sizeof(char); + i += sizeof(array[0]) / sizeof(char); + return i; +} + +int +f3 (int a[]) +{ + return sizeof a / sizeof *a; /* { dg-warning "Wsizeof-array-argument" } */ +} diff --git a/gcc/testsuite/c-c++-common/gomp/pr81006.c b/gcc/testsuite/c-c++-common/gomp/pr81006.c new file mode 100644 index 00000000000..a826c5f5a53 --- /dev/null +++ b/gcc/testsuite/c-c++-common/gomp/pr81006.c @@ -0,0 +1,10 @@ +/* PR c/81006 */ +/* { dg-do compile } */ + +int a[] = {}; + +void foo() +{ + #pragma omp task depend(out: a[:]) /* { dg-error "zero length array section in .depend. clause" } */ + {} +} diff --git a/gcc/testsuite/c-c++-common/pr43395.c b/gcc/testsuite/c-c++-common/pr43395.c index f672c8c1994..d060ae2a968 100644 --- a/gcc/testsuite/c-c++-common/pr43395.c +++ b/gcc/testsuite/c-c++-common/pr43395.c @@ -1,5 +1,6 @@ /* PR c/43395 */ /* { dg-do compile } */ +/* { dg-require-effective-target label_values } */ void * foo (void) diff --git a/gcc/testsuite/c-c++-common/ubsan/align-10.c b/gcc/testsuite/c-c++-common/ubsan/align-10.c new file mode 100644 index 00000000000..56ae9ebfe30 --- /dev/null +++ b/gcc/testsuite/c-c++-common/ubsan/align-10.c @@ -0,0 +1,39 @@ +/* Limit this to known non-strict alignment targets. */ +/* { dg-do run { target { i?86-*-linux* x86_64-*-linux* } } } */ +/* { dg-options "-O -fsanitize=alignment -fsanitize-recover=alignment" } */ + +struct R { int a; } r; +struct S { struct R a; char b; long long c; short d[10]; }; +struct T { char a; long long b; }; +struct U { char a; int b; int c; long long d; struct S e; struct T f; } __attribute__((packed)); +struct V { long long a; struct S b; struct T c; struct U u; } v; + +__attribute__((noinline, noclone)) int +bar (int x, struct R y, struct R z) +{ + return x + y.a; +} + +__attribute__((noinline, noclone)) int +foo (struct S *p, struct S *q) +{ + int i = bar (0, r, r); + i += bar (1, p->a, r); + i += bar (2, r, q->a); + return i; +} + +int +main () +{ + char *p = (char *) &v.u.e; + struct S *q, *r; + asm volatile ("" : "=r" (q) : "0" (p)); + asm volatile ("" : "=r" (r) : "0" (p)); + if (foo (q, r) != 3) + __builtin_abort (); + return 0; +} + +/* { dg-output "\.c:21:\[0-9]*: \[^\n\r]*member access within misaligned address 0x\[0-9a-fA-F]* for type 'struct S', which requires \[48] byte alignment.*" } */ +/* { dg-output "\.c:22:\[0-9]*: \[^\n\r]*member access within misaligned address 0x\[0-9a-fA-F]* for type 'struct S', which requires \[48] byte alignment" } */ diff --git a/gcc/testsuite/c-c++-common/ubsan/null-13.c b/gcc/testsuite/c-c++-common/ubsan/null-13.c new file mode 100644 index 00000000000..59e0429490c --- /dev/null +++ b/gcc/testsuite/c-c++-common/ubsan/null-13.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-options "-fsanitize=null -fno-sanitize-recover=null -w" } */ +/* { dg-shouldfail "ubsan" } */ + +struct S { + int i; + long long j; + long long m; +}; +union U { + int k; + struct S l; +}; + +__attribute__((noinline, noclone)) int +foo (struct S s) +{ + return s.i + s.j + s.m; +} + +__attribute__((noinline, noclone)) int +bar (union U *u) +{ + foo (u->l); +} + +union U v; + +int +main (void) +{ + union U *u = 0; + asm volatile ("" : "+r" (u) : "r" (&v) : "memory"); + return bar (u); +} + +/* { dg-output "member access within null pointer of type 'union U'" } */ diff --git a/gcc/testsuite/c-c++-common/ubsan/pr66313.c b/gcc/testsuite/c-c++-common/ubsan/pr66313.c new file mode 100644 index 00000000000..7fd627dd40f --- /dev/null +++ b/gcc/testsuite/c-c++-common/ubsan/pr66313.c @@ -0,0 +1,26 @@ +/* { dg-do run } */ +/* { dg-options "-fsanitize=undefined -fsanitize-undefined-trap-on-error" } */ + +int __attribute__((noinline,noclone)) +f(int a, int b, int c) +{ + return a * b + a * c; +} +int __attribute__((noinline,noclone)) +g(int a) +{ + return a * (__INT_MAX__/2) + a * (__INT_MAX__/2 + 2); +} +int __attribute__((noinline,noclone)) +h(int a, int b) +{ + return a * (__INT_MAX__/2 + 1) + b * (__INT_MAX__/2 + 1); +} +int main() +{ + volatile int tem = f(0, __INT_MAX__, __INT_MAX__); + tem = f(-1, __INT_MAX__/2 + 1, __INT_MAX__/2 + 1); + tem = g(-1); + tem = h(-1, -1); + return 0; +} diff --git a/gcc/testsuite/c-c++-common/ubsan/pr80932.c b/gcc/testsuite/c-c++-common/ubsan/pr80932.c new file mode 100644 index 00000000000..92903f7e0ee --- /dev/null +++ b/gcc/testsuite/c-c++-common/ubsan/pr80932.c @@ -0,0 +1,17 @@ +/* PR sanitizer/80932 */ +/* { dg-do run } */ +/* { dg-options "-fsanitize=undefined -fsanitize-undefined-trap-on-error" } */ + +int x = 1; + +int +foo (void) +{ + return ((int) (2855545792U * x) - (int) (3269399503U * x)) * -5; +} + +int +main () +{ + foo (); +} diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-targ.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-targ.C index b5171141f94..98bb502249a 100644 --- a/gcc/testsuite/g++.dg/cpp0x/constexpr-targ.C +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-targ.C @@ -10,4 +10,4 @@ struct B { }; constexpr A a { }; -B<a> b; // { dg-error "template argument|invalid type" } +B<a> b; // { dg-error "template argument|converted constant" } diff --git a/gcc/testsuite/g++.dg/cpp0x/nullptr38.C b/gcc/testsuite/g++.dg/cpp0x/nullptr38.C new file mode 100644 index 00000000000..82d75ed2816 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/nullptr38.C @@ -0,0 +1,9 @@ +// { dg-do compile { target c++11 } } + +using nullptr_t = decltype(nullptr); + +constexpr nullptr_t n = nullptr; + +template <void *> struct A { }; + +A<n> a; diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-68754.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-68754.C new file mode 100644 index 00000000000..e72acb1baa3 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/constexpr-68754.C @@ -0,0 +1,7 @@ +// PR c++/68754 +// { dg-do compile { target c++14 } } + +struct base { }; +struct derived : base { + constexpr derived& operator=(derived const&) = default; +}; diff --git a/gcc/testsuite/g++.dg/cpp1z/class-deduction39.C b/gcc/testsuite/g++.dg/cpp1z/class-deduction39.C new file mode 100644 index 00000000000..98a3664f5b2 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/class-deduction39.C @@ -0,0 +1,15 @@ +// { dg-options -std=c++1z } + +template <class T> struct A { }; + +A<int> a; +const A c = a; +volatile A v = a; +const volatile A cv = a; + +template <class,class> struct same; +template <class T> struct same<T,T> {}; + +same<decltype(c), const A<int>> s1; +same<decltype(v), volatile A<int>> s2; +same<decltype(cv), const volatile A<int>> s3; diff --git a/gcc/testsuite/g++.dg/cpp1z/lambda-this3.C b/gcc/testsuite/g++.dg/cpp1z/lambda-this3.C new file mode 100644 index 00000000000..b5a1fc63a53 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/lambda-this3.C @@ -0,0 +1,10 @@ +// { dg-options -std=c++1z } + +struct S { + int i; + constexpr S() : i(5) { + ([*this] () { return i + 10; }()); + } + constexpr operator int() const { return i; } +}; +constexpr int x = S(); diff --git a/gcc/testsuite/g++.dg/cpp1z/nodiscard5.C b/gcc/testsuite/g++.dg/cpp1z/nodiscard5.C new file mode 100644 index 00000000000..fa9a974355b --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/nodiscard5.C @@ -0,0 +1,7 @@ +// PR c++/80896 +// { dg-do compile { target c++11 } } + +int x = 42; +[[nodiscard]] int& func() { return x; } + +int main() { func(); } // { dg-warning "ignoring return value" } diff --git a/gcc/testsuite/g++.dg/cpp1z/noexcept-type15.C b/gcc/testsuite/g++.dg/cpp1z/noexcept-type15.C new file mode 100644 index 00000000000..cc5a3edf1e4 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/noexcept-type15.C @@ -0,0 +1,11 @@ +// PR c++/80384 +// { dg-options -std=c++17 } + +template<class> struct foo; +template<bool B> +struct foo<int() noexcept(B)> { + static const bool value = B; +}; + +static_assert(!foo<int()>::value); +static_assert(foo<int() noexcept>::value); diff --git a/gcc/testsuite/g++.dg/ext/utf16-4.C b/gcc/testsuite/g++.dg/ext/utf16-4.C index 2c4377cea5d..e32c5edb573 100644 --- a/gcc/testsuite/g++.dg/ext/utf16-4.C +++ b/gcc/testsuite/g++.dg/ext/utf16-4.C @@ -13,6 +13,6 @@ const static char16_t c5 = U'\u2029'; const static char16_t c6 = U'\U00064321'; /* { dg-warning "conversion from .char32_t. to .char16_t. changes value from .410401. to .17185." } */ const static char16_t c7 = L'a'; const static char16_t c8 = L'\u2029'; -const static char16_t c9 = L'\U00064321'; /* { dg-warning "unsigned conversion from .wchar_t. to .char16_t. changes value from .410401. to .17185." "" { target { 4byte_wchar_t } } } */ +const static char16_t c9 = L'\U00064321'; /* { dg-warning "conversion from .wchar_t. to .char16_t. changes value from .410401. to .17185." "" { target { 4byte_wchar_t } } } */ /* { dg-warning "constant too long" "" { target { ! 4byte_wchar_t } } .-1 } */ int main () {} diff --git a/gcc/testsuite/g++.dg/gomp/pr81011.C b/gcc/testsuite/g++.dg/gomp/pr81011.C new file mode 100644 index 00000000000..4abd609596c --- /dev/null +++ b/gcc/testsuite/g++.dg/gomp/pr81011.C @@ -0,0 +1,19 @@ +// PR c++/81011 +// { dg-do compile } + +class A { A (const A&); }; // { dg-message "declared private here" } +void foo (const A&); + +void +bar (A& a) +{ +#pragma omp task // { dg-error "is private within this context" } + foo (a); +} + +void +baz (A& a) +{ +#pragma omp task firstprivate (a) // { dg-error "is private within this context" } + foo (a); +} diff --git a/gcc/testsuite/g++.dg/lookup/lambda1.C b/gcc/testsuite/g++.dg/lookup/lambda1.C new file mode 100644 index 00000000000..1cf450e363f --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/lambda1.C @@ -0,0 +1,13 @@ +// { dg-do compile { target c++11 } } + +namespace std +{ + typedef int I; +} + +void foo () +{ + using namespace std; + + auto l = [] (I) {}; +} diff --git a/gcc/testsuite/g++.dg/lookup/pr80891-5.C b/gcc/testsuite/g++.dg/lookup/pr80891-5.C new file mode 100644 index 00000000000..ebf64f8758e --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/pr80891-5.C @@ -0,0 +1,68 @@ +// PR c++/80891 part 4 + +// ICE copying an augmented lookup during ADL + +struct __normal_iterator get(); // { dg-message "candidate: .__normal_iterator get\\(\\)." } +namespace boost { +template <class> void get(); // { dg-message "candidate: .template<class> void boost::get\\(\\)." } +struct A { + A(int); +}; +enum problem_selector { subgraph_iso }; +template <typename, typename, typename, typename, + typename SubGraphIsoMapCallback, problem_selector> +struct B { + B(A, A, int, int, int, int); + void m_fn1(SubGraphIsoMapCallback p1) { + __normal_iterator __trans_tmp_1(); + p1(__trans_tmp_1, 0); + } +}; +template <typename Graph1, typename Graph2, typename IndexMap1, + typename IndexMap2, typename VertexOrder1, + typename EdgeEquivalencePredicate, + typename VertexEquivalencePredicate, typename SubGraphIsoMapCallback, + problem_selector problem_selection> +void match( + Graph1, Graph2, SubGraphIsoMapCallback p3, VertexOrder1, + B<IndexMap1, IndexMap2, EdgeEquivalencePredicate, + VertexEquivalencePredicate, SubGraphIsoMapCallback, problem_selection> + p5) { + p5.m_fn1(p3); +} +template <problem_selector problem_selection, typename GraphSmall, + typename GraphLarge, typename IndexMapSmall, typename IndexMapLarge, + typename VertexOrderSmall, typename EdgeEquivalencePredicate, + typename VertexEquivalencePredicate, typename SubGraphIsoMapCallback> +void vf2_subgraph_morphism(GraphSmall, GraphLarge, SubGraphIsoMapCallback p3, + IndexMapSmall, IndexMapLarge, VertexOrderSmall, + EdgeEquivalencePredicate, + VertexEquivalencePredicate) { + B<IndexMapSmall, IndexMapLarge, EdgeEquivalencePredicate, + VertexEquivalencePredicate, SubGraphIsoMapCallback, problem_selection> + s(0, 0, 0, 0, 0, 0); + match(0, 0, p3, 0, s); +} +template <typename GraphSmall, typename GraphLarge, typename IndexMapSmall, + typename IndexMapLarge, typename VertexOrderSmall, + typename EdgeEquivalencePredicate, + typename VertexEquivalencePredicate, typename SubGraphIsoMapCallback> +int vf2_subgraph_iso(GraphSmall, GraphLarge, SubGraphIsoMapCallback p3, + IndexMapSmall, IndexMapLarge, VertexOrderSmall, + EdgeEquivalencePredicate, VertexEquivalencePredicate) { + vf2_subgraph_morphism<subgraph_iso>(0, 0, p3, 0, 0, 0, 0, 0); +} +} +using namespace boost; +struct C { + C(int) : graph1_(0), graph2_(0) {} + template <typename CorrespondenceMap1To2, typename CorrespondenceMap2To1> + void operator()(CorrespondenceMap1To2 p1, CorrespondenceMap2To1) { + get(p1); // { dg-error "no matching function" } + } + A graph1_; + A graph2_; +}; +template <typename> void get(); // { dg-message "candidate: .template<class> void get\\(\\)." } +void test_vf2_sub_graph_iso() { C a(vf2_subgraph_iso(0, 0, a, 0, 0, 0, 0, 0)); +} diff --git a/gcc/testsuite/g++.dg/lookup/pr80913.C b/gcc/testsuite/g++.dg/lookup/pr80913.C new file mode 100644 index 00000000000..a7866bcc8a3 --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/pr80913.C @@ -0,0 +1,11 @@ +// PR 80913 infinite look on spelling corrector caused by incorrectly +// chained decl + +extern int meminfo (); +struct meminfo {}; + +void frob () +{ + meminf (); // { dg-error "not declared" } + // { dg-message "suggested alternative" "" { target *-*-* } .-1 } +} diff --git a/gcc/testsuite/g++.dg/lookup/pr80979.C b/gcc/testsuite/g++.dg/lookup/pr80979.C new file mode 100644 index 00000000000..eb22f71773c --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/pr80979.C @@ -0,0 +1,26 @@ +// pr C++/80979 ICE with late discovery of using directives during ADL +// of a friend declaration. + +namespace Tiny { + class Handsome {}; + void Dahl (Handsome &, Handsome &); + + namespace Jack { + class Vladof { + friend void Dahl (Vladof &, Vladof &); + }; + void Dahl (Vladof &, Vladof &); + } + + struct BDonk {}; + + namespace Tina { + void Dahl (BDonk &, Jack::Vladof &); + } + using Tina::Dahl; +} + +void BoomBoom (Tiny::BDonk &vault, Tiny::Jack::Vladof &hunter) +{ + Dahl (vault, hunter); +} diff --git a/gcc/testsuite/g++.dg/plugin/comment_plugin.c b/gcc/testsuite/g++.dg/plugin/comment_plugin.c new file mode 100644 index 00000000000..c3b08e34dc7 --- /dev/null +++ b/gcc/testsuite/g++.dg/plugin/comment_plugin.c @@ -0,0 +1,63 @@ +/* Test of cpp_callbacks::comments. */ + +#include "gcc-plugin.h" +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "cpplib.h" +#include "diagnostic.h" +#include "c-family/c-pragma.h" + +int plugin_is_GPL_compatible; + +/* Test callback for cpp_callbacks::comments. */ + +void +my_comment_cb (cpp_reader *, source_location loc, + const unsigned char *content, size_t len) +{ + if (in_system_header_at (loc)) + return; + + /* CONTENT contains the opening slash-star (or slash-slash), + and for C-style comments contains the closing star-slash. */ + gcc_assert (len >= 2); + gcc_assert (content[0] == '/'); + gcc_assert (content[1] == '*' || content[1] == '/'); + bool c_style = (content[1] == '*'); + if (c_style) + { + gcc_assert (content[len - 2] == '*'); + gcc_assert (content[len - 1] == '/'); + } + + if (c_style) + inform (loc, "got C-style comment; length=%i", len); + else + inform (loc, "got C++-style comment; length=%i", len); + + /* Print the content of the comment. + For a C-style comment, the buffer CONTENT contains the opening + slash-star and closing star-slash, so we can't directly verify + it in the DejaGnu test without adding another comment, which + would trigger this callback again. + Hence we skip the syntactically-significant parts of the comment + when printing it. */ + fprintf (stderr, "stripped content of comment: >"); + /* Avoid printing trailing star-slash. */ + if (c_style) + len -= 2; + for (size_t i = 2; i < len; i++) + fputc (content[i], stderr); + fprintf (stderr, "<\n"); +} + +int +plugin_init (struct plugin_name_args *plugin_info, + struct plugin_gcc_version *version) +{ + cpp_callbacks *cb = cpp_get_callbacks (parse_in); + cb->comment = my_comment_cb; + + return 0; +} diff --git a/gcc/testsuite/g++.dg/plugin/comments-1.C b/gcc/testsuite/g++.dg/plugin/comments-1.C new file mode 100644 index 00000000000..0821b14c03a --- /dev/null +++ b/gcc/testsuite/g++.dg/plugin/comments-1.C @@ -0,0 +1,49 @@ +/* Example of a one-line C-style comment. */ +#if 0 +{ dg-message "1: got C-style comment; length=45" "" { target *-*-* } .-2 } +{ dg-begin-multiline-output "" } +stripped content of comment: > Example of a one-line C-style comment. < +{ dg-end-multiline-output "" } +#endif + + /*Another example of a one-line C-style comment.*/ +#if 0 +{ dg-message "6: got C-style comment; length=50" "" { target *-*-* } .-2 } +{ dg-begin-multiline-output "" } +stripped content of comment: >Another example of a one-line C-style comment.< +{ dg-end-multiline-output "" } +#endif + +/**/ +#if 0 +{ dg-message "1: got C-style comment; length=4" "" { target *-*-* } .-2 } +{ dg-begin-multiline-output "" } +stripped content of comment: >< +{ dg-end-multiline-output "" } +#endif + +/* Example of a + multi-line C-style comment. */ +#if 0 +{ dg-message "1: got C-style comment; length=50" "" { target *-*-* } .-3 } +{ dg-begin-multiline-output "" } +stripped content of comment: > Example of a + multi-line C-style comment. < +{ dg-end-multiline-output "" } +#endif + +// Example of a C++-style comment +#if 0 +{ dg-message "1: got C\\+\\+-style comment; length=33" "" { target *-*-* } .-2 } +{ dg-begin-multiline-output "" } +stripped content of comment: > Example of a C++-style comment< +{ dg-end-multiline-output "" } +#endif + +// +#if 0 +{ dg-message "1: got C\\+\\+-style comment; length=2" "" { target *-*-* } .-2 } +{ dg-begin-multiline-output "" } +stripped content of comment: >< +{ dg-end-multiline-output "" } +#endif diff --git a/gcc/testsuite/g++.dg/plugin/plugin.exp b/gcc/testsuite/g++.dg/plugin/plugin.exp index 6a0c1aa504c..e40cba328c5 100644 --- a/gcc/testsuite/g++.dg/plugin/plugin.exp +++ b/gcc/testsuite/g++.dg/plugin/plugin.exp @@ -65,6 +65,10 @@ set plugin_test_list [list \ { def_plugin.c def-plugin-test.C } \ { ../../gcc.dg/plugin/diagnostic_plugin_test_tree_expression_range.c \ diagnostic-test-expressions-1.C } \ + { show_template_tree_color_plugin.c \ + show-template-tree-color.C \ + show-template-tree-color-no-elide-type.C } \ + { comment_plugin.c comments-1.C } \ ] foreach plugin_test $plugin_test_list { diff --git a/gcc/testsuite/g++.dg/plugin/show-template-tree-color-no-elide-type.C b/gcc/testsuite/g++.dg/plugin/show-template-tree-color-no-elide-type.C new file mode 100644 index 00000000000..cab0359f240 --- /dev/null +++ b/gcc/testsuite/g++.dg/plugin/show-template-tree-color-no-elide-type.C @@ -0,0 +1,30 @@ +/* Verify colorization of the output of -fdiagnostics-show-template-tree, + and within the %H and %I format codes. + Doing so requires a plugin; see the comments in the plugin for the + rationale. */ + +// { dg-options "-fdiagnostics-show-template-tree -fdiagnostics-color=always -fno-elide-type" } + +template<typename> struct vector {}; +template<typename, typename> struct map {}; + +void fn_1(vector<int>); +void fn_2(map<int, int>); + +void test () +{ + fn_1 (vector<double> ()); + /* { dg-begin-multiline-output "" } +could not convert '[01m[Kvector<double>()[m[K' from '[01m[Kvector<[01;32m[Kdouble[m[K>[m[K' to '[01m[Kvector<[01;32m[Kint[m[K>[m[K' + vector< + [[01;32m[Kdouble[m[K != [01;32m[Kint[m[K]> + { dg-end-multiline-output "" } */ + + fn_2 (map<int, double>()); + /* { dg-begin-multiline-output "" } +could not convert '[01m[Kmap<int, double>()[m[K' from '[01m[Kmap<int,[01;32m[Kdouble[m[K>[m[K' to '[01m[Kmap<int,[01;32m[Kint[m[K>[m[K' + map< + int, + [[01;32m[Kdouble[m[K != [01;32m[Kint[m[K]> + { dg-end-multiline-output "" } */ +} diff --git a/gcc/testsuite/g++.dg/plugin/show-template-tree-color.C b/gcc/testsuite/g++.dg/plugin/show-template-tree-color.C new file mode 100644 index 00000000000..eb99a3ed8da --- /dev/null +++ b/gcc/testsuite/g++.dg/plugin/show-template-tree-color.C @@ -0,0 +1,30 @@ +/* Verify colorization of the output of -fdiagnostics-show-template-tree, + and within the %H and %I format codes. + Doing so requires a plugin; see the comments in the plugin for the + rationale. */ + +// { dg-options "-fdiagnostics-show-template-tree -fdiagnostics-color=always" } + +template<typename> struct vector {}; +template<typename, typename> struct map {}; + +void fn_1(vector<int>); +void fn_2(map<int, int>); + +void test () +{ + fn_1 (vector<double> ()); + /* { dg-begin-multiline-output "" } +could not convert '[01m[Kvector<double>()[m[K' from '[01m[Kvector<[01;32m[Kdouble[m[K>[m[K' to '[01m[Kvector<[01;32m[Kint[m[K>[m[K' + vector< + [[01;32m[Kdouble[m[K != [01;32m[Kint[m[K]> + { dg-end-multiline-output "" } */ + + fn_2 (map<int, double>()); + /* { dg-begin-multiline-output "" } +could not convert '[01m[Kmap<int, double>()[m[K' from '[01m[Kmap<[...],[01;32m[Kdouble[m[K>[m[K' to '[01m[Kmap<[...],[01;32m[Kint[m[K>[m[K' + map< + [...], + [[01;32m[Kdouble[m[K != [01;32m[Kint[m[K]> + { dg-end-multiline-output "" } */ +} diff --git a/gcc/testsuite/g++.dg/plugin/show_template_tree_color_plugin.c b/gcc/testsuite/g++.dg/plugin/show_template_tree_color_plugin.c new file mode 100644 index 00000000000..af568bf622a --- /dev/null +++ b/gcc/testsuite/g++.dg/plugin/show_template_tree_color_plugin.c @@ -0,0 +1,38 @@ +/* We want to verify the colorized output of cxx_format_postprocessor, + but turning on colorization for everything confuses "dg-error" etc. + The color codes in the generated messages would also need escaping + for use within dg-error. + + Hence the simplest approach is to provide a custom diagnostic_starter_fn, + which does nothing. + + The resulting messages lack the "FILENAME:LINE:COL: error: " prefix + and can thus be tested using dg-begin/end-multiline-output. */ + +/* { dg-options "-O" } */ + +#include "gcc-plugin.h" +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "plugin-version.h" +#include "diagnostic.h" + +int plugin_is_GPL_compatible; + +void +noop_starter_fn (diagnostic_context *, diagnostic_info *) +{ +} + +int +plugin_init (struct plugin_name_args *plugin_info, + struct plugin_gcc_version *version) +{ + if (!plugin_default_version_check (version, &gcc_version)) + return 1; + + diagnostic_starter (global_dc) = noop_starter_fn; + + return 0; +} diff --git a/gcc/testsuite/g++.dg/pr45330.C b/gcc/testsuite/g++.dg/pr45330.C index f89d1e5c93b..f16094d93f1 100644 --- a/gcc/testsuite/g++.dg/pr45330.C +++ b/gcc/testsuite/g++.dg/pr45330.C @@ -1,17 +1,26 @@ -// { dg-do compile } -// Search std, __cxxabiv1, and global namespaces, plus one more. -// { dg-options "--param cxx-max-namespaces-for-diagnostic-help=4" } +// { dg-do compile { target c++11 } } +// Search std, __cxxabiv1, and global namespaces, plus two more, +// breadth first -#define NSPACE(NAME) namespace NAME { int foo; } +// { dg-options "--param cxx-max-namespaces-for-diagnostic-help=5" } + +// ::, std and __cxxabiv1 namespace A { int foo; // { dg-message "A::foo" "suggested alternative" } + namespace A0 + { + int foo; // not me + } } namespace B { - int foo; + inline namespace I + { + int foo; // { dg-message "B::I::foo" "suggested alternative" } + } } namespace C @@ -32,6 +41,6 @@ namespace E int bar() { return foo; // { dg-error "was not declared" } - // { dg-message "maximum limit of 4 namespaces" "maximum limit" { target *-*-* } .-1 } + // { dg-message "maximum limit of 5 namespaces" "maximum limit" { target *-*-* } .-1 } // { dg-message "suggested alternative" "suggested alternative" { target *-*-* } .-2 } } diff --git a/gcc/testsuite/g++.dg/pr81007.C b/gcc/testsuite/g++.dg/pr81007.C new file mode 100644 index 00000000000..87d7d40b913 --- /dev/null +++ b/gcc/testsuite/g++.dg/pr81007.C @@ -0,0 +1,15 @@ +// { dg-do compile } +// { dg-options "-O2" } + +struct A +{ + A p; // { dg-error "incomplete" } + virtual void foo(); +}; + +struct B : A {}; + +void bar(B& b) +{ + b.foo(); +} diff --git a/gcc/testsuite/g++.dg/template/crash106.C b/gcc/testsuite/g++.dg/template/crash106.C index 5bef101e598..8d972699900 100644 --- a/gcc/testsuite/g++.dg/template/crash106.C +++ b/gcc/testsuite/g++.dg/template/crash106.C @@ -11,4 +11,4 @@ template<T N = 0, void (A::*)() = &A::foo<N> > struct B {}; // { dg-error "type| B<> b; // { dg-message "non-type" } -// { dg-prune-output "could not convert" } +// { dg-prune-output "(could not convert|no matches)" } diff --git a/gcc/testsuite/g++.dg/template/crash84.C b/gcc/testsuite/g++.dg/template/crash84.C index 103e90a7076..b3099d931c2 100644 --- a/gcc/testsuite/g++.dg/template/crash84.C +++ b/gcc/testsuite/g++.dg/template/crash84.C @@ -14,7 +14,7 @@ void foo () { a<int> a1; // OK - a<int>::b<a,int> b1; // { dg-error "template argument" } + a<int>::b<a,int> b1; // { dg-error "template argument|converted constant" } } // { dg-prune-output "invalid type in declaration" } diff --git a/gcc/testsuite/g++.dg/template/crash87.C b/gcc/testsuite/g++.dg/template/crash87.C index 7b8bf4ada0d..af81edbfd80 100644 --- a/gcc/testsuite/g++.dg/template/crash87.C +++ b/gcc/testsuite/g++.dg/template/crash87.C @@ -17,7 +17,7 @@ template <bool name> class BUG2 : BUG { public: - typedef BUG1_5<name> ptr; // { dg-error "could not convert template argument" } + typedef BUG1_5<name> ptr; // { dg-error "convert" } }; int main() diff --git a/gcc/testsuite/g++.dg/template/dependent-args1.C b/gcc/testsuite/g++.dg/template/dependent-args1.C index a540e55f4e5..8fffbf85317 100644 --- a/gcc/testsuite/g++.dg/template/dependent-args1.C +++ b/gcc/testsuite/g++.dg/template/dependent-args1.C @@ -10,4 +10,4 @@ template<int N, void (A::*)() = &A::foo<N> > struct B {}; B<int> b; // { dg-error "type/value mismatch|expected a constant|invalid type" } -// { dg-prune-output "could not convert" } +// { dg-prune-output "(could not convert|no match)" } diff --git a/gcc/testsuite/g++.dg/template/function1.C b/gcc/testsuite/g++.dg/template/function1.C index f2345855ed9..4bab2e4e9bf 100644 --- a/gcc/testsuite/g++.dg/template/function1.C +++ b/gcc/testsuite/g++.dg/template/function1.C @@ -1,10 +1,8 @@ // PR c++/38647 -// { dg-do compile { target { ! c++1z } } } -// { dg-prune-output "note" } template<const char *, int> struct A {}; const char func[] = "abc"; -template<int N> struct A<func, N> {}; // { dg-error "cannot appear|is invalid|not a valid|constant expression" } +template<int N> struct A<func, N> {}; // { dg-error "cannot appear|is invalid|not a valid|constant expression" "" { target c++98_only } } char a1[1]; A<a1, 0> a; diff --git a/gcc/testsuite/g++.dg/template/local-fn2.C b/gcc/testsuite/g++.dg/template/local-fn2.C new file mode 100644 index 00000000000..98525fd8d02 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/local-fn2.C @@ -0,0 +1,21 @@ +// PR c++/80856 +// { dg-do compile { target c++11 } } + +template<typename T> +inline T WrapToCycle(T degrees) +{ + int Wrap(int x, int lower_bound, int upper_bound); + + auto p = Wrap; + p (1, 0, 360); + + double Wrap(double x, int lower_bound, int upper_bound); + + Wrap(1, 0, 360); + return Wrap(degrees, 0, 360); +} + +void GenerateOldReportPage() +{ + WrapToCycle(0); +} diff --git a/gcc/testsuite/g++.dg/template/nontype-array1.C b/gcc/testsuite/g++.dg/template/nontype-array1.C new file mode 100644 index 00000000000..f22551b0f1a --- /dev/null +++ b/gcc/testsuite/g++.dg/template/nontype-array1.C @@ -0,0 +1,41 @@ +// { dg-do compile { target c++11 } } + +template <char const* STR> +class Message { +}; + +extern char const s1[] = "hi"; +char const s2[] = "hi"; +constexpr char const s3[] = "hi"; // OK since C++11 + +constexpr char const * f() { return s3; } + +using fn_p = char const * (*)(); +template <fn_p> struct A { }; +constexpr fn_p f2() { return f; } + +struct B +{ + constexpr B() { } + constexpr operator const char *() { return s3; } +}; + +int main() +{ + Message<s1> m1; // OK (all versions) + Message<s2> m2; // OK for clang since C++14, for gcc since C++17 + Message<s3> m3; // OK for clang/gcc since C++11 + + A<f2()> a1; // { dg-error "" "" { target c++14_down } } + + static char const s4[] = "hi"; + static constexpr char const s5[] = "hi"; // OK since C++11 + Message<s4> m4; // { dg-error "no linkage" "" { target c++14_down } } + Message<s5> m5; // { dg-error "no linkage" "" { target c++14_down } } + Message<f()> m6; // { dg-error "" "" { target c++14_down } } + Message<B{}> m7; // { dg-error "" "" { target c++14_down } } + + + char const s8[] = "hi"; + Message<s8> m8; // { dg-error "" } +} diff --git a/gcc/testsuite/g++.dg/template/nontype13.C b/gcc/testsuite/g++.dg/template/nontype13.C index d604da94454..3250109aa4a 100644 --- a/gcc/testsuite/g++.dg/template/nontype13.C +++ b/gcc/testsuite/g++.dg/template/nontype13.C @@ -11,7 +11,7 @@ struct Dummy template<bool B> void tester() { - bar<evil>()(); // { dg-error "constant|template" } + bar<evil>()(); // { dg-error "constant|template|convert" } } template<bool B> struct bar diff --git a/gcc/testsuite/g++.dg/template/nontype21.C b/gcc/testsuite/g++.dg/template/nontype21.C index 69cab54f412..508f9090240 100644 --- a/gcc/testsuite/g++.dg/template/nontype21.C +++ b/gcc/testsuite/g++.dg/template/nontype21.C @@ -4,4 +4,4 @@ template<char const * const x> class Something { }; extern char const xyz; -class SomethingElse:public Something<xyz> { }; // { dg-error "xyz. is a variable" } +class SomethingElse:public Something<xyz> { }; // { dg-error "" } diff --git a/gcc/testsuite/g++.dg/template/nontype26.C b/gcc/testsuite/g++.dg/template/nontype26.C index 763d987dd39..588ce1cc23a 100644 --- a/gcc/testsuite/g++.dg/template/nontype26.C +++ b/gcc/testsuite/g++.dg/template/nontype26.C @@ -7,7 +7,7 @@ template<int& i> void doit() { template<const int& i> class X { public: void foo() { - doit<i>(); // { dg-error "cv-qualification|no matching" } + doit<i>(); // { dg-error "qualifi|template arg|no matching" } } }; diff --git a/gcc/testsuite/g++.dg/template/ptrmem20.C b/gcc/testsuite/g++.dg/template/ptrmem20.C index 2d2453d73db..e17ed84c739 100644 --- a/gcc/testsuite/g++.dg/template/ptrmem20.C +++ b/gcc/testsuite/g++.dg/template/ptrmem20.C @@ -12,5 +12,5 @@ template<void (A::*)()> void bar(); // { dg-message "note" } void baz() { - bar<&B::foo>(); // { dg-error "not a valid template argument|no match" } + bar<&B::foo>(); // { dg-error "template argument|no match" } } diff --git a/gcc/testsuite/g++.dg/template/ptrmem8.C b/gcc/testsuite/g++.dg/template/ptrmem8.C index 85ffa4a6e8d..b759b7077d5 100644 --- a/gcc/testsuite/g++.dg/template/ptrmem8.C +++ b/gcc/testsuite/g++.dg/template/ptrmem8.C @@ -15,10 +15,8 @@ template <int (D::*fun)() const> int Get(); // { dg-message "note" } int main () { - Get<&B::I>(); // { dg-error "not a valid template argument" "not valid" } + Get<&B::I>(); // { dg-error "template argument|converted constant" "not valid" } // { dg-error "no match" "no match" { target *-*-* } .-1 } - // { dg-message "note" "note" { target *-*-* } .-2 } - Get<&D::I>(); // { dg-error "not a valid template argument" "not valid" } + Get<&D::I>(); // { dg-error "template argument|converted constant" "not valid" } // { dg-error "no match" "no match" { target *-*-* } .-1 } - // { dg-message "note" "note" { target *-*-* } .-2 } } diff --git a/gcc/testsuite/g++.dg/template/ref10.C b/gcc/testsuite/g++.dg/template/ref10.C new file mode 100644 index 00000000000..60e91d053a0 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/ref10.C @@ -0,0 +1,13 @@ +// PR c++/80840 +// { dg-do compile { target c++11 } } + +template <class T, T X> +struct Just; + +template <const double& X> +struct Number { + static constexpr double value = X; + using result = Just<const double&, value>; +}; + +int main() {} diff --git a/gcc/testsuite/g++.dg/template/show-template-tree-2.C b/gcc/testsuite/g++.dg/template/show-template-tree-2.C new file mode 100644 index 00000000000..1cd3a06bbbf --- /dev/null +++ b/gcc/testsuite/g++.dg/template/show-template-tree-2.C @@ -0,0 +1,118 @@ +// Tests of -fdiagnostics-show-template-tree with variadic templates +// { dg-options "-fdiagnostics-show-template-tree -std=c++11" } + +template<typename> struct vector {}; +template<typename, typename> struct map {}; +template<typename ... Types> struct var {}; + +void fn_0(var<>); +void fn_1(var<int>); +void fn_2(var<int, int>); +void fn_3(vector<var<> >); +void fn_4(vector<var<int> >); +void fn_5(vector<var<int, int> >); + +void test_fn_0 () +{ + fn_0 (var<> ()); + fn_0 (var<int> ()); // { dg-error "could not convert .* from 'var<int>' to 'var<>'" } + /* { dg-begin-multiline-output "" } + var< + [int != ]> + { dg-end-multiline-output "" } */ + fn_0 (var<int, int> ()); // { dg-error "could not convert .* from 'var<int, int>' to 'var<>'" } + /* { dg-begin-multiline-output "" } + var< + [int, int != ]> + { dg-end-multiline-output "" } */ + fn_0 (vector<var<int> >()); // { dg-error "could not convert .* from 'vector<var<int> >' to 'var<>'" } + fn_0 (vector<var<int, int> >()); // { dg-error "could not convert .* from 'vector<var<int, int> >' to 'var<>'" } +} + +void test_fn_1 () +{ + fn_1 (var<> ()); // { dg-error "could not convert .* from 'var<>' to 'var<int>'" } + /* { dg-begin-multiline-output "" } + var< + [ != int]> + { dg-end-multiline-output "" } */ + fn_1 (var<int> ()); + fn_1 (var<int, int> ()); // { dg-error "could not convert .* from 'var<int, int>' to 'var<int>'" } + /* { dg-begin-multiline-output "" } + var< + [int, int != int]> + { dg-end-multiline-output "" } */ + fn_1 (vector<var<int> >()); // { dg-error "could not convert .* from 'vector<var<int> >' to 'var<int>'" } + fn_1 (vector<var<int, int> >()); // { dg-error "could not convert .* from 'vector<var<int, int> >' to 'var<int>'" } +} + +void test_fn_2 () +{ + fn_2 (var<> ()); // { dg-error "could not convert .* from 'var<>' to 'var<int, int>'" } + /* { dg-begin-multiline-output "" } + var< + [ != int, int]> + { dg-end-multiline-output "" } */ + fn_2 (var<int> ()); // { dg-error "could not convert .* from 'var<int>' to 'var<int, int>'" } + /* { dg-begin-multiline-output "" } + var< + [int != int, int]> + { dg-end-multiline-output "" } */ + fn_2 (var<int, int> ()); + fn_2 (vector<var<int> >()); // { dg-error "could not convert .* from 'vector<var<int> >' to 'var<int, int>'" } + fn_2 (vector<var<int, int> >()); // { dg-error "could not convert .* from 'vector<var<int, int> >' to 'var<int, int>'" } +} + +void test_fn_3 () +{ + fn_3 (var<> ()); // { dg-error "could not convert .* from 'var<>' to 'vector<var<> >'" } + fn_3 (var<int> ()); // { dg-error "could not convert .* from 'var<int>' to 'vector<var<> >'" } + fn_3 (var<int, int> ()); // { dg-error "could not convert .* from 'var<int, int>' to 'vector<var<> >'" } + fn_3 (vector<var<> >()); + fn_3 (vector<var<int> >()); // { dg-error "could not convert .* from 'vector<var<int>>' to 'vector<var<>>'" } + /* { dg-begin-multiline-output "" } + vector< + var< + [int != ]>> + { dg-end-multiline-output "" } */ + fn_3 (vector<var<int, int> >()); // { dg-error "could not convert .* from 'vector<var<int, int>>' to 'vector<var<>>'" } + /* { dg-begin-multiline-output "" } + vector< + var< + [int, int != ]>> + { dg-end-multiline-output "" } */ +} + +void test_fn_4 () +{ + fn_4 (var<> ()); // { dg-error "could not convert .* from 'var<>' to 'vector<var<int> >'" } + fn_4 (var<int> ()); // { dg-error "could not convert .* from 'var<int>' to 'vector<var<int> >'" } + fn_4 (var<int, int> ()); // { dg-error "could not convert .* from 'var<int, int>' to 'vector<var<int> >'" } + fn_4 (vector<var<> >()); // { dg-error "could not convert .* from 'vector<var<>>' to 'vector<var<int>>'" } + /* { dg-begin-multiline-output "" } + vector< + var< + [ != int]>> + { dg-end-multiline-output "" } */ + fn_4 (vector<var<int> >()); + fn_4 (vector<var<int, int> >()); // { dg-error "could not convert .* from 'vector<var<int, int>>' to 'vector<var<int>>'" } + /* { dg-begin-multiline-output "" } + vector< + var< + [int, int != int]>> + { dg-end-multiline-output "" } */ +} + +void test_fn_5 () +{ + fn_5 (var<> ()); // { dg-error "could not convert .* from 'var<>' to 'vector<var<int, int> >'" } + fn_5 (var<int> ()); // { dg-error "could not convert .* from 'var<int>' to 'vector<var<int, int> >'" } + fn_5 (var<int, int> ()); // { dg-error "could not convert .* from 'var<int, int>' to 'vector<var<int, int> >'" } + fn_5 (vector<var<int> >()); // { dg-error "could not convert .* from 'vector<var<int>>' to 'vector<var<int, int>>'" } + /* { dg-begin-multiline-output "" } + vector< + var< + [int != int, int]>> + { dg-end-multiline-output "" } */ + fn_5 (vector<var<int, int> >()); +} diff --git a/gcc/testsuite/g++.dg/template/show-template-tree-3.C b/gcc/testsuite/g++.dg/template/show-template-tree-3.C new file mode 100644 index 00000000000..0eda40bcf77 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/show-template-tree-3.C @@ -0,0 +1,37 @@ +/* End-to-end test of -fdiagnostics-show-template-tree and -felide-type + using the STL. + In particular, ensure that we don't print the default arguments e.g. + rather than printing + from 'vector<double,allocator<double>>' to 'vector<float,allocator<float>>' + (albeit with differences nicely color-coded), we want to print: + from 'vector<double>' to 'vector<float>' + (again, with the "double" and "float" highlighted, though we can't test + for that in this case). */ + +// { dg-options "-fdiagnostics-show-template-tree" } + +#include <map> +#include <vector> + +using std::vector; +using std::map; + +void takes_vf (vector<float> v); +void takes_mivf (map<int, vector<float> > v); + +int test () +{ + takes_vf (vector<double> ()); // { dg-error "could not convert '.*' from 'vector<double>' to 'vector<float>'" } + /* { dg-begin-multiline-output "" } + vector< + [double != float]> + { dg-end-multiline-output "" } */ + + takes_mivf (map<int, vector<double> > ()); // { dg-error "could not convert '.*' from 'map<.\\.\\.\\..,vector<double>>' to 'map<.\\.\\.\\..,vector<float>>'" } + /* { dg-begin-multiline-output "" } + map< + [...], + vector< + [double != float]>> + { dg-end-multiline-output "" } */ +} diff --git a/gcc/testsuite/g++.dg/template/show-template-tree-4.C b/gcc/testsuite/g++.dg/template/show-template-tree-4.C new file mode 100644 index 00000000000..953733b03b4 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/show-template-tree-4.C @@ -0,0 +1,95 @@ +// { dg-options "-fdiagnostics-show-template-tree" } + +/* Example of default template args, and various kinds of mismatch. */ + +template <int = 0, int = 1, int = 2> +struct s {}; + +void takes_s (s<> ); +void takes_s013 (s<0, 1, 3> ); +void takes_s321 (s<3, 2, 1> ); + +void test () +{ + takes_s (s<>()); + takes_s (s<0, 1>()); + takes_s (s<0, 1, 2>()); + takes_s (s<0, 2>()); // { dg-error "could not convert '.*' from 's<.\\.\\.\\..,2>' to 's<.\\.\\.\\..,1>'" } + /* { dg-begin-multiline-output "" } + s< + [...], + [2 != 1]> + { dg-end-multiline-output "" } */ + + takes_s (s<1>()); // { dg-error "could not convert '.*' from 's<1>' to 's<0>'" } + /* { dg-begin-multiline-output "" } + s< + [1 != 0]> + { dg-end-multiline-output "" } */ + + takes_s (s<0, 1, 3>()); // { dg-error "could not convert '.*' from 's<.\\.\\.\\..,.\\.\\.\\..,3>' to 's<.\\.\\.\\..,.\\.\\.\\..,2>'" } + /* { dg-begin-multiline-output "" } + s< + [...], + [...], + [3 != 2]> + { dg-end-multiline-output "" } */ + + takes_s (s<3, 2, 0>()); // { dg-error "could not convert '.*' from 's<3,2,0>' to 's<0,1,2>'" } + /* { dg-begin-multiline-output "" } + s< + [3 != 0], + [2 != 1], + [0 != 2]> + { dg-end-multiline-output "" } */ + + takes_s (s<3, 2, 1>()); // { dg-error "could not convert '.*' from 's<3,2,1>' to 's<0,1,2>'" } + /* { dg-begin-multiline-output "" } + s< + [3 != 0], + [2 != 1], + [1 != 2]> + { dg-end-multiline-output "" } */ + + takes_s013 (s<0, 1, 2>()); // { dg-error "could not convert '.*' from 's<.\\.\\.\\..,.\\.\\.\\..,2>' to 's<.\\.\\.\\..,.\\.\\.\\..,3>'" } + /* { dg-begin-multiline-output "" } + s< + [...], + [...], + [2 != 3]> + { dg-end-multiline-output "" } */ + + takes_s321 (s<>()); // { dg-error "could not convert '.*' from 's<0,1,2>' to 's<3,2,1>'" } + /* { dg-begin-multiline-output "" } + s< + [0 != 3], + [1 != 2], + [2 != 1]> + { dg-end-multiline-output "" } */ + + takes_s321 (s<0, 1, 3>()); // { dg-error "could not convert '.*' from 's<0,1,3>' to 's<3,2,1>'" } + /* { dg-begin-multiline-output "" } + s< + [0 != 3], + [1 != 2], + [3 != 1]> + { dg-end-multiline-output "" } */ + + takes_s321 (s<3, 2, 0>()); // { dg-error "could not convert '.*' from 's<.\\.\\.\\..,.\\.\\.\\..,0>' to 's<.\\.\\.\\..,.\\.\\.\\..,1>'" } + /* { dg-begin-multiline-output "" } + s< + [...], + [...], + [0 != 1]> + { dg-end-multiline-output "" } */ + + takes_s321 (s<3, 2, 1>()); + + takes_s321 (s<1, 2, 3>()); // { dg-error "could not convert '.*' from 's<1,.\\.\\.\\..,3>' to 's<3,.\\.\\.\\..,1>'" } + /* { dg-begin-multiline-output "" } + s< + [1 != 3], + [...], + [3 != 1]> + { dg-end-multiline-output "" } */ +} diff --git a/gcc/testsuite/g++.dg/template/show-template-tree-no-elide-type.C b/gcc/testsuite/g++.dg/template/show-template-tree-no-elide-type.C new file mode 100644 index 00000000000..d4bfa81c2e0 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/show-template-tree-no-elide-type.C @@ -0,0 +1,24 @@ +// { dg-options "-fdiagnostics-show-template-tree -fno-elide-type" } + +template<typename> struct vector {}; +template<typename, typename> struct map {}; + +void fn_1(vector<int>); +void fn_2(map<int, int>); +void fn_3(vector<map<int, float> >); + +void test () +{ + fn_1 (vector<double> ()); // { dg-error "could not convert .* from 'vector<double>' to 'vector<int>'" } + /* { dg-begin-multiline-output "" } + vector< + [double != int]> + { dg-end-multiline-output "" } */ + + fn_2 (map<int, double>()); // { dg-error "could not convert .* from 'map<int,double>' to 'map<int,int>'" } + /* { dg-begin-multiline-output "" } + map< + int, + [double != int]> + { dg-end-multiline-output "" } */ +} diff --git a/gcc/testsuite/g++.dg/template/show-template-tree.C b/gcc/testsuite/g++.dg/template/show-template-tree.C new file mode 100644 index 00000000000..0b75098675a --- /dev/null +++ b/gcc/testsuite/g++.dg/template/show-template-tree.C @@ -0,0 +1,51 @@ +// { dg-options "-fdiagnostics-show-template-tree" } + +template<typename> struct vector {}; +template<typename, typename> struct map {}; +template<int> struct arr {}; + +void fn_1(vector<int>); +void fn_2(map<int, int>); +void fn_3(vector<map<int, float> >); +void takes_arr_10 (arr<10>); + +void test () +{ + fn_1 (vector<int> ()); + fn_1 (42); // { dg-error "could not convert '42' from 'int' to 'vector<int>'" } + fn_1 (vector<double> ()); // { dg-error "could not convert .* from 'vector<double>' to 'vector<int>'" } + /* { dg-begin-multiline-output "" } + vector< + [double != int]> + { dg-end-multiline-output "" } */ + fn_1 (map<int, int> ()); // { dg-error "could not convert .* from 'map<int, int>' to 'vector<int>'" } + + fn_2 (map<int, int>()); + fn_2 (map<int, double>()); // { dg-error "could not convert .* from 'map<.\\.\\.\\..,double>. to .map<.\\.\\.\\..,int>'" } + /* { dg-begin-multiline-output "" } + map< + [...], + [double != int]> + { dg-end-multiline-output "" } */ + fn_2 (map<double, double>()); // { dg-error "could not convert .* from .map<double,double>. to .map<int,int>." } + /* { dg-begin-multiline-output "" } + map< + [double != int], + [double != int]> + { dg-end-multiline-output "" } */ + + fn_3 (vector<map<int, float> >()); + fn_3 (vector<map<int, double> >()); // { dg-error "could not convert .* from 'vector<map<.\\.\\.\\..,double>>' to 'vector<map<.\\.\\.\\..,float>>'" } + /* { dg-begin-multiline-output "" } + vector< + map< + [...], + [double != float]>> + { dg-end-multiline-output "" } */ + + takes_arr_10 (arr<5>()); // { dg-error "could not convert '.*' from 'arr<5>' to 'arr<10>'" } + /* { dg-begin-multiline-output "" } + arr< + [5 != 10]> + { dg-end-multiline-output "" } */ +} diff --git a/gcc/testsuite/g++.dg/tree-ssa/counts-1.C b/gcc/testsuite/g++.dg/tree-ssa/counts-1.C new file mode 100644 index 00000000000..1759618300f --- /dev/null +++ b/gcc/testsuite/g++.dg/tree-ssa/counts-1.C @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ +void foo(); +extern void abort (void); + +static __attribute__ ((noinline)) +void mark_me_unlikely () +{ + foo(); + foo(); + foo(); + foo(); +} + +void i_am_not_unlikely() +{ + try { foo(); } + catch (int) {mark_me_unlikely ();} +} +/* { dg-final { scan-tree-dump "mark_me_unlikely\[^\r\n\]*(unlikely executed)" "optimized"} } */ +/* { dg-final { scan-tree-dump-not "i_am_not_unlikely\[^\r\n\]*(unlikely executed)" "optimized"} } */ diff --git a/gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C b/gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C index 31c7300c90b..f63d5c63e4a 100644 --- a/gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C +++ b/gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C @@ -3,6 +3,7 @@ // itself call malloc(), and will fail if there is no more // memory available. // { dg-do run { xfail { { xstormy16-*-* *-*-darwin[3-7]* } || vxworks_rtp } } } +// { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } // Copyright (C) 2000, 2002, 2003, 2010, 2012, 2014 Free Software Foundation, Inc. // Contributed by Nathan Sidwell 6 June 2000 <nathan@codesourcery.com> diff --git a/gcc/testsuite/gcc.c-torture/compile/20000326-2.c b/gcc/testsuite/gcc.c-torture/compile/20000326-2.c index 055260f6e64..6578d4e41c6 100644 --- a/gcc/testsuite/gcc.c-torture/compile/20000326-2.c +++ b/gcc/testsuite/gcc.c-torture/compile/20000326-2.c @@ -1,4 +1,5 @@ -#ifndef NO_LABEL_VALUES +/* { dg-require-effective-target label_values } */ + extern int printk(const char *fmt, ...); void foo (int x, int y) @@ -7,7 +8,3 @@ void foo (int x, int y) here: printk ("", &&here); } - -#else -int x; -#endif diff --git a/gcc/testsuite/gcc.c-torture/compile/20080806-1.c b/gcc/testsuite/gcc.c-torture/compile/20080806-1.c index c54e7397f5d..d0ee9cc2e6c 100644 --- a/gcc/testsuite/gcc.c-torture/compile/20080806-1.c +++ b/gcc/testsuite/gcc.c-torture/compile/20080806-1.c @@ -1,3 +1,5 @@ +/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */ + /* This used to ICE on s390x due to a reload bug. */ #if defined(STACK_SIZE) && (STACK_SIZE < 65536) diff --git a/gcc/testsuite/gcc.c-torture/compile/920301-1.c b/gcc/testsuite/gcc.c-torture/compile/920301-1.c index c4d663eb8a7..b61fe93b554 100644 --- a/gcc/testsuite/gcc.c-torture/compile/920301-1.c +++ b/gcc/testsuite/gcc.c-torture/compile/920301-1.c @@ -1,4 +1,4 @@ -#ifndef NO_LABEL_VALUES +/* { dg-require-effective-target label_values } */ + f(){static void*t[]={&&x};x:;} -#endif g(){static unsigned p[5];} diff --git a/gcc/testsuite/gcc.c-torture/compile/920501-1.c b/gcc/testsuite/gcc.c-torture/compile/920501-1.c index 29e197341aa..84cc122070b 100644 --- a/gcc/testsuite/gcc.c-torture/compile/920501-1.c +++ b/gcc/testsuite/gcc.c-torture/compile/920501-1.c @@ -1,5 +1,3 @@ -#ifndef NO_LABEL_VALUES +/* { dg-require-effective-target label_values } */ + a(){int**b[]={&&c};c:;} -#else -int x; -#endif diff --git a/gcc/testsuite/gcc.c-torture/compile/920723-1.c b/gcc/testsuite/gcc.c-torture/compile/920723-1.c index 69b031e895d..c6351c37261 100644 --- a/gcc/testsuite/gcc.c-torture/compile/920723-1.c +++ b/gcc/testsuite/gcc.c-torture/compile/920723-1.c @@ -1,3 +1,4 @@ +/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */ #if defined(STACK_SIZE) && STACK_SIZE < 65536 # define GITT_SIZE 75 diff --git a/gcc/testsuite/gcc.c-torture/compile/930506-2.c b/gcc/testsuite/gcc.c-torture/compile/930506-2.c index e11e62f026f..bc982acffba 100644 --- a/gcc/testsuite/gcc.c-torture/compile/930506-2.c +++ b/gcc/testsuite/gcc.c-torture/compile/930506-2.c @@ -1,4 +1,5 @@ -#ifndef NO_TRAMPOLINES +/* { dg-require-effective-target trampolines } */ + int f1() { { int ___() { foo(1); } bar(___); } @@ -10,6 +11,3 @@ int f2(int j) { int ___() { foo(j); } bar(___); } return( { int ___() { foo(j); } bar(___);} ); } -#else -int x; -#endif diff --git a/gcc/testsuite/gcc.c-torture/compile/930621-1.c b/gcc/testsuite/gcc.c-torture/compile/930621-1.c index 4199bbe0870..13e997a49cc 100644 --- a/gcc/testsuite/gcc.c-torture/compile/930621-1.c +++ b/gcc/testsuite/gcc.c-torture/compile/930621-1.c @@ -1,3 +1,5 @@ +/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */ + #if defined(STACK_SIZE) && (STACK_SIZE < 65536) # define BYTEMEM_SIZE 10000L #endif diff --git a/gcc/testsuite/gcc.c-torture/compile/941014-4.c b/gcc/testsuite/gcc.c-torture/compile/941014-4.c index 9e673f37833..9c4cec8b7a0 100644 --- a/gcc/testsuite/gcc.c-torture/compile/941014-4.c +++ b/gcc/testsuite/gcc.c-torture/compile/941014-4.c @@ -1,4 +1,5 @@ -#ifndef NO_LABEL_VALUES +/* { dg-require-effective-target label_values } */ + f (int *re) { int *loops = 0, *loope = 0; @@ -11,6 +12,3 @@ f (int *re) if (dat0 & 1) re[(dat0 >> 2) & 3] = 0; } -#else -int x; -#endif diff --git a/gcc/testsuite/gcc.c-torture/compile/991214-2.c b/gcc/testsuite/gcc.c-torture/compile/991214-2.c index 3e18d215e13..32dad4ff864 100644 --- a/gcc/testsuite/gcc.c-torture/compile/991214-2.c +++ b/gcc/testsuite/gcc.c-torture/compile/991214-2.c @@ -1,3 +1,5 @@ +/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */ + #if defined(STACK_SIZE) && (STACK_SIZE < 65536) # define HISTO_SIZE 9 #else diff --git a/gcc/testsuite/gcc.c-torture/compile/asmgoto-1.c b/gcc/testsuite/gcc.c-torture/compile/asmgoto-1.c index cc34610aba7..502969991bf 100644 --- a/gcc/testsuite/gcc.c-torture/compile/asmgoto-1.c +++ b/gcc/testsuite/gcc.c-torture/compile/asmgoto-1.c @@ -1,3 +1,5 @@ +/* { dg-require-effective-target label_values } */ + void fn (void); void diff --git a/gcc/testsuite/gcc.c-torture/compile/bcopy.c b/gcc/testsuite/gcc.c-torture/compile/bcopy.c index aed994e578a..cb7c05dda01 100644 --- a/gcc/testsuite/gcc.c-torture/compile/bcopy.c +++ b/gcc/testsuite/gcc.c-torture/compile/bcopy.c @@ -1,3 +1,5 @@ +/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */ + void bcopy1 (s, d, c) long long *s; diff --git a/gcc/testsuite/gcc.c-torture/compile/labels-1.c b/gcc/testsuite/gcc.c-torture/compile/labels-1.c index fae6ab8f400..7889567ffa6 100644 --- a/gcc/testsuite/gcc.c-torture/compile/labels-1.c +++ b/gcc/testsuite/gcc.c-torture/compile/labels-1.c @@ -1,4 +1,5 @@ -#ifndef NO_LABEL_VALUES +/* { dg-require-effective-target label_values } */ + f () { void *x = &&L2; @@ -8,6 +9,3 @@ f () L2: abort (); L3:; } -#else -int x; -#endif diff --git a/gcc/testsuite/gcc.c-torture/compile/memtst.c b/gcc/testsuite/gcc.c-torture/compile/memtst.c index b5ef2607073..e165a2297e8 100644 --- a/gcc/testsuite/gcc.c-torture/compile/memtst.c +++ b/gcc/testsuite/gcc.c-torture/compile/memtst.c @@ -1,3 +1,5 @@ +/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */ + #ifdef STACK_SIZE #define SIZE STACK_SIZE / 8 #else diff --git a/gcc/testsuite/gcc.c-torture/compile/msp.c b/gcc/testsuite/gcc.c-torture/compile/msp.c index 5d350fd5ee0..594cecb6721 100644 --- a/gcc/testsuite/gcc.c-torture/compile/msp.c +++ b/gcc/testsuite/gcc.c-torture/compile/msp.c @@ -1,3 +1,5 @@ +/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */ + #ifdef STACK_SIZE # define A_SIZE (STACK_SIZE/sizeof(int)) #else diff --git a/gcc/testsuite/gcc.c-torture/compile/pr18903.c b/gcc/testsuite/gcc.c-torture/compile/pr18903.c index 3c123511297..461504f611a 100644 --- a/gcc/testsuite/gcc.c-torture/compile/pr18903.c +++ b/gcc/testsuite/gcc.c-torture/compile/pr18903.c @@ -1,8 +1,9 @@ +/* { dg-require-effective-target label_values } */ + /* We were ICEing in bsi_after_labels because we had a BB which did not have a lablel. PR middle-end/18903 */ -#ifndef NO_LABEL_VALUES void g (int s, int f) { &&ff; @@ -12,6 +13,3 @@ void g (int s, int f) f = s; end:; } -#else -int g; -#endif diff --git a/gcc/testsuite/gcc.c-torture/compile/pr81003.c b/gcc/testsuite/gcc.c-torture/compile/pr81003.c new file mode 100644 index 00000000000..26117b638c4 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr81003.c @@ -0,0 +1,10 @@ +/* PR tree-optimization/81003 */ + +unsigned int a, b; + +void +foo (void) +{ + for (b = 0; b < 13; b += 2) + a &= !!b; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/stuct.c b/gcc/testsuite/gcc.c-torture/compile/stuct.c index deb838d8099..59acd571ba6 100644 --- a/gcc/testsuite/gcc.c-torture/compile/stuct.c +++ b/gcc/testsuite/gcc.c-torture/compile/stuct.c @@ -1,3 +1,5 @@ +/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */ + #ifdef STACK_SIZE #define SIZE STACK_SIZE / 8 #else diff --git a/gcc/testsuite/gcc.c-torture/execute/20000822-1.c b/gcc/testsuite/gcc.c-torture/execute/20000822-1.c index f4a084b33ed..e99bcc2fea3 100644 --- a/gcc/testsuite/gcc.c-torture/execute/20000822-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/20000822-1.c @@ -1,4 +1,5 @@ -#ifndef NO_TRAMPOLINES +/* { dg-require-effective-target trampolines } */ + int f0(int (*fn)(int *), int *p) { return (*fn) (p); @@ -16,13 +17,11 @@ int f1(void) return f0(f2, &i); } -#endif int main() { -#ifndef NO_TRAMPOLINES if (f1() != 2) abort (); -#endif + return 0; } diff --git a/gcc/testsuite/gcc.c-torture/execute/20011008-3.c b/gcc/testsuite/gcc.c-torture/execute/20011008-3.c index 3244b0a97ae..2fd6871e757 100644 --- a/gcc/testsuite/gcc.c-torture/execute/20011008-3.c +++ b/gcc/testsuite/gcc.c-torture/execute/20011008-3.c @@ -1,3 +1,5 @@ +/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */ + extern void exit (int); extern void abort (void); diff --git a/gcc/testsuite/gcc.c-torture/execute/20030209-1.c b/gcc/testsuite/gcc.c-torture/execute/20030209-1.c index 5845d67b3ca..72c1e55f88b 100644 --- a/gcc/testsuite/gcc.c-torture/execute/20030209-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/20030209-1.c @@ -1,3 +1,5 @@ +/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */ + #ifdef STACK_SIZE #if STACK_SIZE < 8*100*100 #define SKIP diff --git a/gcc/testsuite/gcc.c-torture/execute/20031012-1.c b/gcc/testsuite/gcc.c-torture/execute/20031012-1.c index a1f3de8baef..db7f3fa97ad 100644 --- a/gcc/testsuite/gcc.c-torture/execute/20031012-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/20031012-1.c @@ -1,3 +1,5 @@ +/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */ + /* PR optimization/8750 Used to fail under Cygwin with -O2 -fomit-frame-pointer diff --git a/gcc/testsuite/gcc.c-torture/execute/20040805-1.c b/gcc/testsuite/gcc.c-torture/execute/20040805-1.c index f09fc49a268..4e978f519bc 100644 --- a/gcc/testsuite/gcc.c-torture/execute/20040805-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/20040805-1.c @@ -1,3 +1,5 @@ +/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */ + #if __INT_MAX__ < 32768 || (defined(STACK_SIZE) && STACK_SIZE < 0x12000) int main () { exit (0); } #else diff --git a/gcc/testsuite/gcc.c-torture/execute/20101011-1.c b/gcc/testsuite/gcc.c-torture/execute/20101011-1.c index 899a401dd75..dda49a59852 100644 --- a/gcc/testsuite/gcc.c-torture/execute/20101011-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/20101011-1.c @@ -1,5 +1,6 @@ /* { dg-options "-fnon-call-exceptions" } */ /* With -fnon-call-exceptions 0 / 0 should not be eliminated. */ +/* { dg-additional-options "-DSIGNAL_SUPPRESS" { target { ! signal } } } */ #ifdef SIGNAL_SUPPRESS # define DO_TEST 0 diff --git a/gcc/testsuite/gcc.c-torture/execute/920302-1.c b/gcc/testsuite/gcc.c-torture/execute/920302-1.c index 44a1e9b670e..62e4fc205a9 100644 --- a/gcc/testsuite/gcc.c-torture/execute/920302-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/920302-1.c @@ -1,9 +1,10 @@ +/* { dg-require-effective-target label_values } */ + short optab[5]; char buf[10]; execute (ip) register short *ip; { -#ifndef NO_LABEL_VALUES register void *base = &&x; char *bp = buf; static void *tab[] = {&&x, &&y, &&z}; @@ -21,9 +22,6 @@ y: *bp++='y'; z: *bp++='z'; *bp=0; return; -#else - strcpy (buf, "xyxyz"); -#endif } short p[5]; diff --git a/gcc/testsuite/gcc.c-torture/execute/920410-1.c b/gcc/testsuite/gcc.c-torture/execute/920410-1.c index f5180f06a9c..50bc41770e8 100644 --- a/gcc/testsuite/gcc.c-torture/execute/920410-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/920410-1.c @@ -1,3 +1,5 @@ +/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */ + #define STACK_REQUIREMENT (40000 * 4 + 256) #if defined (STACK_SIZE) && STACK_SIZE < STACK_REQUIREMENT main () { exit (0); } diff --git a/gcc/testsuite/gcc.c-torture/execute/920415-1.c b/gcc/testsuite/gcc.c-torture/execute/920415-1.c index 2d6335aea55..ec31ea94a52 100644 --- a/gcc/testsuite/gcc.c-torture/execute/920415-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/920415-1.c @@ -1,5 +1,2 @@ -#ifndef NO_LABEL_VALUES +/* { dg-require-effective-target label_values } */ main(){__label__ l;void*x(){return&&l;}goto*x();abort();return;l:exit(0);} -#else -main(){ exit (0); } -#endif diff --git a/gcc/testsuite/gcc.c-torture/execute/920428-2.c b/gcc/testsuite/gcc.c-torture/execute/920428-2.c index f8c2e5f782c..c6a5bda05bc 100644 --- a/gcc/testsuite/gcc.c-torture/execute/920428-2.c +++ b/gcc/testsuite/gcc.c-torture/execute/920428-2.c @@ -1,7 +1,6 @@ -#if !defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES) +/* { dg-require-effective-target label_values } */ +/* { dg-require-effective-target trampolines } */ + s(i){if(i>0){__label__ l1;int f(int i){if(i==2)goto l1;return 0;}return f(i);l1:;}return 1;} x(){return s(0)==1&&s(1)==0&&s(2)==1;} main(){if(x()!=1)abort();exit(0);} -#else -main(){ exit (0); } -#endif diff --git a/gcc/testsuite/gcc.c-torture/execute/920501-3.c b/gcc/testsuite/gcc.c-torture/execute/920501-3.c index 1031d7378cb..452d7c0debe 100644 --- a/gcc/testsuite/gcc.c-torture/execute/920501-3.c +++ b/gcc/testsuite/gcc.c-torture/execute/920501-3.c @@ -1,8 +1,9 @@ +/* { dg-require-effective-target label_values } */ + int tab[9]; execute(oip, ip) unsigned short *oip, *ip; { -#ifndef NO_LABEL_VALUES int x = 0; int *xp = tab; base: @@ -14,12 +15,6 @@ base: } *xp++ = ip - oip; goto *(&&base + *ip++); -#else - tab[0] = 0; - tab[1] = 1; - tab[2] = 2; - tab[3] = 0; -#endif } main() diff --git a/gcc/testsuite/gcc.c-torture/execute/920501-4.c b/gcc/testsuite/gcc.c-torture/execute/920501-4.c index 3524dd5c8b2..c99857079aa 100644 --- a/gcc/testsuite/gcc.c-torture/execute/920501-4.c +++ b/gcc/testsuite/gcc.c-torture/execute/920501-4.c @@ -1,4 +1,5 @@ -#ifndef NO_LABEL_VALUES +/* { dg-require-effective-target label_values } */ + int x (int i) { @@ -21,7 +22,3 @@ main (void) exit (0); } -#else -int -main (void) { exit (0); } -#endif diff --git a/gcc/testsuite/gcc.c-torture/execute/920501-5.c b/gcc/testsuite/gcc.c-torture/execute/920501-5.c index e352a915563..f0b90716653 100644 --- a/gcc/testsuite/gcc.c-torture/execute/920501-5.c +++ b/gcc/testsuite/gcc.c-torture/execute/920501-5.c @@ -1,4 +1,5 @@ -#ifndef NO_LABEL_VALUES +/* { dg-require-effective-target label_values } */ + x (int i) { void *j[] = {&&x, &&y, &&z}; @@ -14,6 +15,3 @@ main () abort(); exit(0); } -#else -main(){ exit (0); } -#endif diff --git a/gcc/testsuite/gcc.c-torture/execute/920501-7.c b/gcc/testsuite/gcc.c-torture/execute/920501-7.c index c23717d797e..5cced09dc04 100644 --- a/gcc/testsuite/gcc.c-torture/execute/920501-7.c +++ b/gcc/testsuite/gcc.c-torture/execute/920501-7.c @@ -1,10 +1,13 @@ +/* { dg-require-effective-target label_values } */ +/* { dg-require-effective-target trampolines } */ +/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */ + #ifdef STACK_SIZE #define DEPTH ((STACK_SIZE) / 512 + 1) #else #define DEPTH 1000 #endif -#if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES) x(a) { __label__ xlab; @@ -18,13 +21,11 @@ x(a) xlab:; return a; } -#endif main () { -#if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES) if (x (DEPTH) != DEPTH) abort (); -#endif + exit (0); } diff --git a/gcc/testsuite/gcc.c-torture/execute/920612-2.c b/gcc/testsuite/gcc.c-torture/execute/920612-2.c index 9bbdce2e0ad..23796fcdaa9 100644 --- a/gcc/testsuite/gcc.c-torture/execute/920612-2.c +++ b/gcc/testsuite/gcc.c-torture/execute/920612-2.c @@ -1,3 +1,5 @@ +/* { dg-require-effective-target trampolines } */ + main () { int i = 0; @@ -7,9 +9,9 @@ main () i++, x--; return x; } -#ifndef NO_TRAMPOLINES + if (a (2) != 0) abort (); -#endif + exit (0); } diff --git a/gcc/testsuite/gcc.c-torture/execute/920721-4.c b/gcc/testsuite/gcc.c-torture/execute/920721-4.c index 3cccc5b3024..805918b2aa3 100644 --- a/gcc/testsuite/gcc.c-torture/execute/920721-4.c +++ b/gcc/testsuite/gcc.c-torture/execute/920721-4.c @@ -1,4 +1,5 @@ -#ifndef NO_LABEL_VALUES +/* { dg-require-effective-target label_values } */ + int try (int num) { __label__ lab1, lab2, lab3, lab4, lab5, lab6, default_lab; @@ -55,6 +56,3 @@ main() } exit(0); } -#else -main(){ exit (0); } -#endif diff --git a/gcc/testsuite/gcc.c-torture/execute/921017-1.c b/gcc/testsuite/gcc.c-torture/execute/921017-1.c index c7fab5840b3..a2784f68487 100644 --- a/gcc/testsuite/gcc.c-torture/execute/921017-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/921017-1.c @@ -1,4 +1,6 @@ /* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */ +/* { dg-require-effective-target trampolines } */ + f(n) { int a[n]; @@ -11,8 +13,7 @@ f(n) } main() { -#ifndef NO_TRAMPOLINES if(f(2)!=4711)abort(); -#endif + exit(0); } diff --git a/gcc/testsuite/gcc.c-torture/execute/921113-1.c b/gcc/testsuite/gcc.c-torture/execute/921113-1.c index 78972bc975e..24c4952279a 100644 --- a/gcc/testsuite/gcc.c-torture/execute/921113-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/921113-1.c @@ -1,3 +1,5 @@ +/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */ + #define STACK_REQUIREMENT (128 * 128 * 4 + 1024) #if defined (STACK_SIZE) && STACK_SIZE < STACK_REQUIREMENT main () { exit (0); } diff --git a/gcc/testsuite/gcc.c-torture/execute/921202-1.c b/gcc/testsuite/gcc.c-torture/execute/921202-1.c index 935975dd3ad..530fad006fe 100644 --- a/gcc/testsuite/gcc.c-torture/execute/921202-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/921202-1.c @@ -1,4 +1,6 @@ /* { dg-require-effective-target untyped_assembly } */ +/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */ + #ifndef STACK_SIZE #define VLEN 2055 #else diff --git a/gcc/testsuite/gcc.c-torture/execute/921208-2.c b/gcc/testsuite/gcc.c-torture/execute/921208-2.c index f01b5728ee5..f18f2c8faaa 100644 --- a/gcc/testsuite/gcc.c-torture/execute/921208-2.c +++ b/gcc/testsuite/gcc.c-torture/execute/921208-2.c @@ -1,4 +1,6 @@ /* { dg-require-effective-target untyped_assembly } */ +/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */ + #define STACK_REQUIREMENT (100000 * 4 + 1024) #if defined (STACK_SIZE) && STACK_SIZE < STACK_REQUIREMENT main () { exit (0); } diff --git a/gcc/testsuite/gcc.c-torture/execute/921215-1.c b/gcc/testsuite/gcc.c-torture/execute/921215-1.c index 4fa3b7dfccc..28dccd662f2 100644 --- a/gcc/testsuite/gcc.c-torture/execute/921215-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/921215-1.c @@ -1,6 +1,7 @@ +/* { dg-require-effective-target trampolines } */ + main() { -#ifndef NO_TRAMPOLINES void p(void ((*f) (void ()))) { void r() @@ -17,7 +18,7 @@ main() } p(q); -#endif + exit(0); } diff --git a/gcc/testsuite/gcc.c-torture/execute/930106-1.c b/gcc/testsuite/gcc.c-torture/execute/930106-1.c index 8081f926013..41add7dc25d 100644 --- a/gcc/testsuite/gcc.c-torture/execute/930106-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/930106-1.c @@ -1,3 +1,5 @@ +/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */ + #if defined (STACK_SIZE) #define DUMMY_SIZE 9 #else diff --git a/gcc/testsuite/gcc.c-torture/execute/930406-1.c b/gcc/testsuite/gcc.c-torture/execute/930406-1.c index 9728eabd7ed..0d6b0fbc948 100644 --- a/gcc/testsuite/gcc.c-torture/execute/930406-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/930406-1.c @@ -1,3 +1,5 @@ +/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */ + f() { int x = 1; diff --git a/gcc/testsuite/gcc.c-torture/execute/931002-1.c b/gcc/testsuite/gcc.c-torture/execute/931002-1.c index 6a02b234394..fc5222374d9 100644 --- a/gcc/testsuite/gcc.c-torture/execute/931002-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/931002-1.c @@ -1,3 +1,5 @@ +/* { dg-require-effective-target trampolines } */ + f (void (*func) ()) { func (); @@ -5,7 +7,6 @@ f (void (*func) ()) main () { -#ifndef NO_TRAMPOLINES void t0 () { } @@ -23,6 +24,6 @@ main () t1 (); t1 (); t2 (); -#endif + exit (0); } diff --git a/gcc/testsuite/gcc.c-torture/execute/950221-1.c b/gcc/testsuite/gcc.c-torture/execute/950221-1.c index d67da5b0c8c..aa71024b2db 100644 --- a/gcc/testsuite/gcc.c-torture/execute/950221-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/950221-1.c @@ -1,3 +1,5 @@ +/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */ + struct parsefile { long fd; diff --git a/gcc/testsuite/gcc.c-torture/execute/960521-1.c b/gcc/testsuite/gcc.c-torture/execute/960521-1.c index 9fc5821495a..fc69ff92414 100644 --- a/gcc/testsuite/gcc.c-torture/execute/960521-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/960521-1.c @@ -1,3 +1,5 @@ +/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */ + #include <stdlib.h> int *a, *b; diff --git a/gcc/testsuite/gcc.c-torture/execute/980526-1.c b/gcc/testsuite/gcc.c-torture/execute/980526-1.c index 2c9e735da69..15c580791ab 100644 --- a/gcc/testsuite/gcc.c-torture/execute/980526-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/980526-1.c @@ -1,5 +1,5 @@ -/* { dg-skip-if "requires indirect jumps" { ! indirect_jumps } { "-O0" } { "" } } */ -/* { dg-skip-if "requires label values" { ! label_values } { "-O0" } { "" } } */ +/* { dg-require-effective-target label_values } */ + int expect_do1 = 1, expect_do2 = 2; static int doit(int x){ @@ -31,9 +31,5 @@ static void do2(void){ } int main(void){ -#ifndef NO_LABEL_VALUES - do1(); - do2(); -#endif exit(0); } diff --git a/gcc/testsuite/gcc.c-torture/execute/980605-1.c b/gcc/testsuite/gcc.c-torture/execute/980605-1.c index 2fc2691e535..9185f2b9a3c 100644 --- a/gcc/testsuite/gcc.c-torture/execute/980605-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/980605-1.c @@ -1,3 +1,5 @@ +/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */ + #include <stdio.h> #ifndef STACK_SIZE diff --git a/gcc/testsuite/gcc.c-torture/execute/990208-1.c b/gcc/testsuite/gcc.c-torture/execute/990208-1.c index 786e664f35b..15dcdfbdf7a 100644 --- a/gcc/testsuite/gcc.c-torture/execute/990208-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/990208-1.c @@ -1,8 +1,9 @@ +/* { dg-require-effective-target label_values } */ + /* As a quality of implementation issue, we should not prevent inlining of function explicitly marked inline just because a label therein had its address taken. */ -#ifndef NO_LABEL_VALUES static void *ptr1, *ptr2; static int i = 1; @@ -44,7 +45,3 @@ int main() } void bar(void) { } - -#else /* NO_LABEL_VALUES */ -int main() { exit(0); } -#endif diff --git a/gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c b/gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c index 4c41b71c344..3bc00ef9a9c 100644 --- a/gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c @@ -1,6 +1,9 @@ +/* { dg-require-effective-target label_values } */ +/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */ + #include <stdlib.h> -#if !defined(NO_LABEL_VALUES) && (!defined(STACK_SIZE) || STACK_SIZE >= 4000) && __INT_MAX__ >= 2147483647 +#if (!defined(STACK_SIZE) || STACK_SIZE >= 4000) && __INT_MAX__ >= 2147483647 typedef unsigned int uint32; typedef signed int sint32; diff --git a/gcc/testsuite/gcc.c-torture/execute/comp-goto-2.c b/gcc/testsuite/gcc.c-torture/execute/comp-goto-2.c index 771cd956995..21a1e6f2ae2 100644 --- a/gcc/testsuite/gcc.c-torture/execute/comp-goto-2.c +++ b/gcc/testsuite/gcc.c-torture/execute/comp-goto-2.c @@ -1,3 +1,7 @@ +/* { dg-require-effective-target label_values } */ +/* { dg-require-effective-target trampolines } */ +/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */ + /* A slight variation of 920501-7.c. */ #ifdef STACK_SIZE @@ -6,7 +10,6 @@ #define DEPTH 1000 #endif -#if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES) x(a) { __label__ xlab; @@ -24,13 +27,12 @@ x(a) xlab:; return a; } -#endif main () { -#if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES) + if (x (DEPTH) != DEPTH) abort (); -#endif + exit (0); } diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/ieee.exp b/gcc/testsuite/gcc.c-torture/execute/ieee/ieee.exp index 26247d6e5be..043e02ded1b 100644 --- a/gcc/testsuite/gcc.c-torture/execute/ieee/ieee.exp +++ b/gcc/testsuite/gcc.c-torture/execute/ieee/ieee.exp @@ -53,6 +53,10 @@ if { [istarget "alpha*-*-*"] lappend additional_flags "-mieee" } +if { ![check_effective_target_signal] } { + lappend additional_flags "-DSIGNAL_SUPPRESS" +} + # load support procs load_lib c-torture.exp diff --git a/gcc/testsuite/gcc.c-torture/execute/memcpy-1.c b/gcc/testsuite/gcc.c-torture/execute/memcpy-1.c index 684854b66dc..e94ab8aad88 100644 --- a/gcc/testsuite/gcc.c-torture/execute/memcpy-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/memcpy-1.c @@ -1,3 +1,5 @@ +/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */ + #include <string.h> #if defined (STACK_SIZE) diff --git a/gcc/testsuite/gcc.c-torture/execute/multi-ix.c b/gcc/testsuite/gcc.c-torture/execute/multi-ix.c index 377f08c115c..8ab041b4a53 100644 --- a/gcc/testsuite/gcc.c-torture/execute/multi-ix.c +++ b/gcc/testsuite/gcc.c-torture/execute/multi-ix.c @@ -1,3 +1,5 @@ +/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */ + /* Test for a reload bug: if you have a memory reference using the indexed addressing mode, and the base address is a pseudo containing an address in the frame diff --git a/gcc/testsuite/gcc.c-torture/execute/nestfunc-1.c b/gcc/testsuite/gcc.c-torture/execute/nestfunc-1.c index e34a56b3f57..29ccfc399bd 100644 --- a/gcc/testsuite/gcc.c-torture/execute/nestfunc-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/nestfunc-1.c @@ -1,3 +1,5 @@ +/* { dg-require-effective-target trampolines } */ + int g (int a, int b, int (*gi) (int, int)) { @@ -9,7 +11,6 @@ g (int a, int b, int (*gi) (int, int)) f () { -#ifndef NO_TRAMPOLINES int i, j; int f2 (int a, int b) { @@ -18,7 +19,6 @@ f () if (g (1, 2, f2) != 2) abort (); -#endif } main () diff --git a/gcc/testsuite/gcc.c-torture/execute/nestfunc-2.c b/gcc/testsuite/gcc.c-torture/execute/nestfunc-2.c index 030875560dc..1a25a17449e 100644 --- a/gcc/testsuite/gcc.c-torture/execute/nestfunc-2.c +++ b/gcc/testsuite/gcc.c-torture/execute/nestfunc-2.c @@ -1,3 +1,5 @@ +/* { dg-require-effective-target trampolines } */ + extern int foo (int, int, int (*) (int, int, int, int, int, int, int)); int z; @@ -5,7 +7,6 @@ int z; int main (void) { -#ifndef NO_TRAMPOLINES int sum = 0; int i; @@ -37,8 +38,7 @@ main (void) if (z != 0x1b) abort (); -#endif - + exit (0); } diff --git a/gcc/testsuite/gcc.c-torture/execute/nestfunc-3.c b/gcc/testsuite/gcc.c-torture/execute/nestfunc-3.c index 9d09b196d23..2bdfece9c5b 100644 --- a/gcc/testsuite/gcc.c-torture/execute/nestfunc-3.c +++ b/gcc/testsuite/gcc.c-torture/execute/nestfunc-3.c @@ -1,3 +1,4 @@ +/* { dg-require-effective-target trampolines } */ extern long foo (long, long, long (*) (long, long)); extern long use (long (*) (long, long), long, long); @@ -5,7 +6,6 @@ extern long use (long (*) (long, long), long, long); int main (void) { -#ifndef NO_TRAMPOLINES long sum = 0; long i; @@ -42,7 +42,6 @@ main (void) if ((sum & 0xffffffff) != 0xbecfcbf5) abort (); -#endif exit (0); } diff --git a/gcc/testsuite/gcc.c-torture/execute/nestfunc-4.c b/gcc/testsuite/gcc.c-torture/execute/nestfunc-4.c index e028166b608..ee5b376f9b8 100644 --- a/gcc/testsuite/gcc.c-torture/execute/nestfunc-4.c +++ b/gcc/testsuite/gcc.c-torture/execute/nestfunc-4.c @@ -1,3 +1,5 @@ +/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */ + /* Origin: hp@bitrange.com Test that return values come out right from a 1000-level call chain to functions without parameters that each need at least one "long" diff --git a/gcc/testsuite/gcc.c-torture/execute/nestfunc-5.c b/gcc/testsuite/gcc.c-torture/execute/nestfunc-5.c index 88e74cc904c..fc9ad955a9f 100644 --- a/gcc/testsuite/gcc.c-torture/execute/nestfunc-5.c +++ b/gcc/testsuite/gcc.c-torture/execute/nestfunc-5.c @@ -1,7 +1,8 @@ +/* { dg-require-effective-target trampolines } */ + extern void abort (void); extern void exit (int); -#ifndef NO_TRAMPOLINES static void recursive (int n, void (*proc) (void)) { __label__ l1; @@ -31,6 +32,3 @@ int main () recursive (10, abort); abort (); } -#else -int main () { return 0; } -#endif diff --git a/gcc/testsuite/gcc.c-torture/execute/nestfunc-6.c b/gcc/testsuite/gcc.c-torture/execute/nestfunc-6.c index c8e82435ab1..fad729aaba3 100644 --- a/gcc/testsuite/gcc.c-torture/execute/nestfunc-6.c +++ b/gcc/testsuite/gcc.c-torture/execute/nestfunc-6.c @@ -1,8 +1,8 @@ +/* { dg-require-effective-target trampolines } */ + /* Test that the GP gets properly restored, either by the nonlocal receiver or the nested function. */ -#ifndef NO_TRAMPOLINES - typedef __SIZE_TYPE__ size_t; extern void abort (void); extern void exit (int); @@ -23,7 +23,3 @@ int main () nonlocal: exit (0); } - -#else -int main() { return 0; } -#endif diff --git a/gcc/testsuite/gcc.c-torture/execute/pr20621-1.c b/gcc/testsuite/gcc.c-torture/execute/pr20621-1.c index 57b3df764b7..4a55c970b86 100644 --- a/gcc/testsuite/gcc.c-torture/execute/pr20621-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/pr20621-1.c @@ -1,3 +1,5 @@ +/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */ + /* When generating o32 MIPS PIC, main's $gp save slot was out of range of a single load instruction. */ struct big { int i[sizeof (int) >= 4 && sizeof (void *) >= 4 ? 0x4000 : 4]; }; diff --git a/gcc/testsuite/gcc.c-torture/execute/pr23135.c b/gcc/testsuite/gcc.c-torture/execute/pr23135.c index 378ebe741d9..31b4f8f9c14 100644 --- a/gcc/testsuite/gcc.c-torture/execute/pr23135.c +++ b/gcc/testsuite/gcc.c-torture/execute/pr23135.c @@ -1,3 +1,5 @@ +/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */ + /* Based on execute/simd-1.c, modified by joern.rennecke@st.com to trigger a reload bug. Verified for gcc mainline from 20050722 13:00 UTC for sh-elf -m4 -O2. */ diff --git a/gcc/testsuite/gcc.c-torture/execute/pr24135.c b/gcc/testsuite/gcc.c-torture/execute/pr24135.c index fdeda164004..f1d12983ef3 100644 --- a/gcc/testsuite/gcc.c-torture/execute/pr24135.c +++ b/gcc/testsuite/gcc.c-torture/execute/pr24135.c @@ -1,4 +1,5 @@ -#ifndef NO_TRAMPOLINES +/* { dg-require-effective-target trampolines } */ + extern void abort (void); int x(int a, int b) @@ -41,6 +42,3 @@ int main () return 0; } -#else -int main() { return 0; } -#endif diff --git a/gcc/testsuite/gcc.c-torture/execute/pr28982b.c b/gcc/testsuite/gcc.c-torture/execute/pr28982b.c index 3f9f5bafce5..90d4a931ab8 100644 --- a/gcc/testsuite/gcc.c-torture/execute/pr28982b.c +++ b/gcc/testsuite/gcc.c-torture/execute/pr28982b.c @@ -1,3 +1,5 @@ +/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */ + /* Like pr28982a.c, but with the spill slots outside the range of a single sp-based load on ARM. This test tests for cases where the addresses in the base and index reloads require further reloads. */ diff --git a/gcc/testsuite/gcc.dg/20000707-1.c b/gcc/testsuite/gcc.dg/20000707-1.c index 5328dfa63d9..85a3315c4e9 100644 --- a/gcc/testsuite/gcc.dg/20000707-1.c +++ b/gcc/testsuite/gcc.dg/20000707-1.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -Wall" } */ +/* { dg-require-effective-target label_values } */ extern void foo(void *here); extern inline void bar(void) diff --git a/gcc/testsuite/gcc.dg/Wsizeof-pointer-memaccess1.c b/gcc/testsuite/gcc.dg/Wsizeof-pointer-memaccess1.c index ebdef690879..7feb122b553 100644 --- a/gcc/testsuite/gcc.dg/Wsizeof-pointer-memaccess1.c +++ b/gcc/testsuite/gcc.dg/Wsizeof-pointer-memaccess1.c @@ -73,6 +73,15 @@ f1 (void *x, int z) z += bcmp (x, pa2, sizeof (PTA)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the second source; expected \[^\n\r\]* or an explicit length" } */ z += bcmp (x, pa3, sizeof (PA)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the second source; expected \[^\n\r\]* or an explicit length" } */ + z += bcmp (x, (&a), (sizeof (&a))); /* { dg-warning "call is the same expression as the second source; did you mean to remove the addressof" } */ + z += bcmp (x, (pa1), (sizeof (pa1))); /* { dg-warning "call is the same expression as the second source; did you mean to dereference it" } */ + z += bcmp (x, (pa2), (sizeof pa2)); /* { dg-warning "call is the same expression as the second source; did you mean to dereference it" } */ + z += bcmp (x, (pa3), (sizeof (pa3))); /* { dg-warning "call is the same expression as the second source; did you mean to dereference it" } */ + z += bcmp (x, (pa4), (sizeof pa4)); /* { dg-warning "call is the same expression as the second source; did you mean to dereference it" } */ + z += bcmp (x, (pa1), (sizeof (struct A *)));/* { dg-warning "call is the same pointer type \[^\n\r\]* as the second source; expected \[^\n\r\]* or an explicit length" } */ + z += bcmp (x, (pa2), (sizeof (PTA))); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the second source; expected \[^\n\r\]* or an explicit length" } */ + z += bcmp (x, (pa3), (sizeof (PA))); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the second source; expected \[^\n\r\]* or an explicit length" } */ + /* These are correct, no warning. */ bzero (&a, sizeof a); bzero (&a, sizeof (a)); diff --git a/gcc/testsuite/gcc.dg/Wtrampolines.c b/gcc/testsuite/gcc.dg/Wtrampolines.c index 7e9646be5c3..8ff09ebc9fe 100644 --- a/gcc/testsuite/gcc.dg/Wtrampolines.c +++ b/gcc/testsuite/gcc.dg/Wtrampolines.c @@ -5,8 +5,6 @@ /* { dg-require-effective-target trampolines } */ /* { dg-options "-O2 -Wtrampolines" } */ -#ifndef NO_TRAMPOLINES - /* This used to fail on various versions of Solaris 2 because the trampoline couldn't be made executable. */ @@ -46,12 +44,10 @@ void foo (void) abort(); } } -#endif int main (void) { -#ifndef NO_TRAMPOLINES foo (); -#endif + return 0; } diff --git a/gcc/testsuite/gcc.dg/c99-stdint-1.c b/gcc/testsuite/gcc.dg/c99-stdint-1.c index 530d13025e7..f5c2cda77c9 100644 --- a/gcc/testsuite/gcc.dg/c99-stdint-1.c +++ b/gcc/testsuite/gcc.dg/c99-stdint-1.c @@ -10,6 +10,7 @@ /* { dg-do compile } */ /* { dg-options "-std=iso9899:1999 -pedantic-errors -fhosted" } */ /* { dg-require-effective-target ptr32plus } */ +/* { dg-additional-options "-DSIGNAL_SUPPRESS" { target { ! signal } } } */ #include <limits.h> #include <stdint.h> diff --git a/gcc/testsuite/gcc.dg/c99-stdint-2.c b/gcc/testsuite/gcc.dg/c99-stdint-2.c index 1784b0c413e..08d9f6023d9 100644 --- a/gcc/testsuite/gcc.dg/c99-stdint-2.c +++ b/gcc/testsuite/gcc.dg/c99-stdint-2.c @@ -3,6 +3,8 @@ /* { dg-do compile } */ /* { dg-options "-std=iso9899:1999 -pedantic-errors -ffreestanding" } */ /* { dg-require-effective-target ptr32plus } */ +/* { dg-additional-options "-DSIGNAL_SUPPRESS" { target { ! signal } } } */ + /* The test is that there are no diagnostics, so just include the hosted version. */ #include "c99-stdint-1.c" diff --git a/gcc/testsuite/gcc.dg/c99-stdint-5.c b/gcc/testsuite/gcc.dg/c99-stdint-5.c index 9c224edc1cb..60513233a43 100644 --- a/gcc/testsuite/gcc.dg/c99-stdint-5.c +++ b/gcc/testsuite/gcc.dg/c99-stdint-5.c @@ -3,6 +3,7 @@ compilations). */ /* { dg-do compile } */ /* { dg-options "-std=iso9899:1999 -pedantic-errors" } */ +/* { dg-additional-options "-DSIGNAL_SUPPRESS" { target { ! signal } } } */ #include <stdint.h> #ifndef SIGNAL_SUPPRESS diff --git a/gcc/testsuite/gcc.dg/c99-stdint-6.c b/gcc/testsuite/gcc.dg/c99-stdint-6.c index 150666ce689..60ac31ff7dd 100644 --- a/gcc/testsuite/gcc.dg/c99-stdint-6.c +++ b/gcc/testsuite/gcc.dg/c99-stdint-6.c @@ -2,6 +2,7 @@ with any system <inttypes.h> header. */ /* { dg-do compile { target inttypes_types } } */ /* { dg-options "-std=iso9899:1999 -pedantic-errors" } */ +/* { dg-additional-options "-DSIGNAL_SUPPRESS" { target { ! signal } } } */ #include <inttypes.h> #ifndef SIGNAL_SUPPRESS diff --git a/gcc/testsuite/gcc.dg/fixed-point/int-warning.c b/gcc/testsuite/gcc.dg/fixed-point/int-warning.c index cf48e4ba2b3..14adcc7221d 100644 --- a/gcc/testsuite/gcc.dg/fixed-point/int-warning.c +++ b/gcc/testsuite/gcc.dg/fixed-point/int-warning.c @@ -9,16 +9,16 @@ unsigned char uc; void test() { - sc = 500k; /* { dg-warning "overflow in implicit constant conversion" } */ - sc = -500k; /* { dg-warning "overflow in implicit constant conversion" } */ - sc = 500lk; /* { dg-warning "overflow in implicit constant conversion" } */ - sc = -500lk; /* { dg-warning "overflow in implicit constant conversion" } */ - sc = 500llk; /* { dg-warning "overflow in implicit constant conversion" } */ - sc = -500llk; /* { dg-warning "overflow in implicit constant conversion" } */ - uc = 500k; /* { dg-warning "overflow in implicit constant conversion" } */ - uc = -500k; /* { dg-warning "overflow in implicit constant conversion" } */ - uc = 500lk; /* { dg-warning "overflow in implicit constant conversion" } */ - uc = -500lk; /* { dg-warning "overflow in implicit constant conversion" } */ - uc = 500llk; /* { dg-warning "overflow in implicit constant conversion" } */ - uc = -500llk; /* { dg-warning "overflow in implicit constant conversion" } */ + sc = 500k; /* { dg-warning "overflow in conversion" } */ + sc = -500k; /* { dg-warning "overflow in conversion" } */ + sc = 500lk; /* { dg-warning "overflow in conversion" } */ + sc = -500lk; /* { dg-warning "overflow in conversion" } */ + sc = 500llk; /* { dg-warning "overflow in conversion" } */ + sc = -500llk; /* { dg-warning "overflow in conversion" } */ + uc = 500k; /* { dg-warning "overflow in conversion" } */ + uc = -500k; /* { dg-warning "overflow in conversion" } */ + uc = 500lk; /* { dg-warning "overflow in conversion" } */ + uc = -500lk; /* { dg-warning "overflow in conversion" } */ + uc = 500llk; /* { dg-warning "overflow in conversion" } */ + uc = -500llk; /* { dg-warning "overflow in conversion" } */ } diff --git a/gcc/testsuite/gcc.dg/format/pr80919.c b/gcc/testsuite/gcc.dg/format/pr80919.c new file mode 100644 index 00000000000..510c2e4e6c9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/pr80919.c @@ -0,0 +1,16 @@ +/* PR c/80919 */ +/* { dg-do compile } */ +/* { dg-options "-Wall" } */ + +void +fn (void) +{ + int a[0]; + __builtin_printf("%d\n", &a); /* { dg-warning "expects argument of type" } */ + __builtin_printf("%i\n", &a); /* { dg-warning "expects argument of type" } */ + + __builtin_printf("%o\n", &a); /* { dg-warning "expects argument of type" } */ + __builtin_printf("%u\n", &a); /* { dg-warning "expects argument of type" } */ + __builtin_printf("%x\n", &a); /* { dg-warning "expects argument of type" } */ + __builtin_printf("%X\n", &a); /* { dg-warning "expects argument of type" } */ +} diff --git a/gcc/testsuite/gcc.dg/gimplefe-error-7.c b/gcc/testsuite/gcc.dg/gimplefe-error-7.c new file mode 100644 index 00000000000..7d5ff374a6c --- /dev/null +++ b/gcc/testsuite/gcc.dg/gimplefe-error-7.c @@ -0,0 +1,27 @@ +/* { dg-do compile } */ +/* { dg-options "-fgimple" } */ + +__GIMPLE() void fn1() +{ + if (1) + goto + else /* { dg-error "expected label" } */ + goto lbl; +} + +__GIMPLE() void fn2() +{ + if (1) + goto lbl; + else + goto ; /* { dg-error "expected label" } */ +} + +__GIMPLE() void fn3() +{ + if (1) + goto lbl; + else + goto +} /* { dg-error "expected label" } */ + diff --git a/gcc/testsuite/gcc.dg/graphite/pr79483.c b/gcc/testsuite/gcc.dg/graphite/pr79483.c new file mode 100644 index 00000000000..097273fed71 --- /dev/null +++ b/gcc/testsuite/gcc.dg/graphite/pr79483.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fgraphite-identity" } */ + +int *a; +extern int b[]; +int c; +void d () +{ + double e[2][3] = {0.0, 0.0, 1.0}; + for (int f = 0; f < 2; ++f) + for (int g = 0; g < 6; ++g) + b[0] = a[g] * e[f][2]; + c = b[0]; +} diff --git a/gcc/testsuite/gcc.dg/graphite/pr80906.c b/gcc/testsuite/gcc.dg/graphite/pr80906.c new file mode 100644 index 00000000000..59c7f59cadf --- /dev/null +++ b/gcc/testsuite/gcc.dg/graphite/pr80906.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -floop-nest-optimize -fdump-tree-graphite" } */ + +int qc; + +int +ec (int lh[][2]) +{ + const int jv = 3; + int zf, hp, c5 = 0, m3 = 1; + + for (zf = 0; zf < jv; ++zf) + for (hp = 0; hp < jv; ++hp) + { + short int bm = 0; + + for (qc = 0; qc < jv; ++qc) + --bm; + if (bm != 0) + --c5; + lh[0][0] = 0; + m3 *= jv; + } + + return c5 + m3; +} + +/* { dg-final { scan-tree-dump "isl AST to Gimple succeeded" "graphite" } } */ diff --git a/gcc/testsuite/gcc.dg/loop-3.c b/gcc/testsuite/gcc.dg/loop-3.c index 6bdb5ef5697..2c500d02217 100644 --- a/gcc/testsuite/gcc.dg/loop-3.c +++ b/gcc/testsuite/gcc.dg/loop-3.c @@ -4,6 +4,7 @@ /* { dg-do compile } */ /* { dg-options "-O3" } */ /* { dg-options "-O3 -mtune=i386" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */ +/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */ #if defined(STACK_SIZE) && (STACK_SIZE < 65536) # define BYTEMEM_SIZE 10000L diff --git a/gcc/testsuite/gcc.dg/plugin/diagnostic-test-show-locus-bw.c b/gcc/testsuite/gcc.dg/plugin/diagnostic-test-show-locus-bw.c index 25b9d6cb382..100fa380cd7 100644 --- a/gcc/testsuite/gcc.dg/plugin/diagnostic-test-show-locus-bw.c +++ b/gcc/testsuite/gcc.dg/plugin/diagnostic-test-show-locus-bw.c @@ -269,3 +269,23 @@ void test_fixit_insert_newline (void) { dg-end-multiline-output "" } */ #endif } + +/* Unit test for mutually-exclusive suggestions. */ + +void test_mutually_exclusive_suggestions (void) +{ +#if 0 + original; /* { dg-warning "warning 1" } */ +/* { dg-warning "warning 2" "" { target *-*-* } .-1 } */ +/* { dg-begin-multiline-output "" } + original; + ^~~~~~~~ + replacement_1 + { dg-end-multiline-output "" } */ +/* { dg-begin-multiline-output "" } + original; + ^~~~~~~~ + replacement_2 + { dg-end-multiline-output "" } */ +#endif +} diff --git a/gcc/testsuite/gcc.dg/plugin/diagnostic-test-show-locus-generate-patch.c b/gcc/testsuite/gcc.dg/plugin/diagnostic-test-show-locus-generate-patch.c index 4522dcd350e..f1963dd20c1 100644 --- a/gcc/testsuite/gcc.dg/plugin/diagnostic-test-show-locus-generate-patch.c +++ b/gcc/testsuite/gcc.dg/plugin/diagnostic-test-show-locus-generate-patch.c @@ -51,6 +51,19 @@ void test_fixit_insert_newline (void) #endif } +/* Unit test for mutually-exclusive suggestions. */ + +void test_mutually_exclusive_suggestions (void) +{ +#if 0 + original; /* { dg-warning "warning 1" } */ +/* { dg-warning "warning 2" "" { target *-*-* } .-1 } */ +/* We should not print the mutually-incompatible fix-it hints within + the generated patch; they are not listed in the big expected + multiline output below. */ +#endif +} + /* Verify the output from -fdiagnostics-generate-patch. We expect a header, containing the filename. This is the absolute path, so we can only capture it via regexps. */ diff --git a/gcc/testsuite/gcc.dg/plugin/diagnostic-test-show-locus-parseable-fixits.c b/gcc/testsuite/gcc.dg/plugin/diagnostic-test-show-locus-parseable-fixits.c index 25a7c3c5072..16162baeb7e 100644 --- a/gcc/testsuite/gcc.dg/plugin/diagnostic-test-show-locus-parseable-fixits.c +++ b/gcc/testsuite/gcc.dg/plugin/diagnostic-test-show-locus-parseable-fixits.c @@ -55,3 +55,17 @@ void test_fixit_insert_newline (void) /* { dg-regexp "fix-it:.*\\{52:1-52:1\\}:.*\\n" } */ #endif } + +/* Unit test for mutually-exclusive suggestions. */ + +void test_mutually_exclusive_suggestions (void) +{ +#if 0 + original; /* { dg-warning "warning 1" } */ +/* { dg-warning "warning 2" "" { target *-*-* } .-1 } */ +/* We should print the mutually-incompatible fix-it hints within + -fdiagnostics-parseable-fixits; verify that they are printed. */ +/* { dg-regexp "fix-it:.*\\{64:3-64:11}:.*\\n" } */ +/* { dg-regexp "fix-it:.*\\{64:3-64:11}:.*\\n" } */ +#endif +} diff --git a/gcc/testsuite/gcc.dg/plugin/diagnostic_plugin_test_show_locus.c b/gcc/testsuite/gcc.dg/plugin/diagnostic_plugin_test_show_locus.c index 6afb58414f0..0a8eeba1846 100644 --- a/gcc/testsuite/gcc.dg/plugin/diagnostic_plugin_test_show_locus.c +++ b/gcc/testsuite/gcc.dg/plugin/diagnostic_plugin_test_show_locus.c @@ -306,6 +306,30 @@ test_show_locus (function *fun) warning_at_rich_loc (&richloc, 0, "example of a replacement hint"); } + if (0 == strcmp (fnname, "test_mutually_exclusive_suggestions")) + { + const int line = fnstart_line + 2; + location_t start = get_loc (line, 2); + location_t finish = get_loc (line, 9); + source_range src_range; + src_range.m_start = start; + src_range.m_finish = finish; + + { + rich_location richloc (line_table, make_location (start, start, finish)); + richloc.add_fixit_replace (src_range, "replacement_1"); + richloc.fixits_cannot_be_auto_applied (); + warning_at_rich_loc (&richloc, 0, "warning 1"); + } + + { + rich_location richloc (line_table, make_location (start, start, finish)); + richloc.add_fixit_replace (src_range, "replacement_2"); + richloc.fixits_cannot_be_auto_applied (); + warning_at_rich_loc (&richloc, 0, "warning 2"); + } + } + /* Example of two carets where both carets appear to have an off-by-one error appearing one column early. Seen with gfortran.dg/associate_5.f03. diff --git a/gcc/testsuite/gcc.dg/pr38700.c b/gcc/testsuite/gcc.dg/pr38700.c index ebece7f0ff4..8b7cbc83c4c 100644 --- a/gcc/testsuite/gcc.dg/pr38700.c +++ b/gcc/testsuite/gcc.dg/pr38700.c @@ -1,6 +1,7 @@ /* PR c/38700 */ /* { dg-do compile } */ /* { dg-options "-O0" } */ +/* { dg-require-effective-target label_values } */ int foo () diff --git a/gcc/testsuite/gcc.dg/pr70169.c b/gcc/testsuite/gcc.dg/pr70169.c index 41381e721e6..56e72f34a0f 100644 --- a/gcc/testsuite/gcc.dg/pr70169.c +++ b/gcc/testsuite/gcc.dg/pr70169.c @@ -2,6 +2,7 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fno-strict-aliasing -fno-tree-dce" } */ /* { dg-skip-if "Program and data reside in different address spaces" { "avr-*-*" } } */ +/* { dg-require-effective-target label_values } */ int printf (const char *, ...); diff --git a/gcc/testsuite/gcc.dg/pr79983.c b/gcc/testsuite/gcc.dg/pr79983.c new file mode 100644 index 00000000000..84aae691318 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr79983.c @@ -0,0 +1,15 @@ +/* PR c/79983 */ +/* { dg-do compile } */ +/* { dg-options "" } */ + +struct S; +struct S { int i; }; /* { dg-message "originally defined here" } */ +struct S { int i, j; }; /* { dg-error "redefinition of 'struct S'" } */ + +enum E; +enum E { A, B, C }; /* { dg-message "originally defined here" } */ +enum E { D, F }; /* { dg-error "nested redefinition of 'enum E'|redeclaration of 'enum E'" } */ + +union U; +union U { int i; }; /* { dg-message "originally defined here" } */ +union U { int i; double d; }; /* { dg-error "redefinition of 'union U'" } */ diff --git a/gcc/testsuite/gcc.dg/pr80112.c b/gcc/testsuite/gcc.dg/pr80112.c index 7c78aaedd98..8d6ef3c88aa 100644 --- a/gcc/testsuite/gcc.dg/pr80112.c +++ b/gcc/testsuite/gcc.dg/pr80112.c @@ -1,6 +1,7 @@ /* PR rtl-optimization/80112 */ /* { dg-do compile } */ /* { dg-options "-Os -fmodulo-sched" } */ +/* { dg-require-effective-target label_values } */ void **a; diff --git a/gcc/testsuite/gcc.dg/pr80903.c b/gcc/testsuite/gcc.dg/pr80903.c new file mode 100644 index 00000000000..73d44b0dc45 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr80903.c @@ -0,0 +1,34 @@ +/* PR rtl-optimization/80903 */ +/* { dg-do compile } */ +/* { dg-options "-O3 -funroll-loops" } */ + +short int a; + +void +foo (int x, short int y, short int z) +{ + if (y != 0) + { + const short int b = 37; + y = 0; + while (y < b) + { + while (y < b) + { + lab: + ++y; + } + for (y = 0; y < b - 1; ++y) + ; + if (z != 0) + { + --a; + y *= a; + } + z = x; + } + x = 0; + } + + goto lab; +} diff --git a/gcc/testsuite/gcc.dg/predict-14.c b/gcc/testsuite/gcc.dg/predict-14.c index 18ede8f39c0..a1b283699ec 100644 --- a/gcc/testsuite/gcc.dg/predict-14.c +++ b/gcc/testsuite/gcc.dg/predict-14.c @@ -1,16 +1,18 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fdump-tree-profile_estimate" } */ +void test(void) __attribute__ ((noreturn)); + int main(int argc, char **argv) { switch (argc) { case 1: - __builtin_abort(); + test(); case 4: - __builtin_abort(); + test(); default: - __builtin_abort(); + test(); } return 10; diff --git a/gcc/testsuite/gcc.dg/stdint-width-1.c b/gcc/testsuite/gcc.dg/stdint-width-1.c index a28feee38db..3eba9f6cb15 100644 --- a/gcc/testsuite/gcc.dg/stdint-width-1.c +++ b/gcc/testsuite/gcc.dg/stdint-width-1.c @@ -1,6 +1,7 @@ /* Test TS 18661-1 width macros in <stdint.h>. */ /* { dg-do compile } */ /* { dg-options "-std=c11 -ffreestanding" } */ +/* { dg-additional-options "-DSIGNAL_SUPPRESS" { target { ! signal } } } */ #include <stddef.h> #define __STDC_WANT_IEC_60559_BFP_EXT__ diff --git a/gcc/testsuite/gcc.dg/struct-ret-3.c b/gcc/testsuite/gcc.dg/struct-ret-3.c index 36cc87e7d0e..c6f87acba9d 100644 --- a/gcc/testsuite/gcc.dg/struct-ret-3.c +++ b/gcc/testsuite/gcc.dg/struct-ret-3.c @@ -2,7 +2,8 @@ /* Origin: Peeter Joot <peeterj@ca.ibm.com> */ /* { dg-do run { target *-*-linux* *-*-gnu* } } */ - +/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */ + #include <sys/mman.h> #include <string.h> #include <stdio.h> diff --git a/gcc/testsuite/gcc.dg/torture/Wsizeof-pointer-memaccess1.c b/gcc/testsuite/gcc.dg/torture/Wsizeof-pointer-memaccess1.c index a73e45fb809..f9bc57c4e86 100644 --- a/gcc/testsuite/gcc.dg/torture/Wsizeof-pointer-memaccess1.c +++ b/gcc/testsuite/gcc.dg/torture/Wsizeof-pointer-memaccess1.c @@ -150,6 +150,15 @@ f1 (void *x, int z) z += memcmp (x, pa2, sizeof (PTA)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the second source; expected \[^\n\r\]* or an explicit length" } */ z += memcmp (x, pa3, sizeof (PA)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the second source; expected \[^\n\r\]* or an explicit length" } */ + z += memcmp (x, (&a), (sizeof (&a))); /* { dg-warning "call is the same expression as the second source; did you mean to remove the addressof" } */ + z += memcmp (x, (pa1), (sizeof (pa1))); /* { dg-warning "call is the same expression as the second source; did you mean to dereference it" } */ + z += memcmp (x, (pa2), (sizeof pa2)); /* { dg-warning "call is the same expression as the second source; did you mean to dereference it" } */ + z += memcmp (x, (pa3), (sizeof (pa3))); /* { dg-warning "call is the same expression as the second source; did you mean to dereference it" } */ + z += memcmp (x, (pa4), (sizeof pa4)); /* { dg-warning "call is the same expression as the second source; did you mean to dereference it" } */ + z += memcmp (x, (pa1), (sizeof (struct A *)));/* { dg-warning "call is the same pointer type \[^\n\r\]* as the second source; expected \[^\n\r\]* or an explicit length" } */ + z += memcmp (x, (pa2), (sizeof (PTA))); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the second source; expected \[^\n\r\]* or an explicit length" } */ + z += memcmp (x, (pa3), (sizeof (PA))); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the second source; expected \[^\n\r\]* or an explicit length" } */ + /* These are correct, no warning. */ memset (&a, 0, sizeof a); memset (&a, 0, sizeof (a)); diff --git a/gcc/testsuite/gcc.dg/torture/pr51071-2.c b/gcc/testsuite/gcc.dg/torture/pr51071-2.c index ccf3d815872..638b4b8539a 100644 --- a/gcc/testsuite/gcc.dg/torture/pr51071-2.c +++ b/gcc/testsuite/gcc.dg/torture/pr51071-2.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-fno-delete-null-pointer-checks" } */ +/* { dg-require-effective-target label_values } */ __extension__ typedef __UINTPTR_TYPE__ uintptr_t; diff --git a/gcc/testsuite/gcc.dg/torture/pr51071.c b/gcc/testsuite/gcc.dg/torture/pr51071.c index 99af9587d05..ad83dccdbc3 100644 --- a/gcc/testsuite/gcc.dg/torture/pr51071.c +++ b/gcc/testsuite/gcc.dg/torture/pr51071.c @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-require-effective-target label_values } */ void foo (void); void bar (void *); diff --git a/gcc/testsuite/gcc.dg/torture/pr80876.c b/gcc/testsuite/gcc.dg/torture/pr80876.c new file mode 100644 index 00000000000..35f9f509a64 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr80876.c @@ -0,0 +1,42 @@ +/* { dg-do compile } */ + +int sy; + +void +fo (char o5) +{ + char yh = 0; + + if (o5 == 0) + return; + + while (o5 != 0) + if (0) + { + while (yh != 0) + { + o5 = 0; + while (o5 < 2) + { + sy &= yh; + if (sy != 0) + { +km: + sy = yh; + } + } + ++yh; + } + } + else + { + o5 = sy; + goto km; + } +} + +void +on (void) +{ + fo (sy); +} diff --git a/gcc/testsuite/gcc.dg/torture/pr80901.c b/gcc/testsuite/gcc.dg/torture/pr80901.c new file mode 100644 index 00000000000..635d93907b2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr80901.c @@ -0,0 +1,32 @@ +/* { dg-do compile } */ + +int a, b, c, d; + +int fn1 () +{ + int f; + if (d) + while (c) + { + for (f = 0; f < 1; f++) + { + int g[70] = { 0 }; + if (b) + ; + else + { + int h = !b; + for (; h; h = 1) + ; + } + } + return 0; + } + return a; +} + +int main () +{ + fn1 (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/torture/pr80974.c b/gcc/testsuite/gcc.dg/torture/pr80974.c new file mode 100644 index 00000000000..4918607ba1f --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr80974.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ + +int a, b, c, d, e, f, g[4]; + +static int fn1 () +{ + int h, i; + if (b) + goto L1; +L2:; + int m = a; + while (1) + { + int n = 2; + e = !f && (n = 5); + if (e) + for (h = 0; h < 9; h++) + for (i = 0; i < 6; i++) + if (a) + g[h] = 4; + if (d) + goto L2; + a & n || b; +L1: + if (a) + L3: + c = m; + if (a) + goto L3; + if (b < 5) + return 0; + } +} + +int main () +{ + fn1 (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/torture/pr81053.c b/gcc/testsuite/gcc.dg/torture/pr81053.c new file mode 100644 index 00000000000..98ab95dadeb --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr81053.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ + +int a, b[2], c, d; + +void fn1 () +{ + for (; d < 2; d++) + { + b[d] = a; + a = c; + } +} diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/comp-goto-1.c b/gcc/testsuite/gcc.dg/torture/stackalign/comp-goto-1.c index cf163722de8..726bb209a94 100644 --- a/gcc/testsuite/gcc.dg/torture/stackalign/comp-goto-1.c +++ b/gcc/testsuite/gcc.dg/torture/stackalign/comp-goto-1.c @@ -1,4 +1,7 @@ /* { dg-do run } */ +/* { dg-require-effective-target label_values } */ +/* { dg-require-effective-target trampolines } */ +/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */ #ifdef STACK_SIZE #define DEPTH ((STACK_SIZE) / 512 + 1) @@ -9,7 +12,6 @@ extern void abort (void); extern void exit (int); -#if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES) int x(int a) { @@ -28,14 +30,12 @@ x(int a) xlab:; return a; } -#endif int main () { -#if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES) if (x (DEPTH) != DEPTH) abort (); -#endif + exit (0); } diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/nested-5.c b/gcc/testsuite/gcc.dg/torture/stackalign/nested-5.c index 95eba0482f6..e6bf3645c59 100644 --- a/gcc/testsuite/gcc.dg/torture/stackalign/nested-5.c +++ b/gcc/testsuite/gcc.dg/torture/stackalign/nested-5.c @@ -1,9 +1,9 @@ /* { dg-do run } */ +/* { dg-require-effective-target trampolines } */ extern void abort (void); extern void exit (int); -#ifndef NO_TRAMPOLINES static void recursive (int n, void (*proc) (void)) { __label__ l1; @@ -33,6 +33,3 @@ int main () recursive (10, abort); abort (); } -#else -int main () { return 0; } -#endif diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/nested-6.c b/gcc/testsuite/gcc.dg/torture/stackalign/nested-6.c index d853825feb7..708cd9e89a9 100644 --- a/gcc/testsuite/gcc.dg/torture/stackalign/nested-6.c +++ b/gcc/testsuite/gcc.dg/torture/stackalign/nested-6.c @@ -1,6 +1,5 @@ /* { dg-do run } */ - -#ifndef NO_TRAMPOLINES +/* { dg-require-effective-target trampolines } */ typedef __SIZE_TYPE__ size_t; extern void abort (void); @@ -22,7 +21,3 @@ int main () nonlocal: exit (0); } - -#else -int main() { return 0; } -#endif diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-3.c b/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-3.c index f18366f9c0f..39525d7f8c6 100644 --- a/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-3.c +++ b/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-3.c @@ -1,7 +1,7 @@ /* { dg-do run } */ /* { dg-require-effective-target nonlocal_goto } */ +/* { dg-require-effective-target trampolines } */ -#ifndef NO_TRAMPOLINES extern void abort (void); int x(int a, int b) @@ -38,6 +38,3 @@ int main () return 0; } -#else -int main() { return 0; } -#endif diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-4.c b/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-4.c index d3057236490..90ca71c9e2d 100644 --- a/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-4.c +++ b/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-4.c @@ -1,5 +1,8 @@ /* { dg-do run } */ /* { dg-require-effective-target nonlocal_goto } */ +/* { dg-require-effective-target label_values } */ +/* { dg-require-effective-target trampolines } */ +/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */ extern void abort (void); extern void exit (int); @@ -10,7 +13,6 @@ extern void exit (int); #define DEPTH 1000 #endif -#if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES) int x(int a) { @@ -25,14 +27,12 @@ x(int a) xlab:; return a; } -#endif int main () { -#if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES) if (x (DEPTH) != DEPTH) abort (); -#endif + exit (0); } diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-5.c b/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-5.c index b034a655ad0..b158cea5436 100644 --- a/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-5.c +++ b/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-5.c @@ -1,12 +1,10 @@ /* { dg-do run } */ /* { dg-require-effective-target nonlocal_goto } */ +/* { dg-require-effective-target label_values } */ +/* { dg-require-effective-target trampolines } */ extern void exit (int); -#if !defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES) extern void abort (void); int s(int i){if(i>0){__label__ l1;int f(int i){if(i==2)goto l1;return 0;}return f(i);l1:;}return 1;} int x(){return s(0)==1&&s(1)==0&&s(2)==1;} int main(){if(x()!=1)abort();exit(0);} -#else -int main(){ exit (0); } -#endif diff --git a/gcc/testsuite/gcc.dg/trampoline-1.c b/gcc/testsuite/gcc.dg/trampoline-1.c index 37a582c5703..e3dcf573a94 100644 --- a/gcc/testsuite/gcc.dg/trampoline-1.c +++ b/gcc/testsuite/gcc.dg/trampoline-1.c @@ -5,8 +5,6 @@ /* { dg-require-effective-target trampolines } */ /* { dg-options "-O2" } */ -#ifndef NO_TRAMPOLINES - /* This used to fail on various versions of Solaris 2 because the trampoline couldn't be made executable. */ @@ -46,12 +44,9 @@ void foo (void) abort(); } } -#endif int main (void) { -#ifndef NO_TRAMPOLINES foo (); -#endif return 0; } diff --git a/gcc/testsuite/gcc.dg/tree-prof/cold_partition_label.c b/gcc/testsuite/gcc.dg/tree-prof/cold_partition_label.c index 6214e3629f2..52518cf40c3 100644 --- a/gcc/testsuite/gcc.dg/tree-prof/cold_partition_label.c +++ b/gcc/testsuite/gcc.dg/tree-prof/cold_partition_label.c @@ -1,7 +1,7 @@ /* Test case to check if function foo gets split and the cold function gets a label. */ /* { dg-require-effective-target freorder } */ -/* { dg-options "-O2 -freorder-blocks-and-partition -save-temps" } */ +/* { dg-options "-O2 -freorder-blocks-and-partition -save-temps -fdump-tree-optimized" } */ #define SIZE 10000 @@ -39,3 +39,4 @@ main (int argc, char *argv[]) /* { dg-final-use { scan-assembler "foo\[._\]+cold\[\._\]+0" { target *-*-linux* *-*-gnu* } } } */ /* { dg-final-use { scan-assembler "size\[ \ta-zA-Z0-0\]+foo\[._\]+cold\[\._\]+0" { target *-*-linux* *-*-gnu* } } } */ +/* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */ diff --git a/gcc/testsuite/gcc.dg/tree-prof/comp-goto-1.c b/gcc/testsuite/gcc.dg/tree-prof/comp-goto-1.c index 42d61f3cad6..dd6774f2826 100644 --- a/gcc/testsuite/gcc.dg/tree-prof/comp-goto-1.c +++ b/gcc/testsuite/gcc.dg/tree-prof/comp-goto-1.c @@ -1,8 +1,11 @@ /* { dg-require-effective-target freorder } */ +/* { dg-require-effective-target label_values } */ /* { dg-options "-O2 -freorder-blocks-and-partition" } */ +/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */ + #include <stdlib.h> -#if !defined(NO_LABEL_VALUES) && (!defined(STACK_SIZE) || STACK_SIZE >= 4000) && __INT_MAX__ >= 2147483647 +#if (!defined(STACK_SIZE) || STACK_SIZE >= 4000) && __INT_MAX__ >= 2147483647 typedef unsigned int uint32; typedef signed int sint32; diff --git a/gcc/testsuite/gcc.dg/tree-prof/pr44777.c b/gcc/testsuite/gcc.dg/tree-prof/pr44777.c index 1c4da7f5f7d..1249b5b251d 100644 --- a/gcc/testsuite/gcc.dg/tree-prof/pr44777.c +++ b/gcc/testsuite/gcc.dg/tree-prof/pr44777.c @@ -1,5 +1,9 @@ /* PR middle-end/44777 */ +/* { dg-require-effective-target label_values } */ +/* { dg-require-effective-target trampolines } */ /* { dg-options "-O0" } */ +/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */ + /* A variant of gcc.c-torture/execute/comp-goto-2.c. */ extern void abort (void); @@ -11,7 +15,6 @@ extern void exit (int); #define DEPTH 1000 #endif -#if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES) int x (int a) { @@ -30,14 +33,13 @@ x (int a) xlab:; return a; } -#endif int main () { -#if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES) + if (x (DEPTH) != DEPTH) abort (); -#endif + exit (0); } diff --git a/gcc/testsuite/gcc.dg/tree-prof/split-1.c b/gcc/testsuite/gcc.dg/tree-prof/split-1.c new file mode 100644 index 00000000000..a42fccf37b5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-prof/split-1.c @@ -0,0 +1,41 @@ +/* Test case that we don't get a link-time error when using + -fsplit-stack with -freorder-blocks-and-partition. */ +/* { dg-require-effective-target freorder } */ +/* { dg-options "-O2 -fsplit-stack" } */ + +extern unsigned int sleep (unsigned int); + +#define SIZE 10000 + +const char *sarr[SIZE]; +const char *buf_hot; +const char *buf_cold; + +__attribute__((noinline)) +void +foo (int path) +{ + int i; + if (path) + { + for (i = 0; i < SIZE; i++) + sarr[i] = buf_hot; + } + else + { + for (i = 0; i < SIZE; i++) + sarr[i] = buf_cold; + sleep (0); + } +} + +int +main (int argc, char *argv[]) +{ + int i; + buf_hot = "hello"; + buf_cold = "world"; + for (i = 0; i < 1000000; i++) + foo (argc); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/tree-ssa/alias-34.c b/gcc/testsuite/gcc.dg/tree-ssa/alias-34.c index 5738feaffb1..363d121df87 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/alias-34.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/alias-34.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fno-strict-aliasing -fdump-tree-optimized" } */ +/* { dg-require-effective-target label_values } */ void foo (int b) { diff --git a/gcc/testsuite/gcc.dg/tree-ssa/attr-hotcold-2.c b/gcc/testsuite/gcc.dg/tree-ssa/attr-hotcold-2.c index 13d2916c47b..f7a5098709b 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/attr-hotcold-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/attr-hotcold-2.c @@ -20,9 +20,9 @@ void f(int x, int y) /* { dg-final { scan-tree-dump-times "hot label heuristics" 1 "profile_estimate" } } */ /* { dg-final { scan-tree-dump-times "cold label heuristics" 1 "profile_estimate" } } */ -/* { dg-final { scan-tree-dump-times "block 4, loop depth 0, count 0, freq \[1-4\]\[^0-9\]" 3 "profile_estimate" } } */ +/* { dg-final { scan-tree-dump-times "block 4, loop depth 0, freq \[1-4\]\[^0-9\]" 3 "profile_estimate" } } */ /* Note: we're attempting to match some number > 6000, i.e. > 60%. The exact number ought to be tweekable without having to juggle the testcase around too much. */ -/* { dg-final { scan-tree-dump-times "block 5, loop depth 0, count 0, freq \[6-9\]\[0-9\]\[0-9\]\[0-9\]" 3 "profile_estimate" } } */ +/* { dg-final { scan-tree-dump-times "block 5, loop depth 0, freq \[6-9\]\[0-9\]\[0-9\]\[0-9\]" 3 "profile_estimate" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/counts-1.c b/gcc/testsuite/gcc.dg/tree-ssa/counts-1.c new file mode 100644 index 00000000000..466895556ca --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/counts-1.c @@ -0,0 +1,35 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ +void unlikely () __attribute__ ((cold)); +void unlikely2 () __attribute__ ((cold)); + +__attribute__ ((noinline)) void +i_am_also_unlikely (int a) +{ + if (a) + unlikely (); + else + unlikely2 (); +} + + +void +i_am_also_unlikely2 (int a,int b) +{ + if (b) + i_am_also_unlikely (a); + else + unlikely (); +} + +void +i_am_not_unlikely (int a,int b,int c) +{ + if (c) + __builtin_exit (0); + i_am_also_unlikely2 (a,b); +} +/* Detect i_am_also_unlikely i_am_also_unlikely2 as unlikely. */ +/* { dg-final { scan-tree-dump "i_am_also_unlikely\[^\r\n\]*(unlikely executed)" "optimized"} } */ +/* { dg-final { scan-tree-dump "i_am_also_unlikely2\[^\r\n\]*(unlikely executed)" "optimized"} } */ +/* { dg-final { scan-tree-dump-not "i_am_not_unlikely\[^\r\n\]*(unlikely executed)" "optimized"} } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ivopt_mult_4.c b/gcc/testsuite/gcc.dg/tree-ssa/ivopt_mult_4.c index effb052f07c..e69e4163c5e 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ivopt_mult_4.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ivopt_mult_4.c @@ -1,6 +1,6 @@ /* { dg-do compile { target {{ i?86-*-* x86_64-*-* } && lp64 } } } */ -/* { dg-options "-O2 -m64 -fdump-tree-ivopts-details" } */ +/* { dg-options "-O2 -m64 -fdump-tree-optimized" } */ /* iv i's step 16 so its period is smaller than the max iterations * i.e. replacing if (p2 > p_limit2) with testing of i may result in @@ -21,4 +21,4 @@ long foo(long* p, long* p2, int N1, int N2) return s; } -/* { dg-final { scan-tree-dump "Replacing exit test" "ivopts"} } */ +/* { dg-final { scan-tree-dump "if \\(.*p_limit2.*\\)" "optimized"} } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-15.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-15.c index 829a6d8a0ff..dce6ad57a04 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/loop-15.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-15.c @@ -19,8 +19,8 @@ int bla(void) } /* Since the loop is removed, there should be no addition. */ -/* { dg-final { scan-tree-dump-times "\\+" 0 "optimized" } } */ -/* { dg-final { scan-tree-dump-times "n_. \\* n_." 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times " \\+ " 0 "optimized" } } */ +/* { dg-final { scan-tree-dump-times " \\* " 1 "optimized" } } */ /* The if from the loop header copying remains in the code. */ /* { dg-final { scan-tree-dump-times "if " 1 "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr80898-2.c b/gcc/testsuite/gcc.dg/tree-ssa/pr80898-2.c new file mode 100644 index 00000000000..cb4799c5ced --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr80898-2.c @@ -0,0 +1,71 @@ +/* { dg-do run } */ +/* { dg-options "-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; +} diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr80898.c b/gcc/testsuite/gcc.dg/tree-ssa/pr80898.c new file mode 100644 index 00000000000..ed88f2cbd1a --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr80898.c @@ -0,0 +1,20 @@ +/* { dg-do run } */ +/* { dg-options "-O2" } */ + +struct S0 { + int f0 : 24; + int f1; + int f74; +} a, *c = &a; +struct S0 fn1() { + struct S0 b = {4, 3}; + return b; +} + +int main() { + *c = fn1(); + + if (a.f1 != 3) + __builtin_abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/utf16-4.c b/gcc/testsuite/gcc.dg/utf16-4.c index f9ebd61845a..e2f115ebc81 100644 --- a/gcc/testsuite/gcc.dg/utf16-4.c +++ b/gcc/testsuite/gcc.dg/utf16-4.c @@ -12,7 +12,7 @@ char16_t c2 = u'\U00064321'; /* { dg-warning "constant too long" } */ char16_t c3 = 'a'; char16_t c4 = U'a'; char16_t c5 = U'\u2029'; -char16_t c6 = U'\U00064321'; /* { dg-warning "conversion from .unsigned int. to .char16_t {aka short unsigned int}. changes value from .410401. to .17185." } */ +char16_t c6 = U'\U00064321'; /* { dg-warning "conversion from .(long )?unsigned int. to .char16_t {aka short unsigned int}. changes value from .410401. to .17185." } */ char16_t c7 = L'a'; char16_t c8 = L'\u2029'; char16_t c9 = L'\U00064321'; /* { dg-warning "conversion" "" { target { 4byte_wchar_t } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/pr66623.c b/gcc/testsuite/gcc.dg/vect/pr66623.c new file mode 100644 index 00000000000..f90c673f82d --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr66623.c @@ -0,0 +1,86 @@ +/* { dg-require-effective-target vect_float } */ + +#include "tree-vect.h" + +extern void abort (void); + +#define OP * +#define INIT 1.0 + +float __attribute__((noinline,noclone)) +foo (float *__restrict__ i) +{ + float l = INIT; + int a; + int b; + + for (a = 0; a < 4; a++) + for (b = 0; b < 4; b++) + l = l OP i[b]; + + return l; +} + +float __attribute__((noinline,noclone)) +foo_ref (float *__restrict__ i) +{ + float l = INIT; + + l = l OP i[0]; + l = l OP i[1]; + l = l OP i[2]; + l = l OP i[3]; + + l = l OP i[0]; + l = l OP i[1]; + l = l OP i[2]; + l = l OP i[3]; + + l = l OP i[0]; + l = l OP i[1]; + l = l OP i[2]; + l = l OP i[3]; + + l = l OP i[0]; + l = l OP i[1]; + l = l OP i[2]; + l = l OP i[3]; + + return l; +} + +union u +{ + float f; + unsigned int u; +}; + +int +main (void) +{ + union u res, res2; + float a[4]; + + if (sizeof (float) != sizeof (unsigned int)) + return 0; + + check_vect (); + + a[0] = 0.01; + a[1] = 0.01; + a[2] = 0.01; + a[3] = 1.0; + + res.f = foo_ref (a); + + res2.f = foo (a); + + if (res.u != res2.u) + abort (); + + return 0; +} + +/* need -ffast-math to vectorize this loop. */ +/* ARM NEON passes -ffast-math to these tests, so expect this to fail. */ +/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { xfail arm_neon_ok } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/pr80815-3.c b/gcc/testsuite/gcc.dg/vect/pr80815-3.c new file mode 100644 index 00000000000..dae01fa7af7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr80815-3.c @@ -0,0 +1,45 @@ +/* { dg-require-effective-target vect_int } */ + +#include "tree-vect.h" +int arr[2048]; +int res[100] = { 2148, 2146, 2144, 2142, 2140, 2138, 2136, 2134, 2132, 2130, + 2128, 2126, 2124, 2122, 2120, 2118, 2116, 2114, 2112, 2110, + 2108, 2106, 2104, 2102, 2100, 2098, 2096, 2094, 2092, 2090, + 2088, 2086, 2084, 2082, 2080, 2078, 2076, 2074, 2072, 2070, + 2068, 2066, 2064, 2062, 2060, 2058, 2056, 2054, 3078, 2050}; + +__attribute__ ((noinline)) int +foo (int *a, int *b, int len) +{ + int i; + int *a1 = a; + int *a0 = a1 - 4; + for (i = 0; i < len; i++) + { + *b = *a0 + *a1; + b--; + a0++; + a1++; + } + return 0; +} + +int main (void) +{ + int *a = &arr[1027]; + int *b = &arr[1024]; + + int i; + for (i = 0; i < 2048; i++) + arr[i] = i; + + foo (a, b, 50); + + for (i = 975; i < 1025; i++) + if (arr[i] != res[i - 975]) + abort (); + + return 0; +} + +/* { dg-final { scan-tree-dump "improved number of alias checks from \[0-9\]* to 1" "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/pr80928.c b/gcc/testsuite/gcc.dg/vect/pr80928.c new file mode 100644 index 00000000000..e6c1f1ab5a7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr80928.c @@ -0,0 +1,37 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target vect_int } */ + +#include "tree-vect.h" + +int a[1020]; + +void __attribute__((noinline)) +foo () +{ + for (int i = 0; i < 1020; i += 5) + { + a[i] = i; + a[i+1] = i; + a[i+2] = i; + a[i+3] = i; + a[i+4] = i; + } +} + +int main () +{ + check_vect (); + + foo (); + + /* check results */ + for (int i = 0; i < 1020; ++i) + if (a[i] != ((i + 4) / 5) * 5) + abort (); + + return 0; +} + +/* Make sure we are not triggering hybrid SLP due to the IV update. */ +/* { dg-final { scan-tree-dump "Loop contains only SLP stmts" "vect" } } */ +/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/slp-13-big-array.c b/gcc/testsuite/gcc.dg/vect/slp-13-big-array.c index 4520fb15f20..5540387b028 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-13-big-array.c +++ b/gcc/testsuite/gcc.dg/vect/slp-13-big-array.c @@ -22,7 +22,7 @@ main1 () abort (); } - /* Induction is not SLPable yet. */ + /* Induction is SLPable. */ for (i = 0; i < N; i++) { out[i*8] = in[i*8] + i; @@ -49,8 +49,7 @@ main1 () abort (); } - /* Induction is not SLPable yet and strided group size must be a power of 2 - to get vectorized. */ + /* Induction is SLPable. */ for (i = 0; i < N/2; i++) { out2[i*12] = in2[i*12] + i; @@ -134,7 +133,7 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" { xfail *-*-* } } } */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" } } */ - +/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { { vect_interleave && vect_extract_even_odd } && { ! vect_pack_trunc } } } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target { ! vect_pack_trunc } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { target { { vect_interleave && vect_extract_even_odd } && vect_pack_trunc } } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" { target vect_pack_trunc } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/slp-13.c b/gcc/testsuite/gcc.dg/vect/slp-13.c index 2394874d36c..e7482667e2a 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-13.c +++ b/gcc/testsuite/gcc.dg/vect/slp-13.c @@ -14,7 +14,7 @@ main1 () unsigned int in2[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; unsigned int out2[N*8]; - /* Induction is not SLPable yet. */ + /* Induction is SLPable. */ for (i = 0; i < N; i++) { out[i*8] = in[i*8] + i; @@ -41,8 +41,7 @@ main1 () abort (); } - /* Induction is not SLPable yet and strided group size must be a power of 2 - to get vectorized. */ + /* Induction is SLPable. */ for (i = 0; i < N/2; i++) { out2[i*12] = in2[i*12] + i; @@ -126,7 +125,7 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" { xfail *-*-* } } } */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" } } */ - +/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { { vect_interleave && vect_extract_even_odd } && { ! vect_pack_trunc } } } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target { ! vect_pack_trunc } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { target { { vect_interleave && vect_extract_even_odd } && vect_pack_trunc } } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" { target vect_pack_trunc } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/slp-perm-8.c b/gcc/testsuite/gcc.dg/vect/slp-perm-8.c index d5fa1e8023f..f804dcc8163 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-perm-8.c +++ b/gcc/testsuite/gcc.dg/vect/slp-perm-8.c @@ -41,6 +41,7 @@ int main (int argc, const char* argv[]) check_results[3*i] = 9 * i + 6; check_results[3*i+1] = 9 * i + 15; check_results[3*i+2] = 9 * i + 4; + __asm__ volatile ("" : : : "memory"); } foo (input, output); @@ -52,8 +53,7 @@ int main (int argc, const char* argv[]) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target { vect_perm_byte && vect_char_mult } } } } */ -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_perm_byte && {! vect_char_mult } } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_perm_byte } } } } */ /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { vect_perm_byte && {! vect_load_lanes } } } } } */ /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target vect_load_lanes } } } */ /* { dg-final { scan-tree-dump "note: Built SLP cancelled: can use load/store-lanes" "vect" { target { vect_perm_byte && vect_load_lanes } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/slp-perm-9.c b/gcc/testsuite/gcc.dg/vect/slp-perm-9.c index 781096e9f66..4d9c11dcc47 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-perm-9.c +++ b/gcc/testsuite/gcc.dg/vect/slp-perm-9.c @@ -42,6 +42,7 @@ int main (int argc, const char* argv[]) check_results[3*i] = 9 * i + 6; check_results[3*i+1] = 9 * i + 15; check_results[3*i+2] = 9 * i + 4; + __asm__ volatile ("" : : : "memory"); } foo (input, output); diff --git a/gcc/testsuite/gcc.dg/vect/vect-103.c b/gcc/testsuite/gcc.dg/vect/vect-103.c index fb2a8578c5d..e0fd1b61e02 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-103.c +++ b/gcc/testsuite/gcc.dg/vect/vect-103.c @@ -55,5 +55,5 @@ int main (void) } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "dependence distance modulo vf == 0" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "accesses have the same alignment" 1 "vect" } } */ diff --git a/gcc/testsuite/gcc.misc-tests/bprob-2.c b/gcc/testsuite/gcc.misc-tests/bprob-2.c index e0931f39c46..90ed7d74b8c 100644 --- a/gcc/testsuite/gcc.misc-tests/bprob-2.c +++ b/gcc/testsuite/gcc.misc-tests/bprob-2.c @@ -1,3 +1,5 @@ +/* { dg-require-effective-target label_values } */ + /* Test profile-directed block ordering with computed gotos. * This is the same as test gcc.c-torture/execute/980526-1.c and @@ -37,9 +39,7 @@ static void do2(void){ } int main(void){ -#ifndef NO_LABEL_VALUES do1(); do2(); -#endif exit(0); } diff --git a/gcc/testsuite/gcc.misc-tests/gcov-1a.c b/gcc/testsuite/gcc.misc-tests/gcov-1a.c new file mode 100644 index 00000000000..2b9fabce66c --- /dev/null +++ b/gcc/testsuite/gcc.misc-tests/gcov-1a.c @@ -0,0 +1,20 @@ +/* Test Gcov basics. */ + +/* { dg-options "-fprofile-arcs -ftest-coverage -fprofile-abs-path" } */ +/* { dg-do run { target native } } */ + +void noop () +{ +} + +int main () +{ + int i; + + for (i = 0; i < 10; i++) /* count(11) */ + noop (); /* count(10) */ + + return 0; /* count(1) */ +} + +/* { dg-final { run-gcov gcov-1a.c } } */ diff --git a/gcc/testsuite/gcc.misc-tests/gcov-3.c b/gcc/testsuite/gcc.misc-tests/gcov-3.c index fcccdeeff41..eb6e4cc46bf 100644 --- a/gcc/testsuite/gcc.misc-tests/gcov-3.c +++ b/gcc/testsuite/gcc.misc-tests/gcov-3.c @@ -1,3 +1,5 @@ +/* { dg-require-effective-target label_values } */ + /* Test Gcov with computed gotos. This is the same as test gcc.c-torture/execute/980526-1.c */ @@ -38,10 +40,8 @@ static void do2(void){ } int main(void){ /* count(1) */ -#ifndef NO_LABEL_VALUES do1(); do2(); -#endif exit(0); /* count(1) */ } diff --git a/gcc/testsuite/gcc.target/aarch64/atomic_cmp_exchange_zero_reg_1.c b/gcc/testsuite/gcc.target/aarch64/atomic_cmp_exchange_zero_reg_1.c new file mode 100644 index 00000000000..15606b68990 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/atomic_cmp_exchange_zero_reg_1.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +int +foo (int *a) +{ + int x = 3; + return __atomic_compare_exchange_n (a, &x, 0, 1, __ATOMIC_ACQUIRE, __ATOMIC_ACQUIRE); +} + +/* { dg-final { scan-assembler "stxr\\tw\[0-9\]+, wzr,.*" } } */ +/* { dg-final { scan-assembler-not "mov\\tw\[0-9\]+, 0" } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/atomic_cmp_exchange_zero_strong_1.c b/gcc/testsuite/gcc.target/aarch64/atomic_cmp_exchange_zero_strong_1.c new file mode 100644 index 00000000000..b14a7c29437 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/atomic_cmp_exchange_zero_strong_1.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +int +foo (int *a) +{ + int x = 0; + return __atomic_compare_exchange_n (a, &x, 4, 0, + __ATOMIC_ACQUIRE, __ATOMIC_ACQUIRE); +} + +/* { dg-final { scan-assembler-times "cbnz\\tw\[0-9\]+" 2 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/cmp_shifted_reg_1.c b/gcc/testsuite/gcc.target/aarch64/cmp_shifted_reg_1.c new file mode 100644 index 00000000000..cacecf4e71d --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/cmp_shifted_reg_1.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 " } */ + +int f3 (int x, int y) +{ + int res = x << 3; + return res != 0; +} + +/* We should combine the shift and compare */ +/* { dg-final { scan-assembler "cmp\.*\twzr, w\[0-9\]+, lsl 3" } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/hfmode_ins_1.c b/gcc/testsuite/gcc.target/aarch64/hfmode_ins_1.c new file mode 100644 index 00000000000..7fafe92f490 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/hfmode_ins_1.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +/* Check that we can perform this in a single INS without doing any DUPs. */ + +#include <arm_neon.h> + +float16x8_t +foo (float16x8_t a, float16x8_t b) +{ + return vsetq_lane_f16 (vgetq_lane_f16 (b, 2), a, 3); +} + +float16x4_t +bar (float16x4_t a, float16x4_t b) +{ + return vset_lane_f16 (vget_lane_f16 (b, 2), a, 3); +} + +/* { dg-final { scan-assembler-times "ins\\t" 2 } } */ +/* { dg-final { scan-assembler-not "dup\\t" } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/inline-lrint_1.c b/gcc/testsuite/gcc.target/aarch64/inline-lrint_1.c new file mode 100644 index 00000000000..478875ff874 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/inline-lrint_1.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-O3 -fno-math-errno" } */ + +#include "lrint-matherr.h" + +TEST (dld, double, long, ) +TEST (flf, float , long, ) + +TEST (did, double, int, ) +TEST (fif, float , int, ) + +TEST (dlld, double, long long, l) +TEST (fllf, float , long long, l) + +/* { dg-final { scan-assembler-times "frintx\t\[d,s\]\[0-9\]+, \[d,s\]\[0-9\]+" 6 } } */ +/* { dg-final { scan-assembler-times "fcvtzs\tx\[0-9\]+, \[d,s\]\[0-9\]+" 6 } } */ +/* { dg-final { scan-assembler-not "bl" } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/inline-lrint_2.c b/gcc/testsuite/gcc.target/aarch64/inline-lrint_2.c new file mode 100644 index 00000000000..6080e186d8f --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/inline-lrint_2.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target ilp32 } */ +/* { dg-options "-O3 -fno-math-errno" } */ + +#include "lrint-matherr.h" + +TEST (dld, double, long, ) +TEST (flf, float , long, ) + +TEST (did, double, int, ) +TEST (fif, float , int, ) + +TEST (dlld, double, long long, l) +TEST (fllf, float , long long, l) + +/* { dg-final { scan-assembler-times "frintx\t\[d,s\]\[0-9\]+, \[d,s\]\[0-9\]+" 6 } } */ +/* { dg-final { scan-assembler-times "fcvtzs\t\[w,x\]\[0-9\]+, \[d,s\]\[0-9\]+" 6 } } */ +/* { dg-final { scan-assembler-not "bl" } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/lrint-matherr.h b/gcc/testsuite/gcc.target/aarch64/lrint-matherr.h new file mode 100644 index 00000000000..cc6e3d13f9b --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/lrint-matherr.h @@ -0,0 +1,5 @@ +#define TEST(name, float_type, int_type, pref) void f_##name (float_type x) \ +{ \ + volatile float_type a = __builtin_rint (x); \ + volatile int_type b = __builtin_l##pref##rint (x); \ +} diff --git a/gcc/testsuite/gcc.target/aarch64/no-inline-lrint_1.c b/gcc/testsuite/gcc.target/aarch64/no-inline-lrint_1.c new file mode 100644 index 00000000000..d5e9200562c --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/no-inline-lrint_1.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-O3" } */ + +#include "lrint-matherr.h" + +TEST (dld, double, long, ) +TEST (flf, float , long, ) + +TEST (did, double, int, ) +TEST (fif, float , int, ) + +TEST (dlld, double, long long, l) +TEST (fllf, float , long long, l) + +/* { dg-final { scan-assembler-times "frintx\t\[d,s\]\[0-9\]+, \[d,s\]\[0-9\]+" 6 } } */ +/* { dg-final { scan-assembler-times "bl\tlrint" 4 } } */ +/* { dg-final { scan-assembler-times "bl\tllrint" 2 } } */ +/* { dg-final { scan-assembler-not "fcvtzs" } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/no-inline-lrint_2.c b/gcc/testsuite/gcc.target/aarch64/no-inline-lrint_2.c new file mode 100644 index 00000000000..05c0a2affa0 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/no-inline-lrint_2.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target ilp32 } */ +/* { dg-options "-O3" } */ + +#include "lrint-matherr.h" + +TEST (dld, double, long, ) +TEST (flf, float , long, ) + +TEST (did, double, int, ) +TEST (fif, float , int, ) + +TEST (dlld, double, long long, l) +TEST (fllf, float , long long, l) + +/* { dg-final { scan-assembler-times "frintx\t\[d,s\]\[0-9\]+, \[d,s\]\[0-9\]+" 6 } } */ +/* { dg-final { scan-assembler-times "bl\tlrint" 4 } } */ +/* { dg-final { scan-assembler-times "bl\tllrint" 2 } } */ +/* { dg-final { scan-assembler-not "fcvtzs" } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sdiv_costs_1.c b/gcc/testsuite/gcc.target/aarch64/sdiv_costs_1.c new file mode 100644 index 00000000000..24d7f7df208 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sdiv_costs_1.c @@ -0,0 +1,38 @@ +/* { dg-do compile } */ +/* { dg-options "-O3" } */ + +/* Both sdiv and udiv can be used here, so prefer udiv. */ +int f1 (unsigned char *p) +{ + return 100 / p[1]; +} + +int f2 (unsigned char *p, unsigned short x) +{ + return x / p[0]; +} + +int f3 (unsigned char *p, int x) +{ + x &= 0x7fffffff; + return x / p[0]; +} + +int f5 (unsigned char *p, unsigned short x) +{ + return x % p[0]; +} + +/* This should only generate signed divisions. */ +int f4 (unsigned char *p) +{ + return -100 / p[1]; +} + +int f6 (unsigned char *p, short x) +{ + return x % p[0]; +} + +/* { dg-final { scan-assembler-times "udiv\tw\[0-9\]+, w\[0-9\]+" 4 } } */ +/* { dg-final { scan-assembler-times "sdiv\tw\[0-9\]+, w\[0-9\]+" 2 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/store_lane0_str_1.c b/gcc/testsuite/gcc.target/aarch64/store_lane0_str_1.c new file mode 100644 index 00000000000..4464fec2c1f --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/store_lane0_str_1.c @@ -0,0 +1,54 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +typedef int v2si __attribute__ ((vector_size (8))); +typedef float v2sf __attribute__ ((vector_size (8))); +typedef short v4hi __attribute__ ((vector_size (8))); +typedef __fp16 v4hf __attribute__ ((vector_size (8))); +typedef char v8qi __attribute__ ((vector_size (8))); + +typedef int v4si __attribute__ ((vector_size (16))); +typedef float v4sf __attribute__ ((vector_size (16))); +typedef short v8hi __attribute__ ((vector_size (16))); +typedef __fp16 v8hf __attribute__ ((vector_size (16))); +typedef char v16qi __attribute__ ((vector_size (16))); +typedef long long v2di __attribute__ ((vector_size (16))); +typedef double v2df __attribute__ ((vector_size (16))); + +#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ +#define LANE(N) (N - 1) +#else +#define LANE(N) 0 +#endif + +#define FUNC(T, E, N) \ +void \ +store_lane_##T (T x, E *y) \ +{ \ + y[0] = x[N - 1 - LANE (N)]; \ + y[3] = x[LANE (N)]; \ +} + +FUNC (v2si, int, 2) +FUNC (v2sf, float, 2) +FUNC (v4hi, short, 4) +FUNC (v4hf, __fp16, 4) +FUNC (v8qi, char, 8) + +FUNC (v4si, int, 4) +FUNC (v4sf, float, 4) +FUNC (v8hi, short, 8) +FUNC (v8hf, __fp16, 8) +FUNC (v16qi, char, 16) +FUNC (v2di, long long, 2) +FUNC (v2df, double, 2) + +/* When storing lane zero of a vector we can use the scalar STR instruction + that supports more addressing modes. */ + +/* { dg-final { scan-assembler-times "str\ts\[0-9\]+" 4 } } */ +/* { dg-final { scan-assembler-times "str\tb\[0-9\]+" 2 } } */ +/* { dg-final { scan-assembler-times "str\th\[0-9\]+" 4 } } */ +/* { dg-final { scan-assembler-times "str\td\[0-9\]+" 2 } } */ +/* { dg-final { scan-assembler-not "umov" } } */ +/* { dg-final { scan-assembler-not "dup" } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/subs_compare_1.c b/gcc/testsuite/gcc.target/aarch64/subs_compare_1.c new file mode 100644 index 00000000000..95c8f696fee --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/subs_compare_1.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +int +foo (int a, int b) +{ + int x = a - b; + if (a <= b) + return x; + else + return 0; +} + +/* { dg-final { scan-assembler-times "subs\\tw\[0-9\]+, w\[0-9\]+, w\[0-9\]+" 1 } } */ +/* { dg-final { scan-assembler-not "cmp\\tw\[0-9\]+, w\[0-9\]+" } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/subs_compare_2.c b/gcc/testsuite/gcc.target/aarch64/subs_compare_2.c new file mode 100644 index 00000000000..60c6d9e5ccd --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/subs_compare_2.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +int +foo (int a, int b) +{ + int x = a - 4; + if (a < 4) + return x; + else + return 0; +} + +/* { dg-final { scan-assembler-times "subs\\tw\[0-9\]+, w\[0-9\]+, #4" 1 } } */ +/* { dg-final { scan-assembler-not "cmp\\tw\[0-9\]+, w\[0-9\]+" } } */ diff --git a/gcc/testsuite/gcc.target/arc/add_n-combine.c b/gcc/testsuite/gcc.target/arc/add_n-combine.c new file mode 100644 index 00000000000..db6454f1462 --- /dev/null +++ b/gcc/testsuite/gcc.target/arc/add_n-combine.c @@ -0,0 +1,48 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-rtl-combine" } */ + +struct b1 { + char c; + char bg; +}; + +struct bj1 { + char bk; + struct b1 bn[]; +}; + +struct b2 { + short c; + char bg; +}; + +struct bj2 { + short bk; + struct b2 bn[]; +}; + +struct b3 { + int c; + char bg; +}; + +struct bj3 { + int bk; + struct b3 bn[]; +}; + + +struct bj1 at1; +struct bj2 at2; +struct bj3 at3; + +int bu; +void a(); + +void f() { + a(at1.bn[bu]); + a(at2.bn[bu]); + a(at3.bn[bu]); +} + +/* { dg-final { scan-rtl-dump-times "\\*add_n" 3 "combine" } } */ diff --git a/gcc/testsuite/gcc.target/arc/pr9001195952.c b/gcc/testsuite/gcc.target/arc/pr9001195952.c new file mode 100755 index 00000000000..252438d8d78 --- /dev/null +++ b/gcc/testsuite/gcc.target/arc/pr9001195952.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-skip-if "" { ! { clmcpu } } } */ +/* { dg-options "-mcpu=archs -Os -w -fpic" } */ + +/* tst_movb split pattern is wrong for anything else than NPS + chip. */ +__bswap_32___bsx() { + int a = __builtin_bswap32(__bswap_32___bsx); + if (a & 1048575) + zlog_warn(); +} diff --git a/gcc/testsuite/gcc.target/arc/sub_n-combine.c b/gcc/testsuite/gcc.target/arc/sub_n-combine.c new file mode 100644 index 00000000000..4e227e41fb9 --- /dev/null +++ b/gcc/testsuite/gcc.target/arc/sub_n-combine.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-rtl-combine" } */ + +int a; + +double b1() { + int c = a << 1; + return 1 - c; +} + +double b2() { + int c = a << 2; + return 1 - c; +} + +double b3() { + int c = a << 3; + return 1 - c; +} + +/* { dg-final { scan-rtl-dump-times "\\*sub_n" 3 "combine" } } */ diff --git a/gcc/testsuite/gcc.target/arm/sdiv_costs_1.c b/gcc/testsuite/gcc.target/arm/sdiv_costs_1.c new file mode 100644 index 00000000000..3920590dfcc --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/sdiv_costs_1.c @@ -0,0 +1,39 @@ +/* { dg-do compile } */ +/* { dg-options "-O3" } */ +/* { dg-require-effective-target arm_v8_vfp_ok } */ + +/* Both sdiv and udiv can be used here, so prefer udiv. */ +int f1 (unsigned char *p) +{ + return 100 / p[1]; +} + +int f2 (unsigned char *p, unsigned short x) +{ + return x / p[0]; +} + +int f3 (unsigned char *p, int x) +{ + x &= 0x7fffffff; + return x / p[0]; +} + +int f5 (unsigned char *p, unsigned short x) +{ + return x % p[0]; +} + +/* This should only generate signed divisions. */ +int f4 (unsigned char *p) +{ + return -100 / p[1]; +} + +int f6 (unsigned char *p, short x) +{ + return x % p[0]; +} + +/* { dg-final { scan-assembler-times "udiv\tr\[0-9\]+, r\[0-9\]+, r\[0-9\]+" 4 } } */ +/* { dg-final { scan-assembler-times "sdiv\tr\[0-9\]+, r\[0-9\]+, r\[0-9\]+" 2 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512bw-vpmovswb-1.c b/gcc/testsuite/gcc.target/i386/avx512bw-vpmovswb-1.c index b5b6ef79a87..6bb87d25f4d 100644 --- a/gcc/testsuite/gcc.target/i386/avx512bw-vpmovswb-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512bw-vpmovswb-1.c @@ -3,18 +3,21 @@ /* { dg-final { scan-assembler-times "vpmovswb\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpmovswb\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpmovswb\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}{z}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vpmovswb\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*res1\[^\n\]*\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpmovswb\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpmovswb\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpmovswb\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}{z}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vpmovswb\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*res2\[^\n\]*\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpmovswb\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpmovswb\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpmovswb\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}{z}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vpmovswb\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*res3\[^\n\]*\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ #include <immintrin.h> -volatile __m128i x, z; -volatile __m256i y; -volatile __m512i u; +volatile __m128i x, z, res1; +volatile __m256i y, res2; +volatile __m512i u, res3; volatile __mmask8 m1; volatile __mmask16 m2; volatile __mmask32 m3; @@ -25,10 +28,13 @@ avx512bw_test (void) z = _mm_cvtsepi16_epi8 (x); z = _mm_mask_cvtsepi16_epi8 (z, m1, x); z = _mm_maskz_cvtsepi16_epi8 (m1, x); + _mm_mask_cvtsepi16_storeu_epi8 ((void *) &res1, m1, x); z = _mm256_cvtsepi16_epi8 (y); z = _mm256_mask_cvtsepi16_epi8 (z, m2, y); z = _mm256_maskz_cvtsepi16_epi8 (m2, y); + _mm256_mask_cvtsepi16_storeu_epi8 ((void *) &res2, m2, y); y = _mm512_cvtsepi16_epi8 (u); y = _mm512_mask_cvtsepi16_epi8 (y, m3, u); y = _mm512_maskz_cvtsepi16_epi8 (m3, u); + _mm512_mask_cvtsepi16_storeu_epi8 ((void *) &res3, m3, u); } diff --git a/gcc/testsuite/gcc.target/i386/avx512bw-vpmovswb-2.c b/gcc/testsuite/gcc.target/i386/avx512bw-vpmovswb-2.c index 69e25a27c4d..fd9cb4c681e 100644 --- a/gcc/testsuite/gcc.target/i386/avx512bw-vpmovswb-2.c +++ b/gcc/testsuite/gcc.target/i386/avx512bw-vpmovswb-2.c @@ -31,9 +31,11 @@ TEST (void) { int i, sign; UNION_TYPE (AVX512F_LEN_HALF, i_b) res1, res2, res3; + char res4[SIZE]; UNION_TYPE (AVX512F_LEN, i_w) src; MASK_TYPE mask = MASK_VALUE; char res_ref[32]; + char res_ref2[SIZE_HALF]; sign = -1; for (i = 0; i < SIZE; i++) @@ -41,6 +43,7 @@ TEST (void) src.a[i] = 1 + 34 * i * sign; sign = sign * -1; res2.a[i] = DEFAULT_VALUE; + res4[i] = DEFAULT_VALUE; } res1.x = INTRINSIC (_cvtsepi16_epi8) (src.x); @@ -59,4 +62,11 @@ TEST (void) MASK_ZERO (i_b) (res_ref, mask, SIZE); if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res3, res_ref)) abort (); + + INTRINSIC (_mask_cvtsepi16_storeu_epi8) (res4, mask, src.x); + CALC (res_ref2, src.a); + MASK_MERGE (i_b) (res_ref2, mask, SIZE); + + if (checkVc (res4, res_ref2, SIZE)) + abort (); } diff --git a/gcc/testsuite/gcc.target/i386/avx512bw-vpmovuswb-1.c b/gcc/testsuite/gcc.target/i386/avx512bw-vpmovuswb-1.c index e1c62bf56e3..7825e46a944 100644 --- a/gcc/testsuite/gcc.target/i386/avx512bw-vpmovuswb-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512bw-vpmovuswb-1.c @@ -3,18 +3,21 @@ /* { dg-final { scan-assembler-times "vpmovuswb\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpmovuswb\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpmovuswb\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}{z}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vpmovuswb\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*res1\[^\n\]*\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpmovuswb\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpmovuswb\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpmovuswb\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}{z}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vpmovuswb\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*res2\[^\n\]*\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpmovuswb\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpmovuswb\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpmovuswb\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}{z}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vpmovuswb\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*res3\[^\n\]*\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ #include <immintrin.h> -volatile __m128i x, z; -volatile __m256i y; -volatile __m512i u; +volatile __m128i x, z, res1; +volatile __m256i y, res2; +volatile __m512i u, res3; volatile __mmask8 m1; volatile __mmask16 m2; volatile __mmask32 m3; @@ -25,10 +28,13 @@ avx512bw_test (void) z = _mm_cvtusepi16_epi8 (x); z = _mm_mask_cvtusepi16_epi8 (z, m1, x); z = _mm_maskz_cvtusepi16_epi8 (m1, x); + _mm_mask_cvtusepi16_storeu_epi8 ((void *) &res1, m1, x); z = _mm256_cvtusepi16_epi8 (y); z = _mm256_mask_cvtusepi16_epi8 (z, m2, y); z = _mm256_maskz_cvtusepi16_epi8 (m2, y); + _mm256_mask_cvtusepi16_storeu_epi8 ((void *) &res2, m2, y); y = _mm512_cvtusepi16_epi8 (u); y = _mm512_mask_cvtusepi16_epi8 (y, m3, u); y = _mm512_maskz_cvtusepi16_epi8 (m3, u); + _mm512_mask_cvtusepi16_storeu_epi8 ((void *) &res3, m3, u); } diff --git a/gcc/testsuite/gcc.target/i386/avx512bw-vpmovuswb-2.c b/gcc/testsuite/gcc.target/i386/avx512bw-vpmovuswb-2.c index 094d4329ab0..d5198f39eb6 100644 --- a/gcc/testsuite/gcc.target/i386/avx512bw-vpmovuswb-2.c +++ b/gcc/testsuite/gcc.target/i386/avx512bw-vpmovuswb-2.c @@ -23,14 +23,17 @@ TEST (void) { int i; UNION_TYPE (AVX512F_LEN_HALF, i_b) res1, res2, res3; + unsigned char res4[SIZE]; UNION_TYPE (AVX512F_LEN, i_w) src; MASK_TYPE mask = MASK_VALUE; unsigned char res_ref[32]; + unsigned char res_ref2[SIZE]; for (i = 0; i < SIZE; i++) { src.a[i] = 1 + 34 * i; res2.a[i] = DEFAULT_VALUE; + res4[i] = DEFAULT_VALUE; } res1.x = INTRINSIC (_cvtusepi16_epi8) (src.x); @@ -49,4 +52,11 @@ TEST (void) MASK_ZERO (i_b) (res_ref, mask, SIZE); if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res3, res_ref)) abort (); + + INTRINSIC (_mask_cvtusepi16_storeu_epi8) (res4, mask, src.x); + CALC (res_ref2, src.a); + + MASK_MERGE (i_b) (res_ref2, mask, SIZE); + if (checkVc (res4, res_ref2, SIZE)) + abort (); } diff --git a/gcc/testsuite/gcc.target/i386/avx512bw-vpmovwb-1.c b/gcc/testsuite/gcc.target/i386/avx512bw-vpmovwb-1.c index e7adbb5a351..a1ad551392b 100644 --- a/gcc/testsuite/gcc.target/i386/avx512bw-vpmovwb-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512bw-vpmovwb-1.c @@ -3,18 +3,21 @@ /* { dg-final { scan-assembler-times "vpmovwb\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpmovwb\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpmovwb\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}{z}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vpmovwb\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*res1\[^\n\]*\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpmovwb\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpmovwb\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpmovwb\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}{z}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vpmovwb\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*res2\[^\n\]*\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpmovwb\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpmovwb\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpmovwb\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}{z}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vpmovwb\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*res3\[^\n\]*\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ #include <immintrin.h> -volatile __m128i x, z; -volatile __m256i y; -volatile __m512i u; +volatile __m128i x, z, res1; +volatile __m256i y, res2; +volatile __m512i u, res3; volatile __mmask8 m1; volatile __mmask16 m2; volatile __mmask32 m3; @@ -25,10 +28,13 @@ avx512bw_test (void) z = _mm_cvtepi16_epi8 (x); z = _mm_mask_cvtepi16_epi8 (z, m1, x); z = _mm_maskz_cvtepi16_epi8 (m1, x); + _mm_mask_cvtepi16_storeu_epi8 ((void *) &res1, m1, x); z = _mm256_cvtepi16_epi8 (y); z = _mm256_mask_cvtepi16_epi8 (z, m2, y); z = _mm256_maskz_cvtepi16_epi8 (m2, y); + _mm256_mask_cvtepi16_storeu_epi8 ((void *) &res2, m2, y); y = _mm512_cvtepi16_epi8 (u); y = _mm512_mask_cvtepi16_epi8 (y, m3, u); y = _mm512_maskz_cvtepi16_epi8 (m3, u); + _mm512_mask_cvtepi16_storeu_epi8 ((void *) &res3, m3, u); } diff --git a/gcc/testsuite/gcc.target/i386/avx512bw-vpmovwb-2.c b/gcc/testsuite/gcc.target/i386/avx512bw-vpmovwb-2.c index 32857dae551..6b0f86f57d8 100644 --- a/gcc/testsuite/gcc.target/i386/avx512bw-vpmovwb-2.c +++ b/gcc/testsuite/gcc.target/i386/avx512bw-vpmovwb-2.c @@ -24,9 +24,11 @@ TEST (void) { int i, sign; UNION_TYPE (AVX512F_LEN_HALF, i_b) res1, res2, res3; + char res4[SIZE]; UNION_TYPE (AVX512F_LEN, i_w) src; MASK_TYPE mask = MASK_VALUE; char res_ref[32]; + char res_ref2[SIZE]; sign = -1; for (i = 0; i < SIZE; i++) @@ -34,6 +36,7 @@ TEST (void) src.a[i] = 1 + 34 * i * sign; sign = sign * -1; res2.a[i] = DEFAULT_VALUE; + res4[i] = DEFAULT_VALUE; } res1.x = INTRINSIC (_cvtepi16_epi8) (src.x); @@ -52,4 +55,11 @@ TEST (void) MASK_ZERO (i_b) (res_ref, mask, SIZE); if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res3, res_ref)) abort (); + + INTRINSIC (_mask_cvtepi16_storeu_epi8) (res4, mask, src.x); + CALC (res_ref2, src.a); + + MASK_MERGE (i_b) (res_ref2, mask, SIZE); + if (checkVc (res4, res_ref2, SIZE)) + abort (); } diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vmaxsd-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vmaxsd-1.c index c1c8f8d9fc6..161de342efe 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vmaxsd-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vmaxsd-1.c @@ -1,5 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-mavx512f -O2" } */ +/* { dg-final { scan-assembler-times "vmaxsd\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vmaxsd\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vmaxsd\[ \\t\]+\[^\{\n\]*\{sae\}\[^\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vmaxsd\[ \\t\]+\[^\n\]*\{sae\}\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vmaxsd\[ \\t\]+\[^\n\]*\{sae\}\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ @@ -12,6 +14,8 @@ volatile __mmask8 m; void extern avx512f_test (void) { + x1 = _mm_mask_max_sd (x1, m, x2, x3); + x1 = _mm_maskz_max_sd (m, x1, x2); x1 = _mm_max_round_sd (x1, x2, _MM_FROUND_NO_EXC); x1 = _mm_mask_max_round_sd (x1, m, x2, x3, _MM_FROUND_NO_EXC); x1 = _mm_maskz_max_round_sd (m, x1, x2, _MM_FROUND_NO_EXC); diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vmaxsd-2.c b/gcc/testsuite/gcc.target/i386/avx512f-vmaxsd-2.c index 29db77723b1..e732d442f94 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vmaxsd-2.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vmaxsd-2.c @@ -20,7 +20,7 @@ void avx512f_test (void) { int i, sign; - union128d res1, res2, res3, src1, src2; + union128d res1, res2, res3, res4, res5, src1, src2; MASK_TYPE mask = MASK_VALUE; double res_ref[SIZE]; @@ -29,26 +29,38 @@ avx512f_test (void) { src1.a[i] = 1.5 + 34.67 * i * sign; src2.a[i] = -22.17 * i * sign + 1.0; + res1.a[i] = DEFAULT_VALUE; + res4.a[i] = DEFAULT_VALUE; sign = sign * -1; } - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - res1.x = _mm_max_round_sd (src1.x, src2.x, _MM_FROUND_NO_EXC); - res2.x = _mm_mask_max_round_sd (res2.x, mask, src1.x, src2.x, _MM_FROUND_NO_EXC); - res3.x = _mm_maskz_max_round_sd (mask, src1.x, src2.x, _MM_FROUND_NO_EXC); + res1.x = _mm_mask_max_sd (res1.x, mask, src1.x, src2.x); + res2.x = _mm_maskz_max_sd (mask, src1.x, src2.x); + res3.x = _mm_max_round_sd (src1.x, src2.x, _MM_FROUND_NO_EXC); + res4.x = _mm_mask_max_round_sd (res4.x, mask, src1.x, src2.x, _MM_FROUND_NO_EXC); + res5.x = _mm_maskz_max_round_sd (mask, src1.x, src2.x, _MM_FROUND_NO_EXC); calc_max (res_ref, src1.a, src2.a); + MASK_MERGE (d) (res_ref, mask, 1); if (check_union128d (res1, res_ref)) + abort (); + + MASK_ZERO (d) (res_ref, mask, 1); + if (check_union128d (res2, res_ref)) + abort (); + + calc_max (res_ref, src1.a, src2.a); + + if (check_union128d (res3, res_ref)) abort(); MASK_MERGE (d) (res_ref, mask, 1); - if (check_union128d (res2, res_ref)) + if (check_union128d (res4, res_ref)) abort (); MASK_ZERO (d) (res_ref, mask, 1); - if (check_union128d (res3, res_ref)) + if (check_union128d (res5, res_ref)) abort (); } diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vmaxss-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vmaxss-1.c index ecd87578252..668afad9529 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vmaxss-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vmaxss-1.c @@ -1,5 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-mavx512f -O2" } */ +/* { dg-final { scan-assembler-times "vmaxss\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vmaxss\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vmaxss\[ \\t\]+\[^\{\n\]*\{sae\}\[^\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vmaxss\[ \\t\]+\[^\n\]*\{sae\}\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vmaxss\[ \\t\]+\[^\n\]*\{sae\}\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ @@ -12,6 +14,8 @@ volatile __mmask8 m; void extern avx512f_test (void) { + x1 = _mm_mask_max_ss (x1, m, x2, x3); + x1 = _mm_maskz_max_ss (m, x1, x2); x1 = _mm_max_round_ss (x1, x2, _MM_FROUND_NO_EXC); x1 = _mm_mask_max_round_ss (x1, m, x2, x3, _MM_FROUND_NO_EXC); x1 = _mm_maskz_max_round_ss (m, x1, x2, _MM_FROUND_NO_EXC); diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vmaxss-2.c b/gcc/testsuite/gcc.target/i386/avx512f-vmaxss-2.c index 1932a6e5c80..c63a4596b64 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vmaxss-2.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vmaxss-2.c @@ -24,7 +24,7 @@ void avx512f_test (void) { int i, sign; - union128 res1, res2, res3, src1, src2; + union128 res1, res2, res3, res4, res5, src1, src2; MASK_TYPE mask = MASK_VALUE; float res_ref[SIZE]; @@ -33,26 +33,38 @@ avx512f_test (void) { src1.a[i] = 1.5 + 34.67 * i * sign; src2.a[i] = -22.17 * i * sign + 1.0; + res1.a[i] = DEFAULT_VALUE; + res4.a[i] = DEFAULT_VALUE; sign = sign * -1; } - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - res1.x = _mm_max_round_ss (src1.x, src2.x, _MM_FROUND_NO_EXC); - res2.x = _mm_mask_max_round_ss (res2.x, mask, src1.x, src2.x, _MM_FROUND_NO_EXC); - res3.x = _mm_maskz_max_round_ss (mask, src1.x, src2.x, _MM_FROUND_NO_EXC); + res1.x = _mm_mask_max_ss (res1.x, mask, src1.x, src2.x); + res2.x = _mm_maskz_max_ss (mask, src1.x, src2.x); + res3.x = _mm_max_round_ss (src1.x, src2.x, _MM_FROUND_NO_EXC); + res4.x = _mm_mask_max_round_ss (res4.x, mask, src1.x, src2.x, _MM_FROUND_NO_EXC); + res5.x = _mm_maskz_max_round_ss (mask, src1.x, src2.x, _MM_FROUND_NO_EXC); calc_max (res_ref, src1.a, src2.a); + MASK_MERGE () (res_ref, mask, 1); if (check_union128 (res1, res_ref)) + abort (); + + MASK_ZERO () (res_ref, mask, 1); + if (check_union128 (res2, res_ref)) + abort (); + + calc_max (res_ref, src1.a, src2.a); + + if (check_union128 (res3, res_ref)) abort(); MASK_MERGE () (res_ref, mask, 1); - if (check_union128 (res2, res_ref)) + if (check_union128 (res4, res_ref)) abort (); MASK_ZERO () (res_ref, mask, 1); - if (check_union128 (res3, res_ref)) + if (check_union128 (res5, res_ref)) abort (); } diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vminsd-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vminsd-1.c index 22ada8776ad..58b213db4e1 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vminsd-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vminsd-1.c @@ -1,5 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-mavx512f -O2" } */ +/* { dg-final { scan-assembler-times "vminsd\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vminsd\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vminsd\[ \\t\]+\[^\{\n\]*\{sae\}\[^\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vminsd\[ \\t\]+\[^\n\]*\{sae\}\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vminsd\[ \\t\]+\[^\n\]*\{sae\}\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ @@ -12,6 +14,8 @@ volatile __mmask8 m; void extern avx512f_test (void) { + x1 = _mm_mask_min_sd (x1, m, x2, x3); + x1 = _mm_maskz_min_sd (m, x1, x2); x1 = _mm_min_round_sd (x1, x2, _MM_FROUND_NO_EXC); x1 = _mm_mask_min_round_sd (x1, m, x2, x3, _MM_FROUND_NO_EXC); x1 = _mm_maskz_min_round_sd (m, x1, x2, _MM_FROUND_NO_EXC); diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vminsd-2.c b/gcc/testsuite/gcc.target/i386/avx512f-vminsd-2.c index 79a051fb9c1..464ce96cd8f 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vminsd-2.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vminsd-2.c @@ -20,7 +20,7 @@ void avx512f_test (void) { int i, sign; - union128d res1, res2, res3, src1, src2; + union128d res1, res2, res3, res4, res5, src1, src2; MASK_TYPE mask = MASK_VALUE; double res_ref[SIZE]; @@ -29,26 +29,38 @@ avx512f_test (void) { src1.a[i] = 1.5 + 34.67 * i * sign; src2.a[i] = -22.17 * i * sign + 1.0; + res1.a[i] = DEFAULT_VALUE; + res4.a[i] = DEFAULT_VALUE; sign = sign * -1; } - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - res1.x = _mm_min_round_sd (src1.x, src2.x, _MM_FROUND_NO_EXC); - res2.x = _mm_mask_min_round_sd (res2.x, mask, src1.x, src2.x, _MM_FROUND_NO_EXC); - res3.x = _mm_maskz_min_round_sd (mask, src1.x, src2.x, _MM_FROUND_NO_EXC); + + res1.x = _mm_mask_min_sd (res1.x, mask, src1.x, src2.x); + res2.x = _mm_maskz_min_sd (mask, src1.x, src2.x); + res3.x = _mm_min_round_sd (src1.x, src2.x, _MM_FROUND_NO_EXC); + res4.x = _mm_mask_min_round_sd (res4.x, mask, src1.x, src2.x, _MM_FROUND_NO_EXC); + res5.x = _mm_maskz_min_round_sd (mask, src1.x, src2.x, _MM_FROUND_NO_EXC); calc_min (res_ref, src1.a, src2.a); + MASK_MERGE (d) (res_ref, mask, 1); if (check_union128d (res1, res_ref)) + abort (); + + MASK_ZERO (d) (res_ref, mask, 1); + if (check_union128d (res2, res_ref)) + abort (); + + calc_min (res_ref, src1.a, src2.a); + + if (check_union128d (res3, res_ref)) abort(); MASK_MERGE (d) (res_ref, mask, 1); - if (check_union128d (res2, res_ref)) + if (check_union128d (res4, res_ref)) abort (); MASK_ZERO (d) (res_ref, mask, 1); - if (check_union128d (res3, res_ref)) + if (check_union128d (res5, res_ref)) abort (); } diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vminss-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vminss-1.c index 5703a88d7da..7d2175e7b0e 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vminss-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vminss-1.c @@ -1,5 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-mavx512f -O2" } */ +/* { dg-final { scan-assembler-times "vminss\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vminss\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vminss\[ \\t\]+\[^\{\n\]*\{sae\}\[^\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vminss\[ \\t\]+\[^\n\]*\{sae\}\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vminss\[ \\t\]+\[^\n\]*\{sae\}\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ @@ -12,6 +14,8 @@ volatile __mmask8 m; void extern avx512f_test (void) { + x1 = _mm_mask_min_ss (x1, m, x2, x3); + x1 = _mm_maskz_min_ss (m, x1, x2); x1 = _mm_min_round_ss (x1, x2, _MM_FROUND_NO_EXC); x1 = _mm_mask_min_round_ss (x1, m, x2, x3, _MM_FROUND_NO_EXC); x1 = _mm_maskz_min_round_ss (m, x1, x2, _MM_FROUND_NO_EXC); diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vminss-2.c b/gcc/testsuite/gcc.target/i386/avx512f-vminss-2.c index ad1fcb937fe..351c273e595 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vminss-2.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vminss-2.c @@ -24,7 +24,7 @@ void avx512f_test (void) { int i, sign; - union128 res1, res2, res3, src1, src2; + union128 res1, res2, res3, res4, res5, src1, src2; MASK_TYPE mask = MASK_VALUE; float res_ref[SIZE]; @@ -33,26 +33,38 @@ avx512f_test (void) { src1.a[i] = 1.5 + 34.67 * i * sign; src2.a[i] = -22.17 * i * sign + 1.0; + res1.a[i] = DEFAULT_VALUE; + res4.a[i] = DEFAULT_VALUE; sign = sign * -1; } - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - res1.x = _mm_min_round_ss (src1.x, src2.x, _MM_FROUND_NO_EXC); - res2.x = _mm_mask_min_round_ss (res2.x, mask, src1.x, src2.x, _MM_FROUND_NO_EXC); - res3.x = _mm_maskz_min_round_ss (mask, src1.x, src2.x, _MM_FROUND_NO_EXC); + res1.x = _mm_mask_min_ss (res1.x, mask, src1.x, src2.x); + res2.x = _mm_maskz_min_ss (mask, src1.x, src2.x); + res3.x = _mm_min_round_ss (src1.x, src2.x, _MM_FROUND_NO_EXC); + res4.x = _mm_mask_min_round_ss (res4.x, mask, src1.x, src2.x, _MM_FROUND_NO_EXC); + res5.x = _mm_maskz_min_round_ss (mask, src1.x, src2.x, _MM_FROUND_NO_EXC); calc_min (res_ref, src1.a, src2.a); - + + MASK_MERGE () (res_ref, mask, 1); if (check_union128 (res1, res_ref)) + abort (); + + MASK_ZERO () (res_ref, mask, 1); + if (check_union128 (res2, res_ref)) + abort (); + + calc_min (res_ref, src1.a, src2.a); + + if (check_union128 (res3, res_ref)) abort(); MASK_MERGE () (res_ref, mask, 1); - if (check_union128 (res2, res_ref)) + if (check_union128 (res4, res_ref)) abort (); MASK_ZERO () (res_ref, mask, 1); - if (check_union128 (res3, res_ref)) + if (check_union128 (res5, res_ref)) abort (); } diff --git a/gcc/testsuite/gcc.target/i386/l_fma_double_1.c b/gcc/testsuite/gcc.target/i386/l_fma_double_1.c index c8ea28a6ab3..94e512b9602 100644 --- a/gcc/testsuite/gcc.target/i386/l_fma_double_1.c +++ b/gcc/testsuite/gcc.target/i386/l_fma_double_1.c @@ -13,7 +13,7 @@ typedef double adouble __attribute__((aligned(sizeof (double)))); /* { dg-final { scan-assembler-times "vfmsub\[123\]+pd" 8 } } */ /* { dg-final { scan-assembler-times "vfnmadd\[123\]+pd" 8 } } */ /* { dg-final { scan-assembler-times "vfnmsub\[123\]+pd" 8 } } */ -/* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 80 } } */ -/* { dg-final { scan-assembler-times "vfmsub\[123\]+sd" 80 } } */ -/* { dg-final { scan-assembler-times "vfnmadd\[123\]+sd" 80 } } */ -/* { dg-final { scan-assembler-times "vfnmsub\[123\]+sd" 80 } } */ +/* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 56 } } */ +/* { dg-final { scan-assembler-times "vfmsub\[123\]+sd" 56 } } */ +/* { dg-final { scan-assembler-times "vfnmadd\[123\]+sd" 56 } } */ +/* { dg-final { scan-assembler-times "vfnmsub\[123\]+sd" 56 } } */ diff --git a/gcc/testsuite/gcc.target/i386/l_fma_double_2.c b/gcc/testsuite/gcc.target/i386/l_fma_double_2.c index bd873bc854c..ffceab48f48 100644 --- a/gcc/testsuite/gcc.target/i386/l_fma_double_2.c +++ b/gcc/testsuite/gcc.target/i386/l_fma_double_2.c @@ -13,7 +13,7 @@ typedef double adouble __attribute__((aligned(sizeof (double)))); /* { dg-final { scan-assembler-times "vfmsub\[123\]+pd" 8 } } */ /* { dg-final { scan-assembler-times "vfnmadd\[123\]+pd" 8 } } */ /* { dg-final { scan-assembler-times "vfnmsub\[123\]+pd" 8 } } */ -/* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 80 } } */ -/* { dg-final { scan-assembler-times "vfmsub\[123\]+sd" 80 } } */ -/* { dg-final { scan-assembler-times "vfnmadd\[123\]+sd" 80 } } */ -/* { dg-final { scan-assembler-times "vfnmsub\[123\]+sd" 80 } } */ +/* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 56 } } */ +/* { dg-final { scan-assembler-times "vfmsub\[123\]+sd" 56 } } */ +/* { dg-final { scan-assembler-times "vfnmadd\[123\]+sd" 56 } } */ +/* { dg-final { scan-assembler-times "vfnmsub\[123\]+sd" 56 } } */ diff --git a/gcc/testsuite/gcc.target/i386/l_fma_double_3.c b/gcc/testsuite/gcc.target/i386/l_fma_double_3.c index 7677ecb2105..cdb4d33bee4 100644 --- a/gcc/testsuite/gcc.target/i386/l_fma_double_3.c +++ b/gcc/testsuite/gcc.target/i386/l_fma_double_3.c @@ -13,7 +13,7 @@ typedef double adouble __attribute__((aligned(sizeof (double)))); /* { dg-final { scan-assembler-times "vfmsub\[123\]+pd" 8 } } */ /* { dg-final { scan-assembler-times "vfnmadd\[123\]+pd" 8 } } */ /* { dg-final { scan-assembler-times "vfnmsub\[123\]+pd" 8 } } */ -/* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 80 } } */ -/* { dg-final { scan-assembler-times "vfmsub\[123\]+sd" 80 } } */ -/* { dg-final { scan-assembler-times "vfnmadd\[123\]+sd" 80 } } */ -/* { dg-final { scan-assembler-times "vfnmsub\[123\]+sd" 80 } } */ +/* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 56 } } */ +/* { dg-final { scan-assembler-times "vfmsub\[123\]+sd" 56 } } */ +/* { dg-final { scan-assembler-times "vfnmadd\[123\]+sd" 56 } } */ +/* { dg-final { scan-assembler-times "vfnmsub\[123\]+sd" 56 } } */ diff --git a/gcc/testsuite/gcc.target/i386/l_fma_double_4.c b/gcc/testsuite/gcc.target/i386/l_fma_double_4.c index e5de796f5c5..dda487e9804 100644 --- a/gcc/testsuite/gcc.target/i386/l_fma_double_4.c +++ b/gcc/testsuite/gcc.target/i386/l_fma_double_4.c @@ -13,7 +13,7 @@ typedef double adouble __attribute__((aligned(sizeof (double)))); /* { dg-final { scan-assembler-times "vfmsub\[123\]+pd" 8 } } */ /* { dg-final { scan-assembler-times "vfnmadd\[123\]+pd" 8 } } */ /* { dg-final { scan-assembler-times "vfnmsub\[123\]+pd" 8 } } */ -/* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 80 } } */ -/* { dg-final { scan-assembler-times "vfmsub\[123\]+sd" 80 } } */ -/* { dg-final { scan-assembler-times "vfnmadd\[123\]+sd" 80 } } */ -/* { dg-final { scan-assembler-times "vfnmsub\[123\]+sd" 80 } } */ +/* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 56 } } */ +/* { dg-final { scan-assembler-times "vfmsub\[123\]+sd" 56 } } */ +/* { dg-final { scan-assembler-times "vfnmadd\[123\]+sd" 56 } } */ +/* { dg-final { scan-assembler-times "vfnmsub\[123\]+sd" 56 } } */ diff --git a/gcc/testsuite/gcc.target/i386/l_fma_double_5.c b/gcc/testsuite/gcc.target/i386/l_fma_double_5.c index dfeb96be01a..98909aeeb84 100644 --- a/gcc/testsuite/gcc.target/i386/l_fma_double_5.c +++ b/gcc/testsuite/gcc.target/i386/l_fma_double_5.c @@ -13,7 +13,7 @@ typedef double adouble __attribute__((aligned(sizeof (double)))); /* { dg-final { scan-assembler-times "vfmsub\[123\]+pd" 8 } } */ /* { dg-final { scan-assembler-times "vfnmadd\[123\]+pd" 8 } } */ /* { dg-final { scan-assembler-times "vfnmsub\[123\]+pd" 8 } } */ -/* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 80 } } */ -/* { dg-final { scan-assembler-times "vfmsub\[123\]+sd" 80 } } */ -/* { dg-final { scan-assembler-times "vfnmadd\[123\]+sd" 80 } } */ -/* { dg-final { scan-assembler-times "vfnmsub\[123\]+sd" 80 } } */ +/* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 56 } } */ +/* { dg-final { scan-assembler-times "vfmsub\[123\]+sd" 56 } } */ +/* { dg-final { scan-assembler-times "vfnmadd\[123\]+sd" 56 } } */ +/* { dg-final { scan-assembler-times "vfnmsub\[123\]+sd" 56 } } */ diff --git a/gcc/testsuite/gcc.target/i386/l_fma_double_6.c b/gcc/testsuite/gcc.target/i386/l_fma_double_6.c index 13cbd7a35e6..538065a3102 100644 --- a/gcc/testsuite/gcc.target/i386/l_fma_double_6.c +++ b/gcc/testsuite/gcc.target/i386/l_fma_double_6.c @@ -13,7 +13,7 @@ typedef double adouble __attribute__((aligned(sizeof (double)))); /* { dg-final { scan-assembler-times "vfmsub\[123\]+pd" 8 } } */ /* { dg-final { scan-assembler-times "vfnmadd\[123\]+pd" 8 } } */ /* { dg-final { scan-assembler-times "vfnmsub\[123\]+pd" 8 } } */ -/* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 80 } } */ -/* { dg-final { scan-assembler-times "vfmsub\[123\]+sd" 80 } } */ -/* { dg-final { scan-assembler-times "vfnmadd\[123\]+sd" 80 } } */ -/* { dg-final { scan-assembler-times "vfnmsub\[123\]+sd" 80 } } */ +/* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 56 } } */ +/* { dg-final { scan-assembler-times "vfmsub\[123\]+sd" 56 } } */ +/* { dg-final { scan-assembler-times "vfnmadd\[123\]+sd" 56 } } */ +/* { dg-final { scan-assembler-times "vfnmsub\[123\]+sd" 56 } } */ diff --git a/gcc/testsuite/gcc.target/i386/l_fma_float_1.c b/gcc/testsuite/gcc.target/i386/l_fma_float_1.c index f20c009b19c..ff109817d5d 100644 --- a/gcc/testsuite/gcc.target/i386/l_fma_float_1.c +++ b/gcc/testsuite/gcc.target/i386/l_fma_float_1.c @@ -12,7 +12,7 @@ /* { dg-final { scan-assembler-times "vfmsub\[123\]+ps" 8 } } */ /* { dg-final { scan-assembler-times "vfnmadd\[123\]+ps" 8 } } */ /* { dg-final { scan-assembler-times "vfnmsub\[123\]+ps" 8 } } */ -/* { dg-final { scan-assembler-times "vfmadd\[123\]+ss" 176 } } */ -/* { dg-final { scan-assembler-times "vfmsub\[123\]+ss" 176 } } */ -/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ss" 176 } } */ -/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ss" 176 } } */ +/* { dg-final { scan-assembler-times "vfmadd\[123\]+ss" 120 } } */ +/* { dg-final { scan-assembler-times "vfmsub\[123\]+ss" 120 } } */ +/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ss" 120 } } */ +/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ss" 120 } } */ diff --git a/gcc/testsuite/gcc.target/i386/l_fma_float_2.c b/gcc/testsuite/gcc.target/i386/l_fma_float_2.c index ce4efe92f79..38c6b528304 100644 --- a/gcc/testsuite/gcc.target/i386/l_fma_float_2.c +++ b/gcc/testsuite/gcc.target/i386/l_fma_float_2.c @@ -12,7 +12,7 @@ /* { dg-final { scan-assembler-times "vfmsub\[123\]+ps" 8 } } */ /* { dg-final { scan-assembler-times "vfnmadd\[123\]+ps" 8 } } */ /* { dg-final { scan-assembler-times "vfnmsub\[123\]+ps" 8 } } */ -/* { dg-final { scan-assembler-times "vfmadd\[123\]+ss" 176 } } */ -/* { dg-final { scan-assembler-times "vfmsub\[123\]+ss" 176 } } */ -/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ss" 176 } } */ -/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ss" 176 } } */ +/* { dg-final { scan-assembler-times "vfmadd\[123\]+ss" 120 } } */ +/* { dg-final { scan-assembler-times "vfmsub\[123\]+ss" 120 } } */ +/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ss" 120 } } */ +/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ss" 120 } } */ diff --git a/gcc/testsuite/gcc.target/i386/l_fma_float_3.c b/gcc/testsuite/gcc.target/i386/l_fma_float_3.c index 91b953ac631..177ba352262 100644 --- a/gcc/testsuite/gcc.target/i386/l_fma_float_3.c +++ b/gcc/testsuite/gcc.target/i386/l_fma_float_3.c @@ -12,7 +12,7 @@ /* { dg-final { scan-assembler-times "vfmsub\[123\]+ps" 8 } } */ /* { dg-final { scan-assembler-times "vfnmadd\[123\]+ps" 8 } } */ /* { dg-final { scan-assembler-times "vfnmsub\[123\]+ps" 8 } } */ -/* { dg-final { scan-assembler-times "vfmadd\[123\]+ss" 176 } } */ -/* { dg-final { scan-assembler-times "vfmsub\[123\]+ss" 176 } } */ -/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ss" 176 } } */ -/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ss" 176 } } */ +/* { dg-final { scan-assembler-times "vfmadd\[123\]+ss" 120 } } */ +/* { dg-final { scan-assembler-times "vfmsub\[123\]+ss" 120 } } */ +/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ss" 120 } } */ +/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ss" 120 } } */ diff --git a/gcc/testsuite/gcc.target/i386/l_fma_float_4.c b/gcc/testsuite/gcc.target/i386/l_fma_float_4.c index 447be12f524..8ee68d1af1c 100644 --- a/gcc/testsuite/gcc.target/i386/l_fma_float_4.c +++ b/gcc/testsuite/gcc.target/i386/l_fma_float_4.c @@ -12,7 +12,7 @@ /* { dg-final { scan-assembler-times "vfmsub\[123\]+ps" 8 } } */ /* { dg-final { scan-assembler-times "vfnmadd\[123\]+ps" 8 } } */ /* { dg-final { scan-assembler-times "vfnmsub\[123\]+ps" 8 } } */ -/* { dg-final { scan-assembler-times "vfmadd\[123\]+ss" 176 } } */ -/* { dg-final { scan-assembler-times "vfmsub\[123\]+ss" 176 } } */ -/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ss" 176 } } */ -/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ss" 176 } } */ +/* { dg-final { scan-assembler-times "vfmadd\[123\]+ss" 120 } } */ +/* { dg-final { scan-assembler-times "vfmsub\[123\]+ss" 120 } } */ +/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ss" 120 } } */ +/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ss" 120 } } */ diff --git a/gcc/testsuite/gcc.target/i386/l_fma_float_5.c b/gcc/testsuite/gcc.target/i386/l_fma_float_5.c index 99a5b969cd4..23288d0da8e 100644 --- a/gcc/testsuite/gcc.target/i386/l_fma_float_5.c +++ b/gcc/testsuite/gcc.target/i386/l_fma_float_5.c @@ -12,7 +12,7 @@ /* { dg-final { scan-assembler-times "vfmsub\[123\]+ps" 8 } } */ /* { dg-final { scan-assembler-times "vfnmadd\[123\]+ps" 8 } } */ /* { dg-final { scan-assembler-times "vfnmsub\[123\]+ps" 8 } } */ -/* { dg-final { scan-assembler-times "vfmadd\[123\]+ss" 176 } } */ -/* { dg-final { scan-assembler-times "vfmsub\[123\]+ss" 176 } } */ -/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ss" 176 } } */ -/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ss" 176 } } */ +/* { dg-final { scan-assembler-times "vfmadd\[123\]+ss" 120 } } */ +/* { dg-final { scan-assembler-times "vfmsub\[123\]+ss" 120 } } */ +/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ss" 120 } } */ +/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ss" 120 } } */ diff --git a/gcc/testsuite/gcc.target/i386/l_fma_float_6.c b/gcc/testsuite/gcc.target/i386/l_fma_float_6.c index 02f4b100111..07a5fbae317 100644 --- a/gcc/testsuite/gcc.target/i386/l_fma_float_6.c +++ b/gcc/testsuite/gcc.target/i386/l_fma_float_6.c @@ -12,7 +12,7 @@ /* { dg-final { scan-assembler-times "vfmsub\[123\]+ps" 8 } } */ /* { dg-final { scan-assembler-times "vfnmadd\[123\]+ps" 8 } } */ /* { dg-final { scan-assembler-times "vfnmsub\[123\]+ps" 8 } } */ -/* { dg-final { scan-assembler-times "vfmadd\[123\]+ss" 176 } } */ -/* { dg-final { scan-assembler-times "vfmsub\[123\]+ss" 176 } } */ -/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ss" 176 } } */ -/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ss" 176 } } */ +/* { dg-final { scan-assembler-times "vfmadd\[123\]+ss" 120 } } */ +/* { dg-final { scan-assembler-times "vfmsub\[123\]+ss" 120 } } */ +/* { dg-final { scan-assembler-times "vfnmadd\[123\]+ss" 120 } } */ +/* { dg-final { scan-assembler-times "vfnmsub\[123\]+ss" 120 } } */ diff --git a/gcc/testsuite/gcc.target/i386/mpx/hard-reg-1-nov.c b/gcc/testsuite/gcc.target/i386/mpx/hard-reg-1-nov.c index 86276791e06..8cf72e55543 100644 --- a/gcc/testsuite/gcc.target/i386/mpx/hard-reg-1-nov.c +++ b/gcc/testsuite/gcc.target/i386/mpx/hard-reg-1-nov.c @@ -13,7 +13,11 @@ int rd (int *p, int i) int mpx_test (int argc, const char **argv) { +#ifdef __x86_64__ register int *frame __asm__("rsp"); +#else + register int *frame __asm__("esp"); +#endif rd (frame, 1); return 0; diff --git a/gcc/testsuite/gcc.target/i386/mpx/hard-reg-2-lbv.c b/gcc/testsuite/gcc.target/i386/mpx/hard-reg-2-lbv.c new file mode 100644 index 00000000000..38fe59f8be9 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/mpx/hard-reg-2-lbv.c @@ -0,0 +1,21 @@ +/* { dg-do run { target sse2_runtime } } */ +/* { dg-shouldfail "bounds violation" } */ +/* { dg-options "-fcheck-pointer-bounds -mmpx -msse2" } */ + + +#define SHOULDFAIL + +#include "mpx-check.h" + +typedef int v16 __attribute__((vector_size(16))); + +int foo(int i) { + register v16 u asm("xmm0"); + return u[i]; +} + +int mpx_test (int argc, const char **argv) +{ + printf ("%d\n", foo (-1)); + return 0; +} diff --git a/gcc/testsuite/gcc.target/i386/mpx/hard-reg-2-nov.c b/gcc/testsuite/gcc.target/i386/mpx/hard-reg-2-nov.c new file mode 100644 index 00000000000..1db83f5b547 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/mpx/hard-reg-2-nov.c @@ -0,0 +1,18 @@ +/* { dg-do run { target sse2_runtime } } */ +/* { dg-options "-fcheck-pointer-bounds -mmpx -msse2" } */ + +#include "mpx-check.h" + +typedef int v16 __attribute__((vector_size(16))); + +int foo (int i) { + register v16 u asm ("xmm0"); + return u[i]; +} + +int mpx_test (int argc, const char **argv) +{ + printf ("%d\n", foo (3)); + printf ("%d\n", foo (0)); + return 0; +} diff --git a/gcc/testsuite/gcc.target/i386/mpx/hard-reg-2-ubv.c b/gcc/testsuite/gcc.target/i386/mpx/hard-reg-2-ubv.c new file mode 100644 index 00000000000..66607805ca4 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/mpx/hard-reg-2-ubv.c @@ -0,0 +1,21 @@ +/* { dg-do run { target sse2_runtime } } */ +/* { dg-shouldfail "bounds violation" } */ +/* { dg-options "-fcheck-pointer-bounds -mmpx -msse2" } */ + + +#define SHOULDFAIL + +#include "mpx-check.h" + +typedef int v16 __attribute__((vector_size(16))); + +int foo (int i) { + register v16 u asm ("xmm0"); + return u[i]; +} + +int mpx_test (int argc, const char **argv) +{ + printf ("%d\n", foo (5)); + return 0; +} diff --git a/gcc/testsuite/gcc.target/i386/mpx/pr79988.c b/gcc/testsuite/gcc.target/i386/mpx/pr79988.c new file mode 100644 index 00000000000..a6e43eba562 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/mpx/pr79988.c @@ -0,0 +1,6 @@ +/* { dg-do compile } */ +/* { dg-options "-fcheck-pointer-bounds -mmpx" } */ + +void foo(unsigned char * __seg_gs *pointer_gs) { + pointer_gs[5] = 0; +} diff --git a/gcc/testsuite/gcc.target/i386/pr59874-1.c b/gcc/testsuite/gcc.target/i386/pr59874-1.c index e6a8a06dd52..862cba43757 100644 --- a/gcc/testsuite/gcc.target/i386/pr59874-1.c +++ b/gcc/testsuite/gcc.target/i386/pr59874-1.c @@ -6,5 +6,5 @@ unsigned int foo (unsigned short x) { - return x ? __builtin_ctz (x) : 16U; + return x ? __builtin_ctzs (x) : 16U; } diff --git a/gcc/testsuite/gcc.target/i386/pr59874-2.c b/gcc/testsuite/gcc.target/i386/pr59874-2.c index 710aa7a482c..3b7679ff9f5 100644 --- a/gcc/testsuite/gcc.target/i386/pr59874-2.c +++ b/gcc/testsuite/gcc.target/i386/pr59874-2.c @@ -6,5 +6,5 @@ unsigned int foo (unsigned short x) { - return x ? __builtin_clz (x) : 16U; + return x ? __builtin_clzs (x) : 16U; } diff --git a/gcc/testsuite/gcc.target/i386/pr67770.c b/gcc/testsuite/gcc.target/i386/pr67770.c index 3826aff45b7..9368524c145 100644 --- a/gcc/testsuite/gcc.target/i386/pr67770.c +++ b/gcc/testsuite/gcc.target/i386/pr67770.c @@ -3,18 +3,15 @@ /* { dg-require-effective-target trampolines } */ /* { dg-options "-O2" } */ -#ifndef NO_TRAMPOLINES __attribute__ ((noinline)) void foo (int i, void (* __attribute__ ((regparm (3))) bar) (int)) { bar (i); } -#endif int main () { -#ifndef NO_TRAMPOLINES int p = 0; __attribute__ ((regparm (3), noinline)) void @@ -35,6 +32,6 @@ main () if (p != 2) __builtin_abort (); -#endif + return 0; } diff --git a/gcc/testsuite/gcc.target/i386/pr73350.c b/gcc/testsuite/gcc.target/i386/pr73350.c new file mode 100644 index 00000000000..62f6cd42386 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr73350.c @@ -0,0 +1,19 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -mavx512f" } */ +/* { dg-require-effective-target avx512f } */ +#include <math.h> +#define AVX512F +#include "avx512f-helper.h" + +void +TEST (void) +{ + __m512 a = _mm512_set1_ps ((float) M_PI); + __m512 b = _mm512_set1_ps ((float) 1.f); + + __m512 result1 = _mm512_add_round_ps (a, b, (_MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC)); + __m512 result2 = _mm512_add_round_ps (a, b, (_MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC)); + + if (result1[0] == result2[0]) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/pr80833-1.c b/gcc/testsuite/gcc.target/i386/pr80833-1.c new file mode 100644 index 00000000000..3f702fb0a54 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr80833-1.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -msse4.1 -mtune=intel -mregparm=2" } */ +/* { dg-require-effective-target ia32 } */ + +long long test (long long a) +{ + asm ("" : "+x" (a)); + return a; +} + +/* { dg-final { scan-assembler "pinsrd" } } */ +/* { dg-final { scan-assembler "pextrd" } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr80833-2.c b/gcc/testsuite/gcc.target/i386/pr80833-2.c new file mode 100644 index 00000000000..8136a60f519 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr80833-2.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -msse4.1 -mtune=intel" } */ +/* { dg-require-effective-target int128 } */ + +__int128 test (__int128 a) +{ + asm ("" : "+x" (a)); + return a; +} + +/* { dg-final { scan-assembler "pinsrq" } } */ +/* { dg-final { scan-assembler "pextrq" } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr80880.c b/gcc/testsuite/gcc.target/i386/pr80880.c new file mode 100644 index 00000000000..674a587dd26 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr80880.c @@ -0,0 +1,10 @@ +/* PR target/65523 */ +/* { dg-do compile { target { ! x32 } } } */ +/* { dg-options "-O -fcheck-pointer-bounds -mmpx" } */ + +int *fn1() +{ + int *r = fn1(); + if (r == (void *)0) + return r; +} diff --git a/gcc/testsuite/gcc.target/i386/pr81015.c b/gcc/testsuite/gcc.target/i386/pr81015.c new file mode 100644 index 00000000000..92e53f1989f --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr81015.c @@ -0,0 +1,21 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -mlzcnt" } */ +/* { dg-require-effective-target lzcnt } */ + +#include "lzcnt-check.h" + +int +__attribute__ ((noinline, noclone)) +foo (unsigned short a) +{ + return __builtin_clz (a); +} + +static void +lzcnt_test () +{ + int res = foo (1); + + if (res != 31) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-init-v4hi-1.c b/gcc/testsuite/gcc.target/i386/sse-init-v4hi-1.c index f2513154788..1a9b11f4dd5 100644 --- a/gcc/testsuite/gcc.target/i386/sse-init-v4hi-1.c +++ b/gcc/testsuite/gcc.target/i386/sse-init-v4hi-1.c @@ -17,13 +17,13 @@ check (__m64 x, unsigned short *v, int j) union { __m64 x; - unsigned short i[8]; + unsigned short i[4]; } u; unsigned int i; u.x = x; - for (i = 0; i < sizeof (v) / sizeof (v[0]); i++) + for (i = 0; i < sizeof (u) / sizeof (v[0]); i++) if (i == j) { if (v[i] != u.i[i]) diff --git a/gcc/testsuite/gcc.target/i386/sse-init-v4sf-1.c b/gcc/testsuite/gcc.target/i386/sse-init-v4sf-1.c index eea03ecadea..2e9d53e6d75 100644 --- a/gcc/testsuite/gcc.target/i386/sse-init-v4sf-1.c +++ b/gcc/testsuite/gcc.target/i386/sse-init-v4sf-1.c @@ -23,7 +23,7 @@ check (__m128 x, float *v, int j) u.x = x; - for (i = 0; i < sizeof (v) / sizeof (v[0]); i++) + for (i = 0; i < sizeof (u) / sizeof (v[0]); i++) if (i == j) { if (v[i] != u.f[i]) diff --git a/gcc/testsuite/gcc.target/i386/sse-set-ps-1.c b/gcc/testsuite/gcc.target/i386/sse-set-ps-1.c index 5a0c9b95d66..a14351555f7 100644 --- a/gcc/testsuite/gcc.target/i386/sse-set-ps-1.c +++ b/gcc/testsuite/gcc.target/i386/sse-set-ps-1.c @@ -23,7 +23,7 @@ test (float *v) u.x = _mm_set_ps (v[3], v[2], v[1], v[0]); - for (i = 0; i < sizeof (v) / sizeof (v[0]); i++) + for (i = 0; i < sizeof (u) / sizeof (v[0]); i++) if (v[i] != u.f[i]) { #ifdef DEBUG diff --git a/gcc/testsuite/gcc.target/i386/sse2-init-v16qi-1.c b/gcc/testsuite/gcc.target/i386/sse2-init-v16qi-1.c index 6528800462d..6dcb4fffa21 100644 --- a/gcc/testsuite/gcc.target/i386/sse2-init-v16qi-1.c +++ b/gcc/testsuite/gcc.target/i386/sse2-init-v16qi-1.c @@ -23,7 +23,7 @@ check (__m128i x, unsigned char *v, int j) u.x = x; - for (i = 0; i < sizeof (v) / sizeof (v[0]); i++) + for (i = 0; i < sizeof (u) / sizeof (v[0]); i++) if (i == j) { if (v[i] != u.i[i]) diff --git a/gcc/testsuite/gcc.target/i386/sse2-init-v2di-1.c b/gcc/testsuite/gcc.target/i386/sse2-init-v2di-1.c index ef1863c57dc..07c625b2e7f 100644 --- a/gcc/testsuite/gcc.target/i386/sse2-init-v2di-1.c +++ b/gcc/testsuite/gcc.target/i386/sse2-init-v2di-1.c @@ -23,7 +23,7 @@ check (__m128i x, unsigned long long *v, int j) u.x = x; - for (i = 0; i < sizeof (v) / sizeof (v[0]); i++) + for (i = 0; i < sizeof (u) / sizeof (v[0]); i++) if (i == j) { if (v[i] != u.i[i]) diff --git a/gcc/testsuite/gcc.target/i386/sse2-init-v4si-1.c b/gcc/testsuite/gcc.target/i386/sse2-init-v4si-1.c index bcb94055c41..359744a842a 100644 --- a/gcc/testsuite/gcc.target/i386/sse2-init-v4si-1.c +++ b/gcc/testsuite/gcc.target/i386/sse2-init-v4si-1.c @@ -23,7 +23,7 @@ check (__m128i x, unsigned int *v, int j) u.x = x; - for (i = 0; i < sizeof (v) / sizeof (v[0]); i++) + for (i = 0; i < sizeof (u) / sizeof (v[0]); i++) if (i == j) { if (v[i] != u.i[i]) diff --git a/gcc/testsuite/gcc.target/i386/sse2-init-v8hi-1.c b/gcc/testsuite/gcc.target/i386/sse2-init-v8hi-1.c index 62734820d95..cc6ff6840e6 100644 --- a/gcc/testsuite/gcc.target/i386/sse2-init-v8hi-1.c +++ b/gcc/testsuite/gcc.target/i386/sse2-init-v8hi-1.c @@ -23,7 +23,7 @@ check (__m128i x, unsigned short *v, int j) u.x = x; - for (i = 0; i < sizeof (v) / sizeof (v[0]); i++) + for (i = 0; i < sizeof (u) / sizeof (v[0]); i++) if (i == j) { if (v[i] != u.i[i]) diff --git a/gcc/testsuite/gcc.target/i386/sse2-set-epi32-1.c b/gcc/testsuite/gcc.target/i386/sse2-set-epi32-1.c index c1f5d0f7434..e7bbe2dfbed 100644 --- a/gcc/testsuite/gcc.target/i386/sse2-set-epi32-1.c +++ b/gcc/testsuite/gcc.target/i386/sse2-set-epi32-1.c @@ -23,7 +23,7 @@ test (unsigned int *v) u.x = _mm_set_epi32 (v[3], v[2], v[1], v[0]); - for (i = 0; i < sizeof (v) / sizeof (v[0]); i++) + for (i = 0; i < sizeof (u) / sizeof (v[0]); i++) if (v[i] != u.i[i]) { #ifdef DEBUG diff --git a/gcc/testsuite/gcc.target/i386/sse2-set-epi64x-1.c b/gcc/testsuite/gcc.target/i386/sse2-set-epi64x-1.c index ac32015a72c..0d88f9862bf 100644 --- a/gcc/testsuite/gcc.target/i386/sse2-set-epi64x-1.c +++ b/gcc/testsuite/gcc.target/i386/sse2-set-epi64x-1.c @@ -23,7 +23,7 @@ test (unsigned long long *v) u.x = _mm_set_epi64x (v[1], v[0]); - for (i = 0; i < sizeof (v) / sizeof (v[0]); i++) + for (i = 0; i < sizeof (u) / sizeof (v[0]); i++) if (v[i] != u.i[i]) { #ifdef DEBUG diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-init-v16qi-1.c b/gcc/testsuite/gcc.target/i386/sse4_1-init-v16qi-1.c index 6a3ccee583e..43c1d6232d6 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-init-v16qi-1.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-init-v16qi-1.c @@ -23,7 +23,7 @@ check (__m128i x, unsigned char *v, int j) u.x = x; - for (i = 0; i < sizeof (v) / sizeof (v[0]); i++) + for (i = 0; i < sizeof (u) / sizeof (v[0]); i++) if (i == j) { if (v[i] != u.i[i]) diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-init-v2di-1.c b/gcc/testsuite/gcc.target/i386/sse4_1-init-v2di-1.c index cd9fa797853..25d9a66167b 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-init-v2di-1.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-init-v2di-1.c @@ -23,7 +23,7 @@ check (__m128i x, unsigned long long *v, int j) u.x = x; - for (i = 0; i < sizeof (v) / sizeof (v[0]); i++) + for (i = 0; i < sizeof (u) / sizeof (v[0]); i++) if (i == j) { if (v[i] != u.i[i]) diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-init-v4sf-1.c b/gcc/testsuite/gcc.target/i386/sse4_1-init-v4sf-1.c index f9760423517..1be2e62da14 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-init-v4sf-1.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-init-v4sf-1.c @@ -23,7 +23,7 @@ check (__m128 x, float *v, int j) u.x = x; - for (i = 0; i < sizeof (v) / sizeof (v[0]); i++) + for (i = 0; i < sizeof (u) / sizeof (v[0]); i++) if (i == j) { if (v[i] != u.f[i]) diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-init-v4si-1.c b/gcc/testsuite/gcc.target/i386/sse4_1-init-v4si-1.c index 63501b7eebe..ae7142b3ad6 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-init-v4si-1.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-init-v4si-1.c @@ -23,7 +23,7 @@ check (__m128i x, unsigned int *v, int j) u.x = x; - for (i = 0; i < sizeof (v) / sizeof (v[0]); i++) + for (i = 0; i < sizeof (u) / sizeof (v[0]); i++) if (i == j) { if (v[i] != u.i[i]) diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-set-epi32-1.c b/gcc/testsuite/gcc.target/i386/sse4_1-set-epi32-1.c index 989e4f7086f..75d7aec85eb 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-set-epi32-1.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-set-epi32-1.c @@ -23,7 +23,7 @@ test (unsigned int *v) u.x = _mm_set_epi32 (v[3], v[2], v[1], v[0]); - for (i = 0; i < sizeof (v) / sizeof (v[0]); i++) + for (i = 0; i < sizeof (u) / sizeof (v[0]); i++) if (v[i] != u.i[i]) { #ifdef DEBUG diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-set-epi64x-1.c b/gcc/testsuite/gcc.target/i386/sse4_1-set-epi64x-1.c index 8679f52860f..068d0a79c70 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-set-epi64x-1.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-set-epi64x-1.c @@ -23,7 +23,7 @@ test (unsigned long long *v) u.x = _mm_set_epi64x (v[1], v[0]); - for (i = 0; i < sizeof (v) / sizeof (v[0]); i++) + for (i = 0; i < sizeof (u) / sizeof (v[0]); i++) if (v[i] != u.i[i]) { #ifdef DEBUG diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-set-ps-1.c b/gcc/testsuite/gcc.target/i386/sse4_1-set-ps-1.c index fe77d94ad7d..aab1e51a02c 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-set-ps-1.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-set-ps-1.c @@ -23,7 +23,7 @@ test (float *v) u.x = _mm_set_ps (v[3], v[2], v[1], v[0]); - for (i = 0; i < sizeof (v) / sizeof (v[0]); i++) + for (i = 0; i < sizeof (u) / sizeof (v[0]); i++) if (v[i] != u.f[i]) { #ifdef DEBUG diff --git a/gcc/testsuite/gcc.target/i386/umod-3.c b/gcc/testsuite/gcc.target/i386/umod-3.c index 7123bc9f256..e1fb988263a 100644 --- a/gcc/testsuite/gcc.target/i386/umod-3.c +++ b/gcc/testsuite/gcc.target/i386/umod-3.c @@ -1,7 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -mtune=atom" } */ -extern void abort (void); extern void exit (int); unsigned char cx = 7; @@ -11,8 +10,8 @@ main () { unsigned char cy; - cy = cx / 6; if (cy != 1) abort (); - cy = cx % 6; if (cy != 1) abort (); + cy = cx / 6; if (cy != 1) exit (1); + cy = cx % 6; if (cy != 1) exit (1); exit(0); } diff --git a/gcc/testsuite/gcc.target/mips/div-10.c b/gcc/testsuite/gcc.target/mips/div-10.c deleted file mode 100644 index fb8953def4d..00000000000 --- a/gcc/testsuite/gcc.target/mips/div-10.c +++ /dev/null @@ -1,12 +0,0 @@ -/* { dg-options "-mgp64 (-mips16)" } */ -/* { dg-final { scan-assembler "\tdivu\t" } } */ -/* { dg-final { scan-assembler "\tmflo\t" } } */ -/* { dg-final { scan-assembler-not "\tmfhi\t" } } */ - -typedef unsigned int SI __attribute__((mode(SI))); - -MIPS16 SI -f (SI x, SI y) -{ - return x / y; -} diff --git a/gcc/testsuite/gcc.target/mips/div-11.c b/gcc/testsuite/gcc.target/mips/div-11.c deleted file mode 100644 index ff129292a34..00000000000 --- a/gcc/testsuite/gcc.target/mips/div-11.c +++ /dev/null @@ -1,12 +0,0 @@ -/* { dg-options "-mgp64 (-mips16)" } */ -/* { dg-final { scan-assembler "\tdiv\t" } } */ -/* { dg-final { scan-assembler-not "\tmflo\t" } } */ -/* { dg-final { scan-assembler "\tmfhi\t" } } */ - -typedef int SI __attribute__((mode(SI))); - -MIPS16 SI -f (SI x, SI y) -{ - return x % y; -} diff --git a/gcc/testsuite/gcc.target/mips/div-12.c b/gcc/testsuite/gcc.target/mips/div-12.c deleted file mode 100644 index 57866ceb021..00000000000 --- a/gcc/testsuite/gcc.target/mips/div-12.c +++ /dev/null @@ -1,12 +0,0 @@ -/* { dg-options "-mgp64 (-mips16)" } */ -/* { dg-final { scan-assembler "\tdivu\t" } } */ -/* { dg-final { scan-assembler-not "\tmflo\t" } } */ -/* { dg-final { scan-assembler "\tmfhi\t" } } */ - -typedef unsigned int SI __attribute__((mode(SI))); - -MIPS16 SI -f (SI x, SI y) -{ - return x % y; -} diff --git a/gcc/testsuite/gcc.target/mips/div-9.c b/gcc/testsuite/gcc.target/mips/div-9.c deleted file mode 100644 index 294cc7f24ac..00000000000 --- a/gcc/testsuite/gcc.target/mips/div-9.c +++ /dev/null @@ -1,12 +0,0 @@ -/* { dg-options "-mgp64 (-mips16)" } */ -/* { dg-final { scan-assembler "\tdiv\t" } } */ -/* { dg-final { scan-assembler "\tmflo\t" } } */ -/* { dg-final { scan-assembler-not "\tmfhi\t" } } */ - -typedef int SI __attribute__((mode(SI))); - -MIPS16 SI -f (SI x, SI y) -{ - return x / y; -} diff --git a/gcc/testsuite/gcc.target/msp430/interrupt_fn_placement.c b/gcc/testsuite/gcc.target/msp430/interrupt_fn_placement.c new file mode 100644 index 00000000000..c88bfc3d0c3 --- /dev/null +++ b/gcc/testsuite/gcc.target/msp430/interrupt_fn_placement.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-mlarge -mcode-region=either -ffunction-sections" } */ +/* { dg-final { scan-assembler-not "\\.either\\.lowtext" } } */ + +void __attribute__ ((interrupt (2))) ir_1 (void) +{ + while (1); +} + +int main (void) +{ + while (1); +} diff --git a/gcc/testsuite/gcc.target/nvptx/label-values.c b/gcc/testsuite/gcc.target/nvptx/label-values.c new file mode 100644 index 00000000000..350510e961e --- /dev/null +++ b/gcc/testsuite/gcc.target/nvptx/label-values.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-Wno-pedantic" } */ + +int +main (void) +{ + goto L2; + L1: + return 0; + L2: + { + void *ptr = &&L1; /* { dg-message "sorry, unimplemented: target cannot support label values" "" } */ + } +} diff --git a/gcc/testsuite/gcc.target/powerpc/bmi2-pdep32-1.c b/gcc/testsuite/gcc.target/powerpc/bmi2-pdep32-1.c index 0738092dd37..12cf92eec2c 100644 --- a/gcc/testsuite/gcc.target/powerpc/bmi2-pdep32-1.c +++ b/gcc/testsuite/gcc.target/powerpc/bmi2-pdep32-1.c @@ -1,7 +1,8 @@ /* { dg-do run } */ -/* { dg-options "-O3" } */ +/* { dg-options "-O3 -mcpu=power7" } */ /* { dg-require-effective-target lp64 } */ -/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-require-effective-target vsx_hw } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power7" } } */ #define NO_WARN_X86_INTRINSICS 1 #include <x86intrin.h> diff --git a/gcc/testsuite/gcc.target/powerpc/bmi2-pdep64-1.c b/gcc/testsuite/gcc.target/powerpc/bmi2-pdep64-1.c index 29dcfc517b5..01e1fdaf538 100644 --- a/gcc/testsuite/gcc.target/powerpc/bmi2-pdep64-1.c +++ b/gcc/testsuite/gcc.target/powerpc/bmi2-pdep64-1.c @@ -1,7 +1,8 @@ /* { dg-do run } */ -/* { dg-options "-O3" } */ +/* { dg-options "-O3 -mcpu=power7" } */ /* { dg-require-effective-target lp64 } */ -/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-require-effective-target vsx_hw } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power7" } } */ #define NO_WARN_X86_INTRINSICS 1 #include <x86intrin.h> diff --git a/gcc/testsuite/gcc.target/powerpc/bmi2-pext32-1.c b/gcc/testsuite/gcc.target/powerpc/bmi2-pext32-1.c index 9a8ad28c60d..9450ef56aed 100644 --- a/gcc/testsuite/gcc.target/powerpc/bmi2-pext32-1.c +++ b/gcc/testsuite/gcc.target/powerpc/bmi2-pext32-1.c @@ -1,7 +1,8 @@ /* { dg-do run } */ -/* { dg-options "-O3" } */ +/* { dg-options "-O3 -mcpu=power7" } */ /* { dg-require-effective-target lp64 } */ -/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-require-effective-target vsx_hw } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power7" } } */ #define NO_WARN_X86_INTRINSICS 1 #include <x86intrin.h> diff --git a/gcc/testsuite/gcc.target/powerpc/bmi2-pext64-1.c b/gcc/testsuite/gcc.target/powerpc/bmi2-pext64-1.c index 5da1213bf25..b76ae81b5bc 100644 --- a/gcc/testsuite/gcc.target/powerpc/bmi2-pext64-1.c +++ b/gcc/testsuite/gcc.target/powerpc/bmi2-pext64-1.c @@ -1,7 +1,8 @@ /* { dg-do run } */ -/* { dg-options "-O3" } */ +/* { dg-options "-O3 -mcpu=power7" } */ /* { dg-require-effective-target lp64 } */ -/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-require-effective-target vsx_hw } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power7" } } */ #define NO_WARN_X86_INTRINSICS 1 #include <x86intrin.h> diff --git a/gcc/testsuite/gcc.target/powerpc/bmi2-pext64-1a.c b/gcc/testsuite/gcc.target/powerpc/bmi2-pext64-1a.c index 047352fdadf..02de1f944a0 100644 --- a/gcc/testsuite/gcc.target/powerpc/bmi2-pext64-1a.c +++ b/gcc/testsuite/gcc.target/powerpc/bmi2-pext64-1a.c @@ -1,7 +1,9 @@ /* { dg-do compile } */ -/* { dg-options "-O3" } */ +/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */ +/* { dg-options "-O3 -mcpu=power7" } */ /* { dg-require-effective-target lp64 } */ /* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power7" } } */ #define NO_WARN_X86_INTRINSICS 1 #include <x86intrin.h> diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-3-runnable.c b/gcc/testsuite/gcc.target/powerpc/builtins-3-runnable.c new file mode 100644 index 00000000000..60ec617ab1a --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/builtins-3-runnable.c @@ -0,0 +1,84 @@ +/* { dg-do run { target { powerpc*-*-linux* } } } */ +/* { dg-require-effective-target vsx_hw } */ +/* { dg-options "-O2 -mvsx -mcpu=power8" } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ + +#include <altivec.h> // vector + +void abort (void); + +void test_result_dp(vector double vec_result, vector double vec_expected) +{ + if (vec_result[0] != vec_expected[0]) + abort(); + + if (vec_result[1] != vec_expected[1]) + abort(); +} + +int main() +{ + int i; + vector unsigned int vec_unint; + vector signed int vec_int; + vector float vec_flt, vec_flt_result, vec_flt_expected; + vector double vec_dble0, vec_dble1, vec_dble_result, vec_dble_expected; + + vec_int = (vector signed int){ -1, 3, -5, 1234567 }; + vec_unint = (vector unsigned int){ 9, 11, 15, 2468013579 }; + vec_flt = (vector float){ -21., 3.5, -53., 78. }; + vec_dble0 = (vector double){ 34.0, 97.0 }; + vec_dble1 = (vector double){ 214.0, -5.5 }; + + /* conversion of words 0 and 2 */ + vec_dble_expected = (vector double){-1.000000, -5.000000}; + vec_dble_result = vec_doublee (vec_int); + test_result_dp(vec_dble_result, vec_dble_expected); + + vec_dble_expected = (vector double){9.000000, 15.000000}; + vec_dble_result = vec_doublee (vec_unint); + test_result_dp(vec_dble_result, vec_dble_expected); + + vec_dble_expected = (vector double){-21.000000, -53.000000}; + vec_dble_result = vec_doublee (vec_flt); + test_result_dp(vec_dble_result, vec_dble_expected); + + + /* conversion of words 1 and 3 */ + vec_dble_expected = (vector double){3.000000, 1234567.000000}; + vec_dble_result = vec_doubleo (vec_int); + test_result_dp(vec_dble_result, vec_dble_expected); + + vec_dble_expected = (vector double){11.000000, 2468013579.000000}; + vec_dble_result = vec_doubleo (vec_unint); + test_result_dp(vec_dble_result, vec_dble_expected); + + vec_dble_expected = (vector double){3.500000, 78.000000}; + vec_dble_result = vec_doubleo (vec_flt); + test_result_dp(vec_dble_result, vec_dble_expected); + + + /* conversion of words 0 and 1 */ + vec_dble_expected = (vector double){-5.000000, 1234567.000000}; + vec_dble_result = vec_doublel (vec_int); + test_result_dp(vec_dble_result, vec_dble_expected); + + vec_dble_expected = (vector double){15.000000, 2468013579.000000}; + vec_dble_result = vec_doublel (vec_unint); + test_result_dp(vec_dble_result, vec_dble_expected); + + vec_dble_expected = (vector double){-53.000000, 78.000000}; + vec_dble_result = vec_doublel (vec_flt); + test_result_dp(vec_dble_result, vec_dble_expected); + + + /* conversion of words 2 and 3 */ + vec_dble_expected = (vector double){-1.000000, 3.000000}; + vec_dble_result = vec_doubleh (vec_int); + test_result_dp(vec_dble_result, vec_dble_expected); + + vec_dble_expected = (vector double){9.000000, 11.000000}; + vec_dble_result = vec_doubleh (vec_unint); + test_result_dp(vec_dble_result, vec_dble_expected); + +} diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-3.c b/gcc/testsuite/gcc.target/powerpc/builtins-3.c index 5cbac814f91..b25248891d1 100644 --- a/gcc/testsuite/gcc.target/powerpc/builtins-3.c +++ b/gcc/testsuite/gcc.target/powerpc/builtins-3.c @@ -112,26 +112,26 @@ test_vull_slo_vull_vuc (vector unsigned long long x, vector unsigned char y) return vec_slo (x, y); } -vector signed int -test_vsi_mule_vsi_vsi (vector signed int x, vector signed int y) +vector signed long long +test_vsll_mule_vsi_vsi (vector signed int x, vector signed int y) { return vec_mule (x, y); } -vector unsigned int -test_vui_mule_vui_vui (vector unsigned int x, vector unsigned int y) +vector unsigned long long +test_vull_mule_vui_vui (vector unsigned int x, vector unsigned int y) { return vec_mule (x, y); } -vector signed int -test_vsi_mulo_vsi_vsi (vector signed int x, vector signed int y) +vector signed long long +test_vsll_mulo_vsi_vsi (vector signed int x, vector signed int y) { return vec_mulo (x, y); } -vector unsigned int -test_vui_mulo_vui_vui (vector unsigned int x, vector unsigned int y) +vector unsigned long long +test_vull_mulo_vui_vui (vector unsigned int x, vector unsigned int y) { return vec_mulo (x, y); } @@ -207,10 +207,10 @@ test_vul_sldw_vul_vul (vector unsigned long long x, test_vsll_slo_vsll_vuc 1 vslo test_vull_slo_vsll_vsc 1 vslo test_vull_slo_vsll_vuc 1 vslo - test_vsi_mulo_vsi_vsi 1 vmulosh - test_vui_mulo_vui_vui 1 vmulosh - test_vsi_mule_vsi_vsi 1 vmulesh - test_vui_mule_vui_vui 1 vmulesh + test_vsll_mulo_vsi_vsi 1 vmulosh + test_vull_mulo_vui_vui 1 vmulouh + test_vsll_mule_vsi_vsi 1 vmulesh + test_vull_mule_vui_vui 1 vmuleuh test_vsc_mulo_vsc_vsc 1 xxsldwi test_vuc_mulo_vuc_vuc 1 xxsldwi test_vssi_mulo_vssi_vssi 1 xxsldwi @@ -236,6 +236,8 @@ test_vul_sldw_vul_vul (vector unsigned long long x, /* { dg-final { scan-assembler-times "xvnegsp" 1 } } */ /* { dg-final { scan-assembler-times "xvnegdp" 1 } } */ /* { dg-final { scan-assembler-times "vslo" 4 } } */ -/* { dg-final { scan-assembler-times "vmulosh" 2 } } */ -/* { dg-final { scan-assembler-times "vmulesh" 2 } } */ +/* { dg-final { scan-assembler-times "vmulosh" 1 } } */ +/* { dg-final { scan-assembler-times "vmulouh" 1 } } */ +/* { dg-final { scan-assembler-times "vmulesh" 1 } } */ +/* { dg-final { scan-assembler-times "vmuleuh" 1 } } */ /* { dg-final { scan-assembler-times "xxsldwi" 8 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/clone1.c b/gcc/testsuite/gcc.target/powerpc/clone1.c new file mode 100644 index 00000000000..5c69db8e217 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/clone1.c @@ -0,0 +1,26 @@ +/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ +/* { dg-options "-mcpu=power8 -O2" } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ + +/* Power9 (aka, ISA 3.0) has a MODSD instruction to do modulus, while Power8 + (aka, ISA 2.07) has to do modulus with divide and multiply. Make sure + both clone functions are generated. + + Restrict ourselves to Linux, since IFUNC might not be supported in other + operating systems. */ + +__attribute__((target_clones("cpu=power9,default"))) +long mod_func (long a, long b) +{ + return a % b; +} + +long mod_func_or (long a, long b, long c) +{ + return mod_func (a, b) | c; +} + +/* { dg-final { scan-assembler-times {\mdivd\M} 1 } } */ +/* { dg-final { scan-assembler-times {\mmulld\M} 1 } } */ +/* { dg-final { scan-assembler-times {\mmodsd\M} 1 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-abs-char-fwrapv.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-abs-char-fwrapv.c new file mode 100644 index 00000000000..739f06e0fe5 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-abs-char-fwrapv.c @@ -0,0 +1,18 @@ +/* Verify that overloaded built-ins for vec_abs with char + inputs produce the right results. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_altivec_ok } */ +/* { dg-options "-maltivec -O2 -fwrapv" } */ + +#include <altivec.h> + +vector signed char +test2 (vector signed char x) +{ + return vec_abs (x); +} + +/* { dg-final { scan-assembler-times "vspltisw|vxor" 1 } } */ +/* { dg-final { scan-assembler-times "vsububm" 1 } } */ +/* { dg-final { scan-assembler-times "vmaxsb" 1 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-abs-char.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-abs-char.c new file mode 100644 index 00000000000..239c9193464 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-abs-char.c @@ -0,0 +1,18 @@ +/* Verify that overloaded built-ins for vec_abs with char + inputs produce the right results. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_altivec_ok } */ +/* { dg-options "-maltivec -O2" } */ + +#include <altivec.h> + +vector signed char +test2 (vector signed char x) +{ + return vec_abs (x); +} + +/* { dg-final { scan-assembler-times "vspltisw|vxor" 1 } } */ +/* { dg-final { scan-assembler-times "vsububm" 1 } } */ +/* { dg-final { scan-assembler-times "vmaxsb" 1 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-abs-floatdouble.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-abs-floatdouble.c new file mode 100644 index 00000000000..1a08618b367 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-abs-floatdouble.c @@ -0,0 +1,23 @@ +/* Verify that overloaded built-ins for vec_abs with float and + double inputs for VSX produce the right results. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include <altivec.h> + +vector float +test1 (vector float x) +{ + return vec_abs (x); +} + +vector double +test2 (vector double x) +{ + return vec_abs (x); +} + +/* { dg-final { scan-assembler-times "xvabssp" 1 } } */ +/* { dg-final { scan-assembler-times "xvabsdp" 1 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-abs-int-fwrapv.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-abs-int-fwrapv.c new file mode 100644 index 00000000000..34dead4e916 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-abs-int-fwrapv.c @@ -0,0 +1,18 @@ +/* Verify that overloaded built-ins for vec_abs with int + inputs produce the right results. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_altivec_ok } */ +/* { dg-options "-maltivec -O2 -fwrapv" } */ + +#include <altivec.h> + +vector signed int +test1 (vector signed int x) +{ + return vec_abs (x); +} + +/* { dg-final { scan-assembler-times "vspltisw|vxor" 1 } } */ +/* { dg-final { scan-assembler-times "vsubuwm" 1 } } */ +/* { dg-final { scan-assembler-times "vmaxsw" 1 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-abs-int.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-abs-int.c new file mode 100644 index 00000000000..77d9ca5c26b --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-abs-int.c @@ -0,0 +1,18 @@ +/* Verify that overloaded built-ins for vec_abs with int + inputs produce the right results. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_altivec_ok } */ +/* { dg-options "-maltivec -O2" } */ + +#include <altivec.h> + +vector signed int +test1 (vector signed int x) +{ + return vec_abs (x); +} + +/* { dg-final { scan-assembler-times "vspltisw|vxor" 1 } } */ +/* { dg-final { scan-assembler-times "vsubuwm" 1 } } */ +/* { dg-final { scan-assembler-times "vmaxsw" 1 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-abs-longlong-fwrapv.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-abs-longlong-fwrapv.c new file mode 100644 index 00000000000..934618b91b2 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-abs-longlong-fwrapv.c @@ -0,0 +1,18 @@ +/* Verify that overloaded built-ins for vec_abs with long long + inputs produce the right results. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_p8vector_ok } */ +/* { dg-options "-mpower8-vector -O2 -fwrapv" } */ + +#include <altivec.h> + +vector signed long long +test3 (vector signed long long x) +{ + return vec_abs (x); +} + +/* { dg-final { scan-assembler-times "vspltisw|vxor" 1 } } */ +/* { dg-final { scan-assembler-times "vsubudm" 1 } } */ +/* { dg-final { scan-assembler-times "vmaxsd" 1 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-abs-longlong.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-abs-longlong.c new file mode 100644 index 00000000000..5b59d19346d --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-abs-longlong.c @@ -0,0 +1,18 @@ +/* Verify that overloaded built-ins for vec_abs with long long + inputs produce the right results. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_p8vector_ok } */ +/* { dg-options "-mpower8-vector -O2" } */ + +#include <altivec.h> + +vector signed long long +test3 (vector signed long long x) +{ + return vec_abs (x); +} + +/* { dg-final { scan-assembler-times "vspltisw|vxor" 1 } } */ +/* { dg-final { scan-assembler-times "vsubudm" 1 } } */ +/* { dg-final { scan-assembler-times "vmaxsd" 1 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-abs-short-fwrapv.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-abs-short-fwrapv.c new file mode 100644 index 00000000000..2562179af72 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-abs-short-fwrapv.c @@ -0,0 +1,18 @@ +/* Verify that overloaded built-ins for vec_abs with short + inputs produce the right results. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_altivec_ok } */ +/* { dg-options "-maltivec -O2 -fwrapv" } */ + +#include <altivec.h> + +vector signed short +test3 (vector signed short x) +{ + return vec_abs (x); +} + +/* { dg-final { scan-assembler-times "vspltisw|vxor" 1 } } */ +/* { dg-final { scan-assembler-times "vsubuhm" 1 } } */ +/* { dg-final { scan-assembler-times "vmaxsh" 1 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-abs-short.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-abs-short.c new file mode 100644 index 00000000000..d3120002b33 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-abs-short.c @@ -0,0 +1,18 @@ +/* Verify that overloaded built-ins for vec_abs with short + inputs produce the right results. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_altivec_ok } */ +/* { dg-options "-maltivec -O2" } */ + +#include <altivec.h> + +vector signed short +test3 (vector signed short x) +{ + return vec_abs (x); +} + +/* { dg-final { scan-assembler-times "vspltisw|vxor" 1 } } */ +/* { dg-final { scan-assembler-times "vsubuhm" 1 } } */ +/* { dg-final { scan-assembler-times "vmaxsh" 1 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-logical-eqv-char.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-logical-eqv-char.c new file mode 100644 index 00000000000..6810848dee1 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-logical-eqv-char.c @@ -0,0 +1,28 @@ +/* Verify that overloaded built-ins for vec_eqv with char + inputs produce the right results. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_p8vector_ok } */ +/* { dg-options "-mpower8-vector -O2" } */ + +#include <altivec.h> + +vector bool char +test1 (vector bool char x, vector bool char y) +{ + return vec_eqv (x, y); +} + +vector signed char +test3 (vector signed char x, vector signed char y) +{ + return vec_eqv (x, y); +} + +vector unsigned char +test6 (vector unsigned char x, vector unsigned char y) +{ + return vec_eqv (x, y); +} + +/* { dg-final { scan-assembler-times "xxleqv" 3 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-logical-eqv-float.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-logical-eqv-float.c new file mode 100644 index 00000000000..d206cfe7d66 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-logical-eqv-float.c @@ -0,0 +1,16 @@ +/* Verify that overloaded built-ins for vec_eqv with float + inputs produce the right results. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_p8vector_ok } */ +/* { dg-options "-mpower8-vector -O2" } */ + +#include <altivec.h> + +vector float +test1 (vector float x, vector float y) +{ + return vec_eqv (x, y); +} + +/* { dg-final { scan-assembler-times "xxleqv" 1 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-logical-eqv-floatdouble.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-logical-eqv-floatdouble.c new file mode 100644 index 00000000000..56b7cac503d --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-logical-eqv-floatdouble.c @@ -0,0 +1,22 @@ +/* Verify that overloaded built-ins for vec_eqv with float and + double inputs for VSX produce the right results. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_p8vector_ok } */ +/* { dg-options "-mpower8-vector -O2" } */ + +#include <altivec.h> + +vector float +test1 (vector float x, vector float y) +{ + return vec_eqv (x, y); +} + +vector double +test2 (vector double x, vector double y) +{ + return vec_eqv (x, y); +} + +/* { dg-final { scan-assembler-times "xxleqv" 2 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-logical-eqv-int.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-logical-eqv-int.c new file mode 100644 index 00000000000..f5d292e8550 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-logical-eqv-int.c @@ -0,0 +1,28 @@ +/* Verify that overloaded built-ins for vec_eqv with int + inputs produce the right results. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_p8vector_ok } */ +/* { dg-options "-mpower8-vector -O2" } */ + +#include <altivec.h> + +vector bool int +test1 (vector bool int x, vector bool int y) +{ + return vec_eqv (x, y); +} + +vector signed int +test3 (vector signed int x, vector signed int y) +{ + return vec_eqv (x, y); +} + +vector unsigned int +test6 (vector unsigned int x, vector unsigned int y) +{ + return vec_eqv (x, y); +} + +/* { dg-final { scan-assembler-times "xxleqv" 3 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-logical-eqv-longlong.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-logical-eqv-longlong.c new file mode 100644 index 00000000000..342b2bd8ec7 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-logical-eqv-longlong.c @@ -0,0 +1,28 @@ +/* Verify that overloaded built-ins for vec_eqv with long long + inputs produce the right results. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_p8vector_ok } */ +/* { dg-options "-mpower8-vector -O2" } */ + +#include <altivec.h> + +vector bool long long +test1 (vector bool long long x, vector bool long long y) +{ + return vec_eqv (x, y); +} + +vector signed long long +test3 (vector signed long long x, vector signed long long y) +{ + return vec_eqv (x, y); +} + +vector unsigned long long +test6 (vector unsigned long long x, vector unsigned long long y) +{ + return vec_eqv (x, y); +} + +/* { dg-final { scan-assembler-times "xxleqv" 3 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-logical-eqv-short.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-logical-eqv-short.c new file mode 100644 index 00000000000..79ca8aa9029 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-logical-eqv-short.c @@ -0,0 +1,28 @@ +/* Verify that overloaded built-ins for vec_eqv with short + inputs produce the right results. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_p8vector_ok } */ +/* { dg-options "-mpower8-vector -O2" } */ + +#include <altivec.h> + +vector bool short +test1 (vector bool short x, vector bool short y) +{ + return vec_eqv (x, y); +} + +vector signed short +test3 (vector signed short x, vector signed short y) +{ + return vec_eqv (x, y); +} + +vector unsigned short +test6 (vector unsigned short x, vector unsigned short y) +{ + return vec_eqv (x, y); +} + +/* { dg-final { scan-assembler-times "xxleqv" 3 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-logical-ors-longlong.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-logical-ors-longlong.c index 7ca23fb2454..10c69d3d87b 100644 --- a/gcc/testsuite/gcc.target/powerpc/fold-vec-logical-ors-longlong.c +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-logical-ors-longlong.c @@ -2,8 +2,8 @@ * long long inputs produce the right results. */ /* { dg-do compile } */ -/* { dg-require-effective-target powerpc_vsx_ok } */ -/* { dg-options "-mvsx -O2" } */ +/* { dg-require-effective-target powerpc_p8vector_ok } */ +/* { dg-options "-mpower8-vector -O2" } */ #include <altivec.h> @@ -151,11 +151,11 @@ test6_nor (vector unsigned long long x, vector unsigned long long y) return *foo; } -// Codegen on power7 is such that the vec_or() tests generate more xxlor -// instructions than what is seen on power8 or newer. -// Thus, an additional target clause for the xxlor instruction check. -/* { dg-final { scan-assembler-times {\mxxlor\M} 6 { target p8vector_hw } } } */ -/* { dg-final { scan-assembler-times {\mxxlor\M} 24 { target { ! p8vector_hw } } } } */ +// The number of xxlor instructions generated varies between 6 and 24 for +// older systems (power6,power7), as well as for 32-bit versus 64-bit targets. +// For simplicity, this test now only targets "powerpc_p8vector_ok" environments +// where the answer is expected to be 6. +/* { dg-final { scan-assembler-times {\mxxlor\M} 6 } } */ /* { dg-final { scan-assembler-times {\mxxlxor\M} 6 } } */ /* { dg-final { scan-assembler-times {\mxxlnor\M} 6 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-minmax-char.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-minmax-char.c new file mode 100644 index 00000000000..9df6ecdcd75 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-minmax-char.c @@ -0,0 +1,37 @@ +/* Verify that overloaded built-ins for vec_min with char + inputs produce the right results. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_altivec_ok } */ +/* { dg-options "-maltivec" } */ + +#include <altivec.h> + +vector signed char +test3_min (vector signed char x, vector signed char y) +{ + return vec_min (x, y); +} + +vector unsigned char +test6_min (vector unsigned char x, vector unsigned char y) +{ + return vec_min (x, y); +} + +vector signed char +test3_max (vector signed char x, vector signed char y) +{ + return vec_max (x, y); +} + +vector unsigned char +test6_max (vector unsigned char x, vector unsigned char y) +{ + return vec_max (x, y); +} + +/* { dg-final { scan-assembler-times "vminsb" 1 } } */ +/* { dg-final { scan-assembler-times "vmaxsb" 1 } } */ +/* { dg-final { scan-assembler-times "vminub" 1 } } */ +/* { dg-final { scan-assembler-times "vmaxub" 1 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-minmax-floatdouble.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-minmax-floatdouble.c new file mode 100644 index 00000000000..1185ce28f45 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-minmax-floatdouble.c @@ -0,0 +1,37 @@ +/* Verify that overloaded built-ins for vec_max with float and + double inputs for VSX produce the right results. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include <altivec.h> + +vector float +test1_min (vector float x, vector float y) +{ + return vec_min (x, y); +} + +vector double +test2_min (vector double x, vector double y) +{ + return vec_min (x, y); +} + +vector float +test1_max (vector float x, vector float y) +{ + return vec_max (x, y); +} + +vector double +test2_max (vector double x, vector double y) +{ + return vec_max (x, y); +} + +/* { dg-final { scan-assembler-times "vminsp" 1 } } */ +/* { dg-final { scan-assembler-times "vmindp" 1 } } */ +/* { dg-final { scan-assembler-times "vmaxsp" 1 } } */ +/* { dg-final { scan-assembler-times "vmaxdp" 1 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-minmax-int.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-minmax-int.c new file mode 100644 index 00000000000..1ce1c2bab1c --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-minmax-int.c @@ -0,0 +1,37 @@ +/* Verify that overloaded built-ins for vec_min with int + inputs produce the right results. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_altivec_ok } */ +/* { dg-options "-maltivec -O2" } */ + +#include <altivec.h> + +vector signed int +test3_min (vector signed int x, vector signed int y) +{ + return vec_min (x, y); +} + +vector unsigned int +test6_min (vector unsigned int x, vector unsigned int y) +{ + return vec_min (x, y); +} + +vector signed int +test3_max (vector signed int x, vector signed int y) +{ + return vec_max (x, y); +} + +vector unsigned int +test6_max (vector unsigned int x, vector unsigned int y) +{ + return vec_max (x, y); +} + +/* { dg-final { scan-assembler-times "vminsw" 1 } } */ +/* { dg-final { scan-assembler-times "vmaxsw" 1 } } */ +/* { dg-final { scan-assembler-times "vminuw" 1 } } */ +/* { dg-final { scan-assembler-times "vmaxuw" 1 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-minmax-longlong.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-minmax-longlong.c new file mode 100644 index 00000000000..ed9c66db34b --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-minmax-longlong.c @@ -0,0 +1,37 @@ +/* Verify that overloaded built-ins for vec_min with long long + inputs produce the right results. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_p8vector_ok } */ +/* { dg-options "-mpower8-vector" } */ + +#include <altivec.h> + +vector signed long long +test3_min (vector signed long long x, vector signed long long y) +{ + return vec_min (x, y); +} + +vector unsigned long long +test6_min (vector unsigned long long x, vector unsigned long long y) +{ + return vec_min (x, y); +} + +vector signed long long +test3_max (vector signed long long x, vector signed long long y) +{ + return vec_max (x, y); +} + +vector unsigned long long +test6_max (vector unsigned long long x, vector unsigned long long y) +{ + return vec_max (x, y); +} + +/* { dg-final { scan-assembler-times "vminsd" 1 } } */ +/* { dg-final { scan-assembler-times "vmaxsd" 1 } } */ +/* { dg-final { scan-assembler-times "vminud" 1 } } */ +/* { dg-final { scan-assembler-times "vmaxud" 1 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-minmax-short.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-minmax-short.c new file mode 100644 index 00000000000..fa608c9e9bc --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-minmax-short.c @@ -0,0 +1,37 @@ +/* Verify that overloaded built-ins for vec_min with short + inputs produce the right results. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_altivec_ok } */ +/* { dg-options "-maltivec" } */ + +#include <altivec.h> + +vector signed short +test3_min (vector signed short x, vector signed short y) +{ + return vec_min (x, y); +} + +vector unsigned short +test6_min (vector unsigned short x, vector unsigned short y) +{ + return vec_min (x, y); +} + +vector signed short +test3_max (vector signed short x, vector signed short y) +{ + return vec_max (x, y); +} + +vector unsigned short +test6_max (vector unsigned short x, vector unsigned short y) +{ + return vec_max (x, y); +} + +/* { dg-final { scan-assembler-times "vminsh" 1 } } */ +/* { dg-final { scan-assembler-times "vmaxsh" 1 } } */ +/* { dg-final { scan-assembler-times "vminuh" 1 } } */ +/* { dg-final { scan-assembler-times "vmaxuh" 1 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/shift-dot.c b/gcc/testsuite/gcc.target/powerpc/shift-dot.c index 002948c0815..726b7a9ebad 100644 --- a/gcc/testsuite/gcc.target/powerpc/shift-dot.c +++ b/gcc/testsuite/gcc.target/powerpc/shift-dot.c @@ -1,7 +1,7 @@ /* Check that record-form instructions are used. */ /* { dg-do compile } */ -/* { dg-options "-O2 -mgen-cell-microcode" } */ +/* { dg-options "-O2" } */ /* { dg-final { scan-assembler-times {\mrotl[wd]\.} 2 } } */ /* { dg-final { scan-assembler-times {\msl[wd]\.} 2 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/stack-limit.c b/gcc/testsuite/gcc.target/powerpc/stack-limit.c new file mode 100644 index 00000000000..e676c96eb8e --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/stack-limit.c @@ -0,0 +1,10 @@ +/* { dg-options "-O0 -fstack-limit-register=r14" } */ + +// PR80966 + +int foo (int i) +{ + char arr[135000]; + + arr[i] = 0; +} diff --git a/gcc/testsuite/gcc.target/s390/vector/vec-nopeel-2.c b/gcc/testsuite/gcc.target/s390/vector/vec-nopeel-2.c new file mode 100644 index 00000000000..9b67793e6f4 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/vector/vec-nopeel-2.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target s390_vx } */ +/* { dg-options "-O2 -mzarch -march=z13 -ftree-vectorize -fdump-tree-vect-details -fvect-cost-model=dynamic" } */ + +void foo(int *restrict a, int *restrict b, unsigned int n) +{ + for (unsigned int i = 0; i < n; i++) + b[i] = a[i] * 2 + 1; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" } } */ diff --git a/gcc/testsuite/gcc.target/sparc/sparc-ret-3.c b/gcc/testsuite/gcc.target/sparc/sparc-ret-3.c new file mode 100644 index 00000000000..7a151f80b42 --- /dev/null +++ b/gcc/testsuite/gcc.target/sparc/sparc-ret-3.c @@ -0,0 +1,53 @@ +/* PR target/80968 */ +/* { dg-do compile } */ +/* { dg-skip-if "no register windows" { *-*-* } { "-mflat" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ +/* { dg-options "-mcpu=ultrasparc -O" } */ + +/* Make sure references to the stack frame do not slip into the delay slot + of a return instruction. */ + +struct crypto_shash { + unsigned int descsize; +}; +struct crypto_shash *tfm; + +struct shash_desc { + struct crypto_shash *tfm; + unsigned int flags; + + void *__ctx[] __attribute__((aligned(8))); +}; + +static inline unsigned int crypto_shash_descsize(struct crypto_shash *tfm) +{ + return tfm->descsize; +} + +static inline void *shash_desc_ctx(struct shash_desc *desc) +{ + return desc->__ctx; +} + +#define SHASH_DESC_ON_STACK(shash, ctx) \ + char __##shash##_desc[sizeof(struct shash_desc) + \ + crypto_shash_descsize(ctx)] __attribute__((aligned(8))); \ + struct shash_desc *shash = (struct shash_desc *)__##shash##_desc + +extern int crypto_shash_update(struct shash_desc *, const void *, unsigned int); + +unsigned int bug(unsigned int crc, const void *address, unsigned int length) +{ + SHASH_DESC_ON_STACK(shash, tfm); + unsigned int *ctx = (unsigned int *)shash_desc_ctx(shash); + int err; + + shash->tfm = tfm; + shash->flags = 0; + *ctx = crc; + + err = crypto_shash_update(shash, address, length); + + return *ctx; +} +/* { dg-final { scan-assembler "ld\[ \t\]*\\\[%i5\\+8\\\], %i0\n\[^\n\]*return\[ \t\]*%i7\\+8" } } */ diff --git a/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/ms-sysv.exp b/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/ms-sysv.exp index e317af9bd85..26777e0b59f 100644 --- a/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/ms-sysv.exp +++ b/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/ms-sysv.exp @@ -23,17 +23,47 @@ # see the files COPYING3 and COPYING.RUNTIME respectively. If not, see # <http://www.gnu.org/licenses/>. +load_lib gcc-dg.exp + +proc host_supports_c++11 {} { + global HOSTCXX HOSTCXXFLAGS + + set pidstr [pid] + set src "host_supports_c++11_$pidstr.C" + set asm "host_supports_c++11_$pidstr.s" + + set f [open $src "w"] + puts $f "" + close $f + + set cxx "$HOSTCXX $HOSTCXXFLAGS" + + # Temporarily switch to the environment for the host compiler. + restore_ld_library_path_env_vars + set status [remote_exec host "$cxx -S $src -std=c++11 -o $asm"] + # And switch back. + set_ld_library_path_env_vars + + file delete $src $asm + + set status [lindex $status 0] + if { $status != 0 } { + return 0 + } + + return 1 +} + # Exit immediately if this isn't a native x86_64 target. if { (![istarget x86_64-*-*] && ![istarget i?86-*-*]) - || ![is-effective-target lp64] || ![isnative] } then { + || ![is-effective-target lp64] || ![isnative] + || ![host_supports_c++11] } then { unsupported "$subdir" return } global GCC_RUNTEST_PARALLELIZE_DIR -load_lib gcc-dg.exp - proc runtest_ms_sysv { cflags generator_args } { global GCC_UNDER_TEST HOSTCXX HOSTCXXFLAGS tmpdir srcdir subdir \ parallel_dir next_test diff --git a/gcc/testsuite/gfortran.dg/allocate_class_4.f90 b/gcc/testsuite/gfortran.dg/allocate_class_4.f90 index 23c9d53d171..125d99f4d86 100644 --- a/gcc/testsuite/gfortran.dg/allocate_class_4.f90 +++ b/gcc/testsuite/gfortran.dg/allocate_class_4.f90 @@ -31,6 +31,3 @@ module integrable_model_module end subroutine end module integrable_model_module - -! { dg-final { cleanup-modules "integrable_model_module" } } - diff --git a/gcc/testsuite/gfortran.dg/altreturn_8.f90 b/gcc/testsuite/gfortran.dg/altreturn_8.f90 index ccd58a2b083..63a6ef72420 100644 --- a/gcc/testsuite/gfortran.dg/altreturn_8.f90 +++ b/gcc/testsuite/gfortran.dg/altreturn_8.f90 @@ -1,23 +1,21 @@ -! { dg-do compile }
-! { dg-options "-std=gnu" }
-!
-! PR 56284: [OOP] ICE with alternate return in type-bound procedure
-!
-! Contributed by Arjen Markus <arjen.markus@deltares.nl>
-
-module try_this
- implicit none
-
- type :: table_t
- contains
- procedure, nopass :: getRecord
- end type
-
-contains
-
- subroutine getRecord ( * )
- end subroutine
-
-end module
-
-! { dg-final { cleanup-modules "try_this" } }
+! { dg-do compile } +! { dg-options "-std=gnu" } +! +! PR 56284: [OOP] ICE with alternate return in type-bound procedure +! +! Contributed by Arjen Markus <arjen.markus@deltares.nl> + +module try_this + implicit none + + type :: table_t + contains + procedure, nopass :: getRecord + end type + +contains + + subroutine getRecord ( * ) + end subroutine + +end module diff --git a/gcc/testsuite/gfortran.dg/associate_12.f90 b/gcc/testsuite/gfortran.dg/associate_12.f90 index 1ead1e7112e..8d2abb8adb1 100644 --- a/gcc/testsuite/gfortran.dg/associate_12.f90 +++ b/gcc/testsuite/gfortran.dg/associate_12.f90 @@ -25,5 +25,3 @@ program assoc_err print *, 1. + b end associate end program - -! { dg-final { cleanup-modules "assoc_err_m" } } diff --git a/gcc/testsuite/gfortran.dg/c_f_pointer_shape_test.f90 b/gcc/testsuite/gfortran.dg/c_f_pointer_shape_test.f90 index 9b130ad6e59..86377123af6 100644 --- a/gcc/testsuite/gfortran.dg/c_f_pointer_shape_test.f90 +++ b/gcc/testsuite/gfortran.dg/c_f_pointer_shape_test.f90 @@ -16,5 +16,3 @@ contains call c_f_pointer(cPtr, myArrayPtr) ! { dg-error "Expected SHAPE argument to C_F_POINTER with array FPTR" } end subroutine test_0 end module c_f_pointer_shape_test - -! { dg-final { cleanup-modules "c_f_pointer_shape_test" } } diff --git a/gcc/testsuite/gfortran.dg/charlen_15.f90 b/gcc/testsuite/gfortran.dg/charlen_15.f90 index e141f1eb3ac..ed8ff00bec1 100644 --- a/gcc/testsuite/gfortran.dg/charlen_15.f90 +++ b/gcc/testsuite/gfortran.dg/charlen_15.f90 @@ -10,5 +10,3 @@ program foo use m if (trim(x%c(1)) /= 'ab') call abort end program foo -! { dg-final { cleanup-modules "m" } } - diff --git a/gcc/testsuite/gfortran.dg/class_4a.f03 b/gcc/testsuite/gfortran.dg/class_4a.f03 index 015e53cbb1b..a6406a898a8 100644 --- a/gcc/testsuite/gfortran.dg/class_4a.f03 +++ b/gcc/testsuite/gfortran.dg/class_4a.f03 @@ -13,4 +13,3 @@ module m type t end type t end module m -! { dg-final { cleanup-modules "m m2" } } diff --git a/gcc/testsuite/gfortran.dg/class_54.f90 b/gcc/testsuite/gfortran.dg/class_54.f90 index 39c306c83d0..fdcdebc54c4 100644 --- a/gcc/testsuite/gfortran.dg/class_54.f90 +++ b/gcc/testsuite/gfortran.dg/class_54.f90 @@ -18,5 +18,3 @@ subroutine sub2 use m class(t), pointer :: a2 end subroutine - -! { dg-final { cleanup-modules "m" } } diff --git a/gcc/testsuite/gfortran.dg/class_dummy_4.f03 b/gcc/testsuite/gfortran.dg/class_dummy_4.f03 index 24841305bf5..6c2abad546a 100644 --- a/gcc/testsuite/gfortran.dg/class_dummy_4.f03 +++ b/gcc/testsuite/gfortran.dg/class_dummy_4.f03 @@ -40,5 +40,3 @@ contains type(c_stv), allocatable, intent(out) :: y end subroutine end - -! { dg-final { cleanup-modules "m1 m2" } } diff --git a/gcc/testsuite/gfortran.dg/class_dummy_5.f90 b/gcc/testsuite/gfortran.dg/class_dummy_5.f90 index 8da19af1ee6..78fc4f8c622 100644 --- a/gcc/testsuite/gfortran.dg/class_dummy_5.f90 +++ b/gcc/testsuite/gfortran.dg/class_dummy_5.f90 @@ -26,5 +26,3 @@ contains class(t), intent(out) :: x end subroutine end - -! { dg-final { cleanup-modules "m" } } diff --git a/gcc/testsuite/gfortran.dg/constructor_9.f90 b/gcc/testsuite/gfortran.dg/constructor_9.f90 index 5196703031a..a8e882138fd 100644 --- a/gcc/testsuite/gfortran.dg/constructor_9.f90 +++ b/gcc/testsuite/gfortran.dg/constructor_9.f90 @@ -18,5 +18,3 @@ contains cfd=cfmde() ! { dg-error "Can't convert" } end subroutine end module - -! { dg-final { cleanup-modules "cf" } } diff --git a/gcc/testsuite/gfortran.dg/dec_structure_15.f90 b/gcc/testsuite/gfortran.dg/dec_structure_15.f90 index fd06ff9f10d..33f51266c0f 100644 --- a/gcc/testsuite/gfortran.dg/dec_structure_15.f90 +++ b/gcc/testsuite/gfortran.dg/dec_structure_15.f90 @@ -24,4 +24,3 @@ contains a2 = 0.0 end function end module -! { dg-final { cleanup-modules "dec_structure_15" } } diff --git a/gcc/testsuite/gfortran.dg/do_check_8.f90 b/gcc/testsuite/gfortran.dg/do_check_8.f90 index 458ae40b604..5b9acc3d68f 100644 --- a/gcc/testsuite/gfortran.dg/do_check_8.f90 +++ b/gcc/testsuite/gfortran.dg/do_check_8.f90 @@ -56,4 +56,3 @@ program main call sub(undeclared) end do end program main -! { dg-final { cleanup-modules "foo" } } diff --git a/gcc/testsuite/gfortran.dg/dtio_26.f03 b/gcc/testsuite/gfortran.dg/dtio_26.f03 index e947545fb49..ad05da0523e 100644 --- a/gcc/testsuite/gfortran.dg/dtio_26.f03 +++ b/gcc/testsuite/gfortran.dg/dtio_26.f03 @@ -65,5 +65,3 @@ program p read( unit=s, fmt=*, iostat=istat, iomsg=imsg) foo if (imsg.ne."End of record") call abort end program p - -! { dg-final { cleanup-modules "t_m" } } diff --git a/gcc/testsuite/gfortran.dg/dynamic_dispatch_12.f90 b/gcc/testsuite/gfortran.dg/dynamic_dispatch_12.f90 index d37e1f6a9b5..53cc957c4d2 100644 --- a/gcc/testsuite/gfortran.dg/dynamic_dispatch_12.f90 +++ b/gcc/testsuite/gfortran.dg/dynamic_dispatch_12.f90 @@ -70,5 +70,3 @@ contains end subroutine end - -! { dg-final { cleanup-modules "TestResult_mod BaseTestRunner_mod TestRunner_mod" } } diff --git a/gcc/testsuite/gfortran.dg/equiv_9.f90 b/gcc/testsuite/gfortran.dg/equiv_9.f90 index 28f0bb8bbf1..5a226282161 100644 --- a/gcc/testsuite/gfortran.dg/equiv_9.f90 +++ b/gcc/testsuite/gfortran.dg/equiv_9.f90 @@ -19,4 +19,3 @@ subroutine another() implicit none if (x2 /= 2) call abort end subroutine -! { dg-final { cleanup-modules "constant" } } diff --git a/gcc/testsuite/gfortran.dg/extends_15.f90 b/gcc/testsuite/gfortran.dg/extends_15.f90 index 06c31799a00..03f1ff15a18 100644 --- a/gcc/testsuite/gfortran.dg/extends_15.f90 +++ b/gcc/testsuite/gfortran.dg/extends_15.f90 @@ -12,5 +12,3 @@ module ct type :: t1 end type end - -! { dg-final { cleanup-modules "ct" } } diff --git a/gcc/testsuite/gfortran.dg/finalize_22.f90 b/gcc/testsuite/gfortran.dg/finalize_22.f90 index 57fa6e78de3..cad44815796 100644 --- a/gcc/testsuite/gfortran.dg/finalize_22.f90 +++ b/gcc/testsuite/gfortran.dg/finalize_22.f90 @@ -16,5 +16,3 @@ contains class(cfml), intent(inout) :: s end subroutine mld end module cf - -! { dg-final { cleanup-modules "cf" } } diff --git a/gcc/testsuite/gfortran.dg/finalize_23.f90 b/gcc/testsuite/gfortran.dg/finalize_23.f90 index ea3972981da..9dab53e1f13 100644 --- a/gcc/testsuite/gfortran.dg/finalize_23.f90 +++ b/gcc/testsuite/gfortran.dg/finalize_23.f90 @@ -27,5 +27,3 @@ contains end function end module - -! { dg-final { cleanup-modules "ObjectLists" } } diff --git a/gcc/testsuite/gfortran.dg/generic_26.f90 b/gcc/testsuite/gfortran.dg/generic_26.f90 index 22a593b4227..81a0604fbcc 100644 --- a/gcc/testsuite/gfortran.dg/generic_26.f90 +++ b/gcc/testsuite/gfortran.dg/generic_26.f90 @@ -25,5 +25,3 @@ contains end function end - -! { dg-final { cleanup-modules "a" } } diff --git a/gcc/testsuite/gfortran.dg/generic_27.f90 b/gcc/testsuite/gfortran.dg/generic_27.f90 index f4f4f5ab9c3..6f603ae4c91 100644 --- a/gcc/testsuite/gfortran.dg/generic_27.f90 +++ b/gcc/testsuite/gfortran.dg/generic_27.f90 @@ -30,5 +30,3 @@ program test if (testIF(cos)/=1.0) call abort() end program - -! { dg-final { cleanup-modules "m" } } diff --git a/gcc/testsuite/gfortran.dg/gomp/pr80918.f90 b/gcc/testsuite/gfortran.dg/gomp/pr80918.f90 new file mode 100644 index 00000000000..6c5b4d84e8c --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/pr80918.f90 @@ -0,0 +1,10 @@ +! PR fortran/80918 +! { dg-do compile } + +subroutine foo (a) + integer :: a(*) + !$omp task depend(inout:a) + !$omp end task + !$omp task depend(inout:a) + !$omp end task +end subroutine foo diff --git a/gcc/testsuite/gfortran.dg/ieee/ieee_8.f90 b/gcc/testsuite/gfortran.dg/ieee/ieee_8.f90 index 7d0cdfd0e03..a47f9c16b91 100644 --- a/gcc/testsuite/gfortran.dg/ieee/ieee_8.f90 +++ b/gcc/testsuite/gfortran.dg/ieee/ieee_8.f90 @@ -111,5 +111,3 @@ subroutine gee(n, rounding, flag) if (len(s8) /= x8) call abort end subroutine - -! { dg-final { cleanup-modules "foo bar" } } diff --git a/gcc/testsuite/gfortran.dg/implied_do_io_1.f90 b/gcc/testsuite/gfortran.dg/implied_do_io_1.f90 new file mode 100644 index 00000000000..e4a6d6b37b3 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/implied_do_io_1.f90 @@ -0,0 +1,59 @@ +! { dg-do run } +! { dg-options "-O -fdump-tree-original" } +! PR/35339 +! This test ensures optimization of implied do loops in io statements + +program main + implicit none + integer:: i, j, square + integer, parameter:: k = 2, linenum = 14 + integer, dimension(2):: a = [(i, i=1,2)] + integer, dimension(2,2):: b = reshape([1, 2, 3, 4], shape(b)) + character (len=30), dimension(linenum) :: res + character (len=30) :: line + type tp + integer, dimension(2):: i + end type + type(tp), dimension(2):: t = [tp([1, 2]), tp([1, 2])] + data res / & + ' a 2 2', & + ' b 1 2', & + ' c 1 2', & + ' d 1 2', & + ' e 1 2 1 2', & + ' f 1 2 1 1 2 2', & + ' g 1 2 3 4', & + ' h 1 3 2 4', & + ' i 2', & + ' j 2', & + ' k 1 2 1 2', & + ' l 1', & + ' m 1 1', & + ' n 1 2'/ + + open(10,file="test.dat") + + write (10,1000) 'a', (a(k), i=1,2) + write (10,1000) 'b', (b(i, 1), i=1,2) + write (10,1000) 'c', b(1:2:1, 1) + write (10,1000) 'd', (a(i), i=1,2) + write (10,1000) 'e', ((a(i), i=1,2), j=1,2) + write (10,1000) 'f', (a, b(i, 1), i = 1,2) + write (10,1000) 'g', ((b(i, j), i=1,2),j=1,2) + write (10,1000) 'h', ((b(j, i), i=1,2),j=1,2) + write (10,1000) 'i', (a(i+1), i=1,1) + write (10,1000) 'j', (a(i*2), i=1,1) + write (10,1000) 'k', (a(i), i=1,2), (a(i), i=1,2) + write (10,1000) 'l', (a(i), i=1,1) + write (10,1000) 'm', (1, i=1,2) + write (10,1000) 'n', (t(i)%i(i), i=1,2) + rewind (10) + do i=1,linenum + read (10,'(A)') line + if (line .ne. res(i)) call abort + end do + close(10,status="delete") +1000 format (A2,100I4) +end program main + +! { dg-final { scan-tree-dump-times "while" 7 "original" } } diff --git a/gcc/testsuite/gfortran.dg/implied_do_io_2.f90 b/gcc/testsuite/gfortran.dg/implied_do_io_2.f90 new file mode 100644 index 00000000000..52edde54329 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/implied_do_io_2.f90 @@ -0,0 +1,23 @@ +! { dg-do run } +! Test that allocatable characters with deferred length +! are written correctly +program main + implicit none + integer:: i + integer, parameter:: N = 10 + character(len=:), dimension(:),allocatable:: ca + character(len=50):: buffer, line + allocate(character(len=N):: ca(3)) + buffer = "foo bar xyzzy" + ca(1) = "foo" + ca(2) = "bar" + ca(3) = "xyzzy" + write (unit=line, fmt='(3A5)') (ca(i),i=1,3) + if (line /= buffer) call abort + ca(1) = "" + ca(2) = "" + ca(3) = "" + read (unit=line, fmt='(3A5)') (ca(i),i=1,3) + if (line /= buffer) call abort +end program + diff --git a/gcc/testsuite/gfortran.dg/implied_do_io_3.f90 b/gcc/testsuite/gfortran.dg/implied_do_io_3.f90 new file mode 100644 index 00000000000..6ac89ac8d2c --- /dev/null +++ b/gcc/testsuite/gfortran.dg/implied_do_io_3.f90 @@ -0,0 +1,27 @@ +! { dg-do run } +! { dg-options "-ffrontend-optimize" } +! PR 80988 - implied do loops with diagonal elements +! were not written correctly +program main + implicit none + integer :: i,j,k + integer, dimension(3,3) :: a + integer, dimension(3,3,3) :: b + character(len=40) :: line + a = reshape([(((i*10+j),i=1,3),j=1,3)], shape(a)) + i = 2147483548 + write (unit=line,fmt='(10I3)') (a(i,i),i=1,3) + if (line /= ' 11 22 33') call abort + write (unit=line,fmt='(10I3)') (a(i+1,i+1),i=1,2) + if (line /= ' 22 33') call abort + do k=1,3 + do j=1,3 + do i=1,3 + b(i,j,k) = i*100 + j*10 + k + end do + end do + end do + i = -2147483548 + write (unit=line,fmt='(10I4)') ((b(i,j,i),i=1,3),j=1,3) + if (line /= ' 111 212 313 121 222 323 131 232 333') call abort +end program main diff --git a/gcc/testsuite/gfortran.dg/inline_matmul_18.f90 b/gcc/testsuite/gfortran.dg/inline_matmul_18.f90 new file mode 100644 index 00000000000..c846733c8c2 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/inline_matmul_18.f90 @@ -0,0 +1,16 @@ +! { dg-do run } +! { dg-options "-O -finline-matmul-limit=100 -fdump-tree-optimized" } +! PR 80975 - this did not zero the result array in the library version; +! make sure this also doesn't happen in the inline version. +program bogus_matmul + implicit none + real :: M(3,0), v(0), w(3) + + w = 7 + w = matmul(M,v) + if( any(w .ne. 0) ) then + call abort + end if +end program bogus_matmul +! { dg-final { scan-tree-dump-times "matmul_r4" 0 "optimized" } } + diff --git a/gcc/testsuite/gfortran.dg/matmul_16.f90 b/gcc/testsuite/gfortran.dg/matmul_16.f90 new file mode 100644 index 00000000000..9def1336344 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/matmul_16.f90 @@ -0,0 +1,13 @@ +! { dg-do run } +! { dg-options "-finline-matmul-limit=0" } +! PR 80975 - this did not zero the result array +program bogus_matmul + implicit none + real :: M(3,0), v(0), w(3) + + w = 7 + w = matmul(M,v) + if( any(w .ne. 0) ) then + call abort + end if +end program bogus_matmul diff --git a/gcc/testsuite/gfortran.dg/namelist_76.f90 b/gcc/testsuite/gfortran.dg/namelist_76.f90 index acb3b2f6561..9c233fb5bcb 100644 --- a/gcc/testsuite/gfortran.dg/namelist_76.f90 +++ b/gcc/testsuite/gfortran.dg/namelist_76.f90 @@ -24,5 +24,3 @@ subroutine write_data() write(10, nml=write_data_list) close(10) end subroutine write_data - -! { dg-final { cleanup-modules "data" } } diff --git a/gcc/testsuite/gfortran.dg/pointer_init_8.f90 b/gcc/testsuite/gfortran.dg/pointer_init_8.f90 index aacd9a8e16e..8c6bdb2a6a3 100644 --- a/gcc/testsuite/gfortran.dg/pointer_init_8.f90 +++ b/gcc/testsuite/gfortran.dg/pointer_init_8.f90 @@ -22,5 +22,3 @@ end module m if (.not. associated(py, y)) call abort() if (.not. same_type_as(py, y)) call abort() end - -! { dg-final { cleanup-modules "m" } } diff --git a/gcc/testsuite/gfortran.dg/pr61318.f90 b/gcc/testsuite/gfortran.dg/pr61318.f90 index 4e7e862c443..57da52d5890 100644 --- a/gcc/testsuite/gfortran.dg/pr61318.f90 +++ b/gcc/testsuite/gfortran.dg/pr61318.f90 @@ -20,4 +20,3 @@ program test use gbl_interfaces call gagout(seve%e,'Some string') ! { dg-error "Type mismatch in argument" } end program test -! { dg-final { cleanup-modules "gbl_interfaces gbl_message" } } diff --git a/gcc/testsuite/gfortran.dg/pr77260_1.f90 b/gcc/testsuite/gfortran.dg/pr77260_1.f90 index 0d2ead61ce7..76ef3cffced 100644 --- a/gcc/testsuite/gfortran.dg/pr77260_1.f90 +++ b/gcc/testsuite/gfortran.dg/pr77260_1.f90 @@ -22,4 +22,3 @@ program test implicit none print *,f2() end program -! { dg-final { cleanup-modules "foo" } } diff --git a/gcc/testsuite/gfortran.dg/pr77260_2.f90 b/gcc/testsuite/gfortran.dg/pr77260_2.f90 index ea8da4f271c..0c5ebe3a656 100644 --- a/gcc/testsuite/gfortran.dg/pr77260_2.f90 +++ b/gcc/testsuite/gfortran.dg/pr77260_2.f90 @@ -23,4 +23,3 @@ program test implicit none print *,f2() end program -! { dg-final { cleanup-modules "foo" } } diff --git a/gcc/testsuite/gfortran.dg/pr77420_3.f90 b/gcc/testsuite/gfortran.dg/pr77420_3.f90 index cf95ac05f83..c53fce7b438 100644 --- a/gcc/testsuite/gfortran.dg/pr77420_3.f90 +++ b/gcc/testsuite/gfortran.dg/pr77420_3.f90 @@ -6,4 +6,3 @@ module h5global integer :: h5p_default_f, h5p_flags equivalence(h5p_flags, h5p_default_f) end module h5global -! { dg-final { cleanup-modules "h5global" } } diff --git a/gcc/testsuite/gfortran.dg/pr80107.f b/gcc/testsuite/gfortran.dg/pr80107.f deleted file mode 100644 index 541fba8cd95..00000000000 --- a/gcc/testsuite/gfortran.dg/pr80107.f +++ /dev/null @@ -1,6 +0,0 @@ -! { dg-do compile { target { powerpc*-*-* } } } -! { dg-options "-O0 -mpower9-dform-vector -mno-gen-cell-microcode" } - - integer(kind=2) j, j2, ja - call c_c(CMPLX(j),(1.,0.),'CMPLX(integer(2))') - end diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_39.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_39.f90 index 2be5d651793..b3e0eb995ba 100644 --- a/gcc/testsuite/gfortran.dg/proc_ptr_39.f90 +++ b/gcc/testsuite/gfortran.dg/proc_ptr_39.f90 @@ -17,5 +17,3 @@ program Test use Module1 use Module2 end program - -! { dg-final { cleanup-modules "Module1 Module2" } } diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_41.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_41.f90 index 7f50abab21a..534ab0fb5a7 100644 --- a/gcc/testsuite/gfortran.dg/proc_ptr_41.f90 +++ b/gcc/testsuite/gfortran.dg/proc_ptr_41.f90 @@ -33,5 +33,3 @@ program crash_test ptr => generic_name_get_proc_ptr() end program - -! { dg-final { cleanup-modules "test" } } diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_42.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_42.f90 index 8556fdf0c21..c92e537acbe 100644 --- a/gcc/testsuite/gfortran.dg/proc_ptr_42.f90 +++ b/gcc/testsuite/gfortran.dg/proc_ptr_42.f90 @@ -32,5 +32,3 @@ program p use m2 call ns_dirdata(f) end - -! { dg-final { cleanup-modules "m1 m2" } } diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_comp_43.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_comp_43.f90 index 239fe99f71c..7bbd4b5bdab 100644 --- a/gcc/testsuite/gfortran.dg/proc_ptr_comp_43.f90 +++ b/gcc/testsuite/gfortran.dg/proc_ptr_comp_43.f90 @@ -28,5 +28,3 @@ contains end subroutine go end module m - -! { dg-final { cleanup-modules "m" } } diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_comp_50.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_comp_50.f90 new file mode 100644 index 00000000000..d62d8326dd7 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/proc_ptr_comp_50.f90 @@ -0,0 +1,26 @@ +! { dg-do compile } +! +! PR 70601: [5/6/7 Regression] [OOP] ICE on procedure pointer component call +! +! Contributed by zmi <zmi007@gmail.com> + +program test + implicit none + + type :: concrete_type + procedure (run_concrete_type), pointer :: run + end type + + type(concrete_type), allocatable :: concrete + + allocate(concrete) + concrete % run => run_concrete_type + call concrete % run() + +contains + + subroutine run_concrete_type(this) + class(concrete_type) :: this + end subroutine + +end diff --git a/gcc/testsuite/gfortran.dg/prof/prof.exp b/gcc/testsuite/gfortran.dg/prof/prof.exp index 5b0ed55c3c6..dc9a7ba65bf 100644 --- a/gcc/testsuite/gfortran.dg/prof/prof.exp +++ b/gcc/testsuite/gfortran.dg/prof/prof.exp @@ -18,6 +18,7 @@ # ordering using -fprofile-generate followed by -fprofile-use. load_lib target-supports.exp +load_lib fortran-modules.exp # Some targets don't support tree profiling. if { ![check_profiling_available "-fprofile-generate"] } { @@ -50,7 +51,9 @@ foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.f*]] { if ![runtest_file_p $runtests $src] then { continue } + list-module-names $src profopt-execute $src + cleanup-modules "" } foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.f*]] { diff --git a/gcc/testsuite/gfortran.dg/read_5.f90 b/gcc/testsuite/gfortran.dg/read_5.f90 new file mode 100644 index 00000000000..81f1f11cf28 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/read_5.f90 @@ -0,0 +1,21 @@ +! { dg-do run } +! PR53029 Missed optimization, this test case took several seconds to + program internalread + implicit none + integer m + parameter(m=1000000) + character value*10 + character(80) :: result + integer i,j,intvalues(m) + real :: start, finish + intvalues = 33 + call cpu_time(start) + do j=1,100 + write(value,'(i3,a5)') j," 5 69" + read(value,*,end=20) intvalues + 20 write(result,*) (intvalues(i),i=2,4) + if (result.ne.(' 5 69 33')) call abort + call cpu_time(finish) + if ((finish-start).gt. 0.5) call abort + enddo + end program internalread diff --git a/gcc/testsuite/gfortran.dg/submodule_1.f08 b/gcc/testsuite/gfortran.dg/submodule_1.f08 index 578492e54e7..2c5d373206e 100644 --- a/gcc/testsuite/gfortran.dg/submodule_1.f08 +++ b/gcc/testsuite/gfortran.dg/submodule_1.f08 @@ -170,6 +170,3 @@ message2 = "" end subroutine end program -! { dg-final { cleanup-submodules "foo_interface@foo_interface_son" } } -! { dg-final { cleanup-submodules "foo_interface@foo_interface_grandson" } } -! { dg-final { cleanup-submodules "foo_interface@foo_interface_daughter" } } diff --git a/gcc/testsuite/gfortran.dg/submodule_10.f08 b/gcc/testsuite/gfortran.dg/submodule_10.f08 index e956b2905c3..373b11c9f96 100644 --- a/gcc/testsuite/gfortran.dg/submodule_10.f08 +++ b/gcc/testsuite/gfortran.dg/submodule_10.f08 @@ -167,5 +167,3 @@ program testlk stop end program testlk -! { dg-final { cleanup-submodules "error_mod@error_impl_mod" } } - diff --git a/gcc/testsuite/gfortran.dg/submodule_14.f08 b/gcc/testsuite/gfortran.dg/submodule_14.f08 index cbfc3d1d4b1..bc8fd8042a7 100644 --- a/gcc/testsuite/gfortran.dg/submodule_14.f08 +++ b/gcc/testsuite/gfortran.dg/submodule_14.f08 @@ -46,4 +46,3 @@ end submodule testson x = 10 if (fcn1 (x) .ne. 0) call abort end -! { dg-final { cleanup-submodules "test@testson" } } diff --git a/gcc/testsuite/gfortran.dg/submodule_15.f08 b/gcc/testsuite/gfortran.dg/submodule_15.f08 index a09a7e7e403..499bc66d5ac 100644 --- a/gcc/testsuite/gfortran.dg/submodule_15.f08 +++ b/gcc/testsuite/gfortran.dg/submodule_15.f08 @@ -56,4 +56,3 @@ end submodule incr = 1 if (a3(i) .ne. 11) call abort end -! { dg-final { cleanup-submodules "a@a_son" } } diff --git a/gcc/testsuite/gfortran.dg/submodule_2.f08 b/gcc/testsuite/gfortran.dg/submodule_2.f08 index 60925ec788d..43456d5fc4c 100644 --- a/gcc/testsuite/gfortran.dg/submodule_2.f08 +++ b/gcc/testsuite/gfortran.dg/submodule_2.f08 @@ -98,5 +98,3 @@ if (any (arg%greeting .ne. ["adieu, people!", "adieu, people!"])) call abort contains end program -! { dg-final { cleanup-submodules "foo_interface@foo_interface_son" } } -! { dg-final { cleanup-submodules "foo_interface@foo_interface_daughter" } } diff --git a/gcc/testsuite/gfortran.dg/submodule_5.f08 b/gcc/testsuite/gfortran.dg/submodule_5.f08 index 2698000c46a..ed5722ed167 100644 --- a/gcc/testsuite/gfortran.dg/submodule_5.f08 +++ b/gcc/testsuite/gfortran.dg/submodule_5.f08 @@ -57,4 +57,3 @@ contains end SUBMODULE foo_interface_daughter end -! { dg-final { cleanup-submodules "foo_interface@foo_interface_daughter" } } diff --git a/gcc/testsuite/gfortran.dg/submodule_6.f08 b/gcc/testsuite/gfortran.dg/submodule_6.f08 index 21b0e0faac5..ec9dfa9e725 100644 --- a/gcc/testsuite/gfortran.dg/submodule_6.f08 +++ b/gcc/testsuite/gfortran.dg/submodule_6.f08 @@ -92,6 +92,3 @@ program p call p_a(a, create_b([3,4,5])) call print(a) end program p -! { dg-final { cleanup-submodules "mod_a@imp_p_a" } } -! { dg-final { cleanup-submodules "mod_b@imp_create" } } - diff --git a/gcc/testsuite/gfortran.dg/submodule_7.f08 b/gcc/testsuite/gfortran.dg/submodule_7.f08 index a183f50e46c..fd1bee6296c 100644 --- a/gcc/testsuite/gfortran.dg/submodule_7.f08 +++ b/gcc/testsuite/gfortran.dg/submodule_7.f08 @@ -145,5 +145,3 @@ program main call verify_cleanup (c_1, c_2) !... end program main -! { dg-final { cleanup-submodules "color_points@color_points_a" } } -! { dg-final { cleanup-submodules "color_points@color_points_b" } } diff --git a/gcc/testsuite/gfortran.dg/submodule_8.f08 b/gcc/testsuite/gfortran.dg/submodule_8.f08 index 15a38a58833..b3c1565bbd8 100644 --- a/gcc/testsuite/gfortran.dg/submodule_8.f08 +++ b/gcc/testsuite/gfortran.dg/submodule_8.f08 @@ -41,4 +41,3 @@ program a_s call abort end if end program -! { dg-final { cleanup-submodules "mod_a@mod_s" } } diff --git a/gcc/testsuite/gfortran.dg/submodule_9.f08 b/gcc/testsuite/gfortran.dg/submodule_9.f08 index 873979d1feb..4589ebcd6d2 100644 --- a/gcc/testsuite/gfortran.dg/submodule_9.f08 +++ b/gcc/testsuite/gfortran.dg/submodule_9.f08 @@ -38,4 +38,3 @@ program a_s implicit none call p() end program -! { dg-final { cleanup-submodules "mod_a@b" } } diff --git a/gcc/testsuite/gfortran.dg/transfer_class_2.f90 b/gcc/testsuite/gfortran.dg/transfer_class_2.f90 index d75b640f10f..476eaccc709 100644 --- a/gcc/testsuite/gfortran.dg/transfer_class_2.f90 +++ b/gcc/testsuite/gfortran.dg/transfer_class_2.f90 @@ -41,5 +41,3 @@ program p if (c%i /= 4) call abort() end - -! { dg-final { cleanup-modules "m" } } diff --git a/gcc/testsuite/gfortran.dg/typebound_assignment_7.f90 b/gcc/testsuite/gfortran.dg/typebound_assignment_7.f90 index 2c5b837d670..e297d9f8ddf 100644 --- a/gcc/testsuite/gfortran.dg/typebound_assignment_7.f90 +++ b/gcc/testsuite/gfortran.dg/typebound_assignment_7.f90 @@ -62,5 +62,3 @@ program test_assign end select end - -! { dg-final { cleanup-modules "mod1 mod2" } } diff --git a/gcc/testsuite/gfortran.dg/typebound_call_24.f03 b/gcc/testsuite/gfortran.dg/typebound_call_24.f03 index 48d63dc6023..45990aebe41 100644 --- a/gcc/testsuite/gfortran.dg/typebound_call_24.f03 +++ b/gcc/testsuite/gfortran.dg/typebound_call_24.f03 @@ -20,5 +20,3 @@ program bug2 class(aqq_t) :: aqq ! { dg-error "must be dummy, allocatable or pointer" } call aqq%aqq_init end program - -! { dg-final { cleanup-modules "aqq_m" } } diff --git a/gcc/testsuite/gfortran.dg/typebound_call_25.f90 b/gcc/testsuite/gfortran.dg/typebound_call_25.f90 index df81c79e627..7f5fb07f9aa 100644 --- a/gcc/testsuite/gfortran.dg/typebound_call_25.f90 +++ b/gcc/testsuite/gfortran.dg/typebound_call_25.f90 @@ -34,5 +34,3 @@ CONTAINS END SUBROUTINE END MODULE - -! { dg-final { cleanup-modules "my_mod" } } diff --git a/gcc/testsuite/gfortran.dg/typebound_deferred_1.f90 b/gcc/testsuite/gfortran.dg/typebound_deferred_1.f90 index 6e6dc52d0fd..a08e5343b7d 100644 --- a/gcc/testsuite/gfortran.dg/typebound_deferred_1.f90 +++ b/gcc/testsuite/gfortran.dg/typebound_deferred_1.f90 @@ -19,5 +19,3 @@ contains end subroutine inter end module m - -! { dg-final { cleanup-modules "m" } } diff --git a/gcc/testsuite/gfortran.dg/typebound_generic_12.f03 b/gcc/testsuite/gfortran.dg/typebound_generic_12.f03 index 061a41a07f3..c9d0fe0b5de 100644 --- a/gcc/testsuite/gfortran.dg/typebound_generic_12.f03 +++ b/gcc/testsuite/gfortran.dg/typebound_generic_12.f03 @@ -22,5 +22,3 @@ contains class(t) :: this end subroutine sub2 end module m - -! { dg-final { cleanup-modules "m" } } diff --git a/gcc/testsuite/gfortran.dg/typebound_generic_13.f03 b/gcc/testsuite/gfortran.dg/typebound_generic_13.f03 index c2116e965a8..eff919e9328 100644 --- a/gcc/testsuite/gfortran.dg/typebound_generic_13.f03 +++ b/gcc/testsuite/gfortran.dg/typebound_generic_13.f03 @@ -24,5 +24,3 @@ contains end subroutine end module - -! { dg-final { cleanup-modules "m" } } diff --git a/gcc/testsuite/gfortran.dg/typebound_generic_14.f03 b/gcc/testsuite/gfortran.dg/typebound_generic_14.f03 index 8515cf4378f..8fd2a59578e 100644 --- a/gcc/testsuite/gfortran.dg/typebound_generic_14.f03 +++ b/gcc/testsuite/gfortran.dg/typebound_generic_14.f03 @@ -23,5 +23,3 @@ contains end subroutine end module - -! { dg-final { cleanup-modules "a_mod" } } diff --git a/gcc/testsuite/gfortran.dg/typebound_generic_15.f90 b/gcc/testsuite/gfortran.dg/typebound_generic_15.f90 index f71ffd9e8a7..2cff16d1995 100644 --- a/gcc/testsuite/gfortran.dg/typebound_generic_15.f90 +++ b/gcc/testsuite/gfortran.dg/typebound_generic_15.f90 @@ -14,5 +14,3 @@ module Objects end Type end module - -! { dg-final { cleanup-modules "Objects" } } diff --git a/gcc/testsuite/gfortran.dg/typebound_operator_16.f03 b/gcc/testsuite/gfortran.dg/typebound_operator_16.f03 index eff43ebe53b..f56301cfd15 100644 --- a/gcc/testsuite/gfortran.dg/typebound_operator_16.f03 +++ b/gcc/testsuite/gfortran.dg/typebound_operator_16.f03 @@ -45,5 +45,3 @@ contains myadd = a%x + b end function MyAdd end module - -! { dg-final { cleanup-modules "M1 M2" } } diff --git a/gcc/testsuite/gfortran.dg/typebound_operator_18.f90 b/gcc/testsuite/gfortran.dg/typebound_operator_18.f90 index d5ac9e97533..1288ef50d42 100644 --- a/gcc/testsuite/gfortran.dg/typebound_operator_18.f90 +++ b/gcc/testsuite/gfortran.dg/typebound_operator_18.f90 @@ -21,5 +21,3 @@ contains class(athlete) ,intent(in) :: this end function end module - -! { dg-final { cleanup-modules "athlete_module" } } diff --git a/gcc/testsuite/gfortran.dg/typebound_operator_20.f90 b/gcc/testsuite/gfortran.dg/typebound_operator_20.f90 index 26c49a188eb..81fe7744a85 100644 --- a/gcc/testsuite/gfortran.dg/typebound_operator_20.f90 +++ b/gcc/testsuite/gfortran.dg/typebound_operator_20.f90 @@ -49,5 +49,3 @@ program drive if (h1%sum(h2) /= 1) call abort() end - -! { dg-final { cleanup-modules "overwrite" } } diff --git a/gcc/testsuite/gfortran.dg/typebound_override_3.f90 b/gcc/testsuite/gfortran.dg/typebound_override_3.f90 index 36d84737e18..c3ca5e355cf 100644 --- a/gcc/testsuite/gfortran.dg/typebound_override_3.f90 +++ b/gcc/testsuite/gfortran.dg/typebound_override_3.f90 @@ -30,5 +30,3 @@ contains name = "name_B" end function end module - -! { dg-final { cleanup-modules "dtAs dtBs" } } diff --git a/gcc/testsuite/gfortran.dg/typebound_override_4.f90 b/gcc/testsuite/gfortran.dg/typebound_override_4.f90 index 95131dea3b8..63464526352 100644 --- a/gcc/testsuite/gfortran.dg/typebound_override_4.f90 +++ b/gcc/testsuite/gfortran.dg/typebound_override_4.f90 @@ -30,5 +30,3 @@ contains class(r_type) :: mapout end subroutine end module - -! { dg-final { cleanup-modules "base_mod r_mod" } } diff --git a/gcc/testsuite/gfortran.dg/typebound_override_5.f90 b/gcc/testsuite/gfortran.dg/typebound_override_5.f90 index 565dd48d4fd..fc48fccb648 100644 --- a/gcc/testsuite/gfortran.dg/typebound_override_5.f90 +++ b/gcc/testsuite/gfortran.dg/typebound_override_5.f90 @@ -1,40 +1,38 @@ -! { dg-do compile }
-!
-! PR 54190: TYPE(*)/assumed-rank: Type/rank check too relaxed for dummy procedure
-! PR 57217: [4.7/4.8/4.9 Regression][OOP] Accepts invalid TBP overriding - lacking arguments check
-!
-! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
-
-module base_mod
- implicit none
- type base_type
- integer :: kind
- contains
- procedure, pass(map) :: clone => base_clone
- end type
-contains
- subroutine base_clone(map,mapout,info)
- class(base_type), intent(inout) :: map
- class(base_type), intent(inout) :: mapout
- integer :: info
- end subroutine
-end module
-
-module r_mod
- use base_mod
- implicit none
- type, extends(base_type) :: r_type
- real :: dat
- contains
- procedure, pass(map) :: clone => r_clone ! { dg-error "Type mismatch in argument" }
- end type
-contains
- subroutine r_clone(map,mapout,info)
- class(r_type), intent(inout) :: map
-!gcc$ attributes no_arg_check :: mapout
- integer, intent(inout) :: mapout
- integer :: info
- end subroutine
-end module
-
-! { dg-final { cleanup-modules "base_mod r_mod" } }
+! { dg-do compile } +! +! PR 54190: TYPE(*)/assumed-rank: Type/rank check too relaxed for dummy procedure +! PR 57217: [4.7/4.8/4.9 Regression][OOP] Accepts invalid TBP overriding - lacking arguments check +! +! Contributed by Tobias Burnus <burnus@gcc.gnu.org> + +module base_mod + implicit none + type base_type + integer :: kind + contains + procedure, pass(map) :: clone => base_clone + end type +contains + subroutine base_clone(map,mapout,info) + class(base_type), intent(inout) :: map + class(base_type), intent(inout) :: mapout + integer :: info + end subroutine +end module + +module r_mod + use base_mod + implicit none + type, extends(base_type) :: r_type + real :: dat + contains + procedure, pass(map) :: clone => r_clone ! { dg-error "Type mismatch in argument" } + end type +contains + subroutine r_clone(map,mapout,info) + class(r_type), intent(inout) :: map +!gcc$ attributes no_arg_check :: mapout + integer, intent(inout) :: mapout + integer :: info + end subroutine +end module diff --git a/gcc/testsuite/gfortran.dg/typebound_override_6.f90 b/gcc/testsuite/gfortran.dg/typebound_override_6.f90 index 45720fd610f..55d4002ce17 100644 --- a/gcc/testsuite/gfortran.dg/typebound_override_6.f90 +++ b/gcc/testsuite/gfortran.dg/typebound_override_6.f90 @@ -1,39 +1,37 @@ -! { dg-do compile }
-!
-! PR 54190: TYPE(*)/assumed-rank: Type/rank check too relaxed for dummy procedure
-! PR 57217: [4.7/4.8/4.9 Regression][OOP] Accepts invalid TBP overriding - lacking arguments check
-!
-! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
-
-module base_mod
- implicit none
- type base_type
- integer :: kind
- contains
- procedure, pass(map) :: clone => base_clone
- end type
-contains
- subroutine base_clone(map,mapout,info)
- class(base_type), intent(inout) :: map
- class(base_type), intent(inout) :: mapout
- integer :: info
- end subroutine
-end module
-
-module r_mod
- use base_mod
- implicit none
- type, extends(base_type) :: r_type
- real :: dat
- contains
- procedure, pass(map) :: clone => r_clone ! { dg-error "Rank mismatch in argument" }
- end type
-contains
- subroutine r_clone(map,mapout,info)
- class(r_type), intent(inout) :: map
- class(base_type), intent(inout) :: mapout(..)
- integer :: info
- end subroutine
-end module
-
-! { dg-final { cleanup-modules "base_mod r_mod" } }
+! { dg-do compile } +! +! PR 54190: TYPE(*)/assumed-rank: Type/rank check too relaxed for dummy procedure +! PR 57217: [4.7/4.8/4.9 Regression][OOP] Accepts invalid TBP overriding - lacking arguments check +! +! Contributed by Tobias Burnus <burnus@gcc.gnu.org> + +module base_mod + implicit none + type base_type + integer :: kind + contains + procedure, pass(map) :: clone => base_clone + end type +contains + subroutine base_clone(map,mapout,info) + class(base_type), intent(inout) :: map + class(base_type), intent(inout) :: mapout + integer :: info + end subroutine +end module + +module r_mod + use base_mod + implicit none + type, extends(base_type) :: r_type + real :: dat + contains + procedure, pass(map) :: clone => r_clone ! { dg-error "Rank mismatch in argument" } + end type +contains + subroutine r_clone(map,mapout,info) + class(r_type), intent(inout) :: map + class(base_type), intent(inout) :: mapout(..) + integer :: info + end subroutine +end module diff --git a/gcc/testsuite/gfortran.dg/typebound_override_7.f90 b/gcc/testsuite/gfortran.dg/typebound_override_7.f90 index 0c7c48ad566..6f75115df5b 100644 --- a/gcc/testsuite/gfortran.dg/typebound_override_7.f90 +++ b/gcc/testsuite/gfortran.dg/typebound_override_7.f90 @@ -1,39 +1,37 @@ -! { dg-do compile }
-!
-! PR 54190: TYPE(*)/assumed-rank: Type/rank check too relaxed for dummy procedure
-! PR 57217: [4.7/4.8/4.9 Regression][OOP] Accepts invalid TBP overriding - lacking arguments check
-!
-! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
-
-module base_mod
- implicit none
- type base_type
- integer :: kind
- contains
- procedure, pass(map) :: clone => base_clone
- end type
-contains
- subroutine base_clone(map,mapout,info)
- class(base_type), intent(inout) :: map
- class(base_type), intent(inout) :: mapout
- integer :: info
- end subroutine
-end module
-
-module r_mod
- use base_mod
- implicit none
- type, extends(base_type) :: r_type
- real :: dat
- contains
- procedure, pass(map) :: clone => r_clone ! { dg-error "Type mismatch in argument" }
- end type
-contains
- subroutine r_clone(map,mapout,info)
- class(r_type), intent(inout) :: map
- type(*), intent(inout) :: mapout
- integer :: info
- end subroutine
-end module
-
-! { dg-final { cleanup-modules "base_mod r_mod" } }
+! { dg-do compile } +! +! PR 54190: TYPE(*)/assumed-rank: Type/rank check too relaxed for dummy procedure +! PR 57217: [4.7/4.8/4.9 Regression][OOP] Accepts invalid TBP overriding - lacking arguments check +! +! Contributed by Tobias Burnus <burnus@gcc.gnu.org> + +module base_mod + implicit none + type base_type + integer :: kind + contains + procedure, pass(map) :: clone => base_clone + end type +contains + subroutine base_clone(map,mapout,info) + class(base_type), intent(inout) :: map + class(base_type), intent(inout) :: mapout + integer :: info + end subroutine +end module + +module r_mod + use base_mod + implicit none + type, extends(base_type) :: r_type + real :: dat + contains + procedure, pass(map) :: clone => r_clone ! { dg-error "Type mismatch in argument" } + end type +contains + subroutine r_clone(map,mapout,info) + class(r_type), intent(inout) :: map + type(*), intent(inout) :: mapout + integer :: info + end subroutine +end module diff --git a/gcc/testsuite/gfortran.dg/typebound_proc_28.f03 b/gcc/testsuite/gfortran.dg/typebound_proc_28.f03 index 74199c343fa..04d97f80641 100644 --- a/gcc/testsuite/gfortran.dg/typebound_proc_28.f03 +++ b/gcc/testsuite/gfortran.dg/typebound_proc_28.f03 @@ -26,5 +26,3 @@ contains end function end module - -! { dg-final { cleanup-modules "t" } } diff --git a/gcc/testsuite/gfortran.dg/typebound_proc_29.f90 b/gcc/testsuite/gfortran.dg/typebound_proc_29.f90 index 2650d149368..3e9a9aab634 100644 --- a/gcc/testsuite/gfortran.dg/typebound_proc_29.f90 +++ b/gcc/testsuite/gfortran.dg/typebound_proc_29.f90 @@ -22,5 +22,3 @@ program abstract type(pdf) pp print pp%getx() ! { dg-error "must be of type default-kind CHARACTER or of INTEGER" } end program - -! { dg-final { cleanup-modules "pdfs" } } diff --git a/gcc/testsuite/gfortran.dg/typebound_proc_30.f90 b/gcc/testsuite/gfortran.dg/typebound_proc_30.f90 index 09b07261089..5fa5a0fac00 100644 --- a/gcc/testsuite/gfortran.dg/typebound_proc_30.f90 +++ b/gcc/testsuite/gfortran.dg/typebound_proc_30.f90 @@ -34,5 +34,3 @@ contains end function end module - -! { dg-final { cleanup-modules "phs_single" } } diff --git a/gcc/testsuite/gfortran.dg/typebound_proc_31.f90 b/gcc/testsuite/gfortran.dg/typebound_proc_31.f90 index d83a9cdb4d0..82a67c08417 100644 --- a/gcc/testsuite/gfortran.dg/typebound_proc_31.f90 +++ b/gcc/testsuite/gfortran.dg/typebound_proc_31.f90 @@ -24,5 +24,3 @@ contains end function end module - -! { dg-final { cleanup-modules "classes" } } diff --git a/gcc/testsuite/gfortran.dg/typebound_proc_32.f90 b/gcc/testsuite/gfortran.dg/typebound_proc_32.f90 index 00ae9c73263..035965be426 100644 --- a/gcc/testsuite/gfortran.dg/typebound_proc_32.f90 +++ b/gcc/testsuite/gfortran.dg/typebound_proc_32.f90 @@ -31,5 +31,3 @@ contains end function end module - -! { dg-final { cleanup-modules "classes" } } diff --git a/gcc/testsuite/gfortran.dg/typebound_proc_33.f90 b/gcc/testsuite/gfortran.dg/typebound_proc_33.f90 index 68ea53fcd11..41aef56cb03 100644 --- a/gcc/testsuite/gfortran.dg/typebound_proc_33.f90 +++ b/gcc/testsuite/gfortran.dg/typebound_proc_33.f90 @@ -35,5 +35,3 @@ contains end subroutine end - -! { dg-final { cleanup-modules "ObjectLists" } } diff --git a/gcc/testsuite/gfortran.dg/unlimited_polymorphic_16.f90 b/gcc/testsuite/gfortran.dg/unlimited_polymorphic_16.f90 index 99e186d5c14..2be8848c11f 100644 --- a/gcc/testsuite/gfortran.dg/unlimited_polymorphic_16.f90 +++ b/gcc/testsuite/gfortran.dg/unlimited_polymorphic_16.f90 @@ -20,5 +20,3 @@ contains end subroutine end module - -! { dg-final { cleanup-modules "IO" } } diff --git a/gcc/testsuite/gfortran.dg/unlimited_polymorphic_19.f90 b/gcc/testsuite/gfortran.dg/unlimited_polymorphic_19.f90 index 51359d1461c..a665a3829ff 100644 --- a/gcc/testsuite/gfortran.dg/unlimited_polymorphic_19.f90 +++ b/gcc/testsuite/gfortran.dg/unlimited_polymorphic_19.f90 @@ -49,5 +49,3 @@ CONTAINS END SELECT; END SELECT END SUBROUTINE copy_int END PROGRAM main - -! { dg-final { cleanup-modules "m" } } diff --git a/gcc/testsuite/gfortran.dg/unlimited_polymorphic_24.f03 b/gcc/testsuite/gfortran.dg/unlimited_polymorphic_24.f03 index 2abe99cd5bb..39937277323 100644 --- a/gcc/testsuite/gfortran.dg/unlimited_polymorphic_24.f03 +++ b/gcc/testsuite/gfortran.dg/unlimited_polymorphic_24.f03 @@ -214,5 +214,3 @@ program main end select end do end program main - -! { dg-final { cleanup-modules "list_mod link_mod" } } diff --git a/gcc/testsuite/gfortran.dg/use_only_3.f90 b/gcc/testsuite/gfortran.dg/use_only_3.f90 index ebb39289fc4..b264506d4c3 100644 --- a/gcc/testsuite/gfortran.dg/use_only_3.f90 +++ b/gcc/testsuite/gfortran.dg/use_only_3.f90 @@ -32,4 +32,3 @@ subroutine dforceb(c0, i, betae, ipol, bec0, ctabin, gqq, gqqm, qmat, dq2, df) & dq2, gmes end subroutine dforceb -! { dg-final { cleanup-modules "cell_base constants control_flags cvan electrons_base electrons_nose gvecs gvecw ions_base kinds parameters" } } diff --git a/gcc/testsuite/gfortran.dg/use_without_only_1.f90 b/gcc/testsuite/gfortran.dg/use_without_only_1.f90 index 3fea702c2a4..06af9853933 100644 --- a/gcc/testsuite/gfortran.dg/use_without_only_1.f90 +++ b/gcc/testsuite/gfortran.dg/use_without_only_1.f90 @@ -19,4 +19,3 @@ CONTAINS USE ISO_C_BINDING ! { dg-warning "9:has no ONLY qualifier" } END SUBROUTINE S3 END MODULE -! { dg-final { cleanup-modules "foo testmod" } } diff --git a/gcc/testsuite/gfortran.dg/warn_unused_function.f90 b/gcc/testsuite/gfortran.dg/warn_unused_function.f90 index 4d0ed9abc92..209cb7f0026 100644 --- a/gcc/testsuite/gfortran.dg/warn_unused_function.f90 +++ b/gcc/testsuite/gfortran.dg/warn_unused_function.f90 @@ -17,5 +17,3 @@ contains print *, "Hello ", a, "!" end subroutine end module - -! { dg-final { cleanup-modules "mod_say_hello" } } diff --git a/gcc/testsuite/gfortran.dg/warn_unused_function_2.f90 b/gcc/testsuite/gfortran.dg/warn_unused_function_2.f90 index 958cc969253..43b211e57bf 100644 --- a/gcc/testsuite/gfortran.dg/warn_unused_function_2.f90 +++ b/gcc/testsuite/gfortran.dg/warn_unused_function_2.f90 @@ -39,5 +39,3 @@ contains subroutine s5 ! { dg-warning "defined but not used" } end subroutine end - -! { dg-final { cleanup-modules "m" } } diff --git a/gcc/testsuite/gnat.dg/debug11.adb b/gcc/testsuite/gnat.dg/debug11.adb new file mode 100644 index 00000000000..5f60697a536 --- /dev/null +++ b/gcc/testsuite/gnat.dg/debug11.adb @@ -0,0 +1,25 @@ +-- { dg-options "-cargs -O0 -g -dA -fgnat-encodings=minimal -margs" } +-- +-- This testcase checks that in the DWARF description of the variant type +-- below, the C discriminant is properly described as unsigned, hence the 0x5a +-- ('Z') and 0x80 (128) values in the DW_AT_discr_list attribute. If it was +-- described as signed, we would have instead 90 and -128. +-- +-- { dg-final { scan-assembler-times "0x5a.*DW_AT_discr_list" 1 } } +-- { dg-final { scan-assembler-times "0x80.*DW_AT_discr_list" 1 } } + +with Ada.Text_IO; + +procedure Debug11 is + type Rec_Type (C : Character) is record + case C is + when 'Z' .. Character'Val (128) => I : Integer; + when others => null; + end case; + end record; + -- R : Rec_Type := ('Z', 2); + R : Rec_Type ('Z'); +begin + R.I := 0; + Ada.Text_IO.Put_Line ("" & R.C); +end Debug11; diff --git a/gcc/testsuite/gnat.dg/debug12.adb b/gcc/testsuite/gnat.dg/debug12.adb new file mode 100644 index 00000000000..07175968703 --- /dev/null +++ b/gcc/testsuite/gnat.dg/debug12.adb @@ -0,0 +1,9 @@ +-- { dg-options "-cargs -gdwarf-4 -fdebug-types-section -dA -margs" } +-- { dg-final { scan-assembler-times "DW_AT_location" 4 } } + +package body Debug12 is + function Get_A2 return Boolean is + begin + return A2; + end Get_A2; +end Debug12; diff --git a/gcc/testsuite/gnat.dg/debug12.ads b/gcc/testsuite/gnat.dg/debug12.ads new file mode 100644 index 00000000000..dbc5896cc73 --- /dev/null +++ b/gcc/testsuite/gnat.dg/debug12.ads @@ -0,0 +1,8 @@ +package Debug12 is + type Bit_Array is array (Positive range <>) of Boolean + with Pack; + A : Bit_Array := (1 .. 10 => False); + A2 : Boolean renames A (2); + + function Get_A2 return Boolean; +end Debug12; diff --git a/gcc/testsuite/lib/fortran-modules.exp b/gcc/testsuite/lib/fortran-modules.exp index 7bfc0025a8a..a35f7a7abde 100644 --- a/gcc/testsuite/lib/fortran-modules.exp +++ b/gcc/testsuite/lib/fortran-modules.exp @@ -79,10 +79,14 @@ proc list-module-names { files } { proc list-module-names-1 { file } { set result {} - set tmp [grep $file "^\[ \t\]*((#)?\[ \t\]*include|\[mM\]\[oO\]\[dD\]\[uU\]\[lL\]\[eE\](?!\[ \t\]+\[pP\]\[rR\]\[oO\]\[cC\]\[eE\]\[dD\]\[uU\]\[rR\]\[eE\]\[ \t\]+))\[ \t\]+.*" line] + if {[file isdirectory $file]} {return} + # Find lines containing INCLUDE, MODULE, and SUBMODULE, excluding the lines containing + # MODULE [PURE|(IMPURE\s+)?ELEMENTAL|RECURSIVE] (PROCEDURE|FUNCTION|SUBROUTINE) + set pat {^\s*((#)?\s*include|(sub)?module(?!\s+((pure|(impure\s+)?elemental|recursive)\s+)?(procedure|function|subroutine)[:\s]+))\s*.*} + set tmp [igrep $file $pat line] if {![string match "" $tmp]} { foreach i $tmp { - regexp "(\[0-9\]+)\[ \t\]+(?:(?:#)?\[ \t\]*include\[ \t\]+)\[\"\](\[^\"\]*)\[\"\]" $i dummy lineno include_file + regexp -nocase {(\d+)\s+#?\s*include\s+["']([^"']*)["']} $i dummy lineno include_file if {[info exists include_file]} { set dir [file dirname $file] set inc "$dir/$include_file" @@ -99,10 +103,16 @@ proc list-module-names-1 { file } { } continue } - regexp "(\[0-9\]+)\[ \t\]+(?:(\[mM\]\[oO\]\[dD\]\[uU\]\[lL\]\[eE\]\[ \t\]+(?!\[pP\]\[rR\]\[oO\]\[cC\]\[eE\]\[dD\]\[uU\]\[rR\]\[eE\]\[ \t\]+)))(\[^ \t;\]*)" $i i lineno keyword mod - if {![info exists lineno]} { + regexp -nocase {(\d+)\s+(module|submodule)\s*([^;]*)} $i i lineno keyword mod + if {![info exists mod]} { continue } + # Generates the file name mod_name@submod_name from + # (\s*mod_name[:submod_name]\s*)\s*submod_name\s*[! comment] + regsub {\s*!.*} $mod "" mod + regsub {:[^)]*} $mod "" mod + regsub {\(\s*} $mod "" mod + regsub {\s*\)\s*} $mod "@" mod verbose "Line $lineno mentions module `$mod'" 3 if {[lsearch $result $mod] < 0} { lappend result $mod @@ -111,3 +121,54 @@ proc list-module-names-1 { file } { } return $result } + +# Looks for case insensitive occurrences of a string in a file. +# return:list of lines that matched or NULL if none match. +# args: first arg is the filename, +# second is the pattern, +# third are any options. +# Options: line - puts line numbers of match in list +# +proc igrep { args } { + + set file [lindex $args 0] + set pattern [lindex $args 1] + + verbose "Grepping $file for the pattern \"$pattern\"" 3 + + set argc [llength $args] + if { $argc > 2 } { + for { set i 2 } { $i < $argc } { incr i } { + append options [lindex $args $i] + append options " " + } + } else { + set options "" + } + + set i 0 + set fd [open $file r] + while { [gets $fd cur_line]>=0 } { + incr i + if {[regexp -nocase -- "$pattern" $cur_line match]} { + if {![string match "" $options]} { + foreach opt $options { + switch $opt { + "line" { + lappend grep_out [concat $i $match] + } + } + } + } else { + lappend grep_out $match + } + } + } + close $fd + unset fd + unset i + if {![info exists grep_out]} { + set grep_out "" + } + return $grep_out +} diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp index b6865b441dc..e55557491bc 100644 --- a/gcc/testsuite/lib/gcc-dg.exp +++ b/gcc/testsuite/lib/gcc-dg.exp @@ -43,6 +43,12 @@ if { [ishost "*-*-cygwin*"] } { setenv LANG C.ASCII } +# Ensure GCC_COLORS is unset, for the rare testcases that verify +# how output is colorized. +if [info exists ::env(GCC_COLORS) ] { + unsetenv GCC_COLORS +} + global GCC_UNDER_TEST if ![info exists GCC_UNDER_TEST] { set GCC_UNDER_TEST "[find_gcc]" diff --git a/gcc/testsuite/lib/gcc.exp b/gcc/testsuite/lib/gcc.exp index 846e4e285f7..406ec4ac570 100644 --- a/gcc/testsuite/lib/gcc.exp +++ b/gcc/testsuite/lib/gcc.exp @@ -141,19 +141,6 @@ proc gcc_target_compile { source dest type options } { lappend options "ldflags=$TEST_EXTRA_LIBS" } - if [target_info exists gcc,stack_size] { - lappend options "additional_flags=-DSTACK_SIZE=[target_info gcc,stack_size]" - } - if [target_info exists gcc,no_trampolines] { - lappend options "additional_flags=-DNO_TRAMPOLINES" - } - if [target_info exists gcc,no_label_values] { - lappend options "additional_flags=-DNO_LABEL_VALUES" - } - if [target_info exists gcc,signal_suppress] { - lappend options "additional_flags=-DSIGNAL_SUPPRESS" - } - # TEST_ALWAYS_FLAGS are flags that should be passed to every # compilation. They are passed first to allow individual # tests to override them. diff --git a/gcc/testsuite/lib/objc.exp b/gcc/testsuite/lib/objc.exp index 65d18395c44..431754f65b3 100644 --- a/gcc/testsuite/lib/objc.exp +++ b/gcc/testsuite/lib/objc.exp @@ -191,16 +191,6 @@ proc objc_target_compile { source dest type options } { lappend options "ldflags=$wrap_flags" } - if [target_info exists objc,stack_size] { - lappend options "additional_flags=-DSTACK_SIZE=[target_info objc,stack_size]" - } - if [target_info exists objc,no_trampolines] { - lappend options "additional_flags=-DNO_TRAMPOLINES" - } - if [target_info exists objc,no_label_values] { - lappend options "additional_flags=-DNO_LABEL_VALUES" - } - # TEST_ALWAYS_FLAGS are flags that should be passed to every # compilation. They are passed first to allow individual # tests to override them. diff --git a/gcc/testsuite/lib/profopt.exp b/gcc/testsuite/lib/profopt.exp index 77ffae0267f..6519c44ce33 100644 --- a/gcc/testsuite/lib/profopt.exp +++ b/gcc/testsuite/lib/profopt.exp @@ -248,6 +248,7 @@ proc profopt-get-options { src } { foreach op $tmp { set cmd [lindex $op 0] if { ![string compare "dg-options" $cmd] \ + || ![string compare "dg-additional-options" $cmd] \ || ![string compare "dg-skip-if" $cmd] \ || ![string compare "dg-final-generate" $cmd] \ || ![string compare "dg-final-use" $cmd] \ diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index ded6383cc1f..31701c23e8f 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -491,7 +491,7 @@ proc check_gc_sections_available { } { # target is supposed to support trampolines. proc check_effective_target_trampolines { } { - if [target_info exists no_trampolines] { + if [target_info exists gcc,no_trampolines] { return 0 } if { [istarget avr-*-*] @@ -504,6 +504,36 @@ proc check_effective_target_trampolines { } { return 1 } +# Return 1 if target has limited stack size. + +proc check_effective_target_stack_size { } { + if [target_info exists gcc,stack_size] { + return 1 + } + return 0 +} + +# Return the value attribute of an effective target, otherwise return 0. + +proc dg-effective-target-value { effective_target } { + if { "$effective_target" == "stack_size" } { + if [check_effective_target_stack_size] { + return [target_info gcc,stack_size] + } + } + + return 0 +} + +# Return 1 if signal.h is supported. + +proc check_effective_target_signal { } { + if [target_info exists gcc,signal_suppress] { + return 0 + } + return 1 +} + # Return 1 if according to target_info struct and explicit target list # target disables -fdelete-null-pointer-checks. Targets should return 0 # if they simply default to -fno-delete-null-pointer-checks but obey @@ -749,14 +779,11 @@ proc check_effective_target_global_constructor {} { # Return 1 if taking label values is supported, 0 otherwise. proc check_effective_target_label_values {} { - if { [istarget nvptx-*-*] } { + if { [istarget nvptx-*-*] || [target_info exists gcc,no_label_values] } { return 0 } - return [check_no_compiler_messages label_values assembly { - #ifdef NO_LABEL_VALUES - #error NO - #endif - }] + + return 1 } # Return 1 if builtin_return_address and builtin_frame_address are @@ -3775,12 +3802,13 @@ proc check_effective_target_arm_fp16_hw { } { # can be selected and a routine to give the flags to select that architecture # Note: Extra flags may be added to disable options from newer compilers # (Thumb in particular - but others may be added in the future). -# -march=armv7ve is special and is handled explicitly after this loop because -# it needs more than one predefine check to identify. +# Warning: Do not use check_effective_target_arm_arch_*_ok for architecture +# extension (eg. ARMv8.1-A) since there is no macro defined for them. See +# how only __ARM_ARCH_8A__ is checked for ARMv8.1-A. # Usage: /* { dg-require-effective-target arm_arch_v5_ok } */ # /* { dg-add-options arm_arch_v5 } */ # /* { dg-require-effective-target arm_arch_v5_multilib } */ -foreach { armfunc armflag armdef } { +foreach { armfunc armflag armdefs } { v4 "-march=armv4 -marm" __ARM_ARCH_4__ v4t "-march=armv4t" __ARM_ARCH_4T__ v5 "-march=armv5 -marm" __ARM_ARCH_5__ @@ -3795,20 +3823,23 @@ foreach { armfunc armflag armdef } { v7r "-march=armv7-r" __ARM_ARCH_7R__ v7m "-march=armv7-m -mthumb" __ARM_ARCH_7M__ v7em "-march=armv7e-m -mthumb" __ARM_ARCH_7EM__ + v7ve "-march=armv7ve -marm" + "__ARM_ARCH_7A__ && __ARM_FEATURE_IDIV" v8a "-march=armv8-a" __ARM_ARCH_8A__ v8_1a "-march=armv8.1a" __ARM_ARCH_8A__ v8_2a "-march=armv8.2a" __ARM_ARCH_8A__ - v8m_base "-march=armv8-m.base -mthumb -mfloat-abi=soft" __ARM_ARCH_8M_BASE__ + v8m_base "-march=armv8-m.base -mthumb -mfloat-abi=soft" + __ARM_ARCH_8M_BASE__ v8m_main "-march=armv8-m.main -mthumb" __ARM_ARCH_8M_MAIN__ } { - eval [string map [list FUNC $armfunc FLAG $armflag DEF $armdef ] { + eval [string map [list FUNC $armfunc FLAG $armflag DEFS $armdefs ] { proc check_effective_target_arm_arch_FUNC_ok { } { if { [ string match "*-marm*" "FLAG" ] && ![check_effective_target_arm_arm_ok] } { return 0 } return [check_no_compiler_messages arm_arch_FUNC_ok assembly { - #if !defined (DEF) - #error !DEF + #if !(DEFS) + #error !(DEFS) #endif } "FLAG" ] } @@ -3829,26 +3860,6 @@ foreach { armfunc armflag armdef } { }] } -# Same functions as above but for -march=armv7ve. To uniquely identify -# -march=armv7ve we need to check for __ARM_ARCH_7A__ as well as -# __ARM_FEATURE_IDIV otherwise it aliases with armv7-a. - -proc check_effective_target_arm_arch_v7ve_ok { } { - if { [ string match "*-marm*" "-march=armv7ve" ] && - ![check_effective_target_arm_arm_ok] } { - return 0 - } - return [check_no_compiler_messages arm_arch_v7ve_ok assembly { - #if !defined (__ARM_ARCH_7A__) || !defined (__ARM_FEATURE_IDIV) - #error !armv7ve - #endif - } "-march=armv7ve" ] -} - -proc add_options_for_arm_arch_v7ve { flags } { - return "$flags -march=armv7ve" -} - # Return 1 if GCC was configured with --with-mode= proc check_effective_target_default_mode { } { |