diff options
Diffstat (limited to 'gcc/testsuite')
2517 files changed, 44291 insertions, 2805 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index daf99d1..e80759b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,4287 @@ +2025-12-09 Robin Dapp <rdapp@ventanamicro.com> + + PR tree-optimization/123074 + * gcc.target/riscv/rvv/rvv.exp: Include *.C. + * gcc.target/riscv/rvv/autovec/pr123074.C: New test. + +2025-12-09 Qing Zhao <qing.zhao@oracle.com> + + PR c/122982 + * gcc.dg/pointer-counted-by-pr122982.c: New test. + +2025-12-09 Pan Li <pan2.li@intel.com> + + * gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i16.c: Add asm check + for vmslt.vx. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i32.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i64.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i8.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i16.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i32.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i64.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i8.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i16.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i32.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i64.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i8.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_binary.h: Add test + helper macros. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_binary_data.h: Add test + data for run test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vmslt-run-1-i16.c: New test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vmslt-run-1-i32.c: New test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vmslt-run-1-i64.c: New test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vmslt-run-1-i8.c: New test. + +2025-12-09 Richard Biener <rguenther@suse.de> + + PR target/121230 + * gcc.target/i386/pr121230.c: New testcase. + +2025-12-09 Nathaniel Shead <nathanieloshead@gmail.com> + + Revert: + 2025-12-09 Nathaniel Shead <nathanieloshead@gmail.com> + + PR c++/122819 + * g++.dg/modules/tpl-friend-22.C: New test. + +2025-12-09 Jakub Jelinek <jakub@redhat.com> + + PR c/123018 + * gcc.dg/pr123018.c: New test. + +2025-12-09 Robin Dapp <rdapp@ventanamicro.com> + + PR tree-optimization/122635 + * gcc.target/aarch64/sve/pfalse-store.c: Expect more elided + stores. + * gcc.target/riscv/rvv/autovec/pr122635-1.c: New test. + * gcc.target/riscv/rvv/autovec/pr122635-2.c: New test. + * gcc.target/powerpc/p9-vec-length-epil-8.c: Expect two lxvl + less. + +2025-12-09 Robin Dapp <rdapp@ventanamicro.com> + + * gcc.target/riscv/rvv/autovec/max-vect-1.c: New test. + * gcc.target/riscv/rvv/autovec/max-vect-2.c: New test. + +2025-12-09 Robin Dapp <rdapp@ventanamicro.com> + + PR target/123022 + * gcc.target/riscv/rvv/autovec/pr123022-2.c: New test. + * gcc.target/riscv/rvv/autovec/pr123022.c: New test. + +2025-12-09 Robin Dapp <rdapp@ventanamicro.com> + + PR target/115325 + * gcc.target/riscv/pragma-target-1.c: New test. + * gcc.target/riscv/pragma-target-2.c: New test. + +2025-12-09 Robin Dapp <rdapp@ventanamicro.com> + + * gcc.target/riscv/rvv/autovec/reduc/reduc-bool-1-run.c: New test. + * gcc.target/riscv/rvv/autovec/reduc/reduc-bool-1.c: New test. + * gcc.target/riscv/rvv/autovec/reduc/reduc-bool-2-run.c: New test. + * gcc.target/riscv/rvv/autovec/reduc/reduc-bool-2.c: New test. + * gcc.target/riscv/rvv/autovec/reduc/reduc-bool-3-run.c: New test. + * gcc.target/riscv/rvv/autovec/reduc/reduc-bool-3.c: New test. + * gcc.target/riscv/rvv/autovec/reduc/reduc-bool-4-run.c: New test. + * gcc.target/riscv/rvv/autovec/reduc/reduc-bool-4.c: New test. + * gcc.target/riscv/rvv/autovec/reduc/reduc-bool-5-run.c: New test. + * gcc.target/riscv/rvv/autovec/reduc/reduc-bool-5.c: New test. + * gcc.target/riscv/rvv/autovec/reduc/reduc-bool-6-run.c: New test. + * gcc.target/riscv/rvv/autovec/reduc/reduc-bool-6.c: New test. + * gcc.target/riscv/rvv/autovec/reduc/reduc-bool-7-run.c: New test. + * gcc.target/riscv/rvv/autovec/reduc/reduc-bool-7.c: New test. + * gcc.target/riscv/rvv/autovec/reduc/reduc-bool-8-run.c: New test. + * gcc.target/riscv/rvv/autovec/reduc/reduc-bool-8.c: New test. + +2025-12-09 Richard Biener <rguenther@suse.de> + + PR target/123027 + * gcc.target/i386/pr123027.c: New testcase. + * gcc.dg/torture/pr123027.c: Likewise. + +2025-12-09 Nathaniel Shead <nathanieloshead@gmail.com> + + PR c++/122819 + * g++.dg/modules/tpl-friend-22.C: New test. + +2025-12-08 Andrew Pinski <andrew.pinski@oss.qualcomm.com> + + PR tree-optimization/46555 + * gcc.dg/tree-ssa/pr46555.c: New test. + +2025-12-08 Harald Anlauf <anlauf@gmx.de> + Steven G. Kargl <kargl@gcc.gnu.org> + + PR fortran/123025 + * gfortran.dg/assumed_charlen_dummy.f90: These tests failed + with the change because of the default -pedantic option + used by the dg.exp mechanisms. Overide this default. + * gfortran.dg/automatic_char_len_1.f90: Ditto. + * gfortran.dg/entry_23.f: Ditto. + * gfortran.dg/finalize_59.f90: Dito. + * gfortran.dg/g77/f90-intrinsic-bit.f: Ditto. + * gfortran.dg/g77/f90-intrinsic-mathematical.f: Ditto. + * gfortran.dg/g77/f90-intrinsic-numeric.f: Ditto. + * gfortran.dg/g77/intrinsic-unix-bessel.f: Ditto. + * gfortran.dg/g77/intrinsic-unix-erf.f: Ditto. + * gfortran.dg/initialization_9.f90: Ditto. + * gfortran.dg/intrinsic_actual_4.f90: Ditto. + * gfortran.dg/namelist_assumed_char.f90: Ditto. + * gfortran.dg/pr15140.f90: Ditto. + +2025-12-08 Egas Ribeiro <egas.g.ribeiro@tecnico.ulisboa.pt> + + PR c++/119343 + * g++.dg/template/sfinae-deleted-pr119343.C: New test. + +2025-12-08 Eric Botcazou <ebotcazou@adacore.com> + + * gcc.dg/tls/data-sections-1.c: New test. + +2025-12-08 Richard Biener <rguenther@suse.de> + + PR tree-optimization/123040 + * g++.dg/torture/pr123040.C: New testcase. + +2025-12-08 Richard Biener <rguenther@suse.de> + + PR tree-optimization/123038 + * gcc.dg/vect/pr123038.c: New testcase. + +2025-12-08 Tamar Christina <tamar.christina@arm.com> + + PR target/123026 + * gcc.target/aarch64/pr123026.c: New test. + +2025-12-08 H.J. Lu <hjl.tools@gmail.com> + + PR target/122343 + * gcc.target/i386/avx2-vpcmpgtq-1.c: Compile with + -fno-fuse-ops-with-volatile-access. + +2025-12-07 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/reduce3.adb: New test. + +2025-12-07 H.J. Lu <hjl.tools@gmail.com> + + PR target/122343 + * gcc.target/i386/20040112-1.c: Add -fomit-frame-pointer and use + check-function-bodies to check for loop. + * gcc.target/i386/avx-ne-convert-1.c: Compile with + -fno-fuse-ops-with-volatile-access. + * gcc.target/i386/avx10_2-bf16-1.c: Likewise. + * gcc.target/i386/avx10_2-convert-1.c: Likewise. + * gcc.target/i386/avx10_2-satcvt-1.c: Likewise. + * gcc.target/i386/avx512bf16-vcvtneps2bf16-1.c: Likewise. + * gcc.target/i386/avx512bf16vl-vcvtneps2bf16-1a.c: Likewise. + * gcc.target/i386/avx512bf16vl-vcvtneps2bf16-1b.c: Likewise. + * gcc.target/i386/avx512bitalg-vpshufbitqmb.c: Likewise. + * gcc.target/i386/avx512bw-vpcmpb-1.c: Likewise. + * gcc.target/i386/avx512bw-vpcmpub-1.c: Likewise. + * gcc.target/i386/avx512bw-vpcmpuw-1.c: Likewise. + * gcc.target/i386/avx512bw-vpcmpw-1.c: Likewise. + * gcc.target/i386/avx512dq-vcvtps2qq-1.c: Likewise. + * gcc.target/i386/avx512dq-vcvtps2uqq-1.c: Likewise. + * gcc.target/i386/avx512dq-vcvtqq2pd-1.c: Likewise. + * gcc.target/i386/avx512dq-vcvtqq2ps-1.c: Likewise. + * gcc.target/i386/avx512dq-vcvttps2qq-1.c: Likewise. + * gcc.target/i386/avx512dq-vcvttps2uqq-1.c: Likewise. + * gcc.target/i386/avx512dq-vcvtuqq2pd-1.c: Likewise. + * gcc.target/i386/avx512dq-vcvtuqq2ps-1.c: Likewise. + * gcc.target/i386/avx512dq-vextractf32x8-1.c: Likewise. + * gcc.target/i386/avx512dq-vextractf64x2-1.c: Likewise. + * gcc.target/i386/avx512dq-vextracti64x2-1.c: Likewise. + * gcc.target/i386/avx512dq-vfpclasspd-1.c: Likewise. + * gcc.target/i386/avx512dq-vfpclassps-1.c: Likewise. + * gcc.target/i386/avx512dq-vfpclasssd-1.c: Likewise. + * gcc.target/i386/avx512dq-vfpclassss-1.c: Likewise. + * gcc.target/i386/avx512dq-vpmullq-1.c: Likewise. + * gcc.target/i386/avx512dq-vpmullq-3.c: Likewise. + * gcc.target/i386/avx512f-pr100267-1.c: Likewise. + * gcc.target/i386/avx512f-vcmppd-1.c: Likewise. + * gcc.target/i386/avx512f-vcmpps-1.c: Likewise. + * gcc.target/i386/avx512f-vcvtps2pd-1.c: Likewise. + * gcc.target/i386/avx512f-vcvtsd2si-1.c: Likewise. + * gcc.target/i386/avx512f-vcvtsd2si64-1.c: Likewise. + * gcc.target/i386/avx512f-vcvtsd2usi-1.c: Likewise. + * gcc.target/i386/avx512f-vcvtsd2usi64-1.c: Likewise. + * gcc.target/i386/avx512f-vcvtsi2ss-1.c: Likewise. + * gcc.target/i386/avx512f-vcvtss2si-1.c: Likewise. + * gcc.target/i386/avx512f-vcvtss2si64-1.c: Likewise. + * gcc.target/i386/avx512f-vcvtss2usi-1.c: Likewise. + * gcc.target/i386/avx512f-vcvtss2usi64-1.c: Likewise. + * gcc.target/i386/avx512f-vcvttsd2si-1.c: Likewise. + * gcc.target/i386/avx512f-vcvttsd2si64-1.c: Likewise. + * gcc.target/i386/avx512f-vcvttsd2usi-1.c: Likewise. + * gcc.target/i386/avx512f-vcvttsd2usi64-1.c: Likewise. + * gcc.target/i386/avx512f-vcvttss2si-1.c: Likewise. + * gcc.target/i386/avx512f-vcvttss2si64-1.c: Likewise. + * gcc.target/i386/avx512f-vcvttss2usi-1.c: Likewise. + * gcc.target/i386/avx512f-vcvttss2usi64-1.c: Likewise. + * gcc.target/i386/avx512f-vextractf32x4-1.c: Likewise. + * gcc.target/i386/avx512f-vextractf64x4-1.c: Likewise. + * gcc.target/i386/avx512f-vextracti64x4-1.c: Likewise. + * gcc.target/i386/avx512f-vmovapd-1.c: Likewise. + * gcc.target/i386/avx512f-vmovaps-1.c: Likewise. + * gcc.target/i386/avx512f-vmovdqa64-1.c: Likewise. + * gcc.target/i386/avx512f-vpandnq-1.c: Likewise. + * gcc.target/i386/avx512f-vpbroadcastd-1.c: Likewise. + * gcc.target/i386/avx512f-vpbroadcastq-1.c: Likewise. + * gcc.target/i386/avx512f-vpcmpd-1.c: Likewise. + * gcc.target/i386/avx512f-vpcmpeqq-1.c: Likewise. + * gcc.target/i386/avx512f-vpcmpequq-1.c: Likewise. + * gcc.target/i386/avx512f-vpcmpged-1.c: Likewise. + * gcc.target/i386/avx512f-vpcmpgeq-1.c: Likewise. + * gcc.target/i386/avx512f-vpcmpgeud-1.c: Likewise. + * gcc.target/i386/avx512f-vpcmpgeuq-1.c: Likewise. + * gcc.target/i386/avx512f-vpcmpled-1.c: Likewise. + * gcc.target/i386/avx512f-vpcmpleq-1.c: Likewise. + * gcc.target/i386/avx512f-vpcmpleud-1.c: Likewise. + * gcc.target/i386/avx512f-vpcmpleuq-1.c: Likewise. + * gcc.target/i386/avx512f-vpcmpltd-1.c: Likewise. + * gcc.target/i386/avx512f-vpcmpltq-1.c: Likewise. + * gcc.target/i386/avx512f-vpcmpltud-1.c: Likewise. + * gcc.target/i386/avx512f-vpcmpltuq-1.c: Likewise. + * gcc.target/i386/avx512f-vpcmpneqd-1.c: Likewise. + * gcc.target/i386/avx512f-vpcmpneqq-1.c: Likewise. + * gcc.target/i386/avx512f-vpcmpnequd-1.c: Likewise. + * gcc.target/i386/avx512f-vpcmpnequq-1.c: Likewise. + * gcc.target/i386/avx512f-vpcmpq-1.c: Likewise. + * gcc.target/i386/avx512f-vpcmpud-1.c: Likewise. + * gcc.target/i386/avx512f-vpcmpuq-1.c: Likewise. + * gcc.target/i386/avx512f-vrndscalepd-1.c: Likewise. + * gcc.target/i386/avx512f-vrndscaleps-1.c: Likewise. + * gcc.target/i386/avx512fp16-complex-fma.c: Likewise. + * gcc.target/i386/avx512fp16-vaddph-1a.c: Likewise. + * gcc.target/i386/avx512fp16-vcvtpd2ph-1a.c: Likewise. + * gcc.target/i386/avx512fp16-vcvtph2dq-1a.c: Likewise. + * gcc.target/i386/avx512fp16-vcvtph2pd-1a.c: Likewise. + * gcc.target/i386/avx512fp16-vcvtph2psx-1a.c: Likewise. + * gcc.target/i386/avx512fp16-vcvtph2qq-1a.c: Likewise. + * gcc.target/i386/avx512fp16-vcvtph2udq-1a.c: Likewise. + * gcc.target/i386/avx512fp16-vcvtph2uqq-1a.c: Likewise. + * gcc.target/i386/avx512fp16-vcvtph2uw-1a.c: Likewise. + * gcc.target/i386/avx512fp16-vcvtph2w-1a.c: Likewise. + * gcc.target/i386/avx512fp16-vcvtps2ph-1a.c: Likewise. + * gcc.target/i386/avx512fp16-vcvtqq2ph-1a.c: Likewise. + * gcc.target/i386/avx512fp16-vcvttph2dq-1a.c: Likewise. + * gcc.target/i386/avx512fp16-vcvttph2qq-1a.c: Likewise. + * gcc.target/i386/avx512fp16-vcvttph2udq-1a.c: Likewise. + * gcc.target/i386/avx512fp16-vcvttph2uqq-1a.c: Likewise. + * gcc.target/i386/avx512fp16-vcvttph2uw-1a.c: Likewise. + * gcc.target/i386/avx512fp16-vcvttph2w-1a.c: Likewise. + * gcc.target/i386/avx512fp16-vcvtuqq2ph-1a.c: Likewise. + * gcc.target/i386/avx512fp16-vfcmaddcph-1a.c: Likewise. + * gcc.target/i386/avx512fp16-vfcmulcph-1a.c: Likewise. + * gcc.target/i386/avx512fp16-vfmaddcph-1a.c: Likewise. + * gcc.target/i386/avx512fp16-vfmulcph-1a.c: Likewise. + * gcc.target/i386/avx512fp16-vfpclassph-1a.c: Likewise. + * gcc.target/i386/avx512fp16-vfpclasssh-1a.c: Likewise. + * gcc.target/i386/avx512fp16-vmulph-1a.c: Likewise. + * gcc.target/i386/avx512fp16-vrcpph-1a.c: Likewise. + * gcc.target/i386/avx512fp16-vrsqrtph-1a.c: Likewise. + * gcc.target/i386/avx512fp16-vsqrtph-1a.c: Likewise. + * gcc.target/i386/avx512fp16vl-vaddph-1a.c: Likewise. + * gcc.target/i386/avx512fp16vl-vcvtpd2ph-1a.c: Likewise. + * gcc.target/i386/avx512fp16vl-vcvtph2dq-1a.c: Likewise. + * gcc.target/i386/avx512fp16vl-vcvtph2psx-1a.c: Likewise. + * gcc.target/i386/avx512fp16vl-vcvtph2qq-1a.c: Likewise. + * gcc.target/i386/avx512fp16vl-vcvtph2udq-1a.c: Likewise. + * gcc.target/i386/avx512fp16vl-vcvtph2uqq-1a.c: Likewise. + * gcc.target/i386/avx512fp16vl-vcvtph2uw-1a.c: Likewise. + * gcc.target/i386/avx512fp16vl-vcvtph2w-1a.c: Likewise. + * gcc.target/i386/avx512fp16vl-vcvtps2ph-1a.c: Likewise. + * gcc.target/i386/avx512fp16vl-vcvtqq2ph-1a.c: Likewise. + * gcc.target/i386/avx512fp16vl-vcvttph2dq-1a.c: Likewise. + * gcc.target/i386/avx512fp16vl-vcvttph2udq-1a.c: Likewise. + * gcc.target/i386/avx512fp16vl-vcvttph2uw-1a.c: Likewise. + * gcc.target/i386/avx512fp16vl-vcvttph2w-1a.c: Likewise. + * gcc.target/i386/avx512fp16vl-vcvtuqq2ph-1a.c: Likewise. + * gcc.target/i386/avx512fp16vl-vfcmaddcph-1a.c: Likewise. + * gcc.target/i386/avx512fp16vl-vfcmulcph-1a.c: Likewise. + * gcc.target/i386/avx512fp16vl-vfmaddcph-1a.c: Likewise. + * gcc.target/i386/avx512fp16vl-vfmulcph-1a.c: Likewise. + * gcc.target/i386/avx512fp16vl-vfpclassph-1a.c: Likewise. + * gcc.target/i386/avx512fp16vl-vmulph-1a.c: Likewise. + * gcc.target/i386/avx512fp16vl-vrcpph-1a.c: Likewise. + * gcc.target/i386/avx512fp16vl-vrsqrtph-1a.c: Likewise. + * gcc.target/i386/avx512fp16vl-vsqrtph-1a.c: Likewise. + * gcc.target/i386/avx512vl-pr100267-1.c: Likewise. + * gcc.target/i386/avx512vl-vcmppd-1.c: Likewise. + * gcc.target/i386/avx512vl-vcmpps-1.c: Likewise. + * gcc.target/i386/avx512vl-vcvtpd2ps-1.c: Likewise. + * gcc.target/i386/avx512vl-vcvtpd2udq-1.c: Likewise. + * gcc.target/i386/avx512vl-vcvttpd2udq-1.c: Likewise. + * gcc.target/i386/avx512vl-vcvttps2udq-1.c: Likewise. + * gcc.target/i386/avx512vl-vextractf32x4-1.c: Likewise. + * gcc.target/i386/avx512vl-vmovapd-1.c: Likewise. + * gcc.target/i386/avx512vl-vmovaps-1.c: Likewise. + * gcc.target/i386/avx512vl-vmovdqa64-1.c: Likewise. + * gcc.target/i386/avx512vl-vpcmpd-1.c: Likewise. + * gcc.target/i386/avx512vl-vpcmpeqq-1.c: Likewise. + * gcc.target/i386/avx512vl-vpcmpequq-1.c: Likewise. + * gcc.target/i386/avx512vl-vpcmpq-1.c: Likewise. + * gcc.target/i386/avx512vl-vpcmpud-1.c: Likewise. + * gcc.target/i386/avx512vl-vpcmpuq-1.c: Likewise. + * gcc.target/i386/pr122343-1a.c: New test. + * gcc.target/i386/pr122343-1b.c: Likewise. + * gcc.target/i386/pr122343-2a.c: Likewise. + * gcc.target/i386/pr122343-2b.c: Likewise. + * gcc.target/i386/pr122343-3.c: Likewise. + * gcc.target/i386/pr122343-4a.c: Likewise. + * gcc.target/i386/pr122343-4b.c: Likewise. + * gcc.target/i386/pr122343-5a.c: Likewise. + * gcc.target/i386/pr122343-5b.c: Likewise. + * gcc.target/i386/pr122343-6a.c: Likewise. + * gcc.target/i386/pr122343-6b.c: Likewise. + * gcc.target/i386/pr122343-7.c: Likewise. + +2025-12-06 Alexandre Oliva <oliva@adacore.com> + + PR rtl-optimization/122947 + * gcc.dg/pr122947.c: New. + +2025-12-06 Alexandre Oliva <oliva@adacore.com> + + PR target/91420 + * gcc.target/riscv/pr91420.c: New. + +2025-12-06 Jeff Law <jlaw@ventanamicro.com> + + PR rtl-optimization/122675 + * gcc.target/riscv/pr122675-1.c: Adjust expected output. + +2025-12-06 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/103414 + * gfortran.dg/pdt_76.f03: New test. + +2025-12-06 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/122693 + * gfortran.dg/pdt_75.f03: New test. + +2025-12-06 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/122670 + * gfortran.dg/pdt_74.f03: New test. + +2025-12-06 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/122669 + * gfortran.dg/pdt_73.f03: New test. + +2025-12-06 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/122578 + * gfortran.dg/pdt_72.f03: New test. + +2025-12-06 Dimitar Dimitrov <dimitar@dinux.eu> + + PR rtl-optimization/122675 + * gcc.target/aarch64/pr122675-1.c: New test. + * gcc.target/i386/pr122675-1.c: New test. + * gcc.target/riscv/pr122675-1.c: New test. + +2025-12-06 Jakub Jelinek <jakub@redhat.com> + + PR middle-end/99782 + * gcc.dg/torture/pr99782-1.c: Fix typo, dg-compile -> dg-do compile. + Use int128 effective target directly on that directive. Move PR + comment first. + +2025-12-05 Andrew Pinski <andrew.pinski@oss.qualcomm.com> + + * gcc.dg/torture/pr99782-1.c: Require intt128 target. + +2025-12-05 Vladimir N. Makarov <vmakarov@redhat.com> + + PR rtl-optimization/122215 + * gcc.target/riscv/pr122215.c: New. + * lib/target-supports.exp (check_effective_target_valgrind): New. + +2025-12-05 Harald Anlauf <anlauf@gmx.de> + + PR fortran/122977 + * gfortran.dg/contiguous_16.f90: New test. + +2025-12-05 Tobias Burnus <tburnus@baylibre.com> + + * gfortran.dg/gomp/dyn_groupprivate-1.f90: Fix + scan-tree-dump-times regexp to avoid hard-coded 'D.4680'. + +2025-12-05 Richard Biener <rguenther@suse.de> + + PR tree-optimization/120939 + * gcc.dg/torture/pr113026-1.c: Skip when -ftracer. + +2025-12-05 Richard Biener <rguenther@suse.de> + + PR tree-optimization/123002 + * gcc.dg/vect/vect-pr123002.c: Make global data non-const + and non-static. + +2025-12-05 Denis Mazzucato <mazzucato@adacore.com> + + * gnat.dg/reduce1.adb: Adjust expected error message. + +2025-12-05 Richard Biener <rguenther@suse.de> + + PR tree-optimization/123002 + * gcc.dg/vect/vect-pr123002.c: New testcase. + +2025-12-05 Richard Biener <rguenther@suse.de> + + * gcc.dg/gimplefe-58.c: New testcase. + +2025-12-05 Tobias Burnus <tburnus@baylibre.com> + + * gfortran.dg/gomp/dyn_groupprivate-1.f90: Add scan-dump test. + * gfortran.dg/gomp/dyn_groupprivate-2.f90: Extend and update. + * c-c++-common/gomp/dyn_groupprivate-1.c: New test. + * c-c++-common/gomp/dyn_groupprivate-2.c: New test. + +2025-12-05 Richard Biener <rguenther@suse.de> + + PR tree-optimization/122776 + * gcc.dg/vect/vect-simd-clone-24.c: Add -mprefer-vector-width=512. + +2025-12-05 Andrew Pinski <andrew.pinski@oss.qualcomm.com> + + PR middle-end/99782 + * gcc.dg/torture/pr99782-1.c: New test. + +2025-12-05 Daniel Barboza <dbarboza@ventanamicro.com> + Jeff Law <jlaw@ventanamicro.com> + + * gcc.dg/torture/pr122615.c: New test. + * gcc.dg/torture/pr122616.c: Likewise. + +2025-12-05 Pan Li <pan2.li@intel.com> + + * gcc.target/riscv/rvv/autovec/vx_vf/vx-1-u16.c: Add asm check + for vmsltu.vx. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-1-u32.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-1-u64.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-1-u8.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-2-u16.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-2-u32.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-2-u64.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-2-u8.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-3-u16.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-3-u32.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-3-u64.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-3-u8.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_binary.h: Add test + helper macros. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_binary_data.h: Add test + data for run test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsltu-run-1-u16.c: New test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsltu-run-1-u32.c: New test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsltu-run-1-u64.c: New test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsltu-run-1-u8.c: New test. + +2025-12-04 Richard Biener <rguenther@suse.de> + + PR tree-optimization/122776 + * gcc.dg/vect/vect-simd-clone-24.c: New testcase. + * gcc.dg/gomp/pr110485.c: Adjust. + +2025-12-04 Martin Jambor <mjambor@suse.cz> + + * gcc.dg/tree-ssa/vrp-from-cst-agg-1.c: New test. + * gcc.dg/tree-ssa/vrp-from-cst-agg-2.c: Likewise. + * gcc.dg/tree-ssa/vrp-from-cst-agg-3.c: Likewise. + * gcc.dg/tree-ssa/vrp-from-cst-agg-4.c: Likewise. + * gcc.dg/tree-ssa/vrp-from-cst-agg-5.c: Likewise. + * gcc.dg/tree-ssa/vrp-from-cst-agg-6.c: Likewise. + * gcc.dg/tree-ssa/vrp-from-cst-agg-7.c: Likewise. + * gcc.dg/ipa/vrp-from-cst-agg-1.c: Likewise. + +2025-12-04 Stefan Schulze Frielinghaus <stefansf@gcc.gnu.org> + + * gcc.dg/asm-hard-reg-9.c: Restrict to lp64 x86_64. + +2025-12-04 Jakub Jelinek <jakub@redhat.com> + + PR target/122991 + * gcc.dg/pr122991.c: New test. + +2025-12-04 Jakub Jelinek <jakub@redhat.com> + + PR target/122983 + * g++.dg/cpp26/decomp18.C: Add dg-add-options tls and + dg-require-effective-target tls_runtime directives. + +2025-12-04 Stefan Schulze Frielinghaus <stefansf@gcc.gnu.org> + + * gcc.dg/asm-hard-reg-9.c: New test. + +2025-12-03 Joseph Myers <josmyers@redhat.com> + + * lib/gcc-defs.exp (handle-dg-regexps): Also escape \r in output. + +2025-12-03 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/122943 + * gcc.c-torture/execute/pr122943.c: New test. + +2025-12-03 Andrew MacLeod <amacleod@redhat.com> + + PR tree-optimization/122898 + * gcc.dg/pr122898.c: New. + +2025-12-03 Tamar Christina <tamar.christina@arm.com> + + PR tree-optimization/122969 + * gcc.dg/vect/pr122969.c: New test. + +2025-12-03 Mathias Krause <minipli@grsecurity.net> + + * gcc.target/i386/nop-mcount-m16.c: New test. + * gcc.target/i386/nop-mcount.c: Adapt to test for 5-byte NOP. + +2025-12-03 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> + + * rust/compile/lang_feature_gate.rs: New test. + +2025-12-03 Owen Avery <powerboat9.gamer@gmail.com> + + * rust/core/core.exp: Change -frust-compile-until=astvalidation + to -frust-compile-until=nameresolution. + +2025-12-03 Raiki Tamura <tamaron1203@gmail.com> + + * rust/borrowck/reference.rs: Add attributes. + * rust/borrowck/tmp.rs: Likewise. + * rust/compile/additional-trait-bounds1.rs: Likewise. + * rust/compile/additional-trait-bounds2.rs: Likewise. + * rust/compile/additional-trait-bounds2nr2.rs: Likewise. + * rust/compile/auto_traits1.rs: Likewise. + * rust/compile/auto_traits2.rs: Likewise. + * rust/compile/bad-rpit1.rs: Likewise. + * rust/compile/black_box.rs: Likewise. + * rust/compile/bounds1.rs: Likewise. + * rust/compile/box_syntax_feature_gate.rs: Likewise. + * rust/compile/bug-with-default-generic.rs: Likewise. + * rust/compile/canonical_paths1.rs: Likewise. + * rust/compile/cast_generics.rs: Likewise. + * rust/compile/closure_no_type_anno.rs: Likewise. + * rust/compile/cmp1.rs: Likewise. + * rust/compile/complex_qualified_path_in_expr.rs: Likewise. + * rust/compile/const-issue1440.rs: Likewise. + * rust/compile/const_generics_1.rs: Likewise. + * rust/compile/const_generics_10.rs: Likewise. + * rust/compile/const_generics_11.rs: Likewise. + * rust/compile/const_generics_12.rs: Likewise. + * rust/compile/const_generics_13.rs: Likewise. + * rust/compile/const_generics_14.rs: Likewise. + * rust/compile/const_generics_15.rs: Likewise. + * rust/compile/const_generics_16.rs: Likewise. + * rust/compile/const_generics_18.rs: Likewise. + * rust/compile/const_generics_19.rs: Likewise. + * rust/compile/const_generics_3.rs: Likewise. + * rust/compile/const_generics_8.rs: Likewise. + * rust/compile/const_generics_9.rs: Likewise. + * rust/compile/derive-debug1.rs: Likewise. + * rust/compile/derive-default1.rs: Likewise. + * rust/compile/derive-eq-invalid.rs: Likewise. + * rust/compile/derive-hash1.rs: Likewise. + * rust/compile/derive-partialeq1.rs: Likewise. + * rust/compile/derive_clone_enum1.rs: Likewise. + * rust/compile/derive_clone_enum2.rs: Likewise. + * rust/compile/derive_clone_enum3.rs: Likewise. + * rust/compile/derive_macro1.rs: Likewise. + * rust/compile/derive_macro3.rs: Likewise. + * rust/compile/derive_macro4.rs: Likewise. + * rust/compile/derive_macro6.rs: Likewise. + * rust/compile/derive_partial_ord1.rs: Likewise. + * rust/compile/expand_macro_qual_path_in_type.rs: Likewise. + * rust/compile/expected_type_args2.rs: Likewise. + * rust/compile/expected_type_args3.rs: Likewise. + * rust/compile/extern_generics.rs: Likewise. + * rust/compile/for-loop1.rs: Likewise. + * rust/compile/for-loop2.rs: Likewise. + * rust/compile/format_args_basic_expansion.rs: Likewise. + * rust/compile/format_args_concat.rs: Likewise. + * rust/compile/format_args_extra_comma.rs: Likewise. + * rust/compile/generics1.rs: Likewise. + * rust/compile/generics11.rs: Likewise. + * rust/compile/generics12.rs: Likewise. + * rust/compile/generics2.rs: Likewise. + * rust/compile/generics3.rs: Likewise. + * rust/compile/generics4.rs: Likewise. + * rust/compile/generics6.rs: Likewise. + * rust/compile/generics7.rs: Likewise. + * rust/compile/generics8.rs: Likewise. + * rust/compile/if_let_expr.rs: Likewise. + * rust/compile/impl_fnptr.rs: Likewise. + * rust/compile/impl_trait_diag.rs: Likewise. + * rust/compile/impl_trait_generic_arg.rs: Likewise. + * rust/compile/issue-1005.rs: Likewise. + * rust/compile/issue-1019.rs: Likewise. + * rust/compile/issue-1031.rs: Likewise. + * rust/compile/issue-1034.rs: Likewise. + * rust/compile/issue-1128.rs: Likewise. + * rust/compile/issue-1129-2.rs: Likewise. + * rust/compile/issue-1130.rs: Likewise. + * rust/compile/issue-1131.rs: Likewise. + * rust/compile/issue-1165.rs: Likewise. + * rust/compile/issue-1173.rs: Likewise. + * rust/compile/issue-1235.rs: Likewise. + * rust/compile/issue-1237.rs: Likewise. + * rust/compile/issue-1289.rs: Likewise. + * rust/compile/issue-1383.rs: Likewise. + * rust/compile/issue-1447.rs: Likewise. + * rust/compile/issue-1483.rs: Likewise. + * rust/compile/issue-1485.rs: Likewise. + * rust/compile/issue-1487.rs: Likewise. + * rust/compile/issue-1589.rs: Likewise. + * rust/compile/issue-1725-1.rs: Likewise. + * rust/compile/issue-1725-2.rs: Likewise. + * rust/compile/issue-1786.rs: Likewise. + * rust/compile/issue-1893.rs: Likewise. + * rust/compile/issue-1901.rs: Likewise. + * rust/compile/issue-1930.rs: Likewise. + * rust/compile/issue-1981.rs: Likewise. + * rust/compile/issue-2015.rs: Likewise. + * rust/compile/issue-2019-1.rs: Likewise. + * rust/compile/issue-2019-2.rs: Likewise. + * rust/compile/issue-2019-3.rs: Likewise. + * rust/compile/issue-2036.rs: Likewise. + * rust/compile/issue-2037.rs: Likewise. + * rust/compile/issue-2070.rs: Likewise. + * rust/compile/issue-2105.rs: Likewise. + * rust/compile/issue-2106.rs: Likewise. + * rust/compile/issue-2135.rs: Likewise. + * rust/compile/issue-2136-1.rs: Likewise. + * rust/compile/issue-2136-2.rs: Likewise. + * rust/compile/issue-2139.rs: Likewise. + * rust/compile/issue-2142.rs: Likewise. + * rust/compile/issue-2165.rs: Likewise. + * rust/compile/issue-2166.rs: Likewise. + * rust/compile/issue-2190-1.rs: Likewise. + * rust/compile/issue-2190-2.rs: Likewise. + * rust/compile/issue-2195.rs: Likewise. + * rust/compile/issue-2238.rs: Likewise. + * rust/compile/issue-2304.rs: Likewise. + * rust/compile/issue-2323.rs: Likewise. + * rust/compile/issue-2330.rs: Likewise. + * rust/compile/issue-2369.rs: Likewise. + * rust/compile/issue-2375.rs: Likewise. + * rust/compile/issue-2478.rs: Likewise. + * rust/compile/issue-2499.rs: Likewise. + * rust/compile/issue-2723-1.rs: Likewise. + * rust/compile/issue-2723-2.rs: Likewise. + * rust/compile/issue-2725.rs: Likewise. + * rust/compile/issue-2747.rs: Likewise. + * rust/compile/issue-2772-1.rs: Likewise. + * rust/compile/issue-2772-2.rs: Likewise. + * rust/compile/issue-2775.rs: Likewise. + * rust/compile/issue-2782.rs: Likewise. + * rust/compile/issue-2907.rs: Likewise. + * rust/compile/issue-2951.rs: Likewise. + * rust/compile/issue-2953-1.rs: Likewise. + * rust/compile/issue-2953-2.rs: Likewise. + * rust/compile/issue-2954.rs: Likewise. + * rust/compile/issue-2987.rs: Likewise. + * rust/compile/issue-3009.rs: Likewise. + * rust/compile/issue-3022.rs: Likewise. + * rust/compile/issue-3030.rs: Likewise. + * rust/compile/issue-3032-1.rs: Likewise. + * rust/compile/issue-3032-2.rs: Likewise. + * rust/compile/issue-3033.rs: Likewise. + * rust/compile/issue-3035.rs: Likewise. + * rust/compile/issue-3036.rs: Likewise. + * rust/compile/issue-3045-1.rs: Likewise. + * rust/compile/issue-3045-2.rs: Likewise. + * rust/compile/issue-3144.rs: Likewise. + * rust/compile/issue-3242.rs: Likewise. + * rust/compile/issue-3304.rs: Likewise. + * rust/compile/issue-3382.rs: Likewise. + * rust/compile/issue-3402-1.rs: Likewise. + * rust/compile/issue-3402-2.rs: Likewise. + * rust/compile/issue-3403.rs: Likewise. + * rust/compile/issue-3454.rs: Likewise. + * rust/compile/issue-3551.rs: Likewise. + * rust/compile/issue-3554-2.rs: Likewise. + * rust/compile/issue-3599.rs: Likewise. + * rust/compile/issue-3642.rs: Likewise. + * rust/compile/issue-3711.rs: Likewise. + * rust/compile/issue-3836.rs: Likewise. + * rust/compile/issue-3898.rs: Likewise. + * rust/compile/issue-3915.rs: Likewise. + * rust/compile/issue-3916.rs: Likewise. + * rust/compile/issue-3969.rs: Likewise. + * rust/compile/issue-402.rs: Likewise. + * rust/compile/issue-4090-1.rs: Likewise. + * rust/compile/issue-4090-2.rs: Likewise. + * rust/compile/issue-850.rs: Likewise. + * rust/compile/issue-855.rs: Likewise. + * rust/compile/issue-925.rs: Likewise. + * rust/compile/iterators1.rs: Likewise. + * rust/compile/macros/builtin/option_env1.rs: Likewise. + * rust/compile/macros/builtin/option_env2.rs: Likewise. + * rust/compile/macros/builtin/option_env3.rs: Likewise. + * rust/compile/macros/mbe/macro-issue1400.rs: Likewise. + * rust/compile/macros/mbe/macro-issue3708.rs: Likewise. + * rust/compile/macros/mbe/macro-issue3709-2.rs: Likewise. + * rust/compile/macros/mbe/macro20.rs: Likewise. + * rust/compile/macros/mbe/macro23.rs: Likewise. + * rust/compile/macros/mbe/macro40.rs: Likewise. + * rust/compile/macros/mbe/macro49.rs: Likewise. + * rust/compile/macros/mbe/macro54.rs: Likewise. + * rust/compile/multiple_bindings1.rs: Likewise. + * rust/compile/name_resolution2.rs: Likewise. + * rust/compile/name_resolution4.rs: Likewise. + * rust/compile/nested_generic.rs: Likewise. + * rust/compile/parse_associated_type_as_generic_arg.rs: Likewise. + * rust/compile/parse_associated_type_as_generic_arg2.rs: Likewise. + * rust/compile/parse_associated_type_as_generic_arg3.rs: Likewise. + * rust/compile/parse_closure_bind.rs: Likewise. + * rust/compile/parse_complex_generic_application.rs: Likewise. + * rust/compile/parse_complex_generic_application2.rs: Likewise. + * rust/compile/path_as_generic_arg.rs: Likewise. + * rust/compile/privacy4.rs: Likewise. + * rust/compile/privacy6.rs: Likewise. + * rust/compile/silly-order-bug.rs: Likewise. + * rust/compile/sizeof-stray-infer-var-bug.rs: Likewise. + * rust/compile/stmt_with_block_dot.rs: Likewise. + * rust/compile/structural-eq-peq.rs: Likewise. + * rust/compile/torture/associated_types1.rs: Likewise. + * rust/compile/torture/forward_decl_5.rs: Likewise. + * rust/compile/torture/generics1.rs: Likewise. + * rust/compile/torture/generics10.rs: Likewise. + * rust/compile/torture/generics11.rs: Likewise. + * rust/compile/torture/generics12.rs: Likewise. + * rust/compile/torture/generics13.rs: Likewise. + * rust/compile/torture/generics14.rs: Likewise. + * rust/compile/torture/generics15.rs: Likewise. + * rust/compile/torture/generics16.rs: Likewise. + * rust/compile/torture/generics17.rs: Likewise. + * rust/compile/torture/generics18.rs: Likewise. + * rust/compile/torture/generics19.rs: Likewise. + * rust/compile/torture/generics2.rs: Likewise. + * rust/compile/torture/generics20.rs: Likewise. + * rust/compile/torture/generics21.rs: Likewise. + * rust/compile/torture/generics22.rs: Likewise. + * rust/compile/torture/generics23.rs: Likewise. + * rust/compile/torture/generics24.rs: Likewise. + * rust/compile/torture/generics25.rs: Likewise. + * rust/compile/torture/generics26.rs: Likewise. + * rust/compile/torture/generics27.rs: Likewise. + * rust/compile/torture/generics28.rs: Likewise. + * rust/compile/torture/generics29.rs: Likewise. + * rust/compile/torture/generics3.rs: Likewise. + * rust/compile/torture/generics30.rs: Likewise. + * rust/compile/torture/generics31.rs: Likewise. + * rust/compile/torture/generics32.rs: Likewise. + * rust/compile/torture/generics4.rs: Likewise. + * rust/compile/torture/generics5.rs: Likewise. + * rust/compile/torture/generics6.rs: Likewise. + * rust/compile/torture/generics7.rs: Likewise. + * rust/compile/torture/generics8.rs: Likewise. + * rust/compile/torture/generics9.rs: Likewise. + * rust/compile/torture/intrinsics-2.rs: Likewise. + * rust/compile/torture/intrinsics-4.rs: Likewise. + * rust/compile/torture/intrinsics-5.rs: Likewise. + * rust/compile/torture/intrinsics-6.rs: Likewise. + * rust/compile/torture/intrinsics-7.rs: Likewise. + * rust/compile/torture/intrinsics-8.rs: Likewise. + * rust/compile/torture/issue-1024.rs: Likewise. + * rust/compile/torture/issue-1075.rs: Likewise. + * rust/compile/torture/issue-1432.rs: Likewise. + * rust/compile/torture/issue-1555.rs: Likewise. + * rust/compile/torture/issue-368.rs: Likewise. + * rust/compile/torture/issue-808.rs: Likewise. + * rust/compile/torture/issue-862.rs: Likewise. + * rust/compile/torture/issue-893-2.rs: Likewise. + * rust/compile/torture/issue-893.rs: Likewise. + * rust/compile/torture/must_use2.rs: Likewise. + * rust/compile/torture/nested_fn2.rs: Likewise. + * rust/compile/torture/phantom_data.rs: Likewise. + * rust/compile/torture/range-lang-item1.rs: Likewise. + * rust/compile/torture/traits1.rs: Likewise. + * rust/compile/torture/traits10.rs: Likewise. + * rust/compile/torture/traits11.rs: Likewise. + * rust/compile/torture/traits12.rs: Likewise. + * rust/compile/torture/traits13.rs: Likewise. + * rust/compile/torture/traits14.rs: Likewise. + * rust/compile/torture/traits15.rs: Likewise. + * rust/compile/torture/traits16.rs: Likewise. + * rust/compile/torture/traits17.rs: Likewise. + * rust/compile/torture/traits18.rs: Likewise. + * rust/compile/torture/traits19.rs: Likewise. + * rust/compile/torture/traits2.rs: Likewise. + * rust/compile/torture/traits3.rs: Likewise. + * rust/compile/torture/traits4.rs: Likewise. + * rust/compile/torture/traits5.rs: Likewise. + * rust/compile/torture/traits6.rs: Likewise. + * rust/compile/torture/traits7.rs: Likewise. + * rust/compile/torture/traits8.rs: Likewise. + * rust/compile/torture/traits9.rs: Likewise. + * rust/compile/torture/transmute-size-check-1.rs: Likewise. + * rust/compile/torture/transmute1.rs: Likewise. + * rust/compile/torture/uninit-intrinsic-1.rs: Likewise. + * rust/compile/torture/utf8_identifiers.rs: Likewise. + * rust/compile/traits1.rs: Likewise. + * rust/compile/traits10.rs: Likewise. + * rust/compile/traits11.rs: Likewise. + * rust/compile/traits12.rs: Likewise. + * rust/compile/traits2.rs: Likewise. + * rust/compile/traits3.rs: Likewise. + * rust/compile/traits4.rs: Likewise. + * rust/compile/traits5.rs: Likewise. + * rust/compile/traits6.rs: Likewise. + * rust/compile/traits7.rs: Likewise. + * rust/compile/traits8.rs: Likewise. + * rust/compile/traits9.rs: Likewise. + * rust/compile/try-expr1.rs: Likewise. + * rust/compile/try-trait.rs: Likewise. + * rust/compile/try_block1.rs: Likewise. + * rust/compile/type-bindings1.rs: Likewise. + * rust/compile/unconstrained_type_param.rs: Likewise. + * rust/compile/unify-errors1.rs: Likewise. + * rust/compile/unsafe10.rs: Likewise. + * rust/compile/v0-mangle1.rs: Likewise. + * rust/compile/v0-mangle2.rs: Likewise. + * rust/compile/while_let1.rs: Likewise. + * rust/execute/black_box.rs: Likewise. + * rust/execute/torture/atomic_load.rs: Likewise. + * rust/execute/torture/atomic_store.rs: Likewise. + * rust/execute/torture/basic_partial_ord1.rs: Likewise. + * rust/execute/torture/basic_partial_ord2.rs: Likewise. + * rust/execute/torture/builtin_macro_option_env.rs: Likewise. + * rust/execute/torture/closure1.rs: Likewise. + * rust/execute/torture/closure2.rs: Likewise. + * rust/execute/torture/closure3.rs: Likewise. + * rust/execute/torture/closure4.rs: Likewise. + * rust/execute/torture/coercion1.rs: Likewise. + * rust/execute/torture/coercion2.rs: Likewise. + * rust/execute/torture/coercion3.rs: Likewise. + * rust/execute/torture/const-generics-1.rs: Likewise. + * rust/execute/torture/const-generics-2.rs: Likewise. + * rust/execute/torture/const-generics-3.rs: Likewise. + * rust/execute/torture/const-generics-4.rs: Likewise. + * rust/execute/torture/const-generics-5.rs: Likewise. + * rust/execute/torture/const-generics-6.rs: Likewise. + * rust/execute/torture/const-generics-7.rs: Likewise. + * rust/execute/torture/copy_nonoverlapping1.rs: Likewise. + * rust/execute/torture/derive-default1.rs: Likewise. + * rust/execute/torture/derive-partialeq1.rs: Likewise. + * rust/execute/torture/derive-partialeq2.rs: Likewise. + * rust/execute/torture/derive_clone_enum1.rs: Likewise. + * rust/execute/torture/derive_macro1.rs: Likewise. + * rust/execute/torture/derive_macro3.rs: Likewise. + * rust/execute/torture/derive_macro4.rs: Likewise. + * rust/execute/torture/enum_intrinsics1.rs: Likewise. + * rust/execute/torture/enum_intrinsics2.rs: Likewise. + * rust/execute/torture/for-loop1.rs: Likewise. + * rust/execute/torture/for-loop2.rs: Likewise. + * rust/execute/torture/gat1.rs: Likewise. + * rust/execute/torture/impl_desugar-2.rs: Likewise. + * rust/execute/torture/impl_desugar.rs: Likewise. + * rust/execute/torture/impl_rpit1.rs: Likewise. + * rust/execute/torture/impl_rpit2.rs: Likewise. + * rust/execute/torture/impl_rpit3.rs: Likewise. + * rust/execute/torture/impl_trait1.rs: Likewise. + * rust/execute/torture/impl_trait2.rs: Likewise. + * rust/execute/torture/impl_trait3.rs: Likewise. + * rust/execute/torture/impl_trait4.rs: Likewise. + * rust/execute/torture/index1.rs: Likewise. + * rust/execute/torture/issue-1120.rs: Likewise. + * rust/execute/torture/issue-1133.rs: Likewise. + * rust/execute/torture/issue-1198.rs: Likewise. + * rust/execute/torture/issue-1232.rs: Likewise. + * rust/execute/torture/issue-1249.rs: Likewise. + * rust/execute/torture/issue-1436.rs: Likewise. + * rust/execute/torture/issue-1481.rs: Likewise. + * rust/execute/torture/issue-1482.rs: Likewise. + * rust/execute/torture/issue-1496.rs: Likewise. + * rust/execute/torture/issue-1720-2.rs: Likewise. + * rust/execute/torture/issue-1720.rs: Likewise. + * rust/execute/torture/issue-2005.rs: Likewise. + * rust/execute/torture/issue-2052.rs: Likewise. + * rust/execute/torture/issue-2179.rs: Likewise. + * rust/execute/torture/issue-2180.rs: Likewise. + * rust/execute/torture/issue-2236.rs: Likewise. + * rust/execute/torture/issue-2583.rs: Likewise. + * rust/execute/torture/issue-3126.rs: Likewise. + * rust/execute/torture/issue-3381.rs: Likewise. + * rust/execute/torture/issue-3502.rs: Likewise. + * rust/execute/torture/issue-3836.rs: Likewise. + * rust/execute/torture/issue-647.rs: Likewise. + * rust/execute/torture/issue-845.rs: Likewise. + * rust/execute/torture/issue-851.rs: Likewise. + * rust/execute/torture/issue-858.rs: Likewise. + * rust/execute/torture/iter1.rs: Likewise. + * rust/execute/torture/macros23.rs: Likewise. + * rust/execute/torture/macros28.rs: Likewise. + * rust/execute/torture/method2.rs: Likewise. + * rust/execute/torture/method3.rs: Likewise. + * rust/execute/torture/method4.rs: Likewise. + * rust/execute/torture/min_specialization2.rs: Likewise. + * rust/execute/torture/min_specialization3.rs: Likewise. + * rust/execute/torture/operator_overload_1.rs: Likewise. + * rust/execute/torture/operator_overload_10.rs: Likewise. + * rust/execute/torture/operator_overload_11.rs: Likewise. + * rust/execute/torture/operator_overload_12.rs: Likewise. + * rust/execute/torture/operator_overload_2.rs: Likewise. + * rust/execute/torture/operator_overload_3.rs: Likewise. + * rust/execute/torture/operator_overload_4.rs: Likewise. + * rust/execute/torture/operator_overload_5.rs: Likewise. + * rust/execute/torture/operator_overload_6.rs: Likewise. + * rust/execute/torture/operator_overload_7.rs: Likewise. + * rust/execute/torture/operator_overload_8.rs: Likewise. + * rust/execute/torture/operator_overload_9.rs: Likewise. + * rust/execute/torture/partial-eq-1.rs: Likewise. + * rust/execute/torture/partial-eq-2.rs: Likewise. + * rust/execute/torture/partial-eq-3.rs: Likewise. + * rust/execute/torture/partial-eq-4.rs: Likewise. + * rust/execute/torture/partial-ord-1.rs: Likewise. + * rust/execute/torture/partial-ord-2.rs: Likewise. + * rust/execute/torture/partial-ord-3.rs: Likewise. + * rust/execute/torture/partial-ord-4.rs: Likewise. + * rust/execute/torture/partial-ord-5.rs: Likewise. + * rust/execute/torture/partial-ord-6.rs: Likewise. + * rust/execute/torture/prefetch_data.rs: Likewise. + * rust/execute/torture/ref-pattern2.rs: Likewise. + * rust/execute/torture/sip-hasher.rs: Likewise. + * rust/execute/torture/slice-magic.rs: Likewise. + * rust/execute/torture/slice-magic2.rs: Likewise. + * rust/execute/torture/slice1.rs: Likewise. + * rust/execute/torture/str-layout1.rs: Likewise. + * rust/execute/torture/trait1.rs: Likewise. + * rust/execute/torture/trait10.rs: Likewise. + * rust/execute/torture/trait11.rs: Likewise. + * rust/execute/torture/trait12.rs: Likewise. + * rust/execute/torture/trait13.rs: Likewise. + * rust/execute/torture/trait14.rs: Likewise. + * rust/execute/torture/trait15.rs: Likewise. + * rust/execute/torture/trait2.rs: Likewise. + * rust/execute/torture/trait3.rs: Likewise. + * rust/execute/torture/trait4.rs: Likewise. + * rust/execute/torture/trait5.rs: Likewise. + * rust/execute/torture/trait6.rs: Likewise. + * rust/execute/torture/trait7.rs: Likewise. + * rust/execute/torture/trait8.rs: Likewise. + * rust/execute/torture/trait9.rs: Likewise. + * rust/execute/torture/transmute1.rs: Likewise. + * rust/execute/torture/wrapping_op1.rs: Likewise. + * rust/execute/torture/wrapping_op2.rs: Likewise. + * rust/link/generic_function_1.rs: Likewise. + * rust/link/trait_import_1.rs: Likewise. + +2025-12-03 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> + + * rust/compile/braced_macro_arm.rs: Remove parent errors. + * rust/compile/issue-407-2.rs: Likewise. + * rust/compile/issue-407.rs: Likewise. + * rust/compile/issue-4162.rs: Likewise. + * rust/compile/issue-867.rs: Likewise. + * rust/compile/raw_ref_op_invalid.rs: Likewise. + +2025-12-03 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> + + * rust/compile/macros/mbe/macro-issue3608.rs: Remove error. + +2025-12-03 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> + + * rust/compile/braced_macro_arm.rs: Remove superfluous error message + matching. + * rust/compile/decl_macro6.rs: Likewise. + * rust/compile/decl_macro7.rs: Likewise. + * rust/compile/extern_type_item_missing_semi.rs: Likewise. + * rust/compile/issue-2187.rs: Likewise. + * rust/compile/issue-407-2.rs: Likewise. + * rust/compile/issue-407.rs: Likewise. + * rust/compile/issue-4162.rs: Likewise. + * rust/compile/issue-867.rs: Likewise. + * rust/compile/macros/mbe/macro-issue1053-2.rs: Likewise. + * rust/compile/macros/mbe/macro-issue1395-2.rs: Likewise. + * rust/compile/macros/mbe/macro-issue3608.rs: Likewise. + * rust/compile/macros/mbe/macro27.rs: Likewise. + * rust/compile/macros/mbe/macro28.rs: Likewise. + * rust/compile/macros/mbe/macro29.rs: Likewise. + * rust/compile/macros/mbe/macro30.rs: Likewise. + * rust/compile/macros/mbe/macro31.rs: Likewise. + * rust/compile/macros/mbe/macro33.rs: Likewise. + * rust/compile/macros/mbe/macro35.rs: Likewise. + * rust/compile/macros/mbe/macro37.rs: Likewise. + * rust/compile/macros/mbe/macro38.rs: Likewise. + * rust/compile/macros/mbe/macro39.rs: Likewise. + * rust/compile/macros/mbe/macro48.rs: Likewise. + * rust/compile/parse_invalid_specialization.rs: Likewise. + * rust/compile/parse_simple_path_fail_1.rs: Likewise. + * rust/compile/parse_simple_path_fail_2.rs: Likewise. + * rust/compile/raw-string-loc.rs: Likewise. + * rust/compile/raw-byte-string-loc.rs: Likewise. + * rust/compile/self_const_ptr.rs: Likewise. + * rust/compile/self_mut_ptr.rs: Likewise. + * rust/compile/static_var1.rs: Likewise. + * rust/compile/self_ptr.rs: Likewise. + * rust/compile/torture/identifier-missing-impl-1.rs: Likewise. + +2025-12-03 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/103371 + * gfortran.dg/pdt_71.f03: New test. + +2025-12-03 liuhongt <hongtao.liu@intel.com> + + * g++.target/i386/avx512-pr71921.C: New test. + * g++.target/i386/pr71921.C: New test. + +2025-12-02 Robin Dapp <rdapp.gcc@gmail.com> + + PR target/122656 + * gcc.target/riscv/rvv/base/pr122656-1.c: New test. + * gcc.target/riscv/rvv/base/pr122656-2.c: New test.` + +2025-12-02 Jakub Jelinek <jakub@redhat.com> + + PR c++/122860 + * g++.dg/ext/pr122860.C: New test. + +2025-12-02 Jakub Jelinek <jakub@redhat.com> + + PR c++/122836 + * g++.dg/ext/pr122836.C: New test. + +2025-12-02 Jason Merrill <jason@redhat.com> + + PR c++/122171 + PR c++/112632 + * g++.dg/cpp0x/alias-decl-conv1.C: New test. + +2025-12-02 Tamar Christina <tamar.christina@arm.com> + + PR tree-optimization/122868 + * gcc.dg/vect/vect-early-break_140-pr122868_1.c: New test. + * gcc.dg/vect/vect-early-break_140-pr122868_2.c: New test. + * gcc.dg/vect/vect-early-break_140-pr122868_3.c: New test. + * gcc.dg/vect/vect-early-break_140-pr122868_4.c: New test. + +2025-12-02 David Guillen Fandos <david@davidgf.net> + + * gcc.target/mips/madd-10.c: New test. + * gcc.target/mips/maddu-5.c: New test. + * gcc.target/mips/msub-9.c: New test. + * gcc.target/mips/msubu-5.c: New test. + +2025-12-02 David Guillen Fandos <david@davidgf.net> + + * gcc.target/mips/bswap-7.c: New test. + +2025-12-02 David Guillen Fandos <david@davidgf.net> + + * gcc.target/mips/max-1.c: New test. + * gcc.target/mips/min-1.c: New test. + +2025-12-02 Saurabh Jha <saurabh.jha@arm.com> + Radek Barton <radek.barton@microsoft.com> + + * gcc.target/aarch64/mingw/variadic_hfa.c: New test. + * gcc.target/aarch64/mingw/variadic_hva.c: New test. + * gcc.target/aarch64/mingw/variadic_int.c: New test. + +2025-12-02 Saurabh Jha <saurabh.jha@arm.com> + Radek Barton <radek.barton@microsoft.com> + Martin Vejbora <mvejbora@microsoft.com> + + * gcc.target/aarch64/mingw/mingw.exp: New test. + * gcc.target/aarch64/mingw/long_double_size.c: New test. + +2025-12-02 Saurabh Jha <saurabh.jha@arm.com> + + * lib/scanasm.exp: Add support for mingw targets. + +2025-12-01 Nathaniel Shead <nathanieloshead@gmail.com> + + * g++.dg/modules/friend-12_a.C: New test. + * g++.dg/modules/friend-12_b.C: New test. + +2025-12-01 Nathaniel Shead <nathanieloshead@gmail.com> + + PR c++/122915 + * g++.dg/modules/namespace-16_a.C: New test. + * g++.dg/modules/namespace-16_b.C: New test. + * g++.dg/modules/namespace-16_c.C: New test. + * g++.dg/modules/namespace-16_d.C: New test. + +2025-12-01 Christophe Lyon <christophe.lyon@linaro.org> + + PR target/122858 + * gcc.target/arm/mve/pr122858.c: New test. + +2025-12-01 Christopher Albert <albert@tugraz.at> + Harald Anlauf <anlauf@gcc.gnu.org> + + PR fortran/107721 + PR fortran/102417 + * gfortran.dg/array_constructor_typespec_1.f90: New test. + +2025-12-01 Jakub Jelinek <jakub@redhat.com> + + PR c++/122905 + * g++.dg/lto/pr122905.h: New file. + * g++.dg/lto/pr122905_0.C: New test. + * g++.dg/lto/pr122905_1.C: New test. + +2025-12-01 Robin Dapp <rdapp@ventanamicro.com> + + PR target/122652 + * gcc.target/riscv/rvv/base/pr122652.c: New test. + +2025-12-01 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + PR testsuite/122596 + * gfortran.dg/alloc_comp_deep_copy_5.f90: Restrict + -Wa,--noexecstack, -Wl,-z,noexecstack to gas, gld. + * gfortran.dg/alloc_comp_deep_copy_6.f90: Likewise. + +2025-12-01 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + PR c++/81337 + PR c++/52477 + * g++.dg/gcov/pr16855.C (Test::~Test): xfail on *-*-solaris2* + (dg-final): Likewise. + * g++.dg/gcov/pr16855-priority.C (Test::~Test): Likewise. + (dg-final): Likewise. + +2025-12-01 H.J. Lu <hjl.tools@gmail.com> + + PR target/122906 + * g++.target/i386/pr122906-1.C: New test. + +2025-11-30 Kugan Vivekanandarajah <kvivekananda@nvidia.com> + + * gcc.dg/vect/tsvc/vect-tsvc-s293.c: Remove xfail. + * gcc.target/aarch64/vect-ld1r-compile.c: Add + -fno-tree-loop-distribute-patterns to prevent memset detection. + +2025-11-30 Jose E. Marchesi <jose.marchesi@oracle.com> + + PR fortran/122923 + * gfortran.dg/ISO_Fortran_binding_17.f90: Recognize language + list in warning regexp. + * gfortran.dg/c-interop/allocate-errors.f90: Likewise. + * gfortran.dg/c-interop/establish-errors.f90: Likewise. + * gfortran.dg/c-interop/pr113338.f90: Likewise. + * gfortran.dg/c-interop/section-errors.f90: Likewise. + * gfortran.dg/c-interop/select-errors.f90: Likewise. + * gfortran.dg/c-interop/setpointer-errors.f90: Likewise. + +2025-11-30 Jakub Jelinek <jakub@redhat.com> + + PR c++/122465 + * g++.dg/cpp0x/pr122465.C: New test. + +2025-11-30 Tamar Christina <tamar.christina@arm.com> + + PR tree-optimization/115120 + PR tree-optimization/119577 + PR tree-optimization/119860 + * gcc.dg/vect/vect-early-break_39.c: Update. + * gcc.dg/vect/vect-early-break_139.c: New testcase. + * gcc.target/aarch64/sve/peel_ind_10.c: Update. + * gcc.target/aarch64/sve/peel_ind_11.c: Update. + * gcc.target/aarch64/sve/peel_ind_12.c: Update. + * gcc.target/aarch64/sve/peel_ind_5.c: Update. + * gcc.target/aarch64/sve/peel_ind_6.c: Update. + * gcc.target/aarch64/sve/peel_ind_7.c: Update. + * gcc.target/aarch64/sve/peel_ind_9.c: Update. + * gcc.target/aarch64/sve/pr119351.c + +2025-11-30 Jose E. Marchesi <jose.marchesi@oracle.com> + + * algol68/compile/mcgt-1.3b.a68: New file. + * algol68/compile/mcgt-7.1.3a-bis.a68: Likewise. + * algol68/compile/mcgt-7.1.3a.a68: Likewise. + * algol68/execute/mcgt/execute.exp: Likewise. + * algol68/execute/mcgt/mcgt-1.3a.a68: Likewise. + * algol68/execute/mcgt/mcgt-1.3c.a68: Likewise. + * algol68/execute/mcgt/mcgt-2.2.1a.a68: Likewise. + * algol68/execute/mcgt/mcgt-2.2.2a.a68: Likewise. + * algol68/execute/mcgt/mcgt-2.2.3a.a68: Likewise. + * algol68/execute/mcgt/mcgt-2.3a.a68: Likewise. + * algol68/execute/mcgt/mcgt-2.3b.a68: Likewise. + * algol68/execute/mcgt/mcgt-2.3c.a68: Likewise. + * algol68/execute/mcgt/mcgt-2.3e.a68: Likewise. + * algol68/execute/mcgt/mcgt-2.4.2a.a68: Likewise. + * algol68/execute/mcgt/mcgt-2.4.2b.a68: Likewise. + * algol68/execute/mcgt/mcgt-2.4.2c.a68: Likewise. + * algol68/execute/mcgt/mcgt-2.4.3a.a68: Likewise. + * algol68/execute/mcgt/mcgt-2.6a.a68: Likewise. + * algol68/execute/mcgt/mcgt-2.6b.a68: Likewise. + * algol68/execute/mcgt/mcgt-2.7d.a68: Likewise. + * algol68/execute/mcgt/mcgt-2.7e.a68: Likewise. + * algol68/execute/mcgt/mcgt-2.8a.a68: Likewise. + * algol68/execute/mcgt/mcgt-2.8b.a68: Likewise. + * algol68/execute/mcgt/mcgt-2.9.1a.a68: Likewise. + * algol68/execute/mcgt/mcgt-3.5.1a.a68: Likewise. + * algol68/execute/mcgt/mcgt-3.5d.a68: Likewise. + * algol68/execute/mcgt/mcgt-3.7.2a.a68: Likewise. + * algol68/execute/mcgt/mcgt-3.8.2a.a68: Likewise. + * algol68/execute/mcgt/mcgt-3.9.1b.a68: Likewise. + * algol68/execute/mcgt/mcgt-4.1.2a.a68: Likewise. + * algol68/execute/mcgt/mcgt-4.1.3a.a68: Likewise. + * algol68/execute/mcgt/mcgt-4.1.6a.a68: Likewise. + * algol68/execute/mcgt/mcgt-4.1.6b.a68: Likewise. + * algol68/execute/mcgt/mcgt-4.1.6c.a68: Likewise. + * algol68/execute/mcgt/mcgt-4.2.6a.a68: Likewise. + * algol68/execute/mcgt/mcgt-4.2.6b.a68: Likewise. + * algol68/execute/mcgt/mcgt-4.2.6d.a68: Likewise. + * algol68/execute/mcgt/mcgt-4.3.1a.a68: Likewise. + * algol68/execute/mcgt/mcgt-4.3.1b.a68: Likewise. + * algol68/execute/mcgt/mcgt-4.3.2a.a68: Likewise. + * algol68/execute/mcgt/mcgt-5.1.2a.a68: Likewise. + * algol68/execute/mcgt/mcgt-5.1.3a.a68: Likewise. + * algol68/execute/mcgt/mcgt-5.1.3c.a68: Likewise. + * algol68/execute/mcgt/mcgt-5.1.5a.a68: Likewise. + * algol68/execute/mcgt/mcgt-6.2.2a.a68: Likewise. + * algol68/execute/mcgt/mcgt-6.2.2b.a68: Likewise. + * algol68/execute/mcgt/mcgt-6.2.2c.a68: Likewise. + * algol68/execute/mcgt/mcgt-7.1.1a.a68: Likewise. + * algol68/execute/mcgt/mcgt-7.1.1b.a68: Likewise. + * algol68/execute/mcgt/mcgt-7.1.3a.a68: Likewise. + * algol68/execute/mcgt/mcgt-7.3.2a.a68: Likewise. + * algol68/execute/mcgt/mcgt-7.3.6a.a68: Likewise. + * algol68/execute/mcgt/mcgt-7.3.6b.a68: Likewise. + * algol68/execute/mcgt/mcgt-7.5.3a.a68: Likewise. + +2025-11-30 Jose E. Marchesi <jose.marchesi@oracle.com> + + * algol68/README.mcts: New file. + +2025-11-30 Jose E. Marchesi <jose.marchesi@oracle.com> + + * algol68/compile/a68includes/goodbye-supper.a68 + * algol68/compile/a68includes/goodbye.a68: Likewise. + * algol68/compile/a68includes/hello-supper.a68: Likewise. + * algol68/compile/a68includes/hello.a68: Likewise. + * algol68/compile/actual-bounds-expected-1.a68: Likewise. + * algol68/compile/actual-bounds-expected-2.a68: Likewise. + * algol68/compile/actual-bounds-expected-3.a68: Likewise. + * algol68/compile/balancing-1.a68: Likewise. + * algol68/compile/bold-nestable-comment-1.a68: Likewise. + * algol68/compile/bold-taggle-1.a68: Likewise. + * algol68/compile/brief-nestable-comment-1.a68: Likewise. + * algol68/compile/brief-nestable-comment-2.a68: Likewise. + * algol68/compile/char-break-1.a68: Likewise. + * algol68/compile/compile.exp: Likewise. + * algol68/compile/conditional-clause-1.a68: Likewise. + * algol68/compile/error-bold-taggle-1.a68: Likewise. + * algol68/compile/error-coercion-1.a68: Likewise. + * algol68/compile/error-coercion-2.a68: Likewise. + * algol68/compile/error-coercion-flex-1.a68: Likewise. + * algol68/compile/error-conformance-clause-1.a68: Likewise. + * algol68/compile/error-contraction-1.a68: Likewise. + * algol68/compile/error-contraction-2.a68: Likewise. + * algol68/compile/error-incestuous-union-1.a68: Likewise. + * algol68/compile/error-label-after-decl-1.a68: Likewise. + * algol68/compile/error-nestable-comments-1.a68: Likewise. + * algol68/compile/error-nested-comment-1.a68: Likewise. + * algol68/compile/error-no-bounds-allowed-1.a68: Likewise. + * algol68/compile/error-string-break-1.a68: Likewise. + * algol68/compile/error-string-break-2.a68: Likewise. + * algol68/compile/error-string-break-3.a68: Likewise. + * algol68/compile/error-string-break-4.a68: Likewise. + * algol68/compile/error-string-break-5.a68: Likewise. + * algol68/compile/error-string-break-6.a68: Likewise. + * algol68/compile/error-string-break-7.a68: Likewise. + * algol68/compile/error-supper-1.a68: Likewise. + * algol68/compile/error-supper-2.a68: Likewise. + * algol68/compile/error-supper-3.a68: Likewise. + * algol68/compile/error-supper-4.a68: Likewise. + * algol68/compile/error-supper-5.a68: Likewise. + * algol68/compile/error-supper-6.a68: Likewise. + * algol68/compile/error-underscore-in-mode-1.a68: Likewise. + * algol68/compile/error-underscore-in-tag-1.a68: Likewise. + * algol68/compile/error-upper-1.a68: Likewise. + * algol68/compile/error-widening-1.a68: Likewise. + * algol68/compile/error-widening-2.a68: Likewise. + * algol68/compile/error-widening-3.a68: Likewise. + * algol68/compile/error-widening-4.a68: Likewise. + * algol68/compile/error-widening-5.a68: Likewise. + * algol68/compile/error-widening-6.a68: Likewise. + * algol68/compile/error-widening-7.a68: Likewise. + * algol68/compile/error-widening-8.a68: Likewise. + * algol68/compile/error-widening-9.a68: Likewise. + * algol68/compile/hidden-operators-1.a68: Likewise. + * algol68/compile/implicit-widening-1.a68: Likewise. + * algol68/compile/include-supper.a68: Likewise. + * algol68/compile/include.a68: Likewise. + * algol68/compile/labeled-unit-1.a68: Likewise. + * algol68/compile/nested-comment-1.a68: Likewise. + * algol68/compile/nested-comment-2.a68: Likewise. + * algol68/compile/operators-firmly-related.a68: Likewise. + * algol68/compile/recursive-modes-1.a68: Likewise. + * algol68/compile/recursive-modes-2.a68: Likewise. + * algol68/compile/serial-clause-jump-1.a68: Likewise. + * algol68/compile/snobol.a68: Likewise. + * algol68/compile/supper-1.a68: Likewise. + * algol68/compile/supper-10.a68: Likewise. + * algol68/compile/supper-11.a68: Likewise. + * algol68/compile/supper-12.a68: Likewise. + * algol68/compile/supper-13.a68: Likewise. + * algol68/compile/supper-2.a68: Likewise. + * algol68/compile/supper-3.a68: Likewise. + * algol68/compile/supper-4.a68: Likewise. + * algol68/compile/supper-5.a68: Likewise. + * algol68/compile/supper-6.a68: Likewise. + * algol68/compile/supper-7.a68: Likewise. + * algol68/compile/supper-8.a68: Likewise. + * algol68/compile/supper-9.a68: Likewise. + * algol68/compile/uniting-1.a68: Likewise. + * algol68/compile/upper-1.a68: Likewise. + * algol68/compile/warning-scope-1.a68: Likewise. + * algol68/compile/warning-scope-2.a68: Likewise. + * algol68/compile/warning-scope-3.a68: Likewise. + * algol68/compile/warning-scope-4.a68: Likewise. + * algol68/compile/warning-scope-5.a68: Likewise. + * algol68/compile/warning-scope-6.a68: Likewise. + * algol68/compile/warning-scope-7.a68: Likewise. + * algol68/compile/warning-voiding-1.a68: Likewise. + * algol68/compile/warning-voiding-2.a68: Likewise. + * algol68/compile/error-compile-unknown-tag-1.a68: New file. + * algol68/compile/error-def-1.a68: New file. + * algol68/compile/error-mode-stropping-1.a68: New file. + * algol68/compile/error-mode-stropping-10.a68: New file. + * algol68/compile/error-mode-stropping-11.a68: New file. + * algol68/compile/error-mode-stropping-12.a68: New file. + * algol68/compile/error-mode-stropping-13.a68: New file. + * algol68/compile/error-mode-stropping-14.a68: New file. + * algol68/compile/error-mode-stropping-15.a68: New file. + * algol68/compile/error-mode-stropping-16.a68: New file. + * algol68/compile/error-mode-stropping-17.a68: New file. + * algol68/compile/error-mode-stropping-2.a68: New file. + * algol68/compile/error-mode-stropping-3.a68: New file. + * algol68/compile/error-mode-stropping-4.a68: New file. + * algol68/compile/error-mode-stropping-5.a68: New file. + * algol68/compile/error-mode-stropping-6.a68: New file. + * algol68/compile/error-mode-stropping-8.a68: New file. + * algol68/compile/error-mode-stropping-9.a68: New file. + * algol68/compile/error-module-coercions-1.a68: New file. + * algol68/compile/error-module-not-found-1.a68: New file. + * algol68/compile/error-module-ranges-1.a68: New file. + * algol68/compile/error-pragmat-1.a68: New file. + * algol68/compile/error-pragmat-access-1.a68: New file. + * algol68/compile/error-pragmat-access-2.a68: New file. + * algol68/compile/error-pub-loc-1.a68: New file. + * algol68/compile/error-pub-out-of-def-1.a68: New file. + * algol68/compile/error-pub-out-of-def-2.a68: New file. + * algol68/compile/error-string-break-8.a68: New file. + * algol68/compile/error-stropping-5.a68: New file. + * algol68/compile/error-stropping-6.a68: New file. + * algol68/compile/error-stropping-keyword-1.a68: New file. + * algol68/compile/error-stropping-keyword-2.a68: New file. + * algol68/compile/error-stropping-keyword-3.a68: New file. + * algol68/compile/error-stropping-keyword-4.a68: New file. + * algol68/compile/error-vacuum-1.a68: New file. + * algol68/compile/error-vacuum-2.a68: New file. + * algol68/compile/error-vacuum-3.a68: New file. + * algol68/compile/module-1.a68: New file. + * algol68/compile/module-2.a68: New file. + * algol68/compile/module-extracts-1.a68: New file. + * algol68/compile/module-mode-exports-1.a68: New file. + * algol68/compile/module-mode-exports-2.a68: New file. + * algol68/compile/module-mode-exports-3.a68: New file. + * algol68/compile/module-mode-exports-4.a68: New file. + * algol68/compile/module-mode-exports-5.a68: New file. + * algol68/compile/module-mode-exports-6.a68: New file. + * algol68/compile/module-mode-exports-7.a68: New file. + * algol68/compile/module-mode-exports-8.a68: New file. + * algol68/compile/module-mode-exports-9.a68: New file. + * algol68/compile/module-pub-1.a68: New file. + * algol68/compile/module-pub-mangling-1.a68: New file. + * algol68/compile/module-pub-mangling-10.a68: New file. + * algol68/compile/module-pub-mangling-11.a68: New file. + * algol68/compile/module-pub-mangling-12.a68: New file. + * algol68/compile/module-pub-mangling-13.a68: New file. + * algol68/compile/module-pub-mangling-14.a68: New file. + * algol68/compile/module-pub-mangling-15.a68: New file. + * algol68/compile/module-pub-mangling-16.a68: New file. + * algol68/compile/module-pub-mangling-17.a68: New file. + * algol68/compile/module-pub-mangling-18.a68: New file. + * algol68/compile/module-pub-mangling-19.a68: New file. + * algol68/compile/module-pub-mangling-2.a68: New file. + * algol68/compile/module-pub-mangling-20.a68: New file. + * algol68/compile/module-pub-mangling-21.a68: New file. + * algol68/compile/module-pub-mangling-22.a68: New file. + * algol68/compile/module-pub-mangling-3.a68: New file. + * algol68/compile/module-pub-mangling-4.a68: New file. + * algol68/compile/module-pub-mangling-5.a68: New file. + * algol68/compile/module-pub-mangling-6.a68: New file. + * algol68/compile/module-pub-mangling-7.a68: New file. + * algol68/compile/module-pub-mangling-8.a68: New file. + * algol68/compile/module-pub-mangling-9.a68: New file. + * algol68/compile/module-top-down-1.a68: New file. + * algol68/compile/modules/compile.exp: New file. + * algol68/compile/modules/module1.a68: New file. + * algol68/compile/modules/module2.a68: New file. + * algol68/compile/modules/module3.a68: New file. + * algol68/compile/modules/module4.a68: New file. + * algol68/compile/modules/module5.a68: New file. + * algol68/compile/modules/module6.a68: New file. + * algol68/compile/modules/module7.a68: New file. + * algol68/compile/modules/module8.a68: New file. + * algol68/compile/modules/module9.a68: New file. + * algol68/compile/modules/program-7.a68: New file. + * algol68/compile/modules/program-8.a68: New file. + * algol68/compile/modules/program-9.a68: New file. + * algol68/compile/modules/program-error-no-prio-1.a68: New file. + * algol68/compile/modules/program-error-outside-access-1.a68: New file. + * algol68/compile/modules/program-module-accesses-module-1.a68: New file. + * algol68/compile/modules/program-proc-arg-order-1.a68: New file. + * algol68/compile/warning-hidding-1.a68: New file. + * algol68/compile/warning-hidding-2.a68: New file. + * algol68/compile/warning-hidding-3.a68: New file. + * algol68/compile/warning-hidding-4.a68: New file. + * algol68/compile/warning-hidding-5.a68: New file. + * algol68/compile/warning-hidding-6.a68: New file. + * algol68/compile/warning-hidding-7.a68: New file. + * algol68/compile/warning-module-hidding-1.a68: New file. + * algol68/compile/warning-pub-loc-1.a68: New file. + +2025-11-30 Jose E. Marchesi <jose.marchesi@oracle.com> + + * algol68/execute/loop-7.a68: New file. + * algol68/execute/loop-8.a68: Likewise. + * algol68/execute/loop-9.a68: Likewise. + * algol68/execute/loop-overflow-underflow.a68: Likewise. + * algol68/execute/lt-int-1.a68: Likewise. + * algol68/execute/lt-string-stride-1.a68: Likewise. + * algol68/execute/lwb-1.a68: Likewise. + * algol68/execute/minus-int-1.a68: Likewise. + * algol68/execute/minusab-1.a68: Likewise. + * algol68/execute/minusab-2.a68: Likewise. + * algol68/execute/minusab-3.a68: Likewise. + * algol68/execute/minusab-4.a68: Likewise. + * algol68/execute/mod-int-1.a68: Likewise. + * algol68/execute/modab-1.a68: Likewise. + * algol68/execute/modab-2.a68: Likewise. + * algol68/execute/mode-indication-1.a68: Likewise. + * algol68/execute/mult-char-1.a68: Likewise. + * algol68/execute/mult-int-1.a68: Likewise. + * algol68/execute/mult-string-1.a68: Likewise. + * algol68/execute/mult-string-2.a68: Likewise. + * algol68/execute/mult-string-3.a68: Likewise. + * algol68/execute/mult-string-4.a68: Likewise. + * algol68/execute/multab-1.a68: Likewise. + * algol68/execute/multab-2.a68: Likewise. + * algol68/execute/multab-3.a68: Likewise. + * algol68/execute/mutual-recursion-1.a68: Likewise. + * algol68/execute/ne-bits-1.a68: Likewise. + * algol68/execute/ne-char-char-1.a68: Likewise. + * algol68/execute/ne-int-1.a68: Likewise. + * algol68/execute/ne-string-1.a68: Likewise. + * algol68/execute/neg-int-1.a68: Likewise. + * algol68/execute/not-bits-1.a68: Likewise. + * algol68/execute/odd-1.a68: Likewise. + * algol68/execute/op-1.a68: Likewise. + * algol68/execute/op-2.a68: Likewise. + * algol68/execute/op-3.a68: Likewise. + * algol68/execute/operator-declaration-1.a68: Likewise. + * algol68/execute/or-bits-1.a68: Likewise. + * algol68/execute/orf-1.a68: Likewise. + * algol68/execute/over-int-1.a68: Likewise. + * algol68/execute/overab-1.a68: Likewise. + * algol68/execute/overab-2.a68: Likewise. + * algol68/execute/particular-program-1.a68: Likewise. + * algol68/execute/plus-char-1.a68: Likewise. + * algol68/execute/plus-int-1.a68: Likewise. + * algol68/execute/plus-string-1.a68: Likewise. + * algol68/execute/plus-string-2.a68: Likewise. + * algol68/execute/plus-string-stride-1.a68: Likewise. + * algol68/execute/plusab-1.a68: Likewise. + * algol68/execute/plusab-2.a68: Likewise. + * algol68/execute/plusab-3.a68: Likewise. + * algol68/execute/plusab-4.a68: Likewise. + * algol68/execute/plusab-string-1.a68: Likewise. + * algol68/execute/plusto-char-1.a68: Likewise. + * algol68/execute/plusto-string-1.a68: Likewise. + * algol68/execute/posix-argc-argv-1.a68: Likewise. + * algol68/execute/posix-fopen-1.a68: Likewise. + * algol68/execute/posix-fputc-fputs-1.a68: Likewise. + * algol68/execute/posix-getenv-1.a68: Likewise. + * algol68/execute/posix-perror-1.a68: Likewise. + * algol68/execute/posix-putchar-1.a68: Likewise. + * algol68/execute/posix-stdinouterr-1.a68: Likewise. + * algol68/execute/posix-strerror-1.a68: Likewise. + * algol68/execute/posix-stride-1.a68: Likewise. + * algol68/execute/pow-int-1.a68: Likewise. + * algol68/execute/pow-real-1.a68: Likewise. + * algol68/execute/proc-1.a68: Likewise. + * algol68/execute/proc-10.a68: Likewise. + * algol68/execute/proc-12.a68: Likewise. + * algol68/execute/proc-13.a68: Likewise. + * algol68/execute/proc-14.a68: Likewise. + * algol68/execute/proc-15.a68: Likewise. + * algol68/execute/proc-16.a68: Likewise. + * algol68/execute/proc-17.a68: Likewise. + * algol68/execute/proc-18.a68: Likewise. + * algol68/execute/proc-19.a68: Likewise. + * algol68/execute/proc-2.a68: Likewise. + * algol68/execute/proc-20.a68: Likewise. + * algol68/execute/proc-21.a68: Likewise. + * algol68/execute/proc-22.a68: Likewise. + * algol68/execute/proc-23.a68: Likewise. + * algol68/execute/proc-25.a68: Likewise. + * algol68/execute/proc-26.a68: Likewise. + * algol68/execute/proc-27.a68: Likewise. + * algol68/execute/proc-28.a68: Likewise. + * algol68/execute/proc-29.a68: Likewise. + * algol68/execute/proc-3.a68: Likewise. + * algol68/execute/proc-4.a68: Likewise. + * algol68/execute/proc-5.a68: Likewise. + * algol68/execute/proc-6.a68: Likewise. + * algol68/execute/proc-7.a68: Likewise. + * algol68/execute/proc-8.a68: Likewise. + * algol68/execute/procedured-goto-1.a68: Likewise. + * algol68/execute/quine.a68: Likewise. + * algol68/execute/random-1.a68: Likewise. + * algol68/execute/re-im-1.a68: Likewise. + * algol68/execute/rela-string-1.a68: Likewise. + * algol68/execute/repr-1.a68: Likewise. + * algol68/execute/round-1.a68: Likewise. + * algol68/execute/row-display-1.a68: Likewise. + * algol68/execute/row-display-2.a68: Likewise. + * algol68/execute/row-display-3.a68: Likewise. + * algol68/execute/row-display-4.a68: Likewise. + * algol68/execute/row-display-5.a68: Likewise. + * algol68/execute/rowing-1.a68: Likewise. + * algol68/execute/rowing-10.a68: Likewise. + * algol68/execute/rowing-11.a68: Likewise. + * algol68/execute/rowing-12.a68: Likewise. + * algol68/execute/rowing-13.a68: Likewise. + * algol68/execute/rowing-2.a68: Likewise. + * algol68/execute/rowing-3.a68: Likewise. + * algol68/execute/rowing-4.a68: Likewise. + * algol68/execute/rowing-5.a68: Likewise. + * algol68/execute/rowing-6.a68: Likewise. + * algol68/execute/rowing-7.a68: Likewise. + * algol68/execute/rowing-8.a68: Likewise. + * algol68/execute/rowing-9.a68: Likewise. + * algol68/execute/selection-1.a68: Likewise. + * algol68/execute/selection-2.a68: Likewise. + * algol68/execute/selection-3.a68: Likewise. + * algol68/execute/selection-4.a68: Likewise. + * algol68/execute/selection-5.a68: Likewise. + * algol68/execute/selection-multiple-1.a68: Likewise. + * algol68/execute/selection-multiple-2.a68: Likewise. + * algol68/execute/serial-clause-1.a68: Likewise. + * algol68/execute/serial-clause-10.a68: Likewise. + * algol68/execute/serial-clause-2.a68: Likewise. + * algol68/execute/serial-clause-3.a68: Likewise. + * algol68/execute/serial-clause-4.a68: Likewise. + * algol68/execute/serial-clause-5.a68: Likewise. + * algol68/execute/serial-clause-6.a68: Likewise. + * algol68/execute/serial-clause-7.a68: Likewise. + * algol68/execute/serial-clause-8.a68: Likewise. + * algol68/execute/serial-clause-9.a68: Likewise. + * algol68/execute/serial-dsa-1.a68: Likewise. + * algol68/execute/serial-dsa-2.a68: Likewise. + * algol68/execute/serial-dsa-3.a68: Likewise. + * algol68/execute/serial-dsa-4.a68: Likewise. + * algol68/execute/serial-dsa-5.a68: Likewise. + * algol68/execute/serial-dsa-6.a68: Likewise. + * algol68/execute/sign-int-1.a68: Likewise. + * algol68/execute/sign-real-1.a68: Likewise. + * algol68/execute/sin-1.a68: Likewise. + * algol68/execute/skip-1.a68: Likewise. + * algol68/execute/skip-2.a68: Likewise. + * algol68/execute/skip-struct-1.a68: Likewise. + * algol68/execute/slice-indexing-1.a68: Likewise. + * algol68/execute/slice-indexing-2.a68: Likewise. + * algol68/execute/slice-indexing-3.a68: Likewise. + * algol68/execute/slice-indexing-4.a68: Likewise. + * algol68/execute/slice-indexing-5.a68: Likewise. + * algol68/execute/slice-indexing-6.a68: Likewise. + * algol68/execute/slice-indexing-7.a68: Likewise. + * algol68/execute/sqrt-1.a68: Likewise. + * algol68/execute/string-1.a68: Likewise. + * algol68/execute/string-2.a68: Likewise. + * algol68/execute/string-4.a68: Likewise. + * algol68/execute/string-break-1.a68: Likewise. + * algol68/execute/struct-self-1.a68: Likewise. + * algol68/execute/struct-self-2.a68: Likewise. + * algol68/execute/struct-self-3.a68: Likewise. + * algol68/execute/structure-display-1.a68: Likewise. + * algol68/execute/structure-display-2.a68: Likewise. + * algol68/execute/structure-display-3.a68: Likewise. + * algol68/execute/structure-display-4.a68: Likewise. + * algol68/execute/structure-display-5.a68: Likewise. + * algol68/execute/tan-1.a68: Likewise. + * algol68/execute/timesab-string-1.a68: Likewise. + * algol68/execute/trimmer-1.a68: Likewise. + * algol68/execute/trimmer-10.a68: Likewise. + * algol68/execute/trimmer-2.a68: Likewise. + * algol68/execute/trimmer-3.a68: Likewise. + * algol68/execute/trimmer-4.a68: Likewise. + * algol68/execute/trimmer-5.a68: Likewise. + * algol68/execute/trimmer-6.a68: Likewise. + * algol68/execute/trimmer-7.a68: Likewise. + * algol68/execute/trimmer-8.a68: Likewise. + * algol68/execute/trimmer-9.a68: Likewise. + * algol68/execute/trimmer-matrix-1.a68: Likewise. + * algol68/execute/trimmer-matrix-2.a68: Likewise. + * algol68/execute/trimmer-matrix-3.a68: Likewise. + * algol68/execute/trimmer-matrix-4.a68: Likewise. + * algol68/execute/trimmer-matrix-5.a68: Likewise. + * algol68/execute/trimmer-matrix-6.a68: Likewise. + * algol68/execute/trimmer-name-1.a68: Likewise. + * algol68/execute/undefined-1.a68: Likewise. + * algol68/execute/undefined-2.a68: Likewise. + * algol68/execute/undefined-3.a68: Likewise. + * algol68/execute/undefined-4.a68: Likewise. + * algol68/execute/undefined-5.a68: Likewise. + * algol68/execute/uniting-1.a68: Likewise. + * algol68/execute/uniting-2.a68: Likewise. + * algol68/execute/uniting-3.a68: Likewise. + * algol68/execute/uniting-4.a68: Likewise. + * algol68/execute/up-down-bits-1.a68: Likewise. + * algol68/execute/upb-1.a68: Likewise. + * algol68/execute/vacuum-1.a68: Likewise. + * algol68/execute/variable-declaration-1.a68: Likewise. + * algol68/execute/variable-declaration-2.a68: Likewise. + * algol68/execute/variable-declaration-3.a68: Likewise. + * algol68/execute/variable-declaration-4.a68: Likewise. + * algol68/execute/variable-declaration-5.a68: Likewise. + * algol68/execute/variable-declaration-6.a68: Likewise. + * algol68/execute/variable-declaration-heap-1.a68: Likewise. + * algol68/execute/variable-declaration-heap-2.a68: Likewise. + * algol68/execute/variable-declaration-multiple-1.a68: Likewise. + * algol68/execute/variable-declaration-multiple-2.a68: Likewise. + * algol68/execute/variable-declaration-multiple-3.a68: Likewise. + * algol68/execute/variable-declaration-multiple-4.a68: Likewise. + * algol68/execute/variable-declaration-multiple-5.a68: Likewise. + * algol68/execute/variable-declaration-multiple-6.a68: Likewise. + * algol68/execute/variable-declaration-multiple-7.a68: Likewise. + * algol68/execute/variable-declaration-multiple-8.a68: Likewise. + * algol68/execute/variable-declaration-multiple-9.a68: Likewise. + * algol68/execute/voiding-1.a68: Likewise. + * algol68/execute/widening-1.a68: Likewise. + * algol68/execute/widening-2.a68: Likewise. + * algol68/execute/widening-bits-1.a68: Likewise. + * algol68/execute/widening-bits-2.a68: Likewise. + * algol68/execute/widening-bits-3.a68: Likewise. + * algol68/execute/xor-bits-1.a68: Likewise. + * algol68/execute/environment-enquiries-8.a68: Likewise. + * algol68/execute/modules/README: New file. + * algol68/execute/modules/execute.exp: New file. + * algol68/execute/modules/module1.a68: New file. + * algol68/execute/modules/module10.a68: New file. + * algol68/execute/modules/module11.a68: New file. + * algol68/execute/modules/module12.a68: New file. + * algol68/execute/modules/module13.a68: New file. + * algol68/execute/modules/module14.a68: New file. + * algol68/execute/modules/module15.a68: New file. + * algol68/execute/modules/module16.a68: New file. + * algol68/execute/modules/module17.a68: New file. + * algol68/execute/modules/module3.a68: New file. + * algol68/execute/modules/module4.a68: New file. + * algol68/execute/modules/module5.a68: New file. + * algol68/execute/modules/module6.a68: New file. + * algol68/execute/modules/module7.a68: New file. + * algol68/execute/modules/module8.a68: New file. + * algol68/execute/modules/module9.a68: New file. + * algol68/execute/modules/program-1.a68: New file. + * algol68/execute/modules/program-10.a68: New file. + * algol68/execute/modules/program-11.a68: New file. + * algol68/execute/modules/program-12.a68: New file. + * algol68/execute/modules/program-15.a68: New file. + * algol68/execute/modules/program-16.a68: New file. + * algol68/execute/modules/program-17.a68: New file. + * algol68/execute/modules/program-2.a68: New file. + * algol68/execute/modules/program-3.a68: New file. + * algol68/execute/modules/program-4.a68: New file. + * algol68/execute/modules/program-5.a68: New file. + * algol68/execute/modules/program-6.a68: New file. + * algol68/execute/modules/program-7.a68: New file. + * algol68/execute/modules/program-8.a68: New file. + * algol68/execute/posix-lseek.a68: New file. + +2025-11-30 Jose E. Marchesi <jose.marchesi@oracle.com> + + * algol68/execute/abs-bits-1.a68: New file. + * algol68/execute/abs-bool-1.a68: Likewise. + * algol68/execute/abs-char-1.a68: Likewise. + * algol68/execute/abs-int-1.a68: Likewise. + * algol68/execute/abs-int-negative-1.a68: Likewise. + * algol68/execute/abs-int-negative-gnu-1.a68: Likewise. + * algol68/execute/acos-1.a68: Likewise. + * algol68/execute/affirm-int-1.a68: Likewise. + * algol68/execute/and-bits-1.a68: Likewise. + * algol68/execute/andf-1.a68: Likewise. + * algol68/execute/ascription-1.a68: Likewise. + * algol68/execute/asin-1.a68: Likewise. + * algol68/execute/assert-1.a68: Likewise. + * algol68/execute/assignation-char-1.a68: Likewise. + * algol68/execute/assignation-int-1.a68: Likewise. + * algol68/execute/assignation-int-2.a68: Likewise. + * algol68/execute/assignation-int-3.a68: Likewise. + * algol68/execute/assignation-int-4.a68: Likewise. + * algol68/execute/assignation-int-5.a68: Likewise. + * algol68/execute/assignation-multiple-1.a68: Likewise. + * algol68/execute/assignation-multiple-2.a68: Likewise. + * algol68/execute/assignation-struct-1.a68: Likewise. + * algol68/execute/assignation-struct-2.a68: Likewise. + * algol68/execute/atan-1.a68: Likewise. + * algol68/execute/balancing-1.a68: Likewise. + * algol68/execute/balancing-rows-1.a68: Likewise. + * algol68/execute/bin-1.a68: Likewise. + * algol68/execute/bin-negative-1.a68: Likewise. + * algol68/execute/bin-negative-gnu-1.a68: Likewise. + * algol68/execute/boolops-1.a68: Likewise. + * algol68/execute/call-1.a68: Likewise. + * algol68/execute/call-2.a68: Likewise. + * algol68/execute/case-clause-1.a68: Likewise. + * algol68/execute/case-clause-2.a68: Likewise. + * algol68/execute/case-clause-3.a68: Likewise. + * algol68/execute/case-clause-4.a68: Likewise. + * algol68/execute/closed-clause-1.a68: Likewise. + * algol68/execute/closed-clause-2.a68: Likewise. + * algol68/execute/collateral-clause-1.a68: Likewise. + * algol68/execute/collateral-clause-2.a68: Likewise. + * algol68/execute/collateral-clause-3.a68: Likewise. + * algol68/execute/collateral-clause-4.a68: Likewise. + * algol68/execute/collateral-clause-5.a68: Likewise. + * algol68/execute/collateral-clause-6.a68: Likewise. + * algol68/execute/completer-1.a68: Likewise. + * algol68/execute/completer-10.a68: Likewise. + * algol68/execute/completer-2.a68: Likewise. + * algol68/execute/completer-3.a68: Likewise. + * algol68/execute/completer-4.a68: Likewise. + * algol68/execute/completer-5.a68: Likewise. + * algol68/execute/completer-6.a68: Likewise. + * algol68/execute/completer-7.a68: Likewise. + * algol68/execute/completer-8.a68: Likewise. + * algol68/execute/completer-9.a68: Likewise. + * algol68/execute/cond-clause-1.a68: Likewise. + * algol68/execute/cond-clause-2.a68: Likewise. + * algol68/execute/cond-clause-3.a68: Likewise. + * algol68/execute/cond-clause-4.a68: Likewise. + * algol68/execute/cond-clause-5.a68: Likewise. + * algol68/execute/cond-clause-6.a68: Likewise. + * algol68/execute/cond-clause-7.a68: Likewise. + * algol68/execute/cond-clause-8.a68: Likewise. + * algol68/execute/cond-clause-9.a68: Likewise. + * algol68/execute/conformity-clause-1.a68: Likewise. + * algol68/execute/conformity-clause-2.a68: Likewise. + * algol68/execute/conformity-clause-3.a68: Likewise. + * algol68/execute/conformity-clause-4.a68: Likewise. + * algol68/execute/conformity-clause-5.a68: Likewise. + * algol68/execute/conformity-clause-6.a68: Likewise. + * algol68/execute/conformity-clause-7.a68: Likewise. + * algol68/execute/conformity-clause-8.a68: Likewise. + * algol68/execute/conformity-clause-9.a68: Likewise. + * algol68/execute/conj-1.a68: Likewise. + * algol68/execute/cos-1.a68: Likewise. + * algol68/execute/declarer-1.a68: Likewise. + * algol68/execute/declarer-2.a68: Likewise. + * algol68/execute/deprocedure-1.a68: Likewise. + * algol68/execute/deprocedure-2.a68: Likewise. + * algol68/execute/deref-1.a68: Likewise. + * algol68/execute/deref-2.a68: Likewise. + * algol68/execute/deref-3.a68: Likewise. + * algol68/execute/deref-4.a68: Likewise. + * algol68/execute/deref-5.a68: Likewise. + * algol68/execute/deref-6.a68: Likewise. + * algol68/execute/deref-7.a68: Likewise. + * algol68/execute/deref-8.a68: Likewise. + * algol68/execute/div-int-1.a68: Likewise. + * algol68/execute/divab-real-1.a68: Likewise. + * algol68/execute/elem-bits-1.a68: Likewise. + * algol68/execute/elems-1.a68: Likewise. + * algol68/execute/elems-2.a68: Likewise. + * algol68/execute/entier-1.a68: Likewise. + * algol68/execute/environment-enquiries-1.a68: Likewise. + * algol68/execute/environment-enquiries-2.a68: Likewise. + * algol68/execute/environment-enquiries-3.a68: Likewise. + * algol68/execute/environment-enquiries-4.a68: Likewise. + * algol68/execute/environment-enquiries-5.a68: Likewise. + * algol68/execute/environment-enquiries-6.a68: Likewise. + * algol68/execute/environment-enquiries-7.a68: Likewise. + * algol68/execute/environment-enquiries-8.a68: Likewise. + * algol68/execute/eq-bits-1.a68: Likewise. + * algol68/execute/eq-char-char-1.a68: Likewise. + * algol68/execute/eq-int-1.a68: Likewise. + * algol68/execute/eq-string-1.a68: Likewise. + * algol68/execute/eq-string-stride-1.a68: Likewise. + * algol68/execute/execute.exp: Likewise. + * algol68/execute/factorial-1.a68: Likewise. + * algol68/execute/flat-assignation-1.a68: Likewise. + * algol68/execute/flat-assignation-2.a68: Likewise. + * algol68/execute/flex-1.a68: Likewise. + * algol68/execute/flex-2.a68: Likewise. + * algol68/execute/flex-3.a68: Likewise. + * algol68/execute/flex-4.a68: Likewise. + * algol68/execute/flex-5.a68: Likewise. + * algol68/execute/formula-1.a68: Likewise. + * algol68/execute/formula-2.a68: Likewise. + * algol68/execute/fsize-1.a68: Likewise. + * algol68/execute/ge-int-1.a68: Likewise. + * algol68/execute/ge-string-stride-1.a68: Likewise. + * algol68/execute/gen-flex-1.a68: Likewise. + * algol68/execute/gen-heap-1.a68: Likewise. + * algol68/execute/gen-heap-2.a68: Likewise. + * algol68/execute/gen-heap-3.a68: Likewise. + * algol68/execute/gen-heap-bool-1.a68: Likewise. + * algol68/execute/gen-heap-int-1.a68: Likewise. + * algol68/execute/gen-heap-real-1.a68: Likewise. + * algol68/execute/gen-heap-struct-1.a68: Likewise. + * algol68/execute/gen-heap-struct-2.a68: Likewise. + * algol68/execute/gen-heap-struct-3.a68: Likewise. + * algol68/execute/gen-loc-1.a68: Likewise. + * algol68/execute/gen-loc-2.a68: Likewise. + * algol68/execute/gen-loc-3.a68: Likewise. + * algol68/execute/gen-loc-4.a68: Likewise. + * algol68/execute/gen-multiple-1.a68: Likewise. + * algol68/execute/gen-union-1.a68: Likewise. + * algol68/execute/gen-union-2.a68: Likewise. + * algol68/execute/gen-union-3.a68: Likewise. + * algol68/execute/goto-1.a68: Likewise. + * algol68/execute/goto-2.a68: Likewise. + * algol68/execute/goto-3.a68: Likewise. + * algol68/execute/goto-4.a68: Likewise. + * algol68/execute/goto-5.a68: Likewise. + * algol68/execute/gt-int-1.a68: Likewise. + * algol68/execute/gt-string-stride-1.a68: Likewise. + * algol68/execute/i-1.a68: Likewise. + * algol68/execute/i-2.a68: Likewise. + * algol68/execute/identification-1.a68: Likewise. + * algol68/execute/identification-2.a68: Likewise. + * algol68/execute/identity-declaration-1.a68: Likewise. + * algol68/execute/identity-declaration-2.a68: Likewise. + * algol68/execute/identity-declaration-3.a68: Likewise. + * algol68/execute/identity-declaration-4.a68: Likewise. + * algol68/execute/identity-declaration-5.a68: Likewise. + * algol68/execute/identity-declaration-multiple-1.a68: Likewise. + * algol68/execute/identity-declaration-multiple-2.a68: Likewise. + * algol68/execute/identity-declaration-multiple-3.a68: Likewise. + * algol68/execute/identity-declaration-multiple-5.a68: Likewise. + * algol68/execute/identity-declaration-multiple-empty-1.a68: Likewise. + * algol68/execute/identity-declaration-multiple-empty-2.a68: Likewise. + * algol68/execute/identity-declaration-multiple-empty-3.a68: Likewise. + * algol68/execute/identity-declaration-multiple-empty-4.a68: Likewise. + * algol68/execute/identity-declaration-struct-1.a68: Likewise. + * algol68/execute/infinity-1.a68: Likewise. + * algol68/execute/le-ge-bits-1.a68: Likewise. + * algol68/execute/le-int-1.a68: Likewise. + * algol68/execute/le-string-stride-1.a68: Likewise. + * algol68/execute/leng-shorten-bits-1.a68: Likewise. + * algol68/execute/leng-shorten-ints-1.a68: Likewise. + * algol68/execute/leng-shorten-reals-1.a68: Likewise. + * algol68/execute/lengths-shorths-1.a68: Likewise. + * algol68/execute/lisp-1.a68: Likewise. + * algol68/execute/lisp-2.a68: Likewise. + * algol68/execute/ln-1.a68: Likewise. + * algol68/execute/log-1.a68: Likewise. + * algol68/execute/loop-1.a68: Likewise. + * algol68/execute/loop-10.a68: Likewise. + * algol68/execute/loop-11.a68: Likewise. + * algol68/execute/loop-12.a68: Likewise. + * algol68/execute/loop-13.a68: Likewise. + * algol68/execute/loop-14.a68: Likewise. + * algol68/execute/loop-2.a68: Likewise. + * algol68/execute/loop-3.a68: Likewise. + * algol68/execute/loop-4.a68: Likewise. + * algol68/execute/loop-5.a68: Likewise. + * algol68/execute/loop-6.a68: Likewise. + +2025-11-30 Jose E. Marchesi <jose.marchesi@oracle.com> + + * lib/algol68-dg.exp: New file. + * lib/algol68-torture.exp: Likewise. + * lib/algol68.exp: Likewise. + +2025-11-30 Nathaniel Shead <nathanieloshead@gmail.com> + + PR c++/119864 + * g++.dg/modules/omp-4_a.C: New test. + * g++.dg/modules/omp-4_b.C: New test. + +2025-11-29 Eczbek <eczbek.void@gmail.com> + Jason Merrill <jason@redhat.com> + + PR c++/116952 + * g++.dg/cpp2a/lambda-uneval14.C: Revise incorrect test. + * g++.dg/cpp2a/lambda-uneval29.C: New test. + +2025-11-29 Jakub Jelinek <jakub@redhat.com> + + PR c++/122758 + * g++.dg/cpp26/erroneous5.C: New test. + * g++.dg/cpp26/erroneous6.C: New test. + +2025-11-28 Richard Biener <rguenther@suse.de> + + PR tree-optimization/122844 + * gcc.dg/vect/vect-pr122844.c: New testcase. + +2025-11-28 Tobias Burnus <tburnus@baylibre.com> + + PR c/122892 + * gfortran.dg/gomp/allocate-15.f90: Use another allocator as + omp_{cgroup,pteam}_mem_alloc is invalid for non-local static vars. + * gfortran.dg/gomp/allocate-7.f90: Likewise. + * gfortran.dg/gomp/allocate-static-3.f90: New test. + +2025-11-28 Jakub Jelinek <jakub@redhat.com> + + PR c++/119969 + * g++.dg/torture/pr119969.C: New test. + +2025-11-28 Mark Zhuang <mark.zhuang@spacemit.com> + + * gcc.target/riscv/predef-smt-1.c: New test. + +2025-11-28 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/122733 + * gcc.dg/match-shift-cmp-4.c: New test. + * gcc.dg/match-shift-cmp-5.c: New test. + +2025-11-28 Tamar Christina <tamar.christina@arm.com> + + PR middle-end/122890 + * g++.target/aarch64/pr122890.C: New test. + +2025-11-27 Jakub Jelinek <jakub@redhat.com> + + PR c/121506 + * gcc.dg/pr121506.c: New test. + +2025-11-27 Matthieu Longo <matthieu.longo@arm.com> + + * gcc.target/aarch64/build-attributes/build-attribute-define-nok.c: New test. + * gcc.target/aarch64/build-attributes/build-attribute-define-ok.c: New test. + +2025-11-27 Wilco Dijkstra <wilco.dijkstra@arm.com> + + * gcc.target/aarch64/ffs.c: Improve test. + +2025-11-27 Andrew Pinski <andrew.pinski@oss.qualcomm.com> + + * c-c++-common/Wstringop-overflow.c: Xfail, PR 122881. + +2025-11-27 Robin Dapp <rdapp@ventanamicro.com> + + PR tree-optimization/122855 + PR tree-optimization/122850 + * gcc.dg/vect/pr122850.c: New test. + * gcc.dg/vect/pr122855.c: New test. + +2025-11-27 Pan Li <pan2.li@intel.com> + + * gcc.target/riscv/rvv/autovec/pr121959-run-1.c: Update + the reference for run test. + +2025-11-27 Dhruv Chawla <dhruvc@nvidia.com> + + PR tree-optimization/122733 + * gcc.dg/match-shift-cmp-1.c: Update test to only check + equality. + * gcc.dg/match-shift-cmp-2.c: Likewise. + * gcc.dg/match-shift-cmp-3.c: Likewise. + * gcc.dg/match-shift-cmp-4.c: Removed. + +2025-11-27 Richard Biener <rguenther@suse.de> + + PR tree-optimization/122885 + * gcc.dg/torture/pr122873.c: New testcase. + +2025-11-26 Jeff Law <jlaw@ventanamicro.com> + + Revert: + 2025-11-26 Zhongyao Chen <chenzhongyao.hit@gmail.com> + + * gcc.target/riscv/predef-profiles-1.c: New test for __riscv_rvi20u64. + * gcc.target/riscv/predef-profiles-2.c: New test for __riscv_rvi20u32. + * gcc.target/riscv/predef-profiles-3.c: New test for __riscv_rva20u64. + * gcc.target/riscv/predef-profiles-4.c: New test for __riscv_rva22u64. + * gcc.target/riscv/predef-profiles-5.c: New test for __riscv_rva23u64. + * gcc.target/riscv/predef-profiles-6.c: New test for __riscv_rva23s64. + * gcc.target/riscv/predef-profiles-7.c: New test for __riscv_rvb23u64. + * gcc.target/riscv/predef-profiles-8.c: New test for __riscv_rvb23s64. + +2025-11-26 Alejandro Colomar <alx@kernel.org> + + * gcc.dg/maxof-bitint.c: New test. + * gcc.dg/maxof-bitint575.c: New test. + * gcc.dg/maxof-compile.c: New test. + * gcc.dg/maxof-pedantic-errors.c: New test. + * gcc.dg/maxof-pedantic.c: New test. + +2025-11-26 Jeff Law <jlaw@ventanamicro.com> + + PR rtl-optimization/122735 + * gcc.dg/torture/pr122735.c: New test. + +2025-11-26 Tobias Burnus <tburnus@baylibre.com> + + * gfortran.dg/gomp/crayptr2.f90: Move dg-error line. + * gfortran.dg/gomp/declare-target-2.f90: Extend. + * gfortran.dg/gomp/declare-target-4.f90: Update comment, + enable one test. + * gfortran.dg/gomp/declare-target-5.f90: Update dg- wording, + add new test. + * gfortran.dg/gomp/declare-target-indirect-2.f90: Expect + 'device_type(any)' in scan-tree-dump. + * gfortran.dg/gomp/declare-target-6.f90: New test. + * gfortran.dg/gomp/dyn_groupprivate-1.f90: New test. + * gfortran.dg/gomp/dyn_groupprivate-2.f90: New test. + * gfortran.dg/gomp/groupprivate-1.f90: New test. + * gfortran.dg/gomp/groupprivate-2.f90: New test. + * gfortran.dg/gomp/groupprivate-3.f90: New test. + * gfortran.dg/gomp/groupprivate-4.f90: New test. + * gfortran.dg/gomp/groupprivate-5.f90: New test. + * gfortran.dg/gomp/groupprivate-6.f90: New test. + +2025-11-26 Marek Polacek <polacek@redhat.com> + + PR c++/121325 + * g++.dg/cpp26/pack-indexing18.C: New test. + +2025-11-26 Richard Earnshaw <rearnsha@arm.com> + + PR target/122867 + * gcc.target/arm/cbz-range.c: New test. + +2025-11-26 Tamar Christina <tamar.christina@arm.com> + + PR tree-optimization/122861 + * gcc.target/aarch64/sve/vect-early-break-cbranch_10.c: New test. + * gcc.target/aarch64/sve/vect-early-break-cbranch_11.c: New test. + * gcc.target/aarch64/sve/vect-early-break-cbranch_12.c: New test. + * gcc.target/aarch64/sve/vect-early-break-cbranch_13.c: New test. + * gcc.target/aarch64/sve/vect-early-break-cbranch_14.c: New test. + * gcc.target/aarch64/sve/vect-early-break-cbranch_15.c: New test. + * gcc.target/aarch64/sve/vect-early-break-cbranch_9.c: New test. + * gcc.target/aarch64/vect-early-break-cbranch_4.c: New test. + * gcc.target/aarch64/vect-early-break-cbranch_5.c: New test. + +2025-11-26 Jakub Jelinek <jakub@redhat.com> + + * lib/target-supports.exp: Set cxx_default to c++20 rather than + c++17. + * lib/g++-dg.exp (g++-std-flags): Reorder list to put 20 first + and 17 after 26. + * g++.dg/debug/pr80461.C (bar): Use v = v + 1; instead of ++v;. + * g++.dg/debug/pr94459.C: Add -std=gnu++17 to dg-options. + * g++.dg/diagnostic/virtual-constexpr.C: Remove dg-skip-if, + instead use { c++11 && c++17_down } effective target instead of + c++11. + * g++.dg/guality/pr67192.C: Add -std=gnu++17. + * g++.dg/torture/pr84961-1.C: Likewise. + * g++.dg/torture/pr84961-2.C: Likewise. + * g++.dg/torture/pr51482.C (anim_track_bez_wvect::tangent): Cast + key_class to int before multiplying it by float. + * g++.dg/torture/stackalign/unwind-4.C (foo): Use g_a = g_a + 1; + instead of g_a++;. + * g++.dg/tree-prof/partition1.C (bar): Use l = l + 1; return l; + instead of return ++l;. + * obj-c++.dg/exceptions-3.mm: Add -std=gnu++17. + * obj-c++.dg/exceptions-5.mm: Likewise. + +2025-11-26 Jakub Jelinek <jakub@redhat.com> + + PR middle-end/122835 + * gcc.dg/torture/pr122835.c: New test. + +2025-11-26 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/119683 + * gcc.dg/tree-ssa/pr119683.c: New test. + +2025-11-26 Richard Biener <rguenther@suse.de> + + * gcc.dg/vect/vect-simd-clone-22.c: Add -w. + * gcc.dg/vect/vect-simd-clone-23.c: Likewise. + +2025-11-26 Soumya AR <soumyaa@nvidia.com> + + * gcc.target/aarch64/aarch64-json-tunings/aarch64-json-tunings.exp: New test. + * gcc.target/aarch64/aarch64-json-tunings/boolean-1.c: New test. + * gcc.target/aarch64/aarch64-json-tunings/boolean-1.json: New test. + * gcc.target/aarch64/aarch64-json-tunings/boolean-2.c: New test. + * gcc.target/aarch64/aarch64-json-tunings/boolean-2.json: New test. + * gcc.target/aarch64/aarch64-json-tunings/empty-brackets.c: New test. + * gcc.target/aarch64/aarch64-json-tunings/empty-brackets.json: New test. + * gcc.target/aarch64/aarch64-json-tunings/empty.c: New test. + * gcc.target/aarch64/aarch64-json-tunings/empty.json: New test. + * gcc.target/aarch64/aarch64-json-tunings/enum-1.c: New test. + * gcc.target/aarch64/aarch64-json-tunings/enum-1.json: New test. + * gcc.target/aarch64/aarch64-json-tunings/enum-2.c: New test. + * gcc.target/aarch64/aarch64-json-tunings/enum-2.json: New test. + * gcc.target/aarch64/aarch64-json-tunings/integer-1.c: New test. + * gcc.target/aarch64/aarch64-json-tunings/integer-1.json: New test. + * gcc.target/aarch64/aarch64-json-tunings/integer-2.c: New test. + * gcc.target/aarch64/aarch64-json-tunings/integer-2.json: New test. + * gcc.target/aarch64/aarch64-json-tunings/integer-3.c: New test. + * gcc.target/aarch64/aarch64-json-tunings/integer-3.json: New test. + * gcc.target/aarch64/aarch64-json-tunings/string-1.c: New test. + * gcc.target/aarch64/aarch64-json-tunings/string-1.json: New test. + * gcc.target/aarch64/aarch64-json-tunings/string-2.c: New test. + * gcc.target/aarch64/aarch64-json-tunings/string-2.json: New test. + * gcc.target/aarch64/aarch64-json-tunings/test-all.c: New test. + * gcc.target/aarch64/aarch64-json-tunings/test-all.json: New test. + * gcc.target/aarch64/aarch64-json-tunings/unidentified-key.c: New test. + * gcc.target/aarch64/aarch64-json-tunings/unidentified-key.json: New test. + * gcc.target/aarch64/aarch64-json-tunings/unsigned-1.c: New test. + * gcc.target/aarch64/aarch64-json-tunings/unsigned-1.json: New test. + * gcc.target/aarch64/aarch64-json-tunings/unsigned-2.c: New test. + * gcc.target/aarch64/aarch64-json-tunings/unsigned-2.json: New test. + * gcc.target/aarch64/aarch64-json-tunings/unsigned-3.c: New test. + * gcc.target/aarch64/aarch64-json-tunings/unsigned-3.json: New test. + +2025-11-26 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/104650 + * gfortran.dg/pdt_70.f03: New test. + +2025-11-26 Dhruv Chawla <dhruvc@nvidia.com> + + PR middle-end/116815 + * gcc.target/aarch64/pr116815-1.c: New test. + * gcc.target/aarch64/pr116815-2.c: Likewise. + * gcc.target/aarch64/pr116815-3.c: Likewise. + +2025-11-26 Pan Li <pan2.li@intel.com> + + * gcc.target/riscv/sat/sat_arith.h: Add test helper macros. + * gcc.target/riscv/sat/sat_u_mul-8-u16-from-u128.c: New test. + * gcc.target/riscv/sat/sat_u_mul-8-u16-from-u32.c: New test. + * gcc.target/riscv/sat/sat_u_mul-8-u16-from-u64.rv32.c: New test. + * gcc.target/riscv/sat/sat_u_mul-8-u16-from-u64.rv64.c: New test. + * gcc.target/riscv/sat/sat_u_mul-8-u32-from-u128.c: New test. + * gcc.target/riscv/sat/sat_u_mul-8-u32-from-u64.rv32.c: New test. + * gcc.target/riscv/sat/sat_u_mul-8-u32-from-u64.rv64.c: New test. + * gcc.target/riscv/sat/sat_u_mul-8-u64-from-u128.c: New test. + * gcc.target/riscv/sat/sat_u_mul-8-u8-from-u128.c: New test. + * gcc.target/riscv/sat/sat_u_mul-8-u8-from-u16.c: New test. + * gcc.target/riscv/sat/sat_u_mul-8-u8-from-u32.c: New test. + * gcc.target/riscv/sat/sat_u_mul-8-u8-from-u64.rv32.c: New test. + * gcc.target/riscv/sat/sat_u_mul-8-u8-from-u64.rv64.c: New test. + * gcc.target/riscv/sat/sat_u_mul-run-8-u16-from-u128.c: New test. + * gcc.target/riscv/sat/sat_u_mul-run-8-u16-from-u32.c: New test. + * gcc.target/riscv/sat/sat_u_mul-run-8-u16-from-u64.c: New test. + * gcc.target/riscv/sat/sat_u_mul-run-8-u32-from-u128.c: New test. + * gcc.target/riscv/sat/sat_u_mul-run-8-u32-from-u64.c: New test. + * gcc.target/riscv/sat/sat_u_mul-run-8-u64-from-u128.c: New test. + * gcc.target/riscv/sat/sat_u_mul-run-8-u8-from-u128.c: New test. + * gcc.target/riscv/sat/sat_u_mul-run-8-u8-from-u16.c: New test. + * gcc.target/riscv/sat/sat_u_mul-run-8-u8-from-u32.c: New test. + * gcc.target/riscv/sat/sat_u_mul-run-8-u8-from-u64.c: New test. + +2025-11-26 Andrew Pinski <andrew.pinski@oss.qualcomm.com> + + PR tree-optimization/122847 + * gcc.dg/torture/pr122847-1.c: New test. + +2025-11-25 Lúcio Boari Fleury <lucboari@gmail.com> + + * rust/compile/macros/mbe/macro-issue3608.rs: New Test. The test skips an issue at line 11 + +2025-11-25 Philip Herron <herron.philip@googlemail.com> + + * rust/compile/gat1.rs: New test. + * rust/execute/torture/gat1.rs: New test. + +2025-11-25 Lucas Ly Ba <lucas.ly-ba@outlook.com> + + * rust/compile/issue-3971.rs: New test. + +2025-11-25 Lucas Ly Ba <lucas.ly-ba@outlook.com> + + * rust/compile/issue-4226.rs: New test. + +2025-11-25 Yap Zhi Heng <yapzhhg@gmail.com> + + * rust/compile/e0579-neg-float-fail.rs: New file. + * rust/compile/e0579-neg-float.rs: New file. + +2025-11-25 Lucas Ly Ba <lucas.ly-ba@outlook.com> + + * rust/compile/issue-4262.rs: New test. + +2025-11-25 lenny.chiadmi-delage <lenny.chiadmi-delage@epita.fr> + + * rust/compile/issue-4140-1.rs: Fixes test. + * rust/compile/issue-4140-2.rs: Likewise. + +2025-11-25 lenny.chiadmi-delage <lenny.chiadmi-delage@epita.fr> + + * rust/compile/issue-4140-1.rs: New test. + * rust/compile/issue-4140-2.rs: Likewise. + +2025-11-25 David Malcolm <dmalcolm@redhat.com> + + * gcc.dg/analyzer/strchr-1.c: Drop include of <string.h>, and use + __builtin_strchr throughout rather than strchr to avoid const + correctness issues when the header implements strchr with a C23 + const-preserving macro. Drop "const" from two vars. + +2025-11-25 Tamar Christina <tamar.christina@arm.com> + + PR target/118974 + * gcc.target/aarch64/sve/pr119351.c: Update codegen. + * gcc.target/aarch64/sve/vect-early-break-cbranch.c: Likewise. + * gcc.target/aarch64/vect-early-break-cbranch.c: Likewise. + * gcc.target/aarch64/sve/vect-early-break-cbranch_2.c: New test. + * gcc.target/aarch64/sve/vect-early-break-cbranch_3.c: New test. + * gcc.target/aarch64/sve/vect-early-break-cbranch_4.c: New test. + * gcc.target/aarch64/sve/vect-early-break-cbranch_5.c: New test. + * gcc.target/aarch64/sve/vect-early-break-cbranch_7.c: New test. + * gcc.target/aarch64/sve/vect-early-break-cbranch_8.c: New test. + * gcc.target/aarch64/vect-early-break-cbranch_2.c: New test. + * gcc.target/aarch64/vect-early-break-cbranch_3.c: New test. + +2025-11-25 Nathaniel Shead <nathanieloshead@gmail.com> + + PR c++/122699 + * g++.dg/modules/tpl-friend-21_a.C: New test. + * g++.dg/modules/tpl-friend-21_b.C: New test. + +2025-11-25 Andre Vieira <andre.simoesdiasvieira@arm.com> + + * gcc.dg/Wstringop-overflow-47.c: Adjust warnings to allow for 32-bit + stores. + +2025-11-25 Nathaniel Shead <nathanieloshead@gmail.com> + + PR c++/122789 + * g++.dg/modules/concept-12_a.C: New test. + * g++.dg/modules/concept-12_b.C: New test. + +2025-11-25 Jason Merrill <jason@redhat.com> + + * g++.dg/modules/compile-std1.C: New test. + * g++.dg/modules/modules.exp: Only run it once. + +2025-11-25 Jakub Jelinek <jakub@redhat.com> + + PR middle-end/120052 + * c-c++-common/gomp/pr120052.c: New test. + +2025-11-25 Jakub Jelinek <jakub@redhat.com> + + PR testsuite/119931 + * gcc.dg/vla-1.c (main): Hide x value from optimizers and use it after + the call as well. + +2025-11-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + * g++.dg/DRs/dr2581-1.C (__STDC_ISO_10646__): xfail on non-Linux. + * g++.dg/DRs/dr2581-2.C: Likewise. + (__STDC_VERSION__): Expect error instead of warning on Solaris. + +2025-11-25 Jakub Jelinek <jakub@redhat.com> + + PR middle-end/120564 + * c-c++-common/gomp/pr120564.c: New test. + +2025-11-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + * gcc.target/i386/pr120936-1.c: Restrict to *-*-linux*. + * gcc.target/i386/pr120936-2.c: Likewise. + * gcc.target/i386/pr120936-4.c: Likewise. + * gcc.target/i386/pr120936-5.c: Likewise. + * gcc.target/i386/pr120936-9.c: Likewise. + * gcc.target/i386/pr120936-11.c: Likewise. + +2025-11-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + * gcc.target/i386/pr120936-3.c: Restrict to *-*-linux*. + * gcc.target/i386/pr120936-6.c: Likewise. + * gcc.target/i386/pr120936-10.c: Likewise. + * gcc.target/i386/pr120936-12.c: Likewise. + +2025-11-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + * lib/target-supports.exp (add_options_for_check_function_bodies): + New proc. + * g++.target/i386/cf_check-3.C: Add dg-add-options + check_function_bodies. + * g++.target/i386/cf_check-4.C: Likewise. + * gcc.target/i386/builtin-copysign-2.c: Likewise. + * gcc.target/i386/builtin-copysign-3.c: Likewise. + * gcc.target/i386/builtin-copysign-4.c: Likewise. + * gcc.target/i386/builtin-copysign-5.c: Likewise. + * gcc.target/i386/builtin-copysign-6.c: Likewise. + * gcc.target/i386/builtin-copysign-7.c: Likewise. + * gcc.target/i386/builtin-copysign-8a.c: Likewise. + * gcc.target/i386/builtin-copysign-8b.c: Likewise. + * gcc.target/i386/builtin-fabs-1.c: Likewise. + * gcc.target/i386/builtin-memmove-10.c: Likewise. + * gcc.target/i386/builtin-memmove-11a.c: Likewise. + * gcc.target/i386/builtin-memmove-11b.c: Likewise. + * gcc.target/i386/builtin-memmove-11c.c: Likewise. + * gcc.target/i386/builtin-memmove-12.c: Likewise. + * gcc.target/i386/builtin-memmove-13.c: Likewise. + * gcc.target/i386/builtin-memmove-14.c: Likewise. + * gcc.target/i386/builtin-memmove-15.c: Likewise. + * gcc.target/i386/builtin-memmove-1a.c: Likewise. + * gcc.target/i386/builtin-memmove-1b.c: Likewise. + * gcc.target/i386/builtin-memmove-1c.c: Likewise. + * gcc.target/i386/builtin-memmove-1d.c: Likewise. + * gcc.target/i386/builtin-memmove-2a.c: Likewise. + * gcc.target/i386/builtin-memmove-2b.c: Likewise. + * gcc.target/i386/builtin-memmove-2c.c: Likewise. + * gcc.target/i386/builtin-memmove-2d.c: Likewise. + * gcc.target/i386/builtin-memmove-3a.c: Likewise. + * gcc.target/i386/builtin-memmove-3b.c: Likewise. + * gcc.target/i386/builtin-memmove-3c.c: Likewise. + * gcc.target/i386/builtin-memmove-4a.c: Likewise. + * gcc.target/i386/builtin-memmove-4b.c: Likewise. + * gcc.target/i386/builtin-memmove-4c.c: Likewise. + * gcc.target/i386/builtin-memmove-5a.c: Likewise. + * gcc.target/i386/builtin-memmove-5b.c: Likewise. + * gcc.target/i386/builtin-memmove-5c.c: Likewise. + * gcc.target/i386/builtin-memmove-6.c: Likewise. + * gcc.target/i386/builtin-memmove-7.c: Likewise. + * gcc.target/i386/builtin-memmove-8.c: Likewise. + * gcc.target/i386/builtin-memmove-9.c: Likewise. + * gcc.target/i386/cf_check-11.c: Likewise. + * gcc.target/i386/cf_check-7.c: Likewise. + * gcc.target/i386/pr120936-1.c: Likewise. + * gcc.target/i386/pr120936-11.c: Likewise. + * gcc.target/i386/pr120936-2.c: Likewise. + * gcc.target/i386/pr120936-4.c: Likewise. + * gcc.target/i386/pr120936-5.c: Likewise. + * gcc.target/i386/pr120936-9.c: Likewise. + * g++.target/i386/memset-pr101366-1.C: Switch to dg-add-options + check_function_bodies. + * g++.target/i386/memset-pr101366-2.C: Likewise. + * g++.target/i386/memset-pr108585-1a.C: Likewise. + * g++.target/i386/memset-pr108585-1b.C: Likewise. + * g++.target/i386/memset-pr118276-1a.C: Likewise. + * g++.target/i386/memset-pr118276-1b.C: Likewise. + * g++.target/i386/memset-pr118276-1c.C: Likewise. + * gcc.target/i386/memcpy-pr120683-1.c: Likewise. + * gcc.target/i386/memcpy-pr120683-2.c: Likewise. + * gcc.target/i386/memcpy-pr120683-3.c: Likewise. + * gcc.target/i386/memcpy-pr120683-4.c: Likewise. + * gcc.target/i386/memcpy-pr120683-5.c: Likewise. + * gcc.target/i386/memcpy-pr120683-6.c: Likewise. + * gcc.target/i386/memcpy-pr120683-7.c: Likewise. + * gcc.target/i386/memcpy-strategy-12.c: Likewise. + * gcc.target/i386/memset-pr120683-1.c: Likewise. + * gcc.target/i386/memset-pr120683-10.c: Likewise. + * gcc.target/i386/memset-pr120683-11.c: Likewise. + * gcc.target/i386/memset-pr120683-12.c: Likewise. + * gcc.target/i386/memset-pr120683-13.c: Likewise. + * gcc.target/i386/memset-pr120683-14.c: Likewise. + * gcc.target/i386/memset-pr120683-15.c: Likewise. + * gcc.target/i386/memset-pr120683-16.c: Likewise. + * gcc.target/i386/memset-pr120683-17.c: Likewise. + * gcc.target/i386/memset-pr120683-18.c: Likewise. + * gcc.target/i386/memset-pr120683-19.c: Likewise. + * gcc.target/i386/memset-pr120683-2.c: Likewise. + * gcc.target/i386/memset-pr120683-20.c: Likewise. + * gcc.target/i386/memset-pr120683-21.c: Likewise. + * gcc.target/i386/memset-pr120683-22.c: Likewise. + * gcc.target/i386/memset-pr120683-23.c: Likewise. + * gcc.target/i386/memset-pr120683-3.c: Likewise. + * gcc.target/i386/memset-pr120683-4.c: Likewise. + * gcc.target/i386/memset-pr120683-5.c: Likewise. + * gcc.target/i386/memset-pr120683-6.c: Likewise. + * gcc.target/i386/memset-pr120683-7.c: Likewise. + * gcc.target/i386/memset-pr120683-8.c: Likewise. + * gcc.target/i386/memset-pr120683-9.c: Likewise. + * gcc.target/i386/memset-pr70308-1a.c: Likewise. + * gcc.target/i386/memset-pr70308-1b.c: Likewise. + * gcc.target/i386/memset-strategy-10.c: Likewise. + * gcc.target/i386/memset-strategy-13.c: Likewise. + * gcc.target/i386/memset-strategy-25.c: Likewise. + * gcc.target/i386/memset-strategy-28.c: Likewise. + * gcc.target/i386/memset-strategy-29.c: Likewise. + * gcc.target/i386/memset-strategy-30.c: Likewise. + * gcc.target/i386/pr111673.c: Likewise. + * gcc.target/i386/pr82142a.c: Likewise. + * gcc.target/i386/pr82142b.c: Likewise. + * gcc.target/i386/pr92080-17.c: Likewise. + +2025-11-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + * gcc.dg/debug/dwarf2/dwarf-btf-decl-tag-1.c + (scan-assembler-times): Switch to brace quotes. + Allow for alternative assembler syntax. + * gcc.dg/debug/dwarf2/dwarf-btf-type-tag-1.c: Likewise. + * gcc.dg/debug/dwarf2/dwarf-btf-type-tag-10.c: Likewise. + * gcc.dg/debug/dwarf2/dwarf-btf-type-tag-2.c: Likewise. + * gcc.dg/debug/dwarf2/dwarf-btf-type-tag-4.c: Likewise. + * gcc.dg/debug/dwarf2/dwarf-btf-type-tag-5.c: Likewise. + +2025-11-24 Robin Dapp <rdapp.gcc@gmail.com> + + * gcc.target/riscv/rvv/autovec/pr121582.c: New test. + +2025-11-24 Robin Dapp <rdapp@ventanamicro.com> + + PR tree-optimization/122797 + * gcc.dg/vect/pr122797.c: New test. + +2025-11-24 Robin Dapp <rdapp@ventanamicro.com> + + * gcc.target/powerpc/builtins-1.c: Adjust test expectation. + * gcc.target/riscv/rvv/autovec/pr118019-3.c: New test. + +2025-11-24 Andrew Pinski <andrew.pinski@oss.qualcomm.com> + Richard Biener <rguenther@suse.de> + + PR tree-optimization/116835 + * gcc.dg/torture/pr116835.c: New test. + * gcc.dg/tree-ssa/phiprop-6.c: New test. + * gcc.dg/tree-ssa/phiprop-7.c: New test. + +2025-11-24 Andrew Pinski <andrew.pinski@oss.qualcomm.com> + + PR tree-optimization/60183 + * gcc.dg/tree-ssa/phiprop-5.c: New test. + +2025-11-24 Andrew Pinski <andrew.pinski@oss.qualcomm.com> + + PR tree-optimization/60183 + * gcc.dg/tree-ssa/phiprop-3.c: New test. + * gcc.dg/tree-ssa/phiprop-4.c: New test. + +2025-11-24 Andrew Pinski <andrew.pinski@oss.qualcomm.com> + + * g++.dg/tree-ssa/simple-dse-3.C: un-xfail. + +2025-11-24 Andrew Pinski <andrew.pinski@oss.qualcomm.com> + + PR tree-optimization/122633 + * g++.dg/tree-ssa/simple-dse-1.C: New test. + * g++.dg/tree-ssa/simple-dse-2.C: New test. + * g++.dg/tree-ssa/simple-dse-3.C: New test. + * g++.dg/tree-ssa/simple-dse-4.C: New test. + +2025-11-24 Marek Polacek <polacek@redhat.com> + + PR c++/119964 + * g++.dg/cpp1y/defaulted1.C: New test. + * g++.dg/cpp1y/defaulted2.C: New test. + +2025-11-24 Yury Khrustalev <yury.khrustalev@arm.com> + + PR debug/121964 + * g++.target/aarch64/dwarf-bit-stride-func.C: New test. + * g++.target/aarch64/dwarf-bit-stride-pragma.C: New test. + * g++.target/aarch64/dwarf-bit-stride-pragma-sme.C: New test. + * g++.target/aarch64/sve/dwarf-bit-stride.C: New test. + * gcc.target/aarch64/dwarf-bit-stride-func.c: New test. + * gcc.target/aarch64/dwarf-bit-stride-pragma.c: New test. + * gcc.target/aarch64/dwarf-bit-stride-pragma-sme.c: New test. + * gcc.target/aarch64/sve/dwarf-bit-stride.c: New test. + +2025-11-24 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/122766 + * gfortran.dg/pdt_69.f03: New test. + +2025-11-24 Richard Biener <rguenther@suse.de> + + * gcc.dg/vect/bb-slp-41.c: Adjust dump scan. + +2025-11-24 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/object_overflow6.adb: New test. + +2025-11-24 liuhongt <hongtao.liu@intel.com> + + PR target/122503 + * g++.target/i386/pr116896-1.C: Add -mtune=generic to + dg-options. + * gcc.target/i386/pr116896.c: Ditto. + +2025-11-23 Pan Li <pan2.li@intel.com> + + * gcc.dg/tree-ssa/bit_op_cvt.1.c: New test. + * gcc.dg/tree-ssa/bit_op_cvt.2.c: New test. + * gcc.dg/tree-ssa/bit_op_cvt.3.c: New test. + * gcc.dg/tree-ssa/bit_op_cvt.4.c: New test. + * gcc.dg/tree-ssa/bit_op_cvt.5.c: New test. + * gcc.dg/tree-ssa/bit_op_cvt.6.c: New test. + * gcc.dg/tree-ssa/bit_op_cvt.h: New test. + +2025-11-23 Kugan Vivekanandarajah <kvivekananda@nvidia.com> + + * gcc.dg/vect/vect-licm-hoist-1.c: New. + * gcc.dg/vect/vect-licm-hoist-2.c: Likewise. + +2025-11-23 Sandra Loosemore <sloosemore@baylibre.com> + + * c-c++-common/gomp/delim-declare-variant-6.c (f3): Use "x86" + instead of "x86_64" in the arch selector, to match both 64- and + 32-bit targets. + +2025-11-22 Nathaniel Shead <nathanieloshead@gmail.com> + + PR c++/122636 + * g++.dg/modules/internal-19_a.C: New test. + * g++.dg/modules/internal-19_b.C: New test. + +2025-11-22 Nathaniel Shead <nathanieloshead@gmail.com> + + * g++.dg/cpp2a/is-pointer-interconvertible-base-of2.C: New test. + +2025-11-22 Nathaniel Shead <nathanieloshead@gmail.com> + + * g++.dg/cpp2a/is-layout-compatible4.C: New test. + +2025-11-22 Nathaniel Shead <nathanieloshead@gmail.com> + + * g++.dg/cpp1z/has-unique-obj-representations5.C: New test. + +2025-11-22 Nathaniel Shead <nathanieloshead@gmail.com> + + * g++.dg/ext/is_destructible3.C: Add test for function type. + +2025-11-22 Nathaniel Shead <nathanieloshead@gmail.com> + + * g++.dg/ext/is_virtual_base_of_diagnostic2.C: Adjust + diagnostic. + +2025-11-22 Nathaniel Shead <nathanieloshead@gmail.com> + + * g++.dg/cpp2a/is-layout-compatible3.C: Adjust expected results. + +2025-11-22 Jeff Law <jlaw@ventanamicro.com> + + PR rtl-optimization/122701 + * gcc.dg/torture/pr122701.c: New test. + +2025-11-22 Sandra Loosemore <sloosemore@baylibre.com> + Tobias Burnus <tburnus@baylibre.com> + + * c-c++-common/gomp/delim-declare-variant-1.c: New. + * c-c++-common/gomp/delim-declare-variant-2.c: New. + * c-c++-common/gomp/delim-declare-variant-3.c: New. + * c-c++-common/gomp/delim-declare-variant-4.c: New. + * c-c++-common/gomp/delim-declare-variant-5.c: New. + * c-c++-common/gomp/delim-declare-variant-6.c: New. + * c-c++-common/gomp/delim-declare-variant-7.c: New. + * c-c++-common/gomp/delim-declare-variant-8.c: New. + * c-c++-common/gomp/delim-declare-variant-9.c: New. + +2025-11-22 Sandra Loosemore <sloosemore@baylibre.com> + Julian Brown <julian@codesourcery.com> + waffl3x <waffl3x@baylibre.com> + + * g++.dg/gomp/delim-declare-variant-1.C: New. + * g++.dg/gomp/delim-declare-variant-2.C: New. + * g++.dg/gomp/delim-declare-variant-3.C: New. + * g++.dg/gomp/delim-declare-variant-4.C: New. + * g++.dg/gomp/delim-declare-variant-5.C: New. + * g++.dg/gomp/delim-declare-variant-6.C: New. + * g++.dg/gomp/delim-declare-variant-7.C: New. + * g++.dg/gomp/delim-declare-variant-40.C: New. + * g++.dg/gomp/delim-declare-variant-41.C: New. + * g++.dg/gomp/delim-declare-variant-50.C: New. + * g++.dg/gomp/delim-declare-variant-51.C: New. + * g++.dg/gomp/delim-declare-variant-52.C: New. + * g++.dg/gomp/delim-declare-variant-70.C: New. + * g++.dg/gomp/delim-declare-variant-71.C: New. + +2025-11-22 Jakub Jelinek <jakub@redhat.com> + + PR c++/122788 + * g++.dg/cpp26/expansion-stmt27.C: New test. + +2025-11-22 Jakub Jelinek <jakub@redhat.com> + + PR c++/122185 + * g++.dg/cpp1z/pr122185.C: New test. + +2025-11-22 zhaozhou <zhaozhou@loongson.cn> + + * gcc.target/loongarch/vector/lasx/lasx-struct-move.c: New test. + +2025-11-22 Deng Jianbo <dengjianbo@loongson.cn> + + * gcc.target/loongarch/bstrins-5.c: New test. + * gcc.target/loongarch/bstrins-6.c: New test. + +2025-11-22 zhaozhou <zhaozhou@loongson.cn> + + * gcc.target/loongarch/vector/lsx/lsx-vec-construct-opt.c: + +2025-11-22 Daniele Sahebi <daniele@mkryss.me> + Jakub Jelinek <jakub@redhat.com> + + PR c++/122658 + * g++.dg/cpp2a/consteval42.C: New test. + +2025-11-21 Vladimir N. Makarov <vmakarov@redhat.com> + + PR target/118358 + * gcc.target/xstormy16/pr118358.c: New. + +2025-11-21 Richard Biener <rguenther@suse.de> + + PR tree-optimization/122762 + PR tree-optimization/122736 + PR tree-optimization/122790 + * gcc.dg/vect/vect-simd-clone-23.c: New testcase. + +2025-11-21 Richard Biener <rguenther@suse.de> + + PR tree-optimization/122778 + * gcc.dg/vect/vect-simd-clone-22.c: New testcase. + * gcc.dg/vect/vect-simd-clone-22a.c: Likewise. + +2025-11-21 Marek Polacek <polacek@redhat.com> + + PR c++/120529 + * g++.dg/ext/reference_xes_from_temporary1.C: New test. + +2025-11-21 Jakub Jelinek <jakub@redhat.com> + + PR c++/121445 + * g++.dg/cpp1y/constexpr-121445.C: New test. + +2025-11-21 Jakub Jelinek <jakub@redhat.com> + + PR target/122598 + * gcc.target/i386/pr122598.c: New test. + +2025-11-21 Jakub Jelinek <jakub@redhat.com> + + PR middle-end/122773 + * gcc.dg/pr122773.c: New test. + +2025-11-21 Loeka Rogge <loeka@synopsys.com> + Keith Packard <keithp@keithp.com> + + PR target/120375 + * gcc.target/arc/no-barrel-shifter.c: New test. + +2025-11-21 Claudiu Zissulescu <claziss@gmail.com> + Michiel Derhaeg <michiel@synopsys.com> + + * gcc.target/arc/extvsi-3.c: New test. + +2025-11-21 Deng Jianbo <dengjianbo@loongson.cn> + + * gcc.target/loongarch/vector/lasx/lasx-builtin.c: Replace xvrepli + with xvldi. + * gcc.target/loongarch/vector/lasx/lasx-vec-init-2.c: Fix test. + * gcc.target/loongarch/vector/lsx/lsx-builtin.c: Repalce vrepli with + vldi. + * gcc.target/loongarch/vrepli.c: Ditto. + * gcc.target/loongarch/vector/lasx/lasx-xvldi-2.c: New test. + * gcc.target/loongarch/vector/lsx/lsx-vldi-2.c: New test. + +2025-11-20 Kito Cheng <kito.cheng@sifive.com> + + * gcc.target/riscv/pr113715.c: New test. + * gcc.target/riscv/rv32e_zcmp.c: Update expected output for + test_popretz. + * gcc.target/riscv/rv32i_zcmp.c: Likewise. + +2025-11-20 Pan Li <pan2.li@intel.com> + + PR target/122692 + * g++.target/riscv/pr122692-run-1.C: New test. + * g++.target/riscv/pr122692-run-2.C: New test. + +2025-11-20 Xi Ruoyao <xry111@xry111.site> + + PR target/122695 + * gcc.target/loongarch/pr122695-1.c: New test. + * gcc.target/loongarch/pr122695-2.c: New test. + +2025-11-20 Jakub Jelinek <jakub@redhat.com> + + PR c++/120876 + * g++.dg/parse/crash81.C: New test. + +2025-11-19 Andrew MacLeod <amacleod@redhat.com> + + PR tree-optimization/122756 + * gcc.dg/pr122756.c: New. + +2025-11-19 Marek Polacek <polacek@redhat.com> + + PR c++/119580 + * g++.dg/template/crash106.C: Adjust expected diagnostics. + * g++.dg/template/crash112.C: Likewise. + * g++.dg/template/dependent-args1.C: Likewise. + * g++.dg/cpp0x/pr119580.C: New test. + +2025-11-19 Andrew Pinski <andrew.pinski@oss.qualcomm.com> + + PR tree-optimization/122754 + * g++.dg/tree-ssa/string-strlen-1.C: New test. + +2025-11-19 Alfie Richards <alfie.richards@arm.com> + + PR target/122763 + * gcc.target/aarch64/pr122763.c: New test. + +2025-11-19 Patrick Palka <ppalka@redhat.com> + + PR c++/122668 + PR c++/114764 + * g++.dg/cpp0x/noexcept91.C: New test. + +2025-11-19 Tamar Christina <tamar.christina@arm.com> + + * gcc.target/aarch64/simd/fold_to_highpart_6.c: Update codegen. + * gcc.target/aarch64/sve/fold_to_highpart_1.c: New test. + * gcc.target/aarch64/sve/fold_to_highpart_2.c: New test. + +2025-11-19 Richard Biener <rguenther@suse.de> + + PR tree-optimization/122722 + * gcc.dg/vect/slp-reduc-14.c: New testcase. + +2025-11-19 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/121519 + * gcc.dg/pr121519.c: Add testcase for already fixed PR. + +2025-11-19 Christophe Lyon <christophe.lyon@linaro.org> + + * gcc.target/arm/mve/intrinsics/vgetq_lane_f16.c: Add missing + extern "C". Remove dg-skip-if. + * gcc.target/arm/mve/intrinsics/vgetq_lane_f32.c: Likewise. + * gcc.target/arm/mve/intrinsics/vgetq_lane_s16.c: Likewise. + * gcc.target/arm/mve/intrinsics/vgetq_lane_s32.c: Likewise. + * gcc.target/arm/mve/intrinsics/vgetq_lane_s8.c: Likewise. + * gcc.target/arm/mve/intrinsics/vgetq_lane_u16.c: Likewise. + * gcc.target/arm/mve/intrinsics/vgetq_lane_u32.c: Likewise. + * gcc.target/arm/mve/intrinsics/vgetq_lane_u8.c: Likewise. + * gcc.target/arm/mve/intrinsics/vgetq_lane_s64.c: Likewise. Add + check-function-bodies. + * gcc.target/arm/mve/intrinsics/vgetq_lane_u64.c: Likewise. + +2025-11-19 Richard Biener <rguenther@suse.de> + + PR tree-optimization/122747 + * gcc.target/i386/vect-epilogues-10.c: New testcase. + +2025-11-19 Jakub Jelinek <jakub@redhat.com> + + * g++.dg/DRs/dr1670-1.C: New test. + * g++.dg/DRs/dr1670-2.C: New test. + * g++.dg/DRs/dr1670-3.C: New test. + * g++.dg/modules/auto-1_a.H: Use dg-options instead of + dg-additional-options. + * g++.dg/modules/auto-1_b.C: Likewise. + * g++.dg/cpp1y/auto-fn12.C: Likewise. + * g++.dg/cpp1y/auto-fn13.C: Add empty dg-options. + * g++.dg/cpp1y/auto-fn22.C: Likewise. + * g++.dg/cpp1y/constexpr-assert2.C: Likewise. + * g++.dg/cpp1y/auto-fn44.C: Add dg-options -Wpedantic and expect + further warnings. + * g++.dg/cpp1y/auto-fn50.C: Likewise. + * g++.dg/cpp0x/auto9.C: Expect two errors always rather than just + for C++11. + +2025-11-19 Jakub Jelinek <jakub@redhat.com> + + PR libstdc++/122671 + * g++.dg/cpp26/constexpr-eh17.C: New test. + +2025-11-19 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/122184 + * g++.dg/opt/pr122184-1.C: New test. + * g++.dg/opt/pr122184-2.C: New test. + +2025-11-19 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + * c-c++-common/asan/pr59063-2.c: Enable on Solaris. + +2025-11-19 Avinash Jayakar <avinashd@linux.ibm.com> + + PR target/119130 + * gcc.target/powerpc/builtins-1-p9-runnable.c: Use same expected + results for both endian format. + +2025-11-19 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR fortran/32365 + * gfortran.dg/goacc/routine-1.f90: Adjust dg-error format. + * gfortran.dg/goacc/routine-2.f90: Adjust dg-error format. + * gfortran.dg/gomp/declare-variant-17.f90: Adjust dg-error format. + * gfortran.dg/gomp/order-2.f90: Adjust dg-error format. + * gfortran.dg/gomp/pr78026.f03: Adjust dg-error format. + * gfortran.dg/gomp/requires-4.f90: Adjust dg-error format. + * gfortran.dg/gomp/requires-6.f90: Adjust dg-error format. + +2025-11-18 Christophe Lyon <christophe.lyon@linaro.org> + + * gcc.target/arm/mve/intrinsics/vsetq_lane_f16_bounds.c: New test. + * gcc.target/arm/mve/intrinsics/vsetq_lane_f32_bounds.c: New test. + * gcc.target/arm/mve/intrinsics/vsetq_lane_s16_bounds.c: New test. + * gcc.target/arm/mve/intrinsics/vsetq_lane_s32_bounds.c: New test. + * gcc.target/arm/mve/intrinsics/vsetq_lane_s64_bounds.c: New test. + * gcc.target/arm/mve/intrinsics/vsetq_lane_s8_bounds.c: New test. + * gcc.target/arm/mve/intrinsics/vsetq_lane_u16_bounds.c: New test. + * gcc.target/arm/mve/intrinsics/vsetq_lane_u32_bounds.c: New test. + * gcc.target/arm/mve/intrinsics/vsetq_lane_u64_bounds.c: New test. + * gcc.target/arm/mve/intrinsics/vsetq_lane_u8_bounds.c: New test. + +2025-11-18 Christophe Lyon <christophe.lyon@linaro.org> + + PR target/117814 + * gcc.target/arm/mve/intrinsics/pr117814-f16.c: New test. + * gcc.target/arm/mve/intrinsics/pr117814-2-f16.c: New test. + * gcc.target/arm/mve/intrinsics/pr117814-3-f16.c: New test. + * gcc.target/arm/mve/intrinsics/pr117814-4-f16.c: New test. + * gcc.target/arm/mve/intrinsics/pr117814-f32.c: New test. + * gcc.target/arm/mve/intrinsics/pr117814-2-f32.c: New test. + * gcc.target/arm/mve/intrinsics/pr117814-3-f32.c: New test. + * gcc.target/arm/fp16-compile-none-1.c: Delete. + * g++.target/arm/mve/general-c++/nomve_fp_1.c: Fix expected error + message. + * lib/target-supports.exp + (check_effective_target_arm_v8_1m_mve_nofp_ok_nocache): New. + (check_effective_target_arm_v8_1m_mve_nofp_ok): New. + (add_options_for_arm_v8_1m_mve_nofp): New. + +2025-11-18 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR fortran/32365 + * gfortran.dg/common_22.f90: Update. + * gfortran.dg/common_24.f: Update. + * gfortran.dg/goacc/routine-1.f90: Update. + * gfortran.dg/goacc/routine-2.f90: Update. + * gfortran.dg/gomp/declare-variant-17.f90: Update. + * gfortran.dg/gomp/interop-1.f90: Update. + * gfortran.dg/gomp/order-2.f90: Update. + * gfortran.dg/gomp/pr78026.f03: Update. + * gfortran.dg/gomp/requires-4.f90: Update. + * gfortran.dg/gomp/requires-6.f90: Update. + * gfortran.dg/pr61669.f90: Update. + * gfortran.dg/spec_statement_in_exec.f90: New test exercises + data/common/namelist/OpenMP directives with -fopenmp. + +2025-11-18 Uros Bizjak <ubizjak@gmail.com> + + * gcc.dg/pr116815.c: Require target int32. + +2025-11-18 Richard Biener <rguenther@suse.de> + + PR tree-optimization/122736 + * gcc.target/i386/vect-pr122736.c: New testcase. + +2025-11-18 Richard Biener <rguenther@suse.de> + + PR tree-optimization/122723 + * gcc.dg/vect/vect-reduc-cond-add-1.c: New generic functional + testcase. + * gcc.target/i386/vect-epilogues-6.c: New testcase. + * gcc.target/i386/vect-epilogues-7.c: Likewise. + * gcc.target/i386/vect-epilogues-8.c: Likewise. + * gcc.target/i386/vect-epilogues-9.c: Likewise. + +2025-11-18 liuhongt <hongtao.liu@intel.com> + + * gcc.target/i386/avx512vl-pr103750-2.c: New test. + +2025-11-17 Harald Anlauf <anlauf@gmx.de> + + PR fortran/122709 + * gfortran.dg/select_contiguous.f90: New test. + +2025-11-17 David Malcolm <dmalcolm@redhat.com> + + PR analyzer/122626 + * g++.dg/analyzer/malloc.C: Add sarif output to verify the fix for + PR analyzer/122626. + +2025-11-17 Philip Herron <herron.philip@googlemail.com> + + * rust/compile/issue-4188.rs: New test. + +2025-11-17 Philip Herron <herron.philip@googlemail.com> + + * rust/execute/torture/const-generics-5.rs: New test. + * rust/execute/torture/const-generics-6.rs: New test. + * rust/execute/torture/const-generics-7.rs: New test. + +2025-11-17 Philip Herron <herron.philip@googlemail.com> + + * rust/compile/const_generics_18.rs: New test. + * rust/compile/const_generics_19.rs: New test. + * rust/execute/torture/const-generics-3.rs: New test. + * rust/execute/torture/const-generics-4.rs: New test. + +2025-11-17 Lucas Ly Ba <lucas.ly-ba@outlook.com> + + * rust/compile/issue-4212.rs: + * rust/compile/issue-4219.rs: New test. + +2025-11-17 Lucas Ly Ba <lucas.ly-ba@outlook.com> + + * rust/compile/issue-4162.rs: New test. + +2025-11-17 Lucas Ly Ba <lucas.ly-ba@outlook.com> + + * rust/compile/issue-4222.rs: New test. + +2025-11-17 Lucas Ly Ba <lucas.ly-ba@outlook.com> + + * rust/compile/issue-4261.rs: New test. + +2025-11-17 Lucas Ly Ba <lucas.ly-ba@outlook.com> + + * rust/compile/issue-4267.rs: New test. + +2025-11-17 Philip Herron <herron.philip@googlemail.com> + + * rust/execute/torture/const-generics-2.rs: New test. + +2025-11-17 Yap Zhi Heng <yapzhhg@gmail.com> + + * rust/compile/issue-3659.rs: New file. + +2025-11-17 Yap Zhi Heng <yapzhhg@gmail.com> + + * rust/compile/issue-4242.rs: New file. + * rust/execute/torture/issue-4242.rs: New file. + +2025-11-17 vishruth-thimmaiah <vishruththimmaiah@gmail.com> + + * rust/compile/const_generics_17.rs: New test. + * rust/compile/generics14.rs: New test. + +2025-11-17 Yap Zhi Heng <yapzhhg@gmail.com> + + * rust/execute/torture/literalpattern_neg.rs: New file. + +2025-11-17 Lucas Ly Ba <lucas.ly-ba@outlook.fr> + + * rust/compile/issue-3617.rs: New test. + +2025-11-17 Jakub Jelinek <jakub@redhat.com> + + * g++.dg/DRs/dr3079.C: New test. + +2025-11-17 Jakub Jelinek <jakub@redhat.com> + + * g++.dg/DRs/dr3061.C: New test. + +2025-11-17 Jakub Jelinek <jakub@redhat.com> + + * g++.dg/DRs/dr3045.C: New test. + +2025-11-17 Richard Biener <rguenther@suse.de> + + * gcc.dg/vect/slp-9.c: Use noipa function attribute, drop + -fno-early-inlining option. + * c-c++-common/restrict-2.c: Explicitly look for hoisted loads. + * gfortran.dg/pr104466.f90: Adjust. + +2025-11-17 Artemiy Volkov <artemiy.volkov@arm.com> + + * gcc.target/aarch64/simd/usubl2.c: New test. + +2025-11-17 Jakub Jelinek <jakub@redhat.com> + + * c-c++-common/goacc/cache-3-1.c: Add dg-skip-if for c++26. + * g++.dg/goacc/data-clause-2.C: Likewise. + * g++.dg/gomp/allocate-3.C: Likewise. + * c-c++-common/gomp/affinity-2.c: Use { c || c++23_down } effective + target. + * c-c++-common/goacc/cache-3-2.c: Replace [: in OpenMP or OpenACC + pragmas or attributes with [ : and :] with : ]. + * c-c++-common/goacc/data-clause-1.c: Likewise. + * c-c++-common/goacc/data-clause-2.c: Likewise. + * c-c++-common/goacc/data-clause-duplicate-1.c: Likewise. + * c-c++-common/goacc/mdc-2.c: Likewise. + * c-c++-common/goacc/readonly-1.c: Likewise. + * c-c++-common/gomp/allocate-4.c: Likewise. + * c-c++-common/gomp/clauses-3.c: Likewise. + * c-c++-common/gomp/declare-mapper-3.c: Likewise. + * c-c++-common/gomp/depend-1.c: Likewise. + * c-c++-common/gomp/depend-2.c: Likewise. + * c-c++-common/gomp/depend-3.c: Likewise. + * c-c++-common/gomp/depend-4.c: Likewise. + * c-c++-common/gomp/depend-5.c: Likewise. + * c-c++-common/gomp/depend-6.c: Likewise. + * c-c++-common/gomp/dispatch-1.c: Likewise. + * c-c++-common/gomp/loop-5.c: Likewise. + * c-c++-common/gomp/map-1.c: Likewise. + * c-c++-common/gomp/map-2.c: Likewise. + * c-c++-common/gomp/map-4.c: Likewise. + * c-c++-common/gomp/map-7.c: Likewise. + * c-c++-common/gomp/pr100902-1.c: Likewise. + * c-c++-common/gomp/pr103642.c: Likewise. + * c-c++-common/gomp/pr120180-1.c: Likewise. + * c-c++-common/gomp/pr61486-1.c: Likewise. + * c-c++-common/gomp/pr81006.c: Likewise. + * c-c++-common/gomp/pr91920.c: Likewise. + * c-c++-common/gomp/pr96867.c: Likewise. + * c-c++-common/gomp/pr99928-16.c: Likewise. + * c-c++-common/gomp/reduction-1.c: Likewise. + * c-c++-common/gomp/scan-1.c: Likewise. + * c-c++-common/gomp/target-data-1.c: Likewise. + * c-c++-common/gomp/target-enter-data-1.c: Likewise. + * c-c++-common/gomp/target-has-device-addr-1.c: Likewise. + * c-c++-common/gomp/target-implicit-map-2.c: Likewise. + * c-c++-common/gomp/target-map-iterators-1.c: Likewise. + * c-c++-common/gomp/target-map-iterators-3.c: Likewise. + * c-c++-common/gomp/target-update-iterators-1.c: Likewise. + * c-c++-common/gomp/target-update-iterators-3.c: Likewise. + * g++.dg/goacc/cache-3-1.C: Likewise. + * g++.dg/goacc/cache-3-2.C: Likewise. + * g++.dg/goacc/data-clause-1.C: Likewise. + * g++.dg/goacc/mdc.C: Likewise. + * g++.dg/gomp/array-section-2.C: Likewise. + * g++.dg/gomp/bad-array-section-10.C: Likewise. + * g++.dg/gomp/bad-array-section-11.C: Likewise. + * g++.dg/gomp/bad-array-section-9.C: Likewise. + * g++.dg/gomp/declare-mapper-1.C: Likewise. + * g++.dg/gomp/declare-mapper-2.C: Likewise. + * g++.dg/gomp/depend-1.C: Likewise. + * g++.dg/gomp/depend-2.C: Likewise. + * g++.dg/gomp/ind-base-3.C: Likewise. + * g++.dg/gomp/map-1.C: Likewise. + * g++.dg/gomp/map-2.C: Likewise. + * g++.dg/gomp/map-ptrmem-1.C: Likewise. + * g++.dg/gomp/map-ptrmem-2.C: Likewise. + * g++.dg/gomp/member-array-2.C: Likewise. + * g++.dg/gomp/target-this-3.C: Likewise. + * g++.dg/gomp/target-this-4.C: Likewise. + +2025-11-17 Richard Biener <rguenther@suse.de> + + PR tree-optimization/122573 + * gcc.dg/vect/costmodel/x86_64/costmodel-pr122573.c: New testcase. + +2025-11-17 Pan Li <pan2.li@intel.com> + + * gcc.target/riscv/rvv/autovec/vx_vf/vx-1-u16.c: Add asm check + for vmsne.vx. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-1-u32.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-1-u64.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-1-u8.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-2-u16.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-2-u32.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-2-u64.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-2-u8.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-3-u16.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-3-u32.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-3-u64.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-3-u8.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_binary.h: Add the helper + macros. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_binary_data.h: Add test + data for run test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsne-run-1-u16.c: New test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsne-run-1-u32.c: New test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsne-run-1-u64.c: New test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsne-run-1-u8.c: New test. + +2025-11-17 Pan Li <pan2.li@intel.com> + + * gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i16.c: Add asm check + for vmsne.vx. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i32.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i64.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i8.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i16.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i32.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i64.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i8.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i16.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i32.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i64.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i8.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_binary.h: Add test + helper macros. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_binary_data.h: Add test + data for run test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsne-run-1-i16.c: New test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsne-run-1-i32.c: New test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsne-run-1-i64.c: New test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsne-run-1-i8.c: New test. + +2025-11-16 Andrew MacLeod <amacleod@redhat.com> + + PR tree-optimization/121345 + * g++.dg/pr121345.C: New. + +2025-11-16 Andrew MacLeod <amacleod@redhat.com> + + * gcc.dg/pr102983.c: Adjust final check. + +2025-11-16 Nathaniel Shead <nathanieloshead@gmail.com> + + PR c++/122625 + * g++.dg/modules/inst-7_a.C: New test. + * g++.dg/modules/inst-7_b.C: New test. + +2025-11-16 Lewis Hyatt <lhyatt@gmail.com> + + * gcc.dg/plugin/location-overflow-test-3.c: New test. + * gcc.dg/plugin/plugin.exp: Add the new test. + +2025-11-16 Andrew Pinski <andrew.pinski@oss.qualcomm.com> + + * g++.dg/tree-ssa/pr117123.C: un-xfail. + +2025-11-16 Sam James <sam@gentoo.org> + + * gcc.target/aarch64/crc-crc32-data16.c: Fix iteration + count to match testname. + +2025-11-15 Jakub Jelinek <jakub@redhat.com> + + * c-c++-common/asan/asan-stack-small.c (pa, pb, pc): Make these + vars volatile. + (uintptr_t): New typedef. + (main): Use access of b using pa pointer with offset depending on + how exactly the 3 variables are laid out in the frame. + +2025-11-15 Jason Merrill <jason@redhat.com> + + * g++.dg/modules/using-33_a.C: New test. + * g++.dg/modules/using-33_b.C: New test. + +2025-11-15 Jason Merrill <jason@redhat.com> + + * g++.dg/modules/friend-11_a.C: New test. + * g++.dg/modules/friend-11_b.C: New test. + +2025-11-15 Karl Meakin <karl.meakin@arm.com> + + * gcc.target/aarch64/cmpbr-4.c: New test. + * gcc.target/aarch64/cmpbr-5.c: New test. + +2025-11-14 Jeff Law <jlaw@ventanamicro.com> + + * gcc.target/riscv/rvv/vsetvl/avl_single-37.c: Drop unnecessary output + test(s). + * gcc.target/riscv/rvv/vsetvl/vlmax_phi-1.c: Likewise. + * gcc.target/riscv/rvv/vsetvl/vlmax_phi-2.c: Likewise. + * gcc.target/riscv/rvv/vsetvl/vlmax_phi-3.c: Likewise. + * gcc.target/riscv/rvv/vsetvl/vlmax_phi-4.c: Likewise. + * gcc.target/riscv/rvv/vsetvl/vlmax_phi-5.c: Likewise. + * gcc.target/riscv/rvv/vsetvl/vlmax_phi-6.c: Likewise. + * gcc.target/riscv/rvv/vsetvl/vlmax_phi-7.c: Likewise. + * gcc.target/riscv/rvv/vsetvl/vlmax_phi-8.c: Likewise. + * gcc.target/riscv/rvv/vsetvl/vlmax_phi-9.c: Likewise. + * gcc.target/riscv/rvv/vsetvl/vlmax_phi-10.c: Likewise. + * gcc.target/riscv/rvv/vsetvl/vlmax_phi-11.c: Likewise. + * gcc.target/riscv/rvv/vsetvl/vlmax_phi-12.c: Likewise. + * gcc.target/riscv/rvv/vsetvl/vlmax_phi-13.c: Likewise. + * gcc.target/riscv/rvv/vsetvl/vlmax_phi-14.c: Likewise. + * gcc.target/riscv/rvv/vsetvl/vlmax_phi-15.c: Likewise. + * gcc.target/riscv/rvv/vsetvl/vlmax_phi-16.c: Likewise. + * gcc.target/riscv/rvv/vsetvl/vlmax_phi-17.c: Likewise. + * gcc.target/riscv/rvv/vsetvl/vlmax_phi-18.c: Likewise. + * gcc.target/riscv/rvv/vsetvl/vlmax_phi-19.c: Likewise. + * gcc.target/riscv/rvv/vsetvl/vlmax_phi-20.c: Likewise. + * gcc.target/riscv/rvv/vsetvl/vlmax_phi-21.c: Likewise. + * gcc.target/riscv/rvv/vsetvl/vlmax_phi-22.c: Likewise. + * gcc.target/riscv/rvv/vsetvl/vlmax_phi-23.c: Likewise. + * gcc.target/riscv/rvv/vsetvl/vlmax_phi-24.c: Likewise. + * gcc.target/riscv/rvv/vsetvl/vlmax_phi-25.c: Likewise. + * gcc.target/riscv/rvv/vsetvl/vlmax_phi-26.c: Likewise. + * gcc.target/riscv/rvv/vsetvl/vlmax_phi-27.c: Likewise. + * gcc.target/riscv/rvv/vsetvl/vlmax_phi-28.c: Likewise. + +2025-11-14 Christophe Lyon <christophe.lyon@linaro.org> + + * gcc.target/arm/mve/intrinsics/sqshl_check_shift.c: New test. + * gcc.target/arm/mve/intrinsics/srshr_check_shift.c: New test. + * gcc.target/arm/mve/intrinsics/uqshl_check_shift.c: New test. + * gcc.target/arm/mve/intrinsics/urshr_check_shift.c: New test. + +2025-11-14 Christophe Lyon <christophe.lyon@linaro.org> + + * gcc.target/arm/mve/intrinsics/sqshll_check_shift.c: New test. + * gcc.target/arm/mve/intrinsics/srshrl_check_shift.c: New test. + * gcc.target/arm/mve/intrinsics/uqshll_check_shift.c: New test. + * gcc.target/arm/mve/intrinsics/urshrl_check_shift.c: New test. + +2025-11-14 Yuao Ma <c8ef@outlook.com> + + * gfortran.dg/value_optional_3.f90: New test. + +2025-11-14 Richard Biener <rguenther@suse.de> + + PR ipa/122663 + * g++.dg/torture/pr122663.C: New testcase. + +2025-11-14 Richard Biener <rguenther@suse.de> + + PR tree-optimization/122573 + * gcc.dg/vect/slp-58.c: New testcase. + +2025-11-14 Harald Anlauf <anlauf@gmx.de> + + PR fortran/117070 + * gfortran.dg/proc_target_1.f90: New test. + +2025-11-14 Richard Biener <rguenther@suse.de> + + PR tree-optimization/122680 + * gcc.dg/vect/pr122680.c: New testcase. + +2025-11-14 Christophe Lyon <christophe.lyon@linaro.org> + + PR target/122216 + * gcc.target/arm/mve/intrinsics/asrl-various-ranges.c: New test. + * gcc.target/arm/mve/intrinsics/lsll-various-ranges.c: New test. + +2025-11-14 zhaozhou <zhaozhou@loongson.cn> + + * gcc.target/loongarch/vec_reduc_half.c: New test. + +2025-11-13 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR fortran/96255 + * gfortran.dg/do_concurrent_typespec_1.f90: Delete three + dg-bogus directives not needed. + +2025-11-13 Nathaniel Shead <nathanieloshead@gmail.com> + + PR c++/122646 + * g++.dg/modules/friend-10_a.C: New test. + * g++.dg/modules/friend-10_b.C: New test. + +2025-11-13 Andrew Pinski <andrew.pinski@oss.qualcomm.com> + + PR tree-optimization/122493 + * gcc.target/i386/pr121062-1.c: Update count. + * gcc.dg/uninit-pred-7_a.c: xfail line 23. + * g++.dg/uninit-pred-5.C: Change dg-warning to dg-bogus. + * gcc.dg/tree-ssa/ssa-dom-thread-7.c: Update count of jump thread. + +2025-11-13 Andrew Pinski <andrew.pinski@oss.qualcomm.com> + + PR tree-optimization/122637 + * gcc.dg/torture/pr122637-1.c: New test. + +2025-11-13 Michal Jires <mjires@suse.cz> + + PR lto/122603 + * gcc.dg/lto/pr122603_0.c: New test. + +2025-11-13 Artemiy Volkov <artemiy.volkov@arm.com> + + * gcc.dg/tree-ssa/forwprop-43.c: Adjust. + +2025-11-13 Jeff Law <jlaw@ventanamicro.com> + + PR rtl-optimization/122627 + * gcc.target/riscv/rvv/autovec/pr122627.c: New test. + +2025-11-13 liuhongt <hongtao.liu@intel.com> + + * gcc.target/i386/kortest_ccz-1.c: New test. + +2025-11-13 Nathaniel Shead <nathanieloshead@gmail.com> + + PR c++/122551 + * g++.dg/modules/tpl-friend-20_a.C: New test. + * g++.dg/modules/tpl-friend-20_b.C: New test. + * g++.dg/modules/tpl-friend-20_c.C: New test. + +2025-11-13 Andre Vieira <andre.simoesdiasvieira@arm.com> + + * gcc.target/aarch64/eor3-opt.c: New test. + +2025-11-13 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR fortran/96255 + * gfortran.dg/do_concurrent_typespec_1.f90: Update testcase to check + for bugus warnings. + +2025-11-12 Christophe Lyon <christophe.lyon@linaro.org> + + PR target/122175 + * gcc.target/arm/mve/intrinsics/vbicq_m_n_s16.c: Adjust expected + output. + * gcc.target/arm/mve/intrinsics/vbicq_m_n_u16.c: Likewise. + * gcc.target/arm/mve/intrinsics/vbicq_n_s16.c: Likewise. + * gcc.target/arm/mve/intrinsics/vbicq_n_u16.c: Likewise. + * gcc.target/arm/mve/intrinsics/vmvnq_m_n_s16.c: Likewise. + * gcc.target/arm/mve/intrinsics/vmvnq_m_n_u16.c: Likewise. + * gcc.target/arm/mve/intrinsics/vmvnq_n_s16.c: Likewise. + * gcc.target/arm/mve/intrinsics/vmvnq_n_u16.c: Likewise. + * gcc.target/arm/mve/intrinsics/vmvnq_x_n_s16.c: Likewise. + * gcc.target/arm/mve/intrinsics/vmvnq_x_n_u16.c: Likewise. + * gcc.target/arm/mve/intrinsics/vorrq_m_n_s16.c: Likewise. + * gcc.target/arm/mve/intrinsics/vorrq_m_n_u16.c: Likewise. + * gcc.target/arm/mve/intrinsics/vorrq_n_s16.c: Likewise. + * gcc.target/arm/mve/intrinsics/vorrq_n_u16.c: Likewise. + +2025-11-12 Antoni Boucher <bouanto@zoho.com> + + * jit.dg/all-non-failing-tests.h: Mention new test. + * jit.dg/test-abi.c: New test. + +2025-11-12 Richard Biener <rguenther@suse.de> + + PR tree-optimization/122653 + * gcc.dg/tree-ssa/scev-16.c: New testcase. + +2025-11-12 Christophe Lyon <christophe.lyon@linaro.org> + Richard Earnshaw <rearnsha@arm.com> + + PR target/122175 + * gcc.target/arm/mve/intrinsics/pr122175.c: New test. + +2025-11-12 Andre Vieira <andre.simoesdiasvieira@arm.com> + + * gcc.target/arm/cmse/mainline/8m/hard/union-fp.c: New. + * gcc.target/arm/cmse/baseline/union-4.c: New. + * gcc.target/arm/cmse/mainline/8m/hard/union-4.c: New. + * gcc.target/arm/cmse/mainline/8m/soft/union-4.c: New. + * gcc.target/arm/cmse/mainline/8m/softfp/union-4.c: New. + * gcc.target/arm/cmse/union-4.x: New. + +2025-11-12 Andre Vieira <andre.simoesdiasvieira@arm.com> + + * gcc.target/arm/cmse/union-3.x: New test. + * gcc.target/arm/cmse/baseline/union-3.c: New test. + * gcc.target/arm/cmse/mainline/8m/union-3.c: New test. + * gcc.target/arm/cmse/mainline/8_1m/union-3.c: New test. + +2025-11-12 Stefan Schulze Frielinghaus <stefansf@gcc.gnu.org> + + * gcc.target/s390/stack-protector-guard-global-1.c: New test. + * gcc.target/s390/stack-protector-guard-global-2.c: New test. + * gcc.target/s390/stack-protector-guard-global-3.c: New test. + * gcc.target/s390/stack-protector-guard-global-4.c: New test. + +2025-11-12 Richard Biener <rguenther@suse.de> + + PR tree-optimization/122647 + * g++.dg/vect/pr122647.cc: New testcase. + +2025-11-12 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/warn34.adb: New test. + +2025-11-12 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR libfortran/36725 + * gfortran.dg/fmt_g0_4.f08: Change test case from + compile only to compile and run. Adjust test conditions. + +2025-11-11 Christopher Albert <albert@tugraz.at> + + PR fortran/90519 + * gfortran.dg/finalizer_recursive_alloc_1.f90: New test for ICE fix. + * gfortran.dg/finalizer_recursive_alloc_2.f90: New execution test. + * gfortran.dg/finalizer_self_assign.f90: New test for self-assignment + including a = a, a = (a), and a = (((a))) cases using if/stop pattern. + * gfortran.dg/pr112459.f90: Update to expect 6 _final calls instead + of 12, reflecting corrected self-assignment behavior. + +2025-11-11 Jerry DeLisle <jvdelisle@gcc.gnu.org> + Steve Kargl <kargl@gcc.gnu.org> + + PR fortran/96255 + * gfortran.dg/do_concurrent_typespec_1.f90: New test covering all + shadowing scenarios: undeclared variable, same kind shadowing, and + different kind shadowing. + +2025-11-11 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR libfortran/90374 + PR libfortran/90374 + * gfortran.dg/fmt_error_10.f: Update test case to pass. + * gfortran.dg/fmt_zero_width.f90: Likewise. + * gfortran.dg/pr111022.f90: Likewise. + * gfortran.dg/pr96436_4.f90: Likewise. + * gfortran.dg/pr96436_5.f90: Likewise. + +2025-11-11 Pan Li <pan2.li@intel.com> + + * gcc.target/riscv/rvv/autovec/vx_vf/vx-1-u16.c: Add asm check + for vmseq.vx. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-1-u32.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-1-u64.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-1-u8.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-2-u16.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-2-u32.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-2-u64.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-2-u8.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-3-u16.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-3-u32.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-3-u64.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-3-u8.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_binary.h: Add test + helper macros. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_binary_data.h: Add test + data for run test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vmseq-run-1-u16.c: New test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vmseq-run-1-u32.c: New test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vmseq-run-1-u64.c: New test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vmseq-run-1-u8.c: New test. + +2025-11-11 Pan Li <pan2.li@intel.com> + + * gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i16.c: Add asm check + for vmseq.vx. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i32.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i64.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i8.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i16.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i32.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i64.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i8.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i16.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i32.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i64.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i8.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_binary.h: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_binary_data.h: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vmseq-run-1-i16.c: New test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vmseq-run-1-i32.c: New test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vmseq-run-1-i64.c: New test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vmseq-run-1-i8.c: New test. + +2025-11-11 Dhruv Chawla <dhruvc@nvidia.com> + + * gcc.dg/match-shift-cmp-1.c: New test. + * gcc.dg/match-shift-cmp-2.c: Likewise. + * gcc.dg/match-shift-cmp-3.c: Likewise. + * gcc.dg/match-shift-cmp-4.c: Likewise. + +2025-11-11 Lulu Cheng <chenglulu@loongson.cn> + + * g++.target/loongarch/mv-symbols1.C: New test. + * g++.target/loongarch/mv-symbols2.C: New test. + * g++.target/loongarch/mv-symbols3.C: New test. + * g++.target/loongarch/mv-symbols4.C: New test. + * g++.target/loongarch/mv-symbols5.C: New test. + * g++.target/loongarch/mv-symbols6.C: New test. + * g++.target/loongarch/mvc-symbols1.C: New test. + * g++.target/loongarch/mvc-symbols2.C: New test. + * g++.target/loongarch/mvc-symbols3.C: New test. + * g++.target/loongarch/mvc-symbols4.C: New test. + * g++.target/loongarch/mvc-symbols5.C: New test. + * gcc.target/loongarch/attr-check-error-message1.c: New test. + * gcc.target/loongarch/attr-check-error-message2.c: New test. + * gcc.target/loongarch/attr-check-error-message3.c: New test. + * gcc.target/loongarch/attr-check-error-message4.c: New test. + * gcc.target/loongarch/attr-check-error-message5.c: New test. + * gcc.target/loongarch/attr-check-error-message6.c: New test. + * gcc.target/loongarch/attr-check-error-message7.c: New test. + * gcc.target/loongarch/attr-check-error-message8.c: New test. + * gcc.target/loongarch/attr-check-error-message9.c: New test. + +2025-11-11 Lulu Cheng <chenglulu@loongson.cn> + + * gcc.target/loongarch/pragma-la64V1_1.c: New test. + * gcc.target/loongarch/pragma-la64V1_1-2.c: New test. + +2025-11-11 Lulu Cheng <chenglulu@loongson.cn> + + * gcc.target/loongarch/attr-check-error-message.c: Add tests. + +2025-11-11 Andrew Pinski <andrew.pinski@oss.qualcomm.com> + + PR tree-optimization/122629 + * gcc.dg/torture/pr122629-1.c: New test. + * gcc.dg/torture/pr122629-2.c: New test. + * gcc.dg/tree-ssa/pr122629-1.c: New test. + +2025-11-11 Hu, Lin1 <lin1.hu@intel.com> + + PR target/122446 + * gcc.target/i386/amxbf16-asmintel-1.c: Modify dg-final to check intel + form. + * gcc.target/i386/amxcomplex-asmintel-1.c: Ditto. + * gcc.target/i386/amxfp16-asmintel-1.c: Ditto. + * gcc.target/i386/amxfp8-asmintel-1.c: Ditto. + * gcc.target/i386/amxint8-asmintel-1.c: Ditto. + * gcc.target/i386/amxmovrs-asmintel-1.c: Ditto. + * gcc.target/i386/amxtf32-asmintel-1.c: Ditto. + * gcc.target/i386/amxtile-asmintel-1.c: Ditto. + * g++.target/i386/pr122446-1.C: New test. + * g++.target/i386/pr122446-amxavx512.C: Ditto. + * g++.target/i386/pr122446-amxbf16.C: Ditto. + * g++.target/i386/pr122446-amxcomplex.C: Ditto. + * g++.target/i386/pr122446-amxfp16.C: Ditto. + * g++.target/i386/pr122446-amxfp8.C: Ditto. + * g++.target/i386/pr122446-amxint8.C: Ditto. + * g++.target/i386/pr122446-amxmovrs.C: Ditto. + * g++.target/i386/pr122446-amxtf32.C: Ditto. + * g++.target/i386/pr122446-amxtile.C: Ditto. + +2025-11-10 Nathaniel Shead <nathanieloshead@gmail.com> + + PR c++/122628 + * g++.dg/modules/internal-18.C: New test. + +2025-11-10 Nathaniel Shead <nathanieloshead@gmail.com> + + * g++.dg/modules/tpl-friend-8_a.H: Add testcase. + * g++.dg/modules/tpl-friend-8_b.C: Add testcase. + +2025-11-10 Alejandro Colomar <alx@kernel.org> + + PR c/122591 + * gcc.dg/countof-compile.c (type): Test return type of _Countof. + +2025-11-10 Dimitar Dimitrov <dimitar@dinux.eu> + + PR target/122415 + * gcc.target/pru/pr122415-1.c: New test. + * gcc.target/pru/pr122415-2.c: New test. + +2025-11-10 Tejas Belagod <tejas.belagod@arm.com> + + * gcc.target/aarch64/sve/acle/general-c/svcount_1.c: Update message. + +2025-11-10 Tejas Belagod <tejas.belagod@arm.com> + + * g++.dg/ext/sve-sizeless-1.C: Add new tests. + * g++.dg/ext/sve-sizeless-2.C: Add new tests. + * g++.target/aarch64/sve/acle/general-c++/gnu_vectors_1.C: Add new tests. + * g++.target/aarch64/sve/acle/general-c++/gnu_vectors_2.C: Add new tests. + * gcc.target/aarch64/sve/acle/general-c/gnu_vectors_1.c: Add new tests. + * gcc.target/aarch64/sve/acle/general-c/gnu_vectors_2.c: Add new tests. + * gcc.target/aarch64/sve/acle/general-c/sizeless-1.c: Add new tests. + * gcc.target/aarch64/sve/acle/general-c/sizeless-2.c : Add new tests. + +2025-11-10 Tejas Belagod <tejas.belagod@arm.com> + + * gcc.target/aarch64/sve/acle/general/cops_bool.c: New. + +2025-11-10 Robin Dapp <rdapp@ventanamicro.com> + + * gcc.target/riscv/rvv/autovec/pr121985.c: New test. + +2025-11-10 Robin Dapp <rdapp@ventanamicro.com> + + * gcc.target/riscv/rvv/autovec/pr118019-2.c: + +2025-11-10 Jakub Jelinek <jakub@redhat.com> + + PR c++/119064 + * g++.dg/cpp26/feat-cxx26.C: Revert 2025-07-11 changes. + * g++.dg/DRs/dr2581-1.C (__cpp_trivial_relocatability): Remove test. + * g++.dg/DRs/dr2581-2.C (__cpp_trivial_relocatability): Likewise. + * g++.dg/warn/Wkeyword-macro-1.C: Don't expect any diagnostics on + #define or #undef of trivially_relocatable_if_eligible or + replaceable_if_eligible. + * g++.dg/warn/Wkeyword-macro-2.C: Likewise. + * g++.dg/warn/Wkeyword-macro-4.C: Likewise. + * g++.dg/warn/Wkeyword-macro-5.C: Likewise. + * g++.dg/warn/Wkeyword-macro-7.C: Likewise. + * g++.dg/warn/Wkeyword-macro-8.C: Likewise. + * g++.dg/cpp26/trivially-relocatable1.C: Remove. + * g++.dg/cpp26/trivially-relocatable2.C: Remove. + * g++.dg/cpp26/trivially-relocatable3.C: Remove. + * g++.dg/cpp26/trivially-relocatable4.C: Remove. + * g++.dg/cpp26/trivially-relocatable5.C: Remove. + * g++.dg/cpp26/trivially-relocatable6.C: Remove. + * g++.dg/cpp26/trivially-relocatable7.C: Remove. + * g++.dg/cpp26/trivially-relocatable8.C: Remove. + * g++.dg/cpp26/trivially-relocatable9.C: Remove. + * g++.dg/cpp26/trivially-relocatable10.C: Remove. + * g++.dg/cpp26/trivially-relocatable11.C: Remove. + * g++.dg/modules/class-11_a.H: Remove trivial relocatability + related parts. + * g++.dg/modules/class-11_b.C: Likewise. + +2025-11-10 Jakub Jelinek <jakub@redhat.com> + + * g++.dg/warn/Wkeyword-macro-1.C: Expect diagnostics on define/undef + of indeterminate. + * g++.dg/warn/Wkeyword-macro-2.C: Likewise. + * g++.dg/warn/Wkeyword-macro-4.C: Likewise. + * g++.dg/warn/Wkeyword-macro-5.C: Likewise. + * g++.dg/warn/Wkeyword-macro-7.C: Likewise. + * g++.dg/warn/Wkeyword-macro-8.C: Likewise. + +2025-11-10 Jakub Jelinek <jakub@redhat.com> + + * g++.dg/warn/Wkeyword-macro-4.C: Don't diagnose for #undef likely + or #undef unlikely. + * g++.dg/warn/Wkeyword-macro-5.C: Likewise. + * g++.dg/warn/Wkeyword-macro-9.C: Likewise. + * g++.dg/warn/Wkeyword-macro-8.C: Likewise. + * g++.dg/warn/Wkeyword-macro-10.C: Likewise. + +2025-11-10 Lewis Hyatt <lhyatt@gmail.com> + + PR preprocessor/105608 + * g++.dg/pch/line-map-3.C: Remove xfails. + * g++.dg/pch/line-map-4.C: New test. + * g++.dg/pch/line-map-4.Hs: New test. + +2025-11-09 H.J. Lu <hjl.tools@gmail.com> + + * gcc.target/i386/apx-ndd-tls-1b.c: Change to xfail for ! ia32. + +2025-11-09 H.J. Lu <hjl.tools@gmail.com> + + * gcc.target/i386/indirect-thunk-5.c: Drop x32 scan. + * gcc.target/i386/indirect-thunk-6.c: Likewise. + * gcc.target/i386/indirect-thunk-extern-5.c: Likewise. + * gcc.target/i386/indirect-thunk-extern-6.c: Likewise. + * gcc.target/i386/indirect-thunk-inline-5.c: Likewise. + * gcc.target/i386/indirect-thunk-inline-6.c: Likewise. + +2025-11-09 H.J. Lu <hjl.tools@gmail.com> + + * gcc.target/i386/cmov12.c: Limit to lp64. + +2025-11-09 H.J. Lu <hjl.tools@gmail.com> + + * gcc.target/i386/shrink_wrap_1.c: Limit to lp64. + +2025-11-09 H.J. Lu <hjl.tools@gmail.com> + + * gcc.dg/pr90838.c: Adjust for x32 + +2025-11-08 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/specs/limited_with4.ads: Rename to... + * gnat.dg/specs/limited_with1.ads: ...this. + * gnat.dg/specs/limited_with4_pkg.ads: Rename to... + * gnat.dg/specs/limited_with1_pkg.ads: ...this. + * gnat.dg/specs/limited_with2-child1.ads: New test. + * gnat.dg/specs/limited_with2-child2.ads: Likewise. + * gnat.dg/specs/limited_with2.ads: New helper. + +2025-11-08 Philipp Tomsich <philipp.tomsich@vrull.eu> + + * gcc.target/riscv/snez.c: New test. + +2025-11-08 Harald Anlauf <anlauf@gmx.de> + + PR fortran/113338 + * gfortran.dg/c-interop/pr113338-c.c: New test. + * gfortran.dg/c-interop/pr113338.f90: New test. + +2025-11-08 Avinash Jayakar <avinashd@linux.ibm.com> + + PR tree-optimization/122126 + * gcc.dg/pr122126_vextr.c: New test. + * gcc.dg/pr122126_vset.c: New test. + +2025-11-08 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR fortran/121628 + * gfortran.dg/alloc_comp_deep_copy_7.f90: New test. + +2025-11-08 Andrew Pinski <andrew.pinski@oss.qualcomm.com> + + PR tree-optimization/122599 + * gcc.dg/torture/pr122599-1.c: New test. + +2025-11-07 Andrew Pinski <andrew.pinski@oss.qualcomm.com> + + PR tree-optimization/122588 + * gcc.c-torture/compile/pr122588-1.c: New test. + * gcc.dg/tree-ssa/pr122588-1.c: New test. + +2025-11-07 Andrew Pinski <andrew.pinski@oss.qualcomm.com> + + PR testsuite/122602 + * gcc.dg/vect/complex/complex-operations-run.c: Move to... + * gcc.dg/vect/complex/vect-complex-operations-run.c: ...here. + +2025-11-07 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/class_wide6.ads, gnat.dg/class_wide6.adb: New test. + * gnat.dg/class_wide6_pkg.ads: New helper. + +2025-11-07 Richard Biener <rguenther@suse.de> + + PR tree-optimization/122577 + * gcc.dg/vect/vect-bool-3.c: New testcase. + +2025-11-07 Pan Li <pan2.li@intel.com> + + * gcc.target/riscv/rvv/autovec/pr121959-1.c: New test. + * gcc.target/riscv/rvv/autovec/pr121959-2.c: New test. + * gcc.target/riscv/rvv/autovec/pr121959-3.c: New test. + * gcc.target/riscv/rvv/autovec/pr121959-4.c: New test. + * gcc.target/riscv/rvv/autovec/pr121959-5.c: New test. + * gcc.target/riscv/rvv/autovec/pr121959-run-1.c: New test. + * gcc.target/riscv/rvv/autovec/pr121959.h: New test. + +2025-11-07 Richard Biener <rguenther@suse.de> + + PR tree-optimization/122589 + PR middle-end/122594 + * g++.dg/torture/pr122589.C: New testcase. + +2025-11-07 Alfie Richards <alfie.richards@arm.com> + + PR target/118328 + * gcc.target/aarch64/preserve_none_1.c: New test. + * gcc.target/aarch64/preserve_none_mingw_1.c: New test. + * gcc.target/aarch64/preserve_none_2.c: New test. + * gcc.target/aarch64/preserve_none_3.c: New test. + * gcc.target/aarch64/preserve_none_4.c: New test. + * gcc.target/aarch64/preserve_none_5.c: New test. + * gcc.target/aarch64/preserve_none_6.c: New test. + +2025-11-07 Pan Li <pan2.li@intel.com> + + * gcc.target/riscv/rvv/autovec/vx_vf/vx-1-u16.c: Add asm check + for vwmaccu.vx. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-1-u32.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-1-u64.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-2-u16.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-2-u32.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-2-u64.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-3-u16.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-3-u32.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx-3-u64.c: Ditto. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_widen.h: Add test helper + macros. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_widen_data.h: Add test + data for run test. + * gcc.target/riscv/rvv/autovec/vx_vf/vx_vwmaccu-run-1-u64.c: New test. + +2025-11-07 Lulu Cheng <chenglulu@loongson.cn> + + * gcc.target/loongarch/sign-extend-4.c: New test. + * gcc.target/loongarch/sign-extend-5.c: New test. + +2025-11-07 Lulu Cheng <chenglulu@loongson.cn> + + * gcc.target/loongarch/sign-extend-3.c: New test. + +2025-11-07 Lulu Cheng <chenglulu@loongson.cn> + + * gcc.target/loongarch/sign-extend-6.c: New test. + +2025-11-06 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR fortran/121628 + * gfortran.dg/alloc_comp_deep_copy_5.f90: New test for recursive + allocatable array deep copy. + * gfortran.dg/alloc_comp_deep_copy_6.f90: New test for multi-level + recursive allocatable deep copy. + * gfortran.dg/array_memcpy_2.f90: Fix test with proper allocation. + Signed-off-by: Christopher Albert <albert@tugraz.at> + +2025-11-06 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/prefix3.adb: New test. + * gnat.dg/prefix3_pkg.ads: New helper. + * gnat.dg/prefix3_pkg.adb: Likewise. + +2025-11-06 Jeff Law <jlaw@ventanamicro.com> + + * gcc.target/riscv/czero-bext.c: New test. + +2025-11-06 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/renaming19.adb: New test. + * gnat.dg/renaming19_pkg.ads: New helper. + * gnat.dg/renaming19_pkg.adb: Likewise. + +2025-11-06 Your Name <jlaw@ventanamicro.com> + + PR rtl-optimization/121136 + * gcc.target/riscv/pr121136.c: New test. + * gcc.dg/cmp-mem-const-1.c: Skip for risc-v. + * gcc.dg/cmp-mem-const-2.c: Likewise. + +2025-11-06 Richard Biener <rguenther@suse.de> + + PR tree-optimization/122502 + * gcc.dg/torture/pr122502-2.c: New testcase. + +2025-11-06 Andrew MacLeod <amacleod@redhat.com> + + PR tree-optimization/113632 + * gcc.dg/pr113632.c: New. + +2025-11-06 Christophe Lyon <christophe.lyon@linaro.org> + + * lib/target-supports.exp + (check_effective_target_arm_v8_vfp_ok_nocache): New. + (check_effective_target_arm_v8_vfp_ok): Call the above helper, and + use global flags. + (add_options_for_arm_v8_vfp): Use et_arm_v8_vfp_flags. + * gcc.target/arm/lceil-vcvt_1.c: Remove -march=armv8-a. + * gcc.target/arm/lfloor-vcvt_1.c: Likewise. + * gcc.target/arm/lround-vcvt_1.c: Likewise. + * gcc.target/arm/vrinta-ce.c: Likewise. + +2025-11-06 Xi Ruoyao <xry111@xry111.site> + + * gcc.target/loongarch/vect-frint-no-inexact.c (dg-options): Add + -mcmodel=normal. + * gcc.target/loongarch/vect-frint-scalar-no-inexact.c: Likewise. + * gcc.target/loongarch/vect-frint-scalar.c: Likewise. + * gcc.target/loongarch/vect-frint.c: Likewise. + * gcc.target/loongarch/vect-ftint-no-inexact.c: Likewise. + * gcc.target/loongarch/vect-ftint.c: Likewise. + +2025-11-05 Nathaniel Shead <nathanieloshead@gmail.com> + + PR c++/121574 + * g++.dg/modules/internal-17_b.C: Check for diagnostics when + instantiating imported TU-local entities. + +2025-11-05 Nathaniel Shead <nathanieloshead@gmail.com> + + PR c++/121574 + * g++.dg/modules/internal-17_a.C: New test. + * g++.dg/modules/internal-17_b.C: New test. + +2025-11-05 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/specs/discr8.ads: New test. + +2025-11-05 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/122566 + * gfortran.dg/pdt_68.f03: New test. + +2025-11-05 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/122501 + PR fortran/122524 + * gfortran.dg/pdt_66.f03: New test. + * gfortran.dg/pdt_67.f03: New test. + +2025-11-05 Tobias Burnus <tburnus@baylibre.com> + + PR fortran/122570 + * gfortran.dg/gomp/pr122570.f: New test. + +2025-11-05 Artemiy Volkov <artemiy.volkov@arm.com> + + * gcc.dg/tree-ssa/forwprop-43.c: New test. + * gcc.target/aarch64/simd/combine_ext.c: New test. + +2025-11-05 Guo Jie <guojie@loongson.cn> + + * gcc.target/loongarch/widen-mul-rtx-cost-signed.c: Update. + +2025-11-04 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/protected_subtype1.adb: New test. + +2025-11-04 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/specs/generic_inst9.ads: New test. + * gnat.dg/specs/generic_inst9_pkg1.ads: New helper. + * gnat.dg/specs/generic_inst9_pkg2.ads: Likewise. + * gnat.dg/specs/generic_inst9_pkg2-g.ads: Likewise. + +2025-11-04 Uros Bizjak <ubizjak@gmail.com> + + PR target/122390 + * gcc.target/i386/pr122390.c: New test. + * gcc.target/i386/pr122390-1.c: New test. + +2025-11-04 Kees Cook <kees@kernel.org> + + * gcc.target/arc/builtin_fls_const.c: New test. Verify that + const attribute enables CSE optimization for mathematical ARC + builtins by checking that duplicate calls are eliminated and + results are optimized to shift operations. + +2025-11-04 Paul-Antoine Arras <parras@baylibre.com> + + PR fortran/122369 + PR fortran/122508 + * gfortran.dg/gomp/pr122369-1.f90: New test. + * gfortran.dg/gomp/pr122369-2.f90: New test. + * gfortran.dg/gomp/pr122369-3.f90: New test. + * gfortran.dg/gomp/pr122369-4.f90: New test. + * gfortran.dg/gomp/pr122508-1.f90: New test. + * gfortran.dg/gomp/pr122508-2.f90: New test. + +2025-11-04 Siddhesh Poyarekar <siddhesh@gotplt.org> + + PR lto/122515 + * lib/lto.exp (lto-build-archive): New procedure. + (lto-execute-1): Use it. + (lto-link-and-maybe-run, lto-get-options-main): Handle ar-link. + * gcc.dg/lto/pr122515_0.c: New test case. + * gcc.dg/lto/pr122515_1.c: New file. + * gcc.dg/lto/pr122515_2.c: Likewise. + * gcc.dg/lto/pr122515_3.c: Likewise. + * gcc.dg/lto/pr122515_4.c: Likewise. + * gcc.dg/lto/pr122515_5.c: Likewise. + * gcc.dg/lto/pr122515_6.c: Likewise. + * gcc.dg/lto/pr122515_7.c: Likewise. + * gcc.dg/lto/pr122515_8.c: Likewise. + * gcc.dg/lto/pr122515_9.c: Likewise. + +2025-11-04 Nathaniel Shead <nathanieloshead@gmail.com> + + PR c++/122253 + * g++.dg/modules/internal-16.C: New test. + +2025-11-04 Tobias Burnus <tburnus@baylibre.com> + + PR fortran/122513 + * gfortran.dg/pr122513-2.f90: New test. + +2025-11-04 Kishan Parmar <kishan@linux.ibm.com> + + PR rtl-optimization/93738 + * gcc.target/powerpc/rlwimi-2.c: Update expected rldicl count. + +2025-11-04 David Malcolm <dmalcolm@redhat.com> + + PR analyzer/122544 + * g++.dg/analyzer/exception-path-1-sarif.py: New test script. + * g++.dg/analyzer/exception-path-1.C: Add SARIF output, and use + the above to check it. + * g++.dg/analyzer/exception-path-unwind-multiple-2-sarif.py: New + test script. + * g++.dg/analyzer/exception-path-unwind-multiple-2.C: Add SARIF + output, and use the above to check it. + * gcc.dg/analyzer/setjmp-3-sarif.py: New test script. + * gcc.dg/analyzer/setjmp-3.c: Add SARIF output, and use + the above to check it. + +2025-11-03 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/generic_inst15.adb: New test. + * gnat.dg/generic_inst15_pkg-g.ads: New helper. + * gnat.dg/generic_inst15_pkg.ads: Likewise. + +2025-11-03 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/specs/abstract1.ads: New test. + +2025-11-03 Uros Bizjak <ubizjak@gmail.com> + + PR target/122534 + * gcc.target/i386/pr122534.c: New test. + +2025-11-03 Robin Dapp <rdapp.gcc@gmail.com> + + * gcc.target/riscv/rvv/base/pr119115.c: Add -std=gnu99. + +2025-11-03 Steve Kargl <kargls@comcast.net> + + PR fortran/122513 + * gfortran.dg/pr122513.f90: New test. + +2025-11-03 Jason Merrill <jason@redhat.com> + + * g++.dg/lookup/koenig16.C: New test. + * g++.dg/modules/adl-11_a.C: New file. + * g++.dg/modules/adl-11_b.C: New file. + +2025-11-03 Jason Merrill <jason@redhat.com> + + * g++.dg/modules/builtin-9_a.C: New test. + * g++.dg/modules/builtin-9_b.C: New test. + +2025-11-03 Jason Merrill <jason@redhat.com> + + * g++.dg/modules/clone-5_a.C: New test. + * g++.dg/modules/clone-5_b.C: New test. + +2025-11-03 Jason Merrill <jason@redhat.com> + + * g++.dg/modules/namespace-15_a.C: New test. + * g++.dg/modules/namespace-15_b.C: New test. + +2025-11-03 Georg-Johann Lay <avr@gjlay.de> + + * gcc.target/avr/torture/pr92606.c: Use LPM even if LPMx + is available. + +2025-11-03 Loeka Rogge <loeka@synopsys.com> + + * gcc.target/arc/movv2hi-be.c: New test. + +2025-11-03 Kito Cheng <kito.cheng@sifive.com> + + * g++.dg/abi/param2.C: Add -Wno-psabi option for RISC-V. + * g++.target/riscv/abi/empty-struct+union-1.cc: New test. + * g++.target/riscv/abi/empty-struct+union-2.cc: New test. + * g++.target/riscv/abi/empty-struct+union-3.cc: New test. + * g++.target/riscv/abi/empty-struct+union-4.cc: New test. + * g++.target/riscv/abi/empty-struct-1.cc: New test. + * g++.target/riscv/abi/empty-struct-2.cc: New test. + * g++.target/riscv/abi/empty-struct-3.cc: New test. + * g++.target/riscv/abi/empty-struct-4.cc: New test. + * g++.target/riscv/abi/empty-struct-5.cc: New test. + * g++.target/riscv/abi/empty-struct-6.cc: New test. + * g++.target/riscv/abi/empty-struct-7.cc: New test. + * g++.target/riscv/abi/empty-struct-8.cc: New test. + * g++.target/riscv/abi/empty-struct-9.cc: New test. + * g++.target/riscv/abi/empty-struct-10.cc: New test. + * g++.target/riscv/abi/empty-struct-11.cc: New test. + * g++.target/riscv/abi/empty-struct-12.cc: New test. + * g++.target/riscv/abi/empty-union-1.cc: New test. + * g++.target/riscv/abi/empty-union-2.cc: New test. + * g++.target/riscv/abi/empty-union-3.cc: New test. + * g++.target/riscv/abi/empty-union-4.cc: New test. + * g++.target/riscv/riscv.exp: Add abi subdirectory. + * gcc.dg/compat/pr83487-1_x.c: Add -Wno-psabi option for RISC-V. + * gcc.dg/compat/pr83487-1_y.c: Likewise. + * gcc.dg/compat/pr83487-2_x.c: Likewise. + * gcc.dg/compat/pr83487-2_y.c: Likewise. + * gcc.dg/torture/pr28814.c: Likewise. + * gcc.target/riscv/abi/empty-struct+union-1.c: New test. + * gcc.target/riscv/abi/empty-struct+union-2.c: New test. + * gcc.target/riscv/abi/empty-struct+union-3.c: New test. + * gcc.target/riscv/abi/empty-struct+union-4.c: New test. + * gcc.target/riscv/abi/empty-struct-1.c: New test. + * gcc.target/riscv/abi/empty-struct-2.c: New test. + * gcc.target/riscv/abi/empty-struct-3.c: New test. + * gcc.target/riscv/abi/empty-struct-4.c: New test. + * gcc.target/riscv/abi/empty-struct-5.c: New test. + * gcc.target/riscv/abi/empty-struct-6.c: New test. + * gcc.target/riscv/abi/empty-struct-7.c: New test. + * gcc.target/riscv/abi/empty-struct-8.c: New test. + * gcc.target/riscv/abi/empty-struct-9.c: New test. + * gcc.target/riscv/abi/empty-struct-10.c: New test. + * gcc.target/riscv/abi/empty-struct-11.c: New test. + * gcc.target/riscv/abi/empty-struct-12.c: New test. + * gcc.target/riscv/abi/empty-union-1.c: New test. + * gcc.target/riscv/abi/empty-union-2.c: New test. + * gcc.target/riscv/abi/empty-union-3.c: New test. + * gcc.target/riscv/abi/empty-union-4.c: New test. + * gcc.target/riscv/riscv.exp: Add abi subdirectory. + +2025-11-03 Alfie Richards <alfie.richards@arm.com> + + PR target/122405 + * g++.target/aarch64/mv-cpu-features.C: Add HWCAP_ATOMICS and + HWCAP2_RNG defines. + +2025-11-03 Alfie Richards <alfie.richards@arm.com> + + * gcc.target/aarch64/fmv_priority.in: Update for new features. + * gcc.target/aarch64/fmv_priority1.c: Ditto. + * gcc.target/aarch64/fmv_priority2.c: Ditto. + +2025-11-03 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/vect19.ads, gnat.dg/vect19.adb: New test. + * gnat.dg/vect19_pkg.ads, gnat.dg/vect19_pkg.adb: New helper. + +2025-11-03 Guo Jie <guojie@loongson.cn> + + * gcc.target/loongarch/mode-tieable-opt.c: New test. + +2025-11-03 Guo Jie <guojie@loongson.cn> + + * gcc.target/loongarch/mem-and-mask-opt.c: New test. + +2025-11-03 Guo Jie <guojie@loongson.cn> + + * gcc.target/loongarch/vec_pack_unpack_256.c: Adjust to changed + lasx_xvpermi_q_<LASX:mode> template. + * gcc.target/loongarch/vector/lasx/lasx-builtin.c: Ditto. + * gcc.target/loongarch/lasx-xvpermi_q-opt.c: New test. + +2025-11-03 Guo Jie <guojie@loongson.cn> + + * gcc.target/loongarch/and-large-immediate-opt.c: New test. + +2025-11-03 Guo Jie <guojie@loongson.cn> + + * gcc.target/loongarch/extendsidi2-combine.c: New test. + * gcc.target/loongarch/spill-less.c: New test. + +2025-11-03 Guo Jie <guojie@loongson.cn> + + * gcc.target/loongarch/mulh_wu.c: New test. + +2025-11-03 Tamar Christina <tamar.christina@arm.com> + + PR tree-optimization/122475 + * gcc.dg/vect/pr122475.c: New test. + * gcc.target/aarch64/sve/vect-reduc-bool-19.c: New test. + * gcc.target/aarch64/sve/vect-reduc-bool-20.c: New test. + +2025-11-03 H.J. Lu <hjl.tools@gmail.com> + + * gcc.target/i386/builtin-memmove-1a.c: New test. + * gcc.target/i386/builtin-memmove-1b.c: Likewise. + * gcc.target/i386/builtin-memmove-1c.c: Likewise. + * gcc.target/i386/builtin-memmove-1d.c: Likewise. + * gcc.target/i386/builtin-memmove-2a.c: Likewise. + * gcc.target/i386/builtin-memmove-2b.c: Likewise. + * gcc.target/i386/builtin-memmove-2c.c: Likewise. + * gcc.target/i386/builtin-memmove-2d.c: Likewise. + * gcc.target/i386/builtin-memmove-3a.c: Likewise. + * gcc.target/i386/builtin-memmove-3b.c: Likewise. + * gcc.target/i386/builtin-memmove-3c.c: Likewise. + * gcc.target/i386/builtin-memmove-4a.c: Likewise. + * gcc.target/i386/builtin-memmove-4b.c: Likewise. + * gcc.target/i386/builtin-memmove-4c.c: Likewise. + * gcc.target/i386/builtin-memmove-5a.c: Likewise. + * gcc.target/i386/builtin-memmove-5b.c: Likewise. + * gcc.target/i386/builtin-memmove-5c.c: Likewise. + * gcc.target/i386/builtin-memmove-6.c: Likewise. + * gcc.target/i386/builtin-memmove-7.c: Likewise. + * gcc.target/i386/builtin-memmove-8.c: Likewise. + * gcc.target/i386/builtin-memmove-9.c: Likewise. + * gcc.target/i386/builtin-memmove-10.c: Likewise. + * gcc.target/i386/builtin-memmove-11a.c: Likewise. + * gcc.target/i386/builtin-memmove-11b.c: Likewise. + * gcc.target/i386/builtin-memmove-11c.c: Likewise. + * gcc.target/i386/builtin-memmove-12.c: Likewise. + * gcc.target/i386/builtin-memmove-13.c: Likewise. + * gcc.target/i386/builtin-memmove-14.c: Likewise. + * gcc.target/i386/builtin-memmove-15.c: Likewise. + +2025-11-03 Shreya Munnangi <smunnangi1@ventanamicro.com> + + PR target/52345 + * gcc.target/riscv/pr52345.c: Add new test cases. + +2025-11-03 chenxiaolong <chenxiaolong@loongson.cn> + + * gcc.target/loongarch/vector/lasx/vect-concat-128-256-result.c: New test. + * gcc.target/loongarch/vector/lasx/vect-concat-128-256.c: New test. + * gcc.target/loongarch/vector/lasx/vect-extract-256-128-result.c: New test. + * gcc.target/loongarch/vector/lasx/vect-extract-256-128.c: New test. + * gcc.target/loongarch/vector/lasx/vect-insert-128-256-result.c: New test. + * gcc.target/loongarch/vector/lasx/vect-insert-128-256.c: New test. + +2025-11-03 Lulu Cheng <chenglulu@loongson.cn> + + * gcc.target/loongarch/imm-load.c: Modify. + +2025-11-02 Gaius Mulley <gaiusmod2@gmail.com> + + PR modula2/122499 + * gm2.dg/spell/iso/fail/badimport2.mod: New test. + * gm2.dg/spell/iso/fail/badimport3.mod: New test. + * gm2.dg/spell/iso/fail/badimport4.mod: New test. + +2025-11-02 Eric Botcazou <ebotcazou@adacore.com> + + * gcc.target/sparc/small-struct-1.c: Run only on Solaris. + +2025-11-02 Eric Botcazou <ebotcazou@adacore.com> + + * gcc.target/sparc/cbcond-1.c: Accept reverse branches. + * gcc.target/sparc/cbcond-2.c: Likewise. + * gcc.target/sparc/overflow-3.c: Likewise. + * gcc.target/sparc/overflow-4.c: Likewise. + * gcc.target/sparc/overflow-5.c: Likewise. + +2025-11-02 Uros Bizjak <ubizjak@gmail.com> + + PR target/122518 + * gcc.target/i386/pr122518.c: New test. + +2025-11-02 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/specs/unknown_discr1.ads: New test. + * gnat.dg/specs/unknown_discr1_pkg.ads: New helper. + * gnat.dg/specs/unknown_discr1_pkg-child.ads: Likewise. + * gnat.dg/specs/unknown_discr1_pkg-g.ads: Likewise. + * gnat.dg/specs/unknown_discr1_pkg-inst.ads: Likewise. + +2025-11-02 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/use_type4.adb: New test. + +2025-11-02 Georg-Johann Lay <avr@gjlay.de> + + * gcc.target/avr/torture/pr84211-fuse-move-1.c: Add -fno-lto. + +2025-11-02 Nathaniel Shead <nathanieloshead@gmail.com> + + PR c++/122421 + * g++.dg/modules/inst-6_a.C: New test. + * g++.dg/modules/inst-6_b.C: New test. + +2025-11-01 Shreya Munnangi <smunnangi1@ventanamicro.com> + + PR target/67731 + * gcc.target/riscv/pr67731.c: New test. + * gcc.target/sh/pr67731.c: New test. + +2025-11-01 Jeff Law <jlaw@ventanamicro.com> + + PR rtl-optimization/122321 + * gcc.target/riscv/rvv/autovec/pr122321.c: New test. + +2025-11-01 Harald Anlauf <anlauf@gmx.de> + + PR fortran/78640 + * gfortran.dg/pure_result.f90: New test. + +2025-11-01 Nathaniel Shead <nathanieloshead@gmail.com> + + PR c++/122381 + * g++.dg/modules/convop-2_a.H: New test. + * g++.dg/modules/convop-2_b.C: New test. + +2025-11-01 Martin Uecker <uecker@tugraz.at> + + * gcc.dg/gnu-compoundlit-1.c: New test. + * gcc.dg/gnu-compoundlit-2.c: New test. + * gcc.dg/pr68090.c: Adapt. + * gcc.dg/vla-init-4.c: Adapt. + * gcc.dg/vla-init-5.c: Adapt. + +2025-11-01 Martin Uecker <uecker@tugraz.at> + + PR c/97986 + * gcc.dg/pr97986-1.c: New test. + * gcc.dg/pr97986-2.c: New test. + +2025-11-01 Andrew Pinski <andrew.pinski@oss.qualcomm.com> + + * gcc.dg/fold-vecperm-1.c: Test at forwprop3. + +2025-10-31 Tamar Christina <tamar.christina@arm.com> + + PR target/121853 + * gcc.target/aarch64/pr121853_1.c: New test. + * gcc.target/aarch64/pr121853_2.c: New test. + +2025-10-31 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/122452 + * gfortran.dg/pdt_65.f03: New test. + +2025-10-31 Richard Biener <rguenther@suse.de> + + PR tree-optimization/122502 + * gcc.dg/torture/pr122502.c: New testcase. + +2025-10-31 Andrew Pinski <andrew.pinski@oss.qualcomm.com> + + * gcc.dg/tree-ssa/pr122478.c: Swap `1` and `"optimized"`. + +2025-10-31 Andrew Pinski <andrew.pinski@oss.qualcomm.com> + + PR tree-optimization/122497 + * gcc.dg/torture/pr122497-1.c: New test. + +2025-10-31 Lulu Cheng <chenglulu@loongson.cn> + + * gcc.dg/vect/slp-widen-mult-half.c: Remove '-mlasx'. + * gcc.dg/vect/tree-vect.h: Check whether the runtime + environment supports LSX instructions. + * gcc.dg/vect/vect-widen-mult-const-s16.c: Dito. + * gcc.dg/vect/vect-widen-mult-const-u16.c: Dito. + * gcc.dg/vect/vect-widen-mult-half-u8.c: Dito. + * gcc.dg/vect/vect-widen-mult-half.c: Dito. + * gcc.dg/vect/vect-widen-mult-u16.c: Dito. + * gcc.dg/vect/vect-widen-mult-u8-s16-s32.c: Dito. + * gcc.dg/vect/vect-widen-mult-u8-u32.c: Dito. + * gcc.dg/vect/vect-widen-mult-u8.c: Dito. + 2025-10-30 Yap Zhi Heng <yapzhhg@gmail.com> * rust/compile/tuplepattern-restpattern-typecheck-err.rs: New file. diff --git a/gcc/testsuite/algol68/README.mcts b/gcc/testsuite/algol68/README.mcts new file mode 100644 index 0000000..cdf95ce --- /dev/null +++ b/gcc/testsuite/algol68/README.mcts @@ -0,0 +1,18 @@ +The mcts testsuite is not distributed along with GCC due to unclear +distribution terms of its contents, which have to be clarified with +the CWI. + +In the meanwhile, you can find the testset at: + + https://git.sr.ht/~jemarch/a68-mcts + +In order to install them in the GCC sources, just copy the file and +two directories to the testsuite/algol68 directory, like: + + $ git clone https://git.sr.ht/~jemarch/a68-mcts + $ cd a68-mcts + $ cp README.mcts /path/to/gcc/gcc/testsuite/algol68/ + $ cp -r compile/* /path/to/gcc/gcc/testsuite/algol68/compile/ + $ cp -r execute/* /path/to/gcc/gcc/testsuite/algol68/execute/ + +Then make check-algol68 will include the evil MCTS as well. diff --git a/gcc/testsuite/algol68/compile/a68includes/goodbye-supper.a68 b/gcc/testsuite/algol68/compile/a68includes/goodbye-supper.a68 new file mode 100644 index 0000000..c287d6a --- /dev/null +++ b/gcc/testsuite/algol68/compile/a68includes/goodbye-supper.a68 @@ -0,0 +1,4 @@ +proc goodbye = (string name) string: +begin string msg := "Goodbye " + name; + msg +end; diff --git a/gcc/testsuite/algol68/compile/a68includes/goodbye.a68 b/gcc/testsuite/algol68/compile/a68includes/goodbye.a68 new file mode 100644 index 0000000..19c3acc --- /dev/null +++ b/gcc/testsuite/algol68/compile/a68includes/goodbye.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +# PR UPPER PR # + +PROC goodbye = (STRING name) STRING: +BEGIN + STRING msg := "Goodbye " + name; + msg +END; diff --git a/gcc/testsuite/algol68/compile/a68includes/hello-supper.a68 b/gcc/testsuite/algol68/compile/a68includes/hello-supper.a68 new file mode 100644 index 0000000..2af568bc --- /dev/null +++ b/gcc/testsuite/algol68/compile/a68includes/hello-supper.a68 @@ -0,0 +1,5 @@ +proc hello = (string name) string: +begin string msg := "Hello " + name; + msg +end; + diff --git a/gcc/testsuite/algol68/compile/a68includes/hello.a68 b/gcc/testsuite/algol68/compile/a68includes/hello.a68 new file mode 100644 index 0000000..aa72e28 --- /dev/null +++ b/gcc/testsuite/algol68/compile/a68includes/hello.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +# PR UPPER PR # + +PROC hello = (STRING name) STRING: +BEGIN + STRING msg := "Hello " + name; + msg +END; diff --git a/gcc/testsuite/algol68/compile/actual-bounds-expected-1.a68 b/gcc/testsuite/algol68/compile/actual-bounds-expected-1.a68 new file mode 100644 index 0000000..58309db --- /dev/null +++ b/gcc/testsuite/algol68/compile/actual-bounds-expected-1.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN []INT a := (1,2,3); # { dg-error "actual bounds expected" } # + SKIP +END diff --git a/gcc/testsuite/algol68/compile/actual-bounds-expected-2.a68 b/gcc/testsuite/algol68/compile/actual-bounds-expected-2.a68 new file mode 100644 index 0000000..e80e8cb --- /dev/null +++ b/gcc/testsuite/algol68/compile/actual-bounds-expected-2.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN LOC[]INT a := (1,2,3); # { dg-error "actual bounds expected" } # + SKIP +END diff --git a/gcc/testsuite/algol68/compile/actual-bounds-expected-3.a68 b/gcc/testsuite/algol68/compile/actual-bounds-expected-3.a68 new file mode 100644 index 0000000..26ddd27 --- /dev/null +++ b/gcc/testsuite/algol68/compile/actual-bounds-expected-3.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # + +BEGIN LOC[]INT a := (1,2,3), # { dg-error "actual bounds expected" } # + b := (4); + SKIP +END diff --git a/gcc/testsuite/algol68/compile/balancing-1.a68 b/gcc/testsuite/algol68/compile/balancing-1.a68 new file mode 100644 index 0000000..62d1221 --- /dev/null +++ b/gcc/testsuite/algol68/compile/balancing-1.a68 @@ -0,0 +1,7 @@ +mode Word = union (void,real), + Rules = union (void,string); + +op LEN = (Word w) int: skip, +LEN = (Rules r) int: skip; + +skip diff --git a/gcc/testsuite/algol68/compile/bold-nestable-comment-1.a68 b/gcc/testsuite/algol68/compile/bold-nestable-comment-1.a68 new file mode 100644 index 0000000..0820c3d --- /dev/null +++ b/gcc/testsuite/algol68/compile/bold-nestable-comment-1.a68 @@ -0,0 +1,7 @@ +# { dg-options {-fstropping=upper} } # +# pr UPPER pr # +BEGIN NOTE This is a + NOTE nestable ETON comment in bold style. + ETON + SKIP +END diff --git a/gcc/testsuite/algol68/compile/bold-taggle-1.a68 b/gcc/testsuite/algol68/compile/bold-taggle-1.a68 new file mode 100644 index 0000000..77ce9e7 --- /dev/null +++ b/gcc/testsuite/algol68/compile/bold-taggle-1.a68 @@ -0,0 +1,6 @@ +# { dg-options {-std=gnu68 -fstropping=upper} } # + +BEGIN MODE FOO_BAR = INT; + FOO_BAR foo_bar = 10; + SKIP +END diff --git a/gcc/testsuite/algol68/compile/brief-nestable-comment-1.a68 b/gcc/testsuite/algol68/compile/brief-nestable-comment-1.a68 new file mode 100644 index 0000000..045b9b5 --- /dev/null +++ b/gcc/testsuite/algol68/compile/brief-nestable-comment-1.a68 @@ -0,0 +1,4 @@ +begin { This is a + { nestable } comment in brief style. } + skip +end diff --git a/gcc/testsuite/algol68/compile/brief-nestable-comment-2.a68 b/gcc/testsuite/algol68/compile/brief-nestable-comment-2.a68 new file mode 100644 index 0000000..a4e5d3e --- /dev/null +++ b/gcc/testsuite/algol68/compile/brief-nestable-comment-2.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN NOTE This is a + { nestable } comment in brief style. + ETON + SKIP +END diff --git a/gcc/testsuite/algol68/compile/char-break-1.a68 b/gcc/testsuite/algol68/compile/char-break-1.a68 new file mode 100644 index 0000000..30308b3 --- /dev/null +++ b/gcc/testsuite/algol68/compile/char-break-1.a68 @@ -0,0 +1,11 @@ +{ Make sure char denotations with string breaks work. } +begin prio % = 9; + op % = (char a) char: a; + assert (ABS %"'n" = 10); + assert (ABS %"'f" = 12); + assert (ABS %"'t" = 9); + assert (ABS %"'r" = 13); + assert (%"'( u0061)" = "a"); + assert (%"'(U00000061 )" = "a"); + assert (%"'(u1234)" = replacement_char) +end diff --git a/gcc/testsuite/algol68/compile/compile.exp b/gcc/testsuite/algol68/compile/compile.exp new file mode 100644 index 0000000..68fa5fa --- /dev/null +++ b/gcc/testsuite/algol68/compile/compile.exp @@ -0,0 +1,34 @@ +# Copyright (C) 2024 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# <http://www.gnu.org/licenses/>. + +# Compile tests, no torture testing. +# +# These tests raise errors in the front end; torture testing doesn't apply. + +load_lib algol68-dg.exp + +# Initialize `dg'. +dg-init + +# Main loop. +set saved-dg-do-what-default ${dg-do-what-default} + +set dg-do-what-default "compile" +algol68-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.a68]] "" "" +set dg-do-what-default ${saved-dg-do-what-default} + +# All done. +dg-finish diff --git a/gcc/testsuite/algol68/compile/conditional-clause-1.a68 b/gcc/testsuite/algol68/compile/conditional-clause-1.a68 new file mode 100644 index 0000000..a727bc2 --- /dev/null +++ b/gcc/testsuite/algol68/compile/conditional-clause-1.a68 @@ -0,0 +1,9 @@ +# { dg-options "-fstropping=upper" } # + +BEGIN INT i := 26; + IF INT ii = i * 2; ii > 50 THEN + ii + ELIF i = 10 THEN + 100 + FI +END diff --git a/gcc/testsuite/algol68/compile/error-bold-taggle-1.a68 b/gcc/testsuite/algol68/compile/error-bold-taggle-1.a68 new file mode 100644 index 0000000..d813e55 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-bold-taggle-1.a68 @@ -0,0 +1,6 @@ +# { dg-options {-std=algol68 -fstropping=upper} } # + +BEGIN MODE FOO_BAR = INT; # { dg-error "unworthy" } # + FOO_BAR foo_bar = 10; + SKIP +END diff --git a/gcc/testsuite/algol68/compile/error-coercion-1.a68 b/gcc/testsuite/algol68/compile/error-coercion-1.a68 new file mode 100644 index 0000000..d0e2482 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-coercion-1.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # + +BEGIN INT a; + a := "foo" # { dg-error "cannot be coerced" } # +END diff --git a/gcc/testsuite/algol68/compile/error-coercion-2.a68 b/gcc/testsuite/algol68/compile/error-coercion-2.a68 new file mode 100644 index 0000000..bb8de30 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-coercion-2.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # + +# This is Example 4.2.6c in McGETTRICK[78]. # +BEGIN []STRUCT([]INT a) r = (1,2,3); # { dg-error "cannot be coerced" } # + SKIP +END diff --git a/gcc/testsuite/algol68/compile/error-coercion-flex-1.a68 b/gcc/testsuite/algol68/compile/error-coercion-flex-1.a68 new file mode 100644 index 0000000..c556d70 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-coercion-flex-1.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # + +# Coercing from REF FLEX[]REAL to REF[]REAL is not allowed, since + flexibility shall match # +BEGIN FLEX[1:0] REAL rowvar := SKIP; + REF [] REAL xlm = rowvar; # { dg-error "FLEX.*cannot be coerced" } # + SKIP +END diff --git a/gcc/testsuite/algol68/compile/error-compile-unknown-tag-1.a68 b/gcc/testsuite/algol68/compile/error-compile-unknown-tag-1.a68 new file mode 100644 index 0000000..cd69d1a --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-compile-unknown-tag-1.a68 @@ -0,0 +1,8 @@ +module Foo = def pub int idpublic = 10; + int idprivate = 20; + skip + fed, + Bar = def pub int idpublic = 30; + int idprivate = 40; + xxx { dg-error "" } + fed diff --git a/gcc/testsuite/algol68/compile/error-conformance-clause-1.a68 b/gcc/testsuite/algol68/compile/error-conformance-clause-1.a68 new file mode 100644 index 0000000..e6cb738 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-conformance-clause-1.a68 @@ -0,0 +1,8 @@ +{ This is an invalid program. } +begin case + if true then "foo" else 10 fi { dg-error "not a united mode" } + in (string): skip, + (int): skip + esac +end + diff --git a/gcc/testsuite/algol68/compile/error-contraction-1.a68 b/gcc/testsuite/algol68/compile/error-contraction-1.a68 new file mode 100644 index 0000000..f2bce73 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-contraction-1.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # + +# Contracting mixed collateral variable and constant declarations is + not allowed. +# +(INT foo = 100, bar := 200) # { dg-error "mixed" } # diff --git a/gcc/testsuite/algol68/compile/error-contraction-2.a68 b/gcc/testsuite/algol68/compile/error-contraction-2.a68 new file mode 100644 index 0000000..2115a4c --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-contraction-2.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # + +# Contracting mixed collateral variable and constant declarations is + not allowed. # +BEGIN PROC x = VOID: SKIP, + y := VOID: SKIP; # { dg-error "mixed" } # + x +END diff --git a/gcc/testsuite/algol68/compile/error-def-1.a68 b/gcc/testsuite/algol68/compile/error-def-1.a68 new file mode 100644 index 0000000..6d7cdc8 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-def-1.a68 @@ -0,0 +1,3 @@ +module Foo = +def skip; { dg-error "fed" } + skip diff --git a/gcc/testsuite/algol68/compile/error-incestuous-union-1.a68 b/gcc/testsuite/algol68/compile/error-incestuous-union-1.a68 new file mode 100644 index 0000000..519cb8a --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-incestuous-union-1.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # + +# Union modes shall not contain modes which are firmly related, i.e. + it shall not be possible to coerce from one mode to another in a + firm context. # +BEGIN UNION(INT, REF INT) incestuous; # { dg-error "has firmly related components" } # + incestuous +END diff --git a/gcc/testsuite/algol68/compile/error-label-after-decl-1.a68 b/gcc/testsuite/algol68/compile/error-label-after-decl-1.a68 new file mode 100644 index 0000000..670f890 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-label-after-decl-1.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # + +BEGIN GOTO end; + ASSERT(FALSE); +end: 0; + INT i = 10; # { dg-error "declaration cannot follow" } # + i +END diff --git a/gcc/testsuite/algol68/compile/error-mode-stropping-1.a68 b/gcc/testsuite/algol68/compile/error-mode-stropping-1.a68 new file mode 100644 index 0000000..7a619d8 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-mode-stropping-1.a68 @@ -0,0 +1,3 @@ +begin struct (int i, real r) j; + j := "joo" { dg-error "char.*struct \\(int i, real r\\)" } +end diff --git a/gcc/testsuite/algol68/compile/error-mode-stropping-10.a68 b/gcc/testsuite/algol68/compile/error-mode-stropping-10.a68 new file mode 100644 index 0000000..fd70de7 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-mode-stropping-10.a68 @@ -0,0 +1,3 @@ +begin long long int j; + j := "joo" { dg-error "char.*long long int" } +end diff --git a/gcc/testsuite/algol68/compile/error-mode-stropping-11.a68 b/gcc/testsuite/algol68/compile/error-mode-stropping-11.a68 new file mode 100644 index 0000000..156d8d3 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-mode-stropping-11.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN LONG LONG INT j; + j := "joo" { dg-error "CHAR.*LONG LONG INT" } +END diff --git a/gcc/testsuite/algol68/compile/error-mode-stropping-12.a68 b/gcc/testsuite/algol68/compile/error-mode-stropping-12.a68 new file mode 100644 index 0000000..0dda5be --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-mode-stropping-12.a68 @@ -0,0 +1,3 @@ +begin short int j; + j := "joo" { dg-error "char.*short int" } +end diff --git a/gcc/testsuite/algol68/compile/error-mode-stropping-13.a68 b/gcc/testsuite/algol68/compile/error-mode-stropping-13.a68 new file mode 100644 index 0000000..84cf830 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-mode-stropping-13.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN SHORT INT j; + j := "joo" { dg-error "CHAR.*SHORT INT" } +END diff --git a/gcc/testsuite/algol68/compile/error-mode-stropping-14.a68 b/gcc/testsuite/algol68/compile/error-mode-stropping-14.a68 new file mode 100644 index 0000000..24bda0a --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-mode-stropping-14.a68 @@ -0,0 +1,3 @@ +begin short short int j; + j := "joo" { dg-error "char.*short short int" } +end diff --git a/gcc/testsuite/algol68/compile/error-mode-stropping-15.a68 b/gcc/testsuite/algol68/compile/error-mode-stropping-15.a68 new file mode 100644 index 0000000..0136fdb --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-mode-stropping-15.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN SHORT SHORT INT j; + j := "joo" { dg-error "CHAR.*SHORT SHORT INT" } +END diff --git a/gcc/testsuite/algol68/compile/error-mode-stropping-16.a68 b/gcc/testsuite/algol68/compile/error-mode-stropping-16.a68 new file mode 100644 index 0000000..82359e5 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-mode-stropping-16.a68 @@ -0,0 +1,3 @@ +begin flex[1:0]int j; + j := "joo" { dg-error "char.*flex.*int" } +end diff --git a/gcc/testsuite/algol68/compile/error-mode-stropping-17.a68 b/gcc/testsuite/algol68/compile/error-mode-stropping-17.a68 new file mode 100644 index 0000000..e733c51 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-mode-stropping-17.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN FLEX[1:0]INT j; + j := "joo" { dg-error "CHAR.*FLEX.*INT" } +END diff --git a/gcc/testsuite/algol68/compile/error-mode-stropping-2.a68 b/gcc/testsuite/algol68/compile/error-mode-stropping-2.a68 new file mode 100644 index 0000000..f72b6dd --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-mode-stropping-2.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN STRUCT (INT i, REAL r) j; + j := "joo" # { dg-error "CHAR.*STRUCT \\(INT i, REAL r\\)" } # +END diff --git a/gcc/testsuite/algol68/compile/error-mode-stropping-3.a68 b/gcc/testsuite/algol68/compile/error-mode-stropping-3.a68 new file mode 100644 index 0000000..eb672c4 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-mode-stropping-3.a68 @@ -0,0 +1,3 @@ +begin union (int,real) j; + j := "joo" { dg-error "char.*union \\( *real *, *int *\\)" } +end diff --git a/gcc/testsuite/algol68/compile/error-mode-stropping-4.a68 b/gcc/testsuite/algol68/compile/error-mode-stropping-4.a68 new file mode 100644 index 0000000..42c6ee2 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-mode-stropping-4.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN UNION (INT,REAL) j; + j := "joo" { dg-error "CHAR.*UNION \\( *REAL *, *INT *\\)" } +END diff --git a/gcc/testsuite/algol68/compile/error-mode-stropping-5.a68 b/gcc/testsuite/algol68/compile/error-mode-stropping-5.a68 new file mode 100644 index 0000000..0206d19 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-mode-stropping-5.a68 @@ -0,0 +1,3 @@ +begin proc union (int,real) j; + j := "joo" { dg-error "char.*proc union \\( *real *, *int *\\)" } +end diff --git a/gcc/testsuite/algol68/compile/error-mode-stropping-6.a68 b/gcc/testsuite/algol68/compile/error-mode-stropping-6.a68 new file mode 100644 index 0000000..5f84043 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-mode-stropping-6.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN PROC UNION (INT,REAL) j; + j := "joo" { dg-error "CHAR.*PROC UNION \\( *REAL *, *INT *\\)" } +END diff --git a/gcc/testsuite/algol68/compile/error-mode-stropping-8.a68 b/gcc/testsuite/algol68/compile/error-mode-stropping-8.a68 new file mode 100644 index 0000000..4930886 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-mode-stropping-8.a68 @@ -0,0 +1,3 @@ +begin long int j; + j := "joo" { dg-error "char.*long int" } +end diff --git a/gcc/testsuite/algol68/compile/error-mode-stropping-9.a68 b/gcc/testsuite/algol68/compile/error-mode-stropping-9.a68 new file mode 100644 index 0000000..dc20eb3 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-mode-stropping-9.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN LONG INT j; + j := "joo" { dg-error "CHAR.*LONG INT" } +END diff --git a/gcc/testsuite/algol68/compile/error-module-coercions-1.a68 b/gcc/testsuite/algol68/compile/error-module-coercions-1.a68 new file mode 100644 index 0000000..460c381 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-module-coercions-1.a68 @@ -0,0 +1,15 @@ +{ This test makes sure mode checks are carried + over the inside of module texts. } +module Foo = def + skip + postlude + int i = "foo"; { dg-error "coerced" } + skip + fed, + Bar = def + int i = 3.14; { dg-error "coerced" } + skip + postlude + skip + fed, + Baz = def skip fed diff --git a/gcc/testsuite/algol68/compile/error-module-not-found-1.a68 b/gcc/testsuite/algol68/compile/error-module-not-found-1.a68 new file mode 100644 index 0000000..e990c6e --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-module-not-found-1.a68 @@ -0,0 +1,4 @@ +access + Foo { dg-error "cannot find module" } +begin skip end + diff --git a/gcc/testsuite/algol68/compile/error-module-ranges-1.a68 b/gcc/testsuite/algol68/compile/error-module-ranges-1.a68 new file mode 100644 index 0000000..b377ffb --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-module-ranges-1.a68 @@ -0,0 +1,13 @@ +{ Definitions in the def-part of a module text are visible in the + postlude-part, but not the other way around. } + +module Foo = def int i; + x := 20 { dg-error "" } + postlude + i := 10 { this is ok } + fed, + Bar = def int x; + skip + postlude + x := 20 { this is ok } + fed diff --git a/gcc/testsuite/algol68/compile/error-nestable-comments-1.a68 b/gcc/testsuite/algol68/compile/error-nestable-comments-1.a68 new file mode 100644 index 0000000..df00a1a --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-nestable-comments-1.a68 @@ -0,0 +1,9 @@ +# { dg-options "-fstropping=upper" } # +# pr UPPER pr # +BEGIN NOTE This is a + NOTE nestable ETON comment in brief style. + ETON + { Another { comment }. } + NOTE invalid { nesting ETON of comments } # { dg-error "" } # + SKIP +END diff --git a/gcc/testsuite/algol68/compile/error-nested-comment-1.a68 b/gcc/testsuite/algol68/compile/error-nested-comment-1.a68 new file mode 100644 index 0000000..3c78f34 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-nested-comment-1.a68 @@ -0,0 +1,6 @@ +{ The string in nested comment is in one logical line. } +begin + { puts ("{'n { dg-error {} } +"); { this prints foo }} + skip +end diff --git a/gcc/testsuite/algol68/compile/error-no-bounds-allowed-1.a68 b/gcc/testsuite/algol68/compile/error-no-bounds-allowed-1.a68 new file mode 100644 index 0000000..75d66bc --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-no-bounds-allowed-1.a68 @@ -0,0 +1,15 @@ +# { dg-options "-fstropping=upper" } # + +BEGIN [1:10]INT i, + [1:10]STRUCT(REF[]INT i, BOOL j) k, + [1:10]STRUCT([1:10]INT i, BOOL j) l, + [1:10]REF[]INT p; + # formal, so no bounds allowed: # + [1:10]PROC[1:10]INT q, # { dg-error "formal bounds expected" } # + STRUCT(REF[1:10]INT i, BOOLj) m, # { dg-error "virtual bounds expected" } # + [1:10]REF[1:10]INT mn, # { dg-error "virtual bounds expected" } # + PROC([1:10]INT)VOID pp, # { dg-error "formal bounds expected" } # + UNION([1:10] INT, BOOL) nm, # { dg-error "formal bounds expected" } # + [1:10]INT u = (1); # { dg-error "formal bounds expected" } # + SKIP +END diff --git a/gcc/testsuite/algol68/compile/error-pragmat-1.a68 b/gcc/testsuite/algol68/compile/error-pragmat-1.a68 new file mode 100644 index 0000000..8c5f1c1d --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-pragmat-1.a68 @@ -0,0 +1,8 @@ +{ dg-error "unrecognized pragmat" } pr invalid Foo in "module" pr + +begin prio // = 8; + op (int,int)int // = lala; + proc lala = (int a, b) int: a + b; + proc void jeje = skip; + skip +end diff --git a/gcc/testsuite/algol68/compile/error-pragmat-access-1.a68 b/gcc/testsuite/algol68/compile/error-pragmat-access-1.a68 new file mode 100644 index 0000000..2eb4ceb --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-pragmat-access-1.a68 @@ -0,0 +1,8 @@ +pr access Foo in pr { dg-error "expected string" } + +begin prio // = 8; + op (int,int)int // = lala; + proc lala = (int a, b) int: a + b; + proc void jeje = skip; + skip +end diff --git a/gcc/testsuite/algol68/compile/error-pragmat-access-2.a68 b/gcc/testsuite/algol68/compile/error-pragmat-access-2.a68 new file mode 100644 index 0000000..643fcce --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-pragmat-access-2.a68 @@ -0,0 +1,9 @@ +pr access Foo in "lala" pr +pr access Foo in "lele" pr { dg-error "multiple" } + +begin prio // = 8; + op (int,int)int // = lala; + proc lala = (int a, b) int: a + b; + proc void jeje = skip; + skip +end diff --git a/gcc/testsuite/algol68/compile/error-pub-loc-1.a68 b/gcc/testsuite/algol68/compile/error-pub-loc-1.a68 new file mode 100644 index 0000000..eb17480 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-pub-loc-1.a68 @@ -0,0 +1,10 @@ +{ Publicized varifables cannot go on the stack, for obvious reasons. } + +module Foo = +def + pub string xx; + pub heap string yy; + pub loc string zz; { dg-error "" } + loc string vv; + skip +fed diff --git a/gcc/testsuite/algol68/compile/error-pub-out-of-def-1.a68 b/gcc/testsuite/algol68/compile/error-pub-out-of-def-1.a68 new file mode 100644 index 0000000..372bfbb --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-pub-out-of-def-1.a68 @@ -0,0 +1,13 @@ +module Foo = +def pub mode JORL = int; + pub proc plus = (int a, b) int: a + b; + pub proc vplus := (int a, b) int: a + b; + pub loc proc lvplus := (int a, b) int: a + b; + pub heap proc hvplus := (int a, b) int: a + b; + pub prio // = 8; + pub op // = (int a, b) int: a % b; + proc invalid = void: + (pub mode JI = void; { dg-error "" } + skip); + skip +fed diff --git a/gcc/testsuite/algol68/compile/error-pub-out-of-def-2.a68 b/gcc/testsuite/algol68/compile/error-pub-out-of-def-2.a68 new file mode 100644 index 0000000..d911e3d --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-pub-out-of-def-2.a68 @@ -0,0 +1,9 @@ +begin pub mode Jorl = void; { dg-error "" } + pub proc lala = void: skip; { dg-error "" } + pub proc lele := void: skip; { dg-error "" } + begin pub prio + = 4; { dg-error "" } + skip + end; + pub op // = (int a, b) int: a % b; { dg-error "" } + skip +end diff --git a/gcc/testsuite/algol68/compile/error-string-break-1.a68 b/gcc/testsuite/algol68/compile/error-string-break-1.a68 new file mode 100644 index 0000000..fd8e765 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-string-break-1.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # + +BEGIN puts ("hello '_ world") # { dg-error "invalid string break sequence" } # +END diff --git a/gcc/testsuite/algol68/compile/error-string-break-2.a68 b/gcc/testsuite/algol68/compile/error-string-break-2.a68 new file mode 100644 index 0000000..465f8f8 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-string-break-2.a68 @@ -0,0 +1,2 @@ +begin puts ("hello '(U0000) world") # { dg-error "eight" } # +end diff --git a/gcc/testsuite/algol68/compile/error-string-break-3.a68 b/gcc/testsuite/algol68/compile/error-string-break-3.a68 new file mode 100644 index 0000000..e4cf8f6 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-string-break-3.a68 @@ -0,0 +1,2 @@ +begin puts ("hello '(u00) world") # { dg-error "four" } # +end diff --git a/gcc/testsuite/algol68/compile/error-string-break-4.a68 b/gcc/testsuite/algol68/compile/error-string-break-4.a68 new file mode 100644 index 0000000..76adff9 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-string-break-4.a68 @@ -0,0 +1,2 @@ +begin puts ("hello '(u) world") # { dg-error "four" } # +end diff --git a/gcc/testsuite/algol68/compile/error-string-break-5.a68 b/gcc/testsuite/algol68/compile/error-string-break-5.a68 new file mode 100644 index 0000000..c42589f --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-string-break-5.a68 @@ -0,0 +1,2 @@ +begin puts ("hello '(u0010u0020) world") # { dg-error "" } # +end diff --git a/gcc/testsuite/algol68/compile/error-string-break-6.a68 b/gcc/testsuite/algol68/compile/error-string-break-6.a68 new file mode 100644 index 0000000..fed7d84 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-string-break-6.a68 @@ -0,0 +1,2 @@ +begin puts ("hello '(u0010'/) world") # { dg-error "" } # +end diff --git a/gcc/testsuite/algol68/compile/error-string-break-7.a68 b/gcc/testsuite/algol68/compile/error-string-break-7.a68 new file mode 100644 index 0000000..58545e0 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-string-break-7.a68 @@ -0,0 +1,2 @@ +begin puts ("'") # { dg-error "" } # +end diff --git a/gcc/testsuite/algol68/compile/error-string-break-8.a68 b/gcc/testsuite/algol68/compile/error-string-break-8.a68 new file mode 100644 index 0000000..dbc96e4 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-string-break-8.a68 @@ -0,0 +1,4 @@ +begin string s = + "'(Uf09f94a5)"; { dg-error "Unicode" } + skip +end diff --git a/gcc/testsuite/algol68/compile/error-stropping-5.a68 b/gcc/testsuite/algol68/compile/error-stropping-5.a68 new file mode 100644 index 0000000..3190472 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-stropping-5.a68 @@ -0,0 +1,3 @@ +begin int j; + j := "joo" { dg-error "char.*int" } +end diff --git a/gcc/testsuite/algol68/compile/error-stropping-6.a68 b/gcc/testsuite/algol68/compile/error-stropping-6.a68 new file mode 100644 index 0000000..af6097d --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-stropping-6.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT j; + j := "joo" # { dg-error "CHAR.*INT" } # +END diff --git a/gcc/testsuite/algol68/compile/error-stropping-keyword-1.a68 b/gcc/testsuite/algol68/compile/error-stropping-keyword-1.a68 new file mode 100644 index 0000000..4bf549f --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-stropping-keyword-1.a68 @@ -0,0 +1,2 @@ +begin for i to 10 skip od { dg-error "do" } +end diff --git a/gcc/testsuite/algol68/compile/error-stropping-keyword-2.a68 b/gcc/testsuite/algol68/compile/error-stropping-keyword-2.a68 new file mode 100644 index 0000000..a1e616d --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-stropping-keyword-2.a68 @@ -0,0 +1,3 @@ +# { dg-options "-fstropping=upper" } # +BEGIN FOR i TO 10 SKIP OD # { dg-error "DO" } # +END diff --git a/gcc/testsuite/algol68/compile/error-stropping-keyword-3.a68 b/gcc/testsuite/algol68/compile/error-stropping-keyword-3.a68 new file mode 100644 index 0000000..d1076e9 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-stropping-keyword-3.a68 @@ -0,0 +1,2 @@ +begin if then 10 else 20 fi { dg-error "if" } +end diff --git a/gcc/testsuite/algol68/compile/error-stropping-keyword-4.a68 b/gcc/testsuite/algol68/compile/error-stropping-keyword-4.a68 new file mode 100644 index 0000000..92b0b3b --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-stropping-keyword-4.a68 @@ -0,0 +1,3 @@ +# { dg-options "-fstropping=upper" } # +BEGIN IF THEN 10 ELSE 20 FI # { dg-error "IF" } # +END diff --git a/gcc/testsuite/algol68/compile/error-supper-1.a68 b/gcc/testsuite/algol68/compile/error-supper-1.a68 new file mode 100644 index 0000000..f2646c4 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-supper-1.a68 @@ -0,0 +1,3 @@ +# { dg-options {-fstropping=upper} } # + +begin ~ end # { dg-error "" } # diff --git a/gcc/testsuite/algol68/compile/error-supper-2.a68 b/gcc/testsuite/algol68/compile/error-supper-2.a68 new file mode 100644 index 0000000..f8c6c28 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-supper-2.a68 @@ -0,0 +1,5 @@ +# { dg-options {-fstropping=supper} } # + +begin int foo__bar = 10; # { dg-error "unworthy" } # + skip +end diff --git a/gcc/testsuite/algol68/compile/error-supper-3.a68 b/gcc/testsuite/algol68/compile/error-supper-3.a68 new file mode 100644 index 0000000..a35730c --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-supper-3.a68 @@ -0,0 +1,5 @@ +# { dg-options {-fstropping=supper} } # + +begin int _bar = 10; # { dg-error "unworthy" } # + skip +end diff --git a/gcc/testsuite/algol68/compile/error-supper-4.a68 b/gcc/testsuite/algol68/compile/error-supper-4.a68 new file mode 100644 index 0000000..726f806 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-supper-4.a68 @@ -0,0 +1,5 @@ +{ dg-options {-fstropping=supper} } + +begin int foo bar = 10; { dg-error "" } + skip +end diff --git a/gcc/testsuite/algol68/compile/error-supper-5.a68 b/gcc/testsuite/algol68/compile/error-supper-5.a68 new file mode 100644 index 0000000..0cf51c5 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-supper-5.a68 @@ -0,0 +1,5 @@ +# { dg-options {-fstropping=supper} } # + +begin int foo__ = 10; # { dg-error "unworthy" } # + skip +end diff --git a/gcc/testsuite/algol68/compile/error-supper-6.a68 b/gcc/testsuite/algol68/compile/error-supper-6.a68 new file mode 100644 index 0000000..c013b48 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-supper-6.a68 @@ -0,0 +1,6 @@ +# { dg-options {-fstropping=supper} } # + +begin mode foo_Invalid = int; # { dg-error "Invalid" } # + foo_Invalid some_int = 10; # { dg-error "Invalid" } # + skip +end diff --git a/gcc/testsuite/algol68/compile/error-underscore-in-mode-1.a68 b/gcc/testsuite/algol68/compile/error-underscore-in-mode-1.a68 new file mode 100644 index 0000000..2aa294d --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-underscore-in-mode-1.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # + +# Underscores are unworthy characters if they are not trailing + either a taggle or, in UPPER stropping, a bold word. # +BEGIN INT invalid_tag__; # { dg-error "unworthy character" } # + SKIP +END diff --git a/gcc/testsuite/algol68/compile/error-underscore-in-tag-1.a68 b/gcc/testsuite/algol68/compile/error-underscore-in-tag-1.a68 new file mode 100644 index 0000000..a5dcb86 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-underscore-in-tag-1.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # + +# Underscores are unworthy characters if they are not trailing a + taggle or, in UPPER stropping, a bold word.. # +BEGIN MODE INVALID_BOLD_WORD__; # { dg-error "unworthy character" } # + SKIP +END diff --git a/gcc/testsuite/algol68/compile/error-upper-1.a68 b/gcc/testsuite/algol68/compile/error-upper-1.a68 new file mode 100644 index 0000000..0538469 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-upper-1.a68 @@ -0,0 +1,3 @@ +# { dg-options {-fstropping=supper} } # + +BEGIN ~ END # { dg-error "" } # diff --git a/gcc/testsuite/algol68/compile/error-vacuum-1.a68 b/gcc/testsuite/algol68/compile/error-vacuum-1.a68 new file mode 100644 index 0000000..0e72459 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-vacuum-1.a68 @@ -0,0 +1,2 @@ +begin { dg-error "" } +end diff --git a/gcc/testsuite/algol68/compile/error-vacuum-2.a68 b/gcc/testsuite/algol68/compile/error-vacuum-2.a68 new file mode 100644 index 0000000..fe9716a --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-vacuum-2.a68 @@ -0,0 +1,2 @@ +( { dg-error "" } +) diff --git a/gcc/testsuite/algol68/compile/error-vacuum-3.a68 b/gcc/testsuite/algol68/compile/error-vacuum-3.a68 new file mode 100644 index 0000000..fc09600 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-vacuum-3.a68 @@ -0,0 +1,3 @@ +begin struct(int i, real r) foo = (); { dg-error "" } + skip +end diff --git a/gcc/testsuite/algol68/compile/error-widening-1.a68 b/gcc/testsuite/algol68/compile/error-widening-1.a68 new file mode 100644 index 0000000..38ea59a --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-widening-1.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # + +BEGIN INT a := 10; + LONG REAL l := a; # { dg-error "coerced" } # + l +END diff --git a/gcc/testsuite/algol68/compile/error-widening-2.a68 b/gcc/testsuite/algol68/compile/error-widening-2.a68 new file mode 100644 index 0000000..3165d1b --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-widening-2.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # + +BEGIN INT a := 10; + LONG INT l := a; # { dg-error "coerced" } # + l +END diff --git a/gcc/testsuite/algol68/compile/error-widening-3.a68 b/gcc/testsuite/algol68/compile/error-widening-3.a68 new file mode 100644 index 0000000..c4ffb30 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-widening-3.a68 @@ -0,0 +1,10 @@ +# { dg-options "-fstropping=upper" } # + +BEGIN INT d := 0; + INT y := 10; + LONG REAL x; + 2 + + (d > 0 | x | # { dg-error "" } # + y + ) +END diff --git a/gcc/testsuite/algol68/compile/error-widening-4.a68 b/gcc/testsuite/algol68/compile/error-widening-4.a68 new file mode 100644 index 0000000..fa5b207 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-widening-4.a68 @@ -0,0 +1,10 @@ +# { dg-options "-fstropping=upper" } # + +BEGIN + INT d := 0; + LONG REAL x; + 2 + + (d > 0 | x | # { dg-error "" } # + 10 + ) +END diff --git a/gcc/testsuite/algol68/compile/error-widening-5.a68 b/gcc/testsuite/algol68/compile/error-widening-5.a68 new file mode 100644 index 0000000..a619866 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-widening-5.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # + +BEGIN + LONG INT d := 0; # { dg-error "coerced" } # + d +END diff --git a/gcc/testsuite/algol68/compile/error-widening-6.a68 b/gcc/testsuite/algol68/compile/error-widening-6.a68 new file mode 100644 index 0000000..09512e2 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-widening-6.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # + +BEGIN + LONG LONG INT d := LONG 0; # { dg-error "coerced" } # + d +END diff --git a/gcc/testsuite/algol68/compile/error-widening-7.a68 b/gcc/testsuite/algol68/compile/error-widening-7.a68 new file mode 100644 index 0000000..0935208 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-widening-7.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # + +BEGIN + LONG REAL d := 3.14; # { dg-error "coerced" } # + d +END diff --git a/gcc/testsuite/algol68/compile/error-widening-8.a68 b/gcc/testsuite/algol68/compile/error-widening-8.a68 new file mode 100644 index 0000000..098f6c3b --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-widening-8.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # + +BEGIN + LONG LONG REAL d := LONG 3.14; # { dg-error "coerced" } # + d +END diff --git a/gcc/testsuite/algol68/compile/error-widening-9.a68 b/gcc/testsuite/algol68/compile/error-widening-9.a68 new file mode 100644 index 0000000..4d09238 --- /dev/null +++ b/gcc/testsuite/algol68/compile/error-widening-9.a68 @@ -0,0 +1,10 @@ +# { dg-options "-fstropping=upper" } # + +BEGIN + INT d := 0; + LONG LONG REAL x; + 2 + + (d > 0 | x | # { dg-error "" } # + 10 + ) +END diff --git a/gcc/testsuite/algol68/compile/hidden-operators-1.a68 b/gcc/testsuite/algol68/compile/hidden-operators-1.a68 new file mode 100644 index 0000000..d66242d --- /dev/null +++ b/gcc/testsuite/algol68/compile/hidden-operators-1.a68 @@ -0,0 +1,11 @@ +{ dg-options {-Whidden-declarations} } + +begin mode Trilean = union (void,bool); + + Trilean unknown = empty; + op NOT = (Trilean a) Trilean: { dg-warning "hides" } + skip; + op AND = (Trilean a,b) Trilean: { dg-warning "hides" } + skip; + skip +end diff --git a/gcc/testsuite/algol68/compile/implicit-widening-1.a68 b/gcc/testsuite/algol68/compile/implicit-widening-1.a68 new file mode 100644 index 0000000..2fa010c --- /dev/null +++ b/gcc/testsuite/algol68/compile/implicit-widening-1.a68 @@ -0,0 +1,10 @@ +# { dg-options "-Wextensions -fstropping=upper" } # + +# This program shall compile without warning, because + widening from INT to REAL is legal in the strict language, + since they have the same size. # + +BEGIN BOOL cond; + REAL x, y; + y + (cond | x | 10) +END diff --git a/gcc/testsuite/algol68/compile/include-supper.a68 b/gcc/testsuite/algol68/compile/include-supper.a68 new file mode 100644 index 0000000..af0521b --- /dev/null +++ b/gcc/testsuite/algol68/compile/include-supper.a68 @@ -0,0 +1,16 @@ +{ dg-options "-I$srcdir/algol68/compile/a68includes" } +{ dg-additional-files "$srcdir/algol68/compile/a68includes/hello-supper.a68 $srcdir/algol68/compile/a68includes/goodbye-supper.a68" } + +begin string name := "Algol68 with supper!"; + { Both files are in `./a68includes'. + The first one will be included because we uwed `-I. + The second one will be included because of the relative path. } + pr include "hello-supper.a68" pr + pr include "a68includes/goodbye-supper.a68" pr + + string bye := goodbye(name); + string hi := hello(name); + + puts(hi + "\n"); + puts(bye + "\n") +end diff --git a/gcc/testsuite/algol68/compile/include.a68 b/gcc/testsuite/algol68/compile/include.a68 new file mode 100644 index 0000000..6f4855b --- /dev/null +++ b/gcc/testsuite/algol68/compile/include.a68 @@ -0,0 +1,19 @@ +# { dg-options "-I$srcdir/algol68/compile/a68includes -fstropping=upper" } # +# { dg-additional-files "$srcdir/algol68/compile/a68includes/hello.a68 $srcdir/algol68/compile/a68includes/goodbye.a68" } # + +# PR UPPER PR # + +BEGIN STRING name := "Algol68!"; + # Both files are in `./a68includes'. + The first one will be included because we used `-I'. + The second one will be included because of the relative path. + # + PR include "hello.a68" PR + PR include "a68includes/goodbye.a68" PR + + STRING bye := goodbye(name); + STRING hi := hello(name); + + puts(hi + "\n"); + puts(bye + "\n") +END diff --git a/gcc/testsuite/algol68/compile/labeled-unit-1.a68 b/gcc/testsuite/algol68/compile/labeled-unit-1.a68 new file mode 100644 index 0000000..d3dbd8c --- /dev/null +++ b/gcc/testsuite/algol68/compile/labeled-unit-1.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # + +# This tests that the mode of the value yielded by a labeled unit is + the mode of the unit. # +BEGIN 10; +jorl: 20 +END diff --git a/gcc/testsuite/algol68/compile/mcgt-1.3b.a68 b/gcc/testsuite/algol68/compile/mcgt-1.3b.a68 new file mode 100644 index 0000000..80fc4a1 --- /dev/null +++ b/gcc/testsuite/algol68/compile/mcgt-1.3b.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # + +BEGIN REAL r := 10.0, circum, area; + circum := 2 * pi * r; area := pi * r * r +END diff --git a/gcc/testsuite/algol68/compile/mcgt-7.1.3a-bis.a68 b/gcc/testsuite/algol68/compile/mcgt-7.1.3a-bis.a68 new file mode 100644 index 0000000..132f0c5 --- /dev/null +++ b/gcc/testsuite/algol68/compile/mcgt-7.1.3a-bis.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # + +# Transient references and declarations. # +BEGIN FLEX[4,6]INT p; + # Illegal, cannot remember transient name. # + REF[]INT q2 = p[3,]; # { dg-error "" } # + SKIP +END diff --git a/gcc/testsuite/algol68/compile/mcgt-7.1.3a.a68 b/gcc/testsuite/algol68/compile/mcgt-7.1.3a.a68 new file mode 100644 index 0000000..be3f12a --- /dev/null +++ b/gcc/testsuite/algol68/compile/mcgt-7.1.3a.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # + +# Transient references and declarations. # +BEGIN FLEX[4,6]INT p; + # Illegal. p cannot be deflexed since it is a REF FLEX. # + REF[,]INT q3 = p; # { dg-error "" } # + SKIP +END diff --git a/gcc/testsuite/algol68/compile/module-1.a68 b/gcc/testsuite/algol68/compile/module-1.a68 new file mode 100644 index 0000000..e4f3215 --- /dev/null +++ b/gcc/testsuite/algol68/compile/module-1.a68 @@ -0,0 +1,69 @@ +module Argp = +def mode ArgOpt = struct (char name, string long_name, + bool arg_required, proc(string)bool handler); + + proc argp = (int p, [][]ArgOpt opts, + proc(int,string)bool no_opt_handler, + proc(string)void error_handler) void: + begin + proc getopt = (string prefix, string arg) ArgOpt: + begin ArgOpt res, bool found := false; + for i to UPB opts while NOT found + do for j to UPB opts[i] while NOT found + do if arg = long_name of opts[i][j] + OR (arg /= " " AND arg = name of opts[i][j]) + then res := opts[i][j]; found := true + fi + od + od; + (NOT found | error_handler ("unknown option " + prefix + arg)); + res + end; + + bool found_dash_dash := false, + skip_next_opt := false, + continue := true; + + for i from p to argc while continue + do string arg = argv (i); + if skip_next_opt + then skip_next_opt := false + elif arg = "--" AND NOT found_dash_dash + then found_dash_dash := true + elif found_dash_dash OR (UPB arg >= 1 andth arg[1] /= "-") + then continue := no_opt_handler (i + 1, arg) + elif UPB arg > 1 andth arg[2] = "-" + then { Long option. It may have an argument. } + int eqidx = char_in_string (arg, "="); + string optname = (eqidx > 0 | arg[3:eqidx - 1] | arg[3:]), + optarg = (eqidx > 0 AND UPB arg >= (eqidx + 1) | arg[eqidx + 1:]); + ArgOpt opt = getopt ("--", optname); + + if (arg_required of opt) AND optarg = "" + then error_handler ("option --" + arg + " requires an argument") fi; + continue := (handler of opt) (optarg) + else { This is one or more short options. } + for j to UPB arg[2:] + do ArgOpt opt = getopt ("-", arg[j + 1]); + if arg_required of opt + then if i = argc orel (ELEMS argv (i + 1) > 1 andth argv (i + 1)[1] = "-") + then error_handler ("option -" + arg[2+j] + " requires an argument") + fi; + (handler of opt) (argv (i + 1)); + skip_next_opt := true + else continue := (handler of opt) ("") + fi + od + fi + od + end; + + proc char_in_string = (string s, char c) int: + begin int res := 0, bool found := false; + for i to UPB s while NOT found + do (s[i] = c | res := i; found := true) od; + res + end; + + skip +fed diff --git a/gcc/testsuite/algol68/compile/module-2.a68 b/gcc/testsuite/algol68/compile/module-2.a68 new file mode 100644 index 0000000..74bd236 --- /dev/null +++ b/gcc/testsuite/algol68/compile/module-2.a68 @@ -0,0 +1,16 @@ +module Foo = def pub int idpublic = 10; + int idprivate = 20; + pub int varpublic := 100; + real varprivate := 3.14; + pub proc lala = (int a, b) int: a + b; + pub proc lele := (int a, b) int: a - b; + skip + fed, + Bar = def pub int idpublic = 30; + int idprivate = 40; + pub int varpublic := 100; + real varprivate := 3.14; + pub proc lala = (int a, b) int: a + b; + pub proc lele := (int a, b) int: a - b; + skip + fed diff --git a/gcc/testsuite/algol68/compile/module-extracts-1.a68 b/gcc/testsuite/algol68/compile/module-extracts-1.a68 new file mode 100644 index 0000000..c56a1d8 --- /dev/null +++ b/gcc/testsuite/algol68/compile/module-extracts-1.a68 @@ -0,0 +1,29 @@ +{ dg-options "-O0 -dA" } + +module Foo = +def pub mode JURL = union (void,int,real); + { dg-final { scan-assembler "mode extract FOO_JURL" } } + pub proc plus = (int a, b) int: a + b; + { dg-final { scan-assembler "identifier extract FOO_plus" } } + pub proc vplus := (int a, b) int: a + b; + { dg-final { scan-assembler "identifier extract FOO_vplus" } } + pub proc lvplus := (int a, b) int: a + b; + { dg-final { scan-assembler "identifier extract FOO_lvplus" } } + pub heap proc hvplus := (int a, b) int: a + b; + { dg-final { scan-assembler "identifier extract FOO_hvplus" } } + pub proc(int,int)int vplus2 = vplus; + { dg-final { scan-assembler "identifier extract FOO_vplus2" } } + pub proc(int,int)int lvplus2 := lvplus; + { dg-final { scan-assembler "identifier extract FOO_lvplus2" } } + pub heap proc(int,int)int hvplus2 := hvplus; + { dg-final { scan-assembler "identifier extract FOO_hvplus2" } } + pub int i; + { dg-final { scan-assembler "identifier extract FOO_i" } } + int k = 10; + { dg-final { scan-assembler-not "identifier extract FOO_k" } } + pub prio // = 8; + { dg-final { scan-assembler "operator extract FOO_s_s_\[0-9\]+" } } + pub op // = (int a, b) int: a % b; + { dg-final { scan-assembler "operator extract FOO_s_s_\[0-9\]+" } } + skip +fed diff --git a/gcc/testsuite/algol68/compile/module-mode-exports-1.a68 b/gcc/testsuite/algol68/compile/module-mode-exports-1.a68 new file mode 100644 index 0000000..8a4f50e --- /dev/null +++ b/gcc/testsuite/algol68/compile/module-mode-exports-1.a68 @@ -0,0 +1,21 @@ +{ dg-options "-dA" } + +{ Test for mode table in module definition exports. } + +module Foo = +def pub mode MyInt = int; + pub mode MyLongInt = long int; + pub mode MyLongLongInt = long long int; + pub mode MyShortInt = short int; + pub mode MyShortShortInt = short short int; + skip +fed + +{ GA68_MODE_INT = 2UB } + +{ dg-final { scan-assembler-times "2\[\t ]+\[^0-9\]+int" 5 } } +{ dg-final { scan-assembler-times "\[\t \]+0x2\[\t \]+\[^\n\]*sizety" 1 } } +{ dg-final { scan-assembler-times "\[\t \]+0x1\[\t \]+\[^\n\]*sizety" 1 } } +{ dg-final { scan-assembler-times "\[\t \]+0\[\t \]+\[^\n\]*sizety" 1 } } +{ dg-final { scan-assembler-times "\[\t \]+0xff\[\t \]+\[^\n\]*sizety" 1 } } +{ dg-final { scan-assembler-times "\[\t \]+0xfe\[\t \]+\[^\n\]*sizety" 1 } } diff --git a/gcc/testsuite/algol68/compile/module-mode-exports-2.a68 b/gcc/testsuite/algol68/compile/module-mode-exports-2.a68 new file mode 100644 index 0000000..fb67b3d --- /dev/null +++ b/gcc/testsuite/algol68/compile/module-mode-exports-2.a68 @@ -0,0 +1,17 @@ +{ dg-options "-dA" } + +{ Test for mode table in module definition exports. } + +module Foo = +def pub mode MyReal = real; + pub mode MyLongReal = long real; + pub mode MyLongLongReal = long long real; + skip +fed + +{ GA68_MODE_REAL = 3UB } + +{ dg-final { scan-assembler-times "\[\t \]+0x3\[\t \]+\[^\n\]*real" 3 } } +{ dg-final { scan-assembler-times "\[\t \]+0x2\[\t \]+\[^\n\]*sizety" 1 } } +{ dg-final { scan-assembler-times "\[\t \]+0x1\[\t \]+\[^\n\]*sizety" 1 } } +{ dg-final { scan-assembler-times "\[\t \]+0\[\t \]+\[^\n\]*sizety" 1 } } diff --git a/gcc/testsuite/algol68/compile/module-mode-exports-3.a68 b/gcc/testsuite/algol68/compile/module-mode-exports-3.a68 new file mode 100644 index 0000000..b030903 --- /dev/null +++ b/gcc/testsuite/algol68/compile/module-mode-exports-3.a68 @@ -0,0 +1,12 @@ +{ dg-options "-dA" } + +{ Test for mode table in module definition exports. } + +module Foo = +def pub mode MyString = string; + skip +fed + +{ GA68_MODE_STRING = 14UB } + +{ dg-final { scan-assembler-times "\[\t \]+0xe\[\t \]+\[^\n\]*string" 1 } } diff --git a/gcc/testsuite/algol68/compile/module-mode-exports-4.a68 b/gcc/testsuite/algol68/compile/module-mode-exports-4.a68 new file mode 100644 index 0000000..9846f19 --- /dev/null +++ b/gcc/testsuite/algol68/compile/module-mode-exports-4.a68 @@ -0,0 +1,12 @@ +{ dg-options "-dA" } + +{ Test for mode table in module definition exports. } + +module Foo = +def pub mode MyChar = char; + skip +fed + +{ GA68_MODE_CHAR = 6UB } + +{ dg-final { scan-assembler-times "\[\t \]+0x6\[\t \]+\[^\n\]*char" 1 } } diff --git a/gcc/testsuite/algol68/compile/module-mode-exports-5.a68 b/gcc/testsuite/algol68/compile/module-mode-exports-5.a68 new file mode 100644 index 0000000..be4deef --- /dev/null +++ b/gcc/testsuite/algol68/compile/module-mode-exports-5.a68 @@ -0,0 +1,21 @@ +{ dg-options "-dA" } + +{ Test for mode table in module definition exports. } + +module Foo = +def pub mode MyBits = bits; + pub mode MyLongBits = long bits; + pub mode MyLongLongBits = long long bits; + pub mode MyShortBits = short bits; + pub mode MyShortShortBits = short short bits; + skip +fed + +{ GA68_MODE_BITS = 4UB } + +{ dg-final { scan-assembler-times "4\[\t ]+\[^0-9\]+bits" 5 } } +{ dg-final { scan-assembler-times "\[\t \]+0x2\[\t \]+\[^\n\]*sizety" 1 } } +{ dg-final { scan-assembler-times "\[\t \]+0x1\[\t \]+\[^\n\]*sizety" 1 } } +{ dg-final { scan-assembler-times "\[\t \]+0\[\t \]+\[^\n\]*sizety" 1 } } +{ dg-final { scan-assembler-times "\[\t \]+0xff\[\t \]+\[^\n\]*sizety" 1 } } +{ dg-final { scan-assembler-times "\[\t \]+0xfe\[\t \]+\[^\n\]*sizety" 1 } } diff --git a/gcc/testsuite/algol68/compile/module-mode-exports-6.a68 b/gcc/testsuite/algol68/compile/module-mode-exports-6.a68 new file mode 100644 index 0000000..18a7d4f --- /dev/null +++ b/gcc/testsuite/algol68/compile/module-mode-exports-6.a68 @@ -0,0 +1,15 @@ +{ dg-options "-dA" } + +{ Test for mode table in module definition exports. } + +module Foo = +def pub mode MyBool = bool; + pub mode MyVoid = void; + skip +fed + +{ GA68_MODE_BOOL = 7UB + GA68_MODE_VOID = 1UB } + +{ dg-final { scan-assembler-times "7\[\t ]+\[^0-9\]+bool" 1 } } +{ dg-final { scan-assembler-times "1\[\t ]+\[^0-9\]+void" 1 } } diff --git a/gcc/testsuite/algol68/compile/module-mode-exports-7.a68 b/gcc/testsuite/algol68/compile/module-mode-exports-7.a68 new file mode 100644 index 0000000..b76085b --- /dev/null +++ b/gcc/testsuite/algol68/compile/module-mode-exports-7.a68 @@ -0,0 +1,13 @@ +{ dg-options "-dA" } + +{ Test for mode table in module definition exports. } + +module Foo = +def pub mode MyName = ref int; + skip +fed + +{ GA68_MODE_NAME = 12UB } + +{ dg-final { scan-assembler-times "0xc\[\t ]+\[^0-9\]+ref" 1 } } +{ dg-final { scan-assembler-times "0x2\[\t ]+\[^0-9\]+int" 1 } } diff --git a/gcc/testsuite/algol68/compile/module-mode-exports-8.a68 b/gcc/testsuite/algol68/compile/module-mode-exports-8.a68 new file mode 100644 index 0000000..c38502a --- /dev/null +++ b/gcc/testsuite/algol68/compile/module-mode-exports-8.a68 @@ -0,0 +1,17 @@ +{ dg-options "-dA" } + +{ Test for mode table in module definition exports. } + +module Foo = +def pub mode MyCompl = compl; + pub mode MyLongCompl = long compl; + pub mode MyLongLongCompl = long long compl; + skip +fed + +{ GA68_MODE_CMPL = 8UB } + +{ dg-final { scan-assembler-times "0x8\[\t ]+\[^0-9\]+compl" 3 } } +{ dg-final { scan-assembler-times "\[\t \]+0x2\[\t \]+\[^\n\]*sizety" 1 } } +{ dg-final { scan-assembler-times "\[\t \]+0x1\[\t \]+\[^\n\]*sizety" 1 } } +{ dg-final { scan-assembler-times "\[\t \]+0\[\t \]+\[^\n\]*sizety" 1 } } diff --git a/gcc/testsuite/algol68/compile/module-mode-exports-9.a68 b/gcc/testsuite/algol68/compile/module-mode-exports-9.a68 new file mode 100644 index 0000000..482aab6 --- /dev/null +++ b/gcc/testsuite/algol68/compile/module-mode-exports-9.a68 @@ -0,0 +1,12 @@ +{ dg-options "-dA" } + +{ Test for mode table in module definition exports. } + +module Foo = +def pub mode MyProc = proc void; + skip +fed + +{ GA68_MODE_CMPL = 8UB } + +{ dg-final { scan-assembler-times "0xd\[\t ]+\[^0-9\]+proc" 1 } } diff --git a/gcc/testsuite/algol68/compile/module-pub-1.a68 b/gcc/testsuite/algol68/compile/module-pub-1.a68 new file mode 100644 index 0000000..a0cf6e9 --- /dev/null +++ b/gcc/testsuite/algol68/compile/module-pub-1.a68 @@ -0,0 +1,16 @@ +module Foo = +def pub mode JORL = int, JURL = union (void,int,real); + pub proc plus = (int a, b) int: a + b; + pub proc vplus := (int a, b) int: a + b; + pub proc lvplus := (int a, b) int: a + b; + pub heap proc hvplus := (int a, b) int: a + b; + pub proc(int,int)int vplus2 = vplus; + pub proc(int,int)int lvplus2 := lvplus; + pub heap proc(int,int)int hvplus2 := hvplus; + pub int i, x, y; + pub int k = 10; + pub int j := 20; + pub prio // = 8; + pub op // = (int a, b) int: a % b; + skip +fed diff --git a/gcc/testsuite/algol68/compile/module-pub-mangling-1.a68 b/gcc/testsuite/algol68/compile/module-pub-mangling-1.a68 new file mode 100644 index 0000000..3451f46 --- /dev/null +++ b/gcc/testsuite/algol68/compile/module-pub-mangling-1.a68 @@ -0,0 +1,15 @@ +{ dg-options "-O0" } + +module Foo = def pub int foo; { dg-final { scan-assembler "FOO_foo" } } + int bar; { dg-final { scan-assembler "FOO_bar" } } + skip + fed, + Bar = def pub int foo; { dg-final { scan-assembler "BAR_foo" } } + int bar; { dg-final { scan-assembler "BAR_bar" } } + skip + fed + +{ dg-final { scan-assembler "FOO__prelude" } } +{ dg-final { scan-assembler "FOO__postlude" } } +{ dg-final { scan-assembler "BAR__prelude" } } +{ dg-final { scan-assembler "BAR__postlude" } } diff --git a/gcc/testsuite/algol68/compile/module-pub-mangling-10.a68 b/gcc/testsuite/algol68/compile/module-pub-mangling-10.a68 new file mode 100644 index 0000000..e427181 --- /dev/null +++ b/gcc/testsuite/algol68/compile/module-pub-mangling-10.a68 @@ -0,0 +1,10 @@ +{ dg-options "-O0" } + +{ Mangling of monads, nomads and : + Unfortunately we cannot do all of them in a single test. } + +module Foo = +def prio + = 9; + op + = (int a, b) int: skip; { dg-final { scan-assembler "FOO_u_\[0-9\]+" } } + skip +fed diff --git a/gcc/testsuite/algol68/compile/module-pub-mangling-11.a68 b/gcc/testsuite/algol68/compile/module-pub-mangling-11.a68 new file mode 100644 index 0000000..3ba8b68 --- /dev/null +++ b/gcc/testsuite/algol68/compile/module-pub-mangling-11.a68 @@ -0,0 +1,10 @@ +{ dg-options "-O0" } + +{ Mangling of monads, nomads and : + Unfortunately we cannot do all of them in a single test. } + +module Foo = +def prio - = 9; + op - = (int a, b) int: skip; { dg-final { scan-assembler "FOO_m_\[0-9\]+" } } + skip +fed diff --git a/gcc/testsuite/algol68/compile/module-pub-mangling-12.a68 b/gcc/testsuite/algol68/compile/module-pub-mangling-12.a68 new file mode 100644 index 0000000..9efc781 --- /dev/null +++ b/gcc/testsuite/algol68/compile/module-pub-mangling-12.a68 @@ -0,0 +1,10 @@ +{ dg-options "-O0" } + +{ Mangling of monads, nomads and : + Unfortunately we cannot do all of them in a single test. } + +module Foo = +def prio % = 9; + op % = (int a, b) int: skip; { dg-final { scan-assembler "FOO_p_\[0-9\]+" } } + skip +fed diff --git a/gcc/testsuite/algol68/compile/module-pub-mangling-13.a68 b/gcc/testsuite/algol68/compile/module-pub-mangling-13.a68 new file mode 100644 index 0000000..4834747 --- /dev/null +++ b/gcc/testsuite/algol68/compile/module-pub-mangling-13.a68 @@ -0,0 +1,10 @@ +{ dg-options "-O0" } + +{ Mangling of monads, nomads and : + Unfortunately we cannot do all of them in a single test. } + +module Foo = +def prio ^ = 9; + op ^ = (int a, b) int: skip; { dg-final { scan-assembler "FOO_c_\[0-9\]+" } } + skip +fed diff --git a/gcc/testsuite/algol68/compile/module-pub-mangling-14.a68 b/gcc/testsuite/algol68/compile/module-pub-mangling-14.a68 new file mode 100644 index 0000000..60ffc3d --- /dev/null +++ b/gcc/testsuite/algol68/compile/module-pub-mangling-14.a68 @@ -0,0 +1,10 @@ +{ dg-options "-O0" } + +{ Mangling of monads, nomads and : + Unfortunately we cannot do all of them in a single test. } + +module Foo = +def prio & = 9; + op & = (int a, b) int: skip; { dg-final { scan-assembler "FOO_a_\[0-9\]+" } } + skip +fed diff --git a/gcc/testsuite/algol68/compile/module-pub-mangling-15.a68 b/gcc/testsuite/algol68/compile/module-pub-mangling-15.a68 new file mode 100644 index 0000000..9f70993 --- /dev/null +++ b/gcc/testsuite/algol68/compile/module-pub-mangling-15.a68 @@ -0,0 +1,10 @@ +{ dg-options "-O0" } + +{ Mangling of monads, nomads and : + Unfortunately we cannot do all of them in a single test. } + +module Foo = +def prio ~ = 9; + op ~ = (int a, b) int: skip; { dg-final { scan-assembler "FOO_t_\[0-9\]+" } } + skip +fed diff --git a/gcc/testsuite/algol68/compile/module-pub-mangling-16.a68 b/gcc/testsuite/algol68/compile/module-pub-mangling-16.a68 new file mode 100644 index 0000000..a5a7d26 --- /dev/null +++ b/gcc/testsuite/algol68/compile/module-pub-mangling-16.a68 @@ -0,0 +1,10 @@ +{ dg-options "-O0" } + +{ Mangling of monads, nomads and : + Unfortunately we cannot do all of them in a single test. } + +module Foo = +def prio ! = 9; + op ! = (int a, b) int: skip; { dg-final { scan-assembler "FOO_b_\[0-9\]+" } } + skip +fed diff --git a/gcc/testsuite/algol68/compile/module-pub-mangling-17.a68 b/gcc/testsuite/algol68/compile/module-pub-mangling-17.a68 new file mode 100644 index 0000000..1f5b52a --- /dev/null +++ b/gcc/testsuite/algol68/compile/module-pub-mangling-17.a68 @@ -0,0 +1,10 @@ +{ dg-options "-O0" } + +{ Mangling of monads, nomads and : + Unfortunately we cannot do all of them in a single test. } + +module Foo = +def prio ? = 9; + op ? = (int a, b) int: skip; { dg-final { scan-assembler "FOO_q_\[0-9\]+" } } + skip +fed diff --git a/gcc/testsuite/algol68/compile/module-pub-mangling-18.a68 b/gcc/testsuite/algol68/compile/module-pub-mangling-18.a68 new file mode 100644 index 0000000..a840b14 --- /dev/null +++ b/gcc/testsuite/algol68/compile/module-pub-mangling-18.a68 @@ -0,0 +1,10 @@ +{ dg-options "-O0" } + +{ Mangling of monads, nomads and : + Unfortunately we cannot do all of them in a single test. } + +module Foo = +def prio > = 9; + op > = (int a, b) int: skip; { dg-final { scan-assembler "FOO_g_\[0-9\]+" } } + skip +fed diff --git a/gcc/testsuite/algol68/compile/module-pub-mangling-19.a68 b/gcc/testsuite/algol68/compile/module-pub-mangling-19.a68 new file mode 100644 index 0000000..ffcd1cf --- /dev/null +++ b/gcc/testsuite/algol68/compile/module-pub-mangling-19.a68 @@ -0,0 +1,10 @@ +{ dg-options "-O0" } + +{ Mangling of monads, nomads and : + Unfortunately we cannot do all of them in a single test. } + +module Foo = +def prio < = 9; + op < = (int a, b) int: skip; { dg-final { scan-assembler "FOO_l_\[0-9\]+" } } + skip +fed diff --git a/gcc/testsuite/algol68/compile/module-pub-mangling-2.a68 b/gcc/testsuite/algol68/compile/module-pub-mangling-2.a68 new file mode 100644 index 0000000..79fe3d8 --- /dev/null +++ b/gcc/testsuite/algol68/compile/module-pub-mangling-2.a68 @@ -0,0 +1,15 @@ +{ dg-options "-O0" } + +module Foo = def pub struct (int i, real r) foo;{ dg-final { scan-assembler "FOO_foo" } } + struct (int i, real r) bar; { dg-final { scan-assembler "FOO_bar" } } + skip + fed, + Bar = def pub struct (int i, real r) foo;{ dg-final { scan-assembler "BAR_foo" } } + struct (int i, real r) bar; { dg-final { scan-assembler "BAR_bar" } } + skip + fed + +{ dg-final { scan-assembler "FOO__prelude" } } +{ dg-final { scan-assembler "FOO__postlude" } } +{ dg-final { scan-assembler "BAR__prelude" } } +{ dg-final { scan-assembler "BAR__postlude" } } diff --git a/gcc/testsuite/algol68/compile/module-pub-mangling-20.a68 b/gcc/testsuite/algol68/compile/module-pub-mangling-20.a68 new file mode 100644 index 0000000..fd435c7 --- /dev/null +++ b/gcc/testsuite/algol68/compile/module-pub-mangling-20.a68 @@ -0,0 +1,10 @@ +{ dg-options "-O0" } + +{ Mangling of monads, nomads and : + Unfortunately we cannot do all of them in a single test. } + +module Foo = +def prio / = 9; + op / = (int a, b) int: skip; { dg-final { scan-assembler "FOO_s_\[0-9\]+" } } + skip +fed diff --git a/gcc/testsuite/algol68/compile/module-pub-mangling-21.a68 b/gcc/testsuite/algol68/compile/module-pub-mangling-21.a68 new file mode 100644 index 0000000..05b2b0a --- /dev/null +++ b/gcc/testsuite/algol68/compile/module-pub-mangling-21.a68 @@ -0,0 +1,10 @@ +{ dg-options "-O0" } + +{ Mangling of monads, nomads and : + Unfortunately we cannot do all of them in a single test. } + +module Foo = +def prio = = 9; + op = = (int a, b) int: skip; { dg-final { scan-assembler "FOO_e_\[0-9\]+" } } + skip +fed diff --git a/gcc/testsuite/algol68/compile/module-pub-mangling-22.a68 b/gcc/testsuite/algol68/compile/module-pub-mangling-22.a68 new file mode 100644 index 0000000..d11e9a8 --- /dev/null +++ b/gcc/testsuite/algol68/compile/module-pub-mangling-22.a68 @@ -0,0 +1,10 @@ +{ dg-options "-O0" } + +{ Mangling of monads, nomads and : + Unfortunately we cannot do all of them in a single test. } + +module Foo = +def prio +:= = 9; + op +:= = (int a, b) int: skip; { dg-final { scan-assembler "FOO_u_o_e_\[0-9\]+" } } + skip +fed diff --git a/gcc/testsuite/algol68/compile/module-pub-mangling-3.a68 b/gcc/testsuite/algol68/compile/module-pub-mangling-3.a68 new file mode 100644 index 0000000..579cb84 --- /dev/null +++ b/gcc/testsuite/algol68/compile/module-pub-mangling-3.a68 @@ -0,0 +1,15 @@ +{ dg-options "-O0" } + +module Foo = def pub int foo = 10; { dg-final { scan-assembler "FOO_foo" } } + int bar = 20; { dg-final { scan-assembler "FOO_bar" } } + skip + fed, + Bar = def pub int foo = 30; { dg-final { scan-assembler "BAR_foo" } } + int bar = 40; { dg-final { scan-assembler "BAR_bar" } } + skip + fed + +{ dg-final { scan-assembler "FOO__prelude" } } +{ dg-final { scan-assembler "FOO__postlude" } } +{ dg-final { scan-assembler "BAR__prelude" } } +{ dg-final { scan-assembler "BAR__postlude" } } diff --git a/gcc/testsuite/algol68/compile/module-pub-mangling-4.a68 b/gcc/testsuite/algol68/compile/module-pub-mangling-4.a68 new file mode 100644 index 0000000..4bb5394 --- /dev/null +++ b/gcc/testsuite/algol68/compile/module-pub-mangling-4.a68 @@ -0,0 +1,17 @@ +{ dg-options "-O0" } + +{ Procedure variable declarations. } + +module Foo = def pub proc int foo; { dg-final { scan-assembler "FOO_foo" } } + proc int bar := int: skip; { dg-final { scan-assembler "FOO_bar" } } + skip + fed, + Bar = def pub proc int foo; { dg-final { scan-assembler "BAR_foo" } } + proc int bar := foo; { dg-final { scan-assembler "BAR_bar" } } + skip + fed + +{ dg-final { scan-assembler "FOO__prelude" } } +{ dg-final { scan-assembler "FOO__postlude" } } +{ dg-final { scan-assembler "BAR__prelude" } } +{ dg-final { scan-assembler "BAR__postlude" } } diff --git a/gcc/testsuite/algol68/compile/module-pub-mangling-5.a68 b/gcc/testsuite/algol68/compile/module-pub-mangling-5.a68 new file mode 100644 index 0000000..be29ee1 --- /dev/null +++ b/gcc/testsuite/algol68/compile/module-pub-mangling-5.a68 @@ -0,0 +1,17 @@ +{ dg-options "-O0" } + +{ Procedure identity declarations. } + +module Foo = def pub proc foo = int: skip; { dg-final { scan-assembler "FOO_foo" } } + proc bar = int: skip; { dg-final { scan-assembler "FOO_bar" } } + skip + fed, + Bar = def pub proc foo = int: skip; { dg-final { scan-assembler "BAR_foo" } } + proc bar = int: skip; { dg-final { scan-assembler "BAR_bar" } } + skip + fed + +{ dg-final { scan-assembler "FOO__prelude" } } +{ dg-final { scan-assembler "FOO__postlude" } } +{ dg-final { scan-assembler "BAR__prelude" } } +{ dg-final { scan-assembler "BAR__postlude" } } diff --git a/gcc/testsuite/algol68/compile/module-pub-mangling-6.a68 b/gcc/testsuite/algol68/compile/module-pub-mangling-6.a68 new file mode 100644 index 0000000..8ba5333 --- /dev/null +++ b/gcc/testsuite/algol68/compile/module-pub-mangling-6.a68 @@ -0,0 +1,21 @@ +{ dg-options "-O0" } + +{ Operator brief identity declarations. } + +module Foo = def pub op + = (int a, b) int: a + b; + { dg-final { scan-assembler "FOO_u_" } } + op - = (int a, b) int: a - b; + { dg-final { scan-assembler "FOO_m_" } } + skip + fed, + Bar = def pub op + = (int a, b) int: a + b; + { dg-final { scan-assembler "BAR_u_" } } + op - = (int a, b) int: a - b; + { dg-final { scan-assembler "BAR_m_" } } + skip + fed + +{ dg-final { scan-assembler "FOO__prelude" } } +{ dg-final { scan-assembler "FOO__postlude" } } +{ dg-final { scan-assembler "BAR__prelude" } } +{ dg-final { scan-assembler "BAR__postlude" } } diff --git a/gcc/testsuite/algol68/compile/module-pub-mangling-7.a68 b/gcc/testsuite/algol68/compile/module-pub-mangling-7.a68 new file mode 100644 index 0000000..5c62a79 --- /dev/null +++ b/gcc/testsuite/algol68/compile/module-pub-mangling-7.a68 @@ -0,0 +1,19 @@ +{ dg-options "-O0" } + +{ Operator identity declarations. } + +module Foo = +def prio // = 8; + pub op(int,int)int // = lala; + { dg-final { scan-assembler "FOO_s_s_" } } + proc lala = (int a, b) int: a + b; + prio JORL = 8, JURL = 9; + pub op(int,int)int JORL = lala; + { dg-final { scan-assembler "FOO_JORL" } } + op(int,int)int JURL = (int a, b) int: a - b; + { dg-final { scan-assembler "FOO_JORL" } } + skip +fed + +{ dg-final { scan-assembler "FOO__prelude" } } +{ dg-final { scan-assembler "FOO__postlude" } } diff --git a/gcc/testsuite/algol68/compile/module-pub-mangling-8.a68 b/gcc/testsuite/algol68/compile/module-pub-mangling-8.a68 new file mode 100644 index 0000000..054befb --- /dev/null +++ b/gcc/testsuite/algol68/compile/module-pub-mangling-8.a68 @@ -0,0 +1,18 @@ +{ dg-options "-O0" } + +{ Symbols that should _not_ include the module name. } + +module Foo = +def begin string foo = "foo'n"; { dg-final { scan-assembler-not "FOO_foo" } } + proc printfoo = void: puts (foo); { dg-final { scan-assembler-not "FOO_printfoo" } } + printfoo + end; + skip +postlude + int lala; + proc incrlala = void: lala +:= 1; { dg-final { scan-assembler-not "FOO_incrlala" } } + incrlala +fed + +{ dg-final { scan-assembler "FOO__prelude" } } +{ dg-final { scan-assembler "FOO__postlude" } } diff --git a/gcc/testsuite/algol68/compile/module-pub-mangling-9.a68 b/gcc/testsuite/algol68/compile/module-pub-mangling-9.a68 new file mode 100644 index 0000000..6a6bab1 --- /dev/null +++ b/gcc/testsuite/algol68/compile/module-pub-mangling-9.a68 @@ -0,0 +1,14 @@ +{ dg-options "-O0" } + +{ Operator symbols are numbered so having overloaded symbols in the + module's public range works. } + +module Foo = +def prio // =9; + op // = (int a, b) int: a + b; { dg-final { scan-assembler "FOO_s_s_\[0-9\]+" } } + op // = (real a, b) real: a + b; { dg-final { scan-assembler "FOO_s_s_\[0-9\]+" } } + skip +fed + +{ dg-final { scan-assembler "FOO__prelude" } } +{ dg-final { scan-assembler "FOO__postlude" } } diff --git a/gcc/testsuite/algol68/compile/module-top-down-1.a68 b/gcc/testsuite/algol68/compile/module-top-down-1.a68 new file mode 100644 index 0000000..3f130c2 --- /dev/null +++ b/gcc/testsuite/algol68/compile/module-top-down-1.a68 @@ -0,0 +1,14 @@ +{ This test is to check that serial clauses and + enquiry clauses are properly skipped in module texts. } +module Foo = +def int i; + int j = 20; + string ss; + prio // = 8; + op // = (int a, b) int: a + b; + proc ticks = void: to i do puts ("tick'n") od; + i := 5 +postlude + if j > 5 then ticks fi; + (j < 0 | puts ("error'n") | puts ("success'n")) +fed diff --git a/gcc/testsuite/algol68/compile/modules/compile.exp b/gcc/testsuite/algol68/compile/modules/compile.exp new file mode 100644 index 0000000..af254e8 --- /dev/null +++ b/gcc/testsuite/algol68/compile/modules/compile.exp @@ -0,0 +1,40 @@ +# Copyright (C) 2024 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# <http://www.gnu.org/licenses/>. + +# Compile tests, no torture testing. +# +# These tests raise errors in the front end; torture testing doesn't apply. + +load_lib algol68-dg.exp + +# Initialize `dg'. +dg-init + +# The programs need to be able to find the built modules, which are +# left in objdir. + +global MODULES_OPTIONS +set MODULES_OPTIONS "-I $objdir" + +# Main loop. +set saved-dg-do-what-default ${dg-do-what-default} + +set dg-do-what-default "compile" +algol68-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/program*.a68]] "" "" +set dg-do-what-default ${saved-dg-do-what-default} + +# All done. +dg-finish diff --git a/gcc/testsuite/algol68/compile/modules/module1.a68 b/gcc/testsuite/algol68/compile/modules/module1.a68 new file mode 100644 index 0000000..f49a747 --- /dev/null +++ b/gcc/testsuite/algol68/compile/modules/module1.a68 @@ -0,0 +1,9 @@ +module Module1 = +def + pub mode MyInt = int; + pub int beast_number := 666; + pub string who = "jemarch"; + puts ("Hello from module'n") +postlude + puts ("Bye from module'n") +fed diff --git a/gcc/testsuite/algol68/compile/modules/module2.a68 b/gcc/testsuite/algol68/compile/modules/module2.a68 new file mode 100644 index 0000000..57c68e5 --- /dev/null +++ b/gcc/testsuite/algol68/compile/modules/module2.a68 @@ -0,0 +1,5 @@ +module Module2 = +def prio // = 9; { Note priority is not publicized. } + pub op // = (int a, b) int: a + b; + skip +fed diff --git a/gcc/testsuite/algol68/compile/modules/module3.a68 b/gcc/testsuite/algol68/compile/modules/module3.a68 new file mode 100644 index 0000000..143a469 --- /dev/null +++ b/gcc/testsuite/algol68/compile/modules/module3.a68 @@ -0,0 +1,6 @@ +module Module_3 = +def pub proc foo = (int i, string s) void: skip; + pub mode Jorl = struct (int i, string s); + pub mode Jurl = union (int, string, real); + skip +fed diff --git a/gcc/testsuite/algol68/compile/modules/module4.a68 b/gcc/testsuite/algol68/compile/modules/module4.a68 new file mode 100644 index 0000000..f0ae6e6 --- /dev/null +++ b/gcc/testsuite/algol68/compile/modules/module4.a68 @@ -0,0 +1,4 @@ +module Module_4 = +def access Module_3 (foo (10, "foo")); + skip +fed diff --git a/gcc/testsuite/algol68/compile/modules/module5.a68 b/gcc/testsuite/algol68/compile/modules/module5.a68 new file mode 100644 index 0000000..ebb06fb --- /dev/null +++ b/gcc/testsuite/algol68/compile/modules/module5.a68 @@ -0,0 +1,6 @@ +module Module_5 = +def + pub mode JSON_Val = union (ref JSON_Elm,int), + JSON_Elm = struct (int lala); + skip +fed diff --git a/gcc/testsuite/algol68/compile/modules/module6.a68 b/gcc/testsuite/algol68/compile/modules/module6.a68 new file mode 100644 index 0000000..b0fefb5 --- /dev/null +++ b/gcc/testsuite/algol68/compile/modules/module6.a68 @@ -0,0 +1,5 @@ +module Module6 = + access Module5 +def pub proc getval = JSON_VAl: skip; + skip +fed diff --git a/gcc/testsuite/algol68/compile/modules/module7.a68 b/gcc/testsuite/algol68/compile/modules/module7.a68 new file mode 100644 index 0000000..f585171 --- /dev/null +++ b/gcc/testsuite/algol68/compile/modules/module7.a68 @@ -0,0 +1,5 @@ +module Module7 = +access Module5, Module6 +def pub JSON_Val val = getval; + skip +fed diff --git a/gcc/testsuite/algol68/compile/modules/module8.a68 b/gcc/testsuite/algol68/compile/modules/module8.a68 new file mode 100644 index 0000000..8704474 --- /dev/null +++ b/gcc/testsuite/algol68/compile/modules/module8.a68 @@ -0,0 +1,5 @@ +module Module_8 = +def + pub proc lala = ([]struct (string n, v) arg) void: skip; + skip +fed diff --git a/gcc/testsuite/algol68/compile/modules/module9.a68 b/gcc/testsuite/algol68/compile/modules/module9.a68 new file mode 100644 index 0000000..55afd6f --- /dev/null +++ b/gcc/testsuite/algol68/compile/modules/module9.a68 @@ -0,0 +1,6 @@ +module Module_9 = +def + pub mode Foo = struct (flex[1:0]Event events); + pub mode Event = int; + skip +fed diff --git a/gcc/testsuite/algol68/compile/modules/program-7.a68 b/gcc/testsuite/algol68/compile/modules/program-7.a68 new file mode 100644 index 0000000..a3cb1bf --- /dev/null +++ b/gcc/testsuite/algol68/compile/modules/program-7.a68 @@ -0,0 +1,3 @@ +{ dg-modules "module5 module6 module7" } + +access Module7 (skip) diff --git a/gcc/testsuite/algol68/compile/modules/program-8.a68 b/gcc/testsuite/algol68/compile/modules/program-8.a68 new file mode 100644 index 0000000..ba76755 --- /dev/null +++ b/gcc/testsuite/algol68/compile/modules/program-8.a68 @@ -0,0 +1,3 @@ +{ dg-modules "module8" } + +access Module_8 ( lala ((("foo", "bar"), ("baz", "quux"))) ) diff --git a/gcc/testsuite/algol68/compile/modules/program-9.a68 b/gcc/testsuite/algol68/compile/modules/program-9.a68 new file mode 100644 index 0000000..585607a --- /dev/null +++ b/gcc/testsuite/algol68/compile/modules/program-9.a68 @@ -0,0 +1,3 @@ +{ dg-modules "module9" } + +access Module_9 (skip) diff --git a/gcc/testsuite/algol68/compile/modules/program-error-no-prio-1.a68 b/gcc/testsuite/algol68/compile/modules/program-error-no-prio-1.a68 new file mode 100644 index 0000000..dcca8a9 --- /dev/null +++ b/gcc/testsuite/algol68/compile/modules/program-error-no-prio-1.a68 @@ -0,0 +1,6 @@ +{ dg-modules "module2" } + +access Module_2 +begin assert (2 // 3 = 5); { dg-error "no priority" } + skip +end diff --git a/gcc/testsuite/algol68/compile/modules/program-error-outside-access-1.a68 b/gcc/testsuite/algol68/compile/modules/program-error-outside-access-1.a68 new file mode 100644 index 0000000..39f0f18 --- /dev/null +++ b/gcc/testsuite/algol68/compile/modules/program-error-outside-access-1.a68 @@ -0,0 +1,6 @@ +{ dg-modules "module1" } + +begin int x = access Module1 ( beast_number ), + y = beast_number; { dg-error "declared" } + skip +end diff --git a/gcc/testsuite/algol68/compile/modules/program-module-accesses-module-1.a68 b/gcc/testsuite/algol68/compile/modules/program-module-accesses-module-1.a68 new file mode 100644 index 0000000..7ba7804 --- /dev/null +++ b/gcc/testsuite/algol68/compile/modules/program-module-accesses-module-1.a68 @@ -0,0 +1,5 @@ +{ dg-modules "module3 module4" } +{ This test accesses a Module4 that itself accesses a Module3. } + +access Module_4 (skip) + diff --git a/gcc/testsuite/algol68/compile/modules/program-proc-arg-order-1.a68 b/gcc/testsuite/algol68/compile/modules/program-proc-arg-order-1.a68 new file mode 100644 index 0000000..eecf686 --- /dev/null +++ b/gcc/testsuite/algol68/compile/modules/program-proc-arg-order-1.a68 @@ -0,0 +1,8 @@ +{ dg-modules "module3" } + +access Module_3 +begin foo (10, "foo"); + Jorl x = (10, "foo"); + Jurl y = 3.14; + skip +end diff --git a/gcc/testsuite/algol68/compile/nested-comment-1.a68 b/gcc/testsuite/algol68/compile/nested-comment-1.a68 new file mode 100644 index 0000000..f575243 --- /dev/null +++ b/gcc/testsuite/algol68/compile/nested-comment-1.a68 @@ -0,0 +1,4 @@ +{ Comment delimiters within strings get ignored. } +begin { puts { ("{""'n"); } } + skip +end diff --git a/gcc/testsuite/algol68/compile/nested-comment-2.a68 b/gcc/testsuite/algol68/compile/nested-comment-2.a68 new file mode 100644 index 0000000..9fc912f --- /dev/null +++ b/gcc/testsuite/algol68/compile/nested-comment-2.a68 @@ -0,0 +1,6 @@ +{ The string in nested comment is in one logical line. } +begin + { puts ("{'n\ +"); { this prints foo }} + skip +end diff --git a/gcc/testsuite/algol68/compile/operators-firmly-related.a68 b/gcc/testsuite/algol68/compile/operators-firmly-related.a68 new file mode 100644 index 0000000..a7efe75 --- /dev/null +++ b/gcc/testsuite/algol68/compile/operators-firmly-related.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # + +BEGIN PRIO MIN = 6; + OP MIN = (REF REAL a, b) REF REAL: (a < b | a | b), # { dg-error "firmly related" } # + MIN = (REAL a, b) REAL: (a < b | a | b); # { dg-error "firmly related" } # + SKIP +END diff --git a/gcc/testsuite/algol68/compile/recursive-modes-1.a68 b/gcc/testsuite/algol68/compile/recursive-modes-1.a68 new file mode 100644 index 0000000..4a77a56 --- /dev/null +++ b/gcc/testsuite/algol68/compile/recursive-modes-1.a68 @@ -0,0 +1,33 @@ +# { dg-options "-fstropping=upper" } # + +# This program triggered a bug related to incomplete modes. # +BEGIN MODE REC_MSET = STRUCT (REF REC_MSET_ELM head, tail, + INT num elems, + PROC(REC_MSET_DATA)BOOL gate), + REC_MSET_ELM = STRUCT (REC_MSET_DATA data, BOOL mark, REF REC_MSET_ELM next), + REC_MSET_DATA = UNION (REC_RSET,REC_RECORD,REC_FIELD,REC_CMNT), + REC_RSET = STRUCT (REC_MSET mset, + INT min size, max size, + REF REC_RECORD descriptor), + REC_RECORD = STRUCT (REC_LOC loc, REC_MSET mset, INT foo), + REC_CMNT = STRUCT (REC_LOC loc, STRING content), + REC_FIELD = STRUCT (REC_LOC loc, STRING name, value), + REC_LOC = STRUCT (STRING source, INT line, char); + + PROC rec loc unknown = REC_LOC: + ("unknown", 0, 0); + PROC rec record gate = (REC_MSET_DATA d) BOOL: + (d | (REC_FIELD): TRUE, (REC_CMNT): TRUE | FALSE); + REF REC_MSET_ELM rec no mset elm = NIL; + + PROC rec mset new = (PROC(REC_MSET_DATA)BOOL gate) REC_MSET: + (HEAP REC_MSET := (rec no mset elm, rec no mset elm, + 0, gate)); + + REF REC_RECORD rec no record = NIL; + + PROC rec record new = REF REC_RECORD: + HEAP REC_RECORD := (rec loc unknown, rec mset new (rec record gate), 0); + + SKIP +END diff --git a/gcc/testsuite/algol68/compile/recursive-modes-2.a68 b/gcc/testsuite/algol68/compile/recursive-modes-2.a68 new file mode 100644 index 0000000..f79b214 --- /dev/null +++ b/gcc/testsuite/algol68/compile/recursive-modes-2.a68 @@ -0,0 +1,7 @@ +begin mode Word = union (int, struct (ref Word w)), + Value = union (void,Word), + Stack = struct (ref Stack prev, Value val); + + struct (Word a) qs; { type_2 has no size! } + skip +end diff --git a/gcc/testsuite/algol68/compile/serial-clause-jump-1.a68 b/gcc/testsuite/algol68/compile/serial-clause-jump-1.a68 new file mode 100644 index 0000000..f4e3773 --- /dev/null +++ b/gcc/testsuite/algol68/compile/serial-clause-jump-1.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # + +# This is an infinite loop, but it should compile just fine an yield + an integer after infinite time. # + +BEGIN foo: foo +END diff --git a/gcc/testsuite/algol68/compile/snobol.a68 b/gcc/testsuite/algol68/compile/snobol.a68 new file mode 100644 index 0000000..9b6c4fc --- /dev/null +++ b/gcc/testsuite/algol68/compile/snobol.a68 @@ -0,0 +1,1100 @@ +# { dg-options "-fstropping=upper" } # + +# This is Frank Pagan's SNOBOL4 Interpreter in ALGOL 68 (1976), + fetched from Dick Grune's page https://dickgrune.com/CS/Algol68/ + + The interpreter described in "Algol 68 as an Implementation Language\ + for Portable Interpreters", ACM SIGPLAN Notices - Proceedings of the + Strathclyde ALGOL 68 conference, Volume 12 Issue 6, June 1977, + pp. 54 - 62, and "A Highly-Structured Interpreter for a SNOBOL4 + Subset", Software: Practice and Experience, Vol. 9, 4, + pp. 281-312, April 1979. + + Modifications by Jose E. Marchesi: + - Use the simple POSIX-like transput provided by GCC. + - Read programs from lines rather than from cards. + - Add command-line option -l (listing). +# + +BEGIN PROC itoa = (INT i) STRING: + BEGIN IF i = 0 + THEN "0" + ELSE INT n := ABS i; + STRING res; + WHILE n /= 0 + DO INT rem = n %* 10; + res := REPR (rem > 9 | (rem - 10) + ABS "a" | rem + ABS "0") + res; + n %:= 10 + OD; + (i < 0 | "-" + res | res) + FI + END; + + CHAR sharp = REPR 35; # Sharp character, + to avoid confusing Emacs. # + + # Input file. # + INT filein; + + # IMPLEMENTATION RESTRICTIONS # + INT spoolsize = 400, + stlim = 50, + arglim = 5, + rslim = 80, + pslim = 20, + ftlim = 10; + + # ABSTRACT MACHINE # + MODE ITEM = UNION (INT, REF STRINGITEM, PATTERN), + STRINGITEM = STRUCT (STRING val, REF ITEM ref), + PATTERN = REF[]COMPONENT, + COMPONENT = STRUCT (INT routine, subsequent, alternate, extra, + REF ITEM arg), + PSENTRY = STRUCT (INT cursor, alternate), + RSENTRY = REF ITEM, + FTENTRY = STRUCT (REF ITEM fnname, entry name, + REF[]REF ITEM params, locals); + + [1:spoolsize] REF ITEM spool; + [1:pslim] PSENTRY pattern stack; + [1:rslim] RSENTRY run stack; + [1:ftlim] FTENTRY function table; + + BOOL failed := FALSE; + INT nin, psp, rsp := 0, ftp := 0; + INT mstr = 1, mlen = 2, mbrk = 3, mspn = 4, many = 5, mnul = 6, + miv1 = 7, miv2 = 8, m1 = 9, mat = 10, mpos = 11, mtab = 12, + mrpos = 13, mrtab = 14, mnty = 15; + + # INTERNAL FORM OF PROGRAMS # + + MODE STMT = STRUCT (REF IDR label, + UNION (REF ASMT, REF MATCH, + REF REPL, REF EXPR) stmt core, + REF GOTOFIELD goto), + IDR = STRUCT (REF ITEM idr addr), + NUM = STRUCT (REF ITEM num addr), + LSTR = STRUCT (REF ITEM lstr addr), + ASMT = STRUCT (REF EXPR subject, object), + MATCH = STRUCT (REF EXPR subject, pattern), + REPL = STRUCT (REF EXPR subject, pattern, object), + EXPR = UNION (REF UNARYEXPR, REF BINARYEXPR, IDR, NUM, + LSTR, REF CALL), + GOTOFIELD = STRUCT (REF DEST upart, spart, fpart), + DEST = UNION (REF EXPR, CHAR), + UNARYEXPR = STRUCT (REF EXPR operand, CHAR operator), + BINARYEXPR = STRUCT (REF EXPR operand1, operand2, + CHAR operator), + CALL = STRUCT (IDR fnname, REF[]REF EXPR args); + + REF[]STMT t; + REF ITEM prog entry := NIL; + + PROC error = (STRING mess) VOID: + (puts ("error: " + mess + "'n"); stop); + + # TRANSLATION PHASE # + + BEGIN # DECLARATIONS FOR SCANNER # + STRING card, INT cp, # SOURCE LINE AND POINTER # + CHAR ch, # SOURCE CHARACTER # + [1:80]CHAR str, INT sp, # STRING BUFFER AND POINTER # + CHAR tok, # TOKEN CODE # + REF ITEM psn, # POSITION OF A CREATED VALUE # + INT nv, # NUMERIC VALUE OF CONSTANT # + INT stn, # SOURCE STATEMENT NUMBER # + BOOL listing, # FLAG FOR SOURCE LISTING # + CHAR c; # TEMPORARY # + + # TOKEN MNEMONICS # + CHAR doll = "$", bdoll = "D", + plus = "+", bplus = "P", + minus = "-", bminus = "M", + at = "@", bbar = "!", + bstar = "*", bslash = "/", + lpar = "(", rpar = ")", + comma = ",", colon = ":", + equal = "=", blank = " ", + eos = ";", name = "A", + lstring = "L", number = "U", + endt = "E", ret = "R", + fret = "F", stok = "Y", + ftok = "Z"; + + PROC get card = VOID: + BEGIN cp := 0; + WHILE card := fgets (filein, 80); + IF UPB card = 0 THEN exit FI; + c := card[1]; + IF c /= "." AND c /= "+" AND c /= "-" AND c /= "*" + THEN stn := stn + 1 FI; + IF listing THEN puts (itoa (stn) + " " + card + "'n") FI; + IF c = "-" + THEN IF card[2:5] = "LIST" + THEN listing := TRUE + ELIF card[2:7] = "UNLIST" + THEN listing := FALSE + FI + FI; + c = "-" OR c = "*" + DO SKIP OD; + exit: SKIP + END; + + PROC next ch = VOID: + IF cp = UPB card + THEN get card; + IF c = "." OR c = "+" + THEN ch := " "; cp := 1 + ELSE ch := sharp # END OF LINE AND STATEMENT # + FI + ELSE ch := card[cp +:= 1] + FI; + + PROC lookup = (STRING sv) REF ITEM : ( + INT i := 0, BOOL nf := TRUE; + WHILE IF (i +:= 1) <= nin + THEN nf := sv /= val OF (spool[i] | (REF STRINGITEM s) : s) + ELSE FALSE + FI + DO SKIP OD; + IF nf + THEN IF nin = spoolsize THEN error ("too many strings") FI; + spool[nin +:= 1] := HEAP ITEM := HEAP STRINGITEM := + (sv, NIL) + FI; + spool[i]); + + PROC scan = VOID: + IF ch = " " # BLANKS AND BINARY OPERATORS # + THEN WHILE next ch; ch = " " DO SKIP OD; + # IGNORE TRAILING BLANKS IN A STATEMENT # + IF ch = ";" THEN next ch; stn := stn + 1; tok := eos + ELIF ch = sharp THEN next ch; tok := eos + ELIF ch = "!" OR ch = "$" OR ch = "+" OR ch = "-" + OR ch = "*" OR ch = "/" + THEN IF card[cp+1] = " " + THEN c := ch; + WHILE next ch; ch = " " DO SKIP OD ; + tok := (c = "!" | bbar + |: c = "$" | bdoll + |: c = "-" | bminus + |: c = "+" | bplus + |: c = "*" | bstar + | bslash) + ELSE tok := blank + FI + ELSE tok := blank + FI + ELIF ch = "''" OR ch = """" # LITERAL STRINGS # + THEN c := ch; sp := 0; + WHILE next ch; + IF ch = sharp THEN error ("UNTERMINATED LITERAL") FI; + (str[sp +:= 1] := ch) /= c + DO SKIP OD ; + next ch; + tok := lstring; + IF sp = 1 + THEN psn := NIL + ELSE STRING s = str[1:sp-1] ; + psn := lookup (s) + FI + ELIF ch >= "0" AND ch <= "9" # NUMBERS # + THEN nv := 0 ; + WHILE nv := nv * 10 + ABS ch - ABS "0"; + next ch; + ch >= "0" AND ch <= "9" + DO SKIP OD ; + tok := number; + psn := HEAP ITEM := nv + ELIF ch >= "A" AND ch <= "Z" # NAMES # + THEN sp := 0; + WHILE str[sp +:= 1] := ch; + next ch; + ch = "." OR ch >= "A" AND ch <= "Z" + OR ch >= "0" AND ch <= "9" + DO SKIP OD ; + STRING s = str[1:sp]; + tok := (s = "S" | stok + |: s = "F" | ftok + |: s = "END" | endt + |: s = "RETURN" | ret + |: s = "FRETURN" | fret + | psn := lookup (s); name) + ELIF ch = ";" + THEN next ch; stn := stn + 1; tok := eos + ELIF ch = sharp + THEN next ch; tok := eos + ELSE # ( ) , : = @ $ + - # + tok := ch; next ch + FI; + + PROC init = VOID: + BEGIN stn := 0; + spool[nin := 1] := HEAP ITEM := HEAP STRINGITEM := + ("ARB", HEAP ITEM := HEAP[1:3]COMPONENT := + ((mnul, 2, 0, SKIP, NIL), + (mnul, 0, 3, SKIP, NIL), + (m1, 2, 0, SKIP, NIL))); + get card; + next ch; + scan + END; + + PROC verify = (CHAR token) VOID: + IF tok = token THEN scan + ELSE STRING s := "TOKEN "" "" DOES NOT OCCUR WHERE EXPECTED"; + s[8] := token; + error (s) + FI; + + PROC translate = VOID: + BEGIN HEAP[1:stlim]STMT ss, INT ssc := 0; + WHILE IF ssc = stlim THEN error ("TOO MANY STATEMENTS") FI; + tok /= endt + DO ss[ssc +:= 1] := trans stmt OD; + scan; + IF tok = blank + THEN scan; + IF tok = name THEN prog entry := psn FI + FI; + t := ss[1:ssc] + END; + + PROC trans stmt = STMT: + BEGIN + REF IDR lab := NIL; + REF EXPR subj, pat, obj := NIL; + REF GOTOFIELD go := NIL; + BOOL asgn; + + PROC move to obj = STMT: + BEGIN + IF tok = blank + THEN scan; + IF tok = colon + THEN go := trans gofield + ELSE obj := trans expr; + IF tok = colon + THEN go := trans gofield + ELSE verify (eos) + FI + FI + ELSE verify (eos) + FI ; + IF asgn + THEN STMT (lab, HEAP ASMT := (subj, obj), go) + ELSE STMT (lab, HEAP REPL := (subj, pat, obj), go) + FI + END; + + PROC move to subj = STMT: + BEGIN scan; + IF tok = colon + THEN STMT (lab, REF EXPR (NIL), trans gofield) + ELSE subj := trans elem; + IF tok = blank + THEN scan; + IF tok = colon + THEN STMT (lab, REF EXPR (subj), trans gofield) + ELIF tok = equal + THEN asgn := TRUE; scan; move to obj + ELSE pat := trans expr; + IF tok = colon + THEN STMT (lab, HEAP MATCH := (subj, pat), trans gofield) + ELIF tok = equal + THEN asgn := FALSE; scan; move to obj + ELSE verify (eos); + STMT (lab, HEAP MATCH := (subj, pat), NIL) + FI + FI + ELSE verify (eos); + STMT (lab, REF EXPR (subj), NIL) + FI + FI + END; + + # Body of trans stmt. # + IF tok = name + THEN lab := HEAP IDR; idr addr OF lab := psn; scan; + IF tok = blank + THEN move to subj + ELSE verify (eos); + STMT (lab, REF EXPR (NIL), NIL) + FI + ELIF tok = blank + THEN move to subj + ELSE verify (eos); + STMT (lab, REF EXPR (NIL), NIL) + FI + END; + + PROC trans gofield = REF GOTOFIELD: + BEGIN PROC where = REF DEST: + BEGIN HEAP DEST d; + verify (lpar); + IF tok = blank THEN scan FI; + d := (tok = endt | scan; "E" + |: tok = ret | scan; "R" + |: tok = fret | scan; "F" + | trans expr); + verify (rpar); + d + END; + + REF DEST uncond := NIL, succ := NIL, fail := NIL; + scan; IF tok = blank THEN scan FI; + IF tok = stok + THEN scan; succ := where; + IF tok = blank THEN scan FI; + IF tok = ftok THEN scan; fail := where FI; + verify (eos) + ELIF tok = ftok + THEN scan; fail := where; + IF tok = blank THEN scan FI; + IF tok = stok THEN scan; succ := where FI; + verify (eos) + ELSE uncond := where; verify (eos) + FI; + HEAP GOTOFIELD := (uncond, succ, fail) + END; + + PROC trans expr = REF EXPR: + BEGIN REF EXPR e := trans expr1; + WHILE tok = bbar + DO scan; + e := HEAP EXPR := HEAP BINARYEXPR := (e, trans expr1, "!") + OD; + e + END; + + PROC trans expr1 = REF EXPR: + BEGIN REF EXPR e := trans expr2; + WHILE tok = blank + DO scan; + IF tok /= colon AND tok /= rpar AND tok /= comma AND tok /= equal + THEN e := HEAP EXPR := HEAP BINARYEXPR := (e, trans expr2, "C") + FI + OD; + e + END; + + PROC trans expr2 = REF EXPR: + BEGIN REF EXPR e := trans term; + CHAR opr; + WHILE tok = bplus OR tok = bminus + DO opr := (tok = bplus | "+" | "-"); + scan; + e := HEAP EXPR := HEAP BINARYEXPR := (e, trans term, opr) + OD; + e + END; + + PROC trans term = REF EXPR: + BEGIN REF EXPR e := trans term1; + WHILE tok = bslash + DO scan; + e := HEAP EXPR := HEAP BINARYEXPR := (e, trans term1, "/") + OD; + e + END; + + PROC trans term1 = REF EXPR: + BEGIN REF EXPR e := trans term2; + WHILE tok = bstar + DO scan; + e := HEAP EXPR := HEAP BINARYEXPR := (e, trans term2, "*") + OD; + e + END; + + PROC trans term2 = REF EXPR: + BEGIN REF EXPR e := trans elem; + WHILE tok = bdoll + DO scan; + e := HEAP EXPR := HEAP BINARYEXPR := (e, trans elem, "$") + OD; + e + END; + + PROC trans elem = REF EXPR: + IF tok = doll OR tok = plus OR tok = minus OR tok = at + THEN CHAR opr = tok; + scan; + HEAP EXPR := HEAP UNARYEXPR := (trans element, opr) + ELSE trans element + FI; + + PROC trans element = REF EXPR: + IF tok = name + THEN IDR n; + idr addr OF n := psn; + scan; + IF tok /= lpar + THEN HEAP EXPR := n + ELSE HEAP[1:arglim]REF EXPR a, INT ac := 0; + WHILE scan; + IF tok = blank THEN scan FI; + IF ac = arglim + THEN error ("TOO MANY ARGUMENTS IN FUNCTION CALL") + FI; + IF NOT (ac = 0 AND tok = rpar) + THEN a[ac +:= 1] := (tok = comma OR tok = rpar | NIL | trans expr) + FI; + IF tok /= comma AND tok /= rpar + THEN error ("ERROR IN ARGUMENT LIST") + FI; + tok = comma + DO SKIP OD; + scan; + HEAP EXPR := HEAP CALL := (n, a[1:ac]) + FI + ELIF tok = lstring + THEN LSTR ls; + lstr addr OF ls := psn; + scan; + HEAP EXPR := ls + ELIF tok = number + THEN NUM nu; num addr OF nu := psn; + scan; + HEAP EXPR := nu + ELSE verify (lpar); + IF tok = blank THEN scan FI; + REF EXPR e = trans expr; + verify (rpar); + e + FI; + + PROC usage = VOID: + BEGIN puts ("Usage: snobol [-l] FILE'n"); + stop + END; + + listing := FALSE; + IF argc < 2 THEN usage FI; + FOR i FROM 2 TO argc + DO IF argv (i) = "-l" THEN listing := TRUE + ELIF filein = 0 + THEN filein := fopen (argv (i), file o rdonly); + IF (filein = -1) + THEN error ("opening " + argv (i) + ": " + strerror (errno)) FI + ELSE usage + FI + OD; + init; + translate + END; # TRANSLATION PHASE # + + BEGIN # INTERPRETATION PHASE # + + OP INTG = (REF ITEM a) INT: (a | (INT i) : i), + STR = (REF ITEM a) REF STRINGITEM: (a | (REF STRINGITEM s): s), + PAT = (REF ITEM a) PATTERN: (a | (PATTERN p) : p); + BOOL fn success; + + PROC interpret = (INT stmt no) VOID: + BEGIN INT sn := stmt no; BOOL cycling := TRUE; + + PROC jump = (REF DEST dest) VOID: + BEGIN failed := FALSE; + CASE dest + IN (REF EXPR e): sn := find label (eval softly (e)), + (CHAR c): IF c = "E" THEN sn := UPB t + 1 + ELIF c = "R" THEN fn success := TRUE; + cycling := FALSE + ELSE # c = "F" # fn success := cycling := FALSE + FI + ESAC + END; + + WHILE cycling + DO IF sn > UPB t THEN stop FI; + failed := FALSE; + + # EXECUTE STATEMENT CORE # + CASE stmt core OF t[sn] + IN (REF ASMT a): + (REF ITEM sp = eval softly (subject OF a); + assign (sp, eval strongly (object OF a))), + (REF MATCH m): + (REF ITEM svp = eval strongly (subject OF m); + match (convert to str (svp), + convert to pat (eval strongly (pattern OF m)))), + (REF REPL r): + (REF ITEM sp = eval softly (subject OF r); + REF ITEM pp = convert to pat (eval strongly (pattern OF r)); + REF ITEM svp = convert to str (ref OF (STR sp)); + INT c = match (svp, pp); + REF ITEM b = (svp IS NIL | NIL | make str ((val OF (STR svp))[c+1:])); + REF ITEM obp = eval strongly (object OF r); + assign (sp, concatenate (obp, b))), + (REF EXPR e): + eval strongly (e) + ESAC; + + # PROCESS GOTO FIELD # + REF GOTOFIELD go = goto OF t[sn]; + IF go IS NIL THEN sn := sn + 1 + ELIF REF DEST (upart OF go) ISNT NIL + THEN jump (upart OF go) + ELIF NOT failed AND (REF DEST (spart OF go) ISNT NIL) + THEN jump (spart OF go) + ELIF failed AND (REF DEST (fpart OF go) ISNT NIL) + THEN jump (fpart OF go) + ELSE sn := sn + 1 + FI + OD + END; # END OF INTERPRET # + + PROC find label = (REF ITEM label ptr) INT: + BEGIN INT stmt no := 0; + IF failed THEN error ("FAILURE IN GOTO FIELD") FI; + FOR i TO UPB t WHILE stmt no = 0 + DO IF (REF IDR (label OF t[i]) IS NIL + | FALSE + | label ptr IS idr addr OF label OF t[i]) + THEN stmt no := i + FI + OD; + IF stmt no = 0 THEN error ("UNDEFINED LABEL") FI; + stmt no + END; + + PROC match = (REF ITEM subject ptr, pattern ptr) INT: + IF failed + THEN 0 + ELSE PATTERN p = PAT pattern ptr; + STRING subj = (subject ptr IS NIL | "" | val OF (STR subject ptr)); + INT u = UPB subj; + INT iarg, # INTEGER COMPONENT ARGUMENT # + STRING sarg, # STRING COMPONENT ARGUMENT # + INT l; # LENGTH OF SARG # + INT cn := 1, # COMPONENT NUMBER # + c := 0, # CURSOR # + code; # NEW CURSOR OR -1 IF COMPONENT NO-MATCH # + BOOL matching := TRUE; + + psp := 0; # CLEAR PATTERN STACK # + WHILE matching + DO IF alternate OF p[cn] /= 0 + THEN # PUSH PATTERN STACK # + pattern stack[psp +:= 1] := (c, alternate OF p[cn]) + FI; + IF REF ITEM (arg OF p[cn]) ISNT NIL + THEN CASE arg OF p[cn] + IN (INT i) : iarg := i, + (REF STRINGITEM s): + (sarg := val OF s; l := UPB sarg) + ESAC + FI; + + # EXECUTE INDICATED MATCHING ROUTINE # + CASE routine OF p[cn] + IN # MSTR # + IF REF ITEM (arg OF p[cn]) IS NIL + THEN code := c + ELIF c + l > u THEN code := -1 + ELSE code := (sarg = subj[c+1:c+l] | c + l | -1) + FI, + # MLEN # + code := (iarg <= u - c | c + iarg | -1), + # MBRK # + IF c >= u THEN code := -1 + ELSE INT n = break scan (subj[c+1:], sarg); + code := (n < u - c | c + n | -1) + FI, + # MSPN # + IF c >= u THEN code := -1 + ELIF any (sarg, subj[c+1]) + THEN INT j := c + 1; + FOR i FROM c + 2 TO u WHILE any (sarg, subj[i]) + DO j := i OD; + code := j + ELSE code := -1 + FI, + # MANY # + IF c >= u + THEN code := -1 + ELSE code := (any (sarg, subj[c+1]) | c + 1 | -1) + FI, + # MNUL # + code := c, + # MIV1 # + code := extra OF p[cn] := c, + # MIV2 # + (INT m = extra OF p[cn - extra OF p[cn]] + 1; + assign (arg OF p[cn], make str (subj[m:c])); + code := c), + # M1 # + code := (1 <= u - c | c + 1 | -1), + # MAT # + (assign (arg OF p[cn], make int (c)); + code := c), + # MPOS # + code := (c = iarg | c | -1), + # MTAB # + code := (c <= iarg AND iarg <= u | iarg | -1), + # MRPOS # + code := (u - c = iarg | c | -1), + # MRTAB # + code := (u - c >= iarg | u - iarg | -1), + # MNTY # + IF c >= u + THEN code := -1 + ELSE code := (any (sarg, subj[c+1]) | -1 | c + 1) + FI + ESAC; + + # DECIDE WHAT TO DO NEXT # + IF code >= 0 + THEN IF subsequent OF p[cn] = 0 + THEN matching := FALSE #SUCCESSFUL TERMINATION # + ELSE cn := subsequent OF p[cn]; + c := code # CONTINUE # + FI + ELIF psp = 0 + THEN failed := TRUE; + matching := FALSE # STMT FAILURE # + ELSE # POP PATTERN STACK TO BACKTRACK # + cn := alternate OF pattern stack[psp]; + c := cursor OF pattern stack[psp]; + psp := psp - 1 + FI + OD; + (failed | 0 | code) + FI; # END OF MATCH PROCEDURE # + + PROC assign = (REF ITEM subject ptr, object ptr) VOID: + IF failed THEN SKIP + ELSE REF STRINGITEM s = STR subject ptr; + ref OF s := object ptr; + IF val OF s = "OUTPUT" + THEN IF object ptr IS NIL + THEN puts ("'n") + ELSE CASE object ptr + IN (REF STRINGITEM r): puts ((val OF r) + "'n"), + (INT i): puts (itoa (i) + "'n"), + (PATTERN): (error ("ATTEMPT TO OUTPUT PATTERN"); SKIP) + ESAC + FI + FI + FI; + + PROC eval softly = (REF EXPR expression) REF ITEM: + IF failed THEN SKIP + ELSE CASE expression # CAN NEVER BE NIL # + IN (IDR id): idr addr OF id, + (REF UNARYEXPR ue): + IF operator OF ue = "$" + THEN REF ITEM r = convert to str (eval strongly (operand OF ue)); + IF r IS NIL + THEN error ("NULL RESULT WHERE VAR REQUIRED"); + SKIP + ELSE r + FI + ELSE error ("INAPPROPRIATE UNARY EXPR WHERE VAR REQUIRED"); + SKIP + FI + OUT error ("INAPPROPRIATE EXPR WHERE VAR REQUIRED"); + SKIP + ESAC + FI; + + PROC eval strongly = (REF EXPR expression) REF ITEM: + IF failed THEN SKIP + ELIF expression IS NIL THEN NIL + ELSE CASE expression + IN (IDR id): + (REF STRINGITEM s = STR (idr addr OF id); + IF val OF s = "INPUT" + THEN STRING line; + # SNOBOL programs read data from stdin. # + line := gets (80); + IF (line = "") THEN failed := TRUE; eof FI; + assign (idr addr OF id, make str (line)); + eof: SKIP + FI; + ref OF s), + (NUM nbr): + num addr OF nbr, + (LSTR ls): + lstr addr OF ls, + (REF UNARYEXPR ue): + (REF ITEM arg ptr = (operator OF ue = "@" + | eval softly (operand OF ue) + | eval strongly (operand OF ue)); + eval unary (arg ptr, operator OF ue)), + (REF BINARYEXPR be): + (REF ITEM arg1 ptr = eval strongly (operand1 OF be); + REF ITEM arg2 ptr = (operator OF be = "$" + | eval softly (operand2 OF be) + | eval strongly (operand2 OF be)); + eval binary (arg1 ptr, arg2 ptr, operator OF be)), + (REF CALL cl): + (INT n = UPB args OF cl; + [1:n]REF ITEM arglist; + FOR i TO n + DO arglist[i] := eval strongly ((args OF cl)[i]) OD; + eval call (idr addr OF fnname OF cl, arglist)) + ESAC + FI; + + PROC eval unary = (REF ITEM arg ptr, CHAR opr) REF ITEM: + IF failed THEN SKIP + ELSE IF opr = "$" + THEN IF arg ptr IS NIL + THEN error ("INDIRECTION APPLIED TO NULL STRING"); + SKIP + ELSE ref OF (STR convert to str (arg ptr)) + FI + ELIF opr = "+" + THEN convert to int (arg ptr) + ELIF opr = "-" + THEN INT k = INTG convert to int (arg ptr); + make int (-k) + ELSE # OPR = "@" # + make pat comp (mat, arg ptr) + FI + FI; + + PROC eval binary = (REF ITEM arg1 ptr, arg2 ptr, CHAR opr) REF ITEM: + IF failed THEN SKIP + ELSE IF opr = "$" + THEN REF ITEM c = concatenate (make pat comp (miv1, NIL), + arg1 ptr); + concatenate (c, make pat comp (miv2, arg2 ptr)) + ELIF opr = "*" OR opr = "/" OR opr = "+" OR opr = "-" + THEN INT m = INTG convert to int (arg1 ptr), + n = INTG convert to int (arg2 ptr); + make int ((opr = "*" | m * n + |: opr = "/" | m OVER n + |: opr = "+" | m + n | m - n)) + ELIF opr = "C" + THEN concatenate (arg1 ptr, arg2 ptr) + ELSE # OPR = "!" # + PATTERN p1 = PAT convert to pat (arg1 ptr), + p2 = PAT convert to pat (arg2 ptr); + INT u1 = UPB p1, u2 = UPB p2; + PATTERN p = HEAP[u1 + u2]COMPONENT, + INT offset = u1 + 1, INT j := 1; + p[1:u1] := p1[1:u1]; + WHILE alternate OF p[j] /= 0 + DO j := alternate OF p[j] OD; + alternate OF p[j] := offset; + FOR i FROM offset TO u1 + u2 + DO p[i] := p2 [i - u1]; + IF subsequent OF p[i] /= 0 + THEN subsequent OF p[i] +:= u1 + FI; + IF alternate OF p[i] /= 0 + THEN alternate OF p[i] +:= u1 + FI + OD; + HEAP ITEM := p + FI + FI; + + PROC eval call = (REF ITEM name ptr, REF[]REF ITEM arglist) REF ITEM: + IF failed THEN SKIP + ELSE # SEARCH FUNCTION TABLE FOR NAME # + BOOL not found := TRUE, INT j; + FOR i TO ftp WHILE not found + DO IF name ptr IS fnname OF function table[i] + THEN j := i; not found := FALSE + FI + OD; + IF not found + THEN exec prim fn (name ptr, arglist) + ELSE #PROGRAMMER-DEFINED FUNCTION # + + PROC stack = (REF ITEM a) VOID: + (IF rsp = rslim THEN error ("RUN STACK OVERFLOW") FI; + run stack [rsp +:= 1] := a); + + PROC unstack = REF ITEM: + (IF rsp = 0 THEN error ("RETURN FROM LEVEL 0") FI; + run stack [(rsp -:= 1) + 1]); + + REF STRINGITEM name = STR name ptr; + + # ENTRY PROTOCOL # + stack (ref OF name); + assign (name ptr, NIL); + REF[]REF ITEM params = params OF function table[j], + INT n = UPB arglist; + IF UPB params /= n + THEN error ("WRONG NUMBER OF ARGUMENTS IN CALL") + FI; + FOR i TO n + DO stack (ref OF (STR params[i])); + assign (params[i], arglist[i]) + OD; + REF[]REF ITEM locals = locals OF function table[j]; + FOR i TO UPB locals + DO stack (ref OF (STR locals[i])); + assign (locals[i], NIL) + OD; + + interpret (find label (entry name OF function table[j])); + + # RETURN PROTOCOL # + FOR i FROM UPB locals BY -1 TO 1 + DO assign (locals[i], unstack) OD; + FOR i FROM n BY -1 TO 1 + DO assign (params[i], unstack) OD; + REF ITEM result = ref OF name; + assign (name ptr, unstack); + (fn success | result | failed := TRUE ; SKIP) + FI + FI; + + PROC exec prim fn = (REF ITEM name ptr, + REF[]REF ITEM arglist) REF ITEM: + BEGIN + PROC gen1 = (INT routine) REF ITEM: + BEGIN # CREATE PATTERN COMPONENT WITH STRING ARGUMENT # + REF ITEM arg = convert to str (arglist[1]); + IF arg IS NIL + THEN error ("NULL ARG FOR PATTERN-VALUED PRIMITIVE FUNCTION" ) + FI; + make pat comp (routine, arg) + END; + + PROC gen2 = (INT routine) REF ITEM: + BEGIN # CREATE PATTERN COMPONENT WITH INTEGER ARGUMENT # + REF ITEM arg = convert to int (arglist[1]); + IF INTG arg < 0 + THEN error ("NEGATIVE ARG FOR PATTERN-VALUED PRIMITIVE FUNCTION") + FI; + make pat comp (routine, arg) + END; + + STRING fn = val OF (STR name ptr), INT n = UPB arglist; + IF fn = "LE" AND n = 2 + THEN IF INTG convert to int (arglist[1]) + <= INTG convert to int (arglist[2]) + THEN NIL + ELSE failed := TRUE; + SKIP + FI + ELIF fn = "EQ" AND n = 2 + THEN IF INTG convert to int (arglist[1]) + = INTG convert to int (arglist[2]) + THEN NIL + ELSE failed := TRUE; + SKIP + FI + ELIF fn = "NE" AND n = 2 + THEN IF INTG convert to int (arglist[1]) + /= INTG convert to int (arglist[2]) + THEN NIL + ELSE failed := TRUE; + SKIP + FI + ELIF fn = "IDENT" AND n = 2 + THEN IF REF ITEM (arglist[1]) IS arglist[2] + THEN NIL + ELSE failed := TRUE; + SKIP + FI + ELIF fn = "DIFFER" AND n = 2 + THEN IF REF ITEM (arglist[1]) ISNT arglist[2] + THEN NIL + ELSE failed := TRUE; + SKIP + FI + ELIF fn = "ANY" AND n = 1 THEN gen1 (many) + ELIF fn = "LEN" AND n = 1 THEN gen2 (mlen) + ELIF fn = "POS" AND n = 1 THEN gen2 (mpos) + ELIF fn = "TAB" AND n = 1 THEN gen2 (mtab) + ELIF fn = "SPAN" AND n = 1 THEN gen1 (mspn) + ELIF fn = "RPOS" AND n = 1 THEN gen2 (mrpos) + ELIF fn = "RTAB" AND n = 1 THEN gen2 (mrtab) + ELIF fn = "BREAK" AND n = 1 THEN gen1 (mbrk) + ELIF fn = "NOTANY" AND n = 1 THEN gen1 (mnty) + ELIF fn = "SIZE" AND n = 1 + THEN make int (UPB val OF (STR convert to str (arglist[1]))) + ELIF fn = "DEFINE" AND n = 2 + THEN IF REF ITEM (arglist[1]) IS NIL + THEN error ("NULL PROTOTYPE") FI; + STRING prototype = val OF (STR convert to str (arglist[1])); + REF ITEM entry = convert to str (arglist[2]); + IF entry IS NIL THEN error ("NULL ENTRY LABEL") FI; + + PROC check and find = (STRING str) REF ITEM: + BEGIN IF UPB str = 0 THEN error ("ILLEGAL PROTOTYPE") FI; + STRING an = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789."; + IF NOT any (an[:26], str[1]) + THEN error ("ILLEGAL PROTOTYPE") FI; + FOR i FROM 2 TO UPB str + DO IF NOT any (an, str[i]) + THEN error ("ILLEGAL PROTOTYPE") + FI + OD; + make str (str) + END; + + PROC breakup = (STRING str) REF[]REF ITEM: + BEGIN #ANALYZE A LIST OF IDENTIFIERS # + [1:arglim]REF ITEM r, INT p := 0, a := 1, b; + WHILE a <= UPB str + DO b := break scan (str[a:], ","); + IF p >= arglim + THEN error ("TOO MANY PARAMETERS OR LOCALS IN PROTOTYPE") FI; + r[p +:= 1] := check and find (str[a:a+b-1]); + a := a + b + 1 + OD; + HEAP[1:p]REF ITEM := r[:p] + END; + + INT lp = UPB prototype; + INT a = break scan (prototype, "("); + IF a >= lp THEN error ("ILLEGAL PROTOTYPE") FI; + REF ITEM name ptr = check and find (prototype[:a]); + INT b = break scan (prototype[a+2:], ")"); + IF b >= lp - a - 1 THEN error ("ILLEGAL PROTOTYPE") FI; + REF[]REF ITEM params = breakup (prototype[a+2:a+1+b]); + REF[]REF ITEM locals = breakup (prototype[a+b+3:]); + + BOOL not found := TRUE; + FOR i TO ftp WHILE not found + DO IF name ptr IS fnname OF function table[i] + THEN not found := FALSE; + function table[i] := (name ptr, entry, params, locals) + FI + OD; + IF not found + THEN IF ftp = ftlim + THEN error ("FUNCTION TABLE OVERFLOW") FI; + function table [ftp +:= 1] := (name ptr, entry, params, locals) + FI; + NIL # RESULT OF DEFINE(...) # + ELSE error ("ILLEGAL FUNCTION CALL"); + SKIP + FI + END; + + PROC concatenate = (REF ITEM ptr1, ptr2) REF ITEM: + BEGIN + + PROC concat patterns = (PATTERN p1, p2) REF ITEM: + BEGIN INT u1 = UPB p1, u2 = UPB p2; + PATTERN p = HEAP[u1 + u2]COMPONENT; + INT offset = u1 + 1; + FOR i TO u1 + DO p[i] := p1[i]; + IF subsequent OF p[i] = 0 + THEN subsequent OF p[i] := offset FI + OD; + FOR i FROM offset TO u1 + u2 + DO p[i] := p2[i - u1]; + IF subsequent OF p[i] /= 0 + THEN subsequent OF p[i] +:= u1 FI; + IF alternate OF p[i] /= 0 + THEN alternate OF p[i] +:= u1 FI + OD; + IF u2 = 1 AND routine OF p[offset] = miv2 + THEN extra OF p[offset] := u1 FI; + HEAP ITEM := p + END; + + IF failed THEN SKIP + ELSE IF ptr1 IS NIL THEN ptr2 + ELIF ptr2 IS NIL THEN ptr1 + ELSE CASE ptr1 + IN (PATTERN p1): + concat patterns (p1, PAT convert to pat (ptr2)) + OUSE ptr2 + IN (PATTERN p2): + concat patterns (PAT convert to pat (ptr1), p2) + OUT STRING s1 = val OF (STR convert to str (ptr1)); + make str (s1 + val OF (STR convert to str (ptr2))) + ESAC + FI + FI + END; + + PROC convert to int = (REF ITEM ptr) REF ITEM: + IF failed THEN SKIP + ELSE IF ptr IS NIL THEN make int (0) + ELSE CASE ptr + IN (INT): ptr, + (PATTERN): (error ("PATTERN VALUE WHERE INTEGER REQUIRED"); SKIP), + (REF STRINGITEM s): + (INT n := 0, d, z := ABS "0"; + FOR i TO UPB val OF s + DO d := ABS (val OF s)[i] - z; + IF d < 0 OR d > 9 + THEN error ("STRING NOT CONVERTIBLE TO INTEGER") FI; + n := n * 10 + d + OD; + make int (n)) + ESAC + FI + FI; + + PROC convert to pat = (REF ITEM ptr) REF ITEM: + IF failed THEN SKIP + ELSE IF ptr IS NIL + THEN make pat comp (mstr, NIL) + ELSE CASE ptr + IN (PATTERN): ptr + OUT make pat comp (mstr, convert to str (ptr)) + ESAC + FI + FI; + + PROC convert to str = (REF ITEM ptr) REF ITEM: + IF failed THEN SKIP + ELSE IF ptr IS NIL THEN ptr + ELSE CASE ptr + IN (REF STRINGITEM): ptr, + (PATTERN): (error ("PATTERN VALUE WHERE STRING REQUIRED"); SKIP), + (INT i): make str (itoa (i)) + ESAC + FI + FI; + + PROC make int = (INT val) REF ITEM: + IF failed THEN SKIP + ELSE HEAP ITEM := val + FI; + + PROC make pat comp = (INT routine, REF ITEM arg) REF ITEM: + IF failed THEN SKIP + ELSE HEAP ITEM := HEAP[1:1]COMPONENT := COMPONENT (routine, 0, 0, SKIP, arg) + FI; + + PROC make str = (STRING val) REF ITEM: + IF failed THEN SKIP + ELIF UPB val = 0 THEN NIL + ELSE INT i := 0, BOOL nf := TRUE; + WHILE IF (i +:= 1) <= nin + THEN nf := val /= val OF (STR spool [i]) + ELSE FALSE + FI + DO SKIP OD; + IF nf + THEN IF nin = spoolsize THEN error ("TOO MANY STRINGS") FI; + spool[nin +:= 1] := HEAP ITEM := HEAP STRINGITEM := (val, NIL) + FI; + spool[i] + FI; + + PROC break scan = (STRING str, arg) INT: + BEGIN # RESULT = UPB STR IF NO BREAK CHAR, LESS OTHERWISE # + INT j := 0; + FOR i TO UPB str WHILE NOT any (arg, str[i]) + DO j := i OD; + j + END; + + PROC any = (STRING str, CHAR ch) BOOL: + BEGIN BOOL nf; + FOR i TO UPB str WHILE nf := ch /= str[i] DO SKIP OD; + NOT nf + END; + + interpret ((REF ITEM (prog entry) IS NIL | 1 | find label (prog entry))) + END # INTERPRETATION PHASE # +END diff --git a/gcc/testsuite/algol68/compile/supper-1.a68 b/gcc/testsuite/algol68/compile/supper-1.a68 new file mode 100644 index 0000000..a572f1e --- /dev/null +++ b/gcc/testsuite/algol68/compile/supper-1.a68 @@ -0,0 +1,11 @@ +{ dg-options {-fstropping=supper} } + +begin mode Some_Mode = real; + Some_Mode some_real := random; + + puts ("Hello time for SUPPER!\n"); + if some_real > 0.5 + then puts ("YES\n") + else puts ("NO\n") + fi +end diff --git a/gcc/testsuite/algol68/compile/supper-10.a68 b/gcc/testsuite/algol68/compile/supper-10.a68 new file mode 100644 index 0000000..5c661a6 --- /dev/null +++ b/gcc/testsuite/algol68/compile/supper-10.a68 @@ -0,0 +1,6 @@ +{ dg-options {-fstropping=supper} } + +begin mode BEGIN = int; + BEGIN some_int = 10; + skip +end diff --git a/gcc/testsuite/algol68/compile/supper-11.a68 b/gcc/testsuite/algol68/compile/supper-11.a68 new file mode 100644 index 0000000..5c661a6 --- /dev/null +++ b/gcc/testsuite/algol68/compile/supper-11.a68 @@ -0,0 +1,6 @@ +{ dg-options {-fstropping=supper} } + +begin mode BEGIN = int; + BEGIN some_int = 10; + skip +end diff --git a/gcc/testsuite/algol68/compile/supper-12.a68 b/gcc/testsuite/algol68/compile/supper-12.a68 new file mode 100644 index 0000000..497a88a --- /dev/null +++ b/gcc/testsuite/algol68/compile/supper-12.a68 @@ -0,0 +1,6 @@ +{ dg-options {-fstropping=supper} } + +begin for i while i < 10 + do puts ("lala\n") + od +end diff --git a/gcc/testsuite/algol68/compile/supper-13.a68 b/gcc/testsuite/algol68/compile/supper-13.a68 new file mode 100644 index 0000000..5e17fb4 --- /dev/null +++ b/gcc/testsuite/algol68/compile/supper-13.a68 @@ -0,0 +1,7 @@ +{ dg-options "-fstropping=supper" } + +{ mode_ should not be recognized as a symbol. } + +begin int mode_ = 10; + skip +end diff --git a/gcc/testsuite/algol68/compile/supper-2.a68 b/gcc/testsuite/algol68/compile/supper-2.a68 new file mode 100644 index 0000000..04d5f0f --- /dev/null +++ b/gcc/testsuite/algol68/compile/supper-2.a68 @@ -0,0 +1,5 @@ +{ dg-options {-fstropping=supper} } + +begin int foo_bar = 10; + skip +end diff --git a/gcc/testsuite/algol68/compile/supper-3.a68 b/gcc/testsuite/algol68/compile/supper-3.a68 new file mode 100644 index 0000000..4cc711b --- /dev/null +++ b/gcc/testsuite/algol68/compile/supper-3.a68 @@ -0,0 +1,5 @@ +{ dg-options {-fstropping=supper} } + +begin int foo_bar_ = 10; + skip +end diff --git a/gcc/testsuite/algol68/compile/supper-4.a68 b/gcc/testsuite/algol68/compile/supper-4.a68 new file mode 100644 index 0000000..283be9a --- /dev/null +++ b/gcc/testsuite/algol68/compile/supper-4.a68 @@ -0,0 +1,5 @@ +{ dg-options {-fstropping=supper} } + +begin int foo_ = 10; + skip +end diff --git a/gcc/testsuite/algol68/compile/supper-5.a68 b/gcc/testsuite/algol68/compile/supper-5.a68 new file mode 100644 index 0000000..b3ffd89 --- /dev/null +++ b/gcc/testsuite/algol68/compile/supper-5.a68 @@ -0,0 +1,6 @@ +{ dg-options {-fstropping=supper} } + +begin mode Foo_bar = int; + Foo_bar some_int = 10; + skip +end diff --git a/gcc/testsuite/algol68/compile/supper-6.a68 b/gcc/testsuite/algol68/compile/supper-6.a68 new file mode 100644 index 0000000..37fc5e6 --- /dev/null +++ b/gcc/testsuite/algol68/compile/supper-6.a68 @@ -0,0 +1,5 @@ +{ dg-options {-fstropping=supper} } + +begin go to done; +done: skip +end diff --git a/gcc/testsuite/algol68/compile/supper-7.a68 b/gcc/testsuite/algol68/compile/supper-7.a68 new file mode 100644 index 0000000..a374174 --- /dev/null +++ b/gcc/testsuite/algol68/compile/supper-7.a68 @@ -0,0 +1,5 @@ +{ dg-options {-fstropping=supper} } + +begin goto done; +done: skip +end diff --git a/gcc/testsuite/algol68/compile/supper-8.a68 b/gcc/testsuite/algol68/compile/supper-8.a68 new file mode 100644 index 0000000..363d9b4 --- /dev/null +++ b/gcc/testsuite/algol68/compile/supper-8.a68 @@ -0,0 +1,6 @@ +{ dg-options {-fstropping=supper} } + +begin mode Int = int; + Int some_int = 10; + skip +end diff --git a/gcc/testsuite/algol68/compile/supper-9.a68 b/gcc/testsuite/algol68/compile/supper-9.a68 new file mode 100644 index 0000000..5c661a6 --- /dev/null +++ b/gcc/testsuite/algol68/compile/supper-9.a68 @@ -0,0 +1,6 @@ +{ dg-options {-fstropping=supper} } + +begin mode BEGIN = int; + BEGIN some_int = 10; + skip +end diff --git a/gcc/testsuite/algol68/compile/uniting-1.a68 b/gcc/testsuite/algol68/compile/uniting-1.a68 new file mode 100644 index 0000000..057c4f8 --- /dev/null +++ b/gcc/testsuite/algol68/compile/uniting-1.a68 @@ -0,0 +1,8 @@ +{ dg-options {-fstropping=supper} } +begin mode JSON_Val = union (int,ref JSON_Obj), + JSON_Obj = struct (int je), + + proc json_new_obj = JSON_Val: + (JSON_Obj o; o); + skip +end diff --git a/gcc/testsuite/algol68/compile/upper-1.a68 b/gcc/testsuite/algol68/compile/upper-1.a68 new file mode 100644 index 0000000..6fb7871 --- /dev/null +++ b/gcc/testsuite/algol68/compile/upper-1.a68 @@ -0,0 +1,11 @@ +# { dg-options {-fstropping=upper} } # + +BEGIN MODE SOME_MODE = REAL; + SOME_MODE some_real := random; + + puts ("Hello time for SUPPER!\n"); + IF some_real > 0.5 + THEN puts ("YES\n") + ELSE puts ("NO\n") + FI +END diff --git a/gcc/testsuite/algol68/compile/warning-hidding-1.a68 b/gcc/testsuite/algol68/compile/warning-hidding-1.a68 new file mode 100644 index 0000000..b3d568b --- /dev/null +++ b/gcc/testsuite/algol68/compile/warning-hidding-1.a68 @@ -0,0 +1,6 @@ +{ dg-options "-Whidden-declarations" } +begin + op UPB = (union (int,string) v) int: { dg-warning "hides" } + (v | (string s): UPB s | 0); + UPB "lala" +end diff --git a/gcc/testsuite/algol68/compile/warning-hidding-2.a68 b/gcc/testsuite/algol68/compile/warning-hidding-2.a68 new file mode 100644 index 0000000..12bfcbb --- /dev/null +++ b/gcc/testsuite/algol68/compile/warning-hidding-2.a68 @@ -0,0 +1,6 @@ +{ dg-options "-Whidden-declarations" } +begin + op UPB = (union ([]int,string) v) int: { dg-warning "hides" } + (v | (string s): UPB s | 0); + UPB "lala" +end diff --git a/gcc/testsuite/algol68/compile/warning-hidding-3.a68 b/gcc/testsuite/algol68/compile/warning-hidding-3.a68 new file mode 100644 index 0000000..25f4809 --- /dev/null +++ b/gcc/testsuite/algol68/compile/warning-hidding-3.a68 @@ -0,0 +1,5 @@ +{ dg-options "-Whidden-declarations" } +begin op UPB = (union (int,union(string,real)) v) int: { dg-warning "hides" } + (v | (string s): UPB s | 0); + UPB "lala" +end diff --git a/gcc/testsuite/algol68/compile/warning-hidding-4.a68 b/gcc/testsuite/algol68/compile/warning-hidding-4.a68 new file mode 100644 index 0000000..0078e6a --- /dev/null +++ b/gcc/testsuite/algol68/compile/warning-hidding-4.a68 @@ -0,0 +1,6 @@ +{ dg-options "-Whidden-declarations" } +begin + op UPB = (int i, union (int,string) v) int: { dg-warning "hides" } + (v | (string s): UPB s | 0); + UPB "lala" +end diff --git a/gcc/testsuite/algol68/compile/warning-hidding-5.a68 b/gcc/testsuite/algol68/compile/warning-hidding-5.a68 new file mode 100644 index 0000000..f9bc4a4 --- /dev/null +++ b/gcc/testsuite/algol68/compile/warning-hidding-5.a68 @@ -0,0 +1,9 @@ +{ dg-options "-Whidden-declarations=none" } +begin real b; + begin int getchar = 10; + int b; + op UPB = (int i, union (int,string) v) int: + (v | (string s): UPB s | 0); + UPB "lala" + end +end diff --git a/gcc/testsuite/algol68/compile/warning-hidding-6.a68 b/gcc/testsuite/algol68/compile/warning-hidding-6.a68 new file mode 100644 index 0000000..a865103 --- /dev/null +++ b/gcc/testsuite/algol68/compile/warning-hidding-6.a68 @@ -0,0 +1,9 @@ +{ dg-options "-Whidden-declarations=prelude" } +begin real b; + begin int getchar = 10; { dg-warning "hides" } + int b; + op UPB = (int i, union (int,string) v) int: { dg-warning "hides" } + (v | (string s): UPB s | 0); + UPB "lala" + end +end diff --git a/gcc/testsuite/algol68/compile/warning-hidding-7.a68 b/gcc/testsuite/algol68/compile/warning-hidding-7.a68 new file mode 100644 index 0000000..e641a93 --- /dev/null +++ b/gcc/testsuite/algol68/compile/warning-hidding-7.a68 @@ -0,0 +1,9 @@ +{ dg-options "-Whidden-declarations=all" } +begin real b; + begin int getchar = 10; { dg-warning "hides" } + int b; { dg-warning "hides" } + op UPB = (int i, union (int,string) v) int: { dg-warning "hides" } + (v | (string s): UPB s | 0); + UPB "lala" + end +end diff --git a/gcc/testsuite/algol68/compile/warning-module-hidding-1.a68 b/gcc/testsuite/algol68/compile/warning-module-hidding-1.a68 new file mode 100644 index 0000000..84b4b0e --- /dev/null +++ b/gcc/testsuite/algol68/compile/warning-module-hidding-1.a68 @@ -0,0 +1,6 @@ +{ dg-options "-Whidden-declarations=all" } + +module Foo = def int i; i := 10 postlude puts ("bye foo'n") fed, + Bar = def int j; j := 20 + postlude int j; puts ("bye bar'n") fed, { dg-warning "hidden" } + Baz = def skip fed diff --git a/gcc/testsuite/algol68/compile/warning-pub-loc-1.a68 b/gcc/testsuite/algol68/compile/warning-pub-loc-1.a68 new file mode 100644 index 0000000..57baef9 --- /dev/null +++ b/gcc/testsuite/algol68/compile/warning-pub-loc-1.a68 @@ -0,0 +1,7 @@ +module Foo = +def pub ref int xx = loc int := 777; { dg-warning "" } + pub ref int yy; + pub ref int zz = heap int := 888; + ref int vv = loc int := 999; + skip +fed diff --git a/gcc/testsuite/algol68/compile/warning-scope-1.a68 b/gcc/testsuite/algol68/compile/warning-scope-1.a68 new file mode 100644 index 0000000..99ae973 --- /dev/null +++ b/gcc/testsuite/algol68/compile/warning-scope-1.a68 @@ -0,0 +1,9 @@ +# { dg-options "-fstropping=upper" } # + +# Potential scope violation warnings are disabled by default. # +BEGIN PROC increase = (REF INT i) REF INT: + BEGIN INT j := i; + j # Inhibited warning. # + END; + increase (LOC INT) +END diff --git a/gcc/testsuite/algol68/compile/warning-scope-2.a68 b/gcc/testsuite/algol68/compile/warning-scope-2.a68 new file mode 100644 index 0000000..5bbc0b3 --- /dev/null +++ b/gcc/testsuite/algol68/compile/warning-scope-2.a68 @@ -0,0 +1,8 @@ +# { dg-options {-Wscope -fstropping=upper} } # +BEGIN PROC increase = (REF INT i) REF INT: + BEGIN + INT j := i; + j # { dg-warning "scope violation" } # + END; + increase (LOC INT) +END diff --git a/gcc/testsuite/algol68/compile/warning-scope-3.a68 b/gcc/testsuite/algol68/compile/warning-scope-3.a68 new file mode 100644 index 0000000..c5dd295 --- /dev/null +++ b/gcc/testsuite/algol68/compile/warning-scope-3.a68 @@ -0,0 +1,3 @@ +# { dg-options {-Wscope -fstropping=upper} } # +(REF INT xx; + xx := (INT x; x := 3)) # { dg-warning "scope violation" } # diff --git a/gcc/testsuite/algol68/compile/warning-scope-4.a68 b/gcc/testsuite/algol68/compile/warning-scope-4.a68 new file mode 100644 index 0000000..ae0592e --- /dev/null +++ b/gcc/testsuite/algol68/compile/warning-scope-4.a68 @@ -0,0 +1,3 @@ +# { dg-options {-Wscope -fstropping=upper} } # +(REF INT xx; + (INT x; xx:= x; x := 3)) # { dg-warning "scope violation" } # diff --git a/gcc/testsuite/algol68/compile/warning-scope-5.a68 b/gcc/testsuite/algol68/compile/warning-scope-5.a68 new file mode 100644 index 0000000..2bb5b4a --- /dev/null +++ b/gcc/testsuite/algol68/compile/warning-scope-5.a68 @@ -0,0 +1,8 @@ +# { dg-options {-Wscope -fstropping=upper} } # +# The scope violation here is due to the routine text, which is copied + to P, referring to a value whose range doesn't exist anymore: X # +BEGIN (PROC REAL p; + (REAL x; + p := REAL: x * 2); # { dg-warning "scope violation" } # + p) +END diff --git a/gcc/testsuite/algol68/compile/warning-scope-6.a68 b/gcc/testsuite/algol68/compile/warning-scope-6.a68 new file mode 100644 index 0000000..fa3888d --- /dev/null +++ b/gcc/testsuite/algol68/compile/warning-scope-6.a68 @@ -0,0 +1,6 @@ +# { dg-options {-Wscope -fstropping=upper} } # +BEGIN (PROC REAL p; REAL mypi := 3.14; + (REAL x; + p := REAL: mypi * 2); # No scope violation here. # + p) +END diff --git a/gcc/testsuite/algol68/compile/warning-scope-7.a68 b/gcc/testsuite/algol68/compile/warning-scope-7.a68 new file mode 100644 index 0000000..b99fa85 --- /dev/null +++ b/gcc/testsuite/algol68/compile/warning-scope-7.a68 @@ -0,0 +1,12 @@ +# { dg-options {-Wscope -fstropping=upper} } # +# N,M below represent pairs of insc, outsc # +BEGIN (INT x; + REF INT xx; + (REF INT yy; + INT y; + xx := yy; # 0,0 := 1,0. Dynamic check. # + yy := y; # 1,1 := 1,1. OK # + xx := y # 0,0 := 1,1. { dg-warning "scope violation" } # + ) + ) +END diff --git a/gcc/testsuite/algol68/compile/warning-voiding-1.a68 b/gcc/testsuite/algol68/compile/warning-voiding-1.a68 new file mode 100644 index 0000000..f34787c --- /dev/null +++ b/gcc/testsuite/algol68/compile/warning-voiding-1.a68 @@ -0,0 +1,5 @@ +# { dg-options {-Wvoiding -fstropping=upper} } # +BEGIN PROC sum = (INT a, INT b) INT: + ( a + b ); + sum (10, 20) # { dg-warning "will be voided" } # +END diff --git a/gcc/testsuite/algol68/compile/warning-voiding-2.a68 b/gcc/testsuite/algol68/compile/warning-voiding-2.a68 new file mode 100644 index 0000000..e3c9879 --- /dev/null +++ b/gcc/testsuite/algol68/compile/warning-voiding-2.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # + +BEGIN PROC sum = (INT a, INT b) INT: + ( a + b ); + sum (10, 20) # Voiding warning won't be emitted by default. # +END diff --git a/gcc/testsuite/algol68/execute/abs-bits-1.a68 b/gcc/testsuite/algol68/execute/abs-bits-1.a68 new file mode 100644 index 0000000..bdb3a1b --- /dev/null +++ b/gcc/testsuite/algol68/execute/abs-bits-1.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +# ABS for SIZETY BITS # +BEGIN ASSERT (255 = ABS 16rff); + ASSERT (LONG 255 = ABS LONG 16rff); + ASSERT (LONG LONG 255 = ABS LONG LONG 16rff) + # XXX test ABS of negative numbers (extension). # +END diff --git a/gcc/testsuite/algol68/execute/abs-bool-1.a68 b/gcc/testsuite/algol68/execute/abs-bool-1.a68 new file mode 100644 index 0000000..90ea0d6 --- /dev/null +++ b/gcc/testsuite/algol68/execute/abs-bool-1.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN ASSERT (ABS TRUE /= 0); + ASSERT (ABS FALSE = 0) +END diff --git a/gcc/testsuite/algol68/execute/abs-char-1.a68 b/gcc/testsuite/algol68/execute/abs-char-1.a68 new file mode 100644 index 0000000..124fb3d --- /dev/null +++ b/gcc/testsuite/algol68/execute/abs-char-1.a68 @@ -0,0 +1,3 @@ +# { dg-options "-fstropping=upper" } # +BEGIN ASSERT (ABS "a" = 97) +END diff --git a/gcc/testsuite/algol68/execute/abs-int-1.a68 b/gcc/testsuite/algol68/execute/abs-int-1.a68 new file mode 100644 index 0000000..fa8125a --- /dev/null +++ b/gcc/testsuite/algol68/execute/abs-int-1.a68 @@ -0,0 +1,10 @@ +# { dg-options "-fstropping=upper" } # +BEGIN ASSERT (ABS 10 = 10); + ASSERT (ABS -10 = 10); + ASSERT (ABS SHORT 10 = SHORT 10); + ASSERT (ABS - SHORT 10 = SHORT 10); + ASSERT (ABS - SHORT SHORT 10 = SHORT SHORT 10); + ASSERT (ABS LONG 10 = LONG 10); + ASSERT (ABS - LONG 10 = LONG 10); + ASSERT (ABS - LONG LONG 10 = LONG LONG 10) +END diff --git a/gcc/testsuite/algol68/execute/abs-int-negative-1.a68 b/gcc/testsuite/algol68/execute/abs-int-negative-1.a68 new file mode 100644 index 0000000..77973ad --- /dev/null +++ b/gcc/testsuite/algol68/execute/abs-int-negative-1.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper -std=algol68" } # +BEGIN SHORT SHORT BITS b = BIN - SHORT SHORT 2; + ASSERT (ABS b = SHORT SHORT INT (SKIP)) +END diff --git a/gcc/testsuite/algol68/execute/abs-int-negative-gnu-1.a68 b/gcc/testsuite/algol68/execute/abs-int-negative-gnu-1.a68 new file mode 100644 index 0000000..4afe2567 --- /dev/null +++ b/gcc/testsuite/algol68/execute/abs-int-negative-gnu-1.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper -std=gnu68" } # +BEGIN SHORT SHORT BITS b = BIN - SHORT SHORT 2; + ASSERT (ABS b = - SHORT SHORT 2) +END diff --git a/gcc/testsuite/algol68/execute/acos-1.a68 b/gcc/testsuite/algol68/execute/acos-1.a68 new file mode 100644 index 0000000..6a985cc --- /dev/null +++ b/gcc/testsuite/algol68/execute/acos-1.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +BEGIN REAL r = 1.0; + LONG REAL rr = LONG 45.0; + LONG LONG REAL rrr = LONG LONG 60.0; + ASSERT (arccos (r) = 0.0); + long arccos (rr); + long long arccos (rrr) +END diff --git a/gcc/testsuite/algol68/execute/affirm-int-1.a68 b/gcc/testsuite/algol68/execute/affirm-int-1.a68 new file mode 100644 index 0000000..4cd065f --- /dev/null +++ b/gcc/testsuite/algol68/execute/affirm-int-1.a68 @@ -0,0 +1,10 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i = 10; + LONG INT ii = LONG 10, LONG LONG INT iii = LONG LONG 10; + SHORT INT ss = SHORT 10, SHORT SHORT INT sss = SHORT SHORT 10; + ASSERT (+i = 10); + ASSERT (+ii = LONG 10); + ASSERT (+iii = LONG LONG 10); + ASSERT (+ss = SHORT 10); + ASSERT (+sss = SHORT SHORT 10) +END diff --git a/gcc/testsuite/algol68/execute/and-bits-1.a68 b/gcc/testsuite/algol68/execute/and-bits-1.a68 new file mode 100644 index 0000000..e6530bc --- /dev/null +++ b/gcc/testsuite/algol68/execute/and-bits-1.a68 @@ -0,0 +1,18 @@ +# { dg-options "-fstropping=upper" } # +# AND for SIZETY BITS. # +BEGIN BITS b = 16r0f0f0; + ASSERT ((b AND 16r0f0f) = 16r0); + ASSERT ((b AND 16r00ff) = 16rf0); + LONG BITS bb = LONG 16r0f0f0; + ASSERT ((bb AND LONG 16r0f0f) = LONG 16r0); + ASSERT ((bb AND LONG 16r00ff) = LONG 16rf0); + LONG LONG BITS bbb = LONG LONG 16r0f0f0; + ASSERT ((bbb AND LONG LONG 16r0f0f) = LONG LONG 16r0); + ASSERT ((bbb AND LONG LONG 16r00ff) = LONG LONG 16rf0); + SHORT BITS ss = SHORT 16r0f0f0; + ASSERT ((ss AND SHORT 16r0f0f) = SHORT 16r0); + ASSERT ((ss AND SHORT 16r00ff) = SHORT 16rf0); + SHORT SHORT BITS sss = SHORT SHORT 16r0f0f0; + ASSERT ((sss AND SHORT SHORT 16r0f0f) = SHORT SHORT 16r0); + ASSERT ((sss AND SHORT SHORT 16r00ff) = SHORT SHORT 16rf0) +END diff --git a/gcc/testsuite/algol68/execute/andf-1.a68 b/gcc/testsuite/algol68/execute/andf-1.a68 new file mode 100644 index 0000000..72667a6 --- /dev/null +++ b/gcc/testsuite/algol68/execute/andf-1.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i := 10; + ASSERT (i /= 0 ANDTH i = 10) +END diff --git a/gcc/testsuite/algol68/execute/ascription-1.a68 b/gcc/testsuite/algol68/execute/ascription-1.a68 new file mode 100644 index 0000000..f6744e3 --- /dev/null +++ b/gcc/testsuite/algol68/execute/ascription-1.a68 @@ -0,0 +1,12 @@ +# { dg-options "-fstropping=upper" } # +# Make sure structs are copied when ascribed. # +BEGIN MODE BAR = STRUCT (INT j, REAL r); + MODE FOO = STRUCT (INT i, BAR bar); + + FOO f1 := (10, (20, 3.14)); + FOO f2 = f1; + + j OF bar OF f1 := 200; + ASSERT (j OF bar OF f1 = 200); + ASSERT (j OF bar OF f2 = 20) +END diff --git a/gcc/testsuite/algol68/execute/asin-1.a68 b/gcc/testsuite/algol68/execute/asin-1.a68 new file mode 100644 index 0000000..114518e --- /dev/null +++ b/gcc/testsuite/algol68/execute/asin-1.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +BEGIN REAL r = 0.0; + LONG REAL rr = LONG 45.0; + LONG LONG REAL rrr = LONG LONG 60.0; + ASSERT (arcsin (r) = 0.0); + long arcsin (rr); + long long arcsin (rrr) +END diff --git a/gcc/testsuite/algol68/execute/assert-1.a68 b/gcc/testsuite/algol68/execute/assert-1.a68 new file mode 100644 index 0000000..2ed6ea4 --- /dev/null +++ b/gcc/testsuite/algol68/execute/assert-1.a68 @@ -0,0 +1,3 @@ +# { dg-options "-fstropping=upper" } # +BEGIN ASSERT (TRUE) +END diff --git a/gcc/testsuite/algol68/execute/assignation-char-1.a68 b/gcc/testsuite/algol68/execute/assignation-char-1.a68 new file mode 100644 index 0000000..5558ccc --- /dev/null +++ b/gcc/testsuite/algol68/execute/assignation-char-1.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN CHAR c; + c := "x"; + ASSERT (c = "x") +END diff --git a/gcc/testsuite/algol68/execute/assignation-int-1.a68 b/gcc/testsuite/algol68/execute/assignation-int-1.a68 new file mode 100644 index 0000000..139d743 --- /dev/null +++ b/gcc/testsuite/algol68/execute/assignation-int-1.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i; + i := 20; + ASSERT (i = 20) +END diff --git a/gcc/testsuite/algol68/execute/assignation-int-2.a68 b/gcc/testsuite/algol68/execute/assignation-int-2.a68 new file mode 100644 index 0000000..cfd3840 --- /dev/null +++ b/gcc/testsuite/algol68/execute/assignation-int-2.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN x := 100; + INT x; + ASSERT (x = 100) +END diff --git a/gcc/testsuite/algol68/execute/assignation-int-3.a68 b/gcc/testsuite/algol68/execute/assignation-int-3.a68 new file mode 100644 index 0000000..9b60f7e --- /dev/null +++ b/gcc/testsuite/algol68/execute/assignation-int-3.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN REF INT j = LOC INT; + INT i; + i := j := 20; + ASSERT (i + j = 40) +END diff --git a/gcc/testsuite/algol68/execute/assignation-int-4.a68 b/gcc/testsuite/algol68/execute/assignation-int-4.a68 new file mode 100644 index 0000000..2aeb35b --- /dev/null +++ b/gcc/testsuite/algol68/execute/assignation-int-4.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN REF INT xx; + INT x := 10; + ASSERT ((xx := (x)) = 10) +END diff --git a/gcc/testsuite/algol68/execute/assignation-int-5.a68 b/gcc/testsuite/algol68/execute/assignation-int-5.a68 new file mode 100644 index 0000000..2b67b21 --- /dev/null +++ b/gcc/testsuite/algol68/execute/assignation-int-5.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT x := 10; + REF INT xx := x; + x := 20; + ASSERT ((xx := (INT j; x)) = 20) +END diff --git a/gcc/testsuite/algol68/execute/assignation-multiple-1.a68 b/gcc/testsuite/algol68/execute/assignation-multiple-1.a68 new file mode 100644 index 0000000..cf8d780 --- /dev/null +++ b/gcc/testsuite/algol68/execute/assignation-multiple-1.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN STRUCT ([2:3]INT m, [1:5]REAL g) s; + g OF s:= (1.0, 2.0, 3.0, 4.0, 5.0) +END diff --git a/gcc/testsuite/algol68/execute/assignation-multiple-2.a68 b/gcc/testsuite/algol68/execute/assignation-multiple-2.a68 new file mode 100644 index 0000000..22ff7e1 --- /dev/null +++ b/gcc/testsuite/algol68/execute/assignation-multiple-2.a68 @@ -0,0 +1,15 @@ +begin [5]struct(char i, real r) foo; + + { The stride in the single dimension of the multiple resulting + from the selection is not the size of a 'char'. } + i of foo := ("a","b","c","d","e"); + puts ((i of foo) + "'n"); + { Via indexing then selection. } + assert (i of foo[1] = "a"); + assert (i of foo[2] = "b"); + assert (i of foo[3] = "c"); + assert (i of foo[4] = "d"); + assert (i of foo[5] = "e"); + { Via selection of multiple. } + assert (i of foo = "abcde"); +end diff --git a/gcc/testsuite/algol68/execute/assignation-struct-1.a68 b/gcc/testsuite/algol68/execute/assignation-struct-1.a68 new file mode 100644 index 0000000..a2d661b --- /dev/null +++ b/gcc/testsuite/algol68/execute/assignation-struct-1.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN MODE NODE = STRUCT (INT one, two, three); + NODE top; + top := (10,20,30); + ASSERT (two OF top = 20) +END diff --git a/gcc/testsuite/algol68/execute/assignation-struct-2.a68 b/gcc/testsuite/algol68/execute/assignation-struct-2.a68 new file mode 100644 index 0000000..61734cc --- /dev/null +++ b/gcc/testsuite/algol68/execute/assignation-struct-2.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +# Struct containing a multiple, which must be copied when + the struct value is assigned. # +BEGIN MODE FOO = STRUCT (STRING s, INT i); + FOO f1; + f1 := ("foo", 10); + ASSERT (i OF f1 = 10) +END diff --git a/gcc/testsuite/algol68/execute/atan-1.a68 b/gcc/testsuite/algol68/execute/atan-1.a68 new file mode 100644 index 0000000..bc710c5 --- /dev/null +++ b/gcc/testsuite/algol68/execute/atan-1.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +BEGIN REAL r = 0.0; + LONG REAL rr = LONG 45.0; + LONG LONG REAL rrr = LONG LONG 60.0; + ASSERT (arctan (r) = 0.0); + long arctan (rr); + long long arctan (rrr) +END diff --git a/gcc/testsuite/algol68/execute/balancing-1.a68 b/gcc/testsuite/algol68/execute/balancing-1.a68 new file mode 100644 index 0000000..418b0e4 --- /dev/null +++ b/gcc/testsuite/algol68/execute/balancing-1.a68 @@ -0,0 +1,12 @@ +# { dg-options "-fstropping=upper" } # +BEGIN REAL x, y; + REF REAL xx, yy; + xx := yy := x; + + ASSERT (xx :=: x); + ASSERT (x :=: xx); + ASSERT (xx :/=: yy); + ASSERT (REF REAL (xx) :=: yy); + ASSERT (xx :=: REF REAL (yy)); + ASSERT (REF REAL (xx) :=: REF REAL (yy)) +END diff --git a/gcc/testsuite/algol68/execute/balancing-rows-1.a68 b/gcc/testsuite/algol68/execute/balancing-rows-1.a68 new file mode 100644 index 0000000..1f69d47 --- /dev/null +++ b/gcc/testsuite/algol68/execute/balancing-rows-1.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN ASSERT (UPB IF FALSE THEN []INT (1) ELSE [,]REAL (1) FI = 1); + ASSERT (2 UPB CASE 2 IN []INT (1), [,]REAL (1) ESAC = 1) +END diff --git a/gcc/testsuite/algol68/execute/bin-1.a68 b/gcc/testsuite/algol68/execute/bin-1.a68 new file mode 100644 index 0000000..4fb095f --- /dev/null +++ b/gcc/testsuite/algol68/execute/bin-1.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +# BIN for SIZETY INTs # +BEGIN ASSERT (BIN 255 = 16rff); + ASSERT (BIN LONG 255 = LONG 16rff); + ASSERT (BIN LONG LONG 255 = LONG LONG 16rff) +END diff --git a/gcc/testsuite/algol68/execute/bin-negative-1.a68 b/gcc/testsuite/algol68/execute/bin-negative-1.a68 new file mode 100644 index 0000000..97c2cf0 --- /dev/null +++ b/gcc/testsuite/algol68/execute/bin-negative-1.a68 @@ -0,0 +1,3 @@ +# { dg-options "-fstropping=upper -std=algol68" } # +BEGIN ASSERT (BIN - SHORT SHORT 2 = SHORT SHORT 2r0) +END diff --git a/gcc/testsuite/algol68/execute/bin-negative-gnu-1.a68 b/gcc/testsuite/algol68/execute/bin-negative-gnu-1.a68 new file mode 100644 index 0000000..41d9553 --- /dev/null +++ b/gcc/testsuite/algol68/execute/bin-negative-gnu-1.a68 @@ -0,0 +1,3 @@ +# { dg-options "-fstropping=upper -std=gnu68" } # +BEGIN ASSERT (BIN - SHORT SHORT 2 = SHORT SHORT 2r11111110) +END diff --git a/gcc/testsuite/algol68/execute/boolops-1.a68 b/gcc/testsuite/algol68/execute/boolops-1.a68 new file mode 100644 index 0000000..82600fc --- /dev/null +++ b/gcc/testsuite/algol68/execute/boolops-1.a68 @@ -0,0 +1,18 @@ +# { dg-options "-fstropping=upper" } # +BEGIN BOOL t := TRUE; + BOOL f := FALSE; + ASSERT (NOT t = FALSE); + ASSERT (~t = FALSE); + ASSERT ((t AND t) = TRUE); + ASSERT ((t AND f) = FALSE); + ASSERT ((f AND f) = FALSE); + ASSERT ((f AND t) = FALSE); + ASSERT ((t OR t) = TRUE); + ASSERT ((t OR f) = TRUE); + ASSERT ((f OR f) = FALSE); + ASSERT ((f OR t) = TRUE); + ASSERT ((t XOR t) = FALSE); + ASSERT ((t XOR f) = TRUE); + ASSERT ((f XOR f) = FALSE); + ASSERT ((f XOR t) = TRUE) +END diff --git a/gcc/testsuite/algol68/execute/call-1.a68 b/gcc/testsuite/algol68/execute/call-1.a68 new file mode 100644 index 0000000..f77113d --- /dev/null +++ b/gcc/testsuite/algol68/execute/call-1.a68 @@ -0,0 +1,19 @@ +# { dg-options "-fstropping=upper" } # +# Calling a procedure that gets a row of united values. # +BEGIN INT num ints := 0, num reals := 0, num strings := 0; + PROC foo = ([]UNION(INT,REAL,STRING) d) VOID: + BEGIN FOR i TO UPB d + DO CASE d[i] + IN (STRING): num strings +:= 1, + (INT): num ints +:= 1, + (REAL): num reals +:= 1 + ESAC + OD + END; + foo (()); + foo (10); + ASSERT (num ints = 1 AND num reals = 0 AND num strings = 0); + num ints := 0; + foo (("baz", 1, 3.14, 2, 0.0, "foo")); + ASSERT (num ints = 2 AND num reals = 2 AND num strings = 2) +END diff --git a/gcc/testsuite/algol68/execute/call-2.a68 b/gcc/testsuite/algol68/execute/call-2.a68 new file mode 100644 index 0000000..21a6b25 --- /dev/null +++ b/gcc/testsuite/algol68/execute/call-2.a68 @@ -0,0 +1,21 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT control := 0; + PROC set control = (PROC(INT)VOID p) VOID: p (100); + PROC setter = (INT i) VOID: control := i; + PROC(INT)VOID setter 2 = (INT i) VOID: control := i + 1; + PROC(INT)VOID setter 3 := setter 2; + PROC(INT)VOID setter 4 := (INT i) VOID: control := i + 2; + REF PROC(INT)VOID setter 5 := setter 4; + set control (setter); + ASSERT (control = 100); + set control (setter 2); + ASSERT (control = 101); + control := 0; + set control (setter 3); + ASSERT (control = 101); + set control (setter 4); + ASSERT (control = 102); + control := 0; + set control (setter 5); + ASSERT (control = 102) +END diff --git a/gcc/testsuite/algol68/execute/case-clause-1.a68 b/gcc/testsuite/algol68/execute/case-clause-1.a68 new file mode 100644 index 0000000..71566ed --- /dev/null +++ b/gcc/testsuite/algol68/execute/case-clause-1.a68 @@ -0,0 +1,10 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT j := 1; + ASSERT ((j|10,20,30|40) = 10); + j := 2; + ASSERT ((j|10,20,30|40) = 20); + j := 3; + ASSERT ((j|10,20,30|40) = 30); + j := 100; + ASSERT ((j|10,20,30|40) = 40) +END diff --git a/gcc/testsuite/algol68/execute/case-clause-2.a68 b/gcc/testsuite/algol68/execute/case-clause-2.a68 new file mode 100644 index 0000000..971bdb5 --- /dev/null +++ b/gcc/testsuite/algol68/execute/case-clause-2.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i := 2; + ASSERT (CASE INT x = 10; i + IN x + 1, + x + 2, + x + 3 + ESAC = 12) +END diff --git a/gcc/testsuite/algol68/execute/case-clause-3.a68 b/gcc/testsuite/algol68/execute/case-clause-3.a68 new file mode 100644 index 0000000..3355cef --- /dev/null +++ b/gcc/testsuite/algol68/execute/case-clause-3.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT days, INT month = 2, year = 2024; + days := CASE month + IN 31, (year MOD 4 = 0 AND year MOD 100 /= 0 OR year MOD 400 = 0 | 29 | 28), + 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ESAC; + ASSERT (days = 29) +END diff --git a/gcc/testsuite/algol68/execute/case-clause-4.a68 b/gcc/testsuite/algol68/execute/case-clause-4.a68 new file mode 100644 index 0000000..cd69069 --- /dev/null +++ b/gcc/testsuite/algol68/execute/case-clause-4.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT day = 3; + STRING day name = (day | "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", "SUNDAY"); + ASSERT (day name[1] = "W") +END diff --git a/gcc/testsuite/algol68/execute/closed-clause-1.a68 b/gcc/testsuite/algol68/execute/closed-clause-1.a68 new file mode 100644 index 0000000..d7602e1 --- /dev/null +++ b/gcc/testsuite/algol68/execute/closed-clause-1.a68 @@ -0,0 +1,10 @@ +# { dg-options "-fstropping=upper" } # +BEGIN REAL pie, my small real := 0.001; + PROC my sqrt = (REAL r) REAL: r; + BEGIN REAL w := 0, INT i := 1, REAL z = my sqrt (my small real / 2); + loop: w := w + 2 / (i * (i + 2)); + i := i + 4; + IF 1/i > z THEN GO TO loop FI; + pie := 4 * w + END +END diff --git a/gcc/testsuite/algol68/execute/closed-clause-2.a68 b/gcc/testsuite/algol68/execute/closed-clause-2.a68 new file mode 100644 index 0000000..c6acec8 --- /dev/null +++ b/gcc/testsuite/algol68/execute/closed-clause-2.a68 @@ -0,0 +1,9 @@ +# { dg-options "-fstropping=upper" } # +BEGIN REAL my small real := 0.001; + PROC my sqrt = (REAL r) REAL: r; + REAL res = 4 * (REAL w := 0, INT i := 1; REAL z = my sqrt (my small real / 2); + loop: w := w + 2/(i * (i + 2)); i := i + 4; + IF 1/i > z THEN loop FI; + w); + SKIP +END diff --git a/gcc/testsuite/algol68/execute/collateral-clause-1.a68 b/gcc/testsuite/algol68/execute/collateral-clause-1.a68 new file mode 100644 index 0000000..d467a42 --- /dev/null +++ b/gcc/testsuite/algol68/execute/collateral-clause-1.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i := 10; + (i, i + 1, i + 2) +END diff --git a/gcc/testsuite/algol68/execute/collateral-clause-2.a68 b/gcc/testsuite/algol68/execute/collateral-clause-2.a68 new file mode 100644 index 0000000..8d9aa6e --- /dev/null +++ b/gcc/testsuite/algol68/execute/collateral-clause-2.a68 @@ -0,0 +1,9 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i := 10; + ( + BEGIN + (i + 1, i +:= 1, i + 2) + END + ); + ASSERT (i = 11) +END diff --git a/gcc/testsuite/algol68/execute/collateral-clause-3.a68 b/gcc/testsuite/algol68/execute/collateral-clause-3.a68 new file mode 100644 index 0000000..9af00e7 --- /dev/null +++ b/gcc/testsuite/algol68/execute/collateral-clause-3.a68 @@ -0,0 +1,11 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i := 10; + ( + i +:= 1; + BEGIN + (i + 1, (i +:= 1, i + 10, i + 11, SKIP), i + 2) + END; + i +:= i + ); + ASSERT (i = 24) +END diff --git a/gcc/testsuite/algol68/execute/collateral-clause-4.a68 b/gcc/testsuite/algol68/execute/collateral-clause-4.a68 new file mode 100644 index 0000000..2e64fb1 --- /dev/null +++ b/gcc/testsuite/algol68/execute/collateral-clause-4.a68 @@ -0,0 +1,3 @@ +# { dg-options "-fstropping=upper" } # +BEGIN (SKIP,SKIP) +END diff --git a/gcc/testsuite/algol68/execute/collateral-clause-5.a68 b/gcc/testsuite/algol68/execute/collateral-clause-5.a68 new file mode 100644 index 0000000..c1375a9 --- /dev/null +++ b/gcc/testsuite/algol68/execute/collateral-clause-5.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT x, y, z; + (x := 1, y := 2, z := 3); + ASSERT (x = 1 AND y = 2 AND z = 3) +END diff --git a/gcc/testsuite/algol68/execute/collateral-clause-6.a68 b/gcc/testsuite/algol68/execute/collateral-clause-6.a68 new file mode 100644 index 0000000..57599af --- /dev/null +++ b/gcc/testsuite/algol68/execute/collateral-clause-6.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i; + PROC side = INT: (i := 1; i := 2; i); + PROC add = (INT ii, INT jj) INT: ii + jj; + INT res = add (side, side); + # can be 3 or 4 due to collateral evaluation of arguments. # + ASSERT (res = 3 OR res = 4) +END diff --git a/gcc/testsuite/algol68/execute/completer-1.a68 b/gcc/testsuite/algol68/execute/completer-1.a68 new file mode 100644 index 0000000..e3b488a --- /dev/null +++ b/gcc/testsuite/algol68/execute/completer-1.a68 @@ -0,0 +1,9 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i; + BEGIN (i := 20 EXIT +cont: i := 30 + ); + i +:= 1 + END; + ASSERT (i = 21) +END diff --git a/gcc/testsuite/algol68/execute/completer-10.a68 b/gcc/testsuite/algol68/execute/completer-10.a68 new file mode 100644 index 0000000..18d4f93 --- /dev/null +++ b/gcc/testsuite/algol68/execute/completer-10.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT x := 20; + REF INT xx := x; + REF REF INT xxx; + REF INT i := (x := 10; xxx := xx EXIT foo: xxx EXIT bar: xxx := xx); + ASSERT (i = 10) +END diff --git a/gcc/testsuite/algol68/execute/completer-2.a68 b/gcc/testsuite/algol68/execute/completer-2.a68 new file mode 100644 index 0000000..fac329a --- /dev/null +++ b/gcc/testsuite/algol68/execute/completer-2.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i = (foo; + 10 EXIT +foo: 20 EXIT +bar: 30); + ASSERT (i = 20) +END diff --git a/gcc/testsuite/algol68/execute/completer-3.a68 b/gcc/testsuite/algol68/execute/completer-3.a68 new file mode 100644 index 0000000..6514f2d --- /dev/null +++ b/gcc/testsuite/algol68/execute/completer-3.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i = ((((foo; 10 EXIT foo: 20 EXIT bar: 30)))); + ASSERT (i = 20) +END diff --git a/gcc/testsuite/algol68/execute/completer-4.a68 b/gcc/testsuite/algol68/execute/completer-4.a68 new file mode 100644 index 0000000..1291e73 --- /dev/null +++ b/gcc/testsuite/algol68/execute/completer-4.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i := (foo; 10 EXIT foo: 20 EXIT bar: 30); + ASSERT (i = 20) +END diff --git a/gcc/testsuite/algol68/execute/completer-5.a68 b/gcc/testsuite/algol68/execute/completer-5.a68 new file mode 100644 index 0000000..f6bc6f4 --- /dev/null +++ b/gcc/testsuite/algol68/execute/completer-5.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT x; + REF INT i := (foo; x := 10 EXIT foo: x := 20 EXIT bar: x := 30); + ASSERT (i = 20) +END diff --git a/gcc/testsuite/algol68/execute/completer-6.a68 b/gcc/testsuite/algol68/execute/completer-6.a68 new file mode 100644 index 0000000..aaf512f --- /dev/null +++ b/gcc/testsuite/algol68/execute/completer-6.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT x := 20; + REF INT i := (foo; x := 10 EXIT foo: x EXIT bar: x := 30); + ASSERT (i = 20) +END diff --git a/gcc/testsuite/algol68/execute/completer-7.a68 b/gcc/testsuite/algol68/execute/completer-7.a68 new file mode 100644 index 0000000..9ef0e27 --- /dev/null +++ b/gcc/testsuite/algol68/execute/completer-7.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT x := 20; + REF INT i := (x := 10 EXIT foo: x EXIT bar: x := 30); + ASSERT (i = 10) +END diff --git a/gcc/testsuite/algol68/execute/completer-8.a68 b/gcc/testsuite/algol68/execute/completer-8.a68 new file mode 100644 index 0000000..b73fd13 --- /dev/null +++ b/gcc/testsuite/algol68/execute/completer-8.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT x := 20; + REF INT i := (x EXIT foo: x EXIT bar: x := 30); + ASSERT (i = 20) +END diff --git a/gcc/testsuite/algol68/execute/completer-9.a68 b/gcc/testsuite/algol68/execute/completer-9.a68 new file mode 100644 index 0000000..b84f010 --- /dev/null +++ b/gcc/testsuite/algol68/execute/completer-9.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT x := 20; + REF INT xx := x; + REF INT i := (xx EXIT foo: xx EXIT bar: xx := x); + ASSERT (i = 20) +END diff --git a/gcc/testsuite/algol68/execute/cond-clause-1.a68 b/gcc/testsuite/algol68/execute/cond-clause-1.a68 new file mode 100644 index 0000000..059bb8a --- /dev/null +++ b/gcc/testsuite/algol68/execute/cond-clause-1.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i := 10, x; + IF i > 5 THEN x := i FI; + ASSERT (x = i) +END diff --git a/gcc/testsuite/algol68/execute/cond-clause-2.a68 b/gcc/testsuite/algol68/execute/cond-clause-2.a68 new file mode 100644 index 0000000..f8e5d5f --- /dev/null +++ b/gcc/testsuite/algol68/execute/cond-clause-2.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i := 10, x; + IF i < 5 THEN x = i FI; + ASSERT (x /= i) +END diff --git a/gcc/testsuite/algol68/execute/cond-clause-3.a68 b/gcc/testsuite/algol68/execute/cond-clause-3.a68 new file mode 100644 index 0000000..4e9c685 --- /dev/null +++ b/gcc/testsuite/algol68/execute/cond-clause-3.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i := 5; + IF i = 5 + THEN 0 + ELSE ASSERT (FALSE); 1 + FI +END diff --git a/gcc/testsuite/algol68/execute/cond-clause-4.a68 b/gcc/testsuite/algol68/execute/cond-clause-4.a68 new file mode 100644 index 0000000..0e65041 --- /dev/null +++ b/gcc/testsuite/algol68/execute/cond-clause-4.a68 @@ -0,0 +1,3 @@ +# { dg-options "-fstropping=upper" } # +# Declarations in enquiry clause. # +(INT i; i := 3 ; i := 2; i /= i | ASSERT (FALSE); 1 | 0) diff --git a/gcc/testsuite/algol68/execute/cond-clause-5.a68 b/gcc/testsuite/algol68/execute/cond-clause-5.a68 new file mode 100644 index 0000000..2164c75 --- /dev/null +++ b/gcc/testsuite/algol68/execute/cond-clause-5.a68 @@ -0,0 +1,3 @@ +# { dg-options "-fstropping=upper" } # +# Closed clauses in enquiry clause. # +((INT i; (i := 3 ; i := 2); ((i /= i))) | ASSERT (FALSE); 1 | 0) diff --git a/gcc/testsuite/algol68/execute/cond-clause-6.a68 b/gcc/testsuite/algol68/execute/cond-clause-6.a68 new file mode 100644 index 0000000..39b4bda --- /dev/null +++ b/gcc/testsuite/algol68/execute/cond-clause-6.a68 @@ -0,0 +1,23 @@ +# { dg-options "-fstropping=upper" } # +# Nested conditional clauses # +BEGIN + INT i = 10; + IF i > 5 THEN + IF i < 15 THEN + IF i > 11 THEN + ASSERT (FALSE); + 1 + ELSE + 0 + FI + FI + ELSE + IF i > 100 THEN + ASSERT (FALSE); + 1 + ELSE + ASSERT (FALSE); + 1 + FI + FI +END diff --git a/gcc/testsuite/algol68/execute/cond-clause-7.a68 b/gcc/testsuite/algol68/execute/cond-clause-7.a68 new file mode 100644 index 0000000..3a5af2b --- /dev/null +++ b/gcc/testsuite/algol68/execute/cond-clause-7.a68 @@ -0,0 +1,23 @@ +# { dg-options "-fstropping=upper" } # +# Nested conditional clauses # +BEGIN + INT i = 12; + IF i > 5 THEN + IF i < 15 THEN + IF i > 11 THEN + 0 + ELSE + ASSERT (FALSE); + 1 + FI + FI + ELSE + IF i > 100 THEN + ASSERT (FALSE); + 1 + ELSE + ASSERT (FALSE); + 1 + FI + FI +END diff --git a/gcc/testsuite/algol68/execute/cond-clause-8.a68 b/gcc/testsuite/algol68/execute/cond-clause-8.a68 new file mode 100644 index 0000000..0b3ca04 --- /dev/null +++ b/gcc/testsuite/algol68/execute/cond-clause-8.a68 @@ -0,0 +1,20 @@ +# { dg-options "-fstropping=upper" } # +# ELIF # +BEGIN + INT i = 12; + IF i > 20 THEN + 1 + ELIF i > 5 THEN + BEGIN + IF FALSE THEN + ASSERT (FALSE); + 1 + ELSE + 0 + FI + END + ELIF i < 10 THEN + ASSERT (FALSE); + 1 + FI +END diff --git a/gcc/testsuite/algol68/execute/cond-clause-9.a68 b/gcc/testsuite/algol68/execute/cond-clause-9.a68 new file mode 100644 index 0000000..d0f70e8 --- /dev/null +++ b/gcc/testsuite/algol68/execute/cond-clause-9.a68 @@ -0,0 +1,23 @@ +# { dg-options "-fstropping=upper" } # +# ELIF with ELSE # +BEGIN + INT i = 12; + IF i > 20 THEN + 1 + ELIF i > 12 THEN + BEGIN + IF FALSE THEN + ASSERT (FALSE); + 1 + ELSE + ASSERT (FALSE); + 1 + FI + END + ELIF i < 10 THEN + ASSERT (FALSE); + 1 + ELSE + 0 + FI +END diff --git a/gcc/testsuite/algol68/execute/conformity-clause-1.a68 b/gcc/testsuite/algol68/execute/conformity-clause-1.a68 new file mode 100644 index 0000000..d34b7cf --- /dev/null +++ b/gcc/testsuite/algol68/execute/conformity-clause-1.a68 @@ -0,0 +1,10 @@ +# { dg-options "-fstropping=upper" } # +BEGIN MODE DATUM = UNION(INT,REAL,CHAR); + DATUM datum := 10; + INT i = CASE datum + IN (REAL): 2, + (INT i): i + 1, + (CHAR): 3 + ESAC; + ASSERT (i = 11) +END diff --git a/gcc/testsuite/algol68/execute/conformity-clause-2.a68 b/gcc/testsuite/algol68/execute/conformity-clause-2.a68 new file mode 100644 index 0000000..bfa28bb --- /dev/null +++ b/gcc/testsuite/algol68/execute/conformity-clause-2.a68 @@ -0,0 +1,11 @@ +# { dg-options "-fstropping=upper" } # +BEGIN MODE DATUM = UNION(INT,REAL,CHAR); + DATUM datum := "X"; + INT i = CASE datum + IN (REAL): 2, + (INT val): val + 1 + OUT INT x = 100; + x + 10 + ESAC; + ASSERT (i = 110) +END diff --git a/gcc/testsuite/algol68/execute/conformity-clause-3.a68 b/gcc/testsuite/algol68/execute/conformity-clause-3.a68 new file mode 100644 index 0000000..d0703de --- /dev/null +++ b/gcc/testsuite/algol68/execute/conformity-clause-3.a68 @@ -0,0 +1,11 @@ +# { dg-options "-fstropping=upper" } # +BEGIN MODE DATUM = UNION(INT,REAL,CHAR); + DATUM datum := 20; + INT i = CASE INT i = 10; datum + IN (REAL): 2, + (INT val): val + i + OUT INT x = 100; + x + 10 + ESAC; + ASSERT (i = 30) +END diff --git a/gcc/testsuite/algol68/execute/conformity-clause-4.a68 b/gcc/testsuite/algol68/execute/conformity-clause-4.a68 new file mode 100644 index 0000000..2cac20d --- /dev/null +++ b/gcc/testsuite/algol68/execute/conformity-clause-4.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN []UNION(INT,STRING,REAL) datum = (10, 3.14, "foo", 200); + ASSERT (CASE datum[1] IN (INT): 100 ESAC = 100); + ASSERT (CASE datum[2] IN (REAL): 200 ESAC = 200); + ASSERT (CASE datum[3] IN (STRING): 300 ESAC = 300); + ASSERT (CASE datum[4] IN (INT): 400 ESAC = 400) +END diff --git a/gcc/testsuite/algol68/execute/conformity-clause-5.a68 b/gcc/testsuite/algol68/execute/conformity-clause-5.a68 new file mode 100644 index 0000000..eb6f41e --- /dev/null +++ b/gcc/testsuite/algol68/execute/conformity-clause-5.a68 @@ -0,0 +1,14 @@ +# { dg-options "-fstropping=upper" } # +BEGIN UNION(CHAR,BOOL,INT,REAL) cbira := "X"; + IF CASE cbira + IN (BOOL b): b, + (INT i): i > 0, + (REAL r): r > 0 + OUT FALSE + ESAC + THEN # We get here if cbira was not a CHAR and was otherwise + TRUE or >0, as the case may be. + # + ASSERT (FALSE) + FI +END diff --git a/gcc/testsuite/algol68/execute/conformity-clause-6.a68 b/gcc/testsuite/algol68/execute/conformity-clause-6.a68 new file mode 100644 index 0000000..b3d3d6c --- /dev/null +++ b/gcc/testsuite/algol68/execute/conformity-clause-6.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +BEGIN UNION (CHAR,BOOL,REAL) cbra = 3.14, UNION (INT,REAL) ira = 10; + IF (cbra | (CHAR): FALSE, (BOOL b): b + |: ira | (INT i): i > 0, (REAL r): r > 0) + THEN SKIP + ELSE ASSERT (FALSE) + FI +END diff --git a/gcc/testsuite/algol68/execute/conformity-clause-7.a68 b/gcc/testsuite/algol68/execute/conformity-clause-7.a68 new file mode 100644 index 0000000..18122a3 --- /dev/null +++ b/gcc/testsuite/algol68/execute/conformity-clause-7.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN UNION (CHAR,BOOL,REAL) cbra = 3.14, UNION (INT,REAL) ira = -10; + IF (cbra | (CHAR): FALSE, (BOOL b): b + |: ira | (INT i): i > 0, (REAL r): r > 0) + THEN ASSERT (FALSE) + FI +END diff --git a/gcc/testsuite/algol68/execute/conformity-clause-8.a68 b/gcc/testsuite/algol68/execute/conformity-clause-8.a68 new file mode 100644 index 0000000..2da55f9 --- /dev/null +++ b/gcc/testsuite/algol68/execute/conformity-clause-8.a68 @@ -0,0 +1,11 @@ +# { dg-options "-fstropping=upper" } # +BEGIN MODE JORL = STRUCT (UNION(INT,REAL) i, REF JORL next); + REF JORL p := HEAP JORL := (10, HEAP JORL := (20.0, NIL)); + p := HEAP JORL := (30, p); + INT num ints := 0, num reals := 0; + WHILE REF JORL (p) ISNT NIL + DO CASE i OF p IN (INT): num ints +:= 1, (REAL): num reals +:= 1 ESAC; + p := next OF p + OD; + ASSERT (num ints = 2 AND num reals = 1) +END diff --git a/gcc/testsuite/algol68/execute/conformity-clause-9.a68 b/gcc/testsuite/algol68/execute/conformity-clause-9.a68 new file mode 100644 index 0000000..55f1fc3 --- /dev/null +++ b/gcc/testsuite/algol68/execute/conformity-clause-9.a68 @@ -0,0 +1,10 @@ +begin union (int, bool, string) foo = 666; + case foo + in (union(int,string) bar): + case bar + in (int i): assert (i = 666), + (string s): assert (false) + esac, + (bool baz): assert (false) + esac +end diff --git a/gcc/testsuite/algol68/execute/conj-1.a68 b/gcc/testsuite/algol68/execute/conj-1.a68 new file mode 100644 index 0000000..1954d38 --- /dev/null +++ b/gcc/testsuite/algol68/execute/conj-1.a68 @@ -0,0 +1,9 @@ +# { dg-options "-fstropping=upper" } # +BEGIN COMPL z = 4.0I5.0; + CONJ z; + LONG COMPL zz = LONG 4.0 I LONG 6.0; + CONJ zz; + LONG LONG COMPL zzz = LONG LONG 4.0 I LONG LONG 7.0; + CONJ zzz; + SKIP +END diff --git a/gcc/testsuite/algol68/execute/cos-1.a68 b/gcc/testsuite/algol68/execute/cos-1.a68 new file mode 100644 index 0000000..e6b0f692 --- /dev/null +++ b/gcc/testsuite/algol68/execute/cos-1.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +BEGIN REAL r = 0.0; + LONG REAL rr = LONG 45.0; + LONG LONG REAL rrr = LONG LONG 60.0; + ASSERT (cos (r) = 1.0); + long cos (rr); + long long cos (rrr) +END diff --git a/gcc/testsuite/algol68/execute/declarer-1.a68 b/gcc/testsuite/algol68/execute/declarer-1.a68 new file mode 100644 index 0000000..61af081 --- /dev/null +++ b/gcc/testsuite/algol68/execute/declarer-1.a68 @@ -0,0 +1,9 @@ +# { dg-options "-fstropping=upper" } # +# Tests a jump out of the elaboration of a declarer. # +BEGIN STRING month = CASE 13 + IN "Jan", "Feb","March","April","May","June", + "July","Aug","Sept", "Oct", "Nov","Dec", + stop + ESAC; + ASSERT (FALSE) +END diff --git a/gcc/testsuite/algol68/execute/declarer-2.a68 b/gcc/testsuite/algol68/execute/declarer-2.a68 new file mode 100644 index 0000000..b474e3e --- /dev/null +++ b/gcc/testsuite/algol68/execute/declarer-2.a68 @@ -0,0 +1,6 @@ +begin int n := 1; + { The actual-declarer below should be + elaborated only once. } + [1: n +:= 1]real a, b; + assert (n = 2) +end diff --git a/gcc/testsuite/algol68/execute/deprocedure-1.a68 b/gcc/testsuite/algol68/execute/deprocedure-1.a68 new file mode 100644 index 0000000..17834f4 --- /dev/null +++ b/gcc/testsuite/algol68/execute/deprocedure-1.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT x = 100; + PROC foo = INT: (INT i = 10, j = 20; PROC bar = INT: 100; i + j + bar); + ASSERT (foo = 130) +END diff --git a/gcc/testsuite/algol68/execute/deprocedure-2.a68 b/gcc/testsuite/algol68/execute/deprocedure-2.a68 new file mode 100644 index 0000000..1f501cf --- /dev/null +++ b/gcc/testsuite/algol68/execute/deprocedure-2.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +# Procedure variables. # +BEGIN INT x = 100; + PROC foo := INT: (INT i = 10, j = 20; PROC bar := INT: 100; i + j + bar); + ASSERT (foo = 130) +END diff --git a/gcc/testsuite/algol68/execute/deref-1.a68 b/gcc/testsuite/algol68/execute/deref-1.a68 new file mode 100644 index 0000000..5bb4d5d --- /dev/null +++ b/gcc/testsuite/algol68/execute/deref-1.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT x := 10; + INT res := (REF INT xx := x; xx); + ASSERT (res = 10) +END diff --git a/gcc/testsuite/algol68/execute/deref-2.a68 b/gcc/testsuite/algol68/execute/deref-2.a68 new file mode 100644 index 0000000..d49dc4a --- /dev/null +++ b/gcc/testsuite/algol68/execute/deref-2.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT x := 10; + REF INT xx := x; + x := 20; + ASSERT (xx = 20) +END diff --git a/gcc/testsuite/algol68/execute/deref-3.a68 b/gcc/testsuite/algol68/execute/deref-3.a68 new file mode 100644 index 0000000..8c077e0 --- /dev/null +++ b/gcc/testsuite/algol68/execute/deref-3.a68 @@ -0,0 +1,11 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT x := 10; + INT y := 20; + REF INT xx := x; + CO This makes xx to refer to y + REF REF INT := REF INT + CO + xx := y; + y := 30; + ASSERT (xx = 30) +END diff --git a/gcc/testsuite/algol68/execute/deref-4.a68 b/gcc/testsuite/algol68/execute/deref-4.a68 new file mode 100644 index 0000000..59639fd --- /dev/null +++ b/gcc/testsuite/algol68/execute/deref-4.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT x := 10; + INT y := 20; + REF INT xx := x; + # This sets x to the current value of y # + REF INT (xx) := y; + ASSERT (x = 20) +END diff --git a/gcc/testsuite/algol68/execute/deref-5.a68 b/gcc/testsuite/algol68/execute/deref-5.a68 new file mode 100644 index 0000000..804947f --- /dev/null +++ b/gcc/testsuite/algol68/execute/deref-5.a68 @@ -0,0 +1,42 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT x := 10; + REF INT xx := x; + REF REF INT xxx := xx; + ASSERT (x = 10); + ASSERT (xx = 10); + ASSERT (xxx = 10); + ASSERT ((x) = 10); + ASSERT ((xx) = 10); + ASSERT ((xxx) = 10); + ASSERT (x + 1 = 11); + ASSERT (xx + 1 = 11); + ASSERT (xxx + 1 = 11); + ASSERT ((x + 1) = 11); + ASSERT ((xx + 1) = 11); + ASSERT ((xxx + 1) = 11); + ASSERT ((x := x) = 10); + ASSERT ((xx := x) = 10); + ASSERT ((xxx := xx) = 10); + ASSERT ((x := x) + 1 = 11); + ASSERT ((xx := x) + 1 = 11); + ASSERT ((xxx := xx) + 1 = 11); + x := 20; + ASSERT (x = 20); + ASSERT (xx = 20); + ASSERT (xxx = 20); + ASSERT ((x) = 20); + ASSERT ((xx) = 20); + ASSERT ((xxx) = 20); + ASSERT (x + 1 = 21); + ASSERT (xx + 1 = 21); + ASSERT (xxx + 1 = 21); + ASSERT ((x + 1) = 21); + ASSERT ((xx + 1) = 21); + ASSERT ((xxx + 1) = 21); + ASSERT ((x := x) = 20); + ASSERT ((xx := x) = 20); + ASSERT ((xxx := xx) = 20); + ASSERT ((x := x) + 1 = 21); + ASSERT ((xx := x) + 1 = 21); + ASSERT ((xxx := xx) + 1 = 21) +END diff --git a/gcc/testsuite/algol68/execute/deref-6.a68 b/gcc/testsuite/algol68/execute/deref-6.a68 new file mode 100644 index 0000000..88754d2 --- /dev/null +++ b/gcc/testsuite/algol68/execute/deref-6.a68 @@ -0,0 +1,48 @@ +# { dg-options "-fstropping=upper" } # +# Dereferencing of struct fields. # +BEGIN MODE S = STRUCT (REF INT x, REF REF INT xx, REF REF REF INT xxx); + + INT x := 10; + REF INT xx := x; + REF REF INT xxx := xx; + + S s = (x, xx, xxx); + + ASSERT (x OF s = 10); + ASSERT (xx OF s = 10); + ASSERT (xxx OF s = 10); + ASSERT ((x) = 10); + ASSERT ((xx) = 10); + ASSERT ((xxx) = 10); + ASSERT (x OF s + 1 = 11); + ASSERT (xx OF s + 1 = 11); + ASSERT (xxx OF s + 1 = 11); + ASSERT ((x OF s + 1) = 11); + ASSERT ((xx OF s + 1) = 11); + ASSERT ((xxx OF s + 1) = 11); + ASSERT ((x OF s := x) = 10); + ASSERT ((xx OF s := x) = 10); + ASSERT ((xxx OF s := xx) = 10); + ASSERT ((x OF s := x) + 1 = 11); + ASSERT ((xx OF s := x) + 1 = 11); + ASSERT ((xxx OF s := xx) + 1 = 11); + x OF s := 20; + ASSERT (x OF s = 20); + ASSERT (xx OF s = 20); + ASSERT (xxx OF s = 20); + ASSERT ((x) = 20); + ASSERT ((xx) = 20); + ASSERT ((xxx) = 20); + ASSERT (x OF s + 1 = 21); + ASSERT (xx OF s + 1 = 21); + ASSERT (xxx OF s + 1 = 21); + ASSERT ((x OF s + 1) = 21); + ASSERT ((xx OF s + 1) = 21); + ASSERT ((xxx OF s + 1) = 21); + ASSERT ((x OF s := x) = 20); + ASSERT ((xx OF s := x) = 20); + ASSERT ((xxx OF s := xx) = 20); + ASSERT ((x OF s := x) + 1 = 21); + ASSERT ((xx OF s := x) + 1 = 21); + ASSERT ((xxx OF s := xx) + 1 = 21) +END diff --git a/gcc/testsuite/algol68/execute/deref-7.a68 b/gcc/testsuite/algol68/execute/deref-7.a68 new file mode 100644 index 0000000..b2acec9 --- /dev/null +++ b/gcc/testsuite/algol68/execute/deref-7.a68 @@ -0,0 +1,48 @@ +# { dg-options "-fstropping=upper" } # +# Dereferencing of struct fields. Version with sub-names. # +BEGIN MODE S = STRUCT (INT x, REF INT xx, REF REF INT xxx); + + INT x := 10; + REF INT xx := x; + REF REF INT xxx := xx; + + S s := (x, xx, xxx); + + ASSERT (x OF s = 10); + ASSERT (xx OF s = 10); + ASSERT (xxx OF s = 10); + ASSERT ((x) = 10); + ASSERT ((xx) = 10); + ASSERT ((xxx) = 10); + ASSERT (x OF s + 1 = 11); + ASSERT (xx OF s + 1 = 11); + ASSERT (xxx OF s + 1 = 11); + ASSERT ((x OF s + 1) = 11); + ASSERT ((xx OF s + 1) = 11); + ASSERT ((xxx OF s + 1) = 11); + ASSERT ((x OF s := x) = 10); + ASSERT ((xx OF s := xx) = 10); + ASSERT ((xxx OF s := xxx) = 10); + ASSERT ((x OF s := x) + 1 = 11); + ASSERT ((xx OF s := xx) + 1 = 11); + ASSERT ((xxx OF s := xxx) + 1 = 11); + x := 20; + ASSERT (x OF s = 10); + ASSERT (xx OF s = 20); + ASSERT (xxx OF s = 20); + ASSERT ((x) = 20); + ASSERT ((xx) = 20); + ASSERT ((xxx) = 20); + ASSERT (x OF s + 1 = 11); + ASSERT (xx OF s + 1 = 21); + ASSERT (xxx OF s + 1 = 21); + ASSERT ((x OF s + 1) = 11); + ASSERT ((xx OF s + 1) = 21); + ASSERT ((xxx OF s + 1) = 21); + ASSERT ((x OF s := x) = 20); + ASSERT ((xx OF s := xx) = 20); + ASSERT ((xxx OF s := xxx) = 20); + ASSERT ((x OF s := x) + 1 = 21); + ASSERT ((xx OF s := xx) + 1 = 21); + ASSERT ((xxx OF s := xxx) + 1 = 21) +END diff --git a/gcc/testsuite/algol68/execute/deref-8.a68 b/gcc/testsuite/algol68/execute/deref-8.a68 new file mode 100644 index 0000000..6d57086 --- /dev/null +++ b/gcc/testsuite/algol68/execute/deref-8.a68 @@ -0,0 +1,53 @@ +# { dg-options "-fstropping=upper" } # +# Dereferencing of struct fields. Version with sub-names and + explicit assignations instead of initialization in variable declaration. # +BEGIN MODE S = STRUCT (INT x, REF INT xx, REF REF INT xxx); + + INT x := 10; + REF INT xx := x; + REF REF INT xxx := xx; + + S s; + + x OF s := x; + xx OF s := xx; + xxx OF s := xxx; + + ASSERT (x OF s = 10); + ASSERT (xx OF s = 10); + ASSERT (xxx OF s = 10); + ASSERT ((x) = 10); + ASSERT ((xx) = 10); + ASSERT ((xxx) = 10); + ASSERT (x OF s + 1 = 11); + ASSERT (xx OF s + 1 = 11); + ASSERT (xxx OF s + 1 = 11); + ASSERT ((x OF s + 1) = 11); + ASSERT ((xx OF s + 1) = 11); + ASSERT ((xxx OF s + 1) = 11); + ASSERT ((x OF s := x) = 10); + ASSERT ((xx OF s := xx) = 10); + ASSERT ((xxx OF s := xxx) = 10); + ASSERT ((x OF s := x) + 1 = 11); + ASSERT ((xx OF s := xx) + 1 = 11); + ASSERT ((xxx OF s := xxx) + 1 = 11); + x := 20; + ASSERT (x OF s = 10); + ASSERT (xx OF s = 20); + ASSERT (xxx OF s = 20); + ASSERT ((x) = 20); + ASSERT ((xx) = 20); + ASSERT ((xxx) = 20); + ASSERT (x OF s + 1 = 11); + ASSERT (xx OF s + 1 = 21); + ASSERT (xxx OF s + 1 = 21); + ASSERT ((x OF s + 1) = 11); + ASSERT ((xx OF s + 1) = 21); + ASSERT ((xxx OF s + 1) = 21); + ASSERT ((x OF s := x) = 20); + ASSERT ((xx OF s := xx) = 20); + ASSERT ((xxx OF s := xxx) = 20); + ASSERT ((x OF s := x) + 1 = 21); + ASSERT ((xx OF s := xx) + 1 = 21); + ASSERT ((xxx OF s := xxx) + 1 = 21) +END diff --git a/gcc/testsuite/algol68/execute/div-int-1.a68 b/gcc/testsuite/algol68/execute/div-int-1.a68 new file mode 100644 index 0000000..6a26a7b --- /dev/null +++ b/gcc/testsuite/algol68/execute/div-int-1.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i = 10; + LONG INT ii = LONG 10, LONG LONG INT iii = LONG LONG 10; + ASSERT (i / 2 = 5.0); + ASSERT (ii / LONG 2 = LONG 5.0); + ASSERT (iii / LONG LONG 2 = LONG LONG 5.0) +END diff --git a/gcc/testsuite/algol68/execute/divab-real-1.a68 b/gcc/testsuite/algol68/execute/divab-real-1.a68 new file mode 100644 index 0000000..830ae2e --- /dev/null +++ b/gcc/testsuite/algol68/execute/divab-real-1.a68 @@ -0,0 +1,11 @@ +# { dg-options "-fstropping=upper" } # +BEGIN REAL r := 3.14; + r DIVAB 2.0; + r /:= 2.0; + LONG REAL rr := LONG 3.14; + rr DIVAB LONG 2.0; + rr /:= LONG 2.0; + LONG LONG REAL rrr := LONG LONG 3.14; + rrr DIVAB LONG LONG 2.0; + rrr /:= LONG LONG 2.0 +END diff --git a/gcc/testsuite/algol68/execute/elem-bits-1.a68 b/gcc/testsuite/algol68/execute/elem-bits-1.a68 new file mode 100644 index 0000000..1529b59 --- /dev/null +++ b/gcc/testsuite/algol68/execute/elem-bits-1.a68 @@ -0,0 +1,18 @@ +# { dg-options "-fstropping=upper" } # +# ELEM for SIZETY BITS # +BEGIN BITS b = 2r1010; + ASSERT ((bits width - 1) ELEM b); + ASSERT (NOT ((bits width - 2) ELEM b)); + LONG BITS bb = LONG 2r1010; + ASSERT ((long bits width - 1) ELEM bb); + ASSERT (NOT ((long bits width - 2) ELEM bb)); + LONG LONG BITS bbb = LONG LONG 2r1010; + ASSERT ((long long bits width - 1) ELEM bbb); + ASSERT (NOT ((long long bits width - 2) ELEM bbb)); + SHORT BITS ss = SHORT 2r1010; + ASSERT ((short bits width - 1) ELEM ss); + ASSERT (NOT ((short bits width - 2) ELEM ss)); + SHORT SHORT BITS sss = SHORT SHORT 2r1010; + ASSERT ((short short bits width - 1) ELEM sss); + ASSERT (NOT ((short short bits width - 2) ELEM sss)) +END diff --git a/gcc/testsuite/algol68/execute/elems-1.a68 b/gcc/testsuite/algol68/execute/elems-1.a68 new file mode 100644 index 0000000..da538fc --- /dev/null +++ b/gcc/testsuite/algol68/execute/elems-1.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN ASSERT (ELEMS "foo" = 3); + ASSERT (ELEMS "" = 0); + ASSERT (1 ELEMS "foo" = 3); + ASSERT (1 ELEMS "" = 0) +END diff --git a/gcc/testsuite/algol68/execute/elems-2.a68 b/gcc/testsuite/algol68/execute/elems-2.a68 new file mode 100644 index 0000000..0545f4e --- /dev/null +++ b/gcc/testsuite/algol68/execute/elems-2.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +# Flat and ultra-flat multiples. # +BEGIN [3,10:3]INT arr; + ASSERT (2 ELEMS arr = 0); + [1:0]INT arr2; + ASSERT (ELEMS arr2 = 0) +END diff --git a/gcc/testsuite/algol68/execute/entier-1.a68 b/gcc/testsuite/algol68/execute/entier-1.a68 new file mode 100644 index 0000000..d7c84e2 --- /dev/null +++ b/gcc/testsuite/algol68/execute/entier-1.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +BEGIN REAL x = 3.14, y = 3.80; + LONG REAL xx = LONG 3.14, yy = LONG 3.80; + LONG LONG REAL xxx = LONG LONG 3.14, yyy = LONG LONG 3.80; + ASSERT (ENTIER x = 3 AND ENTIER y = 3); + ASSERT (ENTIER xx = LONG 3 AND ENTIER yy = LONG 3); + ASSERT (ENTIER xxx = LONG LONG 3 AND ENTIER yyy = LONG LONG 3) +END diff --git a/gcc/testsuite/algol68/execute/environment-enquiries-1.a68 b/gcc/testsuite/algol68/execute/environment-enquiries-1.a68 new file mode 100644 index 0000000..1601ac0 --- /dev/null +++ b/gcc/testsuite/algol68/execute/environment-enquiries-1.a68 @@ -0,0 +1,10 @@ +# { dg-options "-fstropping=upper" } # +# Environment enquiries for SIZETY INTs # +BEGIN ASSERT (max int /= 0); + (INT max int = 10; ASSERT (max int = 10)); + ASSERT (long max int >= LENG max int); + ASSERT (long long max int >= LENG long max int); + ASSERT (min int /= 0); + ASSERT (long min int <= LENG min int); + ASSERT (long long min int <= LENG long min int) +END diff --git a/gcc/testsuite/algol68/execute/environment-enquiries-2.a68 b/gcc/testsuite/algol68/execute/environment-enquiries-2.a68 new file mode 100644 index 0000000..9f9d5fc --- /dev/null +++ b/gcc/testsuite/algol68/execute/environment-enquiries-2.a68 @@ -0,0 +1,12 @@ +# { dg-options "-fstropping=upper" } # +# Environment enquiries for SIZETY REALs # +BEGIN ASSERT (max real /= 0.0); + ASSERT (long max real >= LENG max real); + ASSERT (long long max real >= LENG long max real); + ASSERT (min real /= 0.0); + ASSERT (long min real <= LENG min real); + ASSERT (long long min real <= LENG long min real); + ASSERT (small real > 0.0); + ASSERT (long small real > LONG 0.0); + ASSERT (long long small real > LONG LONG 0.0) +END diff --git a/gcc/testsuite/algol68/execute/environment-enquiries-3.a68 b/gcc/testsuite/algol68/execute/environment-enquiries-3.a68 new file mode 100644 index 0000000..7aba4cd --- /dev/null +++ b/gcc/testsuite/algol68/execute/environment-enquiries-3.a68 @@ -0,0 +1,9 @@ +# { dg-options "-fstropping=upper" } # +# Environment enquiries for SIZETY BITS # +BEGIN ASSERT (bits width > 0); + ASSERT (long bits width >= bits width); + ASSERT (long long bits width >= long bits width); + ASSERT (short bits width <= bits width); + ASSERT (short short bits width <= short bits width) +END + diff --git a/gcc/testsuite/algol68/execute/environment-enquiries-4.a68 b/gcc/testsuite/algol68/execute/environment-enquiries-4.a68 new file mode 100644 index 0000000..b053ed1 --- /dev/null +++ b/gcc/testsuite/algol68/execute/environment-enquiries-4.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +# Environment enquiries for pi constants. # +BEGIN ASSERT (pi > 3.0 AND pi < 4.0); + ASSERT (long pi > LONG 3.0 AND long pi < LONG 4.0); + ASSERT (long long pi > LONG LONG 3.0 AND long long pi < LONG LONG 4.0) +END + diff --git a/gcc/testsuite/algol68/execute/environment-enquiries-5.a68 b/gcc/testsuite/algol68/execute/environment-enquiries-5.a68 new file mode 100644 index 0000000..a468798 --- /dev/null +++ b/gcc/testsuite/algol68/execute/environment-enquiries-5.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +# Environment enquiries for certain particular characters. # +BEGIN ASSERT (null character /= blank); + ASSERT (max abs char = ABS 16r10ffff) +END diff --git a/gcc/testsuite/algol68/execute/environment-enquiries-6.a68 b/gcc/testsuite/algol68/execute/environment-enquiries-6.a68 new file mode 100644 index 0000000..a37dd4c --- /dev/null +++ b/gcc/testsuite/algol68/execute/environment-enquiries-6.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +# Environment enquiries for SIZETY BITs # +BEGIN ASSERT (max bits /= 10r0); + # XXX use LENG max bits below # + ASSERT (long max bits >= LONG 10r0); + ASSERT (long long max bits >= LONG LONG 10r0) +END diff --git a/gcc/testsuite/algol68/execute/environment-enquiries-7.a68 b/gcc/testsuite/algol68/execute/environment-enquiries-7.a68 new file mode 100644 index 0000000..d64a68f --- /dev/null +++ b/gcc/testsuite/algol68/execute/environment-enquiries-7.a68 @@ -0,0 +1,15 @@ +# { dg-options "-fstropping=upper" } # +# Environment enquiries for widths # +BEGIN ASSERT (int width > 0); + ASSERT (long int width > 0); + ASSERT (long long int width > 0); + ASSERT (short int width > 0); + ASSERT (short short int width > 0); + ASSERT (real width > 0); + ASSERT (long real width > 0); + ASSERT (long long real width > 0) +CO exp width; + long exp width; + long long exp width; +CO +END diff --git a/gcc/testsuite/algol68/execute/environment-enquiries-8.a68 b/gcc/testsuite/algol68/execute/environment-enquiries-8.a68 new file mode 100644 index 0000000..8c2c904 --- /dev/null +++ b/gcc/testsuite/algol68/execute/environment-enquiries-8.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN ASSERT (flip = "T"); + ASSERT (flop = "F"); + ASSERT (error char = "*"); + ASSERT (ABS replacement char = ABS 16rfffd) +END diff --git a/gcc/testsuite/algol68/execute/eq-bits-1.a68 b/gcc/testsuite/algol68/execute/eq-bits-1.a68 new file mode 100644 index 0000000..b26df33 --- /dev/null +++ b/gcc/testsuite/algol68/execute/eq-bits-1.a68 @@ -0,0 +1,10 @@ +# { dg-options "-fstropping=upper" } # +BEGIN BITS b, LONG BITS bb = LONG 16rff, LONG LONG BITS bbb; + SHORT BITS ss = SHORT 16rff, SHORT SHORT BITS sss; + ASSERT (b = 2r0); + ASSERT (bb EQ LONG 8r377); + ASSERT (bbb = LONG LONG 8r0); + ASSERT (ss EQ SHORT 8r377); + ASSERT (sss = SHORT SHORT 8r0) +END + diff --git a/gcc/testsuite/algol68/execute/eq-char-char-1.a68 b/gcc/testsuite/algol68/execute/eq-char-char-1.a68 new file mode 100644 index 0000000..eb520d2 --- /dev/null +++ b/gcc/testsuite/algol68/execute/eq-char-char-1.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN ASSERT ("a" = "a") +END + diff --git a/gcc/testsuite/algol68/execute/eq-int-1.a68 b/gcc/testsuite/algol68/execute/eq-int-1.a68 new file mode 100644 index 0000000..399b91a --- /dev/null +++ b/gcc/testsuite/algol68/execute/eq-int-1.a68 @@ -0,0 +1,10 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i = 12; + LONG INT ii = LONG 12, LONG LONG INT iii = LONG LONG 12; + SHORT INT s = SHORT 12, SHORT SHORT INT ss = SHORT SHORT 12; + ASSERT (12 = i); + ASSERT (ii = LONG 12); + ASSERT (iii = LONG LONG 12); + ASSERT (s = SHORT 12); + ASSERT (ss = SHORT SHORT 12) +END diff --git a/gcc/testsuite/algol68/execute/eq-string-1.a68 b/gcc/testsuite/algol68/execute/eq-string-1.a68 new file mode 100644 index 0000000..0242f02 --- /dev/null +++ b/gcc/testsuite/algol68/execute/eq-string-1.a68 @@ -0,0 +1,16 @@ +# { dg-options "-fstropping=upper" } # +BEGIN STRING foo = "foo", bar = "bar", quux = "quux"; + # = # + ASSERT ("" = ""); + ASSERT ("foo" = foo); + ASSERT (NOT (foo = bar)); + ASSERT (NOT (foo = quux)); + ASSERT (NOT (quux = foo)); + # EQ # + ASSERT ("" EQ ""); + ASSERT ("foo" EQ foo); + ASSERT (NOT (foo EQ bar)); + ASSERT (NOT (foo EQ quux)); + ASSERT (NOT (quux EQ foo)) +END + diff --git a/gcc/testsuite/algol68/execute/eq-string-stride-1.a68 b/gcc/testsuite/algol68/execute/eq-string-stride-1.a68 new file mode 100644 index 0000000..6e9cec7 --- /dev/null +++ b/gcc/testsuite/algol68/execute/eq-string-stride-1.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN [,]CHAR matrix = (("1", "2", "3"), + ("4", "5", "6"), + ("7", "8", "9")); + ASSERT (matrix[1:3,2] = "258") +END diff --git a/gcc/testsuite/algol68/execute/execute.exp b/gcc/testsuite/algol68/execute/execute.exp new file mode 100644 index 0000000..60722c7 --- /dev/null +++ b/gcc/testsuite/algol68/execute/execute.exp @@ -0,0 +1,37 @@ +# Copyright (C) 2024 Free Software Foundation, Inc. + +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# <http://www.gnu.org/licenses/>. + +# Execute tests, torture testing. + +if $tracelevel then { + strace $tracelevel +} + +load_lib algol68-torture.exp +load_lib torture-options.exp + +torture-init +set-torture-options $TORTURE_OPTIONS + +foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.a68]] { + # If we're only testing specific files and this isn't one of them, skip it. + if ![runtest_file_p $runtests $testcase] then { + continue + } + algol68-torture-execute $testcase + set algol68_compile_args "" +} + +torture-finish diff --git a/gcc/testsuite/algol68/execute/factorial-1.a68 b/gcc/testsuite/algol68/execute/factorial-1.a68 new file mode 100644 index 0000000..f1fa920 --- /dev/null +++ b/gcc/testsuite/algol68/execute/factorial-1.a68 @@ -0,0 +1,170 @@ +# { dg-options "-fstropping=upper" } # +# The Most Contrived Factorial Program + By John P. Baker + University of Bristol. + + Published in the Algol Bulletin 42. + http://jemarch.net/algol-bulletin-42.pdf + + Version adapted for GCC. +# + +BEGIN INT one = 1, two = 2, three = 3, four = 4, five = 5, + six = 6, seven = 7, eight = 8, nine = 9, ten = 10, + eleven = 11, twelve = 12; + INT a = one; + PRIO ME=5, LOVE=7, MY=7, LORDS=7, LADIES=7, + PIPERS=7, DRUMMERS=7, MAIDS=7, SWANS=7, GEESE=7, + GOLD=7, COLLY=7, FRENCH=7, TURTLE=7, PARTRIDGE=6; + BOOL sent to := TRUE; + OP THE = (BOOL a) BOOL: a, + TWELFTH = (INT a) BOOL: a = twelve, + ELEVENTH = (INT a) BOOL: a = eleven, + TENTH = (INT a) BOOL: a = ten, + NINTH = (INT a) BOOL: a = nine, + EIGHTH = (INT a) BOOL: a = eight, + SEVENTH = (INT a) BOOL: a = seven, + SIXTH = (INT a) BOOL: a = six, + FIFTH = (INT a) BOOL: a = five, + FOURTH = (INT a) BOOL: a = four, + THIRD = (INT a) BOOL: a = three, + SECOND = (INT a) BOOL: a = two, + FIRST = (INT a) BOOL: a = one; + OP ME = (BOOL a, INT b) VOID: SKIP; # XXX when transput done (a|print(b)) # + OP LOVE = (BOOL a, b) BOOL: (a|b|FALSE), + MY = (BOOL a, b) BOOL: a LOVE b; + OP AND = (INT a) INT: a; + MODE DATE = STRUCT (INT day, month); + LOC DATE christmas := (25, 12); + OP LORDS = (INT a, b) INT: a * b, + LADIES = (INT a, b) INT: a * b, + PIPERS = (INT a, b) INT: a * b, + DRUMMERS = (INT a, b) INT: a * b, + MAIDS = (INT a, b) INT: a * b, + SWANS = (INT a, b) INT: a * b, + GEESE = (INT a, b) INT: a * b, + GOLD = (INT a, b) INT: a * b, + COLLY = (INT a, b) INT: a * b, + FRENCH = (INT a, b) INT: a * b, + TURTLE = (INT a, b) INT: a * b; + OP LEAPING = (INT a) INT: a, + DANCING = (INT a) INT: a, + PIPING = (INT a) INT: a, + DRUMMING = (INT a) INT: a, + MILKING = (INT a) INT: a, + SWIMMING = (INT a) INT: a, + LAYING = (INT a) INT: a, + RINGS = (INT a) INT: a, + BIRDS = (INT a) INT: a, + HENS = (INT a) INT: a, + DOVES = (INT a) INT: a; + OP PARTRIDGE = (INT a, b) INT: a + b; + INT in a pear tree = 0; + + # Now we are ready... # + + THE FIRST day OF christmas MY TRUE LOVE sent to ME + a PARTRIDGE in a pear tree; + + THE SECOND day OF christmas MY TRUE LOVE sent to ME + two TURTLE DOVES AND + a PARTRIDGE in a pear tree; + + THE THIRD day OF christmas MY TRUE LOVE sent to ME + three FRENCH HENS + two TURTLE DOVES AND + a PARTRIDGE in a pear tree; + + THE FOURTH day OF christmas MY TRUE LOVE sent to ME + four COLLY BIRDS + three FRENCH HENS + two TURTLE DOVES AND + a PARTRIDGE in a pear tree; + + THE FIFTH day OF christmas MY TRUE LOVE sent to ME + five GOLD RINGS + four COLLY BIRDS + three FRENCH HENS + two TURTLE DOVES AND + a PARTRIDGE in a pear tree; + + THE SIXTH day OF christmas MY TRUE LOVE sent to ME + six GEESE LAYING + five GOLD RINGS + four COLLY BIRDS + three FRENCH HENS + two TURTLE DOVES AND + a PARTRIDGE in a pear tree; + + THE SEVENTH day OF christmas MY TRUE LOVE sent to ME + seven SWANS SWIMMING + six GEESE LAYING + five GOLD RINGS + four COLLY BIRDS + three FRENCH HENS + two TURTLE DOVES AND + a PARTRIDGE in a pear tree; + + THE EIGHTH day OF christmas MY TRUE LOVE sent to ME + eight MAIDS MILKING + seven SWANS SWIMMING + six GEESE LAYING + five GOLD RINGS + four COLLY BIRDS + three FRENCH HENS + two TURTLE DOVES AND + a PARTRIDGE in a pear tree; + + THE NINTH day OF christmas MY TRUE LOVE sent to ME + nine DRUMMERS DRUMMING + eight MAIDS MILKING + seven SWANS SWIMMING + six GEESE LAYING + five GOLD RINGS + four COLLY BIRDS + three FRENCH HENS + two TURTLE DOVES AND + a PARTRIDGE in a pear tree; + + THE TENTH day OF christmas MY TRUE LOVE sent to ME + ten PIPERS PIPING + nine DRUMMERS DRUMMING + eight MAIDS MILKING + seven SWANS SWIMMING + six GEESE LAYING + five GOLD RINGS + four COLLY BIRDS + three FRENCH HENS + two TURTLE DOVES AND + a PARTRIDGE in a pear tree; + + THE ELEVENTH day OF christmas MY TRUE LOVE sent to ME + eleven LADIES DANCING + ten PIPERS PIPING + nine DRUMMERS DRUMMING + eight MAIDS MILKING + seven SWANS SWIMMING + six GEESE LAYING + five GOLD RINGS + four COLLY BIRDS + three FRENCH HENS + two TURTLE DOVES AND + a PARTRIDGE in a pear tree; + + THE TWELFTH day OF christmas MY TRUE LOVE sent to ME + twelve LORDS LEAPING + eleven LADIES DANCING + ten PIPERS PIPING + nine DRUMMERS DRUMMING + eight MAIDS MILKING + seven SWANS SWIMMING + six GEESE LAYING + five GOLD RINGS + four COLLY BIRDS + three FRENCH HENS + two TURTLE DOVES AND + a PARTRIDGE in a pear tree; + + SKIP +END + diff --git a/gcc/testsuite/algol68/execute/flat-assignation-1.a68 b/gcc/testsuite/algol68/execute/flat-assignation-1.a68 new file mode 100644 index 0000000..bf97356 --- /dev/null +++ b/gcc/testsuite/algol68/execute/flat-assignation-1.a68 @@ -0,0 +1,7 @@ +{ Assigning to the flexible name replaces the descriptor + as well as the elements. } +begin [10:0]int flat1; + flex[10:-10]int flat2; + flat2 := flat1; + assert (UPB flat2 = 0 AND LWB flat2 = 10) +end diff --git a/gcc/testsuite/algol68/execute/flat-assignation-2.a68 b/gcc/testsuite/algol68/execute/flat-assignation-2.a68 new file mode 100644 index 0000000..fb7fa82 --- /dev/null +++ b/gcc/testsuite/algol68/execute/flat-assignation-2.a68 @@ -0,0 +1,8 @@ +{ Assigning to the flexible name replaces the descriptor + as well as the elements. } +begin [1:20,10:0]int flat1; + flex[100:200,10:-10]int flat2; + flat2 := flat1; + assert (1 UPB flat2 = 20 AND 1 LWB flat2 = 1); + assert (2 UPB flat2 = 0 AND 2 LWB flat2 = 10) +end diff --git a/gcc/testsuite/algol68/execute/flex-1.a68 b/gcc/testsuite/algol68/execute/flex-1.a68 new file mode 100644 index 0000000..4e2bc31 --- /dev/null +++ b/gcc/testsuite/algol68/execute/flex-1.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN FLEX[3]INT list := (1,2,3); + list[2] := 20; + ASSERT (list[2] = 20) +END diff --git a/gcc/testsuite/algol68/execute/flex-2.a68 b/gcc/testsuite/algol68/execute/flex-2.a68 new file mode 100644 index 0000000..4f18674 --- /dev/null +++ b/gcc/testsuite/algol68/execute/flex-2.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +# Rowing to flexible rows. # +BEGIN FLEX[]INT list = 10; + ASSERT (list[1] = 10); + FLEX[,]INT table = 10; + ASSERT (table[1,1] = 10) +END + diff --git a/gcc/testsuite/algol68/execute/flex-3.a68 b/gcc/testsuite/algol68/execute/flex-3.a68 new file mode 100644 index 0000000..8ee3885 --- /dev/null +++ b/gcc/testsuite/algol68/execute/flex-3.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +# Slicing flexible names. # +BEGIN FLEX[]INT list = (1,2,3); + FLEX[]INT sliced = list[2:3]; + ASSERT (LWB sliced = 1 AND UPB sliced = 2); + ASSERT (sliced[1] = 2 AND sliced[2] = 3) +END diff --git a/gcc/testsuite/algol68/execute/flex-4.a68 b/gcc/testsuite/algol68/execute/flex-4.a68 new file mode 100644 index 0000000..d4d7c99 --- /dev/null +++ b/gcc/testsuite/algol68/execute/flex-4.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +# Rowing to flexible rows. # +BEGIN FLEX[3]INT list := (1,2,3); + list := (10,20,30,40); + ASSERT (list[4] = 40) +END diff --git a/gcc/testsuite/algol68/execute/flex-5.a68 b/gcc/testsuite/algol68/execute/flex-5.a68 new file mode 100644 index 0000000..9f9dccc --- /dev/null +++ b/gcc/testsuite/algol68/execute/flex-5.a68 @@ -0,0 +1,12 @@ +# { dg-options "-fstropping=upper" } # +BEGIN FLEX[1:0]INT a; + ASSERT (LWB a = 1 AND UPB a = 0 AND ELEMS a = 0); + a := (1,2,3); + ASSERT (LWB a = 1 AND UPB a = 3 AND a[1] = 1 AND a[2] = 2 AND a[3] = 3); + a := (10,a[2],a[3]); + ASSERT (LWB a = 1 AND UPB a = 3 AND a[1] = 10 AND a[2] = 2 AND a[3] = 3); + a := 100; + ASSERT (LWB a = 1 AND UPB a = 1 AND a[1] = 100); + a := (); + ASSERT (LWB a = 1 AND UPB a = 0 AND ELEMS a = 0) +END diff --git a/gcc/testsuite/algol68/execute/formula-1.a68 b/gcc/testsuite/algol68/execute/formula-1.a68 new file mode 100644 index 0000000..6d2ba4e --- /dev/null +++ b/gcc/testsuite/algol68/execute/formula-1.a68 @@ -0,0 +1,9 @@ +# { dg-options "-fstropping=upper" } # +BEGIN OP JORL = (INT a, b) INT: a + b; + OP JORL = (REAL a, b) REAL: a + b; + OP JORL = ([]CHAR s) INT: ELEMS s; + PRIO JORL = 6; + ASSERT (10 JORL 20 = 30); + ASSERT (REAL r = 3.14 JORL REAL (1); r > 4.13 AND r < 4.15); + ASSERT (JORL "foo" = 3) +END diff --git a/gcc/testsuite/algol68/execute/formula-2.a68 b/gcc/testsuite/algol68/execute/formula-2.a68 new file mode 100644 index 0000000..5b09f3d --- /dev/null +++ b/gcc/testsuite/algol68/execute/formula-2.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i; + PROC side = INT: (i := 1; i := 2; i); + INT res = side + side; + # Can be either due to collateral elaboration in the formula above. # + ASSERT (res = 3 OR res = 4) +END diff --git a/gcc/testsuite/algol68/execute/fsize-1.a68 b/gcc/testsuite/algol68/execute/fsize-1.a68 new file mode 100644 index 0000000..17e3ef2 --- /dev/null +++ b/gcc/testsuite/algol68/execute/fsize-1.a68 @@ -0,0 +1,2 @@ +begin assert (fsize (-1) = - long long 1) +end diff --git a/gcc/testsuite/algol68/execute/ge-int-1.a68 b/gcc/testsuite/algol68/execute/ge-int-1.a68 new file mode 100644 index 0000000..9ed9532 --- /dev/null +++ b/gcc/testsuite/algol68/execute/ge-int-1.a68 @@ -0,0 +1,10 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i = 12; + LONG INT ii = LONG 12, LONG LONG INT iii = LONG LONG 12; + SHORT INT s = SHORT 12, SHORT SHORT INT ss = SHORT SHORT 12; + ASSERT (i >= 10); + ASSERT (ii GE LONG 10); + ASSERT (iii >= LONG LONG 12); + ASSERT (s >= SHORT 12); + ASSERT (ss >= SHORT SHORT 10) +END diff --git a/gcc/testsuite/algol68/execute/ge-string-stride-1.a68 b/gcc/testsuite/algol68/execute/ge-string-stride-1.a68 new file mode 100644 index 0000000..4f51d6b --- /dev/null +++ b/gcc/testsuite/algol68/execute/ge-string-stride-1.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN [,]CHAR matrix = (("1", "0", "1"), + ("4", "0", "4"), + ("7", "0", "7")); + ASSERT (matrix[1:3,1] >= matrix[1:3,3]); + ASSERT (("1","4","7") >= matrix[1:3,3]) +END diff --git a/gcc/testsuite/algol68/execute/gen-flex-1.a68 b/gcc/testsuite/algol68/execute/gen-flex-1.a68 new file mode 100644 index 0000000..ce993df --- /dev/null +++ b/gcc/testsuite/algol68/execute/gen-flex-1.a68 @@ -0,0 +1,10 @@ +begin flex[10:-10]int je; + int num_fields = 3; + assert (UPB je = -10 AND LWB je = 10 AND ELEMS je = 0); + + [1:num_fields][1:num_fields]string fields; + for i to num_fields + do for j to num_fields + do assert (fields[i][j] = "") od + od +end diff --git a/gcc/testsuite/algol68/execute/gen-heap-1.a68 b/gcc/testsuite/algol68/execute/gen-heap-1.a68 new file mode 100644 index 0000000..fdf8df2 --- /dev/null +++ b/gcc/testsuite/algol68/execute/gen-heap-1.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT jorl; + REF INT var = HEAP INT; + var := jorl := 10; + ASSERT (var = 10) +END diff --git a/gcc/testsuite/algol68/execute/gen-heap-2.a68 b/gcc/testsuite/algol68/execute/gen-heap-2.a68 new file mode 100644 index 0000000..80e3a77 --- /dev/null +++ b/gcc/testsuite/algol68/execute/gen-heap-2.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT jorl; + REF INT var := HEAP INT; + var := jorl := 10; + ASSERT (var = 10) +END diff --git a/gcc/testsuite/algol68/execute/gen-heap-3.a68 b/gcc/testsuite/algol68/execute/gen-heap-3.a68 new file mode 100644 index 0000000..e2c026b --- /dev/null +++ b/gcc/testsuite/algol68/execute/gen-heap-3.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT jorl; + INT var := HEAP INT := 15; # The generated name goes away # + ASSERT (var = 15) +END diff --git a/gcc/testsuite/algol68/execute/gen-heap-bool-1.a68 b/gcc/testsuite/algol68/execute/gen-heap-bool-1.a68 new file mode 100644 index 0000000..d4494f0 --- /dev/null +++ b/gcc/testsuite/algol68/execute/gen-heap-bool-1.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN REF BOOL x = HEAP BOOL; + ASSERT (x = FALSE); + x := TRUE; + ASSERT (x = TRUE) +END diff --git a/gcc/testsuite/algol68/execute/gen-heap-int-1.a68 b/gcc/testsuite/algol68/execute/gen-heap-int-1.a68 new file mode 100644 index 0000000..8500d79 --- /dev/null +++ b/gcc/testsuite/algol68/execute/gen-heap-int-1.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN REF INT x = HEAP INT := 4; + ASSERT (x = 4) +END diff --git a/gcc/testsuite/algol68/execute/gen-heap-real-1.a68 b/gcc/testsuite/algol68/execute/gen-heap-real-1.a68 new file mode 100644 index 0000000..3ea6dcb --- /dev/null +++ b/gcc/testsuite/algol68/execute/gen-heap-real-1.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN REF REAL x = HEAP REAL := 4; + ASSERT (x > 3.9 AND x < 4.1) +END diff --git a/gcc/testsuite/algol68/execute/gen-heap-struct-1.a68 b/gcc/testsuite/algol68/execute/gen-heap-struct-1.a68 new file mode 100644 index 0000000..2c2f974 --- /dev/null +++ b/gcc/testsuite/algol68/execute/gen-heap-struct-1.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN HEAP STRUCT(INT i, REAL r) foo; + ASSERT (i OF foo = 0) +END diff --git a/gcc/testsuite/algol68/execute/gen-heap-struct-2.a68 b/gcc/testsuite/algol68/execute/gen-heap-struct-2.a68 new file mode 100644 index 0000000..0803204 --- /dev/null +++ b/gcc/testsuite/algol68/execute/gen-heap-struct-2.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN HEAP STRUCT([10]INT i, REAL r) foo; + FOR i FROM LWB i OF foo TO UPB i OF foo + DO ASSERT ((i OF foo)[i] = 0) OD +END diff --git a/gcc/testsuite/algol68/execute/gen-heap-struct-3.a68 b/gcc/testsuite/algol68/execute/gen-heap-struct-3.a68 new file mode 100644 index 0000000..849bbbd --- /dev/null +++ b/gcc/testsuite/algol68/execute/gen-heap-struct-3.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN HEAP STRUCT([10]INT i, STRING s) foo; + FOR i FROM LWB i OF foo TO UPB i OF foo + DO ASSERT ((i OF foo)[i] = 0) OD +END diff --git a/gcc/testsuite/algol68/execute/gen-loc-1.a68 b/gcc/testsuite/algol68/execute/gen-loc-1.a68 new file mode 100644 index 0000000..1a61bbe --- /dev/null +++ b/gcc/testsuite/algol68/execute/gen-loc-1.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT jorl; + REF INT var = LOC INT; + var := jorl := 10; + ASSERT (var = 10) +END diff --git a/gcc/testsuite/algol68/execute/gen-loc-2.a68 b/gcc/testsuite/algol68/execute/gen-loc-2.a68 new file mode 100644 index 0000000..fce63ef --- /dev/null +++ b/gcc/testsuite/algol68/execute/gen-loc-2.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT jorl; + REF INT var := LOC INT; + var := jorl := 10; + ASSERT (var = 10) +END diff --git a/gcc/testsuite/algol68/execute/gen-loc-3.a68 b/gcc/testsuite/algol68/execute/gen-loc-3.a68 new file mode 100644 index 0000000..66c3cf1 --- /dev/null +++ b/gcc/testsuite/algol68/execute/gen-loc-3.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT jorl; + INT var := LOC INT := 15; # The generated name goes away # + ASSERT (var = 15) +END diff --git a/gcc/testsuite/algol68/execute/gen-loc-4.a68 b/gcc/testsuite/algol68/execute/gen-loc-4.a68 new file mode 100644 index 0000000..6aeb300 --- /dev/null +++ b/gcc/testsuite/algol68/execute/gen-loc-4.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +BEGIN MODE NODE = STRUCT (INT code, REF NODE next); + + NODE top := (10, NIL); + next OF top := LOC NODE := (20, NIL); + ASSERT (code OF top = 10); + ASSERT (code OF next OF top = 20) +END diff --git a/gcc/testsuite/algol68/execute/gen-multiple-1.a68 b/gcc/testsuite/algol68/execute/gen-multiple-1.a68 new file mode 100644 index 0000000..2be0d96 --- /dev/null +++ b/gcc/testsuite/algol68/execute/gen-multiple-1.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN MODE JORL = [(INT x; x + 1)]INT; + JORL xx; + ASSERT (ELEMS xx = 1 AND xx[1] = 0) +END diff --git a/gcc/testsuite/algol68/execute/gen-union-1.a68 b/gcc/testsuite/algol68/execute/gen-union-1.a68 new file mode 100644 index 0000000..893da22 --- /dev/null +++ b/gcc/testsuite/algol68/execute/gen-union-1.a68 @@ -0,0 +1,17 @@ +# { dg-options "-fstropping=upper" } # +BEGIN UNION(INT,REAL,[]INT,CHAR) datux; + ASSERT (CASE datux + IN (INT): 10, + (REAL): 20, + (CHAR): 30, + ([]INT): 40 + ESAC = 0); + []INT ja = (1,2,3); + datux := ja; + ASSERT (CASE datux + IN (INT): 10, + (REAL): 20, + (CHAR): 30, + ([]INT): 40 + ESAC = 40) +END diff --git a/gcc/testsuite/algol68/execute/gen-union-2.a68 b/gcc/testsuite/algol68/execute/gen-union-2.a68 new file mode 100644 index 0000000..27ab7a8 --- /dev/null +++ b/gcc/testsuite/algol68/execute/gen-union-2.a68 @@ -0,0 +1,20 @@ +# { dg-options "-fstropping=upper" } # +# pr UPPER pr # +BEGIN [10]UNION(INT,REAL,[]INT,CHAR) datux; + FOR i FROM LWB datux TO UPB datux + DO ASSERT (CASE datux[i] + IN (INT): 10, + (REAL): 20, + (CHAR): 30, + ([]INT): 40 + ESAC = 0); + []INT ja = (1,2,3); + datux[i] := ja; + ASSERT (CASE datux[i] + IN (INT): 10, + (REAL): 20, + (CHAR): 30, + ([]INT): 40 + ESAC = 40) + OD +END diff --git a/gcc/testsuite/algol68/execute/gen-union-3.a68 b/gcc/testsuite/algol68/execute/gen-union-3.a68 new file mode 100644 index 0000000..78c5d05 --- /dev/null +++ b/gcc/testsuite/algol68/execute/gen-union-3.a68 @@ -0,0 +1,14 @@ +# { dg-options "-fstropping=upper" } # +# An union generated from SKIP has -1 as overhead. # +BEGIN MODE JSONVAL = UNION (JSONOBJ,JSONSTR), + JSONSTR = STRING, + JSONOBJ = STRUCT (REF JSONFLD fields), + JSONFLD = STRUCT (JSONVAL value, REF JSONFLD next); + + JSONFLD fields; + ASSERT (CASE value OF fields + IN (JSONSTR s): "string", + (JSONOBJ o): "object" + OUT "fuckyou" + ESAC = "fuckyou") +END diff --git a/gcc/testsuite/algol68/execute/goto-1.a68 b/gcc/testsuite/algol68/execute/goto-1.a68 new file mode 100644 index 0000000..7f61575 --- /dev/null +++ b/gcc/testsuite/algol68/execute/goto-1.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i := 0; +beg: IF (i < 5) + THEN i +:= 1; + GOTO beg + FI +END diff --git a/gcc/testsuite/algol68/execute/goto-2.a68 b/gcc/testsuite/algol68/execute/goto-2.a68 new file mode 100644 index 0000000..7f78215 --- /dev/null +++ b/gcc/testsuite/algol68/execute/goto-2.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN GOTO end; + ASSERT(FALSE); +end: SKIP +END diff --git a/gcc/testsuite/algol68/execute/goto-3.a68 b/gcc/testsuite/algol68/execute/goto-3.a68 new file mode 100644 index 0000000..47573d2 --- /dev/null +++ b/gcc/testsuite/algol68/execute/goto-3.a68 @@ -0,0 +1,9 @@ +# { dg-options "-fstropping=upper" } # +BEGIN + INT i := 0; + beginning: + IF (i < 5) THEN + i +:= 1; + GO TO beginning + FI +END diff --git a/gcc/testsuite/algol68/execute/goto-4.a68 b/gcc/testsuite/algol68/execute/goto-4.a68 new file mode 100644 index 0000000..c374ca8 --- /dev/null +++ b/gcc/testsuite/algol68/execute/goto-4.a68 @@ -0,0 +1,9 @@ +# { dg-options "-fstropping=upper" } # +BEGIN + INT i := 0; + beginning: + IF (i < 5) THEN + i +:= 1; + beginning + FI +END diff --git a/gcc/testsuite/algol68/execute/goto-5.a68 b/gcc/testsuite/algol68/execute/goto-5.a68 new file mode 100644 index 0000000..a5c720e --- /dev/null +++ b/gcc/testsuite/algol68/execute/goto-5.a68 @@ -0,0 +1,20 @@ +# { dg-options "-fstropping=upper" } # +BEGIN PROC is prime = (INT m) BOOL: + BEGIN IF m < 2 + THEN puts ("program terminated because m is less than 2\n"); + GOTO stop + FI; + + BOOL factor found := NOT (ODD m OR m = 2); + FOR i FROM 3 BY 2 TO m - 1 WHILE NOT factor found + DO factor found := m MOD i = 0 OD; + factor found + END; + + ASSERT (is prime (1)); + ASSERT (is prime (3)); + ASSERT (is prime (71)); + ASSERT (is prime (97)); + is prime (0); + ASSERT (FALSE) # Should jump to stop in the standard postlude. # +END diff --git a/gcc/testsuite/algol68/execute/gt-int-1.a68 b/gcc/testsuite/algol68/execute/gt-int-1.a68 new file mode 100644 index 0000000..cd5437b --- /dev/null +++ b/gcc/testsuite/algol68/execute/gt-int-1.a68 @@ -0,0 +1,10 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i = 12; + LONG INT ii = LONG 12, LONG LONG INT iii = LONG LONG 12; + SHORT INT s = SHORT 12, SHORT SHORT INT ss = SHORT SHORT 12; + ASSERT (i > 10); + ASSERT (ii GT LONG 10); + ASSERT (iii > LONG LONG 10); + ASSERT (s > SHORT 10); + ASSERT (ss > SHORT SHORT 10) +END diff --git a/gcc/testsuite/algol68/execute/gt-string-stride-1.a68 b/gcc/testsuite/algol68/execute/gt-string-stride-1.a68 new file mode 100644 index 0000000..3f0565c --- /dev/null +++ b/gcc/testsuite/algol68/execute/gt-string-stride-1.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN [,]CHAR matrix = (("1", "0", "1"), + ("4", "0", "4"), + ("7", "0", "6")); + ASSERT (matrix[1:3,1] > matrix[1:3,3]); + ASSERT (("1","4","7") > matrix[1:3,3]) +END diff --git a/gcc/testsuite/algol68/execute/i-1.a68 b/gcc/testsuite/algol68/execute/i-1.a68 new file mode 100644 index 0000000..87b6979 --- /dev/null +++ b/gcc/testsuite/algol68/execute/i-1.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN COMPL z = 4I5; + LONG COMPL zz = LONG 4 I LONG 6; + LONG LONG COMPL zzz = LONG LONG 4 I LONG LONG7; + SKIP +END diff --git a/gcc/testsuite/algol68/execute/i-2.a68 b/gcc/testsuite/algol68/execute/i-2.a68 new file mode 100644 index 0000000..455f009 --- /dev/null +++ b/gcc/testsuite/algol68/execute/i-2.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN COMPL z = 4.0I5.0; + LONG COMPL zz = LONG 4.0 I LONG 6.0; + LONG LONG COMPL zzz = LONG LONG 4.0 I LONG LONG 7.0; + SKIP +END diff --git a/gcc/testsuite/algol68/execute/identification-1.a68 b/gcc/testsuite/algol68/execute/identification-1.a68 new file mode 100644 index 0000000..71cc808 --- /dev/null +++ b/gcc/testsuite/algol68/execute/identification-1.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN PROC a = REAL: b := c; + REAL b := 1, c := 2; + REAL x := a; + SKIP +END diff --git a/gcc/testsuite/algol68/execute/identification-2.a68 b/gcc/testsuite/algol68/execute/identification-2.a68 new file mode 100644 index 0000000..8292063 --- /dev/null +++ b/gcc/testsuite/algol68/execute/identification-2.a68 @@ -0,0 +1,14 @@ +# { dg-options "-fstropping=upper" } # +# The identification of c in the assignation marked with XXX works. + In some Algol 68 systems the assignation may fail or result in UB, + because the storage of the REF REAL c doesn't exist yet. In GNU + Algol 68 this works and the value yielded by c is guaranteed to be + zero. +# + +BEGIN REAL b; + b := c; # XXX # + ASSERT (b = 0); + REAL c; + c := b +END diff --git a/gcc/testsuite/algol68/execute/identity-declaration-1.a68 b/gcc/testsuite/algol68/execute/identity-declaration-1.a68 new file mode 100644 index 0000000..ddfa8f2 --- /dev/null +++ b/gcc/testsuite/algol68/execute/identity-declaration-1.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT x := 10; + REF INT xx = x := 20; + ASSERT (xx = 20); + SKIP +END diff --git a/gcc/testsuite/algol68/execute/identity-declaration-2.a68 b/gcc/testsuite/algol68/execute/identity-declaration-2.a68 new file mode 100644 index 0000000..28ba62a --- /dev/null +++ b/gcc/testsuite/algol68/execute/identity-declaration-2.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT x := 10; + REF INT xx = x; + ASSERT (xx = 10); + SKIP +END diff --git a/gcc/testsuite/algol68/execute/identity-declaration-3.a68 b/gcc/testsuite/algol68/execute/identity-declaration-3.a68 new file mode 100644 index 0000000..a694c3a --- /dev/null +++ b/gcc/testsuite/algol68/execute/identity-declaration-3.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT x := 10; + REF INT xx = (x := 20); + ASSERT (xx = 20); + SKIP +END diff --git a/gcc/testsuite/algol68/execute/identity-declaration-4.a68 b/gcc/testsuite/algol68/execute/identity-declaration-4.a68 new file mode 100644 index 0000000..d60867e --- /dev/null +++ b/gcc/testsuite/algol68/execute/identity-declaration-4.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT x := 10; + REF INT xx = ((x)); + ASSERT (xx = 10) +END diff --git a/gcc/testsuite/algol68/execute/identity-declaration-5.a68 b/gcc/testsuite/algol68/execute/identity-declaration-5.a68 new file mode 100644 index 0000000..7c29de1 --- /dev/null +++ b/gcc/testsuite/algol68/execute/identity-declaration-5.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN MODE FOO = STRUCT (STRING s, INT i); + FOO f1 = ("foo", 10); + ASSERT (i OF f1 = 10) +END diff --git a/gcc/testsuite/algol68/execute/identity-declaration-multiple-1.a68 b/gcc/testsuite/algol68/execute/identity-declaration-multiple-1.a68 new file mode 100644 index 0000000..9864ab9 --- /dev/null +++ b/gcc/testsuite/algol68/execute/identity-declaration-multiple-1.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN []INT foo = (1,2,3); + ASSERT (ELEMS foo = 3) +END diff --git a/gcc/testsuite/algol68/execute/identity-declaration-multiple-2.a68 b/gcc/testsuite/algol68/execute/identity-declaration-multiple-2.a68 new file mode 100644 index 0000000..6fd973e --- /dev/null +++ b/gcc/testsuite/algol68/execute/identity-declaration-multiple-2.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN [][]INT foo = ((1,2,3),(4,5,6)); + ASSERT (ELEMS foo = 2) +END diff --git a/gcc/testsuite/algol68/execute/identity-declaration-multiple-3.a68 b/gcc/testsuite/algol68/execute/identity-declaration-multiple-3.a68 new file mode 100644 index 0000000..2d3b8f3 --- /dev/null +++ b/gcc/testsuite/algol68/execute/identity-declaration-multiple-3.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN [3]INT a := (1,2,3); + REF[]INT nn = a; # No copy happens here. # + nn[1] := 200; + ASSERT (a[1] = 200) +END diff --git a/gcc/testsuite/algol68/execute/identity-declaration-multiple-5.a68 b/gcc/testsuite/algol68/execute/identity-declaration-multiple-5.a68 new file mode 100644 index 0000000..005a3c6 --- /dev/null +++ b/gcc/testsuite/algol68/execute/identity-declaration-multiple-5.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN [:]INT foo = (1,2,3); + ASSERT (ELEMS foo = 3) +END diff --git a/gcc/testsuite/algol68/execute/identity-declaration-multiple-empty-1.a68 b/gcc/testsuite/algol68/execute/identity-declaration-multiple-empty-1.a68 new file mode 100644 index 0000000..c8890c2 --- /dev/null +++ b/gcc/testsuite/algol68/execute/identity-declaration-multiple-empty-1.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN []INT a = (); + ASSERT (UPB a = 0); + ASSERT (LWB a = 1); + ASSERT (ELEMS a = 0) +END diff --git a/gcc/testsuite/algol68/execute/identity-declaration-multiple-empty-2.a68 b/gcc/testsuite/algol68/execute/identity-declaration-multiple-empty-2.a68 new file mode 100644 index 0000000..67b5294 --- /dev/null +++ b/gcc/testsuite/algol68/execute/identity-declaration-multiple-empty-2.a68 @@ -0,0 +1,12 @@ +# { dg-options "-fstropping=upper" } # +BEGIN [,,]INT a = (); + ASSERT (1 UPB a = 0); + ASSERT (1 LWB a = 1); + ASSERT (1 ELEMS a = 0); + ASSERT (2 UPB a = 0); + ASSERT (2 LWB a = 1); + ASSERT (2 ELEMS a = 0); + ASSERT (3 UPB a = 0); + ASSERT (3 LWB a = 1); + ASSERT (3 ELEMS a = 0) +END diff --git a/gcc/testsuite/algol68/execute/identity-declaration-multiple-empty-3.a68 b/gcc/testsuite/algol68/execute/identity-declaration-multiple-empty-3.a68 new file mode 100644 index 0000000..b74761f --- /dev/null +++ b/gcc/testsuite/algol68/execute/identity-declaration-multiple-empty-3.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN PROC foo = ([]INT a) VOID: (ASSERT (ELEMS a = 0)); + foo ([]INT()) +END diff --git a/gcc/testsuite/algol68/execute/identity-declaration-multiple-empty-4.a68 b/gcc/testsuite/algol68/execute/identity-declaration-multiple-empty-4.a68 new file mode 100644 index 0000000..69bd760 --- /dev/null +++ b/gcc/testsuite/algol68/execute/identity-declaration-multiple-empty-4.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN PROC foo = ([]INT a) VOID: (ASSERT (LWB a = 1 AND UPB a = 0 AND ELEMS a = 0)); + foo (()) +END diff --git a/gcc/testsuite/algol68/execute/identity-declaration-struct-1.a68 b/gcc/testsuite/algol68/execute/identity-declaration-struct-1.a68 new file mode 100644 index 0000000..58e26b0 --- /dev/null +++ b/gcc/testsuite/algol68/execute/identity-declaration-struct-1.a68 @@ -0,0 +1,10 @@ +# { dg-options "-fstropping=upper" } # +# An identity declaration shall make a copy of the struct value being + ascribed. # +BEGIN MODE FOO = STRUCT (STRING s, INT n); + FOO f1 := ("foo", 10); + FOO f2 = f1; + f1 := ("bar", 20); + ASSERT (n OF f1 = 20); + ASSERT (n OF f2 = 10) +END diff --git a/gcc/testsuite/algol68/execute/infinity-1.a68 b/gcc/testsuite/algol68/execute/infinity-1.a68 new file mode 100644 index 0000000..a7c4fb2 --- /dev/null +++ b/gcc/testsuite/algol68/execute/infinity-1.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN infinity; + minus infinity +END diff --git a/gcc/testsuite/algol68/execute/le-ge-bits-1.a68 b/gcc/testsuite/algol68/execute/le-ge-bits-1.a68 new file mode 100644 index 0000000..8b355f1 --- /dev/null +++ b/gcc/testsuite/algol68/execute/le-ge-bits-1.a68 @@ -0,0 +1,17 @@ +# { dg-options "-fstropping=upper" } # +# <= and => for SIZETY BITS # +BEGIN ASSERT (16rff <= 16rffff); + ASSERT (2r101 LE 2r111); + ASSERT (2r111 >= 2r101); + ASSERT (16rffff GE 16rff); + + ASSERT (LONG 16rff <= LONG 16rffff); + ASSERT (LONG 2r101 LE LONG 2r111); + ASSERT (LONG 2r111 >= LONG 2r101); + ASSERT (LONG 16rffff GE LONG 16rff); + + ASSERT (LONG LONG 16rff <= LONG LONG 16rffff); + ASSERT (LONG LONG 2r101 LE LONG LONG 2r111); + ASSERT (LONG LONG 2r111 >= LONG LONG 2r101); + ASSERT (LONG LONG 16rffff GE LONG LONG 16rff) +END diff --git a/gcc/testsuite/algol68/execute/le-int-1.a68 b/gcc/testsuite/algol68/execute/le-int-1.a68 new file mode 100644 index 0000000..7ad17d3 --- /dev/null +++ b/gcc/testsuite/algol68/execute/le-int-1.a68 @@ -0,0 +1,10 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i = 12; + LONG INT ii = LONG 12, LONG LONG INT iii = LONG LONG 12; + SHORT INT s = SHORT 12, SHORT SHORT INT ss = SHORT SHORT 12; + ASSERT (i <= 13); + ASSERT (ii LE LONG 13); + ASSERT (iii <= LONG LONG 13); + ASSERT (s <= SHORT 12); + ASSERT (ss <= SHORT SHORT 13) +END diff --git a/gcc/testsuite/algol68/execute/le-string-stride-1.a68 b/gcc/testsuite/algol68/execute/le-string-stride-1.a68 new file mode 100644 index 0000000..b0fab2a --- /dev/null +++ b/gcc/testsuite/algol68/execute/le-string-stride-1.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN [,]CHAR matrix = (("1", "Z", "1"), + ("4", "Y", "4"), + ("7", "X", "9")); + ASSERT (matrix[1:3,1] <= matrix[1:3,3]); + ASSERT (("1","4","9") <= matrix[1:3,3]) +END diff --git a/gcc/testsuite/algol68/execute/leng-shorten-bits-1.a68 b/gcc/testsuite/algol68/execute/leng-shorten-bits-1.a68 new file mode 100644 index 0000000..58b5d00 --- /dev/null +++ b/gcc/testsuite/algol68/execute/leng-shorten-bits-1.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +# SHORTEN and LENG on SIZETY BITS # +BEGIN ASSERT (LENG 16rff = LONG 16rff); + ASSERT (SHORTEN LONG 16rffff = 16rffff); + ASSERT (LENG LONG 16rffff = LONG LONG 16rffff); + ASSERT (SHORTEN LONG LONG 16rffff = LONG 16rffff) +END diff --git a/gcc/testsuite/algol68/execute/leng-shorten-ints-1.a68 b/gcc/testsuite/algol68/execute/leng-shorten-ints-1.a68 new file mode 100644 index 0000000..d615f40 --- /dev/null +++ b/gcc/testsuite/algol68/execute/leng-shorten-ints-1.a68 @@ -0,0 +1,27 @@ +# { dg-options "-fstropping=upper" } # +# Environment enquiries for SIZETY INTs # +BEGIN # LENG # + (SHORT SHORT INT iii = short short max int; ASSERT (LENG iii = LENG short short max int)); + (SHORT INT ii = short max int; ASSERT (LENG ii = LENG short max int)); + (INT i = max int; ASSERT (LENG i = LENG max int)); + (LONG INT ii = long max int; ASSERT (LENG ii = LENG long max int)); + # SHORTEN # + (SHORT INT i = SHORT 10; SHORT SHORT INT ii = SHORT SHORT 100; ASSERT (ii + SHORTEN i = SHORT SHORT 110)); + IF int shorths > 2 + THEN (SHORT INT ii = LENG short short max int - SHORT 2; + ASSERT (SHORTEN ii = short short max int - SHORT SHORT 2)); + (SHORT INT ii = LENG short short max int + SHORT 1; ASSERT (SHORTEN ii = short short max int)); + (SHORT INT ii = LENG short short min int - SHORT 1; ASSERT (SHORTEN ii = short short min int)) + FI; + (INT i = LENG short max int - 2; ASSERT (SHORTEN i = SHORTEN max int - SHORT 2)); + (INT i = LENG short max int + 1; ASSERT (SHORTEN i = SHORTEN max int)); + (INT i = LENG short min int - 1; ASSERT (SHORTEN i = SHORTEN min int)); + (LONG INT ii = LENG max int - LONG 2; ASSERT (SHORTEN ii = max int - 2)); + (LONG INT ii = LENG max int + LONG 1; ASSERT (SHORTEN ii = max int)); + (LONG INT ii = LENG min int - LONG 1; ASSERT (SHORTEN ii = min int)); + IF int lengths > 2 + THEN (LONG LONG INT ii = LENG long max int - LONG LONG 2; ASSERT (SHORTEN ii = long max int - LONG 2)); + (LONG LONG INT ii = LENG long max int + LONG LONG 1; ASSERT (SHORTEN ii = long max int)); + (LONG LONG INT ii = LENG long min int - LONG LONG 1; ASSERT (SHORTEN ii = long min int)) + FI +END diff --git a/gcc/testsuite/algol68/execute/leng-shorten-reals-1.a68 b/gcc/testsuite/algol68/execute/leng-shorten-reals-1.a68 new file mode 100644 index 0000000..dd6ed8c --- /dev/null +++ b/gcc/testsuite/algol68/execute/leng-shorten-reals-1.a68 @@ -0,0 +1,17 @@ +# { dg-options "-fstropping=upper" } # +# Environment enquiries for SIZETY REALs # +BEGIN # LENG # + (REAL i = max real; ASSERT (LENG i = LENG max real)); + (LONG REAL ii = long max real; ASSERT (LENG ii = LENG long max real)); + + # SHORTEN # + (LONG REAL ii = LENG max real - LONG 2.0; ASSERT (SHORTEN ii = max real - 2.0)); + (LONG REAL ii = LENG max real + LONG 1.0; ASSERT (SHORTEN ii = max real)); + (LONG REAL ii = LENG min real - LONG 1.0; ASSERT (SHORTEN ii = min real)); + IF (long long max real > LENG long max real) + THEN (LONG LONG REAL ii = LENG long max real - LONG LONG 2.0; + ASSERT (SHORTEN ii = long max real - LONG 2.0)); + (LONG LONG REAL ii = LENG long max real + LONG LONG 1.0; ASSERT (SHORTEN ii = long max real)); + (LONG LONG REAL ii = LENG long min real - LONG LONG 1.0; ASSERT (SHORTEN ii = long min real)) + FI +END diff --git a/gcc/testsuite/algol68/execute/lengths-shorths-1.a68 b/gcc/testsuite/algol68/execute/lengths-shorths-1.a68 new file mode 100644 index 0000000..f1c8923 --- /dev/null +++ b/gcc/testsuite/algol68/execute/lengths-shorths-1.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +BEGIN ASSERT (int lengths > 0); + ASSERT (int shorths > 0); + ASSERT (bits lengths > 0); + ASSERT (bits shorths > 0); + ASSERT (real lengths > 0); + ASSERT (real shorths > 0) +END diff --git a/gcc/testsuite/algol68/execute/lisp-1.a68 b/gcc/testsuite/algol68/execute/lisp-1.a68 new file mode 100644 index 0000000..8cec7f6 --- /dev/null +++ b/gcc/testsuite/algol68/execute/lisp-1.a68 @@ -0,0 +1,25 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT num ints := 0, num chars := 0; + PROC collect stats = (REF CONS tree) VOID: + BEGIN REF CONS e := tree; + WHILE REF CONS (e) ISNT NIL + DO CASE car OF e + IN (CHAR c): num chars +:= 1, + (INT): num ints +:= 1, + (REF CONS s): collect stats (s) + ESAC; + e := cdr OF e + OD + END; + MODE ATOM = UNION (CHAR, INT); + MODE CONS = STRUCT (UNION (ATOM, REF CONS) car, REF CONS cdr); + PROC list = ([]UNION (ATOM, REF CONS) item) REF CONS: + BEGIN REF CONS a := NIL; + FOR i FROM UPB item BY -1 TO 1 + DO a := HEAP CONS := (item[i], a) OD; + a + END; + REF CONS expression := list (("X", "+", list (("Y", "x", 2)))); + collect stats (expression); + ASSERT (num ints = 1 AND num chars = 4) +END diff --git a/gcc/testsuite/algol68/execute/lisp-2.a68 b/gcc/testsuite/algol68/execute/lisp-2.a68 new file mode 100644 index 0000000..79ae697 --- /dev/null +++ b/gcc/testsuite/algol68/execute/lisp-2.a68 @@ -0,0 +1,21 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT num constants := 0, num vars := 0, num operators := 0; + PROC collect stats = (REF EXPRESSION expr) VOID: + BEGIN CASE left OF expr + IN (INT): num constants +:= 1, + (CHAR): num vars +:= 1, + (REF EXPRESSION s): collect stats (s) + ESAC; + num operators +:= 1; + CASE right OF expr + IN (INT): num constants +:= 1, + (CHAR): num vars +:= 1, + (REF EXPRESSION s): collect stats (s) + ESAC + END; + MODE OPERAND = UNION (CHAR,INT,REF EXPRESSION), + EXPRESSION = STRUCT (OPERAND left, CHAR operator, OPERAND right); + REF EXPRESSION expression := HEAP EXPRESSION := ("X", "+", HEAP EXPRESSION := ("Y", "x", 2)); + collect stats (expression); + ASSERT (num constants = 1 AND num vars = 2 AND num operators = 2) +END diff --git a/gcc/testsuite/algol68/execute/ln-1.a68 b/gcc/testsuite/algol68/execute/ln-1.a68 new file mode 100644 index 0000000..5c56971 --- /dev/null +++ b/gcc/testsuite/algol68/execute/ln-1.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +BEGIN REAL r = 1.0; + LONG REAL rr = LONG 2.0; + LONG LONG REAL rrr = LONG LONG 60.0; + ASSERT (ln (r) = 0.0); + long ln (rr); + long long ln (rrr) +END diff --git a/gcc/testsuite/algol68/execute/log-1.a68 b/gcc/testsuite/algol68/execute/log-1.a68 new file mode 100644 index 0000000..b1a8d8d1 --- /dev/null +++ b/gcc/testsuite/algol68/execute/log-1.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +BEGIN REAL r = 1.0; + LONG REAL rr = LONG 2.0; + LONG LONG REAL rrr = LONG LONG 60.0; + ASSERT (log (r) = 0.0); + long log (rr); + long long log (rrr) +END diff --git a/gcc/testsuite/algol68/execute/loop-1.a68 b/gcc/testsuite/algol68/execute/loop-1.a68 new file mode 100644 index 0000000..91e47c0 --- /dev/null +++ b/gcc/testsuite/algol68/execute/loop-1.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i := 0; + DO i +:= 1; IF i = 5 THEN exit FI + OD; +exit: ASSERT (i = 5) +END diff --git a/gcc/testsuite/algol68/execute/loop-10.a68 b/gcc/testsuite/algol68/execute/loop-10.a68 new file mode 100644 index 0000000..53e3823 --- /dev/null +++ b/gcc/testsuite/algol68/execute/loop-10.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i := 0, n := 2; + FOR a FROM n BY 2 TO n + 2 DO i +:= a OD; + ASSERT (i = 2 + 4) +END diff --git a/gcc/testsuite/algol68/execute/loop-11.a68 b/gcc/testsuite/algol68/execute/loop-11.a68 new file mode 100644 index 0000000..eecaade --- /dev/null +++ b/gcc/testsuite/algol68/execute/loop-11.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +# Negative steps towards minus infinity. # +BEGIN INT i := 0, n := -5; + BY -1 TO n - 1 DO i -:= 1 OD; + ASSERT (i = -8) +END diff --git a/gcc/testsuite/algol68/execute/loop-12.a68 b/gcc/testsuite/algol68/execute/loop-12.a68 new file mode 100644 index 0000000..ffd34a5 --- /dev/null +++ b/gcc/testsuite/algol68/execute/loop-12.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i := 0, n := 5; + FOR a TO n WHILE a < 3 DO i +:= 1 OD; + ASSERT (i = 2) +END diff --git a/gcc/testsuite/algol68/execute/loop-13.a68 b/gcc/testsuite/algol68/execute/loop-13.a68 new file mode 100644 index 0000000..dbbd9b9 --- /dev/null +++ b/gcc/testsuite/algol68/execute/loop-13.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i := 0; + FOR a FROM 2 BY 1 WHILE a <= 10 + DO i +:= 1 OD; + ASSERT (i = 9) +END diff --git a/gcc/testsuite/algol68/execute/loop-14.a68 b/gcc/testsuite/algol68/execute/loop-14.a68 new file mode 100644 index 0000000..bf06f98 --- /dev/null +++ b/gcc/testsuite/algol68/execute/loop-14.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +# The while-part shall not be elaborated if the iterator is exhausted. # +BEGIN STRING s = "abc", INT j := 0; + FOR i TO UPB s WHILE s[i] /= "x" + DO j +:= 1 OD; + ASSERT (j = 3) +END diff --git a/gcc/testsuite/algol68/execute/loop-2.a68 b/gcc/testsuite/algol68/execute/loop-2.a68 new file mode 100644 index 0000000..a92efb3 --- /dev/null +++ b/gcc/testsuite/algol68/execute/loop-2.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +# While loop. # +BEGIN INT i := 0; + WHILE INT j = 5; i < j + DO i +:= 1 OD; + ASSERT (i = 5) +END diff --git a/gcc/testsuite/algol68/execute/loop-3.a68 b/gcc/testsuite/algol68/execute/loop-3.a68 new file mode 100644 index 0000000..63b3e203 --- /dev/null +++ b/gcc/testsuite/algol68/execute/loop-3.a68 @@ -0,0 +1,14 @@ +# { dg-options "-fstropping=upper" } # +# Nested loops. # +BEGIN INT i := 10, res := 0; + WHILE i > 0 + DO INT j := 10; + WHILE j > 0 + DO res +:= 1; + j -:= 1 + OD; + ASSERT (j = 0); + i -:= 1; + OD; + ASSERT (i = 0 AND res = 100) +END diff --git a/gcc/testsuite/algol68/execute/loop-4.a68 b/gcc/testsuite/algol68/execute/loop-4.a68 new file mode 100644 index 0000000..491e569 --- /dev/null +++ b/gcc/testsuite/algol68/execute/loop-4.a68 @@ -0,0 +1,13 @@ +# { dg-options "-fstropping=upper" } # +# Nested loops and j on outside range. # +BEGIN INT i := 10, j := 10, res := 0; + WHILE i > 0 + DO j := 10; + WHILE j > 0 + DO res +:= 1; + j -:= 1 + OD; + i -:= 1 + OD; + ASSERT (i = 0 AND j = 0 AND res = 100) +END diff --git a/gcc/testsuite/algol68/execute/loop-5.a68 b/gcc/testsuite/algol68/execute/loop-5.a68 new file mode 100644 index 0000000..ca0cae6 --- /dev/null +++ b/gcc/testsuite/algol68/execute/loop-5.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +# Skip in loop. # +BEGIN INT i := 0; + WHILE i +:= 1; i < 10 + DO SKIP OD; + ASSERT (i = 10) +END diff --git a/gcc/testsuite/algol68/execute/loop-6.a68 b/gcc/testsuite/algol68/execute/loop-6.a68 new file mode 100644 index 0000000..216a564 --- /dev/null +++ b/gcc/testsuite/algol68/execute/loop-6.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +# The range of the while-part shall cover the do-part. # +BEGIN INT i := 0; + WHILE INT incr = 2; i < 10 + DO i +:= incr OD; + ASSERT (i = 10) +END diff --git a/gcc/testsuite/algol68/execute/loop-7.a68 b/gcc/testsuite/algol68/execute/loop-7.a68 new file mode 100644 index 0000000..3d5112e --- /dev/null +++ b/gcc/testsuite/algol68/execute/loop-7.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i := 0, n := 5; + TO n + 1 DO i +:= 1 OD; + ASSERT (i = 6) +END diff --git a/gcc/testsuite/algol68/execute/loop-8.a68 b/gcc/testsuite/algol68/execute/loop-8.a68 new file mode 100644 index 0000000..e7d0901 --- /dev/null +++ b/gcc/testsuite/algol68/execute/loop-8.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i := 0, n := 2; + FOR a TO n + 1 DO i +:= a OD; + ASSERT (i = 1 + 2 + 3) +END diff --git a/gcc/testsuite/algol68/execute/loop-9.a68 b/gcc/testsuite/algol68/execute/loop-9.a68 new file mode 100644 index 0000000..a101db2 --- /dev/null +++ b/gcc/testsuite/algol68/execute/loop-9.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i := 0, n := 2; + FOR a FROM n TO n + 2 DO i +:= a OD; + ASSERT (i = 2 + 3 + 4) +END diff --git a/gcc/testsuite/algol68/execute/loop-overflow-underflow.a68 b/gcc/testsuite/algol68/execute/loop-overflow-underflow.a68 new file mode 100644 index 0000000..1ace68a --- /dev/null +++ b/gcc/testsuite/algol68/execute/loop-overflow-underflow.a68 @@ -0,0 +1,55 @@ +{ Test for overflow/underflow in loops with implicit and explicit + iterators. } + +begin int count; + + { Overflow. } + count := 0; + by 1 while true do count +:= 1 od; + assert (count = max_int); + + count := 0; + from max_int do count +:= 1 od; + assert (count = 1); + count := 0; + + by max_int do count +:= 1 od; + assert (count = 1); + + count := 0; + for i by max_int do count +:= 1 od; + assert (count = 1); + + count := 0; + by max_int % 2 do count +:= 1 od; + assert (count = 3); + + count := 0; + by max_int - 1 do count +:= 1 od; + assert (count = 2); + + { Underflow. } + count := 0; + by -1 while true do count +:= 1 od; + assert (count = -min_int + 2); + + count := 0; + from min_int by -1 do count +:= 1 od; + assert (count = 1); + count := 0; + + by min_int do count +:= 1 od; + assert (count = 2); + + count := 0; + for i by min_int do count +:= 1 od; + assert (count = 2); + + count := 0; + by min_int % 2 do count +:= 1 od; + assert (count = 3); + + count := 0; + by min_int + 1 do count +:= 1 od; + assert (count = 2) +end diff --git a/gcc/testsuite/algol68/execute/lt-int-1.a68 b/gcc/testsuite/algol68/execute/lt-int-1.a68 new file mode 100644 index 0000000..c0e9302 --- /dev/null +++ b/gcc/testsuite/algol68/execute/lt-int-1.a68 @@ -0,0 +1,10 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i = 12; + LONG INT ii = LONG 12, LONG LONG INT iii = LONG LONG 12; + SHORT INT s = SHORT 12, SHORT SHORT INT ss = SHORT SHORT 12; + ASSERT (i < 13); + ASSERT (ii LT LONG 13); + ASSERT (iii < LONG LONG 13); + ASSERT (s < SHORT 13); + ASSERT (ss < SHORT SHORT 13) +END diff --git a/gcc/testsuite/algol68/execute/lt-string-stride-1.a68 b/gcc/testsuite/algol68/execute/lt-string-stride-1.a68 new file mode 100644 index 0000000..9109f67 --- /dev/null +++ b/gcc/testsuite/algol68/execute/lt-string-stride-1.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN [,]CHAR matrix = (("1", "Z", "1"), + ("4", "Y", "4"), + ("7", "X", "9")); + ASSERT (matrix[1:3,1] < matrix[1:3,3]); + ASSERT (("1","4","0") < matrix[1:3,3]) +END diff --git a/gcc/testsuite/algol68/execute/lwb-1.a68 b/gcc/testsuite/algol68/execute/lwb-1.a68 new file mode 100644 index 0000000..c3dd594 --- /dev/null +++ b/gcc/testsuite/algol68/execute/lwb-1.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN ASSERT (LWB "foo" = 1); + ASSERT (LWB "" = 1); + ASSERT (1 LWB "foo" = 1); + ASSERT (1 LWB "" = 1) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/execute.exp b/gcc/testsuite/algol68/execute/mcgt/execute.exp new file mode 100644 index 0000000..f07333f --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/execute.exp @@ -0,0 +1,29 @@ +# Copyright (C) 2024 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# <http://www.gnu.org/licenses/>. + +if $tracelevel then { + strace $tracelevel +} + +load_lib algol68-torture.exp + +foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.a68]] { + # If we're only testing specific files and this isn't one of them, skip it. + if ![runtest_file_p $runtests $testcase] then { + continue + } + algol68-torture-execute $testcase +} diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-1.3a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-1.3a.a68 new file mode 100644 index 0000000..c99c25f --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-1.3a.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN REAL e = 2.7182818284; REAL circum; + circum := 2 * pi * e +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-1.3c.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-1.3c.a68 new file mode 100644 index 0000000..883d4e9 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-1.3c.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT n := 10, result; + result := n * (n + 1) * (2 * n + 1) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-2.2.1a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.2.1a.a68 new file mode 100644 index 0000000..4179a82 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.2.1a.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +# Integer denotations. # +BEGIN 000; 43; 456; 0 +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-2.2.2a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.2.2a.a68 new file mode 100644 index 0000000..3bd3466 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.2.2a.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +# Real denotations. # +BEGIN .5; 0.5; 2.0; .001; + 2.3e1; 2e0; 2e+0; 2e-0 +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-2.2.3a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.2.3a.a68 new file mode 100644 index 0000000..a9aa44c --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.2.3a.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +# Character denotations. # +BEGIN "X"; "a"; "1"; "."; " " +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-2.3a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.3a.a68 new file mode 100644 index 0000000..e8f403b --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.3a.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +# Identifiers. # +BEGIN INT circum, r, ibm, a1, log2, begin; + SKIP +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-2.3b.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.3b.a68 new file mode 100644 index 0000000..be7368f --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.3b.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +# Identity declarations. # +BEGIN REAL e = 2.7182818284, log2 = 0.618, INT ten = 10, g = 32; + SKIP +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-2.3c.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.3c.a68 new file mode 100644 index 0000000..676f989 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.3c.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +# Equivalent declarations. # +BEGIN REAL x = 2.34; + REF INT n = LOC INT, REF INT m = LOC INT; + SKIP +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-2.3e.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.3e.a68 new file mode 100644 index 0000000..1a0dffe --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.3e.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +# Initialisation. # +BEGIN CHAR firstchar := "A", lastchar := "Z", currentchar; + SKIP +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-2.4.2a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.4.2a.a68 new file mode 100644 index 0000000..f304b8f --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.4.2a.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +# Ordinary division. # +BEGIN ASSERT (4/2 = 2.0); + INT a = 4, b = 7; + a/b # Yields a value of mode REAL. # +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-2.4.2b.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.4.2b.a68 new file mode 100644 index 0000000..ed0b0c4 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.4.2b.a68 @@ -0,0 +1,11 @@ +# { dg-options "-fstropping=upper" } # +# Integer division. The operator OVER (%) performs integer + division with truncation. # +BEGIN ASSERT (4 % 2 = 2); + ASSERT (4 OVER 2 = 2); + ASSERT (5 % 3 = 1); + ASSERT (5 OVER 3 = 1); + INT n = -5, m = -3; + ASSERT (n % 3 = -1); + ASSERT (n % m = 1) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-2.4.2c.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.4.2c.a68 new file mode 100644 index 0000000..a63eb7e --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.4.2c.a68 @@ -0,0 +1,9 @@ +# { dg-options "-fstropping=upper" } # +# Integer modulus. The operator MOD (%*) performs integer modulus + with truncation. # +BEGIN ASSERT (0 MOD 4 = 0); + ASSERT (0 %* 4 = 0); + ASSERT (5 %* 3 = 2); + INT m = 5, n = -3; + ASSERT (m MOD n = 2) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-2.4.3a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.4.3a.a68 new file mode 100644 index 0000000..d8707ee --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.4.3a.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +# Exponentiation. # +BEGIN ASSERT (2 ** 3 = 8) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-2.6a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.6a.a68 new file mode 100644 index 0000000..68f8ee1 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.6a.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +# Comparison operators. # +BEGIN REAL x = 2.7, y = 3.6, z = 4.7; + ASSERT (x < y); + ASSERT ("B" /= "C") +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-2.6b.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.6b.a68 new file mode 100644 index 0000000..c61342f --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.6b.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +# Comparison operators and boolean operators. # +BEGIN INT a = 4, b = 5, c = 9, REAL x = 4.7, y = 5.7, z = 6.7; + ASSERT (NOT (x + y < z) AND a + b = c) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-2.7d.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.7d.a68 new file mode 100644 index 0000000..aa035f2 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.7d.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +# Widening. # +BEGIN REAL x := 4, y := 7, z := 2.7; + SKIP +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-2.7e.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.7e.a68 new file mode 100644 index 0000000..ad423a5 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.7e.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +# Dereferencing and widening. # +BEGIN INT n, REAL x = n; + SKIP +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-2.8a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.8a.a68 new file mode 100644 index 0000000..23d5e51 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.8a.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +# Examples of assignations. # +BEGIN REAL pi = 3.14, e = 2.71, INT n = 10, REAL circum, INT result; + circum := 2 * pi * e; + result := n * (n + 1) * ( 2 * n + 1) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-2.8b.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.8b.a68 new file mode 100644 index 0000000..1b5d642 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.8b.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +# Coercions and assignations. # +BEGIN REAL y, INT n, m := 1; + y := n % m +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-2.9.1a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.9.1a.a68 new file mode 100644 index 0000000..e5e2e78 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.9.1a.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +# Arithmetical assignment operators. # +BEGIN INT m, n := 4; + n PLUSAB 1; + ASSERT (n = 5) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-3.5.1a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-3.5.1a.a68 new file mode 100644 index 0000000..85080ea --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-3.5.1a.a68 @@ -0,0 +1,10 @@ +# { dg-options "-fstropping=upper" } # +# Equivalence. # +BEGIN INT m := 3; REF INT p = m; + ASSERT (m = 3 AND p = 3); + BEGIN INT m := 100; + ASSERT (m = 100 AND p = 3); + m -:= 1; p +:= 1 + END; + ASSERT (m = 4 AND p = 4) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-3.5d.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-3.5d.a68 new file mode 100644 index 0000000..5f02498 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-3.5d.a68 @@ -0,0 +1,9 @@ +# { dg-options "-fstropping=upper" } # +# On the availability and accessibility of space. # +BEGIN INT m := 3, INT five = 5; + ASSERT (m = 3); + BEGIN INT m := 100; CHAR five = "5"; + m +:= 1 + END; + ASSERT (m = 3 AND five = 5) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-3.7.2a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-3.7.2a.a68 new file mode 100644 index 0000000..b6514eb --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-3.7.2a.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT p := 10, q := 12; + FROM p TO q DO (p +:= 1, q +:= 1) OD; + ASSERT (p = 13 AND q = 15) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-3.8.2a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-3.8.2a.a68 new file mode 100644 index 0000000..bfc67c9 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-3.8.2a.a68 @@ -0,0 +1,13 @@ +# { dg-options "-fstropping=upper" } # +# Using case clauses. # +BEGIN PROC is divisible = (INT m) BOOL: + BEGIN BOOL divisible := FALSE; + FOR i TO 4 WHILE NOT divisible + DO INT k = (i|3, 5, 7, 11); + divisible := m MOD k = 0 + OD; + divisible + END; + ASSERT (is divisible (50)); + ASSERT (is divisible (253)) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-3.9.1b.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-3.9.1b.a68 new file mode 100644 index 0000000..01ef062 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-3.9.1b.a68 @@ -0,0 +1,16 @@ +# { dg-options "-fstropping=upper" } # +# Using jumps. # +BEGIN INT a, INT b = 0, c = 2, d = 10, BOOL e = TRUE; + CO The following program using jumps is equivalent to: + FOR a FROM b BY c TO d WHILE e DO SKIP OD + CO + BEGIN INT j := b, INT k = c, m = d; + next: IF (k > 0 AND j <= m) OR (k < 0 AND j >= m) OR k = 0 + THEN INT i = j; + IF e + THEN SKIP; j +:= k; GOTO next + FI + FI; + ASSERT (j = 12) + END +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-4.1.2a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.1.2a.a68 new file mode 100644 index 0000000..98e43c6 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.1.2a.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +# Monadic lwb and upb. # +BEGIN INT n := 4; [n]INT a; + ASSERT (UPB a = 4); + n := 6; + ASSERT (UPB a = 4) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-4.1.3a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.1.3a.a68 new file mode 100644 index 0000000..b259240 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.1.3a.a68 @@ -0,0 +1,9 @@ +# { dg-options "-fstropping=upper" } # +# Dyadic lwb an upb. # +BEGIN [0:10,-4:100]REAL xx; + ASSERT (1 LWB xx = 0); + ASSERT (1 UPB xx = 10); + ASSERT (1 UPB xx = UPB xx); + ASSERT (2 LWB xx = -4); + ASSERT (2 UPB xx = 100) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-4.1.6a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.1.6a.a68 new file mode 100644 index 0000000..e17a9cc --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.1.6a.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +BEGIN [4]REAL x2 := (6, 7, 8, 9); + ASSERT (x2[2] > 6.9); + ASSERT (x2[2] < 7.1); + x2 := (1, 1, 1, 1); + ASSERT(x2[2] > 0.9); + ASSERT(x2[2] < 1.1) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-4.1.6b.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.1.6b.a68 new file mode 100644 index 0000000..09302da --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.1.6b.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +# Multi-dimensional row displays. # +BEGIN [2,3]INT aa := ((1,2,3),(4,5,6)); + [2,3,4]REAL bb := (((1,2,3,4), (5,6,7,8), (9,10,11,12)), + ((13,14,15,16),(17,18,19,20),(21,22,2,24))); + SKIP +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-4.1.6c.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.1.6c.a68 new file mode 100644 index 0000000..241e134 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.1.6c.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +# Further row displays. # +BEGIN [4]INT a, b; + [4]INT c := a, d := (1,2,3,0); + [2,4]INT ab := (a,b), cd := ((0,0,0,0), b); + SKIP +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-4.2.6a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.2.6a.a68 new file mode 100644 index 0000000..ed1fa42 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.2.6a.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN STRUCT (INT day, month, year) indep day = (4, 7, 1776); + ASSERT (day OF indep day = 4); + ASSERT (month OF indep day = 7); + ASSERT (year OF indep day = 1776); + SKIP +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-4.2.6b.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.2.6b.a68 new file mode 100644 index 0000000..2f1ad20 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.2.6b.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN []STRUCT(CHAR letter, INT integer) roman + = (("I",1),("V",5),("X",10),("L",50),("C",100)); + # XXX letter OF roman should be ("I","V","X","L","C") # + # XXX integer OF roman whould be (1,5,10,50,100) # + SKIP +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-4.2.6d.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.2.6d.a68 new file mode 100644 index 0000000..8718efd --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.2.6d.a68 @@ -0,0 +1,11 @@ +# { dg-options "-fstropping=upper" } # +# Multiple values and structures. + + Having strings of different lenghts would not be valid in a variable + declaration, but is acceptable in an identity declaration. +# +BEGIN []STRUCT ([]CHAR name, INT age) family = + (("JOHN", 3), ("ROBERT", 1), ("CATHERINE", 4)); + SKIP +END + diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-4.3.1a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.3.1a.a68 new file mode 100644 index 0000000..0fae194 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.3.1a.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +# Simple mode declarations. # +BEGIN MODE INTEGER = INT; + MODE Z = INT, R = REAL, B = BOOL, V = VOID; + MODE ARRAYA = [100]INT, ARRAYB = [10,2:9]REAL; + SKIP +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-4.3.1b.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.3.1b.a68 new file mode 100644 index 0000000..d98d7ec --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.3.1b.a68 @@ -0,0 +1,15 @@ +# { dg-options "-fstropping=upper" } # +# Dynamic arrays revisited. # +BEGIN INT p := 2, q := 10; + MODE M = [p:q]INT; + M a; + ASSERT (LWB a = 2 AND UPB a = 10); + q := 4; + M b; + ASSERT (LWB a = 2 AND UPB a = 10); + ASSERT (LWB b = 2 AND UPB b = 4); + M c = (1,2,3,4); # M is interpreted as formal declarer. + Bounds are ignored. + # + ASSERT (LWB c = 1 AND UPB c = 4) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-4.3.2a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.3.2a.a68 new file mode 100644 index 0000000..039a661 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.3.2a.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +# Rows of integers. # +BEGIN [][]INT g = ((1,2,3),(4,5),(6,7,8,9)); + ASSERT (UPB g[1] = 3 AND UPB g[2] = 2 AND UPB g[3] = 4) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-5.1.2a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-5.1.2a.a68 new file mode 100644 index 0000000..9d77795 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-5.1.2a.a68 @@ -0,0 +1,15 @@ +# { dg-options "-fstropping=upper" } # +# Procedure declarations I. # +BEGIN INT x = 10, y = 20, i = 2; + PROC xxx = (INT arg) INT: 10; + PROC yyy = (INT arg) INT: 20; + PROC zzz = (INT arg) INT: 30; + PROC(INT)INT f = IF x > y THEN xxx ELSE zzz FI, + g = CASE i IN xxx, yyy, zzz ESAC; + PROC(INT)INT h := IF x < y THEN xxx ELSE yyy FI; + ASSERT (f (100) = 30); + ASSERT (g (200) = 20); + ASSERT (h (300) = 10); + h := yyy; + ASSERT (h (300) = 20) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-5.1.3a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-5.1.3a.a68 new file mode 100644 index 0000000..45efc9c --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-5.1.3a.a68 @@ -0,0 +1,12 @@ +# { dg-options "-fstropping=upper" } # +# Using the factorial function in a program # +BEGIN PROC f = (INT n) INT: + BEGIN INT product := 1; + FOR i TO n DO product *:= i OD; + product + END; + ASSERT (f(0) = 1); + ASSERT (f(1) = 1); + ASSERT (f(2) = 2); + ASSERT (f(3) = 6) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-5.1.3c.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-5.1.3c.a68 new file mode 100644 index 0000000..fcd93c8 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-5.1.3c.a68 @@ -0,0 +1,29 @@ +# { dg-options "-fstropping=upper" } # +# Procedure declarations III # +BEGIN # From the ALGOL68 Revised Report. # + PROC my char in string = (CHAR c, REF INT i, []CHAR s) BOOL: + BEGIN BOOL found := FALSE; + FOR k FROM LWB s TO UPB s WHILE NOT found + DO (c = s[k] | i := k; found := TRUE) OD; + found + END; + ASSERT ((INT idx := 0; + my char in string ("o", idx, "foo") + ANDTH idx = 2)); + ASSERT (my char in string ("x", LOC INT, "foo") = FALSE); + # Swapping function. # + PROC swap = (REF INT a, b) VOID: + (INT r = a; a := b; b := r); + ASSERT ((INT x := 1, y := 2; + swap (x, y); + x = 2 AND y = 1)); + # Euclid's algorithm. # + PROC hcf = (INT m, n) INT: + BEGIN INT a := m, b := n; + IF a < b THEN swap (a, b) FI; + WHILE b /= 0 + DO INT c = b; b := a MOD b; a := c OD; + a + END; + ASSERT (hcf (10, 20) = 10) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-5.1.5a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-5.1.5a.a68 new file mode 100644 index 0000000..4f61bf0 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-5.1.5a.a68 @@ -0,0 +1,19 @@ +# { dg-options "-fstropping=upper" } # +# Recursive procedures. # +BEGIN PROC f = (INT m, n) INT: + IF n = 0 + THEN m + ELIF m < n + THEN f (n, m) + ELSE m * f (m % n, n - 1) + n * f (m - 1, n) + FI; + f (10, 20); + PROC a = (INT m, n) INT: + IF m = 0 + THEN + 1 + ELIF n = 0 + THEN a (m - 1, 1) + ELSE a (m - 1, a (m, n - 1)) + FI; + a (10, 20) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-6.2.2a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-6.2.2a.a68 new file mode 100644 index 0000000..b2bed32 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-6.2.2a.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +# Using AND and OR # +BEGIN ASSERT ((2r111 AND 2r101) = 2r101); + ASSERT ((16rff AND 2r111) = 16r7) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-6.2.2b.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-6.2.2b.a68 new file mode 100644 index 0000000..b9a4730 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-6.2.2b.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +# Comparing objects of mode BITS # +BEGIN ASSERT (2r1010 <= 2r1110); + ASSERT (4r331 >= 8r74); + ASSERT (NOT (2r100 >= 2r011)) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-6.2.2c.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-6.2.2c.a68 new file mode 100644 index 0000000..79bfc97 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-6.2.2c.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +# Using BIN # +BEGIN ASSERT (BIN 7 = 2r111); + INT i = 22; + ASSERT ((BITS b = BIN i; ABS (b SHL 3) + ABS (b SHL 1)) = 220) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-7.1.1a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-7.1.1a.a68 new file mode 100644 index 0000000..efd948b --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-7.1.1a.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +# Declarations of flexible names. # +BEGIN FLEX[1:0]INT n; + ASSERT (LWB n = 1 AND UPB n = 0 AND ELEMS n = 0); + FLEX[4,6]INT p; + ASSERT (1 LWB p = 1 AND 1 UPB p = 4 AND 1 ELEMS p = 4 + AND 2 LWB p = 1 AND 2 UPB p = 6 AND 2 ELEMS p = 6) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-7.1.1b.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-7.1.1b.a68 new file mode 100644 index 0000000..3360c5e --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-7.1.1b.a68 @@ -0,0 +1,11 @@ +# { dg-options "-fstropping=upper" } # +# Null row displays an string denotations. # +BEGIN FLEX[4]INT a, FLEX[4,6]INT b, FLEX[10]CHAR c; + a := (); + ASSERT (LWB a = 1 AND UPB a = 0); + b := ((),()); + ASSERT (1 LWB b = 1 AND 1 UPB b = 2 + AND 2 LWB b = 1 AND 2 UPB b = 0); + c := (); + c := "" +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-7.1.3a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-7.1.3a.a68 new file mode 100644 index 0000000..b1bfdf7 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-7.1.3a.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +# Transient references and declarations. # +BEGIN FLEX[4,6]INT p; + []INT q1 = p[3,]; # Transient name is dereferenced giving []INT # + REF FLEX[,]INT q5 = p; # p and q5 are different ways of accessing + the same name. # + SKIP +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-7.3.2a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-7.3.2a.a68 new file mode 100644 index 0000000..688bcac --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-7.3.2a.a68 @@ -0,0 +1,11 @@ +# { dg-options "-fstropping=upper" } # +# Virtual declarers. # +BEGIN REF[]INT s; + STRUCT ([10]INT a, [4]REF[]INT b) c; + UNION (REF FLEX[]INT, PROC(INT)INT) f; + FLEX[4][3]INT a; + REF FLEX[][]INT aa = LOC FLEX[4][3]INT; + [4]FLEX[3]INT b; + REF[]FLEX[]INT bb = LOC[4]FLEX[3]INT; + SKIP +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-7.3.6a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-7.3.6a.a68 new file mode 100644 index 0000000..1fbf6a3 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-7.3.6a.a68 @@ -0,0 +1,23 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT n := 3, m := 3; + REF INT w := n, z := n, REF INT y = n; + # Delivers TRUE since y and n deliver the same variable of mode REF + INT. No coercions take place. + # + ASSERT (y :=: n); + # Delivers TRUE. here w is dereferenced to yield n. The right + hand side is taken to be strong since dereferencing cannot + occur in a soft position. + # + ASSERT (n :=: w); + # Similarly delivers TRUE. Strong position is lhs. # + ASSERT (w :=: n); + # Delivers TRUE. No coercions take place. # + ASSERT (y ISNT m); + # Delivers true. w gets coerced to REF INT due to the strong + context introduced by the cast. No further coercions take place. + # + ASSERT (REF INT (w) :=: z); + # Delives true. No coercions take place. # + ASSERT (w :/=: z) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-7.3.6b.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-7.3.6b.a68 new file mode 100644 index 0000000..479339d --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-7.3.6b.a68 @@ -0,0 +1,12 @@ +# { dg-options "-fstropping=upper" } # +BEGIN + [3]INT a := (1,2,3); + + CO Comparing transient or flex names using an identity relation is + undefined. Therefore, a[2:3] :=: a[2:3] is undefined. + CO + + # But the following are defined. # + ASSERT (a[1] :=: a[1]); + ASSERT (a[1] :/=: a[2]) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-7.5.3a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-7.5.3a.a68 new file mode 100644 index 0000000..dfb8cd4 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-7.5.3a.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +# Declarations involving global generators. # +BEGIN REF REAL xx; + BEGIN REF REAL x = HEAP REAL := 4; + xx := x + END; + ASSERT (xx = 4) +END diff --git a/gcc/testsuite/algol68/execute/minus-int-1.a68 b/gcc/testsuite/algol68/execute/minus-int-1.a68 new file mode 100644 index 0000000..abaf122 --- /dev/null +++ b/gcc/testsuite/algol68/execute/minus-int-1.a68 @@ -0,0 +1,10 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i = 10; + LONG INT ii = LONG 10, LONG LONG INT iii = LONG LONG 10; + SHORT INT ss = SHORT 10, SHORT SHORT INT sss = SHORT SHORT 10; + ASSERT (i - 2 = 8); + ASSERT (ii - LONG 2 = LONG 8); + ASSERT (iii - LONG LONG 2 = LONG LONG 8); + ASSERT (ss - SHORT 2 = SHORT 8); + ASSERT (sss - SHORT SHORT 2 = SHORT SHORT 8) +END diff --git a/gcc/testsuite/algol68/execute/minusab-1.a68 b/gcc/testsuite/algol68/execute/minusab-1.a68 new file mode 100644 index 0000000..0eb1661 --- /dev/null +++ b/gcc/testsuite/algol68/execute/minusab-1.a68 @@ -0,0 +1,32 @@ +# { dg-options "-fstropping=upper" } # +BEGIN BEGIN INT i := 10; + i -:= 2; + ASSERT (i = 8); + i MINUSAB 2; + ASSERT (i = 6) + END; + BEGIN LONG INT i := LONG 1000; + i -:= LONG 100; + ASSERT (i = LONG 900); + i MINUSAB LONG 100; + ASSERT (i = LONG 800) + END; + BEGIN LONG LONG INT i := LONG LONG 10000; + i -:= LONG LONG 1000; + ASSERT (i = LONG LONG 9000); + i MINUSAB LONG LONG 1000; + ASSERT (i = LONG LONG 8000) + END; + BEGIN SHORT INT i := SHORT 100; + i -:= SHORT 10; + ASSERT (i = SHORT 90); + i MINUSAB SHORT 10; + ASSERT (i = SHORT 80) + END; + BEGIN SHORT SHORT INT i := SHORT SHORT 10; + i -:= SHORT SHORT 1; + ASSERT (i = SHORT SHORT 9); + i MINUSAB SHORT SHORT 2; + ASSERT (i = SHORT SHORT 7) + END +END diff --git a/gcc/testsuite/algol68/execute/minusab-2.a68 b/gcc/testsuite/algol68/execute/minusab-2.a68 new file mode 100644 index 0000000..2fee755 --- /dev/null +++ b/gcc/testsuite/algol68/execute/minusab-2.a68 @@ -0,0 +1,20 @@ +# { dg-options "-fstropping=upper" } # +BEGIN BEGIN REAL i := 10.0; + i -:= 2.0; + ASSERT (i = 8.0); + i MINUSAB 2.0; + ASSERT (i = 6.0) + END; + BEGIN LONG REAL i := LONG 1000.0; + i -:= LONG 100.0; + ASSERT (i = LONG 900.0); + i MINUSAB LONG 100.0; + ASSERT (i = LONG 800.0) + END; + BEGIN LONG LONG REAL i := LONG LONG 10000.0; + i -:= LONG LONG 1000.0; + ASSERT (i = LONG LONG 9000.0); + i MINUSAB LONG LONG 1000.0; + ASSERT (i = LONG LONG 8000.0) + END +END diff --git a/gcc/testsuite/algol68/execute/minusab-3.a68 b/gcc/testsuite/algol68/execute/minusab-3.a68 new file mode 100644 index 0000000..08d020d --- /dev/null +++ b/gcc/testsuite/algol68/execute/minusab-3.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT n := 10; + (((n -:= 1))) := 5; + ASSERT (n = 5) +END diff --git a/gcc/testsuite/algol68/execute/minusab-4.a68 b/gcc/testsuite/algol68/execute/minusab-4.a68 new file mode 100644 index 0000000..4330908 --- /dev/null +++ b/gcc/testsuite/algol68/execute/minusab-4.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT num ints := 10; + num ints -:= 1; + ASSERT (num ints = 9); + ASSERT ((LOC INT -:= 12) = -12) +END diff --git a/gcc/testsuite/algol68/execute/mod-int-1.a68 b/gcc/testsuite/algol68/execute/mod-int-1.a68 new file mode 100644 index 0000000..0d8cfe4 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mod-int-1.a68 @@ -0,0 +1,10 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i = 10; + LONG INT ii = LONG 10, LONG LONG INT iii = LONG LONG 10; + SHORT INT ss = SHORT 10, SHORT SHORT INT sss = SHORT SHORT 10; + ASSERT (i %* 3 = 1); + ASSERT (ii %* LONG 3 = LONG 1); + ASSERT (iii %* LONG LONG 3 = LONG LONG 1); + ASSERT (ss %* SHORT 3 = SHORT 1); + ASSERT (sss MOD SHORT SHORT 3 = SHORT SHORT 1) +END diff --git a/gcc/testsuite/algol68/execute/modab-1.a68 b/gcc/testsuite/algol68/execute/modab-1.a68 new file mode 100644 index 0000000..41c49b0 --- /dev/null +++ b/gcc/testsuite/algol68/execute/modab-1.a68 @@ -0,0 +1,10 @@ +# { dg-options "-fstropping=upper" } # +BEGIN (SHORT SHORT INT i := SHORT SHORT 11; i MODAB SHORT SHORT 2; ASSERT (i = SHORT SHORT 1)); + (SHORT INT i := SHORT 11; i MODAB SHORT 2; ASSERT (i = SHORT 1)); + (INT i := 11; i MODAB 2; ASSERT (i = 1)); + (INT i := 11; i %*:= 2; ASSERT (i = 1)); + (LONG INT i := LONG 11; i MODAB LONG 2; ASSERT (i = LONG 1)); + (LONG INT i := LONG 11; i %*:= LONG 2; ASSERT (i = LONG 1)); + (LONG LONG INT i := LONG LONG 11; i MODAB LONG LONG 2; ASSERT (i = LONG LONG 1)); + (LONG LONG INT i := LONG LONG 11; i %*:= LONG LONG 2; ASSERT (i = LONG LONG 1)) +END diff --git a/gcc/testsuite/algol68/execute/modab-2.a68 b/gcc/testsuite/algol68/execute/modab-2.a68 new file mode 100644 index 0000000..52fc9a1 --- /dev/null +++ b/gcc/testsuite/algol68/execute/modab-2.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT n := 10; + (((n MODAB 1))) := 5; + ASSERT (n = 5) +END diff --git a/gcc/testsuite/algol68/execute/mode-indication-1.a68 b/gcc/testsuite/algol68/execute/mode-indication-1.a68 new file mode 100644 index 0000000..f1dd8c2 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mode-indication-1.a68 @@ -0,0 +1,10 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT j; REAL y; + MODE R = REAL; + BEGIN MODE R = INT; + R i := j; + SKIP + END; + R x := y; + SKIP +END diff --git a/gcc/testsuite/algol68/execute/modules/README b/gcc/testsuite/algol68/execute/modules/README new file mode 100644 index 0000000..a22c97c --- /dev/null +++ b/gcc/testsuite/algol68/execute/modules/README @@ -0,0 +1,7 @@ +This directory contains tests that require using several packets. + +Files named module*.a68 contain prelude packets, i.e. the definitions +of one or more modules. These are to be referred within test programs +using dg-modules. + +Each program*.a68 file is a testcase. diff --git a/gcc/testsuite/algol68/execute/modules/execute.exp b/gcc/testsuite/algol68/execute/modules/execute.exp new file mode 100644 index 0000000..cf61857 --- /dev/null +++ b/gcc/testsuite/algol68/execute/modules/execute.exp @@ -0,0 +1,42 @@ +# Copyright (C) 2024 Free Software Foundation, Inc. + +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# <http://www.gnu.org/licenses/>. + +# Execute tests, torture testing. + +if $tracelevel then { + strace $tracelevel +} + +load_lib algol68-torture.exp +load_lib torture-options.exp + +torture-init +set-torture-options $TORTURE_OPTIONS + +# The programs need to be able to find the built modules, which are +# left in objdir. +global BUILT_MODULES_DIR +set BUILT_MODULES_DIR "$objdir" + +foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/program-*.a68]] { + # If we're only testing specific files and this isn't one of them, skip it. + if ![runtest_file_p $runtests $testcase] then { + continue + } + algol68-torture-execute $testcase + set algol68_compile_args "" +} + +torture-finish diff --git a/gcc/testsuite/algol68/execute/modules/module1.a68 b/gcc/testsuite/algol68/execute/modules/module1.a68 new file mode 100644 index 0000000..f49a747 --- /dev/null +++ b/gcc/testsuite/algol68/execute/modules/module1.a68 @@ -0,0 +1,9 @@ +module Module1 = +def + pub mode MyInt = int; + pub int beast_number := 666; + pub string who = "jemarch"; + puts ("Hello from module'n") +postlude + puts ("Bye from module'n") +fed diff --git a/gcc/testsuite/algol68/execute/modules/module10.a68 b/gcc/testsuite/algol68/execute/modules/module10.a68 new file mode 100644 index 0000000..5b163ff --- /dev/null +++ b/gcc/testsuite/algol68/execute/modules/module10.a68 @@ -0,0 +1,7 @@ +module Module10 = +access Module9, Module3 +def int je = foo; + prio QUUX = 9; + pub Lala bar = (bump; getcounter); {11} + skip +fed diff --git a/gcc/testsuite/algol68/execute/modules/module11.a68 b/gcc/testsuite/algol68/execute/modules/module11.a68 new file mode 100644 index 0000000..39adb82 --- /dev/null +++ b/gcc/testsuite/algol68/execute/modules/module11.a68 @@ -0,0 +1,11 @@ +{ Mixing module texts with revelations and without revelations. } + +module Module11 = + access Module1, Module3 + def pub proc someproc = (int a, b) int: a + b; + skip + postlude + skip + fed, + Foo = def skip postlude skip fed, + Bar = def skip fed diff --git a/gcc/testsuite/algol68/execute/modules/module12.a68 b/gcc/testsuite/algol68/execute/modules/module12.a68 new file mode 100644 index 0000000..3f849cb --- /dev/null +++ b/gcc/testsuite/algol68/execute/modules/module12.a68 @@ -0,0 +1,5 @@ +module Module_12 = +def pub proc foo = (proc(int,string)void cb, int a) void: cb (a, "Foo"); + pub proc bar = (real r) void: skip; + skip +fed diff --git a/gcc/testsuite/algol68/execute/modules/module13.a68 b/gcc/testsuite/algol68/execute/modules/module13.a68 new file mode 100644 index 0000000..9d66fe1 --- /dev/null +++ b/gcc/testsuite/algol68/execute/modules/module13.a68 @@ -0,0 +1,5 @@ +module Module_13 = +def + pub mode JSON_Val = struct (int i); + skip +fed diff --git a/gcc/testsuite/algol68/execute/modules/module14.a68 b/gcc/testsuite/algol68/execute/modules/module14.a68 new file mode 100644 index 0000000..bcb9d2c --- /dev/null +++ b/gcc/testsuite/algol68/execute/modules/module14.a68 @@ -0,0 +1,5 @@ +module Module14 = +access Module13 +def pub proc getval = JSON_Val: skip; + skip +fed diff --git a/gcc/testsuite/algol68/execute/modules/module15.a68 b/gcc/testsuite/algol68/execute/modules/module15.a68 new file mode 100644 index 0000000..5e42084 --- /dev/null +++ b/gcc/testsuite/algol68/execute/modules/module15.a68 @@ -0,0 +1,8 @@ +module Module15 = +access Module13, Module14 +def pub proc foo = int: + begin JSON_Val val = getval; + i of val + end; + skip +fed diff --git a/gcc/testsuite/algol68/execute/modules/module16.a68 b/gcc/testsuite/algol68/execute/modules/module16.a68 new file mode 100644 index 0000000..d798d4f --- /dev/null +++ b/gcc/testsuite/algol68/execute/modules/module16.a68 @@ -0,0 +1,8 @@ +module Module_16 = +def + pub int counter; + skip +postlude + assert (counter = 666); + skip +fed diff --git a/gcc/testsuite/algol68/execute/modules/module17.a68 b/gcc/testsuite/algol68/execute/modules/module17.a68 new file mode 100644 index 0000000..232ddeb --- /dev/null +++ b/gcc/testsuite/algol68/execute/modules/module17.a68 @@ -0,0 +1,13 @@ +module Module = +def + pub int ce_port; + pub string ce_host; + + pub proc ce_connect = void: + myconnect (ce_host, ce_port); + + proc myconnect = (string host, int port) void: + skip; + + skip +fed diff --git a/gcc/testsuite/algol68/execute/modules/module3.a68 b/gcc/testsuite/algol68/execute/modules/module3.a68 new file mode 100644 index 0000000..d4d2066 --- /dev/null +++ b/gcc/testsuite/algol68/execute/modules/module3.a68 @@ -0,0 +1,11 @@ +module Module_3 = +def + { variable = 0 in_proc = 1 } pub proc bump = void: counter +:= 1; + { variable = 0 in_proc = 1 } pub proc bumptimes = (int n) void: to n do bump od; + { variable = 1 in_proc = 0 } pub proc vbump := void: counter +:= 1; + { variable = 1 in_proc = 0 } pub proc vbumptimes := (int n) void: to n do vbump od; + { variable = 0 in_proc = 1 } pub proc getcounter = int: counter; + { variable = 0 in_proc = 0 } pub proc int anothergetcounter = getcounter; + int counter := 10; + skip +fed diff --git a/gcc/testsuite/algol68/execute/modules/module4.a68 b/gcc/testsuite/algol68/execute/modules/module4.a68 new file mode 100644 index 0000000..f4ff315 --- /dev/null +++ b/gcc/testsuite/algol68/execute/modules/module4.a68 @@ -0,0 +1,4 @@ +module Module_4 = +def pub int ten = 10; + skip +fed diff --git a/gcc/testsuite/algol68/execute/modules/module5.a68 b/gcc/testsuite/algol68/execute/modules/module5.a68 new file mode 100644 index 0000000..d0b009a --- /dev/null +++ b/gcc/testsuite/algol68/execute/modules/module5.a68 @@ -0,0 +1,7 @@ +module Module_5 = +def pub prio // = 9; + pub op // = (int a, b) int: a + b; + pub prio LALA = 9; + pub op LALA = (int a, b) int: a - b; + skip +fed diff --git a/gcc/testsuite/algol68/execute/modules/module6.a68 b/gcc/testsuite/algol68/execute/modules/module6.a68 new file mode 100644 index 0000000..f89d7ac --- /dev/null +++ b/gcc/testsuite/algol68/execute/modules/module6.a68 @@ -0,0 +1,5 @@ +module Module_6 = +def prio // = 9; { Note priority is not publicized. } + pub op // = (int a, b) int: a + b; + skip +fed diff --git a/gcc/testsuite/algol68/execute/modules/module7.a68 b/gcc/testsuite/algol68/execute/modules/module7.a68 new file mode 100644 index 0000000..c9c2e07 --- /dev/null +++ b/gcc/testsuite/algol68/execute/modules/module7.a68 @@ -0,0 +1,10 @@ +{ This module exports an operator defined in a non-brief operator + declaration. This means the exported symbol is a pointer to a + function and shall be indirected on the accessing side. } + +module Module_7 = +def pub prio MINUS = 9; + pub op (int,int)int MINUS = minus; + proc minus = (int a, b) int: a - b; + skip +fed diff --git a/gcc/testsuite/algol68/execute/modules/module8.a68 b/gcc/testsuite/algol68/execute/modules/module8.a68 new file mode 100644 index 0000000..6936299 --- /dev/null +++ b/gcc/testsuite/algol68/execute/modules/module8.a68 @@ -0,0 +1,9 @@ +module Module_8 = +access Module_1, Module_4 +def + pub proc checks = void: + begin assert (ten = 10); + assert (beast_number = 666) + end; + skip +fed diff --git a/gcc/testsuite/algol68/execute/modules/module9.a68 b/gcc/testsuite/algol68/execute/modules/module9.a68 new file mode 100644 index 0000000..ed59bb8 --- /dev/null +++ b/gcc/testsuite/algol68/execute/modules/module9.a68 @@ -0,0 +1,8 @@ +module Module9 = +def pub int foo = 10; + pub prio // = 9; + pub op QUUX = (int a, b) int: a + b; + prio QUUX = 9; + pub mode Lala = int; + skip +fed diff --git a/gcc/testsuite/algol68/execute/modules/program-1.a68 b/gcc/testsuite/algol68/execute/modules/program-1.a68 new file mode 100644 index 0000000..b385c56 --- /dev/null +++ b/gcc/testsuite/algol68/execute/modules/program-1.a68 @@ -0,0 +1,20 @@ +{ dg-modules "module1" } + +begin string je = access Module1 begin who end; + string ju = access Module1 ( who ); + string ji = access Module1 if true then who else who fi; + string ja = access Module1 (true | who | who); + string aa = access Module1 case 1 in who, "no" esac; + mode United = union (void,int); + string bb = access Module1 case United (10) in (int): who esac; + string cc = access Module1 (1 | who, "no"); + assert (je = "jemarch"); + assert (ju = "jemarch"); + assert (ji = "jemarch"); + assert (ja = "jemarch"); + assert (aa = "jemarch"); + assert (bb = "jemarch"); + assert (cc = "jemarch"); + access Module1 to 1 do assert (who = "jemarch") od; + access Module1 (assert (beast_number = 666)) +end diff --git a/gcc/testsuite/algol68/execute/modules/program-10.a68 b/gcc/testsuite/algol68/execute/modules/program-10.a68 new file mode 100644 index 0000000..101d065 --- /dev/null +++ b/gcc/testsuite/algol68/execute/modules/program-10.a68 @@ -0,0 +1,6 @@ +{ dg-modules "module3 module9 module10" } + +access Module10 +begin int x = 11; + assert (x = bar) +end diff --git a/gcc/testsuite/algol68/execute/modules/program-11.a68 b/gcc/testsuite/algol68/execute/modules/program-11.a68 new file mode 100644 index 0000000..ba2e1fe --- /dev/null +++ b/gcc/testsuite/algol68/execute/modules/program-11.a68 @@ -0,0 +1,3 @@ +{ dg-modules "module1 module3 module11" } + +access Module11 ( assert (someproc (2, 3) = 5)) diff --git a/gcc/testsuite/algol68/execute/modules/program-12.a68 b/gcc/testsuite/algol68/execute/modules/program-12.a68 new file mode 100644 index 0000000..a8a6a4c --- /dev/null +++ b/gcc/testsuite/algol68/execute/modules/program-12.a68 @@ -0,0 +1,6 @@ +{ dg-modules "module12" } + +access Module_12 +begin proc lala = (int n, string s) void: skip; + foo (lala, 10) +end diff --git a/gcc/testsuite/algol68/execute/modules/program-15.a68 b/gcc/testsuite/algol68/execute/modules/program-15.a68 new file mode 100644 index 0000000..7b6abaf --- /dev/null +++ b/gcc/testsuite/algol68/execute/modules/program-15.a68 @@ -0,0 +1,3 @@ +{ dg-modules "module13 module14 module15" } + +access Module15 (assert (foo = 0)) diff --git a/gcc/testsuite/algol68/execute/modules/program-16.a68 b/gcc/testsuite/algol68/execute/modules/program-16.a68 new file mode 100644 index 0000000..dd6ddb6 --- /dev/null +++ b/gcc/testsuite/algol68/execute/modules/program-16.a68 @@ -0,0 +1,8 @@ +{ dg-modules module16 } + +access Module_16 +begin assert (counter = 0); + counter := 20; + access Module_16 (assert (counter = 20)); + counter := 666 +end diff --git a/gcc/testsuite/algol68/execute/modules/program-17.a68 b/gcc/testsuite/algol68/execute/modules/program-17.a68 new file mode 100644 index 0000000..90a1728 --- /dev/null +++ b/gcc/testsuite/algol68/execute/modules/program-17.a68 @@ -0,0 +1,7 @@ +{ dg-modules module17 } + +access Module17 +begin ce_port := 8888; + ce_host := "localhost"; + ce_connect +end diff --git a/gcc/testsuite/algol68/execute/modules/program-2.a68 b/gcc/testsuite/algol68/execute/modules/program-2.a68 new file mode 100644 index 0000000..e0f320c --- /dev/null +++ b/gcc/testsuite/algol68/execute/modules/program-2.a68 @@ -0,0 +1,15 @@ +{ dg-modules "module1" } + +begin int x = 1 + access Module1 ( beast_number); + int i = access Module1 ( beast_number ) + 1; + int z = 1 + access Module1 if true then beast_number fi; + int v = access Module1 if true then beast_number fi + 1; + int w = access Module1 if true then beast_number fi + + access Module1 if true then beast_number fi; + assert (i = 667); + assert (x = 667); + assert (z = 667); + assert (v = 667); + assert (w = 666 * 2); + skip +end diff --git a/gcc/testsuite/algol68/execute/modules/program-3.a68 b/gcc/testsuite/algol68/execute/modules/program-3.a68 new file mode 100644 index 0000000..b1570bd --- /dev/null +++ b/gcc/testsuite/algol68/execute/modules/program-3.a68 @@ -0,0 +1,16 @@ +{ dg-modules "module3" } + +access Module_3 +begin assert (getcounter = 10); + bump; + assert (getcounter = 11); + bumptimes (3); + assert (getcounter = 14) + { vbump and vbumptimes are set to non-publicized routines + that are local to the module, so it is a scope violation + to call them. } +{ vbump; + assert (getcounter = 15); + vbumptimes (10); + assert (anothergetcounter = 25) } +end diff --git a/gcc/testsuite/algol68/execute/modules/program-4.a68 b/gcc/testsuite/algol68/execute/modules/program-4.a68 new file mode 100644 index 0000000..f207d9c --- /dev/null +++ b/gcc/testsuite/algol68/execute/modules/program-4.a68 @@ -0,0 +1,7 @@ +{ dg-modules "module4" } + +{ The widening coercion "jumps" inside the controlled xclause. } + +begin real realten = access Module_4 (ten); + skip +end diff --git a/gcc/testsuite/algol68/execute/modules/program-5.a68 b/gcc/testsuite/algol68/execute/modules/program-5.a68 new file mode 100644 index 0000000..afa49f5 --- /dev/null +++ b/gcc/testsuite/algol68/execute/modules/program-5.a68 @@ -0,0 +1,7 @@ +{ dg-modules "module5" } + +access Module_5 +begin assert (2 // 3 = 5); + assert (2 LALA 3 = -1); + skip +end diff --git a/gcc/testsuite/algol68/execute/modules/program-6.a68 b/gcc/testsuite/algol68/execute/modules/program-6.a68 new file mode 100644 index 0000000..05708fa --- /dev/null +++ b/gcc/testsuite/algol68/execute/modules/program-6.a68 @@ -0,0 +1,9 @@ +{ dg-modules "module6" } + +{ New priority is given to an importe operator. } + +access Module_6 +begin assert (2 // 3 = 5); + prio // = 9; + skip +end diff --git a/gcc/testsuite/algol68/execute/modules/program-7.a68 b/gcc/testsuite/algol68/execute/modules/program-7.a68 new file mode 100644 index 0000000..6a5aa49 --- /dev/null +++ b/gcc/testsuite/algol68/execute/modules/program-7.a68 @@ -0,0 +1,3 @@ +{ dg-modules "module7" } + +access Module_7 ( assert (2 MINUS 3 = -1) ) diff --git a/gcc/testsuite/algol68/execute/modules/program-8.a68 b/gcc/testsuite/algol68/execute/modules/program-8.a68 new file mode 100644 index 0000000..4a50e71 --- /dev/null +++ b/gcc/testsuite/algol68/execute/modules/program-8.a68 @@ -0,0 +1,3 @@ +{ dg-modules "module1 module4 module8" } + +access Module_8 (checks) diff --git a/gcc/testsuite/algol68/execute/mult-char-1.a68 b/gcc/testsuite/algol68/execute/mult-char-1.a68 new file mode 100644 index 0000000..0e3c1f4 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mult-char-1.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN ASSERT ("a" * 3 = "aaa"); + ASSERT ("" * 1 = ""); + ASSERT ("x" * 0 = "x") +END diff --git a/gcc/testsuite/algol68/execute/mult-int-1.a68 b/gcc/testsuite/algol68/execute/mult-int-1.a68 new file mode 100644 index 0000000..2da2988 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mult-int-1.a68 @@ -0,0 +1,10 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i = 10; + LONG INT ii = LONG 10, LONG LONG INT iii = LONG LONG 10; + SHORT INT ss = SHORT 10, SHORT SHORT INT sss = SHORT SHORT 10; + ASSERT (i * 2 = 20); + ASSERT (ii * LONG 2 = LONG 20); + ASSERT (iii * LONG LONG 2 = LONG LONG 20); + ASSERT (ss * SHORT 2 = SHORT 20); + ASSERT (sss * SHORT SHORT 2 = SHORT SHORT 20) +END diff --git a/gcc/testsuite/algol68/execute/mult-string-1.a68 b/gcc/testsuite/algol68/execute/mult-string-1.a68 new file mode 100644 index 0000000..b0d4917 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mult-string-1.a68 @@ -0,0 +1,13 @@ +# { dg-options "-fstropping=upper" } # +BEGIN STRING foo = "foo"; + ASSERT (foo * -10 = "foo"); + ASSERT (-10 * foo = "foo"); + ASSERT (foo * 0 = "foo"); + ASSERT (0 * foo = "foo"); + ASSERT (foo * 1 = "foo"); + ASSERT (1 * foo = "foo"); + ASSERT (foo * 2 = "foofoo"); + ASSERT (2 * foo = "foofoo"); + ASSERT (foo * 3 = "foofoofoo"); + ASSERT (3 * foo = "foofoofoo") +END diff --git a/gcc/testsuite/algol68/execute/mult-string-2.a68 b/gcc/testsuite/algol68/execute/mult-string-2.a68 new file mode 100644 index 0000000..670dcbf --- /dev/null +++ b/gcc/testsuite/algol68/execute/mult-string-2.a68 @@ -0,0 +1,13 @@ +# { dg-options "-fstropping=upper" } # +BEGIN []CHAR foo = ("f","o","o"); + ASSERT (foo * -10 = "foo"); + ASSERT (-10 * foo = "foo"); + ASSERT (foo * 0 = "foo"); + ASSERT (0 * foo = "foo"); + ASSERT (foo * 1 = "foo"); + ASSERT (1 * foo = "foo"); + ASSERT (foo * 2 = "foofoo"); + ASSERT (2 * foo = "foofoo"); + ASSERT (foo * 3 = "foofoofoo"); + ASSERT (3 * foo = "foofoofoo") +END diff --git a/gcc/testsuite/algol68/execute/mult-string-3.a68 b/gcc/testsuite/algol68/execute/mult-string-3.a68 new file mode 100644 index 0000000..a8d3726 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mult-string-3.a68 @@ -0,0 +1,13 @@ +# { dg-options "-fstropping=upper" } # +BEGIN FLEX[3]CHAR foo := ("f","o","o"); + ASSERT (foo * -10 = "foo"); + ASSERT (-10 * foo = "foo"); + ASSERT (foo * 0 = "foo"); + ASSERT (0 * foo = "foo"); + ASSERT (foo * 1 = "foo"); + ASSERT (1 * foo = "foo"); + ASSERT (foo * 2 = "foofoo"); + ASSERT (2 * foo = "foofoo"); + ASSERT (foo * 3 = "foofoofoo"); + ASSERT (3 * foo = "foofoofoo") +END diff --git a/gcc/testsuite/algol68/execute/mult-string-4.a68 b/gcc/testsuite/algol68/execute/mult-string-4.a68 new file mode 100644 index 0000000..d5e1adb --- /dev/null +++ b/gcc/testsuite/algol68/execute/mult-string-4.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN STRING foo = "abc"; + ASSERT (foo[] * 2 = "abcabc") +END diff --git a/gcc/testsuite/algol68/execute/multab-1.a68 b/gcc/testsuite/algol68/execute/multab-1.a68 new file mode 100644 index 0000000..355129b --- /dev/null +++ b/gcc/testsuite/algol68/execute/multab-1.a68 @@ -0,0 +1,31 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i := 2; + i *:= 2; + ASSERT (i = 4); + i *:= 2; + ASSERT (i = 8); + + SHORT INT s := SHORT 2; + s *:= SHORT 2; + ASSERT (s = SHORT 4); + s *:= SHORT 3; + ASSERT (s = SHORT 12); + + SHORT SHORT INT ss := SHORT SHORT 2; + ss *:= SHORT SHORT 2; + ASSERT (ss = SHORT SHORT 4); + ss *:= SHORT SHORT 3; + ASSERT (ss = SHORT SHORT 12); + + REF LONG INT ii = HEAP LONG INT := LONG 2; + ii *:= LONG 2; + ASSERT (ii = LONG 4); + ii *:= LONG 2; + ASSERT (ii = LONG 8); + + LONG LONG INT iii := LONG LONG 2; + iii *:= LONG LONG 2; + ASSERT (iii = LONG LONG 4); + iii *:= LONG LONG 2; + ASSERT (iii = LONG LONG 8) +END diff --git a/gcc/testsuite/algol68/execute/multab-2.a68 b/gcc/testsuite/algol68/execute/multab-2.a68 new file mode 100644 index 0000000..dc14859 --- /dev/null +++ b/gcc/testsuite/algol68/execute/multab-2.a68 @@ -0,0 +1,31 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i := 2; + i TIMESAB 2; + ASSERT (i = 4); + i TIMESAB 2; + ASSERT (i = 8); + + REF SHORT INT ss = HEAP SHORT INT := SHORT 2; + ss TIMESAB SHORT 2; + ASSERT (ss = SHORT 4); + ss TIMESAB SHORT 2; + ASSERT (ss = SHORT 8); + + SHORT SHORT INT sss := SHORT SHORT 2; + sss TIMESAB SHORT SHORT 2; + ASSERT (sss = SHORT SHORT 4); + sss TIMESAB SHORT SHORT 2; + ASSERT (sss = SHORT SHORT 8); + + REF LONG INT ii = HEAP LONG INT := LONG 2; + ii TIMESAB LONG 2; + ASSERT (ii = LONG 4); + ii TIMESAB LONG 2; + ASSERT (ii = LONG 8); + + LONG LONG INT iii := LONG LONG 2; + iii TIMESAB LONG LONG 2; + ASSERT (iii = LONG LONG 4); + iii TIMESAB LONG LONG 2; + ASSERT (iii = LONG LONG 8) +END diff --git a/gcc/testsuite/algol68/execute/multab-3.a68 b/gcc/testsuite/algol68/execute/multab-3.a68 new file mode 100644 index 0000000..87d7f42 --- /dev/null +++ b/gcc/testsuite/algol68/execute/multab-3.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT num ints := 10; + num ints *:= 2; + ASSERT (num ints = 20); + ASSERT ((LOC INT *:= 12) = 0) +END diff --git a/gcc/testsuite/algol68/execute/mutual-recursion-1.a68 b/gcc/testsuite/algol68/execute/mutual-recursion-1.a68 new file mode 100644 index 0000000..06e01f9 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mutual-recursion-1.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN PROC is even = (INT n) BOOL: (n = 0 | TRUE | is odd (n - 1)); + PROC is odd = (INT n) BOOL: (n = 0 | FALSE | is even (n - 1)); + ASSERT (is even (20)); + ASSERT (is odd (13)) +END diff --git a/gcc/testsuite/algol68/execute/ne-bits-1.a68 b/gcc/testsuite/algol68/execute/ne-bits-1.a68 new file mode 100644 index 0000000..49ef810 --- /dev/null +++ b/gcc/testsuite/algol68/execute/ne-bits-1.a68 @@ -0,0 +1,9 @@ +# { dg-options "-fstropping=upper" } # +BEGIN BITS b, LONG BITS bb = LONG 16rff, LONG LONG BITS bbb; + SHORT BITS ss = SHORT 16rff, SHORT SHORT BITS sss; + ASSERT (b /= 2r1); + ASSERT (bb NE LONG 8r477); + ASSERT (bbb /= LONG LONG 8r2); + ASSERT (ss NE SHORT 8r477); + ASSERT (sss /= SHORT SHORT 8r2) +END diff --git a/gcc/testsuite/algol68/execute/ne-char-char-1.a68 b/gcc/testsuite/algol68/execute/ne-char-char-1.a68 new file mode 100644 index 0000000..2a5b44f --- /dev/null +++ b/gcc/testsuite/algol68/execute/ne-char-char-1.a68 @@ -0,0 +1,3 @@ +# { dg-options "-fstropping=upper" } # +BEGIN ASSERT ("x" /= "a") +END diff --git a/gcc/testsuite/algol68/execute/ne-int-1.a68 b/gcc/testsuite/algol68/execute/ne-int-1.a68 new file mode 100644 index 0000000..2c26bd5 --- /dev/null +++ b/gcc/testsuite/algol68/execute/ne-int-1.a68 @@ -0,0 +1,10 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i = 12; + LONG INT ii = LONG 12, LONG LONG INT iii = LONG LONG 12; + SHORT INT s = SHORT 12, SHORT SHORT INT ss = SHORT SHORT 12; + ASSERT (13 /= i); + ASSERT (ii NE LONG 13); + ASSERT (iii /= LONG LONG 13); + ASSERT (s /= SHORT 13); + ASSERT (ss /= SHORT SHORT 13) +END diff --git a/gcc/testsuite/algol68/execute/ne-string-1.a68 b/gcc/testsuite/algol68/execute/ne-string-1.a68 new file mode 100644 index 0000000..95bd212 --- /dev/null +++ b/gcc/testsuite/algol68/execute/ne-string-1.a68 @@ -0,0 +1,15 @@ +# { dg-options "-fstropping=upper" } # +BEGIN STRING foo = "foo", bar = "bar", quux = "quux"; + # /= # + ASSERT (NOT ("" /= "")); + ASSERT (NOT ("foo" /= foo)); + ASSERT (foo /= bar); + ASSERT (foo /= quux); + ASSERT (quux /= foo); + # NE # + ASSERT (NOT ("" NE "")); + ASSERT (NOT ("foo" NE foo)); + ASSERT (foo NE bar); + ASSERT (foo NE quux); + ASSERT (quux NE foo) +END diff --git a/gcc/testsuite/algol68/execute/neg-int-1.a68 b/gcc/testsuite/algol68/execute/neg-int-1.a68 new file mode 100644 index 0000000..0e66149 --- /dev/null +++ b/gcc/testsuite/algol68/execute/neg-int-1.a68 @@ -0,0 +1,10 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i = 10; + LONG INT ii = LONG 10, LONG LONG INT iii = LONG LONG 10; + SHORT INT ss = SHORT 10, SHORT SHORT INT sss = SHORT SHORT 10; + ASSERT (-i = -10); + ASSERT (-ii = - LONG 10); + ASSERT (-iii = - LONG LONG 10); + ASSERT (-ss = - SHORT 10); + ASSERT (-sss = - SHORT SHORT 10) +END diff --git a/gcc/testsuite/algol68/execute/not-bits-1.a68 b/gcc/testsuite/algol68/execute/not-bits-1.a68 new file mode 100644 index 0000000..8334f7f --- /dev/null +++ b/gcc/testsuite/algol68/execute/not-bits-1.a68 @@ -0,0 +1,13 @@ +# { dg-options "-fstropping=upper" } # +# NOT for SIZETY BITS. # +BEGIN BITS b = 16rf0f0; + ASSERT ((NOT b AND 16rffff) = 16r0f0f); + LONG BITS bb = LONG 16rf0f0; + ASSERT ((NOT bb AND LONG 16rffff) = LONG 16r0f0f); + LONG LONG BITS bbb = LONG LONG 16rf0f0; + ASSERT ((NOT bbb AND LONG LONG 16rffff) = LONG LONG 16r0f0f); + SHORT BITS ss = SHORT 16rf0f0; + ASSERT ((NOT ss AND SHORT 16rffff) = SHORT 16r0f0f); + SHORT SHORT BITS sss = SHORT SHORT 16rf0f0; + ASSERT ((NOT sss AND SHORT SHORT 16rffff) = SHORT SHORT 16r0f0f) +END diff --git a/gcc/testsuite/algol68/execute/odd-1.a68 b/gcc/testsuite/algol68/execute/odd-1.a68 new file mode 100644 index 0000000..893bf04 --- /dev/null +++ b/gcc/testsuite/algol68/execute/odd-1.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT a = 1; + ASSERT (ODD a); + ASSERT (ODD LONG 3); + ASSERT (NOT ODD LONG LONG 4); + ASSERT (ODD SHORT 3); + ASSERT (NOT ODD SHORT SHORT 4) +END diff --git a/gcc/testsuite/algol68/execute/op-1.a68 b/gcc/testsuite/algol68/execute/op-1.a68 new file mode 100644 index 0000000..3b63c32 --- /dev/null +++ b/gcc/testsuite/algol68/execute/op-1.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN OP ONEOVER = (REAL a) REAL: 1/a; + REAL x; + x := ONEOVER 3.14 +END diff --git a/gcc/testsuite/algol68/execute/op-2.a68 b/gcc/testsuite/algol68/execute/op-2.a68 new file mode 100644 index 0000000..c772171 --- /dev/null +++ b/gcc/testsuite/algol68/execute/op-2.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN OP + = (INT a, b) INT: a - -b; + ASSERT (10 + 30 = 40) +END diff --git a/gcc/testsuite/algol68/execute/op-3.a68 b/gcc/testsuite/algol68/execute/op-3.a68 new file mode 100644 index 0000000..9889a64 --- /dev/null +++ b/gcc/testsuite/algol68/execute/op-3.a68 @@ -0,0 +1,9 @@ +# { dg-options "-fstropping=upper" } # +BEGIN OP MIN = (REAL a, b) REAL: (a < b | a | b), + MIN = (INT a, REAL b) REAL: (a < b | a | b), + MIN = (REAL a, INT b) REAL: a MIN REAL (b); + PRIO MIN = 6; + ASSERT (10.0 MIN 20.0 > 9.9 AND 10.0 MIN 20.0 < 10.1); + ASSERT (10.0 MIN 100 > 9.9 AND 10.0 MIN 100 < 10.1); + ASSERT (100.0 MIN 10 > 9.9 AND 100.0 MIN 10 < 10.1) +END diff --git a/gcc/testsuite/algol68/execute/operator-declaration-1.a68 b/gcc/testsuite/algol68/execute/operator-declaration-1.a68 new file mode 100644 index 0000000..61f8fa9 --- /dev/null +++ b/gcc/testsuite/algol68/execute/operator-declaration-1.a68 @@ -0,0 +1,13 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT n = 10; + # Note that the priority for the monadic operators gets ignored. # + PRIO JORL = 6, JURL = 6, XXX = 6, YYY = 6; + OP(INT)INT JORL = (n > 10 | (INT a) INT: a + 1 | (INT a) INT: a - 1), + JURL = (n <= 10 | (INT a) INT: a + 1 | (INT a) INT: a - 1); + OP(INT,INT)INT XXX = (INT a, b) INT: a + b, + YYY = (n > 10 | (INT a,b) INT: a * b | (INT a,b) INT: a - b); + ASSERT (JORL 10 = 9); + ASSERT (JURL 10 = 11); + ASSERT (2 XXX 3 = 5); + ASSERT (2 YYY 3 = -1); +END diff --git a/gcc/testsuite/algol68/execute/or-bits-1.a68 b/gcc/testsuite/algol68/execute/or-bits-1.a68 new file mode 100644 index 0000000..4fc1b06 --- /dev/null +++ b/gcc/testsuite/algol68/execute/or-bits-1.a68 @@ -0,0 +1,18 @@ +# { dg-options "-fstropping=upper" } # +# OR for SIZETY BITS. # +BEGIN BITS b = 16rf0f0; + ASSERT ((b OR 16r0f0f) = 16rffff); + ASSERT ((b OR 16r00ff) = 16rf0ff); + LONG BITS bb = LONG 16rf0f0; + ASSERT ((bb OR LONG 16r0f0f) = LONG 16rffff); + ASSERT ((bb OR LONG 16r00ff) = LONG 16rf0ff); + LONG LONG BITS bbb = LONG LONG 16rf0f0; + ASSERT ((bbb OR LONG LONG 16r0f0f) = LONG LONG 16rffff); + ASSERT ((bbb OR LONG LONG 16r00ff) = LONG LONG 16rf0ff); + SHORT BITS ss = SHORT 16rf0f0; + ASSERT ((ss OR SHORT 16r0f0f) = SHORT 16rffff); + ASSERT ((ss OR SHORT 16r00ff) = SHORT 16rf0ff); + SHORT SHORT BITS sss = SHORT SHORT 16rf0f0; + ASSERT ((sss OR SHORT SHORT 16r0f0f) = SHORT SHORT 16rffff); + ASSERT ((sss OR SHORT SHORT 16r00ff) = SHORT SHORT 16rf0ff) +END diff --git a/gcc/testsuite/algol68/execute/orf-1.a68 b/gcc/testsuite/algol68/execute/orf-1.a68 new file mode 100644 index 0000000..10f0521 --- /dev/null +++ b/gcc/testsuite/algol68/execute/orf-1.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i := 10; + ASSERT (i = 0 OREL i = 10) +END diff --git a/gcc/testsuite/algol68/execute/over-int-1.a68 b/gcc/testsuite/algol68/execute/over-int-1.a68 new file mode 100644 index 0000000..871effb --- /dev/null +++ b/gcc/testsuite/algol68/execute/over-int-1.a68 @@ -0,0 +1,10 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i = 10; + LONG INT ii = LONG 10, LONG LONG INT iii = LONG LONG 10; + SHORT INT ss = SHORT 10, SHORT SHORT INT sss = SHORT SHORT 10; + ASSERT (i % 2 = 5); + ASSERT (ii % LONG 2 = LONG 5); + ASSERT (iii % LONG LONG 2 = LONG LONG 5); + ASSERT (ss % SHORT 2 = SHORT 5); + ASSERT (sss % SHORT SHORT 2 = SHORT SHORT 5) +END diff --git a/gcc/testsuite/algol68/execute/overab-1.a68 b/gcc/testsuite/algol68/execute/overab-1.a68 new file mode 100644 index 0000000..8edfa1e --- /dev/null +++ b/gcc/testsuite/algol68/execute/overab-1.a68 @@ -0,0 +1,12 @@ +# { dg-options "-fstropping=upper" } # +BEGIN (INT i := 11; i OVERAB 2; ASSERT (i = 5)); + (INT i := 11; i %:= 2; ASSERT (i = 5)); + (SHORT INT i := SHORT 11; i OVERAB SHORT 2; ASSERT (i = SHORT 5)); + (SHORT INT i := SHORT 11; i %:= SHORT 2; ASSERT (i = SHORT 5)); + (SHORT SHORT INT i := SHORT SHORT 11; i OVERAB SHORT SHORT 2; ASSERT (i = SHORT SHORT 5)); + (SHORT SHORT INT i := SHORT SHORT 11; i %:= SHORT SHORT 2; ASSERT (i = SHORT SHORT 5)); + (LONG INT i := LONG 11; i OVERAB LONG 2; ASSERT (i = LONG 5)); + (LONG INT i := LONG 11; i %:= LONG 2; ASSERT (i = LONG 5)); + (LONG LONG INT i := LONG LONG 11; i OVERAB LONG LONG 2; ASSERT (i = LONG LONG 5)); + (LONG LONG INT i := LONG LONG 11; i %:= LONG LONG 2; ASSERT (i = LONG LONG 5)) +END diff --git a/gcc/testsuite/algol68/execute/overab-2.a68 b/gcc/testsuite/algol68/execute/overab-2.a68 new file mode 100644 index 0000000..eec8a1c --- /dev/null +++ b/gcc/testsuite/algol68/execute/overab-2.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT n := 10; + (((n OVERAB 1))) := 5; + ASSERT (n = 5) +END diff --git a/gcc/testsuite/algol68/execute/particular-program-1.a68 b/gcc/testsuite/algol68/execute/particular-program-1.a68 new file mode 100644 index 0000000..2c490af --- /dev/null +++ b/gcc/testsuite/algol68/execute/particular-program-1.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +# Particular program with preceding labels. # +jo: ju: +BEGIN SKIP END diff --git a/gcc/testsuite/algol68/execute/plus-char-1.a68 b/gcc/testsuite/algol68/execute/plus-char-1.a68 new file mode 100644 index 0000000..d017fe0 --- /dev/null +++ b/gcc/testsuite/algol68/execute/plus-char-1.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN ASSERT ("a" + "b" = "ab"); + ASSERT ("" + "x" = "x") +END diff --git a/gcc/testsuite/algol68/execute/plus-int-1.a68 b/gcc/testsuite/algol68/execute/plus-int-1.a68 new file mode 100644 index 0000000..93ea004 --- /dev/null +++ b/gcc/testsuite/algol68/execute/plus-int-1.a68 @@ -0,0 +1,10 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i = 10; + LONG INT ii = LONG 10, LONG LONG INT iii = LONG LONG 10; + SHORT INT ss = SHORT 10, SHORT SHORT INT sss = SHORT SHORT 10; + ASSERT (i + 2 = 12); + ASSERT (ii + LONG 2 = LONG 12); + ASSERT (iii + LONG LONG 2 = LONG LONG 12); + ASSERT (ss + SHORT 2 = SHORT 12); + ASSERT (sss + SHORT SHORT 2 = SHORT SHORT 12) +END diff --git a/gcc/testsuite/algol68/execute/plus-string-1.a68 b/gcc/testsuite/algol68/execute/plus-string-1.a68 new file mode 100644 index 0000000..be9edf7 --- /dev/null +++ b/gcc/testsuite/algol68/execute/plus-string-1.a68 @@ -0,0 +1,11 @@ +# { dg-options "-fstropping=upper" } # +BEGIN STRING foo = "foo", bar = "bar", quux = "quux"; + ASSERT ("" + "" = ""); + ASSERT ("" + foo = "foo"); + ASSERT (bar + "" = "bar"); + ASSERT (foo + bar = "foobar"); + STRING res = foo + bar; + ASSERT (LWB res = 1 AND UPB res = 6); + STRING empty = "" + ""; + ASSERT (LWB empty = 1 AND UPB empty = 0) +END diff --git a/gcc/testsuite/algol68/execute/plus-string-2.a68 b/gcc/testsuite/algol68/execute/plus-string-2.a68 new file mode 100644 index 0000000..6399ee1 --- /dev/null +++ b/gcc/testsuite/algol68/execute/plus-string-2.a68 @@ -0,0 +1,11 @@ +# { dg-options "-fstropping=upper" } # +BEGIN PROC rec parse comment = VOID: + BEGIN STRING content; + done; + 100; + done: + ASSERT (content + "x" = "x") + END; + + rec parse comment +END diff --git a/gcc/testsuite/algol68/execute/plus-string-stride-1.a68 b/gcc/testsuite/algol68/execute/plus-string-stride-1.a68 new file mode 100644 index 0000000..07fdf79 --- /dev/null +++ b/gcc/testsuite/algol68/execute/plus-string-stride-1.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN [,]CHAR matrix = (("1","H","3"), + ("4","O","6"), + ("7","M","9"), + ("8","E","2")); + ASSERT (matrix[1:2,1] + matrix[3:4,3] = "1492") +END diff --git a/gcc/testsuite/algol68/execute/plusab-1.a68 b/gcc/testsuite/algol68/execute/plusab-1.a68 new file mode 100644 index 0000000..8de4e97 --- /dev/null +++ b/gcc/testsuite/algol68/execute/plusab-1.a68 @@ -0,0 +1,34 @@ +# { dg-options "-fstropping=upper" } # +BEGIN BEGIN INT i := 10; + i +:= 2; + ASSERT (i = 12); + i PLUSAB 2; + ASSERT (i = 14) + END; + + BEGIN SHORT INT i := SHORT 1000; + i +:= SHORT 100; + ASSERT (i = SHORT 1100); + i PLUSAB SHORT 100; + ASSERT (i = SHORT 1200) + END; + BEGIN SHORT SHORT INT i := SHORT SHORT 10000; + i +:= SHORT SHORT 1000; + ASSERT (i = SHORT SHORT 11000); + i PLUSAB SHORT SHORT 1000; + ASSERT (i = SHORT SHORT 12000) + END; + + BEGIN LONG INT i := LONG 1000; + i +:= LONG 100; + ASSERT (i = LONG 1100); + i PLUSAB LONG 100; + ASSERT (i = LONG 1200) + END; + BEGIN LONG LONG INT i := LONG LONG 10000; + i +:= LONG LONG 1000; + ASSERT (i = LONG LONG 11000); + i PLUSAB LONG LONG 1000; + ASSERT (i = LONG LONG 12000) + END +END diff --git a/gcc/testsuite/algol68/execute/plusab-2.a68 b/gcc/testsuite/algol68/execute/plusab-2.a68 new file mode 100644 index 0000000..6db4686 --- /dev/null +++ b/gcc/testsuite/algol68/execute/plusab-2.a68 @@ -0,0 +1,20 @@ +# { dg-options "-fstropping=upper" } # +BEGIN BEGIN REAL i := 10.0; + i +:= 2.0; + ASSERT (i > 11.9); + i PLUSAB 2.0; + ASSERT (i > 13.9) + END; + BEGIN LONG REAL i := LONG 1000.0; + i +:= LONG 100.0; + ASSERT (i > LONG 1099.9); + i PLUSAB LONG 100.0; + ASSERT (i > LONG 1199.9) + END; + BEGIN LONG LONG REAL i := LONG LONG 10000.0; + i +:= LONG LONG 1000.0; + ASSERT (i > LONG LONG 10999.9); + i PLUSAB LONG LONG 1000.0; + ASSERT (i > LONG LONG 11999.9) + END +END diff --git a/gcc/testsuite/algol68/execute/plusab-3.a68 b/gcc/testsuite/algol68/execute/plusab-3.a68 new file mode 100644 index 0000000..beb6306 --- /dev/null +++ b/gcc/testsuite/algol68/execute/plusab-3.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT n := 0; + (((n +:= 1))) := 5; + ASSERT (n = 5) +END diff --git a/gcc/testsuite/algol68/execute/plusab-4.a68 b/gcc/testsuite/algol68/execute/plusab-4.a68 new file mode 100644 index 0000000..adfbc9f --- /dev/null +++ b/gcc/testsuite/algol68/execute/plusab-4.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT num ints := 0; + num ints +:= 1; + ASSERT (num ints = 1); + ASSERT ((LOC INT +:= 12) = 12) +END diff --git a/gcc/testsuite/algol68/execute/plusab-string-1.a68 b/gcc/testsuite/algol68/execute/plusab-string-1.a68 new file mode 100644 index 0000000..ec1bd3c --- /dev/null +++ b/gcc/testsuite/algol68/execute/plusab-string-1.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN STRING foo := ""; + foo +:= "foo"; + ASSERT (LWB foo = 1 AND UPB foo = 3 AND foo = "foo"); + foo PLUSAB "bar"; + ASSERT (LWB foo = 1 AND UPB foo = 6 AND foo = "foobar") +END diff --git a/gcc/testsuite/algol68/execute/plusto-char-1.a68 b/gcc/testsuite/algol68/execute/plusto-char-1.a68 new file mode 100644 index 0000000..79881c0 --- /dev/null +++ b/gcc/testsuite/algol68/execute/plusto-char-1.a68 @@ -0,0 +1,7 @@ +begin string foo := "foo"; + char c := "x"; + c PLUSTO foo; + assert (foo = "xfoo"); + c +=: foo; + assert (foo = "xxfoo") +end diff --git a/gcc/testsuite/algol68/execute/plusto-string-1.a68 b/gcc/testsuite/algol68/execute/plusto-string-1.a68 new file mode 100644 index 0000000..7d5894b --- /dev/null +++ b/gcc/testsuite/algol68/execute/plusto-string-1.a68 @@ -0,0 +1,6 @@ +begin string foo := "foo"; + "bar" PLUSTO foo; + assert (foo = "barfoo"); + "quux" +=: foo; + assert (foo = "quuxbarfoo") +end diff --git a/gcc/testsuite/algol68/execute/posix-argc-argv-1.a68 b/gcc/testsuite/algol68/execute/posix-argc-argv-1.a68 new file mode 100644 index 0000000..a638038 --- /dev/null +++ b/gcc/testsuite/algol68/execute/posix-argc-argv-1.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN ASSERT (argc >= 1); + ASSERT (argv (1000) = ""); + ASSERT (argv (-1) = ""); + FOR i TO argc + DO puts (argv (i)) OD +END diff --git a/gcc/testsuite/algol68/execute/posix-fopen-1.a68 b/gcc/testsuite/algol68/execute/posix-fopen-1.a68 new file mode 100644 index 0000000..d2a0c40 --- /dev/null +++ b/gcc/testsuite/algol68/execute/posix-fopen-1.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT fd = fopen ("doesn''t exist", file o default); + ASSERT (fd = -1) +END diff --git a/gcc/testsuite/algol68/execute/posix-fputc-fputs-1.a68 b/gcc/testsuite/algol68/execute/posix-fputc-fputs-1.a68 new file mode 100644 index 0000000..bf0af6e --- /dev/null +++ b/gcc/testsuite/algol68/execute/posix-fputc-fputs-1.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +BEGIN fputc (stdout, "X"); + ASSERT (fputs (stdout, "foo") = 3); + fputs (stdout, fputc (stdout, "Y") + "T"); + fputc (stdout, "Z"); + ASSERT (fputs (stdout, "") = 0); + puts ("") +END diff --git a/gcc/testsuite/algol68/execute/posix-getenv-1.a68 b/gcc/testsuite/algol68/execute/posix-getenv-1.a68 new file mode 100644 index 0000000..d1e6905 --- /dev/null +++ b/gcc/testsuite/algol68/execute/posix-getenv-1.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN ASSERT (getenv ("") = ""); + ASSERT (getenv ("DOESNT EXIST FOR SURE") = "") +END diff --git a/gcc/testsuite/algol68/execute/posix-lseek.a68 b/gcc/testsuite/algol68/execute/posix-lseek.a68 new file mode 100644 index 0000000..8f20dc5 --- /dev/null +++ b/gcc/testsuite/algol68/execute/posix-lseek.a68 @@ -0,0 +1,17 @@ +begin int fd = fopen ("../../ga68", file_o_rdonly); + assert (fd /= -1); + assert (errno = 0); + long long int offset; + offset := lseek (fd, long long 0, seek_cur); + assert (offset = long long 0); + assert (errno = 0); + offset := lseek (fd, long long 0, seek_set); + assert (offset = long long 0); + assert (errno = 0); + offset := lseek (fd, long long 0, seek_end); + long long int offset2 = lseek (fd, offset, seek_set); + assert (offset = offset2); + long long int file_size = fsize (fd); + assert (errno = 0); + assert (offset = file_size) +end diff --git a/gcc/testsuite/algol68/execute/posix-perror-1.a68 b/gcc/testsuite/algol68/execute/posix-perror-1.a68 new file mode 100644 index 0000000..a349dd7 --- /dev/null +++ b/gcc/testsuite/algol68/execute/posix-perror-1.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +# { dg-output "^something unique: " } # +BEGIN INT fd = fopen ("doesn''t exist", file o default); + IF fd = -1 THEN + ASSERT (strerror (errno) /= ""); + perror ("something unique") + FI +END diff --git a/gcc/testsuite/algol68/execute/posix-putchar-1.a68 b/gcc/testsuite/algol68/execute/posix-putchar-1.a68 new file mode 100644 index 0000000..01bfbbd --- /dev/null +++ b/gcc/testsuite/algol68/execute/posix-putchar-1.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN putchar ("X"); + putchar ("Y"); + putchar ("Z"); + puts ("\n") +END diff --git a/gcc/testsuite/algol68/execute/posix-stdinouterr-1.a68 b/gcc/testsuite/algol68/execute/posix-stdinouterr-1.a68 new file mode 100644 index 0000000..dc5b373 --- /dev/null +++ b/gcc/testsuite/algol68/execute/posix-stdinouterr-1.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN ASSERT (stdin = 0); + ASSERT (stdout = 1); + ASSERT (stderr = 2) +END diff --git a/gcc/testsuite/algol68/execute/posix-strerror-1.a68 b/gcc/testsuite/algol68/execute/posix-strerror-1.a68 new file mode 100644 index 0000000..607e40d --- /dev/null +++ b/gcc/testsuite/algol68/execute/posix-strerror-1.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT fd = fopen ("doesn''t exist", file o default); + IF fd = -1 THEN ASSERT (strerror (errno) /= "") FI +END diff --git a/gcc/testsuite/algol68/execute/posix-stride-1.a68 b/gcc/testsuite/algol68/execute/posix-stride-1.a68 new file mode 100644 index 0000000..6e7a79d --- /dev/null +++ b/gcc/testsuite/algol68/execute/posix-stride-1.a68 @@ -0,0 +1,14 @@ +# { dg-options "-fstropping=upper" } # +BEGIN [,]CHAR matrix = (("1","H","3"), + ("4","O","6"), + ("7","M","9"), + ("8","E","0")); + []CHAR column = matrix[1:4,2]; + puts (column); + fputs (stdout, matrix[3,2:3]); + puts ("\n"); + fputs (stdout, matrix[1:3,1]); + puts ("\n"); + puts (getenv (matrix[,2])); + perror (matrix[,3]) +END diff --git a/gcc/testsuite/algol68/execute/pow-int-1.a68 b/gcc/testsuite/algol68/execute/pow-int-1.a68 new file mode 100644 index 0000000..7d929d7 --- /dev/null +++ b/gcc/testsuite/algol68/execute/pow-int-1.a68 @@ -0,0 +1,10 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i = 2; + LONG INT ii = LONG 2, LONG LONG INT iii = LONG LONG 2; + SHORT INT ss = SHORT 2, SHORT SHORT INT sss = SHORT SHORT 2; + ASSERT (i ** 2 = 4); + ASSERT (ii ** 2 = LONG 4); + ASSERT (iii ** 2 = LONG LONG 4); + ASSERT (ss ** 2 = SHORT 4); + ASSERT (sss ** 2 = SHORT SHORT 4) +END diff --git a/gcc/testsuite/algol68/execute/pow-real-1.a68 b/gcc/testsuite/algol68/execute/pow-real-1.a68 new file mode 100644 index 0000000..8102870 --- /dev/null +++ b/gcc/testsuite/algol68/execute/pow-real-1.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN REAL r0 = 2.0; LONG REAL rr0 = LONG 2.0; LONG LONG REAL rrr0 = LONG LONG 2.0; + REAL r1 = r0 ^ 2; REAL r2 = r0 ^ 3.0; + LONG REAL rr1 = rr0 ^ LONG 2; LONG REAL rr2 = rr0 ^ LONG 3.0; + LONG LONG REAL rrr1 = rrr0 ^ LONG LONG 2; LONG LONG REAL rrr2 = rrr0 ^ LONG LONG 3.0; + SKIP +END diff --git a/gcc/testsuite/algol68/execute/proc-1.a68 b/gcc/testsuite/algol68/execute/proc-1.a68 new file mode 100644 index 0000000..3085f4b --- /dev/null +++ b/gcc/testsuite/algol68/execute/proc-1.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN PROC foo = INT: 100; + ASSERT (foo = 100) +END diff --git a/gcc/testsuite/algol68/execute/proc-10.a68 b/gcc/testsuite/algol68/execute/proc-10.a68 new file mode 100644 index 0000000..bcc86d8 --- /dev/null +++ b/gcc/testsuite/algol68/execute/proc-10.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN PROC(INT,INT)INT foo = (INT i, j) INT: i + j; + ASSERT (foo (10, 20) = 30) +END diff --git a/gcc/testsuite/algol68/execute/proc-12.a68 b/gcc/testsuite/algol68/execute/proc-12.a68 new file mode 100644 index 0000000..be75e79 --- /dev/null +++ b/gcc/testsuite/algol68/execute/proc-12.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN PROC(INT)INT foo = baz; + PROC bar = (INT i) INT: i + 1; + PROC baz = (INT i) INT: i - 1; + ASSERT (foo (10) = 9) +END diff --git a/gcc/testsuite/algol68/execute/proc-13.a68 b/gcc/testsuite/algol68/execute/proc-13.a68 new file mode 100644 index 0000000..c23c086 --- /dev/null +++ b/gcc/testsuite/algol68/execute/proc-13.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN PROC is even := (INT n) BOOL: n %* 2 = 0; + ASSERT (is even (40)); + PROC no args := BOOL: TRUE; + ASSERT (no args) +END diff --git a/gcc/testsuite/algol68/execute/proc-14.a68 b/gcc/testsuite/algol68/execute/proc-14.a68 new file mode 100644 index 0000000..b653bbe --- /dev/null +++ b/gcc/testsuite/algol68/execute/proc-14.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +BEGIN PROC is even := (INT n) BOOL: n %* 2 = 0; + PROC is odd := (INT n) BOOL: n %* 2 /= 0; + PROC(INT)BOOL f = is even; + PROC(INT)BOOL g = is odd; + ASSERT (f (40)); + ASSERT (g (3)) +END diff --git a/gcc/testsuite/algol68/execute/proc-15.a68 b/gcc/testsuite/algol68/execute/proc-15.a68 new file mode 100644 index 0000000..63c5a55 --- /dev/null +++ b/gcc/testsuite/algol68/execute/proc-15.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +# Nested procedures. # +BEGIN PROC foo = (INT i) INT: + BEGIN PROC bar = (INT i) INT: i - 1; + bar (i) * 10 + END; + ASSERT (foo (10) = 90) +END diff --git a/gcc/testsuite/algol68/execute/proc-16.a68 b/gcc/testsuite/algol68/execute/proc-16.a68 new file mode 100644 index 0000000..bb1b1e2 --- /dev/null +++ b/gcc/testsuite/algol68/execute/proc-16.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +BEGIN PROC bar = (INT i) INT: i - 1; + PROC foo = (INT i) INT: + BEGIN + bar (i) * 10 + END; + ASSERT (foo (10) = 90) +END diff --git a/gcc/testsuite/algol68/execute/proc-17.a68 b/gcc/testsuite/algol68/execute/proc-17.a68 new file mode 100644 index 0000000..24ac5a8 --- /dev/null +++ b/gcc/testsuite/algol68/execute/proc-17.a68 @@ -0,0 +1,11 @@ +# { dg-options "-fstropping=upper" } # +# Identity declarations and procedures. # +BEGIN PROC foo = (INT i) INT: i + 1; + ASSERT (foo (10) = 11); + PROC(INT)INT bar = (INT i) INT: i + 1; + ASSERT (bar (10) = 11); + PROC(INT)INT baz = foo; + ASSERT (baz (10) = 11); + PROC(INT)INT quux = IF 10 > 1 THEN baz ELSE foo FI; + ASSERT (quux (10) = 11) +END diff --git a/gcc/testsuite/algol68/execute/proc-18.a68 b/gcc/testsuite/algol68/execute/proc-18.a68 new file mode 100644 index 0000000..3456882 --- /dev/null +++ b/gcc/testsuite/algol68/execute/proc-18.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN PROC foo = (INT i) INT: i + 1; + PROC(INT)INT bar; + bar := foo; + ASSERT (bar (10) = 11) +END diff --git a/gcc/testsuite/algol68/execute/proc-19.a68 b/gcc/testsuite/algol68/execute/proc-19.a68 new file mode 100644 index 0000000..0846fdc --- /dev/null +++ b/gcc/testsuite/algol68/execute/proc-19.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN PROC foo = (INT i) INT: i + 1; + PROC(INT)INT bar := foo; + ASSERT (bar (10) = 11) +END diff --git a/gcc/testsuite/algol68/execute/proc-2.a68 b/gcc/testsuite/algol68/execute/proc-2.a68 new file mode 100644 index 0000000..39346fe --- /dev/null +++ b/gcc/testsuite/algol68/execute/proc-2.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +# Call a non-variable procedure before declaration. # +BEGIN ASSERT (foo = 100); + PROC foo = INT: 100; + SKIP +END diff --git a/gcc/testsuite/algol68/execute/proc-20.a68 b/gcc/testsuite/algol68/execute/proc-20.a68 new file mode 100644 index 0000000..3bf66ee --- /dev/null +++ b/gcc/testsuite/algol68/execute/proc-20.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN PROC foo := (INT i) INT: i + 1; + PROC(INT)INT bar := foo; + ASSERT (bar (10) = 11) +END diff --git a/gcc/testsuite/algol68/execute/proc-21.a68 b/gcc/testsuite/algol68/execute/proc-21.a68 new file mode 100644 index 0000000..c1ac9807 --- /dev/null +++ b/gcc/testsuite/algol68/execute/proc-21.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +# REF REF PROC # +BEGIN PROC foo = (INT i) INT: i + 1; + PROC(INT)INT bar := foo; + REF PROC(INT)INT baz; + baz := bar; + ASSERT (baz (10) = 11) +END diff --git a/gcc/testsuite/algol68/execute/proc-22.a68 b/gcc/testsuite/algol68/execute/proc-22.a68 new file mode 100644 index 0000000..fa23d53 --- /dev/null +++ b/gcc/testsuite/algol68/execute/proc-22.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +# REF REF PROC # +BEGIN PROC foo = (INT i) INT: i + 1; + PROC(INT)INT bar := foo; + REF PROC(INT)INT baz := bar; + ASSERT (baz (10) = 11) +END diff --git a/gcc/testsuite/algol68/execute/proc-23.a68 b/gcc/testsuite/algol68/execute/proc-23.a68 new file mode 100644 index 0000000..7fa1257 --- /dev/null +++ b/gcc/testsuite/algol68/execute/proc-23.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +BEGIN PROC increment = (INT a) INT: a + 1; + PROC getproc = PROC(INT)INT: + BEGIN increment + END; + # getproc below gets deprocedured to yield increment. # + ASSERT (getproc (10) = 11) +END diff --git a/gcc/testsuite/algol68/execute/proc-25.a68 b/gcc/testsuite/algol68/execute/proc-25.a68 new file mode 100644 index 0000000..5b46e89 --- /dev/null +++ b/gcc/testsuite/algol68/execute/proc-25.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +BEGIN PROC increment := (INT a) INT: a + 1; + PROC getproc := PROC(INT)INT: + BEGIN increment + END; + # getproc below gets deprocedured to yield increment. # + ASSERT (getproc (10) = 11) +END diff --git a/gcc/testsuite/algol68/execute/proc-26.a68 b/gcc/testsuite/algol68/execute/proc-26.a68 new file mode 100644 index 0000000..833cbb3 --- /dev/null +++ b/gcc/testsuite/algol68/execute/proc-26.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN PROC sum = (INT a, b) INT: a + b, + minus = (INT a, b) INT: a - b; + ASSERT (sum (1, 2) = 3); + ASSERT (minus (1, 2) = -1) +END diff --git a/gcc/testsuite/algol68/execute/proc-27.a68 b/gcc/testsuite/algol68/execute/proc-27.a68 new file mode 100644 index 0000000..49c4c6a --- /dev/null +++ b/gcc/testsuite/algol68/execute/proc-27.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN PROC reciprocal = (REAL a) REAL: 1/a; + REAL x; + x := reciprocal (3.14) +END diff --git a/gcc/testsuite/algol68/execute/proc-28.a68 b/gcc/testsuite/algol68/execute/proc-28.a68 new file mode 100644 index 0000000..d909219 --- /dev/null +++ b/gcc/testsuite/algol68/execute/proc-28.a68 @@ -0,0 +1,10 @@ +# { dg-options "-fstropping=upper" } # +BEGIN PROC hcf = (INT m, n) INT: + IF m < n + THEN hcf (n, m) + ELIF n = 0 + THEN m + ELSE hcf (n, m MOD n) + FI; + ASSERT (hcf (10, 20) = 10) +END diff --git a/gcc/testsuite/algol68/execute/proc-29.a68 b/gcc/testsuite/algol68/execute/proc-29.a68 new file mode 100644 index 0000000..51ea5fc --- /dev/null +++ b/gcc/testsuite/algol68/execute/proc-29.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +# A heap proc variable. # +BEGIN HEAP PROC foo := INT: 666; + ASSERT (foo = 666) +END diff --git a/gcc/testsuite/algol68/execute/proc-3.a68 b/gcc/testsuite/algol68/execute/proc-3.a68 new file mode 100644 index 0000000..bd9ce05 --- /dev/null +++ b/gcc/testsuite/algol68/execute/proc-3.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN PROC foo = (INT i, j) INT: i + j + 1; + ASSERT (foo (10, 11) = 22) +END diff --git a/gcc/testsuite/algol68/execute/proc-4.a68 b/gcc/testsuite/algol68/execute/proc-4.a68 new file mode 100644 index 0000000..bce68cf --- /dev/null +++ b/gcc/testsuite/algol68/execute/proc-4.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN ASSERT (foo (10, 11) = 22); + PROC foo = (INT i, j) INT: i + j + 1; + SKIP +END diff --git a/gcc/testsuite/algol68/execute/proc-5.a68 b/gcc/testsuite/algol68/execute/proc-5.a68 new file mode 100644 index 0000000..1893dc3 --- /dev/null +++ b/gcc/testsuite/algol68/execute/proc-5.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +# Recursive function. # +BEGIN PROC foo = (INT i) INT: (i > 0 | i + foo (i - 1) | 0); + ASSERT (foo (10) = 55) +END diff --git a/gcc/testsuite/algol68/execute/proc-6.a68 b/gcc/testsuite/algol68/execute/proc-6.a68 new file mode 100644 index 0000000..894f53e --- /dev/null +++ b/gcc/testsuite/algol68/execute/proc-6.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +# Recursive function, used before declared. # +BEGIN ASSERT (foo (10) = 55); + PROC foo = (INT i) INT: BEGIN (i > 0 | i + foo (i - 1) | 0) END; + SKIP +END diff --git a/gcc/testsuite/algol68/execute/proc-7.a68 b/gcc/testsuite/algol68/execute/proc-7.a68 new file mode 100644 index 0000000..9f39e2d --- /dev/null +++ b/gcc/testsuite/algol68/execute/proc-7.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN PROC foo = (INT i) INT: i + 1; + PROC(INT)INT bar = foo; + ASSERT (bar (10) = 11) +END diff --git a/gcc/testsuite/algol68/execute/proc-8.a68 b/gcc/testsuite/algol68/execute/proc-8.a68 new file mode 100644 index 0000000..ee548c6 --- /dev/null +++ b/gcc/testsuite/algol68/execute/proc-8.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN PROC INT foo = INT: 100; + ASSERT (foo = 100) +END diff --git a/gcc/testsuite/algol68/execute/procedured-goto-1.a68 b/gcc/testsuite/algol68/execute/procedured-goto-1.a68 new file mode 100644 index 0000000..8d3dc21 --- /dev/null +++ b/gcc/testsuite/algol68/execute/procedured-goto-1.a68 @@ -0,0 +1,11 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i := 4; +beg: WHILE i > 0 + DO []PROC VOID table = (l3,l1,l2,end); + table[i]; +l1: puts ("uno\n"); i -:= 1; beg; +l2: puts ("dos\n"); i -:= 1; beg; +l3: puts ("tres\n"); i -:= 1; beg; +end: puts ("cuatro\n"); i -:= 1; beg + OD +END diff --git a/gcc/testsuite/algol68/execute/quine.a68 b/gcc/testsuite/algol68/execute/quine.a68 new file mode 100644 index 0000000..9fd9e42 --- /dev/null +++ b/gcc/testsuite/algol68/execute/quine.a68 @@ -0,0 +1,2 @@ +# { dg-options "-fstropping=upper" } # +(STRING a="(STRING a="";puts(2*a[:19]+2*a[19:]);0)";puts(2*a[:19]+2*a[19:])) diff --git a/gcc/testsuite/algol68/execute/random-1.a68 b/gcc/testsuite/algol68/execute/random-1.a68 new file mode 100644 index 0000000..82cc6e3 --- /dev/null +++ b/gcc/testsuite/algol68/execute/random-1.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN IF random > 0.5 THEN puts ("yes\n") ELSE puts ("no\n") FI; + LONG REAL rr = long random; + IF rr > LONG 0.5 THEN puts ("long yes\n") ELSE puts ("long no\n") FI; + LONG LONG REAL rrr = long long random; + IF rrr > LONG LONG 0.5 THEN puts ("long long yes\n") ELSE puts ("long long no\n") FI +END diff --git a/gcc/testsuite/algol68/execute/re-im-1.a68 b/gcc/testsuite/algol68/execute/re-im-1.a68 new file mode 100644 index 0000000..7801b76 --- /dev/null +++ b/gcc/testsuite/algol68/execute/re-im-1.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +BEGIN COMPL z = 4.0I5.0; + ASSERT (RE z = 4.0 AND IM z = 5.0); + LONG COMPL zz = LONG 4.0 I LONG 6.0; + ASSERT (RE zz = LONG 4.0 AND IM zz = LONG 6.0); + LONG LONG COMPL zzz = LONG LONG 4.0 I LONG LONG 7.0; + ASSERT (RE zzz = LONG LONG 4.0 AND IM zzz = LONG LONG 7.0) +END diff --git a/gcc/testsuite/algol68/execute/rela-string-1.a68 b/gcc/testsuite/algol68/execute/rela-string-1.a68 new file mode 100644 index 0000000..9264857 --- /dev/null +++ b/gcc/testsuite/algol68/execute/rela-string-1.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN ASSERT ("" >= ""); + ASSERT ("" <= ""); + ASSERT ("zzz" > "aaa"); + ASSERT ("zzz" >= "aaa"); + ASSERT ("HelloA" < "HelloB") +END diff --git a/gcc/testsuite/algol68/execute/repr-1.a68 b/gcc/testsuite/algol68/execute/repr-1.a68 new file mode 100644 index 0000000..2b92a3e --- /dev/null +++ b/gcc/testsuite/algol68/execute/repr-1.a68 @@ -0,0 +1,3 @@ +# { dg-options "-fstropping=upper" } # +BEGIN ASSERT (REPR ABS "x" = "x") +END diff --git a/gcc/testsuite/algol68/execute/round-1.a68 b/gcc/testsuite/algol68/execute/round-1.a68 new file mode 100644 index 0000000..632e382 --- /dev/null +++ b/gcc/testsuite/algol68/execute/round-1.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +BEGIN REAL x = 3.14, y = 3.80; + LONG REAL xx = LONG 3.14, yy = LONG 3.80; + LONG LONG REAL xxx = LONG LONG 3.14, yyy = LONG LONG 3.80; + ASSERT (ROUND x = 3 AND ROUND y = 4); + ASSERT (ROUND xx = LONG 3 AND ROUND yy = LONG 4); + ASSERT (ROUND xxx = LONG LONG 3 AND ROUND yyy = LONG LONG 4) +END diff --git a/gcc/testsuite/algol68/execute/row-display-1.a68 b/gcc/testsuite/algol68/execute/row-display-1.a68 new file mode 100644 index 0000000..82540d7 --- /dev/null +++ b/gcc/testsuite/algol68/execute/row-display-1.a68 @@ -0,0 +1,13 @@ +# { dg-options "-fstropping=upper" } # +BEGIN []INT foo = (7,8,9); + [,]INT bar = ((1,2,3),(4,5,6),foo); + ASSERT (bar[1,1] = 1); + ASSERT (bar[1,2] = 2); + ASSERT (bar[1,3] = 3); + ASSERT (bar[2,1] = 4); + ASSERT (bar[2,2] = 5); + ASSERT (bar[2,3] = 6); + ASSERT (bar[3,1] = 7); + ASSERT (bar[3,2] = 8); + ASSERT (bar[3,3] = 9) +END diff --git a/gcc/testsuite/algol68/execute/row-display-2.a68 b/gcc/testsuite/algol68/execute/row-display-2.a68 new file mode 100644 index 0000000..f8a07a4 --- /dev/null +++ b/gcc/testsuite/algol68/execute/row-display-2.a68 @@ -0,0 +1,13 @@ +# { dg-options "-fstropping=upper" } # +BEGIN []INT foo = (7,8,9); + [3,3]INT bar := ((1,2,3),(4,5,6),foo); + ASSERT (bar[1,1] = 1); + ASSERT (bar[1,2] = 2); + ASSERT (bar[1,3] = 3); + ASSERT (bar[2,1] = 4); + ASSERT (bar[2,2] = 5); + ASSERT (bar[2,3] = 6); + ASSERT (bar[3,1] = 7); + ASSERT (bar[3,2] = 8); + ASSERT (bar[3,3] = 9) +END diff --git a/gcc/testsuite/algol68/execute/row-display-3.a68 b/gcc/testsuite/algol68/execute/row-display-3.a68 new file mode 100644 index 0000000..73f3ff8 --- /dev/null +++ b/gcc/testsuite/algol68/execute/row-display-3.a68 @@ -0,0 +1,15 @@ +# { dg-options "-fstropping=upper" } # +BEGIN MODE FOO = STRUCT (INT i, STRING s); + [,]FOO matrix = (((10, "foo"), (20, "bar"), (30, "baz")), + ((40, "uno"), (50, "dos"), (60, "tres")), + ((70, "cuatro"), (80, "cinco"), (90, "seis"))); + ASSERT (i OF matrix[1,1] = 10); + ASSERT (i OF matrix[1,2] = 20); + ASSERT (i OF matrix[1,3] = 30); + ASSERT (i OF matrix[2,1] = 40); + ASSERT (i OF matrix[2,2] = 50); + ASSERT (i OF matrix[2,3] = 60); + ASSERT (i OF matrix[3,1] = 70); + ASSERT (i OF matrix[3,2] = 80); + ASSERT (i OF matrix[3,3] = 90) +END diff --git a/gcc/testsuite/algol68/execute/row-display-4.a68 b/gcc/testsuite/algol68/execute/row-display-4.a68 new file mode 100644 index 0000000..464d6fb --- /dev/null +++ b/gcc/testsuite/algol68/execute/row-display-4.a68 @@ -0,0 +1,16 @@ +# { dg-options "-fstropping=upper" } # +BEGIN [,][]INT duples = (((1,2), (3,4), (5,6)), + ((7,8), (9,10), (11,12))); + ASSERT (duples[1,1][1] = 1); + ASSERT (duples[1,1][2] = 2); + ASSERT (duples[1,2][1] = 3); + ASSERT (duples[1,2][2] = 4); + ASSERT (duples[1,3][1] = 5); + ASSERT (duples[1,3][2] = 6); + ASSERT (duples[2,1][1] = 7); + ASSERT (duples[2,1][2] = 8); + ASSERT (duples[2,2][1] = 9); + ASSERT (duples[2,2][2] = 10); + ASSERT (duples[2,3][1] = 11); + ASSERT (duples[2,3][2] = 12) +END diff --git a/gcc/testsuite/algol68/execute/row-display-5.a68 b/gcc/testsuite/algol68/execute/row-display-5.a68 new file mode 100644 index 0000000..9d6b34b --- /dev/null +++ b/gcc/testsuite/algol68/execute/row-display-5.a68 @@ -0,0 +1,10 @@ +# { dg-options "-fstropping=upper" } # +BEGIN []INT list1 = (1,2,3), + list2 = (4,5,6), + list3 = (7,8,9); + [,]INT matrix = (list1, list2, list3); + [,,]INT cube = (matrix, matrix, matrix); + ASSERT (cube[1,1,1] = 1); + ASSERT (cube[2,2,2] = 5); + ASSERT (cube[3,3,3] = 9) +END diff --git a/gcc/testsuite/algol68/execute/rowing-1.a68 b/gcc/testsuite/algol68/execute/rowing-1.a68 new file mode 100644 index 0000000..792b7af --- /dev/null +++ b/gcc/testsuite/algol68/execute/rowing-1.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN []INT a = 10; + ASSERT (LWB a = 1 AND UPB a = 1 AND ELEMS a = 1); + ASSERT (a[1] = 10) +END diff --git a/gcc/testsuite/algol68/execute/rowing-10.a68 b/gcc/testsuite/algol68/execute/rowing-10.a68 new file mode 100644 index 0000000..8ae0caa --- /dev/null +++ b/gcc/testsuite/algol68/execute/rowing-10.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i := 10; + REF[,]INT a = i; + ASSERT (1 LWB a = 1 AND 1 UPB a = 1 AND 1 ELEMS a = 1); + ASSERT (2 LWB a = 1 AND 2 UPB a = 1 AND 2 ELEMS a = 1); + a[1,1] := a[1,1] + 1; + ASSERT (a[1,1] = 11) +END diff --git a/gcc/testsuite/algol68/execute/rowing-11.a68 b/gcc/testsuite/algol68/execute/rowing-11.a68 new file mode 100644 index 0000000..c34342c --- /dev/null +++ b/gcc/testsuite/algol68/execute/rowing-11.a68 @@ -0,0 +1,9 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i := 10; + REF[,,]INT a = i; + ASSERT (1 LWB a = 1 AND 1 UPB a = 1 AND 1 ELEMS a = 1); + ASSERT (2 LWB a = 1 AND 2 UPB a = 1 AND 2 ELEMS a = 1); + ASSERT (3 LWB a = 1 AND 3 UPB a = 1 AND 3 ELEMS a = 1); + a[1,1,1] := a[1,1,1] + 1; + ASSERT (a[1,1,1] = 11) +END diff --git a/gcc/testsuite/algol68/execute/rowing-12.a68 b/gcc/testsuite/algol68/execute/rowing-12.a68 new file mode 100644 index 0000000..d0bb7b4 --- /dev/null +++ b/gcc/testsuite/algol68/execute/rowing-12.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +# Rowing of NIL yields NIL. # +BEGIN REF INT i = NIL; + REF[]INT a = i; + ASSERT (a :=: NIL) +END diff --git a/gcc/testsuite/algol68/execute/rowing-13.a68 b/gcc/testsuite/algol68/execute/rowing-13.a68 new file mode 100644 index 0000000..9ac2517 --- /dev/null +++ b/gcc/testsuite/algol68/execute/rowing-13.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +# Rowing of NIL yields NIL. # +BEGIN REF INT i = (NIL); + REF[,,]INT a = (i); + ASSERT (a :=: NIL) +END diff --git a/gcc/testsuite/algol68/execute/rowing-2.a68 b/gcc/testsuite/algol68/execute/rowing-2.a68 new file mode 100644 index 0000000..d8c66de --- /dev/null +++ b/gcc/testsuite/algol68/execute/rowing-2.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN [][]INT a = 10; + ASSERT (a[1][1] = 10); + ASSERT (LWB a = 1 AND UPB a = 1 AND ELEMS a = 1); + ASSERT (LWB a[1] = 1 AND UPB a[1] = 1 AND ELEMS a[1] = 1) +END diff --git a/gcc/testsuite/algol68/execute/rowing-3.a68 b/gcc/testsuite/algol68/execute/rowing-3.a68 new file mode 100644 index 0000000..bfb8fd3 --- /dev/null +++ b/gcc/testsuite/algol68/execute/rowing-3.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN [][][]INT a = 10; + ASSERT (a[1][1][1] = 10); + ASSERT (LWB a = 1 AND UPB a = 1 AND ELEMS a = 1); + ASSERT (LWB a[1] = 1 AND UPB a[1] = 1 AND ELEMS a[1] = 1); + ASSERT (LWB a[1][1] = 1 AND UPB a[1][1] = 1 AND ELEMS a[1][1] = 1) +END diff --git a/gcc/testsuite/algol68/execute/rowing-4.a68 b/gcc/testsuite/algol68/execute/rowing-4.a68 new file mode 100644 index 0000000..0dd540d --- /dev/null +++ b/gcc/testsuite/algol68/execute/rowing-4.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +BEGIN MODE FOO = STRUCT (INT i, REAL r); + FOO foo = (10, 3.14); + [][]FOO a = foo; + ASSERT (LWB a = 1 AND UPB a = 1 AND ELEMS a = 1); + ASSERT (LWB a[1] = 1 AND UPB a[1] = 1 AND ELEMS a[1] = 1); + ASSERT (i OF a[1][1] = 10) +END diff --git a/gcc/testsuite/algol68/execute/rowing-5.a68 b/gcc/testsuite/algol68/execute/rowing-5.a68 new file mode 100644 index 0000000..2172617 --- /dev/null +++ b/gcc/testsuite/algol68/execute/rowing-5.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +# Rowing of a name. # +BEGIN INT i := 10; + REF[]INT a = i; + ASSERT (LWB a = 1 AND UPB a = 1 AND ELEMS a = 1); + a[1] := a[1] + 1; + ASSERT (a[1] = 11) +END diff --git a/gcc/testsuite/algol68/execute/rowing-6.a68 b/gcc/testsuite/algol68/execute/rowing-6.a68 new file mode 100644 index 0000000..9fb050a --- /dev/null +++ b/gcc/testsuite/algol68/execute/rowing-6.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +# Rowing of NIL yields NIL. # +BEGIN REF[]INT a = REF INT(NIL); + ASSERT (a :=: NIL) +END diff --git a/gcc/testsuite/algol68/execute/rowing-7.a68 b/gcc/testsuite/algol68/execute/rowing-7.a68 new file mode 100644 index 0000000..dde8392 --- /dev/null +++ b/gcc/testsuite/algol68/execute/rowing-7.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN [,]INT a = 10; + ASSERT (1 LWB a = 1 AND 1 UPB a = 1 AND 1 ELEMS a = 1); + ASSERT (2 LWB a = 1 AND 2 UPB a = 1 AND 2 ELEMS a = 1); + ASSERT (a[1,1] = 10) +END diff --git a/gcc/testsuite/algol68/execute/rowing-8.a68 b/gcc/testsuite/algol68/execute/rowing-8.a68 new file mode 100644 index 0000000..069ee3e --- /dev/null +++ b/gcc/testsuite/algol68/execute/rowing-8.a68 @@ -0,0 +1,12 @@ +# { dg-options "-fstropping=upper" } # +BEGIN []INT a = 10; + ASSERT (1 LWB a = 1 AND 1 UPB a = 1 AND 1 ELEMS a = 1); + [,]INT aa = a; + ASSERT (1 LWB aa = 1 AND 1 UPB aa = 1 AND 1 ELEMS aa = 1); + ASSERT (2 LWB aa = 1 AND 2 UPB aa = 1 AND 2 ELEMS aa = 1); + [,,]INT aaa = aa; + ASSERT (1 LWB aaa = 1 AND 1 UPB aaa = 1 AND 1 ELEMS aaa = 1); + ASSERT (2 LWB aaa = 1 AND 2 UPB aaa = 1 AND 2 ELEMS aaa = 1); + ASSERT (3 LWB aaa = 1 AND 3 UPB aaa = 1 AND 3 ELEMS aaa = 1); + ASSERT (aaa[1,1,1] = 10) +END diff --git a/gcc/testsuite/algol68/execute/rowing-9.a68 b/gcc/testsuite/algol68/execute/rowing-9.a68 new file mode 100644 index 0000000..5e34721 --- /dev/null +++ b/gcc/testsuite/algol68/execute/rowing-9.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN [,,]INT aaa = 10; + ASSERT (1 LWB aaa = 1 AND 1 UPB aaa = 1 AND 1 ELEMS aaa = 1); + ASSERT (2 LWB aaa = 1 AND 2 UPB aaa = 1 AND 2 ELEMS aaa = 1); + ASSERT (3 LWB aaa = 1 AND 3 UPB aaa = 1 AND 3 ELEMS aaa = 1); + ASSERT (aaa[1,1,1] = 10) +END diff --git a/gcc/testsuite/algol68/execute/selection-1.a68 b/gcc/testsuite/algol68/execute/selection-1.a68 new file mode 100644 index 0000000..c7087b2 --- /dev/null +++ b/gcc/testsuite/algol68/execute/selection-1.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +# Selecting a struct results in a sub-value. # +BEGIN MODE PERSON = STRUCT (INT age, REAL income, INT num children); + PERSON person = (44, 999.99, 0); + ASSERT (age OF person = 44); + ASSERT (num children OF person = 0) +END diff --git a/gcc/testsuite/algol68/execute/selection-2.a68 b/gcc/testsuite/algol68/execute/selection-2.a68 new file mode 100644 index 0000000..0d7b6c6 --- /dev/null +++ b/gcc/testsuite/algol68/execute/selection-2.a68 @@ -0,0 +1,14 @@ +# { dg-options "-fstropping=upper" } # +# Selecting a struct name results in sub-names. # +BEGIN MODE PERSON = STRUCT (INT age, REAL income, INT num children); + PERSON person; + age OF person := 44; + income OF person := 999.99; + num children OF person := 0; + ASSERT (age OF person = 44); + ASSERT (num children OF person = 0); + REF INT ptr to age := age OF person; + ASSERT (ptr to age = 44); + age OF person := 55; + ASSERT (ptr to age = 55) +END diff --git a/gcc/testsuite/algol68/execute/selection-3.a68 b/gcc/testsuite/algol68/execute/selection-3.a68 new file mode 100644 index 0000000..8648003 --- /dev/null +++ b/gcc/testsuite/algol68/execute/selection-3.a68 @@ -0,0 +1,12 @@ +# { dg-options "-fstropping=upper" } # +# Structs can be nested in other structs. # +BEGIN MODE INCOME = STRUCT (REAL salary, stock, INT code); + MODE PERSON = STRUCT (INT age, INCOME income, INT num children); + + PERSON person = (44, (999.99, 0.0, 10), 3); + + ASSERT (age OF person = 44); + ASSERT (code OF income OF person = 10); + ASSERT (num children OF person = 3); + ASSERT (num children OF person * code OF income OF person = 30) +END diff --git a/gcc/testsuite/algol68/execute/selection-4.a68 b/gcc/testsuite/algol68/execute/selection-4.a68 new file mode 100644 index 0000000..9e81db2 --- /dev/null +++ b/gcc/testsuite/algol68/execute/selection-4.a68 @@ -0,0 +1,19 @@ +# { dg-options "-fstropping=upper" } # +# Structs can be nested in other structs. Version with subnames. # +BEGIN MODE INCOME = STRUCT (REAL salary, stock, INT code); + MODE PERSON = STRUCT (INT age, INCOME income, INT num children); + + PERSON person; + + age OF person := 44; + salary OF income OF person := 999.99; + stock OF income OF person := 0.0; + num children OF person := 3; + code OF income OF person := num children OF person; + + ASSERT (age OF person = 44); + ASSERT (code OF income OF person = num children OF person); + ASSERT (code OF income OF person = 3); + ASSERT (num children OF person = 3); + ASSERT (num children OF person * code OF income OF person = 9) +END diff --git a/gcc/testsuite/algol68/execute/selection-5.a68 b/gcc/testsuite/algol68/execute/selection-5.a68 new file mode 100644 index 0000000..fde72d5 --- /dev/null +++ b/gcc/testsuite/algol68/execute/selection-5.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +# pr UPPER pr # +BEGIN MODE JORL = STRUCT (INT i, REAL r); + REF JORL jorl = LOC JORL := (10, 3.14); + ASSERT (i OF jorl = 10) +END diff --git a/gcc/testsuite/algol68/execute/selection-multiple-1.a68 b/gcc/testsuite/algol68/execute/selection-multiple-1.a68 new file mode 100644 index 0000000..1dc67ea --- /dev/null +++ b/gcc/testsuite/algol68/execute/selection-multiple-1.a68 @@ -0,0 +1,12 @@ +begin [10]struct (int age, string name) persons; + + for i to UPB persons + do age of persons[i] := 20 + i; + name of persons[i] := "x" * i + od; + + for i to UPB name of persons + do assert ((age of persons)[i] = 20 + i); + assert ((name of persons)[i] = "x" * i) + od +end diff --git a/gcc/testsuite/algol68/execute/selection-multiple-2.a68 b/gcc/testsuite/algol68/execute/selection-multiple-2.a68 new file mode 100644 index 0000000..89f848d --- /dev/null +++ b/gcc/testsuite/algol68/execute/selection-multiple-2.a68 @@ -0,0 +1,18 @@ +begin [10,5]struct (int age, string name) persons; + + for i to 1 UPB persons + do for j to 2 UPB persons + do age of persons[i,j] := 20 + i + j; + name of persons[i,j] := "x" * (i + j) + od + od; + + assert (1 UPB name of persons = 10); + assert (2 UPB name of persons = 5); + for i to 1 UPB name of persons + do for j to 2 UPB name of persons + do assert ((age of persons)[i,j] = 20 + i + j); + assert ((name of persons)[i,j] = "x" * (i + j)) + od + od +end diff --git a/gcc/testsuite/algol68/execute/serial-clause-1.a68 b/gcc/testsuite/algol68/execute/serial-clause-1.a68 new file mode 100644 index 0000000..7253f3f --- /dev/null +++ b/gcc/testsuite/algol68/execute/serial-clause-1.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i = 10; + BEGIN INT i = 20; # { dg-warning "hides" } # + ASSERT (i = 20); + i + END; + ASSERT (i = 10) +END diff --git a/gcc/testsuite/algol68/execute/serial-clause-10.a68 b/gcc/testsuite/algol68/execute/serial-clause-10.a68 new file mode 100644 index 0000000..294fc6c --- /dev/null +++ b/gcc/testsuite/algol68/execute/serial-clause-10.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +# NIL is not voided and can appear in a context requiring VOID. # +BEGIN (NIL); + SKIP +END diff --git a/gcc/testsuite/algol68/execute/serial-clause-2.a68 b/gcc/testsuite/algol68/execute/serial-clause-2.a68 new file mode 100644 index 0000000..e333c5c --- /dev/null +++ b/gcc/testsuite/algol68/execute/serial-clause-2.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN BEGIN ASSERT (i = 0); + i + END; + INT i = 10; + ASSERT (i = 10) +END diff --git a/gcc/testsuite/algol68/execute/serial-clause-3.a68 b/gcc/testsuite/algol68/execute/serial-clause-3.a68 new file mode 100644 index 0000000..821c4dc --- /dev/null +++ b/gcc/testsuite/algol68/execute/serial-clause-3.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN ASSERT (i = 0); + INT i = 10; + ASSERT (i = 10) +END diff --git a/gcc/testsuite/algol68/execute/serial-clause-4.a68 b/gcc/testsuite/algol68/execute/serial-clause-4.a68 new file mode 100644 index 0000000..2a03f65 --- /dev/null +++ b/gcc/testsuite/algol68/execute/serial-clause-4.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i := 10; + BEGIN ASSERT (i = 10); + i +:= 1 + END; + ASSERT (i = 11) +END diff --git a/gcc/testsuite/algol68/execute/serial-clause-5.a68 b/gcc/testsuite/algol68/execute/serial-clause-5.a68 new file mode 100644 index 0000000..89ab26e --- /dev/null +++ b/gcc/testsuite/algol68/execute/serial-clause-5.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN BEGIN ASSERT (i = 0); + i + END; + INT i := 10; + ASSERT (i = 10) +END diff --git a/gcc/testsuite/algol68/execute/serial-clause-6.a68 b/gcc/testsuite/algol68/execute/serial-clause-6.a68 new file mode 100644 index 0000000..13a132f --- /dev/null +++ b/gcc/testsuite/algol68/execute/serial-clause-6.a68 @@ -0,0 +1,10 @@ +# { dg-options "-fstropping=upper" } # +BEGIN ASSERT ((INT y := 10; + INT x := 20; + REF INT yy; + (REF INT xx := x; + yy := y; + xx := yy + ) + ) = 10) +END diff --git a/gcc/testsuite/algol68/execute/serial-clause-7.a68 b/gcc/testsuite/algol68/execute/serial-clause-7.a68 new file mode 100644 index 0000000..a33da4a --- /dev/null +++ b/gcc/testsuite/algol68/execute/serial-clause-7.a68 @@ -0,0 +1,10 @@ +# { dg-options "-fstropping=upper" } # +BEGIN ASSERT ((INT y := 10; + INT x := 20; + REF INT yy; + (REF INT xx := x; + yy := y; + xx + yy + ) + ) = 30) +END diff --git a/gcc/testsuite/algol68/execute/serial-clause-8.a68 b/gcc/testsuite/algol68/execute/serial-clause-8.a68 new file mode 100644 index 0000000..9d32e85 --- /dev/null +++ b/gcc/testsuite/algol68/execute/serial-clause-8.a68 @@ -0,0 +1,10 @@ +# { dg-options "-fstropping=upper" } # +BEGIN ASSERT ((INT y := 10; + INT x := 20; + REF INT yy; + (REF INT xx := x; + yy := y; + xx + ) + ) = 20) +END diff --git a/gcc/testsuite/algol68/execute/serial-clause-9.a68 b/gcc/testsuite/algol68/execute/serial-clause-9.a68 new file mode 100644 index 0000000..d8fe7c4 --- /dev/null +++ b/gcc/testsuite/algol68/execute/serial-clause-9.a68 @@ -0,0 +1,9 @@ +# { dg-options "-fstropping=upper" } # +# Serial clause with jump at the end. # + +BEGIN INT i := BEGIN BOOL cont := TRUE; + back: cont := FALSE; + IF cont THEN GOTO back FI + END; + ASSERT (i = 0) +END diff --git a/gcc/testsuite/algol68/execute/serial-dsa-1.a68 b/gcc/testsuite/algol68/execute/serial-dsa-1.a68 new file mode 100644 index 0000000..b27ad8c --- /dev/null +++ b/gcc/testsuite/algol68/execute/serial-dsa-1.a68 @@ -0,0 +1,18 @@ +{ This tests stack management for DSA serial clauses. + If it fails a stack overflow happens. } +begin { DSA due to stack allocated multiple. } + to 10000 + do [10000]int foo; + skip + od; + { DSA due to stack allocated multiple. Explicit loc. } + to 10000 + do loc[10000]int foo; + skip + od; + { DSA due to loc generator. } + to 10000 + do ref[]int jorl = loc [10000]int; + skip + od +end diff --git a/gcc/testsuite/algol68/execute/serial-dsa-2.a68 b/gcc/testsuite/algol68/execute/serial-dsa-2.a68 new file mode 100644 index 0000000..ca8594d --- /dev/null +++ b/gcc/testsuite/algol68/execute/serial-dsa-2.a68 @@ -0,0 +1,6 @@ +{ Check value yielding of DSA serial clauses. } +begin assert ((ref int foo = loc int := 100; + foo) = 100); + []int a = ([10000]int foo; foo[10] := 666; foo); + assert (a[10] = 666) +end diff --git a/gcc/testsuite/algol68/execute/serial-dsa-3.a68 b/gcc/testsuite/algol68/execute/serial-dsa-3.a68 new file mode 100644 index 0000000..7cb96dd --- /dev/null +++ b/gcc/testsuite/algol68/execute/serial-dsa-3.a68 @@ -0,0 +1,12 @@ +{ The jump to leak should not leak stack. } +begin by 10000 + do + by 10000 + do [10000]int foo; + skip; + goto leak + od; + leak: + skip + od +end diff --git a/gcc/testsuite/algol68/execute/serial-dsa-4.a68 b/gcc/testsuite/algol68/execute/serial-dsa-4.a68 new file mode 100644 index 0000000..b132af8 --- /dev/null +++ b/gcc/testsuite/algol68/execute/serial-dsa-4.a68 @@ -0,0 +1,4 @@ +begin (ref int a = loc int := 10; goto leak; a); +leak: + skip +end diff --git a/gcc/testsuite/algol68/execute/serial-dsa-5.a68 b/gcc/testsuite/algol68/execute/serial-dsa-5.a68 new file mode 100644 index 0000000..fb57d5e --- /dev/null +++ b/gcc/testsuite/algol68/execute/serial-dsa-5.a68 @@ -0,0 +1,3 @@ +begin assert ((ref int a = loc int := 10; a) + 1 = 11); + skip +end diff --git a/gcc/testsuite/algol68/execute/serial-dsa-6.a68 b/gcc/testsuite/algol68/execute/serial-dsa-6.a68 new file mode 100644 index 0000000..fb17d2d --- /dev/null +++ b/gcc/testsuite/algol68/execute/serial-dsa-6.a68 @@ -0,0 +1,4 @@ +{ DSA and completers in a serial clause. } +begin assert ((ref int a = loc int := 10; a exit foo: a +:= 1) + 1 = 11); + skip +end diff --git a/gcc/testsuite/algol68/execute/sign-int-1.a68 b/gcc/testsuite/algol68/execute/sign-int-1.a68 new file mode 100644 index 0000000..3c6d317 --- /dev/null +++ b/gcc/testsuite/algol68/execute/sign-int-1.a68 @@ -0,0 +1,28 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT zero = 0; + SHORT INT short zero = SHORT 0; + SHORT SHORT INT short short zero = SHORT SHORT 0; + LONG INT long zero = LONG 0; + LONG LONG INT long long zero = LONG LONG 0; + INT ten = 10; + SHORT INT short ten = SHORT 10; + SHORT SHORT INT short short ten = SHORT SHORT 10; + LONG INT long ten = LONG 10; + LONG LONG INT long long ten = LONG LONG 10; + ASSERT (SIGN zero = 0); + ASSERT (SIGN short zero = 0); + ASSERT (SIGN short short zero = 0); + ASSERT (SIGN long zero = 0); + ASSERT (SIGN long long zero = 0); + ASSERT (SIGN ten = 1); + ASSERT (SIGN short ten = 1); + ASSERT (SIGN short short ten = 1); + ASSERT (SIGN long ten = 1); + ASSERT (SIGN long long ten = 1); + ASSERT (SIGN -ten = -1); + ASSERT (SIGN -short ten = -1); + ASSERT (SIGN -short short ten = -1); + ASSERT (SIGN -long ten = -1); + ASSERT (SIGN -long long ten = -1) +END + diff --git a/gcc/testsuite/algol68/execute/sign-real-1.a68 b/gcc/testsuite/algol68/execute/sign-real-1.a68 new file mode 100644 index 0000000..f15fe96 --- /dev/null +++ b/gcc/testsuite/algol68/execute/sign-real-1.a68 @@ -0,0 +1,17 @@ +# { dg-options "-fstropping=upper" } # +BEGIN REAL zero = 0.0; + LONG REAL long zero = LONG 0.0; + LONG LONG REAL long long zero = LONG LONG 0.0; + REAL ten = 10.0; + LONG REAL long ten = LONG 10.0; + LONG LONG REAL long long ten = LONG LONG 10.0; + ASSERT (SIGN zero = 0); + ASSERT (SIGN long zero = 0); + ASSERT (SIGN long long zero = 0); + ASSERT (SIGN ten = 1); + ASSERT (SIGN long ten = 1); + ASSERT (SIGN long long ten = 1); + ASSERT (SIGN -ten = -1); + ASSERT (SIGN -long ten = -1); + ASSERT (SIGN -long long ten = -1) +END diff --git a/gcc/testsuite/algol68/execute/sin-1.a68 b/gcc/testsuite/algol68/execute/sin-1.a68 new file mode 100644 index 0000000..aac74f9 --- /dev/null +++ b/gcc/testsuite/algol68/execute/sin-1.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +BEGIN REAL r = 0.0; + LONG REAL rr = LONG 45.0; + LONG LONG REAL rrr = LONG LONG 60.0; + ASSERT (sin (r) = 0.0); + long sin (rr); + long long sin (rrr) +END diff --git a/gcc/testsuite/algol68/execute/skip-1.a68 b/gcc/testsuite/algol68/execute/skip-1.a68 new file mode 100644 index 0000000..a36de4f --- /dev/null +++ b/gcc/testsuite/algol68/execute/skip-1.a68 @@ -0,0 +1,13 @@ +# { dg-options "-fstropping=upper" } # +# Check SKIPs for INT modes # +BEGIN INT int skip = SKIP; + ASSERT (int skip = 0); + SHORT INT short int skip = SKIP; + ASSERT (short int skip = SHORT 0); + SHORT SHORT INT short short int skip = SKIP; + ASSERT (short short int skip = SHORT SHORT 0); + LONG INT long int skip = SKIP; + ASSERT (long int skip = LONG 0); + LONG LONG INT long long int skip = SKIP; + ASSERT (long long int skip = LONG LONG 0) +END diff --git a/gcc/testsuite/algol68/execute/skip-2.a68 b/gcc/testsuite/algol68/execute/skip-2.a68 new file mode 100644 index 0000000..5cefe40 --- /dev/null +++ b/gcc/testsuite/algol68/execute/skip-2.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +# Check SKIP values for BOOL and CHAR. # +BEGIN BOOL bool skip = SKIP; + ASSERT (bool skip = FALSE); + CHAR char skip = SKIP; + ASSERT (char skip = " ") +END diff --git a/gcc/testsuite/algol68/execute/skip-struct-1.a68 b/gcc/testsuite/algol68/execute/skip-struct-1.a68 new file mode 100644 index 0000000..72e9a11 --- /dev/null +++ b/gcc/testsuite/algol68/execute/skip-struct-1.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN MODE INCOME = STRUCT (REAL salary, stock, INT jorl); + MODE PERSON = STRUCT (INT age, INCOME income, INT num children); + PERSON person = SKIP; + ASSERT (age OF person = 0); + ASSERT (jorl OF income OF person = 0) +END diff --git a/gcc/testsuite/algol68/execute/slice-indexing-1.a68 b/gcc/testsuite/algol68/execute/slice-indexing-1.a68 new file mode 100644 index 0000000..53d14fa --- /dev/null +++ b/gcc/testsuite/algol68/execute/slice-indexing-1.a68 @@ -0,0 +1,10 @@ +# { dg-options "-fstropping=upper" } # +BEGIN STRING foo = "foo"; + ASSERT (foo[1] = "f"); + ASSERT (foo[2] = "o"); + ASSERT (foo[3] = "o"); + STRING bar := "foo"; + ASSERT (bar[1] = "f"); + ASSERT (bar[2] = "o"); + ASSERT (bar[3] = "o") +END diff --git a/gcc/testsuite/algol68/execute/slice-indexing-2.a68 b/gcc/testsuite/algol68/execute/slice-indexing-2.a68 new file mode 100644 index 0000000..defb675 --- /dev/null +++ b/gcc/testsuite/algol68/execute/slice-indexing-2.a68 @@ -0,0 +1,10 @@ +# { dg-options "-fstropping=upper" } # +BEGIN []INT foo = (1,2,3); + ASSERT (foo[1] = 1); + ASSERT (foo[2] = 2); + ASSERT (foo[3] = 3); + [3]INT bar := (1,2,3); + ASSERT (bar[1] = 1); + ASSERT (bar[2] = 2); + ASSERT (bar[3] = 3) +END diff --git a/gcc/testsuite/algol68/execute/slice-indexing-3.a68 b/gcc/testsuite/algol68/execute/slice-indexing-3.a68 new file mode 100644 index 0000000..593bd71 --- /dev/null +++ b/gcc/testsuite/algol68/execute/slice-indexing-3.a68 @@ -0,0 +1,10 @@ +# { dg-options "-fstropping=upper" } # +BEGIN []INT foo = (10,20,30); + ASSERT (foo[1] = 10); + ASSERT (foo[2] = 20); + ASSERT (foo[3] = 30); + [3]INT bar := (100,200,300); + ASSERT (bar[1] = 100); + ASSERT (bar[2] = 200); + ASSERT (bar[3] = 300) +END diff --git a/gcc/testsuite/algol68/execute/slice-indexing-4.a68 b/gcc/testsuite/algol68/execute/slice-indexing-4.a68 new file mode 100644 index 0000000..bf3a3b1 --- /dev/null +++ b/gcc/testsuite/algol68/execute/slice-indexing-4.a68 @@ -0,0 +1,10 @@ +# { dg-options "-fstropping=upper" } # +BEGIN MODE PERSON = STRUCT (INT i, STRING s); + []PERSON persons = ((10, "foo"), (20, "barbar"), (30, "baz")); + puts (s OF persons[1]); + puts (s OF persons[2]); + puts (s OF persons[3]); + ASSERT (i OF persons[1] = 10); + ASSERT (i OF persons[2] = 20); + ASSERT (i OF persons[3] = 30) +END diff --git a/gcc/testsuite/algol68/execute/slice-indexing-5.a68 b/gcc/testsuite/algol68/execute/slice-indexing-5.a68 new file mode 100644 index 0000000..f236eef --- /dev/null +++ b/gcc/testsuite/algol68/execute/slice-indexing-5.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN STRUCT([]INT i, REAL r) s = ((1,2,3), 3.14); + ASSERT ((i OF s)[1] = 1) +END diff --git a/gcc/testsuite/algol68/execute/slice-indexing-6.a68 b/gcc/testsuite/algol68/execute/slice-indexing-6.a68 new file mode 100644 index 0000000..8d79556 --- /dev/null +++ b/gcc/testsuite/algol68/execute/slice-indexing-6.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT rsp := 5; + [10]INT run stack; + run stack [(rsp -:= 1) + 1] +END diff --git a/gcc/testsuite/algol68/execute/slice-indexing-7.a68 b/gcc/testsuite/algol68/execute/slice-indexing-7.a68 new file mode 100644 index 0000000..d3870f6 --- /dev/null +++ b/gcc/testsuite/algol68/execute/slice-indexing-7.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN STRING s := "foo"; + s[2] := "x" +END diff --git a/gcc/testsuite/algol68/execute/sqrt-1.a68 b/gcc/testsuite/algol68/execute/sqrt-1.a68 new file mode 100644 index 0000000..725a772 --- /dev/null +++ b/gcc/testsuite/algol68/execute/sqrt-1.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +BEGIN REAL r = 100.0; + LONG REAL rr = LONG 25.0; + LONG LONG REAL rrr = LONG LONG 25.0; + ASSERT (sqrt (r) = 10.0); + ASSERT (long sqrt (rr) = LONG 5.0); + ASSERT (long long sqrt (rrr) = LONG LONG 5.0) +END diff --git a/gcc/testsuite/algol68/execute/string-1.a68 b/gcc/testsuite/algol68/execute/string-1.a68 new file mode 100644 index 0000000..28e44fe --- /dev/null +++ b/gcc/testsuite/algol68/execute/string-1.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN STRING s = ""; + ASSERT (LWB s = 1 AND UPB s = 0); + STRING t = (); + ASSERT (LWB t = 1 AND UPB t = 0) +END diff --git a/gcc/testsuite/algol68/execute/string-2.a68 b/gcc/testsuite/algol68/execute/string-2.a68 new file mode 100644 index 0000000..b0b898a --- /dev/null +++ b/gcc/testsuite/algol68/execute/string-2.a68 @@ -0,0 +1,13 @@ +# { dg-options "-fstropping=upper" } # +BEGIN STRING s; + ASSERT (LWB s = 1 AND UPB s = 0 AND ELEMS s = 0); + s := "foo"; + puts (s); + ASSERT (LWB s = 1 AND UPB s = 3 AND s[1] = "f" AND s[2] = "o" AND s[3] = "o"); + s := "bar"; + puts (s); + ASSERT (LWB s = 1 AND UPB s = 3 AND s[1] = "b" AND s[2] = "a" AND s[3] = "r"); + s := "x"; + ASSERT (LWB s = 1 AND UPB s = 1 AND s[1] = "x"); + puts (s) +END diff --git a/gcc/testsuite/algol68/execute/string-4.a68 b/gcc/testsuite/algol68/execute/string-4.a68 new file mode 100644 index 0000000..984d662 --- /dev/null +++ b/gcc/testsuite/algol68/execute/string-4.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN STRING s; + ASSERT (LWB s = 1 AND UPB s = 0 AND ELEMS s = 0); + s +:= "foo"; + ASSERT (LWB s = 1 AND UPB s = 3 AND ELEMS s = 3) +END diff --git a/gcc/testsuite/algol68/execute/string-break-1.a68 b/gcc/testsuite/algol68/execute/string-break-1.a68 new file mode 100644 index 0000000..e99cfe9e --- /dev/null +++ b/gcc/testsuite/algol68/execute/string-break-1.a68 @@ -0,0 +1,8 @@ +begin assert (UPB "foo'nbar" = 7 AND "foo'nbar"[4] = REPR 10); + assert (UPB "foo'tbar" = 7 AND "foo'tbar"[4] = REPR 9); + assert (UPB "foo'rbar" = 7 AND "foo'rbar"[4] = REPR 13); + assert (UPB "foo'fbar" = 7 AND "foo'fbar"[4] = REPR 12); + assert (UPB "foo''bar" = 7 AND "foo''bar"[4] = REPR 39); + assert ("'(u0048,u0065,U0000006c,u006c,U0000006f)" = "Hello"); + assert ("'( u0048, u0065, U0000006c,u006c, U0000006f )" = "Hello") +end diff --git a/gcc/testsuite/algol68/execute/struct-self-1.a68 b/gcc/testsuite/algol68/execute/struct-self-1.a68 new file mode 100644 index 0000000..94622aa --- /dev/null +++ b/gcc/testsuite/algol68/execute/struct-self-1.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN MODE NODE = STRUCT (INT code, REF NODE next); + NODE top; + ASSERT (next OF top :=: REF NODE (NIL)) +END diff --git a/gcc/testsuite/algol68/execute/struct-self-2.a68 b/gcc/testsuite/algol68/execute/struct-self-2.a68 new file mode 100644 index 0000000..a1127eb --- /dev/null +++ b/gcc/testsuite/algol68/execute/struct-self-2.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN MODE NODE = STRUCT (INT code, REF NODE next); + NODE top = (20, NIL); + ASSERT (code OF top = 20); + ASSERT (next OF top :=: NIL) +END diff --git a/gcc/testsuite/algol68/execute/struct-self-3.a68 b/gcc/testsuite/algol68/execute/struct-self-3.a68 new file mode 100644 index 0000000..3829daf --- /dev/null +++ b/gcc/testsuite/algol68/execute/struct-self-3.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN MODE NODE = STRUCT (INT code, REF NODE next); + NODE top := (10, NIL); + NODE next := (20, NIL); + next OF top := next; + ASSERT (code OF next OF top = 20) +END diff --git a/gcc/testsuite/algol68/execute/structure-display-1.a68 b/gcc/testsuite/algol68/execute/structure-display-1.a68 new file mode 100644 index 0000000..a53c247 --- /dev/null +++ b/gcc/testsuite/algol68/execute/structure-display-1.a68 @@ -0,0 +1,9 @@ +# { dg-options "-fstropping=upper" } # +BEGIN MODE INCOME = STRUCT (REAL salary, stock, INT code); + MODE PERSON = STRUCT (INT age, INCOME income, INT num children); + INCOME income = (100.0, 200.0, 300); + ASSERT (code OF income = 300); + PERSON person := (24, (1000.0, 2000.0, 3000), 3); + ASSERT (code OF income OF person = 3000); + ASSERT (num children OF person = 3) +END diff --git a/gcc/testsuite/algol68/execute/structure-display-2.a68 b/gcc/testsuite/algol68/execute/structure-display-2.a68 new file mode 100644 index 0000000..563f979 --- /dev/null +++ b/gcc/testsuite/algol68/execute/structure-display-2.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN MODE NODE = STRUCT (INT code, REF INT next); + INT val := 20; + NODE top = (10, val); + ASSERT (val = 20) +END diff --git a/gcc/testsuite/algol68/execute/structure-display-3.a68 b/gcc/testsuite/algol68/execute/structure-display-3.a68 new file mode 100644 index 0000000..178463f --- /dev/null +++ b/gcc/testsuite/algol68/execute/structure-display-3.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN MODE FOO = STRUCT (INT i, REF INT j); + INT x := 10; + FOO foo; + foo := (10, x); + ASSERT (j OF foo = 10) +END diff --git a/gcc/testsuite/algol68/execute/structure-display-4.a68 b/gcc/testsuite/algol68/execute/structure-display-4.a68 new file mode 100644 index 0000000..2a69172 --- /dev/null +++ b/gcc/testsuite/algol68/execute/structure-display-4.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +BEGIN MODE FOO = STRUCT (INT i, REF INT j); + INT x := 10; + REF INT xx; + FOO foo; + foo := (10, xx := x); + ASSERT (j OF foo = 10) +END diff --git a/gcc/testsuite/algol68/execute/structure-display-5.a68 b/gcc/testsuite/algol68/execute/structure-display-5.a68 new file mode 100644 index 0000000..0b99113 --- /dev/null +++ b/gcc/testsuite/algol68/execute/structure-display-5.a68 @@ -0,0 +1,10 @@ +# { dg-options "-fstropping=upper" } # +BEGIN MODE VEC = STRUCT (REAL xcoord, ycoord, zcoord); + VEC v1, v2, v3; + v1 := (1,1,1); + ASSERT (xcoord OF v1 = 1); + ASSERT (ycoord OF v1 = 1); + ASSERT (zcoord OF v1 = 1); + REAL x = 3.14, i = 3; + v2 := (x + 2, 3.4, i - 3) +END diff --git a/gcc/testsuite/algol68/execute/tan-1.a68 b/gcc/testsuite/algol68/execute/tan-1.a68 new file mode 100644 index 0000000..a7aede6 --- /dev/null +++ b/gcc/testsuite/algol68/execute/tan-1.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +BEGIN REAL r = 0.0; + LONG REAL rr = LONG 50.0; + LONG LONG REAL rrr = LONG LONG 50.0; + ASSERT (tan (r) = 0.0); + long tan (rr); + long long tan (rrr) +END diff --git a/gcc/testsuite/algol68/execute/timesab-string-1.a68 b/gcc/testsuite/algol68/execute/timesab-string-1.a68 new file mode 100644 index 0000000..3ff48fe --- /dev/null +++ b/gcc/testsuite/algol68/execute/timesab-string-1.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN STRING foo := "foo"; + foo TIMESAB 1; + ASSERT (foo = "foo"); + foo *:= 3; + ASSERT (foo = "foofoofoo") +END diff --git a/gcc/testsuite/algol68/execute/trimmer-1.a68 b/gcc/testsuite/algol68/execute/trimmer-1.a68 new file mode 100644 index 0000000..feae4ce --- /dev/null +++ b/gcc/testsuite/algol68/execute/trimmer-1.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN [2:4]INT arr := []INT(1,2,3)[@2]; + ASSERT (arr[3] = 2 AND arr[4] = 3); + []INT jorl = arr[2:3@20]; + ASSERT (LWB jorl = 20 AND UPB jorl = 21); + ASSERT (jorl[20] = 1 AND jorl [21] = 2) +END diff --git a/gcc/testsuite/algol68/execute/trimmer-10.a68 b/gcc/testsuite/algol68/execute/trimmer-10.a68 new file mode 100644 index 0000000..66db83a --- /dev/null +++ b/gcc/testsuite/algol68/execute/trimmer-10.a68 @@ -0,0 +1,14 @@ +# { dg-options "-fstropping=upper" } # +# Trimming with flat descriptors should lead to flat multiples. # +BEGIN []INT a = (1,2,3); + + ASSERT (UPB a[2:1] < LWB a[2:1]); + ASSERT (UPB a[20:2] < LWB a[20:2]); + + [,]INT aa = ((1,2,3), + (4,5,6), + (7,8,9)); + + ASSERT ((1 UPB aa[1,2:1]) < ((1 LWB aa[1,2:1]))); + ASSERT ((1 UPB aa[1,20:]) < ((1 LWB aa[1,20:]))) +END diff --git a/gcc/testsuite/algol68/execute/trimmer-2.a68 b/gcc/testsuite/algol68/execute/trimmer-2.a68 new file mode 100644 index 0000000..68996d2 --- /dev/null +++ b/gcc/testsuite/algol68/execute/trimmer-2.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN [2:4]INT arr := []INT(1,2,3)[@2]; + ASSERT (arr[3] = 2 AND arr[4] = 3); + []INT jorl = arr[2:3]; + ASSERT (LWB jorl = 1 AND UPB jorl = 2); + ASSERT (jorl[1] = 1 AND jorl [2] = 2) +END diff --git a/gcc/testsuite/algol68/execute/trimmer-3.a68 b/gcc/testsuite/algol68/execute/trimmer-3.a68 new file mode 100644 index 0000000..8af69db --- /dev/null +++ b/gcc/testsuite/algol68/execute/trimmer-3.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN [2:4]INT arr := []INT(1,2,3)[@2]; + ASSERT (arr[3] = 2 AND arr[4] = 3); + []INT jorl = arr[:@20]; + ASSERT (LWB jorl = 20 AND UPB jorl = 22); + ASSERT (jorl[20] = 1 AND jorl[21] = 2 AND jorl[22] = 3) +END diff --git a/gcc/testsuite/algol68/execute/trimmer-4.a68 b/gcc/testsuite/algol68/execute/trimmer-4.a68 new file mode 100644 index 0000000..fdcd370 --- /dev/null +++ b/gcc/testsuite/algol68/execute/trimmer-4.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN [2:4]INT arr := []INT(1,2,3)[@2]; + ASSERT (arr[3] = 2 AND arr[4] = 3); + []INT jorl = arr[3:]; + ASSERT (LWB jorl = 1 AND UPB jorl = 2); + ASSERT (jorl[1] = 2 AND jorl[2] = 3) +END diff --git a/gcc/testsuite/algol68/execute/trimmer-5.a68 b/gcc/testsuite/algol68/execute/trimmer-5.a68 new file mode 100644 index 0000000..892fea7 --- /dev/null +++ b/gcc/testsuite/algol68/execute/trimmer-5.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN [2:4]INT arr := []INT(1,2,3)[@2]; + ASSERT (arr[3] = 2 AND arr[4] = 3); + []INT jorl = arr[:3 AT 10]; + ASSERT (LWB jorl = 10 AND UPB jorl = 11); + ASSERT (jorl[10] = 1 AND jorl[11] = 2) +END diff --git a/gcc/testsuite/algol68/execute/trimmer-6.a68 b/gcc/testsuite/algol68/execute/trimmer-6.a68 new file mode 100644 index 0000000..3e9f293 --- /dev/null +++ b/gcc/testsuite/algol68/execute/trimmer-6.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN [2:4]INT arr := []INT(1,2,3)[@2]; + ASSERT (arr[3] = 2 AND arr[4] = 3); + []INT jorl = arr[:3@10]; + ASSERT (LWB jorl = 10 AND UPB jorl = 11); + ASSERT (jorl[10] = 1 AND jorl[11] = 2) +END diff --git a/gcc/testsuite/algol68/execute/trimmer-7.a68 b/gcc/testsuite/algol68/execute/trimmer-7.a68 new file mode 100644 index 0000000..8d3ebf9 --- /dev/null +++ b/gcc/testsuite/algol68/execute/trimmer-7.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN []INT arr = (1,2,3); + ASSERT (arr[2] = 2 AND arr[3] = 3); + []INT jorl = arr[2:3@20]; + ASSERT (LWB jorl = 20 AND UPB jorl = 21); + ASSERT (jorl[20] = 2 AND jorl [21] = 3) +END diff --git a/gcc/testsuite/algol68/execute/trimmer-8.a68 b/gcc/testsuite/algol68/execute/trimmer-8.a68 new file mode 100644 index 0000000..50842ef --- /dev/null +++ b/gcc/testsuite/algol68/execute/trimmer-8.a68 @@ -0,0 +1,9 @@ +# { dg-options "-fstropping=upper" } # +BEGIN [2:4]INT arr := []INT(1,2,3)[@2]; + ASSERT (arr[3] = 2 AND arr[4] = 3); + [10:11]INT jorl := arr[:3 AT 10]; + ASSERT (LWB jorl = 10 AND UPB jorl = 11); + ASSERT (jorl[10] = 1 AND jorl[11] = 2); + jorl[10] := 100; + ASSERT (jorl[10] = 100 AND jorl[11] = 2) +END diff --git a/gcc/testsuite/algol68/execute/trimmer-9.a68 b/gcc/testsuite/algol68/execute/trimmer-9.a68 new file mode 100644 index 0000000..aa0d52d --- /dev/null +++ b/gcc/testsuite/algol68/execute/trimmer-9.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN []INT arr = (1,2,3); + ASSERT (arr[2] = 2 AND arr[3] = 3); + []INT jorl = arr[@20]; + ASSERT (LWB jorl = 20 AND UPB jorl = 22); + ASSERT (jorl[20] = 1 AND jorl [21] = 2 AND jorl [22] = 3) +END diff --git a/gcc/testsuite/algol68/execute/trimmer-matrix-1.a68 b/gcc/testsuite/algol68/execute/trimmer-matrix-1.a68 new file mode 100644 index 0000000..2cec8a8 --- /dev/null +++ b/gcc/testsuite/algol68/execute/trimmer-matrix-1.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +BEGIN [,]INT matrix = ((1,2,3), + (4,5,6), + (7,8,9)); + [2]INT column := matrix[3,2:3]; + ASSERT (column[1] = 8); + ASSERT (column[2] = 9) +END diff --git a/gcc/testsuite/algol68/execute/trimmer-matrix-2.a68 b/gcc/testsuite/algol68/execute/trimmer-matrix-2.a68 new file mode 100644 index 0000000..6ca961f --- /dev/null +++ b/gcc/testsuite/algol68/execute/trimmer-matrix-2.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +BEGIN [,]INT matrix = ((1,2,3), + (4,5,6), + (7,8,9)); + [2]INT column := matrix[2,1:2]; + ASSERT (column[1] = 4); + ASSERT (column[2] = 5) +END diff --git a/gcc/testsuite/algol68/execute/trimmer-matrix-3.a68 b/gcc/testsuite/algol68/execute/trimmer-matrix-3.a68 new file mode 100644 index 0000000..5de2bee --- /dev/null +++ b/gcc/testsuite/algol68/execute/trimmer-matrix-3.a68 @@ -0,0 +1,9 @@ +# { dg-options "-fstropping=upper" } # +BEGIN [,]INT matrix = ((1,2,3), + (4,5,6), + (7,8,9)); + [3]INT column := matrix[2,1:3]; + ASSERT (column[1] = 4); + ASSERT (column[2] = 5); + ASSERT (column[3] = 6) +END diff --git a/gcc/testsuite/algol68/execute/trimmer-matrix-4.a68 b/gcc/testsuite/algol68/execute/trimmer-matrix-4.a68 new file mode 100644 index 0000000..71168ad --- /dev/null +++ b/gcc/testsuite/algol68/execute/trimmer-matrix-4.a68 @@ -0,0 +1,9 @@ +# { dg-options "-fstropping=upper" } # +BEGIN [,]INT matrix = ((1,2,3), + (4,5,6), + (7,8,9)); + []INT column = matrix[1:3,2]; + ASSERT (LWB column = 1); + ASSERT (UPB column = 3); + ASSERT (column[1] = 2 AND column[2] = 5 AND column[3] = 8) +END diff --git a/gcc/testsuite/algol68/execute/trimmer-matrix-5.a68 b/gcc/testsuite/algol68/execute/trimmer-matrix-5.a68 new file mode 100644 index 0000000..6d5f69b --- /dev/null +++ b/gcc/testsuite/algol68/execute/trimmer-matrix-5.a68 @@ -0,0 +1,9 @@ +# { dg-options "-fstropping=upper" } # +BEGIN [,]INT matrix = ((1,2,3), + (4,5,6), + (7,8,9)); + []INT column = matrix[2:3,2]; + ASSERT (LWB column = 1); + ASSERT (UPB column = 2); + ASSERT (column[1] = 5 AND column[2] = 8) +END diff --git a/gcc/testsuite/algol68/execute/trimmer-matrix-6.a68 b/gcc/testsuite/algol68/execute/trimmer-matrix-6.a68 new file mode 100644 index 0000000..59a3389 --- /dev/null +++ b/gcc/testsuite/algol68/execute/trimmer-matrix-6.a68 @@ -0,0 +1,9 @@ +# { dg-options "-fstropping=upper" } # +BEGIN [,]INT matrix = ((1,2,3), + (4,5,6), + (7,8,9)); + []INT row = matrix[3,1:3]; + ASSERT (LWB row = 1); + ASSERT (UPB row = 3); + ASSERT (row[1] = 7 AND row[2] = 8 AND row[3] = 9) +END diff --git a/gcc/testsuite/algol68/execute/trimmer-name-1.a68 b/gcc/testsuite/algol68/execute/trimmer-name-1.a68 new file mode 100644 index 0000000..6b4601c --- /dev/null +++ b/gcc/testsuite/algol68/execute/trimmer-name-1.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN REF[]CHAR t; + PROC foo = VOID: (HEAP[3]CHAR ss := ("1","2","3"); t := ss[1:3]); + foo; + ASSERT (LWB t = 1 AND UPB t = 3); + ASSERT (t[1] = "1" AND t[2] = "2" AND t[3] = "3") +END diff --git a/gcc/testsuite/algol68/execute/undefined-1.a68 b/gcc/testsuite/algol68/execute/undefined-1.a68 new file mode 100644 index 0000000..af97a0c --- /dev/null +++ b/gcc/testsuite/algol68/execute/undefined-1.a68 @@ -0,0 +1,10 @@ +# { dg-options "-fstropping=upper" } # +# j's value is undefined (defined to be 0 in GNU Algol) # +BEGIN INT x := 0; + FOR i TO 5 + DO ASSERT (j = 0); + IF j > 20 THEN stop FI; + INT j = x + i; + x +:= 1 + OD +END diff --git a/gcc/testsuite/algol68/execute/undefined-2.a68 b/gcc/testsuite/algol68/execute/undefined-2.a68 new file mode 100644 index 0000000..54addde --- /dev/null +++ b/gcc/testsuite/algol68/execute/undefined-2.a68 @@ -0,0 +1,9 @@ +# { dg-options "-fstropping=upper" } # +# The undefined value of the multiple `a' is an empty multiple. # +BEGIN ASSERT (i = 0); + ASSERT (LWB a = 1 AND UPB a = 0 AND ELEMS a = 0); + []INT a = (1, 2, 3); + INT i = 10; + ASSERT (i = 10); + ASSERT (LWB a = 1 AND UPB a = 3 AND ELEMS a = 3) +END diff --git a/gcc/testsuite/algol68/execute/undefined-3.a68 b/gcc/testsuite/algol68/execute/undefined-3.a68 new file mode 100644 index 0000000..2a746ad --- /dev/null +++ b/gcc/testsuite/algol68/execute/undefined-3.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN ASSERT (sum = 1); + PROC sum = INT: i + 1; + INT i = 10; + ASSERT (sum = 11) +END diff --git a/gcc/testsuite/algol68/execute/undefined-4.a68 b/gcc/testsuite/algol68/execute/undefined-4.a68 new file mode 100644 index 0000000..c602c05 --- /dev/null +++ b/gcc/testsuite/algol68/execute/undefined-4.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +BEGIN PROC is even = (INT n) BOOL: (n = zero | TRUE | is odd (n - 1)); + PROC is odd = (INT n) BOOL: (n = zero | FALSE | is even (n - 1)); + ASSERT (is even (20)); + ASSERT (is odd (13)); + INT zero := 0; + SKIP +END diff --git a/gcc/testsuite/algol68/execute/undefined-5.a68 b/gcc/testsuite/algol68/execute/undefined-5.a68 new file mode 100644 index 0000000..3cbb4141 --- /dev/null +++ b/gcc/testsuite/algol68/execute/undefined-5.a68 @@ -0,0 +1,9 @@ +# { dg-options "-fstropping=upper" } # +BEGIN PROC is even = (INT n) BOOL: (n = zero | TRUE | is odd (DECR n)); + PROC is odd = (INT n) BOOL: (n = zero | FALSE | is even (DECR n)); + OP DECR = (INT a) INT: a - 1; + ASSERT (is even (20)); + ASSERT (is odd (13)); + INT zero := 0; + SKIP +END diff --git a/gcc/testsuite/algol68/execute/uniting-1.a68 b/gcc/testsuite/algol68/execute/uniting-1.a68 new file mode 100644 index 0000000..dee0b50 --- /dev/null +++ b/gcc/testsuite/algol68/execute/uniting-1.a68 @@ -0,0 +1,11 @@ +# { dg-options "-fstropping=upper" } # +BEGIN UNION(INT,REAL,CHAR) datum := 3.14; + UNION(INT,REAL,[]INT,CHAR) datux; + datux := datum; + ASSERT (CASE datux + IN (INT): 10, + (REAL): 20, + (CHAR c): 30 + ESAC = 20); + SKIP +END diff --git a/gcc/testsuite/algol68/execute/uniting-2.a68 b/gcc/testsuite/algol68/execute/uniting-2.a68 new file mode 100644 index 0000000..5650050 --- /dev/null +++ b/gcc/testsuite/algol68/execute/uniting-2.a68 @@ -0,0 +1,11 @@ +# { dg-options "-fstropping=upper" } # +BEGIN UNION(INT,REAL,CHAR) datum := "X"; + UNION(INT,REAL,[]INT,CHAR) datux; + datux := datum; + ASSERT (CASE datux + IN (INT): 10, + (REAL): 20, + (CHAR c): 30 + ESAC = 30); + SKIP +END diff --git a/gcc/testsuite/algol68/execute/uniting-3.a68 b/gcc/testsuite/algol68/execute/uniting-3.a68 new file mode 100644 index 0000000..cb73c2f --- /dev/null +++ b/gcc/testsuite/algol68/execute/uniting-3.a68 @@ -0,0 +1,11 @@ +# { dg-options "-fstropping=upper" } # +BEGIN UNION(INT,REAL,CHAR) datum := 10; + UNION(INT,REAL,[]INT,CHAR) datux; + datux := datum; + ASSERT (CASE datux + IN (INT): 10, + (REAL): 20, + (CHAR c): 30 + ESAC = 10); + SKIP +END diff --git a/gcc/testsuite/algol68/execute/uniting-4.a68 b/gcc/testsuite/algol68/execute/uniting-4.a68 new file mode 100644 index 0000000..c7b82b8 --- /dev/null +++ b/gcc/testsuite/algol68/execute/uniting-4.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +# Uniting STRING to ROWS. # +BEGIN PROC strlen = (STRING s) INT: ELEMS s; + ASSERT (strlen ("foo") = 3) +END diff --git a/gcc/testsuite/algol68/execute/up-down-bits-1.a68 b/gcc/testsuite/algol68/execute/up-down-bits-1.a68 new file mode 100644 index 0000000..b13c055 --- /dev/null +++ b/gcc/testsuite/algol68/execute/up-down-bits-1.a68 @@ -0,0 +1,33 @@ +# { dg-options "-fstropping=upper" } # +# SHORTEN and LENG on SIZETY BITS # +BEGIN BITS b = 16rff; + ASSERT (b UP 4 = 16rff0); + ASSERT (b SHL 4 = 16rff0); + ASSERT (b DOWN 4 = 16r0f); + ASSERT (b SHR 4 = 16r0f); + + LONG BITS bb = LONG 16rff; + ASSERT (bb UP 4 = LONG 16rff0); + ASSERT (bb SHL 4 = LONG 16rff0); + ASSERT (bb DOWN 4 = LONG 16r0f); + ASSERT (bb SHR 4 = LONG 16r0f); + + LONG LONG BITS bbb = LONG LONG 16rff; + ASSERT (bbb UP 4 = LONG LONG 16rff0); + ASSERT (bbb SHL 4 = LONG LONG 16rff0); + ASSERT (bbb DOWN 4 = LONG LONG 16r0f); + ASSERT (bbb SHR 4 = LONG LONG 16r0f); + + SHORT BITS ss = SHORT 16rff; + ASSERT (ss UP 4 = SHORT 16rff0); + ASSERT (ss SHL 4 = SHORT 16rff0); + ASSERT (ss DOWN 4 = SHORT 16r0f); + ASSERT (ss SHR 4 = SHORT 16r0f); + + SHORT SHORT BITS sss = SHORT SHORT 16r0f; + ASSERT (sss UP 4 = SHORT SHORT 16rf0); + ASSERT (sss SHL 4 = SHORT SHORT 16rf0); + ASSERT (sss DOWN 2 = SHORT SHORT 16r03); + ASSERT (sss SHR 2 = SHORT SHORT 16r03) +END + diff --git a/gcc/testsuite/algol68/execute/upb-1.a68 b/gcc/testsuite/algol68/execute/upb-1.a68 new file mode 100644 index 0000000..d74ffa5 --- /dev/null +++ b/gcc/testsuite/algol68/execute/upb-1.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN ASSERT (UPB "foo" = 3); + ASSERT (1 UPB "foo" = 3); + ASSERT (UPB "" = 0); + ASSERT ((INT i = 1; UPB "") = 0) +END diff --git a/gcc/testsuite/algol68/execute/vacuum-1.a68 b/gcc/testsuite/algol68/execute/vacuum-1.a68 new file mode 100644 index 0000000..c4472c5 --- /dev/null +++ b/gcc/testsuite/algol68/execute/vacuum-1.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN []INT a = (); + ASSERT (LWB a = 1 AND UPB a = 0) +END diff --git a/gcc/testsuite/algol68/execute/variable-declaration-1.a68 b/gcc/testsuite/algol68/execute/variable-declaration-1.a68 new file mode 100644 index 0000000..0b1f4fc --- /dev/null +++ b/gcc/testsuite/algol68/execute/variable-declaration-1.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT x := 10; + REF INT xx := x := 20; + ASSERT (xx = 20) +END diff --git a/gcc/testsuite/algol68/execute/variable-declaration-2.a68 b/gcc/testsuite/algol68/execute/variable-declaration-2.a68 new file mode 100644 index 0000000..6b80f7b --- /dev/null +++ b/gcc/testsuite/algol68/execute/variable-declaration-2.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT x := 10; + REF INT xx := x; + ASSERT (xx = 10) +END diff --git a/gcc/testsuite/algol68/execute/variable-declaration-3.a68 b/gcc/testsuite/algol68/execute/variable-declaration-3.a68 new file mode 100644 index 0000000..4b1f080 --- /dev/null +++ b/gcc/testsuite/algol68/execute/variable-declaration-3.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT x := 10; + REF INT xx := (x := 20); + ASSERT (xx = 20) +END diff --git a/gcc/testsuite/algol68/execute/variable-declaration-4.a68 b/gcc/testsuite/algol68/execute/variable-declaration-4.a68 new file mode 100644 index 0000000..0c66d9e --- /dev/null +++ b/gcc/testsuite/algol68/execute/variable-declaration-4.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT x := 10; + REF INT xx := ((x)); + ASSERT (xx = 10) +END diff --git a/gcc/testsuite/algol68/execute/variable-declaration-5.a68 b/gcc/testsuite/algol68/execute/variable-declaration-5.a68 new file mode 100644 index 0000000..993bbe7 --- /dev/null +++ b/gcc/testsuite/algol68/execute/variable-declaration-5.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT x := 10; + REF REF INT xx := LOC REF INT := x := 20; + ASSERT (xx = 20) +END diff --git a/gcc/testsuite/algol68/execute/variable-declaration-6.a68 b/gcc/testsuite/algol68/execute/variable-declaration-6.a68 new file mode 100644 index 0000000..4f8b1c3 --- /dev/null +++ b/gcc/testsuite/algol68/execute/variable-declaration-6.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN MODE FOO = STRUCT (STRING s, INT i); + FOO f1 := ("foo", 10); + ASSERT (i OF f1 = 10) +END diff --git a/gcc/testsuite/algol68/execute/variable-declaration-heap-1.a68 b/gcc/testsuite/algol68/execute/variable-declaration-heap-1.a68 new file mode 100644 index 0000000..e7b40a1 --- /dev/null +++ b/gcc/testsuite/algol68/execute/variable-declaration-heap-1.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN HEAP INT a := 10; + ASSERT (a = 10) +END diff --git a/gcc/testsuite/algol68/execute/variable-declaration-heap-2.a68 b/gcc/testsuite/algol68/execute/variable-declaration-heap-2.a68 new file mode 100644 index 0000000..406e8c5 --- /dev/null +++ b/gcc/testsuite/algol68/execute/variable-declaration-heap-2.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN HEAP INT x, y; + SKIP +END diff --git a/gcc/testsuite/algol68/execute/variable-declaration-multiple-1.a68 b/gcc/testsuite/algol68/execute/variable-declaration-multiple-1.a68 new file mode 100644 index 0000000..17864f9 --- /dev/null +++ b/gcc/testsuite/algol68/execute/variable-declaration-multiple-1.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN [10,3]INT arr; + ASSERT (1 LWB arr = 1 AND 1 UPB arr = 10 AND 1 ELEMS arr = 10); + ASSERT (2 LWB arr = 1 AND 2 UPB arr = 3 AND 2 ELEMS arr = 3) +END diff --git a/gcc/testsuite/algol68/execute/variable-declaration-multiple-2.a68 b/gcc/testsuite/algol68/execute/variable-declaration-multiple-2.a68 new file mode 100644 index 0000000..d400ee8 --- /dev/null +++ b/gcc/testsuite/algol68/execute/variable-declaration-multiple-2.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT n = 10; + [n,3]INT arr; + ASSERT (1 LWB arr = 1 AND 1 UPB arr = 10 AND 1 ELEMS arr = 10); + ASSERT (2 LWB arr = 1 AND 2 UPB arr = 3 AND 2 ELEMS arr = 3) +END diff --git a/gcc/testsuite/algol68/execute/variable-declaration-multiple-3.a68 b/gcc/testsuite/algol68/execute/variable-declaration-multiple-3.a68 new file mode 100644 index 0000000..a006fed --- /dev/null +++ b/gcc/testsuite/algol68/execute/variable-declaration-multiple-3.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT n := 10, m := 3; + [n,m]INT arr; + ASSERT (1 LWB arr = 1 AND 1 UPB arr = 10 AND 1 ELEMS arr = 10); + ASSERT (2 LWB arr = 1 AND 2 UPB arr = 3 AND 2 ELEMS arr = 3) +END diff --git a/gcc/testsuite/algol68/execute/variable-declaration-multiple-4.a68 b/gcc/testsuite/algol68/execute/variable-declaration-multiple-4.a68 new file mode 100644 index 0000000..8e0467b --- /dev/null +++ b/gcc/testsuite/algol68/execute/variable-declaration-multiple-4.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT n := -4, m := 0; + [n:m,2]INT arr; + ASSERT (1 LWB arr = -4 AND 1 UPB arr = 0 AND 1 ELEMS arr = 5); + ASSERT (2 LWB arr = 1 AND 2 UPB arr = 2 AND 2 ELEMS arr = 2) +END diff --git a/gcc/testsuite/algol68/execute/variable-declaration-multiple-5.a68 b/gcc/testsuite/algol68/execute/variable-declaration-multiple-5.a68 new file mode 100644 index 0000000..0a1889f --- /dev/null +++ b/gcc/testsuite/algol68/execute/variable-declaration-multiple-5.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT n := -4, m := 0; + [n:m,2]INT arr; + FOR i FROM 1 LWB arr TO 1 UPB arr + DO FOR j FROM 2 LWB arr TO 2 UPB arr + DO ASSERT (arr[i,j] = INT(SKIP)) OD + OD +END diff --git a/gcc/testsuite/algol68/execute/variable-declaration-multiple-6.a68 b/gcc/testsuite/algol68/execute/variable-declaration-multiple-6.a68 new file mode 100644 index 0000000..3dde91c --- /dev/null +++ b/gcc/testsuite/algol68/execute/variable-declaration-multiple-6.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT n := -4, m := 0; + [n:m,2]REF INT arr; + FOR i FROM 1 LWB arr TO 1 UPB arr + DO FOR j FROM 2 LWB arr TO 2 UPB arr + DO ASSERT (REF INT (arr[i,j]) :=: REF INT(SKIP)) OD + OD +END diff --git a/gcc/testsuite/algol68/execute/variable-declaration-multiple-7.a68 b/gcc/testsuite/algol68/execute/variable-declaration-multiple-7.a68 new file mode 100644 index 0000000..75ee9a4 --- /dev/null +++ b/gcc/testsuite/algol68/execute/variable-declaration-multiple-7.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT n := 2, m := 3; + [n][m]INT arr; + FOR i FROM LWB arr TO UPB arr + DO FOR j FROM LWB arr[i] TO UPB arr[i] + DO ASSERT (arr[i][j] = INT(SKIP)) OD + OD +END diff --git a/gcc/testsuite/algol68/execute/variable-declaration-multiple-8.a68 b/gcc/testsuite/algol68/execute/variable-declaration-multiple-8.a68 new file mode 100644 index 0000000..391d282 --- /dev/null +++ b/gcc/testsuite/algol68/execute/variable-declaration-multiple-8.a68 @@ -0,0 +1,10 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT n := -4, m := 0; + [10][n:m,2]INT arr; + FOR k FROM LWB arr TO UPB arr + DO FOR i FROM 1 LWB arr[k] TO 1 UPB arr[k] + DO FOR j FROM 2 LWB arr[k] TO 2 UPB arr[k] + DO ASSERT (arr[k][i,j] = INT(SKIP)) OD + OD + OD +END diff --git a/gcc/testsuite/algol68/execute/variable-declaration-multiple-9.a68 b/gcc/testsuite/algol68/execute/variable-declaration-multiple-9.a68 new file mode 100644 index 0000000..21c20ea --- /dev/null +++ b/gcc/testsuite/algol68/execute/variable-declaration-multiple-9.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN [4]INT x, y; + SKIP +END diff --git a/gcc/testsuite/algol68/execute/voiding-1.a68 b/gcc/testsuite/algol68/execute/voiding-1.a68 new file mode 100644 index 0000000..ec6088d --- /dev/null +++ b/gcc/testsuite/algol68/execute/voiding-1.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i; + 2 = i +END diff --git a/gcc/testsuite/algol68/execute/widening-1.a68 b/gcc/testsuite/algol68/execute/widening-1.a68 new file mode 100644 index 0000000..642b226 --- /dev/null +++ b/gcc/testsuite/algol68/execute/widening-1.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT i = 10; + REAL foo = i; + ASSERT (foo > 9.9); + ASSERT (foo < 10.1) +END diff --git a/gcc/testsuite/algol68/execute/widening-2.a68 b/gcc/testsuite/algol68/execute/widening-2.a68 new file mode 100644 index 0000000..9ac6aae --- /dev/null +++ b/gcc/testsuite/algol68/execute/widening-2.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +BEGIN LONG INT i = LONG 10; + LONG REAL foo = i; + ASSERT (foo > LONG 9.9); + ASSERT (foo < LONG 10.1) +END diff --git a/gcc/testsuite/algol68/execute/widening-bits-1.a68 b/gcc/testsuite/algol68/execute/widening-bits-1.a68 new file mode 100644 index 0000000..6940a23 --- /dev/null +++ b/gcc/testsuite/algol68/execute/widening-bits-1.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +# XXX use environment enquiry for actual size of BITS # +BEGIN []BOOL foo = 16rffff; + ASSERT (LWB foo = 1 AND UPB foo = 32); + FOR i TO 16 DO ASSERT (foo[i] = FALSE) OD; + FOR i FROM 17 TO 32 DO ASSERT (foo[i] = TRUE) OD +END diff --git a/gcc/testsuite/algol68/execute/widening-bits-2.a68 b/gcc/testsuite/algol68/execute/widening-bits-2.a68 new file mode 100644 index 0000000..ea47b70 --- /dev/null +++ b/gcc/testsuite/algol68/execute/widening-bits-2.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +# XXX use environment enquiry for actual size of LONG BITS # +BEGIN []BOOL foo = LONG 16rffffffff; + ASSERT (LWB foo = 1 AND UPB foo = 64); + FOR i TO 32 DO ASSERT (foo[i] = FALSE) OD; + FOR i FROM 33 TO 64 DO ASSERT (foo[i] = TRUE) OD +END diff --git a/gcc/testsuite/algol68/execute/widening-bits-3.a68 b/gcc/testsuite/algol68/execute/widening-bits-3.a68 new file mode 100644 index 0000000..61e49da --- /dev/null +++ b/gcc/testsuite/algol68/execute/widening-bits-3.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +# XXX use environment enquiry for actual size of LONG LONG BITS # +BEGIN []BOOL foo = LONG LONG 16rffffffff; + ASSERT (LWB foo = 1 AND UPB foo = 64); + FOR i TO 32 DO ASSERT (foo[i] = FALSE) OD; + FOR i FROM 33 TO 64 DO ASSERT (foo[i] = TRUE) OD +END diff --git a/gcc/testsuite/algol68/execute/xor-bits-1.a68 b/gcc/testsuite/algol68/execute/xor-bits-1.a68 new file mode 100644 index 0000000..beeafb5 --- /dev/null +++ b/gcc/testsuite/algol68/execute/xor-bits-1.a68 @@ -0,0 +1,18 @@ +# { dg-options "-fstropping=upper" } # +# XOR for SIZETY BITS. # +BEGIN BITS b = 16rf0f0; + ASSERT ((b XOR 16r0f0f) = 16rffff); + ASSERT ((b XOR 16r00ff) = 16rf00f); + LONG BITS bb = LONG 16rf0f0; + ASSERT ((bb XOR LONG 16r0f0f) = LONG 16rffff); + ASSERT ((bb XOR LONG 16r00ff) = LONG 16rf00f); + LONG LONG BITS bbb = LONG LONG 16rf0f0; + ASSERT ((bbb XOR LONG LONG 16r0f0f) = LONG LONG 16rffff); + ASSERT ((bbb XOR LONG LONG 16r00ff) = LONG LONG 16rf00f); + SHORT BITS ss = SHORT 16rf0f0; + ASSERT ((ss XOR SHORT 16r0f0f) = SHORT 16rffff); + ASSERT ((ss XOR SHORT 16r00ff) = SHORT 16rf00f); + SHORT SHORT BITS sss = SHORT SHORT 16rf0; + ASSERT ((sss XOR SHORT SHORT 16r0f) = SHORT SHORT 16rff); + ASSERT ((sss XOR SHORT SHORT 16rff) = SHORT SHORT 16r0f) +END diff --git a/gcc/testsuite/c-c++-common/Wstringop-overflow.c b/gcc/testsuite/c-c++-common/Wstringop-overflow.c index 5757a23..9829fe1 100644 --- a/gcc/testsuite/c-c++-common/Wstringop-overflow.c +++ b/gcc/testsuite/c-c++-common/Wstringop-overflow.c @@ -90,8 +90,8 @@ void test_strncat (char **d, const char* s, int i) } { - size_t n = i < strlen (s) ? i : strlen (s); /* { dg-message "length computed here" } */ - T (d, s, n); /* { dg-message ".strncat\[^\n\r\]* specified bound depends on the length of the source argument" } */ + size_t n = i < strlen (s) ? i : strlen (s); /* { dg-message "length computed here" "PR122881" { xfail *-*-* } } */ + T (d, s, n); /* { dg-message ".strncat\[^\n\r\]* specified bound depends on the length of the source argument" "PR122881" { xfail *-*-* } } */ } } diff --git a/gcc/testsuite/c-c++-common/asan/asan-stack-small.c b/gcc/testsuite/c-c++-common/asan/asan-stack-small.c index 11a56b8..d045406 100644 --- a/gcc/testsuite/c-c++-common/asan/asan-stack-small.c +++ b/gcc/testsuite/c-c++-common/asan/asan-stack-small.c @@ -1,8 +1,9 @@ /* { dg-do run } */ -char *pa; -char *pb; -char *pc; +char *volatile pa; +char *volatile pb; +char *volatile pc; +typedef __UINTPTR_TYPE__ uintptr_t; void access (volatile char *ptr) { @@ -22,7 +23,14 @@ int main (int argc, char **argv) access (pb); access (pc); // access 'b' here - access (pa + 32); + if ((uintptr_t) pb == (uintptr_t) pa + 32) + access (pa + 32); + else if ((uintptr_t) pb == (uintptr_t) pa - 32) + access (pa - 32); + else if ((uintptr_t) pb == (uintptr_t) pa + 64) + access (pa + 64); + else if ((uintptr_t) pb == (uintptr_t) pa - 64) + access (pa - 64); return 0; } diff --git a/gcc/testsuite/c-c++-common/asan/pr59063-2.c b/gcc/testsuite/c-c++-common/asan/pr59063-2.c index 63a547f..6458ea7 100644 --- a/gcc/testsuite/c-c++-common/asan/pr59063-2.c +++ b/gcc/testsuite/c-c++-common/asan/pr59063-2.c @@ -1,4 +1,4 @@ -/* { dg-do run { target { *-*-linux* *-*-freebsd* } } } */ +/* { dg-do run { target { *-*-linux* *-*-freebsd* *-*-solaris2* } } } */ /* { dg-options "-static-libasan" } */ #include <time.h> diff --git a/gcc/testsuite/c-c++-common/goacc/cache-3-1.c b/gcc/testsuite/c-c++-common/goacc/cache-3-1.c index 5318a57..5577d71 100644 --- a/gcc/testsuite/c-c++-common/goacc/cache-3-1.c +++ b/gcc/testsuite/c-c++-common/goacc/cache-3-1.c @@ -6,6 +6,10 @@ /* { dg-additional-options "-fopenmp" } for '#pragma omp threadprivate'. */ +/* Array sections without spaces between [ and : or : and ] are incompatible + with C++26. */ +/* { dg-skip-if "array sections vs. C++26" { c++26 } } */ + /* The current implementation doesn't restrict where a 'cache' directive may appear, so we don't make any special arrangements. */ diff --git a/gcc/testsuite/c-c++-common/goacc/cache-3-2.c b/gcc/testsuite/c-c++-common/goacc/cache-3-2.c index ea5222e7..0c651c6 100644 --- a/gcc/testsuite/c-c++-common/goacc/cache-3-2.c +++ b/gcc/testsuite/c-c++-common/goacc/cache-3-2.c @@ -19,25 +19,25 @@ foo (int *p, int (*q)[10], int r[10], int s[10][10]) ; #pragma acc cache (r[-1:2]) ; - #pragma acc cache (s[-1:2][:]) + #pragma acc cache (s[-1:2][ : ]) ; #pragma acc cache (s[-1:2][-2:10]) /* { dg-error "negative low bound in array section in" } */ ; #pragma acc cache (a[-1:2]) /* { dg-error "negative low bound in array section in" } */ ; - #pragma acc cache (b[-1:2][0:]) /* { dg-error "negative low bound in array section in" } */ + #pragma acc cache (b[-1:2][0: ]) /* { dg-error "negative low bound in array section in" } */ ; #pragma acc cache (b[1:2][-2:10]) /* { dg-error "negative low bound in array section in" } */ ; #pragma acc cache (p[2:-3]) /* { dg-error "negative length in array section in" } */ ; - #pragma acc cache (q[2:-3][:]) /* { dg-error "negative length in array section in" } */ + #pragma acc cache (q[2:-3][ : ]) /* { dg-error "negative length in array section in" } */ ; #pragma acc cache (q[2:3][0:-1]) /* { dg-error "negative length in array section in" } */ ; #pragma acc cache (r[2:-5]) /* { dg-error "negative length in array section in" } */ ; - #pragma acc cache (s[2:-5][:]) /* { dg-error "negative length in array section in" } */ + #pragma acc cache (s[2:-5][ : ]) /* { dg-error "negative length in array section in" } */ ; #pragma acc cache (s[2:5][0:-4]) /* { dg-error "negative length in array section in" } */ ; diff --git a/gcc/testsuite/c-c++-common/goacc/data-clause-1.c b/gcc/testsuite/c-c++-common/goacc/data-clause-1.c index 9952ac4..b9871ec 100644 --- a/gcc/testsuite/c-c++-common/goacc/data-clause-1.c +++ b/gcc/testsuite/c-c++-common/goacc/data-clause-1.c @@ -30,13 +30,13 @@ foo (int g[3][10], int h[4][8], int i[2][10], int j[][9], ; #pragma acc parallel copyout(t[2:5]) /* { dg-error "is threadprivate variable" } */ ; - #pragma acc parallel copy(k[0.5:]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */ + #pragma acc parallel copy(k[0.5: ]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */ ; - #pragma acc parallel copyout(l[:7.5f]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */ + #pragma acc parallel copyout(l[ :7.5f]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */ ; - #pragma acc parallel copyin(m[p:]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */ + #pragma acc parallel copyin(m[p: ]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */ ; - #pragma acc parallel copy(n[:p]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */ + #pragma acc parallel copy(n[ :p]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */ ; #pragma acc parallel copyin(o[2:5]) /* { dg-error "does not have pointer or array type" } */ ; @@ -44,72 +44,72 @@ foo (int g[3][10], int h[4][8], int i[2][10], int j[][9], ; #pragma acc parallel create(s2) /* { dg-error "'s2' does not have a mappable type in 'map' clause" } */ ; - #pragma acc parallel copyin(a[:][:]) /* { dg-error "array type length expression must be specified" } */ + #pragma acc parallel copyin(a[ : ][ : ]) /* { dg-error "array type length expression must be specified" } */ bar (&a[0][0]); /* { dg-error "referenced in target region does not have a mappable type" } */ - #pragma acc parallel copy(b[-1:]) /* { dg-error "negative low bound in array section" } */ + #pragma acc parallel copy(b[-1: ]) /* { dg-error "negative low bound in array section" } */ bar (b); - #pragma acc parallel copy(c[:-3][:]) /* { dg-error "negative length in array section" } */ + #pragma acc parallel copy(c[ :-3][ : ]) /* { dg-error "negative length in array section" } */ bar (&c[0][0]); - #pragma acc parallel copyout(d[11:]) /* { dg-error "low bound \[^\n\r]* above array section size" } */ + #pragma acc parallel copyout(d[11: ]) /* { dg-error "low bound \[^\n\r]* above array section size" } */ bar (d); - #pragma acc parallel copyin(e[:11]) /* { dg-error "length \[^\n\r]* above array section size" } */ + #pragma acc parallel copyin(e[ :11]) /* { dg-error "length \[^\n\r]* above array section size" } */ bar (e); #pragma acc parallel copyin(f[1:10]) /* { dg-error "high bound \[^\n\r]* above array section size" } */ bar (f); - #pragma acc parallel copyout(g[:][0:10]) /* { dg-error "for array function parameter length expression must be specified" } */ + #pragma acc parallel copyout(g[ : ][0:10]) /* { dg-error "for array function parameter length expression must be specified" } */ bar (&g[0][0]); - #pragma acc parallel copyout(h[2:1][-1:]) /* { dg-error "negative low bound in array section" } */ + #pragma acc parallel copyout(h[2:1][-1: ]) /* { dg-error "negative low bound in array section" } */ bar (&h[0][0]); - #pragma acc parallel copy(h[:1][:-3]) /* { dg-error "negative length in array section" } */ + #pragma acc parallel copy(h[ :1][ :-3]) /* { dg-error "negative length in array section" } */ bar (&h[0][0]); - #pragma acc parallel copy(i[:1][11:]) /* { dg-error "low bound \[^\n\r]* above array section size" } */ + #pragma acc parallel copy(i[ :1][11: ]) /* { dg-error "low bound \[^\n\r]* above array section size" } */ bar (&i[0][0]); - #pragma acc parallel copyout(j[3:1][:10]) /* { dg-error "length \[^\n\r]* above array section size" } */ + #pragma acc parallel copyout(j[3:1][ :10]) /* { dg-error "length \[^\n\r]* above array section size" } */ bar (&j[0][0]); #pragma acc parallel copyin(j[30:1][5:5]) /* { dg-error "high bound \[^\n\r]* above array section size" } */ bar (&j[0][0]); - #pragma acc parallel copyin(a2[:1][2:4]) + #pragma acc parallel copyin(a2[ :1][2:4]) bar (&a2[0][0]); - #pragma acc parallel copy(a2[3:5][:]) + #pragma acc parallel copy(a2[3:5][ : ]) bar (&a2[0][0]); - #pragma acc parallel copyin(a2[3:5][:10]) + #pragma acc parallel copyin(a2[3:5][ :10]) bar (&a2[0][0]); - #pragma acc parallel copy(b2[0:]) + #pragma acc parallel copy(b2[0: ]) bar (b2); - #pragma acc parallel copy(c2[:3][:]) + #pragma acc parallel copy(c2[ :3][ : ]) bar (&c2[0][0]); - #pragma acc parallel copyout(d2[9:]) + #pragma acc parallel copyout(d2[9: ]) bar (d2); - #pragma acc parallel copyin(e2[:10]) + #pragma acc parallel copyin(e2[ :10]) bar (e2); #pragma acc parallel copyin(f2[1:9]) bar (f2); - #pragma acc parallel copy(g2[:1][2:4]) + #pragma acc parallel copy(g2[ :1][2:4]) bar (&g2[0][0]); - #pragma acc parallel copyout(h2[2:2][0:]) + #pragma acc parallel copyout(h2[2:2][0: ]) bar (&h2[0][0]); - #pragma acc parallel copy(h2[:1][:3]) + #pragma acc parallel copy(h2[ :1][ :3]) bar (&h2[0][0]); - #pragma acc parallel copyin(i2[:1][9:]) + #pragma acc parallel copyin(i2[ :1][9: ]) bar (&i2[0][0]); - #pragma acc parallel copyout(j2[3:4][:9]) + #pragma acc parallel copyout(j2[3:4][ :9]) bar (&j2[0][0]); #pragma acc parallel copyin(j2[30:1][5:4]) bar (&j2[0][0]); #pragma acc parallel copy(q[1:2]) ; - #pragma acc parallel copy(q[3:5][:10]) /* { dg-error "array section is not contiguous" } */ + #pragma acc parallel copy(q[3:5][ :10]) /* { dg-error "array section is not contiguous" } */ ; - #pragma acc parallel copy(r[3:][2:1][1:2]) + #pragma acc parallel copy(r[3: ][2:1][1:2]) ; - #pragma acc parallel copy(r[3:][2:1][1:2][:][0:4]) + #pragma acc parallel copy(r[3: ][2:1][1:2][ : ][0:4]) ; - #pragma acc parallel copy(r[3:][2:1][1:2][1:][0:4]) /* { dg-error "array section is not contiguous" } */ + #pragma acc parallel copy(r[3: ][2:1][1:2][1: ][0:4]) /* { dg-error "array section is not contiguous" } */ ; - #pragma acc parallel copy(r[3:][2:1][1:2][:3][0:4]) /* { dg-error "array section is not contiguous" } */ + #pragma acc parallel copy(r[3: ][2:1][1:2][ :3][0:4]) /* { dg-error "array section is not contiguous" } */ ; - #pragma acc parallel copy(r[3:][2:1][1:2][:][1:]) /* { dg-error "array section is not contiguous" } */ + #pragma acc parallel copy(r[3: ][2:1][1:2][ : ][1: ]) /* { dg-error "array section is not contiguous" } */ ; - #pragma acc parallel copy(r[3:][2:1][1:2][:][:3]) /* { dg-error "array section is not contiguous" } */ + #pragma acc parallel copy(r[3: ][2:1][1:2][ : ][ :3]) /* { dg-error "array section is not contiguous" } */ ; } diff --git a/gcc/testsuite/c-c++-common/goacc/data-clause-2.c b/gcc/testsuite/c-c++-common/goacc/data-clause-2.c index d4603b0..84c7dac 100644 --- a/gcc/testsuite/c-c++-common/goacc/data-clause-2.c +++ b/gcc/testsuite/c-c++-common/goacc/data-clause-2.c @@ -18,25 +18,25 @@ foo (int *p, int (*q)[10], int r[10], int s[10][10]) ; #pragma acc parallel copy (r[-1:2]) ; - #pragma acc parallel copy (s[-1:2][:]) + #pragma acc parallel copy (s[-1:2][ : ]) ; #pragma acc parallel copy (s[-1:2][-2:10]) /* { dg-error "negative low bound in array section in" } */ ; #pragma acc parallel copy (a[-1:2]) /* { dg-error "negative low bound in array section in" } */ ; - #pragma acc parallel copy (b[-1:2][0:]) /* { dg-error "negative low bound in array section in" } */ + #pragma acc parallel copy (b[-1:2][0: ]) /* { dg-error "negative low bound in array section in" } */ ; #pragma acc parallel copy (b[1:2][-2:10]) /* { dg-error "negative low bound in array section in" } */ ; #pragma acc parallel copy (p[2:-3]) /* { dg-error "negative length in array section in" } */ ; - #pragma acc parallel copy (q[2:-3][:]) /* { dg-error "negative length in array section in" } */ + #pragma acc parallel copy (q[2:-3][ : ]) /* { dg-error "negative length in array section in" } */ ; #pragma acc parallel copy (q[2:3][0:-1]) /* { dg-error "negative length in array section in" } */ ; #pragma acc parallel copy (r[2:-5]) /* { dg-error "negative length in array section in" } */ ; - #pragma acc parallel copy (s[2:-5][:]) /* { dg-error "negative length in array section in" } */ + #pragma acc parallel copy (s[2:-5][ : ]) /* { dg-error "negative length in array section in" } */ ; #pragma acc parallel copy (s[2:5][0:-4]) /* { dg-error "negative length in array section in" } */ ; diff --git a/gcc/testsuite/c-c++-common/goacc/data-clause-duplicate-1.c b/gcc/testsuite/c-c++-common/goacc/data-clause-duplicate-1.c index c87ef8b..3f7773d 100644 --- a/gcc/testsuite/c-c++-common/goacc/data-clause-duplicate-1.c +++ b/gcc/testsuite/c-c++-common/goacc/data-clause-duplicate-1.c @@ -8,7 +8,7 @@ fun (void) ; #pragma acc serial present(fp[0:2]) copyin(fp[0:2]) /* { dg-error "'fp' appears more than once in data clauses" } */ ; -#pragma acc data create(fp[:10]) deviceptr(fp) /* { dg-error "'fp' appears more than once in data clauses" } */ +#pragma acc data create(fp[ :10]) deviceptr(fp) /* { dg-error "'fp' appears more than once in data clauses" } */ ; #pragma acc data create(fp) present(fp) /* { dg-error "'fp' appears more than once in data clauses" } */ ; diff --git a/gcc/testsuite/c-c++-common/goacc/mdc-2.c b/gcc/testsuite/c-c++-common/goacc/mdc-2.c index 246625c..8ddda08 100644 --- a/gcc/testsuite/c-c++-common/goacc/mdc-2.c +++ b/gcc/testsuite/c-c++-common/goacc/mdc-2.c @@ -24,17 +24,17 @@ t1 () #pragma acc exit data detach(a) } -#pragma acc enter data attach(z[:5]) /* { dg-error "expected single pointer in .attach. clause" } */ +#pragma acc enter data attach(z[ :5]) /* { dg-error "expected single pointer in .attach. clause" } */ /* { dg-error "has no data movement clause" "" { target *-*-* } .-1 } */ -#pragma acc exit data detach(z[:5]) /* { dg-error "expected single pointer in .detach. clause" } */ +#pragma acc exit data detach(z[ :5]) /* { dg-error "expected single pointer in .detach. clause" } */ /* { dg-error "has no data movement clause" "" { target *-*-* } .-1 } */ -#pragma acc enter data attach(z[1:]) /* { dg-error "expected single pointer in .attach. clause" } */ +#pragma acc enter data attach(z[1: ]) /* { dg-error "expected single pointer in .attach. clause" } */ /* { dg-error "has no data movement clause" "" { target *-*-* } .-1 } */ -#pragma acc exit data detach(z[1:]) /* { dg-error "expected single pointer in .detach. clause" } */ +#pragma acc exit data detach(z[1: ]) /* { dg-error "expected single pointer in .detach. clause" } */ /* { dg-error "has no data movement clause" "" { target *-*-* } .-1 } */ -#pragma acc enter data attach(z[:]) /* { dg-error "expected single pointer in .attach. clause" } */ +#pragma acc enter data attach(z[ : ]) /* { dg-error "expected single pointer in .attach. clause" } */ /* { dg-error "has no data movement clause" "" { target *-*-* } .-1 } */ -#pragma acc exit data detach(z[:]) /* { dg-error "expected single pointer in .detach. clause" } */ +#pragma acc exit data detach(z[ : ]) /* { dg-error "expected single pointer in .detach. clause" } */ /* { dg-error "has no data movement clause" "" { target *-*-* } .-1 } */ #pragma acc enter data attach(z[3]) /* { dg-error "expected pointer in .attach. clause" } */ /* { dg-error "has no data movement clause" "" { target *-*-* } .-1 } */ diff --git a/gcc/testsuite/c-c++-common/goacc/readonly-1.c b/gcc/testsuite/c-c++-common/goacc/readonly-1.c index 300464c..a2fae4c 100644 --- a/gcc/testsuite/c-c++-common/goacc/readonly-1.c +++ b/gcc/testsuite/c-c++-common/goacc/readonly-1.c @@ -15,33 +15,33 @@ int main (void) int x[32], y[32]; struct S s = {x, 0}; - #pragma acc declare copyin(readonly: x/*[:32]*/, s/*.ptr[:16]*/) copyin(y/*[:32]*/) + #pragma acc declare copyin(readonly: x/*[ :32]*/, s/*.ptr[ :16]*/) copyin(y/*[ :32]*/) - #pragma acc parallel copyin(readonly: x[:32], s.ptr[:16]) copyin(y[:32]) + #pragma acc parallel copyin(readonly: x[ :32], s.ptr[ :16]) copyin(y[ :32]) { - #pragma acc cache (readonly: x[:32]) - #pragma acc cache (y[:32]) + #pragma acc cache (readonly: x[ :32]) + #pragma acc cache (y[ :32]) } - #pragma acc kernels copyin(readonly: x[:32], s.ptr[:16]) copyin(y[:32]) + #pragma acc kernels copyin(readonly: x[ :32], s.ptr[ :16]) copyin(y[ :32]) { - #pragma acc cache (readonly: x[:32]) - #pragma acc cache (y[:32]) + #pragma acc cache (readonly: x[ :32]) + #pragma acc cache (y[ :32]) } - #pragma acc serial copyin(readonly: x[:32], s.ptr[:16]) copyin(y[:32]) + #pragma acc serial copyin(readonly: x[ :32], s.ptr[ :16]) copyin(y[ :32]) { - #pragma acc cache (readonly: x[:32]) - #pragma acc cache (y[:32]) + #pragma acc cache (readonly: x[ :32]) + #pragma acc cache (y[ :32]) } - #pragma acc data copyin(readonly: x[:32], s.ptr[:16]) copyin(y[:32]) + #pragma acc data copyin(readonly: x[ :32], s.ptr[ :16]) copyin(y[ :32]) { - #pragma acc cache (readonly: x[:32]) - #pragma acc cache (y[:32]) + #pragma acc cache (readonly: x[ :32]) + #pragma acc cache (y[ :32]) } - #pragma acc enter data copyin(readonly: x[:32], s.ptr[:16]) copyin(y[:32]) + #pragma acc enter data copyin(readonly: x[ :32], s.ptr[ :16]) copyin(y[ :32]) return 0; } diff --git a/gcc/testsuite/c-c++-common/gomp/affinity-2.c b/gcc/testsuite/c-c++-common/gomp/affinity-2.c index 7f30296..78bd21d 100644 --- a/gcc/testsuite/c-c++-common/gomp/affinity-2.c +++ b/gcc/testsuite/c-c++-common/gomp/affinity-2.c @@ -1,4 +1,4 @@ -/* { dg-do compile } */ +/* { dg-do compile { target { c || c++23_down } } } */ /* { dg-options "-fopenmp" } */ extern int a[][10], a2[][10]; diff --git a/gcc/testsuite/c-c++-common/gomp/allocate-4.c b/gcc/testsuite/c-c++-common/gomp/allocate-4.c index 4e0f44a..2576d83 100644 --- a/gcc/testsuite/c-c++-common/gomp/allocate-4.c +++ b/gcc/testsuite/c-c++-common/gomp/allocate-4.c @@ -9,7 +9,7 @@ foo (void) s[0]++; #pragma omp parallel reduction (+: s[2:2]) allocate(s) s[2]++; -#pragma omp parallel reduction (+: p[:2]) allocate(p) +#pragma omp parallel reduction (+: p[ :2]) allocate(p) p[0]++; #pragma omp parallel reduction (+: p[2:2]) allocate(p) p[2]++; @@ -30,7 +30,7 @@ bar (void) #pragma omp teams distribute parallel for reduction (+: s[2:2]) allocate(s) for (i = 0; i < 64; i++) s[2]++; -#pragma omp teams distribute parallel for reduction (+: p[:2]) allocate(p) +#pragma omp teams distribute parallel for reduction (+: p[ :2]) allocate(p) for (i = 0; i < 64; i++) p[0]++; #pragma omp teams distribute parallel for reduction (+: p[2:2]) allocate(p) diff --git a/gcc/testsuite/c-c++-common/gomp/clauses-3.c b/gcc/testsuite/c-c++-common/gomp/clauses-3.c index 5618a91..a1f505a 100644 --- a/gcc/testsuite/c-c++-common/gomp/clauses-3.c +++ b/gcc/testsuite/c-c++-common/gomp/clauses-3.c @@ -17,9 +17,9 @@ main () bar (&s.v.a); #pragma omp target map (s.v.a) map (always, to: s.u) map (s.x) ; - #pragma omp target map (s.s[0]) map (s.v.b[:3]) + #pragma omp target map (s.s[0]) map (s.v.b[ :3]) ; - #pragma omp target map (s.s[0]) map (s.v.b[:3]) + #pragma omp target map (s.s[0]) map (s.v.b[ :3]) baz (s.s); return 0; } diff --git a/gcc/testsuite/c-c++-common/gomp/declare-mapper-3.c b/gcc/testsuite/c-c++-common/gomp/declare-mapper-3.c index e491bcd..c0ec21b 100644 --- a/gcc/testsuite/c-c++-common/gomp/declare-mapper-3.c +++ b/gcc/testsuite/c-c++-common/gomp/declare-mapper-3.c @@ -14,7 +14,7 @@ int main (int argc, char *argv[]) { int N = 1024; #pragma omp declare mapper (mapN:struct S s) map(to:s.ptr, s.size) \ - map(s.ptr[:N]) + map(s.ptr[ :N]) struct S s; s.ptr = (int *) malloc (sizeof (int) * N); diff --git a/gcc/testsuite/c-c++-common/gomp/delim-declare-variant-1.c b/gcc/testsuite/c-c++-common/gomp/delim-declare-variant-1.c new file mode 100644 index 0000000..28cac0d --- /dev/null +++ b/gcc/testsuite/c-c++-common/gomp/delim-declare-variant-1.c @@ -0,0 +1,55 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-fdump-tree-gimple" } */ + +/* Check basic functionality for the delimited form of "declare variant" + - no error re duplicate definitions + - variants are registered and correctly resolved at call site. */ + +int foo (int a) +{ + return a; +} + +int bar (int x) +{ + return x; +} + +#pragma omp begin declare variant match (construct={target}) +int foo (int a) +{ + return a + 1; +} + +int bar (int x) +{ + return x * 2; +} +#pragma omp end declare variant + +/* Because of the high score value, this variant for "bar" should always be + selected even when the one above also matches. */ +#pragma omp begin declare variant match (implementation={vendor(score(10000):"gnu")}) +int bar (int x) +{ + return x * 4; +} +#pragma omp end declare variant + +int main (void) +{ + if (foo (42) != 42) __builtin_abort (); + if (bar (3) != 12) __builtin_abort (); +#pragma omp target + { + if (foo (42) != 43) __builtin_abort (); + if (bar (3) != 12) __builtin_abort (); + } +} + +/* { dg-final { scan-tree-dump-times "omp declare variant base \\(foo.ompvariant." 1 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "omp declare variant base \\(bar.ompvariant." 2 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "foo \\(42\\)" 1 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "foo\\.ompvariant. \\(42\\)" 1 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "bar \\(3\\)" 0 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "bar\\.ompvariant. \\(3\\)" 2 "gimple" } } */ diff --git a/gcc/testsuite/c-c++-common/gomp/delim-declare-variant-2.c b/gcc/testsuite/c-c++-common/gomp/delim-declare-variant-2.c new file mode 100644 index 0000000..03bfe27 --- /dev/null +++ b/gcc/testsuite/c-c++-common/gomp/delim-declare-variant-2.c @@ -0,0 +1,66 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-foffload=disable -fdump-tree-original" } */ + +/* Check for elision of preprocessed code in a begin/end declare variant + construct when it can be determined at parse time that the selector + can never match. */ + +int foobar (int x, int y) +{ + return x * y; +} + +int baz (int x) +{ + return x; +} + +#pragma omp begin declare variant match (implementation={vendor("acme")}) /* { dg-warning "unknown property" } */ +int foobar (int x, int y) +{ + random junk that would ordinarily cause a parse error; + return x + y; +} +#pragma omp end declare variant + +#pragma omp begin declare variant match (device={kind(fpga)}) +int foobar (int x, int y) +{ + random junk that would ordinarily cause a parse error; + return x + y; +} +#pragma omp end declare variant + +/* Per the OpenMP specification, elision only happens when the implementation + or device selectors cannot match; the user/condition selector doesn't + matter for this. */ +#pragma omp begin declare variant match (user={condition (0)}) +int foobar (int x, int y) +{ + return x + y; +} +#pragma omp end declare variant + +/* Check that we're finding the right "omp end declare variant" when + constructs are nested. */ +#pragma omp begin declare variant match (implementation={vendor("acme")}) /* { dg-warning "unknown property" } */ + #pragma omp begin declare variant match (device={kind(fpga)}) + int baz (int x) + { + random junk that would ordinarily cause a parse error; + return x + 1; + } + #pragma omp end declare variant + #pragma omp begin declare variant match (device={kind(host)}) + int baz (int x) + { + random junk that would ordinarily cause a parse error; + return x + 2; + } + #pragma omp end declare variant +#pragma omp end declare variant + +/* { dg-final { scan-tree-dump-times "foobar.ompvariant" 1 "original" } } */ +/* { dg-final { scan-tree-dump-not "baz.ompvariant" "original" } } */ + + diff --git a/gcc/testsuite/c-c++-common/gomp/delim-declare-variant-3.c b/gcc/testsuite/c-c++-common/gomp/delim-declare-variant-3.c new file mode 100644 index 0000000..6b9d819 --- /dev/null +++ b/gcc/testsuite/c-c++-common/gomp/delim-declare-variant-3.c @@ -0,0 +1,49 @@ +/* { dg-do compile } */ + +/* Check that an error is diagnosed when a function defined in a + "begin declare variant" construct doesn't have a visible declaration + at that point. + + The spec is not completely clear on this; it says the base function must be + "declared elsewhere without an associated declare variant directive", + without defining what "elsewhere" means. Particularly in C++ it would be + incorrect to inject such a declaration at the point of the variant + definition (think of a variant for a class method that is defined with a + qualified name outside of the class declaration, for instance). The C++ + front end could differentiate between cases where base declaration injection + is allowed vs not, but for now it seems simplest just to require that a + definition always be visible. */ + +/* This declaration of baz is incompatible with the variant below. */ +extern double baz (double, double); + +/* This is not a function at all. */ +extern int quux; + +#pragma omp begin declare variant match (construct={target}) +int foo (int a) +{ + return a + 1; +} + +int bar (int x) /* { dg-error "no declaration of base function" } */ +{ + return x * 2; +} + +int baz (int x) /* { dg-error "variant function definition does not match declaration of .baz." } */ +{ + return x * 2; +} + +int quux (int x, int y) /* { dg-error "variant function definition does not match declaration of .quux." } */ +{ + return x + y; +} +#pragma omp end declare variant + +/* It's supposedly allowed to define the base function after the variant. */ +int foo (int a) +{ + return a; +} diff --git a/gcc/testsuite/c-c++-common/gomp/delim-declare-variant-4.c b/gcc/testsuite/c-c++-common/gomp/delim-declare-variant-4.c new file mode 100644 index 0000000..f6726ab --- /dev/null +++ b/gcc/testsuite/c-c++-common/gomp/delim-declare-variant-4.c @@ -0,0 +1,31 @@ +/* { dg-do compile } */ + +/* Check that a proper error is diagnosed if an "omp begin declare variant" + construct has an invalid selector, and that this causes the whole variant + to be skipped over rather than a duplicate definition error. */ + +int foo (int a) +{ + return a; +} + +#pragma omp begin declare variant match (construct=target) /* { dg-error "expected '\{' before 'target'" } */ +int foo (int a) +{ + return a + 1; +} + +#pragma omp end declare variant + +int bar (int x) +{ + return x; +} + +#pragma omp begin declare variant match (gibberish = {blah(1)}) /* { dg-error "expected context selector set name" } */ +int bar (int x) +{ + return x + 2; +} + +#pragma omp end declare variant diff --git a/gcc/testsuite/c-c++-common/gomp/delim-declare-variant-5.c b/gcc/testsuite/c-c++-common/gomp/delim-declare-variant-5.c new file mode 100644 index 0000000..4e1645b --- /dev/null +++ b/gcc/testsuite/c-c++-common/gomp/delim-declare-variant-5.c @@ -0,0 +1,26 @@ +/* { dg-do compile } */ + +/* Check that the simd trait is rejected in the match clause for + "begin declare variant". */ + +int foo (int a) +{ + return a; +} + +int bar (int x) +{ + return x; +} + +#pragma omp begin declare variant match (construct={target, simd}) /* { dg-error "the 'simd' selector is not permitted" } */ +int foo (int a) +{ + return a + 1; +} + +int bar (int x) +{ + return x * 2; +} +#pragma omp end declare variant diff --git a/gcc/testsuite/c-c++-common/gomp/delim-declare-variant-6.c b/gcc/testsuite/c-c++-common/gomp/delim-declare-variant-6.c new file mode 100644 index 0000000..0850063 --- /dev/null +++ b/gcc/testsuite/c-c++-common/gomp/delim-declare-variant-6.c @@ -0,0 +1,70 @@ +/* { dg-do compile { target x86_64-*-* } } */ +/* { dg-additional-options "-fdump-tree-gimple -foffload=disable" } */ + +/* Test merging of context selectors for nested "begin declare variant" + directives. + + The OpenMP 6.0 spec says: "the effective context selectors of the outer + directive are appended do the context selector of the inner directive to + form the effective context selector of the inner directive. If a + trait-set-selector is present on both directives, the trait-selector list of + the outer directive is appended to the trait-selector list of the inner + directive after equivalent trait-selectors have been removed from the outer + list." */ + +int f1 (int x) { return x; } +int f2 (int x) { return x; } +int f3 (int x) { return x; } +int f4 (int x) { return x; } +int f5 (int x) { return x; } + +/* Check that duplicate traits can be detected, even when the properties + use different forms. (If these were considered different, it would + trigger an error instead.) */ +#pragma omp begin declare variant match (implementation={vendor(gnu)}) +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +int f1 (int x) { return -x; } +#pragma omp end declare variant +#pragma omp end declare variant + +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +#pragma omp begin declare variant match (implementation={vendor(gnu)}) +int f2 (int x) { return -x; } +#pragma omp end declare variant +#pragma omp end declare variant + +/* Check that non-duplicate traits are collected from both inner and outer. */ + +#pragma omp begin declare variant match (device={kind("host")}) +#pragma omp begin declare variant match (device={arch("x86")}) +int f3 (int x) { return -x; } +#pragma omp end declare variant +#pragma omp end declare variant +/* { dg-final { scan-tree-dump "f3\\.ompvariant.*kind \\(.host.\\)" "gimple" } } */ +/* { dg-final { scan-tree-dump "f3\\.ompvariant.*arch \\(.x86.\\)" "gimple" } } */ + +/* Check that traits for construct selectors merge as expected. */ + +#pragma omp begin declare variant match (construct={parallel, for}) +#pragma omp begin declare variant match (construct={teams}) +int f4 (int x) { return -x; } +#pragma omp end declare variant +#pragma omp end declare variant +/* { dg-final { scan-tree-dump "f4\\.ompvariant.*teams, parallel, for" "gimple" } } */ + +/* Check that multiple trait sets are collected. */ + +extern int flag; + +#pragma omp begin declare variant match (construct={parallel, for}) +#pragma omp begin declare variant match (construct={teams}) +#pragma omp begin declare variant match (user={condition(flag)}) +#pragma omp begin declare variant match (device={kind("host")}) +int f5 (int x) { return -x; } +#pragma omp end declare variant +#pragma omp end declare variant +#pragma omp end declare variant +#pragma omp end declare variant +/* { dg-final { scan-tree-dump "f5\\.ompvariant.*teams, parallel, for" "gimple" } } */ +/* { dg-final { scan-tree-dump "f5\\.ompvariant.*flag" "gimple" } } */ +/* { dg-final { scan-tree-dump "f5\\.ompvariant.*kind \\(.host.\\)" "gimple" } } */ diff --git a/gcc/testsuite/c-c++-common/gomp/delim-declare-variant-7.c b/gcc/testsuite/c-c++-common/gomp/delim-declare-variant-7.c new file mode 100644 index 0000000..49a1d53 --- /dev/null +++ b/gcc/testsuite/c-c++-common/gomp/delim-declare-variant-7.c @@ -0,0 +1,27 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-fdump-tree-gimple" } */ + +/* Test that merging of context selectors from an enclosing "begin declare + variant" directive applies to nested regular "declare variant" directives + (not just nested "begin declare variant", which is tested elsewhere). */ + +extern int foo1 (int); +extern int foo2 (int); + +#pragma omp begin declare variant match (implementation={vendor(gnu)}) + +#pragma omp declare variant (foo1) \ + match (construct={parallel,for}) +#pragma omp declare variant (foo2) \ + match (device={kind(any)}) +extern int foo (int); + +#pragma omp end declare variant + +int foo (int x) +{ + return x + 42; +} + +/* { dg-final { scan-tree-dump-times "omp declare variant base" 2 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "vendor \\(.gnu.\\)" 2 "gimple" } } */ diff --git a/gcc/testsuite/c-c++-common/gomp/delim-declare-variant-8.c b/gcc/testsuite/c-c++-common/gomp/delim-declare-variant-8.c new file mode 100644 index 0000000..33f601d --- /dev/null +++ b/gcc/testsuite/c-c++-common/gomp/delim-declare-variant-8.c @@ -0,0 +1,54 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-fdump-tree-gimple" } */ + +/* This is the same as delim-declare-variant-1.c, but using attribute + syntax. */ + +int foo (int a) +{ + return a; +} + +int bar (int x) +{ + return x; +} + +[[omp::directive (begin declare variant, match (construct={target}))]]; +int foo (int a) +{ + return a + 1; +} + +int bar (int x) +{ + return x * 2; +} +[[omp::directive (end declare variant)]]; + +/* Because of the high score value, this variant for "bar" should always be + selected even when the one above also matches. */ +[[omp::directive (begin declare variant match (implementation={vendor(score(10000):"gnu")}))]]; +int bar (int x) +{ + return x * 4; +} +[[omp::directive (end declare variant)]]; + +int main (void) +{ + if (foo (42) != 42) __builtin_abort (); + if (bar (3) != 12) __builtin_abort (); +#pragma omp target + { + if (foo (42) != 43) __builtin_abort (); + if (bar (3) != 12) __builtin_abort (); + } +} + +/* { dg-final { scan-tree-dump-times "omp declare variant base \\(foo.ompvariant." 1 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "omp declare variant base \\(bar.ompvariant." 2 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "foo \\(42\\)" 1 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "foo\\.ompvariant. \\(42\\)" 1 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "bar \\(3\\)" 0 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "bar\\.ompvariant. \\(3\\)" 2 "gimple" } } */ diff --git a/gcc/testsuite/c-c++-common/gomp/delim-declare-variant-9.c b/gcc/testsuite/c-c++-common/gomp/delim-declare-variant-9.c new file mode 100644 index 0000000..6bf783e --- /dev/null +++ b/gcc/testsuite/c-c++-common/gomp/delim-declare-variant-9.c @@ -0,0 +1,47 @@ +/* { dg-do compile } */ + +/* Check diagnostics for mismatched pragma/attribute forms of delimited + declare variant. */ + +int foo (int a) +{ + return a; +} + +int bar (int x) +{ + return x; +} + +[[omp::directive (begin declare variant match (construct={target}))]]; +int foo (int a) +{ + return a + 1; +} + +int bar (int x) +{ + return x * 2; +} +#pragma omp end declare variant /* { dg-error "'begin declare variant' in attribute syntax terminated with 'end declare variant' in pragma syntax" } */ + +/* Because of the high score value, this variant for "bar" should always be + selected even when the one above also matches. */ +#pragma omp begin declare variant match (implementation={vendor(score(10000):"gnu")}) +int bar (int x) +{ + return x * 4; +} +[[omp::directive (end declare variant)]]; /* { dg-error "'begin declare variant' in pragma syntax terminated with 'end declare variant' in attribute syntax" } */ + +int main (void) +{ + if (foo (42) != 42) __builtin_abort (); + if (bar (3) != 12) __builtin_abort (); +#pragma omp target + { + if (foo (42) != 43) __builtin_abort (); + if (bar (3) != 12) __builtin_abort (); + } +} + diff --git a/gcc/testsuite/c-c++-common/gomp/depend-1.c b/gcc/testsuite/c-c++-common/gomp/depend-1.c index 599031f..575bde9 100644 --- a/gcc/testsuite/c-c++-common/gomp/depend-1.c +++ b/gcc/testsuite/c-c++-common/gomp/depend-1.c @@ -18,61 +18,61 @@ foo (int g[3][10], int h[4][8], int i[2][10], int j[][9], ; #pragma omp task depend(out: t[2:5]) ; - #pragma omp task depend(inout: k[0.5:]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */ + #pragma omp task depend(inout: k[0.5: ]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */ ; - #pragma omp task depend(in: l[:7.5f]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */ + #pragma omp task depend(in: l[ :7.5f]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */ ; - #pragma omp task depend(out: m[p:]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */ + #pragma omp task depend(out: m[p: ]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */ ; - #pragma omp task depend(inout: n[:p]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */ + #pragma omp task depend(inout: n[ :p]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */ ; #pragma omp task depend(in: o[2:5]) /* { dg-error "does not have pointer or array type" } */ ; - #pragma omp task depend(out: a[:][2:4]) /* { dg-error "array type length expression must be specified" } */ + #pragma omp task depend(out: a[ : ][2:4]) /* { dg-error "array type length expression must be specified" } */ ; - #pragma omp task depend(inout: b[-1:]) /* { dg-error "negative low bound in array section" } */ + #pragma omp task depend(inout: b[-1: ]) /* { dg-error "negative low bound in array section" } */ ; - #pragma omp task depend(inout: c[:-3][1:1]) /* { dg-error "negative length in array section" } */ + #pragma omp task depend(inout: c[ :-3][1:1]) /* { dg-error "negative length in array section" } */ ; - #pragma omp task depend(in: d[11:]) /* { dg-error "low bound \[^\n\r]* above array section size" } */ + #pragma omp task depend(in: d[11: ]) /* { dg-error "low bound \[^\n\r]* above array section size" } */ ; - #pragma omp task depend(out: e[:11]) /* { dg-error "length \[^\n\r]* above array section size" } */ + #pragma omp task depend(out: e[ :11]) /* { dg-error "length \[^\n\r]* above array section size" } */ ; #pragma omp task depend(out: f[1:10]) /* { dg-error "high bound \[^\n\r]* above array section size" } */ ; - #pragma omp task depend(in: g[:][2:4]) /* { dg-error "for array function parameter length expression must be specified" } */ + #pragma omp task depend(in: g[ : ][2:4]) /* { dg-error "for array function parameter length expression must be specified" } */ ; - #pragma omp task depend(in: h[2:2][-1:]) /* { dg-error "negative low bound in array section" } */ + #pragma omp task depend(in: h[2:2][-1: ]) /* { dg-error "negative low bound in array section" } */ ; - #pragma omp task depend(inout: h[:1][:-3]) /* { dg-error "negative length in array section" } */ + #pragma omp task depend(inout: h[ :1][ :-3]) /* { dg-error "negative length in array section" } */ ; - #pragma omp task depend(out: i[:1][11:]) /* { dg-error "low bound \[^\n\r]* above array section size" } */ + #pragma omp task depend(out: i[ :1][11: ]) /* { dg-error "low bound \[^\n\r]* above array section size" } */ ; - #pragma omp task depend(in: j[3:4][:10]) /* { dg-error "length \[^\n\r]* above array section size" } */ + #pragma omp task depend(in: j[3:4][ :10]) /* { dg-error "length \[^\n\r]* above array section size" } */ ; #pragma omp task depend(out: j[30:10][5:5]) /* { dg-error "high bound \[^\n\r]* above array section size" } */ ; - #pragma omp task depend(out: a2[:3][2:4]) + #pragma omp task depend(out: a2[ :3][2:4]) ; - #pragma omp task depend(inout: b2[0:]) + #pragma omp task depend(inout: b2[0: ]) ; - #pragma omp task depend(inout: c2[:3][1:1]) + #pragma omp task depend(inout: c2[ :3][1:1]) ; - #pragma omp task depend(in: d2[9:]) + #pragma omp task depend(in: d2[9: ]) ; - #pragma omp task depend(out: e2[:10]) + #pragma omp task depend(out: e2[ :10]) ; #pragma omp task depend(out: f2[1:9]) ; - #pragma omp task depend(in: g2[:2][2:4]) + #pragma omp task depend(in: g2[ :2][2:4]) ; - #pragma omp task depend(in: h2[2:2][0:]) + #pragma omp task depend(in: h2[2:2][0: ]) ; - #pragma omp task depend(inout: h2[:1][:3]) + #pragma omp task depend(inout: h2[ :1][ :3]) ; - #pragma omp task depend(out: i2[:1][9:]) + #pragma omp task depend(out: i2[ :1][9: ]) ; - #pragma omp task depend(in: j2[3:4][:9]) + #pragma omp task depend(in: j2[3:4][ :9]) ; #pragma omp task depend(out: j2[30:10][5:4]) ; diff --git a/gcc/testsuite/c-c++-common/gomp/depend-2.c b/gcc/testsuite/c-c++-common/gomp/depend-2.c index 99bf8ae..b566847 100644 --- a/gcc/testsuite/c-c++-common/gomp/depend-2.c +++ b/gcc/testsuite/c-c++-common/gomp/depend-2.c @@ -6,12 +6,12 @@ void foo (int a[10][10][10], int **b) { int c[10][10][10]; - #pragma omp task depend(out: a[2:4][3:][:7], b[1:7][2:8]) + #pragma omp task depend(out: a[2:4][3: ][ :7], b[1:7][2:8]) bar (a); int i = 1, j = 3, k = 2, l = 6; - #pragma omp task depend(in: a[++i:++j][++k:][:++l]) + #pragma omp task depend(in: a[++i:++j][++k: ][ :++l]) bar (a); - #pragma omp task depend(out: a[7:2][:][:], c[5:2][:][:]) + #pragma omp task depend(out: a[7:2][ : ][ : ], c[5:2][ : ][ : ]) { bar (c); bar (a); diff --git a/gcc/testsuite/c-c++-common/gomp/depend-3.c b/gcc/testsuite/c-c++-common/gomp/depend-3.c index 22fcd8d..2cea43a 100644 --- a/gcc/testsuite/c-c++-common/gomp/depend-3.c +++ b/gcc/testsuite/c-c++-common/gomp/depend-3.c @@ -6,16 +6,16 @@ void foo (int a[10][10][10], int **b, int x) { int c[10][10][10]; - #pragma omp task depend(out: a[2:4][3:0][:7]) /* { dg-error "zero length array section" } */ + #pragma omp task depend(out: a[2:4][3:0][ :7]) /* { dg-error "zero length array section" } */ bar (a); - #pragma omp task depend(inout: b[:7][0:0][:0]) /* { dg-error "zero length array section" } */ + #pragma omp task depend(inout: b[ :7][0:0][ :0]) /* { dg-error "zero length array section" } */ bar (a); - #pragma omp task depend(in: c[:][:][10:]) /* { dg-error "zero length array section" } */ + #pragma omp task depend(in: c[ : ][ : ][10: ]) /* { dg-error "zero length array section" } */ bar (c); - #pragma omp task depend(out: a[2:4][3:0][:x]) /* { dg-error "zero length array section" } */ + #pragma omp task depend(out: a[2:4][3:0][ :x]) /* { dg-error "zero length array section" } */ bar (a); - #pragma omp task depend(inout: b[:x][0:0][:0]) /* { dg-error "zero length array section" } */ + #pragma omp task depend(inout: b[ :x][0:0][ :0]) /* { dg-error "zero length array section" } */ bar (a); - #pragma omp task depend(in: c[:][x-2:x][10:]) /* { dg-error "zero length array section" } */ + #pragma omp task depend(in: c[ : ][x-2:x][10: ]) /* { dg-error "zero length array section" } */ bar (c); } diff --git a/gcc/testsuite/c-c++-common/gomp/depend-4.c b/gcc/testsuite/c-c++-common/gomp/depend-4.c index d40b1fa..0fd771e 100644 --- a/gcc/testsuite/c-c++-common/gomp/depend-4.c +++ b/gcc/testsuite/c-c++-common/gomp/depend-4.c @@ -25,13 +25,13 @@ foo (int *p, int (*q)[10], int r[10], int s[10][10]) ; #pragma omp task depend (inout: p[2:-3]) /* { dg-error "negative length in array section in" } */ ; - #pragma omp task depend (inout: q[2:-3][:]) /* { dg-error "negative length in array section in" } */ + #pragma omp task depend (inout: q[2:-3][ : ]) /* { dg-error "negative length in array section in" } */ ; #pragma omp task depend (inout: q[2:3][0:-1]) /* { dg-error "negative length in array section in" } */ ; #pragma omp task depend (inout: r[2:-5]) /* { dg-error "negative length in array section in" } */ ; - #pragma omp task depend (inout: s[2:-5][:]) /* { dg-error "negative length in array section in" } */ + #pragma omp task depend (inout: s[2:-5][ : ]) /* { dg-error "negative length in array section in" } */ ; #pragma omp task depend (inout: s[2:5][0:-4]) /* { dg-error "negative length in array section in" } */ ; diff --git a/gcc/testsuite/c-c++-common/gomp/depend-5.c b/gcc/testsuite/c-c++-common/gomp/depend-5.c index 993987f..3a1b707 100644 --- a/gcc/testsuite/c-c++-common/gomp/depend-5.c +++ b/gcc/testsuite/c-c++-common/gomp/depend-5.c @@ -15,11 +15,11 @@ foo (void) ; #pragma omp task depend(out: d[2]) ; - #pragma omp task depend(in: d[:]) + #pragma omp task depend(in: d[ : ]) ; #pragma omp task depend(in: d[2:2]) ; - #pragma omp task depend(in: d[:2]) + #pragma omp task depend(in: d[ :2]) ; #pragma omp task depend(inout: d[1].b->c[2]) ; diff --git a/gcc/testsuite/c-c++-common/gomp/depend-6.c b/gcc/testsuite/c-c++-common/gomp/depend-6.c index 4684653..c365cf6 100644 --- a/gcc/testsuite/c-c++-common/gomp/depend-6.c +++ b/gcc/testsuite/c-c++-common/gomp/depend-6.c @@ -13,9 +13,9 @@ struct U i; void foo (void) { - #pragma omp task depend(in: d[:2].b->c[2]) /* { dg-error "expected" } */ + #pragma omp task depend(in: d[ :2].b->c[2]) /* { dg-error "expected" } */ ; - #pragma omp task depend(inout: d[1:].b->c[2]) /* { dg-error "expected" } */ + #pragma omp task depend(inout: d[1: ].b->c[2]) /* { dg-error "expected" } */ ; #pragma omp task depend(out: d[0:1].a) /* { dg-error "expected" } */ ; diff --git a/gcc/testsuite/c-c++-common/gomp/dispatch-1.c b/gcc/testsuite/c-c++-common/gomp/dispatch-1.c index 2a4e939..35eb3b8 100644 --- a/gcc/testsuite/c-c++-common/gomp/dispatch-1.c +++ b/gcc/testsuite/c-c++-common/gomp/dispatch-1.c @@ -64,7 +64,7 @@ void f1 (void) f2 (); #pragma omp dispatch depend(inout: sp) f2 (); -#pragma omp dispatch depend(inoutset: arr[:2]) +#pragma omp dispatch depend(inoutset: arr[ :2]) f2 (); #pragma omp dispatch depend(out: arr) f2 (); diff --git a/gcc/testsuite/c-c++-common/gomp/dyn_groupprivate-1.c b/gcc/testsuite/c-c++-common/gomp/dyn_groupprivate-1.c new file mode 100644 index 0000000..c49189d --- /dev/null +++ b/gcc/testsuite/c-c++-common/gomp/dyn_groupprivate-1.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-fdump-tree-original" } */ + +void f() +{ + int N = 1024; + + #pragma omp target dyn_groupprivate(1024) // { dg-message "sorry, unimplemented: 'dyn_groupprivate' clause" } + ; + + #pragma omp target dyn_groupprivate (1024 * N) // { dg-message "sorry, unimplemented: 'dyn_groupprivate' clause" } + ; + + #pragma omp target dyn_groupprivate ( fallback ( abort ) : N) // { dg-message "sorry, unimplemented: 'dyn_groupprivate' clause" } + ; + + #pragma omp target dyn_groupprivate ( fallback ( null ) : N) // { dg-message "sorry, unimplemented: 'dyn_groupprivate' clause" } + ; + + #pragma omp target dyn_groupprivate ( fallback ( default_mem ) : N) // { dg-message "sorry, unimplemented: 'dyn_groupprivate' clause" } + ; +} + +/* { dg-final { scan-tree-dump-times "#pragma omp target dyn_groupprivate\\(1024\\)" 1 "original" } } */ +/* { dg-final { scan-tree-dump-times "#pragma omp target dyn_groupprivate\\(N \\* 1024\\)" 1 "original" } } */ +/* { dg-final { scan-tree-dump-times "#pragma omp target dyn_groupprivate\\(fallback\\(abort\\):N\\)" 1 "original" } } */ +/* { dg-final { scan-tree-dump-times "#pragma omp target dyn_groupprivate\\(fallback\\(null\\):N\\)" 1 "original" } } */ +/* { dg-final { scan-tree-dump-times "#pragma omp target dyn_groupprivate\\(fallback\\(default_mem\\):N\\)" 1 "original" } } */ diff --git a/gcc/testsuite/c-c++-common/gomp/dyn_groupprivate-2.c b/gcc/testsuite/c-c++-common/gomp/dyn_groupprivate-2.c new file mode 100644 index 0000000..f12ff7b --- /dev/null +++ b/gcc/testsuite/c-c++-common/gomp/dyn_groupprivate-2.c @@ -0,0 +1,72 @@ +/* { dg-do compile } */ + +void f() +{ +#if !defined(__cplusplus) || __cplusplus >= 201103L + constexpr int M = 1024; // C20 + C++11 +#endif + int N, A[1]; + N = 1024; + + #pragma omp target dyn_groupprivate(0) + ; + + #pragma omp target dyn_groupprivate(0) dyn_groupprivate(0) // { dg-error "too many 'dyn_groupprivate' clauses" } + ; + + #pragma omp target dyn_groupprivate(1,) // { dg-error "expected '\\)' before ',' token" } + ; + + #pragma omp target dyn_groupprivate(-123) // { dg-warning "'dyn_groupprivate' value must be non-negative \\\[-Wopenmp\\\]" } + ; + +#if !defined(__cplusplus) || __cplusplus >= 201103L + #pragma omp target dyn_groupprivate (0 * M - 1) // { dg-warning "'dyn_groupprivate' value must be non-negative \\\[-Wopenmp\\\]" "" { target { ! c++98_only } } } +#endif + ; + + #pragma omp target dyn_groupprivate (- 4) // { dg-warning "'dyn_groupprivate' value must be non-negative \\\[-Wopenmp\\\]" } + ; + + #pragma omp target dyn_groupprivate ( fallback ( other ) : N) // { dg-error "expected 'abort', 'default_mem', or 'null' as fallback mode before 'other'" } + // { dg-error "expected an OpenMP clause before ':' token" "" { target c++ } .-1 } + ; + + #pragma omp target dyn_groupprivate ( A ) + // { dg-error "expected integer expression" "" { target c } .-1 } + // { dg-error "'dyn_groupprivate' expression must be integral" "" { target c++ } .-2 } + ; + + #pragma omp target dyn_groupprivate ( 1024. ) + // { dg-error "expected integer expression" "" { target c } .-1 } + // { dg-error "'dyn_groupprivate' expression must be integral" "" { target c++ } .-2 } + ; + + #pragma omp target dyn_groupprivate ( foo ( 4 ) : 10 ) // { dg-error "expected 'fallback' modifier before 'foo'" } + ; + + #pragma omp target dyn_groupprivate ( foo2 ( ) : 10 ) // { dg-error "expected 'fallback' modifier before 'foo2'" } + ; + + #pragma omp target dyn_groupprivate ( fallback ( ) : 10 ) // { dg-error "expected 'abort', 'default_mem', or 'null' as fallback mode before '\\)'" } + // { dg-error "expected an OpenMP clause before ':' token" "" { target c++ } .-1 } + ; + + #pragma omp target dyn_groupprivate ( bar : 10 ) // { dg-error "expected 'fallback' modifier before 'bar'" } + ; + + #pragma omp target dyn_groupprivate ( fallback : 10 ) // { dg-error "expected '\\(' before ':' token" } + // { dg-error "expected an OpenMP clause before ':' token" "" { target c++ } .-1 } + ; + + #pragma omp target dyn_groupprivate ( fallback ( null,) : 10 ) // { dg-error "expected '\\)' before ',' token" } + // { dg-error "expected an OpenMP clause before '\\)' token" "" { target c++ } .-1 } + ; +} + +// { dg-message "sorry, unimplemented: 'dyn_groupprivate' clause" "" { target *-*-* } 11 } +// { dg-message "sorry, unimplemented: 'dyn_groupprivate' clause" "" { target *-*-* } 14 } +// { dg-message "sorry, unimplemented: 'dyn_groupprivate' clause" "" { target *-*-* } 17 } +// { dg-message "sorry, unimplemented: 'dyn_groupprivate' clause" "" { target *-*-* } 20 } +// { dg-message "sorry, unimplemented: 'dyn_groupprivate' clause" "" { target { ! c++98_only } } 24 } +// { dg-message "sorry, unimplemented: 'dyn_groupprivate' clause" "" { target *-*-* } 28 } diff --git a/gcc/testsuite/c-c++-common/gomp/loop-5.c b/gcc/testsuite/c-c++-common/gomp/loop-5.c index b9b2ad9..bfc7017 100644 --- a/gcc/testsuite/c-c++-common/gomp/loop-5.c +++ b/gcc/testsuite/c-c++-common/gomp/loop-5.c @@ -2,7 +2,7 @@ __attribute__((noipa)) int foo (int *a, int *r3) { int r = 0, r2[2] = { 0, 0 }, i; - #pragma omp parallel loop default (none) reduction (+:r, r2[:2], r3[:2]) shared (a) lastprivate (i) + #pragma omp parallel loop default (none) reduction (+:r, r2[ :2], r3[ :2]) shared (a) lastprivate (i) for (i = 0; i < 1024; i++) { r += a[i]; diff --git a/gcc/testsuite/c-c++-common/gomp/map-1.c b/gcc/testsuite/c-c++-common/gomp/map-1.c index ed88944..f7003d3 100644 --- a/gcc/testsuite/c-c++-common/gomp/map-1.c +++ b/gcc/testsuite/c-c++-common/gomp/map-1.c @@ -27,13 +27,13 @@ foo (int g[3][10], int h[4][8], int i[2][10], int j[][9], ; #pragma omp target map(from: t[2:5]) /* { dg-error "is threadprivate variable" } */ ; - #pragma omp target map(tofrom: k[0.5:]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */ + #pragma omp target map(tofrom: k[0.5: ]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */ ; - #pragma omp target map(from: l[:7.5f]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */ + #pragma omp target map(from: l[ :7.5f]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */ ; - #pragma omp target map(to: m[p:]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */ + #pragma omp target map(to: m[p: ]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */ ; - #pragma omp target map(tofrom: n[:p]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */ + #pragma omp target map(tofrom: n[ :p]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */ ; #pragma omp target map(to: o[2:5]) /* { dg-error "does not have pointer or array type" } */ ; @@ -41,72 +41,72 @@ foo (int g[3][10], int h[4][8], int i[2][10], int j[][9], ; #pragma omp target map(alloc: s2) /* { dg-error "'s2' does not have a mappable type in 'map' clause" } */ ; - #pragma omp target map(to: a[:][:]) /* { dg-error "array type length expression must be specified" } */ + #pragma omp target map(to: a[ : ][ : ]) /* { dg-error "array type length expression must be specified" } */ bar (&a[0][0]); /* { dg-error "referenced in target region does not have a mappable type" } */ - #pragma omp target map(tofrom: b[-1:]) /* { dg-error "negative low bound in array section" } */ + #pragma omp target map(tofrom: b[-1: ]) /* { dg-error "negative low bound in array section" } */ bar (b); - #pragma omp target map(tofrom: c[:-3][:]) /* { dg-error "negative length in array section" } */ + #pragma omp target map(tofrom: c[ :-3][ : ]) /* { dg-error "negative length in array section" } */ bar (&c[0][0]); - #pragma omp target map(from: d[11:]) /* { dg-error "low bound \[^\n\r]* above array section size" } */ + #pragma omp target map(from: d[11: ]) /* { dg-error "low bound \[^\n\r]* above array section size" } */ bar (d); - #pragma omp target map(to: e[:11]) /* { dg-error "length \[^\n\r]* above array section size" } */ + #pragma omp target map(to: e[ :11]) /* { dg-error "length \[^\n\r]* above array section size" } */ bar (e); #pragma omp target map(to: f[1:10]) /* { dg-error "high bound \[^\n\r]* above array section size" } */ bar (f); - #pragma omp target map(from: g[:][0:10]) /* { dg-error "for array function parameter length expression must be specified" } */ + #pragma omp target map(from: g[ : ][0:10]) /* { dg-error "for array function parameter length expression must be specified" } */ bar (&g[0][0]); - #pragma omp target map(from: h[2:1][-1:]) /* { dg-error "negative low bound in array section" } */ + #pragma omp target map(from: h[2:1][-1: ]) /* { dg-error "negative low bound in array section" } */ bar (&h[0][0]); - #pragma omp target map(tofrom: h[:1][:-3]) /* { dg-error "negative length in array section" } */ + #pragma omp target map(tofrom: h[ :1][ :-3]) /* { dg-error "negative length in array section" } */ bar (&h[0][0]); - #pragma omp target map(i[:1][11:]) /* { dg-error "low bound \[^\n\r]* above array section size" } */ + #pragma omp target map(i[ :1][11: ]) /* { dg-error "low bound \[^\n\r]* above array section size" } */ bar (&i[0][0]); - #pragma omp target map(from: j[3:1][:10]) /* { dg-error "length \[^\n\r]* above array section size" } */ + #pragma omp target map(from: j[3:1][ :10]) /* { dg-error "length \[^\n\r]* above array section size" } */ bar (&j[0][0]); #pragma omp target map(to: j[30:1][5:5]) /* { dg-error "high bound \[^\n\r]* above array section size" } */ bar (&j[0][0]); - #pragma omp target map(to: a2[:1][2:4]) + #pragma omp target map(to: a2[ :1][2:4]) bar (&a2[0][0]); - #pragma omp target map(a2[3:5][:]) + #pragma omp target map(a2[3:5][ : ]) bar (&a2[0][0]); - #pragma omp target map(to: a2[3:5][:10]) + #pragma omp target map(to: a2[3:5][ :10]) bar (&a2[0][0]); - #pragma omp target map(tofrom: b2[0:]) + #pragma omp target map(tofrom: b2[0: ]) bar (b2); - #pragma omp target map(tofrom: c2[:3][:]) + #pragma omp target map(tofrom: c2[ :3][ : ]) bar (&c2[0][0]); - #pragma omp target map(from: d2[9:]) + #pragma omp target map(from: d2[9: ]) bar (d2); - #pragma omp target map(to: e2[:10]) + #pragma omp target map(to: e2[ :10]) bar (e2); #pragma omp target map(to: f2[1:9]) bar (f2); - #pragma omp target map(g2[:1][2:4]) + #pragma omp target map(g2[ :1][2:4]) bar (&g2[0][0]); - #pragma omp target map(from: h2[2:2][0:]) + #pragma omp target map(from: h2[2:2][0: ]) bar (&h2[0][0]); - #pragma omp target map(tofrom: h2[:1][:3]) + #pragma omp target map(tofrom: h2[ :1][ :3]) bar (&h2[0][0]); - #pragma omp target map(to: i2[:1][9:]) + #pragma omp target map(to: i2[ :1][9: ]) bar (&i2[0][0]); - #pragma omp target map(from: j2[3:4][:9]) + #pragma omp target map(from: j2[3:4][ :9]) bar (&j2[0][0]); #pragma omp target map(to: j2[30:1][5:4]) bar (&j2[0][0]); #pragma omp target map(q[1:2]) ; - #pragma omp target map(tofrom: q[3:5][:10]) /* { dg-error "array section is not contiguous" } */ + #pragma omp target map(tofrom: q[3:5][ :10]) /* { dg-error "array section is not contiguous" } */ ; - #pragma omp target map(r[3:][2:1][1:2]) + #pragma omp target map(r[3: ][2:1][1:2]) ; - #pragma omp target map(r[3:][2:1][1:2][:][0:4]) + #pragma omp target map(r[3: ][2:1][1:2][ : ][0:4]) ; - #pragma omp target map(r[3:][2:1][1:2][1:][0:4]) /* { dg-error "array section is not contiguous" } */ + #pragma omp target map(r[3: ][2:1][1:2][1: ][0:4]) /* { dg-error "array section is not contiguous" } */ ; - #pragma omp target map(r[3:][2:1][1:2][:3][0:4]) /* { dg-error "array section is not contiguous" } */ + #pragma omp target map(r[3: ][2:1][1:2][ :3][0:4]) /* { dg-error "array section is not contiguous" } */ ; - #pragma omp target map(r[3:][2:1][1:2][:][1:]) /* { dg-error "array section is not contiguous" } */ + #pragma omp target map(r[3: ][2:1][1:2][ : ][1: ]) /* { dg-error "array section is not contiguous" } */ ; - #pragma omp target map(r[3:][2:1][1:2][:][:3]) /* { dg-error "array section is not contiguous" } */ + #pragma omp target map(r[3: ][2:1][1:2][ : ][ :3]) /* { dg-error "array section is not contiguous" } */ ; } diff --git a/gcc/testsuite/c-c++-common/gomp/map-2.c b/gcc/testsuite/c-c++-common/gomp/map-2.c index 01fb4be..03a3ed7 100644 --- a/gcc/testsuite/c-c++-common/gomp/map-2.c +++ b/gcc/testsuite/c-c++-common/gomp/map-2.c @@ -16,25 +16,25 @@ foo (int *p, int (*q)[10], int r[10], int s[10][10]) ; #pragma omp target map (tofrom: r[-1:2]) ; - #pragma omp target map (tofrom: s[-1:2][:]) + #pragma omp target map (tofrom: s[-1:2][ : ]) ; #pragma omp target map (tofrom: s[-1:2][-2:10]) /* { dg-error "negative low bound in array section in" } */ ; #pragma omp target map (tofrom: a[-1:2]) /* { dg-error "negative low bound in array section in" } */ ; - #pragma omp target map (tofrom: b[-1:2][0:]) /* { dg-error "negative low bound in array section in" } */ + #pragma omp target map (tofrom: b[-1:2][0: ]) /* { dg-error "negative low bound in array section in" } */ ; #pragma omp target map (tofrom: b[1:2][-2:10]) /* { dg-error "negative low bound in array section in" } */ ; #pragma omp target map (tofrom: p[2:-3]) /* { dg-error "negative length in array section in" } */ ; - #pragma omp target map (tofrom: q[2:-3][:]) /* { dg-error "negative length in array section in" } */ + #pragma omp target map (tofrom: q[2:-3][ : ]) /* { dg-error "negative length in array section in" } */ ; #pragma omp target map (tofrom: q[2:3][0:-1]) /* { dg-error "negative length in array section in" } */ ; #pragma omp target map (tofrom: r[2:-5]) /* { dg-error "negative length in array section in" } */ ; - #pragma omp target map (tofrom: s[2:-5][:]) /* { dg-error "negative length in array section in" } */ + #pragma omp target map (tofrom: s[2:-5][ : ]) /* { dg-error "negative length in array section in" } */ ; #pragma omp target map (tofrom: s[2:5][0:-4]) /* { dg-error "negative length in array section in" } */ ; diff --git a/gcc/testsuite/c-c++-common/gomp/map-4.c b/gcc/testsuite/c-c++-common/gomp/map-4.c index 6c48636..79b61e4 100644 --- a/gcc/testsuite/c-c++-common/gomp/map-4.c +++ b/gcc/testsuite/c-c++-common/gomp/map-4.c @@ -5,7 +5,7 @@ typedef double Grid[SIZE]; void test (Grid src1) { - #pragma omp target map(alloc:src1[:]) /* { dg-error "for array function parameter length expression must be specified" } */ + #pragma omp target map(alloc:src1[ : ]) /* { dg-error "for array function parameter length expression must be specified" } */ { src1[0] = 5; } @@ -13,7 +13,7 @@ void test (Grid src1) void test2 (double src2[]) { - #pragma omp target map(alloc:src2[:]) /* { dg-error "for array function parameter length expression must be specified" } */ + #pragma omp target map(alloc:src2[ : ]) /* { dg-error "for array function parameter length expression must be specified" } */ { src2[0] = 5; } @@ -21,7 +21,7 @@ void test2 (double src2[]) void test3 (double *src3) { - #pragma omp target map(alloc:src3[:]) /* { dg-error "for pointer type length expression must be specified" } */ + #pragma omp target map(alloc:src3[ : ]) /* { dg-error "for pointer type length expression must be specified" } */ { src3[0] = 5; } diff --git a/gcc/testsuite/c-c++-common/gomp/map-7.c b/gcc/testsuite/c-c++-common/gomp/map-7.c index 3f1e972..6d79718 100644 --- a/gcc/testsuite/c-c++-common/gomp/map-7.c +++ b/gcc/testsuite/c-c++-common/gomp/map-7.c @@ -9,12 +9,12 @@ foo (void) int always[N]; int close; - #pragma omp target map(always[:N]) + #pragma omp target map(always[ :N]) ; - #pragma omp target map(close, always[:N]) + #pragma omp target map(close, always[ :N]) ; - #pragma omp target map(always[:N], close) + #pragma omp target map(always[ :N], close) ; } diff --git a/gcc/testsuite/c-c++-common/gomp/pr100902-1.c b/gcc/testsuite/c-c++-common/gomp/pr100902-1.c index babd01a..e84aeb6 100644 --- a/gcc/testsuite/c-c++-common/gomp/pr100902-1.c +++ b/gcc/testsuite/c-c++-common/gomp/pr100902-1.c @@ -3,7 +3,7 @@ void foo (int *ptr) { - #pragma omp target map (ptr, ptr[:4]) + #pragma omp target map (ptr, ptr[ :4]) #pragma omp parallel master ptr[0] = 1; } @@ -11,7 +11,7 @@ foo (int *ptr) void bar (int *ptr) { - #pragma omp target parallel map (ptr[:4], ptr) + #pragma omp target parallel map (ptr[ :4], ptr) #pragma omp master ptr[0] = 1; } diff --git a/gcc/testsuite/c-c++-common/gomp/pr103642.c b/gcc/testsuite/c-c++-common/gomp/pr103642.c index bc6d7ac..f55b7b2 100644 --- a/gcc/testsuite/c-c++-common/gomp/pr103642.c +++ b/gcc/testsuite/c-c++-common/gomp/pr103642.c @@ -23,7 +23,7 @@ int main (void) t.s = (S *) malloc (sizeof (S)); t.s->a = (int *) malloc (sizeof(int) * N); - #pragma omp target map(from: t.s->a[:N]) + #pragma omp target map(from: t.s->a[ :N]) { t.s->a[0] = 1; } diff --git a/gcc/testsuite/c-c++-common/gomp/pr120052.c b/gcc/testsuite/c-c++-common/gomp/pr120052.c new file mode 100644 index 0000000..c379739 --- /dev/null +++ b/gcc/testsuite/c-c++-common/gomp/pr120052.c @@ -0,0 +1,32 @@ +/* PR middle-end/120052 */ +/* { dg-do compile } */ +/* { dg-additional-options "-fsanitize=undefined" } */ + +void +foo (unsigned long s, long indx) +{ + long counts[2][s]; + #pragma omp parallel + #pragma omp masked + for (int i = 0; i < 2; i++) + counts[2][indx] = 1; +} + +void +bar (unsigned long s, long indx) +{ + long counts[2][s]; + #pragma omp parallel shared(counts) + #pragma omp masked + for (int i = 0; i < 2; i++) + counts[2][indx] = 1; +} + +void +baz (unsigned long s, long indx) +{ + long counts[2][s]; + #pragma omp parallel private(counts) + for (int i = 0; i < 2; i++) + counts[2][indx] = 1; +} diff --git a/gcc/testsuite/c-c++-common/gomp/pr120180-1.c b/gcc/testsuite/c-c++-common/gomp/pr120180-1.c index 52b5082..b563d5f 100644 --- a/gcc/testsuite/c-c++-common/gomp/pr120180-1.c +++ b/gcc/testsuite/c-c++-common/gomp/pr120180-1.c @@ -9,9 +9,9 @@ int main() double *qq; int i, k, nq; - #pragma omp metadirective when(user={condition(0)}: target teams distribute parallel for collapse(2) map(qq[:0]) private(i)) \ - when(user={condition(0)}: target teams distribute parallel for map(qq[:0]) private(i)) \ - when(user={condition(1)}: target teams loop collapse(2) map(qq[:0]) private(i)) + #pragma omp metadirective when(user={condition(0)}: target teams distribute parallel for collapse(2) map(qq[ :0]) private(i)) \ + when(user={condition(0)}: target teams distribute parallel for map(qq[ :0]) private(i)) \ + when(user={condition(1)}: target teams loop collapse(2) map(qq[ :0]) private(i)) for(k=0; k<blksize; k++) { #pragma omp metadirective when(user={condition(0)}: simd) default() diff --git a/gcc/testsuite/c-c++-common/gomp/pr120564.c b/gcc/testsuite/c-c++-common/gomp/pr120564.c new file mode 100644 index 0000000..4dfa4fc --- /dev/null +++ b/gcc/testsuite/c-c++-common/gomp/pr120564.c @@ -0,0 +1,15 @@ +/* PR middle-end/120564 */ +/* { dg-do compile } */ + +void bar (unsigned long long, unsigned long long, unsigned long long); + +void +foo (void) +{ + unsigned long long v1, v2, v3; +#pragma omp parallel for schedule(static, 32) collapse(3) + for (v1 = 0; v1 < 20; v1 += 2) + for (v2 = __LONG_LONG_MAX__; v2 > __LONG_LONG_MAX__; v2 -= 3) + for (v3 = 10; v3 > 0; v3--) + bar (v1, v2, v3); +} diff --git a/gcc/testsuite/c-c++-common/gomp/pr61486-1.c b/gcc/testsuite/c-c++-common/gomp/pr61486-1.c index dbd621f..d09e19d 100644 --- a/gcc/testsuite/c-c++-common/gomp/pr61486-1.c +++ b/gcc/testsuite/c-c++-common/gomp/pr61486-1.c @@ -6,7 +6,7 @@ int foo (int *a) { int i, j = 0; - #pragma omp target teams distribute simd linear(i) map(a[:10]) + #pragma omp target teams distribute simd linear(i) map(a[ :10]) for (i = 0; i < 10; i++) a[i] = j; return i; diff --git a/gcc/testsuite/c-c++-common/gomp/pr81006.c b/gcc/testsuite/c-c++-common/gomp/pr81006.c index a826c5f..9a4ca41 100644 --- a/gcc/testsuite/c-c++-common/gomp/pr81006.c +++ b/gcc/testsuite/c-c++-common/gomp/pr81006.c @@ -5,6 +5,6 @@ int a[] = {}; void foo() { - #pragma omp task depend(out: a[:]) /* { dg-error "zero length array section in .depend. clause" } */ + #pragma omp task depend(out: a[ : ]) /* { dg-error "zero length array section in .depend. clause" } */ {} } diff --git a/gcc/testsuite/c-c++-common/gomp/pr91920.c b/gcc/testsuite/c-c++-common/gomp/pr91920.c index 604fd59..016005e 100644 --- a/gcc/testsuite/c-c++-common/gomp/pr91920.c +++ b/gcc/testsuite/c-c++-common/gomp/pr91920.c @@ -7,7 +7,7 @@ foo (void) { int i; float f[3] = { 0.0f, 0.0f, 0.0f }; -#pragma omp parallel for default(none) reduction(+:f[:3]) +#pragma omp parallel for default(none) reduction(+:f[ :3]) for (i = 0; i < 1000; i++) { int j; diff --git a/gcc/testsuite/c-c++-common/gomp/pr96867.c b/gcc/testsuite/c-c++-common/gomp/pr96867.c index f55d9cf..04f920c 100644 --- a/gcc/testsuite/c-c++-common/gomp/pr96867.c +++ b/gcc/testsuite/c-c++-common/gomp/pr96867.c @@ -5,5 +5,5 @@ int *v; void foo (int x) { - #pragma omp target update to (x, v[:]) /* { dg-error "for pointer type length expression must be specified" } */ + #pragma omp target update to (x, v[ : ]) /* { dg-error "for pointer type length expression must be specified" } */ } diff --git a/gcc/testsuite/c-c++-common/gomp/pr99928-16.c b/gcc/testsuite/c-c++-common/gomp/pr99928-16.c index 84cd85d..d548b39 100644 --- a/gcc/testsuite/c-c++-common/gomp/pr99928-16.c +++ b/gcc/testsuite/c-c++-common/gomp/pr99928-16.c @@ -4,13 +4,13 @@ void foo (void) { int a[6] = {}; - #pragma omp target simd reduction(+:a[:3]) + #pragma omp target simd reduction(+:a[ :3]) for (int i = 0; i < 6; i++) a[0]++; - #pragma omp target simd reduction(+:a[:3]) map(always, tofrom: a) + #pragma omp target simd reduction(+:a[ :3]) map(always, tofrom: a) for (int i = 0; i < 6; i++) a[0]++; - #pragma omp target simd reduction(+:a[:3]) map(always, tofrom: a[:6]) + #pragma omp target simd reduction(+:a[ :3]) map(always, tofrom: a[ :6]) for (int i = 0; i < 6; i++) a[0]++; } diff --git a/gcc/testsuite/c-c++-common/gomp/reduction-1.c b/gcc/testsuite/c-c++-common/gomp/reduction-1.c index 897ed68..4ee1006d 100644 --- a/gcc/testsuite/c-c++-common/gomp/reduction-1.c +++ b/gcc/testsuite/c-c++-common/gomp/reduction-1.c @@ -10,17 +10,17 @@ foo (int a[10][10][10], int **b, int x) int c[10][10][0]; int d[0]; char e[12]; - #pragma omp parallel reduction(+: a[:4][:0][:7]) /* { dg-error "zero length array section" } */ + #pragma omp parallel reduction(+: a[ :4][ :0][ :7]) /* { dg-error "zero length array section" } */ bar (a); - #pragma omp parallel reduction(+: b[:7][0:0][:0]) /* { dg-error "zero length array section" } */ + #pragma omp parallel reduction(+: b[ :7][0:0][ :0]) /* { dg-error "zero length array section" } */ bar (a); - #pragma omp parallel reduction(+: c[:][:][0:]) /* { dg-error "zero length array section|for unknown bound array type length expression must be specified" } */ + #pragma omp parallel reduction(+: c[ : ][ : ][0: ]) /* { dg-error "zero length array section|for unknown bound array type length expression must be specified" } */ bar (a); - #pragma omp parallel reduction(+: a[:4][:0][:x]) /* { dg-error "zero length array section" } */ + #pragma omp parallel reduction(+: a[ :4][ :0][ :x]) /* { dg-error "zero length array section" } */ bar (a); - #pragma omp parallel reduction(+: b[:x][0:0][:0]) /* { dg-error "zero length array section" } */ + #pragma omp parallel reduction(+: b[ :x][0:0][ :0]) /* { dg-error "zero length array section" } */ bar (a); - #pragma omp parallel reduction(+: c[:][:x][0:]) /* { dg-error "zero length array section|for unknown bound array type length expression must be specified" } */ + #pragma omp parallel reduction(+: c[ : ][ :x][0: ]) /* { dg-error "zero length array section|for unknown bound array type length expression must be specified" } */ bar (a); #pragma omp parallel reduction(+: d) /* { dg-error "is a zero size array" } */ bar (a); @@ -42,11 +42,11 @@ foo (int a[10][10][10], int **b, int x) bar (a); #pragma omp parallel reduction(+: a[0:2.5]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */ bar (a); - #pragma omp parallel reduction(+: f[:][0:2]) /* { dg-error "for unknown bound array type length expression must be specified" } */ + #pragma omp parallel reduction(+: f[ : ][0:2]) /* { dg-error "for unknown bound array type length expression must be specified" } */ bar (a); - #pragma omp parallel reduction(+: a[:][0:10]) /* { dg-error "for array function parameter length expression must be specified" } */ + #pragma omp parallel reduction(+: a[ : ][0:10]) /* { dg-error "for array function parameter length expression must be specified" } */ bar (a); - #pragma omp parallel reduction(+: a[:10][0:12]) /* { dg-error "above array section size" } */ + #pragma omp parallel reduction(+: a[ :10][0:12]) /* { dg-error "above array section size" } */ bar (a); #pragma omp parallel reduction(+: b[0:10][0:10]) /* { dg-error "array section is not contiguous" } */ bar (a); diff --git a/gcc/testsuite/c-c++-common/gomp/scan-1.c b/gcc/testsuite/c-c++-common/gomp/scan-1.c index 95b46cb..ecc0bd0 100644 --- a/gcc/testsuite/c-c++-common/gomp/scan-1.c +++ b/gcc/testsuite/c-c++-common/gomp/scan-1.c @@ -25,11 +25,11 @@ f2 (int *c, int *d, int *e, int *f) #pragma omp scan inclusive (b) /* { dg-error "" } */ d[i] = b; } - #pragma omp for reduction (inscan, +: e[:2]) /* { dg-error "'inscan' 'reduction' clause with array section" } */ + #pragma omp for reduction (inscan, +: e[ :2]) /* { dg-error "'inscan' 'reduction' clause with array section" } */ for (i = 0; i < 64; ++i) { { e[0] += c[i]; e[1] += c[i]; } - #pragma omp scan inclusive (a, e[:2]) /* { dg-error "" } */ + #pragma omp scan inclusive (a, e[ :2]) /* { dg-error "" } */ { d[i] = e[0]; f[i] = e[1]; } } #pragma omp for reduction (inscan, +: a) ordered /* { dg-error "'ordered' clause specified together with 'inscan' 'reduction' clause" } */ @@ -91,7 +91,7 @@ f3 (int *c, int *d) } #pragma omp scope reduction (inscan, +: a) /* { dg-error "'inscan' 'reduction' clause on 'scope' construct" } */ ; - #pragma omp target parallel for reduction (inscan, +: a) map (c[:64], d[:64]) /* { dg-error "'inscan' 'reduction' clause on construct other than 'for', 'simd', 'for simd', 'parallel for', 'parallel for simd'" } */ + #pragma omp target parallel for reduction (inscan, +: a) map (c[ :64], d[ :64]) /* { dg-error "'inscan' 'reduction' clause on construct other than 'for', 'simd', 'for simd', 'parallel for', 'parallel for simd'" } */ for (i = 0; i < 64; i++) { d[i] = a; diff --git a/gcc/testsuite/c-c++-common/gomp/target-data-1.c b/gcc/testsuite/c-c++-common/gomp/target-data-1.c index 7aa111a..3b8e980 100644 --- a/gcc/testsuite/c-c++-common/gomp/target-data-1.c +++ b/gcc/testsuite/c-c++-common/gomp/target-data-1.c @@ -6,7 +6,7 @@ foo (void) int a[4] = { 1, 2, 3, 4 }; int *p = &a[0]; int x = 5; - #pragma omp target data map(to:p[:4]) + #pragma omp target data map(to:p[ :4]) #pragma omp target data use_device_ptr(p) #pragma omp target is_device_ptr(p) { diff --git a/gcc/testsuite/c-c++-common/gomp/target-enter-data-1.c b/gcc/testsuite/c-c++-common/gomp/target-enter-data-1.c index 4dc5188..57161bc 100644 --- a/gcc/testsuite/c-c++-common/gomp/target-enter-data-1.c +++ b/gcc/testsuite/c-c++-common/gomp/target-enter-data-1.c @@ -16,9 +16,9 @@ struct foo void func (struct foo *f, int n, int m) { - #pragma omp target enter data map (to: f->vectors[m][:n]) - #pragma omp target enter data map (to: f->bars[n].vectors[:m]) - #pragma omp target enter data map (to: f->bars[n].vectors[:f->bars[n].num_vectors]) + #pragma omp target enter data map (to: f->vectors[m][ :n]) + #pragma omp target enter data map (to: f->bars[n].vectors[ :m]) + #pragma omp target enter data map (to: f->bars[n].vectors[ :f->bars[n].num_vectors]) } /* { dg-final { scan-tree-dump-times {map\(struct:\*f \[len: 1\]\) map\(alloc:[a-z0-9\._]+->vectors \[len: 0\]\) map\(to:\*_[0-9]+ \[len: _[0-9]+\]\) map\(attach:[a-z0-9\._]+->vectors \[bias: [^\]]+\]\) map\(attach:\*_[0-9]+ \[bias: [^\]]+\]\)} 1 "gimple" } } */ diff --git a/gcc/testsuite/c-c++-common/gomp/target-has-device-addr-1.c b/gcc/testsuite/c-c++-common/gomp/target-has-device-addr-1.c index ebf55ee..c9520a3 100644 --- a/gcc/testsuite/c-c++-common/gomp/target-has-device-addr-1.c +++ b/gcc/testsuite/c-c++-common/gomp/target-has-device-addr-1.c @@ -26,20 +26,20 @@ foo () ; int z[3] = { 2, 5, 7 }; - #pragma omp target data map(z[:3]) use_device_addr(z) - #pragma omp target has_device_addr(z[1:]) + #pragma omp target data map(z[ :3]) use_device_addr(z) + #pragma omp target has_device_addr(z[1: ]) ; - #pragma omp target data map(z[:3]) use_device_addr(z) + #pragma omp target data map(z[ :3]) use_device_addr(z) #pragma omp target has_device_addr(z[1]) ; - #pragma omp target data map(z[:3]) use_device_addr(z) + #pragma omp target data map(z[ :3]) use_device_addr(z) #pragma omp target has_device_addr(z[1:2]) ; - #pragma omp target data map(z[:3]) use_device_addr(z) - #pragma omp target has_device_addr(z[:2]) + #pragma omp target data map(z[ :3]) use_device_addr(z) + #pragma omp target has_device_addr(z[ :2]) ; int w[3][4]; @@ -48,7 +48,7 @@ foo () ; #pragma omp target data map(w) use_device_addr(w) - #pragma omp target has_device_addr(w[:1][2:]) + #pragma omp target has_device_addr(w[ :1][2: ]) ; int u[0]; diff --git a/gcc/testsuite/c-c++-common/gomp/target-implicit-map-2.c b/gcc/testsuite/c-c++-common/gomp/target-implicit-map-2.c index a336c2d..cb8c9a7 100644 --- a/gcc/testsuite/c-c++-common/gomp/target-implicit-map-2.c +++ b/gcc/testsuite/c-c++-common/gomp/target-implicit-map-2.c @@ -22,29 +22,29 @@ main (void) for (int i = 0; i < N; i++) a.ptr[i] = 0; - #pragma omp target enter data map(to: a.ptr, a.ptr[:N]) + #pragma omp target enter data map(to: a.ptr, a.ptr[ :N]) #pragma omp target for (int i = 0; i < N; i++) a.ptr[i] += 1; - #pragma omp target update from(a.ptr[:N]) + #pragma omp target update from(a.ptr[ :N]) for (int i = 0; i < N; i++) if (a.ptr[i] != 1) abort (); - #pragma omp target map(a.ptr[:N]) + #pragma omp target map(a.ptr[ :N]) for (int i = 0; i < N; i++) a.ptr[i] += 1; - #pragma omp target update from(a.ptr[:N]) + #pragma omp target update from(a.ptr[ :N]) for (int i = 0; i < N; i++) if (a.ptr[i] != 2) abort (); - #pragma omp target exit data map(from:a.ptr, a.ptr[:N]) + #pragma omp target exit data map(from:a.ptr, a.ptr[ :N]) return 0; } diff --git a/gcc/testsuite/c-c++-common/gomp/target-map-iterators-1.c b/gcc/testsuite/c-c++-common/gomp/target-map-iterators-1.c index 7d6c8dc..8071907 100644 --- a/gcc/testsuite/c-c++-common/gomp/target-map-iterators-1.c +++ b/gcc/testsuite/c-c++-common/gomp/target-map-iterators-1.c @@ -6,13 +6,13 @@ void f (int **x, int **y) { - #pragma omp target map(iterator(i=0:DIM1), to: x[i][:DIM2]) + #pragma omp target map(iterator(i=0:DIM1), to: x[i][ :DIM2]) ; - #pragma omp target map(iterator(i=0:DIM1), to: x[i][:DIM2], y[i][:DIM2]) + #pragma omp target map(iterator(i=0:DIM1), to: x[i][ :DIM2], y[i][ :DIM2]) ; - #pragma omp target map(iterator(i=0:DIM1), to: x[i][:DIM2] + 2) /* { dg-message "unsupported map expression" } */ + #pragma omp target map(iterator(i=0:DIM1), to: x[i][ :DIM2] + 2) /* { dg-message "unsupported map expression" } */ ; #pragma omp target map(iterator(i=0:DIM1), iterator(j=0:DIM2), to: x[i][j]) /* { dg-error "too many 'iterator' modifiers" } */ diff --git a/gcc/testsuite/c-c++-common/gomp/target-map-iterators-3.c b/gcc/testsuite/c-c++-common/gomp/target-map-iterators-3.c index 62df42f..c313365 100644 --- a/gcc/testsuite/c-c++-common/gomp/target-map-iterators-3.c +++ b/gcc/testsuite/c-c++-common/gomp/target-map-iterators-3.c @@ -9,9 +9,9 @@ void f (int ***x, float ***y, double **z) { #pragma omp target \ map(to: x, y) \ - map(iterator(i=0:DIM1, j=0:DIM2), to: x[i][j][:DIM3], y[i][j][:DIM3]) \ + map(iterator(i=0:DIM1, j=0:DIM2), to: x[i][j][ :DIM3], y[i][j][ :DIM3]) \ map(from: z) \ - map(iterator(i=0:DIM1), from: z[i][:DIM2]) + map(iterator(i=0:DIM1), from: z[i][ :DIM2]) ; } diff --git a/gcc/testsuite/c-c++-common/gomp/target-update-iterators-1.c b/gcc/testsuite/c-c++-common/gomp/target-update-iterators-1.c index 53b22f0..d69fe95 100644 --- a/gcc/testsuite/c-c++-common/gomp/target-update-iterators-1.c +++ b/gcc/testsuite/c-c++-common/gomp/target-update-iterators-1.c @@ -6,11 +6,11 @@ void f (int **x, float **y) { - #pragma omp target update to (iterator(i=0:DIM1): x[i][:DIM2]) + #pragma omp target update to (iterator(i=0:DIM1): x[i][ :DIM2]) - #pragma omp target update to (iterator(i=0:DIM1): x[i][:DIM2], y[i][:DIM2]) + #pragma omp target update to (iterator(i=0:DIM1): x[i][ :DIM2], y[i][ :DIM2]) - #pragma omp target update to (iterator(i=0:DIM1), present: x[i][:DIM2]) + #pragma omp target update to (iterator(i=0:DIM1), present: x[i][ :DIM2]) #pragma omp target update to (iterator(i=0:DIM1), iterator(j=0:DIM2): x[i][j]) /* { dg-error "too many 'iterator' modifiers" } */ /* { dg-error "'#pragma omp target update' must contain at least one 'from' or 'to' clauses" "" { target *-*-* } .-1 } */ diff --git a/gcc/testsuite/c-c++-common/gomp/target-update-iterators-3.c b/gcc/testsuite/c-c++-common/gomp/target-update-iterators-3.c index ef55216..0057cf7 100644 --- a/gcc/testsuite/c-c++-common/gomp/target-update-iterators-3.c +++ b/gcc/testsuite/c-c++-common/gomp/target-update-iterators-3.c @@ -7,8 +7,8 @@ void f (int ***x, float ***y, double **z) { - #pragma omp target update to (iterator(i=0:DIM1, j=0:DIM2): x[i][j][:DIM3], y[i][j][:DIM3]) - #pragma omp target update from (iterator(i=0:DIM1): z[i][:DIM2]) + #pragma omp target update to (iterator(i=0:DIM1, j=0:DIM2): x[i][j][ :DIM3], y[i][j][ :DIM3]) + #pragma omp target update from (iterator(i=0:DIM1): z[i][ :DIM2]) } /* { dg-final { scan-tree-dump-times "if \\(i <= 9\\) goto <D\.\[0-9\]+>; else goto <D\.\[0-9\]+>;" 2 "gimple" } } */ diff --git a/gcc/testsuite/c-c++-common/restrict-2.c b/gcc/testsuite/c-c++-common/restrict-2.c index ad19fb3..940365c 100644 --- a/gcc/testsuite/c-c++-common/restrict-2.c +++ b/gcc/testsuite/c-c++-common/restrict-2.c @@ -10,4 +10,4 @@ void foo (float * __restrict__ a, float * __restrict__ b, int n, int j) /* We should move the RHS of the store out of the loop. */ -/* { dg-final { scan-tree-dump-times "Moving statement" 11 "lim2" } } */ +/* { dg-final { scan-tree-dump-times "Moving statement _\[0-9\]+ = \\\*_" 2 "lim2" } } */ diff --git a/gcc/testsuite/g++.dg/DRs/dr1670-1.C b/gcc/testsuite/g++.dg/DRs/dr1670-1.C new file mode 100644 index 0000000..1c8430a --- /dev/null +++ b/gcc/testsuite/g++.dg/DRs/dr1670-1.C @@ -0,0 +1,9 @@ +// DR 1670 - auto as conversion-type-id +// { dg-do compile { target c++14 } } + +struct S { + operator auto () { return 0; } // { dg-error "invalid use of 'auto' in conversion operator" } +}; +struct T { + operator decltype (auto) () { return 0; } // { dg-error "invalid use of 'auto' in conversion operator" } +}; diff --git a/gcc/testsuite/g++.dg/DRs/dr1670-2.C b/gcc/testsuite/g++.dg/DRs/dr1670-2.C new file mode 100644 index 0000000..570a04ad --- /dev/null +++ b/gcc/testsuite/g++.dg/DRs/dr1670-2.C @@ -0,0 +1,10 @@ +// DR 1670 - auto as conversion-type-id +// { dg-do compile { target c++14 } } +// { dg-options "-Wpedantic" } + +struct S { + operator auto () { return 0; } // { dg-warning "invalid use of 'auto' in conversion operator" } +}; +struct T { + operator decltype (auto) () { return 0; } // { dg-warning "invalid use of 'auto' in conversion operator" } +}; diff --git a/gcc/testsuite/g++.dg/DRs/dr1670-3.C b/gcc/testsuite/g++.dg/DRs/dr1670-3.C new file mode 100644 index 0000000..9d13875 --- /dev/null +++ b/gcc/testsuite/g++.dg/DRs/dr1670-3.C @@ -0,0 +1,10 @@ +// DR 1670 - auto as conversion-type-id +// { dg-do compile { target c++14 } } +// { dg-options "" } + +struct S { + operator auto () { return 0; } +}; +struct T { + operator decltype (auto) () { return 0; } +}; diff --git a/gcc/testsuite/g++.dg/DRs/dr2581-1.C b/gcc/testsuite/g++.dg/DRs/dr2581-1.C index 56ccb60..855c0d8 100644 --- a/gcc/testsuite/g++.dg/DRs/dr2581-1.C +++ b/gcc/testsuite/g++.dg/DRs/dr2581-1.C @@ -22,7 +22,7 @@ #undef __STDC__ // { dg-warning "undefining '__STDC__'" } #undef __STDC_MB_MIGHT_NEQ_WC__ // { dg-warning "undefining '__STDC_MB_MIGHT_NEQ_WC__'" "" { target c++11 } } #undef __STDC_VERSION__ // { dg-warning "undefining '__STDC_VERSION__'" "" { target c++11 } } -#undef __STDC_ISO_10646__ // { dg-warning "undefining '__STDC_ISO_10646__'" } +#undef __STDC_ISO_10646__ // { dg-warning "undefining '__STDC_ISO_10646__'" "" { xfail { ! *-*-linux* } } } #undef __STDCPP_THREADS__ // { dg-warning "undefining '__STDCPP_THREADS__'" "" { target c++11 } } #undef __STDCPP_STRICT_POINTER_SAFETY__ // { dg-warning "undefining '__STDCPP_STRICT_POINTER_SAFETY__'" "" { target { c++11 && c++20_down } } } #undef __cpp_aggregate_bases // { dg-warning "undefining '__cpp_aggregate_bases'" "" { target c++20 } } @@ -94,7 +94,6 @@ #undef __cpp_template_parameters #undef __cpp_template_template_args // { dg-warning "undefining '__cpp_template_template_args'" "" { target c++20 } } #undef __cpp_threadsafe_static_init // { dg-warning "undefining '__cpp_threadsafe_static_init'" "" { target c++20 } } -#undef __cpp_trivial_relocatability // { dg-warning "undefining '__cpp_trivial_relocatability'" "" { target c++26 } } #undef __cpp_trivial_union #undef __cpp_unicode_characters // { dg-warning "undefining '__cpp_unicode_characters'" "" { target c++20 } } #undef __cpp_unicode_literals // { dg-warning "undefining '__cpp_unicode_literals'" "" { target c++20 } } diff --git a/gcc/testsuite/g++.dg/DRs/dr2581-2.C b/gcc/testsuite/g++.dg/DRs/dr2581-2.C index 1ecbe1c..f09c672 100644 --- a/gcc/testsuite/g++.dg/DRs/dr2581-2.C +++ b/gcc/testsuite/g++.dg/DRs/dr2581-2.C @@ -21,8 +21,9 @@ #define __TIME__ // { dg-error "'__TIME__' redefined" } #define __STDC__ // { dg-error "'__STDC__' redefined" } #define __STDC_MB_MIGHT_NEQ_WC__ // { dg-warning "'__STDC_MB_MIGHT_NEQ_WC__' defined" "" { target c++11 } } -#define __STDC_VERSION__ // { dg-warning "'__STDC_VERSION__' defined" "" { target c++11 } } -#define __STDC_ISO_10646__ // { dg-error "'__STDC_ISO_10646__' redefined" } +#define __STDC_VERSION__ // { dg-warning "'__STDC_VERSION__' defined" "" { target { c++11 && { ! *-*-solaris2* } } } } + // { dg-error "'__STDC_VERSION__' redefined" "" { target *-*-solaris2* } .-1 } +#define __STDC_ISO_10646__ // { dg-error "'__STDC_ISO_10646__' redefined" "" { xfail { ! *-*-linux* } } } #define __STDCPP_THREADS__ // { dg-message "'__STDCPP_THREADS__' (?:re)?defined" "" { target c++11 } } #define __STDCPP_STRICT_POINTER_SAFETY__ // { dg-warning "'__STDCPP_STRICT_POINTER_SAFETY__' defined" "" { target { c++11 && c++20_down } } } #define __cpp_aggregate_bases 201603L // { dg-error "'__cpp_aggregate_bases' redefined" "" { target c++20 } } @@ -94,7 +95,6 @@ #define __cpp_template_parameters 202502L #define __cpp_template_template_args 201611L // { dg-error "'__cpp_template_template_args' redefined" "" { target c++20 } } #define __cpp_threadsafe_static_init 200806L // { dg-error "'__cpp_threadsafe_static_init' redefined" "" { target c++20 } } -#define __cpp_trivial_relocatability 202502L // { dg-error "'__cpp_trivial_relocatability' redefined" "" { target c++26 } } #define __cpp_trivial_union 202502L #define __cpp_unicode_characters 200704L // { dg-error "'__cpp_unicode_characters' redefined" "" { target c++17 } } #define __cpp_unicode_literals 200710L // { dg-error "'__cpp_unicode_literals' redefined" "" { target c++20 } } diff --git a/gcc/testsuite/g++.dg/DRs/dr3045.C b/gcc/testsuite/g++.dg/DRs/dr3045.C new file mode 100644 index 0000000..deeb22c --- /dev/null +++ b/gcc/testsuite/g++.dg/DRs/dr3045.C @@ -0,0 +1,16 @@ +// DR 3045 - Regularizing environment interactions of expansion statement +// { dg-do compile { target c++11 } } +// { dg-options "" } + +void +foo () +{ + static constexpr int arr[] = { 1, 2, 3 }; + for (auto g : arr) { // { dg-message "'int g' previously declared here" } + int g = 42; // { dg-error "redeclaration of 'int g'" } + } + template for (auto x : arr) { // { dg-warning "'template for' only available with" "" { target c++23_down } } + // { dg-message "'int x' previously declared here" "" { target *-*-* } .-1 } + int x = 42; // { dg-error "redeclaration of 'int x'" } + } +} diff --git a/gcc/testsuite/g++.dg/DRs/dr3061.C b/gcc/testsuite/g++.dg/DRs/dr3061.C new file mode 100644 index 0000000..7288298 --- /dev/null +++ b/gcc/testsuite/g++.dg/DRs/dr3061.C @@ -0,0 +1,18 @@ +// DR 3061 - Trailing comma in an expansion-init-list +// { dg-do compile { target c++11 } } +// { dg-options "" } + +#include <initializer_list> + +void +foo () +{ + for (int x : { 1, }) + ; + template for (int x : { 1, }) // { dg-warning "'template for' only available with" "" { target c++23_down } } + ; + for (int x : { , }) // { dg-error "expected primary-expression before ',' token" } + ; // { dg-error "unable to deduce" "" { target *-*-* } .-1 } + template for (int x : { , }) // { dg-warning "'template for' only available with" "" { target c++23_down } } + ; // { dg-error "expected primary-expression before ',' token" "" { target *-*-* } .-1 } +} diff --git a/gcc/testsuite/g++.dg/DRs/dr3079.C b/gcc/testsuite/g++.dg/DRs/dr3079.C new file mode 100644 index 0000000..5fd26d3 --- /dev/null +++ b/gcc/testsuite/g++.dg/DRs/dr3079.C @@ -0,0 +1,5 @@ +// DR 3079 - Allow empty-declarations in anonymous unions +// { dg-do compile { target c++11 } } + +struct A { union { int x;; } u; }; +struct B { union { int x;; }; }; diff --git a/gcc/testsuite/g++.dg/abi/param2.C b/gcc/testsuite/g++.dg/abi/param2.C index d28387a..4752717 100644 --- a/gcc/testsuite/g++.dg/abi/param2.C +++ b/gcc/testsuite/g++.dg/abi/param2.C @@ -1,7 +1,7 @@ // PR target/20795 // Test passing aligned empty aggregate // { dg-do compile } -// { dg-options "-Wno-psabi" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } +// { dg-options "-Wno-psabi" { target { { { i?86-*-* x86_64-*-* } && ilp32 } || { riscv*-*-* } } } } struct S { union {} a; } __attribute__((aligned)); diff --git a/gcc/testsuite/g++.dg/analyzer/exception-path-1-sarif.py b/gcc/testsuite/g++.dg/analyzer/exception-path-1-sarif.py new file mode 100644 index 0000000..8958d96 --- /dev/null +++ b/gcc/testsuite/g++.dg/analyzer/exception-path-1-sarif.py @@ -0,0 +1,22 @@ +from sarif import * + +import pytest + +@pytest.fixture(scope='function', autouse=True) +def sarif(): + return sarif_from_env() + +def test_kinds(sarif): + result = get_result_by_index(sarif, 0) + + assert result['level'] == 'note' + + events = result["codeFlows"][0]["threadFlows"][0]['locations'] + + # Event "(1)": "throwing exception of type 'value_error' here..." (index == 0) + assert events[0]['location']['message']['text'] == "throwing exception of type 'value_error' here..." + assert events[0]['kinds'] == ["throw"] + + # Event "(2)": "...catching exception of type 'value_error' here" (index == 1) + assert events[1]['location']['message']['text'] == "...catching exception of type 'value_error' here" + assert events[1]['kinds'] == ["catch"] diff --git a/gcc/testsuite/g++.dg/analyzer/exception-path-1.C b/gcc/testsuite/g++.dg/analyzer/exception-path-1.C index 486ca193..d923d62 100644 --- a/gcc/testsuite/g++.dg/analyzer/exception-path-1.C +++ b/gcc/testsuite/g++.dg/analyzer/exception-path-1.C @@ -1,3 +1,5 @@ +/* { dg-additional-options "-fdiagnostics-add-output=sarif" } */ + /* Verify that we follow the correct paths when we know the typeinfo of an exception. */ @@ -32,3 +34,10 @@ int test () __analyzer_dump_path (); // { dg-bogus "path" } return 0; } + +/* Verify that some JSON was written to a file with the expected name. */ +/* { dg-final { verify-sarif-file } } */ + +/* Use a Python script to verify various properties about the generated + .sarif file: + { dg-final { run-sarif-pytest exception-path-1.C "exception-path-1-sarif.py" } } */ diff --git a/gcc/testsuite/g++.dg/analyzer/exception-path-unwind-multiple-2-sarif.py b/gcc/testsuite/g++.dg/analyzer/exception-path-unwind-multiple-2-sarif.py new file mode 100644 index 0000000..b817a64 --- /dev/null +++ b/gcc/testsuite/g++.dg/analyzer/exception-path-unwind-multiple-2-sarif.py @@ -0,0 +1,23 @@ +from sarif import * + +import pytest + +@pytest.fixture(scope='function', autouse=True) +def sarif(): + return sarif_from_env() + +def test_kinds(sarif): + result = get_result_by_index(sarif, 0) + + assert result['level'] == 'note' + + events = result["codeFlows"][0]["threadFlows"][0]['locations'] + + assert events[-4]['location']['message']['text'] == "throwing exception of type 'value_error' here..." + assert events[-4]['kinds'] == ["throw"] + + assert events[-3]['location']['message']['text'] == "unwinding 2 stack frames" + assert events[-3]['kinds'] == ["unwind"] + + assert events[-2]['location']['message']['text'] == "...catching exception of type 'value_error' here" + assert events[-2]['kinds'] == ["catch"] diff --git a/gcc/testsuite/g++.dg/analyzer/exception-path-unwind-multiple-2.C b/gcc/testsuite/g++.dg/analyzer/exception-path-unwind-multiple-2.C index 2608f17..aa1ff89 100644 --- a/gcc/testsuite/g++.dg/analyzer/exception-path-unwind-multiple-2.C +++ b/gcc/testsuite/g++.dg/analyzer/exception-path-unwind-multiple-2.C @@ -1,3 +1,5 @@ +/* { dg-additional-options "-fdiagnostics-add-output=sarif" } */ + /* Verify that we follow the correct paths when we know the typeinfo of an exception: interprocedural case where unwind multiple frame, failing to match the type. */ @@ -53,3 +55,10 @@ int outer () __analyzer_dump_path (); // { dg-bogus "path" } return 0; } + +/* Verify that some JSON was written to a file with the expected name. */ +/* { dg-final { verify-sarif-file } } */ + +/* Use a Python script to verify various properties about the generated + .sarif file: + { dg-final { run-sarif-pytest exception-path-unwind-multiple-2.C "exception-path-unwind-multiple-2-sarif.py" } } */ diff --git a/gcc/testsuite/g++.dg/analyzer/malloc.C b/gcc/testsuite/g++.dg/analyzer/malloc.C index d4ef831..f2da988 100644 --- a/gcc/testsuite/g++.dg/analyzer/malloc.C +++ b/gcc/testsuite/g++.dg/analyzer/malloc.C @@ -1,6 +1,9 @@ // { dg-do compile } /* { dg-skip-if "requires hosted libstdc++ for stdlib free" { ! hostedlib } } */ +/* Verify we don't ICE on SARIF output (PR analyzer/122626). */ +/* { dg-additional-options "-fdiagnostics-add-output=sarif" } */ + #include <stdlib.h> void test_1 (void *ptr) @@ -24,3 +27,5 @@ void test_2 (void *ptr) free (ptr); // { dg-message "first 'free' here" } s2 a (ptr); // { dg-message "passing freed pointer 'ptr' in call to 's2::s2' from 'test_2'" } } + +/* { dg-final { verify-sarif-file } } */ diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-conv1.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-conv1.C new file mode 100644 index 0000000..9fb18a7 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-conv1.C @@ -0,0 +1,17 @@ +// PR c++/122171 +// { dg-do compile { target c++11 } } + +constexpr unsigned int poly_size(unsigned int bits) { + return 1; +} + +template <unsigned int Deg> +using poly_table = char[poly_size(Deg)]; + +template <int BITS> +struct FingerprintTable { + static const poly_table<BITS> table; +}; + +template <int BITS> +const poly_table<BITS> FingerprintTable<BITS>::table = {}; diff --git a/gcc/testsuite/g++.dg/cpp0x/auto9.C b/gcc/testsuite/g++.dg/cpp0x/auto9.C index a3a6caf..2f4de05 100644 --- a/gcc/testsuite/g++.dg/cpp0x/auto9.C +++ b/gcc/testsuite/g++.dg/cpp0x/auto9.C @@ -15,8 +15,8 @@ const std::type_info &t2 = typeid (auto *); // { dg-error "auto" } struct A { - operator auto (); // { dg-error "auto" "" { target { ! c++14 } } } - operator auto *(); // { dg-error "auto" "" { target { ! c++14 } } } + operator auto (); // { dg-error "auto" } + operator auto *(); // { dg-error "auto" } }; struct A2 diff --git a/gcc/testsuite/g++.dg/cpp0x/noexcept91.C b/gcc/testsuite/g++.dg/cpp0x/noexcept91.C new file mode 100644 index 0000000..590dfa6 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/noexcept91.C @@ -0,0 +1,15 @@ +// PR c++/122668 +// { dg-do compile { target c++11 } } + +template<class T> +struct A { + friend void f1(A& a) noexcept(noexcept(a.g(0))) { } + friend void f2(A& a) noexcept(noexcept(A::g(0))) { } + static void g(int) noexcept; +}; + +int main() { + A<int> a; + static_assert(noexcept(f1(a)), ""); + static_assert(noexcept(f2(a)), ""); +} diff --git a/gcc/testsuite/g++.dg/cpp0x/pr119580.C b/gcc/testsuite/g++.dg/cpp0x/pr119580.C new file mode 100644 index 0000000..598ddbb --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr119580.C @@ -0,0 +1,16 @@ +// PR c++/119580 +// { dg-do compile { target c++11 } } + +template<typename> struct V; +template<typename> class C; +class F; + +struct S { + template<typename> + static void foo (); + template<typename T, typename> + C<decltype(S::foo<T::value_type>)> foo (); + decltype(foo<V<F>>()) *a; +}; + +S s; diff --git a/gcc/testsuite/g++.dg/cpp0x/pr122465.C b/gcc/testsuite/g++.dg/cpp0x/pr122465.C new file mode 100644 index 0000000..b8de3d4 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr122465.C @@ -0,0 +1,10 @@ +// PR c++/122465 +// { dg-do compile { target c++11 } } + +void +foo () +{ + int x = 0; + for (const T i = { i } : x) // { dg-error "'T' does not name a type" } + ; +} diff --git a/gcc/testsuite/g++.dg/cpp1y/auto-fn12.C b/gcc/testsuite/g++.dg/cpp1y/auto-fn12.C index 9888579..1ee1755 100644 --- a/gcc/testsuite/g++.dg/cpp1y/auto-fn12.C +++ b/gcc/testsuite/g++.dg/cpp1y/auto-fn12.C @@ -1,6 +1,6 @@ // { dg-do compile { target c++14 } } // { dg-final { scan-assembler "_ZN1AIiEcvDaEv" } } -// { dg-additional-options -fno-implicit-constexpr } +// { dg-options -fno-implicit-constexpr } template <class T> struct A { diff --git a/gcc/testsuite/g++.dg/cpp1y/auto-fn13.C b/gcc/testsuite/g++.dg/cpp1y/auto-fn13.C index 96b4b0c..bb4f3ca 100644 --- a/gcc/testsuite/g++.dg/cpp1y/auto-fn13.C +++ b/gcc/testsuite/g++.dg/cpp1y/auto-fn13.C @@ -1,4 +1,5 @@ // { dg-do compile { target c++14 } } +// { dg-options "" } struct A { template <class T> diff --git a/gcc/testsuite/g++.dg/cpp1y/auto-fn22.C b/gcc/testsuite/g++.dg/cpp1y/auto-fn22.C index b16a764..68d8d85 100644 --- a/gcc/testsuite/g++.dg/cpp1y/auto-fn22.C +++ b/gcc/testsuite/g++.dg/cpp1y/auto-fn22.C @@ -1,4 +1,5 @@ // { dg-do compile { target c++14 } } +// { dg-options "" } struct A { diff --git a/gcc/testsuite/g++.dg/cpp1y/auto-fn44.C b/gcc/testsuite/g++.dg/cpp1y/auto-fn44.C index e35215d..4439f47 100644 --- a/gcc/testsuite/g++.dg/cpp1y/auto-fn44.C +++ b/gcc/testsuite/g++.dg/cpp1y/auto-fn44.C @@ -1,11 +1,12 @@ // PR c++/79474 // { dg-do compile { target c++14 } } +// { dg-options "-Wpedantic" } struct Funject { - operator auto() { return +[](bool b) {return b;}; } + operator auto() { return +[](bool b) {return b;}; } // { dg-warning "invalid use of 'auto' in conversion operator" } operator auto() { return +[](bool b, bool, bool) {return b;}; } // { dg-error "cannot be overloaded" } -}; +}; // { dg-warning "invalid use of 'auto' in conversion operator" "" { target *-*-* } .-1 } Funject fun; auto bbb = fun(true); diff --git a/gcc/testsuite/g++.dg/cpp1y/auto-fn50.C b/gcc/testsuite/g++.dg/cpp1y/auto-fn50.C index a2c7e40..8a90105 100644 --- a/gcc/testsuite/g++.dg/cpp1y/auto-fn50.C +++ b/gcc/testsuite/g++.dg/cpp1y/auto-fn50.C @@ -1,10 +1,11 @@ // PR c++/84906 // { dg-do compile { target c++14 } } +// { dg-options "-Wpedantic" } extern "C" int puts(const char*); struct aa { - operator auto() { + operator auto() { // { dg-warning "invalid use of 'auto' in conversion operator" } puts("auto"); return false; } diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-121445.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-121445.C new file mode 100644 index 0000000..b210aaf --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/constexpr-121445.C @@ -0,0 +1,19 @@ +// PR c++/121445 +// { dg-do compile { target c++14 } } + +struct D { + const char *d; + const char *foo () { return ""; }; // { dg-message "declared here" "" { target c++20_down } } + constexpr D () : d (foo ()) {} // { dg-error "call to non-'constexpr' function 'const char\\\* D::foo\\\(\\\)'" "" { target c++20_down } } + constexpr D &operator= (const char *) { return *this; } +}; +struct S { + constexpr S () + { + struct A { D a; }; + struct B { A b; }; + struct C { B c; }; + C d {}; + d.c.b.a = ""; + } +}; diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-assert2.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-assert2.C index def05f5..58f9a31 100644 --- a/gcc/testsuite/g++.dg/cpp1y/constexpr-assert2.C +++ b/gcc/testsuite/g++.dg/cpp1y/constexpr-assert2.C @@ -1,6 +1,7 @@ // PR c++/65985 // { dg-do compile { target c++14 } } // { dg-skip-if "requires hosted libstdc++ for cassert" { ! hostedlib } } +// { dg-options "" } #include <cassert> diff --git a/gcc/testsuite/g++.dg/cpp1y/defaulted1.C b/gcc/testsuite/g++.dg/cpp1y/defaulted1.C new file mode 100644 index 0000000..7b38f97 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/defaulted1.C @@ -0,0 +1,17 @@ +// PR c++/119964 +// { dg-do compile { target c++14 } } + +struct A { + int i; + constexpr A(int v) : i(v) {} + constexpr A(const A&&); +}; + +constexpr int f() { + A a(1); + A b = static_cast<const A&&>( a ); + return b.i; +} + +constexpr A::A(const A&&) = default; // { dg-error "does not match the expected signature" } +static_assert(f () == 1, ""); diff --git a/gcc/testsuite/g++.dg/cpp1y/defaulted2.C b/gcc/testsuite/g++.dg/cpp1y/defaulted2.C new file mode 100644 index 0000000..9e5e6a6 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/defaulted2.C @@ -0,0 +1,15 @@ +// PR c++/119964 +// { dg-do compile { target c++14 } } + +struct A { + int i; + constexpr A(int v) : i(v) {} + constexpr A(const A&&) = default; // { dg-error "implicitly deleted" "" { target c++17_down } } + // { dg-warning "implicitly deleted" "" { target c++20 } .-1 } +}; + +constexpr int f() { + A a(1); + A b = static_cast<const A&&>( a ); // { dg-error "use of deleted function" } + return b.i; +} diff --git a/gcc/testsuite/g++.dg/cpp1z/has-unique-obj-representations5.C b/gcc/testsuite/g++.dg/cpp1z/has-unique-obj-representations5.C new file mode 100644 index 0000000..9380e04 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/has-unique-obj-representations5.C @@ -0,0 +1,47 @@ +// { dg-do compile { target c++17 } } +// Test diagnostics on static assertion failure. + +template <typename T> +constexpr bool is_unique = __has_unique_object_representations(T); + +struct AA { + float x; // { dg-message "float" } +}; +static_assert(is_unique<AA>); // { dg-error "assert" } + +struct A : AA {}; // { dg-message "base" } +static_assert(is_unique<A>); // { dg-error "assert" } + +struct B { + char : 1; // { dg-message "unnamed bit-field inserts padding before" } + char x : 7; +}; +static_assert(is_unique<B>); // { dg-error "assert" } + +struct C { + char x : 5; // { dg-message "padding occurs between 'C::x' and 'C::y'" } + char y; +}; +static_assert(is_unique<C>); // { dg-error "assert" } + +struct D { + int x : 5; // { dg-message "padding occurs" } +}; +static_assert(is_unique<D>); // { dg-error "assert" } + +union E { + char x[1]; // { dg-message "does not fill all bits" } + char y[2]; +}; +static_assert(is_unique<E>); // { dg-error "assert" } + +union F {}; // { dg-message "no data fields" } +static_assert(is_unique<F>); // { dg-error "assert" } + +struct G { G(const G&); }; // { dg-message "trivially copyable" } +static_assert(is_unique<G>); // { dg-error "assert" } + +struct H { + AA a; // { dg-message "unique object representations" } +}; +static_assert(is_unique<H>); // { dg-error "assert" } diff --git a/gcc/testsuite/g++.dg/cpp1z/pr122185.C b/gcc/testsuite/g++.dg/cpp1z/pr122185.C new file mode 100644 index 0000000..73cba76 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/pr122185.C @@ -0,0 +1,49 @@ +// PR c++/122185 +// { dg-do compile { target c++17 } } +// { dg-options "-w -O2" } + +namespace std { +template <typename _Tp> struct remove_reference { + using type = __remove_reference(_Tp); +}; +template <typename _Tp> _Tp forward(typename remove_reference<_Tp>::type); +} +template <typename T> struct static_const { + static constexpr T value{}; +}; +template <typename, typename> struct adl_serializer; +template <template <typename, typename> class = adl_serializer> +class basic_json; +struct from_json_fn { + template <typename BasicJsonType, typename T> + void operator()(BasicJsonType, T) const; +}; +template <typename, typename> struct adl_serializer { + template <typename BasicJsonType, typename TargetType> + static void from_json(BasicJsonType &&j, TargetType val) { + static_const<from_json_fn>::value(std::forward<BasicJsonType>(j), val); + } +}; +struct iter_impl { + basic_json<> operator*(); + void operator++(); + bool operator!=(iter_impl); +}; +template <template <typename, typename = void> class JSONSerializer> +struct basic_json { + template <typename> using iter_impl = iter_impl; + using iterator = iter_impl<basic_json>; + template <typename> void get_impl(int) { + auto ret = int(); + JSONSerializer<int>::from_json(*this, ret); + } + template <typename> void get() { get_impl<int>({}); } + iterator begin(); + iterator end(); + char type_name; +}; +void _ValidateSignatureFile() { + basic_json signatures; + for (auto signature : signatures) + signature.get<int>(); +} diff --git a/gcc/testsuite/g++.dg/cpp26/constexpr-eh17.C b/gcc/testsuite/g++.dg/cpp26/constexpr-eh17.C new file mode 100644 index 0000000..4d83d0d --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp26/constexpr-eh17.C @@ -0,0 +1,38 @@ +// PR libstdc++/122671 +// { dg-do compile { target c++26 } } + +#include <new> +#include <memory> + +consteval auto +foo () +{ + struct E {}; + struct O + { + constexpr explicit O (int x) + { + if (x < 0) { throw E {}; } + } + }; + + try + { + struct S + { + O *s; + constexpr S () : s { std::allocator <O> {}.allocate (1) } {} + constexpr ~S () { std::allocator <O> {}.deallocate (s, 1); } + }; + + auto s = S {}; + + ::new (s.s) O { -1 }; + } + catch (E &) + { + } + return true; +} + +static_assert (foo ()); diff --git a/gcc/testsuite/g++.dg/cpp26/decomp18.C b/gcc/testsuite/g++.dg/cpp26/decomp18.C index 86b9bf4..68dae3f 100644 --- a/gcc/testsuite/g++.dg/cpp26/decomp18.C +++ b/gcc/testsuite/g++.dg/cpp26/decomp18.C @@ -1,6 +1,8 @@ // P1061R10 - Structured Bindings can introduce a Pack // { dg-do run { target c++11 } } // { dg-options "" } +// { dg-add-options tls } +// { dg-require-effective-target tls_runtime } struct S { int a, b, c; }; namespace std { diff --git a/gcc/testsuite/g++.dg/cpp26/erroneous5.C b/gcc/testsuite/g++.dg/cpp26/erroneous5.C new file mode 100644 index 0000000..0ee624b --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp26/erroneous5.C @@ -0,0 +1,241 @@ +// C++ 26 P2795R5 - Erroneous behaviour for uninitialized reads +// { dg-do compile } +// { dg-skip-if "" { *-*-* } { "-ftrivial-auto-var-init=*" } { "" } } +// { dg-options "-O2 -fdump-tree-gimple" } +// All the s1..s24 variables and i1 need .DEFERRED_INIT call on their +// declarations. +// Plus, forward gotos to l1 & l2 labels need up to s1-s4 and s6-s9 vars to +// be .DEFERRED_INITed (and backward gotos up to that minus the first two). +// switch to case 15 skips over s12, switch to case 16/17 skip +// over s12 and s13 but the adjacent l3 label needs to also skip over s3-s4 +// and s6-s9 and s11. switch to case 18 skips over s12-s14 and switch to +// default in the same switch skips over s12-s15. +// goto l4; skips over s19 initialization. +// goto l5; skips over s20-s22 initialization. +// switch to case 32/33 skips over s23 but goto to adjacent l6 skips also +// over s20-s22. switch to default in that switch skips over s23-s24. +// { dg-final { scan-tree-dump-times " s1 = \.DEFERRED_INIT \\\(" 2 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s2 = \.DEFERRED_INIT \\\(" 2 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s3 = \.DEFERRED_INIT \\\(" 3 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s4 = \.DEFERRED_INIT \\\(" 3 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s5 = \.DEFERRED_INIT \\\(" 1 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s6 = \.DEFERRED_INIT \\\(" 3 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s7 = \.DEFERRED_INIT \\\(" 3 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s8 = \.DEFERRED_INIT \\\(" 3 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s9 = \.DEFERRED_INIT \\\(" 3 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s10 = \.DEFERRED_INIT \\\(" 1 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s11 = \.DEFERRED_INIT \\\(" 2 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s12 = \.DEFERRED_INIT \\\(" 5 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s13 = \.DEFERRED_INIT \\\(" 4 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s14 = \.DEFERRED_INIT \\\(" 3 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s15 = \.DEFERRED_INIT \\\(" 2 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s16 = \.DEFERRED_INIT \\\(" 1 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s17 = \.DEFERRED_INIT \\\(" 1 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s18 = \.DEFERRED_INIT \\\(" 1 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s19 = \.DEFERRED_INIT \\\(" 2 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s20 = \.DEFERRED_INIT \\\(" 3 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s21 = \.DEFERRED_INIT \\\(" 3 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s22 = \.DEFERRED_INIT \\\(" 3 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s23 = \.DEFERRED_INIT \\\(" 3 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s24 = \.DEFERRED_INIT \\\(" 2 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " i1 = \.DEFERRED_INIT \\\(" 1 "gimple" { target c++26 } } } + +struct S { int a, b, c; }; + +template <int N> +int +foo (int x) +{ + int r = 0; + if (x == 1) + goto l1; + S s1; + if (x == 2) + goto l1; + S s2; + { + S s10; + if (x == 12) + goto l1; + s10.a = 1; + r += s10.a; + int i1; + if (x == 13) + goto l1; + i1 = 2; + r += i1; + } + if (x == 3) + goto l2; + if (x == 4) + goto l1; + { + S s3; + if (x == 5) + goto l2; + S s4; + if (x == 6) + goto l1; + { + S s5; + if (x == 7) + goto l1; + s5.a = 5; + r += s5.a; + } + S s6; + { + S s7; + S s8; + if (x == 8) + goto l1; + S s9; + if (x == 9) + goto l2; + if (x == 10) + goto l2; + if (x == 11) + goto l2; + l1: + l2: + s1.a = 1; + s2.b = 2; + s3.c = 3; + s4.a = 4; + s6.b = 6; + s7.c = 7; + s8.a = 8; + s9.b = 9; + r += s1.a + s2.b + s3.c; + r += s4.a + s6.b + s7.c; + r += s8.a + s9.b; + if (x == 14) + goto l3; + S s11; + switch (x) + { + S s12; + case 15: + S s13; + // FALLTHRU + l3: + case 16: + case 17: + S s14; + s11.a = 1; + s12.b = 2; + s13.c = 3; + s14.a = 4; + r += s11.a + s12.b + s13.c; + r += s14.a; + return r; + case 18: + S s15; + s11.a = 1; + s12.b = 2; + s13.c = 3; + s14.a = 4; + s15.b = 5; + r += s11.a + s12.b + s13.c; + r += s14.a + s15.b; + return r; + default: + if (x != 19 && x != 20) + break; + S s16; + s11.a = 1; + s12.b = 2; + s13.c = 3; + s14.a = 4; + s15.b = 5; + s16.c = 6; + r += s11.a + s12.b + s13.c; + r += s14.a + s15.b + s16.c; + return r; + } + if (x == 21) + goto l3; + } + S s17; + if (x == 22) + goto l3; + if (x == 23) + goto l1; + if (x == 24) + goto l2; + s17.a = 1; + r += s17.a; + } + S s18; + if (x == 25) + { + S s19; + s19.c = 2; + r += s19.c; + if (x == 29) + l4:; + goto l3; + } + if (x == 26) + goto l1; + if (x == 27) + goto l2; + s18.b = 1; + r += s18.b; + if (x == 28) + goto l4; + { + S s20; + { + S s21; + if (x == 29) + goto l1; + S s22; + if (x == 30) + goto l2; + l5: + s20.a = 1; + s21.b = 2; + s22.c = 3; + r += s20.a + s21.b + s22.c; + switch (x) + { + case 31: + S s23; + // FALLTHRU + l6: + case 32: + case 33: + S s24; + s23.a = 1; + s24.b = 2; + r += s23.a + s24.b; + return r; + default: + if (x >= 34 && x <= 35) + return r; + break; + } + if (x == 34) + goto l5; + if (x == 35) + goto l6; + return r; + } + if (x == 36) + goto l5; + if (x == 37) + goto l6; + } + if (x == 38) + goto l5; + if (x == 39) + goto l6; + return r; +} + +int +bar (int x) +{ + return foo <42> (x); +} diff --git a/gcc/testsuite/g++.dg/cpp26/erroneous6.C b/gcc/testsuite/g++.dg/cpp26/erroneous6.C new file mode 100644 index 0000000..e3ddf35 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp26/erroneous6.C @@ -0,0 +1,241 @@ +// C++ 26 P2795R5 - Erroneous behaviour for uninitialized reads +// { dg-do compile } +// { dg-skip-if "" { *-*-* } { "-ftrivial-auto-var-init=*" } { "" } } +// { dg-options "-O2 -fdump-tree-gimple" } +// All the s1..s24 variables and i1 need .DEFERRED_INIT call on their +// declarations. +// Plus, forward gotos to l1 & l2 labels need up to s1-s4 and s6-s9 vars to +// be .DEFERRED_INITed (and backward gotos up to that minus the first two). +// switch to case 15 skips over s12, switch to case 16/17 skip +// over s12 and s13 but the adjacent l3 label needs to also skip over s3-s4 +// and s6-s9 and s11. switch to case 18 skips over s12-s14 and switch to +// default in the same switch skips over s12-s15. +// goto l4; skips over s19 initialization. +// goto l5; skips over s20-s22 initialization. +// switch to case 32/33 skips over s23 but goto to adjacent l6 skips also +// over s20-s22. switch to default in that switch skips over s23-s24. +// { dg-final { scan-tree-dump-times " s1 = \.DEFERRED_INIT \\\(" 2 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s2 = \.DEFERRED_INIT \\\(" 2 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s3 = \.DEFERRED_INIT \\\(" 3 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s4 = \.DEFERRED_INIT \\\(" 3 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s5 = \.DEFERRED_INIT \\\(" 1 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s6 = \.DEFERRED_INIT \\\(" 3 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s7 = \.DEFERRED_INIT \\\(" 3 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s8 = \.DEFERRED_INIT \\\(" 3 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s9 = \.DEFERRED_INIT \\\(" 3 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s10 = \.DEFERRED_INIT \\\(" 1 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s11 = \.DEFERRED_INIT \\\(" 2 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s12 = \.DEFERRED_INIT \\\(" 5 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s13 = \.DEFERRED_INIT \\\(" 4 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s14 = \.DEFERRED_INIT \\\(" 3 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s15 = \.DEFERRED_INIT \\\(" 2 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s16 = \.DEFERRED_INIT \\\(" 1 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s17 = \.DEFERRED_INIT \\\(" 1 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s18 = \.DEFERRED_INIT \\\(" 1 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s19 = \.DEFERRED_INIT \\\(" 2 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s20 = \.DEFERRED_INIT \\\(" 3 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s21 = \.DEFERRED_INIT \\\(" 3 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s22 = \.DEFERRED_INIT \\\(" 3 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s23 = \.DEFERRED_INIT \\\(" 3 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " s24 = \.DEFERRED_INIT \\\(" 2 "gimple" { target c++26 } } } +// { dg-final { scan-tree-dump-times " i1 = \.DEFERRED_INIT \\\(" 1 "gimple" { target c++26 } } } + +struct S { int a, b, c; }; + +template <typename S> +int +foo (int x) +{ + int r = 0; + if (x == 1) + goto l1; + S s1; + if (x == 2) + goto l1; + S s2; + { + S s10; + if (x == 12) + goto l1; + s10.a = 1; + r += s10.a; + int i1; + if (x == 13) + goto l1; + i1 = 2; + r += i1; + } + if (x == 3) + goto l2; + if (x == 4) + goto l1; + { + S s3; + if (x == 5) + goto l2; + S s4; + if (x == 6) + goto l1; + { + S s5; + if (x == 7) + goto l1; + s5.a = 5; + r += s5.a; + } + S s6; + { + S s7; + S s8; + if (x == 8) + goto l1; + S s9; + if (x == 9) + goto l2; + if (x == 10) + goto l2; + if (x == 11) + goto l2; + l1: + l2: + s1.a = 1; + s2.b = 2; + s3.c = 3; + s4.a = 4; + s6.b = 6; + s7.c = 7; + s8.a = 8; + s9.b = 9; + r += s1.a + s2.b + s3.c; + r += s4.a + s6.b + s7.c; + r += s8.a + s9.b; + if (x == 14) + goto l3; + S s11; + switch (x) + { + S s12; + case 15: + S s13; + // FALLTHRU + l3: + case 16: + case 17: + S s14; + s11.a = 1; + s12.b = 2; + s13.c = 3; + s14.a = 4; + r += s11.a + s12.b + s13.c; + r += s14.a; + return r; + case 18: + S s15; + s11.a = 1; + s12.b = 2; + s13.c = 3; + s14.a = 4; + s15.b = 5; + r += s11.a + s12.b + s13.c; + r += s14.a + s15.b; + return r; + default: + if (x != 19 && x != 20) + break; + S s16; + s11.a = 1; + s12.b = 2; + s13.c = 3; + s14.a = 4; + s15.b = 5; + s16.c = 6; + r += s11.a + s12.b + s13.c; + r += s14.a + s15.b + s16.c; + return r; + } + if (x == 21) + goto l3; + } + S s17; + if (x == 22) + goto l3; + if (x == 23) + goto l1; + if (x == 24) + goto l2; + s17.a = 1; + r += s17.a; + } + S s18; + if (x == 25) + { + S s19; + s19.c = 2; + r += s19.c; + if (x == 29) + l4:; + goto l3; + } + if (x == 26) + goto l1; + if (x == 27) + goto l2; + s18.b = 1; + r += s18.b; + if (x == 28) + goto l4; + { + S s20; + { + S s21; + if (x == 29) + goto l1; + S s22; + if (x == 30) + goto l2; + l5: + s20.a = 1; + s21.b = 2; + s22.c = 3; + r += s20.a + s21.b + s22.c; + switch (x) + { + case 31: + S s23; + // FALLTHRU + l6: + case 32: + case 33: + S s24; + s23.a = 1; + s24.b = 2; + r += s23.a + s24.b; + return r; + default: + if (x >= 34 && x <= 35) + return r; + break; + } + if (x == 34) + goto l5; + if (x == 35) + goto l6; + return r; + } + if (x == 36) + goto l5; + if (x == 37) + goto l6; + } + if (x == 38) + goto l5; + if (x == 39) + goto l6; + return r; +} + +int +bar (int x) +{ + return foo <S> (x); +} diff --git a/gcc/testsuite/g++.dg/cpp26/expansion-stmt27.C b/gcc/testsuite/g++.dg/cpp26/expansion-stmt27.C new file mode 100644 index 0000000..2a0d325 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp26/expansion-stmt27.C @@ -0,0 +1,17 @@ +// PR c++/122788 +// { dg-do compile { target c++14 } } +// { dg-options "-Wunused" } + +void +foo () +{ + template for ([[maybe_unused]] auto i : { 42 }) // { dg-warning "'template for' only available with" "" { target c++23_down } } + ; // { dg-bogus "unused variable 'i'" "" { target *-*-* } .-1 } + template for ([[maybe_unused]] auto j : { 1, 2, 3 }) // { dg-warning "'template for' only available with" "" { target c++23_down } } + { // { dg-bogus "unused variable 'j'" "" { target *-*-* } .-1 } +#if __cpp_if_constexpr >= 201606 + if constexpr (false) + (void) j; +#endif + } +} diff --git a/gcc/testsuite/g++.dg/cpp26/feat-cxx26.C b/gcc/testsuite/g++.dg/cpp26/feat-cxx26.C index 4fe0680..08c0ed4 100644 --- a/gcc/testsuite/g++.dg/cpp26/feat-cxx26.C +++ b/gcc/testsuite/g++.dg/cpp26/feat-cxx26.C @@ -647,12 +647,6 @@ # error "__cpp_constexpr_exceptions != 202411" #endif -#ifndef __cpp_trivial_relocatability -# error "__cpp_trivial_relocatability" -#elif __cpp_trivial_relocatability != 202502 -# error "__cpp_trivial_relocatability != 202502" -#endif - #ifndef __cpp_expansion_statements # error "__cpp_expansion_statements" #elif __cpp_expansion_statements != 202506 diff --git a/gcc/testsuite/g++.dg/cpp26/pack-indexing18.C b/gcc/testsuite/g++.dg/cpp26/pack-indexing18.C new file mode 100644 index 0000000..d3e3730 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp26/pack-indexing18.C @@ -0,0 +1,32 @@ +// PR c++/121325 +// { dg-do compile { target c++26 } } + +void f(auto... a) requires requires { []<int i = 0> noexcept(noexcept(a...[i])) { }(); } {} +void g(auto... a) requires requires { []<int i = 0> { static_assert(noexcept(a...[i])); }(); } {} + +void +h () +{ + f (0); + g (0); +} + +void foo () {} +void bar () noexcept {} +template<bool B> +void baz () noexcept(B) {} + +template<typename... Ts> +void +x (Ts... ts) noexcept (noexcept (ts...[0]())) +{ +} + +void +y () +{ + static_assert (!noexcept (x (foo))); + static_assert (noexcept (x (bar))); + static_assert (noexcept (x (baz<true>))); + static_assert (!noexcept (x (baz<false>))); +} diff --git a/gcc/testsuite/g++.dg/cpp26/trivially-relocatable1.C b/gcc/testsuite/g++.dg/cpp26/trivially-relocatable1.C deleted file mode 100644 index 29ba907..0000000 --- a/gcc/testsuite/g++.dg/cpp26/trivially-relocatable1.C +++ /dev/null @@ -1,137 +0,0 @@ -// P2786R13 - C++26 Trivial Relocatability -// { dg-do compile { target c++11 } } -// { dg-options "" } -// { dg-additional-options "-pedantic" { target c++17 } } - -#if __cpp_trivial_relocatability < 202502L -#define trivially_relocatable_if_eligible __trivially_relocatable_if_eligible -#define replaceable_if_eligible __replaceable_if_eligible -#endif - -namespace std -{ -template <typename T, T v> -struct integral_constant -{ - static constexpr T value = v; -}; - -template <typename> -struct is_trivially_relocatable; - -template <typename> -struct is_replaceable; - -template<typename T> -struct is_trivially_relocatable - : public integral_constant <bool, __builtin_is_trivially_relocatable (T)> -{ -}; - -template<typename T> -struct is_replaceable - : public integral_constant <bool, __builtin_is_replaceable (T)> -{ -}; - -template <typename T> -inline constexpr bool is_trivially_relocatable_v // { dg-warning "inline variables are only available with" "" { target c++14_down } } - = __builtin_is_trivially_relocatable (T); // { dg-warning "variable templates only available with" "" { target c++11_down } .-1 } - -template <typename T> -inline constexpr bool is_replaceable_v // { dg-warning "inline variables are only available with" "" { target c++14_down } } - = __builtin_is_replaceable (T); // { dg-warning "variable templates only available with" "" { target c++11_down } .-1 } -} - -struct A {}; - -static_assert (std::is_trivially_relocatable_v <A>, ""); -static_assert (std::is_replaceable_v <A>, ""); - -struct B { - B (); - ~B (); - B (const B &); - B (B &&); - B &operator= (const B &); - B &operator= (B &&); -}; - -static_assert (!std::is_trivially_relocatable_v <B>, ""); -static_assert (!std::is_replaceable_v <B>, ""); - -struct C { - C (C &&) = delete; - C &operator= (C &&) = delete; - C () = default; -}; - -// Note, P2786R13 says it is trivially relocatable, but I think -// it isn't default-movable because overload resolution in both -// cases selects a deleted special member fn. -static_assert (!std::is_trivially_relocatable_v <C>, ""); -static_assert (!std::is_replaceable_v <C>, ""); - -struct D : A {}; - -static_assert (std::is_trivially_relocatable_v <D>, ""); -static_assert (std::is_replaceable_v <D>, ""); - -struct E : virtual A {}; - -static_assert (!std::is_trivially_relocatable_v <E>, ""); -static_assert (std::is_replaceable_v <E>, ""); - -struct F trivially_relocatable_if_eligible : virtual A {}; - -static_assert (!std::is_trivially_relocatable_v <F>, ""); -static_assert (std::is_replaceable_v <F>, ""); - -struct G { B data; }; - -static_assert (!std::is_trivially_relocatable_v <G>, ""); -static_assert (!std::is_replaceable_v <G>, ""); - -struct H { ~H () = default; }; - -static_assert (std::is_trivially_relocatable_v <H>, ""); -static_assert (std::is_replaceable_v <H>, ""); - -struct I { ~I (); }; -I::~I () = default; - -static_assert (!std::is_trivially_relocatable_v <I>, ""); -static_assert (!std::is_replaceable_v <I>, ""); - -struct J { virtual ~J () = default; }; - -// Note, P2786R13 says otherwise for both, but that looks like -// a bug in the paper, it otherwise says that polymorphic types -// can be both trivially relocatable and replaceable. -static_assert (std::is_trivially_relocatable_v <J>, ""); -static_assert (std::is_replaceable_v <J>, ""); - -struct K { ~K () = delete; }; - -static_assert (!std::is_trivially_relocatable_v <K>, ""); -static_assert (!std::is_replaceable_v <K>, ""); - -struct L { L (L &&) = default; }; - -// Note, P2786R13 says otherwise for both, but that looks like -// a bug in the paper to me. While move ctor is trivial here, -// copy assignment operator is implicitly declared as deleted -// and move assignent operator is not declared. -static_assert (!std::is_trivially_relocatable_v <L>, ""); -static_assert (!std::is_replaceable_v <L>, ""); - -struct M { M (M &&); }; -M::M (M &&) = default; - -static_assert (!std::is_trivially_relocatable_v <M>, ""); -static_assert (!std::is_replaceable_v <M>, ""); - -struct N { N (N &&) = delete; }; - -static_assert (!std::is_trivially_relocatable_v <N>, ""); -static_assert (!std::is_replaceable_v <N>, ""); diff --git a/gcc/testsuite/g++.dg/cpp26/trivially-relocatable10.C b/gcc/testsuite/g++.dg/cpp26/trivially-relocatable10.C deleted file mode 100644 index 2ed1d5e..0000000 --- a/gcc/testsuite/g++.dg/cpp26/trivially-relocatable10.C +++ /dev/null @@ -1,135 +0,0 @@ -// P2786R13 - C++26 Trivial Relocatability -// { dg-do compile { target c++11 } } -// { dg-options "" } -// { dg-additional-options "-pedantic" { target c++17 } } - -#if __cpp_trivial_relocatability < 202502L -#define trivially_relocatable_if_eligible __trivially_relocatable_if_eligible -#define replaceable_if_eligible __replaceable_if_eligible -#endif - -namespace std -{ -template <typename T, T v> -struct integral_constant -{ - static constexpr T value = v; -}; - -template <typename> -struct is_trivially_relocatable; - -template <typename> -struct is_replaceable; - -template<typename T> -struct is_trivially_relocatable - : public integral_constant <bool, __builtin_is_trivially_relocatable (T)> -{ -}; - -template<typename T> -struct is_replaceable - : public integral_constant <bool, __builtin_is_replaceable (T)> -{ -}; - -template <typename T> -inline constexpr bool is_trivially_relocatable_v // { dg-warning "inline variables are only available with" "" { target c++14_down } } - = __builtin_is_trivially_relocatable (T); // { dg-warning "variable templates only available with" "" { target c++11_down } .-1 } - -template <typename T> -inline constexpr bool is_replaceable_v // { dg-warning "inline variables are only available with" "" { target c++14_down } } - = __builtin_is_replaceable (T); // { dg-warning "variable templates only available with" "" { target c++11_down } .-1 } -} - -struct A replaceable_if_eligible { A (A &&); A &operator= (A &&); ~A (); int a; }; - -static_assert (std::is_replaceable_v <A>, ""); -static_assert (!std::is_replaceable_v <const A>, ""); -static_assert (!std::is_replaceable_v <A volatile>, ""); -static_assert (!std::is_replaceable_v <const A volatile>, ""); - -struct B { B (B &&); B &operator= (B &&); ~B (); int a; }; - -static_assert (!std::is_replaceable_v <B>, ""); - -struct C replaceable_if_eligible : public A { C (C &&); C &operator= (C &&); ~C (); int a; }; - -static_assert (std::is_replaceable_v <C>, ""); - -struct D replaceable_if_eligible : public B { D (D &&); D &operator= (D &&); ~D (); int a; }; - -static_assert (!std::is_replaceable_v <D>, ""); - -struct E replaceable_if_eligible { E (E &&); E &operator= (E &&); ~E (); A a; }; - -static_assert (std::is_replaceable_v <E>, ""); - -struct F replaceable_if_eligible { F (F &&); F &operator= (F &&); ~F (); B a; }; - -static_assert (!std::is_replaceable_v <F>, ""); - -struct G replaceable_if_eligible { G (G &&); G &operator= (G &&); ~G () = delete; int a; }; - -static_assert (!std::is_replaceable_v <G>, ""); - -struct H replaceable_if_eligible : virtual A { H (H &&); H &operator= (H &&); ~H (); int a; }; - -static_assert (std::is_replaceable_v <H>, ""); - -struct I replaceable_if_eligible { I (I &&) = delete; I &operator= (I &&); ~I (); int a; }; - -static_assert (!std::is_replaceable_v <I>, ""); - -struct J replaceable_if_eligible { J (J &&); J &operator= (J &&) = delete; ~J (); int a; }; - -static_assert (!std::is_replaceable_v <J>, ""); - -struct K replaceable_if_eligible { K (const K &) = delete; K &operator= (K &&); ~K (); int a; }; - -static_assert (!std::is_replaceable_v <K>, ""); - -struct L replaceable_if_eligible { L (L &&); L &operator= (const L &) = delete; ~L (); int a; }; - -static_assert (!std::is_replaceable_v <L>, ""); - -struct M replaceable_if_eligible { M (); private: M (M &&); M &operator= (M &&); ~M (); int a; }; - -static_assert (std::is_replaceable_v <M>, ""); - -struct N replaceable_if_eligible { N (N &&); N &operator= (N &&); ~N (); const A a; }; - -static_assert (!std::is_replaceable_v <N>, ""); - -struct O replaceable_if_eligible { O (O &&); O &operator= (O &&); ~O (); volatile A a; }; - -static_assert (!std::is_replaceable_v <O>, ""); - -struct P replaceable_if_eligible { P (P &&); P &operator= (P &&); ~P (); const volatile A a; }; - -static_assert (!std::is_replaceable_v <P>, ""); - -struct Q replaceable_if_eligible { Q (Q &&); Q &operator= (Q &&); ~Q (); union { A a; int b; char c; }; }; - -static_assert (!std::is_replaceable_v <Q>, ""); - -struct R replaceable_if_eligible { R (R &&); R &operator= (R &&); ~R (); union { int a; B b; short c; }; }; - -static_assert (!std::is_replaceable_v <R>, ""); - -struct S replaceable_if_eligible { S (S &&); S &operator= (S &&); ~S (); union { int a; const int b; short c; }; }; - -static_assert (!std::is_replaceable_v <S>, ""); - -struct T replaceable_if_eligible { T (T &&); T &operator= (T &&); ~T () = default; int a; }; - -static_assert (std::is_replaceable_v <T>, ""); - -struct U replaceable_if_eligible { U (U &&); U &operator= (U &&); ~U (); union { T a; int b; char c; }; }; - -static_assert (!std::is_replaceable_v <U>, ""); - -struct V replaceable_if_eligible { V (V &&); V &operator= (V &&); ~V (); union { unsigned long long a; int b; char c; }; }; - -static_assert (std::is_replaceable_v <V>, ""); diff --git a/gcc/testsuite/g++.dg/cpp26/trivially-relocatable11.C b/gcc/testsuite/g++.dg/cpp26/trivially-relocatable11.C deleted file mode 100644 index 71fc6f1..0000000 --- a/gcc/testsuite/g++.dg/cpp26/trivially-relocatable11.C +++ /dev/null @@ -1,134 +0,0 @@ -// P2786R13 - C++26 Trivial Relocatability -// { dg-do compile { target c++11 } } -// { dg-options "" } -// { dg-additional-options "-pedantic" { target c++17 } } - -#if __cpp_trivial_relocatability < 202502L -#define trivially_relocatable_if_eligible __trivially_relocatable_if_eligible -#define replaceable_if_eligible __replaceable_if_eligible -#endif - -namespace std -{ -template <typename T, T v> -struct integral_constant -{ - static constexpr T value = v; -}; - -template <typename> -struct is_trivially_relocatable; - -template <typename> -struct is_replaceable; - -template<typename T> -struct is_trivially_relocatable - : public integral_constant <bool, __builtin_is_trivially_relocatable (T)> -{ -}; - -template<typename T> -struct is_replaceable - : public integral_constant <bool, __builtin_is_replaceable (T)> -{ -}; - -template <typename T> -inline constexpr bool is_trivially_relocatable_v // { dg-warning "inline variables are only available with" "" { target c++14_down } } - = __builtin_is_trivially_relocatable (T); // { dg-warning "variable templates only available with" "" { target c++11_down } .-1 } - -template <typename T> -inline constexpr bool is_replaceable_v // { dg-warning "inline variables are only available with" "" { target c++14_down } } - = __builtin_is_replaceable (T); // { dg-warning "variable templates only available with" "" { target c++11_down } .-1 } -} - -struct A { A (A &&) = default; A &operator= (A &&) = default; ~A () = default; int a; }; - -static_assert (std::is_trivially_relocatable_v <A>, ""); -static_assert (std::is_replaceable_v <A>, ""); - -struct B { B (B &&); B &operator= (B &&) = default; ~B () = default; int a; }; - -static_assert (!std::is_trivially_relocatable_v <B>, ""); -static_assert (!std::is_replaceable_v <B>, ""); - -union C { int a; A b; }; - -static_assert (std::is_trivially_relocatable_v <C>, ""); -static_assert (std::is_replaceable_v <C>, ""); - -union D { int a; A b; B c; }; - -static_assert (!std::is_trivially_relocatable_v <D>, ""); -static_assert (!std::is_replaceable_v <D>, ""); - -union E { E (); int a; A b; }; - -static_assert (std::is_trivially_relocatable_v <E>, ""); -static_assert (std::is_replaceable_v <E>, ""); - -union F { F () = default; int a; A b; }; - -static_assert (std::is_trivially_relocatable_v <F>, ""); -static_assert (std::is_replaceable_v <F>, ""); - -union G { G (const G &); int a; A b; }; - -static_assert (!std::is_trivially_relocatable_v <G>, ""); -static_assert (!std::is_replaceable_v <G>, ""); - -union H { H (const H &) = default; int a; A b; }; - -static_assert (!std::is_trivially_relocatable_v <H>, ""); -static_assert (!std::is_replaceable_v <H>, ""); - -union I { I (I &&); int a; A b; }; - -static_assert (!std::is_trivially_relocatable_v <I>, ""); -static_assert (!std::is_replaceable_v <I>, ""); - -union J { J (J &&) = default; int a; A b; }; - -static_assert (!std::is_trivially_relocatable_v <J>, ""); -static_assert (!std::is_replaceable_v <J>, ""); - -union K { K &operator= (const K &); int a; A b; }; - -static_assert (!std::is_trivially_relocatable_v <K>, ""); -static_assert (!std::is_replaceable_v <K>, ""); - -union L { L &operator= (const L &) = default; int a; A b; }; - -static_assert (!std::is_trivially_relocatable_v <L>, ""); -static_assert (!std::is_replaceable_v <L>, ""); - -union M { M &operator= (M &&); int a; A b; }; - -static_assert (!std::is_trivially_relocatable_v <M>, ""); -static_assert (!std::is_replaceable_v <M>, ""); - -union N { N &operator= (N &&) = default; int a; A b; }; - -static_assert (!std::is_trivially_relocatable_v <N>, ""); -static_assert (!std::is_replaceable_v <N>, ""); - -union O { ~O (); int a; A b; }; - -static_assert (!std::is_trivially_relocatable_v <O>, ""); -static_assert (!std::is_replaceable_v <O>, ""); - -union P { ~P () = default; int a; A b; }; - -static_assert (!std::is_trivially_relocatable_v <P>, ""); -static_assert (!std::is_replaceable_v <P>, ""); - -union Q { int a; const A b; }; - -static_assert (std::is_trivially_relocatable_v <Q>, ""); -static_assert (!std::is_replaceable_v <Q>, ""); - -union S { volatile int a; A b; }; - -static_assert (std::is_trivially_relocatable_v <S>, ""); -static_assert (!std::is_replaceable_v <S>, ""); diff --git a/gcc/testsuite/g++.dg/cpp26/trivially-relocatable2.C b/gcc/testsuite/g++.dg/cpp26/trivially-relocatable2.C deleted file mode 100644 index b740061..0000000 --- a/gcc/testsuite/g++.dg/cpp26/trivially-relocatable2.C +++ /dev/null @@ -1,204 +0,0 @@ -// P2786R13 - C++26 Trivial Relocatability -// { dg-do compile { target c++11 } } -// { dg-options "" } -// { dg-additional-options "-pedantic" { target c++17 } } - -#if __cpp_trivial_relocatability < 202502L -#define trivially_relocatable_if_eligible __trivially_relocatable_if_eligible -#define replaceable_if_eligible __replaceable_if_eligible -#endif - -namespace std -{ -template <typename T, T v> -struct integral_constant -{ - static constexpr T value = v; -}; - -template <typename> -struct is_trivially_relocatable; - -template <typename> -struct is_replaceable; - -template<typename T> -struct is_trivially_relocatable - : public integral_constant <bool, __builtin_is_trivially_relocatable (T)> -{ -}; - -template<typename T> -struct is_replaceable - : public integral_constant <bool, __builtin_is_replaceable (T)> -{ -}; - -template <typename T> -inline constexpr bool is_trivially_relocatable_v // { dg-warning "inline variables are only available with" "" { target c++14_down } } - = __builtin_is_trivially_relocatable (T); // { dg-warning "variable templates only available with" "" { target c++11_down } .-1 } - -template <typename T> -inline constexpr bool is_replaceable_v // { dg-warning "inline variables are only available with" "" { target c++14_down } } - = __builtin_is_replaceable (T); // { dg-warning "variable templates only available with" "" { target c++11_down } .-1 } -} - -class A {}; - -static_assert (std::is_trivially_relocatable_v <A>, ""); -static_assert (std::is_replaceable_v <A>, ""); -static_assert (std::is_trivially_relocatable <A>::value, ""); -static_assert (std::is_replaceable <A>::value, ""); - -struct B { ~B (); }; -static B z; - -static_assert (!std::is_trivially_relocatable_v <B>, ""); -static_assert (!std::is_replaceable_v <B>, ""); -static_assert (!std::is_trivially_relocatable <B>::value, ""); -static_assert (!std::is_replaceable <B>::value, ""); - -class C trivially_relocatable_if_eligible {}; - -static_assert (std::is_trivially_relocatable_v <C>, ""); -static_assert (std::is_replaceable_v <C>, ""); - -class D trivially_relocatable_if_eligible : A {}; - -static_assert (std::is_trivially_relocatable_v <D>, ""); -static_assert (std::is_replaceable_v <D>, ""); - -class E trivially_relocatable_if_eligible { - int a; - void *b; - int c[3]; - A d[3]; - B &e = z; -}; - -static_assert (std::is_trivially_relocatable_v <E>, ""); -static_assert (!std::is_replaceable_v <E>, ""); - -class F trivially_relocatable_if_eligible : A {}; - -static_assert (std::is_trivially_relocatable_v <F>, ""); -static_assert (std::is_replaceable_v <F>, ""); - -class G trivially_relocatable_if_eligible : virtual A {}; - -static_assert (!std::is_trivially_relocatable_v <G>, ""); -static_assert (std::is_replaceable_v <G>, ""); - -class H trivially_relocatable_if_eligible : B {}; - -static_assert (!std::is_trivially_relocatable_v <H>, ""); -static_assert (!std::is_replaceable_v <H>, ""); - -class I trivially_relocatable_if_eligible { I (I &&); }; - -static_assert (std::is_trivially_relocatable_v <I>, ""); -static_assert (!std::is_replaceable_v <I>, ""); - -class J trivially_relocatable_if_eligible { ~J (); }; - -static_assert (std::is_trivially_relocatable_v <J>, ""); -static_assert (!std::is_replaceable_v <J>, ""); - -class K trivially_relocatable_if_eligible { - B a; - B b[1]; - const B c; - const B d[1]; -}; - -static_assert (!std::is_trivially_relocatable_v <K>, ""); -static_assert (!std::is_replaceable_v <K>, ""); - -class L trivially_relocatable_if_eligible: virtual A, B { B a; }; - -static_assert (!std::is_trivially_relocatable_v <L>, ""); -static_assert (!std::is_replaceable_v <L>, ""); - -static_assert (!std::is_trivially_relocatable_v <void>, ""); -static_assert (!std::is_trivially_relocatable_v <const void>, ""); -static_assert (std::is_trivially_relocatable_v <int>, ""); -static_assert (std::is_trivially_relocatable_v <const int>, ""); -static_assert (std::is_trivially_relocatable_v <char>, ""); -static_assert (std::is_trivially_relocatable_v <char const volatile>, ""); -static_assert (std::is_trivially_relocatable_v <unsigned long long>, ""); -static_assert (std::is_trivially_relocatable_v <void *>, ""); -static_assert (std::is_trivially_relocatable_v <const int *>, ""); -static_assert (!std::is_trivially_relocatable_v <int &>, ""); -static_assert (!std::is_trivially_relocatable_v <A &>, ""); -static_assert (std::is_trivially_relocatable_v <const A>, ""); -static_assert (std::is_trivially_relocatable_v <A [1]>, ""); -static_assert (std::is_trivially_relocatable_v <A []>, ""); -static_assert (!std::is_replaceable_v <void>, ""); -static_assert (!std::is_replaceable_v <const void>, ""); -static_assert (std::is_replaceable_v <int>, ""); -static_assert (!std::is_replaceable_v <const int>, ""); -static_assert (std::is_replaceable_v <char>, ""); -static_assert (!std::is_replaceable_v <char const volatile>, ""); -static_assert (std::is_replaceable_v <unsigned long long>, ""); -static_assert (std::is_replaceable_v <void *>, ""); -static_assert (std::is_replaceable_v <const int *>, ""); -static_assert (!std::is_replaceable_v <int &>, ""); -static_assert (!std::is_replaceable_v <A &>, ""); -static_assert (!std::is_replaceable_v <const A>, ""); -static_assert (std::is_replaceable_v <A [1]>, ""); -static_assert (std::is_replaceable_v <A []>, ""); - -struct M { const int i; }; - -static_assert (!std::is_trivially_relocatable_v <M>, ""); -static_assert (!std::is_replaceable_v <M>, ""); - -struct N trivially_relocatable_if_eligible { const int i; }; - -static_assert (std::is_trivially_relocatable_v <N>, ""); -static_assert (!std::is_replaceable_v <N>, ""); - -struct O { ~O (); }; - -static_assert (!std::is_trivially_relocatable_v <O>, ""); -static_assert (!std::is_replaceable_v <O>, ""); - -struct P { ~P () = default; }; - -static_assert (std::is_trivially_relocatable_v <P>, ""); -static_assert (std::is_replaceable_v <P>, ""); - -struct Q { Q (Q &&); Q (const Q &) = default; }; - -static_assert (!std::is_trivially_relocatable_v <Q>, ""); -static_assert (!std::is_replaceable_v <Q>, ""); - -struct R { R (R &&); }; - -static_assert (!std::is_trivially_relocatable_v <R>, ""); -static_assert (!std::is_replaceable_v <R>, ""); - -struct S { S (S &&) = default; }; - -static_assert (!std::is_trivially_relocatable_v <S>, ""); -static_assert (!std::is_replaceable_v <S>, ""); - -struct T { T (T &&) = default; T &operator= (T &&) = default; }; - -static_assert (std::is_trivially_relocatable_v <T>, ""); -static_assert (std::is_replaceable_v <T>, ""); - -struct U { U (const U &); }; - -static_assert (!std::is_trivially_relocatable_v <U>, ""); -static_assert (!std::is_replaceable_v <U>, ""); - -struct V { V (const V&) = default; }; - -static_assert (std::is_trivially_relocatable_v <V>, ""); -static_assert (std::is_replaceable_v <V>, ""); - -struct W { W (W &&) = delete; W (const W &) = default; }; - -static_assert (!std::is_trivially_relocatable_v <W>, ""); -static_assert (!std::is_replaceable_v <W>, ""); diff --git a/gcc/testsuite/g++.dg/cpp26/trivially-relocatable3.C b/gcc/testsuite/g++.dg/cpp26/trivially-relocatable3.C deleted file mode 100644 index 312c11b..0000000 --- a/gcc/testsuite/g++.dg/cpp26/trivially-relocatable3.C +++ /dev/null @@ -1,213 +0,0 @@ -// P2786R13 - C++26 Trivial Relocatability -// { dg-do compile { target c++11 } } -// { dg-options "" } -// { dg-additional-options "-pedantic" { target c++17 } } - -#if __cpp_trivial_relocatability < 202502L -#define trivially_relocatable_if_eligible __trivially_relocatable_if_eligible -#define replaceable_if_eligible __replaceable_if_eligible -#endif - -namespace std -{ -template <typename T, T v> -struct integral_constant -{ - static constexpr T value = v; -}; - -template <typename> -struct is_trivially_relocatable; - -template <typename> -struct is_replaceable; - -template<typename T> -struct is_trivially_relocatable - : public integral_constant <bool, __builtin_is_trivially_relocatable (T)> -{ -}; - -template<typename T> -struct is_replaceable - : public integral_constant <bool, __builtin_is_replaceable (T)> -{ -}; - -template <typename T> -inline constexpr bool is_trivially_relocatable_v // { dg-warning "inline variables are only available with" "" { target c++14_down } } - = __builtin_is_trivially_relocatable (T); // { dg-warning "variable templates only available with" "" { target c++11_down } .-1 } - -template <typename T> -inline constexpr bool is_replaceable_v // { dg-warning "inline variables are only available with" "" { target c++14_down } } - = __builtin_is_replaceable (T); // { dg-warning "variable templates only available with" "" { target c++11_down } .-1 } -} - -class A {}; - -struct B { ~B (); }; - -class C trivially_relocatable_if_eligible { C (C &&); }; - -template <typename T> -class D trivially_relocatable_if_eligible : T {}; -D<A> a; -D<B> b; - -static_assert (std::is_trivially_relocatable_v <D<A>>, ""); -static_assert (!std::is_trivially_relocatable_v <D<B>>, ""); -static_assert (std::is_replaceable_v <D<A>>, ""); -static_assert (!std::is_replaceable_v <D<B>>, ""); - -struct E { E (E &&) = delete; }; - -static_assert (!std::is_trivially_relocatable_v <E>, ""); -static_assert (!std::is_replaceable_v <E>, ""); - -struct F { F (const F &) = delete; }; - -static_assert (!std::is_trivially_relocatable_v <F>, ""); -static_assert (!std::is_replaceable_v <F>, ""); - -struct G { G &operator= (G &&) = delete; }; - -static_assert (!std::is_trivially_relocatable_v <G>, ""); -static_assert (!std::is_replaceable_v <G>, ""); - -struct H { ~H () = delete; }; - -static_assert (!std::is_trivially_relocatable_v <H>, ""); -static_assert (!std::is_replaceable_v <H>, ""); - -union U { C u; }; - -static_assert (std::is_trivially_relocatable_v <U>, ""); -static_assert (!std::is_replaceable_v <U>, ""); - -template <typename T> -struct I { int s; T t; }; - -static_assert (std::is_trivially_relocatable_v <I<int>>, ""); -static_assert (std::is_trivially_relocatable_v <I<volatile int>>, ""); -static_assert (!std::is_trivially_relocatable_v <I<const int>>, ""); -static_assert (!std::is_trivially_relocatable_v <I<const int &>>, ""); -static_assert (!std::is_trivially_relocatable_v <I<int &>>, ""); -static_assert (std::is_trivially_relocatable_v <I<int [2]>>, ""); -static_assert (!std::is_trivially_relocatable_v <I<const int [2]>>, ""); -static_assert (std::is_trivially_relocatable_v <I<int []>>, ""); -static_assert (std::is_replaceable_v <I<int>>, ""); -static_assert (!std::is_replaceable_v <I<volatile int>>, ""); -static_assert (!std::is_replaceable_v <I<const int>>, ""); -static_assert (!std::is_replaceable_v <I<const int &>>, ""); -static_assert (!std::is_replaceable_v <I<int &>>, ""); -static_assert (std::is_replaceable_v <I<int [2]>>, ""); -static_assert (!std::is_replaceable_v <I<const int [2]>>, ""); - -template <typename T> -struct J trivially_relocatable_if_eligible { int s; T t; }; - -static_assert (std::is_trivially_relocatable_v <J<int>>, ""); -static_assert (std::is_trivially_relocatable_v <J<volatile int>>, ""); -static_assert (std::is_trivially_relocatable_v <J<const int>>, ""); -static_assert (std::is_trivially_relocatable_v <J<const int &>>, ""); -static_assert (std::is_trivially_relocatable_v <J<int &>>, ""); -static_assert (std::is_trivially_relocatable_v <J<int [2]>>, ""); -static_assert (std::is_trivially_relocatable_v <J<const int [2]>>, ""); -static_assert (std::is_trivially_relocatable_v <J<int []>>, ""); -static_assert (std::is_replaceable_v <J<int>>, ""); -static_assert (!std::is_replaceable_v <J<volatile int>>, ""); -static_assert (!std::is_replaceable_v <J<const int>>, ""); -static_assert (!std::is_replaceable_v <J<const int &>>, ""); -static_assert (!std::is_replaceable_v <J<int &>>, ""); -static_assert (std::is_replaceable_v <J<int [2]>>, ""); -static_assert (!std::is_replaceable_v <J<const int [2]>>, ""); -static_assert (std::is_replaceable_v <J<int []>>, ""); - -struct K { K (K &&) = delete; }; - -static_assert (!std::is_trivially_relocatable_v <K>, ""); -static_assert (!std::is_replaceable_v <K>, ""); - -struct L { L (const L &) = delete; }; - -static_assert (!std::is_trivially_relocatable_v <L>, ""); -static_assert (!std::is_replaceable_v <L>, ""); - -struct M { M &operator= (M &&) = delete; }; - -static_assert (!std::is_trivially_relocatable_v <M>, ""); -static_assert (!std::is_replaceable_v <M>, ""); - -struct N { N (N &&) = default; N &operator= (N &&) = default; }; - -static_assert (std::is_trivially_relocatable_v <N>, ""); -static_assert (std::is_replaceable_v <N>, ""); - -struct O { - O (const O &) = default; - O (O &&) = default; - O &operator= (O &&) = default; -}; - -static_assert (std::is_trivially_relocatable_v <O>, ""); -static_assert (std::is_replaceable_v <O>, ""); - -struct P { P (P &&) = default; P &operator= (P &&) = default; }; - -static_assert (std::is_trivially_relocatable_v <P>, ""); -static_assert (std::is_replaceable_v <P>, ""); - -struct Q { Q (Q &&) {} }; - -static_assert (!std::is_trivially_relocatable_v <Q>, ""); -static_assert (!std::is_replaceable_v <Q>, ""); - -struct R { R (const R &) {} }; - -static_assert (!std::is_trivially_relocatable_v <R>, ""); -static_assert (!std::is_replaceable_v <R>, ""); - -struct S { S &operator= (const S &) { return *this; }; }; - -static_assert (!std::is_trivially_relocatable_v <S>, ""); -static_assert (!std::is_replaceable_v <S>, ""); - -struct T {}; - -static_assert (std::is_trivially_relocatable_v <T>, ""); -static_assert (std::is_replaceable_v <T>, ""); - -struct V replaceable_if_eligible {}; - -static_assert (std::is_trivially_relocatable_v <V>, ""); -static_assert (std::is_replaceable_v <V>, ""); - -struct W { template <typename U> W (const U &) = delete; }; - -static_assert (std::is_trivially_relocatable_v <W>, ""); -static_assert (std::is_replaceable_v <W>, ""); - -template <typename T> -struct X : T {}; - -static_assert (!std::is_trivially_relocatable_v <X<Q>>, ""); -static_assert (!std::is_replaceable_v <X<Q>>, ""); - -template <typename T> -struct Y : virtual T {}; - -static_assert (!std::is_trivially_relocatable_v <Y<I<int>>>, ""); -static_assert (!std::is_trivially_relocatable_v <Y<I<const int>>>, ""); -static_assert (!std::is_trivially_relocatable_v <Y<Q>>, ""); -static_assert (std::is_replaceable_v <Y<I<int>>>, ""); -static_assert (!std::is_replaceable_v <Y<I<const int>>>, ""); -static_assert (!std::is_replaceable_v <Y<Q>>, ""); - -struct Z { - virtual ~Z () = default; - Z (Z &&) = default; - Z &operator= (Z &&) = default; -}; - -static_assert (std::is_trivially_relocatable_v <Z>, ""); -static_assert (std::is_replaceable_v <Z>, ""); diff --git a/gcc/testsuite/g++.dg/cpp26/trivially-relocatable4.C b/gcc/testsuite/g++.dg/cpp26/trivially-relocatable4.C deleted file mode 100644 index 10aafc1..0000000 --- a/gcc/testsuite/g++.dg/cpp26/trivially-relocatable4.C +++ /dev/null @@ -1,128 +0,0 @@ -// P2786R13 - C++26 Trivial Relocatability -// { dg-do compile { target c++11 } } -// { dg-options "" } -// { dg-additional-options "-pedantic" { target c++17 } } - -#if __cpp_trivial_relocatability < 202502L -#define trivially_relocatable_if_eligible __trivially_relocatable_if_eligible -#define replaceable_if_eligible __replaceable_if_eligible -#endif - -namespace std -{ -template <typename T, T v> -struct integral_constant -{ - static constexpr T value = v; -}; - -template <typename> -struct is_trivially_relocatable; - -template <typename> -struct is_replaceable; - -template<typename T> -struct is_trivially_relocatable - : public integral_constant <bool, __builtin_is_trivially_relocatable (T)> -{ -}; - -template<typename T> -struct is_replaceable - : public integral_constant <bool, __builtin_is_replaceable (T)> -{ -}; - -template <typename T> -inline constexpr bool is_trivially_relocatable_v // { dg-warning "inline variables are only available with" "" { target c++14_down } } - = __builtin_is_trivially_relocatable (T); // { dg-warning "variable templates only available with" "" { target c++11_down } .-1 } - -template <typename T> -inline constexpr bool is_replaceable_v // { dg-warning "inline variables are only available with" "" { target c++14_down } } - = __builtin_is_replaceable (T); // { dg-warning "variable templates only available with" "" { target c++11_down } .-1 } -} - -struct A replaceable_if_eligible { - ~A () = delete; - A (A &&) = default; - A &operator= (A &&) = default; -}; - -static_assert (!std::is_trivially_relocatable_v <A>, ""); -static_assert (!std::is_replaceable_v <A>, ""); - -struct B replaceable_if_eligible { B (const B &) = delete; }; - -static_assert (!std::is_trivially_relocatable_v <B>, ""); -static_assert (!std::is_replaceable_v <B>, ""); - -template <typename T> -struct C replaceable_if_eligible : virtual T {}; - -static_assert (!std::is_trivially_relocatable_v <C<A>>, ""); -static_assert (!std::is_trivially_relocatable_v <C<B>>, ""); -static_assert (!std::is_replaceable_v <C<A>>, ""); -static_assert (!std::is_replaceable_v <C<B>>, ""); - -template <typename T> -struct D { int s; T t; }; - -static_assert (!std::is_trivially_relocatable_v <C<D<int>>>, ""); -static_assert (std::is_replaceable_v <C<D<int>>>, ""); - -struct E trivially_relocatable_if_eligible replaceable_if_eligible { - E (E &&); - E &operator= (E &&) = default; -}; - -static_assert (std::is_trivially_relocatable_v <E>, ""); -static_assert (std::is_replaceable_v <E>, ""); - -struct F trivially_relocatable_if_eligible replaceable_if_eligible { - F (F &&) = default; - F &operator= (F &&); -}; - -static_assert (std::is_trivially_relocatable_v <F>, ""); -static_assert (std::is_replaceable_v <F>, ""); - -struct G replaceable_if_eligible { G (G const &) = default; }; - -static_assert (std::is_trivially_relocatable_v <G>, ""); -static_assert (std::is_replaceable_v <G>, ""); - -struct H { H (H const &) = default; }; - -static_assert (std::is_trivially_relocatable_v <H>, ""); -static_assert (std::is_replaceable_v <H>, ""); - -struct I replaceable_if_eligible { I &operator= (const I &) = default; }; - -static_assert (std::is_trivially_relocatable_v <I>, ""); -static_assert (std::is_replaceable_v <I>, ""); - -struct J { J &operator= (J const &) = default; }; - -static_assert (std::is_trivially_relocatable_v <J>, ""); -static_assert (std::is_replaceable_v <J>, ""); - -struct K { K (const K &) = delete; }; - -static_assert (!std::is_trivially_relocatable_v <K>, ""); -static_assert (!std::is_replaceable_v <K>, ""); - -struct L { L (L&&) = delete; }; - -static_assert (!std::is_trivially_relocatable_v <L>, ""); -static_assert (!std::is_replaceable_v <L>, ""); - -struct M { M operator= (M); }; - -static_assert (!std::is_trivially_relocatable_v <M>, ""); -static_assert (!std::is_replaceable_v <M>, ""); - -struct N { N operator= (N &&); }; - -static_assert (!std::is_trivially_relocatable_v <N>, ""); -static_assert (!std::is_replaceable_v <N>, ""); diff --git a/gcc/testsuite/g++.dg/cpp26/trivially-relocatable5.C b/gcc/testsuite/g++.dg/cpp26/trivially-relocatable5.C deleted file mode 100644 index 0416137..0000000 --- a/gcc/testsuite/g++.dg/cpp26/trivially-relocatable5.C +++ /dev/null @@ -1,77 +0,0 @@ -// P2786R13 - C++26 Trivial Relocatability -// { dg-do compile { target c++11 } } -// { dg-additional-options "-Wc++26-compat" } - -struct A __trivially_relocatable_if_eligible { A (const A &&); }; -struct B __replaceable_if_eligible { B (const B &&); B &operator= (B &&); }; -struct C __replaceable_if_eligible __final __trivially_relocatable_if_eligible { C (const C &&); C &operator= (C &&); }; -#if __cpp_trivial_relocatability >= 202502L -struct D trivially_relocatable_if_eligible { D (const D &&); }; -struct E replaceable_if_eligible { E (const E &&); E &operator= (E &&); }; -struct F trivially_relocatable_if_eligible replaceable_if_eligible final { F (const F &&); F &operator= (F &&); }; -#else -struct D trivially_relocatable_if_eligible {}; // { dg-warning "identifier 'trivially_relocatable_if_eligible' is a conditional keyword in" "" { target c++23_down } } -// { dg-error "variable 'D trivially_relocatable_if_eligible' has initializer but incomplete type" "" { target c++23_down } .-1 } -struct E replaceable_if_eligible {}; // { dg-warning "identifier 'replaceable_if_eligible' is a conditional keyword in" "" { target c++23_down } } -// { dg-error "variable 'E replaceable_if_eligible' has initializer but incomplete type" "" { target c++23_down } .-1 } -struct F trivially_relocatable_if_eligible replaceable_if_eligible {}; // { dg-warning "identifier 'trivially_relocatable_if_eligible' is a conditional keyword in" "" { target c++23_down } } -// { dg-error "expected initializer before 'replaceable_if_eligible'" "" { target c++23_down } .-1 } -#endif -#if __cplusplus <= 202302L -struct G {}; -struct G trivially_relocatable_if_eligible {}; // { dg-warning "identifier 'trivially_relocatable_if_eligible' is a conditional keyword in" "" { target c++23_down } } -struct H {}; -struct H replaceable_if_eligible {}; // { dg-warning "identifier 'replaceable_if_eligible' is a conditional keyword in" "" { target c++23_down } } -struct I {}; -struct I trivially_relocatable_if_eligible replaceable_if_eligible {}; // { dg-warning "identifier 'trivially_relocatable_if_eligible' is a conditional keyword in" "" { target c++23_down } } -#endif // { dg-error "expected initializer before 'replaceable_if_eligible'" "" { target c++23_down } .-1 } -struct J {}; -struct J __trivially_relocatable_if_eligible {}; // { dg-error "redefinition of 'struct J'" } -struct K {}; -struct K __replaceable_if_eligible {}; // { dg-error "redefinition of 'struct K'" } -struct L {}; -struct L __trivially_relocatable_if_eligible __replaceable_if_eligible {}; // { dg-error "redefinition of 'struct L'" } -struct M __trivially_relocatable_if_eligible __trivially_relocatable_if_eligible {}; // { dg-error "duplicate '__trivially_relocatable_if_eligible' specifier" } -struct N __replaceable_if_eligible __replaceable_if_eligible {}; // { dg-error "duplicate '__replaceable_if_eligible' specifier" } -struct O __trivially_relocatable_if_eligible __replaceable_if_eligible __replaceable_if_eligible __trivially_relocatable_if_eligible final final {}; -// { dg-error "duplicate '__replaceable_if_eligible' specifier" "" { target *-*-* } .-1 } -// { dg-error "duplicate '__trivially_relocatable_if_eligible' specifier" "" { target *-*-* } .-2 } -// { dg-error "duplicate 'final' specifier" "" { target *-*-* } .-3 } -#if __cpp_trivial_relocatability >= 202502L -struct P trivially_relocatable_if_eligible trivially_relocatable_if_eligible {}; // { dg-error "duplicate 'trivially_relocatable_if_eligible' specifier" "" { target c++26 } } -struct Q replaceable_if_eligible replaceable_if_eligible {}; // { dg-error "duplicate 'replaceable_if_eligible' specifier" "" { target c++26 } } -struct R trivially_relocatable_if_eligible replaceable_if_eligible replaceable_if_eligible trivially_relocatable_if_eligible final final {}; -// { dg-error "duplicate 'replaceable_if_eligible' specifier" "" { target c++26 } .-1 } -// { dg-error "duplicate 'trivially_relocatable_if_eligible' specifier" "" { target c++26 } .-2 } -// { dg-error "duplicate 'final' specifier" "" { target c++26 } .-3 } -struct S trivially_relocatable_if_eligible __trivially_relocatable_if_eligible {}; // { dg-error "duplicate '__trivially_relocatable_if_eligible' specifier" "" { target c++26 } } -struct T replaceable_if_eligible __replaceable_if_eligible {}; // { dg-error "duplicate '__replaceable_if_eligible' specifier" "" { target c++26 } } -struct U trivially_relocatable_if_eligible replaceable_if_eligible __replaceable_if_eligible __trivially_relocatable_if_eligible final __final {}; -// { dg-error "duplicate '__replaceable_if_eligible' specifier" "" { target c++26 } .-1 } -// { dg-error "duplicate '__trivially_relocatable_if_eligible' specifier" "" { target c++26 } .-2 } -// { dg-error "duplicate '__final' specifier" "" { target c++26 } .-3 } -struct V __trivially_relocatable_if_eligible trivially_relocatable_if_eligible {}; // { dg-error "duplicate 'trivially_relocatable_if_eligible' specifier" "" { target c++26 } } -struct W __replaceable_if_eligible replaceable_if_eligible {}; // { dg-error "duplicate 'replaceable_if_eligible' specifier" "" { target c++26 } } -struct X __trivially_relocatable_if_eligible __replaceable_if_eligible replaceable_if_eligible trivially_relocatable_if_eligible __final final {}; -// { dg-error "duplicate 'replaceable_if_eligible' specifier" "" { target c++26 } .-1 } -// { dg-error "duplicate 'trivially_relocatable_if_eligible' specifier" "" { target c++26 } .-2 } -// { dg-error "duplicate 'final' specifier" "" { target c++26 } .-3 } -#else -struct Y {}; -Y foo (); -struct Y trivially_relocatable_if_eligible = foo (); // { dg-warning "identifier 'trivially_relocatable_if_eligible' is a conditional keyword in" "" { target c++23_down } } -struct Z {}; -Z bar (); -struct Z replaceable_if_eligible = bar (); // { dg-warning "identifier 'replaceable_if_eligible' is a conditional keyword in" "" { target c++23_down } } -#endif - -static_assert (__builtin_is_trivially_relocatable (A), ""); -static_assert (__builtin_is_replaceable (B), ""); -static_assert (__builtin_is_trivially_relocatable (C), ""); -static_assert (__builtin_is_replaceable (C), ""); -#if __cpp_trivial_relocatability >= 202502L -static_assert (__builtin_is_trivially_relocatable (D), ""); -static_assert (__builtin_is_replaceable (E), ""); -static_assert (__builtin_is_trivially_relocatable (F), ""); -static_assert (__builtin_is_replaceable (F), ""); -#endif diff --git a/gcc/testsuite/g++.dg/cpp26/trivially-relocatable6.C b/gcc/testsuite/g++.dg/cpp26/trivially-relocatable6.C deleted file mode 100644 index ffcf12b..0000000 --- a/gcc/testsuite/g++.dg/cpp26/trivially-relocatable6.C +++ /dev/null @@ -1,30 +0,0 @@ -// P2786R13 - C++26 Trivial Relocatability -// { dg-do compile { target c++98_only } } -// { dg-additional-options "-Wc++26-compat" } - -struct A __trivially_relocatable_if_eligible {}; -struct B __replaceable_if_eligible {}; -struct C __replaceable_if_eligible __final __trivially_relocatable_if_eligible {}; -struct D trivially_relocatable_if_eligible {}; // { dg-warning "identifier 'trivially_relocatable_if_eligible' is a conditional keyword in" } -// { dg-error "variable 'D trivially_relocatable_if_eligible' has initializer but incomplete type" "" { target *-*-* } .-1 } -// { dg-error "extended initializer lists only available with" "" { target *-*-* } .-2 } -struct E replaceable_if_eligible {}; // { dg-warning "identifier 'replaceable_if_eligible' is a conditional keyword in" } -// { dg-error "variable 'E replaceable_if_eligible' has initializer but incomplete type" "" { target *-*-* } .-1 } -// { dg-error "extended initializer lists only available with" "" { target *-*-* } .-2 } -struct F trivially_relocatable_if_eligible replaceable_if_eligible {}; // { dg-warning "identifier 'trivially_relocatable_if_eligible' is a conditional keyword in" } -// { dg-error "expected initializer before 'replaceable_if_eligible'" "" { target *-*-* } .-1 } -struct G {}; -struct G trivially_relocatable_if_eligible {}; // { dg-warning "identifier 'trivially_relocatable_if_eligible' is a conditional keyword in" } -// { dg-error "extended initializer lists only available with" "" { target *-*-* } .-1 } -struct H {}; -struct H replaceable_if_eligible {}; // { dg-warning "identifier 'replaceable_if_eligible' is a conditional keyword in" } -// { dg-error "extended initializer lists only available with" "" { target *-*-* } .-1 } -struct I {}; -struct I trivially_relocatable_if_eligible replaceable_if_eligible {}; // { dg-warning "identifier 'trivially_relocatable_if_eligible' is a conditional keyword in" } -// { dg-error "expected initializer before 'replaceable_if_eligible'" "" { target *-*-* } .-1 } -struct J {}; -J foo (); -struct J trivially_relocatable_if_eligible = foo (); // { dg-warning "identifier 'trivially_relocatable_if_eligible' is a conditional keyword in" } -struct K {}; -K bar (); -struct K replaceable_if_eligible = bar (); // { dg-warning "identifier 'replaceable_if_eligible' is a conditional keyword in" } diff --git a/gcc/testsuite/g++.dg/cpp26/trivially-relocatable7.C b/gcc/testsuite/g++.dg/cpp26/trivially-relocatable7.C deleted file mode 100644 index 608c245..0000000 --- a/gcc/testsuite/g++.dg/cpp26/trivially-relocatable7.C +++ /dev/null @@ -1,33 +0,0 @@ -// P2786R13 - C++26 Trivial Relocatability -// { dg-do compile { target c++11 } } -// { dg-options "" } -// { dg-additional-options "-pedantic" { target c++17 } } - -namespace std -{ -template <typename T, T v> -struct integral_constant -{ - static constexpr T value = v; -}; - -template <typename T> -inline constexpr bool is_trivially_relocatable_v // { dg-warning "inline variables are only available with" "" { target c++14_down } } - = __builtin_is_trivially_relocatable (T); // { dg-warning "variable templates only available with" "" { target c++11_down } .-1 } - // { dg-error "invalid use of incomplete type 'struct A'" "" { target *-*-* } .-1 } - -template <typename T> -inline constexpr bool is_nothrow_relocatable_v // { dg-warning "inline variables are only available with" "" { target c++14_down } } - = __builtin_is_nothrow_relocatable (T); // { dg-warning "variable templates only available with" "" { target c++11_down } .-1 } - // { dg-error "invalid use of incomplete type 'struct A'" "" { target *-*-* } .-1 } - -template <typename T> -inline constexpr bool is_replaceable_v // { dg-warning "inline variables are only available with" "" { target c++14_down } } - = __builtin_is_replaceable (T); // { dg-warning "variable templates only available with" "" { target c++11_down } .-1 } -} // { dg-error "invalid use of incomplete type 'struct A'" "" { target *-*-* } .-1 } - -struct A; // { dg-message "forward declaration of 'struct A'" } - -auto a = std::is_trivially_relocatable_v <A>; // { dg-message "required from here" } -auto b = std::is_nothrow_relocatable_v <A>; // { dg-message "required from here" } -auto c = std::is_replaceable_v <A>; // { dg-message "required from here" } diff --git a/gcc/testsuite/g++.dg/cpp26/trivially-relocatable8.C b/gcc/testsuite/g++.dg/cpp26/trivially-relocatable8.C deleted file mode 100644 index 5f8390d..0000000 --- a/gcc/testsuite/g++.dg/cpp26/trivially-relocatable8.C +++ /dev/null @@ -1,190 +0,0 @@ -// P2786R13 - C++26 Trivial Relocatability -// { dg-do compile { target c++11 } } -// { dg-options "" } -// { dg-additional-options "-pedantic" { target c++17 } } - -#if __cpp_trivial_relocatability < 202502L -#define trivially_relocatable_if_eligible __trivially_relocatable_if_eligible -#define replaceable_if_eligible __replaceable_if_eligible -#endif - -namespace std -{ -template <typename T, T v> -struct integral_constant -{ - static constexpr T value = v; -}; - -template <typename> -struct is_trivially_relocatable; - -template <typename> -struct is_replaceable; - -template<typename T> -struct is_trivially_relocatable - : public integral_constant <bool, __builtin_is_trivially_relocatable (T)> -{ -}; - -template<typename T> -struct is_nothrow_relocatable - : public integral_constant <bool, __builtin_is_nothrow_relocatable (T)> -{ -}; - -template<typename T> -struct is_replaceable - : public integral_constant <bool, __builtin_is_replaceable (T)> -{ -}; - -template <typename T> -inline constexpr bool is_trivially_relocatable_v // { dg-warning "inline variables are only available with" "" { target c++14_down } } - = __builtin_is_trivially_relocatable (T); // { dg-warning "variable templates only available with" "" { target c++11_down } .-1 } - -template <typename T> -inline constexpr bool is_nothrow_relocatable_v // { dg-warning "inline variables are only available with" "" { target c++14_down } } - = __builtin_is_nothrow_relocatable (T); // { dg-warning "variable templates only available with" "" { target c++11_down } .-1 } - -template <typename T> -inline constexpr bool is_replaceable_v // { dg-warning "inline variables are only available with" "" { target c++14_down } } - = __builtin_is_replaceable (T); // { dg-warning "variable templates only available with" "" { target c++11_down } .-1 } -} - -struct A { A (A &&) = default; A &operator= (A &&) = default; ~A () = default; int a; }; - -static_assert (std::is_trivially_relocatable_v <A>, ""); -static_assert (std::is_nothrow_relocatable_v <A>, ""); -static_assert (std::is_replaceable_v <A>, ""); - -struct B { B (B &&); B &operator= (B &&) = default; ~B () = default; int a; }; - -static_assert (!std::is_trivially_relocatable_v <B>, ""); -static_assert (!std::is_nothrow_relocatable_v <B>, ""); -static_assert (!std::is_replaceable_v <B>, ""); - -struct C { C (C &&) = default; C &operator= (C &&); ~C () = default; int a; }; - -static_assert (!std::is_trivially_relocatable_v <C>, ""); -static_assert (std::is_nothrow_relocatable_v <C>, ""); -static_assert (!std::is_replaceable_v <C>, ""); - -struct D { D (D &&) = delete; D &operator= (D &&) = default; int a; }; - -static_assert (!std::is_trivially_relocatable_v <D>, ""); -static_assert (!std::is_nothrow_relocatable_v <D>, ""); -static_assert (!std::is_replaceable_v <D>, ""); - -struct E { E (E &&) = default; E &operator= (E &&) = delete; int a; }; - -static_assert (!std::is_trivially_relocatable_v <E>, ""); -static_assert (std::is_nothrow_relocatable_v <E>, ""); -static_assert (!std::is_replaceable_v <E>, ""); - -struct F { F (F &&) = default; F &operator= (F &&) = default; ~F () = delete; int a; }; - -static_assert (!std::is_trivially_relocatable_v <F>, ""); -static_assert (!std::is_nothrow_relocatable_v <F>, ""); -static_assert (!std::is_replaceable_v <F>, ""); - -struct G { G (const G &) = default; G &operator= (const G &) = default; int a; }; - -static_assert (std::is_trivially_relocatable_v <G>, ""); -static_assert (std::is_nothrow_relocatable_v <G>, ""); -static_assert (std::is_replaceable_v <G>, ""); - -struct H { H (const H &); H &operator= (const H &) = default; int a; }; - -static_assert (!std::is_trivially_relocatable_v <H>, ""); -static_assert (!std::is_nothrow_relocatable_v <H>, ""); -static_assert (!std::is_replaceable_v <H>, ""); - -struct I { I (const I &) = default; I &operator= (const I &); ~I () = default; int a; }; - -static_assert (!std::is_trivially_relocatable_v <I>, ""); -static_assert (std::is_nothrow_relocatable_v <I>, ""); -static_assert (!std::is_replaceable_v <I>, ""); - -struct J { J (const J &) = delete; J &operator= (const J &) = default; int a; }; - -static_assert (!std::is_trivially_relocatable_v <J>, ""); -static_assert (!std::is_nothrow_relocatable_v <J>, ""); -static_assert (!std::is_replaceable_v <J>, ""); - -struct K { K (const K &) = default; K &operator= (const K &) = delete; int a; }; - -static_assert (!std::is_trivially_relocatable_v <K>, ""); -static_assert (std::is_nothrow_relocatable_v <K>, ""); -static_assert (!std::is_replaceable_v <K>, ""); - -struct M; -struct L { L (L &&) = default; L (M &&); L &operator= (L &&) = default; int a; }; - -static_assert (std::is_trivially_relocatable_v <L>, ""); -static_assert (std::is_nothrow_relocatable_v <L>, ""); -static_assert (std::is_replaceable_v <L>, ""); - -struct M : public L { using L::L; M (const M &); M &operator= (M &&) = default; int b; }; - -static_assert (!std::is_trivially_relocatable_v <M>, ""); -static_assert (!std::is_nothrow_relocatable_v <M>, ""); -static_assert (!std::is_replaceable_v <M>, ""); - -struct O; -struct N { N (N &&) = default; N &operator= (N &&) = default; N &operator= (O &&); int a; }; - -static_assert (std::is_trivially_relocatable_v <N>, ""); -static_assert (std::is_nothrow_relocatable_v <N>, ""); -static_assert (std::is_replaceable_v <N>, ""); - -struct O : public N { using N::operator=; O (O &&) = default; int b; }; - -static_assert (!std::is_trivially_relocatable_v <O>, ""); -static_assert (std::is_nothrow_relocatable_v <O>, ""); -static_assert (!std::is_replaceable_v <O>, ""); - -struct Q; -struct P { template <typename T> P (T &&) {} }; - -static_assert (std::is_trivially_relocatable_v <P>, ""); -static_assert (std::is_nothrow_relocatable_v <P>, ""); -static_assert (std::is_replaceable_v <P>, ""); - -struct Q : public P { using P::P; Q (const Q &); }; - -static_assert (!std::is_trivially_relocatable_v <Q>, ""); -static_assert (!std::is_nothrow_relocatable_v <Q>, ""); -static_assert (!std::is_replaceable_v <Q>, ""); - -struct S; -struct R { R (const R &) = default; R (const M &); R &operator= (R &&) = default; int a; }; - -static_assert (std::is_trivially_relocatable_v <R>, ""); -static_assert (std::is_nothrow_relocatable_v <R>, ""); -static_assert (std::is_replaceable_v <R>, ""); - -struct S : public R { using R::R; S &operator= (S &&) = default; int b; }; - -static_assert (!std::is_trivially_relocatable_v <S>, ""); -static_assert (!std::is_nothrow_relocatable_v <S>, ""); -static_assert (!std::is_replaceable_v <S>, ""); - -struct T { T (T &&) = default; T &operator= (T &&) = default; ~T (); int a; }; - -static_assert (!std::is_trivially_relocatable_v <T>, ""); -static_assert (std::is_nothrow_relocatable_v <T>, ""); -static_assert (!std::is_replaceable_v <T>, ""); - -struct U { U (const U &) = default; U &operator= (const U &) = default; ~U (); int a; }; - -static_assert (!std::is_trivially_relocatable_v <U>, ""); -static_assert (std::is_nothrow_relocatable_v <U>, ""); -static_assert (!std::is_replaceable_v <U>, ""); - -struct V { public: V (); private: V (V &&) = default; V &operator= (V &&) = default; ~V () = default; int a; }; - -static_assert (std::is_trivially_relocatable_v <V>, ""); -static_assert (std::is_nothrow_relocatable_v <V>, ""); -static_assert (std::is_replaceable_v <V>, ""); diff --git a/gcc/testsuite/g++.dg/cpp26/trivially-relocatable9.C b/gcc/testsuite/g++.dg/cpp26/trivially-relocatable9.C deleted file mode 100644 index 1c45b53..0000000 --- a/gcc/testsuite/g++.dg/cpp26/trivially-relocatable9.C +++ /dev/null @@ -1,134 +0,0 @@ -// P2786R13 - C++26 Trivial Relocatability -// { dg-do compile { target c++11 } } -// { dg-options "" } -// { dg-additional-options "-pedantic" { target c++17 } } - -#if __cpp_trivial_relocatability < 202502L -#define trivially_relocatable_if_eligible __trivially_relocatable_if_eligible -#define replaceable_if_eligible __replaceable_if_eligible -#endif - -namespace std -{ -template <typename T, T v> -struct integral_constant -{ - static constexpr T value = v; -}; - -template <typename> -struct is_trivially_relocatable; - -template <typename> -struct is_replaceable; - -template<typename T> -struct is_trivially_relocatable - : public integral_constant <bool, __builtin_is_trivially_relocatable (T)> -{ -}; - -template<typename T> -struct is_nothrow_relocatable - : public integral_constant <bool, __builtin_is_nothrow_relocatable (T)> -{ -}; - -template<typename T> -struct is_replaceable - : public integral_constant <bool, __builtin_is_replaceable (T)> -{ -}; - -template <typename T> -inline constexpr bool is_trivially_relocatable_v // { dg-warning "inline variables are only available with" "" { target c++14_down } } - = __builtin_is_trivially_relocatable (T); // { dg-warning "variable templates only available with" "" { target c++11_down } .-1 } - -template <typename T> -inline constexpr bool is_nothrow_relocatable_v // { dg-warning "inline variables are only available with" "" { target c++14_down } } - = __builtin_is_nothrow_relocatable (T); // { dg-warning "variable templates only available with" "" { target c++11_down } .-1 } - -template <typename T> -inline constexpr bool is_replaceable_v // { dg-warning "inline variables are only available with" "" { target c++14_down } } - = __builtin_is_replaceable (T); // { dg-warning "variable templates only available with" "" { target c++11_down } .-1 } -} - -struct A trivially_relocatable_if_eligible { A (A &&); A &operator= (A &&); ~A (); int a; }; - -static_assert (std::is_trivially_relocatable_v <A>, ""); -static_assert (std::is_nothrow_relocatable_v <A>, ""); - -struct B { B (B &&); B &operator= (B &&); ~B (); int a; }; - -static_assert (!std::is_trivially_relocatable_v <B>, ""); -static_assert (!std::is_nothrow_relocatable_v <B>, ""); - -struct C trivially_relocatable_if_eligible : public A { C (C &&); C &operator= (C &&); ~C (); int a; }; - -static_assert (std::is_trivially_relocatable_v <C>, ""); -static_assert (std::is_nothrow_relocatable_v <C>, ""); - -struct D trivially_relocatable_if_eligible : public B { D (D &&); D &operator= (D &&); ~D (); int a; }; - -static_assert (!std::is_trivially_relocatable_v <D>, ""); -static_assert (!std::is_nothrow_relocatable_v <D>, ""); - -struct E trivially_relocatable_if_eligible { E (E &&); E &operator= (E &&); ~E (); A a; }; - -static_assert (std::is_trivially_relocatable_v <E>, ""); -static_assert (std::is_nothrow_relocatable_v <E>, ""); - -struct F trivially_relocatable_if_eligible { F (F &&) noexcept; F &operator= (F &&); ~F (); B a; }; - -static_assert (!std::is_trivially_relocatable_v <F>, ""); -static_assert (std::is_nothrow_relocatable_v <F>, ""); - -struct G trivially_relocatable_if_eligible { G (G &&); G &operator= (G &&); ~G () = delete; int a; }; - -static_assert (!std::is_trivially_relocatable_v <G>, ""); -static_assert (!std::is_nothrow_relocatable_v <G>, ""); - -struct H trivially_relocatable_if_eligible : virtual A { H (H &&); H &operator= (H &&); ~H (); int a; }; - -static_assert (!std::is_trivially_relocatable_v <H>, ""); -static_assert (!std::is_nothrow_relocatable_v <H>, ""); - -struct I trivially_relocatable_if_eligible { I (I &&); I &operator= (I &&); ~I (); A &a; int &b; }; - -static_assert (std::is_trivially_relocatable_v <I>, ""); -static_assert (std::is_nothrow_relocatable_v <I>, ""); - -struct J trivially_relocatable_if_eligible { J (J &&); J &operator= (J &&); ~J (); B &a; int &b; }; - -static_assert (std::is_trivially_relocatable_v <J>, ""); -static_assert (std::is_nothrow_relocatable_v <J>, ""); - -struct K trivially_relocatable_if_eligible { K (K &&) noexcept; K &operator= (K &&); ~K (); union { A a; int b; char c; }; }; - -static_assert (!std::is_trivially_relocatable_v <K>, ""); -static_assert (std::is_nothrow_relocatable_v <K>, ""); - -struct L trivially_relocatable_if_eligible { L (L &&); L &operator= (L &&); ~L (); union { int a; B b; short c; }; }; - -static_assert (!std::is_trivially_relocatable_v <L>, ""); -static_assert (!std::is_nothrow_relocatable_v <L>, ""); - -struct M trivially_relocatable_if_eligible { M (M &&); M &operator= (M &&); ~M () = default; int a; }; - -static_assert (std::is_trivially_relocatable_v <M>, ""); -static_assert (std::is_nothrow_relocatable_v <M>, ""); - -struct N trivially_relocatable_if_eligible { N (N &&); N &operator= (N &&); ~N (); union { M a; int b; char c; }; }; - -static_assert (std::is_trivially_relocatable_v <N>, ""); -static_assert (std::is_nothrow_relocatable_v <N>, ""); - -struct O trivially_relocatable_if_eligible { O (O &&); O &operator= (O &&); ~O (); union { unsigned long long a; int b; char c; }; }; - -static_assert (std::is_trivially_relocatable_v <O>, ""); -static_assert (std::is_nothrow_relocatable_v <O>, ""); - -struct P { P (P &&) noexcept; P &operator= (P &&); ~P (); int a; }; - -static_assert (!std::is_trivially_relocatable_v <P>, ""); -static_assert (std::is_nothrow_relocatable_v <P>, ""); diff --git a/gcc/testsuite/g++.dg/cpp2a/consteval42.C b/gcc/testsuite/g++.dg/cpp2a/consteval42.C new file mode 100644 index 0000000..c75bb49 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/consteval42.C @@ -0,0 +1,21 @@ +// PR c++/122658 +// { dg-do compile { target c++20 } } + +struct S { + consteval S () noexcept { } + consteval S (const S &) = default; +}; + +template <typename T> +S +foo () +{ + constexpr auto s = S(); + return s; +} + +S +bar () +{ + return foo <int> (); +} diff --git a/gcc/testsuite/g++.dg/cpp2a/is-layout-compatible3.C b/gcc/testsuite/g++.dg/cpp2a/is-layout-compatible3.C index 499ba49..e48679f 100644 --- a/gcc/testsuite/g++.dg/cpp2a/is-layout-compatible3.C +++ b/gcc/testsuite/g++.dg/cpp2a/is-layout-compatible3.C @@ -51,15 +51,15 @@ struct B1 { signed int b; }; struct alignas (16) C1 : public A1 {}; struct alignas (16) D1 : public B1 {}; -static_assert (!std::is_layout_compatible_v<I, J>); +static_assert (std::is_layout_compatible_v<I, J>); static_assert (!std::is_layout_compatible_v<K, L>); -static_assert (!std::is_layout_compatible_v<M, N>); +static_assert (std::is_layout_compatible_v<M, N>); static_assert (!std::is_layout_compatible_v<O, P>); static_assert (!std::is_layout_compatible_v<P, D>); static_assert (std::is_layout_compatible_v<Q, R>); static_assert (!std::is_layout_compatible_v<U, V>); -static_assert (!std::is_layout_compatible_v<A, I>); -static_assert (!std::is_layout_compatible_v<C, I>); +static_assert (std::is_layout_compatible_v<A, I>); +static_assert (std::is_layout_compatible_v<C, I>); static_assert (!std::is_layout_compatible_v<E, F>); static_assert (std::is_layout_compatible_v<G, H>); static_assert (std::is_layout_compatible_v<C1, D1>); diff --git a/gcc/testsuite/g++.dg/cpp2a/is-layout-compatible4.C b/gcc/testsuite/g++.dg/cpp2a/is-layout-compatible4.C new file mode 100644 index 0000000..6217fcb --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/is-layout-compatible4.C @@ -0,0 +1,78 @@ +// Test for diagnostics on failed is_layout_compatible. +// { dg-do compile { target c++20 } } + +template <typename T, typename U> +constexpr bool is_layout_compatible_v = __is_layout_compatible (T, U); + +static_assert(is_layout_compatible_v<int, unsigned>); // { dg-error "assert" } +// { dg-message "is not layout compatible" "" { target *-*-* } .-1 } +// { dg-message "same type" "" { target *-*-* } .-2 } + +struct S {}; +static_assert(is_layout_compatible_v<const S, volatile int>); // { dg-error "assert" } +// { dg-message "is not layout compatible" "" { target *-*-* } .-1 } +// { dg-message "same type" "" { target *-*-* } .-2 } + +struct A { + int a; + char b; // { dg-message "'A::b' and 'B::b' do not correspond" } +}; +struct B { + int a; + signed char b; // { dg-message "declared here" } +}; +static_assert(is_layout_compatible_v<A, B>); // { dg-error "assert" } + +struct C { + int : 1; + int c : 7; + int : 0; // { dg-message "'C::<anonymous>' and 'D::g' do not correspond" } + int : 2; +}; +struct D { + int f : 1; + int : 7; + int g : 2; // { dg-message "declared here" } +}; +static_assert(is_layout_compatible_v<C, D>); // { dg-error "assert" } + +struct E { // { dg-message "'E' is not a standard-layout type" } + int a; +private: + int b; +}; +struct F { + int a; +private: + int b; +}; +static_assert(is_layout_compatible_v<E, F>); // { dg-error "assert" } + +union G { + int a; + long long b; + signed char c; // { dg-message "'H' has no member corresponding to 'G::c'" } +}; +union H { // { dg-message "declared here" } + char x; + int y; + long long z; +}; +static_assert(is_layout_compatible_v<G, H>); // { dg-error "assert" } + +union I { // { dg-message "'I' has 2 fields, but" } + int a; + double b; +}; +union J { // { dg-message "'J' has 1 field" } + int c; +}; +static_assert(is_layout_compatible_v<I, J>); // { dg-error "assert" } + +enum K : int { // { dg-message "the underlying type of 'K' is 'int'" } + K0, K1 +}; +enum L : long int { // { dg-message "the underlying type of 'L' is 'long int'" } + L0, L1 +}; +static_assert(is_layout_compatible_v<K, L>); // { dg-error "assert" } diff --git a/gcc/testsuite/g++.dg/cpp2a/is-pointer-interconvertible-base-of2.C b/gcc/testsuite/g++.dg/cpp2a/is-pointer-interconvertible-base-of2.C new file mode 100644 index 0000000..9530f9e --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/is-pointer-interconvertible-base-of2.C @@ -0,0 +1,29 @@ +// { dg-do compile { target c++20 } } +// { dg-additional-options "-Wno-inaccessible-base" } + +template <typename T, typename U> +constexpr bool pointer_interconvertible_base_of + = __is_pointer_interconvertible_base_of(T, U); + +struct A {}; +struct B {}; // { dg-message "not a pointer-interconvertible base" } +static_assert(pointer_interconvertible_base_of<A, B>); // { dg-error "assert" } + +struct C { + int x; +private: + int y; +}; +struct D : C {}; // { dg-message "standard-layout" } +static_assert(pointer_interconvertible_base_of<C, D>); // { dg-error "assert" } + +struct E {}; +struct F : E {}; +struct G : F, E {}; // { dg-message "standard-layout" } +static_assert(pointer_interconvertible_base_of<E, G>); // { dg-error "assert" } + +union H {}; // { dg-message "non-union" } +static_assert(pointer_interconvertible_base_of<H, H>); // { dg-error "assert" } + +static_assert(pointer_interconvertible_base_of<A, int>); // { dg-error "assert" } +// { dg-message "non-union" "" { target *-*-* } .-1 } diff --git a/gcc/testsuite/g++.dg/cpp2a/lambda-uneval14.C b/gcc/testsuite/g++.dg/cpp2a/lambda-uneval14.C index a180359..d0e74e3 100644 --- a/gcc/testsuite/g++.dg/cpp2a/lambda-uneval14.C +++ b/gcc/testsuite/g++.dg/cpp2a/lambda-uneval14.C @@ -1,6 +1,6 @@ // PR c++/99478 // { dg-do compile { target c++20 } } -template <decltype ([] {})> auto f() {} // { dg-error "lambda" } +template <decltype ([] {})> auto f() {} -int main() { f<{}>(); } // { dg-prune-output "no match" } +int main() { f<{}>(); } diff --git a/gcc/testsuite/g++.dg/cpp2a/lambda-uneval29.C b/gcc/testsuite/g++.dg/cpp2a/lambda-uneval29.C new file mode 100644 index 0000000..76e743f --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/lambda-uneval29.C @@ -0,0 +1,5 @@ +// PR c++/116952 +// { dg-do compile { target c++20 } } + +template<typename, auto> concept A = true; +template<A<[] {}>> int x; diff --git a/gcc/testsuite/g++.dg/debug/pr80461.C b/gcc/testsuite/g++.dg/debug/pr80461.C index b472e62..440241d 100644 --- a/gcc/testsuite/g++.dg/debug/pr80461.C +++ b/gcc/testsuite/g++.dg/debug/pr80461.C @@ -30,7 +30,7 @@ bar () { O q; A<P> f = q; - v++; + v = v + 1; } void diff --git a/gcc/testsuite/g++.dg/debug/pr94459.C b/gcc/testsuite/g++.dg/debug/pr94459.C index ebc0cf4..6886bdb 100644 --- a/gcc/testsuite/g++.dg/debug/pr94459.C +++ b/gcc/testsuite/g++.dg/debug/pr94459.C @@ -1,6 +1,6 @@ // PR debug/94459 // { dg-do compile { target c++14 } } -// { dg-options "-g -dA" } +// { dg-options "-g -dA -std=gnu++17" } template <typename T> struct S diff --git a/gcc/testsuite/g++.dg/diagnostic/virtual-constexpr.C b/gcc/testsuite/g++.dg/diagnostic/virtual-constexpr.C index 9223c69..1daa86d 100644 --- a/gcc/testsuite/g++.dg/diagnostic/virtual-constexpr.C +++ b/gcc/testsuite/g++.dg/diagnostic/virtual-constexpr.C @@ -1,6 +1,5 @@ // { dg-options "-fdiagnostics-show-caret -pedantic-errors" } -// { dg-do compile { target c++11 } } -// { dg-skip-if "virtual constexpr" { *-*-* } { "-std=gnu++2a" } { "" } } +// { dg-do compile { target { c++11 && c++17_down } } } struct S { diff --git a/gcc/testsuite/g++.dg/ext/is_destructible3.C b/gcc/testsuite/g++.dg/ext/is_destructible3.C index a8501d6..5d3c929 100644 --- a/gcc/testsuite/g++.dg/ext/is_destructible3.C +++ b/gcc/testsuite/g++.dg/ext/is_destructible3.C @@ -9,6 +9,10 @@ static_assert(is_destructible<void>::value, ""); // { dg-error "assert" } // { dg-message "'void' is not destructible, because" "" { target *-*-* } .-1 } // { dg-error "'void' is incomplete" "" { target *-*-* } .-2 } +static_assert(is_destructible<void() volatile>::value, ""); // { dg-error "assert" } +// { dg-message "'void\\(\\) volatile' is not destructible, because" "" { target *-*-* } .-1 } +// { dg-error "not a class or scalar type" "" { target *-*-* } .-2 } + struct A { ~A() = delete; // { dg-message "declared here" } }; diff --git a/gcc/testsuite/g++.dg/ext/is_virtual_base_of_diagnostic2.C b/gcc/testsuite/g++.dg/ext/is_virtual_base_of_diagnostic2.C index ac28121..20d2685 100644 --- a/gcc/testsuite/g++.dg/ext/is_virtual_base_of_diagnostic2.C +++ b/gcc/testsuite/g++.dg/ext/is_virtual_base_of_diagnostic2.C @@ -8,6 +8,6 @@ struct is_virtual_base_of { static_assert(is_virtual_base_of<int, int>::value, ""); // { dg-error "assert" } // { dg-message "'int' is not a virtual base of 'int'" "" { target *-*-* } .-1 } -struct A {}; // { dg-message "'A' is not a virtual base of 'B'" } -struct B : A {}; // { dg-message "declared here" } +struct A {}; +struct B : A {}; // { dg-message "'A' is not a virtual base of 'B'" } static_assert(is_virtual_base_of<A, B>::value, ""); // { dg-error "assert" } diff --git a/gcc/testsuite/g++.dg/ext/pr122836.C b/gcc/testsuite/g++.dg/ext/pr122836.C new file mode 100644 index 0000000..5307ae9 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/pr122836.C @@ -0,0 +1,11 @@ +// PR c++/122836 +// { dg-do compile } +// { dg-options "" } + +struct V { __attribute__ ((__vector_size__ (2 * sizeof (float)))) float v[2]; }; + +V +foo () +{ + return (V) { { .v = { 0, 0 } } }; // { dg-error "name 'v' used in a GNU-style designated initializer for an array" } +} diff --git a/gcc/testsuite/g++.dg/ext/pr122860.C b/gcc/testsuite/g++.dg/ext/pr122860.C new file mode 100644 index 0000000..b0604f0 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/pr122860.C @@ -0,0 +1,30 @@ +// PR c++/122860 +// { dg-do compile } +// { dg-options "-Wno-register" } + +void +foo () +{ + register __UINTPTR_TYPE__ val asm ("1") = (__UINTPTR_TYPE__) &val; // { dg-error "address of explicit register variable 'val' requested" } +} + +template <typename T> +void +bar () +{ + register T val asm ("1") = (T) &val; // { dg-error "address of explicit register variable 'val' requested" } +} + +template <typename T> +void +baz () +{ + register __UINTPTR_TYPE__ val asm ("1") = (__UINTPTR_TYPE__) &val; // { dg-error "address of explicit register variable 'val' requested" } +} + +void +qux () +{ + bar <__UINTPTR_TYPE__> (); + baz <int> (); +} diff --git a/gcc/testsuite/g++.dg/ext/reference_xes_from_temporary1.C b/gcc/testsuite/g++.dg/ext/reference_xes_from_temporary1.C new file mode 100644 index 0000000..274de05 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/reference_xes_from_temporary1.C @@ -0,0 +1,28 @@ +// PR c++/120529 +// { dg-do compile { target c++11 } } + +#define SA(X) static_assert((X),#X) + +class Dst {}; + +class Src { +private: + operator Dst() const; +}; + +class Src2 { +protected: + operator Dst() const; +}; + +class Src3 { +public: + operator Dst() const; +}; + +SA (!__reference_converts_from_temporary (Dst&&, Src)); +SA (!__reference_constructs_from_temporary (Dst&&, Src)); +SA (!__reference_converts_from_temporary (Dst&&, Src2)); +SA (!__reference_constructs_from_temporary (Dst&&, Src2)); +SA (__reference_converts_from_temporary (Dst&&, Src3)); +SA (__reference_constructs_from_temporary (Dst&&, Src3)); diff --git a/gcc/testsuite/g++.dg/ext/sve-sizeless-1.C b/gcc/testsuite/g++.dg/ext/sve-sizeless-1.C index 37bcec1..d06d9f7 100644 --- a/gcc/testsuite/g++.dg/ext/sve-sizeless-1.C +++ b/gcc/testsuite/g++.dg/ext/sve-sizeless-1.C @@ -173,6 +173,16 @@ statements (int n) svint32_t init_sve_vc8 = { 0, 1, 2, 3, 4, 5 }; // { dg-error {too many initializers for 'svint32_t'} } svint32_t init_sve_vc9 = { 0, bar (), 2, 3, 4, n }; // { dg-error {too many initializers for 'svint32_t'} } + svbool_t init_sve_vb1 = { 0, -1 }; + svbool_t init_sve_vb2 = { 0, bar () }; // { dg-warning {narrowing conversion} "" { target c++11 } } + svbool_t init_sve_vb3 = { bar (), n }; // { dg-warning {narrowing conversion} "" { target c++11 } } + svbool_t init_sve_vb4 = { 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + svbool_t init_sve_vb5 = { 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, bar (), 0, 0 }; // { dg-warning {narrowing conversion} "" { target c++11 } } + svbool_t init_sve_vb6 = { 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1 }; // { dg-error {too many initializers for 'svbool_t'} } + svbool_t init_sve_vb7 = { 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, bar () }; // { dg-error {too many initializers for 'svbool_t'} } + svbool_t init_sve_vb8 = { 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, bar (), -1 }; // { dg-error {too many initializers for 'svbool_t'} } + svbool_t init_sve_vb9 = { 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, bar (), n }; // { dg-error {too many initializers for 'svbool_t'} } + // Constructor calls. (0, svint8_t ()); diff --git a/gcc/testsuite/g++.dg/ext/sve-sizeless-2.C b/gcc/testsuite/g++.dg/ext/sve-sizeless-2.C index 3243a17..04ae5bd 100644 --- a/gcc/testsuite/g++.dg/ext/sve-sizeless-2.C +++ b/gcc/testsuite/g++.dg/ext/sve-sizeless-2.C @@ -173,6 +173,27 @@ statements (int n) svint32_t init_sve_vc8 = { 0, bar (), 2, 3, 4, n, 5, 6, 7, 8, 9 }; // { dg-error {too many initializers for 'svint32_t'} } svint32_t init_sve_vc9 = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; // { dg-error {too many initializers for 'svint32_t'} } + svbool_t init_sve_vb1 = { 0, -1 }; + svbool_t init_sve_vb2 = { 0, bar () }; // { dg-warning {narrowing conversion} "" { target c++11 } } + svbool_t init_sve_vb3 = { bar (), n }; // { dg-warning {narrowing conversion} "" { target c++11 } } + svbool_t init_sve_vb4 = { 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + svbool_t init_sve_vb5 = { 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, -1, -1, -1, 0, 0, 0, bar (), 0, 0, 0, 0, 0, 0, // { dg-warning {narrowing conversion} "" { target c++11 } } + 0, 0 }; + svbool_t init_sve_vb6 = { 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0 }; // { dg-error {too many initializers for 'svbool_t'} } + svbool_t init_sve_vb7 = { 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + bar () }; // { dg-error {too many initializers for 'svbool_t'} } + svbool_t init_sve_vb8 = { 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + bar (), -1 }; // { dg-error {too many initializers for 'svbool_t'} } + svbool_t init_sve_vb9 = { 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + bar (), n }; // { dg-error {too many initializers for 'svbool_t'} } + // Constructor calls. (0, svint8_t ()); diff --git a/gcc/testsuite/g++.dg/gcov/pr16855-priority.C b/gcc/testsuite/g++.dg/gcov/pr16855-priority.C index c7a5839..ebdcad5 100644 --- a/gcc/testsuite/g++.dg/gcov/pr16855-priority.C +++ b/gcc/testsuite/g++.dg/gcov/pr16855-priority.C @@ -20,7 +20,7 @@ class Test public: Test (void) { fprintf (stderr, "In Test::Test\n"); /* count(1) */ } ~Test (void) { - fprintf (stderr, "In Test::~Test\n"); /* count(1) { xfail *-*-dragonfly* } */ + fprintf (stderr, "In Test::~Test\n"); /* count(1) { xfail *-*-dragonfly* *-*-solaris2* } */ } } T1; @@ -78,4 +78,4 @@ static void __attribute__ ((destructor ((65535)))) dtor_65535 () fprintf (stderr, "in destructor((65535))\n"); /* count(1) */ } -/* { dg-final { run-gcov branches { -b pr16855-priority.C } { xfail *-*-dragonfly* } } } */ +/* { dg-final { run-gcov branches { -b pr16855-priority.C } { xfail *-*-dragonfly* *-*-solaris2* } } } */ diff --git a/gcc/testsuite/g++.dg/gcov/pr16855.C b/gcc/testsuite/g++.dg/gcov/pr16855.C index f9b86a4..724ee02 100644 --- a/gcc/testsuite/g++.dg/gcov/pr16855.C +++ b/gcc/testsuite/g++.dg/gcov/pr16855.C @@ -1,7 +1,8 @@ /* { dg-options "-fprofile-arcs -ftest-coverage" } */ /* { dg-do run { target native } } */ -/* See PR91087 for information on Darwin xfails. */ +/* See PR91087 for information on Darwin xfails. Also PR81337 for Solaris + ones.*/ #include <stdlib.h> #include <stdio.h> @@ -21,7 +22,7 @@ class Test public: Test (void) { fprintf (stderr, "In Test::Test\n"); /* count(1) */ } ~Test (void) { - fprintf (stderr, "In Test::~Test\n"); /* count(1) { xfail *-*-darwin* *-*-dragonfly* } */ + fprintf (stderr, "In Test::~Test\n"); /* count(1) { xfail *-*-darwin* *-*-dragonfly* *-*-solaris2* } */ } } T1; @@ -49,4 +50,4 @@ static void __attribute__ ((destructor)) dtor_default () fprintf (stderr, "in destructor(())\n"); /* count(1) { xfail *-*-darwin* } */ } -/* { dg-final { run-gcov branches { -b pr16855.C } { xfail *-*-darwin* *-*-dragonfly* } } } */ +/* { dg-final { run-gcov branches { -b pr16855.C } { xfail *-*-darwin* *-*-dragonfly* *-*-solaris2* } } } */ diff --git a/gcc/testsuite/g++.dg/goacc/cache-3-1.C b/gcc/testsuite/g++.dg/goacc/cache-3-1.C index ceafb38..8fa7aa8 100644 --- a/gcc/testsuite/g++.dg/goacc/cache-3-1.C +++ b/gcc/testsuite/g++.dg/goacc/cache-3-1.C @@ -32,13 +32,13 @@ foo (int g[3][10], int h[4][8], int i[2][10], int j[][9], ; #pragma acc cache(t[2:5]) /* { dg-error "is threadprivate variable" } */ ; - #pragma acc cache(k[0.5:]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */ + #pragma acc cache(k[0.5: ]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */ ; - #pragma acc cache(l[:7.5f]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */ + #pragma acc cache(l[ :7.5f]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */ ; - #pragma acc cache(m[p:]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */ + #pragma acc cache(m[p: ]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */ ; - #pragma acc cache(n[:p]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */ + #pragma acc cache(n[ :p]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */ ; #pragma acc cache(o[2:5]) /* { dg-error "does not have pointer or array type" } */ ; @@ -46,73 +46,73 @@ foo (int g[3][10], int h[4][8], int i[2][10], int j[][9], ; #pragma acc cache(s2) /* { dg-error "expected '\\\['" } */ ; - #pragma acc cache(a[:][:]) /* { dg-error "array type length expression must be specified" } */ + #pragma acc cache(a[ : ][ : ]) /* { dg-error "array type length expression must be specified" } */ bar (&a[0][0]); - #pragma acc cache(b[-1:]) /* { dg-error "negative low bound in array section" } */ + #pragma acc cache(b[-1: ]) /* { dg-error "negative low bound in array section" } */ bar (b); - #pragma acc cache(c[:-3][:]) /* { dg-error "negative length in array section" } */ + #pragma acc cache(c[ :-3][ : ]) /* { dg-error "negative length in array section" } */ bar (&c[0][0]); - #pragma acc cache(d[11:]) /* { dg-error "low bound \[^\n\r]* above array section size" } */ + #pragma acc cache(d[11: ]) /* { dg-error "low bound \[^\n\r]* above array section size" } */ bar (d); - #pragma acc cache(e[:11]) /* { dg-error "length \[^\n\r]* above array section size" } */ + #pragma acc cache(e[ :11]) /* { dg-error "length \[^\n\r]* above array section size" } */ bar (e); #pragma acc cache(f[1:10]) /* { dg-error "high bound \[^\n\r]* above array section size" } */ bar (f); - #pragma acc cache(g[:][0:10]) /* { dg-error "for array function parameter length expression must be specified" } */ + #pragma acc cache(g[ : ][0:10]) /* { dg-error "for array function parameter length expression must be specified" } */ bar (&g[0][0]); - #pragma acc cache(h[2:1][-1:]) /* { dg-error "negative low bound in array section" } */ + #pragma acc cache(h[2:1][-1: ]) /* { dg-error "negative low bound in array section" } */ bar (&h[0][0]); - #pragma acc cache(h[:1][:-3]) /* { dg-error "negative length in array section" } */ + #pragma acc cache(h[ :1][ :-3]) /* { dg-error "negative length in array section" } */ bar (&h[0][0]); - #pragma acc cache(i[:1][11:]) /* { dg-error "low bound \[^\n\r]* above array section size" } */ + #pragma acc cache(i[ :1][11: ]) /* { dg-error "low bound \[^\n\r]* above array section size" } */ bar (&i[0][0]); - #pragma acc cache(j[3:1][:10]) /* { dg-error "length \[^\n\r]* above array section size" } */ + #pragma acc cache(j[3:1][ :10]) /* { dg-error "length \[^\n\r]* above array section size" } */ bar (&j[0][0]); #pragma acc cache(j[30:1][5:5]) /* { dg-error "high bound \[^\n\r]* above array section size" } */ bar (&j[0][0]); - #pragma acc cache(a2[:1][2:4]) + #pragma acc cache(a2[ :1][2:4]) bar (&a2[0][0]); - #pragma acc cache(a2[3:5][:]) + #pragma acc cache(a2[3:5][ : ]) bar (&a2[0][0]); - #pragma acc cache(a2[3:5][:10]) + #pragma acc cache(a2[3:5][ :10]) bar (&a2[0][0]); - #pragma acc cache(b2[0:]) + #pragma acc cache(b2[0: ]) bar (b2); - #pragma acc cache(c2[:3][:]) + #pragma acc cache(c2[ :3][ : ]) bar (&c2[0][0]); - #pragma acc cache(d2[9:]) + #pragma acc cache(d2[9: ]) bar (d2); - #pragma acc cache(e2[:10]) + #pragma acc cache(e2[ :10]) bar (e2); #pragma acc cache(f2[1:9]) bar (f2); - #pragma acc cache(g2[:1][2:4]) + #pragma acc cache(g2[ :1][2:4]) bar (&g2[0][0]); - #pragma acc cache(h2[2:2][0:]) + #pragma acc cache(h2[2:2][0: ]) bar (&h2[0][0]); - #pragma acc cache(h2[:1][:3]) + #pragma acc cache(h2[ :1][ :3]) bar (&h2[0][0]); - #pragma acc cache(i2[:1][9:]) + #pragma acc cache(i2[ :1][9: ]) bar (&i2[0][0]); - #pragma acc cache(j2[3:4][:9]) + #pragma acc cache(j2[3:4][ :9]) bar (&j2[0][0]); #pragma acc cache(j2[30:1][5:4]) bar (&j2[0][0]); #pragma acc cache(q[1:2]) ; - #pragma acc cache(q[3:5][:10]) /* { dg-error "array section is not contiguous" } */ + #pragma acc cache(q[3:5][ :10]) /* { dg-error "array section is not contiguous" } */ ; - #pragma acc cache(r[3:][2:1][1:2]) + #pragma acc cache(r[3: ][2:1][1:2]) ; - #pragma acc cache(r[3:][2:1][1:2][:][0:4]) + #pragma acc cache(r[3: ][2:1][1:2][ : ][0:4]) ; - #pragma acc cache(r[3:][2:1][1:2][1:][0:4]) /* { dg-error "array section is not contiguous" } */ + #pragma acc cache(r[3: ][2:1][1:2][1: ][0:4]) /* { dg-error "array section is not contiguous" } */ ; - #pragma acc cache(r[3:][2:1][1:2][:3][0:4]) /* { dg-error "array section is not contiguous" } */ + #pragma acc cache(r[3: ][2:1][1:2][ :3][0:4]) /* { dg-error "array section is not contiguous" } */ ; - #pragma acc cache(r[3:][2:1][1:2][:][1:]) /* { dg-error "array section is not contiguous" } */ + #pragma acc cache(r[3: ][2:1][1:2][ : ][1: ]) /* { dg-error "array section is not contiguous" } */ ; - #pragma acc cache(r[3:][2:1][1:2][:][:3]) /* { dg-error "array section is not contiguous" } */ + #pragma acc cache(r[3: ][2:1][1:2][ : ][ :3]) /* { dg-error "array section is not contiguous" } */ ; } diff --git a/gcc/testsuite/g++.dg/goacc/cache-3-2.C b/gcc/testsuite/g++.dg/goacc/cache-3-2.C index 5561e17..8809ab0 100644 --- a/gcc/testsuite/g++.dg/goacc/cache-3-2.C +++ b/gcc/testsuite/g++.dg/goacc/cache-3-2.C @@ -20,25 +20,25 @@ foo (int *p, int (*q)[10], int r[10], int s[10][10]) ; #pragma acc cache (r[-1:2]) ; - #pragma acc cache (s[-1:2][:]) + #pragma acc cache (s[-1:2][ : ]) ; #pragma acc cache (s[-1:2][-2:10]) /* { dg-error "negative low bound in array section in" } */ ; #pragma acc cache (a[-1:2]) /* { dg-error "negative low bound in array section in" } */ ; - #pragma acc cache (b[-1:2][0:]) /* { dg-error "negative low bound in array section in" } */ + #pragma acc cache (b[-1:2][0: ]) /* { dg-error "negative low bound in array section in" } */ ; #pragma acc cache (b[1:2][-2:10]) /* { dg-error "negative low bound in array section in" } */ ; #pragma acc cache (p[2:-3]) /* { dg-error "negative length in array section in" } */ ; - #pragma acc cache (q[2:-3][:]) /* { dg-error "negative length in array section in" } */ + #pragma acc cache (q[2:-3][ : ]) /* { dg-error "negative length in array section in" } */ ; #pragma acc cache (q[2:3][0:-1]) /* { dg-error "negative length in array section in" } */ ; #pragma acc cache (r[2:-5]) /* { dg-error "negative length in array section in" } */ ; - #pragma acc cache (s[2:-5][:]) /* { dg-error "negative length in array section in" } */ + #pragma acc cache (s[2:-5][ : ]) /* { dg-error "negative length in array section in" } */ ; #pragma acc cache (s[2:5][0:-4]) /* { dg-error "negative length in array section in" } */ ; diff --git a/gcc/testsuite/g++.dg/goacc/data-clause-1.C b/gcc/testsuite/g++.dg/goacc/data-clause-1.C index 07ef6ae..ead7185 100644 --- a/gcc/testsuite/g++.dg/goacc/data-clause-1.C +++ b/gcc/testsuite/g++.dg/goacc/data-clause-1.C @@ -31,13 +31,13 @@ foo (int g[3][10], int h[4][8], int i[2][10], int j[][9], ; #pragma acc parallel copyout(t[2:5]) /* { dg-error "is threadprivate variable" } */ ; - #pragma acc parallel copy(k[0.5:]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */ + #pragma acc parallel copy(k[0.5: ]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */ ; - #pragma acc parallel copyout(l[:7.5f]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */ + #pragma acc parallel copyout(l[ :7.5f]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */ ; - #pragma acc parallel copyin(m[p:]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */ + #pragma acc parallel copyin(m[p: ]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */ ; - #pragma acc parallel copy(n[:p]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */ + #pragma acc parallel copy(n[ :p]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */ ; #pragma acc parallel copyin(o[2:5]) /* { dg-error "does not have pointer or array type" } */ ; @@ -45,73 +45,73 @@ foo (int g[3][10], int h[4][8], int i[2][10], int j[][9], ; #pragma acc parallel create(s2) /* { dg-error "'s2' does not have a mappable type in 'map' clause" } */ ; - #pragma acc parallel copyin(a[:][:]) /* { dg-error "array type length expression must be specified" } */ + #pragma acc parallel copyin(a[ : ][ : ]) /* { dg-error "array type length expression must be specified" } */ bar (&a[0][0]); /* { dg-error "referenced in target region does not have a mappable type" "PR97996" { xfail *-*-* } } */ - #pragma acc parallel copy(b[-1:]) /* { dg-error "negative low bound in array section" } */ + #pragma acc parallel copy(b[-1: ]) /* { dg-error "negative low bound in array section" } */ bar (b); - #pragma acc parallel copy(c[:-3][:]) /* { dg-error "negative length in array section" } */ + #pragma acc parallel copy(c[ :-3][ : ]) /* { dg-error "negative length in array section" } */ bar (&c[0][0]); - #pragma acc parallel copyout(d[11:]) /* { dg-error "low bound \[^\n\r]* above array section size" } */ + #pragma acc parallel copyout(d[11: ]) /* { dg-error "low bound \[^\n\r]* above array section size" } */ bar (d); - #pragma acc parallel copyin(e[:11]) /* { dg-error "length \[^\n\r]* above array section size" } */ + #pragma acc parallel copyin(e[ :11]) /* { dg-error "length \[^\n\r]* above array section size" } */ bar (e); #pragma acc parallel copyin(f[1:10]) /* { dg-error "high bound \[^\n\r]* above array section size" } */ bar (f); - #pragma acc parallel copyout(g[:][0:10]) /* { dg-error "for array function parameter length expression must be specified" } */ + #pragma acc parallel copyout(g[ : ][0:10]) /* { dg-error "for array function parameter length expression must be specified" } */ bar (&g[0][0]); - #pragma acc parallel copyout(h[2:1][-1:]) /* { dg-error "negative low bound in array section" } */ + #pragma acc parallel copyout(h[2:1][-1: ]) /* { dg-error "negative low bound in array section" } */ bar (&h[0][0]); - #pragma acc parallel copy(h[:1][:-3]) /* { dg-error "negative length in array section" } */ + #pragma acc parallel copy(h[ :1][ :-3]) /* { dg-error "negative length in array section" } */ bar (&h[0][0]); - #pragma acc parallel copy(i[:1][11:]) /* { dg-error "low bound \[^\n\r]* above array section size" } */ + #pragma acc parallel copy(i[ :1][11: ]) /* { dg-error "low bound \[^\n\r]* above array section size" } */ bar (&i[0][0]); - #pragma acc parallel copyout(j[3:1][:10]) /* { dg-error "length \[^\n\r]* above array section size" } */ + #pragma acc parallel copyout(j[3:1][ :10]) /* { dg-error "length \[^\n\r]* above array section size" } */ bar (&j[0][0]); #pragma acc parallel copyin(j[30:1][5:5]) /* { dg-error "high bound \[^\n\r]* above array section size" } */ bar (&j[0][0]); - #pragma acc parallel copyin(a2[:1][2:4]) + #pragma acc parallel copyin(a2[ :1][2:4]) bar (&a2[0][0]); - #pragma acc parallel copy(a2[3:5][:]) + #pragma acc parallel copy(a2[3:5][ : ]) bar (&a2[0][0]); - #pragma acc parallel copyin(a2[3:5][:10]) + #pragma acc parallel copyin(a2[3:5][ :10]) bar (&a2[0][0]); - #pragma acc parallel copy(b2[0:]) + #pragma acc parallel copy(b2[0: ]) bar (b2); - #pragma acc parallel copy(c2[:3][:]) + #pragma acc parallel copy(c2[ :3][ : ]) bar (&c2[0][0]); - #pragma acc parallel copyout(d2[9:]) + #pragma acc parallel copyout(d2[9: ]) bar (d2); - #pragma acc parallel copyin(e2[:10]) + #pragma acc parallel copyin(e2[ :10]) bar (e2); #pragma acc parallel copyin(f2[1:9]) bar (f2); - #pragma acc parallel copy(g2[:1][2:4]) + #pragma acc parallel copy(g2[ :1][2:4]) bar (&g2[0][0]); - #pragma acc parallel copyout(h2[2:2][0:]) + #pragma acc parallel copyout(h2[2:2][0: ]) bar (&h2[0][0]); - #pragma acc parallel copy(h2[:1][:3]) + #pragma acc parallel copy(h2[ :1][ :3]) bar (&h2[0][0]); - #pragma acc parallel copyin(i2[:1][9:]) + #pragma acc parallel copyin(i2[ :1][9: ]) bar (&i2[0][0]); - #pragma acc parallel copyout(j2[3:4][:9]) + #pragma acc parallel copyout(j2[3:4][ :9]) bar (&j2[0][0]); #pragma acc parallel copyin(j2[30:1][5:4]) bar (&j2[0][0]); #pragma acc parallel copy(q[1:2]) ; - #pragma acc parallel copy(q[3:5][:10]) /* { dg-error "array section is not contiguous" } */ + #pragma acc parallel copy(q[3:5][ :10]) /* { dg-error "array section is not contiguous" } */ ; - #pragma acc parallel copy(r[3:][2:1][1:2]) + #pragma acc parallel copy(r[3: ][2:1][1:2]) ; - #pragma acc parallel copy(r[3:][2:1][1:2][:][0:4]) + #pragma acc parallel copy(r[3: ][2:1][1:2][ : ][0:4]) ; - #pragma acc parallel copy(r[3:][2:1][1:2][1:][0:4]) /* { dg-error "array section is not contiguous" } */ + #pragma acc parallel copy(r[3: ][2:1][1:2][1: ][0:4]) /* { dg-error "array section is not contiguous" } */ ; - #pragma acc parallel copy(r[3:][2:1][1:2][:3][0:4]) /* { dg-error "array section is not contiguous" } */ + #pragma acc parallel copy(r[3: ][2:1][1:2][ :3][0:4]) /* { dg-error "array section is not contiguous" } */ ; - #pragma acc parallel copy(r[3:][2:1][1:2][:][1:]) /* { dg-error "array section is not contiguous" } */ + #pragma acc parallel copy(r[3: ][2:1][1:2][ : ][1: ]) /* { dg-error "array section is not contiguous" } */ ; - #pragma acc parallel copy(r[3:][2:1][1:2][:][:3]) /* { dg-error "array section is not contiguous" } */ + #pragma acc parallel copy(r[3: ][2:1][1:2][ : ][ :3]) /* { dg-error "array section is not contiguous" } */ ; } diff --git a/gcc/testsuite/g++.dg/goacc/data-clause-2.C b/gcc/testsuite/g++.dg/goacc/data-clause-2.C index 57d1823..f167d98 100644 --- a/gcc/testsuite/g++.dg/goacc/data-clause-2.C +++ b/gcc/testsuite/g++.dg/goacc/data-clause-2.C @@ -6,6 +6,10 @@ /* See also corresponding OpenMP variant: '../gomp/map-2.C'. */ +/* Array sections without spaces between [ and : or : and ] are incompatible + with C++26. */ +/* { dg-skip-if "array sections vs. C++26" { c++26 } } */ + template <int N> void foo (int *p, int (*q)[10], int r[10], int s[10][10]) diff --git a/gcc/testsuite/g++.dg/goacc/mdc.C b/gcc/testsuite/g++.dg/goacc/mdc.C index 9d460f2..99148be 100644 --- a/gcc/testsuite/g++.dg/goacc/mdc.C +++ b/gcc/testsuite/g++.dg/goacc/mdc.C @@ -30,17 +30,17 @@ t1 () #pragma acc exit data detach(ra) } -#pragma acc enter data attach(rz[:5]) /* { dg-error "expected single pointer in .attach. clause" } */ +#pragma acc enter data attach(rz[ :5]) /* { dg-error "expected single pointer in .attach. clause" } */ /* { dg-error "has no data movement clause" "" { target *-*-* } .-1 } */ -#pragma acc exit data detach(rz[:5]) /* { dg-error "expected single pointer in .detach. clause" } */ +#pragma acc exit data detach(rz[ :5]) /* { dg-error "expected single pointer in .detach. clause" } */ /* { dg-error "has no data movement clause" "" { target *-*-* } .-1 } */ -#pragma acc enter data attach(rz[1:]) /* { dg-error "expected single pointer in .attach. clause" } */ +#pragma acc enter data attach(rz[1: ]) /* { dg-error "expected single pointer in .attach. clause" } */ /* { dg-error "has no data movement clause" "" { target *-*-* } .-1 } */ -#pragma acc exit data detach(rz[1:]) /* { dg-error "expected single pointer in .detach. clause" } */ +#pragma acc exit data detach(rz[1: ]) /* { dg-error "expected single pointer in .detach. clause" } */ /* { dg-error "has no data movement clause" "" { target *-*-* } .-1 } */ -#pragma acc enter data attach(rz[:]) /* { dg-error "expected single pointer in .attach. clause" } */ +#pragma acc enter data attach(rz[ : ]) /* { dg-error "expected single pointer in .attach. clause" } */ /* { dg-error "has no data movement clause" "" { target *-*-* } .-1 } */ -#pragma acc exit data detach(rz[:]) /* { dg-error "expected single pointer in .detach. clause" } */ +#pragma acc exit data detach(rz[ : ]) /* { dg-error "expected single pointer in .detach. clause" } */ /* { dg-error "has no data movement clause" "" { target *-*-* } .-1 } */ #pragma acc enter data attach(rz[3]) /* { dg-error "expected pointer in .attach. clause" } */ /* { dg-error "has no data movement clause" "" { target *-*-* } .-1 } */ diff --git a/gcc/testsuite/g++.dg/gomp/allocate-3.C b/gcc/testsuite/g++.dg/gomp/allocate-3.C index e778314..0303b55 100644 --- a/gcc/testsuite/g++.dg/gomp/allocate-3.C +++ b/gcc/testsuite/g++.dg/gomp/allocate-3.C @@ -1,3 +1,7 @@ +// Array sections without spaces between [ and : or : and ] are incompatible +// with C++26. +// { dg-skip-if "array sections vs. C++26" { c++26 } } + template <typename T> void foo (T &x, T (&y)[4], T *&z, int &u, int (&v)[4], int *&w) diff --git a/gcc/testsuite/g++.dg/gomp/array-section-2.C b/gcc/testsuite/g++.dg/gomp/array-section-2.C index e2be979..7bf00c0 100644 --- a/gcc/testsuite/g++.dg/gomp/array-section-2.C +++ b/gcc/testsuite/g++.dg/gomp/array-section-2.C @@ -18,10 +18,10 @@ int C::foo() #pragma omp target map(arr1[::x: ::y]) // { dg-final { scan-tree-dump {map\(tofrom:arr1\[SAVE_EXPR <x>\] \[len: \(sizetype\) y \* [0-9]+\]\) map\(firstprivate:arr1 \[pointer assign, bias: \((?:long )?int\) &arr1\[SAVE_EXPR <x>\] - \((?:long )?int\) &arr1\]\)} "original" } } { } -#pragma omp target map(arr1[::x:]) +#pragma omp target map(arr1[::x: ]) // { dg-final { scan-tree-dump {map\(tofrom:arr1\[SAVE_EXPR <x>\] \[len: \(40 - \(sizetype\) SAVE_EXPR <x>\) \* [0-9]+\]\) map\(firstprivate:arr1 \[pointer assign, bias: \((?:long )?int\) &arr1\[SAVE_EXPR <x>\] - \((?:long )?int\) &arr1\]\)} "original" } } { } -#pragma omp target map(arr1[: ::y]) +#pragma omp target map(arr1[ : ::y]) // { dg-final { scan-tree-dump {map\(tofrom:arr1\[0\] \[len: \(sizetype\) y \* [0-9]+\]\) map\(firstprivate:arr1 \[pointer assign, bias: 0\]\)} "original" } } { } return ::x + ::y; @@ -42,10 +42,10 @@ void Ct<T>::foo() #pragma omp target map(arr1[::x: ::y]) // { dg-final { scan-tree-dump {map\(tofrom:arr1\[SAVE_EXPR <x>\] \[len: \(sizetype\) y \* [0-9]+\]\) map\(firstprivate:arr1 \[pointer assign, bias: \((?:long )?int\) &arr1\[SAVE_EXPR <x>\] - \((?:long )?int\) &arr1\]\)} "original" } } { } -#pragma omp target map(arr1[::x:]) +#pragma omp target map(arr1[::x: ]) // { dg-final { scan-tree-dump {map\(tofrom:arr1\[SAVE_EXPR <x>\] \[len: \(40 - \(sizetype\) SAVE_EXPR <x>\) \* [0-9]+\]\) map\(firstprivate:arr1 \[pointer assign, bias: \((?:long )?int\) &arr1\[SAVE_EXPR <x>\] - \((?:long )?int\) &arr1\]\)} "original" } } { } -#pragma omp target map(arr1[: ::y]) +#pragma omp target map(arr1[ : ::y]) // { dg-final { scan-tree-dump {map\(tofrom:arr1\[0\] \[len: \(sizetype\) y \* [0-9]+\]\) map\(firstprivate:arr1 \[pointer assign, bias: 0\]\)} "original" } } { } } diff --git a/gcc/testsuite/g++.dg/gomp/bad-array-section-10.C b/gcc/testsuite/g++.dg/gomp/bad-array-section-10.C index 286e72e..78646ce 100644 --- a/gcc/testsuite/g++.dg/gomp/bad-array-section-10.C +++ b/gcc/testsuite/g++.dg/gomp/bad-array-section-10.C @@ -4,7 +4,7 @@ template<int C, int D> void foo() { int arr1[40]; -#pragma omp target map(arr1[4,C:]) +#pragma omp target map(arr1[4,C: ]) // { dg-warning "top-level comma expression in array subscript is deprecated" "" { target c++20_only } .-1 } // { dg-error "cannot use multidimensional subscript in OpenMP array section" "" { target c++23 } .-2 } { } @@ -12,7 +12,7 @@ void foo() // { dg-warning "top-level comma expression in array subscript is deprecated" "" { target c++20_only } .-1 } // { dg-error "cannot use multidimensional subscript in OpenMP array section" "" { target c++23 } .-2 } { } -#pragma omp target map(arr1[:8,C,10]) +#pragma omp target map(arr1[ :8,C,10]) // { dg-warning "top-level comma expression in array subscript is deprecated" "" { target c++20_only } .-1 } // { dg-error "cannot use multidimensional subscript in OpenMP array section" "" { target c++23 } .-2 } { } @@ -21,7 +21,7 @@ void foo() int main() { int arr1[40]; -#pragma omp target map(arr1[4,5:]) +#pragma omp target map(arr1[4,5: ]) // { dg-warning "top-level comma expression in array subscript is deprecated" "" { target c++20_only } .-1 } // { dg-error "cannot use multidimensional subscript in OpenMP array section" "" { target c++23 } .-2 } { } @@ -29,7 +29,7 @@ int main() // { dg-warning "top-level comma expression in array subscript is deprecated" "" { target c++20_only } .-1 } // { dg-error "cannot use multidimensional subscript in OpenMP array section" "" { target c++23 } .-2 } { } -#pragma omp target map(arr1[:8,9,10]) +#pragma omp target map(arr1[ :8,9,10]) // { dg-warning "top-level comma expression in array subscript is deprecated" "" { target c++20_only } .-1 } // { dg-error "cannot use multidimensional subscript in OpenMP array section" "" { target c++23 } .-2 } { } diff --git a/gcc/testsuite/g++.dg/gomp/bad-array-section-11.C b/gcc/testsuite/g++.dg/gomp/bad-array-section-11.C index dea3b44..2756c65 100644 --- a/gcc/testsuite/g++.dg/gomp/bad-array-section-11.C +++ b/gcc/testsuite/g++.dg/gomp/bad-array-section-11.C @@ -5,13 +5,13 @@ template<int C, int D> void foo() { int arr1[40]; -#pragma omp target map(arr1[4,C:]) +#pragma omp target map(arr1[4,C: ]) // { dg-error "cannot use multidimensional subscript in OpenMP array section" "" { target *-*-* } .-1 } { } #pragma omp target map(arr1[4,5:C,7]) // { dg-error "cannot use multidimensional subscript in OpenMP array section" "" { target *-*-* } .-1 } { } -#pragma omp target map(arr1[:8,C,10]) +#pragma omp target map(arr1[ :8,C,10]) // { dg-error "cannot use multidimensional subscript in OpenMP array section" "" { target *-*-* } .-1 } { } } @@ -19,13 +19,13 @@ void foo() int main() { int arr1[40]; -#pragma omp target map(arr1[4,5:]) +#pragma omp target map(arr1[4,5: ]) // { dg-error "cannot use multidimensional subscript in OpenMP array section" "" { target *-*-* } .-1 } { } #pragma omp target map(arr1[4,5:6,7]) // { dg-error "cannot use multidimensional subscript in OpenMP array section" "" { target *-*-* } .-1 } { } -#pragma omp target map(arr1[:8,9,10]) +#pragma omp target map(arr1[ :8,9,10]) // { dg-error "cannot use multidimensional subscript in OpenMP array section" "" { target *-*-* } .-1 } { } diff --git a/gcc/testsuite/g++.dg/gomp/bad-array-section-9.C b/gcc/testsuite/g++.dg/gomp/bad-array-section-9.C index bba7772..13b9d4f 100644 --- a/gcc/testsuite/g++.dg/gomp/bad-array-section-9.C +++ b/gcc/testsuite/g++.dg/gomp/bad-array-section-9.C @@ -10,7 +10,7 @@ void foo() #pragma omp target map(arr1[arr2[4:5]:arr2[6:7]]) // { dg-error {low bound 'arr2\[4:5\]' of array section does not have integral type} "" { target *-*-* } .-1 } { } -#pragma omp target map(arr1[arr2[:1]:arr2[6:1]]) +#pragma omp target map(arr1[arr2[ :1]:arr2[6:1]]) // { dg-error {low bound 'arr2\[:1\]' of array section does not have integral type} "" { target *-*-* } .-1 } { } #pragma omp target map(arr1[x:arr2[6:1]]) @@ -25,7 +25,7 @@ int main() #pragma omp target map(arr1[arr2[4:5]:arr2[6:7]]) // { dg-error {low bound 'arr2\[4:5\]' of array section does not have integral type} "" { target *-*-* } .-1 } { } -#pragma omp target map(arr1[arr2[:1]:arr2[6:1]]) +#pragma omp target map(arr1[arr2[ :1]:arr2[6:1]]) // { dg-error {low bound 'arr2\[:1\]' of array section does not have integral type} "" { target *-*-* } .-1 } { } #pragma omp target map(arr1[x:arr2[6:1]]) diff --git a/gcc/testsuite/g++.dg/gomp/declare-mapper-1.C b/gcc/testsuite/g++.dg/gomp/declare-mapper-1.C index 3177d20..2523d02 100644 --- a/gcc/testsuite/g++.dg/gomp/declare-mapper-1.C +++ b/gcc/testsuite/g++.dg/gomp/declare-mapper-1.C @@ -10,8 +10,8 @@ struct S { #define N 64 -#pragma omp declare mapper (S w) map(w.size, w.ptr, w.ptr[:w.size]) -#pragma omp declare mapper (foo:S w) map(to:w.size, w.ptr) map(w.ptr[:w.size]) +#pragma omp declare mapper (S w) map(w.size, w.ptr, w.ptr[ :w.size]) +#pragma omp declare mapper (foo:S w) map(to:w.size, w.ptr) map(w.ptr[ :w.size]) int main (int argc, char *argv[]) { @@ -19,7 +19,7 @@ int main (int argc, char *argv[]) s.ptr = new int[N]; s.size = N; -#pragma omp declare mapper (bar:S w) map(w.size, w.ptr, w.ptr[:w.size]) +#pragma omp declare mapper (bar:S w) map(w.size, w.ptr, w.ptr[ :w.size]) #pragma omp target { diff --git a/gcc/testsuite/g++.dg/gomp/declare-mapper-2.C b/gcc/testsuite/g++.dg/gomp/declare-mapper-2.C index 7df72c7..379be29 100644 --- a/gcc/testsuite/g++.dg/gomp/declare-mapper-2.C +++ b/gcc/testsuite/g++.dg/gomp/declare-mapper-2.C @@ -13,7 +13,7 @@ struct Z { int main (int argc, char *argv[]) { -#pragma omp declare mapper (S v) map(v.size, v.ptr[:v.size]) // { dg-note "'#pragma omp declare mapper \\(S\\)' previously declared here" } +#pragma omp declare mapper (S v) map(v.size, v.ptr[ :v.size]) // { dg-note "'#pragma omp declare mapper \\(S\\)' previously declared here" } /* This one's a duplicate. */ #pragma omp declare mapper (default: S v) map (to: v.size) map (v) // { dg-error "redeclaration of '#pragma omp declare mapper \\(S\\)'" } diff --git a/gcc/testsuite/g++.dg/gomp/delim-declare-variant-1.C b/gcc/testsuite/g++.dg/gomp/delim-declare-variant-1.C new file mode 100644 index 0000000..dfeb7c4 --- /dev/null +++ b/gcc/testsuite/g++.dg/gomp/delim-declare-variant-1.C @@ -0,0 +1,39 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-foffload=disable -fdump-tree-gimple" } */ + +/* Check that variants within a "begin declare variant" directive + are attached to the correct overloaded function. */ + +int f (int x) { return x; } + +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +int f (int x) { return -1; } +#pragma omp end declare variant + +int f (int x, int y) { return x * y; } + +#pragma omp begin declare variant match (construct={target}) +int f (int x, int y) { return -2; } +#pragma omp end declare variant + +int f (int x, int y, int z) { return x * y * z; } + +#pragma omp begin declare variant match (device={kind("host")}) +int f (int x, int y, int z) { return -3; } +#pragma omp end declare variant + +int main (void) +{ + if (f (10) != -1) __builtin_abort (); + if (f (10, 20) != 200) __builtin_abort (); /* no match on this one */ + if (f (10, 20, 30) != -3) __builtin_abort (); +} + +/* { dg-final { scan-tree-dump "f\\.ompvariant. \\(10\\)" "gimple" } } */ +/* { dg-final { scan-tree-dump "f \\(10, 20\\)" "gimple" } } */ +/* { dg-final { scan-tree-dump "f\\.ompvariant. \\(10, 20, 30\\)" "gimple" } } */ + + + + + diff --git a/gcc/testsuite/g++.dg/gomp/delim-declare-variant-2.C b/gcc/testsuite/g++.dg/gomp/delim-declare-variant-2.C new file mode 100644 index 0000000..1784e14 --- /dev/null +++ b/gcc/testsuite/g++.dg/gomp/delim-declare-variant-2.C @@ -0,0 +1,53 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-fdump-tree-gimple" } */ + +/* Check that "omp begin declare variant" works on methods in a + class declaration. */ + +class test1 { + + private: + int n; + static int m; + + public: + + #pragma omp begin declare variant match (implementation={vendor("gnu")}) + int get_n (void) { return n * 2; } + static int get_m (void) { return m * 2; } + #pragma omp end declare variant + + #pragma omp begin declare variant match (construct={target}) + int get_n (void) { return this->n * 2; } + #pragma omp end declare variant + + /* The base methods are deliberately declared after the variants in order + to check that the lookup can still find them. */ + void set_n (int x) { n = x; } + int get_n (void) { return n; } + + static void set_m (int x) { m = x; } + static int get_m (void) { return m; } +}; + +int test1::m; + +int main (void) +{ + test1 t1; + t1.set_n (10); + if (t1.get_n () != 20) __builtin_abort (); + test1::set_m (1); + if (test1::get_m () != 2) __builtin_abort (); +} + +/* { dg-final { scan-tree-dump "test1::get_n\\.ompvariant. \\(&t1\\)" "gimple" } } */ +/* { dg-final { scan-tree-dump "test1::get_m\\.ompvariant. \\(\\)" "gimple" } } */ + +/* The variants must have internal linkage, not .globl or .weak. */ +/* { dg-final { scan-assembler-not "\\.globl\[ \t\]*_?_ZN5test117get_n\\.ompvariant" } } */ +/* { dg-final { scan-assembler-not "\\.globl\[ \t\]*_?_ZN5test117get_m\\.ompvariant" } } */ +/* { dg-final { scan-assembler-not "\\.weak\[ \t\]*_?_ZN5test117get_n\\.ompvariant" } } */ +/* { dg-final { scan-assembler-not "\\.weak\[ \t\]*_?_ZN5test117get_m\\.ompvariant" } } */ + + diff --git a/gcc/testsuite/g++.dg/gomp/delim-declare-variant-3.C b/gcc/testsuite/g++.dg/gomp/delim-declare-variant-3.C new file mode 100644 index 0000000..ccbb01c --- /dev/null +++ b/gcc/testsuite/g++.dg/gomp/delim-declare-variant-3.C @@ -0,0 +1,37 @@ +/* { dg-do compile } */ + +/* Check that "omp begin declare variant" for class methods outside of the + class declaration gives a sorry. C++ generally does not allow injection + of additional methods into a class outside of its declaration so it is + not clear what this is supposed to do. */ + +class test1 { + + private: + int n; + static int m; + + public: + + void set_n (int x) { n = x; } + int get_n (void) { return n; } + + static void set_m (int x) { m = x; } + static int get_m (void) { return m; } + +}; + +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +int test1::get_n (void) { return n * 2; } /* { dg-message "sorry, unimplemented: cannot handle qualified name for variant function" } */ +static int test1::get_m (void) { return m * 2; } /* { dg-message "sorry, unimplemented: cannot handle qualified name for variant function" } */ +#pragma omp end declare variant + +int main (void) +{ + test1 t1; + t1.set_n (10); + if (t1.get_n () != 20) __builtin_abort (); + test1::set_m (1); + if (test1::get_m () != 2) __builtin_abort (); +} + diff --git a/gcc/testsuite/g++.dg/gomp/delim-declare-variant-4.C b/gcc/testsuite/g++.dg/gomp/delim-declare-variant-4.C new file mode 100644 index 0000000..567cf9c --- /dev/null +++ b/gcc/testsuite/g++.dg/gomp/delim-declare-variant-4.C @@ -0,0 +1,57 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-fdump-tree-gimple" } */ + +/* Like c-c++-common/delim-declare-variant-1.c, but with namespaces. */ + +namespace n1 { + +int foo (int a) +{ + return a; +} + +int bar (int x) +{ + return x; +} + +#pragma omp begin declare variant match (construct={target}) +int foo (int a) +{ + return a + 1; +} + +int bar (int x) +{ + return x * 2; +} +#pragma omp end declare variant + +/* Because of the high score value, this variant for "bar" should always be + selected even when the one above also matches. */ +#pragma omp begin declare variant match (implementation={vendor(score(10000):"gnu")}) +int bar (int x) +{ + return x * 4; +} +#pragma omp end declare variant + +} /* namespace n1 */ + +int main (void) +{ + if (n1::foo (42) != 42) __builtin_abort (); + if (n1::bar (3) != 12) __builtin_abort (); +#pragma omp target + { + if (n1::foo (42) != 43) __builtin_abort (); + if (n1::bar (3) != 12) __builtin_abort (); + } +} + +/* { dg-final { scan-tree-dump-times "omp declare variant base \\(foo.ompvariant." 1 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "omp declare variant base \\(bar.ompvariant." 2 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "foo \\(42\\)" 1 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "foo\\.ompvariant. \\(42\\)" 1 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "bar \\(3\\)" 0 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "bar\\.ompvariant. \\(3\\)" 2 "gimple" } } */ diff --git a/gcc/testsuite/g++.dg/gomp/delim-declare-variant-40.C b/gcc/testsuite/g++.dg/gomp/delim-declare-variant-40.C new file mode 100644 index 0000000..4f35d20 --- /dev/null +++ b/gcc/testsuite/g++.dg/gomp/delim-declare-variant-40.C @@ -0,0 +1,51 @@ +// { dg-do compile } + +// Check that variants for a template function are instantiated correctly. +// FIXME: Fails due to PR118530. + +template<typename T> +void f_default_param (T = 42) {} +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +template<typename T> +void f_default_param (T = 42) {} +#pragma omp end declare variant + +template<typename T> +void f_no_param () {} // { dg-bogus "no matching function for call" "PR118530" { xfail *-*-* } } +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +template<typename T> +void f_no_param () {} +#pragma omp end declare variant + +void instantiate_f() +{ + f_default_param<int>(); + f_no_param<int>(); +} + +template<int> +void nttp () {} // { dg-bogus "no matching function for call" "PR118530" { xfail *-*-* } } +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +template<int> +void nttp () {} +#pragma omp end declare variant + +void instantiate_nttp() +{ + nttp<42>(); +} + +template<typename> +struct S {}; + +template<template<typename> class Templ> +void templ_templ () {} // { dg-bogus "no matching function for call" "PR118530" { xfail *-*-* } } +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +template<template<typename> class Templ> +void templ_templ () {} +#pragma omp end declare variant + +void instantiate_templ_templ() +{ + templ_templ<S>(); +} diff --git a/gcc/testsuite/g++.dg/gomp/delim-declare-variant-41.C b/gcc/testsuite/g++.dg/gomp/delim-declare-variant-41.C new file mode 100644 index 0000000..5a35210 --- /dev/null +++ b/gcc/testsuite/g++.dg/gomp/delim-declare-variant-41.C @@ -0,0 +1,29 @@ +/* { dg-do compile { target c++11 } } */ + +template<typename T, typename U> +class is_same { + public: + static constexpr bool value = false; +}; + +template<typename T> +class is_same<T, T> { + public: + static constexpr bool value = true; +}; + +template<typename T> +void fn (T&&) { } + +#pragma omp begin declare variant match(implementation={vendor("gnu")}) +template<typename T> +void fn(T&&) { + static_assert(is_same<T, int>::value); +} +#pragma omp end declare variant + +int main() +{ + int lvalue = 42; + fn(0); +} diff --git a/gcc/testsuite/g++.dg/gomp/delim-declare-variant-5.C b/gcc/testsuite/g++.dg/gomp/delim-declare-variant-5.C new file mode 100644 index 0000000..e8db369 --- /dev/null +++ b/gcc/testsuite/g++.dg/gomp/delim-declare-variant-5.C @@ -0,0 +1,53 @@ +/* { dg-do compile } */ + +/* Check that "omp begin declare variant" for a namespace function outside of + the namespace gives an error. C++ generally does not allow injection of + additional function into a namespace outside of its scope so this is just a + generic error. */ + +namespace n1 { + +int foo (int a) +{ + return a; +} + +int bar (int x) +{ + return x; +} + +} /* namespace n1 */ + + +#pragma omp begin declare variant match (construct={target}) +int n1::foo (int a) /* { dg-message "sorry, unimplemented: cannot handle qualified name for variant function" } */ +{ + return a + 1; +} + +int n1::bar (int x) /* { dg-message "sorry, unimplemented: cannot handle qualified name for variant function" } */ +{ + return x * 2; +} +#pragma omp end declare variant + +/* Because of the high score value, this variant for "bar" should always be + selected even when the one above also matches. */ +#pragma omp begin declare variant match (implementation={vendor(score(10000):"gnu")}) +int n1::bar (int x) /* { dg-message "sorry, unimplemented: cannot handle qualified name for variant function" } */ +{ + return x * 4; +} +#pragma omp end declare variant + +int main (void) +{ + if (n1::foo (42) != 42) __builtin_abort (); + if (n1::bar (3) != 12) __builtin_abort (); +#pragma omp target + { + if (n1::foo (42) != 43) __builtin_abort (); + if (n1::bar (3) != 12) __builtin_abort (); + } +} diff --git a/gcc/testsuite/g++.dg/gomp/delim-declare-variant-50.C b/gcc/testsuite/g++.dg/gomp/delim-declare-variant-50.C new file mode 100644 index 0000000..a958b52 --- /dev/null +++ b/gcc/testsuite/g++.dg/gomp/delim-declare-variant-50.C @@ -0,0 +1,99 @@ +/* { dg-do compile } */ + +/* Test for restrictions on declare variant functions on virtual functions, + constructors, and destructors. */ + +struct S0 +{ + virtual void f_virtual_before0 () {} + #pragma omp begin declare variant match (implementation={vendor("gnu")}) + virtual void f_virtual_before0 () {} // { dg-error "declare variant directives are not allowed on virtual functions" } + #pragma omp end declare variant + + virtual void f_virtual_before1 () {} + #pragma omp begin declare variant match (implementation={vendor("gnu")}) + void f_virtual_before1 () {} // { dg-error "declare variant directives are not allowed on virtual functions" } + #pragma omp end declare variant + + void f_virtual_before2 () {} + #pragma omp begin declare variant match (implementation={vendor("gnu")}) + virtual void f_virtual_before2 () {} // { dg-error "declare variant directives are not allowed on virtual functions" } + #pragma omp end declare variant + + void f_virtual_before3 () {} + // code elision, no error + #pragma omp begin declare variant match (implementation={vendor("cray")}) + virtual void f_virtual_before3 () {} + #pragma omp end declare variant + + #pragma omp begin declare variant match (implementation={vendor("gnu")}) + virtual void f_virtual_after0 () {} // { dg-error "declare variant directives are not allowed on virtual functions" } + #pragma omp end declare variant + virtual void f_virtual_after0 () {} + + #pragma omp begin declare variant match (implementation={vendor("gnu")}) + void f_virtual_after1 () {} // { dg-error "declare variant directives are not allowed on virtual functions" } + #pragma omp end declare variant + virtual void f_virtual_after1 () {} + + #pragma omp begin declare variant match (implementation={vendor("gnu")}) + virtual void f_virtual_after2 () {} // { dg-error "declare variant directives are not allowed on virtual functions" } + #pragma omp end declare variant + void f_virtual_after2 () {} +}; + +struct S_before { + S_before() {} + #pragma omp begin declare variant match (implementation={vendor("gnu")}) + S_before() {} // { dg-error "declare variant directives are not allowed on constructors" } + #pragma omp end declare variant + + S_before(int) {} + #pragma omp begin declare variant match (implementation={vendor("gnu")}) + S_before(int) {} // { dg-error "declare variant directives are not allowed on constructors" } + #pragma omp end declare variant + + S_before(double) {} + // code elision, no error + #pragma omp begin declare variant match (implementation={vendor("cray")}) + S_before(double) {} + #pragma omp end declare variant + + template<typename T> + S_before(T) {} + #pragma omp begin declare variant match (implementation={vendor("gnu")}) + template<typename T> + S_before(T) {} // { dg-error "declare variant directives are not allowed on constructors" } + #pragma omp end declare variant + + ~S_before() {} + #pragma omp begin declare variant match (implementation={vendor("gnu")}) + ~S_before() {} // { dg-error "declare variant directives are not allowed on destructors" } + #pragma omp end declare variant +}; + +struct S_after { + #pragma omp begin declare variant match (implementation={vendor("gnu")}) + S_after() {} // { dg-error "declare variant directives are not allowed on constructors" } + #pragma omp end declare variant + S_after() {} + + #pragma omp begin declare variant match (implementation={vendor("gnu")}) + S_after(int) {} // { dg-error "declare variant directives are not allowed on constructors" } + #pragma omp end declare variant + S_after(int) {} + + #pragma omp begin declare variant match (implementation={vendor("gnu")}) + template<typename T> + S_after(T) {} // { dg-error "declare variant directives are not allowed on constructors" } + #pragma omp end declare variant + template<typename T> + S_after(T) {} + + // code elision, no error + #pragma omp begin declare variant match (implementation={vendor("cray")}) + ~S_after() {} + #pragma omp end declare variant + ~S_after() {} +}; + diff --git a/gcc/testsuite/g++.dg/gomp/delim-declare-variant-51.C b/gcc/testsuite/g++.dg/gomp/delim-declare-variant-51.C new file mode 100644 index 0000000..129193d --- /dev/null +++ b/gcc/testsuite/g++.dg/gomp/delim-declare-variant-51.C @@ -0,0 +1,181 @@ +/* { dg-do compile { target c++11 } } */ + +/* Test delimited declare variant on constexpr, deleted, and defaulted + functions. */ +/* C++11 */ + +/* TODO: add templates cases for constexpr/delete free functions */ + +/* Do we warn for the mismatch? + TBH we probably warn whenever a variant function is constexpr in general. + I can't imagine that we are going to support constant evaluation of a + variant function, realistically the only choice is to always use the base + function if a constant-expression is required. */ +constexpr int freefn_mismatched_constexpr_before0 () { return 0; } +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +int freefn_mismatched_constexpr_before0 () { return 1; } +#pragma omp end declare variant + +int freefn_mismatched_constexpr_before1 () { return 0; } +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +constexpr int freefn_mismatched_constexpr_before1 () { return 1; } +#pragma omp end declare variant + +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +constexpr int freefn_mismatched_constexpr_after0 () { return 1; } +#pragma omp end declare variant +int freefn_mismatched_constexpr_after0 () { return 0; } + +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +int freefn_mismatched_constexpr_after1 () { return 1; } +#pragma omp end declare variant +constexpr int freefn_mismatched_constexpr_after1 () { return 0; } + + + +void freefn_deleted_before () = delete; +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +void freefn_deleted_before () {} // { dg-error "declare variant directives are not allowed on deleted functions" } +#pragma omp end declare variant + +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +void freefn_deleted_after () {} // { dg-error "declare variant directives are not allowed on deleted functions" } +#pragma omp end declare variant +void freefn_deleted_after () = delete; + +/* TECHNICALLY allowed by the spec, but obviously conflicts with the intention. */ +void freefn_variant_deleted_base_before () {} +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +void freefn_variant_deleted_base_before () = delete; // { dg-error "declare variant directives are not allowed on deleted functions" } +#pragma omp end declare variant + +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +void freefn_variant_deleted_base_after () = delete; // { dg-error "declare variant directives are not allowed on deleted functions" } +#pragma omp end declare variant +void freefn_variant_deleted_base_after () {}; + + +/* For now, obviously error, not sure if we error on just the base or on + both though. + In the future, I think if the base and all variants are deleted, we can + treat a call to the function as deleted before we determine a variant. */ +void freefn_both_deleted_base_before () = delete; +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +void freefn_both_deleted_base_before () = delete; // { dg-error "declare variant directives are not allowed on deleted functions" } +#pragma omp end declare variant + +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +void freefn_both_deleted_base_after () = delete; // { dg-error "declare variant directives are not allowed on deleted functions" } +#pragma omp end declare variant +void freefn_both_deleted_base_after () = delete; + + + + +struct S0 +{ + void f_deleted_before () = delete; + #pragma omp begin declare variant match (implementation={vendor("gnu")}) + void f_deleted_before () {} // { dg-error "declare variant directives are not allowed on deleted functions" } + #pragma omp end declare variant + + #pragma omp begin declare variant match (implementation={vendor("gnu")}) + void f_deleted_after () {} // { dg-error "declare variant directives are not allowed on deleted functions" } + #pragma omp end declare variant + void f_deleted_after () = delete; +}; + + +/* These should error for constructor/destructor, not default. */ +struct S_default_before { + S_default_before() = default; + #pragma omp begin declare variant match (implementation={vendor("gnu")}) + S_default_before() {} // { dg-error "declare variant directives are not allowed on constructors" } + #pragma omp end declare variant + + S_default_before(S_default_before const&) = default; + #pragma omp begin declare variant match (implementation={vendor("gnu")}) + S_default_before(S_default_before const&) {} // { dg-error "declare variant directives are not allowed on constructors" } + #pragma omp end declare variant + + S_default_before(S_default_before&&) = default; + #pragma omp begin declare variant match (implementation={vendor("gnu")}) + S_default_before(S_default_before&&) {} // { dg-error "declare variant directives are not allowed on constructors" } + #pragma omp end declare variant + + ~S_default_before() = default; + #pragma omp begin declare variant match (implementation={vendor("gnu")}) + ~S_default_before() {} // { dg-error "declare variant directives are not allowed on destructors" } + #pragma omp end declare variant +}; + +struct S_default_after { + #pragma omp begin declare variant match (implementation={vendor("gnu")}) + S_default_after() {} // { dg-error "declare variant directives are not allowed on constructors" } + #pragma omp end declare variant + S_default_after() = default; + + #pragma omp begin declare variant match (implementation={vendor("gnu")}) + S_default_after(S_default_after const&) {} // { dg-error "declare variant directives are not allowed on constructors" } + #pragma omp end declare variant + S_default_after(S_default_after const&) = default; + + #pragma omp begin declare variant match (implementation={vendor("gnu")}) + S_default_after(S_default_after&&) {} // { dg-error "declare variant directives are not allowed on constructors" } + #pragma omp end declare variant + S_default_after(S_default_after&&) = default; + + #pragma omp begin declare variant match (implementation={vendor("gnu")}) + ~S_default_after() {} // { dg-error "declare variant directives are not allowed on destructors" } + #pragma omp end declare variant + ~S_default_after() = default; +}; + +/* These should error for default/delete. */ +struct S_default_assignment_before { + S_default_assignment_before& operator=(S_default_assignment_before const&) = default; + #pragma omp begin declare variant match (implementation={vendor("gnu")}) + S_default_assignment_before& operator=(S_default_assignment_before const&) { return *this; } // { dg-error "declare variant directives are not allowed on defaulted functions" } + #pragma omp end declare variant + + S_default_assignment_before& operator=(S_default_assignment_before&&) = default; + #pragma omp begin declare variant match (implementation={vendor("gnu")}) + S_default_assignment_before& operator=(S_default_assignment_before&&) { return *this; } // { dg-error "declare variant directives are not allowed on defaulted functions" } + #pragma omp end declare variant +}; + +struct S_default_assignment_after { + #pragma omp begin declare variant match (implementation={vendor("gnu")}) + S_default_assignment_after& operator=(S_default_assignment_after const&) { return *this; } // { dg-error "declare variant directives are not allowed on defaulted functions" } + #pragma omp end declare variant + S_default_assignment_after& operator=(S_default_assignment_after const&) = default; + + #pragma omp begin declare variant match (implementation={vendor("gnu")}) + S_default_assignment_after& operator=(S_default_assignment_after&&) { return *this; } // { dg-error "declare variant directives are not allowed on defaulted functions" } + #pragma omp end declare variant + S_default_assignment_after& operator=(S_default_assignment_after&&) = default; +}; + +struct S_deleted_assignment_before { + S_deleted_assignment_before& operator=(S_deleted_assignment_before const&) = delete; + #pragma omp begin declare variant match (implementation={vendor("gnu")}) + S_deleted_assignment_before& operator=(S_deleted_assignment_before const&) { return *this; } // { dg-error "declare variant directives are not allowed on deleted functions" } + #pragma omp end declare variant + + S_deleted_assignment_before& operator=(S_deleted_assignment_before&&) = delete; + #pragma omp begin declare variant match (implementation={vendor("gnu")}) + S_deleted_assignment_before& operator=(S_deleted_assignment_before&&) { return *this; } // { dg-error "declare variant directives are not allowed on deleted functions" } + #pragma omp end declare variant +}; + +struct S_deleted_assignment_after { + #pragma omp begin declare variant match (implementation={vendor("gnu")}) + S_deleted_assignment_after& operator=(S_deleted_assignment_after const&) { return *this; } // { dg-error "declare variant directives are not allowed on deleted functions" } + #pragma omp end declare variant + S_deleted_assignment_after& operator=(S_deleted_assignment_after const&) = delete; + + #pragma omp begin declare variant match (implementation={vendor("gnu")}) + S_deleted_assignment_after& operator=(S_deleted_assignment_after&&) { return *this; } // { dg-error "declare variant directives are not allowed on deleted functions" } + #pragma omp end declare variant + S_deleted_assignment_after& operator=(S_deleted_assignment_after&&) = delete; +}; diff --git a/gcc/testsuite/g++.dg/gomp/delim-declare-variant-52.C b/gcc/testsuite/g++.dg/gomp/delim-declare-variant-52.C new file mode 100644 index 0000000..4f4a005 --- /dev/null +++ b/gcc/testsuite/g++.dg/gomp/delim-declare-variant-52.C @@ -0,0 +1,24 @@ +/* { dg-do compile { target c++20 } } */ + +/* The procedure that a declare variant directive determined to be a function + variant may not be an immediate function + Declare variant directives may + not be specified for immediate functions. */ +consteval void freefn_consteval_before0 () {} +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +consteval void freefn_consteval_before0 () {} // { dg-error "declare variant directives are not allowed on immediate functions" } +#pragma omp end declare variant + +/* Declare variant directives may not be specified for immediate functions. */ +consteval void freefn_consteval_before1 () {} +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +void freefn_consteval_before1 () {} // { dg-error "declare variant directives are not allowed on immediate functions" } +#pragma omp end declare variant + +/* The procedure that a declare variant directive determined to be a function + variant may not be an immediate function. */ +void freefn_consteval_before2 () {} +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +consteval void freefn_consteval_before2 () {} // { dg-error "declare variant directives are not allowed on immediate functions" } +#pragma omp end declare variant + + diff --git a/gcc/testsuite/g++.dg/gomp/delim-declare-variant-6.C b/gcc/testsuite/g++.dg/gomp/delim-declare-variant-6.C new file mode 100644 index 0000000..b5c6e65 --- /dev/null +++ b/gcc/testsuite/g++.dg/gomp/delim-declare-variant-6.C @@ -0,0 +1,72 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-fdump-tree-gimple" } */ + +/* Check "begin declare variant" on template functions. */ + +template <typename T> +T foo (T a) +{ + return a; +} + +template <typename T> +T bar (T x) +{ + return x; +} + +#pragma omp begin declare variant match (construct={target}) +template <typename T1> +T1 foo (T1 a) +{ + return a + 1; +} + +template <typename T1> +T1 bar (T1 x) +{ + return x * 2; +} +#pragma omp end declare variant + +/* Because of the high score value, this variant for "bar" should always be + selected even when the one above also matches. */ +#pragma omp begin declare variant match (implementation={vendor(score(10000):"gnu")}) +template <typename T2> +T2 bar (T2 x) +{ + return x * 4; +} +#pragma omp end declare variant + +int main (void) +{ + if (foo<int> (42) != 42) __builtin_abort (); + if (bar<int> (3) != 12) __builtin_abort (); +#pragma omp target + { + if (foo<int> (42) != 43) __builtin_abort (); + if (bar<int> (3) != 12) __builtin_abort (); + } +} + +/* Make sure all the template functions are instantiated. */ +/* { dg-final { scan-tree-dump "int foo.ompvariant.<int> \\(.*\\)" "gimple" } } */ +/* { dg-final { scan-tree-dump "int foo<int> \\(.*\\)" "gimple" } } */ +/* { dg-final { scan-tree-dump "int bar.ompvariant.<int> \\(.*\\)" "gimple" } } */ + +/* Make sure the calls are resolved correctly. */ +/* { dg-final { scan-tree-dump-times "foo<int> \\(42\\)" 1 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "foo\\.ompvariant.<int> \\(42\\)" 1 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "bar<int> \\(3\\)" 0 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "bar\\.ompvariant.<int> \\(3\\)" 2 "gimple" } } */ + +/* The variants must have internal linkage, not .globl or .weak. */ +/* { dg-final { scan-assembler-not "\\.globl\[ \t\]*_?_Z15foo.ompvariant" } } */ +/* { dg-final { scan-assembler-not "\\.globl\[ \t\]*_?_Z15bar.ompvariant" } } */ +/* { dg-final { scan-assembler-not "\\.weak\[ \t\]*_?_Z15foo.ompvariant" } } */ +/* { dg-final { scan-assembler-not "\\.weak\[ \t\]*_?_Z15bar.ompvariant" } } */ + + + + diff --git a/gcc/testsuite/g++.dg/gomp/delim-declare-variant-7.C b/gcc/testsuite/g++.dg/gomp/delim-declare-variant-7.C new file mode 100644 index 0000000..b24e6c0 --- /dev/null +++ b/gcc/testsuite/g++.dg/gomp/delim-declare-variant-7.C @@ -0,0 +1,57 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-fdump-tree-gimple" } */ + +/* Check that "omp begin declare variant" works on methods in a template + class declaration. */ + +template <typename T> +class test1 { + + private: + T n; + static T m; + + public: + + void set_n (T x) { n = x; } + T get_n (void) { return n; } + + static void set_m (T x) { m = x; } + static T get_m (void) { return m; } + + #pragma omp begin declare variant match (implementation={vendor("gnu")}) + T get_n (void) { return n * 2; } + static T get_m (void) { return m * 2; } + #pragma omp end declare variant + + #pragma omp begin declare variant match (construct={target}) + T get_n (void) { return this->n * 2; } + #pragma omp end declare variant +}; + +template <typename T> +T test1<T>::m; + +int main (void) +{ + test1<int> t1; + t1.set_n (10); + if (t1.get_n () != 20) __builtin_abort (); + test1<int>::set_m (1); + if (test1<int>::get_m () != 2) __builtin_abort (); +} + +/* Make sure the "declare variant" replacement happens. */ +/* { dg-final { scan-tree-dump "test1<int>::get_n\\.ompvariant. \\(&t1\\)" "gimple" } } */ +/* { dg-final { scan-tree-dump "test1<int>::get_m\\.ompvariant. \\(\\)" "gimple" } } */ + +/* Make sure the variant methods are instantiated. */ +/* { dg-final { scan-tree-dump "int test1<int>::get_n\\.ompvariant. \\(.*\\)" "gimple" } } */ +/* { dg-final { scan-tree-dump "int test1<int>::get_m\\.ompvariant. \\(.*\\)" "gimple" } } */ + +/* The variants must have internal linkage, not .globl or .weak. */ +/* { dg-final { scan-assembler-not "\\.globl\[ \t\]*_?_ZN5test1IiE17get_n.ompvariant" } } */ +/* { dg-final { scan-assembler-not "\\.globl\[ \t\]*_?_ZN5test1IiE17get_m.ompvariant" } } */ +/* { dg-final { scan-assembler-not "\\.weak\[ \t\]*_?_ZN5test1IiE17get_n.ompvariant" } } */ +/* { dg-final { scan-assembler-not "\\.weak\[ \t\]*_?_ZN5test1IiE17get_m.ompvariant" } } */ + diff --git a/gcc/testsuite/g++.dg/gomp/delim-declare-variant-70.C b/gcc/testsuite/g++.dg/gomp/delim-declare-variant-70.C new file mode 100644 index 0000000..ed1e1ae --- /dev/null +++ b/gcc/testsuite/g++.dg/gomp/delim-declare-variant-70.C @@ -0,0 +1,206 @@ +/* { dg-do compile { target c++11 } } */ + +/* Check that the substituted type in variant is the same as the one in the + base. */ + +template<typename T, typename U> +struct is_same { + static constexpr bool value = false; +}; + +template<typename T> +struct is_same<T, T> { + static constexpr bool value = true; +}; + +/* Using static_assert directly in a variant triggers the SCOPE_REF bug noted + in delim-declare-variant-41.C. We'll avoid that by outsourcing the checks + to this function. PR118791 is a different bug that affects also the + non-delimited form of "declare variant". */ +template<typename T, typename U> +void fail_if_not_same() { + static_assert(is_same<T, U>::value); // { dg-bogus "static assertion failed" "PR118791" { xfail *-*-* } } +} + +/* Sanity checks are included in the base function just to be absolutely + certain there were no mistakes made in the tests. They should match the + cases in the variant function exactly. */ + +template<typename T> +void fwdref_passed_lvalue_int (T&& p) { + static_assert(is_same<T, int&>::value); + static_assert(is_same<decltype(p), int&>::value); + static_assert(is_same<decltype((p)), int&>::value); +} +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +template<typename T> +void fwdref_passed_lvalue_int (T&& p) { + fail_if_not_same<T, int&>(); + fail_if_not_same<decltype(p), int&>(); + fail_if_not_same<decltype((p)), int&>(); +} +#pragma omp end declare variant + +template<typename T> +void fwdref_passed_lvalue_const_int (T&& p) { + static_assert(is_same<T, int const&>::value); + static_assert(is_same<decltype(p), int const&>::value); + static_assert(is_same<decltype((p)), int const&>::value); +} +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +template<typename T> +void fwdref_passed_lvalue_const_int (T&& p) { + fail_if_not_same<T, int const&>(); + fail_if_not_same<decltype(p), int const&>(); + fail_if_not_same<decltype((p)), int const&>(); +} +#pragma omp end declare variant + +template<typename T> +void fwdref_passed_rvalue_int (T&& p) { + static_assert(is_same<T, int>::value); + static_assert(is_same<decltype(p), int&&>::value); + static_assert(is_same<decltype((p)), int&>::value); +} +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +template<typename T> +void fwdref_passed_rvalue_int (T&& p) { + fail_if_not_same<T, int>(); + fail_if_not_same<decltype(p), int&&>(); + fail_if_not_same<decltype((p)), int&>(); +} +#pragma omp end declare variant + +template<typename T> +void fwdref_passed_rvalue_const_int (T&& p) { + static_assert(is_same<T, int const>::value); + static_assert(is_same<decltype(p), int const&&>::value); + static_assert(is_same<decltype((p)), int const&>::value); +} +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +template<typename T> +void fwdref_passed_rvalue_const_int (T&& p) { + fail_if_not_same<T, int const>(); + fail_if_not_same<decltype(p), int const&&>(); + fail_if_not_same<decltype((p)), int const&>(); +} +#pragma omp end declare variant + +void instantiate_fwdref() +{ + int lvalue = 0; + fwdref_passed_lvalue_int(lvalue); + fwdref_passed_lvalue_const_int(static_cast<int const&>(lvalue)); + fwdref_passed_rvalue_int(0); + fwdref_passed_rvalue_const_int(static_cast<int const&&>(0)); +} + + + +template<typename T> +void explicit_instantiate_fwdref_with_lvalue_int (T&& p) { + static_assert(is_same<T, int&>::value); + static_assert(is_same<decltype(p), int&>::value); + static_assert(is_same<decltype((p)), int&>::value); +} +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +template<typename T> +void explicit_instantiate_fwdref_with_lvalue_int (T&& p) { + fail_if_not_same<T, int&>(); + fail_if_not_same<decltype(p), int&>(); + fail_if_not_same<decltype((p)), int&>(); +} +#pragma omp end declare variant + +template<typename T> +void explicit_instantiate_fwdref_with_lvalue_const_int (T&& p) { + static_assert(is_same<T, int const&>::value); + static_assert(is_same<decltype(p), int const&>::value); + static_assert(is_same<decltype((p)), int const&>::value); +} +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +template<typename T> +void explicit_instantiate_fwdref_with_lvalue_const_int (T&& p) { + fail_if_not_same<T, int const&>(); + fail_if_not_same<decltype(p), int const&>(); + fail_if_not_same<decltype((p)), int const&>(); +} +#pragma omp end declare variant + +template<typename T> +void explicit_instantiate_fwdref_with_rvalue_int (T&& p) { + static_assert(is_same<T, int&&>::value); + static_assert(is_same<decltype(p), int&&>::value); + static_assert(is_same<decltype((p)), int&>::value); +} +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +template<typename T> +void explicit_instantiate_fwdref_with_rvalue_int (T&& p) { + fail_if_not_same<T, int&&>(); + fail_if_not_same<decltype(p), int&&>(); + fail_if_not_same<decltype((p)), int&>(); +} +#pragma omp end declare variant + +template<typename T> +void explicit_instantiate_fwdref_with_rvalue_const_int (T&& p) { + static_assert(is_same<T, int const&&>::value); + static_assert(is_same<decltype(p), int const&&>::value); + static_assert(is_same<decltype((p)), int const&>::value); +} +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +template<typename T> +void explicit_instantiate_fwdref_with_rvalue_const_int (T&& p) { + fail_if_not_same<T, int const&&>(); + fail_if_not_same<decltype(p), int const&&>(); + fail_if_not_same<decltype((p)), int const&>(); +} +#pragma omp end declare variant + +/* Technically a missuse of a forwarding reference */ +void explicit_instantiate_fwdref() +{ + int lvalue = 0; + explicit_instantiate_fwdref_with_lvalue_int<int&>(lvalue); + explicit_instantiate_fwdref_with_lvalue_const_int<int const&>(static_cast<int const&>(lvalue)); + explicit_instantiate_fwdref_with_rvalue_int<int&&>(0); // { dg-bogus "required from here" "PR118791" { xfail *-*-* } } + explicit_instantiate_fwdref_with_rvalue_const_int<int const&&>(static_cast<int const&&>(0)); // { dg-bogus "required from here" "PR118791" { xfail *-*-* } } +} + + +template<typename T> +void const_lref_passed_lvalue_int (T const& p) { + static_assert(is_same<T, int>::value); + static_assert(is_same<decltype(p), int const&>::value); + static_assert(is_same<decltype((p)), int const&>::value); +} +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +template<typename T> +void const_lref_passed_lvalue_int (T const& p) { + fail_if_not_same<T, int>(); + fail_if_not_same<decltype(p), int const&>(); + fail_if_not_same<decltype((p)), int const&>(); +} +#pragma omp end declare variant + +template<typename T> +void const_lref_passed_lvalue_const_int (T const& p) { + static_assert(is_same<T, int>::value); + static_assert(is_same<decltype(p), int const&>::value); + static_assert(is_same<decltype((p)), int const&>::value); +} +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +template<typename T> +void const_lref_passed_lvalue_const_int (T const& p) { + fail_if_not_same<T, int>(); + fail_if_not_same<decltype(p), int const&>(); + fail_if_not_same<decltype((p)), int const&>(); +} +#pragma omp end declare variant + +void instantiate_const_lref() +{ + int lvalue = 0; + const_lref_passed_lvalue_int(lvalue); + const_lref_passed_lvalue_const_int(static_cast<int const&>(lvalue)); +} diff --git a/gcc/testsuite/g++.dg/gomp/delim-declare-variant-71.C b/gcc/testsuite/g++.dg/gomp/delim-declare-variant-71.C new file mode 100644 index 0000000..87ec966 --- /dev/null +++ b/gcc/testsuite/g++.dg/gomp/delim-declare-variant-71.C @@ -0,0 +1,157 @@ +/* { dg-do compile { target c++11 } } */ + +/* Test static_assert in variants. */ +/* Most of the tests in this file are broken and xfailed. + See also delim-declare-variant-41.C for a simpler test case for + the "base function cannot be resolved" sorry. */ + +struct has_value_true { static constexpr bool value = true; }; + +template<typename T> +struct always_true { + static constexpr bool value = true; +}; + +template<typename T> +void static_assert_in_variant_static_member_uninstantiated (T) { } +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +template<typename T> +void static_assert_in_variant_static_member_uninstantiated (T) +{ + static_assert(T::value); +} +#pragma omp end declare variant + +template<typename T> +void static_assert_in_variant_static_member_no_param_uninstantiated () { } +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +template<typename T> +void static_assert_in_variant_static_member_no_param_uninstantiated () +{ + static_assert(T::value); +} +#pragma omp end declare variant + +template<typename T> +void static_assert_in_variant_static_member (T) { } +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +template<typename T> +void static_assert_in_variant_static_member (T) +{ + static_assert(T::value); +} +#pragma omp end declare variant + +template<typename T> +void static_assert_in_variant_static_member_no_param () { } // { dg-bogus "no matching function for call" "" { xfail *-*-* } } +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +template<typename T> +void static_assert_in_variant_static_member_no_param () +{ + static_assert(T::value); +} +#pragma omp end declare variant + +void instantiate_static_assert_in_variant_static_member() +{ + static_assert_in_variant_static_member(has_value_true{}); + static_assert_in_variant_static_member_no_param<has_value_true>(); +} + + +template<typename T> +void static_assert_in_variant_templ_member_uninstantiated (T) { } +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +template<typename T> +void static_assert_in_variant_templ_member_uninstantiated (T) +{ + static_assert(always_true<T>::value); +} +#pragma omp end declare variant + +template<typename T> +void static_assert_in_variant_templ_member_no_param_uninstantiated () { } +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +template<typename T> +void static_assert_in_variant_templ_member_no_param_uninstantiated () +{ + static_assert(always_true<T>::value); +} +#pragma omp end declare variant + +template<typename T> +void static_assert_in_variant_templ_member (T) { } +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +template<typename T> +void static_assert_in_variant_templ_member (T) +{ + static_assert(always_true<T>::value); +} +#pragma omp end declare variant + +template<typename T> +void static_assert_in_variant_templ_member_no_param () { } // { dg-bogus "no matching function for call" "" { xfail *-*-* } } +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +template<typename T> +void static_assert_in_variant_templ_member_no_param () +{ + static_assert(always_true<T>::value); +} +#pragma omp end declare variant + +void instantiate_static_assert_in_variant_templ_member() +{ + static_assert_in_variant_templ_member(0); + static_assert_in_variant_templ_member_no_param<int>(); +} + + +/* PR118530 affects also the non-delimited form of "declare variant". */ +template<bool B> +void static_assert_in_variant_nttp_uninstantiated () { } +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +template<bool B> +void static_assert_in_variant_nttp_uninstantiated () { + static_assert(B); +} +#pragma omp end declare variant + +template<bool B> +void static_assert_in_variant_nttp () { } // { dg-bogus "no matching function for call" "PR118530" { xfail *-*-* } } +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +template<bool B> +void static_assert_in_variant_nttp () { + static_assert(B); +} +#pragma omp end declare variant + +void instantiate_static_assert_in_variant_nttp() +{ + static_assert_in_variant_nttp<true>(); +} + + +template<template<typename> class Templ> +void static_assert_in_variant_template_template_uninstantiated () { } +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +template<template<typename> class Templ> +void static_assert_in_variant_template_template_uninstantiated () +{ + static_assert(Templ<void>::value); +} +#pragma omp end declare variant + +template<template<typename> class Templ> +void static_assert_in_variant_template_template () { } // { dg-bogus "no matching function for call" "" { xfail *-*-* } } +#pragma omp begin declare variant match (implementation={vendor("gnu")}) +template<template<typename> class Templ> +void static_assert_in_variant_template_template () +{ + static_assert(Templ<void>::value); +} +#pragma omp end declare variant + +void instantiate_static_assert_in_variant_template_template() +{ + static_assert_in_variant_template_template<always_true>(); +} diff --git a/gcc/testsuite/g++.dg/gomp/depend-1.C b/gcc/testsuite/g++.dg/gomp/depend-1.C index 81ae27f..b432b21 100644 --- a/gcc/testsuite/g++.dg/gomp/depend-1.C +++ b/gcc/testsuite/g++.dg/gomp/depend-1.C @@ -17,53 +17,53 @@ foo (int g[3][10], int h[4][8], int i[2][10], int j[][9], { #pragma omp task depend(out: t[2:5]) ; - #pragma omp task depend(inout: k[0.5:]) // { dg-error "low bound \[^\n\r]* of array section does not have integral type" } + #pragma omp task depend(inout: k[0.5: ]) // { dg-error "low bound \[^\n\r]* of array section does not have integral type" } ; - #pragma omp task depend(in: l[:7.5f]) // { dg-error "length \[^\n\r]* of array section does not have integral type" } + #pragma omp task depend(in: l[ :7.5f]) // { dg-error "length \[^\n\r]* of array section does not have integral type" } ; - #pragma omp task depend(out: m[p:]) // { dg-error "low bound \[^\n\r]* of array section does not have integral type" } + #pragma omp task depend(out: m[p: ]) // { dg-error "low bound \[^\n\r]* of array section does not have integral type" } ; - #pragma omp task depend(inout: n[:p]) // { dg-error "length \[^\n\r]* of array section does not have integral type" } + #pragma omp task depend(inout: n[ :p]) // { dg-error "length \[^\n\r]* of array section does not have integral type" } ; #pragma omp task depend(in: o[2:5]) // { dg-error "does not have pointer or array type" } ; - #pragma omp task depend(out: a[:][2:4]) // { dg-error "array type length expression must be specified" } + #pragma omp task depend(out: a[ : ][2:4]) // { dg-error "array type length expression must be specified" } ; - #pragma omp task depend(in: d[11:]) // { dg-error "low bound \[^\n\r]* above array section size" } + #pragma omp task depend(in: d[11: ]) // { dg-error "low bound \[^\n\r]* above array section size" } ; - #pragma omp task depend(out: e[:11]) // { dg-error "length \[^\n\r]* above array section size" } + #pragma omp task depend(out: e[ :11]) // { dg-error "length \[^\n\r]* above array section size" } ; #pragma omp task depend(out: f[1:10]) // { dg-error "high bound \[^\n\r]* above array section size" } ; - #pragma omp task depend(in: g[:][2:4]) // { dg-error "for array function parameter length expression must be specified" } + #pragma omp task depend(in: g[ : ][2:4]) // { dg-error "for array function parameter length expression must be specified" } ; - #pragma omp task depend(out: i[:1][11:]) // { dg-error "low bound \[^\n\r]* above array section size" } + #pragma omp task depend(out: i[ :1][11: ]) // { dg-error "low bound \[^\n\r]* above array section size" } ; - #pragma omp task depend(in: j[3:4][:10]) // { dg-error "length \[^\n\r]* above array section size" } + #pragma omp task depend(in: j[3:4][ :10]) // { dg-error "length \[^\n\r]* above array section size" } ; #pragma omp task depend(out: j[30:10][5:5]) // { dg-error "high bound \[^\n\r]* above array section size" } ; - #pragma omp task depend(out: a2[:3][2:4]) + #pragma omp task depend(out: a2[ :3][2:4]) ; - #pragma omp task depend(inout: b2[0:]) + #pragma omp task depend(inout: b2[0: ]) ; - #pragma omp task depend(inout: c2[:3][1:1]) + #pragma omp task depend(inout: c2[ :3][1:1]) ; - #pragma omp task depend(in: d2[9:]) + #pragma omp task depend(in: d2[9: ]) ; - #pragma omp task depend(out: e2[:10]) + #pragma omp task depend(out: e2[ :10]) ; #pragma omp task depend(out: f2[1:9]) ; - #pragma omp task depend(in: g2[:2][2:4]) + #pragma omp task depend(in: g2[ :2][2:4]) ; - #pragma omp task depend(in: h2[2:2][0:]) + #pragma omp task depend(in: h2[2:2][0: ]) ; - #pragma omp task depend(inout: h2[:1][:3]) + #pragma omp task depend(inout: h2[ :1][ :3]) ; - #pragma omp task depend(out: i2[:1][9:]) + #pragma omp task depend(out: i2[ :1][9: ]) ; - #pragma omp task depend(in: j2[3:4][:9]) + #pragma omp task depend(in: j2[3:4][ :9]) ; #pragma omp task depend(out: j2[30:10][5:4]) ; diff --git a/gcc/testsuite/g++.dg/gomp/depend-2.C b/gcc/testsuite/g++.dg/gomp/depend-2.C index f0f9f60..ecc2e0c 100644 --- a/gcc/testsuite/g++.dg/gomp/depend-2.C +++ b/gcc/testsuite/g++.dg/gomp/depend-2.C @@ -19,61 +19,61 @@ foo (int g[3][10], int h[4][8], int i[2][10], int j[][9], ; #pragma omp task depend(out: t[2:5]) ; - #pragma omp task depend(inout: k[0.5:]) // { dg-error "low bound \[^\n\r]* of array section does not have integral type" } + #pragma omp task depend(inout: k[0.5: ]) // { dg-error "low bound \[^\n\r]* of array section does not have integral type" } ; - #pragma omp task depend(in: l[:7.5f]) // { dg-error "length \[^\n\r]* of array section does not have integral type" } + #pragma omp task depend(in: l[ :7.5f]) // { dg-error "length \[^\n\r]* of array section does not have integral type" } ; - #pragma omp task depend(out: m[p:]) // { dg-error "low bound \[^\n\r]* of array section does not have integral type" } + #pragma omp task depend(out: m[p: ]) // { dg-error "low bound \[^\n\r]* of array section does not have integral type" } ; - #pragma omp task depend(inout: n[:p]) // { dg-error "length \[^\n\r]* of array section does not have integral type" } + #pragma omp task depend(inout: n[ :p]) // { dg-error "length \[^\n\r]* of array section does not have integral type" } ; #pragma omp task depend(in: o[2:5]) // { dg-error "does not have pointer or array type" } ; - #pragma omp task depend(out: a[:][2:4]) // { dg-error "array type length expression must be specified" } + #pragma omp task depend(out: a[ : ][2:4]) // { dg-error "array type length expression must be specified" } ; - #pragma omp task depend(inout: b[-1:]) // { dg-error "negative low bound in array section" } + #pragma omp task depend(inout: b[-1: ]) // { dg-error "negative low bound in array section" } ; - #pragma omp task depend(inout: c[:-3][1:1]) // { dg-error "negative length in array section" } + #pragma omp task depend(inout: c[ :-3][1:1]) // { dg-error "negative length in array section" } ; - #pragma omp task depend(in: d[11:]) // { dg-error "low bound \[^\n\r]* above array section size" } + #pragma omp task depend(in: d[11: ]) // { dg-error "low bound \[^\n\r]* above array section size" } ; - #pragma omp task depend(out: e[:11]) // { dg-error "length \[^\n\r]* above array section size" } + #pragma omp task depend(out: e[ :11]) // { dg-error "length \[^\n\r]* above array section size" } ; #pragma omp task depend(out: f[1:10]) // { dg-error "high bound \[^\n\r]* above array section size" } ; - #pragma omp task depend(in: g[:][2:4]) // { dg-error "for array function parameter length expression must be specified" } + #pragma omp task depend(in: g[ : ][2:4]) // { dg-error "for array function parameter length expression must be specified" } ; - #pragma omp task depend(in: h[2:2][-1:]) // { dg-error "negative low bound in array section" } + #pragma omp task depend(in: h[2:2][-1: ]) // { dg-error "negative low bound in array section" } ; - #pragma omp task depend(inout: h[:1][:-3]) // { dg-error "negative length in array section" } + #pragma omp task depend(inout: h[ :1][ :-3]) // { dg-error "negative length in array section" } ; - #pragma omp task depend(out: i[:1][11:]) // { dg-error "low bound \[^\n\r]* above array section size" } + #pragma omp task depend(out: i[ :1][11: ]) // { dg-error "low bound \[^\n\r]* above array section size" } ; - #pragma omp task depend(in: j[3:4][:10]) // { dg-error "length \[^\n\r]* above array section size" } + #pragma omp task depend(in: j[3:4][ :10]) // { dg-error "length \[^\n\r]* above array section size" } ; #pragma omp task depend(out: j[30:10][5:5]) // { dg-error "high bound \[^\n\r]* above array section size" } ; - #pragma omp task depend(out: a2[:3][2:4]) + #pragma omp task depend(out: a2[ :3][2:4]) ; - #pragma omp task depend(inout: b2[0:]) + #pragma omp task depend(inout: b2[0: ]) ; - #pragma omp task depend(inout: c2[:3][1:1]) + #pragma omp task depend(inout: c2[ :3][1:1]) ; - #pragma omp task depend(in: d2[9:]) + #pragma omp task depend(in: d2[9: ]) ; - #pragma omp task depend(out: e2[:10]) + #pragma omp task depend(out: e2[ :10]) ; #pragma omp task depend(out: f2[1:9]) ; - #pragma omp task depend(in: g2[:2][2:4]) + #pragma omp task depend(in: g2[ :2][2:4]) ; - #pragma omp task depend(in: h2[2:2][0:]) + #pragma omp task depend(in: h2[2:2][0: ]) ; - #pragma omp task depend(inout: h2[:1][:3]) + #pragma omp task depend(inout: h2[ :1][ :3]) ; - #pragma omp task depend(out: i2[:1][9:]) + #pragma omp task depend(out: i2[ :1][9: ]) ; - #pragma omp task depend(in: j2[3:4][:9]) + #pragma omp task depend(in: j2[3:4][ :9]) ; #pragma omp task depend(out: j2[30:10][5:4]) ; diff --git a/gcc/testsuite/g++.dg/gomp/ind-base-3.C b/gcc/testsuite/g++.dg/gomp/ind-base-3.C index e3ecddd..69285fc 100644 --- a/gcc/testsuite/g++.dg/gomp/ind-base-3.C +++ b/gcc/testsuite/g++.dg/gomp/ind-base-3.C @@ -24,7 +24,7 @@ int main (int argc, char *argv[]) for (int i = 0; i < 10; i++) { -#pragma omp target map(choose(&a, &b, i)->x[:10]) +#pragma omp target map(choose(&a, &b, i)->x[ :10]) /* { dg-message {sorry, unimplemented: unsupported map expression 'choose\(\(& a\), \(& b\), i\)->S::x\[0\]'} "" { target *-*-* } .-1 } */ for (int j = 0; j < 10; j++) choose (&a, &b, i)->x[j]++; diff --git a/gcc/testsuite/g++.dg/gomp/map-1.C b/gcc/testsuite/g++.dg/gomp/map-1.C index 27dc7a5..4416ce9 100644 --- a/gcc/testsuite/g++.dg/gomp/map-1.C +++ b/gcc/testsuite/g++.dg/gomp/map-1.C @@ -28,13 +28,13 @@ foo (int g[3][10], int h[4][8], int i[2][10], int j[][9], ; #pragma omp target map(from: t[2:5]) /* { dg-error "is threadprivate variable" } */ ; - #pragma omp target map(tofrom: k[0.5:]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */ + #pragma omp target map(tofrom: k[0.5: ]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */ ; - #pragma omp target map(from: l[:7.5f]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */ + #pragma omp target map(from: l[ :7.5f]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */ ; - #pragma omp target map(to: m[p:]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */ + #pragma omp target map(to: m[p: ]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */ ; - #pragma omp target map(tofrom: n[:p]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */ + #pragma omp target map(tofrom: n[ :p]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */ ; #pragma omp target map(to: o[2:5]) /* { dg-error "does not have pointer or array type" } */ ; @@ -42,73 +42,73 @@ foo (int g[3][10], int h[4][8], int i[2][10], int j[][9], ; #pragma omp target map(alloc: s2) /* { dg-error "'s2' does not have a mappable type in 'map' clause" } */ ; - #pragma omp target map(to: a[:][:]) /* { dg-error "array type length expression must be specified" } */ + #pragma omp target map(to: a[ : ][ : ]) /* { dg-error "array type length expression must be specified" } */ bar (&a[0][0]); /* { dg-error "referenced in target region does not have a mappable type" "PR97996" { xfail *-*-* } } */ - #pragma omp target map(tofrom: b[-1:]) /* { dg-error "negative low bound in array section" } */ + #pragma omp target map(tofrom: b[-1: ]) /* { dg-error "negative low bound in array section" } */ bar (b); - #pragma omp target map(tofrom: c[:-3][:]) /* { dg-error "negative length in array section" } */ + #pragma omp target map(tofrom: c[ :-3][ : ]) /* { dg-error "negative length in array section" } */ bar (&c[0][0]); - #pragma omp target map(from: d[11:]) /* { dg-error "low bound \[^\n\r]* above array section size" } */ + #pragma omp target map(from: d[11: ]) /* { dg-error "low bound \[^\n\r]* above array section size" } */ bar (d); - #pragma omp target map(to: e[:11]) /* { dg-error "length \[^\n\r]* above array section size" } */ + #pragma omp target map(to: e[ :11]) /* { dg-error "length \[^\n\r]* above array section size" } */ bar (e); #pragma omp target map(to: f[1:10]) /* { dg-error "high bound \[^\n\r]* above array section size" } */ bar (f); - #pragma omp target map(from: g[:][0:10]) /* { dg-error "for array function parameter length expression must be specified" } */ + #pragma omp target map(from: g[ : ][0:10]) /* { dg-error "for array function parameter length expression must be specified" } */ bar (&g[0][0]); - #pragma omp target map(from: h[2:1][-1:]) /* { dg-error "negative low bound in array section" } */ + #pragma omp target map(from: h[2:1][-1: ]) /* { dg-error "negative low bound in array section" } */ bar (&h[0][0]); - #pragma omp target map(tofrom: h[:1][:-3]) /* { dg-error "negative length in array section" } */ + #pragma omp target map(tofrom: h[ :1][ :-3]) /* { dg-error "negative length in array section" } */ bar (&h[0][0]); - #pragma omp target map(i[:1][11:]) /* { dg-error "low bound \[^\n\r]* above array section size" } */ + #pragma omp target map(i[ :1][11: ]) /* { dg-error "low bound \[^\n\r]* above array section size" } */ bar (&i[0][0]); - #pragma omp target map(from: j[3:1][:10]) /* { dg-error "length \[^\n\r]* above array section size" } */ + #pragma omp target map(from: j[3:1][ :10]) /* { dg-error "length \[^\n\r]* above array section size" } */ bar (&j[0][0]); #pragma omp target map(to: j[30:1][5:5]) /* { dg-error "high bound \[^\n\r]* above array section size" } */ bar (&j[0][0]); - #pragma omp target map(to: a2[:1][2:4]) + #pragma omp target map(to: a2[ :1][2:4]) bar (&a2[0][0]); - #pragma omp target map(a2[3:5][:]) + #pragma omp target map(a2[3:5][ : ]) bar (&a2[0][0]); - #pragma omp target map(to: a2[3:5][:10]) + #pragma omp target map(to: a2[3:5][ :10]) bar (&a2[0][0]); - #pragma omp target map(tofrom: b2[0:]) + #pragma omp target map(tofrom: b2[0: ]) bar (b2); - #pragma omp target map(tofrom: c2[:3][:]) + #pragma omp target map(tofrom: c2[ :3][ : ]) bar (&c2[0][0]); - #pragma omp target map(from: d2[9:]) + #pragma omp target map(from: d2[9: ]) bar (d2); - #pragma omp target map(to: e2[:10]) + #pragma omp target map(to: e2[ :10]) bar (e2); #pragma omp target map(to: f2[1:9]) bar (f2); - #pragma omp target map(g2[:1][2:4]) + #pragma omp target map(g2[ :1][2:4]) bar (&g2[0][0]); - #pragma omp target map(from: h2[2:2][0:]) + #pragma omp target map(from: h2[2:2][0: ]) bar (&h2[0][0]); - #pragma omp target map(tofrom: h2[:1][:3]) + #pragma omp target map(tofrom: h2[ :1][ :3]) bar (&h2[0][0]); - #pragma omp target map(to: i2[:1][9:]) + #pragma omp target map(to: i2[ :1][9: ]) bar (&i2[0][0]); - #pragma omp target map(from: j2[3:4][:9]) + #pragma omp target map(from: j2[3:4][ :9]) bar (&j2[0][0]); #pragma omp target map(to: j2[30:1][5:4]) bar (&j2[0][0]); #pragma omp target map(q[1:2]) ; - #pragma omp target map(tofrom: q[3:5][:10]) /* { dg-error "array section is not contiguous" } */ + #pragma omp target map(tofrom: q[3:5][ :10]) /* { dg-error "array section is not contiguous" } */ ; - #pragma omp target map(r[3:][2:1][1:2]) + #pragma omp target map(r[3: ][2:1][1:2]) ; - #pragma omp target map(r[3:][2:1][1:2][:][0:4]) + #pragma omp target map(r[3: ][2:1][1:2][ : ][0:4]) ; - #pragma omp target map(r[3:][2:1][1:2][1:][0:4]) /* { dg-error "array section is not contiguous" } */ + #pragma omp target map(r[3: ][2:1][1:2][1: ][0:4]) /* { dg-error "array section is not contiguous" } */ ; - #pragma omp target map(r[3:][2:1][1:2][:3][0:4]) /* { dg-error "array section is not contiguous" } */ + #pragma omp target map(r[3: ][2:1][1:2][ :3][0:4]) /* { dg-error "array section is not contiguous" } */ ; - #pragma omp target map(r[3:][2:1][1:2][:][1:]) /* { dg-error "array section is not contiguous" } */ + #pragma omp target map(r[3: ][2:1][1:2][ : ][1: ]) /* { dg-error "array section is not contiguous" } */ ; - #pragma omp target map(r[3:][2:1][1:2][:][:3]) /* { dg-error "array section is not contiguous" } */ + #pragma omp target map(r[3: ][2:1][1:2][ : ][ :3]) /* { dg-error "array section is not contiguous" } */ ; } diff --git a/gcc/testsuite/g++.dg/gomp/map-2.C b/gcc/testsuite/g++.dg/gomp/map-2.C index bbe2606..474402d 100644 --- a/gcc/testsuite/g++.dg/gomp/map-2.C +++ b/gcc/testsuite/g++.dg/gomp/map-2.C @@ -17,25 +17,25 @@ foo (int *p, int (*q)[10], int r[10], int s[10][10]) ; #pragma omp target map (tofrom: r[-1:2]) ; - #pragma omp target map (tofrom: s[-1:2][:]) + #pragma omp target map (tofrom: s[-1:2][ : ]) ; #pragma omp target map (tofrom: s[-1:2][-2:10]) /* { dg-error "negative low bound in array section in" } */ ; #pragma omp target map (tofrom: a[-1:2]) /* { dg-error "negative low bound in array section in" } */ ; - #pragma omp target map (tofrom: b[-1:2][0:]) /* { dg-error "negative low bound in array section in" } */ + #pragma omp target map (tofrom: b[-1:2][0: ]) /* { dg-error "negative low bound in array section in" } */ ; #pragma omp target map (tofrom: b[1:2][-2:10]) /* { dg-error "negative low bound in array section in" } */ ; #pragma omp target map (tofrom: p[2:-3]) /* { dg-error "negative length in array section in" } */ ; - #pragma omp target map (tofrom: q[2:-3][:]) /* { dg-error "negative length in array section in" } */ + #pragma omp target map (tofrom: q[2:-3][ : ]) /* { dg-error "negative length in array section in" } */ ; #pragma omp target map (tofrom: q[2:3][0:-1]) /* { dg-error "negative length in array section in" } */ ; #pragma omp target map (tofrom: r[2:-5]) /* { dg-error "negative length in array section in" } */ ; - #pragma omp target map (tofrom: s[2:-5][:]) /* { dg-error "negative length in array section in" } */ + #pragma omp target map (tofrom: s[2:-5][ : ]) /* { dg-error "negative length in array section in" } */ ; #pragma omp target map (tofrom: s[2:5][0:-4]) /* { dg-error "negative length in array section in" } */ ; diff --git a/gcc/testsuite/g++.dg/gomp/map-ptrmem-1.C b/gcc/testsuite/g++.dg/gomp/map-ptrmem-1.C index 110996b..f0545bc 100644 --- a/gcc/testsuite/g++.dg/gomp/map-ptrmem-1.C +++ b/gcc/testsuite/g++.dg/gomp/map-ptrmem-1.C @@ -20,7 +20,7 @@ main (int argc, char *argv[]) for (int i = 0; i < 64; i++) (s.*ptrp)[i] = i; -#pragma omp target map(s.*xp, s.*ptrp, (s.*ptrp)[:64]) +#pragma omp target map(s.*xp, s.*ptrp, (s.*ptrp)[ :64]) /* { dg-message {sorry, unimplemented: pointer-to-member mapping '\*\(\*\(\(\(int\*\*\)\(& s\)\) \+ \(\(sizetype\)ptrp\)\)\)' not supported} "" { target *-*-* } .-1 } */ /* { dg-message {sorry, unimplemented: pointer-to-member mapping '\*\(\(\(int\*\*\)\(& s\)\) \+ \(\(sizetype\)ptrp\)\)' not supported} "" { target *-*-* } .-2 } */ /* { dg-message {sorry, unimplemented: pointer-to-member mapping '\*\(\(\(int\*\)\(& s\)\) \+ \(\(sizetype\)xp\)\)' not supported} "" { target *-*-* } .-3 } */ diff --git a/gcc/testsuite/g++.dg/gomp/map-ptrmem-2.C b/gcc/testsuite/g++.dg/gomp/map-ptrmem-2.C index 644e5bb..96aab67 100644 --- a/gcc/testsuite/g++.dg/gomp/map-ptrmem-2.C +++ b/gcc/testsuite/g++.dg/gomp/map-ptrmem-2.C @@ -20,7 +20,7 @@ main (int argc, char *argv[]) for (int i = 0; i < 64; i++) (s->*ptrp)[i] = i; -#pragma omp target map(s->*xp, s->*ptrp, (s->*ptrp)[:64]) +#pragma omp target map(s->*xp, s->*ptrp, (s->*ptrp)[ :64]) /* { dg-message {sorry, unimplemented: pointer-to-member mapping '\*\(\(\(int\*\*\)s\) \+ \(\(sizetype\)ptrp\)\)' not supported} "" { target *-*-* } .-1 } */ /* { dg-message {sorry, unimplemented: pointer-to-member mapping '\*\(\(\(int\*\)s\) \+ \(\(sizetype\)xp\)\)' not supported} "" { target *-*-* } .-2 } */ /* { dg-message {sorry, unimplemented: pointer-to-member mapping '\*\(\*\(\(\(int\*\*\)s\) \+ \(\(sizetype\)ptrp\)\)\)' not supported} "" { target *-*-* } .-3 } */ diff --git a/gcc/testsuite/g++.dg/gomp/member-array-2.C b/gcc/testsuite/g++.dg/gomp/member-array-2.C index a4e3a22..4958634 100644 --- a/gcc/testsuite/g++.dg/gomp/member-array-2.C +++ b/gcc/testsuite/g++.dg/gomp/member-array-2.C @@ -40,7 +40,7 @@ C::zero () void C::do_operation () { -#pragma omp target map(arr, ptr, ptr[:100]) +#pragma omp target map(arr, ptr, ptr[ :100]) #pragma omp teams distribute parallel for for (int i = 0; i < 100; i++) { @@ -70,7 +70,7 @@ main (int argc, char *argv[]) /* It might sort of make sense to be able to do this, but we don't support it for now. */ - #pragma omp target map(c.get_arr()[:100]) + #pragma omp target map(c.get_arr()[ :100]) /* { dg-message {sorry, unimplemented: unsupported map expression 'c\.C::get_arr\(\)\[0\]'} "" { target *-*-* } .-1 } */ #pragma omp teams distribute parallel for for (int i = 0; i < 100; i++) @@ -79,7 +79,7 @@ main (int argc, char *argv[]) c.check (5, 5); /* Same for this. */ - #pragma omp target map(c.get_ptr(), c.get_ptr()[:100]) + #pragma omp target map(c.get_ptr(), c.get_ptr()[ :100]) /* { dg-message {sorry, unimplemented: unsupported map expression 'c\.C::get_ptr\(\)'} "" { target *-*-* } .-1 } */ /* { dg-message {sorry, unimplemented: unsupported map expression '\* c\.C::get_ptr\(\)'} "" { target *-*-* } .-2 } */ #pragma omp teams distribute parallel for diff --git a/gcc/testsuite/g++.dg/gomp/target-this-3.C b/gcc/testsuite/g++.dg/gomp/target-this-3.C index f4996b1..c318fd1 100644 --- a/gcc/testsuite/g++.dg/gomp/target-this-3.C +++ b/gcc/testsuite/g++.dg/gomp/target-this-3.C @@ -73,7 +73,7 @@ int main (void) if (ptr2[i] != 0) abort (); - #pragma omp target data map(ptr1[:N]) + #pragma omp target data map(ptr1[ :N]) mapped = s.set_ptr (val); if (!mapped) @@ -86,7 +86,7 @@ int main (void) if (ptr1[i] != val) abort (); - #pragma omp target data map(ptr2[:N]) + #pragma omp target data map(ptr2[ :N]) mapped = s.set_refptr (val); if (!mapped) diff --git a/gcc/testsuite/g++.dg/gomp/target-this-4.C b/gcc/testsuite/g++.dg/gomp/target-this-4.C index bbcde3d..8c0ad9a 100644 --- a/gcc/testsuite/g++.dg/gomp/target-this-4.C +++ b/gcc/testsuite/g++.dg/gomp/target-this-4.C @@ -80,7 +80,7 @@ int main (void) if (ptr2[i] != 0) abort (); - #pragma omp target data map(ptr1[:N], ptr2[:N]) + #pragma omp target data map(ptr1[ :N], ptr2[ :N]) { if (!p1 ()) abort (); diff --git a/gcc/testsuite/g++.dg/guality/pr67192.C b/gcc/testsuite/g++.dg/guality/pr67192.C index c09ecf8..9c30dd7 100644 --- a/gcc/testsuite/g++.dg/guality/pr67192.C +++ b/gcc/testsuite/g++.dg/guality/pr67192.C @@ -1,6 +1,6 @@ /* PR debug/67192 */ /* { dg-do run } */ -/* { dg-options "-x c++ -g -Wmisleading-indentation" } */ +/* { dg-options "-x c++ -g -Wmisleading-indentation -std=gnu++17" } */ volatile int cnt = 0; diff --git a/gcc/testsuite/g++.dg/lookup/extern-c-redecl3.C b/gcc/testsuite/g++.dg/lookup/extern-c-redecl3.C index 56dcefa..c9c9bd5 100644 --- a/gcc/testsuite/g++.dg/lookup/extern-c-redecl3.C +++ b/gcc/testsuite/g++.dg/lookup/extern-c-redecl3.C @@ -5,17 +5,19 @@ // { dg-final { scan-assembler-not "call\[\t \]+\[^\$\]*?_Z4forkv" { target i?86-*-* x86_64-*-* } } } // { dg-final { scan-assembler "call\[\t \]+_?fork" { target i?86-*-* x86_64-*-* } } } -extern "C" int fork (void); +typedef __typeof (__builtin_fork ()) pid_t; + +extern "C" pid_t fork (void); void foo () { - extern int fork (void); + extern pid_t fork (void); fork (); } extern "C" -int +pid_t fork (void) { return 0; diff --git a/gcc/testsuite/g++.dg/lookup/koenig16.C b/gcc/testsuite/g++.dg/lookup/koenig16.C new file mode 100644 index 0000000..1d6e4e3 --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/koenig16.C @@ -0,0 +1,22 @@ +// Before P1787 (C++20), only hidden friends are included in ADL. +// After P1787, all friends are included. + +namespace N { + namespace NN { + struct A; + } + using NN::A; + void fn (A); + namespace NN { + struct A { + friend void N::fn (A); + }; + } + void fn (A) { } +} + +int main() +{ + N::A a; + fn(a); // { dg-error "not declared" "" { target c++17_down } } +} diff --git a/gcc/testsuite/g++.dg/lto/pr122905.h b/gcc/testsuite/g++.dg/lto/pr122905.h new file mode 100644 index 0000000..f345e18 --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/pr122905.h @@ -0,0 +1,9 @@ +struct A { + typedef char *B; + struct C { C (B x) {} }; + C c; + enum { D = 15 }; + union { char e[16]; }; + A (const char *x) : c {e} {} +}; +A foo (); diff --git a/gcc/testsuite/g++.dg/lto/pr122905_0.C b/gcc/testsuite/g++.dg/lto/pr122905_0.C new file mode 100644 index 0000000..6cde9bc --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/pr122905_0.C @@ -0,0 +1,16 @@ +/* PR c++/122905 */ +/* { dg-lto-do link } */ +/* { dg-lto-options { { -O2 -flto -std=c++20 } } } */ + +#include "pr122905.h" + +A +foo () +{ + return "foo"; +} + +int +main () +{ +} diff --git a/gcc/testsuite/g++.dg/lto/pr122905_1.C b/gcc/testsuite/g++.dg/lto/pr122905_1.C new file mode 100644 index 0000000..549c373 --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/pr122905_1.C @@ -0,0 +1,5 @@ +// { dg-options "-O2 -flto -std=c++17" } + +#include "pr122905.h" + +volatile auto v = foo (); diff --git a/gcc/testsuite/g++.dg/modules/adl-11_a.C b/gcc/testsuite/g++.dg/modules/adl-11_a.C new file mode 100644 index 0000000..063dd89 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/adl-11_a.C @@ -0,0 +1,21 @@ +// Before P1787 (C++20), only hidden friends are included in ADL. +// After P1787, all friends are included. + +// { dg-additional-options "-fmodules -Wno-global-module" } + +export module M; + +namespace N { + namespace NN { + export struct A; + } + export using NN::A; + + export void fn (A); + + namespace NN { + struct A { + friend void N::fn (A); + }; + } +} diff --git a/gcc/testsuite/g++.dg/modules/adl-11_b.C b/gcc/testsuite/g++.dg/modules/adl-11_b.C new file mode 100644 index 0000000..f178915 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/adl-11_b.C @@ -0,0 +1,12 @@ +// Before P1787 (C++20), only hidden friends are included in ADL. +// After P1787, all friends are included. + +// { dg-additional-options -fmodules } + +import M; + +int main() +{ + N::A a; + fn(a); // { dg-error "not declared" "" { target c++17_down } } +} diff --git a/gcc/testsuite/g++.dg/modules/auto-1_a.H b/gcc/testsuite/g++.dg/modules/auto-1_a.H index 4d3bc77..e9cbd00 100644 --- a/gcc/testsuite/g++.dg/modules/auto-1_a.H +++ b/gcc/testsuite/g++.dg/modules/auto-1_a.H @@ -1,4 +1,4 @@ -// { dg-additional-options -fmodule-header } +// { dg-options -fmodule-header } // { dg-module-cmi {} } #include "auto-1.h" diff --git a/gcc/testsuite/g++.dg/modules/auto-1_b.C b/gcc/testsuite/g++.dg/modules/auto-1_b.C index 9635066..f642233 100644 --- a/gcc/testsuite/g++.dg/modules/auto-1_b.C +++ b/gcc/testsuite/g++.dg/modules/auto-1_b.C @@ -1,4 +1,4 @@ -// { dg-additional-options "-fmodules-ts -fno-module-lazy -fdump-lang-module-alias" } +// { dg-options "-fmodules-ts -fno-module-lazy -fdump-lang-module-alias" } #include "auto-1.h" import "auto-1_a.H"; diff --git a/gcc/testsuite/g++.dg/modules/builtin-9_a.C b/gcc/testsuite/g++.dg/modules/builtin-9_a.C new file mode 100644 index 0000000..69b0e37 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/builtin-9_a.C @@ -0,0 +1,16 @@ +// Test that the built-in clog doesn't interfere with redeclaring the import. + +// { dg-additional-options "-fmodules -Wno-global-module" } + +module; + +namespace std { + class ostream; + extern ostream clog; +} + +export module M; + +namespace std { + export using std::clog; +} diff --git a/gcc/testsuite/g++.dg/modules/builtin-9_b.C b/gcc/testsuite/g++.dg/modules/builtin-9_b.C new file mode 100644 index 0000000..30ea013 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/builtin-9_b.C @@ -0,0 +1,8 @@ +// { dg-additional-options -fmodules } + +import M; + +namespace std { + class ostream; + extern ostream clog; +} diff --git a/gcc/testsuite/g++.dg/modules/class-11_a.H b/gcc/testsuite/g++.dg/modules/class-11_a.H index 43fddb6..e926959 100644 --- a/gcc/testsuite/g++.dg/modules/class-11_a.H +++ b/gcc/testsuite/g++.dg/modules/class-11_a.H @@ -3,17 +3,6 @@ // { dg-module-cmi {} } // { dg-skip-if "test assumes that structs have padding" { default_packed } } -#if __cpp_trivial_relocatability < 202502L -#define trivially_relocatable_if_eligible __trivially_relocatable_if_eligible -#define replaceable_if_eligible __replaceable_if_eligible -#endif - -struct A trivially_relocatable_if_eligible { A(A&&); }; -struct B replaceable_if_eligible { B(B&&); B& operator=(B&&); }; -struct C {}; -static_assert(__builtin_is_trivially_relocatable(C) && __builtin_is_replaceable(C), ""); - - struct pr106381 { long l; char c = -1; diff --git a/gcc/testsuite/g++.dg/modules/class-11_b.C b/gcc/testsuite/g++.dg/modules/class-11_b.C index 87be71a..892142d 100644 --- a/gcc/testsuite/g++.dg/modules/class-11_b.C +++ b/gcc/testsuite/g++.dg/modules/class-11_b.C @@ -3,10 +3,6 @@ import "class-11_a.H"; -static_assert(__builtin_is_trivially_relocatable(A), ""); -static_assert(__builtin_is_replaceable(B), ""); -static_assert(__builtin_is_trivially_relocatable(C) && __builtin_is_replaceable(C), ""); - struct M1 : pr106381 { char x; // { dg-warning "offset" "" { target c++14 } } }; diff --git a/gcc/testsuite/g++.dg/modules/clone-5_a.C b/gcc/testsuite/g++.dg/modules/clone-5_a.C new file mode 100644 index 0000000..4a72e8f --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/clone-5_a.C @@ -0,0 +1,25 @@ +// Test that a random instantiation of a constructor template doesn't end up in +// the overload set for other arguments. + +// { dg-do compile { target c++20 } } +// { dg-additional-options "-fmodules" } + +export module M; + +export { + inline int i; + + template <class T> + struct A { + A(const T* p, unsigned long len) { ++i; } + template <class B, class E> + requires (!__is_convertible(E,unsigned long)) + A(B,E) { ++i; } + }; + + inline void f() + { + const char *const p = nullptr; + A<char> a (p, p); // instantiate A<const char *, const char *> + } +} diff --git a/gcc/testsuite/g++.dg/modules/clone-5_b.C b/gcc/testsuite/g++.dg/modules/clone-5_b.C new file mode 100644 index 0000000..f66b465 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/clone-5_b.C @@ -0,0 +1,9 @@ +// { dg-additional-options -fmodules } + +import M; + +int main() +{ + const char *const p = nullptr; + A<char> (p, 0); +} diff --git a/gcc/testsuite/g++.dg/modules/compile-std1.C b/gcc/testsuite/g++.dg/modules/compile-std1.C new file mode 100644 index 0000000..a7972be --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/compile-std1.C @@ -0,0 +1,11 @@ +// { dg-additional-options "-fmodules --compile-std-module -g -O" } +// { dg-do compile { target c++20 } } + +import <bits/stdc++.h>; +import std; +import std.compat; + +void f() +{ + std::string s; +} diff --git a/gcc/testsuite/g++.dg/modules/concept-12_a.C b/gcc/testsuite/g++.dg/modules/concept-12_a.C new file mode 100644 index 0000000..9d370d3 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/concept-12_a.C @@ -0,0 +1,6 @@ +// PR c++/122789 +// { dg-additional-options "-fmodules -fconcepts" } +// { dg-module-cmi M } + +export module M; +template <typename T> constexpr bool b = requires(int, typename T::U x) { x; }; diff --git a/gcc/testsuite/g++.dg/modules/concept-12_b.C b/gcc/testsuite/g++.dg/modules/concept-12_b.C new file mode 100644 index 0000000..83353ca --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/concept-12_b.C @@ -0,0 +1,5 @@ +// PR c++/122789 +// { dg-additional-options "-fmodules -fconcepts" } + +module M; +static_assert(!b<int>); diff --git a/gcc/testsuite/g++.dg/modules/convop-2_a.H b/gcc/testsuite/g++.dg/modules/convop-2_a.H new file mode 100644 index 0000000..62bb210 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/convop-2_a.H @@ -0,0 +1,10 @@ +// PR c++/122381 +// { dg-additional-options "-fmodule-header" } +// { dg-module-cmi {} } + +template <typename T> struct color_ref { + operator int() const { return 0; } + int foo(color_ref x) { + return x.operator int(); + } +}; diff --git a/gcc/testsuite/g++.dg/modules/convop-2_b.C b/gcc/testsuite/g++.dg/modules/convop-2_b.C new file mode 100644 index 0000000..d1e829e --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/convop-2_b.C @@ -0,0 +1,5 @@ +// PR c++/122381 +// { dg-additional-options "-fmodules" } + +import "convop-2_a.H"; +template struct color_ref<int>; diff --git a/gcc/testsuite/g++.dg/modules/friend-10_a.C b/gcc/testsuite/g++.dg/modules/friend-10_a.C new file mode 100644 index 0000000..6669fff --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/friend-10_a.C @@ -0,0 +1,21 @@ +// PR c++/122646 +// { dg-additional-options "-fmodules -fconcepts" } +// { dg-module-cmi M } + +export module M; + +template <typename T> +struct zip_view_iterator { + void operator-(int) {} + friend void operator-(zip_view_iterator, zip_view_iterator) + requires requires(T x) { x.begin() - x.begin(); } + {} +}; + +struct ref_view { + ref_view begin(); +}; + +export template <typename X> void foo() { + zip_view_iterator<ref_view>{} - X(); +} diff --git a/gcc/testsuite/g++.dg/modules/friend-10_b.C b/gcc/testsuite/g++.dg/modules/friend-10_b.C new file mode 100644 index 0000000..ea261aa --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/friend-10_b.C @@ -0,0 +1,5 @@ +// PR c++/122646 +// { dg-additional-options "-fmodules -fconcepts" } + +import M; +template void foo<int>(); diff --git a/gcc/testsuite/g++.dg/modules/friend-11_a.C b/gcc/testsuite/g++.dg/modules/friend-11_a.C new file mode 100644 index 0000000..2382f4c --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/friend-11_a.C @@ -0,0 +1,22 @@ +// { dg-additional-options "-fmodules" } + +export module M; + +export { +template <class T> +int fn() { + return T::mem; +} + +template <class T> +class A { + inline static int mem = 42; + friend int fn<A>(); +}; + +template <class T> +class B { + inline static int mem = 24; + friend int fn<B>(); +}; +} diff --git a/gcc/testsuite/g++.dg/modules/friend-11_b.C b/gcc/testsuite/g++.dg/modules/friend-11_b.C new file mode 100644 index 0000000..e8baeee --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/friend-11_b.C @@ -0,0 +1,9 @@ +// { dg-additional-options "-fmodules" } + +import M; + +int main() +{ + fn<A<int>>(); + fn<B<int>>(); +} diff --git a/gcc/testsuite/g++.dg/modules/friend-12_a.C b/gcc/testsuite/g++.dg/modules/friend-12_a.C new file mode 100644 index 0000000..827c74b --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/friend-12_a.C @@ -0,0 +1,11 @@ +// { dg-additional-options "-fmodules -Wno-global-module" } +// { dg-module-cmi M:part } + +module; +template <typename T> struct basic_streambuf; +template <typename T> void __copy_streambufs_eof(basic_streambuf<T>*); +template <typename T> struct basic_streambuf { + friend void __copy_streambufs_eof<>(basic_streambuf*); +}; +export module M:part; +void foo(basic_streambuf<char>&) {} diff --git a/gcc/testsuite/g++.dg/modules/friend-12_b.C b/gcc/testsuite/g++.dg/modules/friend-12_b.C new file mode 100644 index 0000000..7eb7014 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/friend-12_b.C @@ -0,0 +1,5 @@ +// { dg-additional-options "-fmodules -Wno-global-module" } +// { dg-module-cmi M } + +export module M; +export import :part; diff --git a/gcc/testsuite/g++.dg/modules/inst-6_a.C b/gcc/testsuite/g++.dg/modules/inst-6_a.C new file mode 100644 index 0000000..7f35cc1 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/inst-6_a.C @@ -0,0 +1,14 @@ +// PR c++/122421 +// { dg-additional-options "-fmodules" } +// { dg-module-cmi M } + +export module M; + +export template <typename T> struct Type { + static const int arr[3]; +}; + +extern template const int Type<double>::arr[3]; +template <typename T> const int Type<T>::arr[] = { 42, 43, 44 }; + +export Type<int> ti; diff --git a/gcc/testsuite/g++.dg/modules/inst-6_b.C b/gcc/testsuite/g++.dg/modules/inst-6_b.C new file mode 100644 index 0000000..5a8092c --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/inst-6_b.C @@ -0,0 +1,12 @@ +// PR c++/122421 +// { dg-additional-options "-fmodules" } + +import M; + +int main() { + const int& a = Type<int>::arr[0]; + const int& b = Type<double>::arr[0]; +} + +// { dg-final { scan-assembler {_ZNW1M4TypeIiE3arrE:} } } +// { dg-final { scan-assembler-not {_ZNW1M4TypeIdE3arrE:} } } diff --git a/gcc/testsuite/g++.dg/modules/inst-7_a.C b/gcc/testsuite/g++.dg/modules/inst-7_a.C new file mode 100644 index 0000000..7489edf --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/inst-7_a.C @@ -0,0 +1,33 @@ +// PR c++/122625 +// { dg-additional-options "-fmodules" } +// { dg-module-cmi M } + +export module M; +struct integral_constant { + void f() const {} +}; +struct span { + template <int> static constexpr integral_constant __v{}; + template <int, int> static constexpr integral_constant partial{}; +}; +template <int x> constexpr integral_constant span::partial<x, 0>{}; + +template <typename T> +struct nested { + template <typename U> static const U arr[3]; +}; +template <typename T> +struct nested<T*> { + template <typename U> static const U arr[3]; +}; +template <typename T> template <typename U> const U nested<T>::arr[3] = {}; +template <typename T> template <typename U> const U nested<T*>::arr[3] = {}; +template <typename T> template <typename U> const U nested<T*>::arr<U*>[3] = {}; + +export inline void format() { + span::__v<1>.f(); + span::partial<5, 0>.f(); + nested<int>::arr<integral_constant>[0].f(); + nested<int*>::arr<integral_constant>[0].f(); + nested<int*>::arr<integral_constant*>[0].f(); +} diff --git a/gcc/testsuite/g++.dg/modules/inst-7_b.C b/gcc/testsuite/g++.dg/modules/inst-7_b.C new file mode 100644 index 0000000..3a49b516 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/inst-7_b.C @@ -0,0 +1,13 @@ +// PR c++/122625 +// { dg-additional-options "-fmodules" } + +import M; +int main() { + format(); +} + +// { dg-final { scan-assembler {_ZNW1M4span3__vILi1EEE:} } } +// { dg-final { scan-assembler {_ZNW1M4span7partialILi5ELi0EEE:} } } +// { dg-final { scan-assembler {_ZNW1M6nestedIiE3arrIS_17integral_constantEE:} } } +// { dg-final { scan-assembler {_ZNW1M6nestedIPiE3arrIS_17integral_constantEE:} } } +// { dg-final { scan-assembler {_ZNW1M6nestedIPiE3arrIPS_17integral_constantEE:} } } diff --git a/gcc/testsuite/g++.dg/modules/internal-16.C b/gcc/testsuite/g++.dg/modules/internal-16.C new file mode 100644 index 0000000..4a928ae --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/internal-16.C @@ -0,0 +1,30 @@ +// PR c++/122253 +// { dg-additional-options "-fmodules -Wtemplate-names-tu-local" } + +export module M; + +template <int> struct ic {}; +struct S { + constexpr operator int() const { return 5; } + constexpr int operator&() const { return 8; } +}; + +template <typename T> inline void a(T) { + T a; + static T b; + ic<a>{}; + ic<b>{}; + ic<&a>{}; + ic<&b>{}; +} + +template <typename T> inline auto b(T x) { + return [&](auto y) { + return [=](auto z) { + return ic<(int)x + (int)&y + (int)z>{}; + }; + }; +} + +template void a(S); +ic<5 + 8 + 5> x = b(S{})(S{})(S{}); diff --git a/gcc/testsuite/g++.dg/modules/internal-17_a.C b/gcc/testsuite/g++.dg/modules/internal-17_a.C new file mode 100644 index 0000000..17eef47 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/internal-17_a.C @@ -0,0 +1,64 @@ +// PR c++/121574 +// { dg-additional-options "-fmodules -Wno-error=expose-global-module-tu-local -Wtemplate-names-tu-local -Wno-global-module" } +// { dg-module-cmi M } + +module; + +namespace { + void foo() {} + inline int bar = 123; + template <typename> void qux() {} + template void qux<int>(); + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wexpose-global-module-tu-local" + void foo_ignored() {} + inline int bar_ignored = 123; + template <typename> void qux_ignored() {} + template void qux_ignored<int>(); +#pragma GCC diagnostic pop +}; + +export module M; + +export inline void a() { // { dg-warning "exposes TU-local" } + foo(); + int x = bar; +} + +export inline void b() { + foo_ignored(); + int x = bar_ignored; +} + +export template <typename T> +void c() { // { dg-warning "refers to TU-local" } + foo(); + int x = bar; +} + +export template <typename T> +void d() { + foo_ignored(); + int x = bar_ignored; +} + +export inline void e() { // { dg-warning "exposes TU-local" } + foo(); + int result = bar_ignored; +} + +export template <typename T> +void f() { // { dg-warning "refers to TU-local" } + foo_ignored(); + int result = bar; +} + +export inline void g() { // { dg-warning "exposes TU-local" } + qux<int>(); +} + +export template <typename> +void h() { + qux_ignored<int>(); +} diff --git a/gcc/testsuite/g++.dg/modules/internal-17_b.C b/gcc/testsuite/g++.dg/modules/internal-17_b.C new file mode 100644 index 0000000..f900926 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/internal-17_b.C @@ -0,0 +1,60 @@ +// PR c++/121576 +// { dg-additional-options "-fmodules -Wno-error=expose-global-module-tu-local -Wtemplate-names-tu-local -Wno-global-module" } +// { dg-module-cmi !X } + +module; + +static inline int x // { dg-error "TU-local" } + // { dg-message "exposed elsewhere" "" { target *-*-* } .-1 } + = []{ return 1; }(); // { dg-message "internal" } + +static inline int y = []{ return 2; }(); // { dg-bogus "" } + +namespace { + struct S {}; + template <typename> void tmpl(); + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wexpose-global-module-tu-local" + struct S_ignored {}; + template <typename> void tmpl_ignored(); +#pragma GCC diagnostic pop +} + +export module X; +import M; + +void test_usage() { + a(); + b(); + c<int>(); // { dg-message "required from here" } + d<int>(); // { dg-bogus "" } + e(); + f<int>(); // { dg-message "required from here" } + g(); + h<int>(); // { dg-bogus "" } + + // { dg-warning "instantiation exposes TU-local entity" "" { target *-*-* } 0 } +} + +inline void expose() { // { dg-warning "exposes TU-local" } + int result = x; +} + +// Internal linkage types always hard error +inline void expose_struct() { // { dg-error "exposes TU-local" } + S s; +} +inline void still_expose_struct() { // { dg-error "exposes TU-local" } + S_ignored s; +} + +// Template instantiations occuring in module purview are not ignored, +// as it's too hard to tell if the instantiation will accidentally rely +// on something in the purview or not. +inline void expose_tmpl() { // { dg-error "exposes TU-local" } + tmpl<int>(); +} +inline void still_expose_tmpl() { // { dg-error "exposes TU-local" } + tmpl_ignored<int>(); +} diff --git a/gcc/testsuite/g++.dg/modules/internal-18.C b/gcc/testsuite/g++.dg/modules/internal-18.C new file mode 100644 index 0000000..3f9102a --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/internal-18.C @@ -0,0 +1,9 @@ +// PR c++/122628 +// { dg-additional-options "-fmodules" } + +template <typename T> static void baz(T) {} +template <typename T> static void bar(T) { baz(0); } + +void foo() { + bar(0); +} diff --git a/gcc/testsuite/g++.dg/modules/internal-19_a.C b/gcc/testsuite/g++.dg/modules/internal-19_a.C new file mode 100644 index 0000000..8b7bb45 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/internal-19_a.C @@ -0,0 +1,21 @@ +// PR c++/122636 +// { dg-additional-options "-fmodules" } +// { dg-module-cmi M } + +export module M; +export template <typename> +struct Foo { + constexpr static inline auto lambda = []{}; + template <typename T = decltype(lambda)> + static void foo(T = lambda) {} +}; + +export template <typename... Types> +struct Type +{ + template <typename T> + auto test(T to) + { + return [to](auto && ...){ return to; }(); + } +}; diff --git a/gcc/testsuite/g++.dg/modules/internal-19_b.C b/gcc/testsuite/g++.dg/modules/internal-19_b.C new file mode 100644 index 0000000..58d1fd5 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/internal-19_b.C @@ -0,0 +1,16 @@ +// PR c++/122636 +// { dg-additional-options "-fmodules -Werror=expose-global-module-tu-local" } + +import M; +namespace { + struct Bar {}; + void bar() { Foo<Bar>::foo(); } +} + +int main() { + bar(); + + enum class E { }; + Type<E> t; + t.test(0); +} diff --git a/gcc/testsuite/g++.dg/modules/modules.exp b/gcc/testsuite/g++.dg/modules/modules.exp index 73b5de1..3f2b8f2 100644 --- a/gcc/testsuite/g++.dg/modules/modules.exp +++ b/gcc/testsuite/g++.dg/modules/modules.exp @@ -267,7 +267,8 @@ proc module-init { src } { set extra_tool_flags {} if { [llength $option_list] - && [string match "*xtreme*" $src] } { + && ( [string match "*xtreme*" $src] + || [string match "*compile-std*" $src] ) } { # Only run the xtreme tests once. set option_list [lrange [lsort $option_list] end end] } diff --git a/gcc/testsuite/g++.dg/modules/namespace-15_a.C b/gcc/testsuite/g++.dg/modules/namespace-15_a.C new file mode 100644 index 0000000..7c0c0e6 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/namespace-15_a.C @@ -0,0 +1,9 @@ +// Test that namespace deprecation is represented in the gcm. + +// { dg-additional-options "-fmodules" } + +export module M; + +export { + namespace [[deprecated]] N { } +} diff --git a/gcc/testsuite/g++.dg/modules/namespace-15_b.C b/gcc/testsuite/g++.dg/modules/namespace-15_b.C new file mode 100644 index 0000000..5128e82 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/namespace-15_b.C @@ -0,0 +1,5 @@ +// { dg-additional-options -fmodules } + +import M; + +using namespace N; // { dg-warning "deprecated" } diff --git a/gcc/testsuite/g++.dg/modules/namespace-16_a.C b/gcc/testsuite/g++.dg/modules/namespace-16_a.C new file mode 100644 index 0000000..8475ca0 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/namespace-16_a.C @@ -0,0 +1,9 @@ +// PR c++/122915 +// { dg-additional-options "-fmodules" } +// { dg-module-cmi imagine } + +export module imagine; +namespace ns {} +export namespace ig { + using namespace ns; +} diff --git a/gcc/testsuite/g++.dg/modules/namespace-16_b.C b/gcc/testsuite/g++.dg/modules/namespace-16_b.C new file mode 100644 index 0000000..aed3e8a --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/namespace-16_b.C @@ -0,0 +1,9 @@ +// PR c++/122915 +// { dg-additional-options "-fmodules" } +// { dg-module-cmi tests:part } + +export module tests:part; +namespace abc {} +namespace part { + export using namespace abc; +} diff --git a/gcc/testsuite/g++.dg/modules/namespace-16_c.C b/gcc/testsuite/g++.dg/modules/namespace-16_c.C new file mode 100644 index 0000000..0638e35 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/namespace-16_c.C @@ -0,0 +1,12 @@ +// PR c++/122915 +// { dg-additional-options "-fmodules -fdump-lang-module" } +// { dg-module-cmi tests } + +export module tests; +export import :part; +import imagine; +using namespace ig; + +// { dg-final { scan-lang-dump {Writing using-directive in '::' for '::ig'} module } } +// { dg-final { scan-lang-dump {Writing using-directive in '::part' for '::abc'} module } } +// { dg-final { scan-lang-dump-not {Writing using-directive in '::ig' for '::ns'} module } } diff --git a/gcc/testsuite/g++.dg/modules/namespace-16_d.C b/gcc/testsuite/g++.dg/modules/namespace-16_d.C new file mode 100644 index 0000000..f126d41 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/namespace-16_d.C @@ -0,0 +1,10 @@ +// PR c++/122915 +// { dg-additional-options "-fmodules" } + +module tests; + +namespace ns { using T = int; }; +T x = 123; + +namespace abc { using U = double; }; +part::U y = 3.14; diff --git a/gcc/testsuite/g++.dg/modules/omp-4_a.C b/gcc/testsuite/g++.dg/modules/omp-4_a.C new file mode 100644 index 0000000..948966e --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/omp-4_a.C @@ -0,0 +1,30 @@ +// PR c++/119864 +// { dg-additional-options "-fmodules -fopenmp" } +// { dg-module-cmi p1 } + +export module p1; + +export +template<unsigned> +struct T +{ + double d; + + T &operator +=(T const &x) { d += x.d; return *this; } +}; + +export +template<unsigned d> +T<d> sum(T<d> const *p, unsigned N) +{ +T<d> Sum = {}; + +#pragma omp declare reduction(Op: T<d>: omp_out += omp_in) initializer(omp_priv = {}) +#pragma omp parallel for reduction(Op: Sum) +for (unsigned i = 0u; i < N; ++i) + { + Sum += *p; + ++p; + } +return Sum; +} diff --git a/gcc/testsuite/g++.dg/modules/omp-4_b.C b/gcc/testsuite/g++.dg/modules/omp-4_b.C new file mode 100644 index 0000000..c1ca279 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/omp-4_b.C @@ -0,0 +1,11 @@ +// PR c++/119864 +// { dg-additional-options "-fmodules -fopenmp" } + +import p1; + +int main() +{ + T<1u> v[3u] = {}; + + T s = sum(v, 3u); +} diff --git a/gcc/testsuite/g++.dg/modules/tpl-friend-20_a.C b/gcc/testsuite/g++.dg/modules/tpl-friend-20_a.C new file mode 100644 index 0000000..0918ec4 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/tpl-friend-20_a.C @@ -0,0 +1,16 @@ +// PR c++/122551 +// { dg-additional-options "-fmodules" } +// { dg-module-cmi M } + +export module M; +export template <typename T> struct S { + operator int() const { return 123; } + template <typename U> friend void f(U); + template <typename U> friend void g(U) {} + friend void h(int); + friend void i(int) {} +}; +template <typename U> void f(U) {} +template <typename U> void g(U); +void h(int) {} +void i(int); diff --git a/gcc/testsuite/g++.dg/modules/tpl-friend-20_b.C b/gcc/testsuite/g++.dg/modules/tpl-friend-20_b.C new file mode 100644 index 0000000..b8e2033 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/tpl-friend-20_b.C @@ -0,0 +1,10 @@ +// PR c++/122551 +// { dg-additional-options "-fmodules" } +// { dg-module-cmi X } + +export module X; +import M; + +export S<int> test() { + return {}; +} diff --git a/gcc/testsuite/g++.dg/modules/tpl-friend-20_c.C b/gcc/testsuite/g++.dg/modules/tpl-friend-20_c.C new file mode 100644 index 0000000..0414cc7 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/tpl-friend-20_c.C @@ -0,0 +1,11 @@ +// PR c++/122551 +// { dg-additional-options "-fmodules" } + +import X; + +int main() { + f(test()); + g(test()); + h(test()); + i(test()); +} diff --git a/gcc/testsuite/g++.dg/modules/tpl-friend-21_a.C b/gcc/testsuite/g++.dg/modules/tpl-friend-21_a.C new file mode 100644 index 0000000..091d0f02 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/tpl-friend-21_a.C @@ -0,0 +1,11 @@ +// PR c++/122699 +// { dg-additional-options "-fmodules" } +// { dg-module-cmi M } + +export module M; +export namespace ns::inner { + template <typename T> struct S { + inline friend void f(); + }; + void f(); +} diff --git a/gcc/testsuite/g++.dg/modules/tpl-friend-21_b.C b/gcc/testsuite/g++.dg/modules/tpl-friend-21_b.C new file mode 100644 index 0000000..6bdc44a --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/tpl-friend-21_b.C @@ -0,0 +1,7 @@ +// PR c++/122699 +// { dg-additional-options "-fmodules" } +// { dg-module-cmi X } + +export module X; +import M; +ns::inner::S<int> s; diff --git a/gcc/testsuite/g++.dg/modules/tpl-friend-8_a.H b/gcc/testsuite/g++.dg/modules/tpl-friend-8_a.H index bd22904..7269d8e 100644 --- a/gcc/testsuite/g++.dg/modules/tpl-friend-8_a.H +++ b/gcc/testsuite/g++.dg/modules/tpl-friend-8_a.H @@ -7,3 +7,13 @@ namespace std { friend void f(A) { } }; } + +namespace outer { + namespace inner { + inline namespace more_inner { + template<class T> struct B { + friend void g() {} + }; + } + } +} diff --git a/gcc/testsuite/g++.dg/modules/tpl-friend-8_b.C b/gcc/testsuite/g++.dg/modules/tpl-friend-8_b.C index 76d7447..47569aa 100644 --- a/gcc/testsuite/g++.dg/modules/tpl-friend-8_b.C +++ b/gcc/testsuite/g++.dg/modules/tpl-friend-8_b.C @@ -1,8 +1,13 @@ // PR c++/100134 -// { dg-additional-options -fmodules-ts } +// { dg-additional-options "-fmodules -Wno-global-module" } // { dg-module-cmi pr100134 } +module; +namespace outer::inner { + inline namespace more_inner {} +} export module pr100134; import "tpl-friend-8_a.H"; export std::A<int> a; +export outer::inner::B<int> b; diff --git a/gcc/testsuite/g++.dg/modules/using-33_a.C b/gcc/testsuite/g++.dg/modules/using-33_a.C new file mode 100644 index 0000000..949eade --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/using-33_a.C @@ -0,0 +1,10 @@ +// { dg-additional-options "-fmodules" } +module; + +#include <string.h> + +export module M; + +namespace N { + export using ::memset; +} diff --git a/gcc/testsuite/g++.dg/modules/using-33_b.C b/gcc/testsuite/g++.dg/modules/using-33_b.C new file mode 100644 index 0000000..3420146 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/using-33_b.C @@ -0,0 +1,10 @@ +// { dg-additional-options "-fmodules" } +import M; + +using N::memset; + +int main() +{ + int i = 1; + memset (&i, 42, 1); +} diff --git a/gcc/testsuite/g++.dg/opt/pr122184-1.C b/gcc/testsuite/g++.dg/opt/pr122184-1.C new file mode 100644 index 0000000..50f8639 --- /dev/null +++ b/gcc/testsuite/g++.dg/opt/pr122184-1.C @@ -0,0 +1,12 @@ +// PR tree-optimization/122184 +// { dg-do compile } +// { dg-require-stack-check "generic" } +// { dg-options "-O2 -fstack-check=generic" } + +void +foo () +{ + goto fail; + char var[41]; +fail:; +} diff --git a/gcc/testsuite/g++.dg/opt/pr122184-2.C b/gcc/testsuite/g++.dg/opt/pr122184-2.C new file mode 100644 index 0000000..b5dd6fc --- /dev/null +++ b/gcc/testsuite/g++.dg/opt/pr122184-2.C @@ -0,0 +1,12 @@ +// PR tree-optimization/122184 +// { dg-do compile } +// { dg-require-stack-check "generic" } +// { dg-options "-O2 -fstack-check=generic -ftrivial-auto-var-init=zero" } + +void +foo () +{ + goto fail; + char var[41]; +fail:; +} diff --git a/gcc/testsuite/g++.dg/parse/crash81.C b/gcc/testsuite/g++.dg/parse/crash81.C new file mode 100644 index 0000000..6841162 --- /dev/null +++ b/gcc/testsuite/g++.dg/parse/crash81.C @@ -0,0 +1,14 @@ +// PR c++/120876 +// { dg-do compile { target c++11 } } + +template <typename T> +struct S { + static bool foo (decltype (bar (T {}))); // { dg-error "'bar' was not declared in this scope; did you mean 'baz'\\\?" } + static constexpr bool s = foo (0); // { dg-error "declaration of 'S<int>::foo' depends on itself" } +}; + +void +baz () +{ + S <int>::s; +} diff --git a/gcc/testsuite/g++.dg/pch/line-map-3.C b/gcc/testsuite/g++.dg/pch/line-map-3.C index 3390d7a..9def08d 100644 --- a/gcc/testsuite/g++.dg/pch/line-map-3.C +++ b/gcc/testsuite/g++.dg/pch/line-map-3.C @@ -1,23 +1,5 @@ -#define UNUSED_MACRO /* { dg-error "UNUSED_MACRO" "" { xfail *-*-* } } */ -#include "line-map-3.H" /* { dg-bogus "-:UNUSED_MACRO" "" { xfail *-*-* } } */ - -/* { dg-do compile } */ -/* { dg-additional-options "-Werror=unused-macros" } */ - /* PR preprocessor/105608 */ -/* This test case is currently xfailed and requires work in libcpp/pch.cc to - resolve. Currently, the macro location is incorrectly assigned to line 2 - of the header file when read via PCH, because libcpp doesn't try to - assign locations relative to the newly loaded line map after restoring - the PCH. */ - -/* In PCH mode we also complain incorrectly about the command line macro -Dwith_PCH - added by dejagnu; that warning would get suppressed if the macro location were - correctly restored by libcpp to reflect that it was a command line macro. */ -/* { dg-bogus "-:with_PCH" "" { xfail *-*-* } 2 } */ - -/* The reason we used -Werror was to prevent pch.exp from rerunning without PCH; - in that case we would get unnecessary XPASS outputs since the test does work - fine without PCH. Once the bug is fixed, remove the -Werror and switch to - dg-warning. */ -/* { dg-regexp {[^[:space:]]*: some warnings being treated as errors} } */ +/* { dg-do compile } */ +/* { dg-additional-options "-Wunused-macros" } */ +#define UNUSED_MACRO /* { dg-warning "-:UNUSED_MACRO" "" } */ +#include "line-map-3.H" /* { dg-bogus "-:UNUSED_MACRO" "" } */ diff --git a/gcc/testsuite/g++.dg/pch/line-map-4.C b/gcc/testsuite/g++.dg/pch/line-map-4.C new file mode 100644 index 0000000..cc13a46 --- /dev/null +++ b/gcc/testsuite/g++.dg/pch/line-map-4.C @@ -0,0 +1,5 @@ +/* PR preprocessor/105608 */ +/* { dg-do compile } */ +#define INT int /* { dg-error "-:declaration does not declare anything" } */ +#include "line-map-4.H" +INT; /* { dg-note "in expansion of macro" } */ diff --git a/gcc/testsuite/g++.dg/pch/line-map-4.Hs b/gcc/testsuite/g++.dg/pch/line-map-4.Hs new file mode 100644 index 0000000..3b6178b --- /dev/null +++ b/gcc/testsuite/g++.dg/pch/line-map-4.Hs @@ -0,0 +1 @@ +/* This space intentionally left blank. */ diff --git a/gcc/testsuite/g++.dg/pid_t-1.C b/gcc/testsuite/g++.dg/pid_t-1.C new file mode 100644 index 0000000..cb32eb4 --- /dev/null +++ b/gcc/testsuite/g++.dg/pid_t-1.C @@ -0,0 +1,3 @@ +/* { dg-options "-Wall" } */ + +extern "C" int fork (void); // { dg-warning "conflicts with built-in declaration" "" { target { *-*-solaris2* && ilp32 } } } diff --git a/gcc/testsuite/g++.dg/pr121345.C b/gcc/testsuite/g++.dg/pr121345.C new file mode 100644 index 0000000..c121a6b --- /dev/null +++ b/gcc/testsuite/g++.dg/pr121345.C @@ -0,0 +1,39 @@ +/* { dg-do compile } */ +/* { dg-options "-fdump-tree-evrp -std=c++11 -fmath-errno -fno-exceptions -O3 -W -Wall" } */ + + struct type { + unsigned long long t; + int t1; + } ; +struct a +{ + type per_lane_size_states[16]; +}TestForGEVectorsState; + +void sink(int); + +static constexpr int kMaxSupportedLaneSize = 8; + +void dead(); + +void f() +{ + for (int lane_size = 1; lane_size <= kMaxSupportedLaneSize; lane_size <<= 1) { + type *tp = &TestForGEVectorsState.per_lane_size_states[lane_size]; + if (lane_size < 0) + dead (); + if ((unsigned long long)(lane_size * 8) <= 64llu) + { + unsigned long long t = lane_size; + t = 24 / t; + if (tp->t != t) + { + __builtin_trap(); + } + } + else if (tp->t1) + __builtin_trap(); + } +} + +/* { dg-final { scan-tree-dump-not "dead" "evrp" } } */ diff --git a/gcc/testsuite/g++.dg/template/crash106.C b/gcc/testsuite/g++.dg/template/crash106.C index 35cedb5..bb71e29 100644 --- a/gcc/testsuite/g++.dg/template/crash106.C +++ b/gcc/testsuite/g++.dg/template/crash106.C @@ -7,6 +7,6 @@ struct A template<T> void foo(); // { dg-error "type" "" { target c++17_down } } }; -template<T N = 0.0, void (A::*)() = &A::foo<N> > struct B {}; // { dg-error "type|declared|could not convert" "" { target c++17_down } } +template<T N = 0.0, void (A::*)() = &A::foo<N> > struct B {}; // { dg-error "type|not a member" "" { target c++17_down } } -B<> b; // { dg-message "" "" { target c++17_down } } +B<> b; // { dg-error "invalid" "" { target c++17_down } } diff --git a/gcc/testsuite/g++.dg/template/crash112.C b/gcc/testsuite/g++.dg/template/crash112.C index ff35764..a60b233 100644 --- a/gcc/testsuite/g++.dg/template/crash112.C +++ b/gcc/testsuite/g++.dg/template/crash112.C @@ -9,9 +9,7 @@ template<void (A::*)()> struct B {}; template<int> struct C { - B<&A::foo<int int> > b; // { dg-error "declaration|type" } + B<&A::foo<int int> > b; // { dg-error "declaration|not a member" } }; C<0> c; - -// { dg-prune-output "could not convert" } diff --git a/gcc/testsuite/g++.dg/template/dependent-args1.C b/gcc/testsuite/g++.dg/template/dependent-args1.C index 8fffbf8..1f16206 100644 --- a/gcc/testsuite/g++.dg/template/dependent-args1.C +++ b/gcc/testsuite/g++.dg/template/dependent-args1.C @@ -6,8 +6,6 @@ struct A template<int> void foo(); }; -template<int N, void (A::*)() = &A::foo<N> > struct B {}; +template<int N, void (A::*)() = &A::foo<N> > struct B {}; // { dg-error "not a member" } -B<int> b; // { dg-error "type/value mismatch|expected a constant|invalid type" } - -// { dg-prune-output "(could not convert|no match)" } +B<int> b; // { dg-error "type/value mismatch|invalid" } diff --git a/gcc/testsuite/g++.dg/template/sfinae-deleted-pr119343.C b/gcc/testsuite/g++.dg/template/sfinae-deleted-pr119343.C new file mode 100644 index 0000000..065ad60 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/sfinae-deleted-pr119343.C @@ -0,0 +1,31 @@ +// { dg-do compile { target c++11 } } +// PR c++/119343 - No SFINAE for deleted explicit specializations + +struct true_type { static constexpr bool value = true; }; +struct false_type { static constexpr bool value = false; }; + +struct X { + static void f()=delete; + template<int> static void g(); +}; +template<> void X::g<0>()=delete; +struct Y { + static void f(); + template<int> static void g(); +}; + +template<class T,class=void> +struct has_f : false_type {}; +template<class T> +struct has_f<T,decltype(void(T::f))> : true_type {}; + +static_assert(!has_f<X>::value, ""); +static_assert(has_f<Y>::value, ""); + +template<class T,class=void> +struct has_g0 : false_type {}; +template<class T> +struct has_g0<T,decltype(void(T::template g<0>))> : true_type {}; + +static_assert(!has_g0<X>::value, ""); +static_assert(has_g0<Y>::value, ""); diff --git a/gcc/testsuite/g++.dg/torture/pr119969.C b/gcc/testsuite/g++.dg/torture/pr119969.C new file mode 100644 index 0000000..25a4053 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr119969.C @@ -0,0 +1,46 @@ +// PR c++/119969 +// { dg-do run } + +struct S {}; +using PMF = void (S::*)(); +using Block = PMF[16]; +using BlockPtr = Block*; + +struct IteratorImp { + Block** d_blockPtr_p; + PMF* d_value_p; + + void operator++(); + PMF& operator*() const { return *d_value_p; } +}; + +void IteratorImp::operator++() { + int offset = 1 + (d_value_p - **d_blockPtr_p); + d_blockPtr_p += offset / 16; + d_value_p = **d_blockPtr_p + (offset % 16); +} + +struct iterator { + IteratorImp d_imp; +}; + +struct D { + Block* d_blockPtrs[1]; + Block d_block; + PMF* d_start_p; +}; + +D mX; + +void privateInit(int numElements) { + mX.d_blockPtrs[0] = &mX.d_block; + mX.d_start_p = mX.d_block + (numElements + 7); +} + +int main() { + privateInit(0); + iterator cbgn = {{mX.d_blockPtrs, mX.d_block + 7}}; + auto clast = cbgn; + ++clast.d_imp; + if (&*cbgn.d_imp == &*clast.d_imp) return 1; +} diff --git a/gcc/testsuite/g++.dg/torture/pr122589.C b/gcc/testsuite/g++.dg/torture/pr122589.C new file mode 100644 index 0000000..ac441a0 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr122589.C @@ -0,0 +1,22 @@ +// { dg-do compile } +// { dg-additional-options "-g" } + +struct QPointF { + QPointF(double xpos, double ypos) : xp(xpos), yp(ypos) {} + double xp; + double yp; +}; +double xp, yp, w, h; +struct QRectF { + QRectF(QPointF, int); + QPointF center() { return QPointF(xp + w / 2, yp + h / 2); } +}; +void clientArea(QPointF &); +int workspace_size; +void workspace() { + QRectF geom(QPointF(0, 0), workspace_size); + xp = 0 - w / 2; + yp = -h; + QPointF __trans_tmp_2 = geom.center(); + clientArea(__trans_tmp_2); +} diff --git a/gcc/testsuite/g++.dg/torture/pr122663.C b/gcc/testsuite/g++.dg/torture/pr122663.C new file mode 100644 index 0000000..eafcc98 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr122663.C @@ -0,0 +1,26 @@ +// { dg-do compile } +// { dg-additional-options "-g" } + +int a, b, c; +char bk(int, int); +void bl(int); +inline unsigned d() { + bl(c); + return bk(b, 0); +} +struct e { + template <class bc> e(bc &); +}; +int g(e) { return 0; } +unsigned h(e k) { return g(k); } +unsigned i(e k) { return h(k); } +inline unsigned j() { + unsigned bh = i(a); + bh += d(); + return bh; +} +void f() { + j(); + j(); + __builtin_unreachable(); +} diff --git a/gcc/testsuite/g++.dg/torture/pr123040.C b/gcc/testsuite/g++.dg/torture/pr123040.C new file mode 100644 index 0000000..3ba2d90 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr123040.C @@ -0,0 +1,61 @@ +// { dg-do compile } + +template <int kBytes, typename From, typename To> +void CopyBytes(From from, To to) { + __builtin_memcpy(to, from, kBytes); +} +template <typename From, typename To> void CopySameSize(From *from, To to) { + CopyBytes<sizeof(From)>(from, to); +} +template <typename> using MakeUnsigned = char; +template <typename Lane, int N> struct Simd { + using T = Lane; + static constexpr int kPrivateLanes = N; + template <typename NewT> using Rebind = Simd<NewT, 0>; +}; +template <class D> using TFromD = D::T; +template <class T, class D> using Rebind = D::template Rebind<T>; +template <class D> using RebindToUnsigned = Rebind<MakeUnsigned<D>, D>; +template <typename T, int> struct Vec128 { + using PrivateT = T; + static constexpr int kPrivateN = 6; + T raw[16]; +}; +template <class V> using DFromV = Simd<typename V::PrivateT, V::kPrivateN>; +template <class D> Vec128<TFromD<D>, D::kPrivateLanes> Zero(D); +template <class D> using VFromD = decltype(Zero(D())); +template <class D, class VFrom> VFromD<D> BitCast(D, VFrom v) { + VFromD<D> to; + CopySameSize(&v, to.raw); + return to; +} +template <int N> Vec128<signed char, N> And(Vec128<signed char, N> b) { + Vec128<signed char, N> a; + DFromV<decltype(a)> d; + RebindToUnsigned<decltype(d)> du; + auto au(a); + auto bu = BitCast(du, b); + for (int i = 0; i < N; ++i) + au.raw[i] &= bu.raw[i]; + return au; +} +void Or(Vec128<signed char, 16>); +template <int N> void IfVecThenElse(Vec128<signed char, N> yes) { + Vec128 __trans_tmp_2 = And(yes); + Or(__trans_tmp_2); +} +template <int N> void IfThenElseZero(Vec128<signed char, N> yes) { + IfVecThenElse(yes); +} +Vec128<signed char, 16> Abs_a; +char MaskedAbs___trans_tmp_5; +void MaskedAbs() { + Vec128<signed char, 16> __trans_tmp_4; + for (int i = 0; i < 16; ++i) { + MaskedAbs___trans_tmp_5 = Abs_a.raw[i] ? -Abs_a.raw[i] : 0; + Abs_a.raw[i] = MaskedAbs___trans_tmp_5; + } + __trans_tmp_4 = Abs_a; + Vec128 __trans_tmp_3 = __trans_tmp_4; + IfThenElseZero(__trans_tmp_3); +} diff --git a/gcc/testsuite/g++.dg/torture/pr51482.C b/gcc/testsuite/g++.dg/torture/pr51482.C index 4032703..d4d6ae4 100644 --- a/gcc/testsuite/g++.dg/torture/pr51482.C +++ b/gcc/testsuite/g++.dg/torture/pr51482.C @@ -22,7 +22,7 @@ WVECT * anim_track_bez_wvect::tangent(int kn, BEZIER_KEY_CLASS key_class, WVECT g1.y = (p_p1->y - p_p0->y)*bp1; g1.z = (p_p1->z - p_p0->z)*bp1; g1.w = (p_p1->w - p_p0->w)*bp1; - bp1 = (0.5f + key_class*0.5f*continuity); + bp1 = (0.5f + ((int)key_class)*0.5f*continuity); p_tn->x = (g1.x + g3.x*bp1)*tn1; p_tn->y = (g1.y + g3.y*bp1)*tn1; p_tn->z = (g1.z + g3.z*bp1)*tn1; diff --git a/gcc/testsuite/g++.dg/torture/pr84961-1.C b/gcc/testsuite/g++.dg/torture/pr84961-1.C index 6a72ad5..2c372c5 100644 --- a/gcc/testsuite/g++.dg/torture/pr84961-1.C +++ b/gcc/testsuite/g++.dg/torture/pr84961-1.C @@ -1,5 +1,6 @@ // PR c++/84961 // { dg-do compile } +// { dg-options "-std=gnu++17" } short a; volatile int b; diff --git a/gcc/testsuite/g++.dg/torture/pr84961-2.C b/gcc/testsuite/g++.dg/torture/pr84961-2.C index 0909eed..7f4fe69 100644 --- a/gcc/testsuite/g++.dg/torture/pr84961-2.C +++ b/gcc/testsuite/g++.dg/torture/pr84961-2.C @@ -1,5 +1,6 @@ // PR c++/84961 // { dg-do compile } +// { dg-options "-std=gnu++17" } short a; volatile int b; diff --git a/gcc/testsuite/g++.dg/torture/stackalign/unwind-4.C b/gcc/testsuite/g++.dg/torture/stackalign/unwind-4.C index fddf276..6b9339e 100644 --- a/gcc/testsuite/g++.dg/torture/stackalign/unwind-4.C +++ b/gcc/testsuite/g++.dg/torture/stackalign/unwind-4.C @@ -11,7 +11,7 @@ foo() int i; ALTER_REGS(); for (i=0; i < 10; i++) - g_a++; + g_a = g_a + 1; throw g_a; } #endif diff --git a/gcc/testsuite/g++.dg/tree-prof/partition1.C b/gcc/testsuite/g++.dg/tree-prof/partition1.C index 8dd64aa..b3095bd 100644 --- a/gcc/testsuite/g++.dg/tree-prof/partition1.C +++ b/gcc/testsuite/g++.dg/tree-prof/partition1.C @@ -16,7 +16,8 @@ int bar (int i) void *p = __builtin_alloca (i); asm volatile ("" : : "r" (i), "r" (p) : "memory"); if (k) throw 6; - return ++l; + l = l + 1; + return l; } void foo () diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr117123.C b/gcc/testsuite/g++.dg/tree-ssa/pr117123.C index 29b69df..2aa2810 100644 --- a/gcc/testsuite/g++.dg/tree-ssa/pr117123.C +++ b/gcc/testsuite/g++.dg/tree-ssa/pr117123.C @@ -49,6 +49,4 @@ int patatino(int a) { } // { dg-final { scan-tree-dump-not "dont_be_here" "optimized" } } -// Depending on LOGICAL_OP_NON_SHORT_CIRCUIT (or BRANCH_COST) this might -// or might not be optimized fully -// { dg-final { scan-tree-dump-times "if " 3 "optimized" { xfail { aarch64-*-* } } } } +// { dg-final { scan-tree-dump-times "if " 3 "optimized" } } diff --git a/gcc/testsuite/g++.dg/tree-ssa/simple-dse-1.C b/gcc/testsuite/g++.dg/tree-ssa/simple-dse-1.C new file mode 100644 index 0000000..20db9d4 --- /dev/null +++ b/gcc/testsuite/g++.dg/tree-ssa/simple-dse-1.C @@ -0,0 +1,28 @@ +// { dg-do compile } +// { dg-options "-O2 -fno-exceptions -fdump-tree-forwprop1-details" } +// PR tree-optimization/122633 + +struct s1 +{ + int f1[4]; + ~s1(){} +}; + +struct s1 func1(int a); +void func2(int a) +{ + struct s1 v1 = func1(a); +} + +__attribute__((pure)) +struct s1 pure1(int a); +void func3(int a) +{ + struct s1 p1 = pure1(a); +} + +// { dg-final { scan-tree-dump "Removing dead call store stmt p1 =" "forwprop1" } } +// { dg-final { scan-tree-dump-not "Removing dead call store stmt v1 =" "forwprop1" } } +// { dg-final { scan-tree-dump-not "Removing lhs of call stmt " "forwprop1" } } +// { dg-final { scan-tree-dump-times "Removing dead call store stmt" 1 "forwprop1" } } + diff --git a/gcc/testsuite/g++.dg/tree-ssa/simple-dse-2.C b/gcc/testsuite/g++.dg/tree-ssa/simple-dse-2.C new file mode 100644 index 0000000..a4a5a9f --- /dev/null +++ b/gcc/testsuite/g++.dg/tree-ssa/simple-dse-2.C @@ -0,0 +1,28 @@ +// { dg-do compile } +// { dg-options "-O2 -fno-exceptions -fdump-tree-forwprop1-details" } +// PR tree-optimization/122633 +struct s1 +{ + int f1[4]; +}; + +struct s1 func1(int a); +void func2(int a) +{ + struct s1 v1 = func1(a); +} + +__attribute__((pure)) +struct s1 pure1(int a); +void func3(int a) +{ + struct s1 p1 = pure1(a); +} + +// { dg-final { scan-tree-dump-not "Removing lhs of call stmt p1 =" "forwprop1" } } +// { dg-final { scan-tree-dump-not "Removing dead call store stmt v1 =" "forwprop1" } } +// { dg-final { scan-tree-dump "Removing lhs of call stmt v1 =" "forwprop1" } } +// { dg-final { scan-tree-dump "Removing dead call store stmt p1 =" "forwprop1" } } +// { dg-final { scan-tree-dump-times "Removing dead call store stmt" 1 "forwprop1" } } +// { dg-final { scan-tree-dump-times "Removing lhs of call stmt" 1 "forwprop1" } } + diff --git a/gcc/testsuite/g++.dg/tree-ssa/simple-dse-3.C b/gcc/testsuite/g++.dg/tree-ssa/simple-dse-3.C new file mode 100644 index 0000000..3b3bcc0 --- /dev/null +++ b/gcc/testsuite/g++.dg/tree-ssa/simple-dse-3.C @@ -0,0 +1,28 @@ +// { dg-do compile } +// { dg-options "-O2 -fexceptions -fdump-tree-forwprop1-details" } +// PR tree-optimization/122633 +struct s1 +{ + int f1[4]; + ~s1(){} +}; + +struct s1 func1(int a); +void func2(int a) +{ + struct s1 v1 = func1(a); +} + +__attribute__((pure)) +struct s1 pure1(int a); +void func3(int a) +{ + struct s1 p1 = pure1(a); +} + +// { dg-final { scan-tree-dump "Removing dead call store stmt p1 =" "forwprop1" } } +// { dg-final { scan-tree-dump-not "Removing dead call store stmt v1 =" "forwprop1" } } +// { dg-final { scan-tree-dump-not "Removing lhs of call stmt " "forwprop1" } } +// { dg-final { scan-tree-dump-times "Removing dead call store stmt" 1 "forwprop1" { target { ! c++26 } } } } +// { dg-final { scan-tree-dump-times "Removing dead call store stmt" 2 "forwprop1" { target c++26 } } } + diff --git a/gcc/testsuite/g++.dg/tree-ssa/simple-dse-4.C b/gcc/testsuite/g++.dg/tree-ssa/simple-dse-4.C new file mode 100644 index 0000000..1b9ad07 --- /dev/null +++ b/gcc/testsuite/g++.dg/tree-ssa/simple-dse-4.C @@ -0,0 +1,30 @@ +// { dg-do compile } +// { dg-options "-O2 -fexceptions -fdump-tree-forwprop1-details" } +// PR tree-optimization/122633 +struct s1 +{ + int f1[4]; +}; + +struct s1 func1(int a); +void func2(int a) +{ + struct s1 v1 = func1(a); +} + +__attribute__((pure)) +struct s1 pure1(int a); +void func3(int a) +{ + struct s1 p1 = pure1(a); +} + +// { dg-final { scan-tree-dump-not "Removing lhs of call stmt p1 =" "forwprop1" } } +// { dg-final { scan-tree-dump-not "Removing dead call store stmt v1 = func1" "forwprop1" } } +// { dg-final { scan-tree-dump "Removing lhs of call stmt v1 =" "forwprop1" } } +// { dg-final { scan-tree-dump "Removing dead call store stmt p1 =" "forwprop1" } } +// v1 has an DEFERRED_INIT associated with it (due to exceptions) +// { dg-final { scan-tree-dump-times "Removing dead call store stmt" 1 "forwprop1" { target { ! c++26 } } } } +// { dg-final { scan-tree-dump-times "Removing dead call store stmt" 2 "forwprop1" { target c++26 } } } +// { dg-final { scan-tree-dump-times "Removing lhs of call stmt" 1 "forwprop1" } } + diff --git a/gcc/testsuite/g++.dg/tree-ssa/string-strlen-1.C b/gcc/testsuite/g++.dg/tree-ssa/string-strlen-1.C new file mode 100644 index 0000000..fb7f9200 --- /dev/null +++ b/gcc/testsuite/g++.dg/tree-ssa/string-strlen-1.C @@ -0,0 +1,20 @@ +// { dg-do compile } */ +// { dg-additional-options "-fdump-tree-optimized -O2" } +// { dg-skip-if "requires hosted libstdc++ for string" { ! hostedlib } } +// PR tree-optimization/122754 + +#include <string> + +int g(void) +{ + std::string a="a"; + return __builtin_strlen(a.c_str()); +} + +// This should be optimized to just `return 1` without any +// references to struct string or any other variables. + +// { dg-final { scan-tree-dump-not "strlen " "optimized" } } +// { dg-final { scan-tree-dump-not "struct string" "optimized" } } +// { dg-final { scan-tree-dump "return 1" "optimized" } } + diff --git a/gcc/testsuite/g++.dg/uninit-pred-5.C b/gcc/testsuite/g++.dg/uninit-pred-5.C index 8dfd987..cffac6b 100644 --- a/gcc/testsuite/g++.dg/uninit-pred-5.C +++ b/gcc/testsuite/g++.dg/uninit-pred-5.C @@ -41,7 +41,7 @@ public: edit_distance_t __trans_tmp_1; if (m_best_candidate) { size_t candidate_len = m_best_candidate_len; - __trans_tmp_1 = get_edit_distance_cutoff(candidate_len); // { dg-warning "may be used uninitialized" } + __trans_tmp_1 = get_edit_distance_cutoff(candidate_len); // { dg-bogus "may be used uninitialized" } } edit_distance_t cutoff = __trans_tmp_1; if (cutoff) diff --git a/gcc/testsuite/g++.dg/vect/pr122647.cc b/gcc/testsuite/g++.dg/vect/pr122647.cc new file mode 100644 index 0000000..d7203bd --- /dev/null +++ b/gcc/testsuite/g++.dg/vect/pr122647.cc @@ -0,0 +1,18 @@ +// { dg-do compile } + +void av(float *au) +{ + for (int i = 0; i < 1024; ++i) + { + float t = i; + int tt = __builtin_bit_cast(int, t); + bool t1 = tt; + float t2 = t1; + int t3 = __builtin_bit_cast(int, t2); + bool t4 = t3; + float t5 = t5; + au[i] = t4; + } +} + +// { dg-final { scan-tree-dump "optimized: loop vectorized" "vect" { target { { vect_uintfloat_cvt && vect_float } && vect_bool_cmp } } } } diff --git a/gcc/testsuite/g++.dg/warn/Wkeyword-macro-1.C b/gcc/testsuite/g++.dg/warn/Wkeyword-macro-1.C index f47de7a..1e2e29c 100644 --- a/gcc/testsuite/g++.dg/warn/Wkeyword-macro-1.C +++ b/gcc/testsuite/g++.dg/warn/Wkeyword-macro-1.C @@ -95,15 +95,15 @@ #define override 1 // { dg-error "keyword 'override' defined as macro" "" { target c++26 } } #define post 1 #define pre 1 -#define replaceable_if_eligible 1 // { dg-error "keyword 'replaceable_if_eligible' defined as macro" "" { target c++26 } } -#define trivially_relocatable_if_eligible 1 // { dg-error "keyword 'trivially_relocatable_if_eligible' defined as macro" "" { target c++26 } } +#define replaceable_if_eligible +#define trivially_relocatable_if_eligible // [dcl.attr] #define assume 1 // { dg-error "keyword 'assume' defined as macro" "" { target c++26 } } #define carries_dependency 1 #define deprecated 1 // { dg-error "keyword 'deprecated' defined as macro" "" { target c++26 } } #define fallthrough 1 // { dg-error "keyword 'fallthrough' defined as macro" "" { target c++26 } } -#define indeterminate 1 +#define indeterminate 1 // { dg-error "keyword 'indeterminate' defined as macro" "" { target c++26 } } #define likely 1 // { dg-error "keyword 'likely' defined as macro" "" { target c++26 } } #define maybe_unused 1 // { dg-error "keyword 'maybe_unused' defined as macro" "" { target c++26 } } #define nodiscard 1 // { dg-error "keyword 'nodiscard' defined as macro" "" { target c++26 } } diff --git a/gcc/testsuite/g++.dg/warn/Wkeyword-macro-10.C b/gcc/testsuite/g++.dg/warn/Wkeyword-macro-10.C index e6fafcd..ec8c95e 100644 --- a/gcc/testsuite/g++.dg/warn/Wkeyword-macro-10.C +++ b/gcc/testsuite/g++.dg/warn/Wkeyword-macro-10.C @@ -17,7 +17,7 @@ #undef inline // { dg-warning "undefining keyword 'inline'" } #define inline __inline__ __attribute__((__always_inline__)) // { dg-warning "keyword 'inline' defined as macro" } #define likely(a) a -#undef likely // { dg-warning "undefining keyword 'likely'" "" { target c++20 } } +#undef likely #define unlikely(a, b, c) a + b + c #define unlikely(a, b, c) a + b + c -#undef unlikely // { dg-warning "undefining keyword 'unlikely'" "" { target c++20 } } +#undef unlikely diff --git a/gcc/testsuite/g++.dg/warn/Wkeyword-macro-2.C b/gcc/testsuite/g++.dg/warn/Wkeyword-macro-2.C index b1a9aa2..3e63c3e 100644 --- a/gcc/testsuite/g++.dg/warn/Wkeyword-macro-2.C +++ b/gcc/testsuite/g++.dg/warn/Wkeyword-macro-2.C @@ -95,15 +95,15 @@ #define override 1 // { dg-warning "keyword 'override' defined as macro" "" { target c++26 } } #define post 1 #define pre 1 -#define replaceable_if_eligible 1 // { dg-warning "keyword 'replaceable_if_eligible' defined as macro" "" { target c++26 } } -#define trivially_relocatable_if_eligible 1 // { dg-warning "keyword 'trivially_relocatable_if_eligible' defined as macro" "" { target c++26 } } +#define replaceable_if_eligible +#define trivially_relocatable_if_eligible // [dcl.attr] #define assume 1 // { dg-warning "keyword 'assume' defined as macro" "" { target c++26 } } #define carries_dependency 1 #define deprecated 1 // { dg-warning "keyword 'deprecated' defined as macro" "" { target c++26 } } #define fallthrough 1 // { dg-warning "keyword 'fallthrough' defined as macro" "" { target c++26 } } -#define indeterminate 1 +#define indeterminate 1 // { dg-warning "keyword 'indeterminate' defined as macro" "" { target c++26 } } #define likely 1 // { dg-warning "keyword 'likely' defined as macro" "" { target c++26 } } #define maybe_unused 1 // { dg-warning "keyword 'maybe_unused' defined as macro" "" { target c++26 } } #define nodiscard 1 // { dg-warning "keyword 'nodiscard' defined as macro" "" { target c++26 } } diff --git a/gcc/testsuite/g++.dg/warn/Wkeyword-macro-4.C b/gcc/testsuite/g++.dg/warn/Wkeyword-macro-4.C index 9ff974d..334508c 100644 --- a/gcc/testsuite/g++.dg/warn/Wkeyword-macro-4.C +++ b/gcc/testsuite/g++.dg/warn/Wkeyword-macro-4.C @@ -95,18 +95,18 @@ #undef override // { dg-error "undefining keyword 'override'" "" { target c++26 } } #undef post #undef pre -#undef replaceable_if_eligible // { dg-error "undefining keyword 'replaceable_if_eligible'" "" { target c++26 } } -#undef trivially_relocatable_if_eligible // { dg-error "undefining keyword 'trivially_relocatable_if_eligible'" "" { target c++26 } } +#undef replaceable_if_eligible +#undef trivially_relocatable_if_eligible // [dcl.attr] #undef assume // { dg-error "undefining keyword 'assume'" "" { target c++26 } } #undef carries_dependency #undef deprecated // { dg-error "undefining keyword 'deprecated'" "" { target c++26 } } #undef fallthrough // { dg-error "undefining keyword 'fallthrough'" "" { target c++26 } } -#undef indeterminate -#undef likely // { dg-error "undefining keyword 'likely'" "" { target c++26 } } +#undef indeterminate // { dg-error "undefining keyword 'indeterminate'" "" { target c++26 } } +#undef likely #undef maybe_unused // { dg-error "undefining keyword 'maybe_unused'" "" { target c++26 } } #undef nodiscard // { dg-error "undefining keyword 'nodiscard'" "" { target c++26 } } #undef noreturn // { dg-error "undefining keyword 'noreturn'" "" { target c++26 } } #undef no_unique_address // { dg-error "undefining keyword 'no_unique_address'" "" { target c++26 } } -#undef unlikely // { dg-error "undefining keyword 'unlikely'" "" { target c++26 } } +#undef unlikely diff --git a/gcc/testsuite/g++.dg/warn/Wkeyword-macro-5.C b/gcc/testsuite/g++.dg/warn/Wkeyword-macro-5.C index 657797b..87c5349 100644 --- a/gcc/testsuite/g++.dg/warn/Wkeyword-macro-5.C +++ b/gcc/testsuite/g++.dg/warn/Wkeyword-macro-5.C @@ -95,18 +95,18 @@ #undef override // { dg-warning "undefining keyword 'override'" "" { target c++26 } } #undef post #undef pre -#undef replaceable_if_eligible // { dg-warning "undefining keyword 'replaceable_if_eligible'" "" { target c++26 } } -#undef trivially_relocatable_if_eligible // { dg-warning "undefining keyword 'trivially_relocatable_if_eligible'" "" { target c++26 } } +#undef replaceable_if_eligible +#undef trivially_relocatable_if_eligible // [dcl.attr] #undef assume // { dg-warning "undefining keyword 'assume'" "" { target c++26 } } #undef carries_dependency #undef deprecated // { dg-warning "undefining keyword 'deprecated'" "" { target c++26 } } #undef fallthrough // { dg-warning "undefining keyword 'fallthrough'" "" { target c++26 } } -#undef indeterminate -#undef likely // { dg-warning "undefining keyword 'likely'" "" { target c++26 } } +#undef indeterminate // { dg-warning "undefining keyword 'indeterminate'" "" { target c++26 } } +#undef likely #undef maybe_unused // { dg-warning "undefining keyword 'maybe_unused'" "" { target c++26 } } #undef nodiscard // { dg-warning "undefining keyword 'nodiscard'" "" { target c++26 } } #undef noreturn // { dg-warning "undefining keyword 'noreturn'" "" { target c++26 } } #undef no_unique_address // { dg-warning "undefining keyword 'no_unique_address'" "" { target c++26 } } -#undef unlikely // { dg-warning "undefining keyword 'unlikely'" "" { target c++26 } } +#undef unlikely diff --git a/gcc/testsuite/g++.dg/warn/Wkeyword-macro-7.C b/gcc/testsuite/g++.dg/warn/Wkeyword-macro-7.C index 30a2c8d..66bfa46 100644 --- a/gcc/testsuite/g++.dg/warn/Wkeyword-macro-7.C +++ b/gcc/testsuite/g++.dg/warn/Wkeyword-macro-7.C @@ -95,15 +95,15 @@ #define override 1 // { dg-warning "keyword 'override' defined as macro" "" { target c++11 } } #define post 1 #define pre 1 -#define replaceable_if_eligible 1 // { dg-warning "keyword 'replaceable_if_eligible' defined as macro" "" { target c++26 } } -#define trivially_relocatable_if_eligible 1 // { dg-warning "keyword 'trivially_relocatable_if_eligible' defined as macro" "" { target c++26 } } +#define replaceable_if_eligible +#define trivially_relocatable_if_eligible // [dcl.attr] #define assume 1 // { dg-warning "keyword 'assume' defined as macro" "" { target c++23 } } #define carries_dependency 1 // { dg-warning "keyword 'carries_dependency' defined as macro" "" { target { c++11 && c++23_down } } } #define deprecated 1 // { dg-warning "keyword 'deprecated' defined as macro" "" { target c++14 } } #define fallthrough 1 // { dg-warning "keyword 'fallthrough' defined as macro" "" { target c++17 } } -#define indeterminate 1 +#define indeterminate 1 // { dg-warning "keyword 'indeterminate' defined as macro" "" { target c++26 } } #define likely 1 // { dg-warning "keyword 'likely' defined as macro" "" { target c++20 } } #define maybe_unused 1 // { dg-warning "keyword 'maybe_unused' defined as macro" "" { target c++17 } } #define nodiscard 1 // { dg-warning "keyword 'nodiscard' defined as macro" "" { target c++17 } } diff --git a/gcc/testsuite/g++.dg/warn/Wkeyword-macro-8.C b/gcc/testsuite/g++.dg/warn/Wkeyword-macro-8.C index 7dcc377..e7cc35d 100644 --- a/gcc/testsuite/g++.dg/warn/Wkeyword-macro-8.C +++ b/gcc/testsuite/g++.dg/warn/Wkeyword-macro-8.C @@ -95,18 +95,18 @@ #undef override // { dg-warning "undefining keyword 'override'" "" { target c++11 } } #undef post #undef pre -#undef replaceable_if_eligible // { dg-warning "undefining keyword 'replaceable_if_eligible'" "" { target c++26 } } -#undef trivially_relocatable_if_eligible // { dg-warning "undefining keyword 'trivially_relocatable_if_eligible'" "" { target c++26 } } +#undef replaceable_if_eligible +#undef trivially_relocatable_if_eligible // [dcl.attr] #undef assume // { dg-warning "undefining keyword 'assume'" "" { target c++23 } } #undef carries_dependency // { dg-warning "undefining keyword 'carries_dependency'" "" { target { c++11 && c++23_down } } } #undef deprecated // { dg-warning "undefining keyword 'deprecated'" "" { target c++14 } } #undef fallthrough // { dg-warning "undefining keyword 'fallthrough'" "" { target c++17 } } -#undef indeterminate -#undef likely // { dg-warning "undefining keyword 'likely'" "" { target c++20 } } +#undef indeterminate // { dg-warning "undefining keyword 'indeterminate'" "" { target c++26 } } +#undef likely #undef maybe_unused // { dg-warning "undefining keyword 'maybe_unused'" "" { target c++17 } } #undef nodiscard // { dg-warning "undefining keyword 'nodiscard'" "" { target c++17 } } #undef noreturn // { dg-warning "undefining keyword 'noreturn'" "" { target c++11 } } #undef no_unique_address // { dg-warning "undefining keyword 'no_unique_address'" "" { target c++20 } } -#undef unlikely // { dg-warning "undefining keyword 'unlikely'" "" { target c++20 } } +#undef unlikely diff --git a/gcc/testsuite/g++.dg/warn/Wkeyword-macro-9.C b/gcc/testsuite/g++.dg/warn/Wkeyword-macro-9.C index 741cdee..1145c65 100644 --- a/gcc/testsuite/g++.dg/warn/Wkeyword-macro-9.C +++ b/gcc/testsuite/g++.dg/warn/Wkeyword-macro-9.C @@ -17,6 +17,6 @@ #undef inline // { dg-error "undefining keyword 'inline'" "" { target c++26 } } #define inline __inline__ __attribute__((__always_inline__)) // { dg-error "keyword 'inline' defined as macro" "" { target c++26 } } #define likely(a) a -#undef likely // { dg-error "undefining keyword 'likely'" "" { target c++26 } } +#undef likely #define unlikely(a, b, c) a + b + c #define unlikely(a, b, c) a + b + c diff --git a/gcc/testsuite/g++.target/aarch64/dwarf-bit-stride-func.C b/gcc/testsuite/g++.target/aarch64/dwarf-bit-stride-func.C new file mode 100644 index 0000000..1917d91 --- /dev/null +++ b/gcc/testsuite/g++.target/aarch64/dwarf-bit-stride-func.C @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +// { dg-options "-g -dA" } +// { dg-final { scan-assembler-times "DW_AT_name: \"svbool_t\"" 1 } } +// { dg-final { scan-assembler-times ".byte 0x1 // DW_AT_bit_stride" 1 } } +// { dg-final { scan-assembler-times ".byte 0x1 // DW_AT_bit_size" 1 } } + +#include <arm_sve.h> + +[[gnu::target ("arch=armv9-a+sve")]] +void fun () +{ + volatile svbool_t pred8 = svwhilelt_b8_u32 (0u, 1u); + volatile svbool_t pred16 = svwhilelt_b16_u32 (0u, 3u); + volatile svbool_t pred32 = svwhilelt_b32_u32 (0u, 7u); + volatile svbool_t pred64 = svwhilelt_b64_u32 (0u, 11u); +} diff --git a/gcc/testsuite/g++.target/aarch64/dwarf-bit-stride-pragma-sme.C b/gcc/testsuite/g++.target/aarch64/dwarf-bit-stride-pragma-sme.C new file mode 100644 index 0000000..4b73cbc --- /dev/null +++ b/gcc/testsuite/g++.target/aarch64/dwarf-bit-stride-pragma-sme.C @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +// { dg-options "-g -dA" } +// { dg-final { scan-assembler-times "DW_AT_name: \"svbool_t\"" 1 } } +// { dg-final { scan-assembler-times "DW_AT_name: \"svcount_t\"" 1 } } +// { dg-final { scan-assembler-times ".byte 0x1 // DW_AT_bit_stride" 1 } } +// { dg-final { scan-assembler-times ".byte 0x1 // DW_AT_bit_size" 1 } } + +#include <arm_sme.h> + +#pragma GCC target "+sve2p1+sme2" + +void fun () +{ + volatile svbool_t pred; + volatile svcount_t count; +} diff --git a/gcc/testsuite/g++.target/aarch64/dwarf-bit-stride-pragma.C b/gcc/testsuite/g++.target/aarch64/dwarf-bit-stride-pragma.C new file mode 100644 index 0000000..64b02cc --- /dev/null +++ b/gcc/testsuite/g++.target/aarch64/dwarf-bit-stride-pragma.C @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +// { dg-options "-g -dA" } +// { dg-final { scan-assembler-times "DW_AT_name: \"svbool_t\"" 1 } } +// { dg-final { scan-assembler-times ".byte 0x1 // DW_AT_bit_stride" 1 } } +// { dg-final { scan-assembler-times ".byte 0x1 // DW_AT_bit_size" 1 } } + +#include <arm_sve.h> + +#pragma GCC target "+sve" + +void fun () +{ + volatile svbool_t pred8 = svwhilelt_b8_u32 (0u, 1u); + volatile svbool_t pred16 = svwhilelt_b16_u32 (0u, 3u); + volatile svbool_t pred32 = svwhilelt_b32_u32 (0u, 7u); + volatile svbool_t pred64 = svwhilelt_b64_u32 (0u, 11u); +} diff --git a/gcc/testsuite/g++.target/aarch64/mv-cpu-features.C b/gcc/testsuite/g++.target/aarch64/mv-cpu-features.C index ad6accd..56e2916 100644 --- a/gcc/testsuite/g++.target/aarch64/mv-cpu-features.C +++ b/gcc/testsuite/g++.target/aarch64/mv-cpu-features.C @@ -41,6 +41,14 @@ int impl () #define _IFUNC_ARG_HWCAP (1ULL << 62) #endif +#ifndef HWCAP_ATOMICS +#define HWCAP_ATOMICS (1 << 8) +#endif + +#ifndef HWCAP2_RNG +#define HWCAP2_RNG (1 << 16) +#endif + extern "C" void __init_cpu_features_resolver (unsigned long hwcap, const ifunc_arg_t *arg); diff --git a/gcc/testsuite/g++.target/aarch64/pr122890.C b/gcc/testsuite/g++.target/aarch64/pr122890.C new file mode 100644 index 0000000..2b74264 --- /dev/null +++ b/gcc/testsuite/g++.target/aarch64/pr122890.C @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-march=armv8-a -std=c++11 -Ofast" } */ + +#include <vector> + +int foo() +{ + bool xs[] = { true, true, false, true }; + bool s[] = { true, true, false }; + std::vector<bool> x(xs, xs+4); + std::vector<bool> g(s, s+3); + g.push_back(true); + if (g != x) + __builtin_abort(); + return 0; +} diff --git a/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_1.C b/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_1.C index cdd48cb..83d63e3 100644 --- a/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_1.C +++ b/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_1.C @@ -5,9 +5,13 @@ typedef uint8_t gnu_uint8_t __attribute__ ((vector_size (32))); typedef int8_t gnu_int8_t __attribute__ ((vector_size (32))); +typedef int32_t gnu128_int32_t __attribute__ ((vector_size (128))); +typedef int32_t gnu32_int32_t __attribute__ ((vector_size (32))); + void -f (svuint8_t sve_u1, svint8_t sve_s1, - gnu_uint8_t gnu_u1, gnu_int8_t gnu_s1, int n, unsigned char uc) +f (svuint8_t sve_u1, svint8_t sve_s1, svbool_t sve_b1, svbool_t sve_b2, + gnu_uint8_t gnu_u1, gnu_int8_t gnu_s1, gnu128_int32_t gnu128_s1, + int n, unsigned char uc) { // Initialization @@ -56,6 +60,20 @@ f (svuint8_t sve_u1, svint8_t sve_s1, gnu_uint8_t init_gnu_u20 (sve_s1); // { dg-error {cannot convert 'svint8_t' to 'gnu_uint8_t'[^\n]* in initialization} } gnu_uint8_t init_gnu_u21 (gnu_s1); // { dg-error {cannot convert 'gnu_int8_t'[^\n]* to 'gnu_uint8_t'[^\n]* in initialization} } + // Boolean inits. + svbool_t init_sve_b1 = 0; // { dg-error {cannot convert 'int' to 'svbool_t'} } + svbool_t init_sve_b2 = {}; + svbool_t init_sve_b3 = { sve_b1 }; + svbool_t init_sve_b4 = { gnu_u1 }; // { dg-error {cannot convert 'gnu_uint8_t'[^\n]* to 'signed char:1'} } + svbool_t init_sve_b5 = { sve_s1 }; // { dg-error {cannot convert 'svint8_t' to 'signed char:1'} } + svbool_t init_sve_b6 = { gnu_s1 }; // { dg-error {cannot convert 'gnu_int8_t'[^\n]* to 'signed char:1'} } + svbool_t init_sve_b7 = { 0 }; + + svbool_t init_sve_b8 = { sve_u1, sve_u1 }; // { dg-error {cannot convert 'svuint8_t' to 'signed char:1'} } + svbool_t init_sve_b9 = { gnu_u1, gnu_u1 }; // { dg-error {cannot convert 'gnu_uint8_t'[^\n]* to 'signed char:1'} } + init_gnu_u8 = { sve_b1 }; // { dg-error {cannot convert '<brace-enclosed initializer list>' to 'gnu_uint8_t'[^\n]*} } + init_gnu_u8 = { sve_b1, sve_b1 }; // { dg-error {cannot convert '<brace-enclosed initializer list>' to 'gnu_uint8_t'[^\n]*} } + // Compound literals (svuint8_t) {}; @@ -76,6 +94,17 @@ f (svuint8_t sve_u1, svint8_t sve_s1, (gnu_uint8_t) { sve_u1, sve_u1 }; // { dg-error {cannot convert 'svuint8_t' to 'unsigned char' in initialization} } (gnu_uint8_t) { gnu_u1, gnu_u1 }; // { dg-error {cannot convert 'gnu_uint8_t'[^\n]* to 'unsigned char' in initialization} } + // Boolean compound literals. + + (svbool_t) {}; + (svbool_t) { 0 }; + (svbool_t) { sve_b1 }; + (svbool_t) { gnu_u1 }; // { dg-error {cannot convert 'gnu_uint8_t'[^\n]* to 'signed char:1'} } + (svbool_t) { sve_s1 }; // { dg-error {cannot convert 'svint8_t' to 'signed char:1'} } + (svbool_t) { sve_u1 }; // { dg-error {cannot convert 'svuint8_t' to 'signed char:1'} } + (svbool_t) { gnu_s1 }; // { dg-error {cannot convert 'gnu_int8_t'[^\n]* to 'signed char:1'} } + (gnu_uint8_t) { sve_b1 }; // { dg-error {cannot convert 'svbool_t' to 'unsigned char'} } + // Assignment sve_u1 = 0; // { dg-error {cannot convert 'int' to 'svuint8_t' in assignment} } @@ -90,6 +119,14 @@ f (svuint8_t sve_u1, svint8_t sve_s1, gnu_u1 = sve_s1; // { dg-error {cannot convert 'svint8_t' to 'gnu_uint8_t'[^\n]* in assignment} } gnu_u1 = gnu_s1; // { dg-error {cannot convert 'gnu_int8_t'[^\n]* to 'gnu_uint8_t'[^\n]* in assignment} } + // Boolean Assignments. + + sve_b1 = 0; // { dg-error {cannot convert 'int' to 'svbool_t'} } + sve_b1 = sve_b1; + sve_b1 = sve_s1; // { dg-error {cannot convert 'svint8_t' to 'svbool_t'} } + sve_b1 = gnu_s1; // { dg-error {cannot convert 'gnu_int8_t'[^\n]* to 'svbool_t'} } + gnu_u1 = sve_b1; // { dg-error {cannot convert 'svbool_t' to 'gnu_uint8_t'} } + // Casts (void) sve_u1; @@ -112,6 +149,17 @@ f (svuint8_t sve_u1, svint8_t sve_s1, (gnu_uint8_t) sve_s1; (gnu_uint8_t) gnu_s1; + // Boolean casts. + (void) sve_b1; + (svbool_t) sve_b1; + (svbool_t) gnu_u1; // { dg-error {cannot convert a value of type 'gnu_uint8_t'[^\n]* to vector type 'svbool_t' which has different size} } + (svbool_t) sve_u1; // { dg-error {cannot convert a value of type 'svuint8_t' to vector type 'svbool_t' which has different size} } + (svbool_t) 0; + (svbool_t) n; + (svint8_t) sve_b1; // { dg-error {cannot convert a value of type 'svbool_t' to vector type 'svint8_t' which has different size} } + (gnu_uint8_t) sve_b1; // { dg-error {cannot convert a value of type 'svbool_t' to vector type 'gnu_uint8_t'[^\n]* which has different size} } + (gnu_int8_t) sve_b1; // { dg-error {cannot convert a value of type 'svbool_t' to vector type 'gnu_int8_t'[^\n]* which has different size} } + // Vector indexing. sve_u1[0]; @@ -147,6 +195,20 @@ f (svuint8_t sve_u1, svint8_t sve_s1, gnu_u1++; gnu_u1--; + // Boolean unary ops. + + +sve_b1; + -sve_b1; // { dg-error {negation operation not permitted} } + ~sve_b1; + !sve_b1; + *sve_b1; // { dg-error {invalid type argument of unary '\*'} } + __real sve_b1; // { dg-error {wrong type argument to __real} } + __imag sve_b1; // { dg-error {wrong type argument to __imag} } + ++sve_b1; // { dg-error {not permitted} } + --sve_b1; // { dg-error {not permitted} } + sve_b1++; // { dg-error {not permitted} } + sve_b1--; // { dg-error {not permitted} } + // Vector-vector binary arithmetic. sve_u1 + sve_u1; @@ -169,6 +231,27 @@ f (svuint8_t sve_u1, svint8_t sve_s1, sve_u1 && sve_u1; sve_u1 || sve_u1; + // Boolean vector-vector binary arithmetic. + + sve_b1 + sve_b1; // { dg-error {not permitted} } + sve_b1 - sve_b1; // { dg-error {not permitted} } + sve_b1 * sve_b1; // { dg-error {not permitted} } + sve_b1 / sve_b1; // { dg-error {not permitted} } + sve_b1 % sve_b1; // { dg-error {invalid operands} } + sve_b1 & sve_b1; + sve_b1 | sve_b1; + sve_b1 ^ sve_b1; + sve_b1 == sve_b1; + sve_b1 != sve_b1; + sve_b1 <= sve_b1; // { dg-error {only == and != operations permitted} } + sve_b1 < sve_b1; // { dg-error {only == and != operations permitted} } + sve_b1 > sve_b1; // { dg-error {only == and != operations permitted} } + sve_b1 >= sve_b1; // { dg-error {only == and != operations permitted} } + sve_b1 << sve_b1; // { dg-error {not permitted} } + sve_b1 >> sve_b1; // { dg-error {not permitted} } + sve_b1 && sve_b1; + sve_b1 || sve_b1; + sve_u1 + gnu_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } sve_u1 - gnu_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } sve_u1 * gnu_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } @@ -456,6 +539,25 @@ f (svuint8_t sve_u1, svint8_t sve_s1, gnu_u1 ? gnu_u1 : uc; gnu_u1 ? uc : gnu_u1; + // Boolean conditional expressions. + + uc ? sve_b1 : sve_b2; + sve_b1 ? sve_b1 : sve_b2; + + sve_b1 ? sve_u1 : sve_u1; // { dg-error {incompatible vector types in conditional expression} } + sve_b1 ? sve_s1 : sve_s1; // { dg-error {incompatible vector types in conditional expression} } + sve_b1 ? gnu_u1 : sve_u1; // { dg-error {incompatible vector types in conditional expression} } + sve_b1 ? sve_u1 : gnu_u1; // { dg-error {incompatible vector types in conditional expression} } + sve_b1 ? gnu_u1 : gnu_u1; // { dg-error {incompatible vector types in conditional expression} } + sve_b1 ? gnu_s1 : gnu_s1; // { dg-error {incompatible vector types in conditional expression} } + + sve_u1 ? sve_b1 : sve_b2; // { dg-error {incompatible vector types in conditional expression} } + sve_s1 ? sve_b1 : sve_b2; // { dg-error {incompatible vector types in conditional expression} } + gnu_u1 ? sve_b1 : sve_b2; // { dg-error {incompatible vector types in conditional expression} } + gnu_s1 ? sve_b1 : sve_b2; // { dg-error {incompatible vector types in conditional expression} } + gnu_u1 ? gnu_u1 : sve_b1; // { dg-error {incompatible vector types in conditional expression} } + gnu_u1 ? sve_b1 : gnu_u1; // { dg-error {incompatible vector types in conditional expression} } + // Vector built-ins. __builtin_shuffle (sve_u1, sve_u1, sve_u1); @@ -469,6 +571,33 @@ f (svuint8_t sve_u1, svint8_t sve_s1, __builtin_convertvector (sve_u1, gnu_uint8_t); __builtin_convertvector (gnu_u1, gnu_uint8_t); + // Boolean vector built-ins. + + __builtin_shuffle (sve_b1, sve_b1, sve_s1); + __builtin_shuffle (sve_b1, sve_b1, sve_u1); + __builtin_shuffle (sve_b1, sve_b1, gnu_s1); + __builtin_shuffle (sve_b1, sve_b1, gnu_u1); + + __builtin_shuffle (sve_b1, gnu_u1, gnu_u1); // { dg-error {'__builtin_shuffle' argument vectors must be of the same type} } + __builtin_shuffle (gnu_u1, sve_b1, gnu_u1); // { dg-error {'__builtin_shuffle' argument vectors must be of the same type} } + + __builtin_convertvector (sve_b1, svint8_t); + __builtin_convertvector (sve_b1, svuint8_t); + __builtin_convertvector (sve_b1, gnu_int8_t); + __builtin_convertvector (sve_b1, gnu_uint8_t); + + __builtin_convertvector (sve_s1, svbool_t); + __builtin_convertvector (gnu_s1, svbool_t); + __builtin_convertvector (sve_u1, svbool_t); + __builtin_convertvector (gnu_u1, svbool_t); + + __builtin_convertvector (sve_b1, svint32_t); /* { dg-error {'__builtin_convertvector' number of elements of the first argument vector and the second argument vector type should be the same} } */ + __builtin_convertvector (sve_b1, svuint32_t); /* { dg-error {'__builtin_convertvector' number of elements of the first argument vector and the second argument vector type should be the same} } */ + __builtin_convertvector (sve_b1, gnu32_int32_t); /* { dg-error {'__builtin_convertvector' number of elements of the first argument vector and the second argument vector type should be the same} } */ + + __builtin_convertvector (sve_b1, gnu128_int32_t); + __builtin_convertvector (gnu128_s1, svbool_t); + // Type queries. static_assert(__is_literal_type(svuint8_t)); diff --git a/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_2.C b/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_2.C index 587d28d..fd15019 100644 --- a/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_2.C +++ b/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_2.C @@ -5,9 +5,13 @@ typedef uint8_t gnu_uint8_t __attribute__ ((vector_size (32))); typedef int8_t gnu_int8_t __attribute__ ((vector_size (32))); +typedef int32_t gnu128_int32_t __attribute__ ((vector_size (128))); +typedef int32_t gnu32_int32_t __attribute__ ((vector_size (32))); + void -f (svuint8_t sve_u1, svint8_t sve_s1, - gnu_uint8_t gnu_u1, gnu_int8_t gnu_s1, int n, unsigned char uc) +f (svuint8_t sve_u1, svint8_t sve_s1, svbool_t sve_b1, svbool_t sve_b2, + gnu_uint8_t gnu_u1, gnu_int8_t gnu_s1, gnu128_int32_t gnu128_s1, + int n, unsigned char uc) { // Initialization @@ -56,6 +60,20 @@ f (svuint8_t sve_u1, svint8_t sve_s1, gnu_uint8_t init_gnu_u20 (sve_s1); gnu_uint8_t init_gnu_u21 (gnu_s1); + // Boolean inits. + svbool_t init_sve_b1 = 0; // { dg-error {cannot convert 'int' to 'svbool_t'} } + svbool_t init_sve_b2 = {}; + svbool_t init_sve_b3 = { sve_b1 }; + svbool_t init_sve_b4 = { gnu_u1 }; // { dg-error {cannot convert 'gnu_uint8_t'[^\n]* to 'signed char:1'} } + svbool_t init_sve_b5 = { sve_s1 }; // { dg-error {cannot convert 'svint8_t' to 'signed char:1'} } + svbool_t init_sve_b6 = { gnu_s1 }; // { dg-error {cannot convert 'gnu_int8_t'[^\n]* to 'signed char:1'} } + svbool_t init_sve_b7 = { 0 }; + + svbool_t init_sve_b8 = { sve_u1, sve_u1 }; // { dg-error {cannot convert 'svuint8_t' to 'signed char:1'} } + svbool_t init_sve_b9 = { gnu_u1, gnu_u1 }; // { dg-error {cannot convert 'gnu_uint8_t'[^\n]* to 'signed char:1'} } + init_gnu_u8 = { sve_b1 }; // { dg-error {cannot convert '<brace-enclosed initializer list>' to 'gnu_uint8_t'[^\n]*} } + init_gnu_u8 = { sve_b1, sve_b1 }; // { dg-error {cannot convert '<brace-enclosed initializer list>' to 'gnu_uint8_t'[^\n]*} } + // Compound literals (svuint8_t) {}; @@ -76,6 +94,17 @@ f (svuint8_t sve_u1, svint8_t sve_s1, (gnu_uint8_t) { sve_u1, sve_u1 }; // { dg-error {cannot convert 'svuint8_t' to 'unsigned char' in initialization} } (gnu_uint8_t) { gnu_u1, gnu_u1 }; // { dg-error {cannot convert 'gnu_uint8_t'[^\n]* to 'unsigned char' in initialization} } + // Boolean compound literals. + + (svbool_t) {}; + (svbool_t) { 0 }; + (svbool_t) { sve_b1 }; + (svbool_t) { gnu_u1 }; // { dg-error {cannot convert 'gnu_uint8_t'[^\n]* to 'signed char:1'} } + (svbool_t) { sve_s1 }; // { dg-error {cannot convert 'svint8_t' to 'signed char:1'} } + (svbool_t) { sve_u1 }; // { dg-error {cannot convert 'svuint8_t' to 'signed char:1'} } + (svbool_t) { gnu_s1 }; // { dg-error {cannot convert 'gnu_int8_t'[^\n]* to 'signed char:1'} } + (gnu_uint8_t) { sve_b1 }; // { dg-error {cannot convert 'svbool_t' to 'unsigned char'} } + // Assignment sve_u1 = 0; // { dg-error {cannot convert 'int' to 'svuint8_t' in assignment} } @@ -90,6 +119,14 @@ f (svuint8_t sve_u1, svint8_t sve_s1, gnu_u1 = sve_s1; gnu_u1 = gnu_s1; + // Boolean Assignments. + + sve_b1 = 0; // { dg-error {cannot convert 'int' to 'svbool_t'} } + sve_b1 = sve_b1; + sve_b1 = sve_s1; // { dg-error {cannot convert 'svint8_t' to 'svbool_t'} } + sve_b1 = gnu_s1; // { dg-error {cannot convert 'gnu_int8_t'[^\n]* to 'svbool_t'} } + gnu_u1 = sve_b1; // { dg-error {cannot convert 'svbool_t' to 'gnu_uint8_t'} } + // Casts (void) sve_u1; @@ -112,6 +149,17 @@ f (svuint8_t sve_u1, svint8_t sve_s1, (gnu_uint8_t) sve_s1; (gnu_uint8_t) gnu_s1; + // Boolean casts. + (void) sve_b1; + (svbool_t) sve_b1; + (svbool_t) gnu_u1; // { dg-error {cannot convert a value of type 'gnu_uint8_t'[^\n]* to vector type 'svbool_t' which has different size} } + (svbool_t) sve_u1; // { dg-error {cannot convert a value of type 'svuint8_t' to vector type 'svbool_t' which has different size} } + (svbool_t) 0; + (svbool_t) n; + (svint8_t) sve_b1; // { dg-error {cannot convert a value of type 'svbool_t' to vector type 'svint8_t' which has different size} } + (gnu_uint8_t) sve_b1; // { dg-error {cannot convert a value of type 'svbool_t' to vector type 'gnu_uint8_t'[^\n]* which has different size} } + (gnu_int8_t) sve_b1; // { dg-error {cannot convert a value of type 'svbool_t' to vector type 'gnu_int8_t'[^\n]* which has different size} } + // Vector indexing. sve_u1[0]; @@ -147,6 +195,20 @@ f (svuint8_t sve_u1, svint8_t sve_s1, gnu_u1++; gnu_u1--; + // Boolean unary ops. + + +sve_b1; + -sve_b1; // { dg-error {negation operation not permitted} } + ~sve_b1; + !sve_b1; + *sve_b1; // { dg-error {invalid type argument of unary '\*'} } + __real sve_b1; // { dg-error {wrong type argument to __real} } + __imag sve_b1; // { dg-error {wrong type argument to __imag} } + ++sve_b1; // { dg-error {not permitted} } + --sve_b1; // { dg-error {not permitted} } + sve_b1++; // { dg-error {not permitted} } + sve_b1--; // { dg-error {not permitted} } + // Vector-vector binary arithmetic. sve_u1 + sve_u1; @@ -169,6 +231,27 @@ f (svuint8_t sve_u1, svint8_t sve_s1, sve_u1 && sve_u1; sve_u1 || sve_u1; + // Boolean vector-vector binary arithmetic. + + sve_b1 + sve_b1; // { dg-error {not permitted} } + sve_b1 - sve_b1; // { dg-error {not permitted} } + sve_b1 * sve_b1; // { dg-error {not permitted} } + sve_b1 / sve_b1; // { dg-error {not permitted} } + sve_b1 % sve_b1; // { dg-error {invalid operands} } + sve_b1 & sve_b1; + sve_b1 | sve_b1; + sve_b1 ^ sve_b1; + sve_b1 == sve_b1; + sve_b1 != sve_b1; + sve_b1 <= sve_b1; // { dg-error {only == and != operations permitted} } + sve_b1 < sve_b1; // { dg-error {only == and != operations permitted} } + sve_b1 > sve_b1; // { dg-error {only == and != operations permitted} } + sve_b1 >= sve_b1; // { dg-error {only == and != operations permitted} } + sve_b1 << sve_b1; // { dg-error {not permitted} } + sve_b1 >> sve_b1; // { dg-error {not permitted} } + sve_b1 && sve_b1; + sve_b1 || sve_b1; + sve_u1 + gnu_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } sve_u1 - gnu_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } sve_u1 * gnu_u1; // { dg-error {cannot combine GNU and SVE vectors in a binary operation} } @@ -456,6 +539,25 @@ f (svuint8_t sve_u1, svint8_t sve_s1, gnu_u1 ? gnu_u1 : uc; gnu_u1 ? uc : gnu_u1; + // Boolean conditional expressions. + + uc ? sve_b1 : sve_b2; + sve_b1 ? sve_b1 : sve_b2; + + sve_b1 ? sve_u1 : sve_u1; // { dg-error {incompatible vector types in conditional expression} } + sve_b1 ? sve_s1 : sve_s1; // { dg-error {incompatible vector types in conditional expression} } + sve_b1 ? gnu_u1 : sve_u1; // { dg-error {incompatible vector types in conditional expression} } + sve_b1 ? sve_u1 : gnu_u1; // { dg-error {incompatible vector types in conditional expression} } + sve_b1 ? gnu_u1 : gnu_u1; // { dg-error {incompatible vector types in conditional expression} } + sve_b1 ? gnu_s1 : gnu_s1; // { dg-error {incompatible vector types in conditional expression} } + + sve_u1 ? sve_b1 : sve_b2; // { dg-error {incompatible vector types in conditional expression} } + sve_s1 ? sve_b1 : sve_b2; // { dg-error {incompatible vector types in conditional expression} } + gnu_u1 ? sve_b1 : sve_b2; // { dg-error {incompatible vector types in conditional expression} } + gnu_s1 ? sve_b1 : sve_b2; // { dg-error {incompatible vector types in conditional expression} } + gnu_u1 ? gnu_u1 : sve_b1; // { dg-error {incompatible vector types in conditional expression} } + gnu_u1 ? sve_b1 : gnu_u1; // { dg-error {incompatible vector types in conditional expression} } + // Vector built-ins. __builtin_shuffle (sve_u1, sve_u1, sve_u1); @@ -469,6 +571,33 @@ f (svuint8_t sve_u1, svint8_t sve_s1, __builtin_convertvector (sve_u1, gnu_uint8_t); __builtin_convertvector (gnu_u1, gnu_uint8_t); + // Boolean vector built-ins. + + __builtin_shuffle (sve_b1, sve_b1, sve_s1); + __builtin_shuffle (sve_b1, sve_b1, sve_u1); + __builtin_shuffle (sve_b1, sve_b1, gnu_s1); + __builtin_shuffle (sve_b1, sve_b1, gnu_u1); + + __builtin_shuffle (sve_b1, gnu_u1, gnu_u1); // { dg-error {'__builtin_shuffle' argument vectors must be of the same type} } + __builtin_shuffle (gnu_u1, sve_b1, gnu_u1); // { dg-error {'__builtin_shuffle' argument vectors must be of the same type} } + + __builtin_convertvector (sve_b1, svint8_t); + __builtin_convertvector (sve_b1, svuint8_t); + __builtin_convertvector (sve_b1, gnu_int8_t); + __builtin_convertvector (sve_b1, gnu_uint8_t); + + __builtin_convertvector (sve_s1, svbool_t); + __builtin_convertvector (gnu_s1, svbool_t); + __builtin_convertvector (sve_u1, svbool_t); + __builtin_convertvector (gnu_u1, svbool_t); + + __builtin_convertvector (sve_b1, svint32_t); /* { dg-error {'__builtin_convertvector' number of elements of the first argument vector and the second argument vector type should be the same} } */ + __builtin_convertvector (sve_b1, svuint32_t); /* { dg-error {'__builtin_convertvector' number of elements of the first argument vector and the second argument vector type should be the same} } */ + __builtin_convertvector (sve_b1, gnu32_int32_t); /* { dg-error {'__builtin_convertvector' number of elements of the first argument vector and the second argument vector type should be the same} } */ + + __builtin_convertvector (sve_b1, gnu128_int32_t); + __builtin_convertvector (gnu128_s1, svbool_t); + // Type queries. static_assert(__is_literal_type(svuint8_t)); diff --git a/gcc/testsuite/g++.target/aarch64/sve/dwarf-bit-stride.C b/gcc/testsuite/g++.target/aarch64/sve/dwarf-bit-stride.C new file mode 100644 index 0000000..80224d4 --- /dev/null +++ b/gcc/testsuite/g++.target/aarch64/sve/dwarf-bit-stride.C @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +// { dg-options "-g -dA" } +// { dg-final { scan-assembler-times "DW_AT_name: \"svbool_t\"" 1 } } +// { dg-final { scan-assembler-times ".byte 0x1 // DW_AT_bit_stride" 1 } } +// { dg-final { scan-assembler-times ".byte 0x1 // DW_AT_bit_size" 1 } } + +#include <arm_sve.h> + +void fun () +{ + volatile svbool_t pred8 = svwhilelt_b8_u32 (0u, 1u); + volatile svbool_t pred16 = svwhilelt_b16_u32 (0u, 3u); + volatile svbool_t pred32 = svwhilelt_b32_u32 (0u, 7u); + volatile svbool_t pred64 = svwhilelt_b64_u32 (0u, 11u); +} diff --git a/gcc/testsuite/g++.target/arm/mve/general-c++/nomve_fp_1.c b/gcc/testsuite/g++.target/arm/mve/general-c++/nomve_fp_1.c index fd8c05b..4b91e0c 100644 --- a/gcc/testsuite/g++.target/arm/mve/general-c++/nomve_fp_1.c +++ b/gcc/testsuite/g++.target/arm/mve/general-c++/nomve_fp_1.c @@ -12,6 +12,6 @@ void f1 (uint8x16_t v) { - vreinterpretq_f16 (v); /* { dg-error {ACLE function 'void vreinterpretq_f16\(uint8x16_t\)' requires ISA extension 'mve.fp'} } */ + vreinterpretq_f16 (v); /* { dg-error {ACLE function 'float16x8_t vreinterpretq_f16\(uint8x16_t\)' requires ISA extension 'mve.fp'} } */ /* { dg-message {note: you can enable mve.fp by using the command-line option '-march', or by using the 'target' attribute or pragma} "" {target *-*-*} .-1 } */ } diff --git a/gcc/testsuite/g++.target/i386/avx512-pr71921.C b/gcc/testsuite/g++.target/i386/avx512-pr71921.C new file mode 100644 index 0000000..a3e458f --- /dev/null +++ b/gcc/testsuite/g++.target/i386/avx512-pr71921.C @@ -0,0 +1,60 @@ +// PR target/116925 +// { dg-do compile } +// { dg-options "-O2 -march=x86-64-v4" } +// { dg-final { scan-assembler-not "vcmpltps" } } +// { dg-final { scan-assembler-times "vminps" 2 } } +// { dg-final { scan-assembler-times "vmaxps" 2 } } + +#include <vector> + +void relu(float * __restrict__ output, const float * __restrict__ input, int size) +{ + int i; + int s2; + + s2 = size / 4; + for (i = 0; i < 10000; i++) { + float t; + t = input[i]; + output[i] = std::max(t, float(0)); + } +} + +void relu1(float * __restrict__ output, const float * __restrict__ input, int size) +{ + int i; + int s2; + + s2 = size / 4; + for (i = 0; i < 10000; i++) { + float t; + t = input[i]; + output[i] = std::max(float(0), t); + } +} + +void relu2(float * __restrict__ output, const float * __restrict__ input, int size) +{ + int i; + int s2; + + s2 = size / 4; + for (i = 0; i < 10000; i++) { + float t; + t = input[i]; + output[i] = std::min(t, float(0)); + } +} + +void relu3(float * __restrict__ output, const float * __restrict__ input, int size) +{ + int i; + int s2; + + s2 = size / 4; + for (i = 0; i < 10000; i++) { + float t; + t = input[i]; + output[i] = std::min(float(0), t); + } +} diff --git a/gcc/testsuite/g++.target/i386/cf_check-3.C b/gcc/testsuite/g++.target/i386/cf_check-3.C index 79d3a25..56107da 100644 --- a/gcc/testsuite/g++.target/i386/cf_check-3.C +++ b/gcc/testsuite/g++.target/i386/cf_check-3.C @@ -1,5 +1,6 @@ /* { dg-do compile { target { "i?86-*-* x86_64-*-*" } } } */ /* { dg-options "-O2 -fcf-protection" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target "*-*-*" } {^\t?\.} } } */ diff --git a/gcc/testsuite/g++.target/i386/cf_check-4.C b/gcc/testsuite/g++.target/i386/cf_check-4.C index 57c40a5..fc7eb73 100644 --- a/gcc/testsuite/g++.target/i386/cf_check-4.C +++ b/gcc/testsuite/g++.target/i386/cf_check-4.C @@ -1,6 +1,7 @@ /* { dg-do compile { target { "i?86-*-* x86_64-*-*" } } } */ /* { dg-require-weak "" } */ /* { dg-options "-O2 -fcf-protection" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target "*-*-*" } {^\t?\.} } } */ diff --git a/gcc/testsuite/g++.target/i386/memset-pr101366-1.C b/gcc/testsuite/g++.target/i386/memset-pr101366-1.C index 5b1c7b5..7976742 100644 --- a/gcc/testsuite/g++.target/i386/memset-pr101366-1.C +++ b/gcc/testsuite/g++.target/i386/memset-pr101366-1.C @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -march=x86-64-v2 -std=gnu++17 -fasynchronous-unwind-tables -fdwarf2-cfi-asm" } */ +/* { dg-options "-O3 -march=x86-64-v2 -std=gnu++17" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/g++.target/i386/memset-pr101366-2.C b/gcc/testsuite/g++.target/i386/memset-pr101366-2.C index 0e06eec..b087095 100644 --- a/gcc/testsuite/g++.target/i386/memset-pr101366-2.C +++ b/gcc/testsuite/g++.target/i386/memset-pr101366-2.C @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -march=x86-64-v2 -std=gnu++17 -fasynchronous-unwind-tables -fdwarf2-cfi-asm" } */ +/* { dg-options "-O3 -march=x86-64-v2 -std=gnu++17" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/g++.target/i386/memset-pr108585-1a.C b/gcc/testsuite/g++.target/i386/memset-pr108585-1a.C index 440771a..8060324 100644 --- a/gcc/testsuite/g++.target/i386/memset-pr108585-1a.C +++ b/gcc/testsuite/g++.target/i386/memset-pr108585-1a.C @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -march=x86-64 -std=c++20 -fasynchronous-unwind-tables -fdwarf2-cfi-asm -mno-stackrealign -fomit-frame-pointer -DUSE_CHAR" } */ +/* { dg-options "-O3 -march=x86-64 -std=c++20 -mno-stackrealign -fomit-frame-pointer -DUSE_CHAR" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/g++.target/i386/memset-pr108585-1b.C b/gcc/testsuite/g++.target/i386/memset-pr108585-1b.C index cabd3c2..0e79265 100644 --- a/gcc/testsuite/g++.target/i386/memset-pr108585-1b.C +++ b/gcc/testsuite/g++.target/i386/memset-pr108585-1b.C @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -march=x86-64 -std=c++20 -fasynchronous-unwind-tables -fdwarf2-cfi-asm -mno-stackrealign -fomit-frame-pointer" } */ +/* { dg-options "-O3 -march=x86-64 -std=c++20 -mno-stackrealign -fomit-frame-pointer" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/g++.target/i386/memset-pr118276-1a.C b/gcc/testsuite/g++.target/i386/memset-pr118276-1a.C index 9fa40e7..a51a153 100644 --- a/gcc/testsuite/g++.target/i386/memset-pr118276-1a.C +++ b/gcc/testsuite/g++.target/i386/memset-pr118276-1a.C @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -march=x86-64 -std=c++17 -fasynchronous-unwind-tables -fdwarf2-cfi-asm -DMODE=0" } */ +/* { dg-options "-O3 -march=x86-64 -std=c++17 -DMODE=0" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/g++.target/i386/memset-pr118276-1b.C b/gcc/testsuite/g++.target/i386/memset-pr118276-1b.C index 3d0b657..173e92a 100644 --- a/gcc/testsuite/g++.target/i386/memset-pr118276-1b.C +++ b/gcc/testsuite/g++.target/i386/memset-pr118276-1b.C @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -march=x86-64 -std=c++17 -fasynchronous-unwind-tables -fdwarf2-cfi-asm -DMODE=1" } */ +/* { dg-options "-O3 -march=x86-64 -std=c++17 -DMODE=1" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/g++.target/i386/memset-pr118276-1c.C b/gcc/testsuite/g++.target/i386/memset-pr118276-1c.C index 3c955d8..c91c296 100644 --- a/gcc/testsuite/g++.target/i386/memset-pr118276-1c.C +++ b/gcc/testsuite/g++.target/i386/memset-pr118276-1c.C @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -march=x86-64 -std=c++17 -fasynchronous-unwind-tables -fdwarf2-cfi-asm -DMODE=2" } */ +/* { dg-options "-O3 -march=x86-64 -std=c++17 -DMODE=2" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/g++.target/i386/pr116896-1.C b/gcc/testsuite/g++.target/i386/pr116896-1.C index 3925ad8..0732229 100644 --- a/gcc/testsuite/g++.target/i386/pr116896-1.C +++ b/gcc/testsuite/g++.target/i386/pr116896-1.C @@ -1,6 +1,6 @@ // PR middle-end/116896 // { dg-do compile { target c++20 } } -// { dg-options "-O2 -masm=att -fno-stack-protector" } +// { dg-options "-O2 -masm=att -fno-stack-protector -mtune=generic" } // { dg-final { scan-assembler-times "\tjp\t" 1 } } // { dg-final { scan-assembler-not "\tj\[^mp\]\[a-z\]*\t" } } // { dg-final { scan-assembler-times "\tsbb\[bl\]\t\\\$0, " 3 } } diff --git a/gcc/testsuite/g++.target/i386/pr122446-1.C b/gcc/testsuite/g++.target/i386/pr122446-1.C new file mode 100644 index 0000000..39e594f --- /dev/null +++ b/gcc/testsuite/g++.target/i386/pr122446-1.C @@ -0,0 +1,17 @@ +/* { dg-do compile { target { ! ia32 } } } */ +/* { dg-options "-mamx-tile -mamx-int8 -O0" } */ +/* { dg-final { scan-assembler "tdpbssd\[ \\t]+\[^\n\]*%tmm2+\[^\n\]*%tmm1+\[^\n\]*%tmm0" } } */ + +#include <immintrin.h> + +template <int hello, int crazy, int gcc> +struct dpbssd +{ + void operator()() { _tile_dpbssd(hello, crazy, gcc); } +}; + +void f() +{ + dpbssd<0, 1, 2>()(); +} + diff --git a/gcc/testsuite/g++.target/i386/pr122446-amxavx512.C b/gcc/testsuite/g++.target/i386/pr122446-amxavx512.C new file mode 100644 index 0000000..bf11a36 --- /dev/null +++ b/gcc/testsuite/g++.target/i386/pr122446-amxavx512.C @@ -0,0 +1,104 @@ +/* { dg-do compile { target { ! ia32 } } } */ +/* { dg-options "-mamx-tile -mamx-avx512 -O0" } */ +/* { dg-final { scan-assembler "tcvtrowd2ps\[ \\t]+%e.x,\[ \\t\]*%tmm1,\[ \\t\]*%zmm\[0-9\]+" } } */ +/* { dg-final { scan-assembler "tcvtrowd2ps\[ \\t]+\\\$5,\[ \\t\]*%tmm2,\[ \\t\]*%zmm\[0-9\]+" } } */ +/* { dg-final { scan-assembler "tcvtrowps2bf16h\[ \\t]+%e.x,\[ \\t\]*%tmm1,\[ \\t\]*%zmm\[0-9\]+" } } */ +/* { dg-final { scan-assembler "tcvtrowps2bf16h\[ \\t]+\\\$7,\[ \\t\]*%tmm3,\[ \\t\]*%zmm\[0-9\]+" } } */ +/* { dg-final { scan-assembler "tcvtrowps2bf16l\[ \\t]+%e.x,\[ \\t\]*%tmm2,\[ \\t\]*%zmm\[0-9\]+" } } */ +/* { dg-final { scan-assembler "tcvtrowps2bf16l\[ \\t]+\\\$3,\[ \\t\]*%tmm4,\[ \\t\]*%zmm\[0-9\]+" } } */ +/* { dg-final { scan-assembler "tcvtrowps2phh\[ \\t]+%e.x,\[ \\t\]*%tmm1,\[ \\t\]*%zmm\[0-9\]+" } } */ +/* { dg-final { scan-assembler "tcvtrowps2phh\[ \\t]+\\\$6,\[ \\t\]*%tmm2,\[ \\t\]*%zmm\[0-9\]+" } } */ +/* { dg-final { scan-assembler "tcvtrowps2phl\[ \\t]+%e.x,\[ \\t\]*%tmm3,\[ \\t\]*%zmm\[0-9\]+" } } */ +/* { dg-final { scan-assembler "tcvtrowps2phl\[ \\t]+\\\$2,\[ \\t\]*%tmm4,\[ \\t\]*%zmm\[0-9\]+" } } */ +/* { dg-final { scan-assembler "tilemovrow\[ \\t]+%e.x,\[ \\t\]*%tmm5,\[ \\t\]*%zmm\[0-9\]+" } } */ +/* { dg-final { scan-assembler "tilemovrow\[ \\t]+\\\$4,\[ \\t\]*%tmm6,\[ \\t\]*%zmm\[0-9\]+" } } */ + +#include <immintrin.h> + +template <int tmm_num> +struct tile_cvtrowd2ps_test +{ + __m512 operator()() { return _tile_cvtrowd2ps(tmm_num, 0); } +}; + +template <int tmm_num, int imm> +struct tile_cvtrowd2psi_test +{ + __m512 operator()() { return _tile_cvtrowd2psi(tmm_num, imm); } +}; + +template <int tmm_num> +struct tile_cvtrowps2bf16h_test +{ + __m512bh operator()() { return _tile_cvtrowps2bf16h(tmm_num, 0); } +}; + +template <int tmm_num, int imm> +struct tile_cvtrowps2bf16hi_test +{ + __m512bh operator()() { return _tile_cvtrowps2bf16hi(tmm_num, imm); } +}; + +template <int tmm_num> +struct tile_cvtrowps2bf16l_test +{ + __m512bh operator()() { return _tile_cvtrowps2bf16l(tmm_num, 0); } +}; + +template <int tmm_num, int imm> +struct tile_cvtrowps2bf16li_test +{ + __m512bh operator()() { return _tile_cvtrowps2bf16li(tmm_num, imm); } +}; + +template <int tmm_num> +struct tile_cvtrowps2phh_test +{ + __m512h operator()() { return _tile_cvtrowps2phh(tmm_num, 0); } +}; + +template <int tmm_num, int imm> +struct tile_cvtrowps2phhi_test +{ + __m512h operator()() { return _tile_cvtrowps2phhi(tmm_num, imm); } +}; + +template <int tmm_num> +struct tile_cvtrowps2phl_test +{ + __m512h operator()() { return _tile_cvtrowps2phl(tmm_num, 0); } +}; + +template <int tmm_num, int imm> +struct tile_cvtrowps2phli_test +{ + __m512h operator()() { return _tile_cvtrowps2phli(tmm_num, imm); } +}; + +template <int tmm_num> +struct tile_movrow_test +{ + __m512 operator()() { return _tile_movrow(tmm_num, 0); } +}; + +template <int tmm_num, int imm> +struct tile_movrowi_test +{ + __m512 operator()() { return _tile_movrowi(tmm_num, imm); } +}; + +void test_amx_avx512() +{ + __m512 r1 = tile_cvtrowd2ps_test<1>()(); + __m512 r2 = tile_cvtrowd2psi_test<2, 5>()(); + __m512bh r3 = tile_cvtrowps2bf16h_test<1>()(); + __m512bh r4 = tile_cvtrowps2bf16hi_test<3, 7>()(); + __m512bh r5 = tile_cvtrowps2bf16l_test<2>()(); + __m512bh r6 = tile_cvtrowps2bf16li_test<4, 3>()(); + __m512h r7 = tile_cvtrowps2phh_test<1>()(); + __m512h r8 = tile_cvtrowps2phhi_test<2, 6>()(); + __m512h r9 = tile_cvtrowps2phl_test<3>()(); + __m512h r10 = tile_cvtrowps2phli_test<4, 2>()(); + __m512 r11 = tile_movrow_test<5>()(); + __m512 r12 = tile_movrowi_test<6, 4>()(); +} diff --git a/gcc/testsuite/g++.target/i386/pr122446-amxbf16.C b/gcc/testsuite/g++.target/i386/pr122446-amxbf16.C new file mode 100644 index 0000000..8ee0391 --- /dev/null +++ b/gcc/testsuite/g++.target/i386/pr122446-amxbf16.C @@ -0,0 +1,16 @@ +/* { dg-do compile { target { ! ia32 } } } */ +/* { dg-options "-mamx-tile -mamx-bf16 -O0" } */ +/* { dg-final { scan-assembler "tdpbf16ps\[ \\t]+%tmm2,\[ \\t\]*%tmm1,\[ \\t\]*%tmm0" } } */ + +#include <immintrin.h> + +template <int dst, int src1, int src2> +struct dpbf16ps +{ + void operator()() { _tile_dpbf16ps(dst, src1, src2); } +}; + +void test_amx_bf16() +{ + dpbf16ps<0, 1, 2>()(); +} diff --git a/gcc/testsuite/g++.target/i386/pr122446-amxcomplex.C b/gcc/testsuite/g++.target/i386/pr122446-amxcomplex.C new file mode 100644 index 0000000..3224b48 --- /dev/null +++ b/gcc/testsuite/g++.target/i386/pr122446-amxcomplex.C @@ -0,0 +1,24 @@ +/* { dg-do compile { target { ! ia32 } } } */ +/* { dg-options "-mamx-tile -mamx-complex -O0" } */ +/* { dg-final { scan-assembler "tcmmimfp16ps\[ \\t]+%tmm2,\[ \\t\]*%tmm1,\[ \\t\]*%tmm0" } } */ +/* { dg-final { scan-assembler "tcmmrlfp16ps\[ \\t]+%tmm5,\[ \\t\]*%tmm4,\[ \\t\]*%tmm3" } } */ + +#include <immintrin.h> + +template <int dst, int src1, int src2> +struct cmmimfp16ps +{ + void operator()() { _tile_cmmimfp16ps(dst, src1, src2); } +}; + +template <int dst, int src1, int src2> +struct cmmrlfp16ps +{ + void operator()() { _tile_cmmrlfp16ps(dst, src1, src2); } +}; + +void test_amx_complex() +{ + cmmimfp16ps<0, 1, 2>()(); + cmmrlfp16ps<3, 4, 5>()(); +} diff --git a/gcc/testsuite/g++.target/i386/pr122446-amxfp16.C b/gcc/testsuite/g++.target/i386/pr122446-amxfp16.C new file mode 100644 index 0000000..7467cd9 --- /dev/null +++ b/gcc/testsuite/g++.target/i386/pr122446-amxfp16.C @@ -0,0 +1,16 @@ +/* { dg-do compile { target { ! ia32 } } } */ +/* { dg-options "-mamx-tile -mamx-fp16 -O0" } */ +/* { dg-final { scan-assembler "tdpfp16ps\[ \\t]+%tmm2,\[ \\t\]*%tmm1,\[ \\t\]*%tmm0" } } */ + +#include <immintrin.h> + +template <int dst, int src1, int src2> +struct dpfp16ps +{ + void operator()() { _tile_dpfp16ps(dst, src1, src2); } +}; + +void test_amx_fp16() +{ + dpfp16ps<0, 1, 2>()(); +} diff --git a/gcc/testsuite/g++.target/i386/pr122446-amxfp8.C b/gcc/testsuite/g++.target/i386/pr122446-amxfp8.C new file mode 100644 index 0000000..8e5af6c --- /dev/null +++ b/gcc/testsuite/g++.target/i386/pr122446-amxfp8.C @@ -0,0 +1,40 @@ +/* { dg-do compile { target { ! ia32 } } } */ +/* { dg-options "-mamx-tile -mamx-fp8 -O0" } */ +/* { dg-final { scan-assembler "tdpbf8ps\[ \\t]+%tmm2,\[ \\t\]*%tmm1,\[ \\t\]*%tmm0" } } */ +/* { dg-final { scan-assembler "tdpbhf8ps\[ \\t]+%tmm5,\[ \\t\]*%tmm4,\[ \\t\]*%tmm3" } } */ +/* { dg-final { scan-assembler "tdphbf8ps\[ \\t]+%tmm2,\[ \\t\]*%tmm1,\[ \\t\]*%tmm6" } } */ +/* { dg-final { scan-assembler "tdphf8ps\[ \\t]+%tmm1,\[ \\t\]*%tmm0,\[ \\t\]*%tmm7" } } */ + +#include <immintrin.h> + +template <int dst, int src1, int src2> +struct dpbf8ps +{ + void operator()() { _tile_dpbf8ps(dst, src1, src2); } +}; + +template <int dst, int src1, int src2> +struct dpbhf8ps +{ + void operator()() { _tile_dpbhf8ps(dst, src1, src2); } +}; + +template <int dst, int src1, int src2> +struct dphbf8ps +{ + void operator()() { _tile_dphbf8ps(dst, src1, src2); } +}; + +template <int dst, int src1, int src2> +struct dphf8ps +{ + void operator()() { _tile_dphf8ps(dst, src1, src2); } +}; + +void test_amx_fp8() +{ + dpbf8ps<0, 1, 2>()(); + dpbhf8ps<3, 4, 5>()(); + dphbf8ps<6, 1, 2>()(); + dphf8ps<7, 0, 1>()(); +} diff --git a/gcc/testsuite/g++.target/i386/pr122446-amxint8.C b/gcc/testsuite/g++.target/i386/pr122446-amxint8.C new file mode 100644 index 0000000..0393792 --- /dev/null +++ b/gcc/testsuite/g++.target/i386/pr122446-amxint8.C @@ -0,0 +1,40 @@ +/* { dg-do compile { target { ! ia32 } } } */ +/* { dg-options "-mamx-tile -mamx-int8 -O0" } */ +/* { dg-final { scan-assembler "tdpbssd\[ \\t]+%tmm2,\[ \\t\]*%tmm1,\[ \\t\]*%tmm0" } } */ +/* { dg-final { scan-assembler "tdpbsud\[ \\t]+%tmm5,\[ \\t\]*%tmm4,\[ \\t\]*%tmm3" } } */ +/* { dg-final { scan-assembler "tdpbusd\[ \\t]+%tmm2,\[ \\t\]*%tmm1,\[ \\t\]*%tmm6" } } */ +/* { dg-final { scan-assembler "tdpbuud\[ \\t]+%tmm1,\[ \\t\]*%tmm0,\[ \\t\]*%tmm7" } } */ + +#include <immintrin.h> + +template <int dst, int src1, int src2> +struct dpbssd +{ + void operator()() { _tile_dpbssd(dst, src1, src2); } +}; + +template <int dst, int src1, int src2> +struct dpbsud +{ + void operator()() { _tile_dpbsud(dst, src1, src2); } +}; + +template <int dst, int src1, int src2> +struct dpbusd +{ + void operator()() { _tile_dpbusd(dst, src1, src2); } +}; + +template <int dst, int src1, int src2> +struct dpbuud +{ + void operator()() { _tile_dpbuud(dst, src1, src2); } +}; + +void test_amx_int8() +{ + dpbssd<0, 1, 2>()(); + dpbsud<3, 4, 5>()(); + dpbusd<6, 1, 2>()(); + dpbuud<7, 0, 1>()(); +} diff --git a/gcc/testsuite/g++.target/i386/pr122446-amxmovrs.C b/gcc/testsuite/g++.target/i386/pr122446-amxmovrs.C new file mode 100644 index 0000000..09f651d --- /dev/null +++ b/gcc/testsuite/g++.target/i386/pr122446-amxmovrs.C @@ -0,0 +1,31 @@ +/* { dg-do compile { target { ! ia32 } } } */ +/* { dg-options "-mamx-tile -mamx-movrs -O0" } */ +/* { dg-final { scan-assembler "tileloaddrs\[ \\t]+\[^\n\]*,\[ \\t\]*%tmm0" } } */ +/* { dg-final { scan-assembler "tileloaddrst1\[ \\t]+\[^\n\]*,\[ \\t\]*%tmm1" } } */ + +#include <immintrin.h> + +template <int tmm_num> +struct tile_loaddrs_test +{ + void operator()(const void* base, int stride) + { + _tile_loaddrs(tmm_num, base, stride); + } +}; + +template <int tmm_num> +struct tile_loaddrst1_test +{ + void operator()(const void* base, int stride) + { + _tile_loaddrst1(tmm_num, base, stride); + } +}; + +void test_amx_movrs() +{ + char buf[1024]; + tile_loaddrs_test<0>()(buf, 64); + tile_loaddrst1_test<1>()(buf, 64); +} diff --git a/gcc/testsuite/g++.target/i386/pr122446-amxtf32.C b/gcc/testsuite/g++.target/i386/pr122446-amxtf32.C new file mode 100644 index 0000000..0d1220a --- /dev/null +++ b/gcc/testsuite/g++.target/i386/pr122446-amxtf32.C @@ -0,0 +1,16 @@ +/* { dg-do compile { target { ! ia32 } } } */ +/* { dg-options "-mamx-tile -mamx-tf32 -O0" } */ +/* { dg-final { scan-assembler "tmmultf32ps\[ \\t]+%tmm2,\[ \\t\]*%tmm1,\[ \\t\]*%tmm0" } } */ + +#include <immintrin.h> + +template <int dst, int src1, int src2> +struct mmultf32ps +{ + void operator()() { _tile_mmultf32ps(dst, src1, src2); } +}; + +void test_amx_tf32() +{ + mmultf32ps<0, 1, 2>()(); +} diff --git a/gcc/testsuite/g++.target/i386/pr122446-amxtile.C b/gcc/testsuite/g++.target/i386/pr122446-amxtile.C new file mode 100644 index 0000000..6836ba49 --- /dev/null +++ b/gcc/testsuite/g++.target/i386/pr122446-amxtile.C @@ -0,0 +1,50 @@ +/* { dg-do compile { target { ! ia32 } } } */ +/* { dg-options "-mamx-tile -O0" } */ +/* { dg-final { scan-assembler "tileloadd\[ \\t]+\[^\n\]*,\[ \\t\]*%tmm0" } } */ +/* { dg-final { scan-assembler "tilestored\[ \\t]+%tmm1," } } */ +/* { dg-final { scan-assembler "tilezero\[ \\t]+%tmm3" } } */ +/* { dg-final { scan-assembler "tileloaddt1\[ \\t]+\[^\n\]*,\[ \\t\]*%tmm2" } } */ + +#include <immintrin.h> + +template <int tmm_num> +struct tile_loadd_test +{ + void operator()(const void* base, int stride) + { + _tile_loadd(tmm_num, base, stride); + } +}; + +template <int tmm_num> +struct tile_stored_test +{ + void operator()(void* base, int stride) + { + _tile_stored(tmm_num, base, stride); + } +}; + +template <int tmm_num> +struct tile_zero_test +{ + void operator()() { _tile_zero(tmm_num); } +}; + +template <int tmm_num> +struct tile_stream_loadd_test +{ + void operator()(const void* base, int stride) + { + _tile_stream_loadd(tmm_num, base, stride); + } +}; + +void test_amx_tile() +{ + char buf[1024]; + tile_loadd_test<0>()(buf, 64); + tile_stored_test<1>()(buf, 64); + tile_stream_loadd_test<2>()(buf, 64); + tile_zero_test<3>()(); +} diff --git a/gcc/testsuite/g++.target/i386/pr122906-1.C b/gcc/testsuite/g++.target/i386/pr122906-1.C new file mode 100644 index 0000000..6c4be38 --- /dev/null +++ b/gcc/testsuite/g++.target/i386/pr122906-1.C @@ -0,0 +1,1065 @@ +// { dg-do compile { target *-*-linux* } } +// { dg-options "-O3 -std=c++20 -ftrivial-auto-var-init=zero -march=x86-64-v3 -fPIC -w -mtls-dialect=gnu " } + +template <int> using b = int; +template <typename, typename> struct e; +struct m {}; +template <class> struct aa; +template <typename> struct j; +using h = aa<j<int>>; +template <typename> using a = h; +template <typename> using k = h; +template <typename d> struct p { + d ad; +}; +struct ac {}; +template <typename> struct al; +template <typename g> struct al<g *> { + typedef g &ah; +}; +template <typename z> z ::i q(z); +struct w { + e<m, m> *l; + al<e<m, m> *>::ah operator*() { return *l; } + bool operator==(w) { return l; } +}; +template <typename g, int o> struct n { + using af = g[o]; +}; +template <typename g, int o> struct ak { + n<g, o>::af am; +}; +void ab(); +template <typename ai> void ar(ai r, ac) { + ai ag; + for (; r != ag; ++r) + ab(), *r; +} +template <typename ai> void as(ai r, ac) { ar(r, q(r)); } +struct { + template <typename ai> void aj(ai r, ai) { as(r, q(r)); } +} ao; +namespace ap { +template <int at> struct bb { + static const bool ax = at; +}; +} // namespace ap +using ap::bb; +namespace av { +template <class aq, aq> struct c; +template <bool au> struct c<bool, au> { + static const bool ax = au; + operator bb<au>() { + void *bc; + return *reinterpret_cast<bb<au> *>(bc); + } +}; +template <class, class> struct ae : c<bool, false> {}; +template <class aq> struct ae<aq, aq> : c<bool, true> {}; +namespace aw { +using namespace ap; +} +} // namespace av +namespace ap { +template <int> struct bd { + typedef bd<1> bh; +}; +} // namespace ap +namespace av { +namespace aw { +template <typename, typename = int> struct be; +template <int, typename, typename, typename, typename> struct bn : bb<true> {}; +template <typename bg, typename bj, typename ay, typename az> +struct bn<false, bg, bj, ay, az> : bn<bg ::ax, bj, ay, az, bb<false>> {}; +template <> +struct bn<false, bb<false>, bb<false>, bb<false>, bb<false>> : bb<false> {}; +template <typename bg, typename bj = int, typename ay = bb<false>, + typename az = bb<false>, typename bl = bb<false>> +struct br : bn<bg ::ax, bj, ay, az, bl> {}; +} // namespace aw +template <class aq> struct bi { + typedef aq h; +}; +template <typename aq> bi<aq>::h bf(); +template <class> struct ba : c<bool, false> {}; +template <class aq> struct ba<aq const> : c<bool, true> {}; +template <class aq> struct bk { + typedef aq const h; +}; +template <class aq> struct bq { + typedef aq h; +}; +template <class aq> struct bu { + typedef aq::h h; +}; +template <class bo> struct by { + typedef bo ::ah h; +}; +template <class aq> struct bm { + typedef aq h; +}; +template <class aq> struct bm<aq const> { + typedef aq h; +}; +namespace aw { +template <int, typename bg, typename> struct bp { + typedef bg h; +}; +template <typename bg, typename bj> struct bp<false, bg, bj> { + typedef bj h; +}; +template <typename bg, typename bj, typename ay = int> struct cg { + typedef bp<bg::ax, bj, ay>::h h; +}; +template <typename C, typename bt, typename cd = int> struct bs { + typedef cg<C, bt, cd>::h ::h h; +}; +template <int, typename, typename, typename, typename> struct bx; +template <typename bg, typename bj, typename ay, typename az> +struct bx<true, bg, bj, ay, az> : bx<bg ::ax, bj, ay, az, bb<true>> {}; +template <> +struct bx<true, bb<true>, bb<true>, bb<true>, bb<true>> : bb<true> {}; +template <typename bg, typename bj> +struct bw : bx<bg ::ax, bj, bb<true>, bb<true>, bb<true>> {}; +} // namespace aw +template <typename bv, typename bz> struct cb { + template <typename cc> static void ca(cc); + template <typename ch, typename cc> static decltype(ca<cc>(bf<ch>())) cr(int); + template <typename, typename> static int cr(...); + static const bool ax = sizeof(cr<bv, bz>(0)) == 1; +}; +template <typename bv, typename bz> struct cm { + static const bool ax = cb<bv, bz>::ax; +}; +template <class bv, class bz> struct cl { + typedef cm<bv, bz> h; +}; +template <typename bv, typename bz> struct ci { + typedef cl<bv, bz>::h h; +}; +template <typename bv, typename bz> struct co : ci<bv, bz>::h {}; +template <class bv, class bz> struct ce : c<bool, co<bv, bz>::ax> {}; +namespace aw { +template <typename aq> struct cf { + typedef aq h; +}; +} // namespace aw +template <int> struct arg { + template <typename ck, typename> struct apply { + typedef ck h; + }; +}; +template <> struct arg<2> { + template <typename, typename cu> struct apply { + typedef cu h; + }; +}; +struct cj {}; +template <class cq> struct cx : aw::bs<ce<cq, cj>, aw::cf<cq>> {}; +template <class bo> struct cw : cx<typename bo::i> {}; +template <class ct, class cp, class dc> +struct cn : aw::bs<aw::bw<ce<ct, cj>, ce<dc, cp>>, aw::cf<ac>> {}; +template <class aq> struct dd : aw::br<ce<aq, ac>, ce<aq, int>> {}; +template <class cs, class ct> struct cz : cs, ct {}; +template <class cp, class dc> struct da { + typedef cn<cj, cp, dc>::h category; + typedef aw::cg<ae<cj, int>, category, cz<category, cj>>::h h; +}; +template <class cy, class cp, class dc> +struct s : aw::bs<dd<cy>, aw::cf<cy>, da<cp, dc>> {}; +namespace aw { +template <typename df, typename bg> struct de : df::apply<bg> {}; +template <typename df, typename bg, typename bj> +struct u : df::apply<bg, bj> {}; +template <typename df, typename bg, typename bj> +struct db : df::apply<bg, bj> {}; +template <typename aq> struct bh { + typedef aq::bh h; +}; +template <typename, typename, typename, typename> struct cv; +template <int dk, typename ck, typename cu, typename dm> +struct cv<arg<dk>, ck, cu, dm> { + typedef db<arg<dk>, ck, cu>::h h; +}; +template <typename df, typename bg> struct dh { + template <typename ck, typename cu = int> struct apply { + typedef de<df, typename cv<bg, ck, cu, int>::h>::h h; + }; +}; +template <typename df, typename bg, typename ck, typename cu, typename dm> +struct cv<dh<df, bg>, ck, cu, dm> { + typedef db<dh<df, bg>, ck, cu>::h h; +}; +template <typename df, typename bg, typename bj> struct dg { + template <typename ck, typename cu> struct apply { + typedef u<df, typename cv<bg, ck, cu, int>::h, + typename cv<bj, ck, cu, int>::h>::h h; + }; +}; +template <typename aq> struct di { + typedef aq::h h; +}; +template <template <typename> class df> struct dl { + template <typename ck> struct apply : di<df<ck>> {}; +}; +template <int dk, typename dn> struct be<arg<dk>, dn> { + typedef bb<true> dj; + typedef arg<dk> result_; +}; +template <typename, template <typename> class, typename> struct x; +template <template <typename> class df, typename L1> +struct x<bb<true>, df, L1> { + typedef dh<dl<df>, typename L1::result_> h; +}; +template <template <typename> class df, typename bg, typename dn> +struct be<df<bg>, dn> { + typedef be<bg> l1; + typedef x<typename l1::dj, df, l1>::h h; +}; +template <typename df, typename bg, typename bj> +struct apply2 : u<df, bg, bj> {}; +} // namespace aw +namespace iterators { +struct always_bool2 { + template <class, class> struct apply { + typedef bool h; + }; +}; +template <class cp, class cy, class dc> struct y { + typedef s<cy, cp, dc>::h i; +}; +template <class, class, class, class, class, bool> class iterator_facade_base; +struct iterator_core_access { + template <class Facade> static Facade::ah dereference(Facade &r) { + return r.dereference(); + } + template <class Facade> static void increment(Facade &r) { r.increment(); } + template <class Facade1, class Facade2> + static bool equal(Facade1 &r, Facade2 p2) { + return r.equal(p2); + } +}; +template <class Derived, class Value, class cy, class dc, class Difference> +struct iterator_facade_base<Derived, Value, cy, dc, Difference, false> { + typedef dc ah; + typedef y<Value, cy, dc>::i i; + ah operator*() { return iterator_core_access::dereference(derived()); } + void operator++() { iterator_core_access::increment(derived()); } + Derived &derived() { return *static_cast<Derived *>(this); } +}; +template <class Derived, class Value, class cy, class dc, class = long> +struct iterator_facade + : iterator_facade_base<Derived, Value, cy, dc, int, ce<cj, int>::ax> {}; +template <class Derived1, class V1, class TC1, class Reference1, + class Difference1, class Derived2, class V2, class TC2, + class Reference2, class Difference2> +bq<typename aw::apply2<always_bool2, Derived1, Derived2>::h>::h +operator==(iterator_facade<Derived1, V1, TC1, Reference1, Difference1> const &r, + iterator_facade<Derived2, V2, TC2, Reference2, Difference2> p2) { + return iterator_core_access::equal(*static_cast<Derived1 const *>(&r), + *static_cast<Derived2 *>(&p2)); +} +} // namespace iterators +using iterators::iterator_facade; +template <class aq, class DefaultNullaryFn> +struct ia_dflt_help : aw::bs<ae<aq, int>, DefaultNullaryFn, aw::cf<aq>> {}; +template <class Derived, class Base, class dc> struct iterator_adaptor_base { + typedef iterator_facade<Derived, int, typename ia_dflt_help<int, cw<Base>>::h, + typename ia_dflt_help<dc, int>::h> + h; +}; +template <class Derived, class Base, class, class, class dc, class = int> +struct iterator_adaptor : iterator_adaptor_base<Derived, Base, dc>::h { + Base an() const { return m_iterator; } + template <class OtherDerived, class OtherIterator, class V, class C, class R, + class D> + bool equal(iterator_adaptor<OtherDerived, OtherIterator, V, C, R, D>) const { + return m_iterator == an(); + } + void increment() { ++m_iterator; } + Base m_iterator; +}; +template <typename> struct result_of; +template <typename df, typename... Args> struct result_of<df(Args...)> { + typedef decltype(df()(bf<Args>()...)) h; +}; +namespace iterators { +template <class> class transform_iterator; +template <class UnaryFunc, class bo> struct transform_iterator_base { + typedef iterator_adaptor< + transform_iterator<UnaryFunc>, bo, UnaryFunc, int, + typename ia_dflt_help<int, result_of<UnaryFunc(typename bo::ah)>>::h> + h; +}; +template <typename> class zip_iterator; +template <class UnaryFunc> +struct transform_iterator + : transform_iterator_base<UnaryFunc, zip_iterator<int>>::h { + void dereference() { m_f(*this->an()); } + UnaryFunc m_f; +}; +template <class UnaryFunc> +transform_iterator<UnaryFunc> make_transform_iterator(zip_iterator<int>, + UnaryFunc); +} // namespace iterators +namespace tuples { +template <class, class> struct cons; +template <class = int, class = int, class = int, class = int, class = int, + class = int, class = int, class = int, class = int, class = int> +class tuple; +template <class aq> struct access_traits { + typedef const aq &const_type; + typedef aq &non_const_type; +}; +template <long, class HT, class TT> +access_traits<HT>::const_type get(cons<HT, TT>); +template <class aq> struct wrap_non_storeable_type { + typedef aq h; +}; +template <class HT, class TT> struct cons { + typedef HT head_type; + typedef TT tail_type; + typedef wrap_non_storeable_type<head_type>::h stored_head_type; + stored_head_type head; + tail_type tail; + access_traits<stored_head_type>::non_const_type get_head() { return head; } + access_traits<tail_type>::non_const_type get_tail() { return tail; } + access_traits<stored_head_type>::const_type get_head() const { return head; } + access_traits<tail_type>::const_type get_tail() const { return tail; } +}; +template <class T0, class bg, class, class, class, class, class, class, class, + class> +struct map_tuple_to_cons { + typedef cons<T0, typename map_tuple_to_cons<bg, int, int, int, int, int, int, + int, int, int>::h> + h; +}; +template <> +struct map_tuple_to_cons<int, int, int, int, int, int, int, int, int, int> { + typedef int h; +}; +template <class T0, class bg, class, class, class, class, class, class, class, + class> +struct tuple + : map_tuple_to_cons<T0, bg, int, int, int, int, int, int, int, int>::h {}; +} // namespace tuples +using tuples::tuple; +} // namespace av +template <class R_> struct aa { + ak<typename R_::FT, 3> an; +}; +template <typename K> struct Compare_xy_2 { + typedef K::Point_2 Point_2; + void operator()(Point_2, Point_2); +}; +template <typename K_, typename FT_> struct Cartesian_base { + typedef FT_ FT; + typedef m Point_2; + typedef aa<K_> Line_2; +}; +template <typename K_base> struct Type_equality_wrapper : K_base {}; +template <typename FT_, typename Kernel_> +struct Cartesian_base_no_ref_count : Cartesian_base<Kernel_, FT_> {}; +template <typename FT_> +struct j : Type_equality_wrapper<Cartesian_base_no_ref_count<FT_, j<FT_>>> {}; +template <class C2E> struct Filtered_predicate { + C2E c2e; + Compare_xy_2<j<double>> ep; + template <typename... Args> void operator()(Args... r) { ep(c2e(r)...); } +}; +struct Mpzf { + ~Mpzf(); +}; +struct Cartesian_converter { + j<Mpzf>::Line_2 operator()(Type_equality_wrapper<j<double>>::Line_2); +}; +namespace av { +namespace aw { +template <typename> struct begin_impl; +template <typename> struct end_impl; +template <typename> struct sequence_tag; +template <typename Sequence> struct begin { + typedef sequence_tag<Sequence>::h tag_; + typedef begin_impl<tag_>::template apply<Sequence>::h h; +}; +template <typename Sequence> struct ab { + typedef sequence_tag<Sequence>::h tag_; + typedef end_impl<tag_>::template apply<Sequence>::h h; +}; +const long ax = -1; +template <int, typename, typename, typename, typename> struct fold_impl; +template <typename First, typename Last, typename State, typename ForwardOp> +struct fold_impl<-1, First, Last, State, ForwardOp> + : fold_impl<-1, typename bh<First>::h, Last, + typename apply2<ForwardOp, State, typename First::h>::h, + ForwardOp> {}; +template <typename Last, typename State, typename ForwardOp> +struct fold_impl<-1, Last, Last, State, ForwardOp> { + typedef State state; +}; +template <typename Sequence, typename State, typename ForwardOp> struct fold { + typedef fold_impl<ax, typename begin<Sequence>::h, typename ab<Sequence>::h, + State, ForwardOp>::state h; +}; +template <typename> struct push_back_impl; +template <typename Sequence = int, typename aq = int> +struct push_back + : push_back_impl<typename sequence_tag<Sequence>::h>::apply<Sequence, aq> { +}; +struct has_push_back { + static const bool ax = sizeof(0); +}; +template <> struct push_back<> { + template <typename bg, typename bj> struct apply : push_back<bg, bj> {}; +}; +template <typename Sequence, typename Operation> struct inserter { + typedef Sequence state; + typedef Operation operation; +}; +template <typename Sequence> +struct back_inserter : inserter<Sequence, push_back<>> {}; +template <typename> struct clear_impl; +template <typename Sequence> +struct clear : clear_impl<typename sequence_tag<Sequence>::h>::apply<Sequence> { +}; +template <typename Seq, typename Op, typename In> +struct transform1_impl + : fold<Seq, typename In::state, + dg<typename In::operation, arg<1>, dh<typename be<Op>::h, arg<2>>>> { +}; +template <typename P1> +struct transform1 + : cg<has_push_back, + transform1_impl<P1, by<arg<1>>, + back_inserter<typename clear<P1>::h>>>::h {}; +template <typename Seq1> struct transform { + typedef bs<br<bb<true>>, transform1<Seq1>>::h h; +}; +} // namespace aw +} // namespace av +template <typename, typename, typename> struct Type_mapper_impl; +template <typename K1, typename K2> +struct Type_mapper_impl<typename K1::Line_2, K1, K2> { + typedef K2::Line_2 h; +}; +auto call_once___callable = [] {}; +struct once_flag { + struct _Prepare_execution; +} __thread *__once_callable; +struct once_flag::_Prepare_execution { + template <typename _Callable> _Prepare_execution(_Callable) { + __once_callable = nullptr; + } +}; +template <typename _Callable> void call_once(_Callable) { + once_flag::_Prepare_execution __exec(call_once___callable); +} +template <typename ET> auto approx(e<aa<j<int>>, ET> r) { return r.approx(); } +template <typename ET> ET exact(e<m, ET> r) { return r.exact(); } +once_flag once; +template <typename AT_, typename ET> struct Lazy_rep { + AT_ approx(); + ET exact_unsafe(); + ET exact() { + call_once(once); + return exact_unsafe(); + } +}; +struct Exact_converter { + template <typename aq> auto operator()(aq r) { return exact(r); } +}; +template <typename AT_, typename ET_> struct e { + typedef Lazy_rep<AT_, ET_> Self_rep; + e(Self_rep *); + auto approx() { return ptr()->approx(); } + ET_ exact() { return ptr()->exact(); } + Self_rep *ptr(); +}; +template <typename LK> struct Lazy_construction { + auto operator()() { + return typename Type_mapper_impl<a<k<int>>, typename LK::Approximate_kernel, + LK>::h(0); + } +}; +template <typename, typename> +using Epick_with_filtered_predicates = Type_equality_wrapper<j<double>>; +struct Epic_converter { + p<Epick_with_filtered_predicates<double, int>::Line_2> + operator()(j<int>::Line_2); +}; +template <typename FP, typename EpicP> struct Static_filtered_predicate { + FP fp; + EpicP epicp; + template <typename A1> void operator()(A1 r) { + Epic_converter convert; + auto __trans_tmp_4 = approx(r), aa1 = convert(__trans_tmp_4); + epicp(aa1.ad); + } + template <typename A1, typename A2> void operator()(A1 r, A2 p2) { + fp(r, p2); + } +}; +Static_filtered_predicate<Filtered_predicate<Exact_converter>, int> +compare_xy_2_object(); +Static_filtered_predicate<int, Cartesian_converter> is_vertical_2_object(); +struct Lazy_kernel_base { + typedef j<int> Approximate_kernel; + typedef e<Approximate_kernel::Line_2, int> Line_2; +}; +template <typename, typename> using Epeck_lazy_base = Lazy_kernel_base; +template <typename FT, typename> +using Epeck_lazy_base_with_type_equality = + Type_equality_wrapper<Epeck_lazy_base<FT, class Epeck>>; +struct Epeck : Epeck_lazy_base_with_type_equality<double, Epeck> {}; +struct Construct_x_monotone_curve_2 { + void operator()(e<m, m> r, e<m, m> p2) { + Lazy_construction<Epeck> __trans_tmp_9; + auto line = __trans_tmp_9(); + compare_xy_2_object()(r, p2); + is_vertical_2_object()(line); + } +}; +Construct_x_monotone_curve_2 construct_curve_2_object(); +namespace av { +w last1; +typedef e<m, m> *iterator2_t; +struct join_iterator_union { + iterator2_t &it2() { return m_it2; } + e<m, m> &dereference(unsigned r) { + if (r) + return *m_it2; + return *m_it1; + } + w m_it1; + iterator2_t m_it2; +}; +struct join_iterator : iterator_facade<join_iterator, int, int, e<m, m> &> { + w __trans_tmp_24; + void increment() { + if (m_section) + ; + else if (__trans_tmp_24 == last1) + m_it.it2() = 0; + } + ah dereference() { return m_it.dereference(m_section); } + bool equal(join_iterator) const { return m_section; } + int m_section; + join_iterator_union m_it; +}; +} // namespace av +template <typename InputIterator> void construct_polycurve(InputIterator r) { + InputIterator begin; + ao.aj(begin, r); +} +struct Polycurve_2 { + template <typename InputIterator> + Polycurve_2(InputIterator, InputIterator p2) { + construct_polycurve(p2); + } +}; +struct Arr_polycurve_traits_2 { + struct Construct_curve_2 { + template <typename ForwardIterator> + void operator()(ForwardIterator r, ForwardIterator p2) { + Polycurve_2(r, p2); + } + }; +}; +namespace av { +namespace fusion { +namespace traits { +template <typename> struct tag_of; +template <class T0, class bg, class bj, class ay, class az, class bl, class T6, + class T7, class T8, class T9> +struct tag_of<tuple<T0, bg, bj, ay, az, bl, T6, T7, T8, T9>> { + typedef int h; +}; +template <class Head, class Tail> struct tag_of<tuples::cons<Head, Tail>> { + typedef int h; +}; +} // namespace traits +} // namespace fusion +namespace aw { +template <class T0, class bg, class bj, class ay, class az, class bl, class T6, + class T7, class T8, class T9> +struct sequence_tag<tuple<T0, bg, bj, ay, az, bl, T6, T7, T8, T9>> { + typedef int h; +}; +template <class Head, class Tail> +struct sequence_tag<tuples::cons<Head, Tail>> { + typedef int h; +}; +} // namespace aw +namespace fusion { +namespace detail { +template <typename Sequence> struct tag_of_impl { + typedef Sequence::fusion_tag h; +}; +} // namespace detail +namespace traits { +template <typename Sequence> struct tag_of : detail::tag_of_impl<Sequence> {}; +} // namespace traits +namespace detail { +template <typename aq> struct tag_of : traits::tag_of<typename bm<aq>::h> {}; +} // namespace detail +struct iterator_facade_tag; +template <typename> struct next_impl { + template <typename bo> struct apply : bo::bh<bo> {}; +}; +namespace result_of { +template <typename bo> +struct bh : next_impl<typename bo::fusion_tag>::apply<bo> {}; +} // namespace result_of +template <typename bo> result_of::bh<bo>::h bh(bo r) { + return result_of::bh<bo>::call(r); +} +template <typename> struct equal_to_impl { + template <typename I1, typename I2> + struct apply : ae<typename bk<I1>::h, typename bk<I2>::h> {}; +}; +template <> struct equal_to_impl<iterator_facade_tag> { + template <typename, typename, typename, typename> struct dispatch; + template <typename It1, typename It2, typename dn> + struct dispatch<It1, It2, dn, dn> : It1::equal_to<It1, It2> {}; + template <typename It1, typename It2> + struct apply + : dispatch<It1, It2, typename It1::fusion_tag, typename It2::fusion_tag> { + }; +}; +namespace result_of { +template <typename I1, typename I2> +struct equal_to : equal_to_impl<typename I1::fusion_tag>::apply<I1, I2> {}; +} // namespace result_of +struct iterator_facade { + typedef iterator_facade_tag fusion_tag; +}; +template <typename Cons = int> struct boost_tuple_iterator : iterator_facade { + typedef Cons cons_type; + boost_tuple_iterator(Cons &r) : cons(r) {} + Cons &cons; + template <typename> + struct value_of : aw::cf<typename cons_type::head_type> {}; + template <typename bo> struct deref { + typedef value_of<bo>::h element; + typedef aw::cg< + ba<cons_type>, typename tuples::access_traits<element>::const_type, + typename tuples::access_traits<element>::non_const_type>::h h; + static h call(bo r) { return r.cons.get_head(); } + }; + template <typename bo> struct bh { + typedef cons_type::tail_type tail_type; + typedef boost_tuple_iterator< + typename aw::bs<ba<cons_type>, bk<tail_type>, aw::cf<tail_type>>::h> + h; + static h call(bo r) { return r.cons.get_tail(); } + }; + template <typename, typename I2> + struct equal_to : ae<Cons, typename I2::cf> {}; +}; +struct boost_tuple_null_iterator : iterator_facade { + typedef int cf; + template <typename, typename> struct equal_to : aw::br<ae<int, int>> {}; +}; +template <> struct boost_tuple_iterator<> : boost_tuple_null_iterator { + template <typename Cons> boost_tuple_iterator(Cons); +}; +template <> struct boost_tuple_iterator<int const> : boost_tuple_null_iterator { + template <typename Cons> boost_tuple_iterator(Cons) {} +}; +template <> struct boost_tuple_iterator<tuple<>> : boost_tuple_null_iterator {}; +template <typename> struct begin_impl { + template <typename Sequence> struct apply { + typedef boost_tuple_iterator<Sequence> h; + static h call(Sequence r) { return r; } + }; +}; +template <typename> struct end_impl { + template <typename Sequence> struct apply { + typedef boost_tuple_iterator<typename aw::cg<ba<Sequence>, int const>::h> h; + }; +}; +template <typename> struct value_of_impl { + template <typename bo> struct apply : bo::value_of<bo> {}; +}; +namespace result_of { +template <typename bo> +struct value_of : value_of_impl<typename bo::fusion_tag>::apply<bo> {}; +} // namespace result_of +template <typename> struct deref_impl { + template <typename bo> struct apply : bo::deref<bo> {}; +}; +namespace result_of { +template <typename bo> +struct deref : deref_impl<typename bo::fusion_tag>::apply<bo> {}; +} // namespace result_of +template <typename bo> result_of::deref<bo>::h deref(bo r) { + return result_of::deref<bo>::call(r); +} +template <typename bo> result_of::deref<bo>::h operator*(bo r) { + return deref(r); +} +namespace detail { +template <typename First, typename Last, + bool = result_of::equal_to<First, Last>::ax> +struct build_tuple_cons { + typedef int h; + static h call(First, Last) { return h(); } +}; +template <typename First, typename Last> +struct build_tuple_cons<First, Last, false> { + typedef build_tuple_cons<typename result_of::bh<First>::h, Last> + next_build_tuple_cons; + typedef tuples::cons<typename result_of::value_of<First>::h, + typename next_build_tuple_cons::h> + h; + static h call(First r, Last p2) { + typename result_of::value_of<First>::h v = *r; + return h(v, next_build_tuple_cons::call(bh(r), p2)); + } +}; +} // namespace detail +namespace result_of { +template <typename Sequence> +struct begin + : begin_impl<typename detail::tag_of<Sequence>::h>::apply<Sequence> {}; +template <typename Sequence> +struct ab : end_impl<typename detail::tag_of<Sequence>::h>::apply<Sequence> {}; +} // namespace result_of +namespace traits { +struct is_view : bb<0> {}; +} // namespace traits +} // namespace fusion +namespace aw { +template <typename bo> struct fusion_iterator { + typedef fusion::result_of::value_of<bo>::h h; +}; +template <typename bo> struct bh<fusion_iterator<bo>> { + typedef fusion_iterator<typename fusion::result_of::bh<bo>::h> h; +}; +template <> struct begin_impl<int> { + template <typename Sequence> struct apply { + typedef fusion_iterator<typename fusion::result_of::begin<Sequence>::h> h; + }; +}; +template <> struct end_impl<int> { + template <typename Sequence> struct apply { + typedef fusion_iterator<typename fusion::result_of::ab<Sequence>::h> h; + }; +}; +} // namespace aw +namespace fusion { +template <> struct next_impl<int> { + template <typename bo> struct apply { + typedef aw::cg< + result_of::equal_to<typename result_of::bh<typename bo::first_type>::h, + typename bo::last_type>, + typename bo::concat_type>::h h; + }; +}; +template <> struct value_of_impl<int> { + template <typename bo> struct apply { + typedef result_of::value_of<typename bo::first_type>::h h; + }; +}; +template <typename First, typename Last, typename Concat> +struct joint_view_iterator { + typedef First first_type; + typedef Last last_type; + typedef Concat concat_type; + typedef int fusion_tag; +}; +struct joint_view_tag; +template <> struct begin_impl<joint_view_tag> { + template <typename Sequence> struct apply { + typedef Sequence::first_type first_type; + typedef Sequence::last_type last_type; + typedef Sequence::concat_type concat_type; + typedef aw::cg<result_of::equal_to<first_type, last_type>, concat_type, + joint_view_iterator<first_type, last_type, concat_type>>::h + h; + }; +}; +template <> struct end_impl<joint_view_tag> { + template <typename Sequence> struct apply { + typedef Sequence::concat_last_type h; + }; +}; +template <typename Sequence1, typename Sequence2> struct joint_view { + typedef joint_view_tag fusion_tag; + typedef result_of::begin<Sequence1>::h first_type; + typedef result_of::ab<Sequence1>::h last_type; + typedef result_of::begin<Sequence2>::h concat_type; + typedef result_of::ab<Sequence2>::h concat_last_type; +}; +struct single_view_iterator_tag; +template <typename SingleView, typename Pos> struct single_view_iterator { + typedef single_view_iterator_tag fusion_tag; + typedef SingleView::value_type value_type; + typedef Pos position; + typedef SingleView single_view_type; +}; +template <> struct next_impl<single_view_iterator_tag> { + template <typename bo> struct apply { + typedef single_view_iterator<typename bo::single_view_type, + typename aw::bh<typename bo::position>::h> + h; + }; +}; +template <> struct value_of_impl<single_view_iterator_tag> { + template <typename bo> struct apply { + typedef bo::value_type h; + }; +}; +struct single_view_tag; +template <> struct begin_impl<single_view_tag> { + template <typename Sequence> struct apply { + typedef single_view_iterator<Sequence, aw::bd<0>> h; + }; +}; +template <> struct end_impl<single_view_tag> { + template <typename Sequence> struct apply { + typedef single_view_iterator<Sequence, aw::bd<1>> h; + }; +}; +template <typename aq> struct single_view { + typedef single_view_tag fusion_tag; + typedef aq value_type; +}; +namespace result_of { +template <typename Sequence, typename aq> struct push_back { + typedef joint_view<Sequence, single_view<aq>> h; +}; +} // namespace result_of +template <typename Sequence> +bu<result_of::begin<Sequence>>::h begin(Sequence r) { + return result_of::begin<Sequence>::call(r); +} +template <typename Sequence> struct apply { + typedef detail::build_tuple_cons<typename result_of::begin<Sequence>::h, + typename result_of::ab<Sequence>::h> + build_tuple_cons; + typedef build_tuple_cons::h h; + static h call(Sequence r) { + typename result_of::begin<Sequence>::h __trans_tmp_6 = begin(r); + typename result_of::ab<Sequence>::h __trans_tmp_7(r); + return build_tuple_cons::call(__trans_tmp_6, __trans_tmp_7); + } +}; +namespace detail { +template <typename First, typename Last, typename df> +void for_each_linear(First, Last, df, bb<true>) {} +template <typename First, typename Last, typename df> +void for_each_linear(First r, Last p2, df p3, bb<false>) { + p3(*r); + for_each_linear( + bh(r), p2, p3, + result_of::equal_to<typename result_of::bh<First>::h, Last>()); +} +template <typename Sequence, typename df, typename dn> +void for_each_dispatch(Sequence &r, df p2, dn) { + typename result_of::begin<Sequence>::h __trans_tmp_2 = r; + typename result_of::ab<Sequence>::h __trans_tmp_3 = 0; + for_each_linear(__trans_tmp_2, __trans_tmp_3, p2, + result_of::equal_to<typename result_of::begin<Sequence>::h, + typename result_of::ab<Sequence>::h>()); +} +template <typename Sequence, typename df> void for_each(Sequence &r, df p2) { + for_each_dispatch(r, p2, int()); +} +} // namespace detail +template <typename df> +void for_each(tuple<join_iterator, join_iterator> &r, df p2) { + detail::for_each(r, p2); +} +struct transform_view_iterator_tag; +template <> struct deref_impl<transform_view_iterator_tag> { + template <typename bo> struct apply { + typedef result_of::deref<typename bo::first_type>::h value_type; + typedef bo::transform_type df; + typedef typename result_of<df(value_type)>::h h; + static h call(bo r) { return r.f(*r.ad); } + }; +}; +template <typename First, typename df> struct transform_view_iterator { + typedef transform_view_iterator_tag fusion_tag; + typedef First first_type; + typedef df transform_type; + first_type ad; + transform_type f; +}; +template <> struct next_impl<transform_view_iterator_tag> { + template <typename bo> struct apply { + typedef transform_view_iterator< + typename result_of::bh<typename bo::first_type>::h, + typename bo::transform_type> + h; + static h call(bo r) { return h(bh(r.ad)); } + }; +}; +template <> struct value_of_impl<transform_view_iterator_tag> { + template <typename bo> struct apply { + typedef av::result_of<typename bo::transform_type( + typename result_of::value_of<typename bo::first_type>::h)>::h h; + }; +}; +struct transform_view_tag; +template <> struct begin_impl<transform_view_tag> { + template <typename Sequence> struct apply { + typedef transform_view_iterator<typename Sequence::first_type, + typename Sequence::transform_type> + h; + static h call(Sequence r) { return h(r.ad()); } + }; +}; +template <> struct end_impl<transform_view_tag> { + template <typename Sequence> struct apply { + typedef transform_view_iterator<typename Sequence::last_type, + typename Sequence::transform_type> + h; + }; +}; +} // namespace fusion +namespace aw { +template <> struct clear_impl<int> { + template <typename> struct apply { + typedef tuple<> h; + }; +}; +} // namespace aw +namespace fusion { +namespace result_of { +template <typename Sequence> struct convert { + typedef apply<Sequence> gen; + typedef gen::h h; +}; +} // namespace result_of +template <typename, typename Sequence> +result_of::convert<Sequence>::h convert(Sequence r) { + typedef typename result_of::convert<Sequence>::gen gen; + return gen::call(r); +} +} // namespace fusion +namespace aw { +template <> struct push_back_impl<int> { + template <typename Sequence, typename aq> struct apply { + typedef fusion::result_of::convert< + typename fusion::result_of::push_back<Sequence, aq>::h>::h h; + }; +}; +} // namespace aw +namespace fusion { +template <typename, typename df> struct transform_view { + typedef transform_view_tag fusion_tag; + typedef result_of::begin<const tuple<join_iterator, join_iterator>>::h + first_type; + typedef result_of::ab<const tuple<>>::h last_type; + typedef df transform_type; + first_type ad() { return seq; } + aw::cg<traits::is_view, int, const tuple<join_iterator, join_iterator> &>::h + seq; +}; +namespace result_of { +template <typename, typename df> struct transform { + typedef transform_view<const tuple<join_iterator, join_iterator>, df> h; +}; +} // namespace result_of +template <typename df> +result_of::transform<int, df>::h +transform(const tuple<join_iterator, join_iterator> &r, df) { + return transform_view<const tuple<join_iterator, join_iterator>, df>(r); +} +namespace detail { +struct sequence_equal_to { + template <typename I1, typename I2> static bool call(I1, I2, bb<true>); + template <typename I1, typename I2> static bool call(I1 r, I2 p2, bb<false>) { + return *r == *p2 && call(bh(r), bh(p2)); + } + template <typename I1, typename I2> static bool call(I1 r, I2 p2) { + result_of::equal_to<I1, result_of::ab<tuple<>>::h> eq; + return call(r, p2, eq); + } +}; +} // namespace detail +template <typename Seq2> +bool equal_to(const tuple<join_iterator, join_iterator> &r, Seq2 p2) { + boost_tuple_iterator __trans_tmp_27 = r; + return detail::sequence_equal_to::call(__trans_tmp_27, begin(p2)); +} +} // namespace fusion +namespace iterators { +struct increment_iterator { + template <typename bo> void operator()(bo &r) { ++r; } +}; +struct dereference_iterator { + template <typename> struct result; + template <typename This, typename bo> struct result<This(bo)> { + typedef by<bo>::h h; + }; + template <typename bo> result<dereference_iterator(bo)>::h operator()(bo r) { + return *r; + } +}; +struct minimum_traversal_category_in_iterator_tuple; +typedef aw::transform<tuple<join_iterator, join_iterator>>::h ah; +static ah call(fusion::transform_view<const tuple<join_iterator, join_iterator>, + dereference_iterator> + r) { + return convert < ah >> (r); +} +template <typename> +struct zip_iterator + : iterator_facade<zip_iterator<int>, ah, + minimum_traversal_category_in_iterator_tuple, ah> { + const tuple<join_iterator, join_iterator> &get_iterator_tuple() const { + return m_iterator_tuple; + } + ah dereference() { + const tuple<join_iterator, join_iterator> &__trans_tmp_21 = + get_iterator_tuple(); + fusion::transform_view __trans_tmp_26 = + fusion::transform(__trans_tmp_21, dereference_iterator()); + return call(__trans_tmp_26); + } + template <typename OtherIteratorTuple> bool equal(OtherIteratorTuple) const { + const tuple<join_iterator, join_iterator> &__trans_tmp_24 = + get_iterator_tuple(); + tuple<join_iterator, join_iterator> __trans_tmp_25; + return fusion::equal_to(__trans_tmp_24, __trans_tmp_25); + } + void increment() { fusion::for_each(m_iterator_tuple, increment_iterator()); } + tuple<join_iterator, join_iterator> m_iterator_tuple; +}; +} // namespace iterators +using iterators::zip_iterator; +} // namespace av +struct Construct_curve_2 { + template <typename ForwardIterator> + void operator()(ForwardIterator r, ForwardIterator p2) const { + constructor_impl(r, p2, int()); + } + void operator()(int) { + av::join_iterator __trans_tmp_11, __trans_tmp_18; + operator()(__trans_tmp_18, __trans_tmp_11); + } + template <typename ForwardIterator> + void constructor_impl(ForwardIterator r, ForwardIterator p2, b<false>) const { + Arr_polycurve_traits_2::Construct_curve_2()(r, p2); + } + void constructor_impl(av::join_iterator, av::join_iterator, b<true>) const { + auto point_pair_to_segment = [](av::zip_iterator<av::tuple<>>::ah t) { + construct_curve_2_object()(0, get<1>(t)); + }; + av::zip_iterator<int> __trans_tmp_20, __trans_tmp_22; + operator()(make_transform_iterator(__trans_tmp_22, point_pair_to_segment), + make_transform_iterator(__trans_tmp_20, point_pair_to_segment)); + } +}; +int __trans_tmp_33___trans_tmp_16; +int +__trans_tmp_33() +{ + Construct_curve_2 __trans_tmp_10; + __trans_tmp_10(__trans_tmp_33___trans_tmp_16); +} + +// { dg-final { scan-assembler-times "call\[ \t\]__tls_get_addr@PLT" 1 { target { ! ia32 } } } } diff --git a/gcc/testsuite/g++.target/i386/pr71921.C b/gcc/testsuite/g++.target/i386/pr71921.C new file mode 100644 index 0000000..baf2352 --- /dev/null +++ b/gcc/testsuite/g++.target/i386/pr71921.C @@ -0,0 +1,60 @@ +// PR target/116925 +// { dg-do compile } +// { dg-options "-O2 -march=x86-64-v3" } +// { dg-final { scan-assembler-not "vcmpltps" } } +// { dg-final { scan-assembler-times "vminps" 2 } } +// { dg-final { scan-assembler-times "vmaxps" 2 } } + +#include <vector> + +void relu(float * __restrict__ output, const float * __restrict__ input, int size) +{ + int i; + int s2; + + s2 = size / 4; + for (i = 0; i < 10000; i++) { + float t; + t = input[i]; + output[i] = std::max(t, float(0)); + } +} + +void relu1(float * __restrict__ output, const float * __restrict__ input, int size) +{ + int i; + int s2; + + s2 = size / 4; + for (i = 0; i < 10000; i++) { + float t; + t = input[i]; + output[i] = std::max(float(0), t); + } +} + +void relu2(float * __restrict__ output, const float * __restrict__ input, int size) +{ + int i; + int s2; + + s2 = size / 4; + for (i = 0; i < 10000; i++) { + float t; + t = input[i]; + output[i] = std::min(t, float(0)); + } +} + +void relu3(float * __restrict__ output, const float * __restrict__ input, int size) +{ + int i; + int s2; + + s2 = size / 4; + for (i = 0; i < 10000; i++) { + float t; + t = input[i]; + output[i] = std::min(float(0), t); + } +} diff --git a/gcc/testsuite/g++.target/loongarch/mv-symbols1.C b/gcc/testsuite/g++.target/loongarch/mv-symbols1.C new file mode 100644 index 0000000..4703f27 --- /dev/null +++ b/gcc/testsuite/g++.target/loongarch/mv-symbols1.C @@ -0,0 +1,62 @@ +/* { dg-do compile } */ +/* { dg-require-ifunc "" } */ +/* { dg-options "-O0 -march=loongarch64 -mabi=lp64d -mcmodel=normal" } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.default:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.arch_la64v1_0:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.strict_align:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\tbl\t\\\%plt\\\(_Z3foov\\\)\n" 1 } } */ +/* { dg-final { scan-assembler-times "\t\.type\t_Z3foov, @gnu_indirect_function" 1 } } */ +/* { dg-final { scan-assembler-times "\t\.set\t_Z3foov,_Z3foov\.resolver" 1 } } */ + +/* { dg-final { scan-assembler-times "\n_Z3fooi\.default:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.arch_la64v1_0:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.strict_align:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\tbl\t\\\%plt\\\(_Z3fooi\\\)\n" 1 } } */ +/* { dg-final { scan-assembler-times "\t\.type\t_Z3fooi, @gnu_indirect_function" 1 } } */ +/* { dg-final { scan-assembler-times "\t\.set\t_Z3fooi,_Z3fooi\.resolver" 1 } } */ + +int foo () +{ + return 1; +} + +__attribute__((target_version("arch=la64v1.0"))) +int foo () +{ + return 3; +} +__attribute__((target_version("strict-align"))) +int foo () +{ + return 5; +} + +int foo (int) +{ + return 2; +} + +__attribute__((target_version("arch=la64v1.0"))) +int foo (int) +{ + return 6; +} + +__attribute__((target_version("strict-align"))) +int foo (int) +{ + return 4; +} + + +int bar() +{ + return foo (); +} + +int bar(int x) +{ + return foo (x); +} diff --git a/gcc/testsuite/g++.target/loongarch/mv-symbols2.C b/gcc/testsuite/g++.target/loongarch/mv-symbols2.C new file mode 100644 index 0000000..ab4934b --- /dev/null +++ b/gcc/testsuite/g++.target/loongarch/mv-symbols2.C @@ -0,0 +1,53 @@ +/* { dg-do compile } */ +/* { dg-require-ifunc "" } */ +/* { dg-options "-O0 -march=loongarch64 -mabi=lp64d -mcmodel=normal" } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.default:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.arch_la64v1_0:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.strict_align:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.resolver:\n" 1 } }*/ +/* { dg-final { scan-assembler-not "\tbl\t\\\%plt\\\(_Z3foov\\\)\n" } } */ +/* { dg-final { scan-assembler-times "\t\.type\t_Z3foov, @gnu_indirect_function" 1 } } */ +/* { dg-final { scan-assembler-times "\t\.set\t_Z3foov,_Z3foov\.resolver" 1 } } */ + +/* { dg-final { scan-assembler-times "\n_Z3fooi\.default:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.arch_la64v1_0:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.strict_align:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-not "\tbl\t\\\%plt\\\(_Z3fooi\\\)\n" } } */ +/* { dg-final { scan-assembler-times "\t\.type\t_Z3fooi, @gnu_indirect_function" 1 } } */ +/* { dg-final { scan-assembler-times "\t\.set\t_Z3fooi,_Z3fooi\.resolver" 1 } } */ + + +int foo () +{ + return 1; +} + +__attribute__((target_version("arch=la64v1.0"))) +int foo () +{ + return 3; +} + +__attribute__((target_version("strict-align"))) +int foo () +{ + return 5; +} + +int foo (int) +{ + return 2; +} + +__attribute__((target_version("arch=la64v1.0"))) +int foo (int) +{ + return 6; +} + +__attribute__((target_version("strict-align"))) +int foo (int) +{ + return 4; +} diff --git a/gcc/testsuite/g++.target/loongarch/mv-symbols3.C b/gcc/testsuite/g++.target/loongarch/mv-symbols3.C new file mode 100644 index 0000000..1fa4736 --- /dev/null +++ b/gcc/testsuite/g++.target/loongarch/mv-symbols3.C @@ -0,0 +1,42 @@ +/* { dg-do compile } */ +/* { dg-require-ifunc "" } */ +/* { dg-options "-O0 -march=loongarch64 -mabi=lp64d -mcmodel=normal" } */ +/* { dg-final { scan-assembler-not "\n_Z3foov\.default:\n" } } */ +/* { dg-final { scan-assembler-not "\n_Z3foov\.arch_la64v1_0:\n" } } */ +/* { dg-final { scan-assembler-not "\n_Z3foov\.strict_align:\n" } } */ +/* { dg-final { scan-assembler-not "\n_Z3foov\.resolver:\n" } } */ +/* { dg-final { scan-assembler-times "\tbl\t\\\%plt\\\(_Z3foov\\\)\n" 1 } } */ +/* { dg-final { scan-assembler-not "\t\.type\t_Z3foov, @gnu_indirect_function" } } */ +/* { dg-final { scan-assembler-not "\t\.set\t_Z3foov,_Z3foov\.resolver" } } */ + +/* { dg-final { scan-assembler-not "\n_Z3fooi\.default:\n" } } */ +/* { dg-final { scan-assembler-not "\n_Z3fooi\.arch_la64v1_0:\n" } } */ +/* { dg-final { scan-assembler-not "\n_Z3fooi\.strict_align:\n" } } */ +/* { dg-final { scan-assembler-not "\n_Z3fooi\.resolver:\n" } } */ +/* { dg-final { scan-assembler-not "\tbl\t\\\%plt\\\(_Z3fooi\\\)\n" } } */ +/* { dg-final { scan-assembler-not "\t\.type\t_Z3fooi, @gnu_indirect_function" } } */ +/* { dg-final { scan-assembler-not "\t\.set\t_Z3fooi,_Z3fooi\.resolver" } } */ + +__attribute__((target_version("default"))) +int foo (); + +__attribute__((target_version("arch=la64v1.0"))) +int foo (); + +__attribute__((target_version("strict-align"))) +int foo (); + +__attribute__((target_version("default"))) +int foo (int); + +__attribute__((target_version("arch=la64v1.0"))) +int foo (int); + +__attribute__((target_version("strict-align"))) +int foo (int); + +int bar() +{ + return foo (); +} + diff --git a/gcc/testsuite/g++.target/loongarch/mv-symbols4.C b/gcc/testsuite/g++.target/loongarch/mv-symbols4.C new file mode 100644 index 0000000..8a0274e --- /dev/null +++ b/gcc/testsuite/g++.target/loongarch/mv-symbols4.C @@ -0,0 +1,48 @@ +/* { dg-do compile } */ +/* { dg-require-ifunc "" } */ +/* { dg-options "-O0 -march=loongarch64 -mabi=lp64d -mcmodel=normal" } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.default:\n" 1 } } */ +/* { dg-final { scan-assembler-not "\n_Z3foov\.arch_la64v1_0:\n" } } */ +/* { dg-final { scan-assembler-not "\n_Z3foov\.strict_align:\n" } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\tbl\t\\\%plt\\\(_Z3foov\\\)\n" 1 } } */ +/* { dg-final { scan-assembler-times "\t\.type\t_Z3foov, @gnu_indirect_function" 1 } } */ +/* { dg-final { scan-assembler-times "\t\.set\t_Z3foov,_Z3foov\.resolver" 1 } } */ + +/* { dg-final { scan-assembler-times "\n_Z3fooi\.default:\n" 1 } } */ +/* { dg-final { scan-assembler-not "\n_Z3fooi\.arch_la64v1_0:\n" } } */ +/* { dg-final { scan-assembler-not "\n_Z3fooi\.strict_align:\n" } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-not "\tbl\t\\\%plt\\\(_Z3fooi\\\)\n" } } */ +/* { dg-final { scan-assembler-times "\t\.type\t_Z3fooi, @gnu_indirect_function" 1 } } */ +/* { dg-final { scan-assembler-times "\t\.set\t_Z3fooi,_Z3fooi\.resolver" 1 } } */ + +__attribute__((target_version("default"))) +int foo () +{ + return 1; +} + +__attribute__((target_version("arch=la64v1.0"))) +int foo (); + +__attribute__((target_version("strict-align"))) +int foo (); + +__attribute__((target_version("default"))) +int foo (int) +{ + return 2; +} + +__attribute__((target_version("arch=la64v1.0"))) +int foo (int); + +__attribute__((target_version("strict-align"))) +int foo (int); + + +int bar() +{ + return foo (); +} diff --git a/gcc/testsuite/g++.target/loongarch/mv-symbols5.C b/gcc/testsuite/g++.target/loongarch/mv-symbols5.C new file mode 100644 index 0000000..67caab1 --- /dev/null +++ b/gcc/testsuite/g++.target/loongarch/mv-symbols5.C @@ -0,0 +1,55 @@ +/* { dg-do compile } */ +/* { dg-require-ifunc "" } */ +/* { dg-options "-O0 -march=loongarch64 -mabi=lp64d -mcmodel=normal" } */ +/* { dg-final { scan-assembler-not "\n_Z3foov\.default:\n" } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.arch_la64v1_0:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.strict_align:\n" 1 } } */ +/* { dg-final { scan-assembler-not "\n_Z3foov\.resolver:\n" } } */ +/* { dg-final { scan-assembler-times "\tbl\t\\\%plt\\\(_Z3foov\\\)\n" 1 } } */ +/* { dg-final { scan-assembler-not "\t\.type\t_Z3foov, @gnu_indirect_function" } } */ +/* { dg-final { scan-assembler-not "\t\.set\t_Z3foov,_Z3foov\.resolver" } } */ + +/* { dg-final { scan-assembler-not "\n_Z3fooi\.default:\n" } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.arch_la64v1_0:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.strict_align:\n" 1 } } */ +/* { dg-final { scan-assembler-not "\n_Z3fooi\.resolver:\n" } } */ +/* { dg-final { scan-assembler-not "\tbl\t\\\%plt\\\(_Z3fooi\\\)\n" } } */ +/* { dg-final { scan-assembler-not "\t\.type\t_Z3fooi, @gnu_indirect_function" } } */ +/* { dg-final { scan-assembler-not "\t\.set\t_Z3fooi,_Z3fooi\.resolver" } } */ + + +__attribute__((target_version("default"))) +int foo (); + +__attribute__((target_version("arch=la64v1.0"))) +int foo () +{ + return 3; +} +__attribute__((target_version("strict-align"))) +int foo () +{ + return 5; +} + +__attribute__((target_version("default"))) +int foo (int); + +__attribute__((target_version("arch=la64v1.0"))) +int foo (int) +{ + return 6; +} + +__attribute__((target_version("strict-align"))) +int foo (int) +{ + return 4; +} + + +int bar() +{ + return foo (); +} + diff --git a/gcc/testsuite/g++.target/loongarch/mv-symbols6.C b/gcc/testsuite/g++.target/loongarch/mv-symbols6.C new file mode 100644 index 0000000..1c79652 --- /dev/null +++ b/gcc/testsuite/g++.target/loongarch/mv-symbols6.C @@ -0,0 +1,63 @@ +/* { dg-do compile } */ +/* { dg-require-ifunc "" } */ +/* { dg-options "-O0 -march=loongarch64 -mabi=lp64d -mcmodel=normal" } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.default:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.arch_la64v1_0_priority_1:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.strict_align_priority_2:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\tbl\t\\\%plt\\\(_Z3foov\\\)\n" 1 } } */ +/* { dg-final { scan-assembler-times "\t\.type\t_Z3foov, @gnu_indirect_function" 1 } } */ +/* { dg-final { scan-assembler-times "\t\.set\t_Z3foov,_Z3foov\.resolver" 1 } } */ + +/* { dg-final { scan-assembler-times "\n_Z3fooi\.default:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.arch_la64v1_0_priority_1:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.strict_align_priority_2:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\tbl\t\\\%plt\\\(_Z3fooi\\\)\n" 1 } } */ +/* { dg-final { scan-assembler-times "\t\.type\t_Z3fooi, @gnu_indirect_function" 1 } } */ +/* { dg-final { scan-assembler-times "\t\.set\t_Z3fooi,_Z3fooi\.resolver" 1 } } */ + +int foo () +{ + return 1; +} + +__attribute__((target_version("arch=la64v1.0;priority=1"))) +int foo () +{ + return 3; +} +__attribute__((target_version("strict-align;priority=2"))) +int foo () +{ + return 5; +} + +int foo (int) +{ + return 2; +} + +__attribute__((target_version("arch=la64v1.0;priority=1"))) +int foo (int) +{ + return 6; +} + +__attribute__((target_version("strict-align;priority=2"))) +int foo (int) +{ + return 4; +} + + +int bar() +{ + return foo (); +} + +int bar(int x) +{ + return foo (x); +} + diff --git a/gcc/testsuite/g++.target/loongarch/mvc-symbols1.C b/gcc/testsuite/g++.target/loongarch/mvc-symbols1.C new file mode 100644 index 0000000..a6fcfed --- /dev/null +++ b/gcc/testsuite/g++.target/loongarch/mvc-symbols1.C @@ -0,0 +1,42 @@ +/* { dg-do compile } */ +/* { dg-require-ifunc "" } */ +/* { dg-options "-O0 -march=loongarch64 -mabi=lp64d -mcmodel=normal" } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.default:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.arch_la64v1_1:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.lsx:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\tbl\t\\\%plt\\\(_Z3foov\\\)\n" 1 } } */ +/* { dg-final { scan-assembler-times "\t\.type\t_Z3foov, @gnu_indirect_function" 1 } } */ +/* { dg-final { scan-assembler-times "\t\.set\t_Z3foov,_Z3foov\.resolver" 1 } } */ + +/* { dg-final { scan-assembler-times "\n_Z3fooi\.default:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.arch_la64v1_1:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.lsx:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\tbl\t\\\%plt\\\(_Z3fooi\\\)\n" 1 } } */ +/* { dg-final { scan-assembler-times "\t\.type\t_Z3fooi, @gnu_indirect_function" 1 } } */ +/* { dg-final { scan-assembler-times "\t\.set\t_Z3fooi,_Z3fooi\.resolver" 1 } } */ + +__attribute__((target_clones("default", "arch=la64v1.1", "lsx"))) +int foo () +{ + return 1; +} + +__attribute__((target_clones("default", "arch=la64v1.1", "lsx"))) +int foo (int) +{ + return 2; +} + + +int bar() +{ + return foo (); +} + +int bar(int x) +{ + return foo (x); +} + diff --git a/gcc/testsuite/g++.target/loongarch/mvc-symbols2.C b/gcc/testsuite/g++.target/loongarch/mvc-symbols2.C new file mode 100644 index 0000000..ff5dc66 --- /dev/null +++ b/gcc/testsuite/g++.target/loongarch/mvc-symbols2.C @@ -0,0 +1,30 @@ +/* { dg-do compile } */ +/* { dg-require-ifunc "" } */ +/* { dg-options "-O0 -march=loongarch64 -mabi=lp64d -mcmodel=normal" } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.default:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.arch_la64v1_1:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.lsx:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-not "\tbl\t\\\%plt\\\(_Z3foov\\\)\n" } } */ +/* { dg-final { scan-assembler-times "\t\.type\t_Z3foov, @gnu_indirect_function" 1 } } */ +/* { dg-final { scan-assembler-times "\t\.set\t_Z3foov,_Z3foov\.resolver" 1 } } */ + +/* { dg-final { scan-assembler-times "\n_Z3fooi\.default:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.arch_la64v1_1:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.lsx:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-not "\tbl\t\\\%plt\\\(_Z3fooi\\\)\n" } } */ +/* { dg-final { scan-assembler-times "\t\.type\t_Z3fooi, @gnu_indirect_function" 1 } } */ +/* { dg-final { scan-assembler-times "\t\.set\t_Z3fooi,_Z3fooi\.resolver" 1 } } */ + +__attribute__((target_clones("default", "arch=la64v1.1", "lsx"))) +int foo () +{ + return 1; +} + +__attribute__((target_clones("default", "arch=la64v1.1", "lsx"))) +int foo (int) +{ + return 2; +} diff --git a/gcc/testsuite/g++.target/loongarch/mvc-symbols3.C b/gcc/testsuite/g++.target/loongarch/mvc-symbols3.C new file mode 100644 index 0000000..da21111 --- /dev/null +++ b/gcc/testsuite/g++.target/loongarch/mvc-symbols3.C @@ -0,0 +1,36 @@ +/* { dg-do compile } */ +/* { dg-require-ifunc "" } */ +/* { dg-options "-O0 -march=loongarch64 -mabi=lp64d -mcmodel=normal" } */ +/* { dg-final { scan-assembler-not "\n_Z3foov\.default:\n" } } */ +/* { dg-final { scan-assembler-not "\n_Z3foov\.arch_la64v1_1:\n" } } */ +/* { dg-final { scan-assembler-not "\n_Z3foov\.lsx:\n" } } */ +/* { dg-final { scan-assembler-not "\n_Z3foov\.resolver:\n" } } */ +/* { dg-final { scan-assembler-times "\tbl\t\\\%plt\\\(_Z3foov\\\)\n" 1 } } */ +/* { dg-final { scan-assembler-not "\t\.type\t_Z3foov, @gnu_indirect_function" } } */ +/* { dg-final { scan-assembler-not "\t\.set\t_Z3foov,_Z3foov\.resolver" } } */ + +/* { dg-final { scan-assembler-not "\n_Z3fooi\.default:\n" } } */ +/* { dg-final { scan-assembler-not "\n_Z3fooi\.arch_la64v1_1:\n" } } */ +/* { dg-final { scan-assembler-not "\n_Z3fooi\.lsx:\n" } } */ +/* { dg-final { scan-assembler-not "\n_Z3fooi\.resolver:\n" } } */ +/* { dg-final { scan-assembler-times "\tbl\t\\\%plt\\\(_Z3fooi\\\)\n" 1 } } */ +/* { dg-final { scan-assembler-not "\t\.type\t_Z3fooi, @gnu_indirect_function" } } */ +/* { dg-final { scan-assembler-not "\t\.set\t_Z3fooi,_Z3fooi\.resolver" } } */ + +__attribute__((target_clones("default", "arch=la64v1.1", "lsx"))) +int foo (); + +__attribute__((target_clones("default", "arch=la64v1.1", "lsx"))) +int foo (int); + + +int bar() +{ + return foo (); +} + +int bar(int x) +{ + return foo (x); +} + diff --git a/gcc/testsuite/g++.target/loongarch/mvc-symbols4.C b/gcc/testsuite/g++.target/loongarch/mvc-symbols4.C new file mode 100644 index 0000000..898a021 --- /dev/null +++ b/gcc/testsuite/g++.target/loongarch/mvc-symbols4.C @@ -0,0 +1,26 @@ +/* { dg-do compile } */ +/* { dg-require-ifunc "" } */ +/* { dg-options "-O0 -march=loongarch64 -mabi=lp64d -mcmodel=normal" } */ +/* { dg-final { scan-assembler-not "\n_Z3foov\.default:\n" } } */ +/* { dg-final { scan-assembler-not "\n_Z3foov\.arch_la64v1_1:\n" } } */ +/* { dg-final { scan-assembler-not "\n_Z3foov\.lsx:\n" } } */ +/* { dg-final { scan-assembler-not "\n_Z3foov\.resolver:\n" } } */ +/* { dg-final { scan-assembler-not "\tbl\t\\\%plt\\\(_Z3foov\\\)\n" } } */ +/* { dg-final { scan-assembler-not "\t\.type\t_Z3foov, @gnu_indirect_function" } } */ +/* { dg-final { scan-assembler-not "\t\.set\t_Z3foov,_Z3foov\.resolver" } } */ + +/* { dg-final { scan-assembler-not "\n_Z3fooi\.default:\n" } } */ +/* { dg-final { scan-assembler-not "\n_Z3fooi\.arch_la64v1_1:\n" } } */ +/* { dg-final { scan-assembler-not "\n_Z3fooi\.lsx:\n" } } */ +/* { dg-final { scan-assembler-not "\n_Z3fooi\.resolver:\n" } } */ +/* { dg-final { scan-assembler-not "\tbl\t\\\%plt\\\(_Z3fooi\\\)\n" } } */ +/* { dg-final { scan-assembler-not "\t\.type\t_Z3fooi, @gnu_indirect_function" } } */ +/* { dg-final { scan-assembler-not "\t\.set\t_Z3fooi,_Z3fooi\.resolver" } } */ + +__attribute__((target_clones("default", "arch=la64v1.1", "lsx"))) +int foo (); + +__attribute__((target_clones("default", "arch=la64v1.1", "lsx"))) +int foo (int); + + diff --git a/gcc/testsuite/g++.target/loongarch/mvc-symbols5.C b/gcc/testsuite/g++.target/loongarch/mvc-symbols5.C new file mode 100644 index 0000000..2d93dfb --- /dev/null +++ b/gcc/testsuite/g++.target/loongarch/mvc-symbols5.C @@ -0,0 +1,42 @@ +/* { dg-do compile } */ +/* { dg-require-ifunc "" } */ +/* { dg-options "-O0 -march=loongarch64 -mabi=lp64d -mcmodel=normal" } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.default:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.arch_la64v1_1_priority_3:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.lsx:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\tbl\t\\\%plt\\\(_Z3foov\\\)\n" 1 } } */ +/* { dg-final { scan-assembler-times "\t\.type\t_Z3foov, @gnu_indirect_function" 1 } } */ +/* { dg-final { scan-assembler-times "\t\.set\t_Z3foov,_Z3foov\.resolver" 1 } } */ + +/* { dg-final { scan-assembler-times "\n_Z3fooi\.default:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.arch_la64v1_1:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.lsx_priority_1:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\tbl\t\\\%plt\\\(_Z3fooi\\\)\n" 1 } } */ +/* { dg-final { scan-assembler-times "\t\.type\t_Z3fooi, @gnu_indirect_function" 1 } } */ +/* { dg-final { scan-assembler-times "\t\.set\t_Z3fooi,_Z3fooi\.resolver" 1 } } */ + +__attribute__((target_clones("default", "arch=la64v1.1;priority=3", "lsx"))) +int foo () +{ + return 1; +} + +__attribute__((target_clones("default", "arch=la64v1.1", "lsx;priority=1"))) +int foo (int) +{ + return 2; +} + + +int bar() +{ + return foo (); +} + +int bar(int x) +{ + return foo (x); +} + diff --git a/gcc/testsuite/g++.target/riscv/abi/empty-struct+union-1.cc b/gcc/testsuite/g++.target/riscv/abi/empty-struct+union-1.cc new file mode 100644 index 0000000..69a1350 --- /dev/null +++ b/gcc/testsuite/g++.target/riscv/abi/empty-struct+union-1.cc @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g -mabi=lp64d -fdump-rtl-expand" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +struct Su2e_1f { + union { + struct { + } e1, e2; + } u; + float f; +}; +struct Su2e_1f echo_Su2e_1f(int i, float f, struct Su2e_1f s) /* { dg-warning "ABI for flattened empty union and zero length array changed in GCC 16" } */ { + return s; +} + +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa1 \[ s\+4 \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa0\)[[:space:]]+\(reg.*:SF \d+ \[ <retval>\+4 \]\)\)} "expand" } } */ diff --git a/gcc/testsuite/g++.target/riscv/abi/empty-struct+union-2.cc b/gcc/testsuite/g++.target/riscv/abi/empty-struct+union-2.cc new file mode 100644 index 0000000..763477c --- /dev/null +++ b/gcc/testsuite/g++.target/riscv/abi/empty-struct+union-2.cc @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g -mabi=lp64d -fdump-rtl-expand" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +struct Su2e_2f { + union { + struct { + } e1, e2; + } u; + float f; + float g; +}; +struct Su2e_2f echo_Su2e_2f(int i, float f, struct Su2e_2f s) /* { dg-warning "ABI for flattened empty union and zero length array changed in GCC 16" } */ { + return s; +} + +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa1 \[ s\+4 \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa2 \[ s\+8 \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa0\)[[:space:]]+\(reg.*:SF \d+ \[ <retval>\+4 \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa1\)[[:space:]]+\(reg.*:SF \d+ \[ <retval>\+8 \]\)\)} "expand" } } */ diff --git a/gcc/testsuite/g++.target/riscv/abi/empty-struct+union-3.cc b/gcc/testsuite/g++.target/riscv/abi/empty-struct+union-3.cc new file mode 100644 index 0000000..5c9ce31 --- /dev/null +++ b/gcc/testsuite/g++.target/riscv/abi/empty-struct+union-3.cc @@ -0,0 +1,27 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g -mabi=lp64d -fdump-rtl-expand" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +struct Smu2e_1f { + union { + struct { + } e1, e2; + } u1; + struct { + float f; + union { + struct { + } e1, e2; + } u; + } ue; + union { + struct { + } e1, e2; + } u2; +}; +struct Smu2e_1f echo_Smu2e_1f(int i, float f, struct Smu2e_1f s) /* { dg-warning "ABI for flattened empty union and zero length array changed in GCC 16" } */ { + return s; +} + +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa1 \[ s\+4 \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa0\)[[:space:]]+\(reg.*:SF \d+ \[ <retval>\+4 \]\)\)} "expand" } } */ diff --git a/gcc/testsuite/g++.target/riscv/abi/empty-struct+union-4.cc b/gcc/testsuite/g++.target/riscv/abi/empty-struct+union-4.cc new file mode 100644 index 0000000..ecefc94 --- /dev/null +++ b/gcc/testsuite/g++.target/riscv/abi/empty-struct+union-4.cc @@ -0,0 +1,30 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g -mabi=lp64d -fdump-rtl-expand" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +struct Smu2e_2f { + union { + struct { + } e1, e2; + } u1; + struct { + float f; + float g; + union { + struct { + } e1, e2; + } u; + } ue; + union { + struct { + } e1, e2; + } u2; +}; +struct Smu2e_2f echo_Smu2e_2f(int i, float f, struct Smu2e_2f s) /* { dg-warning "ABI for flattened empty union and zero length array changed in GCC 16" } */ { + return s; +} + +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa1 \[ s\+4 \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa2 \[ s\+8 \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa0\)[[:space:]]+\(reg.*:SF \d+ \[ <retval>\+4 \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa1\)[[:space:]]+\(reg.*:SF \d+ \[ <retval>\+8 \]\)\)} "expand" } } */ diff --git a/gcc/testsuite/g++.target/riscv/abi/empty-struct-1.cc b/gcc/testsuite/g++.target/riscv/abi/empty-struct-1.cc new file mode 100644 index 0000000..81f563e --- /dev/null +++ b/gcc/testsuite/g++.target/riscv/abi/empty-struct-1.cc @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g -mabi=lp64d -fdump-rtl-expand" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +struct Se_1f { + struct { + } e1; + float f; +}; +struct Se_1f echo_Se_1f(int i, float f, struct Se_1f s) { + return s; +} + +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa1 \[ s\+4 \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa0\)[[:space:]]+\(reg.*:SF \d+ \[ <retval>\+4 \]\)\)} "expand" } } */ diff --git a/gcc/testsuite/g++.target/riscv/abi/empty-struct-10.cc b/gcc/testsuite/g++.target/riscv/abi/empty-struct-10.cc new file mode 100644 index 0000000..167f54c --- /dev/null +++ b/gcc/testsuite/g++.target/riscv/abi/empty-struct-10.cc @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g -mabi=lp64d -fdump-rtl-expand" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +struct S1ae_2f { + struct { + } e1[1]; + float f; + float g; +}; +struct S1ae_2f echo_S1ae_2f(int i, float f, struct S1ae_2f s) { + return s; +} + +/* { dg-final { scan-rtl-dump {\(set \(mem.*:DI .*\[.* s\+0 .*\]\)[[:space:]]+\(reg.*:DI \d+ a1\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(mem.*:DI .*\[.* s\+8 .*\]\)[[:space:]]+\(reg.*:DI \d+ a2\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:DI \d+ a0 .*\)[[:space:]]+\(subreg:DI \(reg.*:TI \d+ \[ <retval> \]\) 0\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:DI \d+ a1 .*\)[[:space:]]+\(subreg:DI \(reg.*:TI \d+ \[ <retval> \]\) 8\)\)} "expand" } } */ diff --git a/gcc/testsuite/g++.target/riscv/abi/empty-struct-11.cc b/gcc/testsuite/g++.target/riscv/abi/empty-struct-11.cc new file mode 100644 index 0000000..057994d --- /dev/null +++ b/gcc/testsuite/g++.target/riscv/abi/empty-struct-11.cc @@ -0,0 +1,23 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g -mabi=lp64d -fdump-rtl-expand" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +struct Sm1ae_1f { + struct { + } e1[1]; + struct { + float f; + struct { + } e[1]; + } fe; + struct { + } e2[1]; +}; +struct Sm1ae_1f echo_Sm1ae_1f(int i, float f, struct Sm1ae_1f s) { + return s; +} + +/* { dg-final { scan-rtl-dump {\(set \(mem.*:DI .*\[.* s\+0 .*\]\)[[:space:]]+\(reg.*:DI \d+ a1\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(mem.*:DI .*\[.* s\+8 .*\]\)[[:space:]]+\(reg.*:DI \d+ a2\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:DI \d+ a0 .*\)[[:space:]]+\(subreg:DI \(reg.*:TI \d+ \[ <retval> \]\) 0\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:DI \d+ a1 .*\)[[:space:]]+\(subreg:DI \(reg.*:TI \d+ \[ <retval> \]\) 8\)\)} "expand" } } */ diff --git a/gcc/testsuite/g++.target/riscv/abi/empty-struct-12.cc b/gcc/testsuite/g++.target/riscv/abi/empty-struct-12.cc new file mode 100644 index 0000000..d8f0154 --- /dev/null +++ b/gcc/testsuite/g++.target/riscv/abi/empty-struct-12.cc @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g -mabi=lp64d -fdump-rtl-expand" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +struct Sm1ae_2f { + struct { + } e1[1]; + struct { + float f; + float g; + struct { + } e[1]; + } fe; + struct { + } e2[1]; +}; +struct Sm1ae_2f echo_Sm1ae_2f(int i, float f, struct Sm1ae_2f s) { + return s; +} + +/* { dg-final { scan-rtl-dump {\[.* \.result_ptr\+0 .*\]} "expand" } } */ diff --git a/gcc/testsuite/g++.target/riscv/abi/empty-struct-2.cc b/gcc/testsuite/g++.target/riscv/abi/empty-struct-2.cc new file mode 100644 index 0000000..9d5669c --- /dev/null +++ b/gcc/testsuite/g++.target/riscv/abi/empty-struct-2.cc @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g -mabi=lp64d -fdump-rtl-expand" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +struct Se_2f { + struct { + } e1; + float f; + float g; +}; +struct Se_2f echo_Se_2f(int i, float f, struct Se_2f s) { + return s; +} + +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa1 \[ s\+4 \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa2 \[ s\+8 \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa0\)[[:space:]]+\(reg.*:SF \d+ \[ <retval>\+4 \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa1\)[[:space:]]+\(reg.*:SF \d+ \[ <retval>\+8 \]\)\)} "expand" } } */ diff --git a/gcc/testsuite/g++.target/riscv/abi/empty-struct-3.cc b/gcc/testsuite/g++.target/riscv/abi/empty-struct-3.cc new file mode 100644 index 0000000..7b9e71a --- /dev/null +++ b/gcc/testsuite/g++.target/riscv/abi/empty-struct-3.cc @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g -mabi=lp64d -fdump-rtl-expand" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +struct Sme_1f { + struct { + } e1; + struct { + float f; + struct { + } e; + } fe; + struct { + } e2; +}; +struct Sme_1f echo_Sme_1f(int i, float f, struct Sme_1f s) { + return s; +} + +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa1 \[ s\+4 \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa0\)[[:space:]]+\(reg.*:SF \d+ \[ <retval>\+4 \]\)\)} "expand" } } */ diff --git a/gcc/testsuite/g++.target/riscv/abi/empty-struct-4.cc b/gcc/testsuite/g++.target/riscv/abi/empty-struct-4.cc new file mode 100644 index 0000000..aaec892 --- /dev/null +++ b/gcc/testsuite/g++.target/riscv/abi/empty-struct-4.cc @@ -0,0 +1,24 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g -mabi=lp64d -fdump-rtl-expand" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +struct Sme_2f { + struct { + } e1; + struct { + float f; + float g; + struct { + } e; + } fe; + struct { + } e2; +}; +struct Sme_2f echo_Sme_2f(int i, float f, struct Sme_2f s) { + return s; +} + +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa1 \[ s\+4 \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa2 \[ s\+8 \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa0\)[[:space:]]+\(reg.*:SF \d+ \[ <retval>\+4 \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa1\)[[:space:]]+\(reg.*:SF \d+ \[ <retval>\+8 \]\)\)} "expand" } } */ diff --git a/gcc/testsuite/g++.target/riscv/abi/empty-struct-5.cc b/gcc/testsuite/g++.target/riscv/abi/empty-struct-5.cc new file mode 100644 index 0000000..0ae1e41 --- /dev/null +++ b/gcc/testsuite/g++.target/riscv/abi/empty-struct-5.cc @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g -mabi=lp64d -fdump-rtl-expand" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +struct S0ae_1f { + struct { + } e1[0]; + float f; +}; +struct S0ae_1f echo_S0ae_1f(int i, float f, struct S0ae_1f s) { + return s; +} + +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa1 \[ s \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa0\)[[:space:]]+\(reg.*:SF \d+ \[ <retval> \]\)\)} "expand" } } */ diff --git a/gcc/testsuite/g++.target/riscv/abi/empty-struct-6.cc b/gcc/testsuite/g++.target/riscv/abi/empty-struct-6.cc new file mode 100644 index 0000000..d3d0b65 --- /dev/null +++ b/gcc/testsuite/g++.target/riscv/abi/empty-struct-6.cc @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g -mabi=lp64d -fdump-rtl-expand" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +struct S0ae_2f { + struct { + } e1[0]; + float f; + float g; +}; +struct S0ae_2f echo_S0ae_2f(int i, float f, struct S0ae_2f s) /* { dg-warning "ABI for flattened empty union and zero length array changed in GCC 16" } */ { + return s; +} + +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa1 \[ s \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa2 \[ s\+4 \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa0\)[[:space:]]+\(reg.*:SF \d+ \[ <retval> \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa1\)[[:space:]]+\(reg.*:SF \d+ \[ <retval>\+4 \]\)\)} "expand" } } */ diff --git a/gcc/testsuite/g++.target/riscv/abi/empty-struct-7.cc b/gcc/testsuite/g++.target/riscv/abi/empty-struct-7.cc new file mode 100644 index 0000000..9eae13d --- /dev/null +++ b/gcc/testsuite/g++.target/riscv/abi/empty-struct-7.cc @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g -mabi=lp64d -fdump-rtl-expand" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +struct Sm0ae_1f { + struct { + } e1[0]; + struct { + float f; + struct { + } e[0]; + } fe; + struct { + } e2[0]; +}; +struct Sm0ae_1f echo_Sm0ae_1f(int i, float f, struct Sm0ae_1f s) { + return s; +} + +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa1 \[ s \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa0\)[[:space:]]+\(reg.*:SF \d+ \[ <retval> \]\)\)} "expand" } } */ diff --git a/gcc/testsuite/g++.target/riscv/abi/empty-struct-8.cc b/gcc/testsuite/g++.target/riscv/abi/empty-struct-8.cc new file mode 100644 index 0000000..e7c81f4 --- /dev/null +++ b/gcc/testsuite/g++.target/riscv/abi/empty-struct-8.cc @@ -0,0 +1,24 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g -mabi=lp64d -fdump-rtl-expand" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +struct Sm0ae_2f { + struct { + } e1[0]; + struct { + float f; + float g; + struct { + } e[0]; + } fe; + struct { + } e2[0]; +}; +struct Sm0ae_2f echo_Sm0ae_2f(int i, float f, struct Sm0ae_2f s) /* { dg-warning "ABI for flattened empty union and zero length array changed in GCC 16" } */ { + return s; +} + +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa1 \[ s \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa2 \[ s\+4 \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa0\)[[:space:]]+\(reg.*:SF \d+ \[ <retval> \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa1\)[[:space:]]+\(reg.*:SF \d+ \[ <retval>\+4 \]\)\)} "expand" } } */ diff --git a/gcc/testsuite/g++.target/riscv/abi/empty-struct-9.cc b/gcc/testsuite/g++.target/riscv/abi/empty-struct-9.cc new file mode 100644 index 0000000..d36d50b --- /dev/null +++ b/gcc/testsuite/g++.target/riscv/abi/empty-struct-9.cc @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g -mabi=lp64d -fdump-rtl-expand" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +struct S1ae_1f { + struct { + } e1[1]; + float f; +}; +struct S1ae_1f echo_S1ae_1f(int i, float f, struct S1ae_1f s) { + return s; +} + +/* { dg-final { scan-rtl-dump {\(set \(mem.*:DI .*\[.* s\+0 .*\]\)[[:space:]]+\(reg.*:DI \d+ a1\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:DI \d+ a0\)[[:space:]]+\(reg.*:DI \d+ \[ <retval> \]\)\)} "expand" } } */ diff --git a/gcc/testsuite/g++.target/riscv/abi/empty-union-1.cc b/gcc/testsuite/g++.target/riscv/abi/empty-union-1.cc new file mode 100644 index 0000000..e3c2376 --- /dev/null +++ b/gcc/testsuite/g++.target/riscv/abi/empty-union-1.cc @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g -mabi=lp64d -fdump-rtl-expand" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +struct Seu_1f { + union { + } e1; + float f; +}; +struct Seu_1f echo_Seu_1f(int i, float f, struct Seu_1f s) /* { dg-warning "ABI for flattened empty union and zero length array changed in GCC 16" } */ { + return s; +} + +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa1 \[ s\+4 \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa0\)[[:space:]]+\(reg.*:SF \d+ \[ <retval>\+4 \]\)\)} "expand" } } */ diff --git a/gcc/testsuite/g++.target/riscv/abi/empty-union-2.cc b/gcc/testsuite/g++.target/riscv/abi/empty-union-2.cc new file mode 100644 index 0000000..d7b7d05 --- /dev/null +++ b/gcc/testsuite/g++.target/riscv/abi/empty-union-2.cc @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g -mabi=lp64d -fdump-rtl-expand" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +struct S2eu_2f { + union { + } e1; + float f; + float g; +}; +struct S2eu_2f echo_S2eu_2f(int i, float f, struct S2eu_2f s) /* { dg-warning "ABI for flattened empty union and zero length array changed in GCC 16" } */ { + return s; +} + +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa1 \[ s\+4 \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa2 \[ s\+8 \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa0\)[[:space:]]+\(reg.*:SF \d+ \[ <retval>\+4 \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa1\)[[:space:]]+\(reg.*:SF \d+ \[ <retval>\+8 \]\)\)} "expand" } } */ diff --git a/gcc/testsuite/g++.target/riscv/abi/empty-union-3.cc b/gcc/testsuite/g++.target/riscv/abi/empty-union-3.cc new file mode 100644 index 0000000..f12af7a --- /dev/null +++ b/gcc/testsuite/g++.target/riscv/abi/empty-union-3.cc @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g -mabi=lp64d -fdump-rtl-expand" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +struct Smeu_1f { + union { + } e1; + struct { + float f; + union { + } e; + } fe; + union { + } e2; +}; +struct Smeu_1f echo_Smeu_1f(int i, float f, struct Smeu_1f s) /* { dg-warning "ABI for flattened empty union and zero length array changed in GCC 16" } */ { + return s; +} + +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa1 \[ s\+4 \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa0\)[[:space:]]+\(reg.*:SF \d+ \[ <retval>\+4 \]\)\)} "expand" } } */ diff --git a/gcc/testsuite/g++.target/riscv/abi/empty-union-4.cc b/gcc/testsuite/g++.target/riscv/abi/empty-union-4.cc new file mode 100644 index 0000000..ab8c56e --- /dev/null +++ b/gcc/testsuite/g++.target/riscv/abi/empty-union-4.cc @@ -0,0 +1,24 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g -mabi=lp64d -fdump-rtl-expand" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +struct Smeu_2f { + union { + } e1; + struct { + float f; + float g; + union { + } e; + } fe; + union { + } e2; +}; +struct Smeu_2f echo_Smeu_2f(int i, float f, struct Smeu_2f s) /* { dg-warning "ABI for flattened empty union and zero length array changed in GCC 16" } */ { + return s; +} + +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa1 \[ s\+4 \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa2 \[ s\+8 \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa0\)[[:space:]]+\(reg.*:SF \d+ \[ <retval>\+4 \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa1\)[[:space:]]+\(reg.*:SF \d+ \[ <retval>\+8 \]\)\)} "expand" } } */ diff --git a/gcc/testsuite/g++.target/riscv/pr122692-run-1.C b/gcc/testsuite/g++.target/riscv/pr122692-run-1.C new file mode 100644 index 0000000..52def7f --- /dev/null +++ b/gcc/testsuite/g++.target/riscv/pr122692-run-1.C @@ -0,0 +1,116 @@ +/* { dg-do run { target { rv32 || rv64 } } } */ +/* { dg-options "-O2" } */ + +#include <stddef.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> + +#include <array> +#include <limits> +#include <memory> +#include <new> +#include <type_traits> + +#define HWY_INLINE inline __attribute__((__always_inline__)) +#define HWY_MIN(a, b) ((a) < (b) ? (a) : (b)) +#define HWY_MAX(a, b) ((a) > (b) ? (a) : (b)) + +#if defined(__GNUC__) && !defined(__clang__) +#define NOIPA_ATTR __attribute__((__noipa__)) +#else +#define NOIPA_ATTR +#endif + +namespace test { + +static __attribute__((__noinline__)) NOIPA_ATTR int Unpredictable1() { + int result = 1; + __asm__("" : "+r"(result)::); + return result; +} + +class RandomState { + public: + explicit RandomState( + const uint64_t seed = uint64_t{0x123456789} * + static_cast<uint64_t>(test::Unpredictable1())) { + s0_ = SplitMix64(seed + 0x9E3779B97F4A7C15ull); + s1_ = SplitMix64(s0_); + } + + HWY_INLINE uint64_t operator()() { + uint64_t s1 = s0_; + const uint64_t s0 = s1_; + const uint64_t bits = s1 + s0; + s0_ = s0; + s1 ^= s1 << 23; + s1 ^= s0 ^ (s1 >> 18) ^ (s0 >> 5); + s1_ = s1; + return bits; + } + + private: + static uint64_t SplitMix64(uint64_t z) { + z = (z ^ (z >> 30)) * 0xBF58476D1CE4E5B9ull; + z = (z ^ (z >> 27)) * 0x94D049BB133111EBull; + return z ^ (z >> 31); + } + + uint64_t s0_; + uint64_t s1_; +}; + +static __attribute__((__noinline__)) NOIPA_ATTR void GenerateRandomU16x16Vals( + RandomState& rng, uint16_t* const from, uint8_t* const expected) { + using T = uint16_t; + using TN = uint8_t; + + const T min = 0; + const T max = static_cast<T>(std::numeric_limits<TN>::max()); + + for (size_t i = 0; i < 16; ++i) { + const uint64_t bits = rng(); + __builtin_memcpy(&from[i], &bits, sizeof(T)); // not same size + expected[i] = static_cast<TN>(HWY_MIN(HWY_MAX(min, from[i]), max)); + } +} + +static __attribute__((__noinline__)) NOIPA_ATTR void DoVerifyU16x16Demote( + const uint16_t* const from, const uint8_t* const expected) { + for (int i = 0; i < 16; ++i) { + const uint8_t actual = + static_cast<uint8_t>((from[i] < 0xFF) ? from[i] : 0xFF); + if (expected[i] != actual) { + fprintf(stderr, + "Mismatch between expected result and actual result\nfrom=%u, " + "expected=%u, actual=%u\n", + static_cast<unsigned>(from[i]), + static_cast<unsigned>(expected[i]), + static_cast<unsigned>(actual)); + __builtin_abort(); + } + } +} + +static void DoDemoteU16x16ToU8x16Test() { + using T = uint16_t; + using TN = uint8_t; + std::array<T, 16> from; + std::array<TN, 16> expected; + + RandomState rng; + for (size_t rep = 0; rep < 1000; ++rep) { + GenerateRandomU16x16Vals(rng, from.data(), expected.data()); + DoVerifyU16x16Demote(from.data(), expected.data()); + } +} + +} // namespace test + +int main(int /*argc*/, char** /*argv*/) { + printf("Doing DoDemoteU16x16ToU8x16Test\n"); + test::DoDemoteU16x16ToU8x16Test(); + printf("Test completed successfully\n"); + return 0; +} diff --git a/gcc/testsuite/g++.target/riscv/pr122692-run-2.C b/gcc/testsuite/g++.target/riscv/pr122692-run-2.C new file mode 100644 index 0000000..fd50e32 --- /dev/null +++ b/gcc/testsuite/g++.target/riscv/pr122692-run-2.C @@ -0,0 +1,178 @@ +/* { dg-do run { target { rv32 || rv64 } } } */ +/* { dg-options "-O2" } */ + +#include <inttypes.h> +#include <stddef.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> + +#include <array> +#include <limits> +#include <memory> +#include <new> +#include <type_traits> + +#define HWY_INLINE inline __attribute__((__always_inline__)) +#define HWY_MIN(a, b) ((a) < (b) ? (a) : (b)) +#define HWY_MAX(a, b) ((a) > (b) ? (a) : (b)) + +#if defined(__GNUC__) && !defined(__clang__) +#define NOIPA_ATTR __attribute__((__noipa__)) +#else +#define NOIPA_ATTR +#endif + +namespace test { + +static __attribute__((__noinline__)) NOIPA_ATTR int Unpredictable1() { + int result = 1; + __asm__("" : "+r"(result)::); + return result; +} + +class RandomState { + public: + explicit RandomState( + const uint64_t seed = uint64_t{0x123456789} * + static_cast<uint64_t>(test::Unpredictable1())) { + s0_ = SplitMix64(seed + 0x9E3779B97F4A7C15ull); + s1_ = SplitMix64(s0_); + } + + HWY_INLINE uint64_t operator()() { + uint64_t s1 = s0_; + const uint64_t s0 = s1_; + const uint64_t bits = s1 + s0; + s0_ = s0; + s1 ^= s1 << 23; + s1 ^= s0 ^ (s1 >> 18) ^ (s0 >> 5); + s1_ = s1; + return bits; + } + + private: + static uint64_t SplitMix64(uint64_t z) { + z = (z ^ (z >> 30)) * 0xBF58476D1CE4E5B9ull; + z = (z ^ (z >> 27)) * 0x94D049BB133111EBull; + return z ^ (z >> 31); + } + + uint64_t s0_; + uint64_t s1_; +}; + +template <class T> +static __attribute__((noinline)) NOIPA_ATTR T* MallocArray( + size_t num_to_alloc) { + static_assert(sizeof(T) > 0, "sizeof(T) > 0 must be true"); + constexpr size_t kMaxNumToAlloc = + std::numeric_limits<size_t>::max() / sizeof(T); + if (num_to_alloc > kMaxNumToAlloc) { + return nullptr; + } + + return reinterpret_cast<T*>(::malloc(num_to_alloc * sizeof(T))); +} + +struct CFreeDeleter { + HWY_INLINE void operator()(const volatile void* ptr) const noexcept { + if (ptr) { + ::free(const_cast<void*>(ptr)); + } + } +}; + +#define HWY_ASSERT(cond) \ + do { \ + if (__builtin_expect(!(cond), false)) { \ + fprintf(stderr, "Assertion failed at line %d of file %s: %s\n", \ + static_cast<int>(__LINE__), __FILE__, "" #cond); \ + fflush(stderr); \ + __builtin_abort(); \ + } \ + } while (false) + +static __attribute__((__noinline__)) NOIPA_ATTR void AssertU8x16ArrayEquals( + std::array<uint8_t, 16> expected, std::array<uint8_t, 16> actual, + const int line, const char* filename) { + for (size_t i = 0; i < 16; i++) { + if (expected[i] != actual[i]) { + fprintf(stderr, "Array mismatch at line %d of file %s:\n", line, + filename); + fprintf(stderr, + "Expected: {%" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 + ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 + ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 + ", %" PRIu8 ", %" PRIu8 "}\n", + expected[0], expected[1], expected[2], expected[3], expected[4], + expected[5], expected[6], expected[7], expected[8], expected[9], + expected[10], expected[11], expected[12], expected[13], + expected[14], expected[15]); + fprintf(stderr, + "Actual: {%" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 + ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 + ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 + ", %" PRIu8 ", %" PRIu8 "}\n", + actual[0], actual[1], actual[2], actual[3], actual[4], actual[5], + actual[6], actual[7], actual[8], actual[9], actual[10], + actual[11], actual[12], actual[13], actual[14], actual[15]); + __builtin_abort(); + } + } +} + +#define ASSERT_U8X16_ARR_EQUALS(expected, actual) \ + AssertU8x16ArrayEquals(expected, actual, __LINE__, __FILE__) + +static std::array<uint8_t, 16> LoadU8x16Vec(const uint8_t* __restrict ptr) { + std::array<uint8_t, 16> result; + __builtin_memcpy(&result, ptr, 16 * sizeof(uint8_t)); + return result; +} + +static std::array<uint16_t, 8> LoadU16x8Vec(const uint16_t* __restrict ptr) { + std::array<uint16_t, 8> result; + __builtin_memcpy(&result, ptr, 8 * sizeof(uint16_t)); + return result; +} + +static void DoOrderedDemote2U16x8ToU8x16Test() { + using T = uint16_t; + using TN = uint8_t; + std::unique_ptr<T[], CFreeDeleter> from(MallocArray<T>(16)); + std::unique_ptr<TN[], CFreeDeleter> expected(MallocArray<TN>(16)); + HWY_ASSERT(from && expected); + + constexpr size_t N = 8; + constexpr size_t twiceN = 16; + + // Narrower range in the wider type, for clamping before we cast + const T min = static_cast<T>( + std::is_signed_v<T> ? std::numeric_limits<TN>::lowest() : TN{0}); + const T max = std::numeric_limits<TN>::max(); + + RandomState rng; + for (size_t rep = 0; rep < 1000; ++rep) { + for (size_t i = 0; i < twiceN; ++i) { + const uint64_t bits = rng(); + __builtin_memcpy(&from[i], &bits, sizeof(T)); // not same size + expected[i] = static_cast<TN>(HWY_MIN(HWY_MAX(min, from[i]), max)); + } + + std::array<uint8_t, 16> actual; + for (size_t i = 0; i < 16; i++) { + actual[i] = static_cast<uint8_t>(HWY_MIN(from[i], 0xFF)); + } + ASSERT_U8X16_ARR_EQUALS(LoadU8x16Vec(expected.get()), actual); + } +} + +} // namespace test + +int main(int /*argc*/, char** /*argv*/) { + printf("Doing DoOrderedDemote2U16x8ToU8x16Test\n"); + test::DoOrderedDemote2U16x8ToU8x16Test(); + printf("Test completed successfully\n"); + return 0; +} diff --git a/gcc/testsuite/g++.target/riscv/riscv.exp b/gcc/testsuite/g++.target/riscv/riscv.exp index f58e688..e268bd8 100644 --- a/gcc/testsuite/g++.target/riscv/riscv.exp +++ b/gcc/testsuite/g++.target/riscv/riscv.exp @@ -29,6 +29,7 @@ dg-init # Main loop. dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.C]] "" "" +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/abi/*.cc]] "" "" # All done. dg-finish diff --git a/gcc/testsuite/g++.target/riscv/rvv/autovec/pr123074.C b/gcc/testsuite/g++.target/riscv/rvv/autovec/pr123074.C new file mode 100644 index 0000000..d203477 --- /dev/null +++ b/gcc/testsuite/g++.target/riscv/rvv/autovec/pr123074.C @@ -0,0 +1,124 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=rv64gcv_zvl256b -mabi=lp64d -mrvv-vector-bits=zvl -mrvv-max-lmul=m2 -fpermissive -Wno-return-type" } */ + +namespace std { +template <typename _Iterator> _Iterator __miter_base(_Iterator); +template <typename _Default, typename, template <typename> class> +struct __detector { + using type = _Default; +}; +template <typename _Default, template <typename> class _Op> +using __detected_or = __detector<_Default, void, _Op>; +template <typename _Default, template <typename> class _Op> +using __detected_or_t = typename __detected_or<_Default, _Op>::type; +template <typename _Tp> class allocator { +public: + typedef _Tp value_type; +}; +template <typename> struct pointer_traits { + template <typename _Up> using rebind = _Up *; +}; +} // namespace std +namespace __gnu_cxx { +template <typename _Iterator, typename> class __normal_iterator { +public: + _Iterator base(); +}; +} // namespace __gnu_cxx +namespace std { +template <bool, typename _OutIter, typename _InIter> +void __assign_one(_OutIter __out, _InIter __in) { + *__out = *__in; +} +template <bool _IsMove, typename _BI1, typename _BI2> +__copy_move_backward_a2(_BI1 __first, _BI1 __last, _BI2 __result) { /* { dg-warning "with no type" "" } */ + while (__first != __last) { + --__last; + --__result; + __assign_one<_IsMove>(__result, __last); + } +} +template <bool _IsMove, typename _BI1, typename _BI2> +__copy_move_backward_a1(_BI1 __first, _BI1 __last, _BI2 __result) { /* { dg-warning "with no type" "" } */ + __copy_move_backward_a2<_IsMove>(__first, __last, __result); +} +template <bool _IsMove, typename _II, typename _OI> +__copy_move_backward_a(_II __first, _II __last, _OI __result) { /* { dg-warning "with no type" "" } */ + __copy_move_backward_a1<_IsMove>(__first, __last, __result); +} +template <typename _BI1, typename _BI2> +move_backward(_BI1 __first, _BI1 __last, _BI2 __result) { /* { dg-warning "with no type" "" } */ + __copy_move_backward_a<true>(__first, __miter_base(__last), __result); +} +struct __allocator_traits_base { + template <typename _Tp> using __pointer = typename _Tp::pointer; + template <typename _Tp> using __c_pointer = typename _Tp::const_pointer; +}; +template <typename _Alloc> struct allocator_traits : __allocator_traits_base { + typedef typename _Alloc::value_type value_type; + using pointer = __detected_or_t<value_type *, __pointer>; + template <template <typename> class, typename _Tp> struct _Ptr { + using type = typename pointer_traits<pointer>::rebind<_Tp>; + }; + using const_pointer = typename _Ptr<__c_pointer, value_type>::type; +}; +} // namespace std +namespace __gnu_cxx { +template <typename _Alloc> +struct __alloc_traits : std::allocator_traits<_Alloc> {}; +} // namespace __gnu_cxx +namespace std { +template <typename, typename _Alloc> struct _Vector_base { + typedef __gnu_cxx::__alloc_traits<_Alloc> _Tp_alloc_type; + typedef typename __gnu_cxx::__alloc_traits<_Tp_alloc_type>::pointer pointer; + struct { + pointer _M_finish; + } _M_impl; +}; +template <typename _Tp, typename _Alloc = allocator<_Tp>> +class vector : _Vector_base<_Tp, _Alloc> { + typedef _Vector_base<_Tp, _Alloc> _Base; + typedef typename _Base::_Tp_alloc_type _Alloc_traits; + +public: + typedef _Tp value_type; + typedef typename _Base::pointer pointer; + typedef typename _Alloc_traits::const_pointer const_pointer; + typedef __gnu_cxx::__normal_iterator<pointer, vector> iterator; + typedef __gnu_cxx::__normal_iterator<const_pointer, vector> const_iterator; + iterator begin(); + iterator insert(const_iterator, const value_type &); + struct _Temporary_value {}; + template <typename _Arg> void _M_insert_aux(iterator, _Arg &&); +}; +template <typename _Tp, typename _Alloc> +typename vector<_Tp, _Alloc>::iterator +vector<_Tp, _Alloc>::insert(const_iterator, const value_type &) { + auto __pos = begin(); + _Temporary_value __x_copy; + _M_insert_aux(__pos, __x_copy); +} +template <typename _Tp, typename _Alloc> +template <typename _Arg> +void vector<_Tp, _Alloc>::_M_insert_aux(iterator __position, _Arg &&) { + move_backward(__position.base(), this->_M_impl._M_finish, + this->_M_impl._M_finish); +} +namespace internals { +struct distributing { + distributing &operator=(const distributing &); + int global_row; + *constraints; /* { dg-warning "with no type" "" } */ +}; +distributing &distributing::operator=(const distributing &in) { + global_row = in.global_row; + return; /* { dg-warning "return-statement with no value" "" } */ +} +insert_index(vector<distributing> my_indices) { /* { dg-warning "with no type" "" } */ + typedef vector<distributing>::iterator index_iterator; + index_iterator pos; + distributing row_value; + my_indices.insert(pos, row_value); +} +} // namespace internals +} // namespace std diff --git a/gcc/testsuite/gcc.c-torture/compile/pr122588-1.c b/gcc/testsuite/gcc.c-torture/compile/pr122588-1.c new file mode 100644 index 0000000..43ec621 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr122588-1.c @@ -0,0 +1,25 @@ +/* Disable warnings about __sync_nand_and_fetch. */ +/* { dg-options "-w" } */ +/* PR tree-optimization/122588 */ + +int i; +char c; + +static inline __attribute__((__always_inline__)) +void foo0 (int a) +{ +l5: + __sync_nand_and_fetch (&i, 0); + int x = __builtin_memcmp_eq (&a, 0, 4); + if (__builtin_iseqsig (x, 0.)) + goto l5; + if (a) + __builtin_unreachable (); + c = a; +} + +int +main () +{ + foo0 (1); +} diff --git a/gcc/testsuite/gcc.c-torture/execute/pr122943.c b/gcc/testsuite/gcc.c-torture/execute/pr122943.c new file mode 100644 index 0000000..a41777c --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr122943.c @@ -0,0 +1,130 @@ +/* PR tree-optimization/122943 */ + +__attribute__((noipa)) unsigned char +foo (long long val) +{ + unsigned char result = 0; + switch (val) + { + case 0: result = 1; break; + case 1: result = 2; break; + case 2: result = 3; break; + default: break; + } + return result; +} + +__attribute__((noipa)) unsigned char +bar (long long val) +{ + unsigned char result = 1; + switch (val) + { + case 0: result = 8; break; + case 1: result = 31; break; + case 2: result = 72; break; + default: break; + } + return result; +} + +#ifdef __SIZEOF_INT128__ +__attribute__((noipa)) unsigned char +baz (__int128 val) +{ + unsigned char result = 0; + switch (val) + { + case 0: result = 1; break; + case 1: result = 2; break; + case 2: result = 3; break; + default: break; + } + return result; +} + +__attribute__((noipa)) unsigned char +qux (__int128 val) +{ + unsigned char result = 1; + switch (val) + { + case 0: result = 8; break; + case 1: result = 31; break; + case 2: result = 72; break; + default: break; + } + return result; +} +#endif + +int +main () +{ + if (foo (-1) != 0) + __builtin_abort (); + if (foo (0) != 1) + __builtin_abort (); + if (foo (1) != 2) + __builtin_abort (); + if (foo (2) != 3) + __builtin_abort (); + if (foo (3) != 0) + __builtin_abort (); + if (foo (-__LONG_LONG_MAX__ - 1) != 0) + __builtin_abort (); + if (foo (-__LONG_LONG_MAX__) != 0) + __builtin_abort (); + if (foo (-__LONG_LONG_MAX__ + 1) != 0) + __builtin_abort (); + if (bar (-1) != 1) + __builtin_abort (); + if (bar (0) != 8) + __builtin_abort (); + if (bar (1) != 31) + __builtin_abort (); + if (bar (2) != 72) + __builtin_abort (); + if (bar (3) != 1) + __builtin_abort (); + if (bar (-__LONG_LONG_MAX__ - 1) != 1) + __builtin_abort (); + if (bar (-__LONG_LONG_MAX__) != 1) + __builtin_abort (); + if (bar (-__LONG_LONG_MAX__ + 1) != 1) + __builtin_abort (); +#ifdef __SIZEOF_INT128__ + if (baz (-1) != 0) + __builtin_abort (); + if (baz (0) != 1) + __builtin_abort (); + if (baz (1) != 2) + __builtin_abort (); + if (baz (2) != 3) + __builtin_abort (); + if (baz (3) != 0) + __builtin_abort (); + if (baz (((__int128) 1) << 64) != 0) + __builtin_abort (); + if (baz ((((__int128) 1) << 64) + 1) != 0) + __builtin_abort (); + if (baz ((((__int128) 1) << 64) + 2) != 0) + __builtin_abort (); + if (qux (-1) != 1) + __builtin_abort (); + if (qux (0) != 8) + __builtin_abort (); + if (qux (1) != 31) + __builtin_abort (); + if (qux (2) != 72) + __builtin_abort (); + if (qux (3) != 1) + __builtin_abort (); + if (qux (((__int128) 1) << 64) != 1) + __builtin_abort (); + if (qux ((((__int128) 1) << 64) + 1) != 1) + __builtin_abort (); + if (qux ((((__int128) 1) << 64) + 2) != 1) + __builtin_abort (); +#endif +} diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-47.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-47.c index aa5402a..6fb64ae 100644 --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-47.c +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-47.c @@ -31,15 +31,15 @@ void nowarn_c32 (char c) void warn_c32 (char c) { - extern char warn_a32[32]; // { dg-message "at offset (32|1|17) into destination object 'warn_a32' of size 32" "pr97027" } + extern char warn_a32[32]; // { dg-message "at offset (32|1|17|29) into destination object 'warn_a32' of size 32" "pr97027" } void *p = warn_a32 + 1; - *(C32*)p = (C32){ c }; // { dg-warning "writing (1 byte|16 bytes|32 bytes) into a region of size (0|15|31)" "pr97027" } + *(C32*)p = (C32){ c }; // { dg-warning "writing (1 byte|16 bytes|32 bytes|4 bytes) into a region of size (0|15|31|3)" "pr97027" } /* Verify a local variable too. */ char a32[32]; p = a32 + 1; - *(C32*)p = (C32){ c }; // { dg-warning "writing (1 byte|16 bytes|32 bytes) into a region of size (0|15|31)" "pr97027" } + *(C32*)p = (C32){ c }; // { dg-warning "writing (1 byte|16 bytes|32 bytes|4 bytes) into a region of size (0|15|31|3)" "pr97027" } sink (p); } diff --git a/gcc/testsuite/gcc.dg/analyzer/setjmp-3-sarif.py b/gcc/testsuite/gcc.dg/analyzer/setjmp-3-sarif.py new file mode 100644 index 0000000..922d338 --- /dev/null +++ b/gcc/testsuite/gcc.dg/analyzer/setjmp-3-sarif.py @@ -0,0 +1,23 @@ +from sarif import * + +import pytest + +@pytest.fixture(scope='function', autouse=True) +def sarif(): + return sarif_from_env() + +def test_kinds(sarif): + result = get_result_by_index(sarif, 0) + + assert result['level'] == 'note' + + events = result["codeFlows"][0]["threadFlows"][0]['locations'] + + assert events[1]['location']['message']['text'] == "'setjmp' called here" + assert events[1]['kinds'] == ["setjmp"] + + assert events[6]['location']['message']['text'] == "rewinding from 'longjmp' in 'inner'..." + assert events[6]['kinds'] == ["longjmp"] + + assert events[7]['location']['message']['text'].startswith("...to 'setjmp' in 'outer'") + assert events[7]['kinds'] == ["longjmp"] diff --git a/gcc/testsuite/gcc.dg/analyzer/setjmp-3.c b/gcc/testsuite/gcc.dg/analyzer/setjmp-3.c index 3e4f870..a19ce84 100644 --- a/gcc/testsuite/gcc.dg/analyzer/setjmp-3.c +++ b/gcc/testsuite/gcc.dg/analyzer/setjmp-3.c @@ -1,4 +1,6 @@ /* { dg-additional-options "-fdiagnostics-show-line-numbers -fdiagnostics-path-format=inline-events -fdiagnostics-show-caret" } */ +/* { dg-additional-options "-fdiagnostics-add-output=sarif" } */ + /* { dg-enable-nn-line-numbers "" } */ /* { dg-require-effective-target indirect_jumps } */ @@ -107,3 +109,10 @@ void outer (void) | | (11) here | { dg-end-multiline-output "" } */ + +/* Verify that some JSON was written to a file with the expected name. */ +/* { dg-final { verify-sarif-file } } */ + +/* Use a Python script to verify various properties about the generated + .sarif file: + { dg-final { run-sarif-pytest setjmp-3.c "setjmp-3-sarif.py" } } */ diff --git a/gcc/testsuite/gcc.dg/analyzer/strchr-1.c b/gcc/testsuite/gcc.dg/analyzer/strchr-1.c index 181f182..5cc5fe5 100644 --- a/gcc/testsuite/gcc.dg/analyzer/strchr-1.c +++ b/gcc/testsuite/gcc.dg/analyzer/strchr-1.c @@ -1,4 +1,3 @@ -#include <string.h> #include "analyzer-decls.h" const char* test_literal (int x) @@ -14,28 +13,28 @@ const char* test_literal (int x) return p; } -void test_2 (const char *s, int c) +void test_2 (char *s, int c) { char *p = __builtin_strchr (s, c); /* { dg-message "when '__builtin_strchr' returns NULL" } */ *p = 'A'; /* { dg-warning "dereference of NULL 'p'" "null deref" } */ } -void test_3 (const char *s, int c) +void test_3 (char *s, int c) { - char *p = strchr (s, c); /* { dg-message "when 'strchr' returns NULL" } */ + char *p = __builtin_strchr (s, c); /* { dg-message "when '__builtin_strchr' returns NULL" } */ *p = 'A'; /* { dg-warning "dereference of NULL 'p'" "null deref" } */ } void test_unterminated (int c) { char buf[3] = "abc"; - strchr (buf, c); /* { dg-warning "stack-based buffer over-read" } */ - /* { dg-message "while looking for null terminator for argument 1 \\('&buf'\\) of 'strchr'..." "event" { target *-*-* } .-1 } */ + __builtin_strchr (buf, c); /* { dg-warning "stack-based buffer over-read" } */ + /* { dg-message "while looking for null terminator for argument 1 \\('&buf'\\) of '__builtin_strchr'..." "event" { target *-*-* } .-1 } */ } void test_uninitialized (int c) { char buf[16]; - strchr (buf, c); /* { dg-warning "use of uninitialized value 'buf\\\[0\\\]'" } */ - /* { dg-message "while looking for null terminator for argument 1 \\('&buf'\\) of 'strchr'..." "event" { target *-*-* } .-1 } */ + __builtin_strchr (buf, c); /* { dg-warning "use of uninitialized value 'buf\\\[0\\\]'" } */ + /* { dg-message "while looking for null terminator for argument 1 \\('&buf'\\) of '__builtin_strchr'..." "event" { target *-*-* } .-1 } */ } diff --git a/gcc/testsuite/gcc.dg/asm-hard-reg-9.c b/gcc/testsuite/gcc.dg/asm-hard-reg-9.c new file mode 100644 index 0000000..f2079ec --- /dev/null +++ b/gcc/testsuite/gcc.dg/asm-hard-reg-9.c @@ -0,0 +1,15 @@ +/* { dg-do compile { target { s390*-*-* || { x86_64-*-* && lp64 } } } } */ +/* { dg-options "-O2" } */ + +/* Ensure that if the reload register for operand 2 is resued for operand 3, + that exclude start hard regs coming from operand 3 are taken into account. + Otherwise a different register than r8 may be chosen rendering the insn + after LRA unsatisfiable. */ + +long +test () +{ + long x; + __asm__ ("" : "=r" (x) : "0" (1000), "r" (0l), "{r8}" (0l)); + return x; +} diff --git a/gcc/testsuite/gcc.dg/cmp-mem-const-1.c b/gcc/testsuite/gcc.dg/cmp-mem-const-1.c index 0b0e733..4f94902 100644 --- a/gcc/testsuite/gcc.dg/cmp-mem-const-1.c +++ b/gcc/testsuite/gcc.dg/cmp-mem-const-1.c @@ -1,6 +1,7 @@ /* { dg-do compile { target { lp64 } } } */ /* { dg-options "-O2 -fdump-rtl-combine-details" } */ /* { dg-final { scan-rtl-dump "narrow comparison from mode .I to QI" "combine" } } */ +/* { dg-skip-if "" { riscv*-*-* } } */ typedef __UINT64_TYPE__ uint64_t; diff --git a/gcc/testsuite/gcc.dg/cmp-mem-const-2.c b/gcc/testsuite/gcc.dg/cmp-mem-const-2.c index 8022137..12d962a 100644 --- a/gcc/testsuite/gcc.dg/cmp-mem-const-2.c +++ b/gcc/testsuite/gcc.dg/cmp-mem-const-2.c @@ -1,6 +1,7 @@ /* { dg-do compile { target { lp64 } } } */ /* { dg-options "-O2 -fdump-rtl-combine-details" } */ /* { dg-final { scan-rtl-dump "narrow comparison from mode .I to QI" "combine" } } */ +/* { dg-skip-if "" { riscv*-*-* } } */ typedef __UINT64_TYPE__ uint64_t; diff --git a/gcc/testsuite/gcc.dg/compat/pr83487-1_x.c b/gcc/testsuite/gcc.dg/compat/pr83487-1_x.c index b5b208f..22b71cf 100644 --- a/gcc/testsuite/gcc.dg/compat/pr83487-1_x.c +++ b/gcc/testsuite/gcc.dg/compat/pr83487-1_x.c @@ -1,4 +1,5 @@ /* { dg-options "-fno-common" { target { hppa*-*-hpux* } } } */ +/* { dg-options "-Wno-psabi" { target { riscv*-*-* } } } */ #include "pr83487-1.h" extern diff --git a/gcc/testsuite/gcc.dg/compat/pr83487-1_y.c b/gcc/testsuite/gcc.dg/compat/pr83487-1_y.c index ad336dd..cf275d8 100644 --- a/gcc/testsuite/gcc.dg/compat/pr83487-1_y.c +++ b/gcc/testsuite/gcc.dg/compat/pr83487-1_y.c @@ -1,4 +1,5 @@ /* { dg-options "-fno-common" { target { hppa*-*-hpux* } } } */ +/* { dg-options "-Wno-psabi" { target { riscv*-*-* } } } */ #include "pr83487-1.h" struct A a; diff --git a/gcc/testsuite/gcc.dg/compat/pr83487-2_x.c b/gcc/testsuite/gcc.dg/compat/pr83487-2_x.c index 7103194..399ac86 100644 --- a/gcc/testsuite/gcc.dg/compat/pr83487-2_x.c +++ b/gcc/testsuite/gcc.dg/compat/pr83487-2_x.c @@ -1,3 +1,4 @@ /* { dg-options "-fno-common" { target { hppa*-*-hpux* } } } */ +/* { dg-options "-Wno-psabi" { target { riscv*-*-* } } } */ #define PR83487_LARGE #include "pr83487-1_x.c" diff --git a/gcc/testsuite/gcc.dg/compat/pr83487-2_y.c b/gcc/testsuite/gcc.dg/compat/pr83487-2_y.c index e176783..dc6c1f8 100644 --- a/gcc/testsuite/gcc.dg/compat/pr83487-2_y.c +++ b/gcc/testsuite/gcc.dg/compat/pr83487-2_y.c @@ -1,3 +1,4 @@ /* { dg-options "-fno-common" { target { hppa*-*-hpux* } } } */ +/* { dg-options "-Wno-psabi" { target { riscv*-*-* } } } */ #define PR83487_LARGE #include "pr83487-1_y.c" diff --git a/gcc/testsuite/gcc.dg/countof-compile.c b/gcc/testsuite/gcc.dg/countof-compile.c index afd5659..ebbac16 100644 --- a/gcc/testsuite/gcc.dg/countof-compile.c +++ b/gcc/testsuite/gcc.dg/countof-compile.c @@ -122,3 +122,9 @@ const_expr(void) _Static_assert (_Countof (int [3][n]) == 3); _Static_assert (_Countof (int [n][3]) == 7); /* { dg-error "not constant" } */ } + +void +type(void) +{ + _Generic (_Countof (w), __typeof__ (sizeof 0): 0); +} diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-btf-decl-tag-1.c b/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-btf-decl-tag-1.c index a1c1676..38739e4 100644 --- a/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-btf-decl-tag-1.c +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-btf-decl-tag-1.c @@ -5,7 +5,7 @@ int *foo __attribute__((btf_decl_tag ("my_foo"))); -/* { dg-final { scan-assembler-times "DIE \\(\[^\n\]*\\) DW_TAG_GNU_annotation" 1 } } */ -/* { dg-final { scan-assembler-times " DW_AT_name: \"btf_decl_tag\"" 1 } } */ -/* { dg-final { scan-assembler-times " DW_AT_const_value: \"my_foo\"" 1 } } */ -/* { dg-final { scan-assembler-times " DW_AT_GNU_annotation" 1 } } */ +/* { dg-final { scan-assembler-times {(?n)DIE \(.*\) DW_TAG_GNU_annotation} 1 } } */ +/* { dg-final { scan-assembler-times {(?n)( DW_AT_name: "btf_decl_tag"|"btf_decl_tag..".*DW_AT_name)} 1 } } */ +/* { dg-final { scan-assembler-times {(?n)( DW_AT_const_value: "my_foo"|"my_foo..".*DW_AT_const_value)} 1 } } */ +/* { dg-final { scan-assembler-times { DW_AT_GNU_annotation} 1 } } */ diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-btf-type-tag-1.c b/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-btf-type-tag-1.c index 772aab0..437b981 100644 --- a/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-btf-type-tag-1.c +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-btf-type-tag-1.c @@ -4,7 +4,7 @@ int * __attribute__((btf_type_tag("__user"))) ptr; -/* { dg-final { scan-assembler-times "DIE \\(\[^\n\]*\\) DW_TAG_GNU_annotation" 1 } } */ -/* { dg-final { scan-assembler-times " DW_AT_name: \"btf_type_tag\"" 1 } } */ -/* { dg-final { scan-assembler-times " DW_AT_const_value: \"__user\"" 1 } } */ -/* { dg-final { scan-assembler-times " DW_AT_GNU_annotation" 1 } } */ +/* { dg-final { scan-assembler-times {(?n)DIE \(.*\) DW_TAG_GNU_annotation} 1 } } */ +/* { dg-final { scan-assembler-times {(?n)( DW_AT_name: "btf_type_tag"| "btf_type_tag..".*DW_AT_name)} 1 } } */ +/* { dg-final { scan-assembler-times {(?n)( DW_AT_const_value: "__user"|"__user..".*DW_AT_const_value)} 1 } } */ +/* { dg-final { scan-assembler-times { DW_AT_GNU_annotation} 1 } } */ diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-btf-type-tag-10.c b/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-btf-type-tag-10.c index 3ecd79f..7af1452 100644 --- a/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-btf-type-tag-10.c +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-btf-type-tag-10.c @@ -16,5 +16,5 @@ foo (int *x, int *y) /* Ideally, verify that AT_GNU_annotation in the subprogram DIE refers to the decl_tag annotation DIE, and the AT_GNU_annotation in the return type refers to the type_tag... */ -/* { dg-final { scan-assembler-times " DW_AT_name: \"btf_type_tag\"" 1 } } */ -/* { dg-final { scan-assembler-times " DW_AT_name: \"btf_decl_tag\"" 1 } } */ +/* { dg-final { scan-assembler-times {(?n)( DW_AT_name: "btf_type_tag"|"btf_type_tag..".*DW_AT_name)} 1 } } */ +/* { dg-final { scan-assembler-times {(?n)( DW_AT_name: "btf_decl_tag"|"btf_decl_tag..".*DW_AT_name)} 1 } } */ diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-btf-type-tag-2.c b/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-btf-type-tag-2.c index 9c44e0e..467d759 100644 --- a/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-btf-type-tag-2.c +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-btf-type-tag-2.c @@ -20,12 +20,12 @@ struct S * __tag1 __tag2 my_S; /* Only 2 DW_TAG_GNU_annotation DIEs should be generated, one each for "tag1" and "tag2", and they should be reused. */ -/* { dg-final { scan-assembler-times "DIE \\(\[^\n\]*\\) DW_TAG_GNU_annotation" 2 } } */ -/* { dg-final { scan-assembler-times " DW_AT_name: \"btf_type_tag\"" 2 } } */ -/* { dg-final { scan-assembler-times " DW_AT_const_value: \"tag1\"" 1 } } */ -/* { dg-final { scan-assembler-times " DW_AT_const_value: \"tag2\"" 1 } } */ +/* { dg-final { scan-assembler-times {(?n)DIE \(.*\) DW_TAG_GNU_annotation} 2 } } */ +/* { dg-final { scan-assembler-times { DW_AT_name: "btf_type_tag"} 2 } } */ +/* { dg-final { scan-assembler-times {(?n)( DW_AT_const_value: "tag1"|"tag1..".* DW_AT_const_value)} 1 } } */ +/* { dg-final { scan-assembler-times {(?n)( DW_AT_const_value: "tag2"|"tag2..".*DW_AT_const_value)} 1 } } */ /* Each attribute-ed type shall refer via DW_AT_GNU_annotation to the appropriate annotation DIE, including the annotation DIE for "tag2" which is always chained to the DIE for "tag1" in this construction. */ -/* { dg-final { scan-assembler-times " DW_AT_GNU_annotation" 5 } } */ +/* { dg-final { scan-assembler-times { DW_AT_GNU_annotation} 5 } } */ diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-btf-type-tag-4.c b/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-btf-type-tag-4.c index 7205ef2..212cc4ec 100644 --- a/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-btf-type-tag-4.c +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-btf-type-tag-4.c @@ -29,6 +29,6 @@ union U volatile union U volatile_u; /* One annotation DIE may be shared by all three annotated types. */ -/* { dg-final { scan-assembler-times "DIE \\(\[^\n\]*\\) DW_TAG_GNU_annotation" 1 } } */ -/* { dg-final { scan-assembler-times " DW_AT_name: \"btf_type_tag\"" 1 } } */ -/* { dg-final { scan-assembler-times " DW_AT_GNU_annotation" 3 } } */ +/* { dg-final { scan-assembler-times {(?n)DIE \(.*\) DW_TAG_GNU_annotation} 1 } } */ +/* { dg-final { scan-assembler-times {(?n)( DW_AT_name: "btf_type_tag"|"btf_type_tag..".* DW_AT_name)} 1 } } */ +/* { dg-final { scan-assembler-times { DW_AT_GNU_annotation} 3 } } */ diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-btf-type-tag-5.c b/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-btf-type-tag-5.c index 1a6b29f..ffb2ca8 100644 --- a/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-btf-type-tag-5.c +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-btf-type-tag-5.c @@ -4,7 +4,7 @@ int arr[8] __attribute__((btf_type_tag("tagged_arr"))); -/* { dg-final { scan-assembler-times "DIE \\(\[^\n\]*\\) DW_TAG_GNU_annotation" 1 } } */ -/* { dg-final { scan-assembler-times " DW_AT_name: \"btf_type_tag\"" 1 } } */ -/* { dg-final { scan-assembler-times " DW_AT_const_value: \"tagged_arr\"" 1 } } */ -/* { dg-final { scan-assembler-times " DW_AT_GNU_annotation" 1 } } */ +/* { dg-final { scan-assembler-times {(?n)DIE \(.*\) DW_TAG_GNU_annotation} 1 } } */ +/* { dg-final { scan-assembler-times {(?n)( DW_AT_name: "btf_type_tag"|"btf_type_tag..".*)} 1 } } */ +/* { dg-final { scan-assembler-times {(?n)( DW_AT_const_value: "tagged_arr"|"tagged_arr..".*DW_AT_const_value)} 1 } } */ +/* { dg-final { scan-assembler-times { DW_AT_GNU_annotation} 1 } } */ diff --git a/gcc/testsuite/gcc.dg/fold-vecperm-1.c b/gcc/testsuite/gcc.dg/fold-vecperm-1.c index 5d4456b..878d392 100644 --- a/gcc/testsuite/gcc.dg/fold-vecperm-1.c +++ b/gcc/testsuite/gcc.dg/fold-vecperm-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-optimized" } */ +/* { dg-options "-O2 -fdump-tree-forwprop3" } */ typedef int v4si __attribute__((vector_size(16))); typedef short v8hi __attribute__((vector_size(16))); @@ -20,4 +20,4 @@ int128 concat (int128 a, int128 b) { return res; } -/* { dg-final { scan-tree-dump-times "VEC_PERM_EXPR" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "VEC_PERM_EXPR" 1 "forwprop3" } } */ diff --git a/gcc/testsuite/gcc.dg/gimplefe-58.c b/gcc/testsuite/gcc.dg/gimplefe-58.c new file mode 100644 index 0000000..b209ab6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/gimplefe-58.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-fgimple" } */ + +int __GIMPLE (ssa) +foo (int * restrict p, int * q) +{ + int x; + int _1; + int _7; + + __BB(2): + x_4 = __MEM <int> (q_3(D), 1:0); + __MEM <int> ((int *)p_5(D), 1 :1) = 1; + _1 = __MEM <int> (q_3(D), 1: 0); + _7 = _1 + x_4; + return _7; +} diff --git a/gcc/testsuite/gcc.dg/gnu-compoundlit-1.c b/gcc/testsuite/gcc.dg/gnu-compoundlit-1.c new file mode 100644 index 0000000..a7f3496 --- /dev/null +++ b/gcc/testsuite/gcc.dg/gnu-compoundlit-1.c @@ -0,0 +1,26 @@ +/* { dg-do compile } */ +/* { dg-options "-std=gnu23" } */ + +int g(int n, int (*p)[n]); +int f(int n) +{ + return g(n, &(int[n]){ }); +} + +void h(int n) +{ + (int[n]){ 1 }; /* { dg-error "empty initializer" } */ +} + +void i(int n) +{ + (static int[3]){ }; + (static int[n]){ }; /* { dg-error "storage size" } */ + (constexpr int[3]){ }; + (constexpr int[n]){ }; /* { dg-error "storage size" } */ + (register int[3]){ }; /* { dg-error "register" } */ + (register int[n]){ }; /* { dg-error "register" } */ + (_Thread_local int[3]){ }; /* { dg-error "_Thread_local" } */ + (_Thread_local int[n]){ }; /* { dg-error "_Thread_local" } */ +} + diff --git a/gcc/testsuite/gcc.dg/gnu-compoundlit-2.c b/gcc/testsuite/gcc.dg/gnu-compoundlit-2.c new file mode 100644 index 0000000..dcc5775 --- /dev/null +++ b/gcc/testsuite/gcc.dg/gnu-compoundlit-2.c @@ -0,0 +1,20 @@ +/* { dg-do run } */ +/* { dg-options "-std=gnu23 -Wall" } */ + +[[gnu::noinline,gnu::noipa]] +static bool f(int n) +{ + struct foo { char a[n]; }; + struct foo x = { }; + + return 0 == __builtin_memcmp(&x, &(struct foo){ }, sizeof x); +} + +int main() +{ + if (!f(7)) + __builtin_abort(); + + return 0; +} + diff --git a/gcc/testsuite/gcc.dg/gomp/pr110485.c b/gcc/testsuite/gcc.dg/gomp/pr110485.c index ba6817a..5183f3f 100644 --- a/gcc/testsuite/gcc.dg/gomp/pr110485.c +++ b/gcc/testsuite/gcc.dg/gomp/pr110485.c @@ -16,4 +16,4 @@ void foo (int n) } /* { dg-final { scan-tree-dump-not "MASK_LOAD" "vect" } } */ -/* { dg-final { scan-tree-dump "can't use a fully-masked loop because a non-masked simd clone was selected." "vect" { target x86_64-*-* } } } */ +/* { dg-final { scan-tree-dump "can't use a fully-masked loop because no masked simd clone was available" "vect" { target x86_64-*-* } } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/vrp-from-cst-agg-1.c b/gcc/testsuite/gcc.dg/ipa/vrp-from-cst-agg-1.c new file mode 100644 index 0000000..c18146a --- /dev/null +++ b/gcc/testsuite/gcc.dg/ipa/vrp-from-cst-agg-1.c @@ -0,0 +1,33 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -fdump-ipa-cp-details" } */ + +static const struct { + int w; + int h; +} sizes[7] = { + { 16, 16 }, + { 16, 8 }, + { 8, 16 }, + { 8, 8 }, + { 8, 4 }, + { 4, 8 }, + { 4, 4 } +}; + +int baz(int, int); + +[[gnu::noinline]] void bar(int w, int h) +{ + for (int i = 0; i < w; i++) + for (int j = 0; i < h; j++) + baz (i, j); +} + +void foo (int index) +{ + int w = sizes[index].w; + int h = sizes[index].h; + + bar (w, h); +} +/* { dg-final { scan-ipa-dump "irange" "cp" } } */ diff --git a/gcc/testsuite/gcc.dg/lto/pr122515_0.c b/gcc/testsuite/gcc.dg/lto/pr122515_0.c new file mode 100644 index 0000000..fb2fa8b --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/pr122515_0.c @@ -0,0 +1,9 @@ +/* { dg-lto-do ar-link } */ +/* { dg-lto-options { { -flto=auto -ffat-lto-objects } } } */ + +extern int bar_7 (int); + +int main (void) +{ + return bar_7 (42); +} diff --git a/gcc/testsuite/gcc.dg/lto/pr122515_1.c b/gcc/testsuite/gcc.dg/lto/pr122515_1.c new file mode 100644 index 0000000..f676c4a --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/pr122515_1.c @@ -0,0 +1,12 @@ +typedef struct { + int num; + int foo[40000000]; +} A_1; + +A_1 a1_1 = {1}; +A_1 a2_1 = {2}; + +int bar_1 (int i) +{ + return i++; +} diff --git a/gcc/testsuite/gcc.dg/lto/pr122515_2.c b/gcc/testsuite/gcc.dg/lto/pr122515_2.c new file mode 100644 index 0000000..acda878 --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/pr122515_2.c @@ -0,0 +1,12 @@ +typedef struct { + int num; + int foo[40000000]; +} A_2; + +A_2 a1_2 = {1}; +A_2 a2_2 = {2}; + +int bar_2 (int i) +{ + return i++; +} diff --git a/gcc/testsuite/gcc.dg/lto/pr122515_3.c b/gcc/testsuite/gcc.dg/lto/pr122515_3.c new file mode 100644 index 0000000..7223e9f --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/pr122515_3.c @@ -0,0 +1,12 @@ +typedef struct { + int num; + int foo[40000000]; +} A_3; + +A_3 a1_3 = {1}; +A_3 a2_3 = {2}; + +int bar_3 (int i) +{ + return i++; +} diff --git a/gcc/testsuite/gcc.dg/lto/pr122515_4.c b/gcc/testsuite/gcc.dg/lto/pr122515_4.c new file mode 100644 index 0000000..51754ae --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/pr122515_4.c @@ -0,0 +1,12 @@ +typedef struct { + int num; + int foo[40000000]; +} A_4; + +A_4 a1_4 = {1}; +A_4 a2_4 = {2}; + +int bar_4 (int i) +{ + return i++; +} diff --git a/gcc/testsuite/gcc.dg/lto/pr122515_5.c b/gcc/testsuite/gcc.dg/lto/pr122515_5.c new file mode 100644 index 0000000..cca1787 --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/pr122515_5.c @@ -0,0 +1,12 @@ +typedef struct { + int num; + int foo[40000000]; +} A_5; + +A_5 a1_5 = {1}; +A_5 a2_5 = {2}; + +int bar_5 (int i) +{ + return i++; +} diff --git a/gcc/testsuite/gcc.dg/lto/pr122515_6.c b/gcc/testsuite/gcc.dg/lto/pr122515_6.c new file mode 100644 index 0000000..98e6213 --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/pr122515_6.c @@ -0,0 +1,12 @@ +typedef struct { + int num; + int foo[40000000]; +} A_6; + +A_6 a1_6 = {1}; +A_6 a2_6 = {2}; + +int bar_6 (int i) +{ + return i++; +} diff --git a/gcc/testsuite/gcc.dg/lto/pr122515_7.c b/gcc/testsuite/gcc.dg/lto/pr122515_7.c new file mode 100644 index 0000000..7f27fff --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/pr122515_7.c @@ -0,0 +1,12 @@ +typedef struct { + int num; + int foo[40000000]; +} A_7; + +A_7 a1_7 = {1}; +A_7 a2_7 = {2}; + +int bar_7 (int i) +{ + return i++; +} diff --git a/gcc/testsuite/gcc.dg/lto/pr122515_8.c b/gcc/testsuite/gcc.dg/lto/pr122515_8.c new file mode 100644 index 0000000..f3d56bd --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/pr122515_8.c @@ -0,0 +1,12 @@ +typedef struct { + int num; + int foo[40000000]; +} A_8; + +A_8 a1_8 = {1}; +A_8 a2_8 = {2}; + +int bar_8 (int i) +{ + return i++; +} diff --git a/gcc/testsuite/gcc.dg/lto/pr122515_9.c b/gcc/testsuite/gcc.dg/lto/pr122515_9.c new file mode 100644 index 0000000..2fdd04c --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/pr122515_9.c @@ -0,0 +1,12 @@ +typedef struct { + int num; + int foo[40000000]; +} A_9; + +A_9 a1_9 = {1}; +A_9 a2_9 = {2}; + +int bar_9 (int i) +{ + return i++; +} diff --git a/gcc/testsuite/gcc.dg/lto/pr122603_0.c b/gcc/testsuite/gcc.dg/lto/pr122603_0.c new file mode 100644 index 0000000..127aeb7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/pr122603_0.c @@ -0,0 +1,6 @@ +/* PR lto/122603 */ +/* { dg-lto-do link } */ +/* { dg-lto-options { "-O0 -flto -flto-partition=cache --param=lto-min-partition=1" } } */ + +int main() {} +asm(""); diff --git a/gcc/testsuite/gcc.dg/match-shift-cmp-1.c b/gcc/testsuite/gcc.dg/match-shift-cmp-1.c new file mode 100644 index 0000000..7a69cd1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/match-shift-cmp-1.c @@ -0,0 +1,41 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ + +#define TEST_ONE_CST(n, op, type, cst) \ + bool lshift_cst_##type##_##n (type x) { return (cst << x) op x; } + +#define TEST_OP_CST(n, op, cst) \ + TEST_ONE_CST (n, op, unsigned, cst) \ + TEST_ONE_CST (n, op, int, cst) \ + TEST_ONE_CST (n, op, bool, cst) \ + TEST_ONE_CST (n, op, test_enum, cst) + +#define TEST_ONE(n, op, type) \ + bool lshift_##type##_##n (type x, type y) \ + { \ + if (y <= 0) \ + __builtin_unreachable (); \ + return (y << x) op x; \ + } + +#define TEST_OP(n, op) \ + TEST_ONE (n, op, unsigned) \ + TEST_ONE (n, op, int) \ + TEST_ONE (n, op, bool) \ + TEST_ONE (n, op, test_enum) + +typedef enum +{ + MONE = -1, + ZERO = 0, + ONE = 1, + TWO = 2 +} test_enum; + +TEST_OP_CST (eq, ==, 1) +TEST_OP_CST (ne, !=, 2) + +TEST_OP (eq, ==) +TEST_OP (ne, !=) + +/* { dg-final { scan-tree-dump-not "<<" optimized } } */ diff --git a/gcc/testsuite/gcc.dg/match-shift-cmp-2.c b/gcc/testsuite/gcc.dg/match-shift-cmp-2.c new file mode 100644 index 0000000..3d514ba --- /dev/null +++ b/gcc/testsuite/gcc.dg/match-shift-cmp-2.c @@ -0,0 +1,47 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ + +/* The fold (y << x) <op> x -> 0|1 shouldn't trigger when y is 0. */ + +#define TEST_ONE_CST(n, op, type, cst) \ + bool lshift_cst_##type##_##n (type x) { return (cst << x) op x; } + +#define TEST_OP_CST(n, op, cst) \ + TEST_ONE_CST (n, op, unsigned, cst) \ + TEST_ONE_CST (n, op, int, cst) \ + TEST_ONE_CST (n, op, bool, cst) \ + TEST_ONE_CST (n, op, test_enum, cst) + +#define TEST_ONE(n, op, type) \ + bool lshift_##type##_##n (type x, type y) \ + { \ + if (y != 0) \ + __builtin_unreachable (); \ + return (y << x) op x; \ + } + +#define TEST_OP(n, op) \ + TEST_ONE (n, op, unsigned) \ + TEST_ONE (n, op, int) \ + TEST_ONE (n, op, bool) \ + TEST_ONE (n, op, test_enum) + +typedef enum +{ + MONE = -1, + ZERO = 0, + ONE = 1, + TWO = 2 +} test_enum; + +TEST_OP_CST (eq, ==, 0) +TEST_OP_CST (ne, !=, 0) + +TEST_OP (eq, ==) +TEST_OP (ne, !=) + +/* These end up getting folded by other patterns. */ +/* { dg-final { scan-tree-dump-times "x_\\d\\(D\\) == 0" 6 optimized } } */ +/* { dg-final { scan-tree-dump-times "x_\\d\\(D\\) != 0" 6 optimized } } */ +/* { dg-final { scan-tree-dump-times "~x_\\d\\(D\\)" 2 optimized } } */ +/* { dg-final { scan-tree-dump-times "return x_\\d\\(D\\);" 2 optimized } } */ diff --git a/gcc/testsuite/gcc.dg/match-shift-cmp-3.c b/gcc/testsuite/gcc.dg/match-shift-cmp-3.c new file mode 100644 index 0000000..e46ac30 --- /dev/null +++ b/gcc/testsuite/gcc.dg/match-shift-cmp-3.c @@ -0,0 +1,43 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ + +/* The fold (y << x) <op> x -> 0|1 should trigger when y is negative + unsigned. */ + +#define TEST_ONE_CST(n, op, type, cst) \ + bool lshift_cst_##type##_##n (type x) { return ((unsigned) (cst) << x) op x; } + +#define TEST_OP_CST(n, op, cst) \ + TEST_ONE_CST (n, op, unsigned, cst) \ + TEST_ONE_CST (n, op, int, cst) \ + TEST_ONE_CST (n, op, test_enum, cst) + +#define TEST_ONE(n, op, type) \ + bool lshift_##type##_##n (type x, type y) \ + { \ + if ((int) y <= 0) \ + __builtin_unreachable (); \ + return ((unsigned) (y) << x) op x; \ + } + +#define TEST_OP(n, op) \ + TEST_ONE (n, op, unsigned) \ + TEST_ONE (n, op, int) \ + TEST_ONE (n, op, test_enum) + +typedef enum +{ + MONE = -1, + ZERO = 0, + ONE = 1, + TWO = 2 +} test_enum; + +TEST_OP_CST (eq, ==, -1) +TEST_OP_CST (ne, !=, -2) + +TEST_OP (eq, ==) +TEST_OP (ne, !=) + +/* { dg-final { scan-tree-dump-times "return 0;" 6 optimized } } */ +/* { dg-final { scan-tree-dump-times "return 1;" 6 optimized } } */ diff --git a/gcc/testsuite/gcc.dg/match-shift-cmp-4.c b/gcc/testsuite/gcc.dg/match-shift-cmp-4.c new file mode 100644 index 0000000..c2458d9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/match-shift-cmp-4.c @@ -0,0 +1,47 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ +/* { dg-final { scan-tree-dump-times "return 0;" 4 "optimized" { target bitint575 } } } */ +/* { dg-final { scan-tree-dump-times "return 0;" 2 "optimized" { target { ! bitint575 } } } } */ +/* { dg-final { scan-tree-dump-not " << " "optimized" } } */ + +bool +foo (unsigned long long x, unsigned y) +{ + if (x >= 64 || x == 0) + __builtin_unreachable (); + if (y > sizeof (unsigned long long) * __CHAR_BIT__ - 6) + __builtin_unreachable (); + return (x << y) <= y; +} + +#if __BITINT_MAXWIDTH__ >= 575 +bool +bar (unsigned _BitInt(575) x, unsigned y) +{ + if (x >= 1361129467683753853853498429727072845823uwb || x == 0) + __builtin_unreachable (); + if (y > 575 - 130) + __builtin_unreachable (); + return (x << y) < y; +} + +bool +baz (unsigned _BitInt(575) x, unsigned y) +{ + if (x >= 1361129467683753853853498429727072845823uwb || x == 0) + __builtin_unreachable (); + if (y >= 575 - 130) + __builtin_unreachable (); + return ((signed _BitInt(575)) (x << y)) < y; +} +#endif + +bool +qux (int x, int y) +{ + if (x >= 128 || x <= 0) + __builtin_unreachable (); + if (y >= sizeof (int) * __CHAR_BIT__ - 7) + __builtin_unreachable (); + return (x << y) <= y; +} diff --git a/gcc/testsuite/gcc.dg/match-shift-cmp-5.c b/gcc/testsuite/gcc.dg/match-shift-cmp-5.c new file mode 100644 index 0000000..7768f59 --- /dev/null +++ b/gcc/testsuite/gcc.dg/match-shift-cmp-5.c @@ -0,0 +1,47 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ +/* { dg-final { scan-tree-dump-times "return 1;" 4 "optimized" { target bitint575 } } } */ +/* { dg-final { scan-tree-dump-times "return 1;" 2 "optimized" { target { ! bitint575 } } } } */ +/* { dg-final { scan-tree-dump-not " << " "optimized" } } */ + +bool +foo (unsigned long long x, unsigned y) +{ + if (x >= 64 || x == 0) + __builtin_unreachable (); + if (y > sizeof (unsigned long long) * __CHAR_BIT__ - 6) + __builtin_unreachable (); + return (x << y) >= y; +} + +#if __BITINT_MAXWIDTH__ >= 575 +bool +bar (unsigned _BitInt(575) x, unsigned y) +{ + if (x >= 1361129467683753853853498429727072845823uwb || x == 0) + __builtin_unreachable (); + if (y > 575 - 130) + __builtin_unreachable (); + return (x << y) > y; +} + +bool +baz (unsigned _BitInt(575) x, unsigned y) +{ + if (x >= 1361129467683753853853498429727072845823uwb || x == 0) + __builtin_unreachable (); + if (y >= 575 - 130) + __builtin_unreachable (); + return ((signed _BitInt(575)) (x << y)) > y; +} +#endif + +bool +qux (int x, int y) +{ + if (x >= 128 || x <= 0) + __builtin_unreachable (); + if (y >= sizeof (int) * __CHAR_BIT__ - 7) + __builtin_unreachable (); + return (x << y) >= y; +} diff --git a/gcc/testsuite/gcc.dg/maxof-bitint.c b/gcc/testsuite/gcc.dg/maxof-bitint.c new file mode 100644 index 0000000..647909c --- /dev/null +++ b/gcc/testsuite/gcc.dg/maxof-bitint.c @@ -0,0 +1,20 @@ +/* { dg-do compile { target bitint } } */ +/* { dg-options "-std=gnu2y" } */ + +void +limits (void) +{ + _Static_assert (_Maxof (_BitInt (5)) == 15); + _Static_assert (_Minof (_BitInt (5)) == -16); + _Static_assert (_Maxof (unsigned _BitInt (5)) == 31); + _Static_assert (_Minof (unsigned _BitInt (5)) == 0); +} + +void +type (void) +{ + _Generic (_Maxof (_BitInt (5)), _BitInt (5): 0); + _Generic (_Minof (_BitInt (5)), _BitInt (5): 0); + _Generic (_Maxof (unsigned _BitInt (5)), unsigned _BitInt (5): 0); + _Generic (_Minof (unsigned _BitInt (5)), unsigned _BitInt (5): 0); +} diff --git a/gcc/testsuite/gcc.dg/maxof-bitint575.c b/gcc/testsuite/gcc.dg/maxof-bitint575.c new file mode 100644 index 0000000..f43951a --- /dev/null +++ b/gcc/testsuite/gcc.dg/maxof-bitint575.c @@ -0,0 +1,39 @@ +/* { dg-do run { target bitint575 } } */ +/* { dg-options "-std=gnu2y" } */ + +#define assert(e) ((e) ? (void) 0 : __builtin_abort ()) + +void limits (void); + +int +main (void) +{ + limits (); +} + +void +limits (void) +{ + unsigned _BitInt (500) u; + _BitInt (500) i; + + u = 0; + u--; + + assert (_Maxof (unsigned _BitInt (500)) == u); + assert (_Minof (unsigned _BitInt (500)) == 0); + + i = u >> 1; + + assert (_Maxof (_BitInt (500)) == i); + assert (_Minof (_BitInt (500)) == -i-1); +} + +void +type (void) +{ + _Generic (_Maxof (_BitInt (500)), _BitInt (500): 0); + _Generic (_Minof (_BitInt (500)), _BitInt (500): 0); + _Generic (_Maxof (unsigned _BitInt (500)), unsigned _BitInt (500): 0); + _Generic (_Minof (unsigned _BitInt (500)), unsigned _BitInt (500): 0); +} diff --git a/gcc/testsuite/gcc.dg/maxof-compile.c b/gcc/testsuite/gcc.dg/maxof-compile.c new file mode 100644 index 0000000..098cade --- /dev/null +++ b/gcc/testsuite/gcc.dg/maxof-compile.c @@ -0,0 +1,158 @@ +/* { dg-do compile } */ +/* { dg-options "-std=gnu2y" } */ + +#define SCHAR_MAX __SCHAR_MAX__ +#define SCHAR_MIN (-SCHAR_MAX - 1) +#define UCHAR_MAX (SCHAR_MAX * 2 + 1) + +#define SHRT_MAX __SHRT_MAX__ +#define SHRT_MIN (-SHRT_MAX - 1) +#define USHRT_MAX (SHRT_MAX * 2U + 1) + +#define INT_MAX __INT_MAX__ +#define INT_MIN (-INT_MAX - 1) +#define UINT_MAX (INT_MAX * 2U + 1) + +#define LONG_MAX __LONG_MAX__ +#define LONG_MIN (-LONG_MAX - 1L) +#define ULONG_MAX (LONG_MAX * 2LU + 1) + +void +integer (void) +{ + _Static_assert (_Maxof (char) == SCHAR_MAX || _Maxof (char) == UCHAR_MAX); + _Static_assert (_Minof (char) == SCHAR_MIN || _Minof (char) == 0); + + _Static_assert (_Maxof (signed char) == SCHAR_MAX); + _Static_assert (_Maxof (short) == SHRT_MAX); + _Static_assert (_Maxof (int) == INT_MAX); + _Static_assert (_Maxof (long) == LONG_MAX); + _Static_assert (_Maxof (long long) >= LONG_MAX); + + _Static_assert (_Minof (signed char) == SCHAR_MIN); + _Static_assert (_Minof (short) == SHRT_MIN); + _Static_assert (_Minof (int) == INT_MIN); + _Static_assert (_Minof (long) == LONG_MIN); + _Static_assert (_Minof (long long) <= LONG_MIN); + + _Static_assert (_Maxof (unsigned char) == UCHAR_MAX); + _Static_assert (_Maxof (unsigned short) == USHRT_MAX); + _Static_assert (_Maxof (unsigned int) == UINT_MAX); + _Static_assert (_Maxof (unsigned long) == ULONG_MAX); + _Static_assert (_Maxof (unsigned long long) >= ULONG_MAX); + + _Static_assert (_Minof (unsigned char) == 0); + _Static_assert (_Minof (unsigned short) == 0); + _Static_assert (_Minof (unsigned int) == 0); + _Static_assert (_Minof (unsigned long) == 0); + _Static_assert (_Minof (unsigned long long) == 0); + + _Static_assert (_Maxof (bool) == true); + _Static_assert (_Minof (bool) == false); +} + +void +enums (void) +{ + enum e1 { E1 }; + enum e2 : short { E2 }; + + _Maxof (enum e1); + _Minof (enum e1); + _Static_assert (_Maxof (enum e2) == SHRT_MAX); + _Static_assert (_Minof (enum e2) == SHRT_MIN); +} + +void +expr (void) +{ + int x; + + _Maxof (x); /* { dg-error "to something not a type" } */ + /* { dg-error "expected '\\)'" "syntax error" { target *-*-* } .-1 } */ + _Minof (x); /* { dg-error "to something not a type" } */ + /* { dg-error "expected '\\)'" "syntax error" { target *-*-* } .-1 } */ + _Maxof (1); /* { dg-error "to something not a type" } */ + /* { dg-error "expected '\\)'" "syntax error" { target *-*-* } .-1 } */ + _Minof (1); /* { dg-error "to something not a type" } */ + /* { dg-error "expected '\\)'" "syntax error" { target *-*-* } .-1 } */ + _Maxof 1; /* { dg-error "expected '\\('" } */ + _Minof 1; /* { dg-error "expected '\\('" } */ + _Maxof (int) {1}; /* { dg-error "expected ';'" } */ + _Minof (int) {1}; /* { dg-error "expected ';'" } */ +} + +void +incomplete (void) +{ + _Maxof (enum e); /* { dg-error "to incomplete type" } */ + _Minof (enum e); /* { dg-error "to incomplete type" } */ +} + +void +non_int (void) +{ + struct s {int x;}; + union u {int x;}; + + _Maxof (struct s); /* { dg-error "to type" } */ + _Minof (struct s); /* { dg-error "to type" } */ + _Maxof (union u); /* { dg-error "to type" } */ + _Minof (union u); /* { dg-error "to type" } */ + _Maxof (int [1]); /* { dg-error "to type" } */ + _Minof (int [1]); /* { dg-error "to type" } */ +} + +void +specs (void) +{ + _Maxof (static int); /* { dg-error "to something not a type" } */ + /* { dg-error "expected '\\)'" "syntax error" { target *-*-* } .-1 } */ + _Minof (static int); /* { dg-error "to something not a type" } */ + /* { dg-error "expected '\\)'" "syntax error" { target *-*-* } .-1 } */ + _Maxof (alignas(8) int); /* { dg-error "alignment specified" } */ + _Minof (alignas(8) int); /* { dg-error "alignment specified" } */ +} + +void +bogus (void) +{ + _Maxof (int x); /* { dg-error "expected '\\)'" } */ + _Minof (int x); /* { dg-error "expected '\\)'" } */ + _Maxof (int (!)); /* { dg-error "expected '\\)'" } */ + _Minof (int (!)); /* { dg-error "expected '\\)'" } */ +} + +void +type (void) +{ + _Generic (_Maxof (char), char: 0); + _Generic (_Minof (char), char: 0); + + _Generic (_Maxof (signed char), signed char: 0); + _Generic (_Maxof (short), short: 0); + _Generic (_Maxof (int), int: 0); + _Generic (_Maxof (long), long: 0); + _Generic (_Maxof (long long), long long: 0); + + _Generic (_Minof (signed char), signed char: 0); + _Generic (_Minof (short), short: 0); + _Generic (_Minof (int), int: 0); + _Generic (_Minof (long), long: 0); + _Generic (_Minof (long long), long long: 0); + + _Generic (_Maxof (unsigned char), unsigned char: 0); + _Generic (_Maxof (unsigned short), unsigned short: 0); + _Generic (_Maxof (unsigned int), unsigned int: 0); + _Generic (_Maxof (unsigned long), unsigned long: 0); + _Generic (_Maxof (unsigned long long), unsigned long long: 0); + + _Generic (_Minof (unsigned char), unsigned char: 0); + _Generic (_Minof (unsigned short), unsigned short: 0); + _Generic (_Minof (unsigned int), unsigned int: 0); + _Generic (_Minof (unsigned long), unsigned long: 0); + _Generic (_Minof (unsigned long long), unsigned long long: 0); + + _Generic (_Maxof (bool), bool: 0); + _Generic (_Minof (bool), bool: 0); +} diff --git a/gcc/testsuite/gcc.dg/maxof-pedantic-errors.c b/gcc/testsuite/gcc.dg/maxof-pedantic-errors.c new file mode 100644 index 0000000..dcb64bb --- /dev/null +++ b/gcc/testsuite/gcc.dg/maxof-pedantic-errors.c @@ -0,0 +1,5 @@ +/* { dg-do compile } */ +/* { dg-options "-std=c23 -pedantic-errors" } */ + +int a[_Maxof(char)]; /* { dg-error "ISO C does not support" } */ +int b[1 + _Minof(unsigned char)]; /* { dg-error "ISO C does not support" } */ diff --git a/gcc/testsuite/gcc.dg/maxof-pedantic.c b/gcc/testsuite/gcc.dg/maxof-pedantic.c new file mode 100644 index 0000000..fa2582c --- /dev/null +++ b/gcc/testsuite/gcc.dg/maxof-pedantic.c @@ -0,0 +1,5 @@ +/* { dg-do compile } */ +/* { dg-options "-std=c23 -pedantic" } */ + +int a[_Maxof(char)]; /* { dg-warning "ISO C does not support" } */ +int b[1 + _Minof(unsigned char)]; /* { dg-warning "ISO C does not support" } */ diff --git a/gcc/testsuite/gcc.dg/pid_t-1.c b/gcc/testsuite/gcc.dg/pid_t-1.c new file mode 100644 index 0000000..f4f3f68 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pid_t-1.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-Wall" } */ +/* { dg-require-fork "" } */ + +/* Compile with -Wall to get a warning if built-in and system pid_t don't + match. */ + +#include <sys/types.h> + +typedef __typeof (__builtin_fork ()) __builtin_pid_t; + +__builtin_pid_t __p_t__; +pid_t *p_t_p; + +void +pt (void) +{ + p_t_p = &__p_t__; +} diff --git a/gcc/testsuite/gcc.dg/plugin/location-overflow-test-3.c b/gcc/testsuite/gcc.dg/plugin/location-overflow-test-3.c new file mode 100644 index 0000000..2acf1c3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/plugin/location-overflow-test-3.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-fplugin-arg-location_overflow_plugin-value=1024 -fdump-internal-locations" } */ + +/* The plugin arranges for location_t values to exceed 32 bits; verify the + internal dump routines don't crash. The exact output depends on the system + and on absolute path names, and this output is only meant for internal + purposes, so don't demand an exact form of the output. */ + +/* { dg-allow-blank-lines-in-output 1 } */ +/* { dg-prune-output ".*" } */ diff --git a/gcc/testsuite/gcc.dg/plugin/plugin.exp b/gcc/testsuite/gcc.dg/plugin/plugin.exp index 38991e8..83ef1b2 100644 --- a/gcc/testsuite/gcc.dg/plugin/plugin.exp +++ b/gcc/testsuite/gcc.dg/plugin/plugin.exp @@ -145,6 +145,7 @@ set plugin_test_list [list \ { location_overflow_plugin.cc \ location-overflow-test-1.c \ location-overflow-test-2.c \ + location-overflow-test-3.c \ location-overflow-test-pr83173.c \ location-overflow-test-pr116047.c \ location-overflow-test-pr120061.c } \ diff --git a/gcc/testsuite/gcc.dg/pointer-counted-by-pr122982.c b/gcc/testsuite/gcc.dg/pointer-counted-by-pr122982.c new file mode 100644 index 0000000..1bad7f0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pointer-counted-by-pr122982.c @@ -0,0 +1,19 @@ +/* PR c/122982 */ +/* { dg-do compile } */ +/* { dg-options "-O0" } */ + +int* f (int); + +struct __bounded_ptr { + int k; + int *buf __attribute__ ((counted_by (k))); +}; + +int* +f1 (int n) { return f (n); } + +void h1 (void) +{ + int *p = (struct __bounded_ptr) {3, f1 (3)}.buf; + __builtin_memset (p, 0, 3 * sizeof p); +} diff --git a/gcc/testsuite/gcc.dg/pr102983.c b/gcc/testsuite/gcc.dg/pr102983.c index ded748a..1b0e5c7 100644 --- a/gcc/testsuite/gcc.dg/pr102983.c +++ b/gcc/testsuite/gcc.dg/pr102983.c @@ -18,4 +18,4 @@ int main() { } } -/* { dg-final { scan-tree-dump-times "Global Exported: c_.*1, 1" 1 "evrp" } } */ +/* { dg-final { scan-tree-dump-not "if \\(c_" "evrp" } } */ diff --git a/gcc/testsuite/gcc.dg/pr113632.c b/gcc/testsuite/gcc.dg/pr113632.c new file mode 100644 index 0000000..dd49b66 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr113632.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-evrp" } */ + +void dummy(void); +_Bool f(unsigned long a) +{ + _Bool cmp = a > 8192; + if (cmp) goto then; else goto e; +then: + unsigned long t = __builtin_clzl(a); // [0,50] + t^=63; // [13,63] + if (t < 13 || t >63) + dummy (); +e: + return 0; +} + +void f2(int x) +{ + if (x <= 0 || x == 2 || x == 4 || x == 6) + return; + /* x = [1, 1][3, 3][5, 5][7, 2147483647] */ + /* x ^ 6 should be non-zero. */ + if ((x ^ 6) == 0) + dummy (); +} + +/* { dg-final { scan-tree-dump-not "dummy" "evrp" } } */ diff --git a/gcc/testsuite/gcc.dg/pr116815.c b/gcc/testsuite/gcc.dg/pr116815.c index b5f1330..7b0650f 100644 --- a/gcc/testsuite/gcc.dg/pr116815.c +++ b/gcc/testsuite/gcc.dg/pr116815.c @@ -1,5 +1,5 @@ /* PR target/116815 */ -/* { dg-do run } */ +/* { dg-do run { target int32 } } */ /* { dg-options "-O2" } */ [[gnu::always_inline]] diff --git a/gcc/testsuite/gcc.dg/pr121506.c b/gcc/testsuite/gcc.dg/pr121506.c new file mode 100644 index 0000000..0d06647 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr121506.c @@ -0,0 +1,8 @@ +/* PR c/121506 */ +/* { dg-do compile } */ + +#include <stdarg.h> + +struct A; +void foo (struct A *); /* { dg-message "previous declaration of 'foo' with type 'void\\\(struct A \\\*\\\)'" } */ +void foo (va_list); /* { dg-error "conflicting types for 'foo'; have" } */ diff --git a/gcc/testsuite/gcc.dg/pr121519.c b/gcc/testsuite/gcc.dg/pr121519.c new file mode 100644 index 0000000..e86f67d --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr121519.c @@ -0,0 +1,41 @@ +/* PR tree-optimization/121519 */ +/* { dg-do compile { target int32plus } } */ +/* { dg-options "-O3" } */ + +extern int foo (void); +int a, b, c; + +int +bar (int f) +{ + int d = 0; + for (; d < 6; d++) + { + a = f <<= 1; + if (f & 64) + f ^= 67; + } + return a; +} + +void +baz (void) +{ + int i = 0; + if (c) + goto j; + i = -32644994; +k: + b = 0; +j: + if (foo () - 508050053 + bar (i + 79)) + goto k; +} + +int +main () +{ + while (a) + baz (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/pr122126_vextr.c b/gcc/testsuite/gcc.dg/pr122126_vextr.c new file mode 100644 index 0000000..b598aa0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr122126_vextr.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ +/* { dg-additional-options "-mavx2" { target avx2 } } */ + +#define vect16 __attribute__((vector_size(16))) +void ub_set() { + volatile vect16 unsigned BS_VAR_0; + unsigned a = BS_VAR_0[12]; +} diff --git a/gcc/testsuite/gcc.dg/pr122126_vset.c b/gcc/testsuite/gcc.dg/pr122126_vset.c new file mode 100644 index 0000000..85b2c68 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr122126_vset.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ +/* { dg-additional-options "-mavx2" { target avx2 } } */ + +#define vect16 __attribute__((vector_size(16))) +void ub_set() { + volatile vect16 unsigned BS_VAR_0; + BS_VAR_0[12] = 4; +} diff --git a/gcc/testsuite/gcc.dg/pr122756.c b/gcc/testsuite/gcc.dg/pr122756.c new file mode 100644 index 0000000..6299469 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr122756.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-O3" } */ +/* { dg-additional-options "-march=rv64gcv -mabi=lp64d" { target { rv64 } } } */ + +long a; +void b() { + unsigned long c, d; + for (;; c = d + 2000) { + d = c; + for (; d < a; d += 2) + if (d % 2) + for (;;) + ; + } +} diff --git a/gcc/testsuite/gcc.dg/pr122773.c b/gcc/testsuite/gcc.dg/pr122773.c new file mode 100644 index 0000000..a3860e9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr122773.c @@ -0,0 +1,25 @@ +/* PR middle-end/122773 */ +/* { dg-do compile } */ +/* { dg-options "-Wimplicit-fallthrough -O2 -ftrivial-auto-var-init=zero" } */ + +void *l; +int +foo (int x) +{ + __label__ l1, l2, l3; + static void *l[] = { &&l1, &&l2, &&l3 }; + switch (0) + { + case 0: + while (0) + ; + goto *l[x]; + } + l1: + ++x; + l2: + ++x; + l3: + ++x; + return x; +} diff --git a/gcc/testsuite/gcc.dg/pr122898.c b/gcc/testsuite/gcc.dg/pr122898.c new file mode 100644 index 0000000..8b89c82 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr122898.c @@ -0,0 +1,56 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -fno-tree-forwprop -fno-tree-fre" } */ +extern void o(); +int a, b, c, d, e, f, g, h, i, k, l, m, n; +volatile int j; +static void p() { + if (d) { + q: + if (a) { + if (k) { + if (!(d && e)) + goto r; + if (i) + goto q; + o(); + } + h || j; + } + s: + d || j; + if (a) + goto q; + r: + if (b) { + if (c) + goto t; + if (b) + goto r; + if (m) + goto q; + } + while (j) + ; + u: + if (g) { + o(); + goto s; + } + if (h) { + t: + if (n) + goto v; + o(); + goto r; + } + int w = i & 1; + v: + if (w <= l) + if (f) + goto u; + goto q; + } + if (a) + goto v; +} +int main() { p(); } diff --git a/gcc/testsuite/gcc.dg/pr122947.c b/gcc/testsuite/gcc.dg/pr122947.c new file mode 100644 index 0000000..945a61a --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr122947.c @@ -0,0 +1,45 @@ +/* PR rtl-optimization/122947 based on PR 117239 */ +/* { dg-do run } */ +/* { dg-options "-fno-inline -O2" } */ +/* { dg-additional-options "-fschedule-insns -mno-accumulate-outgoing-args" { target x86 } } */ + +int c = 1; + +struct A { + int e, f, g, h; + short i; + int j; +}; + +void +bar (int x, struct A y) +{ + if (y.j == 1) + c = 0; +} + +/* Simplest pure way to force baz's x.j back to memory. + So simple that IPA "inlines" it, so we disable IPA and mark as pure. */ +int __attribute__ ((noipa, pure)) +bad (struct A const *x) +{ + return x->j; +} + +int +baz (struct A x) +{ + x.j = 0; + return bad (&x); +} + +int +main () +{ + struct A k = { 0, 0, 0, 0, 0, 1 }; + int d = baz (k); + bar (0, k); + if (c + d != 0) + __builtin_abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/pr122991.c b/gcc/testsuite/gcc.dg/pr122991.c new file mode 100644 index 0000000..6b27a2d --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr122991.c @@ -0,0 +1,28 @@ +/* PR target/122991 */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ +/* { dg-additional-options "-msse4" { target i?86-*-* x86_64-*-* } } */ + +int +foo () +{ + return __builtin_rev_crc32_data32 (0, 0, 0); +} + +int +bar () +{ + return __builtin_rev_crc32_data32 (-1U, -1U, -1U); +} + +int +baz () +{ + return __builtin_crc32_data32 (0, 0, 0); +} + +int +qux () +{ + return __builtin_crc32_data32 (-1U, -1U, -1U); +} diff --git a/gcc/testsuite/gcc.dg/pr123018.c b/gcc/testsuite/gcc.dg/pr123018.c new file mode 100644 index 0000000..f1f701b --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr123018.c @@ -0,0 +1,17 @@ +/* PR c/123018 */ +/* { dg-do compile } */ + +struct A { + int x : 8 __attribute__ ((vector_size (8))); /* { dg-error "bit-field 'x' has invalid type" } */ +}; +struct B { + float x : 8; /* { dg-error "bit-field 'x' has invalid type" } */ +}; +struct C { + int : 8 __attribute__ ((vector_size (8))); /* { dg-error "bit-field '\[^\n\r]*anonymous\[^\n\r]*' has invalid type" } */ + int x; +}; +struct D { + float : 8; /* { dg-error "bit-field '\[^\n\r]*anonymous\[^\n\r]*' has invalid type" } */ + int x; +}; diff --git a/gcc/testsuite/gcc.dg/pr68090.c b/gcc/testsuite/gcc.dg/pr68090.c index 87b3b93..84e0ca4 100644 --- a/gcc/testsuite/gcc.dg/pr68090.c +++ b/gcc/testsuite/gcc.dg/pr68090.c @@ -1,13 +1,18 @@ /* PR c/68090 */ /* { dg-do compile } */ -/* { dg-options "" } */ +/* { dg-options "--pedantic-error" } */ void fn (int i) { (int[(0, 1)]) { 0 }; /* { dg-error "compound literal has variable size" } */ + /* { dg-error "variable-size" "" { target *-*-* } .-1 } */ (int[i]) { 0 }; /* { dg-error "compound literal has variable size" } */ + /* { dg-error "variable-size" "" { target *-*-* } .-1 } */ (int[(0, i)]) { 0 }; /* { dg-error "compound literal has variable size" } */ + /* { dg-error "variable-size" "" { target *-*-* } .-1 } */ (int [][i]){ 0 }; /* { dg-error "compound literal has variable size" } */ + /* { dg-error "variable-size" "" { target *-*-* } .-1 } */ (int [][(1, 2)]){ 0 }; /* { dg-error "compound literal has variable size" } */ + /* { dg-error "variable-size" "" { target *-*-* } .-1 } */ } diff --git a/gcc/testsuite/gcc.dg/pr90838.c b/gcc/testsuite/gcc.dg/pr90838.c index 9a330f7..8b06929 100644 --- a/gcc/testsuite/gcc.dg/pr90838.c +++ b/gcc/testsuite/gcc.dg/pr90838.c @@ -60,13 +60,13 @@ int ctz4 (unsigned long x) return table[(lsb * magic) >> 58]; } -/* { dg-final { scan-tree-dump-times {= \.CTZ} 4 "forwprop2" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 } } } } } } */ -/* { dg-final { scan-assembler-times "tzcntq\t" 1 { target { { i?86-*-* x86_64-*-* } && { ! { ia32 } } } } } } */ +/* { dg-final { scan-tree-dump-times {= \.CTZ} 4 "forwprop2" { target { { i?86-*-* x86_64-*-* } && lp64 } } } } */ +/* { dg-final { scan-assembler-times "tzcntq\t" 1 { target { { i?86-*-* x86_64-*-* } && lp64 } } } } */ /* { dg-final { scan-assembler-times "tzcntl\t" 3 { target { { i?86-*-* x86_64-*-* } && { ! { ia32 } } } } } } */ -/* { dg-final { scan-assembler-times "andl\t" 2 { target { { i?86-*-* x86_64-*-* } && { ! { ia32 } } } } } } */ +/* { dg-final { scan-assembler-times "andl\t" 2 { target { { i?86-*-* x86_64-*-* } && lp64 } } } } */ /* { dg-final { scan-assembler-not "negq" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 } } } } } } */ -/* { dg-final { scan-assembler-not "imulq" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 } } } } } } */ -/* { dg-final { scan-assembler-not "shrq" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 } } } } } } */ +/* { dg-final { scan-assembler-not "imulq" { target { { i?86-*-* x86_64-*-* } && { ! { x32 } } } } } } */ +/* { dg-final { scan-assembler-not "shrq" { target { { i?86-*-* x86_64-*-* } && { ! { x32 } } } } } } */ /* { dg-final { scan-tree-dump-times {= \.CTZ} 4 "forwprop2" { target aarch64*-*-* } } } */ /* { dg-final { scan-assembler-times "clz\t" 4 { target aarch64*-*-* } } } */ diff --git a/gcc/testsuite/gcc.dg/pr97986-1.c b/gcc/testsuite/gcc.dg/pr97986-1.c new file mode 100644 index 0000000..87ee3d8 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr97986-1.c @@ -0,0 +1,27 @@ +/* { dg-do run } */ +/* { dg-options "-std=gnu23" } */ + +#include <stdarg.h> + +int f(int n, ...) +{ + __label__ b, d; + va_list ap; + va_start(ap, n); + _Static_assert(5 == sizeof(va_arg(ap, char[5]))); /* { dg-warning "array type" } */ + void g(void) { n++; goto b; } + int *a = va_arg((g(), ap), int[n]); /* { dg-warning "array type" } */ +b: + void h(void) { n++; goto d; } + typeof(va_arg(ap, int[(h(), n)])) c; /* { dg-warning "array type" } */ +d: + return n; +} + +int main() +{ + if (9 != f(7)) + __builtin_abort(); + return 0; +} + diff --git a/gcc/testsuite/gcc.dg/pr97986-2.c b/gcc/testsuite/gcc.dg/pr97986-2.c new file mode 100644 index 0000000..fc23a57 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr97986-2.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-std=c90" } */ + +#include <stdarg.h> + + +int f(int n, ...) +{ + va_list ap; + va_start(ap, n); + _Static_assert(5 == sizeof(va_arg(ap, char[5]))); + va_arg(ap, int[n]); /* { dg-error "array type" } */ + int * a = va_arg(ap, int[3]); /* { dg-error "invalid use of non-lvalue array" } */ +} + diff --git a/gcc/testsuite/gcc.dg/tls/data-sections-1.c b/gcc/testsuite/gcc.dg/tls/data-sections-1.c new file mode 100644 index 0000000..c829256 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tls/data-sections-1.c @@ -0,0 +1,14 @@ +/* { dg-do run } */ +/* { dg-require-effective-target tls_runtime } */ +/* { dg-options "-fdata-sections" } */ +/* { dg-add-options tls } */ + +__thread int i = 1; + +int main (void) +{ + if (i != 1) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/torture/pr113026-1.c b/gcc/testsuite/gcc.dg/torture/pr113026-1.c index 56dfef3..37b5281d 100644 --- a/gcc/testsuite/gcc.dg/torture/pr113026-1.c +++ b/gcc/testsuite/gcc.dg/torture/pr113026-1.c @@ -1,4 +1,6 @@ -/* { dg-do compile } */ +/* { dg-do compile } */ +/* When tracing the vector epilog we diagnose an unreachable access. */ +/* { dg-skip-if "" { *-*-* } { "-ftracer" } { "" } } */ /* { dg-additional-options "-Wall" } */ char dst[16]; diff --git a/gcc/testsuite/gcc.dg/torture/pr116835.c b/gcc/testsuite/gcc.dg/torture/pr116835.c new file mode 100644 index 0000000..31d3b59 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr116835.c @@ -0,0 +1,33 @@ +/* { dg-do run { target { weak_undefined } } } */ +/* { dg-add-options weak_undefined } */ + +/* PR tree-optimization/116835 */ +/* phiprop would prop into the loop the load of b + and also prop the load of a before the loop. + Which is incorrect as a is a weak symbol. */ + +struct s1 +{ + int t; + int t1; +}; +typedef struct s1 type; +extern type a __attribute__((weak)); +int t; +type b; +type bar (int c) __attribute__((noipa, noinline)); +type +bar (int c) +{ + t = 1; + type *p = &a; + for (int j = 0; j < c; ++j) + p = &b; + return *p; +} + +int main(void) +{ + if (bar(&a == nullptr).t) + __builtin_abort(); +} diff --git a/gcc/testsuite/gcc.dg/torture/pr122502-2.c b/gcc/testsuite/gcc.dg/torture/pr122502-2.c new file mode 100644 index 0000000..36a114d --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr122502-2.c @@ -0,0 +1,23 @@ +/* { dg-do compile } */ + +typedef struct { + int mant; + int exp; +} SoftFloat; +SoftFloat __trans_tmp_8, main___trans_tmp_5; +static SoftFloat av_normalize_sf(SoftFloat a) { + while (a.mant + 536870911 < 1073741823) { + a.mant += a.mant; + a.exp -= 1; + } + return a; +} +void main() { + main___trans_tmp_5 = av_normalize_sf((SoftFloat){1, 29 + 1}); + SoftFloat sf1 = main___trans_tmp_5; + for (;;) { + int t = main___trans_tmp_5.exp - sf1.exp; + if (t < 2) + sf1 = __trans_tmp_8; + } +} diff --git a/gcc/testsuite/gcc.dg/torture/pr122599-1.c b/gcc/testsuite/gcc.dg/torture/pr122599-1.c new file mode 100644 index 0000000..5f2356f --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr122599-1.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* PR tree-optimization/122599 */ + +void f(int *x, unsigned n) { + for (int i = 0; i < 5; i++) + while ((int)--n >= 0) + x[0] = 0; +} diff --git a/gcc/testsuite/gcc.dg/torture/pr122615.c b/gcc/testsuite/gcc.dg/torture/pr122615.c new file mode 100644 index 0000000..9f4f3c4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr122615.c @@ -0,0 +1,22 @@ +/* { dg-do compile } */ +/* { dg-options "-fdump-tree-original" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ + +int f1 (int x) +{ + return x & 1 ? (x & ~1) : (x | 1); +} + +int f2 (int x) +{ + return x & 2 ? (x & ~2) : (x | 2); +} + +int f3 (int x) +{ + return x & 3 ? (x & ~3) : (x | 3); +} + +/* { dg-final { scan-tree-dump-times "x \\^ 1" 1 "original" } } */ +/* { dg-final { scan-tree-dump-times "x \\^ 2" 1 "original" } } */ +/* { dg-final { scan-tree-dump-times "x \\^ 3" 0 "original" } } */ diff --git a/gcc/testsuite/gcc.dg/torture/pr122616.c b/gcc/testsuite/gcc.dg/torture/pr122616.c new file mode 100644 index 0000000..77d364e --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr122616.c @@ -0,0 +1,22 @@ +/* { dg-do compile } */ +/* { dg-options "-fdump-tree-original" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ + +int f1 (int x) +{ + return x & 1 ? (x - 1) : (x | 1); +} + +int f2 (int x) +{ + return x & 2 ? (x - 2) : (x | 2); +} + +int f3 (int x) +{ + return x & 3 ? (x - 3) : (x | 3); +} + +/* { dg-final { scan-tree-dump-times "x \\^ 1" 1 "original" } } */ +/* { dg-final { scan-tree-dump-times "x \\^ 2" 1 "original" } } */ +/* { dg-final { scan-tree-dump-times "x \\^ 3" 0 "original" } } */ diff --git a/gcc/testsuite/gcc.dg/torture/pr122629-1.c b/gcc/testsuite/gcc.dg/torture/pr122629-1.c new file mode 100644 index 0000000..47936e7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr122629-1.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* PR tree-optimization/122629 */ + +/* factor_out_operators was factoring out BIT_FIELD_REF and BIT_INSERT_EXPR, + both which requires constant operands so it would not valid to factor. */ + +typedef int ix4 __attribute__((vector_size(4*sizeof(int)))); + +int f(ix4 *a, int l, int *b) +{ + for (int i =0 ;i < l; i++) + { + int t; + ix4 tt = a[i]; + if(*b) t = tt[1]; else t = tt[0]; + *b = t; + } +} + +int g(ix4 *a, int l, int *b) +{ + for (int i =0 ;i < l; i++) + { + ix4 tt = a[i]; + if(*b) tt[1] = 1; else tt[0] = 1; + *a = tt; + } +} diff --git a/gcc/testsuite/gcc.dg/torture/pr122629-2.c b/gcc/testsuite/gcc.dg/torture/pr122629-2.c new file mode 100644 index 0000000..1ade7b9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr122629-2.c @@ -0,0 +1,32 @@ +/* { dg-do compile } */ +/* PR tree-optimization/122629 */ + +typedef int ix4 __attribute__((vector_size(4*sizeof(int)))); + +int f(ix4 *a, int l, int *b, ix4 *c) +{ + for (int i =0 ;i < l; i++) + { + int t; + ix4 tt = a[i]; + ix4 tt1 = c[i]; + if(*b) t = tt1[0]; else t = tt[0]; + *b = t; + } +} + +int g(ix4 *a, int l, int *b, ix4 *c) +{ + for (int i =0 ;i < l; i++) + { + ix4 tt = a[i]; + ix4 tt1 = c[i]; + if(*b) { + tt = tt1; + tt[0] = 1; + } else { + tt[0] = 1; + } + a[i] = tt; + } +} diff --git a/gcc/testsuite/gcc.dg/torture/pr122637-1.c b/gcc/testsuite/gcc.dg/torture/pr122637-1.c new file mode 100644 index 0000000..22d6d2d --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr122637-1.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* PR tree-optimization/122637 */ + +char a[10][3]; +int b; +void e(short c) { + for (; c; c--) { + for (int d = 2; d; d--) + b = a[d][0] & a[c][d]; + } +} diff --git a/gcc/testsuite/gcc.dg/torture/pr122701.c b/gcc/testsuite/gcc.dg/torture/pr122701.c new file mode 100644 index 0000000..62d3e3d --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr122701.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ + +char _strtoimax_r_c; +void _strtoimax_r() { + for (;; _strtoimax_r_c++) { + if (_strtoimax_r_c <= '9') + _strtoimax_r_c -= '0'; + if (_strtoimax_r_c >= 'A') + break; + } +} diff --git a/gcc/testsuite/gcc.dg/torture/pr122735.c b/gcc/testsuite/gcc.dg/torture/pr122735.c new file mode 100644 index 0000000..9499ce4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr122735.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +int a; +void b() { + int c; + unsigned d = c + 19; + a = d >> 32 + 19 + d + 255 - 293; +} diff --git a/gcc/testsuite/gcc.dg/torture/pr122835.c b/gcc/testsuite/gcc.dg/torture/pr122835.c new file mode 100644 index 0000000..03efdfa --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr122835.c @@ -0,0 +1,79 @@ +/* PR middle-end/122835 */ +/* { dg-do run { target i?86-*-* x86_64-*-* aarch64-*-* arm*-*-* powerpc*-*-* s390*-*-* } } */ + +#if defined(__x86_64__) || defined(__i386__) +#define JMP "jmp" +#elif defined(__aarch64__) || defined(__arm__) || defined(__powerpc__) +#define JMP "b" +#elif defined(__s390__) +#define JMP "j" +#endif + +int cnt; + +static void +my_cleanup (int *p) +{ + ++cnt; +} + +__attribute__((noipa)) static void +my_abort (void) +{ + __builtin_abort (); +} + +int +main () +{ + { + int x __attribute__((cleanup (my_cleanup))) = 0; + + asm goto (JMP "\t%l0" :::: l1); + + my_abort (); + } + +l1: + if (cnt != 1) + __builtin_abort (); + + { + int x __attribute__((cleanup (my_cleanup))) = 0; + + { + int y __attribute__((cleanup (my_cleanup))) = 0; + + asm goto (JMP "\t%l1" :::: l2, l3); + + my_abort (); + } +l2: + __builtin_abort (); + } +l3: + if (cnt != 3) + __builtin_abort (); + + { + int x __attribute__((cleanup (my_cleanup))) = 0; + + { + int y __attribute__((cleanup (my_cleanup))) = 0; + + asm goto (JMP "\t%l0" :::: l4, l5); + + my_abort (); + } +l4: + if (cnt != 4) + __builtin_abort (); + } + if (0) + { +l5: + __builtin_abort (); + } + if (cnt != 5) + __builtin_abort (); +} diff --git a/gcc/testsuite/gcc.dg/torture/pr122847-1.c b/gcc/testsuite/gcc.dg/torture/pr122847-1.c new file mode 100644 index 0000000..9ec4360 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr122847-1.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* PR tree-optimization/122847 */ + +struct { + char x[6]; +} *a, b; + +int c; + +int d() { + /* `a->x` might trap. */ + char *p = a ? a->x : b.x; + char e = *p; + if (c) + return *(short *)p & e; + return 0; +} diff --git a/gcc/testsuite/gcc.dg/torture/pr122873.c b/gcc/testsuite/gcc.dg/torture/pr122873.c new file mode 100644 index 0000000..1eadcee --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr122873.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-march=armv9-a -msve-vector-bits=128" { target { aarch64-*-* } } } */ +/* { dg-additional-options "-mavx512bw -mavx512vl --param vect-partial-vector-usage=1" { target { avx512bw && avx512vl } } } */ + +char *b; +bool c(int l) +{ + bool d = true; + for (int a = 0; a < l; a++) + if (b[a]) + d = false; + return d; +} diff --git a/gcc/testsuite/gcc.dg/torture/pr123027.c b/gcc/testsuite/gcc.dg/torture/pr123027.c new file mode 100644 index 0000000..cba4cc9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr123027.c @@ -0,0 +1,20 @@ +/* { dg-do run } */ +/* { dg-options "-ffinite-math-only" } */ +/* { dg-add-options ieee } */ + +double a = 0.0; +double b = -0.0; + +int main() +{ + double min1 = a < b ? a : b; + double max1 = a > b ? a : b; + double min2 = b < a ? b : a; + double max2 = b > a ? b : a; + if (__builtin_copysign (1., min1) != -1. + || __builtin_copysign (1., max1) != -1. + || __builtin_copysign (1., min2) != 1. + || __builtin_copysign (1., max2) != 1.) + __builtin_abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/torture/pr28814.c b/gcc/testsuite/gcc.dg/torture/pr28814.c index cf641ca..e835ff5 100644 --- a/gcc/testsuite/gcc.dg/torture/pr28814.c +++ b/gcc/testsuite/gcc.dg/torture/pr28814.c @@ -1,4 +1,5 @@ /* { dg-do compile { target { ilp32 || lp64 } } } */ +/* { dg-options "-Wno-psabi" { target { riscv*-*-* } } } */ struct w49 { diff --git a/gcc/testsuite/gcc.dg/torture/pr99782-1.c b/gcc/testsuite/gcc.dg/torture/pr99782-1.c new file mode 100644 index 0000000..45fb93e --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr99782-1.c @@ -0,0 +1,17 @@ +/* PR middle-end/99782 */ +/* { dg-do compile { target int128 } } */ +/* { dg-additional-options "-mapxf" { target { { i?86-*-* x86_64-*-* } && { ! ia32 } } } } */ + +int hb; + +void +w4 (__int128 uv, int ng) +{ + int vh; + + for (vh = 0; vh < 14; ++vh) + { + ++ng; + hb = (hb == uv) && ng; + } +} diff --git a/gcc/testsuite/gcc.dg/tree-ssa/bit_op_cvt.1.c b/gcc/testsuite/gcc.dg/tree-ssa/bit_op_cvt.1.c new file mode 100644 index 0000000..c0da601 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/bit_op_cvt.1.c @@ -0,0 +1,33 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ + +#include "bit_op_cvt.h" + +DEF_BIT_CVT_0(uint8_t, int8_t, uint16_t, |, bit_ior) +DEF_BIT_CVT_0(uint8_t, int8_t, uint32_t, |, bit_ior) +DEF_BIT_CVT_0(uint8_t, int8_t, uint64_t, |, bit_ior) +DEF_BIT_CVT_0(uint8_t, uint8_t, uint16_t, |, bit_ior) +DEF_BIT_CVT_0(uint8_t, uint8_t, uint32_t, |, bit_ior) +DEF_BIT_CVT_0(uint8_t, uint8_t, uint64_t, |, bit_ior) +DEF_BIT_CVT_0(uint8_t, uint8_t, int16_t, |, bit_ior) +DEF_BIT_CVT_0(uint8_t, uint8_t, int32_t, |, bit_ior) +DEF_BIT_CVT_0(uint8_t, uint8_t, int64_t, |, bit_ior) +DEF_BIT_CVT_0(uint8_t, int8_t, int16_t, |, bit_ior) +DEF_BIT_CVT_0(uint8_t, int8_t, int32_t, |, bit_ior) +DEF_BIT_CVT_0(uint8_t, int8_t, int64_t, |, bit_ior) + +DEF_BIT_CVT_0(uint16_t, int16_t, uint32_t, |, bit_ior) +DEF_BIT_CVT_0(uint16_t, int16_t, uint64_t, |, bit_ior) +DEF_BIT_CVT_0(uint16_t, int16_t, int32_t, |, bit_ior) +DEF_BIT_CVT_0(uint16_t, int16_t, int64_t, |, bit_ior) +DEF_BIT_CVT_0(uint16_t, uint16_t, uint32_t, |, bit_ior) +DEF_BIT_CVT_0(uint16_t, uint16_t, uint64_t, |, bit_ior) +DEF_BIT_CVT_0(uint16_t, uint16_t, int32_t, |, bit_ior) +DEF_BIT_CVT_0(uint16_t, uint16_t, int64_t, |, bit_ior) + +DEF_BIT_CVT_0(uint32_t, int32_t, uint64_t, |, bit_ior) +DEF_BIT_CVT_0(uint32_t, int32_t, int64_t, |, bit_ior) +DEF_BIT_CVT_0(uint32_t, uint32_t, uint64_t, |, bit_ior) +DEF_BIT_CVT_0(uint32_t, uint32_t, int64_t, |, bit_ior) + +/* { dg-final { scan-tree-dump-not "_\[0-9]\+ = \\(u?int\[0-9]\+_t\\) _\[0-9]\+;\\s+return _\[0-9]\+;" "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/bit_op_cvt.2.c b/gcc/testsuite/gcc.dg/tree-ssa/bit_op_cvt.2.c new file mode 100644 index 0000000..38671d2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/bit_op_cvt.2.c @@ -0,0 +1,33 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ + +#include "bit_op_cvt.h" + +DEF_BIT_CVT_0(int8_t, int8_t, uint16_t, |, bit_ior) +DEF_BIT_CVT_0(int8_t, int8_t, uint32_t, |, bit_ior) +DEF_BIT_CVT_0(int8_t, int8_t, uint64_t, |, bit_ior) +DEF_BIT_CVT_0(int8_t, uint8_t, uint16_t, |, bit_ior) +DEF_BIT_CVT_0(int8_t, uint8_t, uint32_t, |, bit_ior) +DEF_BIT_CVT_0(int8_t, uint8_t, uint64_t, |, bit_ior) +DEF_BIT_CVT_0(int8_t, uint8_t, int16_t, |, bit_ior) +DEF_BIT_CVT_0(int8_t, uint8_t, int32_t, |, bit_ior) +DEF_BIT_CVT_0(int8_t, uint8_t, int64_t, |, bit_ior) +DEF_BIT_CVT_0(int8_t, int8_t, int16_t, |, bit_ior) +DEF_BIT_CVT_0(int8_t, int8_t, int32_t, |, bit_ior) +DEF_BIT_CVT_0(int8_t, int8_t, int64_t, |, bit_ior) + +DEF_BIT_CVT_0(int16_t, int16_t, uint32_t, |, bit_ior) +DEF_BIT_CVT_0(int16_t, int16_t, uint64_t, |, bit_ior) +DEF_BIT_CVT_0(int16_t, int16_t, int32_t, |, bit_ior) +DEF_BIT_CVT_0(int16_t, int16_t, int64_t, |, bit_ior) +DEF_BIT_CVT_0(int16_t, uint16_t, uint32_t, |, bit_ior) +DEF_BIT_CVT_0(int16_t, uint16_t, uint64_t, |, bit_ior) +DEF_BIT_CVT_0(int16_t, uint16_t, int32_t, |, bit_ior) +DEF_BIT_CVT_0(int16_t, uint16_t, int64_t, |, bit_ior) + +DEF_BIT_CVT_0(int32_t, int32_t, uint64_t, |, bit_ior) +DEF_BIT_CVT_0(int32_t, int32_t, int64_t, |, bit_ior) +DEF_BIT_CVT_0(int32_t, uint32_t, uint64_t, |, bit_ior) +DEF_BIT_CVT_0(int32_t, uint32_t, int64_t, |, bit_ior) + +/* { dg-final { scan-tree-dump-not "_\[0-9]\+ = \\(u?int\[0-9]\+_t\\) _\[0-9]\+;\\s+return _\[0-9]\+;" "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/bit_op_cvt.3.c b/gcc/testsuite/gcc.dg/tree-ssa/bit_op_cvt.3.c new file mode 100644 index 0000000..8439345 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/bit_op_cvt.3.c @@ -0,0 +1,33 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ + +#include "bit_op_cvt.h" + +DEF_BIT_CVT_0(uint8_t, int8_t, uint16_t, &, bit_and) +DEF_BIT_CVT_0(uint8_t, int8_t, uint32_t, &, bit_and) +DEF_BIT_CVT_0(uint8_t, int8_t, uint64_t, &, bit_and) +DEF_BIT_CVT_0(uint8_t, uint8_t, uint16_t, &, bit_and) +DEF_BIT_CVT_0(uint8_t, uint8_t, uint32_t, &, bit_and) +DEF_BIT_CVT_0(uint8_t, uint8_t, uint64_t, &, bit_and) +DEF_BIT_CVT_0(uint8_t, uint8_t, int16_t, &, bit_and) +DEF_BIT_CVT_0(uint8_t, uint8_t, int32_t, &, bit_and) +DEF_BIT_CVT_0(uint8_t, uint8_t, int64_t, &, bit_and) +DEF_BIT_CVT_0(uint8_t, int8_t, int16_t, &, bit_and) +DEF_BIT_CVT_0(uint8_t, int8_t, int32_t, &, bit_and) +DEF_BIT_CVT_0(uint8_t, int8_t, int64_t, &, bit_and) + +DEF_BIT_CVT_0(uint16_t, int16_t, uint32_t, &, bit_and) +DEF_BIT_CVT_0(uint16_t, int16_t, uint64_t, &, bit_and) +DEF_BIT_CVT_0(uint16_t, int16_t, int32_t, &, bit_and) +DEF_BIT_CVT_0(uint16_t, int16_t, int64_t, &, bit_and) +DEF_BIT_CVT_0(uint16_t, uint16_t, uint32_t, &, bit_and) +DEF_BIT_CVT_0(uint16_t, uint16_t, uint64_t, &, bit_and) +DEF_BIT_CVT_0(uint16_t, uint16_t, int32_t, &, bit_and) +DEF_BIT_CVT_0(uint16_t, uint16_t, int64_t, &, bit_and) + +DEF_BIT_CVT_0(uint32_t, int32_t, uint64_t, &, bit_and) +DEF_BIT_CVT_0(uint32_t, int32_t, int64_t, &, bit_and) +DEF_BIT_CVT_0(uint32_t, uint32_t, uint64_t, &, bit_and) +DEF_BIT_CVT_0(uint32_t, uint32_t, int64_t, &, bit_and) + +/* { dg-final { scan-tree-dump-not "_\[0-9]\+ = \\(u?int\[0-9]\+_t\\) _\[0-9]\+;\\s+return _\[0-9]\+;" "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/bit_op_cvt.4.c b/gcc/testsuite/gcc.dg/tree-ssa/bit_op_cvt.4.c new file mode 100644 index 0000000..3f3356b --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/bit_op_cvt.4.c @@ -0,0 +1,33 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ + +#include "bit_op_cvt.h" + +DEF_BIT_CVT_0(int8_t, int8_t, uint16_t, &, bit_and) +DEF_BIT_CVT_0(int8_t, int8_t, uint32_t, &, bit_and) +DEF_BIT_CVT_0(int8_t, int8_t, uint64_t, &, bit_and) +DEF_BIT_CVT_0(int8_t, uint8_t, uint16_t, &, bit_and) +DEF_BIT_CVT_0(int8_t, uint8_t, uint32_t, &, bit_and) +DEF_BIT_CVT_0(int8_t, uint8_t, uint64_t, &, bit_and) +DEF_BIT_CVT_0(int8_t, uint8_t, int16_t, &, bit_and) +DEF_BIT_CVT_0(int8_t, uint8_t, int32_t, &, bit_and) +DEF_BIT_CVT_0(int8_t, uint8_t, int64_t, &, bit_and) +DEF_BIT_CVT_0(int8_t, int8_t, int16_t, &, bit_and) +DEF_BIT_CVT_0(int8_t, int8_t, int32_t, &, bit_and) +DEF_BIT_CVT_0(int8_t, int8_t, int64_t, &, bit_and) + +DEF_BIT_CVT_0(int16_t, int16_t, uint32_t, &, bit_and) +DEF_BIT_CVT_0(int16_t, int16_t, uint64_t, &, bit_and) +DEF_BIT_CVT_0(int16_t, int16_t, int32_t, &, bit_and) +DEF_BIT_CVT_0(int16_t, int16_t, int64_t, &, bit_and) +DEF_BIT_CVT_0(int16_t, uint16_t, uint32_t, &, bit_and) +DEF_BIT_CVT_0(int16_t, uint16_t, uint64_t, &, bit_and) +DEF_BIT_CVT_0(int16_t, uint16_t, int32_t, &, bit_and) +DEF_BIT_CVT_0(int16_t, uint16_t, int64_t, &, bit_and) + +DEF_BIT_CVT_0(int32_t, int32_t, uint64_t, &, bit_and) +DEF_BIT_CVT_0(int32_t, int32_t, int64_t, &, bit_and) +DEF_BIT_CVT_0(int32_t, uint32_t, uint64_t, &, bit_and) +DEF_BIT_CVT_0(int32_t, uint32_t, int64_t, &, bit_and) + +/* { dg-final { scan-tree-dump-not "_\[0-9]\+ = \\(u?int\[0-9]\+_t\\) _\[0-9]\+;\\s+return _\[0-9]\+;" "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/bit_op_cvt.5.c b/gcc/testsuite/gcc.dg/tree-ssa/bit_op_cvt.5.c new file mode 100644 index 0000000..e746d6e --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/bit_op_cvt.5.c @@ -0,0 +1,33 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ + +#include "bit_op_cvt.h" + +DEF_BIT_CVT_0(uint8_t, int8_t, uint16_t, ^, bit_xor) +DEF_BIT_CVT_0(uint8_t, int8_t, uint32_t, ^, bit_xor) +DEF_BIT_CVT_0(uint8_t, int8_t, uint64_t, ^, bit_xor) +DEF_BIT_CVT_0(uint8_t, uint8_t, uint16_t, ^, bit_xor) +DEF_BIT_CVT_0(uint8_t, uint8_t, uint32_t, ^, bit_xor) +DEF_BIT_CVT_0(uint8_t, uint8_t, uint64_t, ^, bit_xor) +DEF_BIT_CVT_0(uint8_t, uint8_t, int16_t, ^, bit_xor) +DEF_BIT_CVT_0(uint8_t, uint8_t, int32_t, ^, bit_xor) +DEF_BIT_CVT_0(uint8_t, uint8_t, int64_t, ^, bit_xor) +DEF_BIT_CVT_0(uint8_t, int8_t, int16_t, ^, bit_xor) +DEF_BIT_CVT_0(uint8_t, int8_t, int32_t, ^, bit_xor) +DEF_BIT_CVT_0(uint8_t, int8_t, int64_t, ^, bit_xor) + +DEF_BIT_CVT_0(uint16_t, int16_t, uint32_t, ^, bit_xor) +DEF_BIT_CVT_0(uint16_t, int16_t, uint64_t, ^, bit_xor) +DEF_BIT_CVT_0(uint16_t, int16_t, int32_t, ^, bit_xor) +DEF_BIT_CVT_0(uint16_t, int16_t, int64_t, ^, bit_xor) +DEF_BIT_CVT_0(uint16_t, uint16_t, uint32_t, ^, bit_xor) +DEF_BIT_CVT_0(uint16_t, uint16_t, uint64_t, ^, bit_xor) +DEF_BIT_CVT_0(uint16_t, uint16_t, int32_t, ^, bit_xor) +DEF_BIT_CVT_0(uint16_t, uint16_t, int64_t, ^, bit_xor) + +DEF_BIT_CVT_0(uint32_t, int32_t, uint64_t, ^, bit_xor) +DEF_BIT_CVT_0(uint32_t, int32_t, int64_t, ^, bit_xor) +DEF_BIT_CVT_0(uint32_t, uint32_t, uint64_t, ^, bit_xor) +DEF_BIT_CVT_0(uint32_t, uint32_t, int64_t, ^, bit_xor) + +/* { dg-final { scan-tree-dump-not "_\[0-9]\+ = \\(u?int\[0-9]\+_t\\) _\[0-9]\+;\\s+return _\[0-9]\+;" "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/bit_op_cvt.6.c b/gcc/testsuite/gcc.dg/tree-ssa/bit_op_cvt.6.c new file mode 100644 index 0000000..a12dc88 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/bit_op_cvt.6.c @@ -0,0 +1,33 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ + +#include "bit_op_cvt.h" + +DEF_BIT_CVT_0(int8_t, int8_t, uint16_t, ^, bit_xor) +DEF_BIT_CVT_0(int8_t, int8_t, uint32_t, ^, bit_xor) +DEF_BIT_CVT_0(int8_t, int8_t, uint64_t, ^, bit_xor) +DEF_BIT_CVT_0(int8_t, uint8_t, uint16_t, ^, bit_xor) +DEF_BIT_CVT_0(int8_t, uint8_t, uint32_t, ^, bit_xor) +DEF_BIT_CVT_0(int8_t, uint8_t, uint64_t, ^, bit_xor) +DEF_BIT_CVT_0(int8_t, uint8_t, int16_t, ^, bit_xor) +DEF_BIT_CVT_0(int8_t, uint8_t, int32_t, ^, bit_xor) +DEF_BIT_CVT_0(int8_t, uint8_t, int64_t, ^, bit_xor) +DEF_BIT_CVT_0(int8_t, int8_t, int16_t, ^, bit_xor) +DEF_BIT_CVT_0(int8_t, int8_t, int32_t, ^, bit_xor) +DEF_BIT_CVT_0(int8_t, int8_t, int64_t, ^, bit_xor) + +DEF_BIT_CVT_0(int16_t, int16_t, uint32_t, ^, bit_xor) +DEF_BIT_CVT_0(int16_t, int16_t, uint64_t, ^, bit_xor) +DEF_BIT_CVT_0(int16_t, int16_t, int32_t, ^, bit_xor) +DEF_BIT_CVT_0(int16_t, int16_t, int64_t, ^, bit_xor) +DEF_BIT_CVT_0(int16_t, uint16_t, uint32_t, ^, bit_xor) +DEF_BIT_CVT_0(int16_t, uint16_t, uint64_t, ^, bit_xor) +DEF_BIT_CVT_0(int16_t, uint16_t, int32_t, ^, bit_xor) +DEF_BIT_CVT_0(int16_t, uint16_t, int64_t, ^, bit_xor) + +DEF_BIT_CVT_0(int32_t, int32_t, uint64_t, ^, bit_xor) +DEF_BIT_CVT_0(int32_t, int32_t, int64_t, ^, bit_xor) +DEF_BIT_CVT_0(int32_t, uint32_t, uint64_t, ^, bit_xor) +DEF_BIT_CVT_0(int32_t, uint32_t, int64_t, ^, bit_xor) + +/* { dg-final { scan-tree-dump-not "_\[0-9]\+ = \\(u?int\[0-9]\+_t\\) _\[0-9]\+;\\s+return _\[0-9]\+;" "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/bit_op_cvt.h b/gcc/testsuite/gcc.dg/tree-ssa/bit_op_cvt.h new file mode 100644 index 0000000..87d67e6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/bit_op_cvt.h @@ -0,0 +1,13 @@ +#ifndef HAVE_DEFINED_BIT_OP_CVT +#define HAVE_DEFINED_BIT_OP_CVT + +#include <stdint.h> + +#define DEF_BIT_CVT_0(T1, T2, T3, OP, NAME) \ +T1 test_bit_##NAME##_##T1##_##T2##_##T3##_0(T2 a, \ + T3 b) \ +{ \ + return (T1)(a OP (T3)b); \ +} + +#endif diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-43.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-43.c new file mode 100644 index 0000000..bfda376 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-43.c @@ -0,0 +1,171 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-forwprop1" } */ +/* { dg-require-effective-target stdint_types } */ +/* { dg-require-effective-target vect_int } */ +/* { dg-additional-options "-fgimple" } */ + +#include <stdint.h> + +typedef int32_t int32x4_t __attribute__((vector_size(16))); +typedef int32_t int32x2_t __attribute__((vector_size(8))); +typedef int32_t int32x1_t __attribute__((vector_size(4))); + +int32x4_t __GIMPLE (ssa) +foo (int32x4_t x) +{ + int32x2_t _1; + int32x2_t _2; + int32x4_t _6; + +__BB(2): + _1 = __BIT_FIELD_REF <int32x2_t> (x, 64, 64); + _2 = __BIT_FIELD_REF <int32x2_t> (x, 64, 0); + _6 = _Literal (int32x4_t) { _1, _2 }; + return _6; +} + +int32x4_t __GIMPLE (ssa) +foo2 (int32x4_t x) +{ + int32x1_t _1; + int32x1_t _2; + int32x1_t _3; + int32x1_t _4; + int32x4_t _6; + +__BB(2): + _1 = __BIT_FIELD_REF <int32x1_t> (x, 32, 64); + _2 = __BIT_FIELD_REF <int32x1_t> (x, 32, 96); + _3 = __BIT_FIELD_REF <int32x1_t> (x, 32, 0); + _4 = __BIT_FIELD_REF <int32x1_t> (x, 32, 32); + _6 = _Literal (int32x4_t) { _1, _2, _3, _4 }; + return _6; +} + +int32x4_t __GIMPLE (ssa) +foo3 (int32x4_t x, int32x4_t y) +{ + int32x2_t _1; + int32x2_t _2; + int32x4_t _6; + +__BB(2): + _1 = __BIT_FIELD_REF <int32x2_t> (x, 64, 64); + _2 = __BIT_FIELD_REF <int32x2_t> (y, 64, 0); + _6 = _Literal (int32x4_t) { _1, _2 }; + return _6; +} + +int32x4_t __GIMPLE (ssa) +foo4 (int32x4_t x, int32x4_t y) +{ + int32x1_t _1; + int32x1_t _2; + int32x1_t _3; + int32x1_t _4; + int32x4_t _6; + +__BB(2): + _1 = __BIT_FIELD_REF <int32x1_t> (x, 32, 64); + _2 = __BIT_FIELD_REF <int32x1_t> (y, 32, 96); + _3 = __BIT_FIELD_REF <int32x1_t> (x, 32, 0); + _4 = __BIT_FIELD_REF <int32x1_t> (y, 32, 32); + _6 = _Literal (int32x4_t) { _1, _2, _3, _4 }; + return _6; +} + +int32x4_t __GIMPLE (ssa) +foo5 (int32x4_t x) +{ + int32x2_t _1; + int32x2_t _2; + int32x4_t _6; + +__BB(2): + _1 = __BIT_FIELD_REF <int32x2_t> (x, 64, 64); + _2 = _Literal (int32x2_t) { 1, 2 }; + _6 = _Literal (int32x4_t) { _1, _2 }; + return _6; +} + +int32x4_t __GIMPLE (ssa) +foo6 (int32x4_t x, int32_t y) +{ + int32x2_t _1; + int32x2_t _2; + int32x4_t _6; + +__BB(2): + _1 = __BIT_FIELD_REF <int32x2_t> (x, 64, 64); + _2 = _Literal (int32x2_t) { y, y }; + _6 = _Literal (int32x4_t) { _1, _2 }; + return _6; +} + +int32x4_t __GIMPLE (ssa) +foo7 (int32x4_t x) +{ + int32x2_t _1; + int32x2_t _2; + int32x4_t _6; + +__BB(2): + _1 = __BIT_FIELD_REF <int32x2_t> (x, 64, 64); + _2 = _Literal (int32x2_t) { 1, 2 }; + _6 = _Literal (int32x4_t) { _2, _1 }; + return _6; +} + +int32x4_t __GIMPLE (ssa) +foo8 (int32x4_t x, int32_t y) +{ + int32x2_t _1; + int32x2_t _2; + int32x4_t _6; + +__BB(2): + _1 = __BIT_FIELD_REF <int32x2_t> (x, 64, 64); + _2 = _Literal (int32x2_t) { y, y }; + _6 = _Literal (int32x4_t) { _2, _1 }; + return _6; +} + +int32x4_t __GIMPLE (ssa) +foo9 (int32x4_t x) +{ + int32x1_t _1; + int32x1_t _2; + int32x1_t _3; + int32x1_t _4; + int32x4_t _6; + +__BB(2): + _1 = __BIT_FIELD_REF <int32x1_t> (x, 32, 96); + _2 = __BIT_FIELD_REF <int32x1_t> (x, 32, 64); + _3 = _Literal (int32x1_t) { 1 }; + _4 = _Literal (int32x1_t) { 1 }; + _6 = _Literal (int32x4_t) { _3, _4, _1, _2 }; + return _6; +} + +int32x4_t __GIMPLE (ssa) +foo10 (int32x4_t x, int32_t y) +{ + int32x1_t _1; + int32x1_t _2; + int32x1_t _3; + int32x1_t _4; + int32x4_t _6; + +__BB(2): + _1 = __BIT_FIELD_REF <int32x1_t> (x, 32, 96); + _2 = __BIT_FIELD_REF <int32x1_t> (x, 32, 64); + _3 = _Literal (int32x1_t) { y }; + _4 = _Literal (int32x1_t) { y }; + _6 = _Literal (int32x4_t) { _3, _4, _1, _2 }; + + return _6; +} + + +/* { dg-final { scan-tree-dump-times "VEC_PERM_EXPR" 10 "forwprop1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/phiprop-3.c b/gcc/testsuite/gcc.dg/tree-ssa/phiprop-3.c new file mode 100644 index 0000000..59e9561 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/phiprop-3.c @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* { dg-options "-O1 -fdump-tree-phiprop1-details" } */ + +/* PR tree-optimization/60183 */ + +unsigned char c; +extern unsigned char d; +int j = 2; + +unsigned long +foo (void) +{ + unsigned char *y = &c; + int i; + unsigned w = 0; + for (i = 0; i < j; i++) + { + w = *y; + y = &d; + } + return w; +} +/* the load from c/d does not trap so we should able to remove the phi. */ +/* { dg-final { scan-tree-dump "Removing dead stmt:" "phiprop1"} } */ +/* { dg-final { scan-tree-dump "Inserting PHI for result of load" "phiprop1"} } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/phiprop-4.c b/gcc/testsuite/gcc.dg/tree-ssa/phiprop-4.c new file mode 100644 index 0000000..ceb03ed --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/phiprop-4.c @@ -0,0 +1,26 @@ +/* { dg-do compile { target { weak_undefined } } } */ +/* { dg-options "-O1 -fdump-tree-phiprop1-details" } */ +/* { dg-add-options weak_undefined } */ + +/* PR tree-optimization/60183 */ + +unsigned char c; +extern unsigned char d __attribute__((weak)); +int j = 2; + +unsigned long +foo (void) +{ + unsigned char *y = &c; + int i; + unsigned w = 0; + for (i = 0; i < j; i++) + { + w = *y; + y = &d; + } + return w; +} +/* the load from d can trap so this should not cause a phiprop. */ +/* { dg-final { scan-tree-dump-not "Removing dead stmt:" "phiprop1"} } */ +/* { dg-final { scan-tree-dump-not "Inserting PHI for result of load" "phiprop1"} } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/phiprop-5.c b/gcc/testsuite/gcc.dg/tree-ssa/phiprop-5.c new file mode 100644 index 0000000..b76b17c --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/phiprop-5.c @@ -0,0 +1,26 @@ +/* { dg-do compile { target { weak_undefined } } } */ +/* { dg-options "-O1 -fdump-tree-phiprop1-details" } */ +/* { dg-add-options weak_undefined } */ + +/* PR tree-optimization/60183 */ + +unsigned char c; +extern unsigned char d __attribute__((weak)); +int j = 2; + +unsigned long +foo (void) +{ + unsigned char *y = &c; + int i; + unsigned w = 0; + for (i = 0; i < *y; i++) + { + w = *y; + y = &d; + } + return w; +} +/* the load from d can trap but the load always happen so this should be done. */ +/* { dg-final { scan-tree-dump "Removing dead stmt:" "phiprop1"} } */ +/* { dg-final { scan-tree-dump "Inserting PHI for result of load" "phiprop1"} } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/phiprop-6.c b/gcc/testsuite/gcc.dg/tree-ssa/phiprop-6.c new file mode 100644 index 0000000..8561cd1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/phiprop-6.c @@ -0,0 +1,21 @@ +/* { dg-do compile { target { weak_undefined } } } */ +/* { dg-options "-O2 -fdump-tree-phiprop-details" } */ +/* { dg-add-options weak_undefined } */ + +/* PR tree-optimization/116835 */ + +extern int a __attribute__((weak)); +int b; + +int +bar (int c) +{ + int *p = &a; + for (int j = 0; j < c; ++j) + p = &b; + return *p; +} +/* The weak load is conditional with the loop so we cannot make it unconditional. */ +/* { dg-final { scan-tree-dump-not "Removing dead stmt:" "phiprop1"} } */ +/* { dg-final { scan-tree-dump-not "Inserting PHI for result of load" "phiprop1"} } */ + diff --git a/gcc/testsuite/gcc.dg/tree-ssa/phiprop-7.c b/gcc/testsuite/gcc.dg/tree-ssa/phiprop-7.c new file mode 100644 index 0000000..ebce03e --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/phiprop-7.c @@ -0,0 +1,21 @@ +/* { dg-do compile { target { weak_undefined } } } */ +/* { dg-options "-O2 -fdump-tree-phiprop-details" } */ +/* { dg-add-options weak_undefined } */ + +/* PR tree-optimization/116835 */ + +extern int a __attribute__((weak)); +int b; + +int +bar (int c) +{ + int *p = &a; + for (int j = 0; j < *p; ++j) + p = &b; + return *p; +} +/* The weak load is unconditional due to the conditional so we can remove it unconditionally. */ +/* { dg-final { scan-tree-dump "Removing dead stmt:" "phiprop1"} } */ +/* { dg-final { scan-tree-dump "Inserting PHI for result of load" "phiprop1"} } */ + diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr119683.c b/gcc/testsuite/gcc.dg/tree-ssa/pr119683.c new file mode 100644 index 0000000..631ab43 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr119683.c @@ -0,0 +1,19 @@ +/* PR tree-optimization/119683 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ +/* { dg-final { scan-tree-dump-times " = c_\[0-9]*\\\(D\\\) \\\+ \(?:\[0-9-]\)+;" 3 "optimized" } } */ + +unsigned +foo (signed char c) +{ + if (c >= '0' && c <= '9') + return c - '0'; + + if (c >= 'a' && c <= 'z') + return c - 'a' + 10; + + if (c >= 'A' && c <= 'Z') + return c - 'A' + 10; + + return -1; +} diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr122588-1.c b/gcc/testsuite/gcc.dg/tree-ssa/pr122588-1.c new file mode 100644 index 0000000..2c214c9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr122588-1.c @@ -0,0 +1,30 @@ +/* { dg-do compile } */ +/* { dg-options "-O1 -fgimple" } */ +/* PR tree-optimization/122588 */ + +/* The removal of unreachable blocks should not + change blocks which have already become true/false. + The function below was is an example of that. And + forwprop does not go into non-executable blocks + so the statement `t = _1;` was still holding the + old reference. */ + +int t; + +__GIMPLE(ssa,startwith("forwprop4")) void g(void) +{ + int _1; + __BB(2): + _1 = 1; + if (_1 != 0) + goto __BB3; + else + goto __BB4; + + __BB(3): + __builtin_unreachable (); + + __BB(4): + t = _1; + return; +} diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr122629-1.c b/gcc/testsuite/gcc.dg/tree-ssa/pr122629-1.c new file mode 100644 index 0000000..a80d4a1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr122629-1.c @@ -0,0 +1,36 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-ifcvt-details" } */ +/* PR tree-optimization/122629 */ + +typedef int ix4 __attribute__((vector_size(4*sizeof(int)))); + +int f(ix4 *a, int l, int *b, ix4 *c) +{ + for (int i =0 ;i < l; i++) + { + int t; + ix4 tt = a[i]; + ix4 tt1 = c[i]; + if(*b) t = tt1[0]; else t = tt[0]; + *b = t; + } +} + +int g(ix4 *a, int l, int *b, ix4 *c) +{ + for (int i =0 ;i < l; i++) + { + ix4 tt = a[i]; + ix4 tt1 = c[i]; + if(*b) { + tt = tt1; + tt[0] = 1; + } else { + tt[0] = 1; + } + a[i] = tt; + } +} + +/* Make sure BIT_INSERT_EXPR/BIT_FIELD_REF is still factored out for the case if operand 0 is different. */ +/* { dg-final { scan-tree-dump-times "changed to factor operation out from" 2 "ifcvt" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr46555.c b/gcc/testsuite/gcc.dg/tree-ssa/pr46555.c new file mode 100644 index 0000000..d4de7c2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr46555.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-optimized-details -fdump-rtl-pro_and_epilogue" } */ +/* PR tree-optimization/46555 */ +/* Here should not remove the forwarder block (or rather recreate it and not + remove it again). This improves expansion to RTL as there is one less copy + (or constant formation) in some cases. In this case we also get the ability + to shrink wrap the function. */ + +int h(void); +int f(int a, int b, int c) +{ + if (a) + return 2; + h(); + if (b) + return 2; + h(); + if (c) + return 2; + h(); + return 4; +} + +/* { dg-final { scan-tree-dump-times "New forwarder block for edge" 1 "optimized" } } */ +/* Make sure we only have a PHI with 2 arguments here, 2 and 4. */ +/* { dg-final { scan-tree-dump "PHI <2..., 4...>|PHI <4..., 2...>" "optimized" } } */ +/* Make sure we can shrink wrap the function now too. */ +/* { dg-final { scan-rtl-dump "Performing shrink-wrapping" "pro_and_epilogue" { target { { { i?86-*-* x86_64-*-* } && { ! ia32 } } || { powerpc*-*-* aarch64*-*-* riscv*-*-* arm*-*-* } } } } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/scev-16.c b/gcc/testsuite/gcc.dg/tree-ssa/scev-16.c new file mode 100644 index 0000000..0cc7f70 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/scev-16.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-O -fdump-tree-sccp" } */ + +extern char a[]; +int foo () +{ + int cnt = 0; + char *aend = a + 32; + char *a0 = a; + do + { + a0 = a0 + 16; + cnt++; + } + while (aend - a0 > 12); + return cnt; +} + +/* { dg-final { scan-tree-dump "return 2" "sccp" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-7.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-7.c index 1c2cfa4..81bb7fc 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-7.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-7.c @@ -11,8 +11,8 @@ to change decisions in switch expansion which in turn can expose new jump threading opportunities. Skip the later tests on aarch64. */ /* { dg-final { scan-tree-dump-not "Jumps threaded" "dom3" { target { ! aarch64*-*-* } } } } */ -/* { dg-final { scan-tree-dump "Jumps threaded: 8" "thread2" { target { ! aarch64*-*-* } } } } */ -/* { dg-final { scan-tree-dump "Jumps threaded: 8" "thread2" { target { aarch64*-*-* } } } } */ +/* { dg-final { scan-tree-dump "Jumps threaded: 12" "thread2" { target { ! aarch64*-*-* } } } } */ +/* { dg-final { scan-tree-dump "Jumps threaded: 12" "thread2" { target { aarch64*-*-* } } } } */ enum STATE { S0=0, diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp-from-cst-agg-1.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp-from-cst-agg-1.c new file mode 100644 index 0000000..6612a88 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp-from-cst-agg-1.c @@ -0,0 +1,32 @@ +/* { dg-do link } */ +/* { dg-options "-O2" } */ + +int ga = 1; +int gb = 2; +int gc = 3; +volatile int gi; + +static const int *vars[3] = {&ga, &gb, &gc}; + +void link_error (void); + +[[gnu::noinline]] void foo (int index) +{ + const int *p = vars[index]; + if (!p) + link_error (); + else + gi = *p; +} + +[[gnu::noipa]] int +get_index (void) +{ + return 1; +} + +int main (int argc, char **argv) +{ + foo (get_index ()); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp-from-cst-agg-2.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp-from-cst-agg-2.c new file mode 100644 index 0000000..0f7677d --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp-from-cst-agg-2.c @@ -0,0 +1,57 @@ +/* { dg-do run } */ +/* { dg-options "-O2" } */ + +enum comp_cat_tag +{ + cc_partial_ordering, + cc_weak_ordering, + cc_strong_ordering, + cc_last +}; + +struct comp_cat_info_t +{ + const char *name; + const char *members[4]; +}; + +static const struct comp_cat_info_t comp_cat_info[cc_last] += { + { "partial_ordering", { "equivalent", "greater", "less", "unordered" } }, + { "weak_ordering", { "equivalent", "greater", "less" } }, + { "strong_ordering", { "equal", "greater", "less" } } +}; + +volatile const char *gp; + +[[gnu::noipa]] static void +check (const char *p) +{ + if (!p) + __builtin_abort (); + gp = p; +} + +[[gnu::noinline]] int foo (enum comp_cat_tag tag) +{ + for (int i = 0; i < 4; ++i) + { + const char *p = comp_cat_info[tag].members[i]; + if (!p) + continue;; + check (p); + } + return 0; +} + +[[gnu::noipa]] enum comp_cat_tag +get_index (void) +{ + return cc_strong_ordering; +} + +int main (int argc, char **argv) +{ + foo (get_index ()); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp-from-cst-agg-3.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp-from-cst-agg-3.c new file mode 100644 index 0000000..d7a5e61 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp-from-cst-agg-3.c @@ -0,0 +1,30 @@ +/* { dg-do link } */ +/* { dg-options "-O2" } */ + +volatile int gi; + +static const int values[3] = {5, 7, 11}; + +void link_error (void); + +[[gnu::noinline]] void foo (int index) +{ + const int v = values[index]; + if (v <= 2 + || v > 11) + link_error (); + else + gi = v; +} + +[[gnu::noipa]] int +get_index (void) +{ + return 1; +} + +int main (int argc, char **argv) +{ + foo (get_index ()); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp-from-cst-agg-4.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp-from-cst-agg-4.c new file mode 100644 index 0000000..333a24b --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp-from-cst-agg-4.c @@ -0,0 +1,30 @@ +/* { dg-do link } */ +/* { dg-options "-O2" } */ + +volatile int gi; + +static const int values[25] = {5, 7, 11}; + +void link_error (void); + +[[gnu::noinline]] void foo (int index) +{ + const int v = values[index]; + if (v <= -2 + || v > 11) + link_error (); + else + gi = v; +} + +[[gnu::noipa]] int +get_index (void) +{ + return 1; +} + +int main (int argc, char **argv) +{ + foo (get_index ()); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp-from-cst-agg-5.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp-from-cst-agg-5.c new file mode 100644 index 0000000..08e2117 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp-from-cst-agg-5.c @@ -0,0 +1,36 @@ +/* { dg-do link } */ +/* { dg-options "-O2" } */ + +volatile int gi; + +static const struct { + int a; + int b; +} values[2][2] = { + { {1000, 1 }, {1001, 2} }, + { {1003, 1 }, {1004, 2} } +}; + +void link_error (void); + +[[gnu::noinline]] void foo (int i, int j) +{ + const int v = values[i][j].b; + if (v <= 0 + || v > 2) + link_error (); + else + gi = v; +} + +[[gnu::noipa]] int +get_index (void) +{ + return 1; +} + +int main (int argc, char **argv) +{ + foo (get_index (), get_index ()); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp-from-cst-agg-6.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp-from-cst-agg-6.c new file mode 100644 index 0000000..6f93f09 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp-from-cst-agg-6.c @@ -0,0 +1,42 @@ +/* { dg-do run } */ +/* { dg-options "-O2" } */ + +volatile int gi; + +static const struct { + int a; + int b; +} values[2][2] = { + { {0, 1 }, {0, 2} }, + { {0, 1 }, {0, 2} } +}; + +[[gnu::noipa]] static void +check (int v) +{ + if (!v) + __builtin_abort (); + gi = v; +} + + +[[gnu::noinline]] void foo (int i, int j) +{ + const int v = values[i][j].a; + if (v <= 0 + || v > 2) + return; + check (v); +} + +[[gnu::noipa]] int +get_index (void) +{ + return 1; +} + +int main (int argc, char **argv) +{ + foo (get_index (), get_index ()); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp-from-cst-agg-7.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp-from-cst-agg-7.c new file mode 100644 index 0000000..da01abb --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp-from-cst-agg-7.c @@ -0,0 +1,36 @@ +/* { dg-do link } */ +/* { dg-options "-O2" } */ + +volatile int gi; + +static const struct { + int a; + int b; +} values[2][2] = { + { {1000, 1 }, {1001, 2} }, + { {1003, 1 }, {1004, 2} } +}; + +void link_error (void); + +[[gnu::noinline]] void foo (int i) +{ + const int v = values[0][i].b; + if (v <= 0 + || v > 2) + link_error (); + else + gi = v; +} + +[[gnu::noipa]] int +get_index (void) +{ + return 1; +} + +int main (int argc, char **argv) +{ + foo (get_index ()); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/uninit-pred-7_a.c b/gcc/testsuite/gcc.dg/uninit-pred-7_a.c index c2ba2a4..7aaadf7 100644 --- a/gcc/testsuite/gcc.dg/uninit-pred-7_a.c +++ b/gcc/testsuite/gcc.dg/uninit-pred-7_a.c @@ -20,7 +20,7 @@ int foo (int n, int l, int m, int r) blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */ if ( n ) - blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */ + blah(v); /* { dg-bogus "uninitialized" "bogus warning" { xfail *-*-* } } */ if ( l ) blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */ diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-41.c b/gcc/testsuite/gcc.dg/vect/bb-slp-41.c index 5a2bd4d..89e0bcd 100644 --- a/gcc/testsuite/gcc.dg/vect/bb-slp-41.c +++ b/gcc/testsuite/gcc.dg/vect/bb-slp-41.c @@ -59,4 +59,4 @@ int main () return 0; } -/* { dg-final { scan-tree-dump-not "vectorizing stmts using SLP" "slp1" } } */ +/* { dg-final { scan-tree-dump-not "vectorizable constructor" "slp1" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/complex/complex-operations-run.c b/gcc/testsuite/gcc.dg/vect/complex/vect-complex-operations-run.c index 2f916ab..2f916ab 100644 --- a/gcc/testsuite/gcc.dg/vect/complex/complex-operations-run.c +++ b/gcc/testsuite/gcc.dg/vect/complex/vect-complex-operations-run.c diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-pr122573.c b/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-pr122573.c new file mode 100644 index 0000000..ca3294d --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-pr122573.c @@ -0,0 +1,30 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-march=znver5" } */ + +struct S { + float m_col1[4]; + float m_col2[4]; + float m_col3[4]; + float m_col4[4]; +}; + +void apply(struct S *s, const float *in, float *out, long numPixels) +{ + for (long idx = 0; idx < numPixels; ++idx) + { + const float r = in[0]; + const float g = in[1]; + const float b = in[2]; + const float a = in[3]; + out[0] = r*s->m_col1[0] + g*s->m_col2[0] + b*s->m_col3[0] + a*s->m_col4[0]; + out[1] = r*s->m_col1[1] + g*s->m_col2[1] + b*s->m_col3[1] + a*s->m_col4[1]; + out[2] = r*s->m_col1[2] + g*s->m_col2[2] + b*s->m_col3[2] + a*s->m_col4[2]; + out[3] = r*s->m_col1[3] + g*s->m_col2[3] + b*s->m_col3[3] + a*s->m_col4[3]; + in += 4; + out += 4; + } +} + +/* Check that we do not use a masked epilog but a SSE one with VF 1 + (and possibly a AVX2 one as well). */ +/* { dg-final { scan-tree-dump "optimized: epilogue loop vectorized using 16 byte vectors and unroll factor 1" "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/pr122475.c b/gcc/testsuite/gcc.dg/vect/pr122475.c new file mode 100644 index 0000000..ed229c5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr122475.c @@ -0,0 +1,13 @@ +/* { dg-additional-options "-march=armv8-a+sve" { target aarch64*-*-* } } */ +/* Check that we don't ICE. */ +int a; +int b; +int main() { + for (char t = 0; t < 14; t += 2) + for (int u = 0; u < 242; u += 4) { + a = a < 0 ? a : 0; + b = b < 0 ? b : 0; + } +} + +/* { dg-final { scan-tree-dump-times "optimized: loop vectorized" 1 "vect" { target aarch64*-*-* } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/pr122680.c b/gcc/testsuite/gcc.dg/vect/pr122680.c new file mode 100644 index 0000000..3e25a3f --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr122680.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-O3" } */ +/* { dg-additional-options "-mavx2" { target avx2 } } */ + +void +foo (float *buf) +{ + for (unsigned long i = 0, j = 100; i < 100; i++, j--) + buf[i] = j; +} diff --git a/gcc/testsuite/gcc.dg/vect/pr122797.c b/gcc/testsuite/gcc.dg/vect/pr122797.c new file mode 100644 index 0000000..11819ef --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr122797.c @@ -0,0 +1,27 @@ +/* { dg-do run } */ +/* { dg-additional-options "-O3" } */ + +int src_stride = 0; +int dst_stride = 0; + +int main() { + char src[12] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}; + char dst[16]; + char *s = src; + char *d = dst; + for (int i = 0; i < 2; i++) { + d[0] = s[0] + s[1] + s[2] + s[3] + s[4]; + d[1] = s[1] + s[2] + s[3] + s[4] + s[5]; + d[2] = s[2] + s[3] + s[4] + s[5] + s[6]; + d[3] = s[3] + s[4] + s[5] + s[6] + s[7]; + d[4] = s[4] + s[5] + s[6] + s[7] + s[8]; + d[5] = s[5] + s[6] + s[7] + s[8] + s[9]; + d[6] = s[6] + s[7] + s[8] + s[9] + s[10]; + d[7] = s[7] + s[8] + s[9] + s[10] + s[11]; + s += src_stride; + d += dst_stride; + } + + if (d[0] != 15) + __builtin_abort (); +} diff --git a/gcc/testsuite/gcc.dg/vect/pr122850.c b/gcc/testsuite/gcc.dg/vect/pr122850.c new file mode 100644 index 0000000..4f50aa9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr122850.c @@ -0,0 +1,13 @@ +/* { dg-do compile { target { x86_64-*-* i?86-*-* } } } */ +/* { dg-additional-options "-O3 -march=haswell -m32" } */ + +typedef int v2ll __attribute__ ((__vector_size__ (2 * sizeof (int)))); +typedef unsigned int v2ull __attribute__ ((__vector_size__ (2 * sizeof (int)))); +typedef __attribute__ ((__vector_size__ (2 * sizeof (short)))) short v2s; + +v2ll +f (v2ull e) +{ + v2s c = (v2s) e[0]; + return (v2ll) {(int) c, 0}; +} diff --git a/gcc/testsuite/gcc.dg/vect/pr122855.c b/gcc/testsuite/gcc.dg/vect/pr122855.c new file mode 100644 index 0000000..3084d20 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr122855.c @@ -0,0 +1,15 @@ +/* { dg-do compile { target { x86_64-*-* i?86-*-* } } } */ +/* { dg-additional-options "-O3 -march=haswell" } */ + +int zoom_x3_weights_0, zoom_x3_j, zoom_x3_pixel2; + +void zoom_x3(char *__restrict s, char *__restrict zoom_x3_tmp) { + int pixel0 = 0, pixel1 = 0; + for (; zoom_x3_j; zoom_x3_j--) { + pixel0 += *s++ * zoom_x3_weights_0; + pixel1 += *s++ * zoom_x3_weights_0; + zoom_x3_pixel2 += *s++ * zoom_x3_weights_0; + } + *zoom_x3_tmp++ = pixel0 < 0 ? 0 : pixel0 > 255 ? 255 : pixel0; + *zoom_x3_tmp = pixel1 < 0 ? 0 : pixel1 > 255 ? 255 : pixel1; +} diff --git a/gcc/testsuite/gcc.dg/vect/pr122969.c b/gcc/testsuite/gcc.dg/vect/pr122969.c new file mode 100644 index 0000000..47699fd --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr122969.c @@ -0,0 +1,16 @@ +/* { dg-add-options vect_early_break } */ +/* { dg-require-effective-target vect_early_break } */ +/* { dg-require-effective-target vect_int } */ +/* { dg-additional-options "-w -O3 -fno-tree-dominator-opts -fno-code-hoisting -fno-tree-pre -fno-tree-dce" } */ + +/* { dg-final { scan-tree-dump "loop vectorized" "vect" } } */ + +int a, b; +int main() { + while (a) + for (a = 0; a != 1; a--) + if (b) + break; + return 0; +} + diff --git a/gcc/testsuite/gcc.dg/vect/pr123038.c b/gcc/testsuite/gcc.dg/vect/pr123038.c new file mode 100644 index 0000000..bca831f --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr123038.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ + +unsigned char f(int b) +{ + for (int a = 0; a < 10; a += 1) + b = __builtin_ffs(b); + return b; +} diff --git a/gcc/testsuite/gcc.dg/vect/slp-58.c b/gcc/testsuite/gcc.dg/vect/slp-58.c new file mode 100644 index 0000000..e03cfa3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/slp-58.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target vect_float } */ + +struct S { + float m_col1[4]; + float m_col2[4]; + float m_col3[4]; + float m_col4[4]; +}; + +void apply(struct S *s, const float *in, float *out, long numPixels) +{ + for (long idx = 0; idx < numPixels; ++idx) + { + const float r = in[0]; + const float g = in[1]; + const float b = in[2]; + const float a = in[3]; + out[0] = r*s->m_col1[0] + g*s->m_col2[0] + b*s->m_col3[0] + a*s->m_col4[0]; + out[1] = r*s->m_col1[1] + g*s->m_col2[1] + b*s->m_col3[1] + a*s->m_col4[1]; + out[2] = r*s->m_col1[2] + g*s->m_col2[2] + b*s->m_col3[2] + a*s->m_col4[2]; + out[3] = r*s->m_col1[3] + g*s->m_col2[3] + b*s->m_col3[3] + a*s->m_col4[3]; + in += 4; + out += 4; + } +} + +/* { dg-final { scan-tree-dump "vectorization factor = 1" "vect" { target { ! vect_load_lanes } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/slp-9.c b/gcc/testsuite/gcc.dg/vect/slp-9.c index 4fb6953..8869764 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-9.c +++ b/gcc/testsuite/gcc.dg/vect/slp-9.c @@ -1,5 +1,4 @@ /* { dg-require-effective-target vect_int } */ -/* { dg-additional-options "-fno-early-inlining" } */ #include <stdarg.h> #include "tree-vect.h" @@ -11,7 +10,7 @@ short Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))); int result[N]; /* short->int widening-mult */ -int +int __attribute__((noipa)) foo1(int len) { int i; diff --git a/gcc/testsuite/gcc.dg/vect/slp-reduc-14.c b/gcc/testsuite/gcc.dg/vect/slp-reduc-14.c new file mode 100644 index 0000000..7966d23 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/slp-reduc-14.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-additional-options "--param vect-epilogues-nomask=0" } */ + +void foo (int * __restrict sums, int *a, int *b, int n) +{ + for (int i = 0; i < n; ++i) + { + sums[0] = sums[0] + a[2*i]; + sums[1] = sums[1] + a[2*i+1]; + sums[2] = sums[2] + b[2*i]; + sums[3] = sums[3] + b[2*i+1]; + } +} + +/* { dg-final { scan-tree-dump-times "SLP discovery of size 2 reduction group" 2 "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/tsvc/vect-tsvc-s293.c b/gcc/testsuite/gcc.dg/vect/tsvc/vect-tsvc-s293.c index 3213948..34f6af0 100644 --- a/gcc/testsuite/gcc.dg/vect/tsvc/vect-tsvc-s293.c +++ b/gcc/testsuite/gcc.dg/vect/tsvc/vect-tsvc-s293.c @@ -36,4 +36,4 @@ int main (int argc, char **argv) return 0; } -/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" { xfail *-*-* } } } */ +/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect"} } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-bool-3.c b/gcc/testsuite/gcc.dg/vect/vect-bool-3.c new file mode 100644 index 0000000..671f602 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-bool-3.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target vect_int } */ +/* { dg-require-effective-target vect_unpack } */ + +int count_true(const bool *values, int len) +{ + int count = 0; + for (int i = 0; i < len; i++) + count += values[i]; + return count; +} + +/* { dg-final { scan-tree-dump "optimized: loop vectorized" "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_139.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_139.c new file mode 100644 index 0000000..9599493 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_139.c @@ -0,0 +1,37 @@ +/* { dg-add-options vect_early_break } */ +/* { dg-require-effective-target vect_early_break_hw } */ +/* { dg-require-effective-target vect_int } */ + +/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */ + +#include "tree-vect.h" + +__attribute__((noipa)) +unsigned loop9(unsigned char *a, unsigned n, unsigned c) +{ + for (unsigned j = 0;;) + { + if (c <= j) + __builtin_abort(); + + unsigned char *slot = (unsigned char *)a + j; + + *slot = (char)j; + + unsigned d = j + 1; + if (d < n) + j = d; + else + return d; + } +} + +int main () +{ + check_vect (); + + unsigned char buff[16] = {0}; + unsigned res = loop9 (buff, 16, 20); + if (res != 16) + __builtin_abort (); +} diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_140-pr122868_1.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_140-pr122868_1.c new file mode 100644 index 0000000..80264bd --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_140-pr122868_1.c @@ -0,0 +1,39 @@ +/* { dg-add-options vect_early_break } */ +/* { dg-require-effective-target vect_sizes_16B_8B } */ +/* { dg-require-effective-target vect_early_break_hw } */ +/* { dg-require-effective-target vect_int } */ + +/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */ + +#include "tree-vect.h" + +__attribute__ ((noipa)) +int f (int a[12], int b[12], int n) +{ +#ifdef __arm__ + a = __builtin_assume_aligned (a, 8); + b = __builtin_assume_aligned (b, 8); +#else + a = __builtin_assume_aligned (a, 16); + b = __builtin_assume_aligned (b, 16); +#endif + for (int i = 0; i < n; i++) + { + if (b[i] == 0) + return 0; + if (a[0] > b[i]) + return 1; + } + return 2; +} + +int main () +{ + check_vect (); + + int *a = 0; + int b[12] = {0}; + return f (a, b, 10); +} + +/* { dg-final { scan-tree-dump "not hoisting invariant load due to early break" "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_140-pr122868_2.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_140-pr122868_2.c new file mode 100644 index 0000000..90222fc --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_140-pr122868_2.c @@ -0,0 +1,31 @@ +/* { dg-add-options vect_early_break } */ +/* { dg-require-effective-target vect_early_break_hw } */ +/* { dg-require-effective-target vect_int } */ + +/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */ + +#include "tree-vect.h" + +__attribute__ ((noipa)) +int f (int a[12], int b[12], int n) +{ + for (int i = 0; i < n; i++) + { + if (b[i] == 0) + return 0; + if (a[0] > b[i]) + return 1; + } + return 2; +} + +int main () +{ + check_vect (); + + int *a = 0; + int b[12] = {0}; + return f (a, b, 10); +} + +/* { dg-final { scan-tree-dump-times "not hoisting invariant load due to early break" 0 "vect" { xfail *-*-* } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_140-pr122868_3.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_140-pr122868_3.c new file mode 100644 index 0000000..670804f --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_140-pr122868_3.c @@ -0,0 +1,39 @@ +/* { dg-add-options vect_early_break } */ +/* { dg-require-effective-target vect_sizes_16B_8B } */ +/* { dg-require-effective-target vect_early_break_hw } */ +/* { dg-require-effective-target vect_int } */ + +/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */ + +#include "tree-vect.h" + +__attribute__ ((noipa)) +int f (int a[12], int b[12], int n) +{ +#ifdef __arm__ + a = __builtin_assume_aligned (a, 8); + b = __builtin_assume_aligned (b, 8); +#else + a = __builtin_assume_aligned (a, 16); + b = __builtin_assume_aligned (b, 16); +#endif + for (int i = 0; i < n; i++) + { + if (a[0] > b[i]) + return 0; + if (b[i] == 0) + return 1; + } + return 2; +} + +int main () +{ + check_vect (); + + int a[12] = {1}; + int b[12] = {0}; + return f (a, b, 10); +} + +/* { dg-final { scan-tree-dump-times "not hoisting invariant load due to early break" 0 "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_140-pr122868_4.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_140-pr122868_4.c new file mode 100644 index 0000000..de2aff2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_140-pr122868_4.c @@ -0,0 +1,31 @@ +/* { dg-add-options vect_early_break } */ +/* { dg-require-effective-target vect_early_break_hw } */ +/* { dg-require-effective-target vect_int } */ + +/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */ + +#include "tree-vect.h" + +__attribute__ ((noipa)) +int f (int a[12], int b[12], int n) +{ + for (int i = 0; i < n; i++) + { + if (a[0] > b[i]) + return 0; + if (b[i] == 0) + return 0; + } + return 2; +} + +int main () +{ + check_vect (); + + int a[12] = {1}; + int b[12] = {0}; + return f (a, b, 10); +} + +/* { dg-final { scan-tree-dump-times "not hoisting invariant load due to early break" 0 "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_39.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_39.c index b3f40b8..bc862ad 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-early-break_39.c +++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_39.c @@ -23,5 +23,6 @@ unsigned test4(unsigned x, unsigned n) return ret; } -/* cannot safely vectorize this due due to the group misalignment. */ -/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 0 "vect" } } */ +/* AArch64 will scalarize the load and is able to vectorize it. */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 1 "vect" { target aarch64*-*-* } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 0 "vect" { target { ! aarch64*-*-* } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-licm-hoist-1.c b/gcc/testsuite/gcc.dg/vect/vect-licm-hoist-1.c new file mode 100644 index 0000000..2e850eb --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-licm-hoist-1.c @@ -0,0 +1,24 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target vect_float } */ +/* { dg-additional-options "-fdump-tree-lim2-details -fdump-tree-vect-details" } */ + +/* Test vectorization of "self write" pattern: a[i] = a[0]. + LICM should hoist a[0] by recognizing that even when i==0 causes + aliasing, the stored value equals the loaded value (via SSA). */ + +#define N 32000 + +float a[N]; + +/* Should vectorize. */ + +void +test_safe_hoist (void) +{ + for (int i = 0; i < N; i++) + a[i] = a[0]; +} + +/* { dg-final { scan-tree-dump "loop vectorized" "vect" } } */ +/* { dg-final { scan-tree-dump "independent \\(self write\\)" "lim2" } } */ + diff --git a/gcc/testsuite/gcc.dg/vect/vect-licm-hoist-2.c b/gcc/testsuite/gcc.dg/vect/vect-licm-hoist-2.c new file mode 100644 index 0000000..c42dc3f --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-licm-hoist-2.c @@ -0,0 +1,26 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target vect_float } */ +/* { dg-additional-options "-fdump-tree-lim2-details -fdump-tree-vect-details" } */ + +/* Negative test: ensure we don't incorrectly hoist when + a store invalidates the loaded value. */ + +#define N 32000 + +float a[N]; + +/* Should NOT hoist: a[0] = 5.0f breaks the SSA dependency. */ + +void +test_unsafe_hoist (void) +{ + for (int i = 0; i < N; i++) + { + float x = a[0]; + a[i] = x; + a[0] = 5.0f; + } +} + +/* { dg-final { scan-tree-dump-not "independent \\(constant-indexed load" "lim2" } } */ + diff --git a/gcc/testsuite/gcc.dg/vect/vect-pr122844.c b/gcc/testsuite/gcc.dg/vect/vect-pr122844.c new file mode 100644 index 0000000..52da3ec --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-pr122844.c @@ -0,0 +1,34 @@ +#include "tree-vect.h" + +short c = 2; +short l = 6; +unsigned char m; +int k; +int a = -1; +unsigned long long t[2][2]; + +static void b( short c, int k, short l, unsigned m) +{ + for( signed x=0; x<2; x++) + for( int ab=0; ab<k+2; ab++) + a = ({ + int ac = a; + int ad = ({ int ac = l ? m : t[x][0]; + unsigned long long ad = c ? m : t[x][x]; + ac < ad ? ac : ad; }); + + ac < ad ? ac : ad; + }); +} + +int main() +{ + check_vect (); + + long long ag; + b(c,k,l,m); + ag = a; + if (ag != -1) + abort (); +} + diff --git a/gcc/testsuite/gcc.dg/vect/vect-pr123002.c b/gcc/testsuite/gcc.dg/vect/vect-pr123002.c new file mode 100644 index 0000000..3b45c48 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-pr123002.c @@ -0,0 +1,39 @@ +/* { dg-additional-options "-mavx2" { target avx2 } } */ + +#include "tree-vect.h" + +unsigned int enc_table_32[8][3] = { + {513735U, 77223048U, 437087610U }, + {0U, 78508U, 646269101U }, + {0U, 0U, 11997U, }, + {0U, 0U, 0U, }, + {0U, 0U, 0U, }, + {0U, 0U, 0U, }, + {0U, 0U, 0U, }, + {0U, 0U, 0U, }}; + +int __attribute__((noipa)) foo() +{ + unsigned long intermediate[3] = {0}; + + for (unsigned long i = 0UL; i < 8; i++) { + intermediate[0] += 2 * (unsigned long)(enc_table_32)[i][0]; + intermediate[1] += 2 * (unsigned long)(enc_table_32)[i][1]; + intermediate[2] += 2 * (unsigned long)(enc_table_32)[i][2]; + } + + if (intermediate[0] == 0xfad8e && + intermediate[1] == 0x9370e68 && intermediate[2] == 0x8125ca08) { + return 0; + } else { + return 1; + } +} + +int main() +{ + check_vect (); + if (foo ()) + __builtin_abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-cond-add-1.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-cond-add-1.c new file mode 100644 index 0000000..1e64df7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-cond-add-1.c @@ -0,0 +1,50 @@ +#include "tree-vect.h" + +char mask[128]; + +double __attribute__((noipa)) +foo (double *a, int n) +{ + double sum = 0.0; + for (int i = 0; i < n; ++i) + { + double val; + if (mask[i]) + val = a[i]; + else + val = -0.0; + sum = sum + val; + } + return sum; +} + +double a[128]; + +int main() +{ + check_vect (); + +#pragma GCC novector + for (int i = 0; i < 128; ++i) + { + a[i] = (i * 7) % 15; + mask[i] = (i + 1) & 4; + } + + double sum = foo (a, 87); + double sum2 = 0.0; +#pragma GCC novector + for (int i = 0; i < 87; ++i) + { + double val; + if (mask[i]) + val = a[i]; + else + val = -0.0; + sum2 = sum2 + val; + } + + if (sum != sum2) + __builtin_abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/vect/vect-simd-clone-22.c b/gcc/testsuite/gcc.dg/vect/vect-simd-clone-22.c new file mode 100644 index 0000000..732d2328 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-simd-clone-22.c @@ -0,0 +1,46 @@ +/* { dg-require-effective-target vect_simd_clones } */ +/* { dg-additional-options "-fopenmp-simd --param vect-partial-vector-usage=2 -w" } */ +/* { dg-additional-options "-mavx512f" { target avx512f_runtime } } */ +/* { dg-add-options ieee } */ +/* { dg-require-effective-target fenv_exceptions } */ +/* { dg-additional-sources vect-simd-clone-22a.c linkonly } */ + +#include <fenv.h> +#include "tree-vect.h" + +#pragma omp declare simd simdlen(16) inbranch +float __attribute__((const)) baz (float x, float y); + +float a[1024]; +int c[1024]; + +void __attribute__((noipa)) +foo (int n, float * __restrict b) +{ + for (int i = 0; i < n; ++i) + { + float aa = a[i]; + float bb = b[i]; + if (c[i] == 0) + aa = baz (aa, bb); + a[i] = aa; + } +} + +float b[1024]; + +int main() +{ + check_vect (); + +#pragma GCC novector + for (int i = 0; i < 1020; ++i) + a[i] = b[i] = 2; + foo (1020, b); + if (fetestexcept (FE_DIVBYZERO) || fetestexcept (FE_INVALID)) + abort (); +#pragma GCC novector + for (int i = 0; i < 1020; ++i) + if (a[i] != 1) + abort (); +} diff --git a/gcc/testsuite/gcc.dg/vect/vect-simd-clone-22a.c b/gcc/testsuite/gcc.dg/vect/vect-simd-clone-22a.c new file mode 100644 index 0000000..88bda07 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-simd-clone-22a.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ + +#pragma omp declare simd simdlen(16) inbranch +float baz (float x, float y) +{ + return x / y; +} diff --git a/gcc/testsuite/gcc.dg/vect/vect-simd-clone-23.c b/gcc/testsuite/gcc.dg/vect/vect-simd-clone-23.c new file mode 100644 index 0000000..b673ee0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-simd-clone-23.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target vect_simd_clones } */ +/* { dg-additional-options "-fopenmp-simd -w" } */ +/* { dg-additional-options "-mavx512bw" { target avx512bw } } */ + +#pragma omp declare simd simdlen(32) inbranch +int __attribute__((const)) baz (int x); + +short a[1024]; + +void __attribute__((noipa)) +foo (int n, int * __restrict b) +{ + for (int i = 0; i < n; ++i) + if (a[i]) + b[i] = baz (b[i]); +} diff --git a/gcc/testsuite/gcc.dg/vect/vect-simd-clone-24.c b/gcc/testsuite/gcc.dg/vect/vect-simd-clone-24.c new file mode 100644 index 0000000..5281dfa --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-simd-clone-24.c @@ -0,0 +1,22 @@ +/* { dg-do compile } */ +/* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */ +/* { dg-require-effective-target vect_simd_clones } */ +/* { dg-additional-options "-fopenmp-simd --param vect-partial-vector-usage=1 -fdump-tree-dce6 -w" } */ +/* { dg-additional-options "-mavx512f -mprefer-vector-width=512" { target avx512f } } */ + +#pragma omp declare simd simdlen(16) +int __attribute__((const)) baz (int x); + +int a[1024]; + +void foo (int n, int * __restrict b) +{ + for (int i = 0; i < n; ++i) + if (baz (a[i])) + b[i] = baz (b[i]); +} + +/* One notinbranch SIMD call, one inbranch in the main vector loop and two + inbranch in the masked epilog. */ +/* { dg-final { scan-tree-dump-times "simdclone\.\[0-9\] \\\(\[^,\]\+\\\)" 1 "dce6" { target avx512f } } } */ +/* { dg-final { scan-tree-dump-times "simdclone\.\[0-9\] \\\(\[^,\]\+,\[^,\]\+\\\)" 3 "dce6" { target avx512f } } } */ diff --git a/gcc/testsuite/gcc.dg/vla-1.c b/gcc/testsuite/gcc.dg/vla-1.c index d16e73d..2ab2b7a 100644 --- a/gcc/testsuite/gcc.dg/vla-1.c +++ b/gcc/testsuite/gcc.dg/vla-1.c @@ -16,11 +16,12 @@ main () { volatile int j; int x = 5; + asm volatile ("" : "+r" (x)); j = f1 (x); + asm volatile ("" : "+r" (x)); return 0; } /* One debug source bind is generated for the parameter, and one to describe the sizes of a and b. */ /* { dg-final { scan-tree-dump-times " s=> i" 2 "optimized" } } */ - diff --git a/gcc/testsuite/gcc.dg/vla-init-4.c b/gcc/testsuite/gcc.dg/vla-init-4.c index 06351d0..7d1aa5b 100644 --- a/gcc/testsuite/gcc.dg/vla-init-4.c +++ b/gcc/testsuite/gcc.dg/vla-init-4.c @@ -4,4 +4,4 @@ /* { dg-options "" } */ const int i = 1; -void foo() { char *p = (char [i]){ "" }; } /* { dg-error "compound literal has variable size" } */ +void foo() { char *p = (char [i]){ "" }; } /* { dg-error "variable-sized object" } */ diff --git a/gcc/testsuite/gcc.dg/vla-init-5.c b/gcc/testsuite/gcc.dg/vla-init-5.c index aa9f491..2c249ec 100644 --- a/gcc/testsuite/gcc.dg/vla-init-5.c +++ b/gcc/testsuite/gcc.dg/vla-init-5.c @@ -4,4 +4,4 @@ /* { dg-options "" } */ const int i = 1; -void foo() { void *p = (char [][i]){ "" }; } /* { dg-error "compound literal has variable size" } */ +void foo() { void *p = (char [][i]){ "" }; } /* { dg-error "variable-sized object" } */ diff --git a/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/aarch64-json-tunings.exp b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/aarch64-json-tunings.exp new file mode 100644 index 0000000..974af6d --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/aarch64-json-tunings.exp @@ -0,0 +1,35 @@ +# Copyright (C) 2025 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# <http://www.gnu.org/licenses/>. + +# GCC testsuite that uses the `dg.exp' driver. + +# Exit immediately if this isn't an AArch64 target. +if ![istarget aarch64*-*-*] then { + return +} + +# Load support procs. +load_lib gcc-dg.exp + +# Initialize `dg'. +dg-init + +# Main loop. +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cCS\]]] \ + "" "" + +# All done. +dg-finish diff --git a/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/boolean-1.c b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/boolean-1.c new file mode 100644 index 0000000..d0a6c35 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/boolean-1.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-muser-provided-CPU=${srcdir}/gcc.target/aarch64/aarch64-json-tunings/boolean-1.json -fdump-tuning-model=temp.json" } */ + +/* { dg-warning "JSON tuning file does not contain version information" "" { target *-*-* } 0 } */ +/* { dg-final { scan-file "temp.json" "\"non_exec_costs_exec\": false" } } */ + +int main () {}
\ No newline at end of file diff --git a/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/boolean-1.json b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/boolean-1.json new file mode 100644 index 0000000..b7bd3dd --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/boolean-1.json @@ -0,0 +1,9 @@ +{ + "tune_params": { + "insn_extra_cost": { + "alu": { + "non_exec_costs_exec": false + } + } + } +} diff --git a/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/boolean-2.c b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/boolean-2.c new file mode 100644 index 0000000..aef632f --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/boolean-2.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-muser-provided-CPU=${srcdir}/gcc.target/aarch64/aarch64-json-tunings/boolean-2.json -fdump-tuning-model=temp.json" } */ + +/* { dg-warning "JSON tuning file does not contain version information" "" { target *-*-* } 0 } */ +/* { dg-error "key .* expected to be a boolean" "" { target *-*-* } 0 } */ +/* { dg-error "validation failed for the provided JSON data" "" { target *-*-* } 0 } */ + +int main () {}
\ No newline at end of file diff --git a/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/boolean-2.json b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/boolean-2.json new file mode 100644 index 0000000..d43e5b1 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/boolean-2.json @@ -0,0 +1,9 @@ +{ + "tune_params": { + "insn_extra_cost": { + "alu": { + "non_exec_costs_exec": 0 + } + } + } +} diff --git a/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/empty-brackets.c b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/empty-brackets.c new file mode 100644 index 0000000..4df72db --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/empty-brackets.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-muser-provided-CPU=${srcdir}/gcc.target/aarch64/aarch64-json-tunings/empty-brackets.json -fdump-tuning-model=temp.json" } */ + +/* { dg-warning "JSON tuning file does not contain version information" "" { target *-*-* } 0 } */ +/* { dg-warning "key 'tune_params' not found in JSON data" "" { target *-*-* } 0 } */ + +int main () {}
\ No newline at end of file diff --git a/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/empty-brackets.json b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/empty-brackets.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/empty-brackets.json @@ -0,0 +1 @@ +{} diff --git a/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/empty.c b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/empty.c new file mode 100644 index 0000000..0e72299 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/empty.c @@ -0,0 +1,6 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-muser-provided-CPU=${srcdir}/gcc.target/aarch64/aarch64-json-tunings/empty.json -fdump-tuning-model=temp.json" } */ + +/* { dg-error "expected a JSON value but got EOF" "" { target *-*-* } 0 } */ + +int main () {}
\ No newline at end of file diff --git a/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/empty.json b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/empty.json new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/empty.json diff --git a/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/enum-1.c b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/enum-1.c new file mode 100644 index 0000000..48daf32 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/enum-1.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-muser-provided-CPU=${srcdir}/gcc.target/aarch64/aarch64-json-tunings/enum-1.json -fdump-tuning-model=temp.json" } */ + +/* { dg-warning "JSON tuning file does not contain version information" "" { target *-*-* } 0 } */ +/* { dg-final { scan-file "temp.json" "\"autoprefetcher_model\": \"AUTOPREFETCHER_OFF\"" } } */ +/* { dg-final { scan-file "temp.json" "\"ldp_policy_model\": \"AARCH64_LDP_STP_POLICY_NEVER\"" } } */ +/* { dg-final { scan-file "temp.json" "\"stp_policy_model\": \"AARCH64_LDP_STP_POLICY_DEFAULT\"" } } */ + +int main () {}
\ No newline at end of file diff --git a/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/enum-1.json b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/enum-1.json new file mode 100644 index 0000000..492af1c --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/enum-1.json @@ -0,0 +1,7 @@ +{ + "tune_params": { + "autoprefetcher_model": "AUTOPREFETCHER_OFF", + "ldp_policy_model": "AARCH64_LDP_STP_POLICY_NEVER", + "stp_policy_model": "AARCH64_LDP_STP_POLICY_DEFAULT" + } +} diff --git a/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/enum-2.c b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/enum-2.c new file mode 100644 index 0000000..c53bc52 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/enum-2.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-muser-provided-CPU=${srcdir}/gcc.target/aarch64/aarch64-json-tunings/enum-2.json -fdump-tuning-model=temp.json" } */ + +/* { dg-warning "JSON tuning file does not contain version information" "" { target *-*-* } 0 } */ +/* { dg-warning "autoprefetcher_model not recognized, defaulting to 'AUTOPREFETCHER_OFF'" "" { target *-*-* } 0 } */ +/* { dg-warning "ldp_policy_model not recognized, defaulting to 'AARCH64_LDP_STP_POLICY_DEFAULT'" "" { target *-*-* } 0 } */ + +int main () {}
\ No newline at end of file diff --git a/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/enum-2.json b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/enum-2.json new file mode 100644 index 0000000..6120407 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/enum-2.json @@ -0,0 +1,7 @@ +{ + "tune_params": { + "autoprefetcher_model": "null", + "ldp_policy_model": "null", + "stp_policy_model": "AARCH64_LDP_STP_POLICY_DEFAULT" + } +} diff --git a/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/integer-1.c b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/integer-1.c new file mode 100644 index 0000000..5d80560 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/integer-1.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-muser-provided-CPU=${srcdir}/gcc.target/aarch64/aarch64-json-tunings/integer-1.json -fdump-tuning-model=temp.json" } */ + +/* { dg-warning "JSON tuning file does not contain version information" "" { target *-*-* } 0 } */ +/* { dg-final { scan-file "temp.json" "\"sve_width\": 256" } } */ +/* { dg-final { scan-file "temp.json" "\"issue_rate\": 4" } } */ + +int main () {}
\ No newline at end of file diff --git a/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/integer-1.json b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/integer-1.json new file mode 100644 index 0000000..8db0efa --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/integer-1.json @@ -0,0 +1,6 @@ +{ + "tune_params": { + "sve_width": 256, + "issue_rate": 4 + } +} diff --git a/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/integer-2.c b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/integer-2.c new file mode 100644 index 0000000..093c860 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/integer-2.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-muser-provided-CPU=${srcdir}/gcc.target/aarch64/aarch64-json-tunings/integer-2.json -fdump-tuning-model=temp.json" } */ + +/* { dg-warning "JSON tuning file does not contain version information" "" { target *-*-* } 0 } */ +/* { dg-error "key .* value .* is out of range for 'int' type" "" { target *-*-* } 0 } */ +/* { dg-error "validation failed for the provided JSON data" "" { target *-*-* } 0 } */ + +int main () {}
\ No newline at end of file diff --git a/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/integer-2.json b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/integer-2.json new file mode 100644 index 0000000..5a897f1 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/integer-2.json @@ -0,0 +1,5 @@ +{ + "tune_params": { + "int_reassoc_width": 12097307449014 + } +} diff --git a/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/integer-3.c b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/integer-3.c new file mode 100644 index 0000000..438685c --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/integer-3.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-muser-provided-CPU=${srcdir}/gcc.target/aarch64/aarch64-json-tunings/integer-3.json -fdump-tuning-model=temp.json" } */ + +/* { dg-warning "JSON tuning file does not contain version information" "" { target *-*-* } 0 } */ +/* { dg-error "key .* expected to be an integer" "" { target *-*-* } 0 } */ +/* { dg-error "validation failed for the provided JSON data" "" { target *-*-* } 0 } */ + +int main () {}
\ No newline at end of file diff --git a/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/integer-3.json b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/integer-3.json new file mode 100644 index 0000000..94fd123 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/integer-3.json @@ -0,0 +1,5 @@ +{ + "tune_params": { + "issue_rate": "10" + } +} diff --git a/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/string-1.c b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/string-1.c new file mode 100644 index 0000000..419ab86 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/string-1.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-muser-provided-CPU=${srcdir}/gcc.target/aarch64/aarch64-json-tunings/string-1.json -fdump-tuning-model=temp.json" } */ + +/* { dg-warning "JSON tuning file does not contain version information" "" { target *-*-* } 0 } */ +/* { dg-final { scan-file "temp.json" "\"function_align\": \"16\"" } } */ +/* { dg-final { scan-file "temp.json" "\"jump_align\": \"2\"" } } */ +/* { dg-final { scan-file "temp.json" "\"loop_align\": \"8\"" } } */ + +int main () {}
\ No newline at end of file diff --git a/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/string-1.json b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/string-1.json new file mode 100644 index 0000000..fe78f32 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/string-1.json @@ -0,0 +1,7 @@ +{ + "tune_params": { + "function_align": "16", + "jump_align": "2", + "loop_align": "8" + } +} diff --git a/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/string-2.c b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/string-2.c new file mode 100644 index 0000000..ad3ea14 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/string-2.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-muser-provided-CPU=${srcdir}/gcc.target/aarch64/aarch64-json-tunings/string-2.json -fdump-tuning-model=temp.json" } */ + +/* { dg-warning "JSON tuning file does not contain version information" "" { target *-*-* } 0 } */ +/* { dg-error "key .* expected to be a string" "" { target *-*-* } 0 } */ +/* { dg-error "validation failed for the provided JSON data" "" { target *-*-* } 0 } */ + +int main () {}
\ No newline at end of file diff --git a/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/string-2.json b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/string-2.json new file mode 100644 index 0000000..5b1df22 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/string-2.json @@ -0,0 +1,5 @@ +{ + "tune_params": { + "function_align": 16 + } +} diff --git a/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/test-all.c b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/test-all.c new file mode 100644 index 0000000..3d6d5c1 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/test-all.c @@ -0,0 +1,59 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-muser-provided-CPU=${srcdir}/gcc.target/aarch64/aarch64-json-tunings/test-all.json -fdump-tuning-model=temp.json" } */ +/* { dg-warning "JSON tuning file does not contain version information" "" { target *-*-* } 0 } */ + +/* Test round-trip parsing: load JSON, dump it, verify key values are preserved */ + +/* Check basic structure values */ +/* { dg-final { scan-file "temp.json" "\"issue_rate\": 3" } } */ +/* { dg-final { scan-file "temp.json" "\"fusible_ops\": 48" } } */ +/* { dg-final { scan-file "temp.json" "\"function_align\": \"32:16\"" } } */ + +/* Check alu costs */ +/* { dg-final { scan-file "temp.json" "\"arith\": 0" } } */ +/* { dg-final { scan-file "temp.json" "\"logical\": 0" } } */ +/* { dg-final { scan-file "temp.json" "\"shift\": 0" } } */ +/* { dg-final { scan-file "temp.json" "\"arith_shift\": 4" } } */ + +/* Check load/store costs */ +/* { dg-final { scan-file "temp.json" "\"load\": 12" } } */ +/* { dg-final { scan-file "temp.json" "\"store\": 0" } } */ +/* { dg-final { scan-file "temp.json" "\"loadf\": 16" } } */ +/* { dg-final { scan-file "temp.json" "\"storef\": 0" } } */ + +/* Check regmove costs */ +/* { dg-final { scan-file "temp.json" "\"GP2GP\": 1" } } */ +/* { dg-final { scan-file "temp.json" "\"GP2FP\": 5" } } */ +/* { dg-final { scan-file "temp.json" "\"FP2GP\": 5" } } */ +/* { dg-final { scan-file "temp.json" "\"FP2FP\": 2" } } */ + +/* Check vec_costs scalar fields */ +/* { dg-final { scan-file "temp.json" "\"scalar_int_stmt_cost\": 1" } } */ +/* { dg-final { scan-file "temp.json" "\"scalar_fp_stmt_cost\": 1" } } */ +/* { dg-final { scan-file "temp.json" "\"cond_taken_branch_cost\": 3" } } */ + +/* Check vec_costs advsimd nested fields */ +/* { dg-final { scan-file "temp.json" "\"int_stmt_cost\": 1" } } */ +/* { dg-final { scan-file "temp.json" "\"fp_stmt_cost\": 1" } } */ +/* { dg-final { scan-file "temp.json" "\"permute_cost\": 2" } } */ +/* { dg-final { scan-file "temp.json" "\"vec_to_scalar_cost\": 2" } } */ + +/* Check vec_costs sve nested fields */ +/* { dg-final { scan-file "temp.json" "\"clast_cost\": 2" } } */ +/* { dg-final { scan-file "temp.json" "\"fadda_f32_cost\": 2" } } */ +/* { dg-final { scan-file "temp.json" "\"gather_load_x32_cost\": 4" } } */ + +/* Check enum values */ +/* { dg-final { scan-file "temp.json" "\"autoprefetcher_model\": \"AUTOPREFETCHER_WEAK\"" } } */ +/* { dg-final { scan-file "temp.json" "\"ldp_policy_model\": \"AARCH64_LDP_STP_POLICY_ALWAYS\"" } } */ +/* { dg-final { scan-file "temp.json" "\"stp_policy_model\": \"AARCH64_LDP_STP_POLICY_ALWAYS\"" } } */ + +/* Check boolean values */ +/* { dg-final { scan-file "temp.json" "\"non_exec_costs_exec\": true" } } */ +/* { dg-final { scan-file "temp.json" "\"prefetch_dynamic_strides\": true" } } */ + +/* Check nested array values (mult costs) */ +/* { dg-final { scan-file "temp.json" "\"simple\": 4" } } */ +/* { dg-final { scan-file "temp.json" "\"idiv\": 24" } } */ + +int main () {}
\ No newline at end of file diff --git a/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/test-all.json b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/test-all.json new file mode 100644 index 0000000..8851000 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/test-all.json @@ -0,0 +1,39 @@ +{ + "tune_params": { + "insn_extra_cost": { + "alu": { + "arith": 0, + "logical": 0, + "shift": 0, + "arith_shift": 4 + }, + "mult": [ + { + "simple": 4, + "idiv": 24 + } + ], + "ldst": { + "load": 12, + "store": 0, + "loadf": 16, + "storef": 0 + } + }, + "regmove_cost": { + "GP2GP": 1, + "GP2FP": 5, + "FP2GP": 5, + "FP2FP": 2 + }, + "issue_rate": 3, + "fusible_ops": 48, + "function_align": "32:16", + "autoprefetcher_model": "AUTOPREFETCHER_WEAK", + "ldp_policy_model": "AARCH64_LDP_STP_POLICY_ALWAYS", + "stp_policy_model": "AARCH64_LDP_STP_POLICY_ALWAYS", + "prefetch": { + "prefetch_dynamic_strides": true + } + } +} diff --git a/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/unidentified-key.c b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/unidentified-key.c new file mode 100644 index 0000000..bafbda8 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/unidentified-key.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-muser-provided-CPU=${srcdir}/gcc.target/aarch64/aarch64-json-tunings/unidentified-key.json -fdump-tuning-model=temp.json" } */ + +/* { dg-warning "JSON tuning file does not contain version information" "" { target *-*-* } 0 } */ +/* { dg-warning "key .* is not a tuning parameter, skipping" "" { target *-*-* } 0 } */ + +int main () {}
\ No newline at end of file diff --git a/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/unidentified-key.json b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/unidentified-key.json new file mode 100644 index 0000000..89e69b2 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/unidentified-key.json @@ -0,0 +1,5 @@ +{ + "tune_params": { + "unidentified_key": "10" + } +} diff --git a/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/unsigned-1.c b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/unsigned-1.c new file mode 100644 index 0000000..b176ae3 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/unsigned-1.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-muser-provided-CPU=${srcdir}/gcc.target/aarch64/aarch64-json-tunings/unsigned-1.json -fdump-tuning-model=temp.json" } */ + +/* { dg-warning "JSON tuning file does not contain version information" "" { target *-*-* } 0 } */ +/* { dg-final { scan-file "temp.json" "\"sve_width\": 512" } } */ +/* { dg-final { scan-file "temp.json" "\"extra_tuning_flags\": 16" } } */ + +int main () {} diff --git a/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/unsigned-1.json b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/unsigned-1.json new file mode 100644 index 0000000..0de87e1 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/unsigned-1.json @@ -0,0 +1,6 @@ +{ + "tune_params": { + "sve_width": 512, + "extra_tuning_flags": 16 + } +} diff --git a/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/unsigned-2.c b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/unsigned-2.c new file mode 100644 index 0000000..ce1989d --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/unsigned-2.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-muser-provided-CPU=${srcdir}/gcc.target/aarch64/aarch64-json-tunings/unsigned-2.json -fdump-tuning-model=temp.json" } */ + +/* { dg-warning "JSON tuning file does not contain version information" "" { target *-*-* } 0 } */ +/* { dg-error "key .* value .* is out of range for 'uint' type" "" { target *-*-* } 0 } */ +/* { dg-error "validation failed for the provided JSON data" "" { target *-*-* } 0 } */ + +int main () {} diff --git a/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/unsigned-2.json b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/unsigned-2.json new file mode 100644 index 0000000..15da319 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/unsigned-2.json @@ -0,0 +1,6 @@ +{ + "tune_params": { + "sve_width": -128, + "extra_tuning_flags": 0 + } +} diff --git a/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/unsigned-3.c b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/unsigned-3.c new file mode 100644 index 0000000..20a661f --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/unsigned-3.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-muser-provided-CPU=${srcdir}/gcc.target/aarch64/aarch64-json-tunings/unsigned-3.json -fdump-tuning-model=temp.json" } */ + +/* { dg-warning "JSON tuning file does not contain version information" "" { target *-*-* } 0 } */ +/* { dg-error "key .* value .* is out of range for 'uint' type" "" { target *-*-* } 0 } */ +/* { dg-error "validation failed for the provided JSON data" "" { target *-*-* } 0 } */ + +int main () {} diff --git a/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/unsigned-3.json b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/unsigned-3.json new file mode 100644 index 0000000..2741159 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/aarch64-json-tunings/unsigned-3.json @@ -0,0 +1,5 @@ +{ + "tune_params": { + "sve_width": 5000000000 + } +} diff --git a/gcc/testsuite/gcc.target/aarch64/build-attributes/build-attribute-define-nok.c b/gcc/testsuite/gcc.target/aarch64/build-attributes/build-attribute-define-nok.c new file mode 100644 index 0000000..55b9de9 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/build-attributes/build-attribute-define-nok.c @@ -0,0 +1,5 @@ +/* { dg-do compile { target { aarch64*-*-linux* && { ! aarch64_gas_has_build_attributes } } } } */ + +#if defined(__ARM_BUILDATTR64_FV) +#error "Support for build attributes should not be enabled in this toolchain." +#endif diff --git a/gcc/testsuite/gcc.target/aarch64/build-attributes/build-attribute-define-ok.c b/gcc/testsuite/gcc.target/aarch64/build-attributes/build-attribute-define-ok.c new file mode 100644 index 0000000..7ecb929 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/build-attributes/build-attribute-define-ok.c @@ -0,0 +1,7 @@ +/* { dg-do compile { target { aarch64*-*-linux* && { aarch64_gas_has_build_attributes } } } } */ + +#if ! defined(__ARM_BUILDATTR64_FV) +#error "Support for build attributes should be enabled in this toolchain." +#elif __ARM_BUILDATTR64_FV != 'A' +#error "The current build attributes version does not match the expected one." +#endif diff --git a/gcc/testsuite/gcc.target/aarch64/cmpbr-4.c b/gcc/testsuite/gcc.target/aarch64/cmpbr-4.c new file mode 100644 index 0000000..e266ce1 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/cmpbr-4.c @@ -0,0 +1,12 @@ +// { dg-do compile } +// { dg-options "-O2" } + +#pragma GCC target "+cmpbr" + +typedef unsigned short Quantum; + +double MagickMax(double x, double y) { return x > y ? x : y; } + +void ConvertRGBToHCL(Quantum red, Quantum green) { + if (red == MagickMax(red, green)) __builtin_abort(); +} diff --git a/gcc/testsuite/gcc.target/aarch64/cmpbr-5.c b/gcc/testsuite/gcc.target/aarch64/cmpbr-5.c new file mode 100644 index 0000000..049e8c1 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/cmpbr-5.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-fgimple -O1" } */ +#pragma GCC target "+cmpbr" +typedef unsigned short us; +__GIMPLE double +f (us x, us y, double a, double b) +{ + bool c; + double d; + c = x == y; + d = c ? a : b; + return d; +} diff --git a/gcc/testsuite/gcc.target/aarch64/crc-crc32-data16.c b/gcc/testsuite/gcc.target/aarch64/crc-crc32-data16.c index e82cb04f..7561b3b 100644 --- a/gcc/testsuite/gcc.target/aarch64/crc-crc32-data16.c +++ b/gcc/testsuite/gcc.target/aarch64/crc-crc32-data16.c @@ -10,7 +10,7 @@ uint32_t _crc32_O0 (uint32_t crc, uint16_t data) { int i; crc = crc ^ data; - for (i = 0; i < 8; i++) { + for (i = 0; i < 16; i++) { if (crc & 1) crc = (crc >> 1) ^ 0xEDB88320; else @@ -24,7 +24,7 @@ uint32_t _crc32 (uint32_t crc, uint16_t data) { int i; crc = crc ^ data; - for (i = 0; i < 8; i++) { + for (i = 0; i < 16; i++) { if (crc & 1) crc = (crc >> 1) ^ 0xEDB88320; else diff --git a/gcc/testsuite/gcc.target/aarch64/dwarf-bit-stride-func.c b/gcc/testsuite/gcc.target/aarch64/dwarf-bit-stride-func.c new file mode 100644 index 0000000..654bae5 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/dwarf-bit-stride-func.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +// { dg-options "-g -dA" } +// { dg-final { scan-assembler-times "DW_AT_name: \"__SVBool_t\"" 1 } } +// { dg-final { scan-assembler-times ".byte 0x1 // DW_AT_bit_stride" 1 } } +// { dg-final { scan-assembler-times ".byte 0x1 // DW_AT_bit_size" 1 } } + +#include <arm_sve.h> + +__attribute__((target("arch=armv9-a+sve"))) +void fun () +{ + volatile svbool_t pred8 = svwhilelt_b8_u32 (0u, 1u); + volatile svbool_t pred16 = svwhilelt_b16_u32 (0u, 3u); + volatile svbool_t pred32 = svwhilelt_b32_u32 (0u, 7u); + volatile svbool_t pred64 = svwhilelt_b64_u32 (0u, 11u); +} diff --git a/gcc/testsuite/gcc.target/aarch64/dwarf-bit-stride-pragma-sme.c b/gcc/testsuite/gcc.target/aarch64/dwarf-bit-stride-pragma-sme.c new file mode 100644 index 0000000..4bd0da5 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/dwarf-bit-stride-pragma-sme.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +// { dg-options "-g -dA" } +// { dg-final { scan-assembler-times "DW_AT_name: \"__SVBool_t\"" 2 } } +// { dg-final { scan-assembler-times "DW_AT_name: \"__SVCount_t\"" 1 } } +// { dg-final { scan-assembler-times ".byte 0x1 // DW_AT_bit_stride" 2 } } +// { dg-final { scan-assembler-times ".byte 0x1 // DW_AT_bit_size" 1 } } + +#pragma GCC target "+sve2p1+sme2" + +void fun () +{ + volatile __SVBool_t pred; + volatile __SVCount_t count; +} diff --git a/gcc/testsuite/gcc.target/aarch64/dwarf-bit-stride-pragma.c b/gcc/testsuite/gcc.target/aarch64/dwarf-bit-stride-pragma.c new file mode 100644 index 0000000..77a0d80 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/dwarf-bit-stride-pragma.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +// { dg-options "-g -dA" } +// { dg-final { scan-assembler-times "DW_AT_name: \"__SVBool_t\"" 1 } } +// { dg-final { scan-assembler-times ".byte 0x1 // DW_AT_bit_stride" 1 } } +// { dg-final { scan-assembler-times ".byte 0x1 // DW_AT_bit_size" 1 } } + +#include <arm_sve.h> + +#pragma GCC target "+sve" + +void fun () +{ + volatile svbool_t pred8 = svwhilelt_b8_u32 (0u, 1u); + volatile svbool_t pred16 = svwhilelt_b16_u32 (0u, 3u); + volatile svbool_t pred32 = svwhilelt_b32_u32 (0u, 7u); + volatile svbool_t pred64 = svwhilelt_b64_u32 (0u, 11u); +} diff --git a/gcc/testsuite/gcc.target/aarch64/eor3-opt.c b/gcc/testsuite/gcc.target/aarch64/eor3-opt.c new file mode 100644 index 0000000..51f36f9 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/eor3-opt.c @@ -0,0 +1,209 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-O2 -fno-schedule-insns -fno-schedule-insns2" } */ +/* { dg-final { check-function-bodies "**" "" {} } } */ +#include <arm_neon.h> + +#pragma GCC target ("+sha3") + +#define EOR_SCALAR_FN(type) \ +type eor3_##type (type a, type b, type c) { \ + return a ^ b ^ c; \ +} + + +EOR_SCALAR_FN(uint64x1_t) +/* +** eor3_uint64x1_t: +** eor3 v0.16b, v0.16b, v1.16b, v2.16b +** ret +*/ +EOR_SCALAR_FN(int64x1_t) +/* +** eor3_int64x1_t: +** eor3 v0.16b, v0.16b, v1.16b, v2.16b +** ret +*/ + +#define EOR_VEC_FN(type) \ +type eor3_##type (type a, type b, type c) \ +{ \ + type res = a; \ + res[0] = a[0] ^ b[0] ^ c[0]; \ + return res; \ +} + +EOR_VEC_FN(int32x4_t) +/* +** eor3_int32x4_t: +** eor3 v([0-2]).16b, v[0-2].16b, v[0-2].16b, v[0-2].16b +** ins v0.s\[0\], v\1.s\[0\] +** ret +*/ +EOR_VEC_FN(int32x2_t) +/* +** eor3_int32x2_t: +** eor3 v([0-2]).16b, v[0-2].16b, v[0-2].16b, v[0-2].16b +** ins v0.s\[0\], v\1.s\[0\] +** ret +*/ +EOR_VEC_FN(uint32x4_t) +/* +** eor3_uint32x4_t: +** eor3 v([0-2]).16b, v[0-2].16b, v[0-2].16b, v[0-2].16b +** ins v0.s\[0\], v\1.s\[0\] +** ret +*/ +EOR_VEC_FN(uint32x2_t) +/* +** eor3_uint32x2_t: +** eor3 v([0-2]).16b, v[0-2].16b, v[0-2].16b, v[0-2].16b +** ins v0.s\[0\], v\1.s\[0\] +** ret +*/ +EOR_VEC_FN(int16x8_t) +/* +** eor3_int16x8_t: +** eor3 v([0-2]).16b, v[0-2].16b, v[0-2].16b, v[0-2].16b +** ins v0.h\[0\], v\1.h\[0\] +** ret +*/ +EOR_VEC_FN(int16x4_t) +/* +** eor3_int16x4_t: +** eor3 v([0-2]).16b, v[0-2].16b, v[0-2].16b, v[0-2].16b +** ins v0.h\[0\], v\1.h\[0\] +** ret +*/ +EOR_VEC_FN(uint16x8_t) +/* +** eor3_uint16x8_t: +** eor3 v([0-2]).16b, v[0-2].16b, v[0-2].16b, v[0-2].16b +** ins v0.h\[0\], v\1.h\[0\] +** ret +*/ +EOR_VEC_FN(uint16x4_t) +/* +** eor3_uint16x4_t: +** eor3 v([0-2]).16b, v[0-2].16b, v[0-2].16b, v[0-2].16b +** ins v0.h\[0\], v\1.h\[0\] +** ret +*/ +EOR_VEC_FN(int8x16_t) +/* +** eor3_int8x16_t: +** eor3 v([0-2]).16b, v[0-2].16b, v[0-2].16b, v[0-2].16b +** ins v0.b\[0\], v\1.b\[0\] +** ret +*/ +EOR_VEC_FN(int8x8_t) +/* +** eor3_int8x8_t: +** eor3 v([0-2]).16b, v[0-2].16b, v[0-2].16b, v[0-2].16b +** ins v0.b\[0\], v\1.b\[0\] +** ret +*/ +EOR_VEC_FN(uint8x16_t) +/* +** eor3_uint8x16_t: +** eor3 v([0-2]).16b, v[0-2].16b, v[0-2].16b, v[0-2].16b +** ins v0.b\[0\], v\1.b\[0\] +** ret +*/ +EOR_VEC_FN(uint8x8_t) +/* +** eor3_uint8x8_t: +** eor3 v([0-2]).16b, v[0-2].16b, v[0-2].16b, v[0-2].16b +** ins v0.b\[0\], v\1.b\[0\] +** ret +*/ + +/* The following tests should not be optimized to EOR3 as that would involve + unnecessary register file moves. */ + +EOR_SCALAR_FN(uint64_t) +/* +** eor3_uint64_t: +** eor x1, x1, x2 +** eor x0, x1, x0 +** ret +*/ +EOR_SCALAR_FN(int64_t) +/* +** eor3_int64_t: +** eor x1, x1, x2 +** eor x0, x1, x0 +** ret +*/ +EOR_SCALAR_FN(uint32_t) +/* +** eor3_uint32_t: +** eor w1, w1, w2 +** eor w0, w1, w0 +** ret +*/ +EOR_SCALAR_FN(int32_t) +/* +** eor3_int32_t: +** eor w1, w1, w2 +** eor w0, w1, w0 +** ret +*/ +EOR_SCALAR_FN(uint16_t) +/* +** eor3_uint16_t: +** eor w1, w1, w2 +** eor w0, w0, w1 +** ret +*/ +EOR_SCALAR_FN(int16_t) +/* +** eor3_int16_t: +** eor w1, w1, w2 +** eor w0, w0, w1 +** ret +*/ +EOR_SCALAR_FN(uint8_t) +/* +** eor3_uint8_t: +** eor w1, w1, w2 +** eor w0, w0, w1 +** ret +*/ +EOR_SCALAR_FN(int8_t) +/* +** eor3_int8_t: +** eor w1, w1, w2 +** eor w0, w0, w1 +** ret +*/ + +void not_eor3_long(long *p) +{ + p[6] = p[4] ^ p[0] ^ (p[2] << 2); +} +/* +** not_eor3_long: +** ldr x1, \[x0\] +** ldr x2, \[x0, 32\] +** eor x2, x2, x1 +** ldr x1, \[x0, 16\] +** eor x1, x2, x1, lsl 2 +** str x1, \[x0, 48\] +** ret +*/ + +int64x2_t not_eor3_int64_t (int64x2_t a, int64_t b, int64_t c) +{ + int64x2_t res; + res[0] = a[0] ^ b ^ c; + return res; +} +/* +** not_eor3_int64_t: +** eor x0, x0, x1 +** fmov d31, x0 +** eor v0.8b, v31.8b, v0.8b +** fmov d0, d0 +** ret +*/ + diff --git a/gcc/testsuite/gcc.target/aarch64/ffs.c b/gcc/testsuite/gcc.target/aarch64/ffs.c index a344761..a303bee 100644 --- a/gcc/testsuite/gcc.target/aarch64/ffs.c +++ b/gcc/testsuite/gcc.target/aarch64/ffs.c @@ -1,12 +1,63 @@ /* { dg-do compile } */ -/* { dg-options "-O2" } */ +/* { dg-additional-options "--save-temps -O2" } */ +/* { dg-final { check-function-bodies "**" "" "" } } */ -unsigned int functest(unsigned int x) +#include <stdint.h> + +#pragma GCC target "+nocssc" + +/* +** ffsw1: +** cmp w1, 0 +** rbit w0, w1 +** clz w0, w0 +** csinc w0, wzr, w0, eq +** ret +*/ + +int ffsw1 (int y, uint32_t x) +{ + return __builtin_ffs (x); +} + +/* +** ffsx1: +** cmp x1, 0 +** rbit x0, x1 +** clz x0, x0 +** csinc x0, xzr, x0, eq +** ret +*/ + +int ffsx1 (int y, uint64_t x) { - return __builtin_ffs(x); + return __builtin_ffsll (x); } -/* { dg-final { scan-assembler "cmp\tw" } } */ -/* { dg-final { scan-assembler "rbit\tw" } } */ -/* { dg-final { scan-assembler "clz\tw" } } */ -/* { dg-final { scan-assembler "csinc\tw" } } */ +#pragma GCC target "+cssc" + +/* +** ffsw2: +** cmp w1, 0 +** ctz w0, w1 +** csinc w0, wzr, w0, eq +** ret +*/ + +int ffsw2 (int y, uint32_t x) +{ + return __builtin_ffs (x); +} + +/* +** ffsx2: +** cmp x1, 0 +** ctz x0, x1 +** csinc x0, xzr, x0, eq +** ret +*/ + +int ffsx2 (int y, uint64_t x) +{ + return __builtin_ffsll (x); +} diff --git a/gcc/testsuite/gcc.target/aarch64/fmv_priority.in b/gcc/testsuite/gcc.target/aarch64/fmv_priority.in index 93209bc..4637369 100644 --- a/gcc/testsuite/gcc.target/aarch64/fmv_priority.in +++ b/gcc/testsuite/gcc.target/aarch64/fmv_priority.in @@ -30,10 +30,12 @@ int fn [[gnu::target_version("fp16")]] (int) { return 1; } int fn_fp16(int) asm("fn._Mfp16"); int fn [[gnu::target_version("fp16fml")]] (int) { return 1; } int fn_fp16fml(int) asm("fn._Mfp16fml"); -/* TODO: These FMV features are not yet supported in GCC. */ -// int fn [[gnu::target_version("dit")]] (int) { return 1; } -// int fn [[gnu::target_version("dpb")]] (int) { return 1; } -// int fn [[gnu::target_version("dpb2")]] (int) { return 1; } +int fn [[gnu::target_version("dit")]] (int) { return 1; } +int fn_dit(int) asm("fn._Mdit"); +int fn [[gnu::target_version("dpb")]] (int) { return 1; } +int fn_dpb(int) asm("fn._Mdpb"); +int fn [[gnu::target_version("dpb2")]] (int) { return 1; } +int fn_dpb2(int) asm("fn._Mdpb2"); int fn [[gnu::target_version("jscvt")]] (int) { return 1; } int fn_jscvt(int) asm("fn._Mjscvt"); int fn [[gnu::target_version("fcma")]] (int) { return 1; } @@ -68,15 +70,14 @@ int fn [[gnu::target_version("sve2-sm4")]] (int) { return 1; } int fn_sve2_sm4(int) asm("fn._Msve2_sm4"); int fn [[gnu::target_version("sve2+sme")]] (int) { return 1; } int fn_sve2_sme(int) asm("fn._Msve2Msme"); -/* TODO: This FMV features is not yet supported in GCC. */ -// int fn [[gnu::target_version("memtag")]] (int) { return 1; } +int fn [[gnu::target_version("memtag")]] (int) { return 1; } +int fn_memtag(int) asm("fn._Mmemtag"); int fn [[gnu::target_version("sb")]] (int) { return 1; } int fn_sb(int) asm("fn._Msb"); -/* TODO: This FMV feature is not yet supported in GCC. */ -// int fn [[gnu::target_version("ssbs")]] (int) { return 1; } -// int fn_ssbs(int) asm("fn._Mssbs"); -/* TODO: This FMV feature is not yet supported in GCC. */ -// int fn [[gnu::target_version("bti")]] (int) { return 1; } +int fn [[gnu::target_version("ssbs")]] (int) { return 1; } +int fn_ssbs(int) asm("fn._Mssbs"); +int fn [[gnu::target_version("bti")]] (int) { return 1; } +int fn_bti(int) asm("fn._Mbti"); int fn [[gnu::target_version("wfxt")]] (int) { return 1; } int fn_wfxt(int) asm("fn._Mwfxt"); int fn [[gnu::target_version("sve2+sme-f64f64")]] (int) { return 1; } diff --git a/gcc/testsuite/gcc.target/aarch64/fmv_priority1.c b/gcc/testsuite/gcc.target/aarch64/fmv_priority1.c index 942b7a7..6075ccf 100644 --- a/gcc/testsuite/gcc.target/aarch64/fmv_priority1.c +++ b/gcc/testsuite/gcc.target/aarch64/fmv_priority1.c @@ -81,14 +81,14 @@ int main () { if(resolver() != &fn_fp16fml) return 1; setCPUFeature (FEAT_DIT); - // if(resolver() != &fn_dit) return 1; - // + if(resolver() != &fn_dit) return 1; + setCPUFeature (FEAT_DPB); - // if(resolver() != &fn_dpb) return 1; - // + if(resolver() != &fn_dpb) return 1; + setCPUFeature (FEAT_DPB2); - // if(resolver() != &fn_dpb2) return 1; - // + if(resolver() != &fn_dpb2) return 1; + setCPUFeature (FEAT_JSCVT); if (resolver () != &fn_jscvt) return 1; @@ -102,8 +102,8 @@ int main () { if (resolver () != &fn_rcpc2) return 1; setCPUFeature (FEAT_RCPC3); - // if(resolver() != &fn_rcpc3) return 1; - // + if(resolver() != &fn_rcpc3) return 1; + setCPUFeature (FEAT_FRINTTS); if (resolver () != &fn_frintts) return 1; @@ -141,16 +141,16 @@ int main () { if (resolver () != &fn_sve2_sme) return 1; setCPUFeature(FEAT_MEMTAG2); - // if(resolver() != &fn_memtag) return 1; + if(resolver() != &fn_memtag) return 1; setCPUFeature (FEAT_SB); if (resolver () != &fn_sb) return 1; setCPUFeature(FEAT_SSBS2); - // if(resolver() != &fn_ssbs) return 1; + if(resolver() != &fn_ssbs) return 1; setCPUFeature(FEAT_BTI); - // if(resolver() != &fn_bti) return 1; + if(resolver() != &fn_bti) return 1; setCPUFeature (FEAT_WFXT); if (resolver () != &fn_wfxt) return 1; diff --git a/gcc/testsuite/gcc.target/aarch64/fmv_priority2.c b/gcc/testsuite/gcc.target/aarch64/fmv_priority2.c index dbeb15e..9464015 100644 --- a/gcc/testsuite/gcc.target/aarch64/fmv_priority2.c +++ b/gcc/testsuite/gcc.target/aarch64/fmv_priority2.c @@ -14,7 +14,9 @@ /* { dg-final { scan-ipa-dump-times "fn\._Msm4/\[0-9\]+\\nfn\._MrdmaMrdm/\[0-9\]+\\nfn\._Mcrc/\[0-9\]+\\n" 1 "targetclone1" } } */ /* { dg-final { scan-ipa-dump-times "fn\._Mcrc/\[0-9\]+\\nfn\._Msha2/\[0-9\]+\\nfn\._Msha3/\[0-9\]+\\n" 1 "targetclone1" } } */ /* { dg-final { scan-ipa-dump-times "fn\._Msha3/\[0-9\]+\\nfn\._Maes/\[0-9\]+\\nfn\._Mfp16/\[0-9\]+\\n" 1 "targetclone1" } } */ -/* { dg-final { scan-ipa-dump-times "fn\._Mfp16/\[0-9\]+\\nfn\._Mfp16fml/\[0-9\]+\\nfn\._Mjscvt/\[0-9\]+\\n" 1 "targetclone1" } } */ +/* { dg-final { scan-ipa-dump-times "fn\._Mfp16/\[0-9\]+\\nfn\._Mfp16fml/\[0-9\]+\\nfn\._Mdit/\[0-9\]+\\n" 1 "targetclone1" } } */ +/* { dg-final { scan-ipa-dump-times "fn\._Mdit/\[0-9\]+\\nfn\._Mdpb/\[0-9\]+\\nfn\._Mdpb2/\[0-9\]+\\n" 1 "targetclone1" } } */ +/* { dg-final { scan-ipa-dump-times "fn\._Mdpb2/\[0-9\]+\\nfn\._Mjscvt/\[0-9\]+\\n" 1 "targetclone1" } } */ /* { dg-final { scan-ipa-dump-times "fn\._Mjscvt/\[0-9\]+\\nfn\._Mfcma/\[0-9\]+\\nfn\._Mrcpc/\[0-9\]+\\n" 1 "targetclone1" } } */ /* { dg-final { scan-ipa-dump-times "fn\._Mrcpc/\[0-9\]+\\nfn\._Mrcpc2/\[0-9\]+\\nfn\._Mrcpc3/\[0-9\]+\\n" 1 "targetclone1" } } */ /* { dg-final { scan-ipa-dump-times "fn\._Mrcpc3/\[0-9\]+\\nfn\._Mfrintts/\[0-9\]+\\nfn\._Mi8mm/\[0-9\]+\\n" 1 "targetclone1" } } */ @@ -23,7 +25,9 @@ /* { dg-final { scan-ipa-dump-times "fn\._Mf64mm/\[0-9\]+\\nfn\._Msve2/\[0-9\]+\\nfn\._Msve2_aes/\[0-9\]+\\n" 1 "targetclone1" } } */ /* { dg-final { scan-ipa-dump-times "fn\._Msve2_aes/\[0-9\]+\\nfn\._Msve2_bitperm/\[0-9\]+\\nfn\._Msve2_sha3/\[0-9\]+\\n" 1 "targetclone1" } } */ /* { dg-final { scan-ipa-dump-times "fn\._Msve2_sha3/\[0-9\]+\\nfn\._Msve2_sm4/\[0-9\]+\\nfn\._Msve2Msme/\[0-9\]+\\n" 1 "targetclone1" } } */ -/* { dg-final { scan-ipa-dump-times "fn\._Msve2Msme/\[0-9\]+\\nfn\._Msb/\[0-9\]+\\nfn\._Mwfxt/\[0-9\]+\\n" 1 "targetclone1" } } */ +/* { dg-final { scan-ipa-dump-times "fn\._Msve2Msme/\[0-9\]+\\nfn\._Mmemtag/\[0-9\]+\\nfn\._Msb/\[0-9\]+\\n" 1 "targetclone1" } } */ +/* { dg-final { scan-ipa-dump-times "fn\._Msb/\[0-9\]+\\nfn\._Mssbs/\[0-9\]+\\nfn\._Mbti/\[0-9\]+\\n" 1 "targetclone1" } } */ +/* { dg-final { scan-ipa-dump-times "fn\._Mbti/\[0-9\]+\\nfn\._Mwfxt/\[0-9\]+\\n" 1 "targetclone1" } } */ /* { dg-final { scan-ipa-dump-times "fn\._Mwfxt/\[0-9\]+\\nfn\._Msve2Msme_f64f64/\[0-9\]+\\nfn\._Msve2Msme_i16i64/\[0-9\]+\\n" 1 "targetclone1" } } */ /* { dg-final { scan-ipa-dump-times "fn\._Msve2Msme_i16i64/\[0-9\]+\\nfn\._Msve2Msme2/\[0-9\]+\\nfn\._Mmops/\[0-9\]+\\n" 1 "targetclone1" } } */ /* { dg-final { scan-ipa-dump-times "fn\._Mmops/\[0-9\]+\\nfn\._Mcssc/\[0-9\]+\\n" 1 "targetclone1" } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/mingw/long_double_size.c b/gcc/testsuite/gcc.target/aarch64/mingw/long_double_size.c new file mode 100644 index 0000000..323bd97 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/mingw/long_double_size.c @@ -0,0 +1,23 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-O2" } */ +/* { dg-final { check-function-bodies "**" "" } } */ + +/** + * For aarch64-w64-mingw32 target, long double is 64 bits. Unlike in + * aarch64-linux-gnu, where long double is 128 bits. The tests below validate + * validate that. In aarch64-linux-gnu, the results would be the opposite. + */ + +/* +** test: +** fmov d0, 4.0e\+0 +** ret +*/ +long double +test () +{ + long double i = 4; + return i; +} + +/* { dg-final { scan-assembler-not "ldr\tq\[0-9\]+, \[x\[0-9\]+\]*" } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/mingw/mingw.exp b/gcc/testsuite/gcc.target/aarch64/mingw/mingw.exp new file mode 100644 index 0000000..66e151e --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/mingw/mingw.exp @@ -0,0 +1,41 @@ +# Copyright (C) 2025 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# <http://www.gnu.org/licenses/>. + +# GCC testsuite that uses the `dg.exp' driver. + +# Exit immediately if this isn't an AArch64-Mingw target. +if {![istarget aarch64*-*-mingw32] } then { + return +} + +# Load support procs. +load_lib gcc-dg.exp + +# If a testcase doesn't have special options, use these. +global DEFAULT_CFLAGS +if ![info exists DEFAULT_CFLAGS] then { + set DEFAULT_CFLAGS " -ansi -pedantic-errors" +} + +# Initialize `dg'. +dg-init + +# Main loop. +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cCS\]]] \ + "" $DEFAULT_CFLAGS + +# All done. +dg-finish diff --git a/gcc/testsuite/gcc.target/aarch64/mingw/variadic_hfa.c b/gcc/testsuite/gcc.target/aarch64/mingw/variadic_hfa.c new file mode 100644 index 0000000..5b3e3ae --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/mingw/variadic_hfa.c @@ -0,0 +1,71 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-std=c99" } */ +/* { dg-final { check-function-bodies "**" "" } } */ + +#include <stdarg.h> + +typedef struct { + double x; + double y; +} point2d; + +point2d accumulate(int count, ...) { + int i; + va_list ap; + va_start(ap, count); + + point2d acc = {0.0, 0.0}; + for (i = 0; i < count; ++i) { + point2d v = va_arg(ap, point2d); + acc.x += v.x; + acc.y += v.y; + } + + va_end(ap); + return acc; +} + +/** + * For aarch64-w64-mingw32 target, the Homogeneous Floating-point Aggregate + * (HFA) types are not treated specially. + * + * This is in contrast to to aarch64-linux-gnu target where double float args + * would be loaded into 64 bit D registers. + */ + +/* +** main: +** ... +** fmov d\d+, 2.0e\+0 +** str d\d+, \[sp, \d+\] +** fmov d\d+, 1.0e\+0 +** str d\d+, \[sp, \d+\] +** fmov d\d+, 4.0e\+0 +** str d\d+, \[sp, \d+\] +** fmov d\d+, 3.0e\+0 +** str d\d+, \[sp, \d+\] +** fmov d\d+, 6.0e\+0 +** str d\d+, \[sp, \d+\] +** fmov d\d+, 5.0e\+0 +** str d\d+, \[sp, \d+\] +** fmov d\d+, 8.0e\+0 +** str d\d+, \[sp, \d+\] +** fmov d\d+, 7.0e\+0 +** str d\d+, \[sp, \d+\] +** ldp x\d+, x\d+, \[sp, \d+\] +** ldp x\d+, x\d+, \[sp, \d+\] +** ldp x\d+, x\d+, \[sp, \d+\] +** ldp x\d+, x\d+, \[sp, \d+\] +** ... +*/ +int main() +{ + point2d p1 = {2.0, 1.0}; + point2d p2 = {4.0, 3.0}; + point2d p3 = {6.0, 5.0}; + point2d p4 = {8.0, 7.0}; + + accumulate (4, p1, p2, p3, p4); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/aarch64/mingw/variadic_hva.c b/gcc/testsuite/gcc.target/aarch64/mingw/variadic_hva.c new file mode 100644 index 0000000..7c690d3 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/mingw/variadic_hva.c @@ -0,0 +1,89 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-std=c99" } */ +/* { dg-final { check-function-bodies "**" "" } } */ + +#include <arm_neon.h> +#include <stdarg.h> + +typedef struct { + float32x4_t a; + float32x4_t b; + float32x4_t c; + float32x4_t d; +} mat4x4; + +mat4x4 accumulate(int count, ...) { + va_list va; + va_start(va, count); + + mat4x4 result = { + vdupq_n_f32(0.0f), + vdupq_n_f32(0.0f), + vdupq_n_f32(0.0f), + vdupq_n_f32(0.0f) + }; + + for (int i = 0; i < count; ++i) { + mat4x4 v = va_arg(va, mat4x4); + result.a = vaddq_f32(result.a, v.a); + result.b = vaddq_f32(result.b, v.b); + result.c = vaddq_f32(result.c, v.c); + result.d = vaddq_f32(result.d, v.d); + } + + va_end(va); + return result; +} + + +/** + * For aarch64-w64-mingw32 target, the Homogeneous Vector Aggregate (HVA) types + * are not treated specially. + * + * This is in contrast to to aarch64-linux-gnu target where float32x4n args + * would be loaded into 128 bit Q registers. + */ + + +/* +** main: +** ... +** ldr q\d+, \[x\d+, #:lo\d+:\.LC\d+\] +** str q\d+, \[sp, \d+\] +** ... +** ldr q\d+, \[x\d+, #:lo\d+:\.LC\d+\] +** str q\d+, \[sp, \d+\] +** ... +** ldr q\d+, \[x\d+, #:lo\d+:\.LC\d+\] +** str q\d+, \[sp, \d+\] +** ... +** ldr q\d+, \[x\d+, #:lo\d+:\.LC\d+\] +** str q\d+, \[sp, \d+\] +** ... +** ldr x\d+, \[sp, \d+\] +** ... +** ldr x\d+, \[sp, \d+\] +** ... +** ldr x\d+, \[sp, \d+\] +** ... +** ldr x\d+, \[sp, \d+\] +** ... +** ldr x\d+, \[sp, \d+\] +** ... +** ldr x\d+, \[sp, \d+\] +** ... +** ldr x\d+, \[sp, \d+\] +** ... +** ldr x\d+, \[sp, \d+\] +** ... +*/ +int main() +{ + float32x4_t x = {1.0, 2.0, 3.0, 4.0}; + float32x4_t y = {2.0, 3.0, 4.0, 5.0}; + float32x4_t z = {3.0, 4.0, 5.0, 6.0}; + float32x4_t w = {4.0, 5.0, 6.0, 7.0}; + + accumulate (4, x, y, z, w); + return 0; +}
\ No newline at end of file diff --git a/gcc/testsuite/gcc.target/aarch64/mingw/variadic_int.c b/gcc/testsuite/gcc.target/aarch64/mingw/variadic_int.c new file mode 100644 index 0000000..bb4e2f1 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/mingw/variadic_int.c @@ -0,0 +1,41 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-std=c99" } */ +/* { dg-final { check-function-bodies "**" "" } } */ + +#include <stdarg.h> + +/* +** sum: +** ... +** str w0, \[sp, \d+\] +** str x1, \[sp, \d+\] +** str x2, \[sp, \d+\] +** str x3, \[sp, \d+\] +** str x4, \[sp, \d+\] +** str x5, \[sp, \d+\] +** str x6, \[sp, \d+\] +** str x7, \[sp, \d+\] +** add x0, sp, \d+ +** sub x0, x0, #\d+ +** str x0, \[sp, \d+\] +** str wzr, \[sp, \d+\] +** str wzr, \[sp, \d+\] +** ... +*/ +int sum(int count, ...) { + va_list args; + + va_start(args, count); + + int total = 0; + for (int i = 0; i < count; i++) + { + total += va_arg(args, int); + } + + va_end(args); + + return total; +} + +/* { dg-final { scan-assembler-not "str\tq\[0-9\]+, \[sp, \[0-9\]+\]*" } } */
\ No newline at end of file diff --git a/gcc/testsuite/gcc.target/aarch64/pr116815-1.c b/gcc/testsuite/gcc.target/aarch64/pr116815-1.c new file mode 100644 index 0000000..f3bdb79 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/pr116815-1.c @@ -0,0 +1,120 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ +/* { dg-final { check-function-bodies "**" "" "" } } */ + +/* PR middle-end/116815 */ + +/* Single-use tests. */ + +static inline unsigned __attribute__ ((always_inline)) +max (unsigned a, unsigned b) +{ + return a > b ? a : b; +} + +static inline unsigned __attribute__ ((always_inline)) +min (unsigned a, unsigned b) +{ + return a < b ? a : b; +} + +#define OPERATION(op, type, N, exp1, exp2) \ + unsigned u##op##type##N (unsigned a, unsigned b) { return op (exp1, exp2); } + +/* +** umaxadd1: +** adds (w[0-9]+), w0, w1 +** csel w0, \1, w0, cc +** ret +*/ +OPERATION (max, add, 1, a, a + b) + +/* +** umaxadd2: +** adds (w[0-9]+), w0, w1 +** csel w0, \1, w0, cc +** ret +*/ +OPERATION (max, add, 2, a, b + a) + +/* +** umaxadd3: +** adds (w[0-9]+), w0, w1 +** csel w0, \1, w0, cc +** ret +*/ +OPERATION (max, add, 3, a + b, a) + +/* +** umaxadd4: +** adds (w[0-9]+), w0, w1 +** csel w0, \1, w0, cc +** ret +*/ +OPERATION (max, add, 4, b + a, a) + +/* +** uminadd1: +** adds (w[0-9]+), w0, w1 +** csel w0, \1, w0, cs +** ret +*/ +OPERATION (min, add, 1, a, a + b) + +/* +** uminadd2: +** adds (w[0-9]+), w0, w1 +** csel w0, \1, w0, cs +** ret +*/ +OPERATION (min, add, 2, a, b + a) + +/* +** uminadd3: +** adds (w[0-9]+), w0, w1 +** csel w0, \1, w0, cs +** ret +*/ +OPERATION (min, add, 3, a + b, a) + +/* +** uminadd4: +** adds (w[0-9]+), w0, w1 +** csel w0, \1, w0, cs +** ret +*/ +OPERATION (min, add, 4, b + a, a) + +/* sub requires the inverse of the comparison from add. */ + +/* +** umaxsub1: +** subs (w[0-9]+), w0, w1 +** csel w0, \1, w0, cc +** ret +*/ +OPERATION (max, sub, 1, a, a - b) + +/* +** umaxsub2: +** subs (w[0-9]+), w0, w1 +** csel w0, \1, w0, cc +** ret +*/ +OPERATION (max, sub, 2, a - b, a) + +/* +** uminsub1: +** subs (w[0-9]+), w0, w1 +** csel w0, \1, w0, cs +** ret +*/ +OPERATION (min, sub, 1, a, a - b) + +/* +** uminsub2: +** subs (w[0-9]+), w0, w1 +** csel w0, \1, w0, cs +** ret +*/ +OPERATION (min, sub, 2, a - b, a) diff --git a/gcc/testsuite/gcc.target/aarch64/pr116815-2.c b/gcc/testsuite/gcc.target/aarch64/pr116815-2.c new file mode 100644 index 0000000..015c868 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/pr116815-2.c @@ -0,0 +1,44 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +#pragma GCC target "+cssc" + +/* PR middle-end/116815 */ + +/* Make sure that umax/umin instructions are generated with CSSC. */ + +static inline unsigned __attribute__ ((always_inline)) +max (unsigned a, unsigned b) +{ + return a > b ? a : b; +} + +static inline unsigned __attribute__ ((always_inline)) +min (unsigned a, unsigned b) +{ + return a < b ? a : b; +} + +#define OPERATION(op, type, N, exp1, exp2) \ + unsigned u##op##type##N (unsigned a, unsigned b) { return op (exp1, exp2); } + +OPERATION (max, add, 1, a, a + b) +OPERATION (max, add, 2, a, b + a) +OPERATION (max, add, 3, a + b, a) +OPERATION (max, add, 4, b + a, a) + +OPERATION (min, add, 1, a, a + b) +OPERATION (min, add, 2, a, b + a) +OPERATION (min, add, 3, a + b, a) +OPERATION (min, add, 4, b + a, a) + +OPERATION (max, sub, 1, a, a - b) +OPERATION (max, sub, 2, a - b, a) + +OPERATION (min, sub, 1, a, a - b) +OPERATION (min, sub, 2, a - b, a) + +/* { dg-final { scan-assembler-times "umax\\t" 6 } } */ +/* { dg-final { scan-assembler-times "umin\\t" 6 } } */ +/* { dg-final { scan-assembler-not "adds\\t" } } */ +/* { dg-final { scan-assembler-not "subs\\t" } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/pr116815-3.c b/gcc/testsuite/gcc.target/aarch64/pr116815-3.c new file mode 100644 index 0000000..d262d21 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/pr116815-3.c @@ -0,0 +1,60 @@ +/* { dg-do run } */ +/* { dg-options "-O2" } */ + +/* PR middle-end/116815 */ + +/* Verify that the transformation gives correct results */ + +static inline unsigned __attribute__ ((always_inline)) +min (unsigned a, unsigned b) +{ + return (a < b) ? a : b; +} + +static inline unsigned __attribute__ ((always_inline)) +max (unsigned a, unsigned b) +{ + return (a > b) ? a : b; +} + +__attribute__ ((noipa)) unsigned +umaxadd (unsigned a, unsigned b) +{ + return max (a + b, a); +} + +__attribute__ ((noipa)) unsigned +umaxsub (unsigned a, unsigned b) +{ + return max (a - b, a); +} + +__attribute__ ((noipa)) unsigned +uminadd (unsigned a, unsigned b) +{ + return min (a + b, a); +} + +__attribute__ ((noipa)) unsigned +uminsub (unsigned a, unsigned b) +{ + return min (a - b, a); +} + +int +main () +{ + /* Overflows to 0x30000000. */ + if (umaxadd (0x90000000, 0xa0000000) != 0x90000000) + __builtin_abort (); + + if (uminadd (0x90000000, 0xa0000000) != 0x30000000) + __builtin_abort (); + + /* Underflows to 0x60000000. */ + if (umaxsub (0x00000000, 0xa0000000) != 0x60000000) + __builtin_abort (); + + if (uminsub (0x00000000, 0xa0000000) != 0x00000000) + __builtin_abort (); +} diff --git a/gcc/testsuite/gcc.target/aarch64/pr121853_1.c b/gcc/testsuite/gcc.target/aarch64/pr121853_1.c new file mode 100644 index 0000000..24b2fdc --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/pr121853_1.c @@ -0,0 +1,64 @@ +/* { dg-do run } */ +/* { dg-additional-options "-O2 -std=c99" } */ + +#include <stdint.h> +#include <stdio.h> +#include <string.h> + +__attribute__ ((noipa)) +float convert(__bf16 value) { + return (float)value; +} + +static inline uint32_t f32_bits(float f) { + uint32_t u; memcpy(&u, &f, sizeof u); return u; +} +static inline __bf16 bf16_from_bits(uint16_t u) { + __bf16 b; memcpy(&b, &u, sizeof b); return b; +} + +/* Fixed bf16 inputs (as raw 16-bit payloads) covering edge cases. */ +static const uint16_t inputs[] = { + 0x0000, // +0 + 0x8000, // -0 + 0x7F80, // +inf + 0xFF80, // -inf + 0x7FC0, // qNaN (+) (quiet bit set in bf16) + 0xFFC0, // qNaN (-) + 0x7F01, // sNaN (+) (will be quieted by conversion) + 0xFF01, // sNaN (-) + 0x0001, // smallest +subnormal + 0x007F, // largest +subnormal + 0x8001, // smallest -subnormal + 0x807F, // largest -subnormal + 0x0080, // smallest +normal + 0x3F80, // +1.0 + 0xBF80, // -1.0 + 0x3F00, // +0.5 + 0xBF00, // -0.5 + 0x3FC0, // +1.5 + 0x7F7F, // max finite + + 0xFF7F, // max finite - +}; + +int main(void) { + const size_t N = sizeof(inputs)/sizeof(inputs[0]); + size_t fails = 0; + + for (size_t i = 0; i < N; ++i) { + __bf16 in = bf16_from_bits(inputs[i]); + float out = convert(in); + uint32_t got = f32_bits(out); + uint32_t exp = inputs[i] << 16; + + if (got != exp) { + printf("FAIL[%zu]: in_bf16=0x%04X exp_f32=0x%08X got_f32=0x%08X\n", + i, inputs[i], exp, got); + ++fails; + } + } + + if (fails != 0) + __builtin_abort (); +} + diff --git a/gcc/testsuite/gcc.target/aarch64/pr121853_2.c b/gcc/testsuite/gcc.target/aarch64/pr121853_2.c new file mode 100644 index 0000000..e9fb401 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/pr121853_2.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-O1" } */ +/* { dg-final { check-function-bodies "**" "" } } */ + +float convert(__bf16 value) { + return (float)value; +} + +/* +** convert: +** movi v[0-9]+.4s, 0 +** ext v[0-9]+.16b, v[0-9]+.16b, v[0-9]+.16b, #14 +** ret +*/ diff --git a/gcc/testsuite/gcc.target/aarch64/pr122675-1.c b/gcc/testsuite/gcc.target/aarch64/pr122675-1.c new file mode 100644 index 0000000..8d2982a --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/pr122675-1.c @@ -0,0 +1,31 @@ +/* Verify that the most likely BB edges are optimized as fallthroughs. */ +/* { dg-do compile } */ +/* { dg-options "-O1 -fno-pic -mtune=generic -march=armv8-a" } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target *-*-* } {^\t?\.} } } */ + +/* +**test: +**.LFB[0-9]+: +** .cfi_startproc +**... +** cbz w0, .L[0-9]* +**... +** bl f1 +**... +** ret +**.L[0-9]+: +**... +** ret +**... +*/ + +int f1(void); + +int test(int a) +{ + if (__builtin_expect(!!a, 1)) { + return f1(); + } + return a; +} diff --git a/gcc/testsuite/gcc.target/aarch64/pr122763.c b/gcc/testsuite/gcc.target/aarch64/pr122763.c new file mode 100644 index 0000000..bd90c66 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/pr122763.c @@ -0,0 +1,75 @@ +/* { dg-do compile } */ +/* { dg-options "-std=gnu99 " } */ +/* { dg-additional-options "-O -fno-schedule-insns -fno-schedule-insns2 " } */ +/* { dg-final { check-function-bodies "**" "" "" } } */ +/* { dg-skip-if "" { *-*-mingw* } } */ + +typedef struct es {} Empty; + +__attribute__ ((__noinline__)) void +aarchpcs_overflow (int, int, int, int, int, int, int, int, Empty); + +/* +**aarchpcs_overflow_call: +** ... +** mov w7, 7 +** mov w6, 6 +** mov w5, 5 +** mov w4, 4 +** mov w3, 3 +** mov w2, 2 +** mov w1, 1 +** mov w0, 0 +** bl aarchpcs_overflow +** ... +*/ + +void +aarchpcs_overflow_call (void) +{ + Empty e; + aarchpcs_overflow (0, 1, 2, 3, 4, 5, 6, 7, e); +} + +__attribute__ ((__noinline__, preserve_none)) void +preserve_none_overflow (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, Empty); + +/* +**preserve_none_overflow_call: +** ... +** mov w15, 23 +** mov w9, 22 +** mov w14, 21 +** mov w13, 20 +** mov w12, 19 +** mov w11, 18 +** mov w10, 17 +** mov w7, 16 +** mov w6, 15 +** mov w5, 14 +** mov w4, 13 +** mov w3, 12 +** mov w2, 11 +** mov w1, 10 +** mov w0, 9 +** mov w28, 8 +** mov w27, 7 +** mov w26, 6 +** mov w25, 5 +** mov w24, 4 +** mov w23, 3 +** mov w22, 2 +** mov w21, 1 +** mov w20, 0 +** ... +** bl preserve_none_overflow +** ... +*/ + +__attribute__ ((preserve_none)) void +preserve_none_overflow_call (void) +{ + Empty e; + preserve_none_overflow(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, e); +} + diff --git a/gcc/testsuite/gcc.target/aarch64/pr123026.c b/gcc/testsuite/gcc.target/aarch64/pr123026.c new file mode 100644 index 0000000..4dcce8a --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/pr123026.c @@ -0,0 +1,21 @@ +/* { dg-do run } */ +/* { dg-additional-options "-O3 -march=armv8-a -std=c99" } */ + +#include <stdbool.h> + +int g; + +__attribute__ ((noipa)) void +foo(bool a) { + for (int i = 0; i < 4; i++) + if (!i || a) + g += 1; +} + +int main() +{ + foo(0); + if (g != 1) + __builtin_abort(); + return 0; +} diff --git a/gcc/testsuite/gcc.target/aarch64/preserve_none_1.c b/gcc/testsuite/gcc.target/aarch64/preserve_none_1.c new file mode 100644 index 0000000..1390173 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/preserve_none_1.c @@ -0,0 +1,143 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fno-schedule-insns2" } */ +/* { dg-final { check-function-bodies "**" "" "" } } */ +/* { dg-skip-if "" { *-*-mingw* } } */ + +void normal_callee(); +void preserve_none_callee() [[gnu::preserve_none]]; + +#pragma GCC target "+sve" + +/* +** preserve_none_caller1: +** ?#APP +** nop +** ?#NO_APP +** ret +*/ +void preserve_none_caller1() [[gnu::preserve_none]] +{ + asm volatile ("nop" ::: "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7", + "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15", + "x16", "x17", "x18", "x19", "x20", "x21", "x22", "x23", + "x24", "x25", "x26", "x27", "x28", + + "z0", "z1", "z2", "z3", "z4", "z5", "z6", "z7", + "z8", "z9", "z10", "z11", "z12", "z13", "z14", "z15", + "z16", "z17", "z18", "z19", "z20", "z21", "z22", "z23", + "z24", "z25", "z26", "z27", "z28", "z29", "z30", "z31", + + "p0", "p1", "p2", "p3", "p4", "p5", "p6", "p7", + "p8", "p9", "p10", "p11", "p12", "p13", "p14", "p15"); +} + +/* +** preserve_none_caller2: +** stp x29, x30, \[sp, #?-16\]! +** mov x29, sp +** bl normal_callee +** mov w0, w20 +** ldp x29, x30, \[sp\], #?16 +** ret +*/ +int preserve_none_caller2(int x) [[gnu::preserve_none]] +{ + normal_callee(); + return x; +} + +/* +** preserve_none_caller3: +** stp x29, x30, \[sp, #?-32\]! +** mov x29, sp +** str w20, \[sp, #?[0-9]+\] +** bl preserve_none_callee +** ldr w0, \[sp, #?[0-9]+\] +** ldp x29, x30, \[sp\], #?32 +** ret +*/ +int preserve_none_caller3(int x) [[gnu::preserve_none]] +{ + preserve_none_callee(); + return x; +} + +/* +** preserve_none_caller4: +** b preserve_none_callee +*/ +void preserve_none_caller4() [[gnu::preserve_none]] +{ + preserve_none_callee(); +} + +/* +** preserve_none_caller5: +** b preserve_none_callee +*/ +void preserve_none_caller5(__SVBool_t x) [[gnu::preserve_none]] +{ + preserve_none_callee(); +} + +/* +** normal_caller1: +** stp x29, x30, \[sp, #?-160\]! +** mov x29, sp +** stp x19, x20, \[sp, #?16\] +** stp x21, x22, \[sp, #?32\] +** stp x23, x24, \[sp, #?48\] +** stp x25, x26, \[sp, #?64\] +** stp x27, x28, \[sp, #?80\] +** stp d8, d9, \[sp, #?96\] +** stp d10, d11, \[sp, #?112\] +** stp d12, d13, \[sp, #?128\] +** stp d14, d15, \[sp, #?144\] +** bl preserve_none_callee +** ldp d8, d9, \[sp, #?96\] +** ldp d10, d11, \[sp, #?112\] +** ldp d12, d13, \[sp, #?128\] +** ldp d14, d15, \[sp, #?144\] +** ldp x19, x20, \[sp, #?16\] +** ldp x21, x22, \[sp, #?32\] +** ldp x23, x24, \[sp, #?48\] +** ldp x25, x26, \[sp, #?64\] +** ldp x27, x28, \[sp, #?80\] +** ldp x29, x30, \[sp\], #?160 +** ret +*/ +void normal_caller1() +{ + preserve_none_callee(); +} + +/* +** normal_caller2: +** stp x29, x30, \[sp, #?-160\]! +** mov x29, sp +** stp x19, x20, \[sp, #?16\] +** stp x21, x22, \[sp, #?32\] +** stp x23, x24, \[sp, #?48\] +** stp x25, x26, \[sp, #?64\] +** stp x27, x28, \[sp, #?80\] +** stp d8, d9, \[sp, #?96\] +** stp d10, d11, \[sp, #?112\] +** stp d12, d13, \[sp, #?128\] +** stp d14, d15, \[sp, #?144\] +** blr x0 +** ldp d8, d9, \[sp, #?96\] +** ldp d10, d11, \[sp, #?112\] +** ldp d12, d13, \[sp, #?128\] +** ldp d14, d15, \[sp, #?144\] +** ldp x19, x20, \[sp, #?16\] +** ldp x21, x22, \[sp, #?32\] +** ldp x23, x24, \[sp, #?48\] +** ldp x25, x26, \[sp, #?64\] +** ldp x27, x28, \[sp, #?80\] +** ldp x29, x30, \[sp\], #?160 +** ret +*/ +void normal_caller2(void (*callee)() [[gnu::preserve_none]]) +{ + callee(); +} diff --git a/gcc/testsuite/gcc.target/aarch64/preserve_none_2.c b/gcc/testsuite/gcc.target/aarch64/preserve_none_2.c new file mode 100644 index 0000000..1bb89e0 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/preserve_none_2.c @@ -0,0 +1,49 @@ +/* { dg-options "" } */ + +void multi1() [[gnu::aarch64_vector_pcs, gnu::preserve_none]]; /* { dg-warning {ignoring attribute 'preserve_none' because it conflicts} } */ +void multi2() [[gnu::preserve_none, gnu::aarch64_vector_pcs]]; /* { dg-warning {ignoring attribute 'aarch64_vector_pcs' because it conflicts} } */ + +void normal_callee(); +void preserve_none_callee() [[gnu::preserve_none]]; +void vector_callee() [[gnu::aarch64_vector_pcs]]; +void sve_callee(__SVBool_t); +void sve_preserve_none_callee(__SVBool_t) [[gnu::preserve_none]]; + +void (*normal_ptr)(); +void (*preserve_none_ptr)() [[gnu::preserve_none]]; +void (*vector_ptr)() [[gnu::aarch64_vector_pcs]]; +void (*sve_ptr)(__SVBool_t); +void (*sve_preserve_none_ptr)(__SVBool_t) [[gnu::preserve_none]]; + +void f() +{ + normal_ptr = normal_callee; + normal_ptr = preserve_none_callee; /* { dg-error {incompatible pointer type} } */ + normal_ptr = vector_callee; /* { dg-error {incompatible pointer type} } */ + normal_ptr = sve_callee; /* { dg-error {incompatible pointer type} } */ + normal_ptr = sve_preserve_none_callee; /* { dg-error {incompatible pointer type} } */ + + preserve_none_ptr = normal_callee; /* { dg-error {incompatible pointer type} } */ + preserve_none_ptr = preserve_none_callee; + preserve_none_ptr = vector_callee; /* { dg-error {incompatible pointer type} } */ + preserve_none_ptr = sve_callee; /* { dg-error {incompatible pointer type} } */ + preserve_none_ptr = sve_preserve_none_callee; /* { dg-error {incompatible pointer type} } */ + + vector_ptr = normal_callee; /* { dg-error {incompatible pointer type} } */ + vector_ptr = preserve_none_callee; /* { dg-error {incompatible pointer type} } */ + vector_ptr = vector_callee; + vector_ptr = sve_callee; /* { dg-error {incompatible pointer type} } */ + vector_ptr = sve_preserve_none_callee; /* { dg-error {incompatible pointer type} } */ + + sve_ptr = normal_callee; /* { dg-error {incompatible pointer type} } */ + sve_ptr = preserve_none_callee; /* { dg-error {incompatible pointer type} } */ + sve_ptr = vector_callee; /* { dg-error {incompatible pointer type} } */ + sve_ptr = sve_callee; + sve_ptr = sve_preserve_none_callee; /* { dg-error {incompatible pointer type} } */ + + sve_preserve_none_ptr = normal_callee; /* { dg-error {incompatible pointer type} } */ + sve_preserve_none_ptr = preserve_none_callee; /* { dg-error {incompatible pointer type} } */ + sve_preserve_none_ptr = vector_callee; /* { dg-error {incompatible pointer type} } */ + sve_preserve_none_ptr = sve_callee; /* { dg-error {incompatible pointer type} } */ + sve_preserve_none_ptr = sve_preserve_none_callee; +} diff --git a/gcc/testsuite/gcc.target/aarch64/preserve_none_3.c b/gcc/testsuite/gcc.target/aarch64/preserve_none_3.c new file mode 100644 index 0000000..0258177 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/preserve_none_3.c @@ -0,0 +1,114 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -std=gnu23" } */ + +int no_arg_stack_use_callee + [[gnu::preserve_none, gnu::noinline, + gnu::noipa]] (int a0, int a1, int a2, int a3, int a4, int a5, int a6, + int a7, int a8, int a9, int a10, int a11, int a12, int a13, + int a14, int a15, int a16, int a17, int a18, int a19, int a20, + int a21, int a22, int a23) +{ + /* Clobber all the registers to check they are correctly marked live at the + start. */ + asm volatile("mov x0, #0;" + "mov x1, #0;" + "mov x2, #0;" + "mov x3, #0;" + "mov x4, #0;" + "mov x5, #0;" + "mov x6, #0;" + "mov x7, #0;" + "mov x8, #0;" + "mov x9, #0;" + "mov x10, #0;" + "mov x11, #0;" + "mov x12, #0;" + "mov x13, #0;" + "mov x14, #0;" + "mov x15, #0;" + "mov x16, #0;" + "mov x17, #0;" + "mov x18, #0;" + "mov x19, #0;" + "mov x20, #0;" + "mov x21, #0;" + "mov x22, #0;" + "mov x23, #0;" + "mov x24, #0;" + "mov x25, #0;" + "mov x26, #0;" + "mov x27, #0;" + "mov x28, #0;" :: + : "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8", "x9", + "x10", "x11", "x12", "x13", "x14", "x15", "x16", "x17", + "x18", "x19", "x20", "x21", "x22", "x23", "x24", "x25", + "x26", "x27", "x28"); + + return a0 + a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8 + a9 + a10 + a11 + a12 + a13 + + a14 + a15 + a16 + a17 + a18 + a19 + a20 + a21 + a22 + a23; +} + +int arg_stack_use_callee + [[gnu::preserve_none, gnu::noinline, + gnu::noipa]] (int a0, int a1, int a2, int a3, int a4, int a5, int a6, + int a7, int a8, int a9, int a10, int a11, int a12, int a13, + int a14, int a15, int a16, int a17, int a18, int a19, int a20, + int a21, int a22, int a23, int a24) +{ + /* Clobber all the registers to check they are correctly marked live at the + start. */ + asm volatile("mov x0, #0;" + "mov x1, #0;" + "mov x2, #0;" + "mov x3, #0;" + "mov x4, #0;" + "mov x5, #0;" + "mov x6, #0;" + "mov x7, #0;" + "mov x8, #0;" + "mov x9, #0;" + "mov x10, #0;" + "mov x11, #0;" + "mov x12, #0;" + "mov x13, #0;" + "mov x14, #0;" + "mov x15, #0;" + "mov x16, #0;" + "mov x17, #0;" + "mov x18, #0;" + "mov x19, #0;" + "mov x20, #0;" + "mov x21, #0;" + "mov x22, #0;" + "mov x23, #0;" + "mov x24, #0;" + "mov x25, #0;" + "mov x26, #0;" + "mov x27, #0;" + "mov x28, #0;" :: + : "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8", "x9", + "x10", "x11", "x12", "x13", "x14", "x15", "x16", "x17", + "x18", "x19", "x20", "x21", "x22", "x23", "x24", "x25", + "x26", "x27", "x28"); + + return a0 + a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8 + a9 + a10 + a11 + a12 + a13 + + a14 + a15 + a16 + a17 + a18 + a19 + a20 + a21 + a22 + a23 + a24; +} + +int +main () +{ + int res = no_arg_stack_use_callee (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23); + + if (res != 23 * 24 / 2) + return 1; + + res = arg_stack_use_callee (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); + + if (res != 24 * 25 / 2) + return 1; + + return 0; +} diff --git a/gcc/testsuite/gcc.target/aarch64/preserve_none_4.c b/gcc/testsuite/gcc.target/aarch64/preserve_none_4.c new file mode 100644 index 0000000..fc8347d --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/preserve_none_4.c @@ -0,0 +1,99 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fno-schedule-insns2" } */ +/* { dg-final { check-function-bodies "**" "" "" } } */ +/* { dg-skip-if "" { *-*-mingw* } } */ + +int no_arg_stack_use_callee + [[gnu::preserve_none, gnu::noinline, + gnu::noipa]] (int a0, int a1, int a2, int a3, int a4, int a5, int a6, + int a7, int a8, int a9, int a10, int a11, int a12, int a13, + int a14, int a15, int a16, int a17, int a18, int a19, int a20, + int a21, int a22, int a24); + +/* Check the pcs argument order is correct. Should be x20-28, x0-7, x10-14, x9, + * x15 and that the return arg is x0 */ + +/* +** no_arg_stack_use_caller: +** ... +** mov w15, 23 +** mov w9, 22 +** mov w14, 21 +** mov w13, 20 +** mov w12, 19 +** mov w11, 18 +** mov w10, 17 +** mov w7, 16 +** mov w6, 15 +** mov w5, 14 +** mov w4, 13 +** mov w3, 12 +** mov w2, 11 +** mov w1, 10 +** mov w0, 9 +** mov w28, 8 +** mov w27, 7 +** mov w26, 6 +** mov w25, 5 +** mov w24, 4 +** mov w23, 3 +** mov w22, 2 +** mov w21, 1 +** mov w20, 0 +** bl no_arg_stack_use_callee +** add w0, w0, 1 +** ... +*/ +int no_arg_stack_use_caller [[gnu::preserve_none]] () +{ + return no_arg_stack_use_callee (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23) + + 1; +} + +int arg_stack_use_callee + [[gnu::preserve_none, gnu::noinline, + gnu::noipa]] (int a0, int a1, int a2, int a3, int a4, int a5, int a6, + int a7, int a8, int a9, int a10, int a11, int a12, int a13, + int a14, int a15, int a16, int a17, int a18, int a19, int a20, + int a21, int a22, int a23, int a24); + +/* +** arg_stack_use_caller: +** ... +** mov w0, 24 +** mov w15, 23 +** mov w9, 22 +** mov w14, 21 +** mov w13, 20 +** mov w12, 19 +** mov w11, 18 +** mov w10, 17 +** mov w7, 16 +** mov w6, 15 +** mov w5, 14 +** mov w4, 13 +** mov w3, 12 +** mov w2, 11 +** mov w1, 10 +** mov w28, 8 +** mov w27, 7 +** mov w26, 6 +** mov w25, 5 +** mov w24, 4 +** mov w23, 3 +** mov w22, 2 +** mov w21, 1 +** mov w20, 0 +** str w0, \[sp\] +** mov w0, 9 +** bl arg_stack_use_callee +** add w0, w0, 1 +** ... +*/ +int arg_stack_use_caller [[gnu::preserve_none]] () +{ + return arg_stack_use_callee (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) + + 1; +} diff --git a/gcc/testsuite/gcc.target/aarch64/preserve_none_5.c b/gcc/testsuite/gcc.target/aarch64/preserve_none_5.c new file mode 100644 index 0000000..d11bf10 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/preserve_none_5.c @@ -0,0 +1,47 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fno-schedule-insns2" } */ +/* { dg-final { check-function-bodies "**" "" "" } } */ +/* { dg-skip-if "" { *-*-mingw* } } */ + +#include <stdarg.h> +int foo [[gnu::preserve_none]] (...); + +/* Check the pcs argument order is correct. Should be x20-28, x0-7, x10-14, x9, x15 and that the return arg is x0 */ + +/* +** bar: +** ... +** mov w15, 23 +** mov w9, 22 +** mov w14, 21 +** mov w13, 20 +** mov w12, 19 +** mov w11, 18 +** mov w10, 17 +** mov w7, 16 +** mov w6, 15 +** mov w5, 14 +** mov w4, 13 +** mov w3, 12 +** mov w2, 11 +** mov w1, 10 +** mov w0, 9 +** mov w28, 8 +** mov w27, 7 +** mov w26, 6 +** mov w25, 5 +** mov w24, 4 +** mov w23, 3 +** mov w22, 2 +** mov w21, 1 +** mov w20, 0 +** bl foo +** add w0, w0, 1 +** ... +*/ +int bar [[gnu::preserve_none]] () +{ + return foo (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23) + + 1; +} diff --git a/gcc/testsuite/gcc.target/aarch64/preserve_none_6.c b/gcc/testsuite/gcc.target/aarch64/preserve_none_6.c new file mode 100644 index 0000000..687e30a --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/preserve_none_6.c @@ -0,0 +1,76 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -std=gnu23" } */ + +#include <stdarg.h> +#include <stdio.h> + +int preserve_none_va_func + [[gnu::preserve_none, gnu::noinline, gnu::noclone]] (int count, ...) +{ + asm volatile("mov x0, #0;" + "mov x1, #0;" + "mov x2, #0;" + "mov x3, #0;" + "mov x4, #0;" + "mov x5, #0;" + "mov x6, #0;" + "mov x7, #0;" + "mov x8, #0;" + "mov x9, #0;" + "mov x10, #0;" + "mov x11, #0;" + "mov x12, #0;" + "mov x13, #0;" + "mov x14, #0;" + "mov x15, #0;" + "mov x16, #0;" + "mov x17, #0;" + "mov x18, #0;" + "mov x19, #0;" + "mov x20, #0;" + "mov x21, #0;" + "mov x22, #0;" + "mov x23, #0;" + "mov x24, #0;" + "mov x25, #0;" + "mov x26, #0;" + "mov x27, #0;" + "mov x28, #0;" :: + : "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8", "x9", + "x10", "x11", "x12", "x13", "x14", "x15", "x16", "x17", + "x18", "x19", "x20", "x21", "x22", "x23", "x24", "x25", + "x26", "x27", "x28"); + + int sum = 0; + + va_list args; + + va_start (args, count); + for (int i = 0; i < count; i++) + sum += va_arg (args, int); + va_end (args); + + return sum; +} + +int +main () +{ + int res = preserve_none_va_func (23, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22); + if (res != 23 * 22 / 2) + return 1; + + res = preserve_none_va_func (24, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23); + + if (res != 24 * 23 / 2) + return 1; + + res = preserve_none_va_func (25, 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); + if (res != 25 * 24 / 2) + return 1; + + return 0; +} diff --git a/gcc/testsuite/gcc.target/aarch64/preserve_none_mingw_1.c b/gcc/testsuite/gcc.target/aarch64/preserve_none_mingw_1.c new file mode 100644 index 0000000..11703c8 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/preserve_none_mingw_1.c @@ -0,0 +1,93 @@ +/* { dg-do compile { target aarch64*-*-mingw* } } */ +/* { dg-options "-O2 -fno-schedule-insns2" } */ +/* { dg-final { check-function-bodies "**" "" "" } } */ + +int no_arg_stack_use_callee [[gnu::preserve_none, gnu::noinline, gnu::noipa]] + (int a0, int a1, int a2, int a3, int a4, int a5, int a6, + int a7, int a8, int a9, int a10, int a11, int a12, + int a13, int a14, int a15, int a16, int a17, int a18, + int a19, int a20, int a21, int a22); + +/* Check the pcs argument order is correct. Should be x20-28, x0-7, x10-14, x9, and that the return arg is x0 */ + +/* +** no_arg_stack_use_caller: +** ... +** mov w9, 22 +** mov w14, 21 +** mov w13, 20 +** mov w12, 19 +** mov w11, 18 +** mov w10, 17 +** mov w7, 16 +** mov w6, 15 +** mov w5, 14 +** mov w4, 13 +** mov w3, 12 +** mov w2, 11 +** mov w1, 10 +** mov w0, 9 +** mov w28, 8 +** mov w27, 7 +** mov w26, 6 +** mov w25, 5 +** mov w24, 4 +** mov w23, 3 +** mov w22, 2 +** mov w21, 1 +** mov w20, 0 +** bl no_arg_stack_use_callee +** add w0, w0, 1 +** ... +*/ +int no_arg_stack_use_caller [[gnu::preserve_none]] () +{ + return no_arg_stack_use_callee (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22) + + 1; +} + +int arg_stack_use_callee [[gnu::preserve_none, gnu::noinline, gnu::noipa]] + (int a0, int a1, int a2, int a3, int a4, int a5, int a6, + int a7, int a8, int a9, int a10, int a11, int a12, + int a13, int a14, int a15, int a16, int a17, int a18, + int a19, int a20, int a21, int a22, int a23); + +/* +** arg_stack_use_caller: +** ... +** mov w0, 23 +** mov w9, 22 +** mov w14, 21 +** mov w13, 20 +** mov w12, 19 +** mov w11, 18 +** mov w10, 17 +** mov w7, 16 +** mov w6, 15 +** mov w5, 14 +** mov w4, 13 +** mov w3, 12 +** mov w2, 11 +** mov w1, 10 +** mov w28, 8 +** mov w27, 7 +** mov w26, 6 +** mov w25, 5 +** mov w24, 4 +** mov w23, 3 +** mov w22, 2 +** mov w21, 1 +** mov w20, 0 +** str w0, \[sp\] +** mov w0, 9 +** bl arg_stack_use_callee +** add w0, w0, 1 +** ... +*/ +int arg_stack_use_caller [[gnu::preserve_none]] () +{ + return arg_stack_use_callee (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23) + + 1; +} diff --git a/gcc/testsuite/gcc.target/aarch64/simd/combine_ext.c b/gcc/testsuite/gcc.target/aarch64/simd/combine_ext.c new file mode 100644 index 0000000..f10a2c6 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/simd/combine_ext.c @@ -0,0 +1,46 @@ +/* { dg-do compile } */ +/* { dg-options "-O1 -fdump-tree-optimized" } */ + +#include <arm_neon.h> + +#ifndef TEST_COMBINE_HIGH_LOW_1 +#define TEST_COMBINE_HIGH_LOW_1(TYPE, SUFF) \ + TYPE rev_##TYPE##_1 (TYPE x) \ + { \ + return vcombine_##SUFF (vget_high_##SUFF (x), vget_low_##SUFF (x)); \ + } +#endif + +#ifndef TEST_COMBINE_HIGH_LOW_2 +#define TEST_COMBINE_HIGH_LOW_2(TYPE, SUFF) \ + TYPE rev_##TYPE##_2 (TYPE x, TYPE y) \ + { \ + return vcombine_##SUFF (vget_high_##SUFF (x), vget_low_##SUFF (y)); \ + } +#endif + +TEST_COMBINE_HIGH_LOW_1 (int8x16_t, s8) +TEST_COMBINE_HIGH_LOW_1 (int16x8_t, s16) +TEST_COMBINE_HIGH_LOW_1 (int32x4_t, s32) +TEST_COMBINE_HIGH_LOW_1 (int64x2_t, s64) +TEST_COMBINE_HIGH_LOW_1 (uint8x16_t, u8) +TEST_COMBINE_HIGH_LOW_1 (uint16x8_t, u16) +TEST_COMBINE_HIGH_LOW_1 (uint32x4_t, u32) +TEST_COMBINE_HIGH_LOW_1 (uint64x2_t, u64) +TEST_COMBINE_HIGH_LOW_1 (float16x8_t, f16) +TEST_COMBINE_HIGH_LOW_1 (float32x4_t, f32) + +TEST_COMBINE_HIGH_LOW_2 (int8x16_t, s8) +TEST_COMBINE_HIGH_LOW_2 (int16x8_t, s16) +TEST_COMBINE_HIGH_LOW_2 (int32x4_t, s32) +TEST_COMBINE_HIGH_LOW_2 (int64x2_t, s64) +TEST_COMBINE_HIGH_LOW_2 (uint8x16_t, u8) +TEST_COMBINE_HIGH_LOW_2 (uint16x8_t, u16) +TEST_COMBINE_HIGH_LOW_2 (uint32x4_t, u32) +TEST_COMBINE_HIGH_LOW_2 (uint64x2_t, u64) +TEST_COMBINE_HIGH_LOW_2 (float16x8_t, f16) +TEST_COMBINE_HIGH_LOW_2 (float32x4_t, f32) + +/* { dg-final { scan-tree-dump-times "VEC_PERM_EXPR" 20 "optimized" } } */ +/* { dg-final { scan-assembler-times {ext\tv0.16b, v0.16b, v0.16b, #8} 10 } } */ +/* { dg-final { scan-assembler-times {ext\tv0.16b, v0.16b, v1.16b, #8} 10 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/simd/fold_to_highpart_6.c b/gcc/testsuite/gcc.target/aarch64/simd/fold_to_highpart_6.c index 3570d4d..83ef214 100644 --- a/gcc/testsuite/gcc.target/aarch64/simd/fold_to_highpart_6.c +++ b/gcc/testsuite/gcc.target/aarch64/simd/fold_to_highpart_6.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-require-effective-target aarch64_little_endian } */ /* { dg-options "-O2 -march=armv8-a+sve" } */ +/* { dg-final { check-function-bodies "**" "" } } */ #include <arm_neon_sve_bridge.h> @@ -16,6 +17,11 @@ test_addressable () return vmovl_s8 (vget_high_s8 (z)); } +/* +** test_scalable_type: +** sxtl2 v0.8h, v0.16b +** ret +*/ int16x8_t test_scalable_type (svint8_t scalable) { @@ -34,4 +40,5 @@ test_256b_type (int16x16_t foo) return vmovl_s16 ((int16x4_t) { foo[4], foo[5], foo[6], foo[7] }); } -/* { dg-final { scan-assembler-not {sxtl2\t} } } */ +/* { dg-final { scan-assembler-times {sxtl2\t} 1 } } */ +/* { dg-final { scan-assembler-times {sxtl\t} 3 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/simd/usubl2.c b/gcc/testsuite/gcc.target/aarch64/simd/usubl2.c new file mode 100644 index 0000000..442b922 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/simd/usubl2.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +#include <arm_neon.h> + +void foo(int16_t *dst, const uint8_t *src0, const uint8_t *src1) +{ + uint8x16_t s0 = vld1q_u8 (src0); + uint8x16_t s1 = vld1q_u8 (src1); + + uint16x8_t d0_lo = vsubl_u8 (vget_low_u8 (s0), vget_low_u8 (s1)); + uint16x8_t d0_hi = vsubl_u8 (vget_high_u8 (s0), vget_high_u8 (s1)); + + vst1q_s16 (dst, vreinterpretq_s16_u16 (d0_lo)); + vst1q_s16 (dst + 8, vreinterpretq_s16_u16 (d0_hi)); +} + +/* { dg-final { scan-assembler "usubl\tv\[0-9\]+\.8h,\ v\[0-9\]+\.8b,\ v\[0-9\]+\.8b" } } */ +/* { dg-final { scan-assembler "usubl2\tv\[0-9\]+\.8h,\ v\[0-9\]+\.16b,\ v\[0-9\]+\.16b" } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/gnu_vectors_1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/gnu_vectors_1.c index 32bb826..3f39e6e 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/gnu_vectors_1.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/gnu_vectors_1.c @@ -5,9 +5,12 @@ typedef uint8_t gnu_uint8_t __attribute__ ((vector_size (32))); typedef int8_t gnu_int8_t __attribute__ ((vector_size (32))); +typedef int32_t gnu128_int32_t __attribute__ ((vector_size (128))); +typedef int32_t gnu32_int32_t __attribute__ ((vector_size (32))); + void -f (svuint8_t sve_u1, svint8_t sve_s1, - gnu_uint8_t gnu_u1, gnu_int8_t gnu_s1, int n, unsigned char uc) +f (svuint8_t sve_u1, svint8_t sve_s1, svbool_t sve_b1, svbool_t sve_b2, + gnu_uint8_t gnu_u1, gnu_int8_t gnu_s1, gnu128_int32_t gnu128_s1, int n, unsigned char uc) { /* Initialization. */ @@ -19,6 +22,15 @@ f (svuint8_t sve_u1, svint8_t sve_s1, svuint8_t init_sve_u6 = { gnu_s1 }; /* { dg-error {incompatible types when initializing type 'unsigned char'} } */ svuint8_t init_sve_u7 = { 0 }; + /* Boolean inits. */ + svbool_t init_sve_b1 = 0; /* { dg-error {incompatible types when initializing type 'svbool_t' using type 'int'} } */ + svbool_t init_sve_b2 = {}; + svbool_t init_sve_b3 = { sve_b1 }; /* { dg-error {incompatible types when initializing type 'signed char:1'} } */ + svbool_t init_sve_b4 = { gnu_u1 }; /* { dg-error {incompatible types when initializing type 'signed char:1'} } */ + svbool_t init_sve_b5 = { sve_s1 }; /* { dg-error {incompatible types when initializing type 'signed char:1'} } */ + svbool_t init_sve_b6 = { gnu_s1 }; /* { dg-error {incompatible types when initializing type 'signed char:1'} } */ + svbool_t init_sve_b7 = { 0 }; + svuint8_t init_sve_u8 = { sve_u1, sve_u1 }; /* { dg-error {incompatible types when initializing type 'unsigned char'} } */ svuint8_t init_sve_u9 = { gnu_u1, gnu_u1 }; /* { dg-error {incompatible types when initializing type 'unsigned char'} } */ @@ -30,6 +42,11 @@ f (svuint8_t sve_u1, svint8_t sve_s1, gnu_uint8_t init_gnu_u6 = { gnu_s1 }; /* { dg-error {incompatible types when initializing type 'unsigned char'} } */ gnu_uint8_t init_gnu_u7 = { 0 }; + /* Boolean inits. */ + svbool_t init_sve_b8 = { sve_u1, sve_u1 }; /* { dg-error {incompatible types when initializing type 'signed char:1'} } */ + svbool_t init_sve_b9 = { gnu_u1, gnu_u1 }; /* { dg-error {incompatible types when initializing type 'signed char:1'} } */ + gnu_uint8_t init_gnu_u8 = { sve_b1 }; /* { dg-error {incompatible types when initializing type 'unsigned char'} } */ + /* Compound literals. */ (svuint8_t) {}; @@ -44,6 +61,16 @@ f (svuint8_t sve_u1, svint8_t sve_s1, (gnu_uint8_t) { sve_u1 }; /* { dg-error {incompatible types when initializing type 'unsigned char'} } */ (gnu_uint8_t) { gnu_u1 }; /* { dg-error {incompatible types when initializing type 'unsigned char'} } */ + /* Boolean compound literals. */ + (svbool_t) {}; + (svbool_t) { 0 }; + (svbool_t) { sve_b1 }; /* { dg-error {incompatible types when initializing type 'signed char:1'} } */ + (svbool_t) { gnu_u1 }; /* { dg-error {incompatible types when initializing type 'signed char:1'} } */ + (svbool_t) { sve_s1 }; /* { dg-error {incompatible types when initializing type 'signed char:1'} } */ + (svbool_t) { sve_u1 }; /* { dg-error {incompatible types when initializing type 'signed char:1'} } */ + (svbool_t) { gnu_s1 }; /* { dg-error {incompatible types when initializing type 'signed char:1'} } */ + (gnu_uint8_t) { sve_b1 }; /* { dg-error {incompatible types when initializing type 'unsigned char'} } */ + /* Assignment. */ sve_u1 = 0; /* { dg-error {incompatible types when assigning to type 'svuint8_t' from type 'int'} } */ @@ -58,6 +85,14 @@ f (svuint8_t sve_u1, svint8_t sve_s1, gnu_u1 = sve_s1; /* { dg-error {incompatible types when assigning to type 'gnu_uint8_t'[^\n]* from type 'svint8_t'} } */ gnu_u1 = gnu_s1; /* { dg-error {incompatible types when assigning to type 'gnu_uint8_t'[^\n]* from type 'gnu_int8_t'} } */ + /* Boolean Assignments. */ + + sve_b1 = 0; /* { dg-error {incompatible types when assigning to type 'svbool_t' from type 'int'} } */ + sve_b1 = sve_b1; + sve_b1 = sve_s1; /* { dg-error {incompatible types when assigning to type 'svbool_t' from type 'svint8_t'} } */ + sve_b1 = gnu_s1; /* { dg-error {incompatible types when assigning to type 'svbool_t' from type 'gnu_int8_t'} } */ + gnu_u1 = sve_b1; /* { dg-error {incompatible types when assigning to type 'gnu_uint8_t'[^\n]* from type 'svbool_t'} } */ + /* Casts. */ (void) sve_u1; @@ -76,6 +111,19 @@ f (svuint8_t sve_u1, svint8_t sve_s1, (gnu_int8_t) sve_u1; (gnu_int8_t) gnu_u1; + /* Boolean casts. */ + (void) sve_b1; + (svbool_t) sve_b1; + (svbool_t) gnu_u1; /* { dg-error {cannot convert a value of type 'gnu_uint8_t'} } */ + (svbool_t) sve_u1; /* { dg-error {cannot convert a value of type 'svuint8_t'} } */ + (svbool_t) 0; /* This is OK. sizeof (svbool_t) == sizeof (int) for VL == 256. */ + (svbool_t) n; /* This is OK. sizeof (svbool_t) == sizeof (int) for VL == 256. */ + (svbool_t) (short)0; /* { dg-error {cannot convert a value of type 'short int'} } */ + (svbool_t) (short)n; /* { dg-error {cannot convert a value of type 'short int'} } */ + (svint8_t) sve_b1; /* { dg-error {cannot convert a value of type 'svbool_t'} } */ + (gnu_uint8_t) sve_b1; /* { dg-error {cannot convert a value of type 'svbool_t'} } */ + (gnu_int8_t) sve_b1; /* { dg-error {cannot convert a value of type 'svbool_t'} } */ + /* Vector indexing. */ sve_u1[0]; @@ -110,6 +158,20 @@ f (svuint8_t sve_u1, svint8_t sve_s1, gnu_u1++; gnu_u1--; + /* Boolean unary ops. */ + + +sve_b1; + -sve_b1; /* { dg-error {negation operation not permitted} } */ + ~sve_b1; + !sve_b1; /* { dg-error {wrong type argument to unary exclamation mark} } */ + *sve_b1; /* { dg-error {invalid type argument of unary '\*'} } */ + __real sve_b1; /* { dg-error {wrong type argument to __real} } */ + __imag sve_b1; /* { dg-error {wrong type argument to __imag} } */ + ++sve_b1; /* { dg-error {not permitted} } */ + --sve_b1; /* { dg-error {not permitted} } */ + sve_b1++; /* { dg-error {not permitted} } */ + sve_b1--; /* { dg-error {not permitted} } */ + /* Vector-vector binary arithmetic. */ sve_u1 + sve_u1; @@ -131,6 +193,27 @@ f (svuint8_t sve_u1, svint8_t sve_s1, sve_u1 && sve_u1; /* { dg-error {used vector type where scalar is required} } */ sve_u1 || sve_u1; /* { dg-error {used vector type where scalar is required} } */ + /* Boolean vector-vector binary arithmetic. */ + + sve_b1 + sve_b1; /* { dg-error {not permitted} } */ + sve_b1 - sve_b1; /* { dg-error {not permitted} } */ + sve_b1 * sve_b1; /* { dg-error {not permitted} } */ + sve_b1 / sve_b1; /* { dg-error {not permitted} } */ + sve_b1 % sve_b1; /* { dg-error {invalid operands to binary} } */ + sve_b1 & sve_b1; + sve_b1 | sve_b1; + sve_b1 ^ sve_b1; + sve_b1 == sve_b1; + sve_b1 != sve_b1; + sve_b1 <= sve_b1; /* { dg-error {only == and != operations permitted} } */ + sve_b1 < sve_b1; /* { dg-error {only == and != operations permitted} } */ + sve_b1 > sve_b1; /* { dg-error {only == and != operations permitted} } */ + sve_b1 >= sve_b1; /* { dg-error {only == and != operations permitted} } */ + sve_b1 << sve_b1; /* { dg-error {not permitted} } */ + sve_b1 >> sve_b1; /* { dg-error {not permitted} } */ + sve_b1 && sve_b1; /* { dg-error {used vector type where scalar is required} } */ + sve_b1 || sve_b1; /* { dg-error {used vector type where scalar is required} } */ + sve_u1 + gnu_u1; /* { dg-error {cannot combine GNU and SVE vectors in a binary operation} } */ sve_u1 - gnu_u1; /* { dg-error {cannot combine GNU and SVE vectors in a binary operation} } */ sve_u1 * gnu_u1; /* { dg-error {cannot combine GNU and SVE vectors in a binary operation} } */ @@ -401,6 +484,20 @@ f (svuint8_t sve_u1, svint8_t sve_s1, gnu_u1 ? sve_u1 : gnu_u1; /* { dg-error {used vector type where scalar is required} } */ gnu_u1 ? gnu_u1 : gnu_u1; /* { dg-error {used vector type where scalar is required} } */ + /* Boolean conditional expressions. */ + + uc ? sve_b1 : sve_b2; + + sve_b1 ? sve_u1 : sve_u1; /* { dg-error {used vector type where scalar is required} } */ + sve_b1 ? gnu_u1 : sve_u1; /* { dg-error {used vector type where scalar is required} } */ + sve_b1 ? sve_u1 : gnu_u1; /* { dg-error {used vector type where scalar is required} } */ + sve_b1 ? gnu_u1 : gnu_u1; /* { dg-error {used vector type where scalar is required} } */ + + sve_u1 ? sve_b1 : sve_b2; /* { dg-error {used vector type where scalar is required} } */ + gnu_u1 ? sve_b1 : sve_b2; /* { dg-error {used vector type where scalar is required} } */ + gnu_u1 ? gnu_u1 : sve_b1; /* { dg-error {used vector type where scalar is required} } */ + gnu_u1 ? sve_b1 : gnu_u1; /* { dg-error {used vector type where scalar is required} } */ + /* Vector built-ins. */ __builtin_shuffle (sve_u1, sve_u1, sve_u1); @@ -413,4 +510,31 @@ f (svuint8_t sve_u1, svint8_t sve_s1, __builtin_convertvector (gnu_u1, svuint8_t); __builtin_convertvector (sve_u1, gnu_uint8_t); __builtin_convertvector (gnu_u1, gnu_uint8_t); + + /* Boolean vector built-ins. */ + + __builtin_shuffle (sve_b1, sve_b1, sve_s1); + __builtin_shuffle (sve_b1, sve_b1, sve_u1); + __builtin_shuffle (sve_b1, sve_b1, gnu_s1); + __builtin_shuffle (sve_b1, sve_b1, gnu_u1); + + __builtin_shuffle (sve_b1, gnu_u1, gnu_u1); /* { dg-error {'__builtin_shuffle' argument vectors must be of the same type} } */ + __builtin_shuffle (gnu_u1, sve_b1, gnu_u1); /* { dg-error {'__builtin_shuffle' argument vectors must be of the same type} } */ + + __builtin_convertvector (sve_b1, svint8_t); + __builtin_convertvector (sve_b1, svuint8_t); + __builtin_convertvector (sve_b1, gnu_int8_t); + __builtin_convertvector (sve_b1, gnu_uint8_t); + + __builtin_convertvector (sve_s1, svbool_t); + __builtin_convertvector (gnu_s1, svbool_t); + __builtin_convertvector (sve_u1, svbool_t); + __builtin_convertvector (gnu_u1, svbool_t); + + __builtin_convertvector (sve_b1, svint32_t); /* { dg-error {'__builtin_convertvector' number of elements of the first argument vector and the second argument vector type should be the same} } */ + __builtin_convertvector (sve_b1, svuint32_t); /* { dg-error {'__builtin_convertvector' number of elements of the first argument vector and the second argument vector type should be the same} } */ + __builtin_convertvector (sve_b1, gnu32_int32_t); /* { dg-error {'__builtin_convertvector' number of elements of the first argument vector and the second argument vector type should be the same} } */ + + __builtin_convertvector (sve_b1, gnu128_int32_t); + __builtin_convertvector (gnu128_s1, svbool_t); } diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/gnu_vectors_2.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/gnu_vectors_2.c index c311e16..156e354 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/gnu_vectors_2.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/gnu_vectors_2.c @@ -5,9 +5,12 @@ typedef uint8_t gnu_uint8_t __attribute__ ((vector_size (32))); typedef int8_t gnu_int8_t __attribute__ ((vector_size (32))); +typedef int32_t gnu128_int32_t __attribute__ ((vector_size (128))); +typedef int32_t gnu32_int32_t __attribute__ ((vector_size (32))); + void -f (svuint8_t sve_u1, svint8_t sve_s1, - gnu_uint8_t gnu_u1, gnu_int8_t gnu_s1, int n, unsigned char uc) +f (svuint8_t sve_u1, svint8_t sve_s1, svbool_t sve_b1, svbool_t sve_b2, + gnu_uint8_t gnu_u1, gnu_int8_t gnu_s1, gnu128_int32_t gnu128_s1, int n, unsigned char uc) { /* Initialization. */ @@ -21,6 +24,15 @@ f (svuint8_t sve_u1, svint8_t sve_s1, svuint8_t init_sve_u8 = { sve_u1, sve_u1 }; /* { dg-error {incompatible types when initializing type 'unsigned char'} } */ svuint8_t init_sve_u9 = { gnu_u1, gnu_u1 }; /* { dg-error {incompatible types when initializing type 'unsigned char'} } */ + /* Boolean inits. */ + svbool_t init_sve_b1 = 0; /* { dg-error {incompatible types when initializing type 'svbool_t' using type 'int'} } */ + svbool_t init_sve_b2 = {}; + svbool_t init_sve_b3 = { sve_b1 }; /* { dg-error {incompatible types when initializing type 'signed char:1'} } */ + svbool_t init_sve_b4 = { gnu_u1 }; /* { dg-error {incompatible types when initializing type 'signed char:1'} } */ + svbool_t init_sve_b5 = { sve_s1 }; /* { dg-error {incompatible types when initializing type 'signed char:1'} } */ + svbool_t init_sve_b6 = { gnu_s1 }; /* { dg-error {incompatible types when initializing type 'signed char:1'} } */ + svbool_t init_sve_b7 = { 0 }; + gnu_uint8_t init_gnu_u1 = 0; /* { dg-error {incompatible types when initializing type 'gnu_uint8_t'[^\n]* using type 'int'} } */ gnu_uint8_t init_gnu_u2 = {}; gnu_uint8_t init_gnu_u3 = { sve_u1 }; /* { dg-error {incompatible types when initializing type 'unsigned char'} } */ @@ -29,6 +41,11 @@ f (svuint8_t sve_u1, svint8_t sve_s1, gnu_uint8_t init_gnu_u6 = { gnu_s1 }; /* { dg-error {incompatible types when initializing type 'unsigned char'} } */ gnu_uint8_t init_gnu_u7 = { 0 }; + /* Boolean inits. */ + svbool_t init_sve_b8 = { sve_u1, sve_u1 }; /* { dg-error {incompatible types when initializing type 'signed char:1'} } */ + svbool_t init_sve_b9 = { gnu_u1, gnu_u1 }; /* { dg-error {incompatible types when initializing type 'signed char:1'} } */ + gnu_uint8_t init_gnu_u8 = { sve_b1 }; /* { dg-error {incompatible types when initializing type 'unsigned char'} } */ + /* Compound literals. */ (svuint8_t) {}; @@ -43,6 +60,16 @@ f (svuint8_t sve_u1, svint8_t sve_s1, (gnu_uint8_t) { sve_u1 }; /* { dg-error {incompatible types when initializing type 'unsigned char'} } */ (gnu_uint8_t) { gnu_u1 }; /* { dg-error {incompatible types when initializing type 'unsigned char'} } */ + /* Boolean compound literals. */ + (svbool_t) {}; + (svbool_t) { 0 }; + (svbool_t) { sve_b1 }; /* { dg-error {incompatible types when initializing type 'signed char:1'} } */ + (svbool_t) { gnu_u1 }; /* { dg-error {incompatible types when initializing type 'signed char:1'} } */ + (svbool_t) { sve_s1 }; /* { dg-error {incompatible types when initializing type 'signed char:1'} } */ + (svbool_t) { sve_u1 }; /* { dg-error {incompatible types when initializing type 'signed char:1'} } */ + (svbool_t) { gnu_s1 }; /* { dg-error {incompatible types when initializing type 'signed char:1'} } */ + (gnu_uint8_t) { sve_b1 }; /* { dg-error {incompatible types when initializing type 'unsigned char'} } */ + /* Assignment. */ sve_u1 = 0; /* { dg-error {incompatible types when assigning to type 'svuint8_t' from type 'int'} } */ @@ -57,6 +84,14 @@ f (svuint8_t sve_u1, svint8_t sve_s1, gnu_u1 = sve_s1; gnu_u1 = gnu_s1; + /* Boolean Assignments. */ + + sve_b1 = 0; /* { dg-error {incompatible types when assigning to type 'svbool_t' from type 'int'} } */ + sve_b1 = sve_b1; + sve_b1 = sve_s1; /* { dg-error {incompatible types when assigning to type 'svbool_t' from type 'svint8_t'} } */ + sve_b1 = gnu_s1; /* { dg-error {incompatible types when assigning to type 'svbool_t' from type 'gnu_int8_t'} } */ + gnu_u1 = sve_b1; /* { dg-error {incompatible types when assigning to type 'gnu_uint8_t'[^\n]* from type 'svbool_t'} } */ + /* Casts. */ (void) sve_u1; @@ -75,6 +110,19 @@ f (svuint8_t sve_u1, svint8_t sve_s1, (gnu_int8_t) sve_u1; (gnu_int8_t) gnu_u1; + /* Boolean casts. */ + (void) sve_b1; + (svbool_t) sve_b1; + (svbool_t) gnu_u1; /* { dg-error {cannot convert a value of type 'gnu_uint8_t'} } */ + (svbool_t) sve_u1; /* { dg-error {cannot convert a value of type 'svuint8_t'} } */ + (svbool_t) 0; /* This is OK. sizeof (svbool_t) == sizeof (int) for VL == 256. */ + (svbool_t) n; /* This is OK. sizeof (svbool_t) == sizeof (int) for VL == 256. */ + (svbool_t) (short)0; /* { dg-error {cannot convert a value of type 'short int'} } */ + (svbool_t) (short)n; /* { dg-error {cannot convert a value of type 'short int'} } */ + (svint8_t) sve_b1; /* { dg-error {cannot convert a value of type 'svbool_t'} } */ + (gnu_uint8_t) sve_b1; /* { dg-error {cannot convert a value of type 'svbool_t'} } */ + (gnu_int8_t) sve_b1; /* { dg-error {cannot convert a value of type 'svbool_t'} } */ + /* Vector indexing. */ sve_u1[0]; @@ -109,6 +157,20 @@ f (svuint8_t sve_u1, svint8_t sve_s1, gnu_u1++; gnu_u1--; + /* Boolean unary ops. */ + + +sve_b1; + -sve_b1; /* { dg-error {negation operation not permitted} } */ + ~sve_b1; + !sve_b1; /* { dg-error {wrong type argument to unary exclamation mark} } */ + *sve_b1; /* { dg-error {invalid type argument of unary '\*'} } */ + __real sve_b1; /* { dg-error {wrong type argument to __real} } */ + __imag sve_b1; /* { dg-error {wrong type argument to __imag} } */ + ++sve_b1; /* { dg-error {not permitted} } */ + --sve_b1; /* { dg-error {not permitted} } */ + sve_b1++; /* { dg-error {not permitted} } */ + sve_b1--; /* { dg-error {not permitted} } */ + /* Vector-vector binary arithmetic. */ sve_u1 + sve_u1; @@ -130,6 +192,27 @@ f (svuint8_t sve_u1, svint8_t sve_s1, sve_u1 && sve_u1; /* { dg-error {used vector type where scalar is required} } */ sve_u1 || sve_u1; /* { dg-error {used vector type where scalar is required} } */ + /* Boolean vector-vector binary arithmetic. */ + + sve_b1 + sve_b1; /* { dg-error {not permitted} } */ + sve_b1 - sve_b1; /* { dg-error {not permitted} } */ + sve_b1 * sve_b1; /* { dg-error {not permitted} } */ + sve_b1 / sve_b1; /* { dg-error {not permitted} } */ + sve_b1 % sve_b1; /* { dg-error {invalid operands to binary} } */ + sve_b1 & sve_b1; + sve_b1 | sve_b1; + sve_b1 ^ sve_b1; + sve_b1 == sve_b1; + sve_b1 != sve_b1; + sve_b1 <= sve_b1; /* { dg-error {only == and != operations permitted} } */ + sve_b1 < sve_b1; /* { dg-error {only == and != operations permitted} } */ + sve_b1 > sve_b1; /* { dg-error {only == and != operations permitted} } */ + sve_b1 >= sve_b1; /* { dg-error {only == and != operations permitted} } */ + sve_b1 << sve_b1; /* { dg-error {not permitted} } */ + sve_b1 >> sve_b1; /* { dg-error {not permitted} } */ + sve_b1 && sve_b1; /* { dg-error {used vector type where scalar is required} } */ + sve_b1 || sve_b1; /* { dg-error {used vector type where scalar is required} } */ + sve_u1 + gnu_u1; /* { dg-error {cannot combine GNU and SVE vectors in a binary operation} } */ sve_u1 - gnu_u1; /* { dg-error {cannot combine GNU and SVE vectors in a binary operation} } */ sve_u1 * gnu_u1; /* { dg-error {cannot combine GNU and SVE vectors in a binary operation} } */ @@ -400,6 +483,20 @@ f (svuint8_t sve_u1, svint8_t sve_s1, gnu_u1 ? sve_u1 : gnu_u1; /* { dg-error {used vector type where scalar is required} } */ gnu_u1 ? gnu_u1 : gnu_u1; /* { dg-error {used vector type where scalar is required} } */ + /* Boolean conditional expressions. */ + + uc ? sve_b1 : sve_b2; + + sve_b1 ? sve_u1 : sve_u1; /* { dg-error {used vector type where scalar is required} } */ + sve_b1 ? gnu_u1 : sve_u1; /* { dg-error {used vector type where scalar is required} } */ + sve_b1 ? sve_u1 : gnu_u1; /* { dg-error {used vector type where scalar is required} } */ + sve_b1 ? gnu_u1 : gnu_u1; /* { dg-error {used vector type where scalar is required} } */ + + sve_u1 ? sve_b1 : sve_b2; /* { dg-error {used vector type where scalar is required} } */ + gnu_u1 ? sve_b1 : sve_b2; /* { dg-error {used vector type where scalar is required} } */ + gnu_u1 ? gnu_u1 : sve_b1; /* { dg-error {used vector type where scalar is required} } */ + gnu_u1 ? sve_b1 : gnu_u1; /* { dg-error {used vector type where scalar is required} } */ + /* Vector built-ins. */ __builtin_shuffle (sve_u1, sve_u1, sve_u1); @@ -412,4 +509,31 @@ f (svuint8_t sve_u1, svint8_t sve_s1, __builtin_convertvector (gnu_u1, svuint8_t); __builtin_convertvector (sve_u1, gnu_uint8_t); __builtin_convertvector (gnu_u1, gnu_uint8_t); + + /* Boolean vector built-ins. */ + + __builtin_shuffle (sve_b1, sve_b1, sve_s1); + __builtin_shuffle (sve_b1, sve_b1, sve_u1); + __builtin_shuffle (sve_b1, sve_b1, gnu_s1); + __builtin_shuffle (sve_b1, sve_b1, gnu_u1); + + __builtin_shuffle (sve_b1, gnu_u1, gnu_u1); /* { dg-error {'__builtin_shuffle' argument vectors must be of the same type} } */ + __builtin_shuffle (gnu_u1, sve_b1, gnu_u1); /* { dg-error {'__builtin_shuffle' argument vectors must be of the same type} } */ + + __builtin_convertvector (sve_b1, svint8_t); + __builtin_convertvector (sve_b1, svuint8_t); + __builtin_convertvector (sve_b1, gnu_int8_t); + __builtin_convertvector (sve_b1, gnu_uint8_t); + + __builtin_convertvector (sve_s1, svbool_t); + __builtin_convertvector (gnu_s1, svbool_t); + __builtin_convertvector (sve_u1, svbool_t); + __builtin_convertvector (gnu_u1, svbool_t); + + __builtin_convertvector (sve_b1, svint32_t); /* { dg-error {'__builtin_convertvector' number of elements of the first argument vector and the second argument vector type should be the same} } */ + __builtin_convertvector (sve_b1, svuint32_t); /* { dg-error {'__builtin_convertvector' number of elements of the first argument vector and the second argument vector type should be the same} } */ + __builtin_convertvector (sve_b1, gnu32_int32_t); /* { dg-error {'__builtin_convertvector' number of elements of the first argument vector and the second argument vector type should be the same} } */ + + __builtin_convertvector (sve_b1, gnu128_int32_t); + __builtin_convertvector (gnu128_s1, svbool_t); } diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/sizeless-1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/sizeless-1.c index 9677b65..da5ac2a 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/sizeless-1.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/sizeless-1.c @@ -81,7 +81,19 @@ statements (int n) svint32_t init_sve_vc8 = { 0, 1, 2, 3, 4, 5 }; /* { dg-error {excess elements in vector initializer} } */ svint32_t init_sve_vc9 = { 0, bar (), 2, 3, 4, n }; /* { dg-error {excess elements in vector initializer} } */ - + svbool_t init_sve_vb1 = { 0, -1 }; /* { dg-warning {overflow in conversion from} } */ + svbool_t init_sve_vb2 = { 0, bar () }; + svbool_t init_sve_vb3 = { bar (), n }; + svbool_t init_sve_vb4 = { 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* { dg-warning {overflow in conversion from} } */ + svbool_t init_sve_vb5 = { 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, bar (), 0, 0}; /* { dg-warning {overflow in conversion from} } */ + svbool_t init_sve_vb6 = { 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1}; /* { dg-error {excess elements in vector initializer} } */ + /* { dg-warning "overflow in conversion from" "" { target *-*-* } .-1 } */ + svbool_t init_sve_vb7 = { 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, bar ()}; /* { dg-error {excess elements in vector initializer} } */ + /* { dg-warning "overflow in conversion from" "" { target *-*-* } .-1 } */ + svbool_t init_sve_vb8 = { 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, bar (), -1}; /* { dg-error {excess elements in vector initializer} } */ + /* { dg-warning "overflow in conversion from" "" { target *-*-* } .-1 } */ + svbool_t init_sve_vb9 = { 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, bar (), n}; /* { dg-error {excess elements in vector initializer} } */ + /* { dg-warning "overflow in conversion from" "" { target *-*-* } .-1 } */ /* Compound literals. */ diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/sizeless-2.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/sizeless-2.c index 73828a5..682e2e0 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/sizeless-2.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/sizeless-2.c @@ -81,6 +81,38 @@ statements (int n) svint32_t init_sve_vc8 = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; /* { dg-warning {excess elements in vector initializer} } */ svint32_t init_sve_vc9 = { 0, bar (), 2, 3, 4, 5, 6, 7, 8, 9, n }; /* { dg-warning {excess elements in vector initializer} } */ + svbool_t init_sve_vb1 = { 0, -1 }; /* { dg-warning {overflow in conversion from} } */ + svbool_t init_sve_vb2 = { 0, bar () }; + svbool_t init_sve_vb3 = { bar (), n }; + svbool_t init_sve_vb4 = { 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + /* { dg-warning "overflow in conversion from" "" { target *-*-* } .-2 } */ + /* { dg-warning "overflow in conversion from" "" { target *-*-* } .-2 } */ + svbool_t init_sve_vb5 = { 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, -1, -1, -1, 0, 0, 0, bar (), 0, 0, 0, 0, 0, 0, + 0, 0 }; + /* { dg-warning "overflow in conversion from" "" { target *-*-* } .-3 } */ + /* { dg-warning "overflow in conversion from" "" { target *-*-* } .-3 } */ + svbool_t init_sve_vb6 = { 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0 }; /* { dg-warning {excess elements in vector initializer} } */ + /* { dg-warning "overflow in conversion from" "" { target *-*-* } .-3 } */ + /* { dg-warning "overflow in conversion from" "" { target *-*-* } .-3 } */ + svbool_t init_sve_vb7 = { 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + bar () }; /* { dg-warning {excess elements in vector initializer} } */ + /* { dg-warning "overflow in conversion from" "" { target *-*-* } .-3 } */ + /* { dg-warning "overflow in conversion from" "" { target *-*-* } .-3 } */ + svbool_t init_sve_vb8 = { 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + bar (), -1 }; /* { dg-warning {excess elements in vector initializer} } */ + /* { dg-warning "overflow in conversion from" "" { target *-*-* } .-3 } */ + /* { dg-warning "overflow in conversion from" "" { target *-*-* } .-3 } */ + svbool_t init_sve_vb9 = { 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + bar (), n}; /* { dg-warning {excess elements in vector initializer} } */ + /* { dg-warning "overflow in conversion from" "" { target *-*-* } .-3 } */ + /* { dg-warning "overflow in conversion from" "" { target *-*-* } .-3 } */ /* Compound literals. */ diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/svcount_1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/svcount_1.c index 920d37e..19e8d49 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/svcount_1.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/svcount_1.c @@ -6,5 +6,5 @@ void f3 (svbool_t *p, svcount_t x) { *p = x; } /* { dg-error {incompatible types void f4 (svcount_t *p, svbool_t x) { *p = x; } /* { dg-error {incompatible types} } */ svbool_t *f5 (svcount_t *p) { return p; } /* { dg-error {incompatible return type} } */ svcount_t *f6 (svbool_t *p) { return p; } /* { dg-error {incompatible return type} } */ -svbool_t f7 (svcount_t x) { return (svbool_t) x; } /* { dg-error {conversion to non-scalar} } */ +svbool_t f7 (svcount_t x) { return (svbool_t) x; } /* { dg-error {cannot convert value to a vector} } */ svcount_t f8 (svbool_t x) { return (svcount_t) x; } /* { dg-error {conversion to non-scalar} } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general/cops_bool.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general/cops_bool.c new file mode 100644 index 0000000..53017ca --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general/cops_bool.c @@ -0,0 +1,301 @@ +/* { dg-do run { target aarch64_sve_hw } } */ +/* { dg-options "-O2" } */ + +#include <arm_sve.h> + +#ifdef __cplusplus +#define BOOL bool +#else +#define BOOL _Bool +#endif + +#define DECL_FUNC_UNARY(name, op, intr, n) \ + svbool_t __attribute__((noipa)) \ + func_ ## name ## _unary (svbool_t a) { \ + return op (a); \ + } \ + void __attribute__((noipa)) \ + checkfunc_ ## name ## _unary () { \ + svbool_t pg = svptrue_b8 (); \ + svbool_t data = svptrue_pat_b8 (SV_VL ## n); \ + svbool_t exp = intr (pg, data); \ + svbool_t actual = func_ ## name ## _unary (data); \ + svbool_t cmp = sveor_b_z (pg, exp, actual); \ + if (svptest_any (pg, cmp)) \ + __builtin_abort (); \ + } + +#define DECL_FUNC_UNARY_COND(name, op, n) \ + svbool_t __attribute__ ((noipa)) \ + func_ ## name ## _unary_cond (svbool_t a) { \ + return op (a); \ + } \ + svbool_t __attribute__ ((noipa)) \ + name (svbool_t t, svbool_t a) { \ + svbool_t pgl = sveor_b_z (t, a, svptrue_b8 ()); \ + return pgl; \ + } \ + void __attribute__((noipa)) \ + checkfunc_ ## name ## _unary_cond () { \ + svbool_t a = svptrue_pat_b8 (SV_VL ## n); \ + svbool_t all_true = svptrue_b8 (); \ + svbool_t cmp = func_ ## name ## _unary_cond (a); \ + svbool_t pgc = name (all_true, a) ; \ + svbool_t res = sveor_b_z (all_true, cmp, pgc); \ + if (svptest_any (all_true, res)) \ + __builtin_abort (); \ + } + +#define VECT_CST { -1, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1 } /* { dg-warning "overflow in conversion from" "" { target c } } */ +#define VECT_CSTN { -1, t (), 0, -1, 0, f (), 0, 0, 0, -1, 0, -1, 0, -1, 0, -1 } /* { dg-warning "overflow in conversion from" "" { target c } } */ + /* { dg-warning "narrowing conversion of" "" { target c++ } .-1 } */ + +#define DECL_FUNC_INIT() \ + svbool_t __attribute__ ((noipa)) \ + func_init1 () { \ + svbool_t temp = VECT_CST; \ + return temp; \ + } \ + svbool_t __attribute__ ((noipa)) \ + func_init2 () { \ + svbool_t temp = { 0 }; \ + return temp; \ + } \ + svbool_t __attribute__ ((noipa)) \ + func_init3 () { \ + svbool_t temp = { }; \ + return temp; \ + } \ + int __attribute__ ((noipa)) \ + t () { \ + return -1; \ + } \ + int __attribute__ ((noipa)) \ + f () { \ + return 0; \ + } \ + svbool_t __attribute__ ((noipa)) \ + func_init4 () { \ + svbool_t temp = VECT_CSTN; \ + return temp; \ + } \ + void __attribute__((noipa)) \ + checkfunc_init() { \ + svbool_t all_true = svptrue_b8 (); \ + svbool_t v16_true = svptrue_pat_b8 (SV_VL16); \ + int8_t mem[] = VECT_CST; \ + int8_t memn[] = VECT_CSTN; \ + svint8_t t8 = svld1_s8 (v16_true, mem); \ + svbool_t init1 = __builtin_convertvector (t8, svbool_t); \ + svbool_t init2 = __builtin_convertvector (svindex_s8 (0, 0), svbool_t); \ + svbool_t init3 = __builtin_convertvector (svindex_s8 (0, 0), svbool_t); \ + svint8_t tn8 = svld1_s8 (v16_true, memn); \ + svbool_t init4 = __builtin_convertvector (tn8, svbool_t); \ + \ + svbool_t res_init1 = func_init1 (); \ + svbool_t cmp = sveor_b_z (all_true, init1, res_init1); \ + if (svptest_any (v16_true, cmp)) \ + __builtin_abort (); \ + \ + svbool_t res_init2 = func_init2 (); \ + cmp = sveor_b_z (all_true, init2, res_init2); \ + if (svptest_any (v16_true, cmp)) \ + __builtin_abort (); \ + \ + svbool_t res_init3 = func_init3 (); \ + cmp = sveor_b_z (all_true, init3, res_init3); \ + if (svptest_any (v16_true, cmp)) \ + __builtin_abort (); \ + \ + svbool_t res_init4 = func_init4 (); \ + cmp = sveor_b_z (all_true, init4, res_init4); \ + if (svptest_any (v16_true, cmp)) \ + __builtin_abort (); \ + } + +#define DECL_FUNC_BINARY(name, op, intr, n) \ + svbool_t __attribute__((noipa)) \ + func_ ## name ## _binary(svbool_t a, svbool_t b) { \ + return (a) op (b); \ + } \ + void __attribute__((noipa)) \ + checkfunc_ ## name ## _binary () { \ + svbool_t pg = svptrue_b8 (); \ + svbool_t data1 = svptrue_pat_b8 (SV_VL ## n); \ + svbool_t data2 = svnot_b_z (pg, data1); \ + svbool_t exp = intr (pg, data1, data2); \ + svbool_t actual = func_ ## name ## _binary (data1, data2); \ + svbool_t cmp = sveor_b_z (pg, exp, actual); \ + if (svptest_any (pg, cmp)) \ + __builtin_abort (); \ + } + +#define DECL_FUNC_BINARY_COND(name, op, intr, n) \ + svbool_t __attribute__ ((noipa)) \ + func_ ## name ## _binary_cond(svbool_t a, svbool_t b) { \ + return (a) op (b); \ + } \ + svbool_t __attribute__ ((noipa)) \ + name ## intr (svbool_t t, svbool_t a, svbool_t b) { \ + return sv ## intr ## _b_z (t, a, b); \ + } \ + void __attribute__((noipa)) \ + checkfunc_ ## name ## _binary_cond () { \ + svbool_t all_true = svptrue_b8 (); \ + svbool_t a = svptrue_pat_b8 (SV_VL ## n); \ + svbool_t b = svnot_b_z (all_true, a); \ + svbool_t cmp = func_ ## name ## _binary_cond (a, b); \ + svbool_t pgc = name ## intr (all_true, a, b) ; \ + svbool_t res = sveor_b_z (all_true, cmp, pgc); \ + if (svptest_any (all_true, res)) \ + __builtin_abort (); \ + } + +#define DECL_FUNC_BOOL_TERNARY(n) \ + svbool_t __attribute__((noipa)) \ + func_svbool_t_ternary_eq(svbool_t p, svbool_t q, svbool_t a, svbool_t b) { \ + return (p == q) ? a : b; \ + } \ + svbool_t __attribute__((noipa)) \ + func_svbool_t_ternary_ne(svbool_t p, svbool_t q, svbool_t a, svbool_t b) { \ + return (p != q) ? a : b; \ + } \ + svbool_t __attribute__((noipa)) \ + func_svbool_t_ternary_ex(svbool_t p, svbool_t a, svbool_t b) { \ + return (p) ? a : b; \ + } \ + void __attribute__((noipa)) \ + checkfunc_svbool_t_ternary () { \ + svbool_t pg = svptrue_b8 (); \ + svbool_t p = svptrue_pat_b8 (SV_VL ## n); \ + svbool_t q = svnot_b_z (pg, p); \ + svbool_t a = p; \ + svbool_t b = q; \ + svbool_t ne = sveor_b_z (pg, p, q); \ + svbool_t eq = svnot_b_z (pg, sveor_b_z (pg, p, q)); \ + svbool_t ex = p; \ + svbool_t expeq = svsel_b (eq, a, b); \ + svbool_t expne = svsel_b (ne, a, b); \ + svbool_t expex = svsel_b (ex, a, b); \ + svbool_t actualeq = func_svbool_t_ternary_eq (p, q, a, b); \ + svbool_t actualne = func_svbool_t_ternary_ne (p, q, a, b); \ + svbool_t actualex = func_svbool_t_ternary_ex (p, a, b); \ + svbool_t pgc_eq = sveor_b_z (pg, actualeq, expeq); \ + svbool_t pgc_ne = sveor_b_z (pg, actualne, expne); \ + svbool_t pgc_ex = sveor_b_z (pg, actualex, expex); \ + if (svptest_any (pg, pgc_eq)) \ + __builtin_abort (); \ + if (svptest_any (pg, pgc_ne)) \ + __builtin_abort (); \ + if (svptest_any (pg, pgc_ex)) \ + __builtin_abort (); \ + } + +svbool_t __attribute__((noipa)) +my_svneor_b_z (svbool_t pg, svbool_t a, svbool_t b) +{ + return svnot_b_z (pg, sveor_b_z (pg, a, b)); +} + +svbool_t __attribute__((noipa)) +func_svbool_t_bc (svint8_t a) +{ + return __builtin_convertvector (a, svbool_t); +} + +void __attribute__((noipa)) +checkfunc_svbool_t_bc () +{ + svbool_t pg = svptrue_b8 (); + svint8_t data = { -1, -1, -1, -1 }; + svbool_t actual = func_svbool_t_bc (data); + svbool_t exp = svptrue_pat_b8 (SV_VL4); + svbool_t cmp = sveor_b_z (pg, exp, actual); + if (svptest_any (pg, cmp)) + __builtin_abort (); +} + +svint8_t __attribute__((noipa)) +func_svint8_t_bc (svbool_t a) +{ + return __builtin_convertvector (a, svint8_t); +} + +void __attribute__((noipa)) +checkfunc_svint8_t_bc () +{ + svbool_t pg = svptrue_b8 (); + svbool_t data = svptrue_pat_b8 (SV_VL4); + svint8_t actual = func_svint8_t_bc (data); + svint8_t exp = { -1, -1, -1, -1 }; + svbool_t cmp = svcmpne_s8 (pg, exp, actual); + if (svptest_any (pg, cmp)) + __builtin_abort (); +} + +DECL_FUNC_UNARY (not, ~, svnot_b_z, 4) +DECL_FUNC_BINARY (and, &, svand_b_z, 8) +DECL_FUNC_BINARY (orr, |, svorr_b_z, 6) +DECL_FUNC_BINARY (eor, ^, sveor_b_z, 3) + +DECL_FUNC_BINARY (eq, ==, my_svneor_b_z, 4) +DECL_FUNC_BINARY (ne, !=, sveor_b_z, 4) + +DECL_FUNC_INIT () + +#ifdef __cplusplus +DECL_FUNC_UNARY_COND (lnot, !, 8) +DECL_FUNC_BINARY_COND (and_and, &&, and, 8) +DECL_FUNC_BINARY_COND (or_or, ||, orr, 8) +DECL_FUNC_BOOL_TERNARY (3) +#endif + +#undef DECL_FUNC_UNARY +#define DECL_FUNC_UNARY(name, op, intr, n) \ + checkfunc_ ## name ## _unary (); + +#undef DECL_FUNC_UNARY_COND +#define DECL_FUNC_UNARY_COND(name, op, n) \ + checkfunc_ ## name ## _unary_cond (); + +#undef DECL_FUNC_INIT +#define DECL_FUNC_INIT() \ + checkfunc_init (); + +#undef DECL_FUNC_BINARY +#define DECL_FUNC_BINARY(name, op, intr, n) \ + checkfunc_ ## name ## _binary (); + +#undef DECL_FUNC_BINARY_COND +#define DECL_FUNC_BINARY_COND(name, op, intr, n) \ + checkfunc_ ## name ## _binary_cond (); + +#undef DECL_FUNC_BOOL_TERNARY +#define DECL_FUNC_BOOL_TERNARY(n) \ + checkfunc_svbool_t_ternary (); + +int +main () +{ + DECL_FUNC_UNARY (not, ~, svnot_b_z, 4) + DECL_FUNC_BINARY (and, &, svand_b_z, 8) + DECL_FUNC_BINARY (orr, |, svorr_b_z, 6) + DECL_FUNC_BINARY (eor, ^, sveor_b_z, 3) + + DECL_FUNC_BINARY (ne, !=, sveor_b_z, 4) + DECL_FUNC_BINARY (eq, ==, my_svneor_b_z, 4) + + DECL_FUNC_INIT () + + checkfunc_svbool_t_bc (); + checkfunc_svint8_t_bc (); + +#ifdef __cplusplus + DECL_FUNC_UNARY_COND (lnot, !, 8) + DECL_FUNC_BINARY_COND (and_and, &&, and, 8) + DECL_FUNC_BINARY_COND (or_or, ||, orr, 8) + DECL_FUNC_BOOL_TERNARY (3) +#endif + + return 0; +} diff --git a/gcc/testsuite/gcc.target/aarch64/sve/dwarf-bit-stride.c b/gcc/testsuite/gcc.target/aarch64/sve/dwarf-bit-stride.c new file mode 100644 index 0000000..3f34348 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sve/dwarf-bit-stride.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +// { dg-options "-g -dA" } +// { dg-final { scan-assembler-times "DW_AT_name: \"__SVBool_t\"" 1 } } +// { dg-final { scan-assembler-times ".byte 0x1 // DW_AT_bit_stride" 1 } } +// { dg-final { scan-assembler-times ".byte 0x1 // DW_AT_bit_size" 1 } } + +#include <arm_sve.h> + +void fun () +{ + volatile svbool_t pred8 = svwhilelt_b8_u32 (0u, 1u); + volatile svbool_t pred16 = svwhilelt_b16_u32 (0u, 3u); + volatile svbool_t pred32 = svwhilelt_b32_u32 (0u, 7u); + volatile svbool_t pred64 = svwhilelt_b64_u32 (0u, 11u); +} diff --git a/gcc/testsuite/gcc.target/aarch64/sve/fold_to_highpart_1.c b/gcc/testsuite/gcc.target/aarch64/sve/fold_to_highpart_1.c new file mode 100644 index 0000000..a3d59a4 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sve/fold_to_highpart_1.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-O1" } */ +/* { dg-final { check-function-bodies "**" "" } } */ + +#include <arm_neon.h> +#include <arm_neon_sve_bridge.h> +#include <stdint.h> + +/* +** sub_neon_i16_sve_bridged: +** ssubl2 v0.8h, v0.16b, v1.16b +** ret +*/ +svint16_t sub_neon_i16_sve_bridged(svint8_t a, svint8_t b) { + return svset_neonq_s16(svundef_s16(), + vsubq_s16(vmovl_high_s8(svget_neonq(a)), + vmovl_high_s8(svget_neonq(b)))); +} + diff --git a/gcc/testsuite/gcc.target/aarch64/sve/fold_to_highpart_2.c b/gcc/testsuite/gcc.target/aarch64/sve/fold_to_highpart_2.c new file mode 100644 index 0000000..6cca4ad --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sve/fold_to_highpart_2.c @@ -0,0 +1,295 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-O1" } */ +/* { dg-final { check-function-bodies "**" "" } } */ + +#include <arm_neon.h> +#include <arm_sve.h> +#include <arm_neon_sve_bridge.h> + +// ============================================================================ +// 8 -> 16 : SIGNED +// ============================================================================ + +/* +** add_neon_i16_from_i8_low_sve_bridged: +** saddl v0.8h, v0.8b, v1.8b +** ret +*/ +svint16_t add_neon_i16_from_i8_low_sve_bridged(svint8_t a, svint8_t b) { + int16x8_t ar = vmovl_s8(vget_low_s8(svget_neonq(a))); + int16x8_t br = vmovl_s8(vget_low_s8(svget_neonq(b))); + return svset_neonq_s16(svundef_s16(), vaddq_s16(ar, br)); +} + +/* +** add_neon_i16_from_i8_high_sve_bridged: +** saddl2 v0.8h, v0.16b, v1.16b +** ret +*/ +svint16_t add_neon_i16_from_i8_high_sve_bridged(svint8_t a, svint8_t b) { + int16x8_t ar = vmovl_s8(vget_high_s8(svget_neonq(a))); + int16x8_t br = vmovl_s8(vget_high_s8(svget_neonq(b))); + return svset_neonq_s16(svundef_s16(), vaddq_s16(ar, br)); +} + +/* +** sub_neon_i16_from_i8_low_sve_bridged: +** ssubl v0.8h, v0.8b, v1.8b +** ret +*/ +svint16_t sub_neon_i16_from_i8_low_sve_bridged(svint8_t a, svint8_t b) { + int16x8_t ar = vmovl_s8(vget_low_s8(svget_neonq(a))); + int16x8_t br = vmovl_s8(vget_low_s8(svget_neonq(b))); + return svset_neonq_s16(svundef_s16(), vsubq_s16(ar, br)); +} + +/* +** sub_neon_i16_from_i8_high_sve_bridged: +** ssubl2 v0.8h, v0.16b, v1.16b +** ret +*/ +svint16_t sub_neon_i16_from_i8_high_sve_bridged(svint8_t a, svint8_t b) { + int16x8_t ar = vmovl_s8(vget_high_s8(svget_neonq(a))); + int16x8_t br = vmovl_s8(vget_high_s8(svget_neonq(b))); + return svset_neonq_s16(svundef_s16(), vsubq_s16(ar, br)); +} + +// ============================================================================ +// 8 -> 16 : UNSIGNED +// ============================================================================ + +/* +** add_neon_u16_from_u8_low_sve_bridged: +** uaddl v0.8h, v0.8b, v1.8b +** ret +*/ +svuint16_t add_neon_u16_from_u8_low_sve_bridged(svuint8_t a, svuint8_t b) { + uint16x8_t ar = vmovl_u8(vget_low_u8(svget_neonq(a))); + uint16x8_t br = vmovl_u8(vget_low_u8(svget_neonq(b))); + return svset_neonq_u16(svundef_u16(), vaddq_u16(ar, br)); +} + +/* +** add_neon_u16_from_u8_high_sve_bridged: +** uaddl2 v0.8h, v0.16b, v1.16b +** ret +*/ +svuint16_t add_neon_u16_from_u8_high_sve_bridged(svuint8_t a, svuint8_t b) { + uint16x8_t ar = vmovl_u8(vget_high_u8(svget_neonq(a))); + uint16x8_t br = vmovl_u8(vget_high_u8(svget_neonq(b))); + return svset_neonq_u16(svundef_u16(), vaddq_u16(ar, br)); +} + +/* +** sub_neon_u16_from_u8_low_sve_bridged: +** usubl v0.8h, v0.8b, v1.8b +** ret +*/ +svuint16_t sub_neon_u16_from_u8_low_sve_bridged(svuint8_t a, svuint8_t b) { + uint16x8_t ar = vmovl_u8(vget_low_u8(svget_neonq(a))); + uint16x8_t br = vmovl_u8(vget_low_u8(svget_neonq(b))); + return svset_neonq_u16(svundef_u16(), vsubq_u16(ar, br)); +} + +/* +** sub_neon_u16_from_u8_high_sve_bridged: +** usubl2 v0.8h, v0.16b, v1.16b +** ret +*/ +svuint16_t sub_neon_u16_from_u8_high_sve_bridged(svuint8_t a, svuint8_t b) { + uint16x8_t ar = vmovl_u8(vget_high_u8(svget_neonq(a))); + uint16x8_t br = vmovl_u8(vget_high_u8(svget_neonq(b))); + return svset_neonq_u16(svundef_u16(), vsubq_u16(ar, br)); +} + +// ============================================================================ +// 16 -> 32 : SIGNED +// ============================================================================ + +/* +** add_neon_i32_from_i16_low_sve_bridged: +** saddl v0.4s, v0.4h, v1.4h +** ret +*/ +svint32_t add_neon_i32_from_i16_low_sve_bridged(svint16_t a, svint16_t b) { + int32x4_t ar = vmovl_s16(vget_low_s16(svget_neonq(a))); + int32x4_t br = vmovl_s16(vget_low_s16(svget_neonq(b))); + return svset_neonq_s32(svundef_s32(), vaddq_s32(ar, br)); +} + +/* +** add_neon_i32_from_i16_high_sve_bridged: +** saddl2 v0.4s, v0.8h, v1.8h +** ret +*/ +svint32_t add_neon_i32_from_i16_high_sve_bridged(svint16_t a, svint16_t b) { + int32x4_t ar = vmovl_s16(vget_high_s16(svget_neonq(a))); + int32x4_t br = vmovl_s16(vget_high_s16(svget_neonq(b))); + return svset_neonq_s32(svundef_s32(), vaddq_s32(ar, br)); +} + +/* +** sub_neon_i32_from_i16_low_sve_bridged: +** ssubl v0.4s, v0.4h, v1.4h +** ret +*/ +svint32_t sub_neon_i32_from_i16_low_sve_bridged(svint16_t a, svint16_t b) { + int32x4_t ar = vmovl_s16(vget_low_s16(svget_neonq(a))); + int32x4_t br = vmovl_s16(vget_low_s16(svget_neonq(b))); + return svset_neonq_s32(svundef_s32(), vsubq_s32(ar, br)); +} + +/* +** sub_neon_i32_from_i16_high_sve_bridged: +** ssubl2 v0.4s, v0.8h, v1.8h +** ret +*/ +svint32_t sub_neon_i32_from_i16_high_sve_bridged(svint16_t a, svint16_t b) { + int32x4_t ar = vmovl_s16(vget_high_s16(svget_neonq(a))); + int32x4_t br = vmovl_s16(vget_high_s16(svget_neonq(b))); + return svset_neonq_s32(svundef_s32(), vsubq_s32(ar, br)); +} + +// ============================================================================ +// 16 -> 32 : UNSIGNED +// ============================================================================ + +/* +** add_neon_u32_from_u16_low_sve_bridged: +** uaddl v0.4s, v0.4h, v1.4h +** ret +*/ +svuint32_t add_neon_u32_from_u16_low_sve_bridged(svuint16_t a, svuint16_t b) { + uint32x4_t ar = vmovl_u16(vget_low_u16(svget_neonq(a))); + uint32x4_t br = vmovl_u16(vget_low_u16(svget_neonq(b))); + return svset_neonq_u32(svundef_u32(), vaddq_u32(ar, br)); +} + +/* +** add_neon_u32_from_u16_high_sve_bridged: +** uaddl2 v0.4s, v0.8h, v1.8h +** ret +*/ +svuint32_t add_neon_u32_from_u16_high_sve_bridged(svuint16_t a, svuint16_t b) { + uint32x4_t ar = vmovl_u16(vget_high_u16(svget_neonq(a))); + uint32x4_t br = vmovl_u16(vget_high_u16(svget_neonq(b))); + return svset_neonq_u32(svundef_u32(), vaddq_u32(ar, br)); +} + +/* +** sub_neon_u32_from_u16_low_sve_bridged: +** usubl v0.4s, v0.4h, v1.4h +** ret +*/ +svuint32_t sub_neon_u32_from_u16_low_sve_bridged(svuint16_t a, svuint16_t b) { + uint32x4_t ar = vmovl_u16(vget_low_u16(svget_neonq(a))); + uint32x4_t br = vmovl_u16(vget_low_u16(svget_neonq(b))); + return svset_neonq_u32(svundef_u32(), vsubq_u32(ar, br)); +} + +/* +** sub_neon_u32_from_u16_high_sve_bridged: +** usubl2 v0.4s, v0.8h, v1.8h +** ret +*/ +svuint32_t sub_neon_u32_from_u16_high_sve_bridged(svuint16_t a, svuint16_t b) { + uint32x4_t ar = vmovl_u16(vget_high_u16(svget_neonq(a))); + uint32x4_t br = vmovl_u16(vget_high_u16(svget_neonq(b))); + return svset_neonq_u32(svundef_u32(), vsubq_u32(ar, br)); +} + +// ============================================================================ +// 32 -> 64 : SIGNED +// ============================================================================ + +/* +** add_neon_i64_from_i32_low_sve_bridged: +** saddl v0.2d, v0.2s, v1.2s +** ret +*/ +svint64_t add_neon_i64_from_i32_low_sve_bridged(svint32_t a, svint32_t b) { + int64x2_t ar = vmovl_s32(vget_low_s32(svget_neonq(a))); + int64x2_t br = vmovl_s32(vget_low_s32(svget_neonq(b))); + return svset_neonq_s64(svundef_s64(), vaddq_s64(ar, br)); +} + +/* +** add_neon_i64_from_i32_high_sve_bridged: +** saddl2 v0.2d, v0.4s, v1.4s +** ret +*/ +svint64_t add_neon_i64_from_i32_high_sve_bridged(svint32_t a, svint32_t b) { + int64x2_t ar = vmovl_s32(vget_high_s32(svget_neonq(a))); + int64x2_t br = vmovl_s32(vget_high_s32(svget_neonq(b))); + return svset_neonq_s64(svundef_s64(), vaddq_s64(ar, br)); +} + +/* +** sub_neon_i64_from_i32_low_sve_bridged: +** ssubl v0.2d, v0.2s, v1.2s +** ret +*/ +svint64_t sub_neon_i64_from_i32_low_sve_bridged(svint32_t a, svint32_t b) { + int64x2_t ar = vmovl_s32(vget_low_s32(svget_neonq(a))); + int64x2_t br = vmovl_s32(vget_low_s32(svget_neonq(b))); + return svset_neonq_s64(svundef_s64(), vsubq_s64(ar, br)); +} + +/* +** sub_neon_i64_from_i32_high_sve_bridged: +** ssubl2 v0.2d, v0.4s, v1.4s +** ret +*/ +svint64_t sub_neon_i64_from_i32_high_sve_bridged(svint32_t a, svint32_t b) { + int64x2_t ar = vmovl_s32(vget_high_s32(svget_neonq(a))); + int64x2_t br = vmovl_s32(vget_high_s32(svget_neonq(b))); + return svset_neonq_s64(svundef_s64(), vsubq_s64(ar, br)); +} + +// ============================================================================ +// 32 -> 64 : UNSIGNED +// ============================================================================ + +/* +** add_neon_u64_from_u32_low_sve_bridged: +** uaddl v0.2d, v0.2s, v1.2s +** ret +*/ +svuint64_t add_neon_u64_from_u32_low_sve_bridged(svuint32_t a, svuint32_t b) { + uint64x2_t ar = vmovl_u32(vget_low_u32(svget_neonq(a))); + uint64x2_t br = vmovl_u32(vget_low_u32(svget_neonq(b))); + return svset_neonq_u64(svundef_u64(), vaddq_u64(ar, br)); +} + +/* +** add_neon_u64_from_u32_high_sve_bridged: +** uaddl2 v0.2d, v0.4s, v1.4s +** ret +*/ +svuint64_t add_neon_u64_from_u32_high_sve_bridged(svuint32_t a, svuint32_t b) { + uint64x2_t ar = vmovl_u32(vget_high_u32(svget_neonq(a))); + uint64x2_t br = vmovl_u32(vget_high_u32(svget_neonq(b))); + return svset_neonq_u64(svundef_u64(), vaddq_u64(ar, br)); +} + +/* +** sub_neon_u64_from_u32_low_sve_bridged: +** usubl v0.2d, v0.2s, v1.2s +** ret +*/ +svuint64_t sub_neon_u64_from_u32_low_sve_bridged(svuint32_t a, svuint32_t b) { + uint64x2_t ar = vmovl_u32(vget_low_u32(svget_neonq(a))); + uint64x2_t br = vmovl_u32(vget_low_u32(svget_neonq(b))); + return svset_neonq_u64(svundef_u64(), vsubq_u64(ar, br)); +} + +/* +** sub_neon_u64_from_u32_high_sve_bridged: +** usubl2 v0.2d, v0.4s, v1.4s +** ret +*/ +svuint64_t sub_neon_u64_from_u32_high_sve_bridged(svuint32_t a, svuint32_t b) { + uint64x2_t ar = vmovl_u32(vget_high_u32(svget_neonq(a))); + uint64x2_t br = vmovl_u32(vget_high_u32(svget_neonq(b))); + return svset_neonq_u64(svundef_u64(), vsubq_u64(ar, br)); +} diff --git a/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_10.c b/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_10.c index b7a7bc5..43abd01c 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_10.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_10.c @@ -20,5 +20,4 @@ foo (int start) } /* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */ -/* { dg-final { scan-tree-dump "pfa_iv_offset" "vect" } } */ /* { dg-final { scan-tree-dump "Alignment of access forced using peeling" "vect" } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_11.c b/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_11.c index feb7ee7..37806ad 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_11.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_11.c @@ -15,6 +15,5 @@ foo (int *a) { } /* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */ -/* { dg-final { scan-tree-dump "pfa_iv_offset" "vect" } } */ /* { dg-final { scan-tree-dump "Alignment of access forced using peeling" "vect" } } */ /* { dg-final { scan-assembler {\tnot\tp[0-7]\.b, p[0-7]/z, p.*\n} } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_12.c b/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_12.c index 260482a..e3ed63a 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_12.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_12.c @@ -15,7 +15,6 @@ foo (int *restrict a, int * restrict b) { } /* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */ -/* { dg-final { scan-tree-dump "pfa_iv_offset" "vect" } } */ /* { dg-final { scan-tree-dump "Both peeling and versioning will be applied" "vect" } } */ /* { dg-final { scan-assembler {\tnot\tp[0-7]\.b, p[0-7]/z, p.*\n} } } */ /* { dg-final { scan-assembler {\teor\t.*\n} } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_5.c b/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_5.c index a03bb1d..1977bf3 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_5.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_5.c @@ -20,5 +20,4 @@ foo (void) } /* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */ -/* { dg-final { scan-tree-dump "pfa_iv_offset" "vect" } } */ /* { dg-final { scan-tree-dump "Alignment of access forced using peeling" "vect" } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_6.c b/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_6.c index 9bfd1a6..0b40d26 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_6.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_6.c @@ -20,5 +20,4 @@ foo (int start) } /* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */ -/* { dg-final { scan-tree-dump "pfa_iv_offset" "vect" } } */ /* { dg-final { scan-tree-dump "Alignment of access forced using peeling" "vect" } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_7.c b/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_7.c index 0182e13..7a24d68 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_7.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_7.c @@ -20,5 +20,4 @@ foo (void) } /* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */ -/* { dg-final { scan-tree-dump "pfa_iv_offset" "vect" } } */ /* { dg-final { scan-tree-dump "Alignment of access forced using peeling" "vect" } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_9.c b/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_9.c index cc904e8..136d18c 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_9.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_9.c @@ -20,6 +20,6 @@ foo (void) } /* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */ -/* Peels using a scalar loop. */ -/* { dg-final { scan-tree-dump-not "pfa_iv_offset" "vect" } } */ +/* Peels using fully masked loop. */ +/* { dg-final { scan-tree-dump "misalignment for fully-masked loop" "vect" } } */ /* { dg-final { scan-tree-dump "Alignment of access forced using peeling" "vect" } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sve/pfalse-store.c b/gcc/testsuite/gcc.target/aarch64/sve/pfalse-store.c index 1539f58..39db13b 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/pfalse-store.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/pfalse-store.c @@ -46,8 +46,5 @@ ALL_DATA (st2, x2_t) ALL_DATA (st3, x3_t) ALL_DATA (st4, x4_t) -/* FIXME: Currently, st1/2/3/4 are not folded with a pfalse - predicate, which is the reason for the 48 missing cases below. Once - folding is implemented for these intrinsics, the sum should be 60. */ -/* { dg-final { scan-assembler-times {\t.cfi_startproc\n\tret\n} 12 } } */ +/* { dg-final { scan-assembler-times {\t.cfi_startproc\n\tret\n} 60 } } */ /* { dg-final { scan-assembler-times {\t.cfi_startproc\n} 60 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sve/pr119351.c b/gcc/testsuite/gcc.target/aarch64/sve/pr119351.c index 85aab35..1aca6c7 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/pr119351.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/pr119351.c @@ -14,7 +14,6 @@ int x[N] __attribute__((aligned(32))); ** ... ** ld1w z[0-9]+.s, p[0-9]+/z, \[x[0-9], x[0-9], lsl 2\] ** cmple p[0-9]+.s, p[0-9]+/z, z[0-9]+.s, #0 -** ptest p[0-9]+, p[0-9]+.b ** ... */ @@ -34,6 +33,5 @@ foo (void) } /* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */ -/* { dg-final { scan-tree-dump "pfa_iv_offset" "vect" } } */ /* { dg-final { scan-tree-dump "Alignment of access forced using peeling" "vect" } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch.c b/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch.c index d7cef11..48fb407 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch.c @@ -8,8 +8,7 @@ int b[N] = {0}; ** f1: ** ... ** cmpgt p[0-9]+.s, p[0-9]+/z, z[0-9]+.s, #0 -** ptest p[0-9]+, p[0-9]+.b -** b.(any|none) \.L[0-9]+ +** b(\.?eq|\.none) \.L[0-9]+ ** ... */ void f1 () @@ -25,8 +24,7 @@ void f1 () ** f2: ** ... ** cmpge p[0-9]+.s, p[0-9]+/z, z[0-9]+.s, #0 -** ptest p[0-9]+, p[0-9]+.b -** b.(any|none) \.L[0-9]+ +** b(\.?eq|\.none) \.L[0-9]+ ** ... */ void f2 () @@ -42,8 +40,7 @@ void f2 () ** f3: ** ... ** cmpeq p[0-9]+.s, p[0-9]+/z, z[0-9]+.s, #0 -** ptest p[0-9]+, p[0-9]+.b -** b.(any|none) \.L[0-9]+ +** b(\.?eq|\.none) \.L[0-9]+ ** ... */ void f3 () @@ -59,8 +56,7 @@ void f3 () ** f4: ** ... ** cmpne p[0-9]+.s, p[0-9]+/z, z[0-9]+.s, #0 -** ptest p[0-9]+, p[0-9]+.b -** b.(any|none) \.L[0-9]+ +** b(\.?eq|\.none) \.L[0-9]+ ** ... */ void f4 () @@ -76,8 +72,7 @@ void f4 () ** f5: ** ... ** cmplt p[0-9]+.s, p7/z, z[0-9]+.s, #0 -** ptest p[0-9]+, p[0-9]+.b -** b.(any|none) .L[0-9]+ +** b(\.?eq|\.none) .L[0-9]+ ** ... */ void f5 () @@ -93,8 +88,7 @@ void f5 () ** f6: ** ... ** cmple p[0-9]+.s, p[0-9]+/z, z[0-9]+.s, #0 -** ptest p[0-9]+, p[0-9]+.b -** b.(any|none) \.L[0-9]+ +** b(\.?eq|\.none) \.L[0-9]+ ** ... */ void f6 () diff --git a/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch_10.c b/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch_10.c new file mode 100644 index 0000000..e74f1fa --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch_10.c @@ -0,0 +1,132 @@ +/* { dg-do run { target aarch64_sve_hw } } */ +/* { dg-options "-O3 --param aarch64-autovec-preference=asimd-only" } */ +/* { dg-require-effective-target lp64 } */ + +#include <stdio.h> + +#define N 640 +#ifndef TYPE +#define TYPE unsigned int +#endif +#ifndef FMT +#define FMT "u" +#endif + + +TYPE a[N] = {0}; +TYPE b[N] = {0}; + +char *curr_test; + +/* Macro to define a function with a specific comparison */ +#define DEFINE_TEST_FUNC(NAME, OP) \ + __attribute__((noipa)) \ + void NAME(void) { \ + for (int i = 0; i < N; i++) { \ + b[i] += a[i]; \ + if (a[i] OP 0) \ + break; \ + } \ + } + +/* Generate the six comparisons functions using the macro. */ +DEFINE_TEST_FUNC(f1, >) +DEFINE_TEST_FUNC(f2, >=) +DEFINE_TEST_FUNC(f3, ==) +DEFINE_TEST_FUNC(f4, !=) +DEFINE_TEST_FUNC(f5, <) +DEFINE_TEST_FUNC(f6, <=) + +__attribute__((noreturn)) +static inline void __abort_trace (const char *m, int i, TYPE result, TYPE expected) +{ + printf ("*** [%s] FAIL AT %s:%d in %s - expected %" FMT " but got %" FMT " at pos %d\n", + m, __FILE__, __LINE__, curr_test, expected, result, i); + __builtin_abort (); +} + +/* Array setup macro. */ +#define RESET_ARRAYS(_aval, _idx, _force, _bval) \ + do { \ + _Pragma("GCC novector") \ + for (int i = 0; i < N; ++i) { \ + a[i] = _aval; \ + b[i] = _bval; \ + } \ + if (_idx >= 0 && _idx < N) \ + a[_idx] = _force; \ + } while (0) + +/* Value check macros. */ +#define CHECK_EQ(_i, _val) \ + do { \ + if (b[_i] != _val) \ + __abort_trace ("single", _i, b[_i], _val); \ + } while (0) + +#define CHECK_RANGE_EQ(_start, _end, _val) \ + do { \ + _Pragma("GCC novector") \ + for (int i = _start; i < _end; ++i) \ + if (b[i] != _val) \ + __abort_trace ("range", i, b[i], _val); \ + } while (0) + +#define str(s) #s +#define TEST_FUNC(_func, _aval, _idx, _force, _bval, _check_stmt) \ + do { \ + curr_test = str (_func); \ + RESET_ARRAYS((_aval), (_idx), (_force), (_bval)); \ + _func(); \ + _check_stmt; \ + } while (0) + +int main(void) { + /* Break on random intervals. */ + TEST_FUNC (f1, 1, 0, 1, 10, CHECK_EQ (0, 11); CHECK_EQ (1, 10)); + TEST_FUNC (f2, 6, 5, 0, 10, CHECK_EQ (0, 16); CHECK_EQ (5, 10)); + TEST_FUNC (f3, 3, 3, 0, 0, CHECK_EQ (0, 3); CHECK_EQ (3, 0)); + TEST_FUNC (f4, 0, 4, 1, 1, CHECK_EQ (4, 2); CHECK_EQ (5, 1)); + TEST_FUNC (f5, 2, 6, 0, 5, CHECK_EQ (6, 5); CHECK_EQ (7, 7)); + TEST_FUNC (f6, 2, 10, 0, 7, CHECK_EQ (10, 7); CHECK_EQ (11, 7)); + + /* Break on last iteration. */ + TEST_FUNC (f1, 0, N-1, 1, 1, + CHECK_RANGE_EQ (0, N-1, 1); CHECK_EQ (N-1, 2)); + + TEST_FUNC (f2, 0, N-1, 0, 4, + CHECK_RANGE_EQ (0, N-1, 4); CHECK_EQ (N-1, 4)); + + TEST_FUNC (f3, 2, N-1, 0, 0, + CHECK_RANGE_EQ(0, N-1, 2); CHECK_EQ (N-1, 0)); + + TEST_FUNC (f4, 0, N-1, 2, 1, + CHECK_RANGE_EQ (0, N-1, 1); CHECK_EQ (N-1, 3)); + + TEST_FUNC (f5, 4, N-1, 1, 6, + CHECK_RANGE_EQ (0, N-1, 10); CHECK_EQ (N-1, 7)); + + TEST_FUNC (f6, 5, N-1, 0, 7, + CHECK_RANGE_EQ (0, N-1, 12); CHECK_EQ (N-1, 7)); + + /* Condition never met — full loop executes. */ + TEST_FUNC (f1, 0, -1, 0, 2, + CHECK_RANGE_EQ (0, N, 2)); + + TEST_FUNC (f2, 0, -1, 0, 3, + CHECK_RANGE_EQ (0, N, 3)); + + TEST_FUNC (f3, 1, -1, 0, 0, + CHECK_RANGE_EQ (0, N, 1)); + + TEST_FUNC (f4, 0, -1, 0, 7, + CHECK_RANGE_EQ (0, N, 7)); + + TEST_FUNC (f5, 1, -1, 0, 4, + CHECK_RANGE_EQ (0, N, 5)); + + TEST_FUNC (f6, 5, -1, 0, 3, + CHECK_RANGE_EQ (0, N, 8)); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch_11.c b/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch_11.c new file mode 100644 index 0000000..7242327 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch_11.c @@ -0,0 +1,132 @@ +/* { dg-do run { target aarch64_sve_hw } } */ +/* { dg-options "-O3 --param aarch64-autovec-preference=sve-only" } */ +/* { dg-require-effective-target lp64 } */ + +#include <stdio.h> + +#define N 640 +#ifndef TYPE +#define TYPE unsigned int +#endif +#ifndef FMT +#define FMT "u" +#endif + + +TYPE a[N] = {0}; +TYPE b[N] = {0}; + +char *curr_test; + +/* Macro to define a function with a specific comparison */ +#define DEFINE_TEST_FUNC(NAME, OP) \ + __attribute__((noipa)) \ + void NAME(void) { \ + for (int i = 0; i < N; i++) { \ + b[i] += a[i]; \ + if (a[i] OP 0) \ + break; \ + } \ + } + +/* Generate the six comparisons functions using the macro. */ +DEFINE_TEST_FUNC(f1, >) +DEFINE_TEST_FUNC(f2, >=) +DEFINE_TEST_FUNC(f3, ==) +DEFINE_TEST_FUNC(f4, !=) +DEFINE_TEST_FUNC(f5, <) +DEFINE_TEST_FUNC(f6, <=) + +__attribute__((noreturn)) +static inline void __abort_trace (const char *m, int i, TYPE result, TYPE expected) +{ + printf ("*** [%s] FAIL AT %s:%d in %s - expected %" FMT " but got %" FMT " at pos %d\n", + m, __FILE__, __LINE__, curr_test, expected, result, i); + __builtin_abort (); +} + +/* Array setup macro. */ +#define RESET_ARRAYS(_aval, _idx, _force, _bval) \ + do { \ + _Pragma("GCC novector") \ + for (int i = 0; i < N; ++i) { \ + a[i] = _aval; \ + b[i] = _bval; \ + } \ + if (_idx >= 0 && _idx < N) \ + a[_idx] = _force; \ + } while (0) + +/* Value check macros. */ +#define CHECK_EQ(_i, _val) \ + do { \ + if (b[_i] != _val) \ + __abort_trace ("single", _i, b[_i], _val); \ + } while (0) + +#define CHECK_RANGE_EQ(_start, _end, _val) \ + do { \ + _Pragma("GCC novector") \ + for (int i = _start; i < _end; ++i) \ + if (b[i] != _val) \ + __abort_trace ("range", i, b[i], _val); \ + } while (0) + +#define str(s) #s +#define TEST_FUNC(_func, _aval, _idx, _force, _bval, _check_stmt) \ + do { \ + curr_test = str (_func); \ + RESET_ARRAYS((_aval), (_idx), (_force), (_bval)); \ + _func(); \ + _check_stmt; \ + } while (0) + +int main(void) { + /* Break on random intervals. */ + TEST_FUNC (f1, 1, 0, 1, 10, CHECK_EQ (0, 11); CHECK_EQ (1, 10)); + TEST_FUNC (f2, 6, 5, 0, 10, CHECK_EQ (0, 16); CHECK_EQ (5, 10)); + TEST_FUNC (f3, 3, 3, 0, 0, CHECK_EQ (0, 3); CHECK_EQ (3, 0)); + TEST_FUNC (f4, 0, 4, 1, 1, CHECK_EQ (4, 2); CHECK_EQ (5, 1)); + TEST_FUNC (f5, 2, 6, 0, 5, CHECK_EQ (6, 5); CHECK_EQ (7, 7)); + TEST_FUNC (f6, 2, 10, 0, 7, CHECK_EQ (10, 7); CHECK_EQ (11, 7)); + + /* Break on last iteration. */ + TEST_FUNC (f1, 0, N-1, 1, 1, + CHECK_RANGE_EQ (0, N-1, 1); CHECK_EQ (N-1, 2)); + + TEST_FUNC (f2, 0, N-1, 0, 4, + CHECK_RANGE_EQ (0, N-1, 4); CHECK_EQ (N-1, 4)); + + TEST_FUNC (f3, 2, N-1, 0, 0, + CHECK_RANGE_EQ(0, N-1, 2); CHECK_EQ (N-1, 0)); + + TEST_FUNC (f4, 0, N-1, 2, 1, + CHECK_RANGE_EQ (0, N-1, 1); CHECK_EQ (N-1, 3)); + + TEST_FUNC (f5, 4, N-1, 1, 6, + CHECK_RANGE_EQ (0, N-1, 10); CHECK_EQ (N-1, 7)); + + TEST_FUNC (f6, 5, N-1, 0, 7, + CHECK_RANGE_EQ (0, N-1, 12); CHECK_EQ (N-1, 7)); + + /* Condition never met — full loop executes. */ + TEST_FUNC (f1, 0, -1, 0, 2, + CHECK_RANGE_EQ (0, N, 2)); + + TEST_FUNC (f2, 0, -1, 0, 3, + CHECK_RANGE_EQ (0, N, 3)); + + TEST_FUNC (f3, 1, -1, 0, 0, + CHECK_RANGE_EQ (0, N, 1)); + + TEST_FUNC (f4, 0, -1, 0, 7, + CHECK_RANGE_EQ (0, N, 7)); + + TEST_FUNC (f5, 1, -1, 0, 4, + CHECK_RANGE_EQ (0, N, 5)); + + TEST_FUNC (f6, 5, -1, 0, 3, + CHECK_RANGE_EQ (0, N, 8)); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch_12.c b/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch_12.c new file mode 100644 index 0000000..e2290e9 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch_12.c @@ -0,0 +1,132 @@ +/* { dg-do run { target aarch64_sve_hw } } */ +/* { dg-options "-O3 --param aarch64-autovec-preference=asimd-only" } */ +/* { dg-require-effective-target lp64 } */ + +#include <stdio.h> + +#define N 640 +#ifndef TYPE +#define TYPE float +#endif +#ifndef FMT +#define FMT ".6f" +#endif + + +TYPE a[N] = {0}; +TYPE b[N] = {0}; + +char *curr_test; + +/* Macro to define a function with a specific comparison */ +#define DEFINE_TEST_FUNC(NAME, OP) \ + __attribute__((noipa)) \ + void NAME(void) { \ + for (int i = 0; i < N; i++) { \ + b[i] += a[i]; \ + if (a[i] OP 0) \ + break; \ + } \ + } + +/* Generate the six comparisons functions using the macro. */ +DEFINE_TEST_FUNC(f1, >) +DEFINE_TEST_FUNC(f2, >=) +DEFINE_TEST_FUNC(f3, ==) +DEFINE_TEST_FUNC(f4, !=) +DEFINE_TEST_FUNC(f5, <) +DEFINE_TEST_FUNC(f6, <=) + +__attribute__((noreturn)) +static inline void __abort_trace (const char *m, int i, TYPE result, TYPE expected) +{ + printf ("*** [%s] FAIL AT %s:%d in %s - expected %" FMT " but got %" FMT " at pos %d\n", + m, __FILE__, __LINE__, curr_test, expected, result, i); + __builtin_abort (); +} + +/* Array setup macro. */ +#define RESET_ARRAYS(_aval, _idx, _force, _bval) \ + do { \ + _Pragma("GCC novector") \ + for (int i = 0; i < N; ++i) { \ + a[i] = _aval; \ + b[i] = _bval; \ + } \ + if (_idx >= 0 && _idx < N) \ + a[_idx] = _force; \ + } while (0) + +/* Value check macros. */ +#define CHECK_EQ(_i, _val) \ + do { \ + if (b[_i] != _val) \ + __abort_trace ("single", _i, b[_i], _val); \ + } while (0) + +#define CHECK_RANGE_EQ(_start, _end, _val) \ + do { \ + _Pragma("GCC novector") \ + for (int i = _start; i < _end; ++i) \ + if (b[i] != _val) \ + __abort_trace ("range", i, b[i], _val); \ + } while (0) + +#define str(s) #s +#define TEST_FUNC(_func, _aval, _idx, _force, _bval, _check_stmt) \ + do { \ + curr_test = str (_func); \ + RESET_ARRAYS((_aval), (_idx), (_force), (_bval)); \ + _func(); \ + _check_stmt; \ + } while (0) + +int main(void) { + /* Break on random intervals. */ + TEST_FUNC (f1, 1, 0, 1, 10, CHECK_EQ (0, 11); CHECK_EQ (1, 10)); + TEST_FUNC (f2, -1, 5, 0, 10, CHECK_EQ (0, 9); CHECK_EQ (5, 10)); + TEST_FUNC (f3, 3, 3, 0, 0, CHECK_EQ (0, 3); CHECK_EQ (3, 0)); + TEST_FUNC (f4, 0, 4, 1, 1, CHECK_EQ (4, 2); CHECK_EQ (5, 1)); + TEST_FUNC (f5, 1, 6, -1, 5, CHECK_EQ (6, 4); CHECK_EQ (7, 5)); + TEST_FUNC (f6, 2, 10, 0, 7, CHECK_EQ (10, 7); CHECK_EQ (11, 7)); + + /* Break on last iteration. */ + TEST_FUNC (f1, 0, N-1, 1, 1, + CHECK_RANGE_EQ (0, N-1, 1); CHECK_EQ (N-1, 2)); + + TEST_FUNC (f2, -5, N-1, 0, 9, + CHECK_RANGE_EQ (0, N-1, 4); CHECK_EQ (N-1, 9)); + + TEST_FUNC (f3, 2, N-1, 0, 0, + CHECK_RANGE_EQ(0, N-1, 2); CHECK_EQ (N-1, 0)); + + TEST_FUNC (f4, 0, N-1, 2, 1, + CHECK_RANGE_EQ (0, N-1, 1); CHECK_EQ (N-1, 3)); + + TEST_FUNC (f5, 2, N-1, -3, 6, + CHECK_RANGE_EQ (0, N-1, 8); CHECK_EQ (N-1, 3)); + + TEST_FUNC (f6, 5, N-1, 0, 7, + CHECK_RANGE_EQ (0, N-1, 12); CHECK_EQ (N-1, 7)); + + /* Condition never met — full loop executes. */ + TEST_FUNC (f1, 0, -1, 0, 2, + CHECK_RANGE_EQ (0, N, 2)); + + TEST_FUNC (f2, -2, -1, 0, 5, + CHECK_RANGE_EQ (0, N, 3)); + + TEST_FUNC (f3, 1, -1, 0, 0, + CHECK_RANGE_EQ (0, N, 1)); + + TEST_FUNC (f4, 0, -1, 0, 7, + CHECK_RANGE_EQ (0, N, 7)); + + TEST_FUNC (f5, 1, -1, 0, 4, + CHECK_RANGE_EQ (0, N, 5)); + + TEST_FUNC (f6, 5, -1, 0, 3, + CHECK_RANGE_EQ (0, N, 8)); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch_13.c b/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch_13.c new file mode 100644 index 0000000..eb2295f --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch_13.c @@ -0,0 +1,132 @@ +/* { dg-do run { target aarch64_sve_hw } } */ +/* { dg-options "-O3 --param aarch64-autovec-preference=sve-only" } */ +/* { dg-require-effective-target lp64 } */ + +#include <stdio.h> + +#define N 640 +#ifndef TYPE +#define TYPE float +#endif +#ifndef FMT +#define FMT ".6f" +#endif + + +TYPE a[N] = {0}; +TYPE b[N] = {0}; + +char *curr_test; + +/* Macro to define a function with a specific comparison */ +#define DEFINE_TEST_FUNC(NAME, OP) \ + __attribute__((noipa)) \ + void NAME(void) { \ + for (int i = 0; i < N; i++) { \ + b[i] += a[i]; \ + if (a[i] OP 0) \ + break; \ + } \ + } + +/* Generate the six comparisons functions using the macro. */ +DEFINE_TEST_FUNC(f1, >) +DEFINE_TEST_FUNC(f2, >=) +DEFINE_TEST_FUNC(f3, ==) +DEFINE_TEST_FUNC(f4, !=) +DEFINE_TEST_FUNC(f5, <) +DEFINE_TEST_FUNC(f6, <=) + +__attribute__((noreturn)) +static inline void __abort_trace (const char *m, int i, TYPE result, TYPE expected) +{ + printf ("*** [%s] FAIL AT %s:%d in %s - expected %" FMT " but got %" FMT " at pos %d\n", + m, __FILE__, __LINE__, curr_test, expected, result, i); + __builtin_abort (); +} + +/* Array setup macro. */ +#define RESET_ARRAYS(_aval, _idx, _force, _bval) \ + do { \ + _Pragma("GCC novector") \ + for (int i = 0; i < N; ++i) { \ + a[i] = _aval; \ + b[i] = _bval; \ + } \ + if (_idx >= 0 && _idx < N) \ + a[_idx] = _force; \ + } while (0) + +/* Value check macros. */ +#define CHECK_EQ(_i, _val) \ + do { \ + if (b[_i] != _val) \ + __abort_trace ("single", _i, b[_i], _val); \ + } while (0) + +#define CHECK_RANGE_EQ(_start, _end, _val) \ + do { \ + _Pragma("GCC novector") \ + for (int i = _start; i < _end; ++i) \ + if (b[i] != _val) \ + __abort_trace ("range", i, b[i], _val); \ + } while (0) + +#define str(s) #s +#define TEST_FUNC(_func, _aval, _idx, _force, _bval, _check_stmt) \ + do { \ + curr_test = str (_func); \ + RESET_ARRAYS((_aval), (_idx), (_force), (_bval)); \ + _func(); \ + _check_stmt; \ + } while (0) + +int main(void) { + /* Break on random intervals. */ + TEST_FUNC (f1, 1, 0, 1, 10, CHECK_EQ (0, 11); CHECK_EQ (1, 10)); + TEST_FUNC (f2, -1, 5, 0, 10, CHECK_EQ (0, 9); CHECK_EQ (5, 10)); + TEST_FUNC (f3, 3, 3, 0, 0, CHECK_EQ (0, 3); CHECK_EQ (3, 0)); + TEST_FUNC (f4, 0, 4, 1, 1, CHECK_EQ (4, 2); CHECK_EQ (5, 1)); + TEST_FUNC (f5, 1, 6, -1, 5, CHECK_EQ (6, 4); CHECK_EQ (7, 5)); + TEST_FUNC (f6, 2, 10, 0, 7, CHECK_EQ (10, 7); CHECK_EQ (11, 7)); + + /* Break on last iteration. */ + TEST_FUNC (f1, 0, N-1, 1, 1, + CHECK_RANGE_EQ (0, N-1, 1); CHECK_EQ (N-1, 2)); + + TEST_FUNC (f2, -5, N-1, 0, 9, + CHECK_RANGE_EQ (0, N-1, 4); CHECK_EQ (N-1, 9)); + + TEST_FUNC (f3, 2, N-1, 0, 0, + CHECK_RANGE_EQ(0, N-1, 2); CHECK_EQ (N-1, 0)); + + TEST_FUNC (f4, 0, N-1, 2, 1, + CHECK_RANGE_EQ (0, N-1, 1); CHECK_EQ (N-1, 3)); + + TEST_FUNC (f5, 2, N-1, -3, 6, + CHECK_RANGE_EQ (0, N-1, 8); CHECK_EQ (N-1, 3)); + + TEST_FUNC (f6, 5, N-1, 0, 7, + CHECK_RANGE_EQ (0, N-1, 12); CHECK_EQ (N-1, 7)); + + /* Condition never met — full loop executes. */ + TEST_FUNC (f1, 0, -1, 0, 2, + CHECK_RANGE_EQ (0, N, 2)); + + TEST_FUNC (f2, -2, -1, 0, 5, + CHECK_RANGE_EQ (0, N, 3)); + + TEST_FUNC (f3, 1, -1, 0, 0, + CHECK_RANGE_EQ (0, N, 1)); + + TEST_FUNC (f4, 0, -1, 0, 7, + CHECK_RANGE_EQ (0, N, 7)); + + TEST_FUNC (f5, 1, -1, 0, 4, + CHECK_RANGE_EQ (0, N, 5)); + + TEST_FUNC (f6, 5, -1, 0, 3, + CHECK_RANGE_EQ (0, N, 8)); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch_14.c b/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch_14.c new file mode 100644 index 0000000..5cc4d6a --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch_14.c @@ -0,0 +1,147 @@ +/* { dg-do run { target aarch64_sve_hw } } */ +/* { dg-options "-Ofast --param aarch64-autovec-preference=asimd-only" } */ +/* { dg-require-effective-target lp64 } */ + +#include <stdio.h> +#include <math.h> + +#define N 640 +#ifndef TYPE +#define TYPE double +#endif +#ifndef FMT +#define FMT ".6f" +#endif + +TYPE a[N] = {0}; +TYPE b[N] = {0}; + +char *curr_test; + +/* Macro to define a function with a specific comparison */ +#define DEFINE_TEST_FUNC(NAME, OP) \ + __attribute__((noipa)) \ + void NAME(void) { \ + for (int i = 0; i < N; i++) { \ + b[i] += a[i]; \ + if (a[i] OP 0) \ + break; \ + } \ + } + +/* Generate comparison functions */ +DEFINE_TEST_FUNC(f1, >) +DEFINE_TEST_FUNC(f2, >=) +DEFINE_TEST_FUNC(f3, ==) +DEFINE_TEST_FUNC(f4, !=) +DEFINE_TEST_FUNC(f5, <) +DEFINE_TEST_FUNC(f6, <=) + +/* Example unordered-sensitive loop: breaks if a[i] is unordered with 0 */ +__attribute__((noipa)) +void f7(void) { + for (int i = 0; i < N; i++) { + b[i] += a[i]; + if (__builtin_isunordered(a[i], 0.0)) + break; + } +} + +__attribute__((noreturn)) +static inline void __abort_trace(const char *m, int i, TYPE result, TYPE expected) { + printf("*** [%s] FAIL AT %s:%d in %s - expected %" FMT " but got %" FMT " at pos %d\n", + m, __FILE__, __LINE__, curr_test, expected, result, i); + __builtin_abort(); +} + +/* Array setup */ +#define RESET_ARRAYS(_aval, _idx, _force, _bval) \ + do { \ + _Pragma("GCC novector") \ + for (int i = 0; i < N; ++i) { \ + a[i] = _aval; \ + b[i] = _bval; \ + } \ + if (_idx >= 0 && _idx < N) \ + a[_idx] = _force; \ + } while (0) + +/* Floating-point comparison macros (with unordered handling) */ +#define CHECK_EQ(_i, _val) do { \ + if (__builtin_isnan (_val) != __builtin_isnan (b[_i]) \ + && b[_i] != _val) \ + __abort_trace ("single", _i, b[_i], _val); \ +} while (0) + +#define CHECK_RANGE_EQ(_start, _end, _val) do { \ + _Pragma("GCC novector") \ + for (int i = _start; i < _end; ++i) \ + if (__builtin_isnan (_val) != __builtin_isnan (b[i]) \ + && b[i] != _val) \ + __abort_trace ("range", i, b[i], _val); \ +} while (0) + +#define str(s) #s +#define TEST_FUNC(_func, _aval, _idx, _force, _bval, _check_stmt) \ + do { \ + curr_test = str (_func); \ + RESET_ARRAYS((_aval), (_idx), (_force), (_bval)); \ + _func(); \ + _check_stmt; \ + } while (0) + +int main(void) { + /* Break on random intervals. */ + TEST_FUNC(f1, 1.0, 0, 1.0, 10.0, CHECK_EQ(0, 11.0); CHECK_EQ(1, 10.0)); + TEST_FUNC(f2, -1.0, 5, 0.0, 10.0, CHECK_EQ(0, 9.0); CHECK_EQ(5, 10.0)); + TEST_FUNC(f3, 3.0, 3, 0.0, 0.0, CHECK_EQ(0, 3.0); CHECK_EQ(3, 0.0)); + TEST_FUNC(f4, 0.0, 4, 1.0, 1.0, CHECK_EQ(4, 2.0); CHECK_EQ(5, 1.0)); + TEST_FUNC(f5, 1.0, 6, -1.0, 5.0, CHECK_EQ(6, 4.0); CHECK_EQ(7, 5.0)); + TEST_FUNC(f6, 2.0, 10, 0.0, 7.0, CHECK_EQ(10, 7.0); CHECK_EQ(11, 7.0)); + + /* Break on last iteration. */ + TEST_FUNC(f1, 0.0, N - 1, 1.0, 1.0, + CHECK_RANGE_EQ(0, N - 1, 1.0); CHECK_EQ(N - 1, 2.0)); + + TEST_FUNC(f2, -5.0, N - 1, 0.0, 9.0, + CHECK_RANGE_EQ(0, N - 1, 4.0); CHECK_EQ(N - 1, 9.0)); + + TEST_FUNC(f3, 2.0, N - 1, 0.0, 0.0, + CHECK_RANGE_EQ(0, N - 1, 2.0); CHECK_EQ(N - 1, 0.0)); + + TEST_FUNC(f4, 0.0, N - 1, 2.0, 1.0, + CHECK_RANGE_EQ(0, N - 1, 1.0); CHECK_EQ(N - 1, 3.0)); + + TEST_FUNC(f5, 2.0, N - 1, -3.0, 6.0, + CHECK_RANGE_EQ(0, N - 1, 8.0); CHECK_EQ(N - 1, 3.0)); + + TEST_FUNC(f6, 5.0, N - 1, 0.0, 7.0, + CHECK_RANGE_EQ(0, N - 1, 12.0); CHECK_EQ(N - 1, 7.0)); + + /* Condition never met — full loop executes. */ + TEST_FUNC(f1, 0.0, -1, 0.0, 2.0, + CHECK_RANGE_EQ(0, N, 2.0)); + + TEST_FUNC(f2, -2.0, -1, 0.0, 5.0, + CHECK_RANGE_EQ(0, N, 3.0)); + + TEST_FUNC(f3, 1.0, -1, 0.0, 0.0, + CHECK_RANGE_EQ(0, N, 1.0)); + + TEST_FUNC(f4, 0.0, -1, 0.0, 7.0, + CHECK_RANGE_EQ(0, N, 7.0)); + + TEST_FUNC(f5, 1.0, -1, 0.0, 4.0, + CHECK_RANGE_EQ(0, N, 5.0)); + + TEST_FUNC(f6, 5.0, -1, 0.0, 3.0, + CHECK_RANGE_EQ(0, N, 8.0)); + +#if !defined(__FAST_MATH__) + /* Unordered break (NAN in a[i]) */ + TEST_FUNC(f7, 1.0, 123, NAN, 2.0, + CHECK_RANGE_EQ(0, 123, 3.0); CHECK_EQ(123, NAN)); +#endif + + return 0; +} diff --git a/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch_15.c b/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch_15.c new file mode 100644 index 0000000..3dd7a60 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch_15.c @@ -0,0 +1,132 @@ +/* { dg-do run { target aarch64_sve_hw } } */ +/* { dg-options "-Ofast --param aarch64-autovec-preference=asimd-only" } */ +/* { dg-require-effective-target lp64 } */ + +#include <stdio.h> + +#define N 640 +#ifndef TYPE +#define TYPE float +#endif +#ifndef FMT +#define FMT ".6f" +#endif + + +TYPE a[N] = {0}; +TYPE b[N] = {0}; + +char *curr_test; + +/* Macro to define a function with a specific comparison */ +#define DEFINE_TEST_FUNC(NAME, OP) \ + __attribute__((noipa)) \ + void NAME(void) { \ + for (int i = 0; i < N; i++) { \ + b[i] += a[i]; \ + if (a[i] OP 0) \ + break; \ + } \ + } + +/* Generate the six comparisons functions using the macro. */ +DEFINE_TEST_FUNC(f1, >) +DEFINE_TEST_FUNC(f2, >=) +DEFINE_TEST_FUNC(f3, ==) +DEFINE_TEST_FUNC(f4, !=) +DEFINE_TEST_FUNC(f5, <) +DEFINE_TEST_FUNC(f6, <=) + +__attribute__((noreturn)) +static inline void __abort_trace (const char *m, int i, TYPE result, TYPE expected) +{ + printf ("*** [%s] FAIL AT %s:%d in %s - expected %" FMT " but got %" FMT " at pos %d\n", + m, __FILE__, __LINE__, curr_test, expected, result, i); + __builtin_abort (); +} + +/* Array setup macro. */ +#define RESET_ARRAYS(_aval, _idx, _force, _bval) \ + do { \ + _Pragma("GCC novector") \ + for (int i = 0; i < N; ++i) { \ + a[i] = _aval; \ + b[i] = _bval; \ + } \ + if (_idx >= 0 && _idx < N) \ + a[_idx] = _force; \ + } while (0) + +/* Value check macros. */ +#define CHECK_EQ(_i, _val) \ + do { \ + if (b[_i] != _val) \ + __abort_trace ("single", _i, b[_i], _val); \ + } while (0) + +#define CHECK_RANGE_EQ(_start, _end, _val) \ + do { \ + _Pragma("GCC novector") \ + for (int i = _start; i < _end; ++i) \ + if (b[i] != _val) \ + __abort_trace ("range", i, b[i], _val); \ + } while (0) + +#define str(s) #s +#define TEST_FUNC(_func, _aval, _idx, _force, _bval, _check_stmt) \ + do { \ + curr_test = str (_func); \ + RESET_ARRAYS((_aval), (_idx), (_force), (_bval)); \ + _func(); \ + _check_stmt; \ + } while (0) + +int main(void) { + /* Break on random intervals. */ + TEST_FUNC (f1, 1, 0, 1, 10, CHECK_EQ (0, 11); CHECK_EQ (1, 10)); + TEST_FUNC (f2, -1, 5, 0, 10, CHECK_EQ (0, 9); CHECK_EQ (5, 10)); + TEST_FUNC (f3, 3, 3, 0, 0, CHECK_EQ (0, 3); CHECK_EQ (3, 0)); + TEST_FUNC (f4, 0, 4, 1, 1, CHECK_EQ (4, 2); CHECK_EQ (5, 1)); + TEST_FUNC (f5, 1, 6, -1, 5, CHECK_EQ (6, 4); CHECK_EQ (7, 5)); + TEST_FUNC (f6, 2, 10, 0, 7, CHECK_EQ (10, 7); CHECK_EQ (11, 7)); + + /* Break on last iteration. */ + TEST_FUNC (f1, 0, N-1, 1, 1, + CHECK_RANGE_EQ (0, N-1, 1); CHECK_EQ (N-1, 2)); + + TEST_FUNC (f2, -5, N-1, 0, 9, + CHECK_RANGE_EQ (0, N-1, 4); CHECK_EQ (N-1, 9)); + + TEST_FUNC (f3, 2, N-1, 0, 0, + CHECK_RANGE_EQ(0, N-1, 2); CHECK_EQ (N-1, 0)); + + TEST_FUNC (f4, 0, N-1, 2, 1, + CHECK_RANGE_EQ (0, N-1, 1); CHECK_EQ (N-1, 3)); + + TEST_FUNC (f5, 2, N-1, -3, 6, + CHECK_RANGE_EQ (0, N-1, 8); CHECK_EQ (N-1, 3)); + + TEST_FUNC (f6, 5, N-1, 0, 7, + CHECK_RANGE_EQ (0, N-1, 12); CHECK_EQ (N-1, 7)); + + /* Condition never met — full loop executes. */ + TEST_FUNC (f1, 0, -1, 0, 2, + CHECK_RANGE_EQ (0, N, 2)); + + TEST_FUNC (f2, -2, -1, 0, 5, + CHECK_RANGE_EQ (0, N, 3)); + + TEST_FUNC (f3, 1, -1, 0, 0, + CHECK_RANGE_EQ (0, N, 1)); + + TEST_FUNC (f4, 0, -1, 0, 7, + CHECK_RANGE_EQ (0, N, 7)); + + TEST_FUNC (f5, 1, -1, 0, 4, + CHECK_RANGE_EQ (0, N, 5)); + + TEST_FUNC (f6, 5, -1, 0, 3, + CHECK_RANGE_EQ (0, N, 8)); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch_2.c b/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch_2.c new file mode 100644 index 0000000..15e9b29 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch_2.c @@ -0,0 +1,132 @@ +/* { dg-do run { target aarch64_sve_hw } } */ +/* { dg-options "-O3 --param aarch64-autovec-preference=asimd-only" } */ +/* { dg-require-effective-target lp64 } */ + +#include <stdio.h> + +#define N 640 +#ifndef TYPE +#define TYPE int +#endif +#ifndef FMT +#define FMT "d" +#endif + + +TYPE a[N] = {0}; +TYPE b[N] = {0}; + +char *curr_test; + +/* Macro to define a function with a specific comparison */ +#define DEFINE_TEST_FUNC(NAME, OP) \ + __attribute__((noipa)) \ + void NAME(void) { \ + for (int i = 0; i < N; i++) { \ + b[i] += a[i]; \ + if (a[i] OP 0) \ + break; \ + } \ + } + +/* Generate the six comparisons functions using the macro. */ +DEFINE_TEST_FUNC(f1, >) +DEFINE_TEST_FUNC(f2, >=) +DEFINE_TEST_FUNC(f3, ==) +DEFINE_TEST_FUNC(f4, !=) +DEFINE_TEST_FUNC(f5, <) +DEFINE_TEST_FUNC(f6, <=) + +__attribute__((noreturn)) +static inline void __abort_trace (const char *m, int i, TYPE result, TYPE expected) +{ + printf ("*** [%s] FAIL AT %s:%d in %s - expected %" FMT " but got %" FMT " at pos %d\n", + m, __FILE__, __LINE__, curr_test, expected, result, i); + __builtin_abort (); +} + +/* Array setup macro. */ +#define RESET_ARRAYS(_aval, _idx, _force, _bval) \ + do { \ + _Pragma("GCC novector") \ + for (int i = 0; i < N; ++i) { \ + a[i] = _aval; \ + b[i] = _bval; \ + } \ + if (_idx >= 0 && _idx < N) \ + a[_idx] = _force; \ + } while (0) + +/* Value check macros. */ +#define CHECK_EQ(_i, _val) \ + do { \ + if (b[_i] != _val) \ + __abort_trace ("single", _i, b[_i], _val); \ + } while (0) + +#define CHECK_RANGE_EQ(_start, _end, _val) \ + do { \ + _Pragma("GCC novector") \ + for (int i = _start; i < _end; ++i) \ + if (b[i] != _val) \ + __abort_trace ("range", i, b[i], _val); \ + } while (0) + +#define str(s) #s +#define TEST_FUNC(_func, _aval, _idx, _force, _bval, _check_stmt) \ + do { \ + curr_test = str (_func); \ + RESET_ARRAYS((_aval), (_idx), (_force), (_bval)); \ + _func(); \ + _check_stmt; \ + } while (0) + +int main(void) { + /* Break on random intervals. */ + TEST_FUNC (f1, 1, 0, 1, 10, CHECK_EQ (0, 11); CHECK_EQ (1, 10)); + TEST_FUNC (f2, -1, 5, 0, 10, CHECK_EQ (0, 9); CHECK_EQ (5, 10)); + TEST_FUNC (f3, 3, 3, 0, 0, CHECK_EQ (0, 3); CHECK_EQ (3, 0)); + TEST_FUNC (f4, 0, 4, 1, 1, CHECK_EQ (4, 2); CHECK_EQ (5, 1)); + TEST_FUNC (f5, 1, 6, -1, 5, CHECK_EQ (6, 4); CHECK_EQ (7, 5)); + TEST_FUNC (f6, 2, 10, 0, 7, CHECK_EQ (10, 7); CHECK_EQ (11, 7)); + + /* Break on last iteration. */ + TEST_FUNC (f1, 0, N-1, 1, 1, + CHECK_RANGE_EQ (0, N-1, 1); CHECK_EQ (N-1, 2)); + + TEST_FUNC (f2, -5, N-1, 0, 9, + CHECK_RANGE_EQ (0, N-1, 4); CHECK_EQ (N-1, 9)); + + TEST_FUNC (f3, 2, N-1, 0, 0, + CHECK_RANGE_EQ(0, N-1, 2); CHECK_EQ (N-1, 0)); + + TEST_FUNC (f4, 0, N-1, 2, 1, + CHECK_RANGE_EQ (0, N-1, 1); CHECK_EQ (N-1, 3)); + + TEST_FUNC (f5, 2, N-1, -3, 6, + CHECK_RANGE_EQ (0, N-1, 8); CHECK_EQ (N-1, 3)); + + TEST_FUNC (f6, 5, N-1, 0, 7, + CHECK_RANGE_EQ (0, N-1, 12); CHECK_EQ (N-1, 7)); + + /* Condition never met — full loop executes. */ + TEST_FUNC (f1, 0, -1, 0, 2, + CHECK_RANGE_EQ (0, N, 2)); + + TEST_FUNC (f2, -2, -1, 0, 5, + CHECK_RANGE_EQ (0, N, 3)); + + TEST_FUNC (f3, 1, -1, 0, 0, + CHECK_RANGE_EQ (0, N, 1)); + + TEST_FUNC (f4, 0, -1, 0, 7, + CHECK_RANGE_EQ (0, N, 7)); + + TEST_FUNC (f5, 1, -1, 0, 4, + CHECK_RANGE_EQ (0, N, 5)); + + TEST_FUNC (f6, 5, -1, 0, 3, + CHECK_RANGE_EQ (0, N, 8)); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch_3.c b/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch_3.c new file mode 100644 index 0000000..da0d90a --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch_3.c @@ -0,0 +1,132 @@ +/* { dg-do run { target aarch64_sve_hw } } */ +/* { dg-options "-O3 --param aarch64-autovec-preference=sve-only" } */ +/* { dg-require-effective-target lp64 } */ + +#include <stdio.h> + +#define N 640 +#ifndef TYPE +#define TYPE int +#endif +#ifndef FMT +#define FMT "d" +#endif + + +TYPE a[N] = {0}; +TYPE b[N] = {0}; + +char *curr_test; + +/* Macro to define a function with a specific comparison */ +#define DEFINE_TEST_FUNC(NAME, OP) \ + __attribute__((noipa)) \ + void NAME(void) { \ + for (int i = 0; i < N; i++) { \ + b[i] += a[i]; \ + if (a[i] OP 0) \ + break; \ + } \ + } + +/* Generate the six comparisons functions using the macro. */ +DEFINE_TEST_FUNC(f1, >) +DEFINE_TEST_FUNC(f2, >=) +DEFINE_TEST_FUNC(f3, ==) +DEFINE_TEST_FUNC(f4, !=) +DEFINE_TEST_FUNC(f5, <) +DEFINE_TEST_FUNC(f6, <=) + +__attribute__((noreturn)) +static inline void __abort_trace (const char *m, int i, TYPE result, TYPE expected) +{ + printf ("*** [%s] FAIL AT %s:%d in %s - expected %" FMT " but got %" FMT " at pos %d\n", + m, __FILE__, __LINE__, curr_test, expected, result, i); + __builtin_abort (); +} + +/* Array setup macro. */ +#define RESET_ARRAYS(_aval, _idx, _force, _bval) \ + do { \ + _Pragma("GCC novector") \ + for (int i = 0; i < N; ++i) { \ + a[i] = _aval; \ + b[i] = _bval; \ + } \ + if (_idx >= 0 && _idx < N) \ + a[_idx] = _force; \ + } while (0) + +/* Value check macros. */ +#define CHECK_EQ(_i, _val) \ + do { \ + if (b[_i] != _val) \ + __abort_trace ("single", _i, b[_i], _val); \ + } while (0) + +#define CHECK_RANGE_EQ(_start, _end, _val) \ + do { \ + _Pragma("GCC novector") \ + for (int i = _start; i < _end; ++i) \ + if (b[i] != _val) \ + __abort_trace ("range", i, b[i], _val); \ + } while (0) + +#define str(s) #s +#define TEST_FUNC(_func, _aval, _idx, _force, _bval, _check_stmt) \ + do { \ + curr_test = str (_func); \ + RESET_ARRAYS((_aval), (_idx), (_force), (_bval)); \ + _func(); \ + _check_stmt; \ + } while (0) + +int main(void) { + /* Break on random intervals. */ + TEST_FUNC (f1, 1, 0, 1, 10, CHECK_EQ (0, 11); CHECK_EQ (1, 10)); + TEST_FUNC (f2, -1, 5, 0, 10, CHECK_EQ (0, 9); CHECK_EQ (5, 10)); + TEST_FUNC (f3, 3, 3, 0, 0, CHECK_EQ (0, 3); CHECK_EQ (3, 0)); + TEST_FUNC (f4, 0, 4, 1, 1, CHECK_EQ (4, 2); CHECK_EQ (5, 1)); + TEST_FUNC (f5, 1, 6, -1, 5, CHECK_EQ (6, 4); CHECK_EQ (7, 5)); + TEST_FUNC (f6, 2, 10, 0, 7, CHECK_EQ (10, 7); CHECK_EQ (11, 7)); + + /* Break on last iteration. */ + TEST_FUNC (f1, 0, N-1, 1, 1, + CHECK_RANGE_EQ (0, N-1, 1); CHECK_EQ (N-1, 2)); + + TEST_FUNC (f2, -5, N-1, 0, 9, + CHECK_RANGE_EQ (0, N-1, 4); CHECK_EQ (N-1, 9)); + + TEST_FUNC (f3, 2, N-1, 0, 0, + CHECK_RANGE_EQ(0, N-1, 2); CHECK_EQ (N-1, 0)); + + TEST_FUNC (f4, 0, N-1, 2, 1, + CHECK_RANGE_EQ (0, N-1, 1); CHECK_EQ (N-1, 3)); + + TEST_FUNC (f5, 2, N-1, -3, 6, + CHECK_RANGE_EQ (0, N-1, 8); CHECK_EQ (N-1, 3)); + + TEST_FUNC (f6, 5, N-1, 0, 7, + CHECK_RANGE_EQ (0, N-1, 12); CHECK_EQ (N-1, 7)); + + /* Condition never met — full loop executes. */ + TEST_FUNC (f1, 0, -1, 0, 2, + CHECK_RANGE_EQ (0, N, 2)); + + TEST_FUNC (f2, -2, -1, 0, 5, + CHECK_RANGE_EQ (0, N, 3)); + + TEST_FUNC (f3, 1, -1, 0, 0, + CHECK_RANGE_EQ (0, N, 1)); + + TEST_FUNC (f4, 0, -1, 0, 7, + CHECK_RANGE_EQ (0, N, 7)); + + TEST_FUNC (f5, 1, -1, 0, 4, + CHECK_RANGE_EQ (0, N, 5)); + + TEST_FUNC (f6, 5, -1, 0, 3, + CHECK_RANGE_EQ (0, N, 8)); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch_4.c b/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch_4.c new file mode 100644 index 0000000..e2290e9 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch_4.c @@ -0,0 +1,132 @@ +/* { dg-do run { target aarch64_sve_hw } } */ +/* { dg-options "-O3 --param aarch64-autovec-preference=asimd-only" } */ +/* { dg-require-effective-target lp64 } */ + +#include <stdio.h> + +#define N 640 +#ifndef TYPE +#define TYPE float +#endif +#ifndef FMT +#define FMT ".6f" +#endif + + +TYPE a[N] = {0}; +TYPE b[N] = {0}; + +char *curr_test; + +/* Macro to define a function with a specific comparison */ +#define DEFINE_TEST_FUNC(NAME, OP) \ + __attribute__((noipa)) \ + void NAME(void) { \ + for (int i = 0; i < N; i++) { \ + b[i] += a[i]; \ + if (a[i] OP 0) \ + break; \ + } \ + } + +/* Generate the six comparisons functions using the macro. */ +DEFINE_TEST_FUNC(f1, >) +DEFINE_TEST_FUNC(f2, >=) +DEFINE_TEST_FUNC(f3, ==) +DEFINE_TEST_FUNC(f4, !=) +DEFINE_TEST_FUNC(f5, <) +DEFINE_TEST_FUNC(f6, <=) + +__attribute__((noreturn)) +static inline void __abort_trace (const char *m, int i, TYPE result, TYPE expected) +{ + printf ("*** [%s] FAIL AT %s:%d in %s - expected %" FMT " but got %" FMT " at pos %d\n", + m, __FILE__, __LINE__, curr_test, expected, result, i); + __builtin_abort (); +} + +/* Array setup macro. */ +#define RESET_ARRAYS(_aval, _idx, _force, _bval) \ + do { \ + _Pragma("GCC novector") \ + for (int i = 0; i < N; ++i) { \ + a[i] = _aval; \ + b[i] = _bval; \ + } \ + if (_idx >= 0 && _idx < N) \ + a[_idx] = _force; \ + } while (0) + +/* Value check macros. */ +#define CHECK_EQ(_i, _val) \ + do { \ + if (b[_i] != _val) \ + __abort_trace ("single", _i, b[_i], _val); \ + } while (0) + +#define CHECK_RANGE_EQ(_start, _end, _val) \ + do { \ + _Pragma("GCC novector") \ + for (int i = _start; i < _end; ++i) \ + if (b[i] != _val) \ + __abort_trace ("range", i, b[i], _val); \ + } while (0) + +#define str(s) #s +#define TEST_FUNC(_func, _aval, _idx, _force, _bval, _check_stmt) \ + do { \ + curr_test = str (_func); \ + RESET_ARRAYS((_aval), (_idx), (_force), (_bval)); \ + _func(); \ + _check_stmt; \ + } while (0) + +int main(void) { + /* Break on random intervals. */ + TEST_FUNC (f1, 1, 0, 1, 10, CHECK_EQ (0, 11); CHECK_EQ (1, 10)); + TEST_FUNC (f2, -1, 5, 0, 10, CHECK_EQ (0, 9); CHECK_EQ (5, 10)); + TEST_FUNC (f3, 3, 3, 0, 0, CHECK_EQ (0, 3); CHECK_EQ (3, 0)); + TEST_FUNC (f4, 0, 4, 1, 1, CHECK_EQ (4, 2); CHECK_EQ (5, 1)); + TEST_FUNC (f5, 1, 6, -1, 5, CHECK_EQ (6, 4); CHECK_EQ (7, 5)); + TEST_FUNC (f6, 2, 10, 0, 7, CHECK_EQ (10, 7); CHECK_EQ (11, 7)); + + /* Break on last iteration. */ + TEST_FUNC (f1, 0, N-1, 1, 1, + CHECK_RANGE_EQ (0, N-1, 1); CHECK_EQ (N-1, 2)); + + TEST_FUNC (f2, -5, N-1, 0, 9, + CHECK_RANGE_EQ (0, N-1, 4); CHECK_EQ (N-1, 9)); + + TEST_FUNC (f3, 2, N-1, 0, 0, + CHECK_RANGE_EQ(0, N-1, 2); CHECK_EQ (N-1, 0)); + + TEST_FUNC (f4, 0, N-1, 2, 1, + CHECK_RANGE_EQ (0, N-1, 1); CHECK_EQ (N-1, 3)); + + TEST_FUNC (f5, 2, N-1, -3, 6, + CHECK_RANGE_EQ (0, N-1, 8); CHECK_EQ (N-1, 3)); + + TEST_FUNC (f6, 5, N-1, 0, 7, + CHECK_RANGE_EQ (0, N-1, 12); CHECK_EQ (N-1, 7)); + + /* Condition never met — full loop executes. */ + TEST_FUNC (f1, 0, -1, 0, 2, + CHECK_RANGE_EQ (0, N, 2)); + + TEST_FUNC (f2, -2, -1, 0, 5, + CHECK_RANGE_EQ (0, N, 3)); + + TEST_FUNC (f3, 1, -1, 0, 0, + CHECK_RANGE_EQ (0, N, 1)); + + TEST_FUNC (f4, 0, -1, 0, 7, + CHECK_RANGE_EQ (0, N, 7)); + + TEST_FUNC (f5, 1, -1, 0, 4, + CHECK_RANGE_EQ (0, N, 5)); + + TEST_FUNC (f6, 5, -1, 0, 3, + CHECK_RANGE_EQ (0, N, 8)); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch_5.c b/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch_5.c new file mode 100644 index 0000000..eb2295f --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch_5.c @@ -0,0 +1,132 @@ +/* { dg-do run { target aarch64_sve_hw } } */ +/* { dg-options "-O3 --param aarch64-autovec-preference=sve-only" } */ +/* { dg-require-effective-target lp64 } */ + +#include <stdio.h> + +#define N 640 +#ifndef TYPE +#define TYPE float +#endif +#ifndef FMT +#define FMT ".6f" +#endif + + +TYPE a[N] = {0}; +TYPE b[N] = {0}; + +char *curr_test; + +/* Macro to define a function with a specific comparison */ +#define DEFINE_TEST_FUNC(NAME, OP) \ + __attribute__((noipa)) \ + void NAME(void) { \ + for (int i = 0; i < N; i++) { \ + b[i] += a[i]; \ + if (a[i] OP 0) \ + break; \ + } \ + } + +/* Generate the six comparisons functions using the macro. */ +DEFINE_TEST_FUNC(f1, >) +DEFINE_TEST_FUNC(f2, >=) +DEFINE_TEST_FUNC(f3, ==) +DEFINE_TEST_FUNC(f4, !=) +DEFINE_TEST_FUNC(f5, <) +DEFINE_TEST_FUNC(f6, <=) + +__attribute__((noreturn)) +static inline void __abort_trace (const char *m, int i, TYPE result, TYPE expected) +{ + printf ("*** [%s] FAIL AT %s:%d in %s - expected %" FMT " but got %" FMT " at pos %d\n", + m, __FILE__, __LINE__, curr_test, expected, result, i); + __builtin_abort (); +} + +/* Array setup macro. */ +#define RESET_ARRAYS(_aval, _idx, _force, _bval) \ + do { \ + _Pragma("GCC novector") \ + for (int i = 0; i < N; ++i) { \ + a[i] = _aval; \ + b[i] = _bval; \ + } \ + if (_idx >= 0 && _idx < N) \ + a[_idx] = _force; \ + } while (0) + +/* Value check macros. */ +#define CHECK_EQ(_i, _val) \ + do { \ + if (b[_i] != _val) \ + __abort_trace ("single", _i, b[_i], _val); \ + } while (0) + +#define CHECK_RANGE_EQ(_start, _end, _val) \ + do { \ + _Pragma("GCC novector") \ + for (int i = _start; i < _end; ++i) \ + if (b[i] != _val) \ + __abort_trace ("range", i, b[i], _val); \ + } while (0) + +#define str(s) #s +#define TEST_FUNC(_func, _aval, _idx, _force, _bval, _check_stmt) \ + do { \ + curr_test = str (_func); \ + RESET_ARRAYS((_aval), (_idx), (_force), (_bval)); \ + _func(); \ + _check_stmt; \ + } while (0) + +int main(void) { + /* Break on random intervals. */ + TEST_FUNC (f1, 1, 0, 1, 10, CHECK_EQ (0, 11); CHECK_EQ (1, 10)); + TEST_FUNC (f2, -1, 5, 0, 10, CHECK_EQ (0, 9); CHECK_EQ (5, 10)); + TEST_FUNC (f3, 3, 3, 0, 0, CHECK_EQ (0, 3); CHECK_EQ (3, 0)); + TEST_FUNC (f4, 0, 4, 1, 1, CHECK_EQ (4, 2); CHECK_EQ (5, 1)); + TEST_FUNC (f5, 1, 6, -1, 5, CHECK_EQ (6, 4); CHECK_EQ (7, 5)); + TEST_FUNC (f6, 2, 10, 0, 7, CHECK_EQ (10, 7); CHECK_EQ (11, 7)); + + /* Break on last iteration. */ + TEST_FUNC (f1, 0, N-1, 1, 1, + CHECK_RANGE_EQ (0, N-1, 1); CHECK_EQ (N-1, 2)); + + TEST_FUNC (f2, -5, N-1, 0, 9, + CHECK_RANGE_EQ (0, N-1, 4); CHECK_EQ (N-1, 9)); + + TEST_FUNC (f3, 2, N-1, 0, 0, + CHECK_RANGE_EQ(0, N-1, 2); CHECK_EQ (N-1, 0)); + + TEST_FUNC (f4, 0, N-1, 2, 1, + CHECK_RANGE_EQ (0, N-1, 1); CHECK_EQ (N-1, 3)); + + TEST_FUNC (f5, 2, N-1, -3, 6, + CHECK_RANGE_EQ (0, N-1, 8); CHECK_EQ (N-1, 3)); + + TEST_FUNC (f6, 5, N-1, 0, 7, + CHECK_RANGE_EQ (0, N-1, 12); CHECK_EQ (N-1, 7)); + + /* Condition never met — full loop executes. */ + TEST_FUNC (f1, 0, -1, 0, 2, + CHECK_RANGE_EQ (0, N, 2)); + + TEST_FUNC (f2, -2, -1, 0, 5, + CHECK_RANGE_EQ (0, N, 3)); + + TEST_FUNC (f3, 1, -1, 0, 0, + CHECK_RANGE_EQ (0, N, 1)); + + TEST_FUNC (f4, 0, -1, 0, 7, + CHECK_RANGE_EQ (0, N, 7)); + + TEST_FUNC (f5, 1, -1, 0, 4, + CHECK_RANGE_EQ (0, N, 5)); + + TEST_FUNC (f6, 5, -1, 0, 3, + CHECK_RANGE_EQ (0, N, 8)); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch_7.c b/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch_7.c new file mode 100644 index 0000000..5a61357 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch_7.c @@ -0,0 +1,147 @@ +/* { dg-do run { target aarch64_sve_hw } } */ +/* { dg-options "-Ofast --param aarch64-autovec-preference=asimd-only" } */ +/* { dg-require-effective-target lp64 } */ + +#include <stdio.h> +#include <math.h> + +#define N 640 +#ifndef TYPE +#define TYPE float +#endif +#ifndef FMT +#define FMT ".6f" +#endif + +TYPE a[N] = {0}; +TYPE b[N] = {0}; + +char *curr_test; + +/* Macro to define a function with a specific comparison */ +#define DEFINE_TEST_FUNC(NAME, OP) \ + __attribute__((noipa)) \ + void NAME(void) { \ + for (int i = 0; i < N; i++) { \ + b[i] += a[i]; \ + if (a[i] OP 0) \ + break; \ + } \ + } + +/* Generate comparison functions */ +DEFINE_TEST_FUNC(f1, >) +DEFINE_TEST_FUNC(f2, >=) +DEFINE_TEST_FUNC(f3, ==) +DEFINE_TEST_FUNC(f4, !=) +DEFINE_TEST_FUNC(f5, <) +DEFINE_TEST_FUNC(f6, <=) + +/* Example unordered-sensitive loop: breaks if a[i] is unordered with 0 */ +__attribute__((noipa)) +void f7(void) { + for (int i = 0; i < N; i++) { + b[i] += a[i]; + if (__builtin_isunordered(a[i], 0.0f)) + break; + } +} + +__attribute__((noreturn)) +static inline void __abort_trace(const char *m, int i, TYPE result, TYPE expected) { + printf("*** [%s] FAIL AT %s:%d in %s - expected %" FMT " but got %" FMT " at pos %d\n", + m, __FILE__, __LINE__, curr_test, expected, result, i); + __builtin_abort(); +} + +/* Array setup */ +#define RESET_ARRAYS(_aval, _idx, _force, _bval) \ + do { \ + _Pragma("GCC novector") \ + for (int i = 0; i < N; ++i) { \ + a[i] = _aval; \ + b[i] = _bval; \ + } \ + if (_idx >= 0 && _idx < N) \ + a[_idx] = _force; \ + } while (0) + +/* Floating-point comparison macros (with unordered handling) */ +#define CHECK_EQ(_i, _val) do { \ + if (__builtin_isnan (_val) != __builtin_isnan (b[_i]) \ + && b[_i] != _val) \ + __abort_trace ("single", _i, b[_i], _val); \ +} while (0) + +#define CHECK_RANGE_EQ(_start, _end, _val) do { \ + _Pragma("GCC novector") \ + for (int i = _start; i < _end; ++i) \ + if (__builtin_isnan (_val) != __builtin_isnan (b[i]) \ + && b[i] != _val) \ + __abort_trace ("range", i, b[i], _val); \ +} while (0) + +#define str(s) #s +#define TEST_FUNC(_func, _aval, _idx, _force, _bval, _check_stmt) \ + do { \ + curr_test = str (_func); \ + RESET_ARRAYS((_aval), (_idx), (_force), (_bval)); \ + _func(); \ + _check_stmt; \ + } while (0) + +int main(void) { + /* Break on random intervals. */ + TEST_FUNC(f1, 1.0f, 0, 1.0f, 10.0f, CHECK_EQ(0, 11.0f); CHECK_EQ(1, 10.0f)); + TEST_FUNC(f2, -1.0f, 5, 0.0f, 10.0f, CHECK_EQ(0, 9.0f); CHECK_EQ(5, 10.0f)); + TEST_FUNC(f3, 3.0f, 3, 0.0f, 0.0f, CHECK_EQ(0, 3.0f); CHECK_EQ(3, 0.0f)); + TEST_FUNC(f4, 0.0f, 4, 1.0f, 1.0f, CHECK_EQ(4, 2.0f); CHECK_EQ(5, 1.0f)); + TEST_FUNC(f5, 1.0f, 6, -1.0f, 5.0f, CHECK_EQ(6, 4.0f); CHECK_EQ(7, 5.0f)); + TEST_FUNC(f6, 2.0f, 10, 0.0f, 7.0f, CHECK_EQ(10, 7.0f); CHECK_EQ(11, 7.0f)); + + /* Break on last iteration. */ + TEST_FUNC(f1, 0.0f, N - 1, 1.0f, 1.0f, + CHECK_RANGE_EQ(0, N - 1, 1.0f); CHECK_EQ(N - 1, 2.0f)); + + TEST_FUNC(f2, -5.0f, N - 1, 0.0f, 9.0f, + CHECK_RANGE_EQ(0, N - 1, 4.0f); CHECK_EQ(N - 1, 9.0f)); + + TEST_FUNC(f3, 2.0f, N - 1, 0.0f, 0.0f, + CHECK_RANGE_EQ(0, N - 1, 2.0f); CHECK_EQ(N - 1, 0.0f)); + + TEST_FUNC(f4, 0.0f, N - 1, 2.0f, 1.0f, + CHECK_RANGE_EQ(0, N - 1, 1.0f); CHECK_EQ(N - 1, 3.0f)); + + TEST_FUNC(f5, 2.0f, N - 1, -3.0f, 6.0f, + CHECK_RANGE_EQ(0, N - 1, 8.0f); CHECK_EQ(N - 1, 3.0f)); + + TEST_FUNC(f6, 5.0f, N - 1, 0.0f, 7.0f, + CHECK_RANGE_EQ(0, N - 1, 12.0f); CHECK_EQ(N - 1, 7.0f)); + + /* Condition never met — full loop executes. */ + TEST_FUNC(f1, 0.0f, -1, 0.0f, 2.0f, + CHECK_RANGE_EQ(0, N, 2.0f)); + + TEST_FUNC(f2, -2.0f, -1, 0.0f, 5.0f, + CHECK_RANGE_EQ(0, N, 3.0f)); + + TEST_FUNC(f3, 1.0f, -1, 0.0f, 0.0f, + CHECK_RANGE_EQ(0, N, 1.0f)); + + TEST_FUNC(f4, 0.0f, -1, 0.0f, 7.0f, + CHECK_RANGE_EQ(0, N, 7.0f)); + + TEST_FUNC(f5, 1.0f, -1, 0.0f, 4.0f, + CHECK_RANGE_EQ(0, N, 5.0f)); + + TEST_FUNC(f6, 5.0f, -1, 0.0f, 3.0f, + CHECK_RANGE_EQ(0, N, 8.0f)); + +#if !defined(__FAST_MATH__) + /* Unordered break (NAN in a[i]) */ + TEST_FUNC(f7, 1.0f, 123, NAN, 2.0f, + CHECK_RANGE_EQ(0, 123, 3.0f); CHECK_EQ(123, NAN)); +#endif + + return 0; +} diff --git a/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch_8.c b/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch_8.c new file mode 100644 index 0000000..3dd7a60 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch_8.c @@ -0,0 +1,132 @@ +/* { dg-do run { target aarch64_sve_hw } } */ +/* { dg-options "-Ofast --param aarch64-autovec-preference=asimd-only" } */ +/* { dg-require-effective-target lp64 } */ + +#include <stdio.h> + +#define N 640 +#ifndef TYPE +#define TYPE float +#endif +#ifndef FMT +#define FMT ".6f" +#endif + + +TYPE a[N] = {0}; +TYPE b[N] = {0}; + +char *curr_test; + +/* Macro to define a function with a specific comparison */ +#define DEFINE_TEST_FUNC(NAME, OP) \ + __attribute__((noipa)) \ + void NAME(void) { \ + for (int i = 0; i < N; i++) { \ + b[i] += a[i]; \ + if (a[i] OP 0) \ + break; \ + } \ + } + +/* Generate the six comparisons functions using the macro. */ +DEFINE_TEST_FUNC(f1, >) +DEFINE_TEST_FUNC(f2, >=) +DEFINE_TEST_FUNC(f3, ==) +DEFINE_TEST_FUNC(f4, !=) +DEFINE_TEST_FUNC(f5, <) +DEFINE_TEST_FUNC(f6, <=) + +__attribute__((noreturn)) +static inline void __abort_trace (const char *m, int i, TYPE result, TYPE expected) +{ + printf ("*** [%s] FAIL AT %s:%d in %s - expected %" FMT " but got %" FMT " at pos %d\n", + m, __FILE__, __LINE__, curr_test, expected, result, i); + __builtin_abort (); +} + +/* Array setup macro. */ +#define RESET_ARRAYS(_aval, _idx, _force, _bval) \ + do { \ + _Pragma("GCC novector") \ + for (int i = 0; i < N; ++i) { \ + a[i] = _aval; \ + b[i] = _bval; \ + } \ + if (_idx >= 0 && _idx < N) \ + a[_idx] = _force; \ + } while (0) + +/* Value check macros. */ +#define CHECK_EQ(_i, _val) \ + do { \ + if (b[_i] != _val) \ + __abort_trace ("single", _i, b[_i], _val); \ + } while (0) + +#define CHECK_RANGE_EQ(_start, _end, _val) \ + do { \ + _Pragma("GCC novector") \ + for (int i = _start; i < _end; ++i) \ + if (b[i] != _val) \ + __abort_trace ("range", i, b[i], _val); \ + } while (0) + +#define str(s) #s +#define TEST_FUNC(_func, _aval, _idx, _force, _bval, _check_stmt) \ + do { \ + curr_test = str (_func); \ + RESET_ARRAYS((_aval), (_idx), (_force), (_bval)); \ + _func(); \ + _check_stmt; \ + } while (0) + +int main(void) { + /* Break on random intervals. */ + TEST_FUNC (f1, 1, 0, 1, 10, CHECK_EQ (0, 11); CHECK_EQ (1, 10)); + TEST_FUNC (f2, -1, 5, 0, 10, CHECK_EQ (0, 9); CHECK_EQ (5, 10)); + TEST_FUNC (f3, 3, 3, 0, 0, CHECK_EQ (0, 3); CHECK_EQ (3, 0)); + TEST_FUNC (f4, 0, 4, 1, 1, CHECK_EQ (4, 2); CHECK_EQ (5, 1)); + TEST_FUNC (f5, 1, 6, -1, 5, CHECK_EQ (6, 4); CHECK_EQ (7, 5)); + TEST_FUNC (f6, 2, 10, 0, 7, CHECK_EQ (10, 7); CHECK_EQ (11, 7)); + + /* Break on last iteration. */ + TEST_FUNC (f1, 0, N-1, 1, 1, + CHECK_RANGE_EQ (0, N-1, 1); CHECK_EQ (N-1, 2)); + + TEST_FUNC (f2, -5, N-1, 0, 9, + CHECK_RANGE_EQ (0, N-1, 4); CHECK_EQ (N-1, 9)); + + TEST_FUNC (f3, 2, N-1, 0, 0, + CHECK_RANGE_EQ(0, N-1, 2); CHECK_EQ (N-1, 0)); + + TEST_FUNC (f4, 0, N-1, 2, 1, + CHECK_RANGE_EQ (0, N-1, 1); CHECK_EQ (N-1, 3)); + + TEST_FUNC (f5, 2, N-1, -3, 6, + CHECK_RANGE_EQ (0, N-1, 8); CHECK_EQ (N-1, 3)); + + TEST_FUNC (f6, 5, N-1, 0, 7, + CHECK_RANGE_EQ (0, N-1, 12); CHECK_EQ (N-1, 7)); + + /* Condition never met — full loop executes. */ + TEST_FUNC (f1, 0, -1, 0, 2, + CHECK_RANGE_EQ (0, N, 2)); + + TEST_FUNC (f2, -2, -1, 0, 5, + CHECK_RANGE_EQ (0, N, 3)); + + TEST_FUNC (f3, 1, -1, 0, 0, + CHECK_RANGE_EQ (0, N, 1)); + + TEST_FUNC (f4, 0, -1, 0, 7, + CHECK_RANGE_EQ (0, N, 7)); + + TEST_FUNC (f5, 1, -1, 0, 4, + CHECK_RANGE_EQ (0, N, 5)); + + TEST_FUNC (f6, 5, -1, 0, 3, + CHECK_RANGE_EQ (0, N, 8)); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch_9.c b/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch_9.c new file mode 100644 index 0000000..ec4f7a6 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sve/vect-early-break-cbranch_9.c @@ -0,0 +1,102 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -fno-schedule-insns -fno-reorder-blocks -fno-schedule-insns2" } */ +/* { dg-final { check-function-bodies "**" "" "" { target lp64 } } } */ +#define N 640 +unsigned int a[N] = {0}; +unsigned int b[N] = {0}; +/* +** f1: +** ... +** cmphi p[0-9]+.s, p[0-9]+/z, z[0-9]+.s, #1 +** b(\.?eq|\.none) \.L[0-9]+ +** ... +*/ +void f1 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] > 1) + break; + } +} +/* +** f2: +** ... +** cmphi p[0-9]+.s, p[0-9]+/z, z[0-9]+.s, #1 +** b(\.?eq|\.none) \.L[0-9]+ +** ... +*/ +void f2 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] >= 2) + break; + } +} +/* +** f3: +** ... +** cmpeq p[0-9]+.s, p[0-9]+/z, z[0-9]+.s, #1 +** b(\.?eq|\.none) \.L[0-9]+ +** ... +*/ +void f3 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] == 1) + break; + } +} +/* +** f4: +** ... +** cmpne p[0-9]+.s, p[0-9]+/z, z[0-9]+.s, #1 +** b(\.?eq|\.none) \.L[0-9]+ +** ... +*/ +void f4 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] != 1) + break; + } +} +/* +** f5: +** ... +** cmpls p[0-9]+.s, p7/z, z[0-9]+.s, #1 +** b(\.?eq|\.none) .L[0-9]+ +** ... +*/ +void f5 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] < 2) + break; + } +} +/* +** f6: +** ... +** cmpls p[0-9]+.s, p[0-9]+/z, z[0-9]+.s, #1 +** b(\.?eq|\.none) \.L[0-9]+ +** ... +*/ +void f6 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] <= 1) + break; + } +} diff --git a/gcc/testsuite/gcc.target/aarch64/sve/vect-reduc-bool-19.c b/gcc/testsuite/gcc.target/aarch64/sve/vect-reduc-bool-19.c new file mode 100644 index 0000000..6492c44 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sve/vect-reduc-bool-19.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-mautovec-preference=sve-only -fdump-tree-vect-details -O3 --param vect-epilogues-nomask=0" } */ + +int p[128]; + +bool __attribute__((noipa)) +fand (int n, bool r1, bool r2) +{ + bool r = true; + for (int i = 0; i < (n/2); i+=2) + { + r &= (p[i] != 0) & r1; + r &= (p[i+1] != 0) & r2; + } + return r; +} +/* { dg-final { scan-tree-dump-times "optimized: loop vectorized" 1 "vect" } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sve/vect-reduc-bool-20.c b/gcc/testsuite/gcc.target/aarch64/sve/vect-reduc-bool-20.c new file mode 100644 index 0000000..83c5c20 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sve/vect-reduc-bool-20.c @@ -0,0 +1,32 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-mautovec-preference=sve-only -fdump-tree-vect-details -O3 --param vect-epilogues-nomask=0" } */ + +#include <stdbool.h> +#include <stdint.h> + +void vec_slp_cmp (char* restrict a, char* restrict b, int n) { + bool x0 = b[0] != 0; + bool x1 = b[1] != 0; + bool x2 = b[2] != 0; + bool x3 = b[3] != 0; + for (int i = 0; i < n; ++i) { + x0 &= (a[i * 4] != 0); + x1 &= (a[i * 4 + 1] != 0); + x2 &= (a[i * 4 + 2] != 0); + x3 &= (a[i * 4 + 3] != 0); + } + b[0] = x0; + b[1] = x1; + b[2] = x2; + b[3] = x3; +} + +void vec_slp_cmp1 (char* restrict a, char* restrict b, int n) { + bool x0 = b[0] != 0; + for (int i = 0; i < n; ++i) { + x0 &= (a[i] != 0); + } + b[0] = x0; +} + +/* { dg-final { scan-tree-dump-times "optimized: loop vectorized" 2 "vect" { target aarch64*-*-* } } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/vect-early-break-cbranch.c b/gcc/testsuite/gcc.target/aarch64/vect-early-break-cbranch.c index 673b781..ca4ef49 100644 --- a/gcc/testsuite/gcc.target/aarch64/vect-early-break-cbranch.c +++ b/gcc/testsuite/gcc.target/aarch64/vect-early-break-cbranch.c @@ -50,7 +50,6 @@ void f2 () /* ** f3: ** ... -** cmeq v[0-9]+.4s, v[0-9]+.4s, #0 ** umaxp v[0-9]+.4s, v[0-9]+.4s, v[0-9]+.4s ** fmov x[0-9]+, d[0-9]+ ** cbn?z x[0-9]+, \.L[0-9]+ @@ -69,7 +68,6 @@ void f3 () /* ** f4: ** ... -** cmtst v[0-9]+.4s, v[0-9]+.4s, v[0-9]+.4s ** umaxp v[0-9]+.4s, v[0-9]+.4s, v[0-9]+.4s ** fmov x[0-9]+, d[0-9]+ ** cbn?z x[0-9]+, \.L[0-9]+ diff --git a/gcc/testsuite/gcc.target/aarch64/vect-early-break-cbranch_2.c b/gcc/testsuite/gcc.target/aarch64/vect-early-break-cbranch_2.c new file mode 100644 index 0000000..d5cb194 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/vect-early-break-cbranch_2.c @@ -0,0 +1,105 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -fno-schedule-insns -fno-reorder-blocks -fno-schedule-insns2 --param aarch64-autovec-preference=asimd-only" } */ +/* { dg-final { check-function-bodies "**" "" "" { target lp64 } } } */ + +#pragma GCC target "+sve" + +#define N 640 +int a[N] = {0}; +int b[N] = {0}; +/* +** f1: +** ... +** cmpgt p[0-9]+.s, p[0-9]+/z, z[0-9]+.s, #0 +** b(\.?eq|\.none) \.L[0-9]+ +** ... +*/ +void f1 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] > 0) + break; + } +} +/* +** f2: +** ... +** cmpge p[0-9]+.s, p[0-9]+/z, z[0-9]+.s, #0 +** b(\.?eq|\.none) \.L[0-9]+ +** ... +*/ +void f2 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] >= 0) + break; + } +} +/* +** f3: +** ... +** cmpeq p[0-9]+.s, p[0-9]+/z, z[0-9]+.s, #0 +** b(\.?eq|\.none) \.L[0-9]+ +** ... +*/ +void f3 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] == 0) + break; + } +} +/* +** f4: +** ... +** cmpne p[0-9]+.s, p[0-9]+/z, z[0-9]+.s, #0 +** b(\.?eq|\.none) \.L[0-9]+ +** ... +*/ +void f4 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] != 0) + break; + } +} +/* +** f5: +** ... +** cmplt p[0-9]+.s, p7/z, z[0-9]+.s, #0 +** b(\.?eq|\.none) .L[0-9]+ +** ... +*/ +void f5 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] < 0) + break; + } +} +/* +** f6: +** ... +** cmple p[0-9]+.s, p[0-9]+/z, z[0-9]+.s, #0 +** b(\.?eq|\.none) \.L[0-9]+ +** ... +*/ +void f6 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] <= 0) + break; + } +} diff --git a/gcc/testsuite/gcc.target/aarch64/vect-early-break-cbranch_3.c b/gcc/testsuite/gcc.target/aarch64/vect-early-break-cbranch_3.c new file mode 100644 index 0000000..8980b9f --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/vect-early-break-cbranch_3.c @@ -0,0 +1,112 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -fno-schedule-insns -fno-reorder-blocks -fno-schedule-insns2 --param aarch64-autovec-preference=asimd-only" } */ +/* { dg-final { check-function-bodies "**" "" "" { target lp64 } } } */ + +#pragma GCC target "+sve" + +#define N 640 +float a[N] = {0}; +float b[N] = {0}; + +/* +** f1: +** ... +** fcmgt p[0-9]+.s, p[0-9]+/z, z[0-9]+.s, #0.0 +** ptest p[0-9]+, p[0-9]+\.b +** b(\.?eq|\.none) \.L[0-9]+ +** ... +*/ +void f1 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] > 0) + break; + } +} +/* +** f2: +** ... +** fcmge p[0-9]+.s, p[0-9]+/z, z[0-9]+.s, #0.0 +** ptest p[0-9]+, p[0-9]+\.b +** b(\.?eq|\.none) \.L[0-9]+ +** ... +*/ +void f2 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] >= 0) + break; + } +} +/* +** f3: +** ... +** fcmeq p[0-9]+.s, p[0-9]+/z, z[0-9]+.s, #0.0 +** ptest p[0-9]+, p[0-9]+\.b +** b(\.?eq|\.none) \.L[0-9]+ +** ... +*/ +void f3 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] == 0) + break; + } +} +/* +** f4: +** ... +** fcmne p[0-9]+.s, p[0-9]+/z, z[0-9]+.s, #0.0 +** ptest p[0-9]+, p[0-9]+\.b +** b(\.?eq|\.none) \.L[0-9]+ +** ... +*/ +void f4 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] != 0) + break; + } +} +/* +** f5: +** ... +** fcmlt p[0-9]+.s, p7/z, z[0-9]+.s, #0.0 +** ptest p[0-9]+, p[0-9]+\.b +** b(\.?eq|\.none) .L[0-9]+ +** ... +*/ +void f5 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] < 0) + break; + } +} +/* +** f6: +** ... +** fcmle p[0-9]+.s, p[0-9]+/z, z[0-9]+.s, #0.0 +** ptest p[0-9]+, p[0-9]+\.b +** b(\.?eq|\.none) \.L[0-9]+ +** ... +*/ +void f6 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] <= 0) + break; + } +} diff --git a/gcc/testsuite/gcc.target/aarch64/vect-early-break-cbranch_4.c b/gcc/testsuite/gcc.target/aarch64/vect-early-break-cbranch_4.c new file mode 100644 index 0000000..a49e796 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/vect-early-break-cbranch_4.c @@ -0,0 +1,122 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -fno-schedule-insns -fno-reorder-blocks -fno-schedule-insns2" } */ +/* { dg-final { check-function-bodies "**" "" "" { target lp64 } } } */ + +#pragma GCC target "+nosve" + +#define N 640 +unsigned int a[N] = {0}; +unsigned int b[N] = {0}; + + +/* +** f1: +** ... +** cmhi v[0-9]+.4s, v[0-9]+.4s, v[0-9]+.4s +** umaxp v[0-9]+.4s, v[0-9]+.4s, v[0-9]+.4s +** fmov x[0-9]+, d[0-9]+ +** cbn?z x[0-9]+, \.L[0-9]+ +** ... +*/ +void f1 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] > 1) + break; + } +} + +/* +** f2: +** ... +** cmtst v[0-9]+.4s, v[0-9]+.4s, v[0-9]+.4s +** umaxp v[0-9]+.4s, v[0-9]+.4s, v[0-9]+.4s +** fmov x[0-9]+, d[0-9]+ +** cbn?z x[0-9]+, \.L[0-9]+ +** ... +*/ +void f2 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] >= 1) + break; + } +} + +/* +** f3: +** ... +** umaxp v[0-9]+.4s, v[0-9]+.4s, v[0-9]+.4s +** fmov x[0-9]+, d[0-9]+ +** cbn?z x[0-9]+, \.L[0-9]+ +** ... +*/ +void f3 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] == 1) + break; + } +} + +/* +** f4: +** ... +** umaxp v[0-9]+.4s, v[0-9]+.4s, v[0-9]+.4s +** fmov x[0-9]+, d[0-9]+ +** cbn?z x[0-9]+, \.L[0-9]+ +** ... +*/ +void f4 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] != 1) + break; + } +} + +/* +** f5: +** ... +** cmhs v[0-9]+.4s, v[0-9]+.4s, v[0-9]+.4s +** umaxp v[0-9]+.4s, v[0-9]+.4s, v[0-9]+.4s +** fmov x[0-9]+, d[0-9]+ +** cbn?z x[0-9]+, \.L[0-9]+ +** ... +*/ +void f5 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] < 2) + break; + } +} + +/* +** f6: +** ... +** cmhs v[0-9]+.4s, v[0-9]+.4s, v[0-9]+.4s +** umaxp v[0-9]+.4s, v[0-9]+.4s, v[0-9]+.4s +** fmov x[0-9]+, d[0-9]+ +** cbn?z x[0-9]+, \.L[0-9]+ +** ... +*/ +void f6 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] <= 2) + break; + } +} diff --git a/gcc/testsuite/gcc.target/aarch64/vect-early-break-cbranch_5.c b/gcc/testsuite/gcc.target/aarch64/vect-early-break-cbranch_5.c new file mode 100644 index 0000000..c28969d --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/vect-early-break-cbranch_5.c @@ -0,0 +1,105 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -fno-schedule-insns -fno-reorder-blocks -fno-schedule-insns2 --param aarch64-autovec-preference=asimd-only" } */ +/* { dg-final { check-function-bodies "**" "" "" { target lp64 } } } */ + +#pragma GCC target "+sve" + +#define N 640 +unsigned int a[N] = {0}; +unsigned int b[N] = {0}; +/* +** f1: +** ... +** cmphi p[0-9]+.s, p[0-9]+/z, z[0-9]+.s, #2 +** b(\.?eq|\.none) \.L[0-9]+ +** ... +*/ +void f1 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] > 2) + break; + } +} +/* +** f2: +** ... +** cmphi p[0-9]+.s, p[0-9]+/z, z[0-9]+.s, #1 +** b(\.?eq|\.none) \.L[0-9]+ +** ... +*/ +void f2 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] >= 2) + break; + } +} +/* +** f3: +** ... +** cmpeq p[0-9]+.s, p[0-9]+/z, z[0-9]+.s, #1 +** b(\.?eq|\.none) \.L[0-9]+ +** ... +*/ +void f3 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] == 1) + break; + } +} +/* +** f4: +** ... +** cmpne p[0-9]+.s, p[0-9]+/z, z[0-9]+.s, #1 +** b(\.?eq|\.none) \.L[0-9]+ +** ... +*/ +void f4 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] != 1) + break; + } +} +/* +** f5: +** ... +** cmpls p[0-9]+.s, p7/z, z[0-9]+.s, #1 +** b(\.?eq|\.none) .L[0-9]+ +** ... +*/ +void f5 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] < 2) + break; + } +} +/* +** f6: +** ... +** cmpls p[0-9]+.s, p[0-9]+/z, z[0-9]+.s, #1 +** b(\.?eq|\.none) \.L[0-9]+ +** ... +*/ +void f6 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] <= 1) + break; + } +} diff --git a/gcc/testsuite/gcc.target/aarch64/vect-ld1r-compile.c b/gcc/testsuite/gcc.target/aarch64/vect-ld1r-compile.c index 30219e6..26fef5b 100644 --- a/gcc/testsuite/gcc.target/aarch64/vect-ld1r-compile.c +++ b/gcc/testsuite/gcc.target/aarch64/vect-ld1r-compile.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -fno-vect-cost-model" } */ +/* Adding -fno-tree-loop-distribute-patterns to present memset dtection. */ +/* { dg-options "-O3 -fno-tree-loop-distribute-patterns -fno-vect-cost-model" } */ #pragma GCC target "+nosve" diff --git a/gcc/testsuite/gcc.target/arc/builtin_fls_const.c b/gcc/testsuite/gcc.target/arc/builtin_fls_const.c new file mode 100644 index 0000000..35629ff --- /dev/null +++ b/gcc/testsuite/gcc.target/arc/builtin_fls_const.c @@ -0,0 +1,35 @@ +/* Test that const attribute enables CSE optimization for ARC builtins. */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +int test_fls_cse(int x) +{ + /* Two calls to the same const builtin with same argument should + be optimized to a single call plus a multiply-by-2 operation. */ + int a = __builtin_arc_fls(x); + int b = __builtin_arc_fls(x); + return a + b; +} + +int test_ffs_cse(int x) +{ + /* Same pattern for __builtin_arc_ffs. */ + int a = __builtin_arc_ffs(x); + int b = __builtin_arc_ffs(x); + return a + b; +} + +int test_norm_cse(int x) +{ + /* Same pattern for __builtin_arc_norm. */ + int a = __builtin_arc_norm(x); + int b = __builtin_arc_norm(x); + return a + b; +} + +/* { dg-final { scan-assembler-times "fls\\s+" 1 } } */ +/* { dg-final { scan-assembler-times "ffs\\s+" 1 } } */ +/* { dg-final { scan-assembler-times "norm\\s+" 1 } } */ + +/* Verify that the result is multiplied by 2 using left shift. */ +/* { dg-final { scan-assembler "asl_s\\s+.*,.*,1" } } */ diff --git a/gcc/testsuite/gcc.target/arc/extvsi-3.c b/gcc/testsuite/gcc.target/arc/extvsi-3.c new file mode 100644 index 0000000..2a466f9 --- /dev/null +++ b/gcc/testsuite/gcc.target/arc/extvsi-3.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-skip-if "avoid conflicts with -mcpu options" { *-*-* } { "-mcpu=*" } { "-mcpu=em" } } */ +/* { dg-options "-O2 -mcpu=em" } */ +struct S { int a : 5; }; + +/* An extra parameter is added to ensure a different register is used for input and output. */ +int foo (int unused, struct S p) +{ + return p.a; +} + +/* { dg-final { scan-assembler "and\\s+r0,r1,31" } } */ +/* { dg-final { scan-assembler "xor\\s+r0,r0,16" } } */ +/* { dg-final { scan-assembler "sub\\s+r0,r0,16" } } */ diff --git a/gcc/testsuite/gcc.target/arc/movv2hi-be.c b/gcc/testsuite/gcc.target/arc/movv2hi-be.c new file mode 100644 index 0000000..7d4b8e2 --- /dev/null +++ b/gcc/testsuite/gcc.target/arc/movv2hi-be.c @@ -0,0 +1,32 @@ +/* { dg-do run } */ +/* { dg-options "-O2" } */ + +typedef short v2hi __attribute__((vector_size(4))); + +__attribute__((noinline)) void foo3(short a) +{ + if (a != 520) + { + __builtin_abort(); + } +} + +__attribute__((noinline)) void foo2(v2hi v) +{ + foo3(v[0]); +} + +__attribute__((noinline)) void foo(v2hi *v) +{ + foo2(*v); +} + +int main (void) +{ + v2hi v; + v[0] = 520; + v[1] = -1; + foo(&v); + foo2(v); + return 0; +} diff --git a/gcc/testsuite/gcc.target/arc/no-barrel-shifter.c b/gcc/testsuite/gcc.target/arc/no-barrel-shifter.c new file mode 100644 index 0000000..2506bdf --- /dev/null +++ b/gcc/testsuite/gcc.target/arc/no-barrel-shifter.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ +/* { dg-skip-if "" { { barrelshifter } } } */ +int fromfloat(float fx); + +float foo(float fx) +{ + int x = fromfloat(fx); + int sign = (x >> 31) & 1; + unsigned int mag = x & 0x7fffffff; + + if (mag > 0x7f800000) + return fx; + if (mag == 0x7f800000) + return (sign == 0); + return fx * (27 + sign); +} + +/* { dg-final { scan-assembler-not "add.f\\s\+\[0-9\]\+,r\[0-9\]\+,r\[0-9\]\+\\n\\s\+beq.d" } } */ diff --git a/gcc/testsuite/gcc.target/arm/cbz-range.c b/gcc/testsuite/gcc.target/arm/cbz-range.c new file mode 100644 index 0000000..3b23888 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/cbz-range.c @@ -0,0 +1,114 @@ +/* { dg-do assemble } */ +/* { dg-require-effective-target arm_arch_v7a_ok } */ +/* { dg-options "-O -mthumb" } */ +/* { dg-add-options arm_arch_v7a } */ + +#define f "movw r0, #0;movw r0, #0;movw r0, #0;" +#define f2 f f +#define f4 f2 f2 +#define f8 f4 f4 +#define f16 f8 f8 +#define f32 f16 f16 +#define f64 f32 f32 +#define f128 f64 f64 +#define f256 f128 f128 +#define f512 f256 f256 +#define f1024 f512 f512 +#define f2048 f1024 f1024 +#define f4096 f2048 f2048 +#define f8192 f4096 f4096 +#define f16384 f8192 f8192 +#define f32768 f16384 f16384 +#define f65536 f32768 f32768 +#define f131072 f65536 f65536 +int a; + +int cbz1(int g) +{ + if (g) + asm(f8); + return a; +} + +int cbz2(int g) +{ + asm ("": "+h"(g)); + if (g) + asm(f8); + return a; +} + +int cbz3(int g) +{ + if (g) + asm(f16); + return a; +} + +int cbz4(int g) +{ + asm ("": "+h"(g)); + if (g) + asm(f16); + return a; +} + +int cbz5(int g) +{ + if (g) + asm(f131072); + return a; +} + +int cbz6(int g) +{ + asm ("": "+h"(g)); + if (g) + asm(f131072); + return a; +} + +int cbnz1(int g) +{ + if (!g) + asm(f8); + return a; +} + +int cbnz2(int g) +{ + asm ("": "+h"(g)); + if (!g) + asm(f8); + return a; +} + +int cbnz3(int g) +{ + if (!g) + asm(f16); + return a; +} + +int cbnz4(int g) +{ + asm ("": "+h"(g)); + if (!g) + asm(f16); + return a; +} + +int cbnz5(int g) +{ + if (!g) + asm(f131072); + return a; +} + +int cbnz6(int g) +{ + asm ("": "+h"(g)); + if (!g) + asm(f131072); + return a; +} diff --git a/gcc/testsuite/gcc.target/arm/cmse/baseline/union-3.c b/gcc/testsuite/gcc.target/arm/cmse/baseline/union-3.c new file mode 100644 index 0000000..f68a081 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/cmse/baseline/union-3.c @@ -0,0 +1,29 @@ + +/* { dg-do compile } */ +/* { dg-options "-mcmse" } */ +/* { dg-final { check-function-bodies "**" "" } } */ + +#include "../union-3.x" + +/* +** fn_caller_0: +** ... +** lsrs r4, r4, #1 +** lsls r4, r4, #1 +** movs r2, r4 +** movs r3, r4 +** bl __gnu_cmse_nonsecure_call +** ... +*/ + +/* +** fn_caller_1: +** ... +** lsrs r4, r4, #1 +** lsls r4, r4, #1 +** movs r1, r4 +** movs r2, r4 +** movs r3, r4 +** bl __gnu_cmse_nonsecure_call +** ... +*/ diff --git a/gcc/testsuite/gcc.target/arm/cmse/baseline/union-4.c b/gcc/testsuite/gcc.target/arm/cmse/baseline/union-4.c new file mode 100644 index 0000000..58c06ce --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/cmse/baseline/union-4.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-options "-mcmse" } */ +/* { dg-final { check-function-bodies "**" "" } } */ + +#include "../union-4.x" + +/* +** fn: +** ... +** lsrs r4, r4, #1 +** lsls r4, r4, #1 +** mov ip, r4 +** movw r4, #7939 +** ands r0, r4 +** mov r4, ip +** movs r2, r4 +** movs r3, r4 +** bl __gnu_cmse_nonsecure_call +** ... +*/ diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/union-3.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/union-3.c new file mode 100644 index 0000000..022bef7 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/union-3.c @@ -0,0 +1,32 @@ + +/* { dg-do compile } */ +/* { dg-options "-mcmse" } */ +/* { dg-final { check-function-bodies "**" "" } } */ + +#include "../../union-3.x" + +/* +** fn_caller_0: +** ... +** lsrs r3, r3, #1 +** lsls r3, r3, #1 +** push {r4, r5, r6, r7, r8, r9, r10, fp} +This test is not meant to be to test the FP clearing, so accept any, preventing +the need to specialize the test further for different float-abi's +** ... +** clrm {r2, r4, r5, r6, r7, r8, r9, r10, fp, ip, APSR} +** blxns r3 +** ... +*/ + +/* +** fn_caller_1: +** ... +** lsrs r3, r3, #1 +** lsls r3, r3, #1 +** push {r4, r5, r6, r7, r8, r9, r10, fp} +** ... +** clrm {r1, r2, r4, r5, r6, r7, r8, r9, r10, fp, ip, APSR} +** blxns r3 +** ... +*/ diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/8m/hard/union-4.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/8m/hard/union-4.c new file mode 100644 index 0000000..671a4e8 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/8m/hard/union-4.c @@ -0,0 +1,27 @@ +/* { dg-do compile } */ +/* { dg-options "-mcmse -mfloat-abi=hard -mfpu=fpv5-d16" } */ +/* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=hard" } } */ +/* { dg-final { check-function-bodies "**" "" } } */ + +#include "../../../union-4.x" + +/* +** fn: +** ... +** lsrs r4, r4, #1 +** lsls r4, r4, #1 +** movw ip, #7939 +** and r0, r0, ip +** mov r2, r4 +** mov r3, r4 +** vmov.f64 d0, #1.0e\+0 +** vmov.f64 d1, #1.0e\+0 +** vmov.f64 d2, #1.0e\+0 +** vmov.f64 d3, #1.0e\+0 +** vmov.f64 d4, #1.0e\+0 +** vmov.f64 d5, #1.0e\+0 +** vmov.f64 d6, #1.0e\+0 +** vmov.f64 d7, #1.0e\+0 +** bl __gnu_cmse_nonsecure_call +** ... +*/ diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/8m/hard/union-fp.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/8m/hard/union-fp.c new file mode 100644 index 0000000..3d45ec6 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/8m/hard/union-fp.c @@ -0,0 +1,66 @@ +/* { dg-do compile } */ +/* { dg-options "-mcmse -mfloat-abi=hard -mfpu=fpv5-d16" } */ +/* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=hard" } } */ +/* { dg-skip-if "Skip these if testing single precision" {*-*-*} {"-mfpu=*-sp-*"} {""} } */ +/* { dg-final { check-function-bodies "**" "" } } */ + +union u_t_0 { + float f; +}; +union u_t_1 { + double d; +}; + +typedef void (__attribute__ ((cmse_nonsecure_call)) fn_t_0)(union u_t_0); +typedef void (__attribute__ ((cmse_nonsecure_call)) fn_t_1)(union u_t_1); + +void fn_caller_0 (fn_t_0 *f_ptr) { + union u_t_0 x = {0.0f}; + f_ptr (x); +} + +/* +** fn_caller_0: +** ... +** lsrs r4, r4, #1 +** lsls r4, r4, #1 +** mov r0, r4 +** mov r1, r4 +** mov r2, r4 +** mov r3, r4 +** vmov.f32 s1, #1.0e\+0 +** vmov.f64 d1, #1.0e\+0 +** vmov.f64 d2, #1.0e\+0 +** vmov.f64 d3, #1.0e\+0 +** vmov.f64 d4, #1.0e\+0 +** vmov.f64 d5, #1.0e\+0 +** vmov.f64 d6, #1.0e\+0 +** vmov.f64 d7, #1.0e\+0 +** bl __gnu_cmse_nonsecure_call +** ... +*/ + +void fn_caller_1 (fn_t_1 *f_ptr) { + union u_t_1 x = {0.0}; + f_ptr (x); +} + +/* +** fn_caller_1: +** ... +** lsrs r4, r4, #1 +** lsls r4, r4, #1 +** mov r0, r4 +** mov r1, r4 +** mov r2, r4 +** mov r3, r4 +** vmov.f64 d1, #1.0e\+0 +** vmov.f64 d2, #1.0e\+0 +** vmov.f64 d3, #1.0e\+0 +** vmov.f64 d4, #1.0e\+0 +** vmov.f64 d5, #1.0e\+0 +** vmov.f64 d6, #1.0e\+0 +** vmov.f64 d7, #1.0e\+0 +** bl __gnu_cmse_nonsecure_call +** ... +*/ diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/8m/soft/union-4.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/8m/soft/union-4.c new file mode 100644 index 0000000..b0a83db --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/8m/soft/union-4.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-mcmse" } */ +/* { dg-final { check-function-bodies "**" "" } } */ + +#include "../../../union-4.x" + +/* +** fn: +** ... +** lsrs r4, r4, #1 +** lsls r4, r4, #1 +** movw ip, #7939 +** and r0, r0, ip +** mov r2, r4 +** mov r3, r4 +** bl __gnu_cmse_nonsecure_call +** ... +*/ diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/8m/softfp/union-4.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/8m/softfp/union-4.c new file mode 100644 index 0000000..9842a0f --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/8m/softfp/union-4.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-mcmse -mfloat-abi=softfp -mfpu=fpv5-d16" } */ +/* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=softfp" } } */ +/* { dg-final { check-function-bodies "**" "" } } */ + +#include "../../../union-4.x" + +/* +** fn: +** ... +** lsrs r4, r4, #1 +** lsls r4, r4, #1 +** movw ip, #7939 +** and r0, r0, ip +** mov r2, r4 +** mov r3, r4 +** bl __gnu_cmse_nonsecure_call +** ... +*/ diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/8m/union-3.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/8m/union-3.c new file mode 100644 index 0000000..dd115b4 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/8m/union-3.c @@ -0,0 +1,33 @@ + +/* { dg-do compile } */ +/* { dg-options "-mcmse" } */ +/* { dg-final { check-function-bodies "**" "" } } */ + +#include "../../union-3.x" + +/* +** fn_caller_0: +** ... +** lsrs r4, r4, #1 +** lsls r4, r4, #1 +** mov r2, r4 +** mov r3, r4 +This test is not meant to be to test the FP clearing, so accept any, preventing +the need to specialize the test further for different float-abi's +** ... +** bl __gnu_cmse_nonsecure_call +** ... +*/ + +/* +** fn_caller_1: +** ... +** lsrs r4, r4, #1 +** lsls r4, r4, #1 +** mov r1, r4 +** mov r2, r4 +** mov r3, r4 +** ... +** bl __gnu_cmse_nonsecure_call +** ... +*/ diff --git a/gcc/testsuite/gcc.target/arm/cmse/union-3.x b/gcc/testsuite/gcc.target/arm/cmse/union-3.x new file mode 100644 index 0000000..880ceb4 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/cmse/union-3.x @@ -0,0 +1,23 @@ +#include <arm_cmse.h> + +union u_t_0 { + long long ll; +}; + +typedef void(__attribute__((cmse_nonsecure_call)) fn_t_0)(union u_t_0); + +void fn_caller_0(fn_t_0 *f_ptr) { + union u_t_0 x = {1234}; + f_ptr(x); +} + +union u_t_1 { + long int l; +}; + +typedef void(__attribute__((cmse_nonsecure_call)) fn_t_1)(union u_t_1); + +void fn_caller_1(fn_t_1 *f_ptr) { + union u_t_1 x = {1234}; + f_ptr(x); +} diff --git a/gcc/testsuite/gcc.target/arm/cmse/union-4.x b/gcc/testsuite/gcc.target/arm/cmse/union-4.x new file mode 100644 index 0000000..2067829 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/cmse/union-4.x @@ -0,0 +1,41 @@ +typedef struct +{ + unsigned char a :2; + unsigned char :0; + unsigned short b :5; + float f; +} test_st_1; + +typedef union +{ + test_st_1 st_1; +}test_un; + +typedef union +{ + test_un un; + struct + { + unsigned int v1; + unsigned int v2; + unsigned int v3; + unsigned int v4; + }values; +} read_un; + + +typedef void __attribute__ ((cmse_nonsecure_call)) (*foo_ns) (test_un); + +int +fn (foo_ns fptr) +{ + read_un r; + + r.values.v1 = 0xFFFFFFFF; + r.values.v2 = 0xFFFFFFFF; + r.values.v3 = 0xFFFFFFFF; + r.values.v4 = 0xFFFFFFFF; + + fptr (r.un); + return 0; +} diff --git a/gcc/testsuite/gcc.target/arm/fp16-compile-none-1.c b/gcc/testsuite/gcc.target/arm/fp16-compile-none-1.c deleted file mode 100644 index 9472249..0000000 --- a/gcc/testsuite/gcc.target/arm/fp16-compile-none-1.c +++ /dev/null @@ -1,7 +0,0 @@ -/* { dg-do compile } */ -/* { dg-require-effective-target arm_fp16_none_ok } */ -/* { dg-options "-mfp16-format=none" } */ - -/* __fp16 type name is not recognized unless you explicitly enable it - by selecting -mfp16-format=ieee or -mfp16-format=alternative. */ -__fp16 xx = 0.0; /* { dg-error "unknown type name" } */ diff --git a/gcc/testsuite/gcc.target/arm/lceil-vcvt_1.c b/gcc/testsuite/gcc.target/arm/lceil-vcvt_1.c index a8afab1..a8f3729 100644 --- a/gcc/testsuite/gcc.target/arm/lceil-vcvt_1.c +++ b/gcc/testsuite/gcc.target/arm/lceil-vcvt_1.c @@ -1,7 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "-mpure-code supports M-profile only" { *-*-* } { "-mpure-code" } } */ /* { dg-require-effective-target arm_v8_vfp_ok } */ -/* { dg-options "-O2 -march=armv8-a" } */ +/* { dg-options "-O2" } */ /* { dg-add-options arm_v8_vfp } */ int diff --git a/gcc/testsuite/gcc.target/arm/lfloor-vcvt_1.c b/gcc/testsuite/gcc.target/arm/lfloor-vcvt_1.c index b8eb1b0..5655fbb 100644 --- a/gcc/testsuite/gcc.target/arm/lfloor-vcvt_1.c +++ b/gcc/testsuite/gcc.target/arm/lfloor-vcvt_1.c @@ -1,7 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "-mpure-code supports M-profile only" { *-*-* } { "-mpure-code" } } */ /* { dg-require-effective-target arm_v8_vfp_ok } */ -/* { dg-options "-O2 -march=armv8-a" } */ +/* { dg-options "-O2" } */ /* { dg-add-options arm_v8_vfp } */ int diff --git a/gcc/testsuite/gcc.target/arm/lround-vcvt_1.c b/gcc/testsuite/gcc.target/arm/lround-vcvt_1.c index 4c52a83..799cb8b 100644 --- a/gcc/testsuite/gcc.target/arm/lround-vcvt_1.c +++ b/gcc/testsuite/gcc.target/arm/lround-vcvt_1.c @@ -1,7 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "-mpure-code supports M-profile only" { *-*-* } { "-mpure-code" } } */ /* { dg-require-effective-target arm_v8_vfp_ok } */ -/* { dg-options "-O2 -march=armv8-a -ffast-math" } */ +/* { dg-options "-O2 -ffast-math" } */ /* { dg-add-options arm_v8_vfp } */ int diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/asrl-various-ranges.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/asrl-various-ranges.c new file mode 100644 index 0000000..4e2a301 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/asrl-various-ranges.c @@ -0,0 +1,161 @@ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ +/* { dg-additional-options "-O2" } */ +/* { dg-final { check-function-bodies "**" "" } } */ + +/* Check that calling asrl with an out of range shift amount is not interpreted + as undefined behavior, and that we actually use the asrl instruction (except + if a negative shift amount can be handled by lsll). Check code generation + for various special cases: + 1 <= amount <= 32 + -32 <= amount <= -1 + 32 < amount < 64 + -64 < amount < -32 + amount >= 64 + amount <= -64 + amount == 0 + amount unknown at compile time. */ +#include "arm_mve.h" + +#ifdef __cplusplus +extern "C" { +#endif + + /* Positive shift amount in [1.32] range, use the immediate: + + asrl r0, r1, #3 */ +/* +**foo_3: +** ... +** asrl (?:ip|fp|r[0-9]+), (?:ip|fp|r[0-9]+), #3(?: @.*|) +** ... +*/ +int64_t +foo_3 (int64_t value) +{ + return asrl (value, 3); +} + + /* Negative shift amount in [-32.-1] range, reverse shift (lsll) with the + opposite shift amount as immediate: + + lsll r0, r1, #3 */ +/* +**foo_m3: +** ... +** lsll (?:ip|fp|r[0-9]+), (?:ip|fp|r[0-9]+), #3(?: @.*|) +** ... +*/ +int64_t +foo_m3 (int64_t value) +{ + return asrl (value, -3); +} + + /* Out of [1.32] range positive shift amount, but < 64. + lo_out = hi_in >> (amount - 32) + hi_out = hi_in >> 31 (to copy the sign bit) + + asrs r0, r1, #1 + asrs r1, r1, #31 */ +/* +**foo_33: +** ... +** asrs (?:ip|fp|r[0-9]+), (ip|fp|r[0-9]+), #1(?: @.*|) +** asrs (?:ip|fp|r[0-9]+), \1, #31(?: @.*|) +** ... +*/ +int64_t +foo_33 (int64_t value) +{ + return asrl (value, 33); +} + + /* Out of [-32..-1] range negative shift amount, but > -64. Reverse shift + (lsll equivalent) in [33.64] range: + hi_out = lo_in << (-amount - 32) + lo_out = 0 + + lsls r1, r0, #1 + movs r0, #0 */ +/* +**foo_m33: +** ... +** lsls (?:ip|fp|r[0-9]+), (ip|fp|r[0-9]+), #1(?: @.*|) +** movs \1, #0(?: @.*|) +** ... +*/ +int64_t +foo_m33 (int64_t value) +{ + return asrl (value, -33); +} + + /* Out of range positive shift amount (>= 64) + lo_out = hi_in >> 31 (copy sign bit) + hi_out = hi_in >> 31 + + asrs r0, r1, #31 + mov r1, r0 */ +/* +**foo_65: +** ... +** asrs (ip|fp|r[0-9]+), (?:ip|fp|r[0-9]+), #31(?: @.*|) +** mov (?:ip|fp|r[0-9]+), \1(?: @.*|) +** ... +*/ +int64_t +foo_65 (int64_t value) +{ + return asrl (value, 65); +} + + /* Out of range negative shift amount (<= 64), result is 0. + + movs r0, #0 + movs r1, #0 */ +/* +**foo_m65: +** ... +** movs (ip|fp|r[0-9]+), #0(?: @.*|) +** movs (ip|fp|r[0-9]+), #0(?: @.*|) +** ... +*/ +int64_t +foo_m65 (int64_t value) +{ + return asrl (value, -65); +} + + /* shift amount == 0, use a mov, which is optimized out. */ +/* +**foo_0: +** bx lr +** ... +*/ +int64_t +foo_0 (int64_t value) +{ + return asrl (value, 0); +} + + /* Unknown shift amount, use the register variant. + + asrl r0, r1, r2 */ +/* +**foo_var: +** ... +** asrl (?:ip|fp|r[0-9]+), (?:ip|fp|r[0-9]+), (?:ip|fp|r[0-9]+)(?: @.*|) +** ... +*/ +int64_t +foo_var (int64_t value, int32_t amount) +{ + return asrl (value, amount); +} + +#ifdef __cplusplus +} +#endif + +/* { dg-final { scan-assembler-not "__ARM_undef" } } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/lsll-various-ranges.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/lsll-various-ranges.c new file mode 100644 index 0000000..1e2f558 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/lsll-various-ranges.c @@ -0,0 +1,160 @@ + /* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ +/* { dg-additional-options "-O2" } */ +/* { dg-final { check-function-bodies "**" "" } } */ + +/* Check that calling lsll with an out of range shift amount is not interpreted + as undefined behavior, and that we actually use the lsll instruction (except + if a negative shift amount can be handled by asrl). Check code generation + for various special cases: + 1 <= amount <= 32 + -32 <= amount <= -1 + 32 < amount < 64 + -64 < amount < -32 + amount >= 64 + amount <= -64 + amount == 0 + amount unknown at compile time. */ +#include "arm_mve.h" + +#ifdef __cplusplus +extern "C" { +#endif + + /* Positive shift amount in [1.32] range, use the immediate: + + lsll r0,r1,#3 */ +/* +**foo_3: +** ... +** lsll (?:ip|fp|r[0-9]+), (?:ip|fp|r[0-9]+), #3(?: @.*|) +** ... +*/ +uint64_t +foo_3 (uint64_t value) +{ + return lsll (value, 3); +} + + /* Negative shift amount in [-32.-1] range, reverse shift (asrl) with the + opposite shift amount as immediate: + + lsrl r0, r1, #3 */ +/* +**foo_m3: +** ... +** lsrl (?:ip|fp|r[0-9]+), (?:ip|fp|r[0-9]+), #3(?: @.*|) +** ... +*/ +uint64_t +foo_m3 (uint64_t value) +{ + return lsll (value, -3); +} + + /* Out of [1..32] range positive shift amount, but < 64. + high_out = low_in << (amount - 32) (using lsls, not lsll) + low_out = 0 + + lsls r1,r0,#1 + movs r0, #0 */ +/* +**foo_33: +** ... +** lsls (?:ip|fp|r[0-9]+), (ip|fp|r[0-9]+), #1(?: @.*|) +** movs \1, #0(?: @.*|) +** ... +*/ +uint64_t +foo_33 (uint64_t value) +{ + return lsll (value, 33); +} + + /* Out of [-32..-1] range negative shift amount, but > -64. Reverse shift + (lsrl equivalent) in [33..64] range: + lo_out = hi_in >> (amount - 32) + hi_out = 0 + + lsrs r0, r1, #1 + movs r1, #0 */ +/* +**foo_m33: +** ... +** lsrs (?:ip|fp|r[0-9]+), (?:ip|fp|r[0-9]+), #1(?: @.*|) +** movs (?:ip|fp|r[0-9]+), #0(?: @.*|) +** ... +*/ +uint64_t +foo_m33 (uint64_t value) +{ + return lsll (value, -33); +} + + /* Out of range positive shift amount (>= 64), result is 0. + + movs r0, #0 + movs r1, #0 */ +/* +**foo_65: +** ... +** movs (ip|fp|r[0-9]+), #0(?: @.*|) +** movs (ip|fp|r[0-9]+), #0(?: @.*|) +** ... +*/ +uint64_t +foo_65 (uint64_t value) +{ + return lsll (value, 65); +} + + /* Out of range negative shift amount (<= -64), result is 0, because lsll + uses an unsigned input. + + movs r0, #0 + movs r1, #0 */ +/* +**foo_m65: +** ... +** movs (ip|fp|r[0-9]+), #0(?: @.*|) +** movs (ip|fp|r[0-9]+), #0(?: @.*|) +** ... +*/ +uint64_t +foo_m65 (uint64_t value) +{ + return lsll (value, -65); +} + + /* shift amount == 0, use a mov, which is optimized out. */ +/* +**foo_0: +** bx lr +** ... +*/ +uint64_t +foo_0 (uint64_t value) +{ + return lsll (value, 0); +} + + /* Unknown shift amount, use the register variant. + + lsll r0, r1, r2 */ +/* +**foo_var: +** ... +** lsll (?:ip|fp|r[0-9]+), (?:ip|fp|r[0-9]+), (?:ip|fp|r[0-9]+)(?: @.*|) +** ... +*/ +uint64_t +foo_var (uint64_t value, int32_t amount) +{ + return lsll (value, amount); +} + +#ifdef __cplusplus +} +#endif + +/* { dg-final { scan-assembler-not "__ARM_undef" } } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/pr117814-2-f16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/pr117814-2-f16.c new file mode 100644 index 0000000..046cad0 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/pr117814-2-f16.c @@ -0,0 +1,30 @@ +/* Check that we can compile if the target does not support floating-point, but + we use a pragma to enable FP support locally. */ + +/* { dg-require-effective-target arm_v8_1m_mve_nofp_ok } */ +/* { dg-add-options arm_v8_1m_mve_nofp } */ +/* { dg-additional-options "-O2" } */ + +#include "arm_mve.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#pragma GCC target ("arch=armv8.1-m.main+mve.fp") + +/* +**foo: +** ... +** vldrh.16 q[0-9]+, \[(?:ip|fp|r[0-9]+)\](?: @.*|) +** ... +*/ +float16x8_t +foo (float16_t const *base) +{ + return vld1q_f16 (base); +} + +#ifdef __cplusplus +} +#endif diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/pr117814-2-f32.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/pr117814-2-f32.c new file mode 100644 index 0000000..6856e8e --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/pr117814-2-f32.c @@ -0,0 +1,30 @@ +/* Check that we can compile if the target does not support floating-point, but + we use a pragma to enable FP support locally. */ + +/* { dg-require-effective-target arm_v8_1m_mve_nofp_ok } */ +/* { dg-add-options arm_v8_1m_mve_nofp } */ +/* { dg-additional-options "-O2" } */ + +#include "arm_mve.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#pragma GCC target ("arch=armv8.1-m.main+mve.fp") + +/* +**foo: +** ... +** vldrw.32 q[0-9]+, \[(?:ip|fp|r[0-9]+)\](?: @.*|) +** ... +*/ +float32x4_t +foo (float32_t const *base) +{ + return vld1q_f32 (base); +} + +#ifdef __cplusplus +} +#endif diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/pr117814-3-f16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/pr117814-3-f16.c new file mode 100644 index 0000000..bcb0dd6 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/pr117814-3-f16.c @@ -0,0 +1,21 @@ +/* Check that we can compile if the target supports floating-point. */ + +/* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */ +/* { dg-add-options arm_v8_1m_mve_fp } */ +/* { dg-additional-options "-O2" } */ + +#include "arm_mve.h" + +#ifdef __cplusplus +extern "C" { +#endif + +float16x8_t +foo (float16_t const *base) +{ + return vld1q_f16 (base); +} + +#ifdef __cplusplus +} +#endif diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/pr117814-3-f32.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/pr117814-3-f32.c new file mode 100644 index 0000000..7e02816 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/pr117814-3-f32.c @@ -0,0 +1,21 @@ +/* Check that we can compile if the target supports floating-point. */ + +/* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */ +/* { dg-add-options arm_v8_1m_mve_fp } */ +/* { dg-additional-options "-O2" } */ + +#include "arm_mve.h" + +#ifdef __cplusplus +extern "C" { +#endif + +float32x4_t +foo (float32_t const *base) +{ + return vld1q_f32 (base); +} + +#ifdef __cplusplus +} +#endif diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/pr117814-4-f16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/pr117814-4-f16.c new file mode 100644 index 0000000..b266f1b --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/pr117814-4-f16.c @@ -0,0 +1,23 @@ +/* Check that -mfp16-format=none works. */ + +/* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */ +/* { dg-add-options arm_v8_1m_mve_fp } */ +/* { dg-additional-options "-O2 -mfp16-format=none" } */ + +#include "arm_mve.h" + +#ifdef __cplusplus +extern "C" { +#endif + +float16x8_t +foo (float16_t const *base) +{ + return vld1q_f16 (base); +} + +#ifdef __cplusplus +} +#endif + +/* { dg-final { scan-assembler-not {eabi_attribute 38,} } } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/pr117814-f16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/pr117814-f16.c new file mode 100644 index 0000000..88930c1 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/pr117814-f16.c @@ -0,0 +1,22 @@ +/* Check that we get an error if the target does not support floating-point: we + force +mve to cancel a possible implicit +mve.fp. */ + +/* { dg-require-effective-target arm_v8_1m_mve_nofp_ok } */ +/* { dg-add-options arm_v8_1m_mve_nofp } */ +/* { dg-additional-options "-O2" } */ + +#include "arm_mve.h" + +#ifdef __cplusplus +extern "C" { +#endif + +float16x8_t +foo (float16_t const *base) +{ + return vld1q_f16 (base); /* { dg-error {ACLE function '.*vld1q_f16.*' requires ISA extension 'mve.fp'} } */ +} + +#ifdef __cplusplus +} +#endif diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/pr117814-f32.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/pr117814-f32.c new file mode 100644 index 0000000..814e781 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/pr117814-f32.c @@ -0,0 +1,22 @@ +/* Check that we get an error if the target does not support floating-point: we + force +mve to cancel a possible implicit +mve.fp. */ + +/* { dg-require-effective-target arm_v8_1m_mve_nofp_ok } */ +/* { dg-add-options arm_v8_1m_mve_nofp } */ +/* { dg-additional-options "-O2" } */ + +#include "arm_mve.h" + +#ifdef __cplusplus +extern "C" { +#endif + +float32x4_t +foo (float32_t const *base) +{ + return vld1q_f32 (base); /* { dg-error {ACLE function '.*vld1q_f32.*' requires ISA extension 'mve.fp'} } */ +} + +#ifdef __cplusplus +} +#endif diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/pr122175.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/pr122175.c new file mode 100644 index 0000000..42873d0 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/pr122175.c @@ -0,0 +1,38 @@ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ +/* { dg-additional-options "-O2" } */ + +#include <arm_mve.h> + +#ifdef __cplusplus +extern "C" { +#endif + +uint16x8_t test_1(uint16x8_t v11) { + return vbicq_n_u16(v11, 0x8000); +} + +uint16x8_t test_2(uint16x8_t v11) { + return vorrq_n_u16(v11, 0x8000); +} + +uint16x8_t test_3() { + return vmvnq_n_u16(0x8000); +} + +mve_pred16_t pred; +uint16x8_t test_4(uint16x8_t v11) { + return vbicq_m_n_u16(v11, 0x8000, pred); +} + +uint16x8_t test_5(uint16x8_t v11) { + return vorrq_m_n_u16(v11, 0x8000, pred); +} + +uint16x8_t test_6() { + return vmvnq_x_n_u16(0x8000, pred); +} + +#ifdef __cplusplus +} +#endif diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/sqshl_check_shift.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/sqshl_check_shift.c new file mode 100644 index 0000000..0519166 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/sqshl_check_shift.c @@ -0,0 +1,24 @@ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ + +#include "arm_mve.h" + +#ifdef __cplusplus +extern "C" { +#endif + +int32_t +foo (int32_t value) +{ + return sqshl (value, 33); /* { dg-error {passing 33 to argument 2 of 'sqshl', which expects a value in the range \[1, 32\]} } */ +} + +int32_t +foo1 (int32_t value) +{ + return sqshl (value, -1); /* { dg-error {passing -1 to argument 2 of 'sqshl', which expects a value in the range \[1, 32\]} } */ +} + +#ifdef __cplusplus +} +#endif diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/sqshll_check_shift.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/sqshll_check_shift.c new file mode 100644 index 0000000..6b5fc41 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/sqshll_check_shift.c @@ -0,0 +1,24 @@ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ + +#include "arm_mve.h" + +#ifdef __cplusplus +extern "C" { +#endif + +int64_t +foo (int64_t value) +{ + return sqshll (value, 33); /* { dg-error {passing 33 to argument 2 of 'sqshll', which expects a value in the range \[1, 32\]} } */ +} + +int64_t +foo1 (int64_t value) +{ + return sqshll (value, -1); /* { dg-error {passing -1 to argument 2 of 'sqshll', which expects a value in the range \[1, 32\]} } */ +} + +#ifdef __cplusplus +} +#endif diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/srshr_check_shift.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/srshr_check_shift.c new file mode 100644 index 0000000..98c5e17 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/srshr_check_shift.c @@ -0,0 +1,24 @@ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ + +#include "arm_mve.h" + +#ifdef __cplusplus +extern "C" { +#endif + +int32_t +foo (int32_t value) +{ + return srshr (value, 33); /* { dg-error {passing 33 to argument 2 of 'srshr', which expects a value in the range \[1, 32\]} } */ +} + +int32_t +foo1 (int32_t value) +{ + return srshr (value, -1); /* { dg-error {passing -1 to argument 2 of 'srshr', which expects a value in the range \[1, 32\]} } */ +} + +#ifdef __cplusplus +} +#endif diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/srshrl_check_shift.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/srshrl_check_shift.c new file mode 100644 index 0000000..d29a239 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/srshrl_check_shift.c @@ -0,0 +1,24 @@ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ + +#include "arm_mve.h" + +#ifdef __cplusplus +extern "C" { +#endif + +int64_t +foo (int64_t value) +{ + return srshrl (value, 33); /* { dg-error {passing 33 to argument 2 of 'srshrl', which expects a value in the range \[1, 32\]} } */ +} + +int64_t +foo1 (int64_t value) +{ + return srshrl (value, -1); /* { dg-error {passing -1 to argument 2 of 'srshrl', which expects a value in the range \[1, 32\]} } */ +} + +#ifdef __cplusplus +} +#endif diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/uqshl_check_shift.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/uqshl_check_shift.c new file mode 100644 index 0000000..eef1bc0 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/uqshl_check_shift.c @@ -0,0 +1,24 @@ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ + +#include "arm_mve.h" + +#ifdef __cplusplus +extern "C" { +#endif + +uint32_t +foo (uint32_t value) +{ + return uqshl (value, 33); /* { dg-error {passing 33 to argument 2 of 'uqshl', which expects a value in the range \[1, 32\]} } */ +} + +uint32_t +foo1 (uint32_t value) +{ + return uqshl (value, -1); /* { dg-error {passing -1 to argument 2 of 'uqshl', which expects a value in the range \[1, 32\]} } */ +} + +#ifdef __cplusplus +} +#endif diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/uqshll_check_shift.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/uqshll_check_shift.c new file mode 100644 index 0000000..485fd01 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/uqshll_check_shift.c @@ -0,0 +1,24 @@ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ + +#include "arm_mve.h" + +#ifdef __cplusplus +extern "C" { +#endif + +uint64_t +foo (uint64_t value) +{ + return uqshll (value, 33); /* { dg-error {passing 33 to argument 2 of 'uqshll', which expects a value in the range \[1, 32\]} } */ +} + +uint64_t +foo1 (uint64_t value) +{ + return uqshll (value, -1); /* { dg-error {passing -1 to argument 2 of 'uqshll', which expects a value in the range \[1, 32\]} } */ +} + +#ifdef __cplusplus +} +#endif diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/urshr_check_shift.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/urshr_check_shift.c new file mode 100644 index 0000000..744bf7c --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/urshr_check_shift.c @@ -0,0 +1,24 @@ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ + +#include "arm_mve.h" + +#ifdef __cplusplus +extern "C" { +#endif + +uint32_t +foo (uint32_t value) +{ + return urshr (value, 33); /* { dg-error {passing 33 to argument 2 of 'urshr', which expects a value in the range \[1, 32\]} } */ +} + +uint32_t +foo1 (uint32_t value) +{ + return urshr (value, -1); /* { dg-error {passing -1 to argument 2 of 'urshr', which expects a value in the range \[1, 32\]} } */ +} + +#ifdef __cplusplus +} +#endif diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/urshrl_check_shift.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/urshrl_check_shift.c new file mode 100644 index 0000000..9d0d3b1 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/urshrl_check_shift.c @@ -0,0 +1,24 @@ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ + +#include "arm_mve.h" + +#ifdef __cplusplus +extern "C" { +#endif + +uint64_t +foo (uint64_t value) +{ + return urshrl (value, 33); /* { dg-error {passing 33 to argument 2 of 'urshrl', which expects a value in the range \[1, 32\]} } */ +} + +uint64_t +foo1 (uint64_t value) +{ + return urshrl (value, -1); /* { dg-error {passing -1 to argument 2 of 'urshrl', which expects a value in the range \[1, 32\]} } */ +} + +#ifdef __cplusplus +} +#endif diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_m_n_s16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_m_n_s16.c index 4e2be3e..804b890 100644 --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_m_n_s16.c +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_m_n_s16.c @@ -16,7 +16,7 @@ extern "C" { ** ... ** vpst(?: @.*|) ** ... -** vbict.i16 q[0-9]+, #[0-9]+(?: @.*|) +** vbict.i16 q[0-9]+, [0-9]+(?: @.*|) ** ... */ int16x8_t @@ -33,7 +33,7 @@ foo (int16x8_t a, mve_pred16_t p) ** ... ** vpst(?: @.*|) ** ... -** vbict.i16 q[0-9]+, #[0-9]+(?: @.*|) +** vbict.i16 q[0-9]+, [0-9]+(?: @.*|) ** ... */ int16x8_t diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_m_n_u16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_m_n_u16.c index 34b62aa..197c711 100644 --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_m_n_u16.c +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_m_n_u16.c @@ -16,7 +16,7 @@ extern "C" { ** ... ** vpst(?: @.*|) ** ... -** vbict.i16 q[0-9]+, #[0-9]+(?: @.*|) +** vbict.i16 q[0-9]+, [0-9]+(?: @.*|) ** ... */ uint16x8_t @@ -33,7 +33,7 @@ foo (uint16x8_t a, mve_pred16_t p) ** ... ** vpst(?: @.*|) ** ... -** vbict.i16 q[0-9]+, #[0-9]+(?: @.*|) +** vbict.i16 q[0-9]+, [0-9]+(?: @.*|) ** ... */ uint16x8_t diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_n_s16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_n_s16.c index 8726b2c..939fffd 100644 --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_n_s16.c +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_n_s16.c @@ -12,7 +12,7 @@ extern "C" { /* **foo: ** ... -** vbic.i16 q[0-9]+, #[0-9]+(?: @.*|) +** vbic.i16 q[0-9]+, [0-9]+(?: @.*|) ** ... */ int16x8_t @@ -25,7 +25,7 @@ foo (int16x8_t a) /* **foo1: ** ... -** vbic.i16 q[0-9]+, #[0-9]+(?: @.*|) +** vbic.i16 q[0-9]+, [0-9]+(?: @.*|) ** ... */ int16x8_t diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_n_u16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_n_u16.c index 1ad03b9..a33c813 100644 --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_n_u16.c +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_n_u16.c @@ -12,7 +12,7 @@ extern "C" { /* **foo: ** ... -** vbic.i16 q[0-9]+, #[0-9]+(?: @.*|) +** vbic.i16 q[0-9]+, [0-9]+(?: @.*|) ** ... */ uint16x8_t @@ -25,7 +25,7 @@ foo (uint16x8_t a) /* **foo1: ** ... -** vbic.i16 q[0-9]+, #[0-9]+(?: @.*|) +** vbic.i16 q[0-9]+, [0-9]+(?: @.*|) ** ... */ uint16x8_t diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_f16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_f16.c index b081137..4bcc2ab 100644 --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_f16.c +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_f16.c @@ -1,4 +1,3 @@ -/* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=soft" } {""} } */ /* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */ /* { dg-add-options arm_v8_1m_mve_fp } */ /* { dg-additional-options "-O2" } */ @@ -6,6 +5,10 @@ #include "arm_mve.h" +#ifdef __cplusplus +extern "C" { +#endif + float16_t foo (float16x8_t a) { @@ -45,3 +48,7 @@ foo1 (float16x8_t a) ** ) ** bx\tlr */ + +#ifdef __cplusplus +} +#endif diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_f32.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_f32.c index c923b9e..18d2dfd 100644 --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_f32.c +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_f32.c @@ -1,4 +1,3 @@ -/* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=soft" } {""} } */ /* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */ /* { dg-add-options arm_v8_1m_mve_fp } */ /* { dg-additional-options "-O2" } */ @@ -6,6 +5,10 @@ #include "arm_mve.h" +#ifdef __cplusplus +extern "C" { +#endif + float32_t foo (float32x4_t a) { @@ -45,3 +48,7 @@ foo1 (float32x4_t a) ** ) ** bx\tlr */ + +#ifdef __cplusplus +} +#endif diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_s16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_s16.c index 4a89637..e8744b8 100644 --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_s16.c +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_s16.c @@ -1,4 +1,3 @@ -/* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=soft" } {""} } */ /* { dg-require-effective-target arm_v8_1m_mve_ok } */ /* { dg-add-options arm_v8_1m_mve } */ /* { dg-additional-options "-O2" } */ @@ -6,6 +5,10 @@ #include "arm_mve.h" +#ifdef __cplusplus +extern "C" { +#endif + int16_t foo (int16x8_t a) { @@ -43,3 +46,7 @@ foo1 (int16x8_t a) ** ) ** bx\tlr */ + +#ifdef __cplusplus +} +#endif diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_s32.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_s32.c index 3a504e8..e6ac370 100644 --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_s32.c +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_s32.c @@ -1,4 +1,3 @@ -/* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=soft" } {""} } */ /* { dg-require-effective-target arm_v8_1m_mve_ok } */ /* { dg-add-options arm_v8_1m_mve } */ /* { dg-additional-options "-O2" } */ @@ -6,6 +5,10 @@ #include "arm_mve.h" +#ifdef __cplusplus +extern "C" { +#endif + int32_t foo (int32x4_t a) { @@ -43,3 +46,7 @@ foo1 (int32x4_t a) ** ) ** bx\tlr */ + +#ifdef __cplusplus +} +#endif diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_s64.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_s64.c index 63b2508..857ed76 100644 --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_s64.c +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_s64.c @@ -1,23 +1,48 @@ -/* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=soft" } {""} } */ -/* { dg-require-effective-target arm_hard_ok } */ /* { dg-require-effective-target arm_v8_1m_mve_ok } */ /* { dg-add-options arm_v8_1m_mve } */ -/* { dg-additional-options "-mfloat-abi=hard -O2" } */ +/* { dg-additional-options "-O2" } */ +/* { dg-final { check-function-bodies "**" "" "" } } */ #include "arm_mve.h" +#ifdef __cplusplus +extern "C" { +#endif + int64_t foo (int64x2_t a) { return vgetq_lane_s64 (a, 0); } - -/* { dg-final { scan-assembler {vmov\tr0, r1, d0} } } */ +/* +** foo: +** ( + -mfloat-abi=softfp + no operation needed +** | + -mfloat-abi=hard +** vmov\tr0, r1, d0\t@ int +** ) +** bx\tlr +*/ int64_t foo1 (int64x2_t a) { return vgetq_lane (a, 0); } +/* +** foo1: +** ( + -mfloat-abi=softfp + no operation needed +** | + -mfloat-abi=hard +** vmov\tr0, r1, d0\t@ int +** ) +** bx\tlr +*/ -/* { dg-final { scan-assembler {vmov\tr0, r1, d0} } } */ +#ifdef __cplusplus +} +#endif diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_s8.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_s8.c index cd014b2..b342af5 100644 --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_s8.c +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_s8.c @@ -1,4 +1,3 @@ -/* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=soft" } {""} } */ /* { dg-require-effective-target arm_v8_1m_mve_ok } */ /* { dg-add-options arm_v8_1m_mve } */ /* { dg-additional-options "-O2" } */ @@ -6,6 +5,10 @@ #include "arm_mve.h" +#ifdef __cplusplus +extern "C" { +#endif + int8_t foo (int8x16_t a) { @@ -43,3 +46,7 @@ foo1 (int8x16_t a) ** ) ** bx\tlr */ + +#ifdef __cplusplus +} +#endif diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_u16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_u16.c index 74b7340..4b42011 100644 --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_u16.c +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_u16.c @@ -1,4 +1,3 @@ -/* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=soft" } {""} } */ /* { dg-require-effective-target arm_v8_1m_mve_ok } */ /* { dg-add-options arm_v8_1m_mve } */ /* { dg-additional-options "-O2" } */ @@ -6,6 +5,10 @@ #include "arm_mve.h" +#ifdef __cplusplus +extern "C" { +#endif + uint16_t foo (uint16x8_t a) { @@ -43,3 +46,7 @@ foo1 (uint16x8_t a) ** ) ** bx\tlr */ + +#ifdef __cplusplus +} +#endif diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_u32.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_u32.c index c4460e4..05e0bda 100644 --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_u32.c +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_u32.c @@ -1,4 +1,3 @@ -/* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=soft" } {""} } */ /* { dg-require-effective-target arm_v8_1m_mve_ok } */ /* { dg-add-options arm_v8_1m_mve } */ /* { dg-additional-options "-O2" } */ @@ -6,6 +5,10 @@ #include "arm_mve.h" +#ifdef __cplusplus +extern "C" { +#endif + uint32_t foo (uint32x4_t a) { @@ -43,3 +46,7 @@ foo1 (uint32x4_t a) ** ) ** bx\tlr */ + +#ifdef __cplusplus +} +#endif diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_u64.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_u64.c index a4b900f..7c708d5 100644 --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_u64.c +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_u64.c @@ -1,23 +1,48 @@ -/* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=soft" } {""} } */ -/* { dg-require-effective-target arm_hard_ok } */ /* { dg-require-effective-target arm_v8_1m_mve_ok } */ /* { dg-add-options arm_v8_1m_mve } */ -/* { dg-additional-options "-mfloat-abi=hard -O2" } */ +/* { dg-additional-options "-O2" } */ +/* { dg-final { check-function-bodies "**" "" "" } } */ #include "arm_mve.h" +#ifdef __cplusplus +extern "C" { +#endif + uint64_t foo (uint64x2_t a) { return vgetq_lane_u64 (a, 0); } - -/* { dg-final { scan-assembler {vmov\tr0, r1, d0} } } */ +/* +** foo: +** ( + -mfloat-abi=softfp + no operation needed +** | + -mfloat-abi=hard +** vmov\tr0, r1, d0\t@ int +** ) +** bx\tlr +*/ uint64_t foo1 (uint64x2_t a) { return vgetq_lane (a, 0); } +/* +** foo1: +** ( + -mfloat-abi=softfp + no operation needed +** | + -mfloat-abi=hard +** vmov\tr0, r1, d0\t@ int +** ) +** bx\tlr +*/ -/* { dg-final { scan-assembler {vmov\tr0, r1, d0} } } */ +#ifdef __cplusplus +} +#endif diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_u8.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_u8.c index f3abf1e..b86764f 100644 --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_u8.c +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_u8.c @@ -1,4 +1,3 @@ -/* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=soft" } {""} } */ /* { dg-require-effective-target arm_v8_1m_mve_ok } */ /* { dg-add-options arm_v8_1m_mve } */ /* { dg-additional-options "-O2" } */ @@ -6,6 +5,10 @@ #include "arm_mve.h" +#ifdef __cplusplus +extern "C" { +#endif + uint8_t foo (uint8x16_t a) { @@ -43,3 +46,7 @@ foo1 (uint8x16_t a) ** ) ** bx\tlr */ + +#ifdef __cplusplus +} +#endif diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vmvnq_m_n_s16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vmvnq_m_n_s16.c index 9d4804a..77b7786 100644 --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vmvnq_m_n_s16.c +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vmvnq_m_n_s16.c @@ -16,7 +16,7 @@ extern "C" { ** ... ** vpst(?: @.*|) ** ... -** vmvnt.i16 q[0-9]+, #[0-9]+(?: @.*|) +** vmvnt.i16 q[0-9]+, [0-9]+(?: @.*|) ** ... */ int16x8_t @@ -33,7 +33,7 @@ foo (int16x8_t inactive, mve_pred16_t p) ** ... ** vpst(?: @.*|) ** ... -** vmvnt.i16 q[0-9]+, #[0-9]+(?: @.*|) +** vmvnt.i16 q[0-9]+, [0-9]+(?: @.*|) ** ... */ int16x8_t diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vmvnq_m_n_u16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vmvnq_m_n_u16.c index 7b0b5a9..7dde0c7 100644 --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vmvnq_m_n_u16.c +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vmvnq_m_n_u16.c @@ -16,7 +16,7 @@ extern "C" { ** ... ** vpst(?: @.*|) ** ... -** vmvnt.i16 q[0-9]+, #[0-9]+(?: @.*|) +** vmvnt.i16 q[0-9]+, [0-9]+(?: @.*|) ** ... */ uint16x8_t @@ -33,7 +33,7 @@ foo (uint16x8_t inactive, mve_pred16_t p) ** ... ** vpst(?: @.*|) ** ... -** vmvnt.i16 q[0-9]+, #[0-9]+(?: @.*|) +** vmvnt.i16 q[0-9]+, [0-9]+(?: @.*|) ** ... */ uint16x8_t diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vmvnq_n_s16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vmvnq_n_s16.c index 9756393..ccfa7eb 100644 --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vmvnq_n_s16.c +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vmvnq_n_s16.c @@ -12,7 +12,7 @@ extern "C" { /* **foo: ** ... -** vmvn.i16 q[0-9]+, #[0-9]+(?: @.*|) +** vmvn.i16 q[0-9]+, [0-9]+(?: @.*|) ** ... */ int16x8_t diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vmvnq_n_u16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vmvnq_n_u16.c index 84e158a..3b8d876 100644 --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vmvnq_n_u16.c +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vmvnq_n_u16.c @@ -12,7 +12,7 @@ extern "C" { /* **foo: ** ... -** vmvn.i16 q[0-9]+, #[0-9]+(?: @.*|) +** vmvn.i16 q[0-9]+, [0-9]+(?: @.*|) ** ... */ uint16x8_t diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vmvnq_x_n_s16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vmvnq_x_n_s16.c index a4d575e..26d03e6 100644 --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vmvnq_x_n_s16.c +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vmvnq_x_n_s16.c @@ -16,7 +16,7 @@ extern "C" { ** ... ** vpst(?: @.*|) ** ... -** vmvnt.i16 q[0-9]+, #[0-9]+(?: @.*|) +** vmvnt.i16 q[0-9]+, [0-9]+(?: @.*|) ** ... */ int16x8_t diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vmvnq_x_n_u16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vmvnq_x_n_u16.c index 9fbf2b9..176b03c 100644 --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vmvnq_x_n_u16.c +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vmvnq_x_n_u16.c @@ -16,7 +16,7 @@ extern "C" { ** ... ** vpst(?: @.*|) ** ... -** vmvnt.i16 q[0-9]+, #[0-9]+(?: @.*|) +** vmvnt.i16 q[0-9]+, [0-9]+(?: @.*|) ** ... */ uint16x8_t diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vorrq_m_n_s16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vorrq_m_n_s16.c index b591bd6..f0f2ce4 100644 --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vorrq_m_n_s16.c +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vorrq_m_n_s16.c @@ -16,7 +16,7 @@ extern "C" { ** ... ** vpst(?: @.*|) ** ... -** vorrt.i16 q[0-9]+, #[0-9]+(?: @.*|) +** vorrt.i16 q[0-9]+, [0-9]+(?: @.*|) ** ... */ int16x8_t @@ -33,7 +33,7 @@ foo (int16x8_t a, mve_pred16_t p) ** ... ** vpst(?: @.*|) ** ... -** vorrt.i16 q[0-9]+, #[0-9]+(?: @.*|) +** vorrt.i16 q[0-9]+, [0-9]+(?: @.*|) ** ... */ int16x8_t diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vorrq_m_n_u16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vorrq_m_n_u16.c index 9e77884..92644b6 100644 --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vorrq_m_n_u16.c +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vorrq_m_n_u16.c @@ -16,7 +16,7 @@ extern "C" { ** ... ** vpst(?: @.*|) ** ... -** vorrt.i16 q[0-9]+, #[0-9]+(?: @.*|) +** vorrt.i16 q[0-9]+, [0-9]+(?: @.*|) ** ... */ uint16x8_t @@ -33,7 +33,7 @@ foo (uint16x8_t a, mve_pred16_t p) ** ... ** vpst(?: @.*|) ** ... -** vorrt.i16 q[0-9]+, #[0-9]+(?: @.*|) +** vorrt.i16 q[0-9]+, [0-9]+(?: @.*|) ** ... */ uint16x8_t diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vorrq_n_s16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vorrq_n_s16.c index b95418d..670e753 100644 --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vorrq_n_s16.c +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vorrq_n_s16.c @@ -12,7 +12,7 @@ extern "C" { /* **foo: ** ... -** vorr.i16 q[0-9]+, #[0-9]+(?: @.*|) +** vorr.i16 q[0-9]+, [0-9]+(?: @.*|) ** ... */ int16x8_t @@ -25,7 +25,7 @@ foo (int16x8_t a) /* **foo1: ** ... -** vorr.i16 q[0-9]+, #[0-9]+(?: @.*|) +** vorr.i16 q[0-9]+, [0-9]+(?: @.*|) ** ... */ int16x8_t diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vorrq_n_u16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vorrq_n_u16.c index 1f13150..fd3d98e 100644 --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vorrq_n_u16.c +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vorrq_n_u16.c @@ -12,7 +12,7 @@ extern "C" { /* **foo: ** ... -** vorr.i16 q[0-9]+, #[0-9]+(?: @.*|) +** vorr.i16 q[0-9]+, [0-9]+(?: @.*|) ** ... */ uint16x8_t @@ -25,7 +25,7 @@ foo (uint16x8_t a) /* **foo1: ** ... -** vorr.i16 q[0-9]+, #[0-9]+(?: @.*|) +** vorr.i16 q[0-9]+, [0-9]+(?: @.*|) ** ... */ uint16x8_t diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vsetq_lane_f16_bounds.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vsetq_lane_f16_bounds.c new file mode 100644 index 0000000..0aec13f --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vsetq_lane_f16_bounds.c @@ -0,0 +1,19 @@ +/* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */ +/* { dg-add-options arm_v8_1m_mve_fp } */ +/* { dg-additional-options "-O2" } */ + +#include "arm_mve.h" + +#ifdef __cplusplus +extern "C" { +#endif + +float16x8_t +foo (float16_t a, float16x8_t b) +{ + return vsetq_lane_f16 (a, b, 9); /* { dg-error {passing 9 to argument 3 of 'vsetq_lane_f16', which expects a value in the range \[0, 7\]} } */ +} + +#ifdef __cplusplus +} +#endif diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vsetq_lane_f32_bounds.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vsetq_lane_f32_bounds.c new file mode 100644 index 0000000..5627e0a --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vsetq_lane_f32_bounds.c @@ -0,0 +1,19 @@ +/* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */ +/* { dg-add-options arm_v8_1m_mve_fp } */ +/* { dg-additional-options "-O2" } */ + +#include "arm_mve.h" + +#ifdef __cplusplus +extern "C" { +#endif + +float32x4_t +foo (float32_t a, float32x4_t b) +{ + return vsetq_lane_f32 (a, b, 4); /* { dg-error {passing 4 to argument 3 of 'vsetq_lane_f32', which expects a value in the range \[0, 3\]} } */ +} + +#ifdef __cplusplus +} +#endif diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vsetq_lane_s16_bounds.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vsetq_lane_s16_bounds.c new file mode 100644 index 0000000..af255f8 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vsetq_lane_s16_bounds.c @@ -0,0 +1,19 @@ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ +/* { dg-additional-options "-O2" } */ + +#include "arm_mve.h" + +#ifdef __cplusplus +extern "C" { +#endif + +int16x8_t +foo (int16_t a, int16x8_t b) +{ + return vsetq_lane_s16 (a, b, 9); /* { dg-error {passing 9 to argument 3 of 'vsetq_lane_s16', which expects a value in the range \[0, 7\]} } */ +} + +#ifdef __cplusplus +} +#endif diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vsetq_lane_s32_bounds.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vsetq_lane_s32_bounds.c new file mode 100644 index 0000000..968910c --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vsetq_lane_s32_bounds.c @@ -0,0 +1,19 @@ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ +/* { dg-additional-options "-O2" } */ + +#include "arm_mve.h" + +#ifdef __cplusplus +extern "C" { +#endif + +int32x4_t +foo (int32_t a, int32x4_t b) +{ + return vsetq_lane_s32 (a, b, 4); /* { dg-error {passing 4 to argument 3 of 'vsetq_lane_s32', which expects a value in the range \[0, 3\]} } */ +} + +#ifdef __cplusplus +} +#endif diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vsetq_lane_s64_bounds.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vsetq_lane_s64_bounds.c new file mode 100644 index 0000000..f3bf3ac --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vsetq_lane_s64_bounds.c @@ -0,0 +1,19 @@ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ +/* { dg-additional-options "-O2" } */ + +#include "arm_mve.h" + +#ifdef __cplusplus +extern "C" { +#endif + +int64x2_t +foo (int64_t a, int64x2_t b) +{ + return vsetq_lane_s64 (a, b, 2); /* { dg-error {passing 2 to argument 3 of 'vsetq_lane_s64', which expects a value in the range \[0, 1\]} } */ +} + +#ifdef __cplusplus +} +#endif diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vsetq_lane_s8_bounds.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vsetq_lane_s8_bounds.c new file mode 100644 index 0000000..0f4f238 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vsetq_lane_s8_bounds.c @@ -0,0 +1,19 @@ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ +/* { dg-additional-options "-O2" } */ + +#include "arm_mve.h" + +#ifdef __cplusplus +extern "C" { +#endif + +int8x16_t +foo (int8_t a, int8x16_t b) +{ + return vsetq_lane_s8 (a, b, 17); /* { dg-error {passing 17 to argument 3 of 'vsetq_lane_s8', which expects a value in the range \[0, 15\]} } */ +} + +#ifdef __cplusplus +} +#endif diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vsetq_lane_u16_bounds.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vsetq_lane_u16_bounds.c new file mode 100644 index 0000000..62a03c0 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vsetq_lane_u16_bounds.c @@ -0,0 +1,19 @@ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ +/* { dg-additional-options "-O2" } */ + +#include "arm_mve.h" + +#ifdef __cplusplus +extern "C" { +#endif + +uint16x8_t +foo (uint16_t a, uint16x8_t b) +{ + return vsetq_lane_u16 (a, b, 8); /* { dg-error {passing 8 to argument 3 of 'vsetq_lane_u16', which expects a value in the range \[0, 7\]} } */ +} + +#ifdef __cplusplus +} +#endif diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vsetq_lane_u32_bounds.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vsetq_lane_u32_bounds.c new file mode 100644 index 0000000..5836eeb --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vsetq_lane_u32_bounds.c @@ -0,0 +1,19 @@ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ +/* { dg-additional-options "-O2" } */ + +#include "arm_mve.h" + +#ifdef __cplusplus +extern "C" { +#endif + +uint32x4_t +foo (uint32_t a, uint32x4_t b) +{ + return vsetq_lane_u32 (a, b, 4); /* { dg-error {passing 4 to argument 3 of 'vsetq_lane_u32', which expects a value in the range \[0, 3\]} } */ +} + +#ifdef __cplusplus +} +#endif diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vsetq_lane_u64_bounds.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vsetq_lane_u64_bounds.c new file mode 100644 index 0000000..8be2b80 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vsetq_lane_u64_bounds.c @@ -0,0 +1,19 @@ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ +/* { dg-additional-options "-O2" } */ + +#include "arm_mve.h" + +#ifdef __cplusplus +extern "C" { +#endif + +uint64x2_t +foo (uint64_t a, uint64x2_t b) +{ + return vsetq_lane_u64 (a, b, 2); /* { dg-error {passing 2 to argument 3 of 'vsetq_lane_u64', which expects a value in the range \[0, 1\]} } */ +} + +#ifdef __cplusplus +} +#endif diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vsetq_lane_u8_bounds.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vsetq_lane_u8_bounds.c new file mode 100644 index 0000000..987dc98 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vsetq_lane_u8_bounds.c @@ -0,0 +1,19 @@ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ +/* { dg-additional-options "-O2" } */ + +#include "arm_mve.h" + +#ifdef __cplusplus +extern "C" { +#endif + +uint8x16_t +foo (uint8_t a, uint8x16_t b) +{ + return vsetq_lane_u8 (a, b, 17); /* { dg-error {passing 17 to argument 3 of 'vsetq_lane_u8', which expects a value in the range \[0, 15\]} } */ +} + +#ifdef __cplusplus +} +#endif diff --git a/gcc/testsuite/gcc.target/arm/mve/pr122858.c b/gcc/testsuite/gcc.target/arm/mve/pr122858.c new file mode 100644 index 0000000..3e6d29d --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/pr122858.c @@ -0,0 +1,83 @@ +/* { dg-do run } */ +/* { dg-require-effective-target arm_mve_hw } */ +/* { dg-options "-O2" } */ +/* { dg-add-options arm_v8_1m_mve } */ +/* { dg-final { check-function-bodies "**" "" "" } } */ + +extern void abort (void); + +/* +** ashrl_fn: +**... +** asrl r[0-9]+, r[0-9]+, #31 +**... +*/ +__attribute__ ((noipa)) +long long ashrl_fn (long long a) +{ + long long c; + + c = a >> 31; + c += a; + return c; +} + +/* +** ashll_fn: +**... +** add (r[0-9]+), \1, r[0-9]+, lsl #2 +**... +*/ +__attribute__ ((noipa)) +long long ashll_fn (long long a) +{ + long long c; + + /* Use 34, since 33 causes PR122871. */ + c = a << 34; + c += a; + return c; +} + +/* +** ashll_fn2: +**... +** lsll r[0-9]+, r[0-9]+, #7 +**... +*/ +__attribute__ ((noipa)) +long long ashll_fn2 (long long a /* unused */, long long x) +{ + return x << 7; +} + +/* +** ashll_fn3: +**... +** lsls r[0-9]+, (r[0-9]+), #2 +** movs \1, #0 +**... +*/ +__attribute__ ((noipa)) +long long ashll_fn3 (long long x) +{ + return x << 34; +} + +int main(void) +{ + long long var1 = 1; + long long var2 = ashll_fn (var1); + if (var2 != 0x400000001) + abort (); + + var2 = ashrl_fn (var2); + if (var2 != 0x400000009) + abort (); + + var2 = ashll_fn2 (var2, 0xa987654350000002LL); + if (var2 != 0xc3b2a1a800000100LL) + abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/arm/vrinta-ce.c b/gcc/testsuite/gcc.target/arm/vrinta-ce.c index 092d914..60da9ec 100644 --- a/gcc/testsuite/gcc.target/arm/vrinta-ce.c +++ b/gcc/testsuite/gcc.target/arm/vrinta-ce.c @@ -1,7 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "-mpure-code supports M-profile only" { *-*-* } { "-mpure-code" } } */ /* { dg-require-effective-target arm_v8_vfp_ok } */ -/* { dg-options "-O2 -marm -march=armv8-a" } */ +/* { dg-options "-O2 -marm" } */ /* { dg-add-options arm_v8_vfp } */ double foo (double a) diff --git a/gcc/testsuite/gcc.target/avr/torture/pr84211-fuse-move-1.c b/gcc/testsuite/gcc.target/avr/torture/pr84211-fuse-move-1.c index 82ce227..4924e9d 100644 --- a/gcc/testsuite/gcc.target/avr/torture/pr84211-fuse-move-1.c +++ b/gcc/testsuite/gcc.target/avr/torture/pr84211-fuse-move-1.c @@ -1,5 +1,6 @@ /* { dg-do run } */ -/* { dg-additional-options -std=gnu99 } */ +/* Disable LTO since it has problems with flobal asm. */ +/* { dg-additional-options { -std=gnu99 -fno-lto } } */ #define USE_VALUE 0 diff --git a/gcc/testsuite/gcc.target/avr/torture/pr92606.c b/gcc/testsuite/gcc.target/avr/torture/pr92606.c index a391d7e..99d1ca6 100644 --- a/gcc/testsuite/gcc.target/avr/torture/pr92606.c +++ b/gcc/testsuite/gcc.target/avr/torture/pr92606.c @@ -14,10 +14,10 @@ typedef uint32_t T; { \ uint16_t __addr16 = (uint16_t)(X); \ uint32_t __result; \ - __asm__ __volatile__ ("lpm %A0, Z+" "\n\t" \ - "lpm %B0, Z+" "\n\t" \ - "lpm %C0, Z+" "\n\t" \ - "lpm %D0, Z" "\n\t" \ + __asm__ __volatile__ ("lpm $ mov %A0,r0 $ adiw %1,1" "\n\t" \ + "lpm $ mov %B0,r0 $ adiw %1,1" "\n\t" \ + "lpm $ mov %C0,r0 $ adiw %1,1" "\n\t" \ + "lpm $ mov %D0,r0" \ : "=r" (__result), "+z" (__addr16)); \ __result; \ })) diff --git a/gcc/testsuite/gcc.target/i386/20040112-1.c b/gcc/testsuite/gcc.target/i386/20040112-1.c index 9dd0989..ab53292 100644 --- a/gcc/testsuite/gcc.target/i386/20040112-1.c +++ b/gcc/testsuite/gcc.target/i386/20040112-1.c @@ -1,6 +1,21 @@ /* { dg-do compile } */ -/* { dg-options "-O2" } */ -/* { dg-final { scan-assembler "testb" } } */ +/* { dg-options "-O2 -fomit-frame-pointer" } */ +/* { dg-additional-options "-mregparm=1" { target ia32 } } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target *-*-* } {^\t?\.} } } */ + +/* +**ftn: +**... +**.L[0-9]+: +** movb \$-24, \(%(e|r)(di|ax)\) +** cmpb \$0, \(%(e|r)(di|ax)\) +** jns .L[0-9]+ +** ret +** .cfi_endproc +**... +*/ + void ftn (char *sp) { diff --git a/gcc/testsuite/gcc.target/i386/amxbf16-asmintel-1.c b/gcc/testsuite/gcc.target/i386/amxbf16-asmintel-1.c index 54194e1..80d129e 100644 --- a/gcc/testsuite/gcc.target/i386/amxbf16-asmintel-1.c +++ b/gcc/testsuite/gcc.target/i386/amxbf16-asmintel-1.c @@ -1,7 +1,7 @@ /* { dg-do compile { target { ! ia32 } } } */ /* { dg-require-effective-target masm_intel } */ /* { dg-options "-O2 -mamx-bf16 -masm=intel" } */ -/* { dg-final { scan-assembler "tdpbf16ps\[ \\t]+\[^\n\]*%tmm1+\[^\n\]*%tmm2+\[^\n\]*%tmm3" } } */ +/* { dg-final { scan-assembler "tdpbf16ps\[ \\t]+\[^\n%\]*tmm1+\[^\n%\]*tmm2+\[^\n%\]*tmm3" } } */ #include <immintrin.h> void TEST () diff --git a/gcc/testsuite/gcc.target/i386/amxcomplex-asmintel-1.c b/gcc/testsuite/gcc.target/i386/amxcomplex-asmintel-1.c index 305465e..51997b7 100644 --- a/gcc/testsuite/gcc.target/i386/amxcomplex-asmintel-1.c +++ b/gcc/testsuite/gcc.target/i386/amxcomplex-asmintel-1.c @@ -1,8 +1,8 @@ /* { dg-do compile { target { ! ia32 } } } */ /* { dg-require-effective-target masm_intel } */ /* { dg-options "-O2 -mamx-complex -masm=intel" } */ -/* { dg-final { scan-assembler "tcmmimfp16ps\[ \\t]+\[^\n\]*%tmm1+\[^\n\]*%tmm2+\[^\n\]*%tmm3" } } */ -/* { dg-final { scan-assembler "tcmmrlfp16ps\[ \\t]+\[^\n\]*%tmm1+\[^\n\]*%tmm2+\[^\n\]*%tmm3" } } */ +/* { dg-final { scan-assembler "tcmmimfp16ps\[ \\t]+\[^\n%\]*tmm1+\[^\n%\]*tmm2+\[^\n%\]*tmm3" } } */ +/* { dg-final { scan-assembler "tcmmrlfp16ps\[ \\t]+\[^\n%\]*tmm1+\[^\n%\]*tmm2+\[^\n%\]*tmm3" } } */ #include <immintrin.h> void TEST() diff --git a/gcc/testsuite/gcc.target/i386/amxfp16-asmintel-1.c b/gcc/testsuite/gcc.target/i386/amxfp16-asmintel-1.c index a8dff94..8895da9 100644 --- a/gcc/testsuite/gcc.target/i386/amxfp16-asmintel-1.c +++ b/gcc/testsuite/gcc.target/i386/amxfp16-asmintel-1.c @@ -1,7 +1,7 @@ /* { dg-do compile { target { ! ia32 } } } */ /* { dg-require-effective-target masm_intel } */ /* { dg-options "-O2 -mamx-fp16 -masm=intel" } */ -/* { dg-final { scan-assembler "tdpfp16ps\[ \\t]+\[^\n\]*%tmm1+\[^\n\]*%tmm2+\[^\n\]*%tmm3" } } */ +/* { dg-final { scan-assembler "tdpfp16ps\[ \\t]+\[^\n%\]*tmm1+\[^\n%\]*tmm2+\[^\n%\]*tmm3" } } */ #include <immintrin.h> void TEST () diff --git a/gcc/testsuite/gcc.target/i386/amxfp8-asmintel-1.c b/gcc/testsuite/gcc.target/i386/amxfp8-asmintel-1.c index f83b7a9..eecd2f5 100644 --- a/gcc/testsuite/gcc.target/i386/amxfp8-asmintel-1.c +++ b/gcc/testsuite/gcc.target/i386/amxfp8-asmintel-1.c @@ -1,10 +1,10 @@ /* { dg-do compile { target { ! ia32 } } } */ /* { dg-require-effective-target masm_intel } */ /* { dg-options "-O2 -mamx-fp16 -masm=intel" } */ -/* { dg-final { scan-assembler "tdpbf8ps\[ \\t]+\[^\n\]*%tmm1+\[^\n\]*%tmm2+\[^\n\]*%tmm3" } } */ -/* { dg-final { scan-assembler "tdpbhf8ps\[ \\t]+\[^\n\]*%tmm1+\[^\n\]*%tmm2+\[^\n\]*%tmm3" } } */ -/* { dg-final { scan-assembler "tdphbf8ps\[ \\t]+\[^\n\]*%tmm1+\[^\n\]*%tmm2+\[^\n\]*%tmm3" } } */ -/* { dg-final { scan-assembler "tdphf8ps\[ \\t]+\[^\n\]*%tmm1+\[^\n\]*%tmm2+\[^\n\]*%tmm3" } } */ +/* { dg-final { scan-assembler "tdpbf8ps\[ \\t]+\[^\n%\]*tmm1+\[^\n%\]*tmm2+\[^\n%\]*tmm3" } } */ +/* { dg-final { scan-assembler "tdpbhf8ps\[ \\t]+\[^\n%\]*tmm1+\[^\n%\]*tmm2+\[^\n%\]*tmm3" } } */ +/* { dg-final { scan-assembler "tdphbf8ps\[ \\t]+\[^\n%\]*tmm1+\[^\n%\]*tmm2+\[^\n%\]*tmm3" } } */ +/* { dg-final { scan-assembler "tdphf8ps\[ \\t]+\[^\n%\]*tmm1+\[^\n%\]*tmm2+\[^\n%\]*tmm3" } } */ #include <immintrin.h> diff --git a/gcc/testsuite/gcc.target/i386/amxint8-asmintel-1.c b/gcc/testsuite/gcc.target/i386/amxint8-asmintel-1.c index abc9874..46c1fa0 100644 --- a/gcc/testsuite/gcc.target/i386/amxint8-asmintel-1.c +++ b/gcc/testsuite/gcc.target/i386/amxint8-asmintel-1.c @@ -1,10 +1,10 @@ /* { dg-do compile { target { ! ia32 } } } */ /* { dg-require-effective-target masm_intel } */ /* { dg-options "-O2 -mamx-int8 -masm=intel" } */ -/* { dg-final { scan-assembler "tdpbssd\[ \\t]+\[^\n\]*%tmm1+\[^\n\]*%tmm2+\[^\n\]*%tmm3" } } */ -/* { dg-final { scan-assembler "tdpbsud\[ \\t]+\[^\n\]*%tmm1+\[^\n\]*%tmm2+\[^\n\]*%tmm3" } } */ -/* { dg-final { scan-assembler "tdpbusd\[ \\t]+\[^\n\]*%tmm1+\[^\n\]*%tmm2+\[^\n\]*%tmm3" } } */ -/* { dg-final { scan-assembler "tdpbuud\[ \\t]+\[^\n\]*%tmm1+\[^\n\]*%tmm2+\[^\n\]*%tmm3" } } */ +/* { dg-final { scan-assembler "tdpbssd\[ \\t]+\[^\n%\]*tmm1+\[^\n%\]*tmm2+\[^\n%\]*tmm3" } } */ +/* { dg-final { scan-assembler "tdpbsud\[ \\t]+\[^\n%\]*tmm1+\[^\n%\]*tmm2+\[^\n%\]*tmm3" } } */ +/* { dg-final { scan-assembler "tdpbusd\[ \\t]+\[^\n%\]*tmm1+\[^\n%\]*tmm2+\[^\n%\]*tmm3" } } */ +/* { dg-final { scan-assembler "tdpbuud\[ \\t]+\[^\n%\]*tmm1+\[^\n%\]*tmm2+\[^\n%\]*tmm3" } } */ #include <immintrin.h> void TEST () diff --git a/gcc/testsuite/gcc.target/i386/amxmovrs-asmintel-1.c b/gcc/testsuite/gcc.target/i386/amxmovrs-asmintel-1.c index 6a522b5..bb7a360 100644 --- a/gcc/testsuite/gcc.target/i386/amxmovrs-asmintel-1.c +++ b/gcc/testsuite/gcc.target/i386/amxmovrs-asmintel-1.c @@ -1,8 +1,8 @@ /* { dg-do compile { target { ! ia32 } } } */ /* { dg-require-effective-target masm_intel } */ /* { dg-options "-O2 -mamx-movrs -masm=intel" } */ -/* { dg-final { scan-assembler-times "tileloaddrs\[ \\t]%tmm\[0-9\]" 1 } } */ -/* { dg-final { scan-assembler-times "tileloaddrst1\[ \\t]%tmm\[0-9\]" 1 } } */ +/* { dg-final { scan-assembler-times "tileloaddrs\[ \\t]tmm\[0-9\]" 1 } } */ +/* { dg-final { scan-assembler-times "tileloaddrst1\[ \\t]tmm\[0-9\]" 1 } } */ #include <immintrin.h> extern const void* base; diff --git a/gcc/testsuite/gcc.target/i386/amxtf32-asmintel-1.c b/gcc/testsuite/gcc.target/i386/amxtf32-asmintel-1.c index 0188788..03ae307 100644 --- a/gcc/testsuite/gcc.target/i386/amxtf32-asmintel-1.c +++ b/gcc/testsuite/gcc.target/i386/amxtf32-asmintel-1.c @@ -1,7 +1,7 @@ /* { dg-do compile { target { ! ia32 } } } */ /* { dg-require-effective-target masm_intel } */ /* { dg-options "-O2 -mamx-tf32 -masm=intel" } */ -/* { dg-final { scan-assembler "tmmultf32ps\[ \\t]+\[^\n\]*%tmm1+\[^\n\]*%tmm2+\[^\n\]*%tmm3" } } */ +/* { dg-final { scan-assembler "tmmultf32ps\[ \\t]+\[^\n%\]*tmm1+\[^\n%\]*tmm2+\[^\n%\]*tmm3" } } */ #include <immintrin.h> void TEST() diff --git a/gcc/testsuite/gcc.target/i386/amxtile-asmintel-1.c b/gcc/testsuite/gcc.target/i386/amxtile-asmintel-1.c index 6c08fec..661645d 100644 --- a/gcc/testsuite/gcc.target/i386/amxtile-asmintel-1.c +++ b/gcc/testsuite/gcc.target/i386/amxtile-asmintel-1.c @@ -4,10 +4,10 @@ /* { dg-final { scan-assembler "ldtilecfg\[ \\t]" } } */ /* { dg-final { scan-assembler "sttilecfg\[ \\t]" } } */ /* { dg-final { scan-assembler "tilerelease" } } */ -/* { dg-final { scan-assembler "tileloadd\[ \\t]%tmm\[0-9\]" } } */ -/* { dg-final { scan-assembler "tileloaddt1\[ \\t]%tmm\[0-9\]" } } */ -/* { dg-final { scan-assembler "tilestored\[ \\t]\[^\n\]+\[^\n\]*%tmm\[0-9\]" } } */ -/* { dg-final { scan-assembler "tilezero\[ \\t]+\[^\n\]*%tmm\[0-9\]" } } */ +/* { dg-final { scan-assembler "tileloadd\[ \\t]tmm\[0-9\]" } } */ +/* { dg-final { scan-assembler "tileloaddt1\[ \\t]tmm\[0-9\]" } } */ +/* { dg-final { scan-assembler "tilestored\[ \\t]\[^\n\]+\[^\n\]*tmm\[0-9\]" } } */ +/* { dg-final { scan-assembler "tilezero\[ \\t]+\[^\n%\]*tmm\[0-9\]" } } */ #include <immintrin.h> extern int a[]; diff --git a/gcc/testsuite/gcc.target/i386/apx-ndd-tls-1b.c b/gcc/testsuite/gcc.target/i386/apx-ndd-tls-1b.c index afcad0c..a17eba4 100644 --- a/gcc/testsuite/gcc.target/i386/apx-ndd-tls-1b.c +++ b/gcc/testsuite/gcc.target/i386/apx-ndd-tls-1b.c @@ -9,4 +9,4 @@ usage(r14-6242-gd564198f960a2f). */ #include "apx-ndd-tls-1a.c" -/* { dg-final { scan-assembler-times "addq\[ \t]+%r\[a-z0-9\]+, a@gottpoff\\(%rip\\), %r\[a-z0-9\]+" 1 { xfail lp64 } } } */ +/* { dg-final { scan-assembler-times "addq\[ \t]+%r\[a-z0-9\]+, a@gottpoff\\(%rip\\), %r\[a-z0-9\]+" 1 { xfail { ! ia32 } } } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx-ne-convert-1.c b/gcc/testsuite/gcc.target/i386/avx-ne-convert-1.c index 27188a6..d6b0e09 100644 --- a/gcc/testsuite/gcc.target/i386/avx-ne-convert-1.c +++ b/gcc/testsuite/gcc.target/i386/avx-ne-convert-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavxneconvert -O2" } */ +/* { dg-options "-mavxneconvert -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vbcstnebf162ps\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vbcstnebf162ps\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vbcstnesh2ps\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-bf16-1.c b/gcc/testsuite/gcc.target/i386/avx10_2-bf16-1.c index f5a29bf..1d390a1 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-bf16-1.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-bf16-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-march=x86-64-v3 -mavx10.2 -O2" } */ +/* { dg-options "-march=x86-64-v3 -mavx10.2 -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vaddbf16\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vaddbf16\[ \\t\]+%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vaddbf16\[ \\t\]+%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-convert-1.c b/gcc/testsuite/gcc.target/i386/avx10_2-convert-1.c index c5a2d6f..2ba7a51 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-convert-1.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-convert-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-march=x86-64-v3 -mavx10.2 -O2" } */ +/* { dg-options "-march=x86-64-v3 -mavx10.2 -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvt2ps2phx\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvt2ps2phx\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvt2ps2phx\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-satcvt-1.c b/gcc/testsuite/gcc.target/i386/avx10_2-satcvt-1.c index 7b1c247..9f3acb0 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-satcvt-1.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-satcvt-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ +/* { dg-options "-O2 -fno-fuse-ops-with-volatile-access -march=x86-64-v3 -mavx10.2" } */ /* { dg-final { scan-assembler-times "vcvtph2ibs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vcvtph2ibs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtph2ibs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx2-vpcmpgtq-1.c b/gcc/testsuite/gcc.target/i386/avx2-vpcmpgtq-1.c index 7a98380..5e6f431 100644 --- a/gcc/testsuite/gcc.target/i386/avx2-vpcmpgtq-1.c +++ b/gcc/testsuite/gcc.target/i386/avx2-vpcmpgtq-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx2 -O2" } */ +/* { dg-options "-mavx2 -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler "vpcmpgtq\[ \\t\]+\[^\n\]*%ymm\[0-9\]" } } */ #include <immintrin.h> diff --git a/gcc/testsuite/gcc.target/i386/avx512bf16-vcvtneps2bf16-1.c b/gcc/testsuite/gcc.target/i386/avx512bf16-vcvtneps2bf16-1.c index 99ba4ee..44ea7c6 100644 --- a/gcc/testsuite/gcc.target/i386/avx512bf16-vcvtneps2bf16-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512bf16-vcvtneps2bf16-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512bf16 -O2" } */ +/* { dg-options "-mavx512bf16 -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvtneps2bf16\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtneps2bf16\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vcvtneps2bf16\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512bf16vl-vcvtneps2bf16-1a.c b/gcc/testsuite/gcc.target/i386/avx512bf16vl-vcvtneps2bf16-1a.c index d3a9bdf..70ec9ea 100644 --- a/gcc/testsuite/gcc.target/i386/avx512bf16vl-vcvtneps2bf16-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512bf16vl-vcvtneps2bf16-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512bf16 -mavx512vl -O2" } */ +/* { dg-options "-mavx512bf16 -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvtneps2bf16y\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtneps2bf16y\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtneps2bf16y\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512bf16vl-vcvtneps2bf16-1b.c b/gcc/testsuite/gcc.target/i386/avx512bf16vl-vcvtneps2bf16-1b.c index e0687fa..f418f3a3b 100644 --- a/gcc/testsuite/gcc.target/i386/avx512bf16vl-vcvtneps2bf16-1b.c +++ b/gcc/testsuite/gcc.target/i386/avx512bf16vl-vcvtneps2bf16-1b.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512bf16 -mavx512vl -mavxneconvert -O2" } */ +/* { dg-options "-mavx512bf16 -mavx512vl -mavxneconvert -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "\{vex\} vcvtneps2bf16y\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtneps2bf16y\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtneps2bf16y\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512bitalg-vpshufbitqmb.c b/gcc/testsuite/gcc.target/i386/avx512bitalg-vpshufbitqmb.c index 75fbef8..fa901d3 100644 --- a/gcc/testsuite/gcc.target/i386/avx512bitalg-vpshufbitqmb.c +++ b/gcc/testsuite/gcc.target/i386/avx512bitalg-vpshufbitqmb.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512bitalg -mavx512vl -O2" } */ +/* { dg-options "-mavx512bitalg -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vpshufbitqmb\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%k\[0-7\]\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpshufbitqmb\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%k\[0-7\]\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpshufbitqmb\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%k\[0-7\]\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512bw-vpcmpb-1.c b/gcc/testsuite/gcc.target/i386/avx512bw-vpcmpb-1.c index e84d766..edc3210 100644 --- a/gcc/testsuite/gcc.target/i386/avx512bw-vpcmpb-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512bw-vpcmpb-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mavx512bw -mavx512vl" } */ +/* { dg-options "-O2 -fno-fuse-ops-with-volatile-access -mavx512bw -mavx512vl" } */ /* { dg-final { scan-assembler-times "vpcmpb\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpcmpb\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpcmpb\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512bw-vpcmpub-1.c b/gcc/testsuite/gcc.target/i386/avx512bw-vpcmpub-1.c index 6d8a442..eacce0e 100644 --- a/gcc/testsuite/gcc.target/i386/avx512bw-vpcmpub-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512bw-vpcmpub-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mavx512bw -mavx512vl" } */ +/* { dg-options "-O2 -fno-fuse-ops-with-volatile-access -mavx512bw -mavx512vl" } */ /* { dg-final { scan-assembler-times "(?:vpcmpub|vpcmpeqb)\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpcmpub\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpcmpub\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512bw-vpcmpuw-1.c b/gcc/testsuite/gcc.target/i386/avx512bw-vpcmpuw-1.c index c0d84de..ef876e5 100644 --- a/gcc/testsuite/gcc.target/i386/avx512bw-vpcmpuw-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512bw-vpcmpuw-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mavx512bw -mavx512vl" } */ +/* { dg-options "-O2 -fno-fuse-ops-with-volatile-access -mavx512bw -mavx512vl" } */ /* { dg-final { scan-assembler-times "vpcmpuw\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpcmpuw\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpcmpuw\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512bw-vpcmpw-1.c b/gcc/testsuite/gcc.target/i386/avx512bw-vpcmpw-1.c index 111ce81..eec6103 100644 --- a/gcc/testsuite/gcc.target/i386/avx512bw-vpcmpw-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512bw-vpcmpw-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mavx512bw -mavx512vl" } */ +/* { dg-options "-O2 -fno-fuse-ops-with-volatile-access -mavx512bw -mavx512vl" } */ /* { dg-final { scan-assembler-times "vpcmpw\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpcmpw\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpcmpw\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512dq-vcvtps2qq-1.c b/gcc/testsuite/gcc.target/i386/avx512dq-vcvtps2qq-1.c index b6ed96f..5bccf40 100644 --- a/gcc/testsuite/gcc.target/i386/avx512dq-vcvtps2qq-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512dq-vcvtps2qq-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512dq -mavx512vl -O2" } */ +/* { dg-options "-mavx512dq -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvtps2qq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtps2qq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtps2qq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512dq-vcvtps2uqq-1.c b/gcc/testsuite/gcc.target/i386/avx512dq-vcvtps2uqq-1.c index 33090a5..3fbd23d 100644 --- a/gcc/testsuite/gcc.target/i386/avx512dq-vcvtps2uqq-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512dq-vcvtps2uqq-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512dq -mavx512vl -O2" } */ +/* { dg-options "-mavx512dq -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvtps2uqq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtps2uqq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtps2uqq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512dq-vcvtqq2pd-1.c b/gcc/testsuite/gcc.target/i386/avx512dq-vcvtqq2pd-1.c index 1d51abd..95afa3e 100644 --- a/gcc/testsuite/gcc.target/i386/avx512dq-vcvtqq2pd-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512dq-vcvtqq2pd-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512dq -mavx512vl -O2" } */ +/* { dg-options "-mavx512dq -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvtqq2pd\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtqq2pd\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtqq2pd\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512dq-vcvtqq2ps-1.c b/gcc/testsuite/gcc.target/i386/avx512dq-vcvtqq2ps-1.c index d5d7bbc..1147ccc 100644 --- a/gcc/testsuite/gcc.target/i386/avx512dq-vcvtqq2ps-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512dq-vcvtqq2ps-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512dq -mavx512vl -O2" } */ +/* { dg-options "-mavx512dq -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvtqq2psx\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtqq2psx\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtqq2psx\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512dq-vcvttps2qq-1.c b/gcc/testsuite/gcc.target/i386/avx512dq-vcvttps2qq-1.c index e99bb3b..065b406 100644 --- a/gcc/testsuite/gcc.target/i386/avx512dq-vcvttps2qq-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512dq-vcvttps2qq-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512dq -mavx512vl -O2" } */ +/* { dg-options "-mavx512dq -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvttps2qq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttps2qq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttps2qq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512dq-vcvttps2uqq-1.c b/gcc/testsuite/gcc.target/i386/avx512dq-vcvttps2uqq-1.c index 9b34e43..1078b20 100644 --- a/gcc/testsuite/gcc.target/i386/avx512dq-vcvttps2uqq-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512dq-vcvttps2uqq-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512dq -mavx512vl -O2" } */ +/* { dg-options "-mavx512dq -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvttps2uqq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttps2uqq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttps2uqq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512dq-vcvtuqq2pd-1.c b/gcc/testsuite/gcc.target/i386/avx512dq-vcvtuqq2pd-1.c index 11b8910..963f206 100644 --- a/gcc/testsuite/gcc.target/i386/avx512dq-vcvtuqq2pd-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512dq-vcvtuqq2pd-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512dq -mavx512vl -O2" } */ +/* { dg-options "-mavx512dq -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvtuqq2pd\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtuqq2pd\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtuqq2pd\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512dq-vcvtuqq2ps-1.c b/gcc/testsuite/gcc.target/i386/avx512dq-vcvtuqq2ps-1.c index 0ae94c6..c70e6de 100644 --- a/gcc/testsuite/gcc.target/i386/avx512dq-vcvtuqq2ps-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512dq-vcvtuqq2ps-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512dq -mavx512vl -O2" } */ +/* { dg-options "-mavx512dq -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvtuqq2psx\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtuqq2psx\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtuqq2psx\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512dq-vextractf32x8-1.c b/gcc/testsuite/gcc.target/i386/avx512dq-vextractf32x8-1.c index b1e61b6..6649ea5 100644 --- a/gcc/testsuite/gcc.target/i386/avx512dq-vextractf32x8-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512dq-vextractf32x8-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512dq -O2" } */ +/* { dg-options "-mavx512dq -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vextractf32x8\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vextractf32x8\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vextractf32x8\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512dq-vextractf64x2-1.c b/gcc/testsuite/gcc.target/i386/avx512dq-vextractf64x2-1.c index c8cce51..5a4fb1f 100644 --- a/gcc/testsuite/gcc.target/i386/avx512dq-vextractf64x2-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512dq-vextractf64x2-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512dq -mavx512vl -O2" } */ +/* { dg-options "-mavx512dq -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vextractf64x2\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+.{7}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vextractf64x2\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+.{7}\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vextractf64x2\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+.{7}\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512dq-vextracti64x2-1.c b/gcc/testsuite/gcc.target/i386/avx512dq-vextracti64x2-1.c index d49b0c0..3347e02 100644 --- a/gcc/testsuite/gcc.target/i386/avx512dq-vextracti64x2-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512dq-vextracti64x2-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512dq -mavx512vl -O2" } */ +/* { dg-options "-mavx512dq -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vextracti64x2\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+.{7}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vextracti64x2\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+.{7}\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vextracti64x2\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+.{7}\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512dq-vfpclasspd-1.c b/gcc/testsuite/gcc.target/i386/avx512dq-vfpclasspd-1.c index 932f103..3a0dac1 100644 --- a/gcc/testsuite/gcc.target/i386/avx512dq-vfpclasspd-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512dq-vfpclasspd-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512dq -mavx512vl -O2" } */ +/* { dg-options "-mavx512dq -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vfpclasspdz\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vfpclasspdy\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vfpclasspdx\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512dq-vfpclassps-1.c b/gcc/testsuite/gcc.target/i386/avx512dq-vfpclassps-1.c index f826e89..fe7394a 100644 --- a/gcc/testsuite/gcc.target/i386/avx512dq-vfpclassps-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512dq-vfpclassps-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512dq -mavx512vl -O2" } */ +/* { dg-options "-mavx512dq -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vfpclasspsz\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vfpclasspsy\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vfpclasspsx\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512dq-vfpclasssd-1.c b/gcc/testsuite/gcc.target/i386/avx512dq-vfpclasssd-1.c index fb5c1d5..790c2d0 100644 --- a/gcc/testsuite/gcc.target/i386/avx512dq-vfpclasssd-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512dq-vfpclasssd-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512dq -O2" } */ +/* { dg-options "-mavx512dq -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vfpclasssd\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vfpclasssd\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[0-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512dq-vfpclassss-1.c b/gcc/testsuite/gcc.target/i386/avx512dq-vfpclassss-1.c index 4822441..e7102de 100644 --- a/gcc/testsuite/gcc.target/i386/avx512dq-vfpclassss-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512dq-vfpclassss-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512dq -O2" } */ +/* { dg-options "-mavx512dq -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vfpclassss\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vfpclassss\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[0-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512dq-vpmullq-1.c b/gcc/testsuite/gcc.target/i386/avx512dq-vpmullq-1.c index ad0de26..fded979 100644 --- a/gcc/testsuite/gcc.target/i386/avx512dq-vpmullq-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512dq-vpmullq-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512dq -mavx512vl -O2" } */ +/* { dg-options "-mavx512dq -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vpmullq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpmullq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpmullq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512dq-vpmullq-3.c b/gcc/testsuite/gcc.target/i386/avx512dq-vpmullq-3.c index 920087b..6ce106b 100644 --- a/gcc/testsuite/gcc.target/i386/avx512dq-vpmullq-3.c +++ b/gcc/testsuite/gcc.target/i386/avx512dq-vpmullq-3.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512dq -O2" } */ +/* { dg-options "-mavx512dq -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vpmullq\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpmullq\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-pr100267-1.c b/gcc/testsuite/gcc.target/i386/avx512f-pr100267-1.c index 5eb6de5..40dd207 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-pr100267-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-pr100267-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512f -O2" } */ +/* { dg-options "-mavx512f -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vpexpandd\[ \\t\]+\[^\{\n\]*\\(\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpexpandd\[ \\t\]+\[^\{\n\(]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpexpandq\[ \\t\]+\[^\{\n\]*\\(\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vcmppd-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vcmppd-1.c index 8125165..b13627f 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vcmppd-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vcmppd-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mavx512f" } */ +/* { dg-options "-O2 -fno-fuse-ops-with-volatile-access -mavx512f" } */ /* { dg-final { scan-assembler-times "vcmppd\[ \\t\]+\[^\{\n\]*\[^\}\]%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 9 } } */ /* { dg-final { scan-assembler-times "vcmppd\[ \\t\]+\[^\{\n\]*\[^\}\]%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 9 } } */ /* { dg-final { scan-assembler-times "vcmppd\[ \\t\]+\[^\{\n\]*\{sae\}\[^\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vcmpps-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vcmpps-1.c index cd3d5c7..2996507 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vcmpps-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vcmpps-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mavx512f" } */ +/* { dg-options "-O2 -fno-fuse-ops-with-volatile-access -mavx512f" } */ /* { dg-final { scan-assembler-times "vcmpps\[ \\t\]+\[^\{\n\]*\[^\}\]%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 9 } } */ /* { dg-final { scan-assembler-times "vcmpps\[ \\t\]+\[^\{\n\]*\[^\}\]%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 9 } } */ /* { dg-final { scan-assembler-times "vcmpps\[ \\t\]+\[^\{\n\]*\{sae\}\[^\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vcvtps2pd-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vcvtps2pd-1.c index 05c1bc2..eb51f56 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vcvtps2pd-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vcvtps2pd-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512f -O2" } */ +/* { dg-options "-mavx512f -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvtps2pd\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtps2pd\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtps2pd\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vcvtsd2si-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vcvtsd2si-1.c index 402af50..17a0fa1 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vcvtsd2si-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vcvtsd2si-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mavx512f" } */ +/* { dg-options "-O2 -fno-fuse-ops-with-volatile-access -mavx512f" } */ /* { dg-final { scan-assembler-times "vcvtsd2sil?\[ \\t\]+\[^\n\]*\{rn-sae\}\[^\n\]*%xmm\[0-9\]+.{6}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtsd2sil?\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+.{6}(?:\n|\[ \\t\]+#)" 1 } } */ #include <immintrin.h> diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vcvtsd2si64-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vcvtsd2si64-1.c index dad26e4..20ebdae 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vcvtsd2si64-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vcvtsd2si64-1.c @@ -1,5 +1,5 @@ /* { dg-do compile { target { ! ia32 } } } */ -/* { dg-options "-O2 -mavx512f" } */ +/* { dg-options "-O2 -fno-fuse-ops-with-volatile-access -mavx512f" } */ /* { dg-final { scan-assembler-times "vcvtsd2siq\[ \\t\]+\[^\n\]*\{rz-sae\}\[^\{\n\]*%xmm\[0-9\]+.{6}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtsd2siq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+.{6}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vcvtsd2usi-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vcvtsd2usi-1.c index 5b2572f..383e09d 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vcvtsd2usi-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vcvtsd2usi-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mavx512f" } */ +/* { dg-options "-O2 -fno-fuse-ops-with-volatile-access -mavx512f" } */ /* { dg-final { scan-assembler-times "vcvtsd2usi\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+.{6}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtsd2usi\[ \\t\]+\[^\n\]*\{rd-sae\}\[^\{\n\]*%xmm\[0-9\]+.{6}(?:\n|\[ \\t\]+#)" 1 } } */ #include <immintrin.h> diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vcvtsd2usi64-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vcvtsd2usi64-1.c index a0c503d..36032cc 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vcvtsd2usi64-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vcvtsd2usi64-1.c @@ -1,5 +1,5 @@ /* { dg-do compile { target { ! ia32 } } } */ -/* { dg-options "-O2 -mavx512f" } */ +/* { dg-options "-O2 -fno-fuse-ops-with-volatile-access -mavx512f" } */ /* { dg-final { scan-assembler-times "vcvtsd2usi\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+.{6}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtsd2usi\[ \\t\]+\[^\n\]*\{ru-sae\}\[^\{\n\]*%xmm\[0-9\]+.{6}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vcvtsi2ss-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vcvtsi2ss-1.c index 0b3f518..8d83df3 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vcvtsi2ss-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vcvtsi2ss-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512f -O2" } */ +/* { dg-options "-mavx512f -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvtsi2ssl\[ \\t\]+\[^%\n\]*%e\[^\{\n\]*\{rn-sae\}\[^\{\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtsi2ssl\[ \\t\]+\[^%\n\]*%e\[^\{\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vcvtss2si-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vcvtss2si-1.c index e3f4223..158eb59 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vcvtss2si-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vcvtss2si-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mavx512f" } */ +/* { dg-options "-O2 -fno-fuse-ops-with-volatile-access -mavx512f" } */ /* { dg-final { scan-assembler-times "vcvtss2sil?\[ \\t\]+\[^\n\]*\{rn-sae\}\[^\{\n\]*%xmm\[0-9\]+.{6}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtss2sil?\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+.{6}(?:\n|\[ \\t\]+#)" 1 } } */ #include <immintrin.h> diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vcvtss2si64-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vcvtss2si64-1.c index 86ef95a..3ba17fd 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vcvtss2si64-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vcvtss2si64-1.c @@ -1,5 +1,5 @@ /* { dg-do compile { target { ! ia32 } } } */ -/* { dg-options "-O2 -mavx512f" } */ +/* { dg-options "-O2 -fno-fuse-ops-with-volatile-access -mavx512f" } */ /* { dg-final { scan-assembler-times "vcvtss2siq\[ \\t\]+\[^\n\]*\{rz-sae\}\[^\{\n\]*%xmm\[0-9\]+.{6}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtss2siq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+.{6}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vcvtss2usi-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vcvtss2usi-1.c index e17a191..807e14d 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vcvtss2usi-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vcvtss2usi-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mavx512f" } */ +/* { dg-options "-O2 -fno-fuse-ops-with-volatile-access -mavx512f" } */ /* { dg-final { scan-assembler-times "vcvtss2usi\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+.{6}(?:\n|\[ \\t\]+#)" 1 } }*/ /* { dg-final { scan-assembler-times "vcvtss2usi\[ \\t\]+\[^\n\]*\{rd-sae\}\[^\{\n\]*%xmm\[0-9\]+.{6}(?:\n|\[ \\t\]+#)" 1 } } */ #include <immintrin.h> diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vcvtss2usi64-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vcvtss2usi64-1.c index a55e411..195e904 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vcvtss2usi64-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vcvtss2usi64-1.c @@ -1,5 +1,5 @@ /* { dg-do compile { target { ! ia32 } } } */ -/* { dg-options "-O2 -mavx512f" } */ +/* { dg-options "-O2 -fno-fuse-ops-with-volatile-access -mavx512f" } */ /* { dg-final { scan-assembler-times "vcvtss2usi\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+.{6}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtss2usi\[ \\t\]+\[^\n\]*\{ru-sae\}\[^\{\n\]*%xmm\[0-9\]+.{6}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vcvttsd2si-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vcvttsd2si-1.c index e7f23aa..6b19e8c 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vcvttsd2si-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vcvttsd2si-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mavx512f" } */ +/* { dg-options "-O2 -fno-fuse-ops-with-volatile-access -mavx512f" } */ /* { dg-final { scan-assembler-times "vcvttsd2sil?\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+.{6}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttsd2sil?\[ \\t\]+\[^\{\n\]*\{sae\}\[^\n\]*%xmm\[0-9\]+.{6}(?:\n|\[ \\t\]+#)" 1 } } */ #include <immintrin.h> diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vcvttsd2si64-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vcvttsd2si64-1.c index dd06e38..d6c937f 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vcvttsd2si64-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vcvttsd2si64-1.c @@ -1,5 +1,5 @@ /* { dg-do compile { target { ! ia32 } } } */ -/* { dg-options "-O2 -mavx512f" } */ +/* { dg-options "-O2 -fno-fuse-ops-with-volatile-access -mavx512f" } */ /* { dg-final { scan-assembler-times "vcvttsd2siq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+.{6}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttsd2siq\[ \\t\]+\[^\{\n\]*\{sae\}\[^\n\]*%xmm\[0-9\]+.{6}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vcvttsd2usi-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vcvttsd2usi-1.c index 474acca..a4eab02 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vcvttsd2usi-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vcvttsd2usi-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mavx512f" } */ +/* { dg-options "-O2 -fno-fuse-ops-with-volatile-access -mavx512f" } */ /* { dg-final { scan-assembler-times "vcvttsd2usi\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+.{6}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttsd2usi\[ \\t\]+\[^\{\n\]*\{sae\}\[^\n\]*%xmm\[0-9\]+.{6}(?:\n|\[ \\t\]+#)" 1 } } */ #include <immintrin.h> diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vcvttsd2usi64-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vcvttsd2usi64-1.c index 5f68508..8a5bf34 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vcvttsd2usi64-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vcvttsd2usi64-1.c @@ -1,5 +1,5 @@ /* { dg-do compile { target { ! ia32 } } } */ -/* { dg-options "-O2 -mavx512f" } */ +/* { dg-options "-O2 -fno-fuse-ops-with-volatile-access -mavx512f" } */ /* { dg-final { scan-assembler-times "vcvttsd2usi\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+.{6}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttsd2usi\[ \\t\]+\[^\{\n\]*\{sae\}\[^\n\]*%xmm\[0-9\]+.{6}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vcvttss2si-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vcvttss2si-1.c index 8598482..be9de9b 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vcvttss2si-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vcvttss2si-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mavx512f" } */ +/* { dg-options "-O2 -fno-fuse-ops-with-volatile-access -mavx512f" } */ /* { dg-final { scan-assembler-times "vcvttss2sil?\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+.{6}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttss2sil?\[ \\t\]+\[^\{\n\]*\{sae\}\[^\n\]*%xmm\[0-9\]+.{6}(?:\n|\[ \\t\]+#)" 1 } } */ #include <immintrin.h> diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vcvttss2si64-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vcvttss2si64-1.c index 85d5837b..03184f2 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vcvttss2si64-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vcvttss2si64-1.c @@ -1,5 +1,5 @@ /* { dg-do compile { target { ! ia32 } } } */ -/* { dg-options "-O2 -mavx512f" } */ +/* { dg-options "-O2 -fno-fuse-ops-with-volatile-access -mavx512f" } */ /* { dg-final { scan-assembler-times "vcvttss2siq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+.{6}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttss2siq\[ \\t\]+\[^\{\n\]*\{sae\}\[^\n\]*%xmm\[0-9\]+.{6}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vcvttss2usi-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vcvttss2usi-1.c index a45b3ee..11a9071 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vcvttss2usi-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vcvttss2usi-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mavx512f" } */ +/* { dg-options "-O2 -fno-fuse-ops-with-volatile-access -mavx512f" } */ /* { dg-final { scan-assembler-times "vcvttss2usi\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+.{6}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttss2usi\[ \\t\]+\[^\{\n\]*\{sae\}\[^\n\]*%xmm\[0-9\]+.{6}(?:\n|\[ \\t\]+#)" 1 } } */ #include <immintrin.h> diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vcvttss2usi64-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vcvttss2usi64-1.c index b8c3980..dc08170 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vcvttss2usi64-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vcvttss2usi64-1.c @@ -1,5 +1,5 @@ /* { dg-do compile { target { ! ia32 } } } */ -/* { dg-options "-O2 -mavx512f" } */ +/* { dg-options "-O2 -fno-fuse-ops-with-volatile-access -mavx512f" } */ /* { dg-final { scan-assembler-times "vcvttss2usi\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+.{6}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttss2usi\[ \\t\]+\[^\{\n\]*\{sae\}\[^\n\]*%xmm\[0-9\]+.{6}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vextractf32x4-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vextractf32x4-1.c index 86b5ee7..617de84 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vextractf32x4-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vextractf32x4-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512f -O2" } */ +/* { dg-options "-mavx512f -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vextractf32x4\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vextractf32x4\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vextractf32x4\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vextractf64x4-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vextractf64x4-1.c index 125b029..ce5cfe3 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vextractf64x4-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vextractf64x4-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512f -O2" } */ +/* { dg-options "-mavx512f -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vextractf64x4\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vextractf64x4\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vextractf64x4\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vextracti64x4-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vextracti64x4-1.c index fceffac..83346476 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vextracti64x4-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vextracti64x4-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512f -O2" } */ +/* { dg-options "-mavx512f -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vextracti64x4\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vextracti64x4\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vextracti64x4\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vmovapd-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vmovapd-1.c index e869f70..17bb022 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vmovapd-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vmovapd-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512f -O2" } */ +/* { dg-options "-mavx512f -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vmovapd\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vmovapd\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vmovapd\[ \\t\]+\[^\{\n\]*\\)\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vmovaps-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vmovaps-1.c index a7635a3..d563839 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vmovaps-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vmovaps-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512f -O2" } */ +/* { dg-options "-mavx512f -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vmovaps\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vmovaps\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vmovaps\[ \\t\]+\[^\{\n\]*\\)\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vmovdqa64-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vmovdqa64-1.c index 1c372c4..fb44558 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vmovdqa64-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vmovdqa64-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512f -O2" } */ +/* { dg-options "-mavx512f -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vmovdqa64\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vmovdqa64\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vmovdqa64\[ \\t\]+\[^\{\n\]*\\)\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vpandnq-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vpandnq-1.c index 83aaca8..e451988 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vpandnq-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vpandnq-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512f -O2" } */ +/* { dg-options "-mavx512f -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vpandnq\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpandnq\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpandnq\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vpbroadcastd-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vpbroadcastd-1.c index bd111b0..7618605 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vpbroadcastd-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vpbroadcastd-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512f -O2" } */ +/* { dg-options "-mavx512f -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vpbroadcastd\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vpbroadcastd\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vpbroadcastd\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 2 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vpbroadcastq-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vpbroadcastq-1.c index 5da582c..1cbaeb5 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vpbroadcastq-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vpbroadcastq-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512f -O2" } */ +/* { dg-options "-mavx512f -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vpbroadcastq\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vpbroadcastq\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vpbroadcastq\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 2 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpd-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpd-1.c index 77276c1..55376e3 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpd-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpd-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mavx512f" } */ +/* { dg-options "-O2 -fno-fuse-ops-with-volatile-access -mavx512f" } */ /* { dg-final { scan-assembler-times "vpcmpd\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpcmpd\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpeqq-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpeqq-1.c index 595ba55..a560dbd 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpeqq-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpeqq-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512f -O2" } */ +/* { dg-options "-mavx512f -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "(?:vpcmpeqq\[ \\t\]+|vpcmpq\[ \\t\]+\\\$0)\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "(?:vpcmpeqq\[ \\t\]+|vpcmpq\[ \\t\]+\\\$0)\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[0-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpequq-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpequq-1.c index f3f35ec..3e00cc1 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpequq-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpequq-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512f -O2" } */ +/* { dg-options "-mavx512f -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "(?:vpcmpuq|vpcmpeqq)\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "(?:vpcmpuq|vpcmpeqq)\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[0-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpged-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpged-1.c index bf7dda2..4b60bd4 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpged-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpged-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512f -O2" } */ +/* { dg-options "-mavx512f -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vpcmpd\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpcmpd\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[0-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpgeq-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpgeq-1.c index 4be0ae4..c5e4b46 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpgeq-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpgeq-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512f -O2" } */ +/* { dg-options "-mavx512f -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vpcmpq\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpcmpq\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[0-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpgeud-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpgeud-1.c index 807c5bb..9f346fe 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpgeud-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpgeud-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512f -O2" } */ +/* { dg-options "-mavx512f -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vpcmpud\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpcmpud\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[0-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpgeuq-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpgeuq-1.c index 86a89e5..9fbb7a6 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpgeuq-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpgeuq-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512f -O2" } */ +/* { dg-options "-mavx512f -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vpcmpuq\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpcmpuq\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[0-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpled-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpled-1.c index ec1e582..6ea73ca 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpled-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpled-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512f -O2" } */ +/* { dg-options "-mavx512f -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vpcmpd\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpcmpd\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[0-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpleq-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpleq-1.c index ae480da..a2ba07c 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpleq-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpleq-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512f -O2" } */ +/* { dg-options "-mavx512f -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vpcmpq\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpcmpq\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[0-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpleud-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpleud-1.c index c520c36..ea0ee4a 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpleud-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpleud-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512f -O2" } */ +/* { dg-options "-mavx512f -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vpcmpud\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpcmpud\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[0-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpleuq-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpleuq-1.c index 6b8de64..7c4e870 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpleuq-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpleuq-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512f -O2" } */ +/* { dg-options "-mavx512f -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vpcmpuq\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpcmpuq\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[0-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpltd-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpltd-1.c index cf82f12..ab0bef3 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpltd-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpltd-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512f -O2" } */ +/* { dg-options "-mavx512f -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vpcmpd\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpcmpd\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[0-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpltq-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpltq-1.c index 0e369a7..5ef7ff4 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpltq-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpltq-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512f -O2" } */ +/* { dg-options "-mavx512f -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vpcmpq\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpcmpq\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[0-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpltud-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpltud-1.c index c28748a..f7f44a3 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpltud-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpltud-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512f -O2" } */ +/* { dg-options "-mavx512f -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vpcmpud\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpcmpud\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[0-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpltuq-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpltuq-1.c index eb70a7c..36d0d15 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpltuq-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpltuq-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512f -O2" } */ +/* { dg-options "-mavx512f -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vpcmpuq\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpcmpuq\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[0-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpneqd-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpneqd-1.c index ffc4826..4c0013b 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpneqd-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpneqd-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512f -O2" } */ +/* { dg-options "-mavx512f -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vpcmpd\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpcmpd\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[0-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpneqq-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpneqq-1.c index 26dde19..a2921f8 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpneqq-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpneqq-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512f -O2" } */ +/* { dg-options "-mavx512f -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vpcmpq\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpcmpq\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[0-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpnequd-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpnequd-1.c index 3cdd173..821b3c1 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpnequd-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpnequd-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512f -O2" } */ +/* { dg-options "-mavx512f -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vpcmpud\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpcmpud\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[0-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpnequq-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpnequq-1.c index b93daf7..bb39636 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpnequq-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpnequq-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512f -O2" } */ +/* { dg-options "-mavx512f -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vpcmpuq\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpcmpuq\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[0-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpq-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpq-1.c index 445e59c..1a32cb8 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpq-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpq-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mavx512f" } */ +/* { dg-options "-O2 -fno-fuse-ops-with-volatile-access -mavx512f" } */ /* { dg-final { scan-assembler-times "vpcmpq\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpcmpq\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpud-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpud-1.c index be0a8fe..9a83931 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpud-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpud-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mavx512f" } */ +/* { dg-options "-O2 -fno-fuse-ops-with-volatile-access -mavx512f" } */ /* { dg-final { scan-assembler-times "(?:vpcmpud|vpcmpeqd)\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpcmpud\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpuq-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpuq-1.c index fa6878a..2dd4906 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpuq-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpuq-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mavx512f" } */ +/* { dg-options "-O2 -fno-fuse-ops-with-volatile-access -mavx512f" } */ /* { dg-final { scan-assembler-times "vpcmpuq\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpcmpuq\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vrndscalepd-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vrndscalepd-1.c index f4467a5..7db4e58 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vrndscalepd-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vrndscalepd-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512f -O2" } */ +/* { dg-options "-mavx512f -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vrndscalepd\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 3 } } */ /* { dg-final { scan-assembler-times "vrndscalepd\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 3 } } */ /* { dg-final { scan-assembler-times "vrndscalepd\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vrndscaleps-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vrndscaleps-1.c index cbb469c..946fb50 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vrndscaleps-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vrndscaleps-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512f -O2" } */ +/* { dg-options "-mavx512f -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vrndscaleps\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 3 } } */ /* { dg-final { scan-assembler-times "vrndscaleps\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 3 } } */ /* { dg-final { scan-assembler-times "vrndscaleps\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-complex-fma.c b/gcc/testsuite/gcc.target/i386/avx512fp16-complex-fma.c index 2dfd369..7d68043 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16-complex-fma.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-complex-fma.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -O2 -Ofast" } */ +/* { dg-options "-mavx512fp16 -O2 -fno-fuse-ops-with-volatile-access -Ofast" } */ /* { dg-final { scan-assembler-times "vfmaddcph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-not "vaddph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)"} } */ /* { dg-final { scan-assembler-not "vfmulcph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)"} } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vaddph-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vaddph-1a.c index 0590c34..871eea6 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16-vaddph-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vaddph-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -O2" } */ +/* { dg-options "-mavx512fp16 -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vaddph\[ \\t\]+%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vaddph\[ \\t\]+%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vaddph\[ \\t\]+%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtpd2ph-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtpd2ph-1a.c index 8f74405..165109e 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtpd2ph-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtpd2ph-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -O2" } */ +/* { dg-options "-mavx512fp16 -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvtpd2phz\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vcvtpd2phz\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtpd2phz\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtph2dq-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtph2dq-1a.c index 31a5639..8beb94c 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtph2dq-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtph2dq-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -O2" } */ +/* { dg-options "-mavx512fp16 -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvtph2dq\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vcvtph2dq\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtph2dq\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtph2pd-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtph2pd-1a.c index b7bb3b7..9e6ab27 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtph2pd-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtph2pd-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -O2" } */ +/* { dg-options "-mavx512fp16 -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvtph2pd\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vcvtph2pd\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtph2pd\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtph2psx-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtph2psx-1a.c index c79549f..dee88a1 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtph2psx-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtph2psx-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -O2" } */ +/* { dg-options "-mavx512fp16 -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvtph2psx\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vcvtph2psx\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtph2psx\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtph2qq-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtph2qq-1a.c index d80ee61..78fab68 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtph2qq-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtph2qq-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -O2" } */ +/* { dg-options "-mavx512fp16 -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvtph2qq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vcvtph2qq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtph2qq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtph2udq-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtph2udq-1a.c index b4a833a..9946fa3 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtph2udq-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtph2udq-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -O2" } */ +/* { dg-options "-mavx512fp16 -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvtph2udq\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vcvtph2udq\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtph2udq\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtph2uqq-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtph2uqq-1a.c index b408779..06fa886 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtph2uqq-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtph2uqq-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -O2" } */ +/* { dg-options "-mavx512fp16 -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvtph2uqq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vcvtph2uqq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtph2uqq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtph2uw-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtph2uw-1a.c index 2622745..82a4a07 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtph2uw-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtph2uw-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -O2" } */ +/* { dg-options "-mavx512fp16 -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvtph2uw\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vcvtph2uw\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtph2uw\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtph2w-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtph2w-1a.c index bcaa744..7280628 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtph2w-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtph2w-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -O2" } */ +/* { dg-options "-mavx512fp16 -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvtph2w\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vcvtph2w\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtph2w\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtps2ph-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtps2ph-1a.c index cb957f8..841ef54 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtps2ph-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtps2ph-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -O2" } */ +/* { dg-options "-mavx512fp16 -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvtps2phx\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vcvtps2phx\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtps2phx\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtqq2ph-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtqq2ph-1a.c index 4e8515e..588734e 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtqq2ph-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtqq2ph-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -O2" } */ +/* { dg-options "-mavx512fp16 -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvtqq2phz\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vcvtqq2phz\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtqq2phz\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vcvttph2dq-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vcvttph2dq-1a.c index 0e44aaf..fb23358 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16-vcvttph2dq-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vcvttph2dq-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -O2" } */ +/* { dg-options "-mavx512fp16 -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvttph2dq\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vcvttph2dq\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttph2dq\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vcvttph2qq-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vcvttph2qq-1a.c index 1241694..53db6b8 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16-vcvttph2qq-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vcvttph2qq-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -O2" } */ +/* { dg-options "-mavx512fp16 -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvttph2qq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vcvttph2qq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttph2qq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vcvttph2udq-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vcvttph2udq-1a.c index 0fd60f5..a08e7b1 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16-vcvttph2udq-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vcvttph2udq-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -O2" } */ +/* { dg-options "-mavx512fp16 -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvttph2udq\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vcvttph2udq\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttph2udq\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vcvttph2uqq-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vcvttph2uqq-1a.c index 04fee29..c246088 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16-vcvttph2uqq-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vcvttph2uqq-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -O2" } */ +/* { dg-options "-mavx512fp16 -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvttph2uqq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vcvttph2uqq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttph2uqq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vcvttph2uw-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vcvttph2uw-1a.c index b31af84..5f0f0644 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16-vcvttph2uw-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vcvttph2uw-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -O2" } */ +/* { dg-options "-mavx512fp16 -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvttph2uw\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vcvttph2uw\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttph2uw\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vcvttph2w-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vcvttph2w-1a.c index a918594..52cea58 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16-vcvttph2w-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vcvttph2w-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -O2" } */ +/* { dg-options "-mavx512fp16 -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvttph2w\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vcvttph2w\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttph2w\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtuqq2ph-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtuqq2ph-1a.c index a234bb5..5f859e7 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtuqq2ph-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vcvtuqq2ph-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -O2" } */ +/* { dg-options "-mavx512fp16 -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvtuqq2phz\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vcvtuqq2phz\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtuqq2phz\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vfcmaddcph-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vfcmaddcph-1a.c index 851561a..90b7072 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16-vfcmaddcph-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vfcmaddcph-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -O2" } */ +/* { dg-options "-mavx512fp16 -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vfcmaddcph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vfcmaddcph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vfcmaddcph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vfcmulcph-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vfcmulcph-1a.c index e228393..94ec85a 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16-vfcmulcph-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vfcmulcph-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -O2" } */ +/* { dg-options "-mavx512fp16 -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vfcmulcph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vfcmulcph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vfcmulcph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 2 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vfmaddcph-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vfmaddcph-1a.c index dfcc6e5..c1f02bb 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16-vfmaddcph-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vfmaddcph-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -O2" } */ +/* { dg-options "-mavx512fp16 -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vfmaddcph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vfmaddcph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vfmaddcph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vfmulcph-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vfmulcph-1a.c index 4135cd2..f3863f9 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16-vfmulcph-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vfmulcph-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -O2" } */ +/* { dg-options "-mavx512fp16 -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vfmulcph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vfmulcph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vfmulcph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 2 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vfpclassph-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vfpclassph-1a.c index a97dddf..db41dbf 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16-vfpclassph-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vfpclassph-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -O2" } */ +/* { dg-options "-mavx512fp16 -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vfpclassphz\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vfpclassphz\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vfpclasssh-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vfpclasssh-1a.c index 7a31fd8..66f5e96 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16-vfpclasssh-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vfpclasssh-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -O2" } */ +/* { dg-options "-mavx512fp16 -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vfpclasssh\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vfpclasssh\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[0-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vmulph-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vmulph-1a.c index 1088e25..6419510 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16-vmulph-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vmulph-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -O2" } */ +/* { dg-options "-mavx512fp16 -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vmulph\[ \\t\]+%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vmulph\[ \\t\]+%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vmulph\[ \\t\]+%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vrcpph-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vrcpph-1a.c index 6a5c642..ca6c762 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16-vrcpph-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vrcpph-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -O2" } */ +/* { dg-options "-mavx512fp16 -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vrcpph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vrcpph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vrcpph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vrsqrtph-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vrsqrtph-1a.c index c9671e8..f1a313a 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16-vrsqrtph-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vrsqrtph-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -O2" } */ +/* { dg-options "-mavx512fp16 -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vrsqrtph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vrsqrtph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vrsqrtph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vsqrtph-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vsqrtph-1a.c index 497b5ba..598543a 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16-vsqrtph-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vsqrtph-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -O2" } */ +/* { dg-options "-mavx512fp16 -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vsqrtph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vsqrtph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vsqrtph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vaddph-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vaddph-1a.c index 354d897..8c88c72 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vaddph-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vaddph-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -mavx512vl -O2" } */ +/* { dg-options "-mavx512fp16 -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vaddph\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vaddph\[ \\t\]+%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vaddph\[ \\t\]+%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtpd2ph-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtpd2ph-1a.c index 57604a9..a997979 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtpd2ph-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtpd2ph-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -mavx512vl -O2" } */ +/* { dg-options "-mavx512fp16 -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvtpd2phy\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtpd2phy\[ \\t\]+%ymm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtpd2phy\[ \\t\]+%ymm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtph2dq-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtph2dq-1a.c index df653b0..c08164c 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtph2dq-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtph2dq-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -mavx512vl -O2" } */ +/* { dg-options "-mavx512fp16 -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvtph2dq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtph2dq\[ \\t\]+%xmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtph2dq\[ \\t\]+%xmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtph2psx-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtph2psx-1a.c index e8c4c8c..9ed630d 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtph2psx-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtph2psx-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -mavx512vl -O2" } */ +/* { dg-options "-mavx512fp16 -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvtph2psx\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtph2psx\[ \\t\]+%xmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtph2psx\[ \\t\]+%xmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtph2qq-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtph2qq-1a.c index ddc6f2a..672d033 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtph2qq-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtph2qq-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -mavx512vl -O2" } */ +/* { dg-options "-mavx512fp16 -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvtph2qq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtph2qq\[ \\t\]+%xmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtph2qq\[ \\t\]+%xmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtph2udq-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtph2udq-1a.c index d07d766..c800d3b 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtph2udq-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtph2udq-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -mavx512vl -O2" } */ +/* { dg-options "-mavx512fp16 -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvtph2udq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtph2udq\[ \\t\]+%xmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtph2udq\[ \\t\]+%xmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtph2uqq-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtph2uqq-1a.c index 26dbf22..ad72cd7 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtph2uqq-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtph2uqq-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -mavx512vl -O2" } */ +/* { dg-options "-mavx512fp16 -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvtph2uqq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtph2uqq\[ \\t\]+%xmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtph2uqq\[ \\t\]+%xmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtph2uw-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtph2uw-1a.c index 0f9fd27..beba83c 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtph2uw-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtph2uw-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -mavx512vl -O2" } */ +/* { dg-options "-mavx512fp16 -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvtph2uw\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtph2uw\[ \\t\]+%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtph2uw\[ \\t\]+%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtph2w-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtph2w-1a.c index 8dee4ee..e538020 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtph2w-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtph2w-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -mavx512vl -O2" } */ +/* { dg-options "-mavx512fp16 -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvtph2w\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtph2w\[ \\t\]+%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtph2w\[ \\t\]+%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtps2ph-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtps2ph-1a.c index a89f8c4..c31285f 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtps2ph-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtps2ph-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -mavx512vl -O2" } */ +/* { dg-options "-mavx512fp16 -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvtps2phxy\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtps2phxy\[ \\t\]+%ymm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtps2phxy\[ \\t\]+%ymm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtqq2ph-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtqq2ph-1a.c index 8e42a4b..29afa7b 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtqq2ph-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtqq2ph-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -mavx512vl -O2" } */ +/* { dg-options "-mavx512fp16 -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvtqq2phy\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtqq2phy\[ \\t\]+%ymm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtqq2phy\[ \\t\]+%ymm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvttph2dq-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvttph2dq-1a.c index b4c0840..2ba959f 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvttph2dq-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvttph2dq-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -mavx512vl -O2" } */ +/* { dg-options "-mavx512fp16 -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvttph2dq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttph2dq\[ \\t\]+%xmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttph2dq\[ \\t\]+%xmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvttph2udq-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvttph2udq-1a.c index 60f4318..09c1270 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvttph2udq-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvttph2udq-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -mavx512vl -O2" } */ +/* { dg-options "-mavx512fp16 -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvttph2udq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttph2udq\[ \\t\]+%xmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttph2udq\[ \\t\]+%xmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvttph2uw-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvttph2uw-1a.c index eafa31a..75b0cb1 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvttph2uw-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvttph2uw-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -mavx512vl -O2" } */ +/* { dg-options "-mavx512fp16 -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvttph2uw\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttph2uw\[ \\t\]+%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttph2uw\[ \\t\]+%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvttph2w-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvttph2w-1a.c index 7476d3c..7992656 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvttph2w-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvttph2w-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -mavx512vl -O2" } */ +/* { dg-options "-mavx512fp16 -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvttph2w\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttph2w\[ \\t\]+%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttph2w\[ \\t\]+%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtuqq2ph-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtuqq2ph-1a.c index a3ee951..6bcd6b3 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtuqq2ph-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vcvtuqq2ph-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -mavx512vl -O2" } */ +/* { dg-options "-mavx512fp16 -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvtuqq2phy\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtuqq2phy\[ \\t\]+%ymm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtuqq2phy\[ \\t\]+%ymm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfcmaddcph-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfcmaddcph-1a.c index 93edb92..dceda62 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfcmaddcph-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfcmaddcph-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -mavx512vl -O2" } */ +/* { dg-options "-mavx512fp16 -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vfcmaddcph\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vfcmaddcph\[ \\t\]+%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vfcmaddcph\[ \\t\]+%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfcmulcph-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfcmulcph-1a.c index 370f9ee..f71c3db 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfcmulcph-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfcmulcph-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512f -mavx512fp16 -mavx512vl -O2" } */ +/* { dg-options "-mavx512f -mavx512fp16 -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vfcmulcph\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vfcmulcph\[ \\t\]+%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vfcmulcph\[ \\t\]+%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 2 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfmaddcph-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfmaddcph-1a.c index 7dfbb3e..c4cbcf5 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfmaddcph-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfmaddcph-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -mavx512vl -O2" } */ +/* { dg-options "-mavx512fp16 -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vfmaddcph\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vfmaddcph\[ \\t\]+%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vfmaddcph\[ \\t\]+%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfmulcph-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfmulcph-1a.c index dce9088..f5edd1a 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfmulcph-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfmulcph-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512f -mavx512fp16 -mavx512vl -O2" } */ +/* { dg-options "-mavx512f -mavx512fp16 -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vfmulcph\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vfmulcph\[ \\t\]+%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vfmulcph\[ \\t\]+%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 2 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfpclassph-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfpclassph-1a.c index 897a3c8..50f6a02 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfpclassph-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfpclassph-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -mavx512vl -O2" } */ +/* { dg-options "-mavx512fp16 -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vfpclassphy\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vfpclassphx\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vfpclassphy\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vmulph-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vmulph-1a.c index 26663c5..8e7d3b3 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vmulph-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vmulph-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -mavx512vl -O2" } */ +/* { dg-options "-mavx512fp16 -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vmulph\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vmulph\[ \\t\]+%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vmulph\[ \\t\]+%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vrcpph-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vrcpph-1a.c index 5894dbc..b0e7b0a 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vrcpph-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vrcpph-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -mavx512vl -O2" } */ +/* { dg-options "-mavx512fp16 -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vrcpph\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vrcpph\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[0-9\]\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vrcpph\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vrsqrtph-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vrsqrtph-1a.c index a5edc17..5aeddd9 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vrsqrtph-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vrsqrtph-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -mavx512vl -O2" } */ +/* { dg-options "-mavx512fp16 -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vrsqrtph\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vrsqrtph\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[0-9\]\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vrsqrtph\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vsqrtph-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vsqrtph-1a.c index 4acb137..bacca0a 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vsqrtph-1a.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vsqrtph-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512fp16 -mavx512vl -O2" } */ +/* { dg-options "-mavx512fp16 -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vsqrtph\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vsqrtph\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[0-9\]\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vsqrtph\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-pr100267-1.c b/gcc/testsuite/gcc.target/i386/avx512vl-pr100267-1.c index 9ffd381..6829ce0 100644 --- a/gcc/testsuite/gcc.target/i386/avx512vl-pr100267-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512vl-pr100267-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512f -mavx512vl -O2" } */ +/* { dg-options "-mavx512f -mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vpexpandd\[ \\t\]+\[^\{\n\]*\\(\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpexpandd\[ \\t\]+\[^\{\n\(]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpexpandq\[ \\t\]+\[^\{\n\]*\\(\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-pr103750-2.c b/gcc/testsuite/gcc.target/i386/avx512vl-pr103750-2.c new file mode 100644 index 0000000..7c6e77b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512vl-pr103750-2.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-march=x86-64-v4 -mprefer-vector-width=128 -O3" } */ +/* { dg-final { scan-assembler "kortest" } } */ +/* { dg-final { scan-assembler-not "kmov" } } */ + +int +foo (int *__restrict a) +{ + for (int i = 0; i != 100; i++) + if (a[i] == 0) + return 1; + return 0; +} diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-vcmppd-1.c b/gcc/testsuite/gcc.target/i386/avx512vl-vcmppd-1.c index 1911f01..072a11e 100644 --- a/gcc/testsuite/gcc.target/i386/avx512vl-vcmppd-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512vl-vcmppd-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mavx512vl" } */ +/* { dg-options "-O2 -fno-fuse-ops-with-volatile-access -mavx512vl" } */ /* { dg-final { scan-assembler-times "vcmppd\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcmppd\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcmppd\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-vcmpps-1.c b/gcc/testsuite/gcc.target/i386/avx512vl-vcmpps-1.c index 5550c35..fa37615 100644 --- a/gcc/testsuite/gcc.target/i386/avx512vl-vcmpps-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512vl-vcmpps-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mavx512vl" } */ +/* { dg-options "-O2 -fno-fuse-ops-with-volatile-access -mavx512vl" } */ /* { dg-final { scan-assembler-times "vcmpps\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcmpps\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcmpps\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-vcvtpd2ps-1.c b/gcc/testsuite/gcc.target/i386/avx512vl-vcvtpd2ps-1.c index b0cd6e4..d252cb9 100644 --- a/gcc/testsuite/gcc.target/i386/avx512vl-vcvtpd2ps-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512vl-vcvtpd2ps-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mavx512vl" } */ +/* { dg-options "-O2 -fno-fuse-ops-with-volatile-access -mavx512vl" } */ /* { dg-final { scan-assembler-times "vcvtpd2psy\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtpd2psy\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtpd2psx\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-vcvtpd2udq-1.c b/gcc/testsuite/gcc.target/i386/avx512vl-vcvtpd2udq-1.c index 465a819..7e2d0b9 100644 --- a/gcc/testsuite/gcc.target/i386/avx512vl-vcvtpd2udq-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512vl-vcvtpd2udq-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512vl -O2" } */ +/* { dg-options "-mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvtpd2udqy\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtpd2udqx\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtpd2udqy\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-vcvttpd2udq-1.c b/gcc/testsuite/gcc.target/i386/avx512vl-vcvttpd2udq-1.c index cc7a2d5..5b4e930 100644 --- a/gcc/testsuite/gcc.target/i386/avx512vl-vcvttpd2udq-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512vl-vcvttpd2udq-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512vl -O2" } */ +/* { dg-options "-mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvttpd2udqy\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttpd2udqx\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttpd2udqy\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-vcvttps2udq-1.c b/gcc/testsuite/gcc.target/i386/avx512vl-vcvttps2udq-1.c index 652f18a..7650a4d 100644 --- a/gcc/testsuite/gcc.target/i386/avx512vl-vcvttps2udq-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512vl-vcvttps2udq-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512vl -O2" } */ +/* { dg-options "-mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vcvttps2udq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttps2udq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttps2udq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-vextractf32x4-1.c b/gcc/testsuite/gcc.target/i386/avx512vl-vextractf32x4-1.c index 26313f4..2e515f4 100644 --- a/gcc/testsuite/gcc.target/i386/avx512vl-vextractf32x4-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512vl-vextractf32x4-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512vl -O2" } */ +/* { dg-options "-mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vextractf(?:128|32x4)\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vextractf32x4\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vextractf32x4\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-vmovapd-1.c b/gcc/testsuite/gcc.target/i386/avx512vl-vmovapd-1.c index 89c3ebe..2b2484a 100644 --- a/gcc/testsuite/gcc.target/i386/avx512vl-vmovapd-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512vl-vmovapd-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512vl -O2" } */ +/* { dg-options "-mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vmovapd\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vmovapd\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vmovapd\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-vmovaps-1.c b/gcc/testsuite/gcc.target/i386/avx512vl-vmovaps-1.c index 2196ebb..eb2873c 100644 --- a/gcc/testsuite/gcc.target/i386/avx512vl-vmovaps-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512vl-vmovaps-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512vl -O2" } */ +/* { dg-options "-mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vmovaps\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vmovaps\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vmovaps\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-vmovdqa64-1.c b/gcc/testsuite/gcc.target/i386/avx512vl-vmovdqa64-1.c index d20b4a7..87eb5c3 100644 --- a/gcc/testsuite/gcc.target/i386/avx512vl-vmovdqa64-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512vl-vmovdqa64-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512vl -O2" } */ +/* { dg-options "-mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "vmovdqa64\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vmovdqa64\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vmovdqa64\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-vpcmpd-1.c b/gcc/testsuite/gcc.target/i386/avx512vl-vpcmpd-1.c index 788e9da..9006a4a 100644 --- a/gcc/testsuite/gcc.target/i386/avx512vl-vpcmpd-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512vl-vpcmpd-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mavx512vl" } */ +/* { dg-options "-O2 -fno-fuse-ops-with-volatile-access -mavx512vl" } */ /* { dg-final { scan-assembler-times "vpcmpd\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpcmpd\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpcmpd\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-vpcmpeqq-1.c b/gcc/testsuite/gcc.target/i386/avx512vl-vpcmpeqq-1.c index a798d06..38b556d 100644 --- a/gcc/testsuite/gcc.target/i386/avx512vl-vpcmpeqq-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512vl-vpcmpeqq-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512vl -O2" } */ +/* { dg-options "-mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "(?:vpcmpeqq\[ \\t\]+|vpcmpq\[ \\t\]+\\\$0)\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%k\[0-7\]\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "(?:vpcmpeqq\[ \\t\]+|vpcmpq\[ \\t\]+\\\$0)\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%k\[0-7\]\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "(?:vpcmpeqq\[ \\t\]+|vpcmpq\[ \\t\]+\\\$0)\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-vpcmpequq-1.c b/gcc/testsuite/gcc.target/i386/avx512vl-vpcmpequq-1.c index 736763f..780cda4 100644 --- a/gcc/testsuite/gcc.target/i386/avx512vl-vpcmpequq-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512vl-vpcmpequq-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx512vl -O2" } */ +/* { dg-options "-mavx512vl -O2 -fno-fuse-ops-with-volatile-access" } */ /* { dg-final { scan-assembler-times "(?:vpcmpuq|vpcmpeqq)\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%k\[0-7\]\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "(?:vpcmpuq|vpcmpeqq)\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%k\[0-7\]\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "(?:vpcmpuq|vpcmpeqq)\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-vpcmpq-1.c b/gcc/testsuite/gcc.target/i386/avx512vl-vpcmpq-1.c index cb3156c..eeabe2b 100644 --- a/gcc/testsuite/gcc.target/i386/avx512vl-vpcmpq-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512vl-vpcmpq-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mavx512vl" } */ +/* { dg-options "-O2 -fno-fuse-ops-with-volatile-access -mavx512vl" } */ /* { dg-final { scan-assembler-times "vpcmpq\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpcmpq\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpcmpq\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-vpcmpud-1.c b/gcc/testsuite/gcc.target/i386/avx512vl-vpcmpud-1.c index ba1a7e2..dcf3094 100644 --- a/gcc/testsuite/gcc.target/i386/avx512vl-vpcmpud-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512vl-vpcmpud-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mavx512vl" } */ +/* { dg-options "-O2 -fno-fuse-ops-with-volatile-access -mavx512vl" } */ /* { dg-final { scan-assembler-times "vpcmpud\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpcmpud\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpcmpud\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-vpcmpuq-1.c b/gcc/testsuite/gcc.target/i386/avx512vl-vpcmpuq-1.c index f93fca2..43cae5f 100644 --- a/gcc/testsuite/gcc.target/i386/avx512vl-vpcmpuq-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512vl-vpcmpuq-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mavx512vl" } */ +/* { dg-options "-O2 -fno-fuse-ops-with-volatile-access -mavx512vl" } */ /* { dg-final { scan-assembler-times "vpcmpuq\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vpcmpuq\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "(?:vpcmpuq|vpcmpeqq)\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/builtin-copysign-2.c b/gcc/testsuite/gcc.target/i386/builtin-copysign-2.c index d90c5a4..e1c786b 100644 --- a/gcc/testsuite/gcc.target/i386/builtin-copysign-2.c +++ b/gcc/testsuite/gcc.target/i386/builtin-copysign-2.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -mno-avx -msse2" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target { ! ia32 } } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/builtin-copysign-3.c b/gcc/testsuite/gcc.target/i386/builtin-copysign-3.c index d3b4dd5..3a30189 100644 --- a/gcc/testsuite/gcc.target/i386/builtin-copysign-3.c +++ b/gcc/testsuite/gcc.target/i386/builtin-copysign-3.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -mno-avx -msse2" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target { ! ia32 } } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/builtin-copysign-4.c b/gcc/testsuite/gcc.target/i386/builtin-copysign-4.c index 9886fdc..f08fe35 100644 --- a/gcc/testsuite/gcc.target/i386/builtin-copysign-4.c +++ b/gcc/testsuite/gcc.target/i386/builtin-copysign-4.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -mno-avx -msse2" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target { ! ia32 } } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/builtin-copysign-5.c b/gcc/testsuite/gcc.target/i386/builtin-copysign-5.c index 3f4df5f..523faab 100644 --- a/gcc/testsuite/gcc.target/i386/builtin-copysign-5.c +++ b/gcc/testsuite/gcc.target/i386/builtin-copysign-5.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -mno-avx -msse2" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target { ! ia32 } } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/builtin-copysign-6.c b/gcc/testsuite/gcc.target/i386/builtin-copysign-6.c index 5b6eb51..4c44055 100644 --- a/gcc/testsuite/gcc.target/i386/builtin-copysign-6.c +++ b/gcc/testsuite/gcc.target/i386/builtin-copysign-6.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -mno-avx -msse2" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target { ! ia32 } } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/builtin-copysign-7.c b/gcc/testsuite/gcc.target/i386/builtin-copysign-7.c index 012fb14..a1f35f5 100644 --- a/gcc/testsuite/gcc.target/i386/builtin-copysign-7.c +++ b/gcc/testsuite/gcc.target/i386/builtin-copysign-7.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -mno-avx -msse2" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target { ! ia32 } } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/builtin-copysign-8a.c b/gcc/testsuite/gcc.target/i386/builtin-copysign-8a.c index e390ee2..5a0f7af 100644 --- a/gcc/testsuite/gcc.target/i386/builtin-copysign-8a.c +++ b/gcc/testsuite/gcc.target/i386/builtin-copysign-8a.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -mno-avx -msse2" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target { ! ia32 } } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/builtin-copysign-8b.c b/gcc/testsuite/gcc.target/i386/builtin-copysign-8b.c index dc9e461..8b5619f 100644 --- a/gcc/testsuite/gcc.target/i386/builtin-copysign-8b.c +++ b/gcc/testsuite/gcc.target/i386/builtin-copysign-8b.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -mno-avx512f -mavx -mtune=generic" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target { ! ia32 } } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/builtin-fabs-1.c b/gcc/testsuite/gcc.target/i386/builtin-fabs-1.c index a9a25f6..ec0be87 100644 --- a/gcc/testsuite/gcc.target/i386/builtin-fabs-1.c +++ b/gcc/testsuite/gcc.target/i386/builtin-fabs-1.c @@ -1,6 +1,7 @@ /* PR target/122323 */ /* { dg-do compile } */ /* { dg-options "-O2 -mno-avx -msse2" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target { ! ia32 } } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/builtin-memmove-10.c b/gcc/testsuite/gcc.target/i386/builtin-memmove-10.c new file mode 100644 index 0000000..4f18374 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/builtin-memmove-10.c @@ -0,0 +1,106 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mno-avx -msse2 -mtune=generic -minline-all-stringops" } */ +/* { dg-add-options check_function_bodies } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target { lp64 } } {^\t?\.} } } */ + +/* +**gcc_memmove: +**.LFB0: +** .cfi_startproc +** cmpq \$63, %rdx +** ja .L12 +**.L1: +** ret +** .p2align 4,,10 +** .p2align 3 +**.L12: +** movq %rdi, %rcx +** movq %rsi, %rax +** cmpq \$128, %rdx +** jbe .L13 +** movq %rdx, %rsi +** cmpq %rdi, %rax +** jb .L6 +** je .L1 +** movdqu -16\(%rax,%rdx\), %xmm7 +** movdqu -32\(%rax,%rdx\), %xmm6 +** movdqu -48\(%rax,%rdx\), %xmm5 +** movdqu -64\(%rax,%rdx\), %xmm4 +**.L7: +** movdqu \(%rax\), %xmm3 +** subq \$64, %rsi +** addq \$64, %rcx +** addq \$64, %rax +** movdqu -48\(%rax\), %xmm2 +** movdqu -32\(%rax\), %xmm1 +** movdqu -16\(%rax\), %xmm0 +** movups %xmm3, -64\(%rcx\) +** movups %xmm2, -48\(%rcx\) +** movups %xmm1, -32\(%rcx\) +** movups %xmm0, -16\(%rcx\) +** cmpq \$64, %rsi +** ja .L7 +** movups %xmm7, -16\(%rdi,%rdx\) +** movups %xmm6, -32\(%rdi,%rdx\) +** movups %xmm5, -48\(%rdi,%rdx\) +** movups %xmm4, -64\(%rdi,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L13: +** movdqu \(%rsi\), %xmm7 +** movdqu 16\(%rsi\), %xmm6 +** movdqu 32\(%rsi\), %xmm5 +** movdqu 48\(%rsi\), %xmm4 +** movdqu -16\(%rsi,%rdx\), %xmm3 +** movdqu -32\(%rsi,%rdx\), %xmm2 +** movdqu -48\(%rsi,%rdx\), %xmm1 +** movdqu -64\(%rsi,%rdx\), %xmm0 +** movups %xmm7, \(%rdi\) +** movups %xmm6, 16\(%rdi\) +** movups %xmm5, 32\(%rdi\) +** movups %xmm4, 48\(%rdi\) +** movups %xmm3, -16\(%rdi,%rdx\) +** movups %xmm2, -32\(%rdi,%rdx\) +** movups %xmm1, -48\(%rdi,%rdx\) +** movups %xmm0, -64\(%rdi,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L6: +** movdqu \(%rax\), %xmm3 +** movdqu 16\(%rax\), %xmm2 +** leaq \(%rdi,%rdx\), %rcx +** movdqu 32\(%rax\), %xmm1 +** movdqu 48\(%rax\), %xmm0 +** addq %rdx, %rax +**.L8: +** movdqu -16\(%rax\), %xmm7 +** movdqu -32\(%rax\), %xmm6 +** subq \$64, %rsi +** subq \$64, %rcx +** movdqu -48\(%rax\), %xmm5 +** movdqu -64\(%rax\), %xmm4 +** subq \$64, %rax +** movups %xmm7, 48\(%rcx\) +** movups %xmm6, 32\(%rcx\) +** movups %xmm5, 16\(%rcx\) +** movups %xmm4, \(%rcx\) +** cmpq \$64, %rsi +** ja .L8 +** movups %xmm3, \(%rdi\) +** movups %xmm2, 16\(%rdi\) +** movups %xmm1, 32\(%rdi\) +** movups %xmm0, 48\(%rdi\) +** ret +** .cfi_endproc +**... +*/ + +void +gcc_memmove (void *a, void *b, __SIZE_TYPE__ n) +{ + if (n >= 64) + __builtin_memmove (a, b, n); +} diff --git a/gcc/testsuite/gcc.target/i386/builtin-memmove-11a.c b/gcc/testsuite/gcc.target/i386/builtin-memmove-11a.c new file mode 100644 index 0000000..bf5369c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/builtin-memmove-11a.c @@ -0,0 +1,80 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mno-avx -msse2 -mtune=generic -minline-all-stringops" } */ +/* { dg-add-options check_function_bodies } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target { lp64 } } {^\t?\.} } } */ + +/* +**gcc_memmove_xmm: +**.LFB0: +** .cfi_startproc +** movq %rdi, %rax +** movl \$512, %edx +** cmpq %rdi, %rsi +** jb .L5 +** je .L1 +** movdqu 496\(%rsi\), %xmm7 +** movdqu 480\(%rsi\), %xmm6 +** movdqu 464\(%rsi\), %xmm5 +** movdqu 448\(%rsi\), %xmm4 +**.L6: +** movdqu \(%rsi\), %xmm3 +** movdqu 16\(%rsi\), %xmm2 +** subl \$64, %edx +** addq \$64, %rax +** movdqu 32\(%rsi\), %xmm1 +** movdqu 48\(%rsi\), %xmm0 +** addq \$64, %rsi +** movups %xmm3, -64\(%rax\) +** movups %xmm2, -48\(%rax\) +** movups %xmm1, -32\(%rax\) +** movups %xmm0, -16\(%rax\) +** cmpl \$64, %edx +** ja .L6 +** movups %xmm7, 496\(%rdi\) +** movups %xmm6, 480\(%rdi\) +** movups %xmm5, 464\(%rdi\) +** movups %xmm4, 448\(%rdi\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L5: +** movdqu \(%rsi\), %xmm7 +** movdqu 16\(%rsi\), %xmm6 +** leaq 512\(%rdi\), %rax +** addq \$512, %rsi +** movdqu -480\(%rsi\), %xmm5 +** movdqu -464\(%rsi\), %xmm4 +**.L7: +** movdqu -16\(%rsi\), %xmm3 +** subl \$64, %edx +** subq \$64, %rax +** subq \$64, %rsi +** movdqu 32\(%rsi\), %xmm2 +** movdqu 16\(%rsi\), %xmm1 +** movdqu \(%rsi\), %xmm0 +** movups %xmm3, 48\(%rax\) +** movups %xmm2, 32\(%rax\) +** movups %xmm1, 16\(%rax\) +** movups %xmm0, \(%rax\) +** cmpl \$64, %edx +** ja .L7 +** movups %xmm7, \(%rdi\) +** movups %xmm6, 16\(%rdi\) +** movups %xmm5, 32\(%rdi\) +** movups %xmm4, 48\(%rdi\) +**.L1: +** ret +** .cfi_endproc +**... +*/ + +#ifndef gcc_memmove +#define gcc_memmove gcc_memmove_xmm +#endif + +void +gcc_memmove (void *a, void *b) +{ + __builtin_memmove (a, b, 512); +} diff --git a/gcc/testsuite/gcc.target/i386/builtin-memmove-11b.c b/gcc/testsuite/gcc.target/i386/builtin-memmove-11b.c new file mode 100644 index 0000000..f80881d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/builtin-memmove-11b.c @@ -0,0 +1,75 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mno-avx512f -march=x86-64-v3 -mtune=generic -minline-all-stringops" } */ +/* { dg-add-options check_function_bodies } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target { lp64 } } {^\t?\.} } } */ + +/* +**gcc_memmove_ymm: +**.LFB0: +** .cfi_startproc +** movq %rdi, %rax +** movl \$512, %edx +** cmpq %rdi, %rsi +** jb .L5 +** je .L10 +** vmovdqu 480\(%rsi\), %ymm7 +** vmovdqu 448\(%rsi\), %ymm6 +** vmovdqu 416\(%rsi\), %ymm5 +** vmovdqu 384\(%rsi\), %ymm4 +**.L6: +** vmovdqu \(%rsi\), %ymm3 +** vmovdqu 32\(%rsi\), %ymm2 +** addl \$-128, %edx +** subq \$-128, %rax +** vmovdqu 64\(%rsi\), %ymm1 +** vmovdqu 96\(%rsi\), %ymm0 +** subq \$-128, %rsi +** vmovdqu %ymm3, -128\(%rax\) +** vmovdqu %ymm2, -96\(%rax\) +** vmovdqu %ymm1, -64\(%rax\) +** vmovdqu %ymm0, -32\(%rax\) +** cmpl \$128, %edx +** ja .L6 +** vmovdqu %ymm7, 480\(%rdi\) +** vmovdqu %ymm6, 448\(%rdi\) +** vmovdqu %ymm5, 416\(%rdi\) +** vmovdqu %ymm4, 384\(%rdi\) +** vzeroupper +** ret +** .p2align 4,,10 +** .p2align 3 +**.L5: +** vmovdqu \(%rsi\), %ymm7 +** vmovdqu 32\(%rsi\), %ymm6 +** leaq 512\(%rdi\), %rax +** addq \$512, %rsi +** vmovdqu -448\(%rsi\), %ymm5 +** vmovdqu -416\(%rsi\), %ymm4 +**.L7: +** vmovdqu -32\(%rsi\), %ymm3 +** addl \$-128, %edx +** addq \$-128, %rax +** addq \$-128, %rsi +** vmovdqu 64\(%rsi\), %ymm2 +** vmovdqu 32\(%rsi\), %ymm1 +** vmovdqu \(%rsi\), %ymm0 +** vmovdqu %ymm3, 96\(%rax\) +** vmovdqu %ymm2, 64\(%rax\) +** vmovdqu %ymm1, 32\(%rax\) +** vmovdqu %ymm0, \(%rax\) +** cmpl \$128, %edx +** ja .L7 +** vmovdqu %ymm7, \(%rdi\) +** vmovdqu %ymm6, 32\(%rdi\) +** vmovdqu %ymm5, 64\(%rdi\) +** vmovdqu %ymm4, 96\(%rdi\) +** vzeroupper +**.L10: +** ret +** .cfi_endproc +**... +*/ + +#define gcc_memmove gcc_memmove_ymm +#include "builtin-memmove-11a.c" diff --git a/gcc/testsuite/gcc.target/i386/builtin-memmove-11c.c b/gcc/testsuite/gcc.target/i386/builtin-memmove-11c.c new file mode 100644 index 0000000..91b566c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/builtin-memmove-11c.c @@ -0,0 +1,34 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -march=x86-64-v4 -mmove-max=512 -mtune=generic -minline-all-stringops" } */ +/* { dg-add-options check_function_bodies } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target { ! ia32 } } {^\t?\.} } } */ + +/* +**gcc_memmove_zmm: +**.LFB0: +** .cfi_startproc +** vmovdqu64 \(%(e|r)si\), %zmm7 +** vmovdqu64 64\(%(e|r)si\), %zmm6 +** vmovdqu64 128\(%(e|r)si\), %zmm5 +** vmovdqu64 192\(%(e|r)si\), %zmm4 +** vmovdqu64 256\(%(e|r)si\), %zmm3 +** vmovdqu64 320\(%(e|r)si\), %zmm2 +** vmovdqu64 384\(%(e|r)si\), %zmm1 +** vmovdqu64 448\(%(e|r)si\), %zmm0 +** vmovdqu64 %zmm7, \(%(e|r)di\) +** vmovdqu64 %zmm6, 64\(%(e|r)di\) +** vmovdqu64 %zmm5, 128\(%(e|r)di\) +** vmovdqu64 %zmm4, 192\(%(e|r)di\) +** vmovdqu64 %zmm3, 256\(%(e|r)di\) +** vmovdqu64 %zmm2, 320\(%(e|r)di\) +** vmovdqu64 %zmm1, 384\(%(e|r)di\) +** vmovdqu64 %zmm0, 448\(%(e|r)di\) +** vzeroupper +** ret +** .cfi_endproc +**... +*/ + +#define gcc_memmove gcc_memmove_zmm +#include "builtin-memmove-11a.c" diff --git a/gcc/testsuite/gcc.target/i386/builtin-memmove-12.c b/gcc/testsuite/gcc.target/i386/builtin-memmove-12.c new file mode 100644 index 0000000..3180a7e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/builtin-memmove-12.c @@ -0,0 +1,42 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mno-avx -msse2 -mtune=generic" } */ +/* { dg-add-options check_function_bodies } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target { lp64 } } {^\t?\.} } } */ + +/* +**foo: +**.LFB0: +** .cfi_startproc +** movdqu a\+20\(%rip\), %xmm5 +** movdqu a\+36\(%rip\), %xmm4 +** movdqu a\+52\(%rip\), %xmm3 +** movdqu a\+68\(%rip\), %xmm2 +** movdqu a\+84\(%rip\), %xmm1 +** movdqu a\+100\(%rip\), %xmm0 +** movups %xmm5, a\+24\(%rip\) +** movq a\+116\(%rip\), %rax +** movdqu a\+4\(%rip\), %xmm6 +** movups %xmm4, a\+40\(%rip\) +** movl %edi, a\+4\(%rip\) +** movq %rax, a\+120\(%rip\) +** movups %xmm6, a\+8\(%rip\) +** movups %xmm3, a\+56\(%rip\) +** movups %xmm2, a\+72\(%rip\) +** movups %xmm1, a\+88\(%rip\) +** movups %xmm0, a\+104\(%rip\) +** ret +** .cfi_endproc +**... +*/ + +#define N 32 + +int a[N]; + +void +foo (int x) +{ + __builtin_memmove (a + 2, a + 1, sizeof a - 2 * sizeof *a); + a[1] = x; +} diff --git a/gcc/testsuite/gcc.target/i386/builtin-memmove-13.c b/gcc/testsuite/gcc.target/i386/builtin-memmove-13.c new file mode 100644 index 0000000..e21fba3 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/builtin-memmove-13.c @@ -0,0 +1,26 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mno-avx -msse2 -mtune=generic" } */ +/* { dg-add-options check_function_bodies } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target { lp64 } } {^\t?\.} } } */ + +/* +**foo: +**.LFB0: +** .cfi_startproc +** movl a\+3\(%rip\), %eax +** movl %eax, a\(%rip\) +** movzbl a\+7\(%rip\), %eax +** movb %al, a\+4\(%rip\) +** ret +** .cfi_endproc +**... +*/ + +char a[8] = "12345678"; + +void +foo (void) +{ + __builtin_memmove (a, a + 3, sizeof a - 3); +} diff --git a/gcc/testsuite/gcc.target/i386/builtin-memmove-14.c b/gcc/testsuite/gcc.target/i386/builtin-memmove-14.c new file mode 100644 index 0000000..651efa4 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/builtin-memmove-14.c @@ -0,0 +1,91 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mno-avx -msse2 -mtune=generic -minline-all-stringops" } */ +/* { dg-add-options check_function_bodies } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target { lp64 } } {^\t?\.} } } */ + +/* +**gcc_memmove: +**.LFB0: +** .cfi_startproc +** cmpq \$64, %rdx +** jbe .L12 +**.L1: +** ret +** .p2align 4,,10 +** .p2align 3 +**.L12: +** cmpl \$16, %edx +** jnb .L13 +** cmpl \$8, %edx +** jnb .L6 +** cmpl \$4, %edx +** jnb .L7 +** cmpl \$1, %edx +** ja .L8 +** jb .L1 +** movzbl \(%rsi\), %eax +** movb %al, \(%rdi\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L13: +** cmpl \$32, %edx +** ja .L5 +** movl %edx, %edx +** movdqu \(%rsi\), %xmm1 +** movdqu -16\(%rsi,%rdx\), %xmm0 +** movups %xmm1, \(%rdi\) +** movups %xmm0, -16\(%rdi,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L5: +** movl %edx, %edx +** movdqu \(%rsi\), %xmm3 +** movdqu 16\(%rsi\), %xmm2 +** addq %rdx, %rsi +** movdqu -16\(%rsi\), %xmm1 +** movdqu -32\(%rsi\), %xmm0 +** movups %xmm3, \(%rdi\) +** movups %xmm2, 16\(%rdi\) +** movups %xmm1, -16\(%rdi,%rdx\) +** movups %xmm0, -32\(%rdi,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L6: +** movl %edx, %edx +** movq \(%rsi\), %rcx +** movq -8\(%rsi,%rdx\), %rax +** movq %rcx, \(%rdi\) +** movq %rax, -8\(%rdi,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L7: +** movl %edx, %edx +** movl \(%rsi\), %ecx +** movl -4\(%rsi,%rdx\), %eax +** movl %ecx, \(%rdi\) +** movl %eax, -4\(%rdi,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L8: +** movl %edx, %edx +** movzwl \(%rsi\), %ecx +** movzwl -2\(%rsi,%rdx\), %eax +** movw %cx, \(%rdi\) +** movw %ax, -2\(%rdi,%rdx\) +** ret +** .cfi_endproc +**... +*/ + +void +gcc_memmove (void *a, void *b, __SIZE_TYPE__ n) +{ + if (n <= 64) + __builtin_memmove (a, b, n); +} diff --git a/gcc/testsuite/gcc.target/i386/builtin-memmove-15.c b/gcc/testsuite/gcc.target/i386/builtin-memmove-15.c new file mode 100644 index 0000000..5fb833b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/builtin-memmove-15.c @@ -0,0 +1,115 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mno-avx -msse2 -mtune=generic -minline-all-stringops" } */ +/* { dg-add-options check_function_bodies } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target { lp64 } } {^\t?\.} } } */ + +/* +**gcc_memmove: +**.LFB0: +** .cfi_startproc +** cmpq \$66, %rdx +** jbe .L12 +**.L1: +** ret +** .p2align 4,,10 +** .p2align 3 +**.L12: +** cmpl \$16, %edx +** jnb .L13 +** cmpl \$8, %edx +** jnb .L6 +** cmpl \$4, %edx +** jnb .L7 +** cmpl \$1, %edx +** ja .L8 +** jb .L1 +** movzbl \(%rsi\), %eax +** movb %al, \(%rdi\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L13: +** cmpl \$32, %edx +** ja .L5 +** movl %edx, %edx +** movdqu \(%rsi\), %xmm1 +** movdqu -16\(%rsi,%rdx\), %xmm0 +** movups %xmm1, \(%rdi\) +** movups %xmm0, -16\(%rdi,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L5: +** cmpl \$64, %edx +** jnb .L14 +** movl %edx, %edx +** movdqu \(%rsi\), %xmm3 +** movdqu 16\(%rsi\), %xmm2 +** addq %rdx, %rsi +** movdqu -16\(%rsi\), %xmm1 +** movdqu -32\(%rsi\), %xmm0 +** movups %xmm3, \(%rdi\) +** movups %xmm2, 16\(%rdi\) +** movups %xmm1, -16\(%rdi,%rdx\) +** movups %xmm0, -32\(%rdi,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L6: +** movl %edx, %edx +** movq \(%rsi\), %rcx +** movq -8\(%rsi,%rdx\), %rax +** movq %rcx, \(%rdi\) +** movq %rax, -8\(%rdi,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L14: +** movl %edx, %edx +** movdqu \(%rsi\), %xmm7 +** movdqu 16\(%rsi\), %xmm6 +** movdqu 32\(%rsi\), %xmm5 +** movdqu 48\(%rsi\), %xmm4 +** addq %rdx, %rsi +** movdqu -16\(%rsi\), %xmm3 +** movdqu -32\(%rsi\), %xmm2 +** movdqu -48\(%rsi\), %xmm1 +** movdqu -64\(%rsi\), %xmm0 +** movups %xmm7, \(%rdi\) +** movups %xmm6, 16\(%rdi\) +** movups %xmm5, 32\(%rdi\) +** movups %xmm4, 48\(%rdi\) +** movups %xmm3, -16\(%rdi,%rdx\) +** movups %xmm2, -32\(%rdi,%rdx\) +** movups %xmm1, -48\(%rdi,%rdx\) +** movups %xmm0, -64\(%rdi,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L7: +** movl %edx, %edx +** movl \(%rsi\), %ecx +** movl -4\(%rsi,%rdx\), %eax +** movl %ecx, \(%rdi\) +** movl %eax, -4\(%rdi,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L8: +** movl %edx, %edx +** movzwl \(%rsi\), %ecx +** movzwl -2\(%rsi,%rdx\), %eax +** movw %cx, \(%rdi\) +** movw %ax, -2\(%rdi,%rdx\) +** ret +** .cfi_endproc +**... +*/ + +void +gcc_memmove (void *a, void *b, __SIZE_TYPE__ n) +{ + if (n <= 66) + __builtin_memmove (a, b, n); +} diff --git a/gcc/testsuite/gcc.target/i386/builtin-memmove-1a.c b/gcc/testsuite/gcc.target/i386/builtin-memmove-1a.c new file mode 100644 index 0000000..6679c96 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/builtin-memmove-1a.c @@ -0,0 +1,124 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mno-avx -msse2 -mtune=generic -minline-all-stringops" } */ +/* { dg-add-options check_function_bodies } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target { ! ia32 } } {^\t?\.} } } */ + +/* +**memmove7: +**.LFB[0-9]+: +** .cfi_startproc +** movl \(%(?:r|e)si\), %edx +** movl 3\(%(?:r|e)si\), %eax +** movl %edx, \(%(?:r|e)di\) +** movl %eax, 3\(%(?:r|e)di\) +** ret +**... +*/ + +/* +**memmove13: +**.LFB[0-9]+: +** .cfi_startproc +** movq \(%(?:r|e)si\), %rdx +** movq 5\(%(?:r|e)si\), %rax +** movq %rdx, \(%(?:r|e)di\) +** movq %rax, 5\(%(?:r|e)di\) +** ret +**... +*/ + +/* +**memmove31: +**.LFB[0-9]+: +** .cfi_startproc +** movdqu \(%(?:r|e)si\), %xmm1 +** movdqu 15\(%(?:r|e)si\), %xmm0 +** movups %xmm1, \(%(?:r|e)di\) +** movups %xmm0, 15\(%(?:r|e)di\) +** ret +**... +*/ + +/* +**memmove39: +**.LFB[0-9]+: +** .cfi_startproc +** movdqu \(%(?:r|e)si\), %xmm1 +** movdqu 16\(%(?:r|e)si\), %xmm0 +** movq 31\(%(?:r|e)si\), %rax +** movups %xmm0, 16\(%(?:r|e)di\) +** movups %xmm1, \(%(?:r|e)di\) +** movq %rax, 31\(%(?:r|e)di\) +** ret +**... +*/ + +/* +**memmove61: +**.LFB[0-9]+: +** .cfi_startproc +** movdqu \(%(?:r|e)si\), %xmm3 +** movdqu 16\(%(?:r|e)si\), %xmm2 +** movdqu 32\(%(?:r|e)si\), %xmm1 +** movdqu 45\(%(?:r|e)si\), %xmm0 +** movups %xmm3, \(%(?:r|e)di\) +** movups %xmm1, 32\(%(?:r|e)di\) +** movups %xmm2, 16\(%(?:r|e)di\) +** movups %xmm0, 45\(%(?:r|e)di\) +** ret +**... +*/ + +/* +**memmove69: +**.LFB[0-9]+: +** .cfi_startproc +** movdqu \(%(?:r|e)si\), %xmm3 +** movdqu 16\(%(?:r|e)si\), %xmm2 +** movdqu 32\(%(?:r|e)si\), %xmm1 +** movdqu 48\(%(?:r|e)si\), %xmm0 +** movq 61\(%(?:r|e)si\), %rax +** movups %xmm3, \(%(?:r|e)di\) +** movups %xmm0, 48\(%(?:r|e)di\) +** movups %xmm2, 16\(%(?:r|e)di\) +** movq %rax, 61\(%(?:r|e)di\) +** movups %xmm1, 32\(%(?:r|e)di\) +** ret +**... +*/ + +/* +**memmove93: +**.LFB[0-9]+: +** .cfi_startproc +** movdqu \(%(?:r|e)si\), %xmm5 +** movdqu 16\(%(?:r|e)si\), %xmm4 +** movdqu 32\(%(?:r|e)si\), %xmm3 +** movdqu 48\(%(?:r|e)si\), %xmm2 +** movdqu 64\(%(?:r|e)si\), %xmm1 +** movdqu 77\(%(?:r|e)si\), %xmm0 +** movups %xmm5, \(%(?:r|e)di\) +** movups %xmm4, 16\(%(?:r|e)di\) +** movups %xmm1, 64\(%(?:r|e)di\) +** movups %xmm3, 32\(%(?:r|e)di\) +** movups %xmm2, 48\(%(?:r|e)di\) +** movups %xmm0, 77\(%(?:r|e)di\) +** ret +**... +*/ + +#define TEST(n) \ + void \ + memmove##n (void *a, void *b) \ + { \ + __builtin_memmove (a, b, n); \ + } + +TEST (7) +TEST (13) +TEST (31) +TEST (39) +TEST (61) +TEST (69) +TEST (93) diff --git a/gcc/testsuite/gcc.target/i386/builtin-memmove-1b.c b/gcc/testsuite/gcc.target/i386/builtin-memmove-1b.c new file mode 100644 index 0000000..356e939 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/builtin-memmove-1b.c @@ -0,0 +1,99 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mno-avx512f -march=x86-64-v3 -mtune=generic -minline-all-stringops" } */ +/* { dg-add-options check_function_bodies } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target { ! ia32 } } {^\t?\.} } } */ + +/* +**memmove7: +**.LFB[0-9]+: +** .cfi_startproc +** movl \(%(?:r|e)si\), %edx +** movl 3\(%(?:r|e)si\), %eax +** movl %edx, \(%(?:r|e)di\) +** movl %eax, 3\(%(?:r|e)di\) +** ret +**... +*/ + +/* +**memmove13: +**.LFB[0-9]+: +** .cfi_startproc +** movq \(%(?:r|e)si\), %rdx +** movq 5\(%(?:r|e)si\), %rax +** movq %rdx, \(%(?:r|e)di\) +** movq %rax, 5\(%(?:r|e)di\) +** ret +**... +*/ + +/* +**memmove31: +**.LFB[0-9]+: +** .cfi_startproc +** vmovdqu \(%(?:r|e)si\), %xmm1 +** vmovdqu 15\(%(?:r|e)si\), %xmm0 +** vmovdqu %xmm1, \(%(?:r|e)di\) +** vmovdqu %xmm0, 15\(%(?:r|e)di\) +** ret +**... +*/ + +/* +**memmove39: +**.LFB[0-9]+: +** .cfi_startproc +** vmovdqu \(%(?:r|e)si\), %ymm0 +** movq 31\(%(?:r|e)si\), %rax +** vmovdqu %ymm0, \(%(?:r|e)di\) +** movq %rax, 31\(%(?:r|e)di\) +** vzeroupper +** ret +**... +*/ + +/* +**memmove61: +**.LFB[0-9]+: +** .cfi_startproc +** vmovdqu \(%(?:r|e)si\), %ymm1 +** vmovdqu 29\(%(?:r|e)si\), %ymm0 +** vmovdqu %ymm1, \(%(?:r|e)di\) +** vmovdqu %ymm0, 29\(%(?:r|e)di\) +** vzeroupper +** ret +**... +*/ + +/* +**memmove69: +**.LFB[0-9]+: +** .cfi_startproc +** vmovdqu 32\(%(?:r|e)si\), %ymm0 +** movq 61\(%(?:r|e)si\), %rax +** vmovdqu \(%(?:r|e)si\), %ymm1 +** vmovdqu %ymm0, 32\(%(?:r|e)di\) +** movq %rax, 61\(%(?:r|e)di\) +** vmovdqu %ymm1, \(%(?:r|e)di\) +** vzeroupper +** ret +**... +*/ + +/* +**memmove93: +**.LFB[0-9]+: +** .cfi_startproc +** vmovdqu \(%(?:r|e)si\), %ymm2 +** vmovdqu 32\(%(?:r|e)si\), %ymm1 +** vmovdqu 61\(%(?:r|e)si\), %ymm0 +** vmovdqu %ymm1, 32\(%(?:r|e)di\) +** vmovdqu %ymm2, \(%(?:r|e)di\) +** vmovdqu %ymm0, 61\(%(?:r|e)di\) +** vzeroupper +** ret +**... +*/ + +#include "builtin-memmove-1a.c" diff --git a/gcc/testsuite/gcc.target/i386/builtin-memmove-1c.c b/gcc/testsuite/gcc.target/i386/builtin-memmove-1c.c new file mode 100644 index 0000000..b532b59 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/builtin-memmove-1c.c @@ -0,0 +1,95 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -march=x86-64-v4 -mmove-max=512 -mtune=generic -minline-all-stringops" } */ +/* { dg-add-options check_function_bodies } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target { ! ia32 } } {^\t?\.} } } */ + +/* +**memmove7: +**.LFB[0-9]+: +** .cfi_startproc +** movl \(%(?:r|e)si\), %edx +** movl 3\(%(?:r|e)si\), %eax +** movl %edx, \(%(?:r|e)di\) +** movl %eax, 3\(%(?:r|e)di\) +** ret +**... +*/ + +/* +**memmove13: +**.LFB[0-9]+: +** .cfi_startproc +** movq \(%(?:r|e)si\), %rdx +** movq 5\(%(?:r|e)si\), %rax +** movq %rdx, \(%(?:r|e)di\) +** movq %rax, 5\(%(?:r|e)di\) +** ret +**... +*/ + +/* +**memmove31: +**.LFB[0-9]+: +** .cfi_startproc +** vmovdqu \(%(?:r|e)si\), %xmm1 +** vmovdqu 15\(%(?:r|e)si\), %xmm0 +** vmovdqu %xmm1, \(%(?:r|e)di\) +** vmovdqu %xmm0, 15\(%(?:r|e)di\) +** ret +**... +*/ + +/* +**memmove39: +**.LFB[0-9]+: +** .cfi_startproc +** vmovdqu \(%(?:r|e)si\), %ymm0 +** movq 31\(%(?:r|e)si\), %rax +** vmovdqu %ymm0, \(%(?:r|e)di\) +** movq %rax, 31\(%(?:r|e)di\) +** vzeroupper +** ret +**... +*/ + +/* +**memmove61: +**.LFB[0-9]+: +** .cfi_startproc +** vmovdqu \(%(?:r|e)si\), %ymm1 +** vmovdqu 29\(%(?:r|e)si\), %ymm0 +** vmovdqu %ymm1, \(%(?:r|e)di\) +** vmovdqu %ymm0, 29\(%(?:r|e)di\) +** vzeroupper +** ret +**... +*/ + +/* +**memmove69: +**.LFB[0-9]+: +** .cfi_startproc +** vmovdqu64 \(%(?:r|e)si\), %zmm0 +** movq 61\(%(?:r|e)si\), %rax +** vmovdqu64 %zmm0, \(%(?:r|e)di\) +** movq %rax, 61\(%(?:r|e)di\) +** vzeroupper +** ret +**... +*/ + +/* +**memmove93: +**.LFB[0-9]+: +** .cfi_startproc +** vmovdqu64 \(%(?:r|e)si\), %zmm1 +** vmovdqu 61\(%(?:r|e)si\), %ymm0 +** vmovdqu64 %zmm1, \(%(?:r|e)di\) +** vmovdqu %ymm0, 61\(%(?:r|e)di\) +** vzeroupper +** ret +**... +*/ + +#include "builtin-memmove-1a.c" diff --git a/gcc/testsuite/gcc.target/i386/builtin-memmove-1d.c b/gcc/testsuite/gcc.target/i386/builtin-memmove-1d.c new file mode 100644 index 0000000..8ccbb4e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/builtin-memmove-1d.c @@ -0,0 +1,227 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mgeneral-regs-only -march=x86-64 -mtune=generic -minline-all-stringops" } */ +/* { dg-add-options check_function_bodies } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target { lp64 } } {^\t?\.} } } */ + +/* +**memmove7: +**.LFB[0-9]+: +** .cfi_startproc +** movl \(%rsi\), %edx +** movl 3\(%rsi\), %eax +** movl %edx, \(%rdi\) +** movl %eax, 3\(%rdi\) +** ret +**... +*/ + +/* +**memmove13: +**.LFB[0-9]+: +** .cfi_startproc +** movq \(%rsi\), %rdx +** movq 5\(%rsi\), %rax +** movq %rdx, \(%rdi\) +** movq %rax, 5\(%rdi\) +** ret +**... +*/ + +/* +**memmove31: +**.LFB[0-9]+: +** .cfi_startproc +** movq \(%(e|r)si\), %r8 +** movq 8\(%(e|r)si\), %rcx +** movq 16\(%(e|r)si\), %rdx +** movq 23\(%(e|r)si\), %rax +** movq %r8, \(%(e|r)di\) +** movq %rdx, 16\(%(e|r)di\) +** movq %rcx, 8\(%(e|r)di\) +** movq %rax, 23\(%(e|r)di\) +** ret +**... +*/ + +/* +**memmove39: +**.LFB[0-9]+: +** .cfi_startproc +** movq \(%rsi\), %r9 +** movq 8\(%rsi\), %r8 +** movq 16\(%rsi\), %rcx +** movq 24\(%rsi\), %rdx +** movq 31\(%rsi\), %rax +** movq %r9, \(%rdi\) +** movq %rdx, 24\(%rdi\) +** movq %r8, 8\(%rdi\) +** movq %rcx, 16\(%rdi\) +** movq %rax, 31\(%rdi\) +** ret +**... +*/ + +/* +**memmove61: +**.LFB[0-9]+: +** .cfi_startproc +** movq 8\(%rsi\), %r11 +** movq 16\(%rsi\), %r10 +** pushq %rbx +** .cfi_def_cfa_offset 16 +** .cfi_offset 3, -16 +** movq 24\(%rsi\), %r9 +** movq \(%rsi\), %rbx +** movq 32\(%rsi\), %r8 +** movq 40\(%rsi\), %rcx +** movq 48\(%rsi\), %rdx +** movq 53\(%rsi\), %rax +** movq %rbx, \(%rdi\) +** movq %r11, 8\(%rdi\) +** popq %rbx +** .cfi_def_cfa_offset 8 +** movq %rdx, 48\(%rdi\) +** movq %r10, 16\(%rdi\) +** movq %r9, 24\(%rdi\) +** movq %r8, 32\(%rdi\) +** movq %rcx, 40\(%rdi\) +** movq %rax, 53\(%rdi\) +** ret +**... +*/ + +/* +**memmove69: +**.LFB5: +** .cfi_startproc +** movq 16\(%rsi\), %r11 +** movq 24\(%rsi\), %r10 +** pushq %rbp +** .cfi_def_cfa_offset 16 +** .cfi_offset 6, -16 +** movq 32\(%rsi\), %r9 +** movq \(%rsi\), %rbp +** pushq %rbx +** .cfi_def_cfa_offset 24 +** .cfi_offset 3, -24 +** movq 40\(%rsi\), %r8 +** movq 8\(%rsi\), %rbx +** movq 48\(%rsi\), %rcx +** movq 56\(%rsi\), %rdx +** movq 61\(%rsi\), %rax +** movq %rbp, \(%rdi\) +** movq %rbx, 8\(%rdi\) +** popq %rbx +** .cfi_def_cfa_offset 16 +** movq %rdx, 56\(%rdi\) +** popq %rbp +** .cfi_def_cfa_offset 8 +** movq %r11, 16\(%rdi\) +** movq %r10, 24\(%rdi\) +** movq %r9, 32\(%rdi\) +** movq %r8, 40\(%rdi\) +** movq %rcx, 48\(%rdi\) +** movq %rax, 61\(%rdi\) +** ret +**... +*/ + +/* +**memmove93: +**.LFB[0-9]+: +** .cfi_startproc +** sub(l|q) \$24, %(e|r)sp +** .cfi_def_cfa_offset 32 +** mov(l|q) %(e|r)si, %(e|r)ax +** movl \$93, %ecx +** cmp(l|q) %(e|r)di, %(e|r)si +** jb .L14 +** je .L10 +** movq %rbx, \(%(e|r)sp\) +** mov(l|q) %(e|r)di, %(e|r)dx +** movq %r14, 8\(%(e|r)sp\) +** movq %r15, 16\(%(e|r)sp\) +** .cfi_offset 3, -32 +** .cfi_offset 14, -24 +** .cfi_offset 15, -16 +** movq 85\(%(e|r)si\), %r14 +** movq 77\(%(e|r)si\), %r15 +** movq 69\(%(e|r)si\), %r10 +** movq 61\(%(e|r)si\), %r11 +**.L15: +** movq 8\(%(e|r)ax\), %r9 +** movq 16\(%(e|r)ax\), %r8 +** subl \$32, %ecx +** add(l|q) \$32, %(e|r)dx +** movq 24\(%(e|r)ax\), %rsi +** movq \(%(e|r)ax\), %rbx +** add(l|q) \$32, %(e|r)ax +** movq %r9, -24\(%(e|r)dx\) +** movq %rbx, -32\(%(e|r)dx\) +** movq %r8, -16\(%(e|r)dx\) +** movq %rsi, -8\(%(e|r)dx\) +** cmpl \$32, %ecx +** ja .L15 +** movq %r10, 69\(%(e|r)di\) +** movq \(%(e|r)sp\), %rbx +** .cfi_restore 3 +** movq %r11, 61\(%(e|r)di\) +** movq %r14, 85\(%(e|r)di\) +** movq 8\(%(e|r)sp\), %r14 +** .cfi_restore 14 +** movq %r15, 77\(%(e|r)di\) +** movq 16\(%(e|r)sp\), %r15 +** .cfi_restore 15 +**.L10: +** add(l|q) \$24, %(e|r)sp +** .cfi_remember_state +** .cfi_def_cfa_offset 8 +** ret +** .p2align 4,,10 +** .p2align 3 +**.L14: +** .cfi_restore_state +** movq %rbx, \(%(e|r)sp\) +** lea(l|q) 93\(%(e|r)di\), %(e|r)dx +** add(l|q) \$93, %(e|r)ax +** movq %r14, 8\(%(e|r)sp\) +** movq %r15, 16\(%(e|r)sp\) +** .cfi_offset 3, -32 +** .cfi_offset 14, -24 +** .cfi_offset 15, -16 +** movq \(%(e|r)si\), %r14 +** movq 8\(%(e|r)si\), %r15 +** movq 16\(%(e|r)si\), %r10 +** movq 24\(%(e|r)si\), %r11 +**.L16: +** movq -16\(%(e|r)ax\), %r9 +** movq -24\(%(e|r)ax\), %r8 +** subl \$32, %ecx +** sub(l|q) \$32, %(e|r)dx +** movq -32\(%(e|r)ax\), %rsi +** movq -8\(%(e|r)ax\), %rbx +** sub(l|q) \$32, %(e|r)ax +** movq %r9, 16\(%(e|r)dx\) +** movq %rbx, 24\(%(e|r)dx\) +** movq %r8, 8\(%(e|r)dx\) +** movq %rsi, \(%(e|r)dx\) +** cmpl \$32, %ecx +** ja .L16 +** movq %r14, \(%(e|r)di\) +** movq \(%(e|r)sp\), %rbx +** .cfi_restore 3 +** movq %r15, 8\(%(e|r)di\) +** movq 8\(%(e|r)sp\), %r14 +** .cfi_restore 14 +** movq %r10, 16\(%(e|r)di\) +** movq 16\(%(e|r)sp\), %r15 +** .cfi_restore 15 +** movq %r11, 24\(%(e|r)di\) +** add(l|q) \$24, %(e|r)sp +** .cfi_def_cfa_offset 8 +** ret +**... +*/ + +#include "builtin-memmove-1a.c" diff --git a/gcc/testsuite/gcc.target/i386/builtin-memmove-2a.c b/gcc/testsuite/gcc.target/i386/builtin-memmove-2a.c new file mode 100644 index 0000000..903a31c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/builtin-memmove-2a.c @@ -0,0 +1,166 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mno-avx -msse2 -mtune=generic -minline-all-stringops" } */ +/* { dg-add-options check_function_bodies } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target { lp64 } } {^\t?\.} } } */ + +/* +**gcc_memmove_xmm: +**.LFB0: +** .cfi_startproc +** movq %rdi, %rax +** movq %rsi, %rcx +** cmpq \$16, %rdx +** jb .L3 +** cmpq \$32, %rdx +** jbe .L17 +** cmpq \$128, %rdx +** jbe .L18 +** movq %rdx, %rsi +** cmpq %rdi, %rcx +** jb .L11 +** je .L2 +** movdqu -16\(%rcx,%rdx\), %xmm7 +** movdqu -32\(%rcx,%rdx\), %xmm6 +** movdqu -48\(%rcx,%rdx\), %xmm5 +** movdqu -64\(%rcx,%rdx\), %xmm4 +**.L12: +** movdqu \(%rcx\), %xmm3 +** subq \$64, %rsi +** addq \$64, %rdi +** addq \$64, %rcx +** movdqu -48\(%rcx\), %xmm2 +** movdqu -32\(%rcx\), %xmm1 +** movdqu -16\(%rcx\), %xmm0 +** movups %xmm3, -64\(%rdi\) +** movups %xmm2, -48\(%rdi\) +** movups %xmm1, -32\(%rdi\) +** movups %xmm0, -16\(%rdi\) +** cmpq \$64, %rsi +** ja .L12 +** movups %xmm7, -16\(%rax,%rdx\) +** movups %xmm6, -32\(%rax,%rdx\) +** movups %xmm5, -48\(%rax,%rdx\) +** movups %xmm4, -64\(%rax,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L3: +** cmpq \$8, %rdx +** jb .L19 +** movq \(%rsi\), %rdi +** movq -8\(%rsi,%rdx\), %rcx +** movq %rdi, \(%rax\) +** movq %rcx, -8\(%rax,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L19: +** cmpq \$4, %rdx +** jnb .L6 +** cmpq \$1, %rdx +** ja .L7 +** jb .L2 +** movzbl \(%rsi\), %edx +** movb %dl, \(%rdi\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L17: +** movdqu \(%rsi\), %xmm1 +** movdqu -16\(%rsi,%rdx\), %xmm0 +** movups %xmm1, \(%rdi\) +** movups %xmm0, -16\(%rdi,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L18: +** cmpq \$64, %rdx +** jb .L10 +** movdqu \(%rsi\), %xmm7 +** movdqu 16\(%rsi\), %xmm6 +** movdqu 32\(%rsi\), %xmm5 +** movdqu 48\(%rsi\), %xmm4 +** movdqu -16\(%rsi,%rdx\), %xmm3 +** movdqu -32\(%rsi,%rdx\), %xmm2 +** movdqu -48\(%rsi,%rdx\), %xmm1 +** movdqu -64\(%rsi,%rdx\), %xmm0 +** movups %xmm7, \(%rdi\) +** movups %xmm6, 16\(%rdi\) +** movups %xmm5, 32\(%rdi\) +** movups %xmm4, 48\(%rdi\) +** movups %xmm3, -16\(%rdi,%rdx\) +** movups %xmm2, -32\(%rdi,%rdx\) +** movups %xmm1, -48\(%rdi,%rdx\) +** movups %xmm0, -64\(%rdi,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L6: +** movl \(%rsi\), %edi +** movl -4\(%rsi,%rdx\), %ecx +** movl %edi, \(%rax\) +** movl %ecx, -4\(%rax,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L11: +** movdqu \(%rcx\), %xmm7 +** movdqu 16\(%rcx\), %xmm6 +** leaq \(%rdi,%rdx\), %rdi +** movdqu 32\(%rcx\), %xmm5 +** movdqu 48\(%rcx\), %xmm4 +** addq %rdx, %rcx +**.L13: +** movdqu -16\(%rcx\), %xmm3 +** movdqu -32\(%rcx\), %xmm2 +** subq \$64, %rsi +** subq \$64, %rdi +** movdqu -48\(%rcx\), %xmm1 +** movdqu -64\(%rcx\), %xmm0 +** subq \$64, %rcx +** movups %xmm3, 48\(%rdi\) +** movups %xmm2, 32\(%rdi\) +** movups %xmm1, 16\(%rdi\) +** movups %xmm0, \(%rdi\) +** cmpq \$64, %rsi +** ja .L13 +** movups %xmm7, \(%rax\) +** movups %xmm6, 16\(%rax\) +** movups %xmm5, 32\(%rax\) +** movups %xmm4, 48\(%rax\) +**.L2: +** ret +** .p2align 4,,10 +** .p2align 3 +**.L10: +** movdqu \(%rsi\), %xmm3 +** movdqu 16\(%rsi\), %xmm2 +** movdqu -16\(%rsi,%rdx\), %xmm1 +** movdqu -32\(%rsi,%rdx\), %xmm0 +** movups %xmm3, \(%rdi\) +** movups %xmm2, 16\(%rdi\) +** movups %xmm1, -16\(%rdi,%rdx\) +** movups %xmm0, -32\(%rdi,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L7: +** movzwl \(%rsi\), %edi +** movzwl -2\(%rsi,%rdx\), %ecx +** movw %di, \(%rax\) +** movw %cx, -2\(%rax,%rdx\) +** ret +** .cfi_endproc +**... +*/ + +#ifndef gcc_memmove +#define gcc_memmove gcc_memmove_xmm +#endif + +void * +gcc_memmove (void *a, void *b, __SIZE_TYPE__ n) +{ + return __builtin_memmove (a, b, n); +} diff --git a/gcc/testsuite/gcc.target/i386/builtin-memmove-2b.c b/gcc/testsuite/gcc.target/i386/builtin-memmove-2b.c new file mode 100644 index 0000000..ac676d0 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/builtin-memmove-2b.c @@ -0,0 +1,174 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mno-avx512f -march=x86-64-v3 -mtune=generic -minline-all-stringops" } */ +/* { dg-add-options check_function_bodies } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target { lp64 } } {^\t?\.} } } */ + +/* +**gcc_memmove_ymm: +**.LFB0: +** .cfi_startproc +** movq %rdi, %rax +** movq %rsi, %rcx +** cmpq \$32, %rdx +** jb .L3 +** cmpq \$64, %rdx +** jbe .L18 +** cmpq \$256, %rdx +** jbe .L19 +** movq %rdx, %rsi +** cmpq %rdi, %rcx +** jb .L12 +** je .L2 +** vmovdqu -32\(%rcx,%rdx\), %ymm7 +** vmovdqu -64\(%rcx,%rdx\), %ymm6 +** vmovdqu -96\(%rcx,%rdx\), %ymm5 +** vmovdqu -128\(%rcx,%rdx\), %ymm4 +**.L13: +** vmovdqu \(%rcx\), %ymm3 +** addq \$-128, %rsi +** subq \$-128, %rdi +** subq \$-128, %rcx +** vmovdqu -96\(%rcx\), %ymm2 +** vmovdqu -64\(%rcx\), %ymm1 +** vmovdqu -32\(%rcx\), %ymm0 +** vmovdqu %ymm3, -128\(%rdi\) +** vmovdqu %ymm2, -96\(%rdi\) +** vmovdqu %ymm1, -64\(%rdi\) +** vmovdqu %ymm0, -32\(%rdi\) +** cmpq \$128, %rsi +** ja .L13 +** vmovdqu %ymm7, -32\(%rax,%rdx\) +** vmovdqu %ymm6, -64\(%rax,%rdx\) +** vmovdqu %ymm5, -96\(%rax,%rdx\) +** vmovdqu %ymm4, -128\(%rax,%rdx\) +** vzeroupper +** ret +** .p2align 4,,10 +** .p2align 3 +**.L3: +** cmpq \$16, %rdx +** jb .L20 +** vmovdqu \(%rsi\), %xmm1 +** vmovdqu -16\(%rsi,%rdx\), %xmm0 +** vmovdqu %xmm1, \(%rdi\) +** vmovdqu %xmm0, -16\(%rdi,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L20: +** cmpq \$8, %rdx +** jnb .L6 +** cmpq \$4, %rdx +** jnb .L7 +** cmpq \$1, %rdx +** ja .L8 +** jb .L2 +** movzbl \(%rsi\), %edx +** movb %dl, \(%rdi\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L18: +** vmovdqu \(%rsi\), %ymm1 +** vmovdqu -32\(%rsi,%rdx\), %ymm0 +** vmovdqu %ymm1, \(%rdi\) +** vmovdqu %ymm0, -32\(%rdi,%rdx\) +** vzeroupper +** ret +** .p2align 4,,10 +** .p2align 3 +**.L19: +** cmpq \$128, %rdx +** jb .L11 +** vmovdqu \(%rsi\), %ymm7 +** vmovdqu 32\(%rsi\), %ymm6 +** vmovdqu 64\(%rsi\), %ymm5 +** vmovdqu 96\(%rsi\), %ymm4 +** vmovdqu -32\(%rsi,%rdx\), %ymm3 +** vmovdqu -64\(%rsi,%rdx\), %ymm2 +** vmovdqu -96\(%rsi,%rdx\), %ymm1 +** vmovdqu -128\(%rsi,%rdx\), %ymm0 +** vmovdqu %ymm7, \(%rdi\) +** vmovdqu %ymm6, 32\(%rdi\) +** vmovdqu %ymm5, 64\(%rdi\) +** vmovdqu %ymm4, 96\(%rdi\) +** vmovdqu %ymm3, -32\(%rdi,%rdx\) +** vmovdqu %ymm2, -64\(%rdi,%rdx\) +** vmovdqu %ymm1, -96\(%rdi,%rdx\) +** vmovdqu %ymm0, -128\(%rdi,%rdx\) +** vzeroupper +** ret +** .p2align 4,,10 +** .p2align 3 +**.L6: +** movq \(%rsi\), %rdi +** movq -8\(%rsi,%rdx\), %rcx +** movq %rdi, \(%rax\) +** movq %rcx, -8\(%rax,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L12: +** vmovdqu \(%rcx\), %ymm7 +** vmovdqu 32\(%rcx\), %ymm6 +** leaq \(%rdi,%rdx\), %rdi +** vmovdqu 64\(%rcx\), %ymm5 +** vmovdqu 96\(%rcx\), %ymm4 +** addq %rdx, %rcx +**.L14: +** vmovdqu -32\(%rcx\), %ymm3 +** vmovdqu -64\(%rcx\), %ymm2 +** addq \$-128, %rsi +** addq \$-128, %rdi +** vmovdqu -96\(%rcx\), %ymm1 +** vmovdqu -128\(%rcx\), %ymm0 +** addq \$-128, %rcx +** vmovdqu %ymm3, 96\(%rdi\) +** vmovdqu %ymm2, 64\(%rdi\) +** vmovdqu %ymm1, 32\(%rdi\) +** vmovdqu %ymm0, \(%rdi\) +** cmpq \$128, %rsi +** ja .L14 +** vmovdqu %ymm7, \(%rax\) +** vmovdqu %ymm6, 32\(%rax\) +** vmovdqu %ymm5, 64\(%rax\) +** vmovdqu %ymm4, 96\(%rax\) +** vzeroupper +**.L2: +** ret +** .p2align 4,,10 +** .p2align 3 +**.L11: +** vmovdqu \(%rsi\), %ymm3 +** vmovdqu 32\(%rsi\), %ymm2 +** vmovdqu -32\(%rsi,%rdx\), %ymm1 +** vmovdqu -64\(%rsi,%rdx\), %ymm0 +** vmovdqu %ymm3, \(%rdi\) +** vmovdqu %ymm2, 32\(%rdi\) +** vmovdqu %ymm1, -32\(%rdi,%rdx\) +** vmovdqu %ymm0, -64\(%rdi,%rdx\) +** vzeroupper +** ret +** .p2align 4,,10 +** .p2align 3 +**.L7: +** movl \(%rsi\), %edi +** movl -4\(%rsi,%rdx\), %ecx +** movl %edi, \(%rax\) +** movl %ecx, -4\(%rax,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L8: +** movzwl \(%rsi\), %edi +** movzwl -2\(%rsi,%rdx\), %ecx +** movw %di, \(%rax\) +** movw %cx, -2\(%rax,%rdx\) +** ret +** .cfi_endproc +**... +*/ + +#define gcc_memmove gcc_memmove_ymm +#include "builtin-memmove-2a.c" diff --git a/gcc/testsuite/gcc.target/i386/builtin-memmove-2c.c b/gcc/testsuite/gcc.target/i386/builtin-memmove-2c.c new file mode 100644 index 0000000..656986b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/builtin-memmove-2c.c @@ -0,0 +1,185 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -march=x86-64-v4 -mmove-max=512 -mtune=generic -minline-all-stringops" } */ +/* { dg-add-options check_function_bodies } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target { lp64 } } {^\t?\.} } } */ + +/* +**gcc_memmove_zmm: +**.LFB0: +** .cfi_startproc +** movq %rdi, %rax +** movq %rsi, %rcx +** cmpq \$64, %rdx +** jb .L3 +** cmpq \$128, %rdx +** jbe .L19 +** cmpq \$512, %rdx +** jbe .L20 +** movq %rdx, %rsi +** cmpq %rdi, %rcx +** jb .L13 +** je .L2 +** vmovdqu64 -64\(%rcx,%rdx\), %zmm7 +** vmovdqu64 -128\(%rcx,%rdx\), %zmm6 +** vmovdqu64 -192\(%rcx,%rdx\), %zmm5 +** vmovdqu64 -256\(%rcx,%rdx\), %zmm4 +**.L14: +** vmovdqu64 \(%rcx\), %zmm3 +** vmovdqu64 64\(%rcx\), %zmm2 +** subq \$256, %rsi +** addq \$256, %rdi +** vmovdqu64 128\(%rcx\), %zmm1 +** addq \$256, %rcx +** vmovdqu64 -64\(%rcx\), %zmm0 +** vmovdqu64 %zmm3, -256\(%rdi\) +** vmovdqu64 %zmm2, -192\(%rdi\) +** vmovdqu64 %zmm1, -128\(%rdi\) +** vmovdqu64 %zmm0, -64\(%rdi\) +** cmpq \$256, %rsi +** ja .L14 +** vmovdqu64 %zmm7, -64\(%rax,%rdx\) +** vmovdqu64 %zmm6, -128\(%rax,%rdx\) +** vmovdqu64 %zmm5, -192\(%rax,%rdx\) +** vmovdqu64 %zmm4, -256\(%rax,%rdx\) +** vzeroupper +** ret +** .p2align 4,,10 +** .p2align 3 +**.L3: +** cmpq \$32, %rdx +** jb .L21 +** vmovdqu \(%rsi\), %ymm1 +** vmovdqu -32\(%rsi,%rdx\), %ymm0 +** vmovdqu %ymm1, \(%rdi\) +** vmovdqu %ymm0, -32\(%rdi,%rdx\) +** vzeroupper +** ret +** .p2align 4,,10 +** .p2align 3 +**.L21: +** cmpq \$16, %rdx +** jnb .L6 +** cmpq \$8, %rdx +** jnb .L7 +** cmpq \$4, %rdx +** jnb .L8 +** cmpq \$1, %rdx +** ja .L9 +** jb .L2 +** movzbl \(%rsi\), %edx +** movb %dl, \(%rdi\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L19: +** vmovdqu64 \(%rsi\), %zmm1 +** vmovdqu64 -64\(%rsi,%rdx\), %zmm0 +** vmovdqu64 %zmm1, \(%rdi\) +** vmovdqu64 %zmm0, -64\(%rdi,%rdx\) +** vzeroupper +** ret +** .p2align 4,,10 +** .p2align 3 +**.L20: +** cmpq \$256, %rdx +** jb .L12 +** vmovdqu64 \(%rsi\), %zmm7 +** vmovdqu64 64\(%rsi\), %zmm6 +** vmovdqu64 -64\(%rsi,%rdx\), %zmm3 +** vmovdqu64 -128\(%rsi,%rdx\), %zmm2 +** vmovdqu64 128\(%rsi\), %zmm5 +** vmovdqu64 192\(%rsi\), %zmm4 +** vmovdqu64 -192\(%rsi,%rdx\), %zmm1 +** vmovdqu64 -256\(%rsi,%rdx\), %zmm0 +** vmovdqu64 %zmm7, \(%rdi\) +** vmovdqu64 %zmm6, 64\(%rdi\) +** vmovdqu64 %zmm5, 128\(%rdi\) +** vmovdqu64 %zmm4, 192\(%rdi\) +** vmovdqu64 %zmm3, -64\(%rdi,%rdx\) +** vmovdqu64 %zmm2, -128\(%rdi,%rdx\) +** vmovdqu64 %zmm1, -192\(%rdi,%rdx\) +** vmovdqu64 %zmm0, -256\(%rdi,%rdx\) +** vzeroupper +** ret +** .p2align 4,,10 +** .p2align 3 +**.L6: +** vmovdqu \(%rsi\), %xmm1 +** vmovdqu -16\(%rsi,%rdx\), %xmm0 +** vmovdqu %xmm1, \(%rdi\) +** vmovdqu %xmm0, -16\(%rdi,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L13: +** vmovdqu64 \(%rcx\), %zmm7 +** leaq \(%rdi,%rdx\), %rdi +** vmovdqu64 64\(%rcx\), %zmm6 +** vmovdqu64 128\(%rcx\), %zmm5 +** vmovdqu64 192\(%rcx\), %zmm4 +** addq %rdx, %rcx +**.L15: +** vmovdqu64 -64\(%rcx\), %zmm3 +** vmovdqu64 -128\(%rcx\), %zmm2 +** subq \$256, %rsi +** subq \$256, %rdi +** vmovdqu64 -192\(%rcx\), %zmm1 +** subq \$256, %rcx +** vmovdqu64 \(%rcx\), %zmm0 +** vmovdqu64 %zmm3, 192\(%rdi\) +** vmovdqu64 %zmm2, 128\(%rdi\) +** vmovdqu64 %zmm1, 64\(%rdi\) +** vmovdqu64 %zmm0, \(%rdi\) +** cmpq \$256, %rsi +** ja .L15 +** vmovdqu64 %zmm7, \(%rax\) +** vmovdqu64 %zmm6, 64\(%rax\) +** vmovdqu64 %zmm5, 128\(%rax\) +** vmovdqu64 %zmm4, 192\(%rax\) +** vzeroupper +**.L2: +** ret +** .p2align 4,,10 +** .p2align 3 +**.L12: +** vmovdqu64 \(%rsi\), %zmm3 +** vmovdqu64 64\(%rsi\), %zmm2 +** vmovdqu64 -64\(%rsi,%rdx\), %zmm1 +** vmovdqu64 -128\(%rsi,%rdx\), %zmm0 +** vmovdqu64 %zmm3, \(%rdi\) +** vmovdqu64 %zmm2, 64\(%rdi\) +** vmovdqu64 %zmm1, -64\(%rdi,%rdx\) +** vmovdqu64 %zmm0, -128\(%rdi,%rdx\) +** vzeroupper +** ret +** .p2align 4,,10 +** .p2align 3 +**.L7: +** movq \(%rsi\), %rdi +** movq -8\(%rsi,%rdx\), %rcx +** movq %rdi, \(%rax\) +** movq %rcx, -8\(%rax,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L8: +** movl \(%rsi\), %edi +** movl -4\(%rsi,%rdx\), %ecx +** movl %edi, \(%rax\) +** movl %ecx, -4\(%rax,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L9: +** movzwl \(%rsi\), %edi +** movzwl -2\(%rsi,%rdx\), %ecx +** movw %di, \(%rax\) +** movw %cx, -2\(%rax,%rdx\) +** ret +** .cfi_endproc +**... +*/ + +#define gcc_memmove gcc_memmove_zmm +#include "builtin-memmove-2a.c" diff --git a/gcc/testsuite/gcc.target/i386/builtin-memmove-2d.c b/gcc/testsuite/gcc.target/i386/builtin-memmove-2d.c new file mode 100644 index 0000000..324de74 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/builtin-memmove-2d.c @@ -0,0 +1,196 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mgeneral-regs-only -march=x86-64 -mtune=generic -minline-all-stringops" } */ +/* { dg-add-options check_function_bodies } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target { lp64 } } {^\t?\.} } } */ + +/* +**gcc_memmove_gpr: +**.LFB0: +** .cfi_startproc +** movq %rdi, %rax +** cmpq \$8, %rdx +** jb .L3 +** cmpq \$16, %rdx +** jbe .L19 +** subq \$32, %rsp +** .cfi_def_cfa_offset 40 +** cmpq \$64, %rdx +** jbe .L20 +** movq %rsi, %rcx +** movq %rdx, %rsi +** cmpq %rdi, %rcx +** jb .L10 +** je .L2 +** movq %rbx, \(%rsp\) +** movq %rbp, 8\(%rsp\) +** movq %r14, 16\(%rsp\) +** movq %r15, 24\(%rsp\) +** .cfi_offset 3, -40 +** .cfi_offset 6, -32 +** .cfi_offset 14, -24 +** .cfi_offset 15, -16 +** movq -8\(%rcx,%rdx\), %r15 +** movq -16\(%rcx,%rdx\), %r14 +** movq -24\(%rcx,%rdx\), %rbp +** movq -32\(%rcx,%rdx\), %r11 +**.L11: +** movq 8\(%rcx\), %r10 +** movq 16\(%rcx\), %r9 +** subq \$32, %rsi +** addq \$32, %rdi +** movq 24\(%rcx\), %r8 +** movq \(%rcx\), %rbx +** addq \$32, %rcx +** movq %r10, -24\(%rdi\) +** movq %rbx, -32\(%rdi\) +** movq %r9, -16\(%rdi\) +** movq %r8, -8\(%rdi\) +** cmpq \$32, %rsi +** ja .L11 +** movq %r15, -8\(%rax,%rdx\) +** movq %r14, -16\(%rax,%rdx\) +** movq %rbp, -24\(%rax,%rdx\) +** movq %r11, -32\(%rax,%rdx\) +** movq \(%rsp\), %rbx +** .cfi_restore 3 +** movq 8\(%rsp\), %rbp +** .cfi_restore 6 +** movq 16\(%rsp\), %r14 +** .cfi_restore 14 +** movq 24\(%rsp\), %r15 +** .cfi_restore 15 +** jmp .L2 +** .p2align 4,,10 +** .p2align 3 +**.L3: +** .cfi_def_cfa_offset 8 +** cmpq \$4, %rdx +** jb .L21 +** movl \(%rsi\), %edi +** movl -4\(%rsi,%rdx\), %ecx +** movl %edi, \(%rax\) +** movl %ecx, -4\(%rax,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L21: +** cmpq \$1, %rdx +** ja .L6 +** jb .L16 +** movzbl \(%rsi\), %edx +** movb %dl, \(%rdi\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L19: +** movq \(%rsi\), %rdi +** movq -8\(%rsi,%rdx\), %rcx +** movq %rdi, \(%rax\) +** movq %rcx, -8\(%rax,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L20: +** .cfi_def_cfa_offset 40 +** cmpq \$32, %rdx +** jb .L9 +** movq %rbx, \(%rsp\) +** movq %r14, 16\(%rsp\) +** .cfi_offset 3, -40 +** .cfi_offset 14, -24 +** movq \(%rsi\), %rbx +** movq 8\(%rsi\), %r14 +** movq 16\(%rsi\), %r11 +** movq 24\(%rsi\), %r10 +** movq -8\(%rsi,%rdx\), %r9 +** movq -16\(%rsi,%rdx\), %r8 +** movq -24\(%rsi,%rdx\), %rdi +** movq -32\(%rsi,%rdx\), %rcx +** movq %rbx, \(%rax\) +** movq %r14, 8\(%rax\) +** movq %r11, 16\(%rax\) +** movq %r10, 24\(%rax\) +** movq %r9, -8\(%rax,%rdx\) +** movq %r8, -16\(%rax,%rdx\) +** movq %rdi, -24\(%rax,%rdx\) +** movq %rcx, -32\(%rax,%rdx\) +** movq \(%rsp\), %rbx +** .cfi_restore 3 +** movq 16\(%rsp\), %r14 +** .cfi_restore 14 +**.L2: +** addq \$32, %rsp +** .cfi_def_cfa_offset 8 +** ret +** .p2align 4,,10 +** .p2align 3 +**.L6: +** movzwl \(%rsi\), %edi +** movzwl -2\(%rsi,%rdx\), %ecx +** movw %di, \(%rax\) +** movw %cx, -2\(%rax,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L16: +** ret +** .p2align 4,,10 +** .p2align 3 +**.L9: +** .cfi_def_cfa_offset 40 +** movq \(%rsi\), %r9 +** movq 8\(%rsi\), %r8 +** movq -8\(%rsi,%rdx\), %rdi +** movq -16\(%rsi,%rdx\), %rcx +** movq %r9, \(%rax\) +** movq %r8, 8\(%rax\) +** movq %rdi, -8\(%rax,%rdx\) +** movq %rcx, -16\(%rax,%rdx\) +** jmp .L2 +** .p2align 4,,10 +** .p2align 3 +**.L10: +** movq %rbx, \(%rsp\) +** leaq \(%rdi,%rdx\), %rdi +** movq %r14, 16\(%rsp\) +** movq %r15, 24\(%rsp\) +** .cfi_offset 3, -40 +** .cfi_offset 14, -24 +** .cfi_offset 15, -16 +** movq \(%rcx\), %r14 +** movq 8\(%rcx\), %r15 +** movq 16\(%rcx\), %r10 +** movq 24\(%rcx\), %r11 +** addq %rdx, %rcx +**.L12: +** movq -16\(%rcx\), %r9 +** movq -24\(%rcx\), %r8 +** subq \$32, %rsi +** subq \$32, %rdi +** movq -32\(%rcx\), %rdx +** movq -8\(%rcx\), %rbx +** subq \$32, %rcx +** movq %r9, 16\(%rdi\) +** movq %rbx, 24\(%rdi\) +** movq %r8, 8\(%rdi\) +** movq %rdx, \(%rdi\) +** cmpq \$32, %rsi +** ja .L12 +** movq %r14, \(%rax\) +** movq \(%rsp\), %rbx +** .cfi_restore 3 +** movq %r15, 8\(%rax\) +** movq 16\(%rsp\), %r14 +** .cfi_restore 14 +** movq %r10, 16\(%rax\) +** movq 24\(%rsp\), %r15 +** .cfi_restore 15 +** movq %r11, 24\(%rax\) +** jmp .L2 +** .cfi_endproc +**... +*/ + +#define gcc_memmove gcc_memmove_gpr +#include "builtin-memmove-2a.c" diff --git a/gcc/testsuite/gcc.target/i386/builtin-memmove-3a.c b/gcc/testsuite/gcc.target/i386/builtin-memmove-3a.c new file mode 100644 index 0000000..cddfd49 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/builtin-memmove-3a.c @@ -0,0 +1,134 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mno-avx -msse2 -mtune=generic -minline-all-stringops" } */ +/* { dg-add-options check_function_bodies } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target { lp64 } } {^\t?\.} } } */ + +/* +**gcc_memmove_xmm: +**.LFB0: +** .cfi_startproc +** cmpq \$16, %rdx +** ja .L13 +**.L1: +** ret +** .p2align 4,,10 +** .p2align 3 +**.L13: +** movq %rdi, %rcx +** movq %rsi, %rax +** cmpq \$32, %rdx +** jbe .L14 +** cmpq \$128, %rdx +** ja .L5 +** cmpq \$64, %rdx +** jnb .L15 +** movdqu \(%rsi\), %xmm3 +** movdqu 16\(%rsi\), %xmm2 +** movdqu -16\(%rsi,%rdx\), %xmm1 +** movdqu -32\(%rsi,%rdx\), %xmm0 +** movups %xmm3, \(%rdi\) +** movups %xmm2, 16\(%rdi\) +** movups %xmm1, -16\(%rdi,%rdx\) +** movups %xmm0, -32\(%rdi,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L14: +** movdqu \(%rsi\), %xmm1 +** movdqu -16\(%rsi,%rdx\), %xmm0 +** movups %xmm1, \(%rdi\) +** movups %xmm0, -16\(%rdi,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L5: +** movq %rdx, %rsi +** cmpq %rdi, %rax +** jb .L7 +** je .L1 +** movdqu -16\(%rax,%rdx\), %xmm7 +** movdqu -32\(%rax,%rdx\), %xmm6 +** movdqu -48\(%rax,%rdx\), %xmm5 +** movdqu -64\(%rax,%rdx\), %xmm4 +**.L8: +** movdqu \(%rax\), %xmm3 +** subq \$64, %rsi +** addq \$64, %rcx +** addq \$64, %rax +** movdqu -48\(%rax\), %xmm2 +** movdqu -32\(%rax\), %xmm1 +** movdqu -16\(%rax\), %xmm0 +** movups %xmm3, -64\(%rcx\) +** movups %xmm2, -48\(%rcx\) +** movups %xmm1, -32\(%rcx\) +** movups %xmm0, -16\(%rcx\) +** cmpq \$64, %rsi +** ja .L8 +** movups %xmm7, -16\(%rdi,%rdx\) +** movups %xmm6, -32\(%rdi,%rdx\) +** movups %xmm5, -48\(%rdi,%rdx\) +** movups %xmm4, -64\(%rdi,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L7: +** movdqu \(%rax\), %xmm3 +** movdqu 16\(%rax\), %xmm2 +** leaq \(%rdi,%rdx\), %rcx +** movdqu 32\(%rax\), %xmm1 +** movdqu 48\(%rax\), %xmm0 +** addq %rdx, %rax +**.L9: +** movdqu -16\(%rax\), %xmm7 +** movdqu -32\(%rax\), %xmm6 +** subq \$64, %rsi +** subq \$64, %rcx +** movdqu -48\(%rax\), %xmm5 +** movdqu -64\(%rax\), %xmm4 +** subq \$64, %rax +** movups %xmm7, 48\(%rcx\) +** movups %xmm6, 32\(%rcx\) +** movups %xmm5, 16\(%rcx\) +** movups %xmm4, \(%rcx\) +** cmpq \$64, %rsi +** ja .L9 +** movups %xmm3, \(%rdi\) +** movups %xmm2, 16\(%rdi\) +** movups %xmm1, 32\(%rdi\) +** movups %xmm0, 48\(%rdi\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L15: +** movdqu \(%rsi\), %xmm7 +** movdqu 16\(%rsi\), %xmm6 +** movdqu 32\(%rsi\), %xmm5 +** movdqu 48\(%rsi\), %xmm4 +** movdqu -16\(%rsi,%rdx\), %xmm3 +** movdqu -32\(%rsi,%rdx\), %xmm2 +** movdqu -48\(%rsi,%rdx\), %xmm1 +** movdqu -64\(%rsi,%rdx\), %xmm0 +** movups %xmm7, \(%rdi\) +** movups %xmm6, 16\(%rdi\) +** movups %xmm5, 32\(%rdi\) +** movups %xmm4, 48\(%rdi\) +** movups %xmm3, -16\(%rdi,%rdx\) +** movups %xmm2, -32\(%rdi,%rdx\) +** movups %xmm1, -48\(%rdi,%rdx\) +** movups %xmm0, -64\(%rdi,%rdx\) +** ret +** .cfi_endproc +**... +*/ + +#ifndef gcc_memmove +#define gcc_memmove gcc_memmove_xmm +#endif + +void +gcc_memmove (void *a, void *b, __SIZE_TYPE__ n) +{ + if (n > 16) + __builtin_memmove (a, b, n); +} diff --git a/gcc/testsuite/gcc.target/i386/builtin-memmove-3b.c b/gcc/testsuite/gcc.target/i386/builtin-memmove-3b.c new file mode 100644 index 0000000..eda5e74 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/builtin-memmove-3b.c @@ -0,0 +1,141 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mno-avx512f -march=x86-64-v3 -mtune=generic -minline-all-stringops" } */ +/* { dg-add-options check_function_bodies } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target { lp64 } } {^\t?\.} } } */ + +/* +**gcc_memmove_ymm: +**.LFB0: +** .cfi_startproc +** cmpq \$16, %rdx +** ja .L16 +**.L14: +** ret +** .p2align 4,,10 +** .p2align 3 +**.L16: +** movq %rdi, %rcx +** movq %rsi, %rax +** cmpq \$32, %rdx +** jb .L6 +** cmpq \$64, %rdx +** ja .L5 +** vmovdqu \(%rsi\), %ymm1 +** vmovdqu -32\(%rsi,%rdx\), %ymm0 +** vmovdqu %ymm1, \(%rdi\) +** vmovdqu %ymm0, -32\(%rdi,%rdx\) +** vzeroupper +** ret +** .p2align 4,,10 +** .p2align 3 +**.L6: +** vmovdqu \(%rsi\), %xmm1 +** vmovdqu -16\(%rsi,%rdx\), %xmm0 +** vmovdqu %xmm1, \(%rdi\) +** vmovdqu %xmm0, -16\(%rdi,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L5: +** cmpq \$256, %rdx +** jbe .L17 +** movq %rdx, %rsi +** cmpq %rdi, %rax +** jb .L9 +** je .L14 +** vmovdqu -32\(%rax,%rdx\), %ymm7 +** vmovdqu -64\(%rax,%rdx\), %ymm6 +** vmovdqu -96\(%rax,%rdx\), %ymm5 +** vmovdqu -128\(%rax,%rdx\), %ymm4 +**.L10: +** vmovdqu \(%rax\), %ymm3 +** addq \$-128, %rsi +** subq \$-128, %rcx +** subq \$-128, %rax +** vmovdqu -96\(%rax\), %ymm2 +** vmovdqu -64\(%rax\), %ymm1 +** vmovdqu -32\(%rax\), %ymm0 +** vmovdqu %ymm3, -128\(%rcx\) +** vmovdqu %ymm2, -96\(%rcx\) +** vmovdqu %ymm1, -64\(%rcx\) +** vmovdqu %ymm0, -32\(%rcx\) +** cmpq \$128, %rsi +** ja .L10 +** vmovdqu %ymm7, -32\(%rdi,%rdx\) +** vmovdqu %ymm6, -64\(%rdi,%rdx\) +** vmovdqu %ymm5, -96\(%rdi,%rdx\) +** vmovdqu %ymm4, -128\(%rdi,%rdx\) +** vzeroupper +** ret +** .p2align 4,,10 +** .p2align 3 +**.L17: +** cmpq \$128, %rdx +** jb .L8 +** vmovdqu \(%rsi\), %ymm7 +** vmovdqu 32\(%rsi\), %ymm6 +** vmovdqu 64\(%rsi\), %ymm5 +** vmovdqu 96\(%rsi\), %ymm4 +** vmovdqu -32\(%rsi,%rdx\), %ymm3 +** vmovdqu -64\(%rsi,%rdx\), %ymm2 +** vmovdqu -96\(%rsi,%rdx\), %ymm1 +** vmovdqu -128\(%rsi,%rdx\), %ymm0 +** vmovdqu %ymm7, \(%rdi\) +** vmovdqu %ymm6, 32\(%rdi\) +** vmovdqu %ymm5, 64\(%rdi\) +** vmovdqu %ymm4, 96\(%rdi\) +** vmovdqu %ymm3, -32\(%rdi,%rdx\) +** vmovdqu %ymm2, -64\(%rdi,%rdx\) +** vmovdqu %ymm1, -96\(%rdi,%rdx\) +** vmovdqu %ymm0, -128\(%rdi,%rdx\) +** vzeroupper +** ret +** .p2align 4,,10 +** .p2align 3 +**.L8: +** vmovdqu \(%rsi\), %ymm3 +** vmovdqu 32\(%rsi\), %ymm2 +** vmovdqu -32\(%rsi,%rdx\), %ymm1 +** vmovdqu -64\(%rsi,%rdx\), %ymm0 +** vmovdqu %ymm3, \(%rdi\) +** vmovdqu %ymm2, 32\(%rdi\) +** vmovdqu %ymm1, -32\(%rdi,%rdx\) +** vmovdqu %ymm0, -64\(%rdi,%rdx\) +** vzeroupper +** ret +** .p2align 4,,10 +** .p2align 3 +**.L9: +** vmovdqu \(%rax\), %ymm3 +** vmovdqu 32\(%rax\), %ymm2 +** leaq \(%rdi,%rdx\), %rcx +** vmovdqu 64\(%rax\), %ymm1 +** vmovdqu 96\(%rax\), %ymm0 +** addq %rdx, %rax +**.L11: +** vmovdqu -32\(%rax\), %ymm7 +** vmovdqu -64\(%rax\), %ymm6 +** addq \$-128, %rsi +** addq \$-128, %rcx +** vmovdqu -96\(%rax\), %ymm5 +** vmovdqu -128\(%rax\), %ymm4 +** addq \$-128, %rax +** vmovdqu %ymm7, 96\(%rcx\) +** vmovdqu %ymm6, 64\(%rcx\) +** vmovdqu %ymm5, 32\(%rcx\) +** vmovdqu %ymm4, \(%rcx\) +** cmpq \$128, %rsi +** ja .L11 +** vmovdqu %ymm3, \(%rdi\) +** vmovdqu %ymm2, 32\(%rdi\) +** vmovdqu %ymm1, 64\(%rdi\) +** vmovdqu %ymm0, 96\(%rdi\) +** vzeroupper +** ret +** .cfi_endproc +**... +*/ + +#define gcc_memmove gcc_memmove_ymm +#include "builtin-memmove-3a.c" diff --git a/gcc/testsuite/gcc.target/i386/builtin-memmove-3c.c b/gcc/testsuite/gcc.target/i386/builtin-memmove-3c.c new file mode 100644 index 0000000..50fac7e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/builtin-memmove-3c.c @@ -0,0 +1,152 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -march=x86-64-v4 -mmove-max=512 -mtune=generic -minline-all-stringops" } */ +/* { dg-add-options check_function_bodies } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target { lp64 } } {^\t?\.} } } */ + +/* +**gcc_memmove_zmm: +**.LFB0: +** .cfi_startproc +** cmpq \$16, %rdx +** ja .L18 +**.L16: +** ret +** .p2align 4,,10 +** .p2align 3 +**.L18: +** movq %rdi, %rcx +** movq %rsi, %rax +** cmpq \$64, %rdx +** jnb .L19 +** cmpq \$32, %rdx +** jb .L15 +** vmovdqu \(%rsi\), %ymm1 +** vmovdqu -32\(%rsi,%rdx\), %ymm0 +** vmovdqu %ymm1, \(%rdi\) +** vmovdqu %ymm0, -32\(%rdi,%rdx\) +** vzeroupper +** ret +** .p2align 4,,10 +** .p2align 3 +**.L19: +** cmpq \$128, %rdx +** ja .L5 +** vmovdqu64 \(%rsi\), %zmm1 +** vmovdqu64 -64\(%rsi,%rdx\), %zmm0 +** vmovdqu64 %zmm1, \(%rdi\) +** vmovdqu64 %zmm0, -64\(%rdi,%rdx\) +** vzeroupper +** ret +** .p2align 4,,10 +** .p2align 3 +**.L5: +** cmpq \$512, %rdx +** jbe .L20 +** movq %rdx, %rsi +** cmpq %rdi, %rax +** jb .L10 +** je .L16 +** vmovdqu64 -64\(%rax,%rdx\), %zmm7 +** vmovdqu64 -128\(%rax,%rdx\), %zmm6 +** vmovdqu64 -192\(%rax,%rdx\), %zmm5 +** vmovdqu64 -256\(%rax,%rdx\), %zmm4 +**.L11: +** vmovdqu64 \(%rax\), %zmm3 +** addq \$256, %rax +** vmovdqu64 -192\(%rax\), %zmm2 +** subq \$256, %rsi +** vmovdqu64 -128\(%rax\), %zmm1 +** vmovdqu64 -64\(%rax\), %zmm0 +** addq \$256, %rcx +** vmovdqu64 %zmm3, -256\(%rcx\) +** vmovdqu64 %zmm2, -192\(%rcx\) +** vmovdqu64 %zmm1, -128\(%rcx\) +** vmovdqu64 %zmm0, -64\(%rcx\) +** cmpq \$256, %rsi +** ja .L11 +** vmovdqu64 %zmm7, -64\(%rdi,%rdx\) +** vmovdqu64 %zmm6, -128\(%rdi,%rdx\) +** vmovdqu64 %zmm5, -192\(%rdi,%rdx\) +** vmovdqu64 %zmm4, -256\(%rdi,%rdx\) +** vzeroupper +** ret +** .p2align 4,,10 +** .p2align 3 +**.L15: +** vmovdqu \(%rsi\), %xmm1 +** vmovdqu -16\(%rsi,%rdx\), %xmm0 +** vmovdqu %xmm1, \(%rdi\) +** vmovdqu %xmm0, -16\(%rdi,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L20: +** cmpq \$256, %rdx +** jb .L9 +** vmovdqu64 \(%rsi\), %zmm7 +** vmovdqu64 64\(%rsi\), %zmm6 +** vmovdqu64 -64\(%rsi,%rdx\), %zmm3 +** vmovdqu64 -128\(%rsi,%rdx\), %zmm2 +** vmovdqu64 128\(%rsi\), %zmm5 +** vmovdqu64 192\(%rsi\), %zmm4 +** vmovdqu64 -192\(%rsi,%rdx\), %zmm1 +** vmovdqu64 -256\(%rsi,%rdx\), %zmm0 +** vmovdqu64 %zmm7, \(%rdi\) +** vmovdqu64 %zmm6, 64\(%rdi\) +** vmovdqu64 %zmm5, 128\(%rdi\) +** vmovdqu64 %zmm4, 192\(%rdi\) +** vmovdqu64 %zmm3, -64\(%rdi,%rdx\) +** vmovdqu64 %zmm2, -128\(%rdi,%rdx\) +** vmovdqu64 %zmm1, -192\(%rdi,%rdx\) +** vmovdqu64 %zmm0, -256\(%rdi,%rdx\) +** vzeroupper +** ret +** .p2align 4,,10 +** .p2align 3 +**.L9: +** vmovdqu64 \(%rsi\), %zmm3 +** vmovdqu64 64\(%rsi\), %zmm2 +** vmovdqu64 -64\(%rsi,%rdx\), %zmm1 +** vmovdqu64 -128\(%rsi,%rdx\), %zmm0 +** vmovdqu64 %zmm3, \(%rdi\) +** vmovdqu64 %zmm2, 64\(%rdi\) +** vmovdqu64 %zmm1, -64\(%rdi,%rdx\) +** vmovdqu64 %zmm0, -128\(%rdi,%rdx\) +** vzeroupper +** ret +** .p2align 4,,10 +** .p2align 3 +**.L10: +** vmovdqu64 \(%rax\), %zmm3 +** leaq \(%rdi,%rdx\), %rcx +** vmovdqu64 64\(%rax\), %zmm2 +** vmovdqu64 128\(%rax\), %zmm1 +** vmovdqu64 192\(%rax\), %zmm0 +** addq %rdx, %rax +**.L12: +** vmovdqu64 -64\(%rax\), %zmm7 +** subq \$256, %rax +** vmovdqu64 128\(%rax\), %zmm6 +** subq \$256, %rsi +** vmovdqu64 64\(%rax\), %zmm5 +** vmovdqu64 \(%rax\), %zmm4 +** subq \$256, %rcx +** vmovdqu64 %zmm7, 192\(%rcx\) +** vmovdqu64 %zmm6, 128\(%rcx\) +** vmovdqu64 %zmm5, 64\(%rcx\) +** vmovdqu64 %zmm4, \(%rcx\) +** cmpq \$256, %rsi +** ja .L12 +** vmovdqu64 %zmm3, \(%rdi\) +** vmovdqu64 %zmm2, 64\(%rdi\) +** vmovdqu64 %zmm1, 128\(%rdi\) +** vmovdqu64 %zmm0, 192\(%rdi\) +** vzeroupper +** ret +** .cfi_endproc +**... +*/ + +#define gcc_memmove gcc_memmove_zmm +#include "builtin-memmove-3a.c" diff --git a/gcc/testsuite/gcc.target/i386/builtin-memmove-4a.c b/gcc/testsuite/gcc.target/i386/builtin-memmove-4a.c new file mode 100644 index 0000000..49b8447 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/builtin-memmove-4a.c @@ -0,0 +1,124 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mno-avx -msse2 -mtune=generic -minline-all-stringops" } */ +/* { dg-add-options check_function_bodies } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target { lp64 } } {^\t?\.} } } */ + +/* +**gcc_memmove_xmm: +**.LFB0: +** .cfi_startproc +** cmpq \$32, %rdx +** ja .L13 +**.L1: +** ret +** .p2align 4,,10 +** .p2align 3 +**.L13: +** movq %rdi, %rcx +** movq %rsi, %rax +** cmpq \$128, %rdx +** jbe .L14 +** movq %rdx, %rsi +** cmpq %rdi, %rax +** jb .L7 +** je .L1 +** movdqu -16\(%rax,%rdx\), %xmm7 +** movdqu -32\(%rax,%rdx\), %xmm6 +** movdqu -48\(%rax,%rdx\), %xmm5 +** movdqu -64\(%rax,%rdx\), %xmm4 +**.L8: +** movdqu \(%rax\), %xmm3 +** subq \$64, %rsi +** addq \$64, %rcx +** addq \$64, %rax +** movdqu -48\(%rax\), %xmm2 +** movdqu -32\(%rax\), %xmm1 +** movdqu -16\(%rax\), %xmm0 +** movups %xmm3, -64\(%rcx\) +** movups %xmm2, -48\(%rcx\) +** movups %xmm1, -32\(%rcx\) +** movups %xmm0, -16\(%rcx\) +** cmpq \$64, %rsi +** ja .L8 +** movups %xmm7, -16\(%rdi,%rdx\) +** movups %xmm6, -32\(%rdi,%rdx\) +** movups %xmm5, -48\(%rdi,%rdx\) +** movups %xmm4, -64\(%rdi,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L14: +** cmpq \$64, %rdx +** jb .L6 +** movdqu \(%rsi\), %xmm7 +** movdqu 16\(%rsi\), %xmm6 +** movdqu 32\(%rsi\), %xmm5 +** movdqu 48\(%rsi\), %xmm4 +** movdqu -16\(%rsi,%rdx\), %xmm3 +** movdqu -32\(%rsi,%rdx\), %xmm2 +** movdqu -48\(%rsi,%rdx\), %xmm1 +** movdqu -64\(%rsi,%rdx\), %xmm0 +** movups %xmm7, \(%rdi\) +** movups %xmm6, 16\(%rdi\) +** movups %xmm5, 32\(%rdi\) +** movups %xmm4, 48\(%rdi\) +** movups %xmm3, -16\(%rdi,%rdx\) +** movups %xmm2, -32\(%rdi,%rdx\) +** movups %xmm1, -48\(%rdi,%rdx\) +** movups %xmm0, -64\(%rdi,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L6: +** movdqu \(%rsi\), %xmm3 +** movdqu 16\(%rsi\), %xmm2 +** movdqu -16\(%rsi,%rdx\), %xmm1 +** movdqu -32\(%rsi,%rdx\), %xmm0 +** movups %xmm3, \(%rdi\) +** movups %xmm2, 16\(%rdi\) +** movups %xmm1, -16\(%rdi,%rdx\) +** movups %xmm0, -32\(%rdi,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L7: +** movdqu \(%rax\), %xmm3 +** movdqu 16\(%rax\), %xmm2 +** leaq \(%rdi,%rdx\), %rcx +** movdqu 32\(%rax\), %xmm1 +** movdqu 48\(%rax\), %xmm0 +** addq %rdx, %rax +**.L9: +** movdqu -16\(%rax\), %xmm7 +** movdqu -32\(%rax\), %xmm6 +** subq \$64, %rsi +** subq \$64, %rcx +** movdqu -48\(%rax\), %xmm5 +** movdqu -64\(%rax\), %xmm4 +** subq \$64, %rax +** movups %xmm7, 48\(%rcx\) +** movups %xmm6, 32\(%rcx\) +** movups %xmm5, 16\(%rcx\) +** movups %xmm4, \(%rcx\) +** cmpq \$64, %rsi +** ja .L9 +** movups %xmm3, \(%rdi\) +** movups %xmm2, 16\(%rdi\) +** movups %xmm1, 32\(%rdi\) +** movups %xmm0, 48\(%rdi\) +** ret +** .cfi_endproc +**... +*/ + +#ifndef gcc_memmove +#define gcc_memmove gcc_memmove_xmm +#endif + +void +gcc_memmove (void *a, void *b, __SIZE_TYPE__ n) +{ + if (n > 32) + __builtin_memmove (a, b, n); +} diff --git a/gcc/testsuite/gcc.target/i386/builtin-memmove-4b.c b/gcc/testsuite/gcc.target/i386/builtin-memmove-4b.c new file mode 100644 index 0000000..f948d17 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/builtin-memmove-4b.c @@ -0,0 +1,131 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mno-avx512f -march=x86-64-v3 -mtune=generic -minline-all-stringops" } */ +/* { dg-add-options check_function_bodies } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target { lp64 } } {^\t?\.} } } */ + +/* +**gcc_memmove_ymm: +**.LFB0: +** .cfi_startproc +** cmpq \$32, %rdx +** ja .L14 +**.L12: +** ret +** .p2align 4,,10 +** .p2align 3 +**.L14: +** movq %rdi, %rcx +** movq %rsi, %rax +** cmpq \$64, %rdx +** jbe .L15 +** cmpq \$256, %rdx +** ja .L5 +** cmpq \$128, %rdx +** jnb .L16 +** vmovdqu \(%rsi\), %ymm3 +** vmovdqu 32\(%rsi\), %ymm2 +** vmovdqu -32\(%rsi,%rdx\), %ymm1 +** vmovdqu -64\(%rsi,%rdx\), %ymm0 +** vmovdqu %ymm3, \(%rdi\) +** vmovdqu %ymm2, 32\(%rdi\) +** vmovdqu %ymm1, -32\(%rdi,%rdx\) +** vmovdqu %ymm0, -64\(%rdi,%rdx\) +** vzeroupper +** ret +** .p2align 4,,10 +** .p2align 3 +**.L15: +** vmovdqu \(%rsi\), %ymm1 +** vmovdqu -32\(%rsi,%rdx\), %ymm0 +** vmovdqu %ymm1, \(%rdi\) +** vmovdqu %ymm0, -32\(%rdi,%rdx\) +** vzeroupper +** ret +** .p2align 4,,10 +** .p2align 3 +**.L5: +** movq %rdx, %rsi +** cmpq %rdi, %rax +** jb .L7 +** je .L12 +** vmovdqu -32\(%rax,%rdx\), %ymm7 +** vmovdqu -64\(%rax,%rdx\), %ymm6 +** vmovdqu -96\(%rax,%rdx\), %ymm5 +** vmovdqu -128\(%rax,%rdx\), %ymm4 +**.L8: +** vmovdqu \(%rax\), %ymm3 +** addq \$-128, %rsi +** subq \$-128, %rcx +** subq \$-128, %rax +** vmovdqu -96\(%rax\), %ymm2 +** vmovdqu -64\(%rax\), %ymm1 +** vmovdqu -32\(%rax\), %ymm0 +** vmovdqu %ymm3, -128\(%rcx\) +** vmovdqu %ymm2, -96\(%rcx\) +** vmovdqu %ymm1, -64\(%rcx\) +** vmovdqu %ymm0, -32\(%rcx\) +** cmpq \$128, %rsi +** ja .L8 +** vmovdqu %ymm7, -32\(%rdi,%rdx\) +** vmovdqu %ymm6, -64\(%rdi,%rdx\) +** vmovdqu %ymm5, -96\(%rdi,%rdx\) +** vmovdqu %ymm4, -128\(%rdi,%rdx\) +** vzeroupper +** ret +** .p2align 4,,10 +** .p2align 3 +**.L7: +** vmovdqu \(%rax\), %ymm3 +** vmovdqu 32\(%rax\), %ymm2 +** leaq \(%rdi,%rdx\), %rcx +** vmovdqu 64\(%rax\), %ymm1 +** vmovdqu 96\(%rax\), %ymm0 +** addq %rdx, %rax +**.L9: +** vmovdqu -32\(%rax\), %ymm7 +** vmovdqu -64\(%rax\), %ymm6 +** addq \$-128, %rsi +** addq \$-128, %rcx +** vmovdqu -96\(%rax\), %ymm5 +** vmovdqu -128\(%rax\), %ymm4 +** addq \$-128, %rax +** vmovdqu %ymm7, 96\(%rcx\) +** vmovdqu %ymm6, 64\(%rcx\) +** vmovdqu %ymm5, 32\(%rcx\) +** vmovdqu %ymm4, \(%rcx\) +** cmpq \$128, %rsi +** ja .L9 +** vmovdqu %ymm3, \(%rdi\) +** vmovdqu %ymm2, 32\(%rdi\) +** vmovdqu %ymm1, 64\(%rdi\) +** vmovdqu %ymm0, 96\(%rdi\) +** vzeroupper +** ret +** .p2align 4,,10 +** .p2align 3 +**.L16: +** vmovdqu \(%rsi\), %ymm7 +** vmovdqu 32\(%rsi\), %ymm6 +** vmovdqu 64\(%rsi\), %ymm5 +** vmovdqu 96\(%rsi\), %ymm4 +** vmovdqu -32\(%rsi,%rdx\), %ymm3 +** vmovdqu -64\(%rsi,%rdx\), %ymm2 +** vmovdqu -96\(%rsi,%rdx\), %ymm1 +** vmovdqu -128\(%rsi,%rdx\), %ymm0 +** vmovdqu %ymm7, \(%rdi\) +** vmovdqu %ymm6, 32\(%rdi\) +** vmovdqu %ymm5, 64\(%rdi\) +** vmovdqu %ymm4, 96\(%rdi\) +** vmovdqu %ymm3, -32\(%rdi,%rdx\) +** vmovdqu %ymm2, -64\(%rdi,%rdx\) +** vmovdqu %ymm1, -96\(%rdi,%rdx\) +** vmovdqu %ymm0, -128\(%rdi,%rdx\) +** vzeroupper +** ret +** .cfi_endproc +**... +*/ + +#define gcc_memmove gcc_memmove_ymm +#include "builtin-memmove-4a.c" diff --git a/gcc/testsuite/gcc.target/i386/builtin-memmove-4c.c b/gcc/testsuite/gcc.target/i386/builtin-memmove-4c.c new file mode 100644 index 0000000..5cf2520 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/builtin-memmove-4c.c @@ -0,0 +1,142 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -march=x86-64-v4 -mmove-max=512 -mtune=generic -minline-all-stringops" } */ +/* { dg-add-options check_function_bodies } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target { lp64 } } {^\t?\.} } } */ + +/* +**gcc_memmove_zmm: +**.LFB0: +** .cfi_startproc +** cmpq \$32, %rdx +** ja .L16 +**.L14: +** ret +** .p2align 4,,10 +** .p2align 3 +**.L16: +** movq %rdi, %rcx +** movq %rsi, %rax +** cmpq \$64, %rdx +** jb .L6 +** cmpq \$128, %rdx +** ja .L5 +** vmovdqu64 \(%rsi\), %zmm1 +** vmovdqu64 -64\(%rsi,%rdx\), %zmm0 +** vmovdqu64 %zmm1, \(%rdi\) +** vmovdqu64 %zmm0, -64\(%rdi,%rdx\) +** vzeroupper +** ret +** .p2align 4,,10 +** .p2align 3 +**.L6: +** vmovdqu \(%rsi\), %ymm1 +** vmovdqu -32\(%rsi,%rdx\), %ymm0 +** vmovdqu %ymm1, \(%rdi\) +** vmovdqu %ymm0, -32\(%rdi,%rdx\) +** vzeroupper +** ret +** .p2align 4,,10 +** .p2align 3 +**.L5: +** cmpq \$512, %rdx +** jbe .L17 +** movq %rdx, %rsi +** cmpq %rdi, %rax +** jb .L9 +** je .L14 +** vmovdqu64 -64\(%rax,%rdx\), %zmm7 +** vmovdqu64 -128\(%rax,%rdx\), %zmm6 +** vmovdqu64 -192\(%rax,%rdx\), %zmm5 +** vmovdqu64 -256\(%rax,%rdx\), %zmm4 +**.L10: +** vmovdqu64 \(%rax\), %zmm3 +** addq \$256, %rax +** vmovdqu64 -192\(%rax\), %zmm2 +** subq \$256, %rsi +** vmovdqu64 -128\(%rax\), %zmm1 +** vmovdqu64 -64\(%rax\), %zmm0 +** addq \$256, %rcx +** vmovdqu64 %zmm3, -256\(%rcx\) +** vmovdqu64 %zmm2, -192\(%rcx\) +** vmovdqu64 %zmm1, -128\(%rcx\) +** vmovdqu64 %zmm0, -64\(%rcx\) +** cmpq \$256, %rsi +** ja .L10 +** vmovdqu64 %zmm7, -64\(%rdi,%rdx\) +** vmovdqu64 %zmm6, -128\(%rdi,%rdx\) +** vmovdqu64 %zmm5, -192\(%rdi,%rdx\) +** vmovdqu64 %zmm4, -256\(%rdi,%rdx\) +** vzeroupper +** ret +** .p2align 4,,10 +** .p2align 3 +**.L17: +** cmpq \$256, %rdx +** jb .L8 +** vmovdqu64 \(%rsi\), %zmm7 +** vmovdqu64 64\(%rsi\), %zmm6 +** vmovdqu64 -64\(%rsi,%rdx\), %zmm3 +** vmovdqu64 -128\(%rsi,%rdx\), %zmm2 +** vmovdqu64 128\(%rsi\), %zmm5 +** vmovdqu64 192\(%rsi\), %zmm4 +** vmovdqu64 -192\(%rsi,%rdx\), %zmm1 +** vmovdqu64 -256\(%rsi,%rdx\), %zmm0 +** vmovdqu64 %zmm7, \(%rdi\) +** vmovdqu64 %zmm6, 64\(%rdi\) +** vmovdqu64 %zmm5, 128\(%rdi\) +** vmovdqu64 %zmm4, 192\(%rdi\) +** vmovdqu64 %zmm3, -64\(%rdi,%rdx\) +** vmovdqu64 %zmm2, -128\(%rdi,%rdx\) +** vmovdqu64 %zmm1, -192\(%rdi,%rdx\) +** vmovdqu64 %zmm0, -256\(%rdi,%rdx\) +** vzeroupper +** ret +** .p2align 4,,10 +** .p2align 3 +**.L8: +** vmovdqu64 \(%rsi\), %zmm3 +** vmovdqu64 64\(%rsi\), %zmm2 +** vmovdqu64 -64\(%rsi,%rdx\), %zmm1 +** vmovdqu64 -128\(%rsi,%rdx\), %zmm0 +** vmovdqu64 %zmm3, \(%rdi\) +** vmovdqu64 %zmm2, 64\(%rdi\) +** vmovdqu64 %zmm1, -64\(%rdi,%rdx\) +** vmovdqu64 %zmm0, -128\(%rdi,%rdx\) +** vzeroupper +** ret +** .p2align 4,,10 +** .p2align 3 +**.L9: +** vmovdqu64 \(%rax\), %zmm3 +** leaq \(%rdi,%rdx\), %rcx +** vmovdqu64 64\(%rax\), %zmm2 +** vmovdqu64 128\(%rax\), %zmm1 +** vmovdqu64 192\(%rax\), %zmm0 +** addq %rdx, %rax +**.L11: +** vmovdqu64 -64\(%rax\), %zmm7 +** subq \$256, %rax +** vmovdqu64 128\(%rax\), %zmm6 +** subq \$256, %rsi +** vmovdqu64 64\(%rax\), %zmm5 +** vmovdqu64 \(%rax\), %zmm4 +** subq \$256, %rcx +** vmovdqu64 %zmm7, 192\(%rcx\) +** vmovdqu64 %zmm6, 128\(%rcx\) +** vmovdqu64 %zmm5, 64\(%rcx\) +** vmovdqu64 %zmm4, \(%rcx\) +** cmpq \$256, %rsi +** ja .L11 +** vmovdqu64 %zmm3, \(%rdi\) +** vmovdqu64 %zmm2, 64\(%rdi\) +** vmovdqu64 %zmm1, 128\(%rdi\) +** vmovdqu64 %zmm0, 192\(%rdi\) +** vzeroupper +** ret +** .cfi_endproc +**... +*/ + +#define gcc_memmove gcc_memmove_zmm +#include "builtin-memmove-4a.c" diff --git a/gcc/testsuite/gcc.target/i386/builtin-memmove-5a.c b/gcc/testsuite/gcc.target/i386/builtin-memmove-5a.c new file mode 100644 index 0000000..bb53a47 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/builtin-memmove-5a.c @@ -0,0 +1,110 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mno-avx -msse2 -mtune=generic -minline-all-stringops" } */ +/* { dg-add-options check_function_bodies } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target { lp64 } } {^\t?\.} } } */ + +/* +**gcc_memmove_xmm: +**.LFB0: +** .cfi_startproc +** cmpq \$67, %rdx +** ja .L12 +**.L1: +** ret +** .p2align 4,,10 +** .p2align 3 +**.L12: +** movq %rdi, %rcx +** movq %rsi, %rax +** cmpq \$128, %rdx +** jbe .L13 +** movq %rdx, %rsi +** cmpq %rdi, %rax +** jb .L6 +** je .L1 +** movdqu -16\(%rax,%rdx\), %xmm7 +** movdqu -32\(%rax,%rdx\), %xmm6 +** movdqu -48\(%rax,%rdx\), %xmm5 +** movdqu -64\(%rax,%rdx\), %xmm4 +**.L7: +** movdqu \(%rax\), %xmm3 +** subq \$64, %rsi +** addq \$64, %rcx +** addq \$64, %rax +** movdqu -48\(%rax\), %xmm2 +** movdqu -32\(%rax\), %xmm1 +** movdqu -16\(%rax\), %xmm0 +** movups %xmm3, -64\(%rcx\) +** movups %xmm2, -48\(%rcx\) +** movups %xmm1, -32\(%rcx\) +** movups %xmm0, -16\(%rcx\) +** cmpq \$64, %rsi +** ja .L7 +** movups %xmm7, -16\(%rdi,%rdx\) +** movups %xmm6, -32\(%rdi,%rdx\) +** movups %xmm5, -48\(%rdi,%rdx\) +** movups %xmm4, -64\(%rdi,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L13: +** movdqu \(%rsi\), %xmm7 +** movdqu 16\(%rsi\), %xmm6 +** movdqu 32\(%rsi\), %xmm5 +** movdqu 48\(%rsi\), %xmm4 +** movdqu -16\(%rsi,%rdx\), %xmm3 +** movdqu -32\(%rsi,%rdx\), %xmm2 +** movdqu -48\(%rsi,%rdx\), %xmm1 +** movdqu -64\(%rsi,%rdx\), %xmm0 +** movups %xmm7, \(%rdi\) +** movups %xmm6, 16\(%rdi\) +** movups %xmm5, 32\(%rdi\) +** movups %xmm4, 48\(%rdi\) +** movups %xmm3, -16\(%rdi,%rdx\) +** movups %xmm2, -32\(%rdi,%rdx\) +** movups %xmm1, -48\(%rdi,%rdx\) +** movups %xmm0, -64\(%rdi,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L6: +** movdqu \(%rax\), %xmm3 +** movdqu 16\(%rax\), %xmm2 +** leaq \(%rdi,%rdx\), %rcx +** movdqu 32\(%rax\), %xmm1 +** movdqu 48\(%rax\), %xmm0 +** addq %rdx, %rax +**.L8: +** movdqu -16\(%rax\), %xmm7 +** movdqu -32\(%rax\), %xmm6 +** subq \$64, %rsi +** subq \$64, %rcx +** movdqu -48\(%rax\), %xmm5 +** movdqu -64\(%rax\), %xmm4 +** subq \$64, %rax +** movups %xmm7, 48\(%rcx\) +** movups %xmm6, 32\(%rcx\) +** movups %xmm5, 16\(%rcx\) +** movups %xmm4, \(%rcx\) +** cmpq \$64, %rsi +** ja .L8 +** movups %xmm3, \(%rdi\) +** movups %xmm2, 16\(%rdi\) +** movups %xmm1, 32\(%rdi\) +** movups %xmm0, 48\(%rdi\) +** ret +** .cfi_endproc +**... +*/ + +#ifndef gcc_memmove +#define gcc_memmove gcc_memmove_xmm +#endif + +void +gcc_memmove (void *a, void *b, __SIZE_TYPE__ n) +{ + if (n > 67) + __builtin_memmove (a, b, n); +} diff --git a/gcc/testsuite/gcc.target/i386/builtin-memmove-5b.c b/gcc/testsuite/gcc.target/i386/builtin-memmove-5b.c new file mode 100644 index 0000000..d42da7f --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/builtin-memmove-5b.c @@ -0,0 +1,121 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mno-avx512f -march=x86-64-v3 -mtune=generic -minline-all-stringops" } */ +/* { dg-add-options check_function_bodies } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target { lp64 } } {^\t?\.} } } */ + +/* +**gcc_memmove_ymm: +**.LFB0: +** .cfi_startproc +** cmpq \$67, %rdx +** ja .L14 +**.L12: +** ret +** .p2align 4,,10 +** .p2align 3 +**.L14: +** movq %rdi, %rcx +** movq %rsi, %rax +** cmpq \$256, %rdx +** jbe .L15 +** movq %rdx, %rsi +** cmpq %rdi, %rax +** jb .L7 +** je .L12 +** vmovdqu -32\(%rax,%rdx\), %ymm7 +** vmovdqu -64\(%rax,%rdx\), %ymm6 +** vmovdqu -96\(%rax,%rdx\), %ymm5 +** vmovdqu -128\(%rax,%rdx\), %ymm4 +**.L8: +** vmovdqu \(%rax\), %ymm3 +** addq \$-128, %rsi +** subq \$-128, %rcx +** subq \$-128, %rax +** vmovdqu -96\(%rax\), %ymm2 +** vmovdqu -64\(%rax\), %ymm1 +** vmovdqu -32\(%rax\), %ymm0 +** vmovdqu %ymm3, -128\(%rcx\) +** vmovdqu %ymm2, -96\(%rcx\) +** vmovdqu %ymm1, -64\(%rcx\) +** vmovdqu %ymm0, -32\(%rcx\) +** cmpq \$128, %rsi +** ja .L8 +** vmovdqu %ymm7, -32\(%rdi,%rdx\) +** vmovdqu %ymm6, -64\(%rdi,%rdx\) +** vmovdqu %ymm5, -96\(%rdi,%rdx\) +** vmovdqu %ymm4, -128\(%rdi,%rdx\) +** vzeroupper +** ret +** .p2align 4,,10 +** .p2align 3 +**.L15: +** cmpq \$128, %rdx +** jb .L6 +** vmovdqu \(%rsi\), %ymm7 +** vmovdqu 32\(%rsi\), %ymm6 +** vmovdqu 64\(%rsi\), %ymm5 +** vmovdqu 96\(%rsi\), %ymm4 +** vmovdqu -32\(%rsi,%rdx\), %ymm3 +** vmovdqu -64\(%rsi,%rdx\), %ymm2 +** vmovdqu -96\(%rsi,%rdx\), %ymm1 +** vmovdqu -128\(%rsi,%rdx\), %ymm0 +** vmovdqu %ymm7, \(%rdi\) +** vmovdqu %ymm6, 32\(%rdi\) +** vmovdqu %ymm5, 64\(%rdi\) +** vmovdqu %ymm4, 96\(%rdi\) +** vmovdqu %ymm3, -32\(%rdi,%rdx\) +** vmovdqu %ymm2, -64\(%rdi,%rdx\) +** vmovdqu %ymm1, -96\(%rdi,%rdx\) +** vmovdqu %ymm0, -128\(%rdi,%rdx\) +** vzeroupper +** ret +** .p2align 4,,10 +** .p2align 3 +**.L6: +** vmovdqu \(%rsi\), %ymm3 +** vmovdqu 32\(%rsi\), %ymm2 +** vmovdqu -32\(%rsi,%rdx\), %ymm1 +** vmovdqu -64\(%rsi,%rdx\), %ymm0 +** vmovdqu %ymm3, \(%rdi\) +** vmovdqu %ymm2, 32\(%rdi\) +** vmovdqu %ymm1, -32\(%rdi,%rdx\) +** vmovdqu %ymm0, -64\(%rdi,%rdx\) +** vzeroupper +** ret +** .p2align 4,,10 +** .p2align 3 +**.L7: +** vmovdqu \(%rax\), %ymm3 +** vmovdqu 32\(%rax\), %ymm2 +** leaq \(%rdi,%rdx\), %rcx +** vmovdqu 64\(%rax\), %ymm1 +** vmovdqu 96\(%rax\), %ymm0 +** addq %rdx, %rax +**.L9: +** vmovdqu -32\(%rax\), %ymm7 +** vmovdqu -64\(%rax\), %ymm6 +** addq \$-128, %rsi +** addq \$-128, %rcx +** vmovdqu -96\(%rax\), %ymm5 +** vmovdqu -128\(%rax\), %ymm4 +** addq \$-128, %rax +** vmovdqu %ymm7, 96\(%rcx\) +** vmovdqu %ymm6, 64\(%rcx\) +** vmovdqu %ymm5, 32\(%rcx\) +** vmovdqu %ymm4, \(%rcx\) +** cmpq \$128, %rsi +** ja .L9 +** vmovdqu %ymm3, \(%rdi\) +** vmovdqu %ymm2, 32\(%rdi\) +** vmovdqu %ymm1, 64\(%rdi\) +** vmovdqu %ymm0, 96\(%rdi\) +** vzeroupper +** ret +** .cfi_endproc +**.LFE0: +**... +*/ + +#define gcc_memmove gcc_memmove_ymm +#include "builtin-memmove-5a.c" diff --git a/gcc/testsuite/gcc.target/i386/builtin-memmove-5c.c b/gcc/testsuite/gcc.target/i386/builtin-memmove-5c.c new file mode 100644 index 0000000..8eac584 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/builtin-memmove-5c.c @@ -0,0 +1,131 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -march=x86-64-v4 -mmove-max=512 -mtune=generic -minline-all-stringops" } */ +/* { dg-add-options check_function_bodies } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target { lp64 } } {^\t?\.} } } */ + +/* +**gcc_memmove_zmm: +**.LFB0: +** .cfi_startproc +** cmpq \$67, %rdx +** ja .L14 +**.L12: +** ret +** .p2align 4,,10 +** .p2align 3 +**.L14: +** movq %rdi, %rcx +** movq %rsi, %rax +** cmpq \$128, %rdx +** jbe .L15 +** cmpq \$512, %rdx +** ja .L5 +** cmpq \$256, %rdx +** jnb .L16 +** vmovdqu64 \(%rsi\), %zmm3 +** vmovdqu64 64\(%rsi\), %zmm2 +** vmovdqu64 -64\(%rsi,%rdx\), %zmm1 +** vmovdqu64 -128\(%rsi,%rdx\), %zmm0 +** vmovdqu64 %zmm3, \(%rdi\) +** vmovdqu64 %zmm2, 64\(%rdi\) +** vmovdqu64 %zmm1, -64\(%rdi,%rdx\) +** vmovdqu64 %zmm0, -128\(%rdi,%rdx\) +** vzeroupper +** ret +** .p2align 4,,10 +** .p2align 3 +**.L15: +** vmovdqu64 \(%rsi\), %zmm1 +** vmovdqu64 -64\(%rsi,%rdx\), %zmm0 +** vmovdqu64 %zmm1, \(%rdi\) +** vmovdqu64 %zmm0, -64\(%rdi,%rdx\) +** vzeroupper +** ret +** .p2align 4,,10 +** .p2align 3 +**.L5: +** movq %rdx, %rsi +** cmpq %rdi, %rax +** jb .L7 +** je .L12 +** vmovdqu64 -64\(%rax,%rdx\), %zmm7 +** vmovdqu64 -128\(%rax,%rdx\), %zmm6 +** vmovdqu64 -192\(%rax,%rdx\), %zmm5 +** vmovdqu64 -256\(%rax,%rdx\), %zmm4 +**.L8: +** vmovdqu64 \(%rax\), %zmm3 +** addq \$256, %rax +** vmovdqu64 -192\(%rax\), %zmm2 +** subq \$256, %rsi +** vmovdqu64 -128\(%rax\), %zmm1 +** vmovdqu64 -64\(%rax\), %zmm0 +** addq \$256, %rcx +** vmovdqu64 %zmm3, -256\(%rcx\) +** vmovdqu64 %zmm2, -192\(%rcx\) +** vmovdqu64 %zmm1, -128\(%rcx\) +** vmovdqu64 %zmm0, -64\(%rcx\) +** cmpq \$256, %rsi +** ja .L8 +** vmovdqu64 %zmm7, -64\(%rdi,%rdx\) +** vmovdqu64 %zmm6, -128\(%rdi,%rdx\) +** vmovdqu64 %zmm5, -192\(%rdi,%rdx\) +** vmovdqu64 %zmm4, -256\(%rdi,%rdx\) +** vzeroupper +** ret +** .p2align 4,,10 +** .p2align 3 +**.L7: +** vmovdqu64 \(%rax\), %zmm3 +** leaq \(%rdi,%rdx\), %rcx +** vmovdqu64 64\(%rax\), %zmm2 +** vmovdqu64 128\(%rax\), %zmm1 +** vmovdqu64 192\(%rax\), %zmm0 +** addq %rdx, %rax +**.L9: +** vmovdqu64 -64\(%rax\), %zmm7 +** subq \$256, %rax +** vmovdqu64 128\(%rax\), %zmm6 +** subq \$256, %rsi +** vmovdqu64 64\(%rax\), %zmm5 +** vmovdqu64 \(%rax\), %zmm4 +** subq \$256, %rcx +** vmovdqu64 %zmm7, 192\(%rcx\) +** vmovdqu64 %zmm6, 128\(%rcx\) +** vmovdqu64 %zmm5, 64\(%rcx\) +** vmovdqu64 %zmm4, \(%rcx\) +** cmpq \$256, %rsi +** ja .L9 +** vmovdqu64 %zmm3, \(%rdi\) +** vmovdqu64 %zmm2, 64\(%rdi\) +** vmovdqu64 %zmm1, 128\(%rdi\) +** vmovdqu64 %zmm0, 192\(%rdi\) +** vzeroupper +** ret +** .p2align 4,,10 +** .p2align 3 +**.L16: +** vmovdqu64 \(%rsi\), %zmm7 +** vmovdqu64 64\(%rsi\), %zmm6 +** vmovdqu64 -64\(%rsi,%rdx\), %zmm3 +** vmovdqu64 -128\(%rsi,%rdx\), %zmm2 +** vmovdqu64 128\(%rsi\), %zmm5 +** vmovdqu64 192\(%rsi\), %zmm4 +** vmovdqu64 -192\(%rsi,%rdx\), %zmm1 +** vmovdqu64 -256\(%rsi,%rdx\), %zmm0 +** vmovdqu64 %zmm7, \(%rdi\) +** vmovdqu64 %zmm6, 64\(%rdi\) +** vmovdqu64 %zmm5, 128\(%rdi\) +** vmovdqu64 %zmm4, 192\(%rdi\) +** vmovdqu64 %zmm3, -64\(%rdi,%rdx\) +** vmovdqu64 %zmm2, -128\(%rdi,%rdx\) +** vmovdqu64 %zmm1, -192\(%rdi,%rdx\) +** vmovdqu64 %zmm0, -256\(%rdi,%rdx\) +** vzeroupper +** ret +** .cfi_endproc +**... +*/ + +#define gcc_memmove gcc_memmove_zmm +#include "builtin-memmove-5a.c" diff --git a/gcc/testsuite/gcc.target/i386/builtin-memmove-6.c b/gcc/testsuite/gcc.target/i386/builtin-memmove-6.c new file mode 100644 index 0000000..3911c7e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/builtin-memmove-6.c @@ -0,0 +1,53 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mno-avx -msse2 -mtune=generic -minline-all-stringops" } */ +/* { dg-add-options check_function_bodies } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target { lp64 } } {^\t?\.} } } */ + +/* +**gcc_memmove: +**.LFB0: +** .cfi_startproc +** cmpq \$7, %rdx +** jbe .L8 +**.L1: +** ret +** .p2align 4,,10 +** .p2align 3 +**.L8: +** cmpl \$4, %edx +** jnb .L9 +** cmpl \$1, %edx +** ja .L5 +** jb .L1 +** movzbl \(%rsi\), %eax +** movb %al, \(%rdi\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L9: +** movl %edx, %edx +** movl \(%rsi\), %ecx +** movl -4\(%rsi,%rdx\), %eax +** movl %ecx, \(%rdi\) +** movl %eax, -4\(%rdi,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L5: +** movl %edx, %edx +** movzwl \(%rsi\), %ecx +** movzwl -2\(%rsi,%rdx\), %eax +** movw %cx, \(%rdi\) +** movw %ax, -2\(%rdi,%rdx\) +** ret +** .cfi_endproc +**... +*/ + +void +gcc_memmove (void *a, void *b, __SIZE_TYPE__ n) +{ + if (n < 8) + __builtin_memmove (a, b, n); +} diff --git a/gcc/testsuite/gcc.target/i386/builtin-memmove-7.c b/gcc/testsuite/gcc.target/i386/builtin-memmove-7.c new file mode 100644 index 0000000..6b4eca8 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/builtin-memmove-7.c @@ -0,0 +1,43 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mno-avx -msse2 -mtune=generic -minline-all-stringops" } */ +/* { dg-add-options check_function_bodies } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target { lp64 } } {^\t?\.} } } */ + +/* +**gcc_memmove: +**.LFB0: +** .cfi_startproc +** cmpq \$3, %rdx +** jbe .L7 +**.L1: +** ret +** .p2align 4,,10 +** .p2align 3 +**.L7: +** cmpl \$2, %edx +** jnb .L8 +** cmpl \$1, %edx +** jb .L1 +** movzbl \(%rsi\), %eax +** movb %al, \(%rdi\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L8: +** movl %edx, %edx +** movzwl \(%rsi\), %ecx +** movzwl -2\(%rsi,%rdx\), %eax +** movw %cx, \(%rdi\) +** movw %ax, -2\(%rdi,%rdx\) +** ret +** .cfi_endproc +**... +*/ + +void +gcc_memmove (void *a, void *b, __SIZE_TYPE__ n) +{ + if (n < 4) + __builtin_memmove (a, b, n); +} diff --git a/gcc/testsuite/gcc.target/i386/builtin-memmove-8.c b/gcc/testsuite/gcc.target/i386/builtin-memmove-8.c new file mode 100644 index 0000000..70a09fb --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/builtin-memmove-8.c @@ -0,0 +1,91 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mno-avx -msse2 -mtune=generic -minline-all-stringops" } */ +/* { dg-add-options check_function_bodies } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target { lp64 } } {^\t?\.} } } */ + +/* +**gcc_memmove: +**.LFB0: +** .cfi_startproc +** cmpq \$33, %rdx +** jbe .L12 +**.L1: +** ret +** .p2align 4,,10 +** .p2align 3 +**.L12: +** cmpl \$16, %edx +** jnb .L13 +** cmpl \$8, %edx +** jnb .L6 +** cmpl \$4, %edx +** jnb .L7 +** cmpl \$1, %edx +** ja .L8 +** jb .L1 +** movzbl \(%rsi\), %eax +** movb %al, \(%rdi\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L13: +** cmpl \$32, %edx +** ja .L5 +** movl %edx, %edx +** movdqu \(%rsi\), %xmm1 +** movdqu -16\(%rsi,%rdx\), %xmm0 +** movups %xmm1, \(%rdi\) +** movups %xmm0, -16\(%rdi,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L5: +** movl %edx, %edx +** movdqu \(%rsi\), %xmm3 +** movdqu 16\(%rsi\), %xmm2 +** addq %rdx, %rsi +** movdqu -16\(%rsi\), %xmm1 +** movdqu -32\(%rsi\), %xmm0 +** movups %xmm3, \(%rdi\) +** movups %xmm2, 16\(%rdi\) +** movups %xmm1, -16\(%rdi,%rdx\) +** movups %xmm0, -32\(%rdi,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L6: +** movl %edx, %edx +** movq \(%rsi\), %rcx +** movq -8\(%rsi,%rdx\), %rax +** movq %rcx, \(%rdi\) +** movq %rax, -8\(%rdi,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L7: +** movl %edx, %edx +** movl \(%rsi\), %ecx +** movl -4\(%rsi,%rdx\), %eax +** movl %ecx, \(%rdi\) +** movl %eax, -4\(%rdi,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L8: +** movl %edx, %edx +** movzwl \(%rsi\), %ecx +** movzwl -2\(%rsi,%rdx\), %eax +** movw %cx, \(%rdi\) +** movw %ax, -2\(%rdi,%rdx\) +** ret +** .cfi_endproc +**... +*/ + +void +gcc_memmove (void *a, void *b, __SIZE_TYPE__ n) +{ + if (n < 34) + __builtin_memmove (a, b, n); +} diff --git a/gcc/testsuite/gcc.target/i386/builtin-memmove-9.c b/gcc/testsuite/gcc.target/i386/builtin-memmove-9.c new file mode 100644 index 0000000..6832647 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/builtin-memmove-9.c @@ -0,0 +1,64 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mno-avx -msse2 -mtune=generic -minline-all-stringops" } */ +/* { dg-add-options check_function_bodies } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target { lp64 } } {^\t?\.} } } */ + +/* +**gcc_memmove: +**.LFB0: +** .cfi_startproc +** cmpq \$15, %rdx +** jbe .L9 +**.L1: +** ret +** .p2align 4,,10 +** .p2align 3 +**.L9: +** cmpl \$8, %edx +** jnb .L10 +** cmpl \$4, %edx +** jnb .L5 +** cmpl \$1, %edx +** ja .L6 +** jb .L1 +** movzbl \(%rsi\), %eax +** movb %al, \(%rdi\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L10: +** movl %edx, %edx +** movq \(%rsi\), %rcx +** movq -8\(%rsi,%rdx\), %rax +** movq %rcx, \(%rdi\) +** movq %rax, -8\(%rdi,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L5: +** movl %edx, %edx +** movl \(%rsi\), %ecx +** movl -4\(%rsi,%rdx\), %eax +** movl %ecx, \(%rdi\) +** movl %eax, -4\(%rdi,%rdx\) +** ret +** .p2align 4,,10 +** .p2align 3 +**.L6: +** movl %edx, %edx +** movzwl \(%rsi\), %ecx +** movzwl -2\(%rsi,%rdx\), %eax +** movw %cx, \(%rdi\) +** movw %ax, -2\(%rdi,%rdx\) +** ret +** .cfi_endproc +**... +*/ + +void +gcc_memmove (void *a, void *b, __SIZE_TYPE__ n) +{ + if (n < 16) + __builtin_memmove (a, b, n); +} diff --git a/gcc/testsuite/gcc.target/i386/cf_check-11.c b/gcc/testsuite/gcc.target/i386/cf_check-11.c index 9ed65ab..2a85a5b 100644 --- a/gcc/testsuite/gcc.target/i386/cf_check-11.c +++ b/gcc/testsuite/gcc.target/i386/cf_check-11.c @@ -2,6 +2,7 @@ /* { dg-do compile { target { "i?86-*-* x86_64-*-*" } } } */ /* { dg-require-weak "" } */ /* { dg-options "-O2 -fcf-protection" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target "*-*-*" } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/cf_check-7.c b/gcc/testsuite/gcc.target/i386/cf_check-7.c index b9a3b39..548e16c 100644 --- a/gcc/testsuite/gcc.target/i386/cf_check-7.c +++ b/gcc/testsuite/gcc.target/i386/cf_check-7.c @@ -1,6 +1,7 @@ /* PR c/122427 */ /* { dg-do compile { target { "i?86-*-* x86_64-*-*" } } } */ /* { dg-options "-O2 -fcf-protection" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target "*-*-*" } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/cmov12.c b/gcc/testsuite/gcc.target/i386/cmov12.c index 3d8c358..81977b9 100644 --- a/gcc/testsuite/gcc.target/i386/cmov12.c +++ b/gcc/testsuite/gcc.target/i386/cmov12.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target { ! ia32 } } } */ +/* { dg-do compile { target lp64 } } */ /* { dg-options "-O2 -mavx2 -mtune=sapphirerapids" } */ /* { dg-final { scan-assembler-times "cmov(\[lq\]\.)?g" 3 } } */ diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-5.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-5.c index fb26c00..bc218352 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-5.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-5.c @@ -9,10 +9,8 @@ foo (void) bar (); } -/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*bar@GOT" { target x32 } } } */ -/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk" { target x32 } } } */ -/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*bar@GOT" { target { ! x32 } } } } */ -/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk_(r|e)ax" { target { ! x32 } } } } */ +/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*bar@GOT" } } */ +/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */ /* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */ /* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */ /* { dg-final { scan-assembler {\tpause} } } */ diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-6.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-6.c index 8bc45ff..ea9e405 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-6.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-6.c @@ -10,13 +10,9 @@ foo (void) return 0; } -/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*bar@GOT" { target x32 } } } */ -/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk" { target x32 } } } */ -/* { dg-final { scan-assembler-times "jmp\[ \t\]*\.LIND" 2 { target x32 } } } */ -/* { dg-final { scan-assembler-times "call\[ \t\]*\.LIND" 2 { target x32 } } } */ -/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*bar@GOT" { target { ! x32 } } } } */ -/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" { target { ! x32 } } } } */ -/* { dg-final { scan-assembler-times "jmp\[ \t\]*\.LIND" 1 { target { ! x32 } } } } */ -/* { dg-final { scan-assembler-times "call\[ \t\]*\.LIND" 1 { target { ! x32 } } } } */ +/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*bar@GOT" } } */ +/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */ +/* { dg-final { scan-assembler-times "jmp\[ \t\]*\.LIND" 1 } } */ +/* { dg-final { scan-assembler-times "call\[ \t\]*\.LIND" 1 } } */ /* { dg-final { scan-assembler {\tpause} } } */ /* { dg-final { scan-assembler {\tlfence} } } */ diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-5.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-5.c index 5328239..cb4961b 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-5.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-5.c @@ -9,10 +9,8 @@ foo (void) bar (); } -/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*bar@GOT" { target x32 } } } */ -/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk" { target x32 } } } */ -/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*bar@GOT" { target { ! x32 } } } } */ -/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk_(r|e)ax" { target { ! x32 } } } } */ +/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*bar@GOT" } } */ +/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */ /* { dg-final { scan-assembler-not {\t(lfence|pause)} } } */ /* { dg-final { scan-assembler-not "jmp\[ \t\]*\.LIND" } } */ /* { dg-final { scan-assembler-not "call\[ \t\]*\.LIND" } } */ diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-6.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-6.c index 8ae4348..5cb874f 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-6.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-6.c @@ -10,8 +10,6 @@ foo (void) return 0; } -/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*bar@GOT" { target x32 } } } */ -/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk" { target x32 } } } */ -/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*bar@GOT" { target { ! x32 } } } } */ -/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" { target { ! x32 } } } } */ +/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*bar@GOT" } } */ +/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */ /* { dg-final { scan-assembler-not {\t(lfence|pause)} } } */ diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-5.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-5.c index 21cbfd3..4c706b3 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-5.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-5.c @@ -9,8 +9,7 @@ foo (void) bar (); } -/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*bar@GOT" { target x32 } } } */ -/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*bar@GOT" { target { ! x32 } } } } */ +/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*bar@GOT" } } */ /* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */ /* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */ /* { dg-final { scan-assembler {\tpause} } } */ diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-6.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-6.c index d1300f1..b61c855 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-6.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-6.c @@ -10,8 +10,7 @@ foo (void) return 0; } -/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*bar@GOT" { target x32 } } } */ -/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*bar@GOT" { target { ! x32 } } } } */ +/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*bar@GOT" } } */ /* { dg-final { scan-assembler-times "jmp\[ \t\]*\.LIND" 2 } } */ /* { dg-final { scan-assembler-times "call\[ \t\]*\.LIND" 2 } } */ /* { dg-final { scan-assembler-times {\tpause} 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/kortest_ccz-1.c b/gcc/testsuite/gcc.target/i386/kortest_ccz-1.c new file mode 100644 index 0000000..b3cf5b8 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/kortest_ccz-1.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-march=x86-64-v4 -O3" } */ +/* { dg-final { scan-assembler-not "kmov" } } */ +/* { dg-final { scan-assembler "kortest" } } */ + +int +foo (int *__restrict a, int* __restrict d, int b, int c, int n) +{ + for (int i = 0; i != 10000; i++) + if (a[i] > b | d[i] > c) + return 1; + return 0; +} diff --git a/gcc/testsuite/gcc.target/i386/memcpy-pr120683-1.c b/gcc/testsuite/gcc.target/i386/memcpy-pr120683-1.c index b1f6678..6d5ed4f 100644 --- a/gcc/testsuite/gcc.target/i386/memcpy-pr120683-1.c +++ b/gcc/testsuite/gcc.target/i386/memcpy-pr120683-1.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fasynchronous-unwind-tables -fdwarf2-cfi-asm -mno-sse -mmemcpy-strategy=unrolled_loop:256:noalign,libcall:-1:noalign" } */ +/* { dg-options "-O2 -mno-sse -mmemcpy-strategy=unrolled_loop:256:noalign,libcall:-1:noalign" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/memcpy-pr120683-2.c b/gcc/testsuite/gcc.target/i386/memcpy-pr120683-2.c index cd78ae8..47a7ac3 100644 --- a/gcc/testsuite/gcc.target/i386/memcpy-pr120683-2.c +++ b/gcc/testsuite/gcc.target/i386/memcpy-pr120683-2.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=x86-64 -fasynchronous-unwind-tables -fdwarf2-cfi-asm -mmemcpy-strategy=vector_loop:2048:noalign,libcall:-1:noalign" } */ +/* { dg-options "-O2 -march=x86-64 -mmemcpy-strategy=vector_loop:2048:noalign,libcall:-1:noalign" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/memcpy-pr120683-3.c b/gcc/testsuite/gcc.target/i386/memcpy-pr120683-3.c index ea3bcca..773f84f 100644 --- a/gcc/testsuite/gcc.target/i386/memcpy-pr120683-3.c +++ b/gcc/testsuite/gcc.target/i386/memcpy-pr120683-3.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=x86-64 -fasynchronous-unwind-tables -fdwarf2-cfi-asm -mmemcpy-strategy=vector_loop:2048:noalign,libcall:-1:noalign" } */ +/* { dg-options "-O2 -march=x86-64 -mmemcpy-strategy=vector_loop:2048:noalign,libcall:-1:noalign" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/memcpy-pr120683-4.c b/gcc/testsuite/gcc.target/i386/memcpy-pr120683-4.c index c2d595f..2116d06 100644 --- a/gcc/testsuite/gcc.target/i386/memcpy-pr120683-4.c +++ b/gcc/testsuite/gcc.target/i386/memcpy-pr120683-4.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=x86-64-v3 -fasynchronous-unwind-tables -fdwarf2-cfi-asm -mmemcpy-strategy=vector_loop:2048:noalign,libcall:-1:noalign" } */ +/* { dg-options "-O2 -march=x86-64-v3 -mmemcpy-strategy=vector_loop:2048:noalign,libcall:-1:noalign" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/memcpy-pr120683-5.c b/gcc/testsuite/gcc.target/i386/memcpy-pr120683-5.c index 294d25c..6c97611 100644 --- a/gcc/testsuite/gcc.target/i386/memcpy-pr120683-5.c +++ b/gcc/testsuite/gcc.target/i386/memcpy-pr120683-5.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=x86-64-v3 -fasynchronous-unwind-tables -fdwarf2-cfi-asm -mmemcpy-strategy=vector_loop:2048:noalign,libcall:-1:noalign" } */ +/* { dg-options "-O2 -march=x86-64-v3 -mmemcpy-strategy=vector_loop:2048:noalign,libcall:-1:noalign" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/memcpy-pr120683-6.c b/gcc/testsuite/gcc.target/i386/memcpy-pr120683-6.c index 2013916..731906b 100644 --- a/gcc/testsuite/gcc.target/i386/memcpy-pr120683-6.c +++ b/gcc/testsuite/gcc.target/i386/memcpy-pr120683-6.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=x86-64-v4 -fasynchronous-unwind-tables -fdwarf2-cfi-asm -mmemcpy-strategy=vector_loop:2048:noalign,libcall:-1:noalign" } */ +/* { dg-options "-O2 -march=x86-64-v4 -mmemcpy-strategy=vector_loop:2048:noalign,libcall:-1:noalign" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/memcpy-pr120683-7.c b/gcc/testsuite/gcc.target/i386/memcpy-pr120683-7.c index 30e2c3c..e2bb409 100644 --- a/gcc/testsuite/gcc.target/i386/memcpy-pr120683-7.c +++ b/gcc/testsuite/gcc.target/i386/memcpy-pr120683-7.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=x86-64-v4 -fasynchronous-unwind-tables -fdwarf2-cfi-asm -mmemcpy-strategy=vector_loop:2048:noalign,libcall:-1:noalign" } */ +/* { dg-options "-O2 -march=x86-64-v4 -mmemcpy-strategy=vector_loop:2048:noalign,libcall:-1:noalign" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/memcpy-strategy-12.c b/gcc/testsuite/gcc.target/i386/memcpy-strategy-12.c index c60cef0..b92f0f9 100644 --- a/gcc/testsuite/gcc.target/i386/memcpy-strategy-12.c +++ b/gcc/testsuite/gcc.target/i386/memcpy-strategy-12.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mtune=generic -mno-sse -fasynchronous-unwind-tables -fdwarf2-cfi-asm" } */ +/* { dg-options "-O2 -mtune=generic -mno-sse" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/memset-pr120683-1.c b/gcc/testsuite/gcc.target/i386/memset-pr120683-1.c index 06e3892..d8d3161 100644 --- a/gcc/testsuite/gcc.target/i386/memset-pr120683-1.c +++ b/gcc/testsuite/gcc.target/i386/memset-pr120683-1.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=x86-64 -fasynchronous-unwind-tables -fdwarf2-cfi-asm -mmemset-strategy=vector_loop:256:noalign,libcall:-1:noalign" } */ +/* { dg-options "-O2 -march=x86-64 -mmemset-strategy=vector_loop:256:noalign,libcall:-1:noalign" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/memset-pr120683-10.c b/gcc/testsuite/gcc.target/i386/memset-pr120683-10.c index 36a924d..040e293 100644 --- a/gcc/testsuite/gcc.target/i386/memset-pr120683-10.c +++ b/gcc/testsuite/gcc.target/i386/memset-pr120683-10.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mno-sse -fasynchronous-unwind-tables -fdwarf2-cfi-asm -mmemset-strategy=unrolled_loop:256:noalign,libcall:-1:noalign" } */ +/* { dg-options "-O2 -mno-sse -mmemset-strategy=unrolled_loop:256:noalign,libcall:-1:noalign" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/memset-pr120683-11.c b/gcc/testsuite/gcc.target/i386/memset-pr120683-11.c index 4868e56..df479c5 100644 --- a/gcc/testsuite/gcc.target/i386/memset-pr120683-11.c +++ b/gcc/testsuite/gcc.target/i386/memset-pr120683-11.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mno-sse -fasynchronous-unwind-tables -fdwarf2-cfi-asm -mmemset-strategy=unrolled_loop:256:noalign,libcall:-1:noalign" } */ +/* { dg-options "-O2 -mno-sse -mmemset-strategy=unrolled_loop:256:noalign,libcall:-1:noalign" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/memset-pr120683-12.c b/gcc/testsuite/gcc.target/i386/memset-pr120683-12.c index 9112897..9ea0951 100644 --- a/gcc/testsuite/gcc.target/i386/memset-pr120683-12.c +++ b/gcc/testsuite/gcc.target/i386/memset-pr120683-12.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mno-sse -fasynchronous-unwind-tables -fdwarf2-cfi-asm -mmemset-strategy=unrolled_loop:256:noalign,libcall:-1:noalign" } */ +/* { dg-options "-O2 -mno-sse -mmemset-strategy=unrolled_loop:256:noalign,libcall:-1:noalign" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/memset-pr120683-13.c b/gcc/testsuite/gcc.target/i386/memset-pr120683-13.c index 69ec6c6..2553d93 100644 --- a/gcc/testsuite/gcc.target/i386/memset-pr120683-13.c +++ b/gcc/testsuite/gcc.target/i386/memset-pr120683-13.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=x86-64 -fasynchronous-unwind-tables -fdwarf2-cfi-asm -mmemset-strategy=vector_loop:256:noalign,libcall:-1:noalign" } */ +/* { dg-options "-O2 -march=x86-64 -mmemset-strategy=vector_loop:256:noalign,libcall:-1:noalign" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/memset-pr120683-14.c b/gcc/testsuite/gcc.target/i386/memset-pr120683-14.c index 209cd67..f3e8cd1 100644 --- a/gcc/testsuite/gcc.target/i386/memset-pr120683-14.c +++ b/gcc/testsuite/gcc.target/i386/memset-pr120683-14.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=x86-64 -fasynchronous-unwind-tables -fdwarf2-cfi-asm -mmemset-strategy=vector_loop:256:noalign,libcall:-1:noalign -minline-all-stringops" } */ +/* { dg-options "-O2 -march=x86-64 -mmemset-strategy=vector_loop:256:noalign,libcall:-1:noalign -minline-all-stringops" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/memset-pr120683-15.c b/gcc/testsuite/gcc.target/i386/memset-pr120683-15.c index d19188f..05c32b0 100644 --- a/gcc/testsuite/gcc.target/i386/memset-pr120683-15.c +++ b/gcc/testsuite/gcc.target/i386/memset-pr120683-15.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=x86-64-v3 -fasynchronous-unwind-tables -fdwarf2-cfi-asm -mmemset-strategy=vector_loop:256:noalign,libcall:-1:noalign -minline-all-stringops" } */ +/* { dg-options "-O2 -march=x86-64-v3 -mmemset-strategy=vector_loop:256:noalign,libcall:-1:noalign -minline-all-stringops" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/memset-pr120683-16.c b/gcc/testsuite/gcc.target/i386/memset-pr120683-16.c index 539714c..dc8f524 100644 --- a/gcc/testsuite/gcc.target/i386/memset-pr120683-16.c +++ b/gcc/testsuite/gcc.target/i386/memset-pr120683-16.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=x86-64-v4 -fasynchronous-unwind-tables -fdwarf2-cfi-asm -mmemset-strategy=vector_loop:256:noalign,libcall:-1:noalign -minline-all-stringops" } */ +/* { dg-options "-O2 -march=x86-64-v4 -mmemset-strategy=vector_loop:256:noalign,libcall:-1:noalign -minline-all-stringops" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/memset-pr120683-17.c b/gcc/testsuite/gcc.target/i386/memset-pr120683-17.c index f58cb28..60885a4 100644 --- a/gcc/testsuite/gcc.target/i386/memset-pr120683-17.c +++ b/gcc/testsuite/gcc.target/i386/memset-pr120683-17.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=x86-64 -fasynchronous-unwind-tables -fdwarf2-cfi-asm -mmemset-strategy=vector_loop:256:noalign,libcall:-1:noalign" } */ +/* { dg-options "-O2 -march=x86-64 -mmemset-strategy=vector_loop:256:noalign,libcall:-1:noalign" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/memset-pr120683-18.c b/gcc/testsuite/gcc.target/i386/memset-pr120683-18.c index a127028..ec2fabf 100644 --- a/gcc/testsuite/gcc.target/i386/memset-pr120683-18.c +++ b/gcc/testsuite/gcc.target/i386/memset-pr120683-18.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=x86-64 -fasynchronous-unwind-tables -fdwarf2-cfi-asm -mmemset-strategy=vector_loop:256:noalign,libcall:-1:noalign" } */ +/* { dg-options "-O2 -march=x86-64 -mmemset-strategy=vector_loop:256:noalign,libcall:-1:noalign" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/memset-pr120683-19.c b/gcc/testsuite/gcc.target/i386/memset-pr120683-19.c index 8dd5ae6..65d8154 100644 --- a/gcc/testsuite/gcc.target/i386/memset-pr120683-19.c +++ b/gcc/testsuite/gcc.target/i386/memset-pr120683-19.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=x86-64 -fasynchronous-unwind-tables -fdwarf2-cfi-asm -mmemset-strategy=vector_loop:256:noalign,libcall:-1:noalign" } */ +/* { dg-options "-O2 -march=x86-64 -mmemset-strategy=vector_loop:256:noalign,libcall:-1:noalign" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/memset-pr120683-2.c b/gcc/testsuite/gcc.target/i386/memset-pr120683-2.c index 3b84b29..fa5840b 100644 --- a/gcc/testsuite/gcc.target/i386/memset-pr120683-2.c +++ b/gcc/testsuite/gcc.target/i386/memset-pr120683-2.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=x86-64-v3 -fasynchronous-unwind-tables -fdwarf2-cfi-asm -mmemset-strategy=vector_loop:256:noalign,libcall:-1:noalign" } */ +/* { dg-options "-O2 -march=x86-64-v3 -mmemset-strategy=vector_loop:256:noalign,libcall:-1:noalign" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/memset-pr120683-20.c b/gcc/testsuite/gcc.target/i386/memset-pr120683-20.c index b8b9cb7..9093a23 100644 --- a/gcc/testsuite/gcc.target/i386/memset-pr120683-20.c +++ b/gcc/testsuite/gcc.target/i386/memset-pr120683-20.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=x86-64 -fasynchronous-unwind-tables -fdwarf2-cfi-asm -mmemset-strategy=vector_loop:256:noalign,libcall:-1:noalign" } */ +/* { dg-options "-O2 -march=x86-64 -mmemset-strategy=vector_loop:256:noalign,libcall:-1:noalign" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/memset-pr120683-21.c b/gcc/testsuite/gcc.target/i386/memset-pr120683-21.c index 3c7bb7c..31113f9 100644 --- a/gcc/testsuite/gcc.target/i386/memset-pr120683-21.c +++ b/gcc/testsuite/gcc.target/i386/memset-pr120683-21.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=x86-64 -fasynchronous-unwind-tables -fdwarf2-cfi-asm -mmemset-strategy=vector_loop:256:noalign,libcall:-1:noalign" } */ +/* { dg-options "-O2 -march=x86-64 -mmemset-strategy=vector_loop:256:noalign,libcall:-1:noalign" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/memset-pr120683-22.c b/gcc/testsuite/gcc.target/i386/memset-pr120683-22.c index 96a21c8..41d60089 100644 --- a/gcc/testsuite/gcc.target/i386/memset-pr120683-22.c +++ b/gcc/testsuite/gcc.target/i386/memset-pr120683-22.c @@ -1,5 +1,6 @@ /* { dg-do compile { target { ! ia32 } } } */ -/* { dg-options "-O2 -march=x86-64 -fasynchronous-unwind-tables -fdwarf2-cfi-asm -mmemset-strategy=rep_8byte:8192:align,libcall:-1:noalign" } */ +/* { dg-options "-O2 -march=x86-64 -mmemset-strategy=rep_8byte:8192:align,libcall:-1:noalign" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/memset-pr120683-23.c b/gcc/testsuite/gcc.target/i386/memset-pr120683-23.c index f3f5d80..547e1a7 100644 --- a/gcc/testsuite/gcc.target/i386/memset-pr120683-23.c +++ b/gcc/testsuite/gcc.target/i386/memset-pr120683-23.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=x86-64 -fasynchronous-unwind-tables -fdwarf2-cfi-asm -minline-all-stringops -mmemset-strategy=vector_loop:256:noalign,libcall:-1:noalign" } */ +/* { dg-options "-O2 -march=x86-64 -minline-all-stringops -mmemset-strategy=vector_loop:256:noalign,libcall:-1:noalign" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/memset-pr120683-3.c b/gcc/testsuite/gcc.target/i386/memset-pr120683-3.c index faa47ca..781e6d5 100644 --- a/gcc/testsuite/gcc.target/i386/memset-pr120683-3.c +++ b/gcc/testsuite/gcc.target/i386/memset-pr120683-3.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=x86-64-v4 -fasynchronous-unwind-tables -fdwarf2-cfi-asm -mmemset-strategy=vector_loop:256:noalign,libcall:-1:noalign" } */ +/* { dg-options "-O2 -march=x86-64-v4 -mmemset-strategy=vector_loop:256:noalign,libcall:-1:noalign" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/memset-pr120683-4.c b/gcc/testsuite/gcc.target/i386/memset-pr120683-4.c index dc3aa57b..2569db4 100644 --- a/gcc/testsuite/gcc.target/i386/memset-pr120683-4.c +++ b/gcc/testsuite/gcc.target/i386/memset-pr120683-4.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=x86-64 -fasynchronous-unwind-tables -fdwarf2-cfi-asm -mmemset-strategy=vector_loop:256:noalign,libcall:-1:noalign -minline-all-stringops" } */ +/* { dg-options "-O2 -march=x86-64 -mmemset-strategy=vector_loop:256:noalign,libcall:-1:noalign -minline-all-stringops" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/memset-pr120683-5.c b/gcc/testsuite/gcc.target/i386/memset-pr120683-5.c index a324f8e..e2114b4 100644 --- a/gcc/testsuite/gcc.target/i386/memset-pr120683-5.c +++ b/gcc/testsuite/gcc.target/i386/memset-pr120683-5.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=x86-64-v3 -fasynchronous-unwind-tables -fdwarf2-cfi-asm -mmemset-strategy=vector_loop:256:noalign,libcall:-1:noalign -minline-all-stringops" } */ +/* { dg-options "-O2 -march=x86-64-v3 -mmemset-strategy=vector_loop:256:noalign,libcall:-1:noalign -minline-all-stringops" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/memset-pr120683-6.c b/gcc/testsuite/gcc.target/i386/memset-pr120683-6.c index 64e7589..33cea66 100644 --- a/gcc/testsuite/gcc.target/i386/memset-pr120683-6.c +++ b/gcc/testsuite/gcc.target/i386/memset-pr120683-6.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=x86-64-v4 -fasynchronous-unwind-tables -fdwarf2-cfi-asm -mmemset-strategy=vector_loop:256:noalign,libcall:-1:noalign -minline-all-stringops" } */ +/* { dg-options "-O2 -march=x86-64-v4 -mmemset-strategy=vector_loop:256:noalign,libcall:-1:noalign -minline-all-stringops" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/memset-pr120683-7.c b/gcc/testsuite/gcc.target/i386/memset-pr120683-7.c index 022f6f9..04043df 100644 --- a/gcc/testsuite/gcc.target/i386/memset-pr120683-7.c +++ b/gcc/testsuite/gcc.target/i386/memset-pr120683-7.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=x86-64 -fasynchronous-unwind-tables -fdwarf2-cfi-asm -mmemset-strategy=vector_loop:256:noalign,libcall:-1:noalign -minline-all-stringops" } */ +/* { dg-options "-O2 -march=x86-64 -mmemset-strategy=vector_loop:256:noalign,libcall:-1:noalign -minline-all-stringops" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/memset-pr120683-8.c b/gcc/testsuite/gcc.target/i386/memset-pr120683-8.c index 5254e21..1e5e102 100644 --- a/gcc/testsuite/gcc.target/i386/memset-pr120683-8.c +++ b/gcc/testsuite/gcc.target/i386/memset-pr120683-8.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=x86-64-v3 -fasynchronous-unwind-tables -fdwarf2-cfi-asm -mmemset-strategy=vector_loop:256:noalign,libcall:-1:noalign -minline-all-stringops" } */ +/* { dg-options "-O2 -march=x86-64-v3 -mmemset-strategy=vector_loop:256:noalign,libcall:-1:noalign -minline-all-stringops" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/memset-pr120683-9.c b/gcc/testsuite/gcc.target/i386/memset-pr120683-9.c index 1719de6..c6f0b77 100644 --- a/gcc/testsuite/gcc.target/i386/memset-pr120683-9.c +++ b/gcc/testsuite/gcc.target/i386/memset-pr120683-9.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=x86-64-v4 -fasynchronous-unwind-tables -fdwarf2-cfi-asm -mmemset-strategy=vector_loop:256:noalign,libcall:-1:noalign -minline-all-stringops" } */ +/* { dg-options "-O2 -march=x86-64-v4 -mmemset-strategy=vector_loop:256:noalign,libcall:-1:noalign -minline-all-stringops" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/memset-pr70308-1a.c b/gcc/testsuite/gcc.target/i386/memset-pr70308-1a.c index 5cc4eee..4cba474 100644 --- a/gcc/testsuite/gcc.target/i386/memset-pr70308-1a.c +++ b/gcc/testsuite/gcc.target/i386/memset-pr70308-1a.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=x86-64 -fasynchronous-unwind-tables -fdwarf2-cfi-asm" } */ +/* { dg-options "-O2 -march=x86-64" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/memset-pr70308-1b.c b/gcc/testsuite/gcc.target/i386/memset-pr70308-1b.c index 15996ea..425a123 100644 --- a/gcc/testsuite/gcc.target/i386/memset-pr70308-1b.c +++ b/gcc/testsuite/gcc.target/i386/memset-pr70308-1b.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=x86-64 -fasynchronous-unwind-tables -fdwarf2-cfi-asm -fomit-frame-pointer -DUSE_SCANF" } */ +/* { dg-options "-O2 -march=x86-64 -fomit-frame-pointer -DUSE_SCANF" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/memset-strategy-10.c b/gcc/testsuite/gcc.target/i386/memset-strategy-10.c index b4a93a7..4a69875 100644 --- a/gcc/testsuite/gcc.target/i386/memset-strategy-10.c +++ b/gcc/testsuite/gcc.target/i386/memset-strategy-10.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-Os -march=x86-64 -mstringop-strategy=vector_loop -fasynchronous-unwind-tables -fdwarf2-cfi-asm" } */ +/* { dg-options "-Os -march=x86-64 -mstringop-strategy=vector_loop" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target { ! ia32 } } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/memset-strategy-13.c b/gcc/testsuite/gcc.target/i386/memset-strategy-13.c index be67610..925874c 100644 --- a/gcc/testsuite/gcc.target/i386/memset-strategy-13.c +++ b/gcc/testsuite/gcc.target/i386/memset-strategy-13.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-Os -mno-sse -mstringop-strategy=unrolled_loop -fasynchronous-unwind-tables -fdwarf2-cfi-asm" } */ +/* { dg-options "-Os -mno-sse -mstringop-strategy=unrolled_loop" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target { ! ia32 } } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/memset-strategy-25.c b/gcc/testsuite/gcc.target/i386/memset-strategy-25.c index 7bd5d43..4e2c2df 100644 --- a/gcc/testsuite/gcc.target/i386/memset-strategy-25.c +++ b/gcc/testsuite/gcc.target/i386/memset-strategy-25.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mtune=generic -mno-sse -fasynchronous-unwind-tables -fdwarf2-cfi-asm" } */ +/* { dg-options "-O2 -mtune=generic -mno-sse" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/memset-strategy-28.c b/gcc/testsuite/gcc.target/i386/memset-strategy-28.c index eef113f..5621d32 100644 --- a/gcc/testsuite/gcc.target/i386/memset-strategy-28.c +++ b/gcc/testsuite/gcc.target/i386/memset-strategy-28.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mtune=generic -mno-sse -fasynchronous-unwind-tables -fdwarf2-cfi-asm" } */ +/* { dg-options "-O2 -mtune=generic -mno-sse" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/memset-strategy-29.c b/gcc/testsuite/gcc.target/i386/memset-strategy-29.c index a33bf92..e8934f1 100644 --- a/gcc/testsuite/gcc.target/i386/memset-strategy-29.c +++ b/gcc/testsuite/gcc.target/i386/memset-strategy-29.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mtune=generic -mno-sse -fasynchronous-unwind-tables -fdwarf2-cfi-asm" } */ +/* { dg-options "-O2 -mtune=generic -mno-sse" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/memset-strategy-30.c b/gcc/testsuite/gcc.target/i386/memset-strategy-30.c index f3912f8..3a0e14a 100644 --- a/gcc/testsuite/gcc.target/i386/memset-strategy-30.c +++ b/gcc/testsuite/gcc.target/i386/memset-strategy-30.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mtune=generic -mno-sse -fasynchronous-unwind-tables -fdwarf2-cfi-asm" } */ +/* { dg-options "-O2 -mtune=generic -mno-sse" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/nop-mcount-m16.c b/gcc/testsuite/gcc.target/i386/nop-mcount-m16.c new file mode 100644 index 0000000..15b8a38 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/nop-mcount-m16.c @@ -0,0 +1,13 @@ +/* Test -mnop-mcount for 16-bit code to generate a 3-byte NOP */ +/* { dg-do compile { target { *-*-linux* && nonpic } } } */ +/* { dg-require-effective-target mfentry } */ +/* { dg-options "-pg -mfentry -mnop-mcount -m16" } */ +/* { dg-final { scan-assembler-not "__fentry__" } } */ +/* { dg-final { scan-assembler-not "0x0f, 0x1f, 0x44, 0x00, 0x00" } } */ +/* { dg-final { scan-assembler-times "0x8d, 0x74, 0x00" 1 } } */ +extern void foobar(char *); + +void func(void) +{ + foobar ("Hello world\n"); +} diff --git a/gcc/testsuite/gcc.target/i386/nop-mcount.c b/gcc/testsuite/gcc.target/i386/nop-mcount.c index ee3c97f..35cfef0 100644 --- a/gcc/testsuite/gcc.target/i386/nop-mcount.c +++ b/gcc/testsuite/gcc.target/i386/nop-mcount.c @@ -1,8 +1,9 @@ /* Test -mnop-mcount */ /* { dg-do compile { target { *-*-linux* && nonpic } } } */ /* { dg-require-effective-target mfentry } */ -/* { dg-options "-Wno-old-style-definition -pg -mfentry -mrecord-mcount -mnop-mcount" } */ +/* { dg-options "-pg -mfentry -mrecord-mcount -mnop-mcount" } */ /* { dg-final { scan-assembler-not "__fentry__" } } */ +/* { dg-final { scan-assembler-times "0x0f, 0x1f, 0x44, 0x00, 0x00" 3 } } */ /* Origin: Andi Kleen */ extern void foobar(char *); @@ -18,8 +19,7 @@ void func2(void) foobar ("Hello world"); } -void func3(a) -char *a; +void func3(char *a) { foobar("Hello world"); } diff --git a/gcc/testsuite/gcc.target/i386/pr111673.c b/gcc/testsuite/gcc.target/i386/pr111673.c index 0f08ba89..6b30d46 100644 --- a/gcc/testsuite/gcc.target/i386/pr111673.c +++ b/gcc/testsuite/gcc.target/i386/pr111673.c @@ -1,5 +1,6 @@ /* { dg-do compile { target { ! ia32 } } } */ -/* { dg-options "-O2 -fdump-rtl-pro_and_epilogue -fasynchronous-unwind-tables -fdwarf2-cfi-asm" } */ +/* { dg-options "-O2 -fdump-rtl-pro_and_epilogue" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target "*-*-*" } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr116896.c b/gcc/testsuite/gcc.target/i386/pr116896.c index 9d1bd88..07b9d2d 100644 --- a/gcc/testsuite/gcc.target/i386/pr116896.c +++ b/gcc/testsuite/gcc.target/i386/pr116896.c @@ -1,6 +1,6 @@ /* PR middle-end/116896 */ /* { dg-do compile } */ -/* { dg-options "-O2 -masm=att -fno-stack-protector" } */ +/* { dg-options "-O2 -masm=att -fno-stack-protector -mtune=generic" } */ /* { dg-final { scan-assembler-times "\tjp\t" 2 } } */ /* { dg-final { scan-assembler-not "\tj\[^mp\]\[a-z\]*\t" } } */ /* { dg-final { scan-assembler-times "\tsbb\[bl\]\t\\\$0, " 4 } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr120936-1.c b/gcc/testsuite/gcc.target/i386/pr120936-1.c index a20680d..342487f 100644 --- a/gcc/testsuite/gcc.target/i386/pr120936-1.c +++ b/gcc/testsuite/gcc.target/i386/pr120936-1.c @@ -1,5 +1,6 @@ -/* { dg-do compile { target fpic } } */ +/* { dg-do compile { target { *-*-linux* && fpic } } } */ /* { dg-options "-O2 -pg -mno-fentry -fno-pic -fno-shrink-wrap" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target "*-*-*" } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr120936-10.c b/gcc/testsuite/gcc.target/i386/pr120936-10.c index ab95b08..6107a5c 100644 --- a/gcc/testsuite/gcc.target/i386/pr120936-10.c +++ b/gcc/testsuite/gcc.target/i386/pr120936-10.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target { fpic && lp64 } } } */ +/* { dg-do compile { target { { *-*-linux* && lp64 } && fpic } } } */ /* { dg-options "-O2 -mcmodel=large -pg -mno-fentry -fpic -fno-shrink-wrap" } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target "*-*-*" } {^(1|\t?\.)} } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr120936-11.c b/gcc/testsuite/gcc.target/i386/pr120936-11.c index 3e39dfe..90995f8 100644 --- a/gcc/testsuite/gcc.target/i386/pr120936-11.c +++ b/gcc/testsuite/gcc.target/i386/pr120936-11.c @@ -1,5 +1,6 @@ -/* { dg-do compile { target { fpic && lp64 } } } */ +/* { dg-do compile { target { { *-*-linux* && lp64 } && fpic } } } */ /* { dg-options "-O2 -mrecord-mcount -mcmodel=large -pg -mno-fentry -fno-pic -fno-shrink-wrap" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target "*-*-*" } {^(1|\t?\.)} } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr120936-12.c b/gcc/testsuite/gcc.target/i386/pr120936-12.c index b5a2aac..fdeaf67 100644 --- a/gcc/testsuite/gcc.target/i386/pr120936-12.c +++ b/gcc/testsuite/gcc.target/i386/pr120936-12.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target { fpic && lp64 } } } */ +/* { dg-do compile { target { { *-*-linux* && lp64 } && fpic } } } */ /* { dg-options "-O2 -mcmodel=large -mrecord-mcount -pg -mno-fentry -fpic -fno-shrink-wrap" } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target "*-*-*" } {^(1|\t?\.)} } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr120936-2.c b/gcc/testsuite/gcc.target/i386/pr120936-2.c index 0835658..615cc05 100644 --- a/gcc/testsuite/gcc.target/i386/pr120936-2.c +++ b/gcc/testsuite/gcc.target/i386/pr120936-2.c @@ -1,5 +1,6 @@ -/* { dg-do compile { target fpic } } */ +/* { dg-do compile { target { *-*-linux* && fpic } } } */ /* { dg-options "-O2 -pg -mno-fentry -fpic -fno-shrink-wrap" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target "*-*-*" } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr120936-3.c b/gcc/testsuite/gcc.target/i386/pr120936-3.c index dc0a8f1..44a1173 100644 --- a/gcc/testsuite/gcc.target/i386/pr120936-3.c +++ b/gcc/testsuite/gcc.target/i386/pr120936-3.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target fpic } } */ +/* { dg-do compile { target { *-*-linux* && fpic } } } */ /* { dg-options "-O2 -mnop-mcount -pg -mno-fentry -fno-pic -fno-shrink-wrap" } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target "*-*-*" } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr120936-4.c b/gcc/testsuite/gcc.target/i386/pr120936-4.c index 2420f0b..8580ec4 100644 --- a/gcc/testsuite/gcc.target/i386/pr120936-4.c +++ b/gcc/testsuite/gcc.target/i386/pr120936-4.c @@ -1,5 +1,6 @@ -/* { dg-do compile { target fpic } } */ +/* { dg-do compile { target { *-*-linux* && fpic } } } */ /* { dg-options "-O2 -pg -mno-fentry -mrecord-mcount -fno-pic -fno-shrink-wrap" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target "*-*-*" } {^(1|\t?\.)} } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr120936-5.c b/gcc/testsuite/gcc.target/i386/pr120936-5.c index 20ecd37..697e8d1 100644 --- a/gcc/testsuite/gcc.target/i386/pr120936-5.c +++ b/gcc/testsuite/gcc.target/i386/pr120936-5.c @@ -1,5 +1,6 @@ -/* { dg-do compile { target fpic } } */ +/* { dg-do compile { target { *-*-linux* && fpic } } } */ /* { dg-options "-O2 -pg -mrecord-mcount -mno-fentry -fpic -fno-shrink-wrap" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target "*-*-*" } {^(1|\t?\.)} } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr120936-6.c b/gcc/testsuite/gcc.target/i386/pr120936-6.c index 6e2290f..013b5e8 100644 --- a/gcc/testsuite/gcc.target/i386/pr120936-6.c +++ b/gcc/testsuite/gcc.target/i386/pr120936-6.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target fpic } } */ +/* { dg-do compile { target { *-*-linux* && fpic } } } */ /* { dg-options "-O2 -mrecord-mcount -mnop-mcount -pg -mno-fentry -fno-pic -fno-shrink-wrap" } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target "*-*-*" } {^(1|\t?\.)} } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr120936-9.c b/gcc/testsuite/gcc.target/i386/pr120936-9.c index 3f4b387..6a9f4c1 100644 --- a/gcc/testsuite/gcc.target/i386/pr120936-9.c +++ b/gcc/testsuite/gcc.target/i386/pr120936-9.c @@ -1,5 +1,6 @@ -/* { dg-do compile { target { fpic && lp64 } } } */ +/* { dg-do compile { target { { *-*-linux* && lp64 } && fpic } } } */ /* { dg-options "-O2 -mcmodel=large -pg -mno-fentry -fno-pic -fno-shrink-wrap" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target "*-*-*" } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr121062-1.c b/gcc/testsuite/gcc.target/i386/pr121062-1.c index 799f856..c334df6 100644 --- a/gcc/testsuite/gcc.target/i386/pr121062-1.c +++ b/gcc/testsuite/gcc.target/i386/pr121062-1.c @@ -31,4 +31,4 @@ render_result_from_bake_h(int tx) } } -/* { dg-final { scan-assembler-times "movq\[ \\t\]+\\\$-1, %r\[a-z0-9\]+" 2 { target { ! ia32 } } } } */ +/* { dg-final { scan-assembler-times "movq\[ \\t\]+\\\$-1, %r\[a-z0-9\]+" 1 { target { ! ia32 } } } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr121230.c b/gcc/testsuite/gcc.target/i386/pr121230.c new file mode 100644 index 0000000..67c9c5c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr121230.c @@ -0,0 +1,16 @@ +/* { dg-do compile { target ia32 } } */ +/* { dg-options "-O3 -march=athlon-xp -mfpmath=387 -fexcess-precision=standard" } */ + +typedef struct { + float a; + float b; +} f32_2; + +f32_2 add32_2(f32_2 x, f32_2 y) { + return (f32_2){ x.a + y.a, x.b + y.b}; +} + +/* We do not want the vectorizer to vectorize the store and/or the + conversion (with IA32 we do not support V2SF add) given that spills + FP regs to reload them to XMM. */ +/* { dg-final { scan-assembler-not "movss\[ \\t\]+\[0-9\]*\\\(%esp\\\), %xmm" } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr122343-1a.c b/gcc/testsuite/gcc.target/i386/pr122343-1a.c new file mode 100644 index 0000000..7076d88 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr122343-1a.c @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fomit-frame-pointer" } */ +/* { dg-additional-options "-mregparm=1" { target ia32 } } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target *-*-* } {^\t?\.} } } */ + +/* +**foo: +**.LFB0: +** .cfi_startproc +** imull \$123, %e(di|ax), %eax +** addl bar(|\(%rip\)), %eax +** ret +** .cfi_endproc +**... +*/ + +extern volatile int bar; + +int +foo (int z) +{ + z *= 123; + return bar + z; +} diff --git a/gcc/testsuite/gcc.target/i386/pr122343-1b.c b/gcc/testsuite/gcc.target/i386/pr122343-1b.c new file mode 100644 index 0000000..989d3b2 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr122343-1b.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fomit-frame-pointer -fno-fuse-ops-with-volatile-access" } */ +/* { dg-additional-options "-mregparm=1" { target ia32 } } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target *-*-* } {^\t?\.} } } */ + +/* +**foo: +**.LFB0: +** .cfi_startproc +** imull \$123, %e(di|ax), %eax +** movl bar(|\(%rip\)), %edx +** addl %edx, %eax +** ret +** .cfi_endproc +**... +*/ + +#include "pr122343-1a.c" diff --git a/gcc/testsuite/gcc.target/i386/pr122343-2a.c b/gcc/testsuite/gcc.target/i386/pr122343-2a.c new file mode 100644 index 0000000..f7ee021 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr122343-2a.c @@ -0,0 +1,23 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fomit-frame-pointer" } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target *-*-* } {^\t?\.} } } */ + +/* +**foo: +**.LFB0: +** .cfi_startproc +** movl bar1(|\(%rip\)), %eax +** addl bar2(|\(%rip\)), %eax +** ret +** .cfi_endproc +**... +*/ + +extern volatile int bar1, bar2; + +int +foo (void) +{ + return bar1 + bar2; +} diff --git a/gcc/testsuite/gcc.target/i386/pr122343-2b.c b/gcc/testsuite/gcc.target/i386/pr122343-2b.c new file mode 100644 index 0000000..d4a1151 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr122343-2b.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fomit-frame-pointer -fno-fuse-ops-with-volatile-access" } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target *-*-* } {^\t?\.} } } */ + +/* +**foo: +**.LFB0: +** .cfi_startproc +** movl bar1(|\(%rip\)), %eax +** movl bar2(|\(%rip\)), %edx +** addl %edx, %eax +** ret +** .cfi_endproc +**... +*/ + +#include "pr122343-2a.c" diff --git a/gcc/testsuite/gcc.target/i386/pr122343-3.c b/gcc/testsuite/gcc.target/i386/pr122343-3.c new file mode 100644 index 0000000..335f777 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr122343-3.c @@ -0,0 +1,22 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fomit-frame-pointer" } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target *-*-* } {^\t?\.} } } */ + +/* +**foo: +**.LFB0: +** .cfi_startproc +** addl \$123, bar(|\(%rip\)) +** ret +** .cfi_endproc +**... +*/ + +extern volatile int bar; + +void +foo (void) +{ + bar += 123; +} diff --git a/gcc/testsuite/gcc.target/i386/pr122343-4a.c b/gcc/testsuite/gcc.target/i386/pr122343-4a.c new file mode 100644 index 0000000..3ae07a2 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr122343-4a.c @@ -0,0 +1,33 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fomit-frame-pointer" } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target *-*-* } {^\t?\.} } } */ + +/* +**foo: +**.LFB0: +** .cfi_startproc +** movl bar(|\(%rip\)), %eax +** movl bar(|\(%rip\)), %eax +**... +** barrier +**... +** addl bar(|\(%rip\)), %eax +** subl bar(|\(%rip\)), %eax +** ret +** .cfi_endproc +**... +*/ + +extern volatile int bar; + +int +foo (void) +{ + int h = bar; + int r = bar; + asm volatile ("barrier" ::: "memory"); + int p = bar; + p = p + r; + return p - bar; +} diff --git a/gcc/testsuite/gcc.target/i386/pr122343-4b.c b/gcc/testsuite/gcc.target/i386/pr122343-4b.c new file mode 100644 index 0000000..31a990e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr122343-4b.c @@ -0,0 +1,24 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fomit-frame-pointer -fno-fuse-ops-with-volatile-access" } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target *-*-* } {^\t?\.} } } */ + +/* +**foo: +**.LFB0: +** .cfi_startproc +** movl bar(|\(%rip\)), %eax +** movl bar(|\(%rip\)), %eax +**... +** barrier +**... +** movl bar(|\(%rip\)), %ecx +** movl bar(|\(%rip\)), %edx +** addl %ecx, %eax +** subl %edx, %eax +** ret +** .cfi_endproc +**... +*/ + +#include "pr122343-4a.c" diff --git a/gcc/testsuite/gcc.target/i386/pr122343-5a.c b/gcc/testsuite/gcc.target/i386/pr122343-5a.c new file mode 100644 index 0000000..3d133b6 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr122343-5a.c @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fomit-frame-pointer" } */ +/* { dg-additional-options "-mregparm=1" { target ia32 } } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target *-*-* } {^\t?\.} } } */ + +/* +**foo: +**.LFB0: +** .cfi_startproc +** imull \$123, %e(di|ax), %e(di|ax) +** addl %e(di|ax), bar(|\(%rip\)) +** ret +** .cfi_endproc +**... +*/ + +extern volatile int bar; + +void +foo (int z) +{ + z *= 123; + bar += z; +} diff --git a/gcc/testsuite/gcc.target/i386/pr122343-5b.c b/gcc/testsuite/gcc.target/i386/pr122343-5b.c new file mode 100644 index 0000000..5f64496 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr122343-5b.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fomit-frame-pointer -fno-fuse-ops-with-volatile-access" } */ +/* { dg-additional-options "-mregparm=1" { target ia32 } } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target *-*-* } {^\t?\.} } } */ + +/* +**foo: +**.LFB0: +** .cfi_startproc +** imull \$123, %e(di|ax), %e(di|ax) +** movl bar(|\(%rip\)), %e(dx|ax) +** addl %e(dx|ax), %e(di|ax) +** movl %e(di|ax), bar(|\(%rip\)) +** ret +** .cfi_endproc +**... +*/ + +#include "pr122343-5a.c" diff --git a/gcc/testsuite/gcc.target/i386/pr122343-6a.c b/gcc/testsuite/gcc.target/i386/pr122343-6a.c new file mode 100644 index 0000000..9401826 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr122343-6a.c @@ -0,0 +1,37 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fomit-frame-pointer" } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target { *-*-* } } {^\t?\.} } } */ + +/* +**foo: +**.LFB0: +** .cfi_startproc +** movl bar(|\(%rip\)), %eax +** movl bar(|\(%rip\)), %eax +** imull \$123, %eax, %edx +** movl %edx, bar(|\(%rip\)) +**... +** barrier +**... +** movl bar(|\(%rip\)), %edx +** addl %edx, %eax +** subl %eax, bar(|\(%rip\)) +** ret +** .cfi_endproc +**... +*/ + +extern volatile int bar; + +void +foo (void) +{ + int h = bar; + int r = bar; + bar = r * 123; + asm volatile ("barrier" ::: "memory"); + int p = bar; + p = p + r; + bar -= p; +} diff --git a/gcc/testsuite/gcc.target/i386/pr122343-6b.c b/gcc/testsuite/gcc.target/i386/pr122343-6b.c new file mode 100644 index 0000000..f741f5c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr122343-6b.c @@ -0,0 +1,27 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fomit-frame-pointer -fno-fuse-ops-with-volatile-access" } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target *-*-* } {^\t?\.} } } */ + +/* +**foo: +**.LFB0: +** .cfi_startproc +** movl bar(|\(%rip\)), %eax +** movl bar(|\(%rip\)), %eax +** imull \$123, %eax, %edx +** movl %edx, bar(|\(%rip\)) +**... +** barrier +**... +** movl bar(|\(%rip\)), %ecx +** movl bar(|\(%rip\)), %edx +** addl %ecx, %eax +** subl %eax, %edx +** movl %edx, bar(|\(%rip\)) +** ret +** .cfi_endproc +**... +*/ + +#include "pr122343-6a.c" diff --git a/gcc/testsuite/gcc.target/i386/pr122343-7.c b/gcc/testsuite/gcc.target/i386/pr122343-7.c new file mode 100644 index 0000000..0e4edd1 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr122343-7.c @@ -0,0 +1,27 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fomit-frame-pointer" } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target *-*-* } {^\t?\.} } } */ + +/* +**test: +**.LFB0: +** .cfi_startproc +** movzbl u8(|\(%rip\)), %eax +** addb %al, u8(|\(%rip\)) +** movzbl u8(|\(%rip\)), %eax +** subb u8(|\(%rip\)), %al +** movb %al, u8(|\(%rip\)) +** ret +** .cfi_endproc +**... +*/ + +extern volatile unsigned char u8; + +void +test (void) +{ + u8 = u8 + u8; + u8 = u8 - u8; +} diff --git a/gcc/testsuite/gcc.target/i386/pr122390-1.c b/gcc/testsuite/gcc.target/i386/pr122390-1.c new file mode 100644 index 0000000..9120dd4 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr122390-1.c @@ -0,0 +1,26 @@ +/* PR target/122390 */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +int f (int); +int g (int); + +int f1 (unsigned a, unsigned b) +{ + unsigned t = a < b; + int tt = a + b + t; + if (tt < 0) + return f(tt); + return g(tt); +} + +int f2 (unsigned a, unsigned b) +{ + unsigned t = a < b; + int tt = a - b - t; + if (tt < 0) + return f(tt); + return g(tt); +} + +/* { dg-final { scan-assembler-not "test" } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr122390.c b/gcc/testsuite/gcc.target/i386/pr122390.c new file mode 100644 index 0000000..a12849a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr122390.c @@ -0,0 +1,44 @@ +/* PR target/122390 */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +int f (int); +int g (int); + +int f1 (unsigned a, unsigned b) +{ + unsigned t = a < b; + int tt = a + t; + if (tt == 0) + return f(tt); + return g(tt); +} + +int f2 (unsigned a, unsigned b) +{ + unsigned t = a <= b; + int tt = a + t; + if (tt < 0) + return f(tt); + return g(tt); +} + +int f3 (unsigned a, unsigned b) +{ + unsigned t = a > b; + int tt = a - t; + if (tt == 0) + return f(tt); + return g(tt); +} + +int f4 (unsigned a, unsigned b) +{ + unsigned t = a >= b; + int tt = a - t; + if (tt < 0) + return f(tt); + return g(tt); +} + +/* { dg-final { scan-assembler-not "test" } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr122518.c b/gcc/testsuite/gcc.target/i386/pr122518.c new file mode 100644 index 0000000..2791889 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr122518.c @@ -0,0 +1,15 @@ +/* PR target/122518 */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +inline unsigned min (unsigned a, unsigned b) +{ + return (a < b) ? a : b; +} + +unsigned uminsub (unsigned a, unsigned b) +{ + return min (a - b, a); +} + +/* { dg-final { scan-assembler-not "cmp" } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr122534.c b/gcc/testsuite/gcc.target/i386/pr122534.c new file mode 100644 index 0000000..b1988fb --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr122534.c @@ -0,0 +1,15 @@ +/* PR target/122534 */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +int test (unsigned long p[6], int index) +{ + __SIZE_TYPE__ i; + + for (i = 0; i < 6; i++) + if (p[i] & (1UL << index)) + return i; + return 0; +} + +/* { dg-final { scan-assembler-not "and" } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr122598.c b/gcc/testsuite/gcc.target/i386/pr122598.c new file mode 100644 index 0000000..0b943b1 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr122598.c @@ -0,0 +1,14 @@ +/* PR target/122598 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -mavx512f -mgfni" } */ + +typedef char V __attribute__ ((vector_size (64))); + +V +foo (V v) +{ + v >>= (V) {5}; + v -= ~0; + v += (V) {} < v; + return v; +} diff --git a/gcc/testsuite/gcc.target/i386/pr122675-1.c b/gcc/testsuite/gcc.target/i386/pr122675-1.c new file mode 100644 index 0000000..fb41f5b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr122675-1.c @@ -0,0 +1,33 @@ +/* Verify that the most likely BB edges are optimized as fallthroughs. */ +/* { dg-do compile } */ +/* { dg-options "-O1 -fno-pic -march=x86-64 -mtune=generic -mgeneral-regs-only" } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ + +/* +**test: +**.LFB[0-9]+: +** .cfi_startproc +** testl %edi, %edi +** je .L[0-9]* +** subq \$[0-9]*, %rsp +** .cfi_def_cfa_offset [0-9]* +** call f1 +** addq \$[0-9]*, %rsp +** .cfi_def_cfa_offset [0-9]* +** ret +**.L[0-9]+: +** movl %edi, %eax +** ret +**... +*/ + +int f1(void); + +int test(int a) +{ + if (__builtin_expect(!!a, 1)) { + return f1(); + } + return a; +} diff --git a/gcc/testsuite/gcc.target/i386/pr123027.c b/gcc/testsuite/gcc.target/i386/pr123027.c new file mode 100644 index 0000000..b7effac --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr123027.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -msse -mfpmath=sse -ffinite-math-only" } */ + +float foo (float a, float b) +{ + return a < b ? a : b; +} + +float bar (float a, float b) +{ + return a > b ? a : b; +} + +/* { dg-final { scan-assembler-times "minss" 1 } } */ +/* { dg-final { scan-assembler-times "maxss" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr82142a.c b/gcc/testsuite/gcc.target/i386/pr82142a.c index a536150..d0d6e52 100644 --- a/gcc/testsuite/gcc.target/i386/pr82142a.c +++ b/gcc/testsuite/gcc.target/i386/pr82142a.c @@ -1,5 +1,6 @@ /* { dg-do compile { target { ! ia32 } } } */ -/* { dg-options "-O2 -mno-avx -msse2 -fasynchronous-unwind-tables -fdwarf2-cfi-asm" } */ +/* { dg-options "-O2 -mno-avx -msse2" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target "*-*-*" } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr82142b.c b/gcc/testsuite/gcc.target/i386/pr82142b.c index d18b7c4..d18b7b5 100644 --- a/gcc/testsuite/gcc.target/i386/pr82142b.c +++ b/gcc/testsuite/gcc.target/i386/pr82142b.c @@ -1,5 +1,6 @@ /* { dg-do compile { target ia32 } } */ -/* { dg-options "-O2 -mno-avx -msse2 -mno-stackrealign -fasynchronous-unwind-tables -fdwarf2-cfi-asm" } */ +/* { dg-options "-O2 -mno-avx -msse2 -mno-stackrealign" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target "*-*-*" } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr92080-17.c b/gcc/testsuite/gcc.target/i386/pr92080-17.c index c1d5f42..5b2594b 100644 --- a/gcc/testsuite/gcc.target/i386/pr92080-17.c +++ b/gcc/testsuite/gcc.target/i386/pr92080-17.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=x86-64-v3 -fasynchronous-unwind-tables -fdwarf2-cfi-asm" } */ +/* { dg-options "-O2 -march=x86-64-v3" } */ +/* { dg-add-options check_function_bodies } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target { ! ia32 } } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/shrink_wrap_1.c b/gcc/testsuite/gcc.target/i386/shrink_wrap_1.c index 30b82ab..a7b34c0 100644 --- a/gcc/testsuite/gcc.target/i386/shrink_wrap_1.c +++ b/gcc/testsuite/gcc.target/i386/shrink_wrap_1.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target { ! ia32 } } } */ +/* { dg-do compile { target lp64 } } */ /* { dg-options "-O2 -mmemset-strategy=rep_8byte:-1:align -fdump-rtl-pro_and_epilogue -fno-stack-protector" } */ enum machine_mode diff --git a/gcc/testsuite/gcc.target/i386/vect-epilogues-10.c b/gcc/testsuite/gcc.target/i386/vect-epilogues-10.c new file mode 100644 index 0000000..a187955 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/vect-epilogues-10.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -mavx512f -mprefer-vector-width=512 --param vect-partial-vector-usage=1 -fdump-tree-vect-optimized" } */ + +double foo (double *a, long long *mask, int n) +{ + double sum = 0.0; + for (int i = 0; i < n; ++i) + { + double val; + if (mask[i]) + val = a[i]; + else + val = -0.0; + sum = sum + val; + } + return sum; +} + +/* { dg-final { scan-tree-dump "optimized: loop vectorized using 64 byte vectors" "vect" } } */ +/* { dg-final { scan-tree-dump "optimized: epilogue loop vectorized using masked 64 byte vectors" "vect" } } */ diff --git a/gcc/testsuite/gcc.target/i386/vect-epilogues-6.c b/gcc/testsuite/gcc.target/i386/vect-epilogues-6.c new file mode 100644 index 0000000..8cd8740 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/vect-epilogues-6.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -mavx512vl -mavx512bw -mprefer-vector-width=512 --param vect-partial-vector-usage=0 -fdump-tree-vect-optimized" } */ + +double +foo (double *a, char *mask, int n) +{ + double sum = 0.0; + for (int i = 0; i < n; ++i) + { + double val; + if (mask[i]) + val = a[i]; + else + val = -0.0; + sum = sum + val; + } + return sum; +} + +/* { dg-final { scan-tree-dump "optimized: loop vectorized using 64 byte vectors" "vect" } } */ +/* { dg-final { scan-tree-dump "optimized: epilogue loop vectorized using 32 byte vectors" "vect" } } */ diff --git a/gcc/testsuite/gcc.target/i386/vect-epilogues-7.c b/gcc/testsuite/gcc.target/i386/vect-epilogues-7.c new file mode 100644 index 0000000..63c2989 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/vect-epilogues-7.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -mavx512vl -mavx512bw -mprefer-vector-width=512 --param vect-partial-vector-usage=1 -fdump-tree-vect-optimized" } */ + +double +foo (double *a, char *mask, int n) +{ + double sum = 0.0; + for (int i = 0; i < n; ++i) + { + double val; + if (mask[i]) + val = a[i]; + else + val = -0.0; + sum = sum + val; + } + return sum; +} + +/* { dg-final { scan-tree-dump "optimized: loop vectorized using 64 byte vectors" "vect" } } */ +/* { dg-final { scan-tree-dump "optimized: epilogue loop vectorized using masked 64 byte vectors" "vect" } } */ diff --git a/gcc/testsuite/gcc.target/i386/vect-epilogues-8.c b/gcc/testsuite/gcc.target/i386/vect-epilogues-8.c new file mode 100644 index 0000000..ab5d455 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/vect-epilogues-8.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-Ofast -mavx512vl -mavx512bw -mprefer-vector-width=512 --param vect-partial-vector-usage=0 -fdump-tree-vect-optimized" } */ + +double +foo (double *a, char *mask, int n) +{ + double sum = 0.0; + for (int i = 0; i < n; ++i) + { + double val; + if (mask[i]) + val = a[i]; + else + val = -0.0; + sum = sum + val; + } + return sum; +} + +/* { dg-final { scan-tree-dump "optimized: loop vectorized using 64 byte vectors" "vect" } } */ +/* { dg-final { scan-tree-dump "optimized: epilogue loop vectorized using 32 byte vectors" "vect" } } */ diff --git a/gcc/testsuite/gcc.target/i386/vect-epilogues-9.c b/gcc/testsuite/gcc.target/i386/vect-epilogues-9.c new file mode 100644 index 0000000..72564a8 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/vect-epilogues-9.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-Ofast -mavx512vl -mavx512bw -mprefer-vector-width=512 --param vect-partial-vector-usage=1 -fdump-tree-vect-optimized" } */ + +double +foo (double *a, char *mask, int n) +{ + double sum = 0.0; + for (int i = 0; i < n; ++i) + { + double val; + if (mask[i]) + val = a[i]; + else + val = -0.0; + sum = sum + val; + } + return sum; +} + +/* { dg-final { scan-tree-dump "optimized: loop vectorized using 64 byte vectors" "vect" } } */ +/* { dg-final { scan-tree-dump "optimized: epilogue loop vectorized using masked 64 byte vectors" "vect" } } */ diff --git a/gcc/testsuite/gcc.target/i386/vect-pr122736.c b/gcc/testsuite/gcc.target/i386/vect-pr122736.c new file mode 100644 index 0000000..2719a52 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/vect-pr122736.c @@ -0,0 +1,22 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fopenmp-simd -mavx512vl" } */ + +#pragma omp declare simd +double __attribute__((noinline)) +baz (double x) +{ + return x; +} + +#pragma omp declare simd +double +foo (double d) +{ + return baz (d); +} + +double __attribute__((noipa)) +fn (double x) +{ + return foo (x); +} diff --git a/gcc/testsuite/gcc.target/loongarch/and-large-immediate-opt.c b/gcc/testsuite/gcc.target/loongarch/and-large-immediate-opt.c new file mode 100644 index 0000000..921bef6 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/and-large-immediate-opt.c @@ -0,0 +1,14 @@ +/* { dg-do compile { target { loongarch64*-*-* } } } */ +/* { dg-options "-O3" } */ +/* { dg-final { scan-assembler-not "\tlu12i.w" } } */ +/* { dg-final { scan-assembler-not "\tori" } } */ +/* { dg-final { scan-assembler-not "\tlu52i.d" } } */ +/* { dg-final { scan-assembler-not "\tand" } } */ +/* { dg-final { scan-assembler "\tbstrpick.d" } } */ +/* { dg-final { scan-assembler "\tbstrins.d" } } */ + +long +test (long a) +{ + return a & 0x3fffffffefffffff; +} diff --git a/gcc/testsuite/gcc.target/loongarch/attr-check-error-message.c b/gcc/testsuite/gcc.target/loongarch/attr-check-error-message.c index 82dcd17..6420f33 100644 --- a/gcc/testsuite/gcc.target/loongarch/attr-check-error-message.c +++ b/gcc/testsuite/gcc.target/loongarch/attr-check-error-message.c @@ -28,3 +28,11 @@ test6 (void) /* { dg-error "attribute \\\'target\\\' argument not a string" } */ __attribute__ ((target ("lsx,"))) void test7 (void) /* { dg-error "malformed \\\'target\\\(\\\"lsx,\\\"\\\)\\\' pragma or attribute" } */ {} + +__attribute__ ((target ("arch"))) void +test8 (void) /* { dg-error "the value of pragma or attribute \\\'target\\\(\\\"arch\\\"\\\)\\\' not be empty" } */ +{} + +__attribute__ ((target ("lsx;priority=1"))) void +test9 (void) /* { dg-error "attribute \\\'target\\\' argument \\\'lsx;priority=1\\\' is unknown" } */ +{} diff --git a/gcc/testsuite/gcc.target/loongarch/attr-check-error-message1.c b/gcc/testsuite/gcc.target/loongarch/attr-check-error-message1.c new file mode 100644 index 0000000..2435b87 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/attr-check-error-message1.c @@ -0,0 +1,6 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -Wno-attributes" } */ + +__attribute__ ((target_clones ("default;priority=1","lsx"))) void +test (void) /* { dg-error "\\\"default\\\" cannot be set together with other features in \\\'default;priority=1\\\'" } */ +{} diff --git a/gcc/testsuite/gcc.target/loongarch/attr-check-error-message2.c b/gcc/testsuite/gcc.target/loongarch/attr-check-error-message2.c new file mode 100644 index 0000000..ea79059 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/attr-check-error-message2.c @@ -0,0 +1,6 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -Wno-attributes" } */ + +__attribute__ ((target_clones ("default","lsx;"))) void +test (void) /* { dg-error "in attribute \\\'lsx;\\\' priority cannot be empty" } */ +{} diff --git a/gcc/testsuite/gcc.target/loongarch/attr-check-error-message3.c b/gcc/testsuite/gcc.target/loongarch/attr-check-error-message3.c new file mode 100644 index 0000000..663e641 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/attr-check-error-message3.c @@ -0,0 +1,6 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -Wno-attributes" } */ + +__attribute__ ((target_clones ("default",";priority=1"))) void +test (void) /* { dg-error "characher before \\\';\\\' in attribute \\\';priority=1\\\' cannot be empty" } */ +{} diff --git a/gcc/testsuite/gcc.target/loongarch/attr-check-error-message4.c b/gcc/testsuite/gcc.target/loongarch/attr-check-error-message4.c new file mode 100644 index 0000000..27565e9 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/attr-check-error-message4.c @@ -0,0 +1,6 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -Wno-attributes" } */ + +__attribute__ ((target_clones ("default","lsx;priority=1;lasx"))) void +test (void) /* { dg-error "in attribute \\\'lsx;priority=1;lasx\\\' the number of reatures cannot exceed two" } */ +{} diff --git a/gcc/testsuite/gcc.target/loongarch/attr-check-error-message5.c b/gcc/testsuite/gcc.target/loongarch/attr-check-error-message5.c new file mode 100644 index 0000000..03a774e --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/attr-check-error-message5.c @@ -0,0 +1,6 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -Wno-attributes" } */ + +__attribute__ ((target_clones ("default","lsx;priority=-1"))) void +test (void) /* { dg-error "Setting the priority value to \\\'-1\\\' is illegal in attribute \\\'lsx;priority=-1\\\'" } */ +{} diff --git a/gcc/testsuite/gcc.target/loongarch/attr-check-error-message6.c b/gcc/testsuite/gcc.target/loongarch/attr-check-error-message6.c new file mode 100644 index 0000000..88188a6 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/attr-check-error-message6.c @@ -0,0 +1,6 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -Wno-attributes" } */ + +__attribute__ ((target_clones ("default","lsx;lasx"))) void +test (void) /* { dg-error "in attribute \\\'lsx;lasx\\\', the second feature should be \\\"priority=\\\'num\\\'\\\" instead of \\\'lasx\\\'" } */ +{} diff --git a/gcc/testsuite/gcc.target/loongarch/attr-check-error-message7.c b/gcc/testsuite/gcc.target/loongarch/attr-check-error-message7.c new file mode 100644 index 0000000..80d4831 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/attr-check-error-message7.c @@ -0,0 +1,6 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -Wno-attributes" } */ + +__attribute__ ((target_clones ("default","arch="))) void +test (void) /* { dg-error "in attribute \\\'arch=\\\' you need to set a legal value for \\\"arch\\\"" } */ +{} diff --git a/gcc/testsuite/gcc.target/loongarch/attr-check-error-message8.c b/gcc/testsuite/gcc.target/loongarch/attr-check-error-message8.c new file mode 100644 index 0000000..f27712b --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/attr-check-error-message8.c @@ -0,0 +1,6 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -Wno-attributes" } */ + +__attribute__ ((target_clones ("default","cmodel=normal"))) void +test (void) /* { dg-error "attribute \\\'cmodel=normal\\\' is not supported in \\\'target_version\\\' or \\\'target_clones\\\'" } */ +{} diff --git a/gcc/testsuite/gcc.target/loongarch/attr-check-error-message9.c b/gcc/testsuite/gcc.target/loongarch/attr-check-error-message9.c new file mode 100644 index 0000000..4e02579 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/attr-check-error-message9.c @@ -0,0 +1,6 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -Wno-attributes" } */ + +__attribute__ ((target_clones ("default","123456"))) void +test (void) /* { dg-error "\\\'123456\\\' is not supported in target attribute" } */ +{} diff --git a/gcc/testsuite/gcc.target/loongarch/bstrins-5.c b/gcc/testsuite/gcc.target/loongarch/bstrins-5.c new file mode 100644 index 0000000..199b16f --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/bstrins-5.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -march=loongarch64 -mabi=lp64d" } */ +/* { dg-final { scan-assembler "foo:.*\tbstrins\\.w\t\\\$r\[0-9\]+,\\\$r\[0-9\]+,31,1.*foo" } } */ +/* { dg-final { scan-assembler "bar:.*\tbstrins\\.w\t\\\$r\[0-9\]+,\\\$r\[0-9\]+,31,31.*bar" } } */ + +int foo (int a, int b) +{ + return (a << 1) | (b & 1); +} + +int bar (int a, int b) +{ + return (a << 31) | (b & 0x7fffffff); +} diff --git a/gcc/testsuite/gcc.target/loongarch/bstrins-6.c b/gcc/testsuite/gcc.target/loongarch/bstrins-6.c new file mode 100644 index 0000000..f2fa351 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/bstrins-6.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -march=loongarch64 -mabi=lp64d" } */ +/* { dg-final { scan-assembler "foo:.*\tbstrins\\.d\t\\\$r\[0-9\]+,\\\$r\[0-9\]+,63,1.*foo" } } */ +/* { dg-final { scan-assembler "bar:.*\tbstrins\\.d\t\\\$r\[0-9\]+,\\\$r\[0-9\]+,63,15.*bar" } } */ + +long foo (long a, long b) +{ + return (a << 1) | (b & 1); +} + +short bar (short a, short b) +{ + return (a << 15) | (b & 0x7fff); +} diff --git a/gcc/testsuite/gcc.target/loongarch/extendsidi2-combine.c b/gcc/testsuite/gcc.target/loongarch/extendsidi2-combine.c new file mode 100644 index 0000000..0c3613c --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/extendsidi2-combine.c @@ -0,0 +1,13 @@ +/* { dg-do compile { target { loongarch64*-*-* } } } */ +/* { dg-options "-O3 -fno-strict-aliasing" } */ + +int +test (double a) +{ + int z; + + *((double *)&z) = a; + return z; +} + +/* { dg-final { scan-assembler-not "slli\\.w" } } */ diff --git a/gcc/testsuite/gcc.target/loongarch/imm-load.c b/gcc/testsuite/gcc.target/loongarch/imm-load.c index 33291fe..a125840 100644 --- a/gcc/testsuite/gcc.target/loongarch/imm-load.c +++ b/gcc/testsuite/gcc.target/loongarch/imm-load.c @@ -7,5 +7,5 @@ test (void) { return 0x1234567890abcdef; } -/* { dg-final { scan-rtl-dump-times "scanning new insn with uid" 6 "split1" } } */ +/* { dg-final { scan-rtl-dump-times "scanning new insn with uid" 4 "split1" } } */ diff --git a/gcc/testsuite/gcc.target/loongarch/lasx-xvpermi_q-opt.c b/gcc/testsuite/gcc.target/loongarch/lasx-xvpermi_q-opt.c new file mode 100644 index 0000000..16fb9df --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/lasx-xvpermi_q-opt.c @@ -0,0 +1,44 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -mlasx -ftree-vectorize" } */ + +#include <lasxintrin.h> + +#define TEST_FUNC(imm) \ + __m256i \ + test_##imm (__m256i op0, __m256i op1) \ + { \ + return __lasx_xvpermi_q (op0, op1, imm); \ + } + +TEST_FUNC (0x00) +/* { dg-final { scan-assembler-not "test_0x00:.*\txvld.*xvld.*-test_0x00"} } */ +/* { dg-final { scan-assembler-times "test_0x00:.*\txvpermi\\.d.*-test_0x00" 1 } } */ + +TEST_FUNC (0x01) +/* { dg-final { scan-assembler-not "test_0x01:.*\txvld.*xvld.*-test_0x01"} } */ +/* { dg-final { scan-assembler-times "test_0x01:.*\txvpermi\\.d.*-test_0x01" 1 } } */ + +TEST_FUNC (0x10) +/* { dg-final { scan-assembler-not "test_0x10:.*\txvld.*xvld.*-test_0x10"} } */ +/* { dg-final { scan-assembler-not "test_0x10:.*\txvpermi.*-test_0x10"} } */ + +TEST_FUNC (0x11) +/* { dg-final { scan-assembler-not "test_0x11:.*\txvld.*xvld.*-test_0x11"} } */ +/* { dg-final { scan-assembler-times "test_0x11:.*\txvpermi\\.d.*-test_0x11" 1 } } */ + +TEST_FUNC (0x22) +/* { dg-final { scan-assembler-not "test_0x22:.*\txvld.*xvld.*-test_0x22"} } */ +/* { dg-final { scan-assembler-times "test_0x22:.*\txvpermi\\.d.*-test_0x22" 1 } } */ + +TEST_FUNC (0x23) +/* { dg-final { scan-assembler-not "test_0x23:.*\txvld.*xvld.*-test_0x23"} } */ +/* { dg-final { scan-assembler-times "test_0x23:.*\txvpermi\\.d.*-test_0x23" 1 } } */ + +TEST_FUNC (0x32) +/* { dg-final { scan-assembler-not "test_0x32:.*\txvld.*xvld.*-test_0x32"} } */ +/* { dg-final { scan-assembler-not "test_0x32:.*\txvpermi.*-test_0x32"} } */ + +TEST_FUNC (0x33) +/* { dg-final { scan-assembler-not "test_0x33:.*\txvld.*xvld.*-test_0x33"} } */ +/* { dg-final { scan-assembler-times "test_0x33:.*\txvpermi\\.d.*-test_0x33" 1 } } */ + diff --git a/gcc/testsuite/gcc.target/loongarch/mem-and-mask-opt.c b/gcc/testsuite/gcc.target/loongarch/mem-and-mask-opt.c new file mode 100644 index 0000000..9b3a5cd --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/mem-and-mask-opt.c @@ -0,0 +1,23 @@ +/* { dg-do compile } */ +/* { dg-options "-O3" } */ +/* { dg-final { scan-assembler-not "bstrpick" } } */ +/* { dg-final { scan-assembler "ld\\.wu" } } */ + +struct st +{ + char const *name; +}; +struct fst +{ + struct st *groups; +}; + +struct fst *pfunc (int); + +const char * +test (int pc, unsigned group) +{ + struct fst *pci = pfunc (pc); + + return pci->groups[group].name; +} diff --git a/gcc/testsuite/gcc.target/loongarch/mode-tieable-opt.c b/gcc/testsuite/gcc.target/loongarch/mode-tieable-opt.c new file mode 100644 index 0000000..d6a6577 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/mode-tieable-opt.c @@ -0,0 +1,17 @@ +/* { dg-do compile { target { loongarch64*-*-* } } } */ +/* { dg-options "-O3 -mno-lsx" } */ +/* { dg-final { scan-assembler-not "stptr\.d" } } */ +/* { dg-final { scan-assembler-not "fld\.d" } } */ +/* { dg-final { scan-assembler-not "fst\.d" } } */ +/* { dg-final { scan-assembler-not "ldptr\.d" } } */ +/* { dg-final { scan-assembler "movgr2fr\.d" } } */ +/* { dg-final { scan-assembler "movfr2gr\.d" } } */ + +typedef double vec __attribute__ ((vector_size(16))); + +vec +foo (vec x, double a) +{ + x[0] -= a; + return x; +} diff --git a/gcc/testsuite/gcc.target/loongarch/mulh_wu.c b/gcc/testsuite/gcc.target/loongarch/mulh_wu.c new file mode 100644 index 0000000..53fc518 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/mulh_wu.c @@ -0,0 +1,10 @@ +/* { dg-do compile { target { loongarch64*-*-* } } } */ +/* { dg-options "-O3 -mabi=lp64d" } */ +/* { dg-final { scan-assembler "\tmulh.wu" } } */ +/* { dg-final { scan-assembler-not "\tlu32i.d" } } */ + +unsigned int +test (unsigned int *a) +{ + return *a / 60; +} diff --git a/gcc/testsuite/gcc.target/loongarch/pr122695-1.c b/gcc/testsuite/gcc.target/loongarch/pr122695-1.c new file mode 100644 index 0000000..d7c906c --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/pr122695-1.c @@ -0,0 +1,22 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -mlasx" } */ +/* { dg-require-effective-target loongarch_asx_hw } */ + +[[gnu::vector_size (32)]] char a, b, c; + +[[gnu::noipa]] void +test (void) +{ + a = __builtin_shuffle (a, b, c); +} + +int +main (void) +{ + a = (typeof (a)){} + 5; + b = (typeof (a)){} + 6; + c = (typeof (a)){} + 64; + test (); + if (a[0] != 5) + __builtin_trap (); +} diff --git a/gcc/testsuite/gcc.target/loongarch/pr122695-2.c b/gcc/testsuite/gcc.target/loongarch/pr122695-2.c new file mode 100644 index 0000000..79fc139 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/pr122695-2.c @@ -0,0 +1,22 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -mlasx" } */ +/* { dg-require-effective-target loongarch_asx_hw } */ + +[[gnu::vector_size(32)]] short a, b, c; + +[[gnu::noipa]] void +test (void) +{ + a = __builtin_shuffle(a, b, c) + c; +} + +int +main (void) +{ + a = (typeof (a)){} + 1; + b = (typeof (b)){} + 2; + c = (typeof (c)){} + 128; + test (); + if (a[0] != 129) + __builtin_trap (); +} diff --git a/gcc/testsuite/gcc.target/loongarch/pragma-la64V1_1-2.c b/gcc/testsuite/gcc.target/loongarch/pragma-la64V1_1-2.c new file mode 100644 index 0000000..1a6ca4e --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/pragma-la64V1_1-2.c @@ -0,0 +1,68 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -march=loongarch64 -std=gnu11 -march=la64v1.1" } */ + +#pragma GCC push_options +#pragma GCC target ("no-frecipe") +float +frecipe (float src) +{ +#ifdef __loongarch_frecipe +#error "Should't define __loongarch_frecipe" +#endif +} +#pragma GCC pop_options + +#pragma GCC push_options +#pragma GCC target ("no-div32") +int +div32 (unsigned long int a, unsigned long int b) +{ +#ifdef __loongarch_div32 +#error "Shouldn't define __loongarch_div32" +#endif +} +#pragma GCC pop_options + +#pragma GCC push_options +#pragma GCC target ("no-lam-bh") +short +lam_bh (short *ptr, short val) +{ +#ifdef __loongarch_lam_bh +#error "Shouldn't define __loongarch_lam_bh" +#endif +} +#pragma GCC pop_options + +#pragma GCC push_options +#pragma GCC target ("no-lamcas") +void +lamcas (int *ptr, int *exp, int des) +{ +#ifdef __loongarch_lamcas +#error "Shouldn't define __loongarch_lamcas" +#endif +} +#pragma GCC pop_options + +#pragma GCC push_options +#pragma GCC target ("no-scq") +void +scq (int *ptr, int *exp, int des) +{ +#ifdef __loongarch_scq +#error "Shouldn't define __loongarch_scq" +#endif +} +#pragma GCC pop_options + +#pragma GCC push_options +#pragma GCC target ("no-ld-seq-sa") +void +ld_seq_sa (int *ptr, int *exp, int des) +{ +#ifdef __loongarch_ld_seq_sa +#error "Shouldn't define __loongarch_ld_seq_sa" +#endif +} +#pragma GCC pop_options diff --git a/gcc/testsuite/gcc.target/loongarch/pragma-la64V1_1.c b/gcc/testsuite/gcc.target/loongarch/pragma-la64V1_1.c new file mode 100644 index 0000000..6165d95 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/pragma-la64V1_1.c @@ -0,0 +1,87 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -march=loongarch64 -std=gnu11" } */ +/* { dg-final { check-function-bodies "**" "" } } */ + + +/* +** frecipe: +** frecipe.s \$f0,\$f0 +** jr \$r1 +*/ +#pragma GCC push_options +#pragma GCC target ("frecipe") +float +frecipe (float src) +{ +#ifndef __loongarch_frecipe +#error "Not define __loongarch_frecipe" +#endif + return __builtin_loongarch_frecipe_s (src); +} +#pragma GCC pop_options + + +/* +** div32: +** div.w \$r4,\$r4,\$r5 +** jr \$r1 +*/ +#pragma GCC push_options +#pragma GCC target ("div32") +int +div32 (unsigned long int a, unsigned long int b) +{ +#ifndef __loongarch_div32 +#error "Not define __loongarch_div32" +#endif + return (int)a / (int)b; +} +#pragma GCC pop_options + +#pragma GCC push_options +#pragma GCC target ("lam-bh") +short +lam_bh (short *ptr, short val) +{ +#ifndef __loongarch_lam_bh +#error "Not define __loongarch_lam_bh" +#endif + return __atomic_fetch_add (ptr, val, __ATOMIC_RELAXED); +} +#pragma GCC pop_options +/* { dg-final { scan-assembler "lam_bh:.*amadd.h.*lam_bh" } } */ + +#pragma GCC push_options +#pragma GCC target ("lamcas") +void +lamcas (int *ptr, int *exp, int des) +{ +#ifndef __loongarch_lamcas +#error "Not define __loongarch_lamcas" +#endif + __atomic_compare_exchange_n (ptr, exp, des, 0, __ATOMIC_ACQ_REL, __ATOMIC_RELAXED); +} +#pragma GCC pop_options +/* { dg-final { scan-assembler "lamcas:.*amcas_db.w.*lamcas" } } */ + +#pragma GCC push_options +#pragma GCC target ("scq") +void +scq (int *ptr, int *exp, int des) +{ +#ifndef __loongarch_scq +#error "Not define __loongarch_scq" +#endif +} +#pragma GCC pop_options + +#pragma GCC push_options +#pragma GCC target ("ld-seq-sa") +void +ld_seq_sa (int *ptr, int *exp, int des) +{ +#ifndef __loongarch_ld_seq_sa +#error "Not define __loongarch_ld_seq_sa" +#endif +} +#pragma GCC pop_options diff --git a/gcc/testsuite/gcc.target/loongarch/sign-extend-3.c b/gcc/testsuite/gcc.target/loongarch/sign-extend-3.c new file mode 100644 index 0000000..d20bd38 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/sign-extend-3.c @@ -0,0 +1,29 @@ +/* { dg-do compile } */ +/* { dg-options "-mabi=lp64d -O2" } */ +/* { dg-final { scan-assembler "sltui" } } */ + +union any { + int any_i32; +}; + +extern char *opname; +extern void test1 (int, char *); +extern int iterms; + +void +test (union any cv) +{ + int i, on; + int ix = cv.any_i32; + for (i = 1; i < iterms; i++) + { + on = (ix == 0 || ix == 1) ? 0 : 1; + if (*opname == '!') + { + on = !on; + ++opname; + } + test1 (on, opname); + } +} + diff --git a/gcc/testsuite/gcc.target/loongarch/sign-extend-4.c b/gcc/testsuite/gcc.target/loongarch/sign-extend-4.c new file mode 100644 index 0000000..d716e5b --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/sign-extend-4.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-mabi=lp64d -O2" } */ +/* { dg-final { scan-assembler-not "slli.w\t\\\$r\[0-9\]+,\\\$r\[0-9\]+,0" } } */ + +extern int items; +extern int gv_fetchmeth (int); +int +Perl_gv_fetchmeth (int level) +{ + int gv; + while (items--) + gv = gv_fetchmeth ((level >= 0) ? level + 1 : level - 1); + + return gv; +} + diff --git a/gcc/testsuite/gcc.target/loongarch/sign-extend-5.c b/gcc/testsuite/gcc.target/loongarch/sign-extend-5.c new file mode 100644 index 0000000..21f5de7 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/sign-extend-5.c @@ -0,0 +1,35 @@ +/* { dg-do compile } */ +/* { dg-options "-mabi=lp64d -O2" } */ +/* { dg-final { scan-assembler-not "slli.w" } } */ + +typedef struct xpvav XPVAV; +struct xpvav +{ + long int xav_fill; + long int xav_max; +}; +typedef struct av AV; +struct av +{ + XPVAV *sv_any; + unsigned int sv_refcnt; + unsigned int sv_flags; +}; +void Perl_av_extend (AV *ar, int key); +void +Perl_av_unshift (AV *av, int num) +{ + int i; + int slide; + + if (num) + { + i = ((XPVAV *)(av)->sv_any)->xav_fill; + + slide = i > 0 ? i : 0; + num += slide; + Perl_av_extend (av, i + num); + + ((XPVAV *)(av)->sv_any)->xav_max -= slide; + } +} diff --git a/gcc/testsuite/gcc.target/loongarch/sign-extend-6.c b/gcc/testsuite/gcc.target/loongarch/sign-extend-6.c new file mode 100644 index 0000000..74d0e58 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/sign-extend-6.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-mabi=lp64d -O2" } */ +/* { dg-final { scan-assembler-times "addi.w\t\\\$r\[0-9\]+,\\\$r\[0-9\]+,1\t" 1 } } */ + +extern unsigned short d; +int +test (int a, unsigned short b) +{ + if (a > 0) + { + d = 1; + if (b > d) + return 10; + } + + return 50; +} diff --git a/gcc/testsuite/gcc.target/loongarch/spill-less.c b/gcc/testsuite/gcc.target/loongarch/spill-less.c new file mode 100644 index 0000000..77eb9b5 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/spill-less.c @@ -0,0 +1,14 @@ +/* { dg-do compile { target { loongarch64*-*-* } } } */ +/* { dg-options "-O3 -fno-strict-aliasing" } */ + +double +convert (long long in) +{ + double f; + *((long long *)&f) = in; + return f; +} + +/* { dg-final { scan-assembler-not "st\\.d" } } */ +/* { dg-final { scan-assembler-not "fld\\.d" } } */ +/* { dg-final { scan-assembler "movgr2fr\\.d" } } */ diff --git a/gcc/testsuite/gcc.target/loongarch/vec_pack_unpack_256.c b/gcc/testsuite/gcc.target/loongarch/vec_pack_unpack_256.c index 506b7bd..5b2fd9b 100644 --- a/gcc/testsuite/gcc.target/loongarch/vec_pack_unpack_256.c +++ b/gcc/testsuite/gcc.target/loongarch/vec_pack_unpack_256.c @@ -55,7 +55,8 @@ test_vec_unpacks_float_hi_lo_v8si (void) } /* { dg-final { scan-assembler "test_vec_unpacks_hi_lo_v8si:.*\tvext2xv\\.d\\.w.*-test_vec_unpacks_hi_lo_v8si" } } */ -/* { dg-final { scan-assembler "test_vec_unpacks_hi_lo_v8si:.*\txvpermi\\.q.*-test_vec_unpacks_hi_lo_v8si" } } */ +/* { dg-final { scan-assembler "test_vec_unpacks_hi_lo_v8si:.*\txvpermi\\.d.*-test_vec_unpacks_hi_lo_v8si" } } */ +/* { dg-final { scan-assembler-not "test_vec_unpacks_hi_lo_v8si:.*\txvpermi\\.q.*-test_vec_unpacks_hi_lo_v8si" } } */ void test_vec_unpacks_hi_lo_v8si (void) { @@ -64,7 +65,8 @@ test_vec_unpacks_hi_lo_v8si (void) } /* { dg-final { scan-assembler "test_vec_unpacks_hi_lo_v16hi:.*\tvext2xv\\.w\\.h.*-test_vec_unpacks_hi_lo_v16hi" } } */ -/* { dg-final { scan-assembler "test_vec_unpacks_hi_lo_v16hi:.*\txvpermi\\.q.*-test_vec_unpacks_hi_lo_v16hi" } } */ +/* { dg-final { scan-assembler "test_vec_unpacks_hi_lo_v16hi:.*\txvpermi\\.d.*-test_vec_unpacks_hi_lo_v16hi" } } */ +/* { dg-final { scan-assembler-not "test_vec_unpacks_hi_lo_v16hi:.*\txvpermi\\.q.*-test_vec_unpacks_hi_lo_v16hi" } } */ void test_vec_unpacks_hi_lo_v16hi (void) { @@ -73,7 +75,8 @@ test_vec_unpacks_hi_lo_v16hi (void) } /* { dg-final { scan-assembler "test_vec_unpacks_hi_lo_v32qi:.*\tvext2xv\\.h\\.b.*-test_vec_unpacks_hi_lo_v32qi" } } */ -/* { dg-final { scan-assembler "test_vec_unpacks_hi_lo_v32qi:.*\txvpermi\\.q.*-test_vec_unpacks_hi_lo_v32qi" } } */ +/* { dg-final { scan-assembler "test_vec_unpacks_hi_lo_v32qi:.*\txvpermi\\.d.*-test_vec_unpacks_hi_lo_v32qi" } } */ +/* { dg-final { scan-assembler-not "test_vec_unpacks_hi_lo_v32qi:.*\txvpermi\\.q.*-test_vec_unpacks_hi_lo_v32qi" } } */ void test_vec_unpacks_hi_lo_v32qi (void) { @@ -91,7 +94,8 @@ test_vec_unpacks_hi_lo_v8sf (void) } /* { dg-final { scan-assembler "test_vec_unpacku_hi_lo_v8si:.*\tvext2xv\\.du\\.wu.*-test_vec_unpacku_hi_lo_v8si" } } */ -/* { dg-final { scan-assembler "test_vec_unpacku_hi_lo_v8si:.*\txvpermi\\.q.*-test_vec_unpacku_hi_lo_v8si" } } */ +/* { dg-final { scan-assembler "test_vec_unpacku_hi_lo_v8si:.*\txvpermi\\.d.*-test_vec_unpacku_hi_lo_v8si" } } */ +/* { dg-final { scan-assembler-not "test_vec_unpacku_hi_lo_v8si:.*\txvpermi\\.q.*-test_vec_unpacku_hi_lo_v8si" } } */ void test_vec_unpacku_hi_lo_v8si (void) { @@ -100,7 +104,8 @@ test_vec_unpacku_hi_lo_v8si (void) } /* { dg-final { scan-assembler "test_vec_unpacku_hi_lo_v16hi:.*\tvext2xv\\.wu\\.hu.*-test_vec_unpacku_hi_lo_v16hi" } } */ -/* { dg-final { scan-assembler "test_vec_unpacku_hi_lo_v16hi:.*\txvpermi\\.q.*-test_vec_unpacku_hi_lo_v16hi" } } */ +/* { dg-final { scan-assembler "test_vec_unpacku_hi_lo_v16hi:.*\txvpermi\\.d.*-test_vec_unpacku_hi_lo_v16hi" } } */ +/* { dg-final { scan-assembler-not "test_vec_unpacku_hi_lo_v16hi:.*\txvpermi\\.q.*-test_vec_unpacku_hi_lo_v16hi" } } */ void test_vec_unpacku_hi_lo_v16hi (void) { @@ -109,7 +114,8 @@ test_vec_unpacku_hi_lo_v16hi (void) } /* { dg-final { scan-assembler "test_vec_unpacku_hi_lo_v32qi:.*\tvext2xv\\.hu\\.bu.*-test_vec_unpacku_hi_lo_v32qi" } } */ -/* { dg-final { scan-assembler "test_vec_unpacku_hi_lo_v32qi:.*\txvpermi\\.q.*-test_vec_unpacku_hi_lo_v32qi" } } */ +/* { dg-final { scan-assembler "test_vec_unpacku_hi_lo_v32qi:.*\txvpermi\\.d.*-test_vec_unpacku_hi_lo_v32qi" } } */ +/* { dg-final { scan-assembler-not "test_vec_unpacku_hi_lo_v32qi:.*\txvpermi\\.q.*-test_vec_unpacku_hi_lo_v32qi" } } */ void test_vec_unpacku_hi_lo_v32qi (void) { diff --git a/gcc/testsuite/gcc.target/loongarch/vec_reduc_half.c b/gcc/testsuite/gcc.target/loongarch/vec_reduc_half.c new file mode 100644 index 0000000..39e817b --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vec_reduc_half.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -ffast-math -mlasx" } */ + +double +foo_1 (double *a, double *b) +{ + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3]; +} + +/* { dg-final { scan-assembler-times "xvpermi.d" 1} } */ diff --git a/gcc/testsuite/gcc.target/loongarch/vect-frint-no-inexact.c b/gcc/testsuite/gcc.target/loongarch/vect-frint-no-inexact.c index 7bbaf1f..e20eaea 100644 --- a/gcc/testsuite/gcc.target/loongarch/vect-frint-no-inexact.c +++ b/gcc/testsuite/gcc.target/loongarch/vect-frint-no-inexact.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mabi=lp64d -mdouble-float -fno-math-errno -fno-fp-int-builtin-inexact -mlasx" } */ +/* { dg-options "-O2 -mabi=lp64d -mdouble-float -fno-math-errno -fno-fp-int-builtin-inexact -mlasx -mcmodel=normal" } */ #include "vect-frint.c" diff --git a/gcc/testsuite/gcc.target/loongarch/vect-frint-scalar-no-inexact.c b/gcc/testsuite/gcc.target/loongarch/vect-frint-scalar-no-inexact.c index 002e3b9..d5f09335 100644 --- a/gcc/testsuite/gcc.target/loongarch/vect-frint-scalar-no-inexact.c +++ b/gcc/testsuite/gcc.target/loongarch/vect-frint-scalar-no-inexact.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mlsx -fno-fp-int-builtin-inexact" } */ +/* { dg-options "-O2 -mlsx -fno-fp-int-builtin-inexact -mcmodel=normal" } */ #include "vect-frint-scalar.c" diff --git a/gcc/testsuite/gcc.target/loongarch/vect-frint-scalar.c b/gcc/testsuite/gcc.target/loongarch/vect-frint-scalar.c index dbcb906..171ba98 100644 --- a/gcc/testsuite/gcc.target/loongarch/vect-frint-scalar.c +++ b/gcc/testsuite/gcc.target/loongarch/vect-frint-scalar.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mlsx -ffp-int-builtin-inexact" } */ +/* { dg-options "-O2 -mlsx -ffp-int-builtin-inexact -mcmodel=normal" } */ #define test(func, suffix) \ __typeof__ (1.##suffix) \ diff --git a/gcc/testsuite/gcc.target/loongarch/vect-frint.c b/gcc/testsuite/gcc.target/loongarch/vect-frint.c index 6bf211e..bda041b 100644 --- a/gcc/testsuite/gcc.target/loongarch/vect-frint.c +++ b/gcc/testsuite/gcc.target/loongarch/vect-frint.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mabi=lp64d -mdouble-float -fno-math-errno -ffp-int-builtin-inexact -mlasx" } */ +/* { dg-options "-O2 -mabi=lp64d -mdouble-float -fno-math-errno -ffp-int-builtin-inexact -mlasx -mcmodel=normal" } */ float out_x[8]; double out_y[4]; diff --git a/gcc/testsuite/gcc.target/loongarch/vect-ftint-no-inexact.c b/gcc/testsuite/gcc.target/loongarch/vect-ftint-no-inexact.c index 61918be..3fa9753 100644 --- a/gcc/testsuite/gcc.target/loongarch/vect-ftint-no-inexact.c +++ b/gcc/testsuite/gcc.target/loongarch/vect-ftint-no-inexact.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mabi=lp64d -mdouble-float -fno-math-errno -fno-fp-int-builtin-inexact -mlasx" } */ +/* { dg-options "-O2 -mabi=lp64d -mdouble-float -fno-math-errno -fno-fp-int-builtin-inexact -mlasx -mcmodel=normal" } */ #include "vect-ftint.c" diff --git a/gcc/testsuite/gcc.target/loongarch/vect-ftint.c b/gcc/testsuite/gcc.target/loongarch/vect-ftint.c index c4962ed..96da3cd 100644 --- a/gcc/testsuite/gcc.target/loongarch/vect-ftint.c +++ b/gcc/testsuite/gcc.target/loongarch/vect-ftint.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mabi=lp64d -mdouble-float -fno-math-errno -ffp-int-builtin-inexact -mlasx" } */ +/* { dg-options "-O2 -mabi=lp64d -mdouble-float -fno-math-errno -ffp-int-builtin-inexact -mlasx -mcmodel=normal" } */ int out_x[8]; long out_y[4]; diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-builtin.c b/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-builtin.c index 64ff870..b9753f5 100644 --- a/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-builtin.c +++ b/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-builtin.c @@ -733,10 +733,10 @@ /* { dg-final { scan-assembler-times "lasx_xvfcmp_sun_s:.*xvfcmp\\.sun\\.s.*lasx_xvfcmp_sun_s" 1 } } */ /* { dg-final { scan-assembler-times "lasx_xvpickve_d_f:.*xvpickve\\.d.*lasx_xvpickve_d_f" 1 } } */ /* { dg-final { scan-assembler-times "lasx_xvpickve_w_f:.*xvpickve\\.w.*lasx_xvpickve_w_f" 1 } } */ -/* { dg-final { scan-assembler-times "lasx_xvrepli_b:.*xvrepli\\.b.*lasx_xvrepli_b" 1 } } */ -/* { dg-final { scan-assembler-times "lasx_xvrepli_d:.*xvrepli\\.d.*lasx_xvrepli_d" 1 } } */ -/* { dg-final { scan-assembler-times "lasx_xvrepli_h:.*xvrepli\\.h.*lasx_xvrepli_h" 1 } } */ -/* { dg-final { scan-assembler-times "lasx_xvrepli_w:.*xvrepli\\.w.*lasx_xvrepli_w" 1 } } */ +/* { dg-final { scan-assembler-times "lasx_xvrepli_b:.*xvldi.*lasx_xvrepli_b" 1 } } */ +/* { dg-final { scan-assembler-times "lasx_xvrepli_d:.*xvldi.*lasx_xvrepli_d" 1 } } */ +/* { dg-final { scan-assembler-times "lasx_xvrepli_h:.*xvldi.*lasx_xvrepli_h" 1 } } */ +/* { dg-final { scan-assembler-times "lasx_xvrepli_w:.*xvldi.*lasx_xvrepli_w" 1 } } */ typedef signed char v32i8 __attribute__ ((vector_size (32), aligned (32))); typedef signed char v32i8_b __attribute__ ((vector_size (32), aligned (1))); @@ -3301,7 +3301,7 @@ __lasx_vext2xv_du_bu (v32i8 _1) v32i8 __lasx_xvpermi_q (v32i8 _1, v32i8 _2) { - return __builtin_lasx_xvpermi_q (_1, _2, 1); + return __builtin_lasx_xvpermi_q (_1, _2, 0x20); } v4i64 __lasx_xvpermi_d (v4i64 _1) diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-struct-move.c b/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-struct-move.c new file mode 100644 index 0000000..ca10e9f --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-struct-move.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -lasx" } */ + +struct vec +{ + int vec_a[32]; + double vec_b[5]; + char vec_c[32]; +}; + +void +foo (struct vec *dest, struct vec *src, int index) +{ + dest[index] = *src; +} + +/* { dg-final { scan-assembler-times "alsl\.d" 3} } */ diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-vec-init-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-vec-init-2.c index 7592198..f0e131f 100644 --- a/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-vec-init-2.c +++ b/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-vec-init-2.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O3 -fno-vect-cost-model -mlasx" } */ -/* { dg-final { scan-assembler-times "vld" 12 } } */ +/* { dg-final { scan-assembler-times "vld\t" 12 } } */ typedef char v16qi __attribute__ ((vector_size (16))); diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-xvldi-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-xvldi-2.c new file mode 100644 index 0000000..45b596f --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-xvldi-2.c @@ -0,0 +1,97 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mlasx" } */ + +#include <lasxintrin.h> + +#define TEST_V16I16(imm) \ +void \ +test_v16i16_##imm (v16i16 *vec) \ + { \ + v16i16 temp = {imm, imm, imm, imm, \ + imm, imm, imm, imm, \ + imm, imm, imm, imm, \ + imm, imm, imm, imm}; \ + *vec = temp; \ + } + +#define TEST_V8I32(imm) \ +void \ +test_v8i32_##imm (v8i32 *vec) \ + { \ + v8i32 temp = {imm, imm, imm, imm, \ + imm, imm, imm, imm}; \ + *vec = temp; \ + } + +#define TEST_V8I32_2(imm1, imm2) \ +void \ +test_v8i32_2_##imm1 (v8i32 *vec) \ + { \ + v8i32 temp = {imm1, imm2, imm1, imm2, \ + imm1, imm2, imm1, imm2};\ + *vec = temp; \ + } + +#define TEST_V4I64(imm) \ +void \ +test_V4I64_##imm (v4i64 *vec) \ + { \ + v4i64 temp = {imm, imm, imm, imm}; \ + *vec = temp; \ + } + +/* 4'b0001:data={2{16'b0,x[7:0],8'b0}}. */ +TEST_V8I32 (0x3a00) +/* { dg-final { scan-assembler-times "test_v8i32_0x3a00:.*\txvldi\t\\\$xr\[0-9\]+,-3782.*-test_v8i32_0x3a00" 1 } } */ + +/* 4'b0010:data={2{8'b0,x[7:0],16'b0}}. */ +TEST_V8I32 (0x3a0000) +/* { dg-final { scan-assembler-times "test_v8i32_0x3a0000:.*\txvldi\t\\\$xr\[0-9\]+,-3526.*-test_v8i32_0x3a0000" 1 } } */ + +/* 4'b0011:data={2{x[7:0],24'b0}}. */ +TEST_V8I32 (0x3a000000) +/* { dg-final { scan-assembler-times "test_v8i32_0x3a000000:.*\txvldi\t\\\$xr\[0-9\]+,-3270.*-test_v8i32_0x3a000000" 1 } } */ + +/* 4'b0101:data={4{x[7:0],8'b0}}. */ +TEST_V16I16 (0x3a00) +/* { dg-final { scan-assembler-times "test_v16i16_0x3a00:.*\txvldi\t\\\$xr\[0-9\]+,-2758.*-test_v16i16_0x3a00" 1 } } */ + +/* 4'b0110:data={2{16'b0,x[7:0],8'hFF}}. */ +TEST_V8I32 (0x3aff) +/* { dg-final { scan-assembler-times "test_v8i32_0x3aff:.*\txvldi\t\\\$xr\[0-9\]+,-2502.*-test_v8i32_0x3aff" 1 } } */ + +/* 4'b0111:data={2{8'b0,x[7:0],16'hFFFF}}. */ +TEST_V8I32 (0x3affff) +/* { dg-final { scan-assembler-times "test_v8i32_0x3affff:.*\txvldi\t\\\$xr\[0-9\]+,-2246.*-test_v8i32_0x3affff" 1 } } */ + +/* 4'b1001:data={{8{x[7]}},{8{x[6]}},{8{x[5]}},{8{x[4]}},{8{x[3]}},{8{x[2]}}, + * {8{x[1]}},{8{x[0]}}}. */ +TEST_V4I64 (0xffffff0000ffff00) +/* { dg-final { scan-assembler-times "test_V4I64_0xffffff0000ffff00:.*\txvldi\t\\\$xr\[0-9\]+,-1562.*-test_V4I64_0xffffff0000ffff00" 1 } } */ + +TEST_V4I64 (0xffff0000ff) +/* { dg-final { scan-assembler-times "test_V4I64_0xffff0000ff:.*\txvldi\t\\\$xr\[0-9\]+,-1767.*-test_V4I64_0xffff0000ff" 1 } } */ + +TEST_V8I32_2 (0xffffff00, 0); +/* { dg-final { scan-assembler-times "test_v8i32_2_0xffffff00:.*\txvldi\t\\\$xr\[0-9\]+,-1778.*-test_v8i32_2_0xffffff00" 1 } } */ + +/* 4'b1010:data={2{x[7],~x[6],{5{x[6]}},x[5:0],19'b0}}. */ +TEST_V8I32 (0xbf180000) +/* { dg-final { scan-assembler-times "test_v8i32_0xbf180000:.*\txvldi\t\\\$xr\[0-9\]+,-1309.*-test_v8i32_0xbf180000" 1 } } */ + +TEST_V8I32 (0x41e00000) +/* { dg-final { scan-assembler-times "test_v8i32_0x41e00000:.*\txvldi\t\\\$xr\[0-9\]+,-1476.*-test_v8i32_0x41e00000" 1 } } */ + +/* 4'b1011:data={32'b0,x[7],~x[6],{5{x[6]}},x[5:0],19'b0}. */ +TEST_V4I64 (0xbe180000) +/* { dg-final { scan-assembler-times "test_V4I64_0xbe180000:.*\txvldi\t\\\$xr\[0-9\]+,-1085.*-test_V4I64_0xbe180000" 1 } } */ + +TEST_V4I64 (0x41e00000) +/* { dg-final { scan-assembler-times "test_V4I64_0x41e00000:.*\txvldi\t\\\$xr\[0-9\]+,-1220.*-test_V4I64_0x41e00000" 1 } } */ + +/* 4'b1100:data={x[7],~x[6],{8{x[6]}},x[5:0],48'b0}. */ +TEST_V4I64 (0xbfd5000000000000) +/* { dg-final { scan-assembler-times "test_V4I64_0xbfd5000000000000:.*\txvldi\t\\\$xr\[0-9\]+,-811.*-test_V4I64_0xbfd5000000000000" 1 } } */ + +TEST_V4I64 (0x4026000000000000) +/* { dg-final { scan-assembler-times "test_V4I64_0x4026000000000000:.*\txvldi\t\\\$xr\[0-9\]+,-986.*-test_V4I64_0x4026000000000000" 1 } } */ diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lasx/vect-concat-128-256-result.c b/gcc/testsuite/gcc.target/loongarch/vector/lasx/vect-concat-128-256-result.c new file mode 100644 index 0000000..e876c4a --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lasx/vect-concat-128-256-result.c @@ -0,0 +1,68 @@ +/* { dg-options "-mabi=lp64d -O2 -mlasx -w -fno-strict-aliasing" } */ + +#include "../simd_correctness_check.h" +#include <lasxintrin.h> + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + __m256i __m256i_op0, __m256i_op1, __m256i_op2, __m256i_out, __m256i_result; + __m256 __m256_op0, __m256_op1, __m256_op2, __m256_out, __m256_result; + __m256d __m256d_op0, __m256d_op1, __m256d_op2, __m256d_out, __m256d_result; + + //__m128_op0={1,2,3,4},__m128_op1={5,6,7,8}; + *((int *)&__m128_op0[3]) = 0x40800000; + *((int *)&__m128_op0[2]) = 0x40400000; + *((int *)&__m128_op0[1]) = 0x40000000; + *((int *)&__m128_op0[0]) = 0x3f800000; + *((int *)&__m128_op1[3]) = 0x41000000; + *((int *)&__m128_op1[2]) = 0x40e00000; + *((int *)&__m128_op1[1]) = 0x40c00000; + *((int *)&__m128_op1[0]) = 0x40a00000; + *((int *)&__m256_result[7]) = 0x41000000; + *((int *)&__m256_result[6]) = 0x40e00000; + *((int *)&__m256_result[5]) = 0x40c00000; + *((int *)&__m256_result[4]) = 0x40a00000; + *((int *)&__m256_result[3]) = 0x40800000; + *((int *)&__m256_result[2]) = 0x40400000; + *((int *)&__m256_result[1]) = 0x40000000; + *((int *)&__m256_result[0]) = 0x3f800000; + __m256_out = __lasx_concat_128_s (__m128_op0, __m128_op1); + ASSERTEQ_32 (__LINE__, __m256_result, __m256_out); + __m256_out = __lasx_cast_128_s (__m128_op0); + ASSERTEQ_32 (__LINE__, __m256_out, __m128_op0); + + //__m128i_op0={1,2},__m128i_op1={3,4}; + *((unsigned long *)&__m128i_op0[1]) = 0x2; + *((unsigned long *)&__m128i_op0[0]) = 0x1; + *((unsigned long *)&__m128i_op1[1]) = 0x4; + *((unsigned long *)&__m128i_op1[0]) = 0x3; + *((unsigned long *)&__m256i_result[3]) = 0x4; + *((unsigned long *)&__m256i_result[2]) = 0x3; + *((unsigned long *)&__m256i_result[1]) = 0x2; + *((unsigned long *)&__m256i_result[0]) = 0x1; + __m256i_out = __lasx_concat_128 (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m256i_result, __m256i_out); + __m256i_out = __lasx_cast_128 (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m256i_out, __m128i_op0); + + //__m128d_op0={1,2},__m128i_op1={3,4}; + *((unsigned long *)&__m128d_op0[1]) = 0x4000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x3ff0000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x4010000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x4008000000000000; + *((unsigned long *)&__m256d_result[3]) = 0x4010000000000000; + *((unsigned long *)&__m256d_result[2]) = 0x4008000000000000; + *((unsigned long *)&__m256d_result[1]) = 0x4000000000000000; + *((unsigned long *)&__m256d_result[0]) = 0x3ff0000000000000; + __m256d_out = __lasx_concat_128_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m256d_result, __m256d_out); + __m256d_out = __lasx_cast_128_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m256d_out, __m128d_op0); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lasx/vect-concat-128-256.c b/gcc/testsuite/gcc.target/loongarch/vector/lasx/vect-concat-128-256.c new file mode 100644 index 0000000..5d8cbb2 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lasx/vect-concat-128-256.c @@ -0,0 +1,92 @@ +/* { dg-do compile { target { loongarch64*-*-* } } } */ +/* { dg-options "-mabi=lp64d -O2 -mlasx" } */ +/* { dg-final { check-function-bodies "**" "" } } */ + +#include <lasxintrin.h> + +/* +**foo1: +** vinsgr2vr.d (\$vr[0-9]+),\$r5,0 +** vinsgr2vr.d (\$vr[0-9]+),\$r7,0 +** vinsgr2vr.d (\$vr[0-9]+),\$r6,1 +** vinsgr2vr.d (\$vr[0-9]+),\$r8,1 +** xvpermi.q (\$xr[0-9]+),(\$xr[0-9]+),0x02 +** xvst (\$xr[0-9]+),\$r4,0 +** jr \$r1 +*/ +__m256 +foo1 (__m128 x, __m128 y) +{ + return __builtin_lasx_concat_128_s (x, y); +} + +/* +**foo2: +** vinsgr2vr.d (\$vr[0-9]+),\$r5,0 +** vinsgr2vr.d (\$vr[0-9]+),\$r7,0 +** vinsgr2vr.d (\$vr[0-9]+),\$r6,1 +** vinsgr2vr.d (\$vr[0-9]+),\$r8,1 +** xvpermi.q (\$xr[0-9]+),(\$xr[0-9]+),0x02 +** xvst (\$xr[0-9]+),\$r4,0 +** jr \$r1 +*/ +__m256d +foo2 (__m128d x, __m128d y) +{ + return __builtin_lasx_concat_128_d (x, y); +} + +/* +**foo3: +** vinsgr2vr.d (\$vr[0-9]+),\$r5,0 +** vinsgr2vr.d (\$vr[0-9]+),\$r7,0 +** vinsgr2vr.d (\$vr[0-9]+),\$r6,1 +** vinsgr2vr.d (\$vr[0-9]+),\$r8,1 +** xvpermi.q (\$xr[0-9]+),(\$xr[0-9]+),0x02 +** xvst (\$xr[0-9]+),\$r4,0 +** jr \$r1 +*/ +__m256i +foo3 (__m128i x, __m128i y) +{ + return __builtin_lasx_concat_128 (x, y); +} + +/* +**foo4: +** vinsgr2vr.d (\$vr[0-9]+),\$r5,0 +** vinsgr2vr.d (\$vr[0-9]+),\$r6,1 +** xvst (\$xr[0-9]+),\$r4,0 +** jr \$r1 +*/ +__m256 +foo4 (__m128 x) +{ + return __builtin_lasx_cast_128_s (x); +} + +/* +**foo5: +** vinsgr2vr.d (\$vr[0-9]+),\$r5,0 +** vinsgr2vr.d (\$vr[0-9]+),\$r6,1 +** xvst (\$xr[0-9]+),\$r4,0 +** jr \$r1 +*/ +__m256d +foo5 (__m128d x) +{ + return __builtin_lasx_cast_128_d (x); +} + +/* +**foo6: +** vinsgr2vr.d (\$vr[0-9]+),\$r5,0 +** vinsgr2vr.d (\$vr[0-9]+),\$r6,1 +** xvst (\$xr[0-9]+),\$r4,0 +** jr \$r1 +*/ +__m256i +foo6 (__m128i x) +{ + return __builtin_lasx_cast_128 (x); +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lasx/vect-extract-256-128-result.c b/gcc/testsuite/gcc.target/loongarch/vector/lasx/vect-extract-256-128-result.c new file mode 100644 index 0000000..61064d6 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lasx/vect-extract-256-128-result.c @@ -0,0 +1,69 @@ +/* { dg-options "-mabi=lp64d -O2 -mlasx -w -fno-strict-aliasing" } */ + +#include "../simd_correctness_check.h" +#include <lasxintrin.h> + +extern void abort (void); +int +main () +{ + __m128i __m128i_result0, __m128i_result1, __m128i_out, __m128i_result; + __m128 __m128_result0, __m128_result1, __m128_out, __m128_result; + __m128d __m128d_result0, __m128d_result1, __m128d_out, __m128d_result; + + __m256i __m256i_op0, __m256i_op1, __m256i_op2, __m256i_out, __m256i_result; + __m256 __m256_op0, __m256_op1, __m256_op2, __m256_out, __m256_result; + __m256d __m256d_op0, __m256d_op1, __m256d_op2, __m256d_out, __m256d_result; + + //__m256_op0 = {1,2,3,4,5,6,7,8}; + *((int *)&__m256_op0[7]) = 0x41000000; + *((int *)&__m256_op0[6]) = 0x40e00000; + *((int *)&__m256_op0[5]) = 0x40c00000; + *((int *)&__m256_op0[4]) = 0x40a00000; + *((int *)&__m256_op0[3]) = 0x40800000; + *((int *)&__m256_op0[2]) = 0x40400000; + *((int *)&__m256_op0[1]) = 0x40000000; + *((int *)&__m256_op0[0]) = 0x3f800000; + *((int *)&__m128_result1[3]) = 0x41000000; + *((int *)&__m128_result1[2]) = 0x40e00000; + *((int *)&__m128_result1[1]) = 0x40c00000; + *((int *)&__m128_result1[0]) = 0x40a00000; + *((int *)&__m128_result0[3]) = 0x40800000; + *((int *)&__m128_result0[2]) = 0x40400000; + *((int *)&__m128_result0[1]) = 0x40000000; + *((int *)&__m128_result0[0]) = 0x3f800000; + __m128_out = __lasx_extract_128_lo_s (__m256_op0); + ASSERTEQ_32 (__LINE__, __m128_result0, __m128_out); + __m128_out = __lasx_extract_128_hi_s (__m256_op0); + ASSERTEQ_32 (__LINE__, __m128_result1, __m128_out); + + //__m256i_op0 = {1,2,3,4}; + *((unsigned long *)&__m256i_op0[3]) = 0x4; + *((unsigned long *)&__m256i_op0[2]) = 0x3; + *((unsigned long *)&__m256i_op0[1]) = 0x2; + *((unsigned long *)&__m256i_op0[0]) = 0x1; + *((unsigned long *)&__m128i_result0[1]) = 0x2; + *((unsigned long *)&__m128i_result0[0]) = 0x1; + *((unsigned long *)&__m128i_result1[1]) = 0x4; + *((unsigned long *)&__m128i_result1[0]) = 0x3; + __m128i_out = __lasx_extract_128_lo (__m256i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result0, __m128i_out); + __m128i_out = __lasx_extract_128_hi (__m256i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result1, __m128i_out); + + //__m256d_op0 = {1,2,3,4}; + *((unsigned long *)&__m256d_op0[3]) = 0x4010000000000000; + *((unsigned long *)&__m256d_op0[2]) = 0x4008000000000000; + *((unsigned long *)&__m256d_op0[1]) = 0x4000000000000000; + *((unsigned long *)&__m256d_op0[0]) = 0x3ff0000000000000; + *((unsigned long *)&__m128d_result0[1]) = 0x4000000000000000; + *((unsigned long *)&__m128d_result0[0]) = 0x3ff0000000000000; + *((unsigned long *)&__m128d_result1[1]) = 0x4010000000000000; + *((unsigned long *)&__m128d_result1[0]) = 0x4008000000000000; + __m128d_out = __lasx_extract_128_lo_d (__m256d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result0, __m128d_out); + __m128d_out = __lasx_extract_128_hi_d (__m256d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result1, __m128d_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lasx/vect-extract-256-128.c b/gcc/testsuite/gcc.target/loongarch/vector/lasx/vect-extract-256-128.c new file mode 100644 index 0000000..d2219ea --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lasx/vect-extract-256-128.c @@ -0,0 +1,86 @@ +/* { dg-do compile { target { loongarch64*-*-* } } } */ +/* { dg-options "-mabi=lp64d -O2 -mlasx" } */ +/* { dg-final { check-function-bodies "**" "" } } */ + +#include <lasxintrin.h> + +/* +**foo1_lo: +** vld (\$vr[0-9]+),\$r4,0 +** vpickve2gr.du \$r4,(\$vr[0-9]+),0 +** vpickve2gr.du \$r5,(\$vr[0-9]+),1 +** jr \$r1 +*/ +__m128 +foo1_lo (__m256 x) +{ + return __lasx_extract_128_lo_s (x); +} + +/* +**foo1_hi: +** xvld (\$xr[0-9]+),\$r4,0 +** xvpermi.d (\$xr[0-9]+),(\$xr[0-9]+),0xe +** vpickve2gr.du \$r4,(\$vr[0-9]+),0 +** vpickve2gr.du \$r5,(\$vr[0-9]+),1 +** jr \$r1 +*/ +__m128 +foo1_hi (__m256 x) +{ + return __lasx_extract_128_hi_s (x); +} + +/* +**foo2_lo: +** vld (\$vr[0-9]+),\$r4,0 +** vpickve2gr.du \$r4,(\$vr[0-9]+),0 +** vpickve2gr.du \$r5,(\$vr[0-9]+),1 +** jr \$r1 +*/ +__m128d +foo2_lo (__m256d x) +{ + return __lasx_extract_128_lo_d (x); +} + +/* +**foo2_hi: +** xvld (\$xr[0-9]+),\$r4,0 +** xvpermi.d (\$xr[0-9]+),(\$xr[0-9]+),0xe +** vpickve2gr.du \$r4,(\$vr[0-9]+),0 +** vpickve2gr.du \$r5,(\$vr[0-9]+),1 +** jr \$r1 +*/ +__m128d +foo2_hi (__m256d x) +{ + return __lasx_extract_128_hi_d (x); +} + +/* +**foo3_lo: +** vld (\$vr[0-9]+),\$r4,0 +** vpickve2gr.du \$r4,(\$vr[0-9]+),0 +** vpickve2gr.du \$r5,(\$vr[0-9]+),1 +** jr \$r1 +*/ +__m128i +foo3_lo (__m256i x) +{ + return __lasx_extract_128_lo (x); +} + +/* +**foo3_hi: +** xvld (\$xr[0-9]+),\$r4,0 +** xvpermi.d (\$xr[0-9]+),(\$xr[0-9]+),0xe +** vpickve2gr.du \$r4,(\$vr[0-9]+),0 +** vpickve2gr.du \$r5,(\$vr[0-9]+),1 +** jr \$r1 +*/ +__m128i +foo3_hi (__m256i x) +{ + return __lasx_extract_128_hi (x); +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lasx/vect-insert-128-256-result.c b/gcc/testsuite/gcc.target/loongarch/vector/lasx/vect-insert-128-256-result.c new file mode 100644 index 0000000..ce5abf9 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lasx/vect-insert-128-256-result.c @@ -0,0 +1,97 @@ +/* { dg-options "-mabi=lp64d -O2 -mlasx -w -fno-strict-aliasing" } */ + +#include "../simd_correctness_check.h" +#include <lasxintrin.h> + +extern void abort (void); +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_out; + __m128 __m128_op0, __m128_op1, __m128_out; + __m128d __m128d_op0, __m128d_op1, __m128d_out; + + __m256i __m256i_op0, __m256i_result0, __m256i_result1, __m256i_out; + __m256 __m256_op0, __m256_result0, __m256_result1, __m256_out; + __m256d __m256d_op0, __m256d_result0, __m256d_result1, __m256d_out; + + //__m256_op0 = {1,2,3,4,5,6,7,8}, __m128_op0 ={9,9,9,9}; + *((int *)&__m256_op0[7]) = 0x41000000; + *((int *)&__m256_op0[6]) = 0x40e00000; + *((int *)&__m256_op0[5]) = 0x40c00000; + *((int *)&__m256_op0[4]) = 0x40a00000; + *((int *)&__m256_op0[3]) = 0x40800000; + *((int *)&__m256_op0[2]) = 0x40400000; + *((int *)&__m256_op0[1]) = 0x40000000; + *((int *)&__m256_op0[0]) = 0x3f800000; + *((int *)&__m128_op0[3]) = 0x41100000; + *((int *)&__m128_op0[2]) = 0x41100000; + *((int *)&__m128_op0[1]) = 0x41100000; + *((int *)&__m128_op0[0]) = 0x41100000; + *((int *)&__m256_result0[7]) = 0x41000000; + *((int *)&__m256_result0[6]) = 0x40e00000; + *((int *)&__m256_result0[5]) = 0x40c00000; + *((int *)&__m256_result0[4]) = 0x40a00000; + *((int *)&__m256_result0[3]) = 0x41100000; + *((int *)&__m256_result0[2]) = 0x41100000; + *((int *)&__m256_result0[1]) = 0x41100000; + *((int *)&__m256_result0[0]) = 0x41100000; + *((int *)&__m256_result1[7]) = 0x41100000; + *((int *)&__m256_result1[6]) = 0x41100000; + *((int *)&__m256_result1[5]) = 0x41100000; + *((int *)&__m256_result1[4]) = 0x41100000; + *((int *)&__m256_result1[3]) = 0x40800000; + *((int *)&__m256_result1[2]) = 0x40400000; + *((int *)&__m256_result1[1]) = 0x40000000; + *((int *)&__m256_result1[0]) = 0x3f800000; + __m256_out = __lasx_insert_128_lo_s (__m256_op0, __m128_op0); + ASSERTEQ_32 (__LINE__, __m256_result0, __m256_out); + __m256_out = __lasx_insert_128_hi_s (__m256_op0, __m128_op0); + ASSERTEQ_32 (__LINE__, __m256_result1, __m256_out); + + //__m256i_op0 ={1,2,3,4},__m128i_op0={5,6},__m128i_op1={7,8}; + *((unsigned long *)&__m256i_op0[3]) = 0x4; + *((unsigned long *)&__m256i_op0[2]) = 0x3; + *((unsigned long *)&__m256i_op0[1]) = 0x2; + *((unsigned long *)&__m256i_op0[0]) = 0x1; + *((unsigned long *)&__m128i_op0[1]) = 0x6; + *((unsigned long *)&__m128i_op0[0]) = 0x5; + *((unsigned long *)&__m128i_op1[1]) = 0x8; + *((unsigned long *)&__m128i_op1[0]) = 0x7; + *((unsigned long *)&__m256i_result0[3]) = 0x4; + *((unsigned long *)&__m256i_result0[2]) = 0x3; + *((unsigned long *)&__m256i_result0[1]) = 0x6; + *((unsigned long *)&__m256i_result0[0]) = 0x5; + *((unsigned long *)&__m256i_result1[3]) = 0x8; + *((unsigned long *)&__m256i_result1[2]) = 0x7; + *((unsigned long *)&__m256i_result1[1]) = 0x2; + *((unsigned long *)&__m256i_result1[0]) = 0x1; + __m256i_out = __lasx_insert_128_lo (__m256i_op0, __m128i_op0); + ASSERTEQ_64 (__LINE__, __m256i_result0, __m256i_out); + __m256i_out = __lasx_insert_128_hi (__m256i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m256i_result1, __m256i_out); + + //__m256d_op0 ={1,2,3,4},__m128d_op0={5,6},__m128d_op1={7,8}; + *((unsigned long *)&__m256d_op0[3]) = 0x4010000000000000; + *((unsigned long *)&__m256d_op0[2]) = 0x4008000000000000; + *((unsigned long *)&__m256d_op0[1]) = 0x4000000000000000; + *((unsigned long *)&__m256d_op0[0]) = 0x3ff0000000000000; + *((unsigned long *)&__m128d_op0[1]) = 0x4018000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x4014000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x4020000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x401c000000000000; + *((unsigned long *)&__m256d_result0[3]) = 0x4010000000000000; + *((unsigned long *)&__m256d_result0[2]) = 0x4008000000000000; + *((unsigned long *)&__m256d_result0[1]) = 0x4018000000000000; + *((unsigned long *)&__m256d_result0[0]) = 0x4014000000000000; + *((unsigned long *)&__m256d_result1[3]) = 0x4020000000000000; + *((unsigned long *)&__m256d_result1[2]) = 0x401c000000000000; + *((unsigned long *)&__m256d_result1[1]) = 0x4000000000000000; + *((unsigned long *)&__m256d_result1[0]) = 0x3ff0000000000000; + __m256d_out = __lasx_insert_128_lo_d (__m256d_op0, __m128d_op0); + ASSERTEQ_64 (__LINE__, __m256d_result0, __m256d_out); + __m256d_out = __lasx_insert_128_hi_d (__m256d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m256d_result1, __m256d_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lasx/vect-insert-128-256.c b/gcc/testsuite/gcc.target/loongarch/vector/lasx/vect-insert-128-256.c new file mode 100644 index 0000000..326c855 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lasx/vect-insert-128-256.c @@ -0,0 +1,95 @@ +/* { dg-do compile { target { loongarch64*-*-* } } } */ +/* { dg-options "-mabi=lp64d -O2 -mlasx" } */ +/* { dg-final { check-function-bodies "**" "" } } */ + +#include <lasxintrin.h> + +/* +**foo1: +** vinsgr2vr.d (\$vr[0-9]+),\$r6,0 +** xvld (\$xr[0-9]+),\$r5,0 +** vinsgr2vr.d (\$vr[0-9]+),\$r7,1 +** xvpermi.q (\$xr[0-9]+),(\$xr[0-9]+),0x30 +** xvst (\$xr[0-9]+),\$r4,0 +** jr \$r1 +*/ +__m256 +foo1 (__m256 x, __m128 y) +{ + return __builtin_lasx_insert_128_lo_s (x, y); +} + +/* +**foo2: +** vinsgr2vr.d (\$vr[0-9]+),\$r6,0 +** xvld (\$xr[0-9]+),\$r5,0 +** vinsgr2vr.d (\$vr[0-9]+),\$r7,1 +** xvpermi.q (\$xr[0-9]+),(\$xr[0-9]+),0x02 +** xvst (\$xr[0-9]+),\$r4,0 +** jr \$r1 +*/ +__m256 +foo2 (__m256 x, __m128 y) +{ + return __builtin_lasx_insert_128_hi_s (x, y); +} + +/* +**foo3: +** vinsgr2vr.d (\$vr[0-9]+),\$r6,0 +** xvld (\$xr[0-9]+),\$r5,0 +** vinsgr2vr.d (\$vr[0-9]+),\$r7,1 +** xvpermi.q (\$xr[0-9]+),(\$xr[0-9]+),0x30 +** xvst (\$xr[0-9]+),\$r4,0 +** jr \$r1 +*/ +__m256d +foo3 (__m256d x, __m128d y) +{ + return __builtin_lasx_insert_128_lo_d (x, y); +} + +/* +**foo4: +** vinsgr2vr.d (\$vr[0-9]+),\$r6,0 +** xvld (\$xr[0-9]+),\$r5,0 +** vinsgr2vr.d (\$vr[0-9]+),\$r7,1 +** xvpermi.q (\$xr[0-9]+),(\$xr[0-9]+),0x02 +** xvst (\$xr[0-9]+),\$r4,0 +** jr \$r1 +*/ +__m256d +foo4 (__m256d x, __m128d y) +{ + return __builtin_lasx_insert_128_hi_d (x, y); +} + +/* +**foo5: +** vinsgr2vr.d (\$vr[0-9]+),\$r6,0 +** xvld (\$xr[0-9]+),\$r5,0 +** vinsgr2vr.d (\$vr[0-9]+),\$r7,1 +** xvpermi.q (\$xr[0-9]+),(\$xr[0-9]+),0x30 +** xvst (\$xr[0-9]+),\$r4,0 +** jr \$r1 +*/ +__m256i +foo5 (__m256i x, __m128i y) +{ + return __builtin_lasx_insert_128_lo (x, y); +} + +/* +**foo6: +** vinsgr2vr.d (\$vr[0-9]+),\$r6,0 +** xvld (\$xr[0-9]+),\$r5,0 +** vinsgr2vr.d (\$vr[0-9]+),\$r7,1 +** xvpermi.q (\$xr[0-9]+),(\$xr[0-9]+),0x02 +** xvst (\$xr[0-9]+),\$r4,0 +** jr \$r1 +*/ +__m256i +foo6 (__m256i x, __m128i y) +{ + return __builtin_lasx_insert_128_hi (x, y); +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-builtin.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-builtin.c index 1c9f384..7ad8f45 100644 --- a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-builtin.c +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-builtin.c @@ -713,10 +713,10 @@ /* { dg-final { scan-assembler-times "lsx_vfcmp_sune_d:.*vfcmp\\.sune\\.d.*lsx_vfcmp_sune_d" 1 } } */ /* { dg-final { scan-assembler-times "lsx_vfcmp_sune_s:.*vfcmp\\.sune\\.s.*lsx_vfcmp_sune_s" 1 } } */ /* { dg-final { scan-assembler-times "lsx_vfcmp_sun_s:.*vfcmp\\.sun\\.s.*lsx_vfcmp_sun_s" 1 } } */ -/* { dg-final { scan-assembler-times "lsx_vrepli_b:.*vrepli\\.b.*lsx_vrepli_b" 1 } } */ -/* { dg-final { scan-assembler-times "lsx_vrepli_d:.*vrepli\\.d.*lsx_vrepli_d" 1 } } */ -/* { dg-final { scan-assembler-times "lsx_vrepli_h:.*vrepli\\.h.*lsx_vrepli_h" 1 } } */ -/* { dg-final { scan-assembler-times "lsx_vrepli_w:.*vrepli\\.w.*lsx_vrepli_w" 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vrepli_b:.*vldi.*lsx_vrepli_b" 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vrepli_d:.*vldi.*lsx_vrepli_d" 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vrepli_h:.*vldi.*lsx_vrepli_h" 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vrepli_w:.*vldi.*lsx_vrepli_w" 1 } } */ typedef signed char v16i8 __attribute__ ((vector_size (16), aligned (16))); typedef signed char v16i8_b __attribute__ ((vector_size (16), aligned (1))); diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vec-construct-opt.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vec-construct-opt.c index 92da1c8..a35cda6 100644 --- a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vec-construct-opt.c +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vec-construct-opt.c @@ -20,9 +20,9 @@ vec_construct_v2i64 () return res; } -/* Only load the lowest 2 elements and directly copy them to high half-part, - reducing more vinsgr2vr.w. */ -/* { dg-final { scan-assembler-times "v4i32:.*\tvreplvei\\.d.*v4i32" 1 } } */ +/* Load the lowest 2 elements and directly copy them to high half-part + by vldrepl.d. */ +/* { dg-final { scan-assembler-times "v4i32:.*\tvldrepl\\.d.*v4i32" 1 } } */ v4i32 vec_construct_v4i32 () { @@ -32,6 +32,21 @@ vec_construct_v4i32 () return res; } +/* Load 2 elements of a vector simultaneously by vldrepl.d and shuffle by the + vshuf4i.w to avoid use vinsgr2vr. */ +/* { dg-final { scan-assembler-times "v4i32_1:.*\tvldrepl\\.d.*v4i32_1" 1 } } + */ +/* { dg-final { scan-assembler-times "v4i32_1:.*\tvshuf4i\\.w.*v4i32_1" 1 } } + */ +v4i32 +vec_construct_v4i32_1 () +{ + v4i32 res = + { x_si[0], x_si[1], x_si[0], x_si[0] } + ; + return res; +} + /* Only load the lowest 4 elements and directly copy them to high half-part, reducing more vinsgr2vr.h. */ /* { dg-final { scan-assembler-times "v8i16:.*\tvreplvei\\.d.*v8i16" 1 } } */ diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vldi-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vldi-2.c new file mode 100644 index 0000000..a756f96 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vldi-2.c @@ -0,0 +1,93 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mlasx" } */ + +#include <lsxintrin.h> + +#define TEST_V8I16(imm) \ +void \ +test_v8i16_##imm (v8i16 *vec) \ + { \ + v8i16 temp = {imm, imm, imm, imm, \ + imm, imm, imm, imm}; \ + *vec = temp; \ + } + +#define TEST_V4I32(imm) \ +void \ +test_v4i32_##imm (v4i32 *vec) \ + { \ + v4i32 temp = {imm, imm, imm, imm}; \ + *vec = temp; \ + } + +#define TEST_V4I32_2(imm1, imm2) \ +void \ +test_v4i32_2_##imm1 (v4i32 *vec) \ + { \ + v4i32 temp = {imm1, imm2, imm1, imm2};\ + *vec = temp; \ + } + +#define TEST_V2I64(imm) \ +void \ +test_v2i64_##imm (v2i64 *vec) \ + { \ + v2i64 temp = {imm, imm}; \ + *vec = temp; \ + } + +/* 4'b0001:data={2{16'b0,x[7:0],8'b0}}. */ +TEST_V4I32 (0x3a00) +/* { dg-final { scan-assembler-times "test_v4i32_0x3a00:.*\tvldi\t\\\$vr\[0-9\]+,-3782.*-test_v4i32_0x3a00" 1 } } */ + +/* 4'b0010:data={2{8'b0,x[7:0],16'b0}}. */ +TEST_V4I32 (0x3a0000) +/* { dg-final { scan-assembler-times "test_v4i32_0x3a0000:.*\tvldi\t\\\$vr\[0-9\]+,-3526.*-test_v4i32_0x3a0000" 1 } } */ + +/* 4'b0011:data={2{x[7:0],24'b0}}. */ +TEST_V4I32 (0x3a000000) +/* { dg-final { scan-assembler-times "test_v4i32_0x3a000000:.*\tvldi\t\\\$vr\[0-9\]+,-3270.*-test_v4i32_0x3a000000" 1 } } */ + +/* 4'b0101:data={4{x[7:0],8'b0}}. */ +TEST_V8I16 (0x3a00) +/* { dg-final { scan-assembler-times "test_v8i16_0x3a00:.*\tvldi\t\\\$vr\[0-9\]+,-2758.*-test_v8i16_0x3a00" 1 } } */ + +/* 4'b0110:data={2{16'b0,x[7:0],8'hFF}}. */ +TEST_V4I32 (0x3aff) +/* { dg-final { scan-assembler-times "test_v4i32_0x3aff:.*\tvldi\t\\\$vr\[0-9\]+,-2502.*-test_v4i32_0x3aff" 1 } } */ + +/* 4'b0111:data={2{8'b0,x[7:0],16'hFFFF}}. */ +TEST_V4I32 (0x3affff) +/* { dg-final { scan-assembler-times "test_v4i32_0x3affff:.*\tvldi\t\\\$vr\[0-9\]+,-2246.*-test_v4i32_0x3affff" 1 } } */ + +/* 4'b1001:data={{8{x[7]}},{8{x[6]}},{8{x[5]}},{8{x[4]}},{8{x[3]}},{8{x[2]}}, + * {8{x[1]}},{8{x[0]}}}. */ +TEST_V2I64 (0xffffff0000ffff00) +/* { dg-final { scan-assembler-times "test_v2i64_0xffffff0000ffff00:.*\tvldi\t\\\$vr\[0-9\]+,-1562.*-test_v2i64_0xffffff0000ffff00" 1 } } */ + +TEST_V2I64 (0xffff0000ff) +/* { dg-final { scan-assembler-times "test_v2i64_0xffff0000ff:.*\tvldi\t\\\$vr\[0-9\]+,-1767.*-test_v2i64_0xffff0000ff" 1 } } */ + +TEST_V4I32_2 (0xffffff00, 0); +/* { dg-final { scan-assembler-times "test_v4i32_2_0xffffff00:.*\tvldi\t\\\$vr\[0-9\]+,-1778.*-test_v4i32_2_0xffffff00" 1 } } */ + +/* 4'b1010:data={2{x[7],~x[6],{5{x[6]}},x[5:0],19'b0}}. */ +TEST_V4I32 (0xbf180000) +/* { dg-final { scan-assembler-times "test_v4i32_0xbf180000:.*\tvldi\t\\\$vr\[0-9\]+,-1309.*-test_v4i32_0xbf180000" 1 } } */ + +TEST_V4I32 (0x41e00000) +/* { dg-final { scan-assembler-times "test_v4i32_0x41e00000:.*\tvldi\t\\\$vr\[0-9\]+,-1476.*-test_v4i32_0x41e00000" 1 } } */ + +/* 4'b1011:data={32'b0,x[7],~x[6],{5{x[6]}},x[5:0],19'b0}. */ +TEST_V2I64 (0xbe180000) +/* { dg-final { scan-assembler-times "test_v2i64_0xbe180000:.*\tvldi\t\\\$vr\[0-9\]+,-1085.*-test_v2i64_0xbe180000" 1 } } */ + +TEST_V2I64 (0x41e00000) +/* { dg-final { scan-assembler-times "test_v2i64_0x41e00000:.*\tvldi\t\\\$vr\[0-9\]+,-1220.*-test_v2i64_0x41e00000" 1 } } */ + +/* 4'b1100:data={x[7],~x[6],{8{x[6]}},x[5:0],48'b0}. */ +TEST_V2I64 (0xbfd5000000000000) +/* { dg-final { scan-assembler-times "test_v2i64_0xbfd5000000000000:.*\tvldi\t\\\$vr\[0-9\]+,-811.*-test_v2i64_0xbfd5000000000000" 1 } } */ + +TEST_V2I64 (0x4026000000000000) +/* { dg-final { scan-assembler-times "test_v2i64_0x4026000000000000:.*\tvldi\t\\\$vr\[0-9\]+,-986.*-test_v2i64_0x4026000000000000" 1 } } */ diff --git a/gcc/testsuite/gcc.target/loongarch/vrepli.c b/gcc/testsuite/gcc.target/loongarch/vrepli.c index 8deeb47..8eef489 100644 --- a/gcc/testsuite/gcc.target/loongarch/vrepli.c +++ b/gcc/testsuite/gcc.target/loongarch/vrepli.c @@ -1,7 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-O2 -mlasx" } */ -/* { dg-final { scan-assembler "\tvrepli\\.b\t\\\$vr\[0-9\]+,-35" } } */ -/* { dg-final { scan-assembler "\txvrepli\\.b\t\\\$xr\[0-9\]+,-35" } } */ +/* { dg-final { scan-assembler "\tvldi\t\\\$vr\[0-9\]+,221" } } */ +/* { dg-final { scan-assembler "\txvldi\t\\\$xr\[0-9\]+,221" } } */ int f __attribute__((vector_size (16))); int g __attribute__((vector_size (32))); diff --git a/gcc/testsuite/gcc.target/loongarch/widen-mul-rtx-cost-signed.c b/gcc/testsuite/gcc.target/loongarch/widen-mul-rtx-cost-signed.c index 1e1e75f..61d21a8 100644 --- a/gcc/testsuite/gcc.target/loongarch/widen-mul-rtx-cost-signed.c +++ b/gcc/testsuite/gcc.target/loongarch/widen-mul-rtx-cost-signed.c @@ -9,5 +9,4 @@ test (int a) return a / 3; } -/* { dg-final { scan-assembler {\tmulw.d.w\t} } } */ /* { dg-final { scan-assembler-not {\tdiv.w\t} } } */ diff --git a/gcc/testsuite/gcc.target/mips/bswap-7.c b/gcc/testsuite/gcc.target/mips/bswap-7.c new file mode 100644 index 0000000..c1f923e --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/bswap-7.c @@ -0,0 +1,9 @@ +/* { dg-options "-march=allegrex" } */ + +NOMIPS16 unsigned int +foo (unsigned int x) +{ + return __builtin_bswap32 (x); +} + +/* { dg-final { scan-assembler "\twsbw\t" } } */ diff --git a/gcc/testsuite/gcc.target/mips/madd-10.c b/gcc/testsuite/gcc.target/mips/madd-10.c new file mode 100644 index 0000000..514b8d9 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/madd-10.c @@ -0,0 +1,15 @@ +/* { dg-options "-march=allegrex -fexpensive-optimizations" } */ +/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */ +/* { dg-final { scan-assembler-not "\tmul\t" } } */ +/* { dg-final { scan-assembler "\tmadd\t" } } */ + +NOMIPS16 int +f1 (int *a, int *b, int n) +{ + int x, i; + + x = 0; + for (i = 0; i < n; i++) + x += a[i] * b[i]; + return x; +} diff --git a/gcc/testsuite/gcc.target/mips/maddu-5.c b/gcc/testsuite/gcc.target/mips/maddu-5.c new file mode 100644 index 0000000..c316b2f --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/maddu-5.c @@ -0,0 +1,20 @@ +/* { dg-options "-march=allegrex -fexpensive-optimizations" } */ +/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */ +/* { dg-final { scan-assembler-not "\tmul\t" } } */ +/* { dg-final { scan-assembler "\tmaddu\t" } } */ + +typedef unsigned int ui; +typedef unsigned long long ull; + +NOMIPS16 ull +f1 (ui x, ui y, ull z) +{ + return (ull) x * y + z; +} + +NOMIPS16 ull +f2 (ui x, ui y, ull z) +{ + return z + (ull) y * x; +} + diff --git a/gcc/testsuite/gcc.target/mips/max-1.c b/gcc/testsuite/gcc.target/mips/max-1.c new file mode 100644 index 0000000..f3589fc --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/max-1.c @@ -0,0 +1,9 @@ +/* { dg-options "-march=allegrex" } */ + +NOMIPS16 int +foo_max (int a, int b) +{ + return (a > b) ? a : b; +} + +/* { dg-final { scan-assembler "\tmax\t" } } */ diff --git a/gcc/testsuite/gcc.target/mips/min-1.c b/gcc/testsuite/gcc.target/mips/min-1.c new file mode 100644 index 0000000..06b5e91 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/min-1.c @@ -0,0 +1,9 @@ +/* { dg-options "-march=allegrex" } */ + +NOMIPS16 int +foo_min (int a, int b) +{ + return (a < b) ? a : b; +} + +/* { dg-final { scan-assembler "\tmin\t" } } */ diff --git a/gcc/testsuite/gcc.target/mips/msub-9.c b/gcc/testsuite/gcc.target/mips/msub-9.c new file mode 100644 index 0000000..c6b94cb --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/msub-9.c @@ -0,0 +1,15 @@ +/* { dg-options "-march=allegrex -fexpensive-optimizations" } */ +/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */ +/* { dg-final { scan-assembler-not "\tmul\t" } } */ +/* { dg-final { scan-assembler "\tmsub\t" } } */ + +NOMIPS16 int +f1 (int *a, int *b, int n) +{ + int x, i; + + x = 100; + for (i = 0; i < n; i++) + x -= a[i] * b[i]; + return x; +} diff --git a/gcc/testsuite/gcc.target/mips/msubu-5.c b/gcc/testsuite/gcc.target/mips/msubu-5.c new file mode 100644 index 0000000..ba3a8e7 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/msubu-5.c @@ -0,0 +1,14 @@ +/* { dg-options "-march=allegrex -fexpensive-optimizations" } */ +/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */ +/* { dg-final { scan-assembler-not "\tmul\t" } } */ +/* { dg-final { scan-assembler "\tmsubu\t" } } */ + +typedef unsigned int ui; +typedef unsigned long long ull; + +NOMIPS16 ull +f2 (ui x, ui y, ull z) +{ + return z - (ull) y * x; +} + diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-1-p9-runnable.c b/gcc/testsuite/gcc.target/powerpc/builtins-1-p9-runnable.c index 9766541..500db87 100644 --- a/gcc/testsuite/gcc.target/powerpc/builtins-1-p9-runnable.c +++ b/gcc/testsuite/gcc.target/powerpc/builtins-1-p9-runnable.c @@ -16,13 +16,8 @@ int main() { vfb = (vector float){10.0, -2.0, 70.0, 999.0 }; /* Expected results. */ -#ifdef __BIG_ENDIAN__ - vexpected = (vector unsigned short) { 0x4900, 0xc000, 0x5460, 0x63ce, - 0x3666, 0x3e66, 0x4d00, 0x563e }; -#else vexpected = (vector unsigned short) { 0x3666, 0x3e66, 0x4d00, 0x563e, 0x4900, 0xc000, 0x5460, 0x63ce }; -#endif /* vresult = vec_pack_to_short_fp32 (vfa, vfb); diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-1.c b/gcc/testsuite/gcc.target/powerpc/builtins-1.c index 8410a5f..4e7e538 100644 --- a/gcc/testsuite/gcc.target/powerpc/builtins-1.c +++ b/gcc/testsuite/gcc.target/powerpc/builtins-1.c @@ -1035,4 +1035,4 @@ foo156 (vector unsigned short usa) /* { dg-final { scan-assembler-times {\mvmrglb\M} 3 } } */ /* { dg-final { scan-assembler-times {\mvmrgew\M} 4 } } */ /* { dg-final { scan-assembler-times {\mvsplth|xxsplth\M} 4 } } */ -/* { dg-final { scan-assembler-times {\mxxpermdi\M} 44 } } */ +/* { dg-final { scan-assembler-times {\mxxpermdi\M} 42 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-8.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-8.c index 34a2c8e..5dff0d0 100644 --- a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-8.c +++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-8.c @@ -13,5 +13,5 @@ #include "p9-vec-length-8.h" -/* { dg-final { scan-assembler-times {\mlxvl\M} 16 } } */ +/* { dg-final { scan-assembler-times {\mlxvl\M} 14 } } */ /* { dg-final { scan-assembler-times {\mstxvl\M} 7 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/rlwimi-2.c b/gcc/testsuite/gcc.target/powerpc/rlwimi-2.c index bafa371..afbde0e 100644 --- a/gcc/testsuite/gcc.target/powerpc/rlwimi-2.c +++ b/gcc/testsuite/gcc.target/powerpc/rlwimi-2.c @@ -6,7 +6,7 @@ /* { dg-final { scan-assembler-times {(?n)^\s+blr} 6750 } } */ /* { dg-final { scan-assembler-times {(?n)^\s+mr} 643 { target ilp32 } } } */ /* { dg-final { scan-assembler-times {(?n)^\s+mr} 11 { target lp64 } } } */ -/* { dg-final { scan-assembler-times {(?n)^\s+rldicl} 7790 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {(?n)^\s+rldicl} 6754 { target lp64 } } } */ /* { dg-final { scan-assembler-times {(?n)^\s+rlwimi} 1692 { target ilp32 } } } */ /* { dg-final { scan-assembler-times {(?n)^\s+rlwimi} 1666 { target lp64 } } } */ diff --git a/gcc/testsuite/gcc.target/pru/pr122415-1.c b/gcc/testsuite/gcc.target/pru/pr122415-1.c new file mode 100644 index 0000000..4508a85 --- /dev/null +++ b/gcc/testsuite/gcc.target/pru/pr122415-1.c @@ -0,0 +1,9 @@ +/* { dg-do assemble } */ +/* { dg-options "-O1" } */ +/* { dg-final { object-size text <= 24 } } */ + +void test(void) +{ + (*(unsigned *)0x11223344) = 1; + (*(unsigned *)0x11223364) = 1; +} diff --git a/gcc/testsuite/gcc.target/pru/pr122415-2.c b/gcc/testsuite/gcc.target/pru/pr122415-2.c new file mode 100644 index 0000000..c0cf3b3 --- /dev/null +++ b/gcc/testsuite/gcc.target/pru/pr122415-2.c @@ -0,0 +1,9 @@ +/* { dg-options "-O1" } */ + +void test(void) +{ + (*(unsigned *)0x11223364) = 1; + (*(unsigned *)0x11223344) = 1; +} +/* { dg-final { scan-assembler "sbbo\\tr\[0-9.bw\]*, r\[0-9\]*, 100, 4" } } */ +/* { dg-final { scan-assembler "sbbo\\tr\[0-9.bw\]*, r\[0-9\]*, 68, 4" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/abi/empty-struct+union-1.c b/gcc/testsuite/gcc.target/riscv/abi/empty-struct+union-1.c new file mode 100644 index 0000000..4cea38e --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/abi/empty-struct+union-1.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g -mabi=lp64d -fdump-rtl-expand" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +struct Su2e_1f { + union { + struct { + } e1, e2; + } u; + float f; +}; +struct Su2e_1f echo_Su2e_1f(int i, float f, struct Su2e_1f s) { + return s; +} + +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa1 \[ s \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa0\)[[:space:]]+\(reg.*:SF \d+ \[ <retval> \]\)\)} "expand" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/abi/empty-struct+union-2.c b/gcc/testsuite/gcc.target/riscv/abi/empty-struct+union-2.c new file mode 100644 index 0000000..e7271e2 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/abi/empty-struct+union-2.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g -mabi=lp64d -fdump-rtl-expand" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +struct Su2e_2f { + union { + struct { + } e1, e2; + } u; + float f; + float g; +}; +struct Su2e_2f echo_Su2e_2f(int i, float f, struct Su2e_2f s) /* { dg-warning "ABI for flattened empty union and zero length array changed in GCC 16" } */ { + return s; +} + +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa1 \[ s \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa2 \[ s\+4 \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa0\)[[:space:]]+\(reg.*:SF \d+ \[ <retval> \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa1\)[[:space:]]+\(reg.*:SF \d+ \[ <retval>\+4 \]\)\)} "expand" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/abi/empty-struct+union-3.c b/gcc/testsuite/gcc.target/riscv/abi/empty-struct+union-3.c new file mode 100644 index 0000000..9743d4a --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/abi/empty-struct+union-3.c @@ -0,0 +1,27 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g -mabi=lp64d -fdump-rtl-expand" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +struct Smu2e_1f { + union { + struct { + } e1, e2; + } u1; + struct { + float f; + union { + struct { + } e1, e2; + } u; + } ue; + union { + struct { + } e1, e2; + } u2; +}; +struct Smu2e_1f echo_Smu2e_1f(int i, float f, struct Smu2e_1f s) { + return s; +} + +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa1 \[ s \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa0\)[[:space:]]+\(reg.*:SF \d+ \[ <retval> \]\)\)} "expand" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/abi/empty-struct+union-4.c b/gcc/testsuite/gcc.target/riscv/abi/empty-struct+union-4.c new file mode 100644 index 0000000..081ea68 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/abi/empty-struct+union-4.c @@ -0,0 +1,30 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g -mabi=lp64d -fdump-rtl-expand" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +struct Smu2e_2f { + union { + struct { + } e1, e2; + } u1; + struct { + float f; + float g; + union { + struct { + } e1, e2; + } u; + } ue; + union { + struct { + } e1, e2; + } u2; +}; +struct Smu2e_2f echo_Smu2e_2f(int i, float f, struct Smu2e_2f s) /* { dg-warning "ABI for flattened empty union and zero length array changed in GCC 16" } */ { + return s; +} + +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa1 \[ s \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa2 \[ s\+4 \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa0\)[[:space:]]+\(reg.*:SF \d+ \[ <retval> \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa1\)[[:space:]]+\(reg.*:SF \d+ \[ <retval>\+4 \]\)\)} "expand" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/abi/empty-struct-1.c b/gcc/testsuite/gcc.target/riscv/abi/empty-struct-1.c new file mode 100644 index 0000000..a0a4866 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/abi/empty-struct-1.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g -mabi=lp64d -fdump-rtl-expand" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +struct Se_1f { + struct { + } e1; + float f; +}; +struct Se_1f echo_Se_1f(int i, float f, struct Se_1f s) { + return s; +} + +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa1 \[ s \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa0\)[[:space:]]+\(reg.*:SF \d+ \[ <retval> \]\)\)} "expand" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/abi/empty-struct-10.c b/gcc/testsuite/gcc.target/riscv/abi/empty-struct-10.c new file mode 100644 index 0000000..de8ad02 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/abi/empty-struct-10.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g -mabi=lp64d -fdump-rtl-expand" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +struct S1ae_2f { + struct { + } e1[1]; + float f; + float g; +}; +struct S1ae_2f echo_S1ae_2f(int i, float f, struct S1ae_2f s) /* { dg-warning "ABI for flattened empty union and zero length array changed in GCC 16" } */ { + return s; +} + +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa1 \[ s \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa2 \[ s\+4 \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa0\)[[:space:]]+\(reg.*:SF \d+ \[ <retval> \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa1\)[[:space:]]+\(reg.*:SF \d+ \[ <retval>\+4 \]\)\)} "expand" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/abi/empty-struct-11.c b/gcc/testsuite/gcc.target/riscv/abi/empty-struct-11.c new file mode 100644 index 0000000..c99bb22 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/abi/empty-struct-11.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g -mabi=lp64d -fdump-rtl-expand" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +struct Sm1ae_1f { + struct { + } e1[1]; + struct { + float f; + struct { + } e[1]; + } fe; + struct { + } e2[1]; +}; +struct Sm1ae_1f echo_Sm1ae_1f(int i, float f, struct Sm1ae_1f s) { + return s; +} + +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa1 \[ s \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa0\)[[:space:]]+\(reg.*:SF \d+ \[ <retval> \]\)\)} "expand" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/abi/empty-struct-12.c b/gcc/testsuite/gcc.target/riscv/abi/empty-struct-12.c new file mode 100644 index 0000000..065ff02 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/abi/empty-struct-12.c @@ -0,0 +1,24 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g -mabi=lp64d -fdump-rtl-expand" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +struct Sm1ae_2f { + struct { + } e1[1]; + struct { + float f; + float g; + struct { + } e[1]; + } fe; + struct { + } e2[1]; +}; +struct Sm1ae_2f echo_Sm1ae_2f(int i, float f, struct Sm1ae_2f s) /* { dg-warning "ABI for flattened empty union and zero length array changed in GCC 16" } */ { + return s; +} + +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa1 \[ s \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa2 \[ s\+4 \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa0\)[[:space:]]+\(reg.*:SF \d+ \[ <retval> \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa1\)[[:space:]]+\(reg.*:SF \d+ \[ <retval>\+4 \]\)\)} "expand" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/abi/empty-struct-2.c b/gcc/testsuite/gcc.target/riscv/abi/empty-struct-2.c new file mode 100644 index 0000000..93210fe --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/abi/empty-struct-2.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g -mabi=lp64d -fdump-rtl-expand" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +struct Se_2f { + struct { + } e1; + float f; + float g; +}; +struct Se_2f echo_Se_2f(int i, float f, struct Se_2f s) { + return s; +} + +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa1 \[ s \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa2 \[ s\+4 \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa0\)[[:space:]]+\(reg.*:SF \d+ \[ <retval> \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa1\)[[:space:]]+\(reg.*:SF \d+ \[ <retval>\+4 \]\)\)} "expand" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/abi/empty-struct-3.c b/gcc/testsuite/gcc.target/riscv/abi/empty-struct-3.c new file mode 100644 index 0000000..b8c3362 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/abi/empty-struct-3.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g -mabi=lp64d -fdump-rtl-expand" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +struct Sme_1f { + struct { + } e1; + struct { + float f; + struct { + } e; + } fe; + struct { + } e2; +}; +struct Sme_1f echo_Sme_1f(int i, float f, struct Sme_1f s) { + return s; +} + +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa1 \[ s \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa0\)[[:space:]]+\(reg.*:SF \d+ \[ <retval> \]\)\)} "expand" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/abi/empty-struct-4.c b/gcc/testsuite/gcc.target/riscv/abi/empty-struct-4.c new file mode 100644 index 0000000..0ce36d1 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/abi/empty-struct-4.c @@ -0,0 +1,24 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g -mabi=lp64d -fdump-rtl-expand" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +struct Sme_2f { + struct { + } e1; + struct { + float f; + float g; + struct { + } e; + } fe; + struct { + } e2; +}; +struct Sme_2f echo_Sme_2f(int i, float f, struct Sme_2f s) { + return s; +} + +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa1 \[ s \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa2 \[ s\+4 \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa0\)[[:space:]]+\(reg.*:SF \d+ \[ <retval> \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa1\)[[:space:]]+\(reg.*:SF \d+ \[ <retval>\+4 \]\)\)} "expand" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/abi/empty-struct-5.c b/gcc/testsuite/gcc.target/riscv/abi/empty-struct-5.c new file mode 100644 index 0000000..0ae1e41 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/abi/empty-struct-5.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g -mabi=lp64d -fdump-rtl-expand" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +struct S0ae_1f { + struct { + } e1[0]; + float f; +}; +struct S0ae_1f echo_S0ae_1f(int i, float f, struct S0ae_1f s) { + return s; +} + +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa1 \[ s \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa0\)[[:space:]]+\(reg.*:SF \d+ \[ <retval> \]\)\)} "expand" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/abi/empty-struct-6.c b/gcc/testsuite/gcc.target/riscv/abi/empty-struct-6.c new file mode 100644 index 0000000..d3d0b65 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/abi/empty-struct-6.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g -mabi=lp64d -fdump-rtl-expand" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +struct S0ae_2f { + struct { + } e1[0]; + float f; + float g; +}; +struct S0ae_2f echo_S0ae_2f(int i, float f, struct S0ae_2f s) /* { dg-warning "ABI for flattened empty union and zero length array changed in GCC 16" } */ { + return s; +} + +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa1 \[ s \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa2 \[ s\+4 \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa0\)[[:space:]]+\(reg.*:SF \d+ \[ <retval> \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa1\)[[:space:]]+\(reg.*:SF \d+ \[ <retval>\+4 \]\)\)} "expand" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/abi/empty-struct-7.c b/gcc/testsuite/gcc.target/riscv/abi/empty-struct-7.c new file mode 100644 index 0000000..9eae13d --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/abi/empty-struct-7.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g -mabi=lp64d -fdump-rtl-expand" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +struct Sm0ae_1f { + struct { + } e1[0]; + struct { + float f; + struct { + } e[0]; + } fe; + struct { + } e2[0]; +}; +struct Sm0ae_1f echo_Sm0ae_1f(int i, float f, struct Sm0ae_1f s) { + return s; +} + +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa1 \[ s \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa0\)[[:space:]]+\(reg.*:SF \d+ \[ <retval> \]\)\)} "expand" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/abi/empty-struct-8.c b/gcc/testsuite/gcc.target/riscv/abi/empty-struct-8.c new file mode 100644 index 0000000..e7c81f4 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/abi/empty-struct-8.c @@ -0,0 +1,24 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g -mabi=lp64d -fdump-rtl-expand" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +struct Sm0ae_2f { + struct { + } e1[0]; + struct { + float f; + float g; + struct { + } e[0]; + } fe; + struct { + } e2[0]; +}; +struct Sm0ae_2f echo_Sm0ae_2f(int i, float f, struct Sm0ae_2f s) /* { dg-warning "ABI for flattened empty union and zero length array changed in GCC 16" } */ { + return s; +} + +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa1 \[ s \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa2 \[ s\+4 \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa0\)[[:space:]]+\(reg.*:SF \d+ \[ <retval> \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa1\)[[:space:]]+\(reg.*:SF \d+ \[ <retval>\+4 \]\)\)} "expand" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/abi/empty-struct-9.c b/gcc/testsuite/gcc.target/riscv/abi/empty-struct-9.c new file mode 100644 index 0000000..55c4be4 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/abi/empty-struct-9.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g -mabi=lp64d -fdump-rtl-expand" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +struct S1ae_1f { + struct { + } e1[1]; + float f; +}; +struct S1ae_1f echo_S1ae_1f(int i, float f, struct S1ae_1f s) { + return s; +} + +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa1 \[ s \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa0\)[[:space:]]+\(reg.*:SF \d+ \[ <retval> \]\)\)} "expand" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/abi/empty-union-1.c b/gcc/testsuite/gcc.target/riscv/abi/empty-union-1.c new file mode 100644 index 0000000..17beb0d --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/abi/empty-union-1.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g -mabi=lp64d -fdump-rtl-expand" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +struct Seu_1f { + union { + } e1; + float f; +}; +struct Seu_1f echo_Seu_1f(int i, float f, struct Seu_1f s) { + return s; +} + +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa1 \[ s \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa0\)[[:space:]]+\(reg.*:SF \d+ \[ <retval> \]\)\)} "expand" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/abi/empty-union-2.c b/gcc/testsuite/gcc.target/riscv/abi/empty-union-2.c new file mode 100644 index 0000000..c583186 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/abi/empty-union-2.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g -mabi=lp64d -fdump-rtl-expand" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +struct S2eu_2f { + union { + } e1; + float f; + float g; +}; +struct S2eu_2f echo_S2eu_2f(int i, float f, struct S2eu_2f s) /* { dg-warning "ABI for flattened empty union and zero length array changed in GCC 16" } */ { + return s; +} + +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa1 \[ s \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa2 \[ s\+4 \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa0\)[[:space:]]+\(reg.*:SF \d+ \[ <retval> \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa1\)[[:space:]]+\(reg.*:SF \d+ \[ <retval>\+4 \]\)\)} "expand" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/abi/empty-union-3.c b/gcc/testsuite/gcc.target/riscv/abi/empty-union-3.c new file mode 100644 index 0000000..e9e189b --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/abi/empty-union-3.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g -mabi=lp64d -fdump-rtl-expand" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +struct Smeu_1f { + union { + } e1; + struct { + float f; + union { + } e; + } fe; + union { + } e2; +}; +struct Smeu_1f echo_Smeu_1f(int i, float f, struct Smeu_1f s) { + return s; +} + +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa1 \[ s \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa0\)[[:space:]]+\(reg.*:SF \d+ \[ <retval> \]\)\)} "expand" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/abi/empty-union-4.c b/gcc/testsuite/gcc.target/riscv/abi/empty-union-4.c new file mode 100644 index 0000000..91c2d89 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/abi/empty-union-4.c @@ -0,0 +1,24 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g -mabi=lp64d -fdump-rtl-expand" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +struct Smeu_2f { + union { + } e1; + struct { + float f; + float g; + union { + } e; + } fe; + union { + } e2; +}; +struct Smeu_2f echo_Smeu_2f(int i, float f, struct Smeu_2f s) /* { dg-warning "ABI for flattened empty union and zero length array changed in GCC 16" } */ { + return s; +} + +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa1 \[ s \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ .*\)[[:space:]]+\(reg.*:SF \d+ fa2 \[ s\+4 \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa0\)[[:space:]]+\(reg.*:SF \d+ \[ <retval> \]\)\)} "expand" } } */ +/* { dg-final { scan-rtl-dump {\(set \(reg.*:SF \d+ fa1\)[[:space:]]+\(reg.*:SF \d+ \[ <retval>\+4 \]\)\)} "expand" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/czero-bext.c b/gcc/testsuite/gcc.target/riscv/czero-bext.c new file mode 100644 index 0000000..54a6d6f --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/czero-bext.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -march=rv64gbc_zicond -mabi=lp64d" { target { rv64 } } } */ +/* { dg-options "-O2 -march=rv32gbc_zicond -mabi=ilp32" { target { rv32 } } } */ + +bool isValidAncestorType(int type) { + if (type == 0 || type == 6 || type == 4) { + return true; + } + return false; +} + + + +/* { dg-final { scan-assembler "czero.nez\t" } } */ +/* { dg-final { scan-assembler "sgtu\t" } } */ +/* { dg-final { scan-assembler-not "bgtu\t" } } */ + diff --git a/gcc/testsuite/gcc.target/riscv/pr113715.c b/gcc/testsuite/gcc.target/riscv/pr113715.c new file mode 100644 index 0000000..953a7be --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/pr113715.c @@ -0,0 +1,98 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32ima_zca_zcmp -mabi=ilp32 -mcmodel=medlow -fno-pic" }*/ +/* { dg-skip-if "" { *-*-* } {"-O0" "-O1" "-O2" "-Og" "-O3" "-flto"} } */ +/* { dg-final { check-function-bodies "**" "" } } */ + +void test_1(int); + +/* +**test_err: +** ... +** li a0,1 +** call test_1 +** cm.popretz {ra}, 16 +** ... +*/ +int test_err(int mode) +{ + if (mode == 2) { + test_1(1); + } + + return 0; +} + +/* +**test_err2: +** ... +** li a0,1 +** call test_1 +** li a1,0 +** cm.popretz {ra}, 16 +** ... +*/ +long long test_err2(int mode) +{ + if (mode == 2) { + test_1(1); + } + + return 0; +} + + +/* +**test_err3: +** ... +** li a0,1 +** call test_1 +** li a1,1 +** cm.popretz {ra}, 16 +** ... +*/ +long long test_err3(int mode) +{ + if (mode == 2) { + test_1(1); + return 0x100000000ll; + } + + return 0; +} + +/* +**test_err4: +** ... +** li a0,1 +** call test_1 +** cm.popretz {ra}, 16 +** ... +*/ +float test_err4(int mode) +{ + if (mode == 2) { + test_1(1); + return 0.0f; + } + + return 1.0f; +} + +/* +**test_err5: +** ... +** li a0,1 +** call test_1 +** li a1,0 +** cm.popretz {ra}, 16 +** ... +*/ +double test_err5(int mode) +{ + if (mode == 2) { + test_1(1); + return 0.0; + } + + return 1.0; +} diff --git a/gcc/testsuite/gcc.target/riscv/pr121136.c b/gcc/testsuite/gcc.target/riscv/pr121136.c new file mode 100644 index 0000000..77585f4 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/pr121136.c @@ -0,0 +1,103 @@ +/* { dg-do compile } */ +/* { dg-options "-std=gnu23 -O2 -march=rv64gc -mabi=lp64d" { target rv64} } */ +/* { dg-options "-std=gnu23 -O2 -march=rv32gc -mabi=ilp32" { target rv32} } */ + +/* We need to adjust the constant so this works for rv32 and rv64. */ +#if __riscv_xlen == 32 +#define ONE 1U +#define TYPE unsigned int +#define CTZ __builtin_ctz +#else +#define ONE 1UL +#define TYPE unsigned long +#define CTZ __builtin_ctzl +#endif + +#define F1(C) _Bool func1_##C(TYPE x) { return x <= C; } +#define F2(C) _Bool func2_##C(TYPE x) { return ((x >> CTZ (C+ONE)) == 0); } +#define F3(C) _Bool func3_##C(TYPE x) { return ((x / (C+ONE)) == 0); } + +#define F(C) F1(C) F2(C) F3(C) + +F (0x1U) +F (0x3U) +F (0x7U) +F (0xfU) +F (0x1fU) +F (0x3fU) +F (0x7fU) +F (0xffU) +F (0x1ffU) +F (0x3ffU) +F (0x7ffU) +F (0xfffU) +F (0x1fffU) +F (0x3fffU) +F (0x7fffU) +F (0xffffU) +F (0x1ffffU) +F (0x3ffffU) +F (0x7ffffU) +F (0xfffffU) +F (0x1fffffU) +F (0x3fffffU) +F (0x7fffffU) +F (0xffffffU) +F (0x1ffffffU) +F (0x3ffffffU) +F (0x7ffffffU) +F (0xfffffffU) +F (0x1fffffffU) +F (0x3fffffffU) +F (0x7fffffffU) +#if __riscv_xlen == 64 +F (0xffffffffUL) +F (0x1ffffffffUL) +F (0x3ffffffffUL) +F (0x7ffffffffUL) +F (0xfffffffffUL) +F (0x1fffffffffUL) +F (0x3fffffffffUL) +F (0x7fffffffffUL) +F (0xffffffffffUL) +F (0x1ffffffffffUL) +F (0x3ffffffffffUL) +F (0x7ffffffffffUL) +F (0xfffffffffffUL) +F (0x1fffffffffffUL) +F (0x3fffffffffffUL) +F (0x7fffffffffffUL) +F (0xffffffffffffUL) +F (0x1ffffffffffffUL) +F (0x3ffffffffffffUL) +F (0x7ffffffffffffUL) +F (0xfffffffffffffUL) +F (0x1fffffffffffffUL) +F (0x3fffffffffffffUL) +F (0x7fffffffffffffUL) +F (0xffffffffffffffUL) +F (0x1ffffffffffffffUL) +F (0x3ffffffffffffffUL) +F (0x7ffffffffffffffUL) +F (0xfffffffffffffffUL) +F (0x1fffffffffffffffUL) +F (0x3fffffffffffffffUL) +F (0x7fffffffffffffffUL) +#endif + +/* These represent current state. They are not optimal as some of the cases + where we shift are better implemented by loading 2^n constant and using + sltu as the lui has no incoming data dependencies. */ +/* { dg-final { scan-assembler-times "\tsltiu" 30 { target { rv64 } } } } */ +/* { dg-final { scan-assembler-times "\tnot" 3 { target { rv64 } } } } */ +/* { dg-final { scan-assembler-times "\tsrli" 121 { target { rv64 } } } } */ +/* { dg-final { scan-assembler-times "\tsltu" 38 { target { rv64 } } } } */ +/* { dg-final { scan-assembler-times "\tseqz" 118 { target { rv64 } } } } */ +/* { dg-final { scan-assembler-times "\tli" 38 { target { rv64 } } } } */ + +/* { dg-final { scan-assembler-times "\tsltiu" 30 { target { rv32 } } } } */ +/* { dg-final { scan-assembler-times "\tnot" 3 { target { rv32 } } } } */ +/* { dg-final { scan-assembler-times "\tsrli" 25 { target { rv32 } } } } */ +/* { dg-final { scan-assembler-times "\tsltu" 38 { target { rv32 } } } } */ +/* { dg-final { scan-assembler-times "\tseqz" 22 { target { rv32 } } } } */ +/* { dg-final { scan-assembler-times "\tli" 38 { target { rv32 } } } } */ diff --git a/gcc/testsuite/gcc.target/riscv/pr122215.c b/gcc/testsuite/gcc.target/riscv/pr122215.c new file mode 100644 index 0000000..cdc1ed7 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/pr122215.c @@ -0,0 +1,46 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target valgrind } */ +/* { dg-additional-files "sparseset.supp" } */ +/* { dg-options "-wrapper valgrind,-q,--exit-on-first-error=yes,--error-exitcode=1,--suppressions=${srcdir}/sparseset.supp" } */ + +typedef signed int int32_t; +typedef signed long int int64_t; + +int64_t dual_reg_insn(int64_t x) { + int64_t res; + int64_t zero = 0; + asm ("some_custom_insn %0,%1,%2" : "=R" (res) : "R" (x), "R" (zero)); + return res; +} + +int32_t single_reg_insn(int32_t x) { + int32_t res; + int32_t zero = 0; + asm ("some_custom_insn %0,%1,%2" : "=r" (res) : "r" (x), "r" (zero)); + return res; +} + +int32_t single_reg_insn_explicit_zero(int32_t x) { + int32_t res; + asm ("some_custom_insn %0,%1,%2" : "=r" (res) : "r" (x), "r" (0)); + return res; +} + +int64_t dual_reg_insn2(int64_t x) { + int64_t res; + int64_t zero = 0; + asm ("some_custom_insn %0,%1,%2" : "=R" (res) : "R" (x), "R" (zero)); + return res; + /* This function is IDENTICAL to dual_reg_insn, + * but for some obscure reason (alignment?) + * it decides to use sX registers instead of aX to store zero, + * resulting in a much larger code since it needs to use the stack. + * THIS ONLY HAPPENS SOMETIMES! + */ +} + +int64_t dual_reg_insn_explicit_zero(int64_t x) { + int64_t res; + asm ("some_custom_insn %0,%1,%2" : "=R" (res) : "R" (x), "R" (0LL)); + return res; +} diff --git a/gcc/testsuite/gcc.target/riscv/pr122675-1.c b/gcc/testsuite/gcc.target/riscv/pr122675-1.c new file mode 100644 index 0000000..3187b10 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/pr122675-1.c @@ -0,0 +1,38 @@ +/* Verify that the most likely BB edges are optimized as fallthroughs. */ +/* { dg-do compile } */ +/* { dg-options "-O1 -fno-pic -march=rv64gc -mabi=lp64d" } */ +/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ +/* { dg-final { check-function-bodies "**" "" "" { target *-*-* } {^\t?\.} } } */ + +/* +**test: +**... +** beq a0,zero,.L[0-9]* +**... +** call f1 +**... +** ( +** jr ra +** | +** ret +** ) +**... +**.L[0-9]+: +**... +** ( +** jr ra +** | +** ret +** ) +**... +*/ + +int f1(void); + +int test(int a) +{ + if (__builtin_expect(!!a, 1)) { + return f1(); + } + return a; +} diff --git a/gcc/testsuite/gcc.target/riscv/pr52345.c b/gcc/testsuite/gcc.target/riscv/pr52345.c new file mode 100644 index 0000000..90feb91 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/pr52345.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -march=rv64gcbv_zicond -mabi=lp64d" { target { rv64 } } } */ +/* { dg-options "-O2 -march=rv32gcbv_zicond -mabi=ilp32" { target { rv32 } } } */ + +int f(int a, int b) +{ + int c = a != 0; + int d = (c!=0|b!=0); + return d; +} + +int h (int a, int b) +{ + int c = (a!=0|b); + int d = c==0; + return d; +} + +/* { dg-final { scan-assembler-times {\tor} 2 } } */ +/* { dg-final { scan-assembler-times {\tsnez} 1 } } */ +/* { dg-final { scan-assembler-times {\tseqz} 1 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/pr67731.c b/gcc/testsuite/gcc.target/riscv/pr67731.c new file mode 100644 index 0000000..6f254fc --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/pr67731.c @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -march=rv64gcbv -mabi=lp64d" { target { rv64 } } } */ +/* { dg-options "-O2 -march=rv32gcbv -mabi=ilp32" { target { rv32 } } } */ + +typedef struct +{ + _Bool a : 1; + _Bool b : 1; + _Bool c : 1; + _Bool d : 1; + unsigned int e : 4; +} S; + +_Bool test_00 (S* s) +{ + return s->b | s->c; +} + +_Bool test_01 (S* s) +{ + return s->b | s->c | s->d; +} +/* { dg-final { scan-assembler-times {\tlw\ta0,0\(a0\).*?\n\tandi\ta0,a0,\d+.*?\n\tsnez\ta0,a0.*?\n\tret} 2 } } */ +/* { dg-final { scan-assembler-not {\tor} } } */ +/* { dg-final { scan-assembler-not {\tbexti} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/pr91420.c b/gcc/testsuite/gcc.target/riscv/pr91420.c new file mode 100644 index 0000000..936d998 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/pr91420.c @@ -0,0 +1,46 @@ +/* { dg-do assemble } */ +/* { dg-options "-O2 -mcmodel=medany -save-temps" } */ + +int a[1]; + +__UINTPTR_TYPE__ +foo(void) +{ + return (__UINTPTR_TYPE__)a + 0x7fffffff; +} + +__UINTPTR_TYPE__ +bfoo(void) +{ + return (__UINTPTR_TYPE__)a + 0x40000000; +} + +__UINTPTR_TYPE__ +sfoo(void) +{ + return (__UINTPTR_TYPE__)a + 0x3fffffff; +} + +__UINTPTR_TYPE__ +bar(void) +{ + return (__UINTPTR_TYPE__)a - 0x80000000; +} + +__UINTPTR_TYPE__ +bbar(void) +{ + return (__UINTPTR_TYPE__)a - 0x40000000; +} + +__UINTPTR_TYPE__ +sbar(void) +{ + return (__UINTPTR_TYPE__)a - 0x3fffffff; +} + +/* /* dg-final { scan-assembler-times "lla\ta[0-9]*, a$" 4 { target riscv64-*-* } } } */ +/* /* dg-final { scan-assembler-times "lla\ta[0-9]*, a[-+]" 2 { target riscv64-*-* } } } */ + +/* /* dg-final { scan-assembler-times "lla\ta[0-9]*, a[-+]$" 6 { target riscv32-*-* } } } */ +/* /* dg-final { scan-assembler-not "lla\ta[0-9]*, a$" { target riscv32-*-* } } } */ diff --git a/gcc/testsuite/gcc.target/riscv/pragma-target-1.c b/gcc/testsuite/gcc.target/riscv/pragma-target-1.c new file mode 100644 index 0000000..d1a0600 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/pragma-target-1.c @@ -0,0 +1,59 @@ +/* Test for #pragma GCC target and push/pop options support in RISC-V */ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gc -mabi=lp64d -O2" } */ + +/* Default compilation options - no vector */ +void default_func(void) { +#ifdef __riscv_vector + __builtin_abort(); /* Should not have vector by default */ +#endif +} + +/* Change target to enable vector */ +#pragma GCC push_options +#pragma GCC target("arch=rv64gcv") +void vector_func(void) { +#ifndef __riscv_vector + __builtin_abort(); /* Should have vector here */ +#endif +} +#pragma GCC pop_options + +/* Back to default - no vector */ +void after_pop_func(void) { +#ifdef __riscv_vector + __builtin_abort(); /* Should not have vector after pop */ +#endif +} + +/* Test multiple push/pop levels */ +#pragma GCC push_options +#pragma GCC target("arch=rv64gc") +void base_func(void) { +#ifdef __riscv_vector + __builtin_abort(); /* Should not have vector */ +#endif +} + +#pragma GCC push_options +#pragma GCC target("arch=rv64gcv") +void nested_vector_func(void) { +#ifndef __riscv_vector + __builtin_abort(); /* Should have vector here */ +#endif +} +#pragma GCC pop_options + +void after_nested_pop_func(void) { +#ifdef __riscv_vector + __builtin_abort(); /* Should not have vector after nested pop */ +#endif +} +#pragma GCC pop_options + +/* Final function should be back to original default */ +void final_func(void) { +#ifdef __riscv_vector + __builtin_abort(); /* Should not have vector */ +#endif +} diff --git a/gcc/testsuite/gcc.target/riscv/pragma-target-2.c b/gcc/testsuite/gcc.target/riscv/pragma-target-2.c new file mode 100644 index 0000000..077bcdd --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/pragma-target-2.c @@ -0,0 +1,26 @@ +/* Test for #pragma GCC target with tune parameter */ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gc -mabi=lp64d -mtune=rocket -O2" } */ + +void default_tune(void) { + /* Default tune is rocket */ +} + +#pragma GCC push_options +#pragma GCC target("tune=sifive-7-series") +void sifive_tune(void) { + /* Tune should be sifive-7-series */ +} +#pragma GCC pop_options + +void back_to_rocket(void) { + /* Tune should be back to rocket */ +} + +#pragma GCC target("arch=rv64gcv;tune=generic") +void combined_options(void) { +#ifndef __riscv_vector + __builtin_abort(); /* Should have vector */ +#endif + /* Tune should be generic */ +} diff --git a/gcc/testsuite/gcc.target/riscv/predef-profiles-1.c b/gcc/testsuite/gcc.target/riscv/predef-profiles-1.c deleted file mode 100644 index 5fc17ab..0000000 --- a/gcc/testsuite/gcc.target/riscv/predef-profiles-1.c +++ /dev/null @@ -1,11 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-march=rvi20u64 -mabi=lp64" } */ - -int main () { - -#ifndef __riscv_rvi20u64 -#error "__riscv_rvi20u64" -#endif - - return 0; -}
\ No newline at end of file diff --git a/gcc/testsuite/gcc.target/riscv/predef-profiles-2.c b/gcc/testsuite/gcc.target/riscv/predef-profiles-2.c deleted file mode 100644 index 86f2771..0000000 --- a/gcc/testsuite/gcc.target/riscv/predef-profiles-2.c +++ /dev/null @@ -1,11 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-march=rvi20u32 -mabi=ilp32" } */ - -int main () { - -#ifndef __riscv_rvi20u32 -#error "__riscv_rvi20u32" -#endif - - return 0; -}
\ No newline at end of file diff --git a/gcc/testsuite/gcc.target/riscv/predef-profiles-3.c b/gcc/testsuite/gcc.target/riscv/predef-profiles-3.c deleted file mode 100644 index 7787549..0000000 --- a/gcc/testsuite/gcc.target/riscv/predef-profiles-3.c +++ /dev/null @@ -1,11 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-march=rva20u64 -mabi=lp64d" } */ - -int main () { - -#ifndef __riscv_rva20u64 -#error "__riscv_rva20u64" -#endif - - return 0; -}
\ No newline at end of file diff --git a/gcc/testsuite/gcc.target/riscv/predef-profiles-4.c b/gcc/testsuite/gcc.target/riscv/predef-profiles-4.c deleted file mode 100644 index abb20b7..0000000 --- a/gcc/testsuite/gcc.target/riscv/predef-profiles-4.c +++ /dev/null @@ -1,11 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-march=rva22u64 -mabi=lp64d" } */ - -int main () { - -#ifndef __riscv_rva22u64 -#error "__riscv_rva22u64" -#endif - - return 0; -}
\ No newline at end of file diff --git a/gcc/testsuite/gcc.target/riscv/predef-profiles-5.c b/gcc/testsuite/gcc.target/riscv/predef-profiles-5.c deleted file mode 100644 index 0840cdc..0000000 --- a/gcc/testsuite/gcc.target/riscv/predef-profiles-5.c +++ /dev/null @@ -1,11 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-march=rva23u64 -mabi=lp64d" } */ - -int main () { - -#ifndef __riscv_rva23u64 -#error "__riscv_rva23u64" -#endif - - return 0; -}
\ No newline at end of file diff --git a/gcc/testsuite/gcc.target/riscv/predef-profiles-6.c b/gcc/testsuite/gcc.target/riscv/predef-profiles-6.c deleted file mode 100644 index 7159780..0000000 --- a/gcc/testsuite/gcc.target/riscv/predef-profiles-6.c +++ /dev/null @@ -1,11 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-march=rva23s64 -mabi=lp64d" } */ - -int main () { - -#ifndef __riscv_rva23s64 -#error "__riscv_rva23s64" -#endif - - return 0; -}
\ No newline at end of file diff --git a/gcc/testsuite/gcc.target/riscv/predef-profiles-7.c b/gcc/testsuite/gcc.target/riscv/predef-profiles-7.c deleted file mode 100644 index 1366159..0000000 --- a/gcc/testsuite/gcc.target/riscv/predef-profiles-7.c +++ /dev/null @@ -1,11 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-march=rvb23u64 -mabi=lp64d" } */ - -int main () { - -#ifndef __riscv_rvb23u64 -#error "__riscv_rvb23u64" -#endif - - return 0; -}
\ No newline at end of file diff --git a/gcc/testsuite/gcc.target/riscv/predef-profiles-8.c b/gcc/testsuite/gcc.target/riscv/predef-profiles-8.c deleted file mode 100644 index c0c5003..0000000 --- a/gcc/testsuite/gcc.target/riscv/predef-profiles-8.c +++ /dev/null @@ -1,11 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-march=rvb23s64 -mabi=lp64d" } */ - -int main () { - -#ifndef __riscv_rvb23s64 -#error "__riscv_rvb23s64" -#endif - - return 0; -}
\ No newline at end of file diff --git a/gcc/testsuite/gcc.target/riscv/predef-smt-1.c b/gcc/testsuite/gcc.target/riscv/predef-smt-1.c new file mode 100644 index 0000000..4556953 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/predef-smt-1.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64g_xsmtvdot -mabi=lp64" } */ + +int main () { +#if !defined(__riscv) +#error "__riscv" +#endif + +#if !defined(__riscv_xsmtvdot) +#error "__riscv_xsmtvdot" +#endif + + return 0; +} diff --git a/gcc/testsuite/gcc.target/riscv/riscv.exp b/gcc/testsuite/gcc.target/riscv/riscv.exp index b5e7618..dd8443d 100644 --- a/gcc/testsuite/gcc.target/riscv/riscv.exp +++ b/gcc/testsuite/gcc.target/riscv/riscv.exp @@ -42,6 +42,8 @@ gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/sched1-spills/*.{\[cS\], "" $DEFAULT_CFLAGS gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/xandes/*.\[cS\]]] \ "" $DEFAULT_CFLAGS +gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/abi/*.\[cS\]]] \ + "" $DEFAULT_CFLAGS # Saturation alu foreach opt { diff --git a/gcc/testsuite/gcc.target/riscv/rv32e_zcmp.c b/gcc/testsuite/gcc.target/riscv/rv32e_zcmp.c index fd845f5..8e3a36d 100644 --- a/gcc/testsuite/gcc.target/riscv/rv32e_zcmp.c +++ b/gcc/testsuite/gcc.target/riscv/rv32e_zcmp.c @@ -259,8 +259,7 @@ foo (void) **test_popretz: ** cm.push {ra}, -16 ** call f1(?:@plt)? -** li a0,0 -** cm.popret {ra}, 16 +** cm.popretz {ra}, 16 */ long test_popretz () diff --git a/gcc/testsuite/gcc.target/riscv/rv32i_zcmp.c b/gcc/testsuite/gcc.target/riscv/rv32i_zcmp.c index d90f4f4..7bcffeb 100644 --- a/gcc/testsuite/gcc.target/riscv/rv32i_zcmp.c +++ b/gcc/testsuite/gcc.target/riscv/rv32i_zcmp.c @@ -259,8 +259,7 @@ foo (void) **test_popretz: ** cm.push {ra}, -16 ** call f1(?:@plt)? -** li a0,0 -** cm.popret {ra}, 16 +** cm.popretz {ra}, 16 */ long test_popretz () diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/max-vect-1.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/max-vect-1.c new file mode 100644 index 0000000..923c1f8 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/max-vect-1.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=rv64gcv -mabi=lp64d -fdump-tree-vect-details" } */ + +void __attribute__ (( target ("max-vectorization"))) +foo (char *restrict a, int *restrict b, short *restrict c, + int *restrict d, int stride) +{ + if (stride <= 1) + return; + + for (int i = 0; i < 3; i++) + { + int res = c[i]; + int t = b[d[i]]; + if (a[c[i]] != 0) + res = t * b[d[i]]; + c[i] = res; + } +} + +/* { dg-final { scan-tree-dump "vectorized 1 loops in function" "vect" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/max-vect-2.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/max-vect-2.c new file mode 100644 index 0000000..fc5c2ad --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/max-vect-2.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=rv64gcv -mabi=lp64d -mmax-vectorization -fdump-tree-vect-details" } */ + +void +foo (char *restrict a, int *restrict b, short *restrict c, + int *restrict d, int stride) +{ + if (stride <= 1) + return; + + for (int i = 0; i < 3; i++) + { + int res = c[i]; + int t = b[d[i]]; + if (a[c[i]] != 0) + res = t * b[d[i]]; + c[i] = res; + } +} + +/* { dg-final { scan-tree-dump "vectorized 1 loops in function" "vect" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr118019-2.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr118019-2.c index c8c1a72..d3436b7 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr118019-2.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr118019-2.c @@ -47,4 +47,4 @@ x264_pixel_satd_8x4 (uint8_t *pix1, int i_pix1, uint8_t *pix2, int i_pix2) return (((uint16_t) sum) + ((uint32_t) sum >> 16)) >> 1; } -/* { dg-final { scan-assembler-times "vlse64" 8 } } */ +/* { dg-final { scan-assembler-times "vlse32" 4 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr118019-3.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr118019-3.c new file mode 100644 index 0000000..6cb761f --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr118019-3.c @@ -0,0 +1,51 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=rv64gcv_zvl512b -mabi=lp64d -mno-vector-strict-align -mmax-vectorization -fdump-tree-optimized" } */ + +/* Ensure we don't use a vector constructor but a permute. */ + +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; + +#define HADAMARD4(d0, d1, d2, d3, s0, s1, s2, s3) {\ + int t0 = s0 + s1;\ + int t1 = s0 - s1;\ + int t2 = s2 + s3;\ + int t3 = s2 - s3;\ + d0 = t0 + t2;\ + d2 = t0 - t2;\ + d1 = t1 + t3;\ + d3 = t1 - t3;\ +} + +uint32_t +abs2 (uint32_t a) +{ + uint32_t s = ((a >> 15) & 0x10001) * 0xffff; + return (a + s) ^ s; +} + +int +x264_pixel_satd_8x4 (uint8_t *pix1, int i_pix1, uint8_t *pix2, int i_pix2) +{ + uint32_t tmp[4][4]; + uint32_t a0, a1, a2, a3; + int sum = 0; + for (int i = 0; i < 4; i++, pix1 += i_pix1, pix2 += i_pix2) + { + a0 = (pix1[0] - pix2[0]) + ((pix1[4] - pix2[4]) << 16); + a1 = (pix1[1] - pix2[1]) + ((pix1[5] - pix2[5]) << 16); + a2 = (pix1[2] - pix2[2]) + ((pix1[6] - pix2[6]) << 16); + a3 = (pix1[3] - pix2[3]) + ((pix1[7] - pix2[7]) << 16); + HADAMARD4 (tmp[i][0], tmp[i][1], tmp[i][2], tmp[i][3], a0, a1, a2, a3); + } +#pragma GCC unroll 4 + for (int i = 0; i < 4; i++) + { + HADAMARD4 (a0, a1, a2, a3, tmp[0][i], tmp[1][i], tmp[2][i], tmp[3][i]); + sum += abs2 (a0) + abs2 (a1) + abs2 (a2) + abs2 (a3); + } + return (((uint16_t) sum) + ((uint32_t) sum >> 16)) >> 1; +} + +/* { dg-final { scan-tree-dump-not "BIT_FIELD_REF" "optimized" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr121582.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr121582.c new file mode 100644 index 0000000..0e991c0 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr121582.c @@ -0,0 +1,6 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=rv64gcv_zvfbfmin -mabi=lp64d" } */ + +typedef __attribute__((__vector_size__(8))) __bf16 V; +V v, w; +void foo() { v -= w; } diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr121959-1.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr121959-1.c new file mode 100644 index 0000000..a42d7c4 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr121959-1.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv_zvbb -mabi=lp64d -O3" } */ + +#include "pr121959.h" + +DEF_VWSLL_FUNC_0(int32_t, uint8_t, 16) + +/* { dg-final { scan-assembler-times {vwsll.vi} 1 } } */ +/* { dg-final { scan-assembler-not {vsll.vi} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr121959-2.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr121959-2.c new file mode 100644 index 0000000..2a3ef8d --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr121959-2.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv -mabi=lp64d -O3" } */ + +#include "pr121959.h" + +DEF_VWSLL_FUNC_0(int32_t, uint8_t, 16) + +/* { dg-final { scan-assembler-times {vsll.vi} 1 } } */ +/* { dg-final { scan-assembler-not {vwsll.vi} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr121959-3.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr121959-3.c new file mode 100644 index 0000000..59a930a --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr121959-3.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv_zvbb -mabi=lp64d -O3" } */ + +#include "pr121959.h" + +DEF_VWSLL_FUNC_0(int32_t, uint8_t, 17) + +/* { dg-final { scan-assembler-times {vwsll.vi} 1 } } */ +/* { dg-final { scan-assembler-not {vsll.vi} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr121959-4.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr121959-4.c new file mode 100644 index 0000000..59a6d36 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr121959-4.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv -mabi=lp64d -O3" } */ + +#include "pr121959.h" + +DEF_VWSLL_FUNC_0(int32_t, uint8_t, 17) + +/* { dg-final { scan-assembler-times {vsll.vi} 1 } } */ +/* { dg-final { scan-assembler-not {vwsll.vi} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr121959-5.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr121959-5.c new file mode 100644 index 0000000..a9319a3 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr121959-5.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv_zvbb -mabi=lp64d -O3" } */ + +#include "pr121959.h" + +DEF_VWSLL_FUNC_0(int32_t, uint8_t, 15) + +/* { dg-final { scan-assembler-times {vsll.vi} 1 } } */ +/* { dg-final { scan-assembler-not {vwsll.vi} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr121959-run-1.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr121959-run-1.c new file mode 100644 index 0000000..af6141d --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr121959-run-1.c @@ -0,0 +1,65 @@ +/* { dg-do run } */ +/* { dg-require-effective-target "riscv_zvbb_ok" } */ +/* { dg-add-options "riscv_v" } */ +/* { dg-add-options "riscv_zvbb" } */ +/* { dg-additional-options "-std=c99" } */ + +#include "pr121959.h" + +#define WT int32_t +#define NT uint8_t +#define IMM 16 +#define N 16 + +DEF_VWSLL_FUNC_0_WRAP(WT, NT, IMM) + +NT g_data[][2][N] = { + { + /* a */ + { + 2, 2, 2, 2, + 255, 255, 255, 255, + 128, 128, 128, 128, + 127, 127, 127, 127, + }, + /* b */ + { + 1, 1, 1, 1, + 0, 0, 0, 0, + 2, 2, 2, 2, + 7, 7, 7, 7, + }, + }, +}; + +WT g_expect[][N] = { + /* 0 */ + { + 65536, 65536, 65536, 65536, + 16711680, 16711680, 16711680, 16711680, + 8257536, 8257536, 8257536, 8257536, + 7864320, 7864320, 7864320, 7864320, + }, +}; + +int +main () +{ + unsigned i, k; + WT out[N]; + + for (i = 0; i < sizeof (g_data) / sizeof (g_data[0]); i++) + { + NT *a = g_data[i][0]; + NT *b = g_data[i][1]; + WT *expect = g_expect[i]; + + RUN_VWSLL_FUNC_0_WRAP (WT, NT, IMM, out, a, b, N); + + for (k = 0; k < N; k++) + if (out[k] != expect[k]) + __builtin_abort (); + } + + return 0; +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr121959.h b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr121959.h new file mode 100644 index 0000000..10b1b62 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr121959.h @@ -0,0 +1,24 @@ +#ifndef HAVE_DEFINED_PR121959_H +#define HAVE_DEFINED_PR121959_H + +#include <stdint.h> + +#define DEF_VWSLL_FUNC_0(WT, NT, IMM) \ +void \ +test_from_##NT##_to_##WT##_##IMM##_0(WT * restrict res, \ + NT * restrict a, \ + NT * restrict b, \ + int n) \ +{ \ + for (int i = 0; i < n; i++) \ + { \ + res[i] = (a[i] - b[i]) << IMM; \ + } \ +} +#define DEF_VWSLL_FUNC_0_WRAP(WT, NT, IMM) DEF_VWSLL_FUNC_0(WT, NT, IMM) +#define RUN_VWSLL_FUNC_0(WT, NT, IMM, res, a, b, n) \ + test_from_##NT##_to_##WT##_##IMM##_0(res, a, b, n) +#define RUN_VWSLL_FUNC_0_WRAP(WT, NT, IMM, res, a, b, n) \ + RUN_VWSLL_FUNC_0(WT, NT, IMM, res, a, b, n) + +#endif diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr121985.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr121985.c new file mode 100644 index 0000000..6e5cdd9 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr121985.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=rv64gcv_zvl512b -mabi=lp64d -mrvv-max-lmul=m8" } */ + +unsigned short a=3; +char f=1; + +int main() +{ + for (char var=f; var<6; var++) + a *= 5; + + return a; +} + +/* We would set a wrong niter range that would cause us to extract the wrong + element. */ +/* { dg-final { scan-assembler-not "vslidedown.vi.*,0" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr122321.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr122321.c new file mode 100644 index 0000000..0e34bc1f --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr122321.c @@ -0,0 +1,150 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv -mabi=lp64d -w -O0" { target rv64 } } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32 -w -O0" { target rv32 } } */ + + +typedef int a; +typedef signed char b; +typedef char c; +typedef short d; +typedef unsigned short e; +typedef a f; +typedef unsigned g; +typedef long h; +h j, k, l, m, n, o; +int p, q, r, s; +short t; +volatile a u; +a v[]; +char w, x; +a *y, *z; +a **aa; +__attribute__((always_inline)) b __attribute__((vector_size(16))) +ab(f __attribute__((vector_size(8 * sizeof(f)))), d ac, + d __attribute__((vector_size(2 * sizeof(d)))), d) { + return __builtin_shufflevector( + (b __attribute__((vector_size(16)))) __builtin_convertvector( + (d __attribute__((vector_size(16 *sizeof(d))))){ + ac, ac, ac, ac, ac, ac, ac, ac, ac, ac, ac, ac, ac}, + c __attribute__((vector_size(16)))) | + __builtin_convertvector( + (d __attribute__((vector_size(16 *sizeof(d))))){ + ac, ac, ac, ac, ac, ac, ac, ac, ac, ac, ac, ac, ac}, + c __attribute__((vector_size(16)))), + __builtin_convertvector( + (d __attribute__((vector_size(16 *sizeof(d))))){ + ac, ac, ac, ac, ac, ac, ac, ac, ac, ac, ac, ac, ac}, + b __attribute__((vector_size(16)))), + 3, 21, 0, 2, 2, 7, 1, 8, 4, 0, 8, 0, 8, 9, 5, 6); +} +__attribute__((always_inline)) g +ad(d ae, h __attribute__((vector_size(32 * sizeof(h))))) { + g f = 6318; + return (8 ? ae / 786856318u : 0) & ae; +} +a(af)(a, int); +void(ag)(long); +char(ah)(char, char); +char(ai)(char); +short(aj)(short, short); +int ak(long, int *, int *, char, int); +void al(signed, a *, int *, long); +char am(int *, short, short); +void an(int *, long, int); +void ao(int, int *, a *); +a ap() { + int *aq, *ar, *as; + short at; + char au, av, aw = 2; + long ax, ay, az = j; + int ba, i; + g __attribute__((vector_size(16 * sizeof(g)))) bb = {80}; + b __attribute__((vector_size(4))) bc = {6}; + int bd[1]; + char *be = &w; + int bf, bg = q; + a **bh[] = { + &y, &z, &z, &y, &y, &y, &y, &y, &z, &z, &y, &z, &y, &y, &y, &y, &z, &y, + &z, &y, &y, &y, &z, &z, &z, &y, &z, &z, &z, &y, &z, &z, &y, &z, &z, &y, + &z, &z, &z, &y, 0, &z, 0, &y, 0, &y, &y, &z, &z, &y, &y, 0, &z, 0, + &z, 0, &y, &z, &z, 0, &z, 0, &z, &z, &z, &y, &z, &z, &y, &z, &z, &y, + 0, &z, 0, &z, &z, &y, 0, &z, 0, &y, 0, &y, &y, &z, &z, &y, &y, 0, + &z, 0, &z, 0, &y, &z, &z, 0, &z, 0, &z, &z, &z, &y, &z, &z, &y, &z, + &z, &y, 0, &z, 0, &z, &z, &y, 0, &z, 0, &y, 0, &y, &y, &z, &z, &y, + &y, 0, &z, 0, &z, 0, &y, &z, &z, 0, &z, 0, &z, &z, &z, &y, &z, &z, + &y, &z, &z, &y, 0, &z, 0, &z, &z, &y, 0, &z, 0, &y, 0, &y, &y, &z, + &z, &y, &y, 0, &z, 0, &z, 0, &y, &z, &z, 0, 0, &z, 0, &z, &z, &z, + &y, &z, &z, &y, &z, &z, &y, 0, &z, 0, 0, &z, &z}; + for (; i; i++) + bd[i] = p; + h __attribute__((vector_size(32 * sizeof(h)))) + bi = {2681, 2681, 2681, 2681, 2681, 2681, 2681, 2681, 2681, 2681, 2681, + 2681, 2681, 2681, 2681, 2681, 2681, 2681, 2681, 2681, 2681, 2681, + 2681, 2681, 2681, 2681, 2681, 2681, 2681, 2681, 2681, 2681}, + bj = __builtin_convertvector( + (c __attribute__((vector_size(32)))){ + aw, aw, aw, aw, aw, aw, aw, aw, aw, aw, aw, aw, aw, aw, aw, aw, + aw, aw, aw, aw, aw, aw, aw, aw, aw, aw, aw, aw, aw, aw, aw, aw}, + h __attribute__((vector_size(32 * sizeof(h))))), + bk = __builtin_convertvector( + __builtin_shufflevector(bb, bb, 4, 8, 7, 9, 1, 10, 4, 7, 0, 4, 3, 5, 6, 7, + 6, 2, 2, 20, 6, 4, 7, 7, 9, 7, 4, 9, 8, 6, 1, 0, + 6, 9), + h __attribute__((vector_size(32 * sizeof(h))))); + bb = __builtin_convertvector( + ab(__builtin_shufflevector( + __builtin_shufflevector( + __builtin_convertvector( + __builtin_shufflevector(bb, bb, 1, 31, 8, 2, 3, 7, 4, 0, 7, + 3, 4, 6, 7, 1, 9, 3, 8, 7, 1, 8, 5, + 3, 9, 9, 0, 3, 2, 8, 5, 2, 5, 3), + f __attribute__((vector_size(32 * sizeof(f))))), + (f __attribute__((vector_size(32 * sizeof(f))))){ + 800761418310502961587690471176286910032020044212442466872080013589354162852207417903424527024812447907811618435019152886919380169872910001752451018659493155196043018716516518746289614523948734758456011127254301274351182132760058399143431214610613191313926994549901191890929084305862034120561651877003645}, + 32, 44), + (f __attribute__((vector_size(2 * sizeof(f))))){o}, 1, 0, 3, 0, 2, + 1, 3, 3), + ad(__builtin_clzg((g)aw, (f)bb[9]), + (h __attribute__((vector_size(32 * sizeof(h))))){ + bi[0] ?: bk[0], bi[1] ? 1 : bk[1], bi[2] ? 2 : bk[2], + bi[3] ? 3 : bk[3], bi[4] ? 4 : bk[4], bi[5] ? 5 : bk[5], + bi[6] ? 6 : bk[6], bi[7] ? 7 : bk[7], bi[8] ? 8 : bk[8], + bi[9] ? 9 : bk[9], bi[0] ? 10 : bk[0], bi[1] ? 1 : bk[1], + bi[2] ? 2 : bk[2], bi[3] ? 3 : bk[3], bi[4] ? 4 : bk[4], + bi[5] ? 5 : bk[5], bi[6] ? 6 : bk[6], bi[7] ? 7 : bk[7], + bi[8] ? 8 : bk[8], bi[9] ? 9 : bk[9], bi[0] ? 20 : bk[0], + bi[1] ? 1 : bk[1], bi[2] ? 2 : bk[2], bi[3] ? 3 : bk[3], + bi[4] ? bj[4] : 4, bi[5] ?: 5, bi[6] ?: 6, + bi[7] ? 0 : 7, bi[8] ?: 8, bi[9] ? 0 : 9, + bi[0] ? 0 : 30, bi[1] ?: 1}), + (d __attribute__((vector_size(2 * sizeof(d))))) + __builtin_shufflevector( + __builtin_convertvector( + __builtin_shufflevector(bb, bb, 2, 7, 21, 6), + e __attribute__((vector_size(4 * sizeof(e))))), + __builtin_convertvector( + (c __attribute__((vector_size(4)))){aw, aw}, + e __attribute__((vector_size(4 * sizeof(e))))), + 5, 1) + + (__builtin_convertvector( + __builtin_shufflevector(bb, bb, 4, 5), + e __attribute__((vector_size(2 * sizeof(e))))) <= + __builtin_convertvector( + (c __attribute__((vector_size(2)))){aw}, + e __attribute__((vector_size(2 * sizeof(e)))))), + n ? bb[5] << n : aw), + g __attribute__((vector_size(16 * sizeof(g))))); + ag(aw & t); + at = aj(aw, v[1]); + au = ah(at, aw); + ba = af((1 == ax != aw) <= aw <= au, aw); + ao(0, &bd[0], &r); + o = ay; + an(aq, aw, k); + av = am(ar, l, k); + *be = ai(*be); + al(x, as, &bd[0], aw); + bg = ak(u, &s, &bf, aw, aw); + as = *aa; + return m; +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr122627.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr122627.c new file mode 100644 index 0000000..e793a1c --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr122627.c @@ -0,0 +1,196 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv -mabi=lp64d -w -O0" { target rv64 } } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32 -w -O0" { target rv32 } } */ + + +typedef signed char int8_t; +typedef short int16_t; +typedef int int32_t; +typedef long int64_t; +typedef char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned long uint64_t; +uint64_t BS_CHECKSUM_ARR_7; +struct S0 { + unsigned f0 : 9; + signed : 26 +} * g_108, g_148, g_150; +int32_t g_8[]; +int32_t g_44, g_130_0; +uint16_t g_76_0; +int64_t g_158[]; +int64_t g_158_1_0_3; +uint8_t *func_56_l_165; +__attribute__((always_inline)) int32_t +backsmith_snippet_544(int16_t __attribute__((vector_size(32 * sizeof(int16_t)))) + BS_ARG_0) { + BS_ARG_0 = BS_ARG_0 = + (int16_t __attribute__((vector_size(32 * sizeof(int16_t))))) - + __builtin_convertvector( + (int16_t __attribute__((vector_size(32 *sizeof(int16_t))))){ + ~BS_ARG_0[3], ~BS_ARG_0[3], ~BS_ARG_0[3], ~BS_ARG_0[3], + ~BS_ARG_0[3], ~BS_ARG_0[3], ~BS_ARG_0[3], ~BS_ARG_0[3], + ~BS_ARG_0[3], ~BS_ARG_0[3], ~BS_ARG_0[3], ~BS_ARG_0[3], + ~BS_ARG_0[3], ~BS_ARG_0[3], ~BS_ARG_0[3], ~BS_ARG_0[3], + ~BS_ARG_0[3], ~BS_ARG_0[3], ~BS_ARG_0[3], ~BS_ARG_0[3], + ~BS_ARG_0[3], ~BS_ARG_0[3], ~BS_ARG_0[3], ~BS_ARG_0[3], + ~BS_ARG_0[3], ~BS_ARG_0[3], ~BS_ARG_0[3], ~BS_ARG_0[3], + ~BS_ARG_0[3], ~BS_ARG_0[3], ~BS_ARG_0[3], ~BS_ARG_0[3]}, + uint16_t __attribute__((vector_size(32 * sizeof(uint16_t))))); + return ((union { + int16_t __attribute__((vector_size(2 * sizeof(int16_t)))) src; + int32_t dst + })__builtin_shufflevector(BS_ARG_0, BS_ARG_0, 43, 7)) + .dst; +} +int8_t(safe_add_func_int8_t_s_s)(int8_t); +uint8_t(safe_lshift_func_uint8_t_u_s)(uint8_t); +unsigned safe_mul_func_uint32_t_u_u(int, int); +uint8_t func_56(uint64_t p_57, int32_t *, int8_t p_59, uint16_t p_60, + int32_t *p_61) { + int64_t __attribute__((vector_size(8 * sizeof(int64_t)))) + BS_VAR_0 = {30330355581}; + int8_t __attribute__((vector_size(2))) BS_VAR_1 = {7}; + int64_t __attribute__((vector_size(32 * sizeof(int64_t)))) BS_VAR_2[33] = {}; + int64_t BS_VAR_2_3_0; + int16_t __attribute__((vector_size(32 * sizeof(int16_t)))) BS_VAR_3 = {}; + int volatile BS_COND_18 = BS_COND_18, BS_COND_19 = 2046083389, + BS_COND_20 = BS_COND_20; + int64_t __attribute__((vector_size(32 * sizeof(int64_t)))) BS_VAR_5 = {}; + int16_t __attribute__((vector_size(sizeof(int16_t)))) + BS_VAR_6 = {90173011178118114616913331460}; + int64_t __attribute__((vector_size(16))) BS_VAR_7 = {20385270170872471}; + switch (BS_COND_19) + case 4044: + case 6463: + case 7825: + case 40964: + case 71504: + case 50913903: + case 3624: + case 3379: + case 80451787: + case 4004383: + case 4133: + case 2098801: + case 2000071388: + case 400611: + case 4155: + case 6888: + case 3506: + case 9734: + case 100094276: + case 3121: + case 9659: + case 5892: + case 9507: + case 1067596166: + case 2099438381: + case 2406: + case 5442: + case 60746: + case 31236: + case 3574: + case 42025: + case 3315: + case 2096976873: + case 6082416: + case 909667: + case 5535: + case 2554: + case 31179: + case 2046083389: + case 7309: + case 4706: + case 6816: + case 7189: + case 3402: + case 706316781: + case 3570: + case 4376: + case 9698: + case 4190: + case 6195: + case 6714: + case 7540: + case 2145: + case 61108: + case 2442: + case 1049158: + case 60055: + case 4302: + break; + int64_t __attribute__((vector_size(2 * sizeof(int64_t)))) + BS_VAR_8[] = {52623717371, + 908827026188589, + 3253451771131199467, + 3253451771131199467, + 8379, + 1, + 500143520836, + 0, + 5884817202404184392, + 5884817202404184392, + (int64_t __attribute__((vector_size(2 * sizeof(int64_t))))){ + 8741271462101646089, 8741271462101646089}}; + int BS_VAR_9 = 2177; + int64_t __attribute__((vector_size(32 * sizeof(int64_t)))) BS_VAR_10[37] = {}; + int16_t __attribute__((vector_size(8 * sizeof(int16_t)))) BS_VAR_11[5] = {}; + uint8_t __attribute__((vector_size(2))) BS_VAR_12 = {4}; + uint64_t LOCAL_CHECKSUM = BS_CHECKSUM_ARR_7; + struct S0 **l_160 = &g_108; + int32_t l_161 = 3842; + int64_t *l_162[] = {&g_158_1_0_3, &g_158_1_0_3, &g_158_1_0_3, &g_158_1_0_3}; + struct S0 ***l_176 = &l_160; + int32_t l_181 = g_44; + int32_t *l_180 = &l_181; + *func_56_l_165 = p_60; + l_162[7] == g_158 != safe_lshift_func_uint8_t_u_s(*func_56_l_165); + g_130_0 |= l_160 != (g_148.f0 & 1 < l_161 >= ((g_76_0 = 0) < g_8[5]), l_160); + if (g_148.f0) + BS_VAR_8[p_57 < 7 ? p_57 : 0] = __builtin_shufflevector( + __builtin_shufflevector(BS_VAR_8[0], BS_VAR_8[0], 1, 0, 1, 2), + __builtin_convertvector( + (uint64_t __attribute__((vector_size(4 *sizeof(uint64_t))))){ + p_57, p_57, p_57, p_57}, + int64_t __attribute__((vector_size(4 * sizeof(int64_t))))), + 6, 0); + l_161 = safe_add_func_int8_t_s_s(l_161); + for (; l_161 != 20;) + p_57 = 9; + p_57 = safe_add_func_int8_t_s_s(p_57); + for (; p_57 > 2;) { + int BS_TEMP_89 = 7760, + BS_TEMP_90 = backsmith_snippet_544(__builtin_convertvector( + __builtin_shufflevector(BS_VAR_8[4], BS_VAR_8[4], 3, 2, 1, 2, 2, 2, + 0, 0, 0, 2, 3, 0, 2, 0, 1, 3, 3, 1, 1, 2, 2, + 0, 2, 3, 3, 0, 1, 3, 0, 1, 3, 3), + int16_t __attribute__((vector_size(32 * sizeof(int16_t)))))); + BS_VAR_2[__builtin_bswap32(BS_TEMP_89 < 2 ? (unsigned)l_161 << BS_TEMP_89 + : BS_VAR_2_3_0) < 3 + ? __builtin_bswap32(BS_TEMP_89 < 2 + ? (unsigned)l_161 << BS_TEMP_89 + : BS_VAR_2_3_0) + : 0] = + __builtin_convertvector( + (int32_t __attribute__((vector_size(32 *sizeof(int32_t))))){ + BS_TEMP_90, BS_TEMP_90, BS_TEMP_90, BS_TEMP_90, BS_TEMP_90, + BS_TEMP_90, BS_TEMP_90, BS_TEMP_90, BS_TEMP_90, BS_TEMP_90, + BS_TEMP_90, BS_TEMP_90, BS_TEMP_90, BS_TEMP_90, BS_TEMP_90, + BS_TEMP_90, BS_TEMP_90, BS_TEMP_90, BS_TEMP_90, BS_TEMP_90, + BS_TEMP_90, BS_TEMP_90, BS_TEMP_90, BS_TEMP_90, BS_TEMP_90, + BS_TEMP_90, BS_TEMP_90, BS_TEMP_90, BS_TEMP_90, BS_TEMP_90, + BS_TEMP_90, BS_TEMP_90}, + int64_t __attribute__((vector_size(32 * sizeof(int64_t))))); + } + *p_61 &= l_161 >= + safe_mul_func_uint32_t_u_u( + g_150.f0, ((*l_176 = l_160) != g_108) > l_160 == 0 == g_148.f0); + *l_180 = 0; + BS_VAR_3 = __builtin_shufflevector( + BS_VAR_11[p_59 < (uint64_t)5 ? (uint64_t)p_59 : 0], + BS_VAR_11[p_59 < (uint64_t)5 ? (uint64_t)p_59 : 0], 0, 4, 5, 4, 0, 3, 3, + 2, 5, 4, 3, 0, 4, 3, 9, 1, 8, 8, 4, 3, 4, 0, 1, 9, 0, 0, 0, 1, 5, 2, 0, + 9); + return p_57; +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr122635-1.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr122635-1.c new file mode 100644 index 0000000..0beb3d7 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr122635-1.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=rv64gcv_zvl256b -mabi=lp64d -mrvv-vector-bits=zvl -mno-autovec-segment" } */ + +typedef struct { + int a[6]; + float b[3]; +} c; + +int d(c *e) { + int f =0; + for (; f < 3; f++) { + e->a[2 * f] = e->b[f]; + e->a[2 * f + 1] = -e->a[2 * f]; + e->a[2 * f] = f + 3 * e->a[2 * f]; + e->a[2 * f + 1] = f + 3 * e->a[2 * f + 1]; + } + return 0; +} + +/* { dg-final { scan-assembler-not "vsetivli.*zero,0" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr122635-2.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr122635-2.c new file mode 100644 index 0000000..0de69b5 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr122635-2.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=rv64gcv_zvl256b -mabi=lp64d -mrvv-vector-bits=zvl -mno-autovec-segment" } */ + +typedef struct { + int A[6]; + float b[]; +} a; + +int b(a *a) { + int b = 0; + for (; b < 3; b++) { + a->A[2 * b] = a->b[b] - b + a->A[2 * b]; + a->A[2 * b + 1] = b * a->A[2 * b + 1]; + } + return 0; +} + +/* { dg-final { scan-assembler-not "vsetivli.*zero,0" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr123022-2.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr123022-2.c new file mode 100644 index 0000000..0562b56 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr123022-2.c @@ -0,0 +1,6 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=rv64gcv_zvl512b -mabi=lp64d -mrvv-vector-bits=zvl -fsigned-char" } */ + +#include "pr123022.c" + +/* { dg-final { scan-assembler-not "vset.*zero,1," } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr123022.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr123022.c new file mode 100644 index 0000000..1f5f165 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr123022.c @@ -0,0 +1,21 @@ +/* { dg-do run } */ +/* { dg-require-effective-target rvv_zvl512b_ok } */ +/* { dg-options "-O3 -march=rv64gcv_zvl512b -mabi=lp64d -mrvv-vector-bits=zvl -fsigned-char" } */ +unsigned e[2][2]; +long a; +char c[2]; + +int +main () +{ + long long b; + c[1] = 3; + for (unsigned h = 0; h < 2; h++) + for (int i = c[0]; i < 5; i += 5) + for (int j = 0; j < 219; j++) + a = c[h] ? e[h][h] + 3326195747 : 0; + + b = a; + if (b != 3326195747) + __builtin_abort (); +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-1-run.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-1-run.c new file mode 100644 index 0000000..b3bf8da --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-1-run.c @@ -0,0 +1,49 @@ +/* { dg-do run } */ +/* { dg-require-effective-target riscv_v_ok } */ + +char p[128]; + +bool __attribute__((noipa)) +fand (int n) +{ + bool r = true; + for (int i = 0; i < n; ++i) + r &= (p[i] != 0); + return r; +} + +bool __attribute__((noipa)) +fior (int n) +{ + bool r = false; + for (int i = 0; i < n; ++i) + r |= (p[i] != 0); + return r; +} + +int main() +{ + __builtin_memset (p, 1, sizeof(p)); + + for (int n = 0; n < 77; ++n) + if (!fand (n)) + __builtin_abort (); + + p[0] = 0; + for (int n = 1; n < 77; ++n) + if (fand (n)) + __builtin_abort (); + + __builtin_memset (p, 0, sizeof(p)); + + for (int n = 0; n < 77; ++n) + if (fior (n)) + __builtin_abort (); + + p[0] = 1; + for (int n = 1; n < 77; ++n) + if (!fior (n)) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-1.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-1.c new file mode 100644 index 0000000..b8c4f22 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-1.c @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-march=rv64gcv -mabi=lp64d -fdump-tree-vect-details" } */ + +char p[128]; + +bool __attribute__((noipa)) +fand (int n) +{ + bool r = true; + for (int i = 0; i < 16; ++i) + r &= (p[i] != 0); + return r; +} + +bool __attribute__((noipa)) +fior (int n) +{ + bool r = false; + for (int i = 0; i < 16; ++i) + r |= (p[i] != 0); + return r; +} + +/* { dg-final { scan-tree-dump-times "optimized: loop vectorized" 2 "vect" } } */ +/* { dg-final { scan-assembler-times {vcpop\.m\s+[atx][0-9]+,\s*v[0-9]+} 2 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-2-run.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-2-run.c new file mode 100644 index 0000000..1a64b2b --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-2-run.c @@ -0,0 +1,49 @@ +/* { dg-do run } */ +/* { dg-require-effective-target riscv_v_ok } */ + +short p[128]; + +bool __attribute__((noipa)) +fand (int n) +{ + bool r = true; + for (int i = 0; i < n; ++i) + r &= (p[i] != 0); + return r; +} + +bool __attribute__((noipa)) +fior (int n) +{ + bool r = false; + for (int i = 0; i < n; ++i) + r |= (p[i] != 0); + return r; +} + +int main() +{ + __builtin_memset (p, 1, sizeof(p)); + + for (int n = 0; n < 77; ++n) + if (!fand (n)) + __builtin_abort (); + + p[0] = 0; + for (int n = 1; n < 77; ++n) + if (fand (n)) + __builtin_abort (); + + __builtin_memset (p, 0, sizeof(p)); + + for (int n = 0; n < 77; ++n) + if (fior (n)) + __builtin_abort (); + + p[0] = 1; + for (int n = 1; n < 77; ++n) + if (!fior (n)) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-2.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-2.c new file mode 100644 index 0000000..868f91b --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-2.c @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-march=rv64gcv -mabi=lp64d -fdump-tree-vect-details" } */ + +short p[128]; + +bool __attribute__((noipa)) +fand () +{ + bool r = true; + for (int i = 0; i < 16; ++i) + r &= (p[i] != 0); + return r; +} + +bool __attribute__((noipa)) +fior () +{ + bool r = false; + for (int i = 0; i < 16; ++i) + r |= (p[i] != 0); + return r; +} + +/* { dg-final { scan-tree-dump-times "optimized: loop vectorized" 2 "vect" } } */ +/* { dg-final { scan-assembler-times {vcpop\.m\s+[atx][0-9]+,\s*v[0-9]+} 2 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-3-run.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-3-run.c new file mode 100644 index 0000000..693a9118 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-3-run.c @@ -0,0 +1,49 @@ +/* { dg-do run } */ +/* { dg-require-effective-target riscv_v_ok } */ + +int p[128]; + +bool __attribute__((noipa)) +fand (int n) +{ + bool r = true; + for (int i = 0; i < n; ++i) + r &= (p[i] != 0); + return r; +} + +bool __attribute__((noipa)) +fior (int n) +{ + bool r = false; + for (int i = 0; i < n; ++i) + r |= (p[i] != 0); + return r; +} + +int main() +{ + __builtin_memset (p, 1, sizeof(p)); + + for (int n = 0; n < 77; ++n) + if (!fand (n)) + __builtin_abort (); + + p[0] = 0; + for (int n = 1; n < 77; ++n) + if (fand (n)) + __builtin_abort (); + + __builtin_memset (p, 0, sizeof(p)); + + for (int n = 0; n < 77; ++n) + if (fior (n)) + __builtin_abort (); + + p[0] = 1; + for (int n = 1; n < 77; ++n) + if (!fior (n)) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-3.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-3.c new file mode 100644 index 0000000..d1a286b --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-3.c @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-march=rv64gcv -mabi=lp64d -fdump-tree-vect-details" } */ + +int p[128]; + +bool __attribute__((noipa)) +fand () +{ + bool r = true; + for (int i = 0; i < 16; ++i) + r &= (p[i] != 0); + return r; +} + +bool __attribute__((noipa)) +fior () +{ + bool r = false; + for (int i = 0; i < 16; ++i) + r |= (p[i] != 0); + return r; +} + +/* { dg-final { scan-tree-dump-times "optimized: loop vectorized" 2 "vect" } } */ +/* { dg-final { scan-assembler-times {vcpop\.m\s+[atx][0-9]+,\s*v[0-9]+} 2 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-4-run.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-4-run.c new file mode 100644 index 0000000..b55925e --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-4-run.c @@ -0,0 +1,49 @@ +/* { dg-do run } */ +/* { dg-require-effective-target riscv_v_ok } */ + +long long p[128]; + +bool __attribute__((noipa)) +fand (int n) +{ + bool r = true; + for (int i = 0; i < n; ++i) + r &= (p[i] != 0); + return r; +} + +bool __attribute__((noipa)) +fior (int n) +{ + bool r = false; + for (int i = 0; i < n; ++i) + r |= (p[i] != 0); + return r; +} + +int main() +{ + __builtin_memset (p, 1, sizeof(p)); + + for (int n = 0; n < 77; ++n) + if (!fand (n)) + __builtin_abort (); + + p[0] = 0; + for (int n = 1; n < 77; ++n) + if (fand (n)) + __builtin_abort (); + + __builtin_memset (p, 0, sizeof(p)); + + for (int n = 0; n < 77; ++n) + if (fior (n)) + __builtin_abort (); + + p[0] = 1; + for (int n = 1; n < 77; ++n) + if (!fior (n)) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-4.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-4.c new file mode 100644 index 0000000..34a44b1 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-4.c @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-march=rv64gcv -mabi=lp64d -fdump-tree-vect-details" } */ + +long long p[128]; + +bool __attribute__((noipa)) +fand () +{ + bool r = true; + for (int i = 0; i < 16; ++i) + r &= (p[i] != 0); + return r; +} + +bool __attribute__((noipa)) +fior () +{ + bool r = false; + for (int i = 0; i < 16; ++i) + r |= (p[i] != 0); + return r; +} + +/* { dg-final { scan-tree-dump-times "optimized: loop vectorized" 2 "vect" } } */ +/* { dg-final { scan-assembler-times {vcpop\.m\s+[atx][0-9]+,\s*v[0-9]+} 2 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-5-run.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-5-run.c new file mode 100644 index 0000000..95570ac --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-5-run.c @@ -0,0 +1,47 @@ +/* { dg-do run } */ +/* { dg-require-effective-target riscv_v_ok } */ + +char p[128]; + +bool __attribute__((noipa)) +fxort (int n) +{ + bool r = true; + for (int i = 0; i < n; ++i) + r ^= (p[i] != 0); + return r; +} + +bool __attribute__((noipa)) +fxorf (int n) +{ + bool r = false; + for (int i = 0; i < n; ++i) + r ^= (p[i] != 0); + return r; +} + +int main() +{ + __builtin_memset (p, 1, sizeof(p)); + + for (int n = 0; n < 77; ++n) + if (fxort (n) != !(n & 1)) + __builtin_abort (); + + for (int n = 0; n < 77; ++n) + if (fxorf (n) != (n & 1)) + __builtin_abort (); + + __builtin_memset (p, 0, sizeof(p)); + + for (int n = 0; n < 77; ++n) + if (!fxort (n)) + __builtin_abort (); + + for (int n = 0; n < 77; ++n) + if (fxorf (n)) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-5.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-5.c new file mode 100644 index 0000000..f179970 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-5.c @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-march=rv64gcv -mabi=lp64d -fdump-tree-vect-details" } */ + +char p[128]; + +bool __attribute__((noipa)) +fxort () +{ + bool r = true; + for (int i = 0; i < 16; ++i) + r ^= (p[i] != 0); + return r; +} + +bool __attribute__((noipa)) +fxorf () +{ + bool r = false; + for (int i = 0; i < 16; ++i) + r ^= (p[i] != 0); + return r; +} + +/* { dg-final { scan-tree-dump-times "optimized: loop vectorized" 2 "vect" } } */ +/* { dg-final { scan-assembler-times {vcpop\.m\s+[atx][0-9]+,\s*v[0-9]+} 2 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-6-run.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-6-run.c new file mode 100644 index 0000000..267485b --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-6-run.c @@ -0,0 +1,47 @@ +/* { dg-do run } */ +/* { dg-require-effective-target riscv_v_ok } */ + +short p[128]; + +bool __attribute__((noipa)) +fxort (int n) +{ + bool r = true; + for (int i = 0; i < n; ++i) + r ^= (p[i] != 0); + return r; +} + +bool __attribute__((noipa)) +fxorf (int n) +{ + bool r = false; + for (int i = 0; i < n; ++i) + r ^= (p[i] != 0); + return r; +} + +int main() +{ + __builtin_memset (p, 1, sizeof(p)); + + for (int n = 0; n < 77; ++n) + if (fxort (n) != !(n & 1)) + __builtin_abort (); + + for (int n = 0; n < 77; ++n) + if (fxorf (n) != (n & 1)) + __builtin_abort (); + + __builtin_memset (p, 0, sizeof(p)); + + for (int n = 0; n < 77; ++n) + if (!fxort (n)) + __builtin_abort (); + + for (int n = 0; n < 77; ++n) + if (fxorf (n)) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-6.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-6.c new file mode 100644 index 0000000..8486c6b --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-6.c @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-march=rv64gcv -mabi=lp64d -fdump-tree-vect-details" } */ + +short p[128]; + +bool __attribute__((noipa)) +fxort () +{ + bool r = true; + for (int i = 0; i < 16; ++i) + r ^= (p[i] != 0); + return r; +} + +bool __attribute__((noipa)) +fxorf () +{ + bool r = false; + for (int i = 0; i < 16; ++i) + r ^= (p[i] != 0); + return r; +} + +/* { dg-final { scan-tree-dump-times "optimized: loop vectorized" 2 "vect" } } */ +/* { dg-final { scan-assembler-times {vcpop\.m\s+[atx][0-9]+,\s*v[0-9]+} 2 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-7-run.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-7-run.c new file mode 100644 index 0000000..242147b --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-7-run.c @@ -0,0 +1,47 @@ +/* { dg-do run } */ +/* { dg-require-effective-target riscv_v_ok } */ + +int p[128]; + +bool __attribute__((noipa)) +fxort (int n) +{ + bool r = true; + for (int i = 0; i < n; ++i) + r ^= (p[i] != 0); + return r; +} + +bool __attribute__((noipa)) +fxorf (int n) +{ + bool r = false; + for (int i = 0; i < n; ++i) + r ^= (p[i] != 0); + return r; +} + +int main() +{ + __builtin_memset (p, 1, sizeof(p)); + + for (int n = 0; n < 77; ++n) + if (fxort (n) != !(n & 1)) + __builtin_abort (); + + for (int n = 0; n < 77; ++n) + if (fxorf (n) != (n & 1)) + __builtin_abort (); + + __builtin_memset (p, 0, sizeof(p)); + + for (int n = 0; n < 77; ++n) + if (!fxort (n)) + __builtin_abort (); + + for (int n = 0; n < 77; ++n) + if (fxorf (n)) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-7.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-7.c new file mode 100644 index 0000000..cc14996 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-7.c @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-march=rv64gcv -mabi=lp64d -fdump-tree-vect-details" } */ + +int p[128]; + +bool __attribute__((noipa)) +fxort () +{ + bool r = true; + for (int i = 0; i < 16; ++i) + r ^= (p[i] != 0); + return r; +} + +bool __attribute__((noipa)) +fxorf () +{ + bool r = false; + for (int i = 0; i < 16; ++i) + r ^= (p[i] != 0); + return r; +} + +/* { dg-final { scan-tree-dump-times "optimized: loop vectorized" 2 "vect" } } */ +/* { dg-final { scan-assembler-times {vcpop\.m\s+[atx][0-9]+,\s*v[0-9]+} 2 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-8-run.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-8-run.c new file mode 100644 index 0000000..bf73da5 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-8-run.c @@ -0,0 +1,47 @@ +/* { dg-do run } */ +/* { dg-require-effective-target riscv_v_ok } */ + +long long p[128]; + +bool __attribute__((noipa)) +fxort (int n) +{ + bool r = true; + for (int i = 0; i < n; ++i) + r ^= (p[i] != 0); + return r; +} + +bool __attribute__((noipa)) +fxorf (int n) +{ + bool r = false; + for (int i = 0; i < n; ++i) + r ^= (p[i] != 0); + return r; +} + +int main() +{ + __builtin_memset (p, 1, sizeof(p)); + + for (int n = 0; n < 77; ++n) + if (fxort (n) != !(n & 1)) + __builtin_abort (); + + for (int n = 0; n < 77; ++n) + if (fxorf (n) != (n & 1)) + __builtin_abort (); + + __builtin_memset (p, 0, sizeof(p)); + + for (int n = 0; n < 77; ++n) + if (!fxort (n)) + __builtin_abort (); + + for (int n = 0; n < 77; ++n) + if (fxorf (n)) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-8.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-8.c new file mode 100644 index 0000000..6842f39 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-bool-8.c @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-march=rv64gcv -mabi=lp64d -fdump-tree-vect-details" } */ + +long long p[128]; + +bool __attribute__((noipa)) +fxort () +{ + bool r = true; + for (int i = 0; i < 16; ++i) + r ^= (p[i] != 0); + return r; +} + +bool __attribute__((noipa)) +fxorf () +{ + bool r = false; + for (int i = 0; i < 16; ++i) + r ^= (p[i] != 0); + return r; +} + +/* { dg-final { scan-tree-dump-times "optimized: loop vectorized" 2 "vect" } } */ +/* { dg-final { scan-assembler-times {vcpop\.m\s+[atx][0-9]+,\s*v[0-9]+} 2 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i16.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i16.c index 8879af3..1b7a0d8 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i16.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i16.c @@ -27,3 +27,6 @@ TEST_TERNARY_VX_SIGNED_0(T) /* { dg-final { scan-assembler-times {vnmsac.vx} 1 } } */ /* { dg-final { scan-assembler-times {vmadd.vx} 1 } } */ /* { dg-final { scan-assembler-times {vnmsub.vx} 1 } } */ +/* { dg-final { scan-assembler-times {vmseq.vx} 1 } } */ +/* { dg-final { scan-assembler-times {vmsne.vx} 1 } } */ +/* { dg-final { scan-assembler-times {vmslt.vx} 1 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i32.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i32.c index 1b7b740..8e2c631 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i32.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i32.c @@ -27,3 +27,6 @@ TEST_TERNARY_VX_SIGNED_0(T) /* { dg-final { scan-assembler-times {vnmsac.vx} 1 } } */ /* { dg-final { scan-assembler-times {vmadd.vx} 1 } } */ /* { dg-final { scan-assembler-times {vnmsub.vx} 1 } } */ +/* { dg-final { scan-assembler-times {vmseq.vx} 1 } } */ +/* { dg-final { scan-assembler-times {vmsne.vx} 1 } } */ +/* { dg-final { scan-assembler-times {vmslt.vx} 1 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i64.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i64.c index 00d8ef7..a16623e 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i64.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i64.c @@ -30,3 +30,6 @@ TEST_TERNARY_VX_SIGNED_0(T) /* { dg-final { scan-assembler-times {vnmsac.vx} 1 } } */ /* { dg-final { scan-assembler-times {vmadd.vx} 1 } } */ /* { dg-final { scan-assembler-times {vnmsub.vx} 1 } } */ +/* { dg-final { scan-assembler-times {vmseq.vx} 1 } } */ +/* { dg-final { scan-assembler-times {vmsne.vx} 1 } } */ +/* { dg-final { scan-assembler-times {vmslt.vx} 1 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i8.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i8.c index 4480635..be50b83 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i8.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i8.c @@ -27,3 +27,6 @@ TEST_TERNARY_VX_SIGNED_0(T) /* { dg-final { scan-assembler-times {vnmsac.vx} 1 } } */ /* { dg-final { scan-assembler-times {vmadd.vx} 1 } } */ /* { dg-final { scan-assembler-times {vnmsub.vx} 1 } } */ +/* { dg-final { scan-assembler-times {vmseq.vx} 1 } } */ +/* { dg-final { scan-assembler-times {vmsne.vx} 1 } } */ +/* { dg-final { scan-assembler-times {vmslt.vx} 1 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-1-u16.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-1-u16.c index be4d23c..7e3ad1f 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-1-u16.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-1-u16.c @@ -11,6 +11,7 @@ TEST_BINARY_VX_UNSIGNED_0(T) TEST_TERNARY_VX_UNSIGNED_0(T) TEST_WIDEN_BINARY_VX_UNSIGNED(T, NT) +TEST_WIDEN_TERNARY_VX_UNSIGNED(T, NT) /* { dg-final { scan-assembler-times {vadd.vx} 2 } } */ /* { dg-final { scan-assembler-times {vsub.vx} 2 } } */ @@ -34,3 +35,7 @@ TEST_WIDEN_BINARY_VX_UNSIGNED(T, NT) /* { dg-final { scan-assembler-not {vwmulu.vx} } } */ /* { dg-final { scan-assembler-not {vwaddu.wx} } } */ /* { dg-final { scan-assembler-not {vwsubu.wx} } } */ +/* { dg-final { scan-assembler-not {vwmaccu.vx} } } */ +/* { dg-final { scan-assembler-times {vmseq.vx} 1 } } */ +/* { dg-final { scan-assembler-times {vmsne.vx} 1 } } */ +/* { dg-final { scan-assembler-times {vmsltu.vx} 1 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-1-u32.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-1-u32.c index 56dd314..cce2226 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-1-u32.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-1-u32.c @@ -11,6 +11,7 @@ TEST_BINARY_VX_UNSIGNED_0(T) TEST_TERNARY_VX_UNSIGNED_0(T) TEST_WIDEN_BINARY_VX_UNSIGNED(T, NT) +TEST_WIDEN_TERNARY_VX_UNSIGNED(T, NT) /* { dg-final { scan-assembler-times {vadd.vx} 2 } } */ /* { dg-final { scan-assembler-times {vsub.vx} 2 } } */ @@ -34,3 +35,7 @@ TEST_WIDEN_BINARY_VX_UNSIGNED(T, NT) /* { dg-final { scan-assembler-not {vwmulu.vx} } } */ /* { dg-final { scan-assembler-not {vwaddu.wx} } } */ /* { dg-final { scan-assembler-not {vwsubu.wx} } } */ +/* { dg-final { scan-assembler-not {vwmaccu.vx} } } */ +/* { dg-final { scan-assembler-times {vmseq.vx} 1 } } */ +/* { dg-final { scan-assembler-times {vmsne.vx} 1 } } */ +/* { dg-final { scan-assembler-times {vmsltu.vx} 1 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-1-u64.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-1-u64.c index 685f5f6..664d88d 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-1-u64.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-1-u64.c @@ -11,6 +11,7 @@ TEST_BINARY_VX_UNSIGNED_0(T) TEST_TERNARY_VX_UNSIGNED_0(T) TEST_WIDEN_BINARY_VX_UNSIGNED(T, NT) +TEST_WIDEN_TERNARY_VX_UNSIGNED(T, NT) /* { dg-final { scan-assembler-times {vadd.vx} 1 } } */ /* { dg-final { scan-assembler-times {vsub.vx} 1 } } */ @@ -37,3 +38,7 @@ TEST_WIDEN_BINARY_VX_UNSIGNED(T, NT) /* { dg-final { scan-assembler-times {vwmulu.vx} 1 } } */ /* { dg-final { scan-assembler-times {vwaddu.wx} 1 } } */ /* { dg-final { scan-assembler-times {vwsubu.wx} 1 } } */ +/* { dg-final { scan-assembler-times {vwmaccu.vx} 1 } } */ +/* { dg-final { scan-assembler-times {vmseq.vx} 1 } } */ +/* { dg-final { scan-assembler-times {vmsne.vx} 1 } } */ +/* { dg-final { scan-assembler-times {vmsltu.vx} 1 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-1-u8.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-1-u8.c index b659f7f..fd5ed56 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-1-u8.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-1-u8.c @@ -26,3 +26,6 @@ TEST_TERNARY_VX_UNSIGNED_0(T) /* { dg-final { scan-assembler-times {vnmsac.vx} 1 } } */ /* { dg-final { scan-assembler-times {vmadd.vx} 1 } } */ /* { dg-final { scan-assembler-times {vnmsub.vx} 1 } } */ +/* { dg-final { scan-assembler-times {vmseq.vx} 1 } } */ +/* { dg-final { scan-assembler-times {vmsne.vx} 1 } } */ +/* { dg-final { scan-assembler-times {vmsltu.vx} 1 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i16.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i16.c index d02aaa3..fb50bae 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i16.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i16.c @@ -27,3 +27,6 @@ TEST_TERNARY_VX_SIGNED_0(T) /* { dg-final { scan-assembler-not {vnmsac.vx} } } */ /* { dg-final { scan-assembler-not {vmadd.vx} } } */ /* { dg-final { scan-assembler-not {vnmsub.vx} } } */ +/* { dg-final { scan-assembler-not {vmseq.vx} } } */ +/* { dg-final { scan-assembler-not {vmsne.vx} } } */ +/* { dg-final { scan-assembler-not {vmslt.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i32.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i32.c index 5921fe6..d79e0e0 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i32.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i32.c @@ -27,3 +27,6 @@ TEST_TERNARY_VX_SIGNED_0(T) /* { dg-final { scan-assembler-not {vnmsac.vx} } } */ /* { dg-final { scan-assembler-not {vmadd.vx} } } */ /* { dg-final { scan-assembler-not {vnmsub.vx} } } */ +/* { dg-final { scan-assembler-not {vmseq.vx} } } */ +/* { dg-final { scan-assembler-not {vmsne.vx} } } */ +/* { dg-final { scan-assembler-not {vmslt.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i64.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i64.c index 3b53319..6cdaf5d 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i64.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i64.c @@ -27,3 +27,6 @@ TEST_TERNARY_VX_SIGNED_0(T) /* { dg-final { scan-assembler-not {vnmsac.vx} } } */ /* { dg-final { scan-assembler-not {vmadd.vx} } } */ /* { dg-final { scan-assembler-not {vnmsub.vx} } } */ +/* { dg-final { scan-assembler-not {vmseq.vx} } } */ +/* { dg-final { scan-assembler-not {vmsne.vx} } } */ +/* { dg-final { scan-assembler-not {vmslt.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i8.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i8.c index ca9fa4a..9e3879a 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i8.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i8.c @@ -27,3 +27,6 @@ TEST_TERNARY_VX_SIGNED_0(T) /* { dg-final { scan-assembler-not {vnmsac.vx} } } */ /* { dg-final { scan-assembler-not {vmadd.vx} } } */ /* { dg-final { scan-assembler-not {vnmsub.vx} } } */ +/* { dg-final { scan-assembler-not {vmseq.vx} } } */ +/* { dg-final { scan-assembler-not {vmsne.vx} } } */ +/* { dg-final { scan-assembler-not {vmslt.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-2-u16.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-2-u16.c index 391c59f..d3cdc4a 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-2-u16.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-2-u16.c @@ -11,6 +11,7 @@ TEST_BINARY_VX_UNSIGNED_0(T) TEST_TERNARY_VX_UNSIGNED_0(T) TEST_WIDEN_BINARY_VX_UNSIGNED(T, NT) +TEST_WIDEN_TERNARY_VX_UNSIGNED(T, NT) /* { dg-final { scan-assembler-not {vadd.vx} } } */ /* { dg-final { scan-assembler-not {vsub.vx} } } */ @@ -34,3 +35,7 @@ TEST_WIDEN_BINARY_VX_UNSIGNED(T, NT) /* { dg-final { scan-assembler-not {vwmulu.vx} } } */ /* { dg-final { scan-assembler-not {vwaddu.wx} } } */ /* { dg-final { scan-assembler-not {vwsubu.wx} } } */ +/* { dg-final { scan-assembler-not {vwmaccu.vx} } } */ +/* { dg-final { scan-assembler-not {vmseq.vx} } } */ +/* { dg-final { scan-assembler-not {vmsne.vx} } } */ +/* { dg-final { scan-assembler-not {vmsltu.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-2-u32.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-2-u32.c index 2bcb6a1..10f5bf0 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-2-u32.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-2-u32.c @@ -11,6 +11,7 @@ TEST_BINARY_VX_UNSIGNED_0(T) TEST_TERNARY_VX_UNSIGNED_0(T) TEST_WIDEN_BINARY_VX_UNSIGNED(T, NT) +TEST_WIDEN_TERNARY_VX_UNSIGNED(T, NT) /* { dg-final { scan-assembler-not {vadd.vx} } } */ /* { dg-final { scan-assembler-not {vsub.vx} } } */ @@ -34,3 +35,7 @@ TEST_WIDEN_BINARY_VX_UNSIGNED(T, NT) /* { dg-final { scan-assembler-not {vwmulu.vx} } } */ /* { dg-final { scan-assembler-not {vwaddu.wx} } } */ /* { dg-final { scan-assembler-not {vwsubu.wx} } } */ +/* { dg-final { scan-assembler-not {vwmaccu.vx} } } */ +/* { dg-final { scan-assembler-not {vmseq.vx} } } */ +/* { dg-final { scan-assembler-not {vmsne.vx} } } */ +/* { dg-final { scan-assembler-not {vmsltu.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-2-u64.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-2-u64.c index 0aa6a21..a7c8888 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-2-u64.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-2-u64.c @@ -11,6 +11,7 @@ TEST_BINARY_VX_UNSIGNED_0(T) TEST_TERNARY_VX_UNSIGNED_0(T) TEST_WIDEN_BINARY_VX_UNSIGNED(T, NT) +TEST_WIDEN_TERNARY_VX_UNSIGNED(T, NT) /* { dg-final { scan-assembler-not {vadd.vx} } } */ /* { dg-final { scan-assembler-not {vsub.vx} } } */ @@ -34,3 +35,7 @@ TEST_WIDEN_BINARY_VX_UNSIGNED(T, NT) /* { dg-final { scan-assembler-not {vwmulu.vx} } } */ /* { dg-final { scan-assembler-not {vwaddu.wx} } } */ /* { dg-final { scan-assembler-not {vwsubu.wx} } } */ +/* { dg-final { scan-assembler-not {vwmaccu.vx} } } */ +/* { dg-final { scan-assembler-not {vmseq.vx} } } */ +/* { dg-final { scan-assembler-not {vmsne.vx} } } */ +/* { dg-final { scan-assembler-not {vmsltu.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-2-u8.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-2-u8.c index 957fcde..55c2a96 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-2-u8.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-2-u8.c @@ -26,3 +26,6 @@ TEST_TERNARY_VX_UNSIGNED_0(T) /* { dg-final { scan-assembler-not {vnmsac.vx} } } */ /* { dg-final { scan-assembler-not {vmadd.vx} } } */ /* { dg-final { scan-assembler-not {vnmsub.vx} } } */ +/* { dg-final { scan-assembler-not {vmseq.vx} } } */ +/* { dg-final { scan-assembler-not {vmsne.vx} } } */ +/* { dg-final { scan-assembler-not {vmsltu.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i16.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i16.c index 573ae91..e3ef3e3 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i16.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i16.c @@ -27,3 +27,6 @@ TEST_TERNARY_VX_SIGNED_0(T) /* { dg-final { scan-assembler-not {vnmsac.vx} } } */ /* { dg-final { scan-assembler-not {vmadd.vx} } } */ /* { dg-final { scan-assembler-not {vnmsub.vx} } } */ +/* { dg-final { scan-assembler-not {vmseq.vx} } } */ +/* { dg-final { scan-assembler-not {vmsne.vx} } } */ +/* { dg-final { scan-assembler-not {vmslt.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i32.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i32.c index 5fab6be..20039c7 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i32.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i32.c @@ -27,3 +27,6 @@ TEST_TERNARY_VX_SIGNED_0(T) /* { dg-final { scan-assembler-not {vnmsac.vx} } } */ /* { dg-final { scan-assembler-not {vmadd.vx} } } */ /* { dg-final { scan-assembler-not {vnmsub.vx} } } */ +/* { dg-final { scan-assembler-not {vmseq.vx} } } */ +/* { dg-final { scan-assembler-not {vmslt.vx} } } */ +/* { dg-final { scan-assembler-not {vmsne.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i64.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i64.c index 5d67e47..c973ea7 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i64.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i64.c @@ -27,3 +27,6 @@ TEST_TERNARY_VX_SIGNED_0(T) /* { dg-final { scan-assembler-not {vnmsac.vx} } } */ /* { dg-final { scan-assembler-not {vmadd.vx} } } */ /* { dg-final { scan-assembler-not {vnmsub.vx} } } */ +/* { dg-final { scan-assembler-not {vmseq.vx} } } */ +/* { dg-final { scan-assembler-not {vmsne.vx} } } */ +/* { dg-final { scan-assembler-not {vmslt.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i8.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i8.c index d889a84..e781c62 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i8.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i8.c @@ -27,3 +27,6 @@ TEST_TERNARY_VX_SIGNED_0(T) /* { dg-final { scan-assembler-not {vnmsac.vx} } } */ /* { dg-final { scan-assembler-not {vmadd.vx} } } */ /* { dg-final { scan-assembler-not {vnmsub.vx} } } */ +/* { dg-final { scan-assembler-not {vmseq.vx} } } */ +/* { dg-final { scan-assembler-not {vmsne.vx} } } */ +/* { dg-final { scan-assembler-not {vmslt.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-3-u16.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-3-u16.c index 48e095f..233613d 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-3-u16.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-3-u16.c @@ -11,6 +11,7 @@ TEST_BINARY_VX_UNSIGNED_0(T) TEST_TERNARY_VX_UNSIGNED_0(T) TEST_WIDEN_BINARY_VX_UNSIGNED(T, NT) +TEST_WIDEN_TERNARY_VX_UNSIGNED(T, NT) /* { dg-final { scan-assembler-not {vadd.vx} } } */ /* { dg-final { scan-assembler-not {vsub.vx} } } */ @@ -34,3 +35,7 @@ TEST_WIDEN_BINARY_VX_UNSIGNED(T, NT) /* { dg-final { scan-assembler-not {vwmulu.vx} } } */ /* { dg-final { scan-assembler-not {vwaddu.wx} } } */ /* { dg-final { scan-assembler-not {vwsubu.wx} } } */ +/* { dg-final { scan-assembler-not {vwmaccu.vx} } } */ +/* { dg-final { scan-assembler-not {vmseq.vx} } } */ +/* { dg-final { scan-assembler-not {vmsne.vx} } } */ +/* { dg-final { scan-assembler-not {vmsltu.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-3-u32.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-3-u32.c index 761ce5d..ac68d6e 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-3-u32.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-3-u32.c @@ -11,6 +11,7 @@ TEST_BINARY_VX_UNSIGNED_0(T) TEST_TERNARY_VX_UNSIGNED_0(T) TEST_WIDEN_BINARY_VX_UNSIGNED(T, NT) +TEST_WIDEN_TERNARY_VX_UNSIGNED(T, NT) /* { dg-final { scan-assembler-not {vadd.vx} } } */ /* { dg-final { scan-assembler-not {vsub.vx} } } */ @@ -34,3 +35,7 @@ TEST_WIDEN_BINARY_VX_UNSIGNED(T, NT) /* { dg-final { scan-assembler-not {vwmulu.vx} } } */ /* { dg-final { scan-assembler-not {vwaddu.wx} } } */ /* { dg-final { scan-assembler-not {vwsubu.wx} } } */ +/* { dg-final { scan-assembler-not {vwmaccu.vx} } } */ +/* { dg-final { scan-assembler-not {vmseq.vx} } } */ +/* { dg-final { scan-assembler-not {vmsne.vx} } } */ +/* { dg-final { scan-assembler-not {vmsltu.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-3-u64.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-3-u64.c index 1eebec9..bfdf5c1 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-3-u64.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-3-u64.c @@ -11,6 +11,7 @@ TEST_BINARY_VX_UNSIGNED_0(T) TEST_TERNARY_VX_UNSIGNED_0(T) TEST_WIDEN_BINARY_VX_UNSIGNED(T, NT) +TEST_WIDEN_TERNARY_VX_UNSIGNED(T, NT) /* { dg-final { scan-assembler-not {vadd.vx} } } */ /* { dg-final { scan-assembler-not {vsub.vx} } } */ @@ -34,3 +35,7 @@ TEST_WIDEN_BINARY_VX_UNSIGNED(T, NT) /* { dg-final { scan-assembler-not {vwmulu.vx} } } */ /* { dg-final { scan-assembler-not {vwaddu.wx} } } */ /* { dg-final { scan-assembler-not {vwsubu.wx} } } */ +/* { dg-final { scan-assembler-not {vwmaccu.vx} } } */ +/* { dg-final { scan-assembler-not {vmseq.vx} } } */ +/* { dg-final { scan-assembler-not {vmsne.vx} } } */ +/* { dg-final { scan-assembler-not {vmsltu.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-3-u8.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-3-u8.c index 9deb635..d6e64ef 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-3-u8.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx-3-u8.c @@ -26,3 +26,6 @@ TEST_TERNARY_VX_UNSIGNED_0(T) /* { dg-final { scan-assembler-not {vnmsac.vx} } } */ /* { dg-final { scan-assembler-not {vmadd.vx} } } */ /* { dg-final { scan-assembler-not {vnmsub.vx} } } */ +/* { dg-final { scan-assembler-not {vmseq.vx} } } */ +/* { dg-final { scan-assembler-not {vmsne.vx} } } */ +/* { dg-final { scan-assembler-not {vmsltu.vx} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_binary.h b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_binary.h index 353ee16..a9bba40 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_binary.h +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_binary.h @@ -402,6 +402,9 @@ DEF_AVG_CEIL(int32_t, int64_t) DEF_VX_BINARY_CASE_0_WRAP(T, *, mul) \ DEF_VX_BINARY_CASE_0_WRAP(T, /, div) \ DEF_VX_BINARY_CASE_0_WRAP(T, %, rem) \ + DEF_VX_BINARY_CASE_0_WRAP(T, ==, eq) \ + DEF_VX_BINARY_CASE_0_WRAP(T, !=, ne) \ + DEF_VX_BINARY_CASE_0_WRAP(T, <, lt) \ DEF_VX_BINARY_CASE_2_WRAP(T, MAX_FUNC_0_WARP(T), max) \ DEF_VX_BINARY_CASE_2_WRAP(T, MAX_FUNC_1_WARP(T), max) \ DEF_VX_BINARY_CASE_2_WRAP(T, MIN_FUNC_0_WARP(T), min) \ @@ -420,6 +423,9 @@ DEF_AVG_CEIL(int32_t, int64_t) DEF_VX_BINARY_CASE_0_WRAP(T, ^, xor) \ DEF_VX_BINARY_CASE_0_WRAP(T, /, div) \ DEF_VX_BINARY_CASE_0_WRAP(T, %, rem) \ + DEF_VX_BINARY_CASE_0_WRAP(T, ==, eq) \ + DEF_VX_BINARY_CASE_0_WRAP(T, !=, ne) \ + DEF_VX_BINARY_CASE_0_WRAP(T, <, ltu) \ DEF_VX_BINARY_CASE_2_WRAP(T, MAX_FUNC_0_WARP(T), max) \ DEF_VX_BINARY_CASE_2_WRAP(T, MAX_FUNC_1_WARP(T), max) \ DEF_VX_BINARY_CASE_2_WRAP(T, MIN_FUNC_0_WARP(T), min) \ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_binary_data.h b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_binary_data.h index e385bf2..fad479a 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_binary_data.h +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_binary_data.h @@ -3338,6 +3338,278 @@ uint64_t TEST_BINARY_DATA(uint64_t, rem)[][3][N] = }, }; +int8_t TEST_BINARY_DATA(int8_t, eq)[][3][N] = +{ + { + { 1 }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + -1, -1, -1, -1, + -2, -2, -2, -2, + }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + 0, 0, 0, 0, + 0, 0, 0, 0, + }, + }, + { + { 127 }, + { + 0, 0, 0, 0, + 127, 127, 127, 127, + -128, -128, -128, -128, + -2, -2, -2, -2, + }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + 0, 0, 0, 0, + 0, 0, 0, 0, + }, + }, +}; + +int16_t TEST_BINARY_DATA(int16_t, eq)[][3][N] = +{ + { + { 1 }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + -1, -1, -1, -1, + -2, -2, -2, -2, + }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + 0, 0, 0, 0, + 0, 0, 0, 0, + }, + }, + { + { -32768 }, + { + 0, 0, 0, 0, + -1, -1, -1, -1, + -32768, -32768, -32768, -32768, + -2, -2, -2, -2, + }, + { + 0, 0, 0, 0, + 0, 0, 0, 0, + 1, 1, 1, 1, + 0, 0, 0, 0, + }, + }, +}; + +int32_t TEST_BINARY_DATA(int32_t, eq)[][3][N] = +{ + { + { 1 }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + -1, -1, -1, -1, + -2, -2, -2, -2, + }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + 0, 0, 0, 0, + 0, 0, 0, 0, + }, + }, + { + { -2147483648 }, + { + 0, 0, 0, 0, + -1, -1, -1, -1, + -2147483648, -2147483648, -2147483648, -2147483648, + -2, -2, -2, -2, + }, + { + 0, 0, 0, 0, + 0, 0, 0, 0, + 1, 1, 1, 1, + 0, 0, 0, 0, + }, + }, +}; + +int64_t TEST_BINARY_DATA(int64_t, eq)[][3][N] = +{ + { + { 1 }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + -1, -1, -1, -1, + -2, -2, -2, -2, + }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + 0, 0, 0, 0, + 0, 0, 0, 0, + }, + }, + { + { -9223372036854775808ull }, + { + 0, 0, 0, 0, + -1, -1, -1, -1, + -9223372036854775808ull, -9223372036854775808ull, -9223372036854775808ull, -9223372036854775808ull, + -2, -2, -2, -2, + }, + { + 0, 0, 0, 0, + 0, 0, 0, 0, + 1, 1, 1, 1, + 0, 0, 0, 0, + }, + }, +}; + +int8_t TEST_BINARY_DATA(int8_t, ne)[][3][N] = +{ + { + { 1 }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + -1, -1, -1, -1, + -2, -2, -2, -2, + }, + { + 1, 1, 1, 1, + 0, 0, 0, 0, + 1, 1, 1, 1, + 1, 1, 1, 1, + }, + }, + { + { 127 }, + { + 0, 0, 0, 0, + 127, 127, 127, 127, + -128, -128, -128, -128, + -2, -2, -2, -2, + }, + { + 1, 1, 1, 1, + 0, 0, 0, 0, + 1, 1, 1, 1, + 1, 1, 1, 1, + }, + }, +}; + +int16_t TEST_BINARY_DATA(int16_t, ne)[][3][N] = +{ + { + { 1 }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + -1, -1, -1, -1, + -2, -2, -2, -2, + }, + { + 1, 1, 1, 1, + 0, 0, 0, 0, + 1, 1, 1, 1, + 1, 1, 1, 1, + }, + }, + { + { -32768 }, + { + 0, 0, 0, 0, + -1, -1, -1, -1, + -32768, -32768, -32768, -32768, + -2, -2, -2, -2, + }, + { + 1, 1, 1, 1, + 1, 1, 1, 1, + 0, 0, 0, 0, + 1, 1, 1, 1, + }, + }, +}; + +int32_t TEST_BINARY_DATA(int32_t, ne)[][3][N] = +{ + { + { 1 }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + -1, -1, -1, -1, + -2, -2, -2, -2, + }, + { + 1, 1, 1, 1, + 0, 0, 0, 0, + 1, 1, 1, 1, + 1, 1, 1, 1, + }, + }, + { + { -2147483648 }, + { + 0, 0, 0, 0, + -1, -1, -1, -1, + -2147483648, -2147483648, -2147483648, -2147483648, + -2, -2, -2, -2, + }, + { + 1, 1, 1, 1, + 1, 1, 1, 1, + 0, 0, 0, 0, + 1, 1, 1, 1, + }, + }, +}; + +int64_t TEST_BINARY_DATA(int64_t, ne)[][3][N] = +{ + { + { 1 }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + -1, -1, -1, -1, + -2, -2, -2, -2, + }, + { + 1, 1, 1, 1, + 0, 0, 0, 0, + 1, 1, 1, 1, + 1, 1, 1, 1, + }, + }, + { + { -9223372036854775808ull }, + { + 0, 0, 0, 0, + -1, -1, -1, -1, + -9223372036854775808ull, -9223372036854775808ull, -9223372036854775808ull, -9223372036854775808ull, + -2, -2, -2, -2, + }, + { + 1, 1, 1, 1, + 1, 1, 1, 1, + 0, 0, 0, 0, + 1, 1, 1, 1, + }, + }, +}; + int8_t TEST_BINARY_DATA(int8_t, max)[][3][N] = { { @@ -5886,4 +6158,548 @@ int64_t TEST_BINARY_DATA(int64_t, merge)[][3][N] = }, }; +uint8_t TEST_BINARY_DATA(uint8_t, eq)[][3][N] = +{ + { + { 127 }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + 127, 127, 127, 127, + 128, 128, 128, 128, + }, + { + 0, 0, 0, 0, + 0, 0, 0, 0, + 1, 1, 1, 1, + 0, 0, 0, 0, + }, + }, + { + { 255 }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + 2, 2, 2, 2, + 255, 255, 255, 255, + }, + { + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 1, 1, 1, 1, + }, + }, +}; + +uint16_t TEST_BINARY_DATA(uint16_t, eq)[][3][N] = +{ + { + { 32767 }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + 32767, 32767, 32767, 32767, + 32768, 32768, 32768, 32768, + }, + { + 0, 0, 0, 0, + 0, 0, 0, 0, + 1, 1, 1, 1, + 0, 0, 0, 0, + }, + }, + { + { 65535 }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + 2, 2, 2, 2, + 65535, 65535, 65535, 65535, + }, + { + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 1, 1, 1, 1, + }, + }, +}; + +uint32_t TEST_BINARY_DATA(uint32_t, eq)[][3][N] = +{ + { + { 2147483647 }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + 2147483647, 2147483647, 2147483647, 2147483647, + 2147483648, 2147483648, 2147483648, 2147483648, + }, + { + 0, 0, 0, 0, + 0, 0, 0, 0, + 1, 1, 1, 1, + 0, 0, 0, 0, + }, + }, + { + { 4294967295 }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + 2, 2, 2, 2, + 4294967295, 4294967295, 4294967295, 4294967295, + }, + { + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 1, 1, 1, 1, + }, + }, +}; + +uint64_t TEST_BINARY_DATA(uint64_t, eq)[][3][N] = +{ + { + { 9223372036854775807ull }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + 9223372036854775807ull, 9223372036854775807ull, 9223372036854775807ull, 9223372036854775807ull, + 9223372036854775808ull, 9223372036854775808ull, 9223372036854775808ull, 9223372036854775808ull, + }, + { + 0, 0, 0, 0, + 0, 0, 0, 0, + 1, 1, 1, 1, + 0, 0, 0, 0, + }, + }, + { + { 18446744073709551615ull }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + 2, 2, 2, 2, + 18446744073709551615ull, 18446744073709551615ull, 18446744073709551615ull, 18446744073709551615ull, + }, + { + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 1, 1, 1, 1, + }, + }, +}; + +uint8_t TEST_BINARY_DATA(uint8_t, ne)[][3][N] = +{ + { + { 127 }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + 127, 127, 127, 127, + 128, 128, 128, 128, + }, + { + 1, 1, 1, 1, + 1, 1, 1, 1, + 0, 0, 0, 0, + 1, 1, 1, 1, + }, + }, + { + { 255 }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + 2, 2, 2, 2, + 255, 255, 255, 255, + }, + { + 1, 1, 1, 1, + 1, 1, 1, 1, + 1, 1, 1, 1, + 0, 0, 0, 0, + }, + }, +}; + +uint16_t TEST_BINARY_DATA(uint16_t, ne)[][3][N] = +{ + { + { 32767 }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + 32767, 32767, 32767, 32767, + 32768, 32768, 32768, 32768, + }, + { + 1, 1, 1, 1, + 1, 1, 1, 1, + 0, 0, 0, 0, + 1, 1, 1, 1, + }, + }, + { + { 65535 }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + 2, 2, 2, 2, + 65535, 65535, 65535, 65535, + }, + { + 1, 1, 1, 1, + 1, 1, 1, 1, + 1, 1, 1, 1, + 0, 0, 0, 0, + }, + }, +}; + +uint32_t TEST_BINARY_DATA(uint32_t, ne)[][3][N] = +{ + { + { 2147483647 }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + 2147483647, 2147483647, 2147483647, 2147483647, + 2147483648, 2147483648, 2147483648, 2147483648, + }, + { + 1, 1, 1, 1, + 1, 1, 1, 1, + 0, 0, 0, 0, + 1, 1, 1, 1, + }, + }, + { + { 4294967295 }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + 2, 2, 2, 2, + 4294967295, 4294967295, 4294967295, 4294967295, + }, + { + 1, 1, 1, 1, + 1, 1, 1, 1, + 1, 1, 1, 1, + 0, 0, 0, 0, + }, + }, +}; + +uint64_t TEST_BINARY_DATA(uint64_t, ne)[][3][N] = +{ + { + { 9223372036854775807ull }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + 9223372036854775807ull, 9223372036854775807ull, 9223372036854775807ull, 9223372036854775807ull, + 9223372036854775808ull, 9223372036854775808ull, 9223372036854775808ull, 9223372036854775808ull, + }, + { + 1, 1, 1, 1, + 1, 1, 1, 1, + 0, 0, 0, 0, + 1, 1, 1, 1, + }, + }, + { + { 18446744073709551615ull }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + 2, 2, 2, 2, + 18446744073709551615ull, 18446744073709551615ull, 18446744073709551615ull, 18446744073709551615ull, + }, + { + 1, 1, 1, 1, + 1, 1, 1, 1, + 1, 1, 1, 1, + 0, 0, 0, 0, + }, + }, +}; + +uint8_t TEST_BINARY_DATA(uint8_t, ltu)[][3][N] = +{ + { + { 127 }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + 127, 127, 127, 127, + 128, 128, 128, 128, + }, + { + 1, 1, 1, 1, + 1, 1, 1, 1, + 0, 0, 0, 0, + 0, 0, 0, 0, + }, + }, + { + { 255 }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + 2, 2, 2, 2, + 255, 255, 255, 255, + }, + { + 1, 1, 1, 1, + 1, 1, 1, 1, + 1, 1, 1, 1, + 0, 0, 0, 0, + }, + }, +}; + +uint16_t TEST_BINARY_DATA(uint16_t, ltu)[][3][N] = +{ + { + { 32767 }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + 32767, 32767, 32767, 32767, + 32768, 32768, 32768, 32768, + }, + { + 1, 1, 1, 1, + 1, 1, 1, 1, + 0, 0, 0, 0, + 0, 0, 0, 0, + }, + }, + { + { 65535 }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + 2, 2, 2, 2, + 65535, 65535, 65535, 65535, + }, + { + 1, 1, 1, 1, + 1, 1, 1, 1, + 1, 1, 1, 1, + 0, 0, 0, 0, + }, + }, +}; + +uint32_t TEST_BINARY_DATA(uint32_t, ltu)[][3][N] = +{ + { + { 2147483647 }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + 2147483647, 2147483647, 2147483647, 2147483647, + 2147483648, 2147483648, 2147483648, 2147483648, + }, + { + 1, 1, 1, 1, + 1, 1, 1, 1, + 0, 0, 0, 0, + 0, 0, 0, 0, + }, + }, + { + { 4294967295 }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + 2, 2, 2, 2, + 4294967295, 4294967295, 4294967295, 4294967295, + }, + { + 1, 1, 1, 1, + 1, 1, 1, 1, + 1, 1, 1, 1, + 0, 0, 0, 0, + }, + }, +}; + +uint64_t TEST_BINARY_DATA(uint64_t, ltu)[][3][N] = +{ + { + { 9223372036854775807ull }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + 9223372036854775807ull, 9223372036854775807ull, 9223372036854775807ull, 9223372036854775807ull, + 9223372036854775808ull, 9223372036854775808ull, 9223372036854775808ull, 9223372036854775808ull, + }, + { + 1, 1, 1, 1, + 1, 1, 1, 1, + 0, 0, 0, 0, + 0, 0, 0, 0, + }, + }, + { + { 18446744073709551615ull }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + 2, 2, 2, 2, + 18446744073709551615ull, 18446744073709551615ull, 18446744073709551615ull, 18446744073709551615ull, + }, + { + 1, 1, 1, 1, + 1, 1, 1, 1, + 1, 1, 1, 1, + 0, 0, 0, 0, + }, + }, +}; + +int8_t TEST_BINARY_DATA(int8_t, lt)[][3][N] = +{ + { + { 127 }, + { + 0, 0, 0, 0, + -1, -1, -1, -1, + 127, 127, 127, 127, + -128, -128, -128, -128, + }, + { + 1, 1, 1, 1, + 1, 1, 1, 1, + 0, 0, 0, 0, + 1, 1, 1, 1, + }, + }, + { + { -1 }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + -2, -2, -2, -2, + -128, -128, -128, -128, + }, + { + 0, 0, 0, 0, + 0, 0, 0, 0, + 1, 1, 1, 1, + 1, 1, 1, 1, + }, + }, +}; + +int16_t TEST_BINARY_DATA(int16_t, lt)[][3][N] = +{ + { + { 32767 }, + { + 0, 0, 0, 0, + -1, -1, -1, -1, + 32767, 32767, 32767, 32767, + -32768, -32768, -32768, -32768, + }, + { + 1, 1, 1, 1, + 1, 1, 1, 1, + 0, 0, 0, 0, + 1, 1, 1, 1, + }, + }, + { + { -1 }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + -2, -2, -2, -2, + -32768, -32768, -32768, -32768, + }, + { + 0, 0, 0, 0, + 0, 0, 0, 0, + 1, 1, 1, 1, + 1, 1, 1, 1, + }, + }, +}; + +int32_t TEST_BINARY_DATA(int32_t, lt)[][3][N] = +{ + { + { 2147483647 }, + { + 0, 0, 0, 0, + -1, -1, -1, -1, + 2147483647, 2147483647, 2147483647, 2147483647, + -2147483648, -2147483648, -2147483648, -2147483648, + }, + { + 1, 1, 1, 1, + 1, 1, 1, 1, + 0, 0, 0, 0, + 1, 1, 1, 1, + }, + }, + { + { -1 }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + -2, -2, -2, -2, + -2147483648, -2147483648, -2147483648, -2147483648, + }, + { + 0, 0, 0, 0, + 0, 0, 0, 0, + 1, 1, 1, 1, + 1, 1, 1, 1, + }, + }, +}; + +int64_t TEST_BINARY_DATA(int64_t, lt)[][3][N] = +{ + { + { 9223372036854775807ll }, + { + 0, 0, 0, 0, + -1, -1, -1, -1, + 9223372036854775807ll, 9223372036854775807ll, 9223372036854775807ll, 9223372036854775807ll, + -9223372036854775808ull, -9223372036854775808ull, -9223372036854775808ull, -9223372036854775808ull, + }, + { + 1, 1, 1, 1, + 1, 1, 1, 1, + 0, 0, 0, 0, + 1, 1, 1, 1, + }, + }, + { + { -1 }, + { + 0, 0, 0, 0, + 1, 1, 1, 1, + -2, -2, -2, -2, + -9223372036854775808ull, -9223372036854775808ull, -9223372036854775808ull, -9223372036854775808ull, + }, + { + 0, 0, 0, 0, + 0, 0, 0, 0, + 1, 1, 1, 1, + 1, 1, 1, 1, + }, + }, +}; + #endif diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmseq-run-1-i16.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmseq-run-1-i16.c new file mode 100644 index 0000000..43404c1 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmseq-run-1-i16.c @@ -0,0 +1,15 @@ +/* { dg-do run { target { riscv_v } } } */ +/* { dg-additional-options "-std=c99 --param=gpr2vr-cost=0" } */ + +#include "vx_binary.h" +#include "vx_binary_data.h" + +#define T int16_t +#define NAME eq + +DEF_VX_BINARY_CASE_0_WRAP(T, ==, NAME) + +#define TEST_DATA TEST_BINARY_DATA_WRAP(T, NAME) +#define TEST_RUN(T, NAME, out, in, x, n) RUN_VX_BINARY_CASE_0_WRAP(T, NAME, out, in, x, n) + +#include "vx_binary_run.h" diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmseq-run-1-i32.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmseq-run-1-i32.c new file mode 100644 index 0000000..c2d59a3 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmseq-run-1-i32.c @@ -0,0 +1,15 @@ +/* { dg-do run { target { riscv_v } } } */ +/* { dg-additional-options "-std=c99 --param=gpr2vr-cost=0" } */ + +#include "vx_binary.h" +#include "vx_binary_data.h" + +#define T int32_t +#define NAME eq + +DEF_VX_BINARY_CASE_0_WRAP(T, ==, NAME) + +#define TEST_DATA TEST_BINARY_DATA_WRAP(T, NAME) +#define TEST_RUN(T, NAME, out, in, x, n) RUN_VX_BINARY_CASE_0_WRAP(T, NAME, out, in, x, n) + +#include "vx_binary_run.h" diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmseq-run-1-i64.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmseq-run-1-i64.c new file mode 100644 index 0000000..b680dd5 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmseq-run-1-i64.c @@ -0,0 +1,15 @@ +/* { dg-do run { target { riscv_v } } } */ +/* { dg-additional-options "-std=c99 --param=gpr2vr-cost=0" } */ + +#include "vx_binary.h" +#include "vx_binary_data.h" + +#define T int64_t +#define NAME eq + +DEF_VX_BINARY_CASE_0_WRAP(T, ==, NAME) + +#define TEST_DATA TEST_BINARY_DATA_WRAP(T, NAME) +#define TEST_RUN(T, NAME, out, in, x, n) RUN_VX_BINARY_CASE_0_WRAP(T, NAME, out, in, x, n) + +#include "vx_binary_run.h" diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmseq-run-1-i8.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmseq-run-1-i8.c new file mode 100644 index 0000000..b9219b9 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmseq-run-1-i8.c @@ -0,0 +1,15 @@ +/* { dg-do run { target { riscv_v } } } */ +/* { dg-additional-options "-std=c99 --param=gpr2vr-cost=0" } */ + +#include "vx_binary.h" +#include "vx_binary_data.h" + +#define T int8_t +#define NAME eq + +DEF_VX_BINARY_CASE_0_WRAP(T, ==, NAME) + +#define TEST_DATA TEST_BINARY_DATA_WRAP(T, NAME) +#define TEST_RUN(T, NAME, out, in, x, n) RUN_VX_BINARY_CASE_0_WRAP(T, NAME, out, in, x, n) + +#include "vx_binary_run.h" diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmseq-run-1-u16.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmseq-run-1-u16.c new file mode 100644 index 0000000..12046c3 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmseq-run-1-u16.c @@ -0,0 +1,15 @@ +/* { dg-do run { target { riscv_v } } } */ +/* { dg-additional-options "-std=c99 --param=gpr2vr-cost=0" } */ + +#include "vx_binary.h" +#include "vx_binary_data.h" + +#define T uint16_t +#define NAME eq + +DEF_VX_BINARY_CASE_0_WRAP(T, ==, NAME) + +#define TEST_DATA TEST_BINARY_DATA_WRAP(T, NAME) +#define TEST_RUN(T, NAME, out, in, x, n) RUN_VX_BINARY_CASE_0_WRAP(T, NAME, out, in, x, n) + +#include "vx_binary_run.h" diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmseq-run-1-u32.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmseq-run-1-u32.c new file mode 100644 index 0000000..7d2be30 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmseq-run-1-u32.c @@ -0,0 +1,15 @@ +/* { dg-do run { target { riscv_v } } } */ +/* { dg-additional-options "-std=c99 --param=gpr2vr-cost=0" } */ + +#include "vx_binary.h" +#include "vx_binary_data.h" + +#define T uint32_t +#define NAME eq + +DEF_VX_BINARY_CASE_0_WRAP(T, ==, NAME) + +#define TEST_DATA TEST_BINARY_DATA_WRAP(T, NAME) +#define TEST_RUN(T, NAME, out, in, x, n) RUN_VX_BINARY_CASE_0_WRAP(T, NAME, out, in, x, n) + +#include "vx_binary_run.h" diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmseq-run-1-u64.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmseq-run-1-u64.c new file mode 100644 index 0000000..7a6f664 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmseq-run-1-u64.c @@ -0,0 +1,15 @@ +/* { dg-do run { target { riscv_v } } } */ +/* { dg-additional-options "-std=c99 --param=gpr2vr-cost=0" } */ + +#include "vx_binary.h" +#include "vx_binary_data.h" + +#define T uint64_t +#define NAME eq + +DEF_VX_BINARY_CASE_0_WRAP(T, ==, NAME) + +#define TEST_DATA TEST_BINARY_DATA_WRAP(T, NAME) +#define TEST_RUN(T, NAME, out, in, x, n) RUN_VX_BINARY_CASE_0_WRAP(T, NAME, out, in, x, n) + +#include "vx_binary_run.h" diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmseq-run-1-u8.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmseq-run-1-u8.c new file mode 100644 index 0000000..619e3d5 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmseq-run-1-u8.c @@ -0,0 +1,15 @@ +/* { dg-do run { target { riscv_v } } } */ +/* { dg-additional-options "-std=c99 --param=gpr2vr-cost=0" } */ + +#include "vx_binary.h" +#include "vx_binary_data.h" + +#define T uint8_t +#define NAME eq + +DEF_VX_BINARY_CASE_0_WRAP(T, ==, NAME) + +#define TEST_DATA TEST_BINARY_DATA_WRAP(T, NAME) +#define TEST_RUN(T, NAME, out, in, x, n) RUN_VX_BINARY_CASE_0_WRAP(T, NAME, out, in, x, n) + +#include "vx_binary_run.h" diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmslt-run-1-i16.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmslt-run-1-i16.c new file mode 100644 index 0000000..865a2f8 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmslt-run-1-i16.c @@ -0,0 +1,15 @@ +/* { dg-do run { target { riscv_v } } } */ +/* { dg-additional-options "-std=c99 --param=gpr2vr-cost=0" } */ + +#include "vx_binary.h" +#include "vx_binary_data.h" + +#define T int16_t +#define NAME lt + +DEF_VX_BINARY_CASE_0_WRAP(T, <, NAME) + +#define TEST_DATA TEST_BINARY_DATA_WRAP(T, NAME) +#define TEST_RUN(T, NAME, out, in, x, n) RUN_VX_BINARY_CASE_0_WRAP(T, NAME, out, in, x, n) + +#include "vx_binary_run.h" diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmslt-run-1-i32.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmslt-run-1-i32.c new file mode 100644 index 0000000..eeb2a66 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmslt-run-1-i32.c @@ -0,0 +1,16 @@ + +/* { dg-do run { target { riscv_v } } } */ +/* { dg-additional-options "-std=c99 --param=gpr2vr-cost=0" } */ + +#include "vx_binary.h" +#include "vx_binary_data.h" + +#define T int32_t +#define NAME lt + +DEF_VX_BINARY_CASE_0_WRAP(T, <, NAME) + +#define TEST_DATA TEST_BINARY_DATA_WRAP(T, NAME) +#define TEST_RUN(T, NAME, out, in, x, n) RUN_VX_BINARY_CASE_0_WRAP(T, NAME, out, in, x, n) + +#include "vx_binary_run.h" diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmslt-run-1-i64.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmslt-run-1-i64.c new file mode 100644 index 0000000..c3a2052 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmslt-run-1-i64.c @@ -0,0 +1,15 @@ +/* { dg-do run { target { riscv_v } } } */ +/* { dg-additional-options "-std=c99 --param=gpr2vr-cost=0" } */ + +#include "vx_binary.h" +#include "vx_binary_data.h" + +#define T int64_t +#define NAME lt + +DEF_VX_BINARY_CASE_0_WRAP(T, <, NAME) + +#define TEST_DATA TEST_BINARY_DATA_WRAP(T, NAME) +#define TEST_RUN(T, NAME, out, in, x, n) RUN_VX_BINARY_CASE_0_WRAP(T, NAME, out, in, x, n) + +#include "vx_binary_run.h" diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmslt-run-1-i8.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmslt-run-1-i8.c new file mode 100644 index 0000000..92a84f2 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmslt-run-1-i8.c @@ -0,0 +1,15 @@ +/* { dg-do run { target { riscv_v } } } */ +/* { dg-additional-options "-std=c99 --param=gpr2vr-cost=0" } */ + +#include "vx_binary.h" +#include "vx_binary_data.h" + +#define T int8_t +#define NAME lt + +DEF_VX_BINARY_CASE_0_WRAP(T, <, NAME) + +#define TEST_DATA TEST_BINARY_DATA_WRAP(T, NAME) +#define TEST_RUN(T, NAME, out, in, x, n) RUN_VX_BINARY_CASE_0_WRAP(T, NAME, out, in, x, n) + +#include "vx_binary_run.h" diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsltu-run-1-u16.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsltu-run-1-u16.c new file mode 100644 index 0000000..38283c1 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsltu-run-1-u16.c @@ -0,0 +1,15 @@ +/* { dg-do run { target { riscv_v } } } */ +/* { dg-additional-options "-std=c99 --param=gpr2vr-cost=0" } */ + +#include "vx_binary.h" +#include "vx_binary_data.h" + +#define T uint16_t +#define NAME ltu + +DEF_VX_BINARY_CASE_0_WRAP(T, <, NAME) + +#define TEST_DATA TEST_BINARY_DATA_WRAP(T, NAME) +#define TEST_RUN(T, NAME, out, in, x, n) RUN_VX_BINARY_CASE_0_WRAP(T, NAME, out, in, x, n) + +#include "vx_binary_run.h" diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsltu-run-1-u32.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsltu-run-1-u32.c new file mode 100644 index 0000000..dadb399 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsltu-run-1-u32.c @@ -0,0 +1,15 @@ +/* { dg-do run { target { riscv_v } } } */ +/* { dg-additional-options "-std=c99 --param=gpr2vr-cost=0" } */ + +#include "vx_binary.h" +#include "vx_binary_data.h" + +#define T uint32_t +#define NAME ltu + +DEF_VX_BINARY_CASE_0_WRAP(T, <, NAME) + +#define TEST_DATA TEST_BINARY_DATA_WRAP(T, NAME) +#define TEST_RUN(T, NAME, out, in, x, n) RUN_VX_BINARY_CASE_0_WRAP(T, NAME, out, in, x, n) + +#include "vx_binary_run.h" diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsltu-run-1-u64.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsltu-run-1-u64.c new file mode 100644 index 0000000..1b961c2 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsltu-run-1-u64.c @@ -0,0 +1,15 @@ +/* { dg-do run { target { riscv_v } } } */ +/* { dg-additional-options "-std=c99 --param=gpr2vr-cost=0" } */ + +#include "vx_binary.h" +#include "vx_binary_data.h" + +#define T uint64_t +#define NAME ltu + +DEF_VX_BINARY_CASE_0_WRAP(T, <, NAME) + +#define TEST_DATA TEST_BINARY_DATA_WRAP(T, NAME) +#define TEST_RUN(T, NAME, out, in, x, n) RUN_VX_BINARY_CASE_0_WRAP(T, NAME, out, in, x, n) + +#include "vx_binary_run.h" diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsltu-run-1-u8.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsltu-run-1-u8.c new file mode 100644 index 0000000..316df98 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsltu-run-1-u8.c @@ -0,0 +1,15 @@ +/* { dg-do run { target { riscv_v } } } */ +/* { dg-additional-options "-std=c99 --param=gpr2vr-cost=0" } */ + +#include "vx_binary.h" +#include "vx_binary_data.h" + +#define T uint8_t +#define NAME ltu + +DEF_VX_BINARY_CASE_0_WRAP(T, <, NAME) + +#define TEST_DATA TEST_BINARY_DATA_WRAP(T, NAME) +#define TEST_RUN(T, NAME, out, in, x, n) RUN_VX_BINARY_CASE_0_WRAP(T, NAME, out, in, x, n) + +#include "vx_binary_run.h" diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsne-run-1-i16.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsne-run-1-i16.c new file mode 100644 index 0000000..d42959e --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsne-run-1-i16.c @@ -0,0 +1,15 @@ +/* { dg-do run { target { riscv_v } } } */ +/* { dg-additional-options "-std=c99 --param=gpr2vr-cost=0" } */ + +#include "vx_binary.h" +#include "vx_binary_data.h" + +#define T int16_t +#define NAME ne + +DEF_VX_BINARY_CASE_0_WRAP(T, !=, NAME) + +#define TEST_DATA TEST_BINARY_DATA_WRAP(T, NAME) +#define TEST_RUN(T, NAME, out, in, x, n) RUN_VX_BINARY_CASE_0_WRAP(T, NAME, out, in, x, n) + +#include "vx_binary_run.h" diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsne-run-1-i32.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsne-run-1-i32.c new file mode 100644 index 0000000..29214cf --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsne-run-1-i32.c @@ -0,0 +1,15 @@ +/* { dg-do run { target { riscv_v } } } */ +/* { dg-additional-options "-std=c99 --param=gpr2vr-cost=0" } */ + +#include "vx_binary.h" +#include "vx_binary_data.h" + +#define T int32_t +#define NAME ne + +DEF_VX_BINARY_CASE_0_WRAP(T, !=, NAME) + +#define TEST_DATA TEST_BINARY_DATA_WRAP(T, NAME) +#define TEST_RUN(T, NAME, out, in, x, n) RUN_VX_BINARY_CASE_0_WRAP(T, NAME, out, in, x, n) + +#include "vx_binary_run.h" diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsne-run-1-i64.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsne-run-1-i64.c new file mode 100644 index 0000000..fbe8113 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsne-run-1-i64.c @@ -0,0 +1,15 @@ +/* { dg-do run { target { riscv_v } } } */ +/* { dg-additional-options "-std=c99 --param=gpr2vr-cost=0" } */ + +#include "vx_binary.h" +#include "vx_binary_data.h" + +#define T int64_t +#define NAME ne + +DEF_VX_BINARY_CASE_0_WRAP(T, !=, NAME) + +#define TEST_DATA TEST_BINARY_DATA_WRAP(T, NAME) +#define TEST_RUN(T, NAME, out, in, x, n) RUN_VX_BINARY_CASE_0_WRAP(T, NAME, out, in, x, n) + +#include "vx_binary_run.h" diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsne-run-1-i8.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsne-run-1-i8.c new file mode 100644 index 0000000..58cdf6d --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsne-run-1-i8.c @@ -0,0 +1,15 @@ +/* { dg-do run { target { riscv_v } } } */ +/* { dg-additional-options "-std=c99 --param=gpr2vr-cost=0" } */ + +#include "vx_binary.h" +#include "vx_binary_data.h" + +#define T int8_t +#define NAME ne + +DEF_VX_BINARY_CASE_0_WRAP(T, !=, NAME) + +#define TEST_DATA TEST_BINARY_DATA_WRAP(T, NAME) +#define TEST_RUN(T, NAME, out, in, x, n) RUN_VX_BINARY_CASE_0_WRAP(T, NAME, out, in, x, n) + +#include "vx_binary_run.h" diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsne-run-1-u16.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsne-run-1-u16.c new file mode 100644 index 0000000..5976490 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsne-run-1-u16.c @@ -0,0 +1,15 @@ +/* { dg-do run { target { riscv_v } } } */ +/* { dg-additional-options "-std=c99 --param=gpr2vr-cost=0" } */ + +#include "vx_binary.h" +#include "vx_binary_data.h" + +#define T uint16_t +#define NAME ne + +DEF_VX_BINARY_CASE_0_WRAP(T, !=, NAME) + +#define TEST_DATA TEST_BINARY_DATA_WRAP(T, NAME) +#define TEST_RUN(T, NAME, out, in, x, n) RUN_VX_BINARY_CASE_0_WRAP(T, NAME, out, in, x, n) + +#include "vx_binary_run.h" diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsne-run-1-u32.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsne-run-1-u32.c new file mode 100644 index 0000000..c2fbe05 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsne-run-1-u32.c @@ -0,0 +1,15 @@ +/* { dg-do run { target { riscv_v } } } */ +/* { dg-additional-options "-std=c99 --param=gpr2vr-cost=0" } */ + +#include "vx_binary.h" +#include "vx_binary_data.h" + +#define T uint32_t +#define NAME ne + +DEF_VX_BINARY_CASE_0_WRAP(T, !=, NAME) + +#define TEST_DATA TEST_BINARY_DATA_WRAP(T, NAME) +#define TEST_RUN(T, NAME, out, in, x, n) RUN_VX_BINARY_CASE_0_WRAP(T, NAME, out, in, x, n) + +#include "vx_binary_run.h" diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsne-run-1-u64.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsne-run-1-u64.c new file mode 100644 index 0000000..3431ed6 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsne-run-1-u64.c @@ -0,0 +1,15 @@ +/* { dg-do run { target { riscv_v } } } */ +/* { dg-additional-options "-std=c99 --param=gpr2vr-cost=0" } */ + +#include "vx_binary.h" +#include "vx_binary_data.h" + +#define T uint64_t +#define NAME ne + +DEF_VX_BINARY_CASE_0_WRAP(T, !=, NAME) + +#define TEST_DATA TEST_BINARY_DATA_WRAP(T, NAME) +#define TEST_RUN(T, NAME, out, in, x, n) RUN_VX_BINARY_CASE_0_WRAP(T, NAME, out, in, x, n) + +#include "vx_binary_run.h" diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsne-run-1-u8.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsne-run-1-u8.c new file mode 100644 index 0000000..9ccebe5 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vmsne-run-1-u8.c @@ -0,0 +1,15 @@ +/* { dg-do run { target { riscv_v } } } */ +/* { dg-additional-options "-std=c99 --param=gpr2vr-cost=0" } */ + +#include "vx_binary.h" +#include "vx_binary_data.h" + +#define T uint8_t +#define NAME ne + +DEF_VX_BINARY_CASE_0_WRAP(T, !=, NAME) + +#define TEST_DATA TEST_BINARY_DATA_WRAP(T, NAME) +#define TEST_RUN(T, NAME, out, in, x, n) RUN_VX_BINARY_CASE_0_WRAP(T, NAME, out, in, x, n) + +#include "vx_binary_run.h" diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vwmaccu-run-1-u64.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vwmaccu-run-1-u64.c new file mode 100644 index 0000000..c058141 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_vwmaccu-run-1-u64.c @@ -0,0 +1,18 @@ +/* { dg-do run { target { riscv_v } } } */ +/* { dg-additional-options "-std=c99 --param=gpr2vr-cost=0" } */ + +#include "vx_widen.h" +#include "vx_widen_data.h" + +#define WT uint64_t +#define NT uint32_t +#define NAME wmacc +#define TEST_DATA DEF_BINARY_WIDEN_STRUCT_0_VAR_WRAP(WT, NT, NAME) +#define DATA_TYPE DEF_BINARY_WIDEN_STRUCT_0_TYPE_WRAP(WT, NT, NAME) + +DEF_VX_WIDEN_TERNARY_CASE_0_WRAP(WT, NT, +, *, NAME) + +#define TEST_RUN(WT, NT, NAME, vd, vs2, rs1, N) \ + RUN_VX_WIDEN_TERNARY_CASE_0_WRAP(WT, NT, NAME, vd, vs2, rs1, N) + +#include "vx_widen_vx_run.h" diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_widen.h b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_widen.h index 5be5f2d..cd73a1b 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_widen.h +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_widen.h @@ -45,6 +45,24 @@ test_vx_widen_binary_##NAME##_##WT##_##NT##_case_1 (WT * restrict vd, \ #define RUN_VX_WIDEN_BINARY_CASE_1_WRAP(WT, NT, NAME, vd, vs2, rs1, n) \ RUN_VX_WIDEN_BINARY_CASE_1(WT, NT, NAME, vd, vs2, rs1, n) +#define DEF_VX_WIDEN_TERNARY_CASE_0(WT, NT, OP1, OP2, NAME) \ +void \ +test_vx_widen_ternary_##NAME##_##WT##_##NT##_case_0 (WT * restrict vd, \ + NT * restrict vs2, \ + NT rs1, \ + unsigned n) \ +{ \ + for (unsigned i = 0; i < n; i++) \ + vd[i] = vd[i] OP1 (WT)vs2[i] OP2 (WT)rs1; \ +} + +#define DEF_VX_WIDEN_TERNARY_CASE_0_WRAP(WT, NT, OP1, OP2, NAME) \ + DEF_VX_WIDEN_TERNARY_CASE_0(WT, NT, OP1, OP2, NAME) +#define RUN_VX_WIDEN_TERNARY_CASE_0(WT, NT, NAME, vd, vs2, rs1, n) \ + test_vx_widen_ternary_##NAME##_##WT##_##NT##_case_0(vd, vs2, rs1, n) +#define RUN_VX_WIDEN_TERNARY_CASE_0_WRAP(WT, NT, NAME, vd, vs2, rs1, n) \ + RUN_VX_WIDEN_TERNARY_CASE_0(WT, NT, NAME, vd, vs2, rs1, n) + #define TEST_WIDEN_BINARY_VX_UNSIGNED(WT, NT) \ DEF_VX_WIDEN_BINARY_CASE_0_WRAP(WT, NT, +, add) \ DEF_VX_WIDEN_BINARY_CASE_0_WRAP(WT, NT, -, sub) \ @@ -52,4 +70,7 @@ test_vx_widen_binary_##NAME##_##WT##_##NT##_case_1 (WT * restrict vd, \ DEF_VX_WIDEN_BINARY_CASE_1_WRAP(WT, NT, +, add) \ DEF_VX_WIDEN_BINARY_CASE_1_WRAP(WT, NT, -, sub) \ +#define TEST_WIDEN_TERNARY_VX_UNSIGNED(WT, NT) \ + DEF_VX_WIDEN_TERNARY_CASE_0_WRAP(WT, NT, +, *, wmadd) + #endif diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_widen_data.h b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_widen_data.h index af7d835..9b2460f 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_widen_data.h +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vx_vf/vx_widen_data.h @@ -59,6 +59,7 @@ DEF_BINARY_WIDEN_STRUCT_0_WRAP(uint64_t, uint32_t, add) DEF_BINARY_WIDEN_STRUCT_0_WRAP(uint64_t, uint32_t, sub) DEF_BINARY_WIDEN_STRUCT_0_WRAP(uint64_t, uint32_t, mul) +DEF_BINARY_WIDEN_STRUCT_0_WRAP(uint64_t, uint32_t, wmacc) #define DEF_BINARY_WIDEN_STRUCT_1(WT, NT, NAME) \ DEF_BINARY_WIDEN_STRUCT_1_TYPE_WRAP(WT, NT, NAME) \ @@ -269,4 +270,57 @@ DEF_BINARY_WIDEN_STRUCT_1_DECL_WRAP(uint64_t, uint32_t, sub)[] = { }, }; +DEF_BINARY_WIDEN_STRUCT_0_DECL_WRAP(uint64_t, uint32_t, wmacc)[] = { + { + /* vs2 NT */ + { + 3, 3, 3, 3, + 7, 7, 7, 7, + 9, 9, 9, 9, + 5, 5, 5, 5, + }, + /* rs1 NT */ + 1, + /* expect WT */ + { + 4, 4, 4, 4, + 9, 9, 9, 9, + 17, 17, 17, 17, + 5, 5, 5, 5, + }, + /* vd WT */ + { + 1, 1, 1, 1, + 2, 2, 2, 2, + 8, 8, 8, 8, + 0, 0, 0, 0, + }, + }, + { + /* vs2 NT */ + { + 4294967295ull, 4294967295ull, 4294967295ull, 4294967295ull, + 4294967294ull, 4294967294ull, 4294967294ull, 4294967294ull, + 4294967293ull, 4294967293ull, 4294967293ull, 4294967293ull, + 4294967292ull, 4294967292ull, 4294967292ull, 4294967292ull, + }, + /* rs1 NT */ + 2, + /* expect WT */ + { + 8589934591ull, 8589934591ull, 8589934591ull, 8589934591ull, + 8589934590ull, 8589934590ull, 8589934590ull, 8589934590ull, + 8589934589ull, 8589934589ull, 8589934589ull, 8589934589ull, + 8589934584ull, 8589934584ull, 8589934584ull, 8589934584ull, + }, + /* vd WT */ + { + 1, 1, 1, 1, + 2, 2, 2, 2, + 3, 3, 3, 3, + 0, 0, 0, 0, + }, + }, +}; + #endif diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/pr119115.c b/gcc/testsuite/gcc.target/riscv/rvv/base/pr119115.c index ac8a70e..524201c 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/base/pr119115.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/pr119115.c @@ -1,7 +1,7 @@ /* { dg-do run } */ /* { dg-require-effective-target rv64 } */ /* { dg-require-effective-target rvv_zvl256b_ok } */ -/* { dg-additional-options "-march=rv64gcv_zvl256b -mabi=lp64d -O3 -fsigned-char -fwrapv -mrvv-vector-bits=zvl" } */ +/* { dg-additional-options "-march=rv64gcv_zvl256b -mabi=lp64d -O3 -fsigned-char -fwrapv -mrvv-vector-bits=zvl -std=gnu99" } */ short a[4][14][14]; void diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/pr122652.c b/gcc/testsuite/gcc.target/riscv/rvv/base/pr122652.c new file mode 100644 index 0000000..bd8f1b4 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/pr122652.c @@ -0,0 +1,22 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=rv64gcv -mabi=lp64d" } */ + +#include "riscv_vector.h" + +int a; +int b(); + +int c() { + if (b()) + a = 0; +} + +void d() { + for (; c() + d;) { + long e, h; + char *f; + __rvv_uint16mf4_t g; + __rvv_uint8mf8x3_t i = __riscv_vlseg3e8ff_v_u8mf8x3(f, &h, e); + __riscv_vsoxseg3ei16_v_u8mf8x3(0, g, i, 0); + } +} diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/pr122656-1.c b/gcc/testsuite/gcc.target/riscv/rvv/base/pr122656-1.c new file mode 100644 index 0000000..76adbed --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/pr122656-1.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv -mabi=lp64d" } */ + +#include "riscv_vector.h" +int a; +long b, c; +void d() { __riscv_vlseg2e32ff_v_i32mf2x2(&a, &c, b); } /* { dg-error "invalid argument to built-in function" } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/pr122656-2.c b/gcc/testsuite/gcc.target/riscv/rvv/base/pr122656-2.c new file mode 100644 index 0000000..395dc7f --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/pr122656-2.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv -mabi=lp64d" } */ + +#include "riscv_vector.h" +int a; +long b, c; +void d() { vint32mf2x2_t v = __riscv_vlseg2e32ff_v_i32mf2x2(&a, &c, b); } diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/avl_single-37.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/avl_single-37.c index 9bade06..d3d0c5a 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/avl_single-37.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/avl_single-37.c @@ -26,4 +26,3 @@ void f (int8_t * restrict in, int8_t * restrict out, int n, int m, unsigned cond /* { dg-final { scan-assembler-times {vsetvli\s+zero,\s*[a-x0-9]+,\s*e32,\s*mf2,\s*tu,\s*mu} 2 { target { no-opts "-O0" no-opts "-O1" no-opts "-g" no-opts "-funroll-loops" } } } } */ /* { dg-final { scan-assembler-times {vsetvli} 3 { target { no-opts "-O0" no-opts "-g" no-opts "-funroll-loops" } } } } */ -/* { dg-final { scan-assembler-times {\.L[0-9]+\:\s+addi\s+\s*[a-x0-9]+,\s*[a-x0-9]+,\s*[0-9]00\s+addi\s+\s*[a-x0-9]+,\s*[a-x0-9]+,\s*[0-9]00\s+addi\s+\s*[a-x0-9]+,\s*[a-x0-9]+,\s*[0-9]00\s+add\s+\s*[a-x0-9]+,\s*[a-x0-9]+,\s*[a-x0-9]+\s+\.L[0-9]+\:} 1 { target { no-opts "-O0" no-opts "-O1" no-opts "-g" no-opts "-funroll-loops" } } } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-1.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-1.c index 723a1c6..7bbd802 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-1.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-1.c @@ -34,4 +34,3 @@ void f (void * restrict in, void * restrict out, int n, int cond) } /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e8,\s*mf8,\s*t[au],\s*m[au]} 4 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ -/* { dg-final { scan-assembler-times {ble\t[a-x0-9]+,zero,\.L[0-9]+\s*\.L[0-9]+\:\s*vle8\.v\s+v[0-9]+,0\([a-x0-9]+\)} 1 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-10.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-10.c index f2dab3a..efa6216 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-10.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-10.c @@ -34,4 +34,3 @@ void f (void * restrict in, void * restrict out, int n, int cond) } /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e16,\s*mf2,\s*t[au],\s*m[au]} 4 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ -/* { dg-final { scan-assembler-times {ble\t[a-x0-9]+,zero,.L[0-9]+\s*\.L[0-9]+\:\s*vle16\.v\s+v[0-9]+,0\([a-x0-9]+\)} 1 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-11.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-11.c index 94fb31f..459b3f0 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-11.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-11.c @@ -34,4 +34,3 @@ void f (void * restrict in, void * restrict out, int n, int cond) } /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e32,\s*mf2,\s*t[au],\s*m[au]} 4 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ -/* { dg-final { scan-assembler-times {ble\t[a-x0-9]+,zero,.L[0-9]+\s*\.L[0-9]+\:\s*vle32\.v\s+v[0-9]+,0\([a-x0-9]+\)} 1 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-12.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-12.c index 1805bcd..7cad984 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-12.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-12.c @@ -34,4 +34,3 @@ void f (void * restrict in, void * restrict out, int n, int cond) } /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e32,\s*mf2,\s*t[au],\s*m[au]} 4 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ -/* { dg-final { scan-assembler-times {ble\t[a-x0-9]+,zero,.L[0-9]+\s*\.L[0-9]+\:\s*vle32\.v\s+v[0-9]+,0\([a-x0-9]+\)} 1 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-13.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-13.c index 68d0af7..ada64d9 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-13.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-13.c @@ -34,4 +34,3 @@ void f (void * restrict in, void * restrict out, int n, int cond) } /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e32,\s*mf2,\s*t[au],\s*m[au]} 4 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ -/* { dg-final { scan-assembler-times {ble\t[a-x0-9]+,zero,.L[0-9]+\s*\.L[0-9]+\:\s*vle32\.v\s+v[0-9]+,0\([a-x0-9]+\)} 1 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-14.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-14.c index 89c785e..a7b40e6 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-14.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-14.c @@ -214,4 +214,3 @@ void f7 (void * restrict in, void * restrict out, int n, int cond) /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e8,\s*m2,\s*t[au],\s*m[au]} 4 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e8,\s*m4,\s*t[au],\s*m[au]} 4 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e8,\s*m8,\s*t[au],\s*m[au]} 4 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ -/* { dg-final { scan-assembler-times {ble\t[a-x0-9]+,zero,.L[0-9]+\s+\.L[0-9]+\:\s+vlm\.v\s+v[0-9]+,0\([a-x0-9]+\)} 7 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-15.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-15.c index af4ba3c..2439c5e 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-15.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-15.c @@ -37,4 +37,3 @@ void f (void * restrict in, void * restrict out, int n, int cond) } /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e8,\s*mf8,\s*t[au],\s*m[au]} 4 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ -/* { dg-final { scan-assembler-times {ble\t[a-x0-9]+,zero,.L[0-9]+\s*\.L[0-9]+\:\s*vle8\.v\s+v[0-9]+,0\([a-x0-9]+\)} 1 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-16.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-16.c index a081dda..3f30b15 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-16.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-16.c @@ -37,4 +37,3 @@ void f (void * restrict in, void * restrict out, int n, int cond) } /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e8,\s*mf8,\s*t[au],\s*m[au]} 4 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ -/* { dg-final { scan-assembler-times {ble\t[a-x0-9]+,zero,.L[0-9]+\s*\.L[0-9]+\:\s*vle8\.v\s+v[0-9]+,0\([a-x0-9]+\)} 1 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-17.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-17.c index e27c76c..9492510 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-17.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-17.c @@ -37,4 +37,3 @@ void f (void * restrict in, void * restrict out, int n, int cond) } /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e8,\s*mf4,\s*t[au],\s*m[au]} 4 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ -/* { dg-final { scan-assembler-times {ble\t[a-x0-9]+,zero,.L[0-9]+\s*\.L[0-9]+\:\s*vle8\.v\s+v[0-9]+,0\([a-x0-9]+\)} 1 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-18.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-18.c index 16c8fd9..00b5ac3 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-18.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-18.c @@ -37,4 +37,3 @@ void f (void * restrict in, void * restrict out, int n, int cond) } /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e8,\s*mf4,\s*t[au],\s*m[au]} 4 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ -/* { dg-final { scan-assembler-times {ble\t[a-x0-9]+,zero,.L[0-9]+\s*\.L[0-9]+\:\s*vle8\.v\s+v[0-9]+,0\([a-x0-9]+\)} 1 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-19.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-19.c index af0df89..7f7c520 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-19.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-19.c @@ -37,4 +37,3 @@ void f (void * restrict in, void * restrict out, int n, int cond) } /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e8,\s*mf2,\s*t[au],\s*m[au]} 4 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ -/* { dg-final { scan-assembler-times {ble\t[a-x0-9]+,zero,.L[0-9]+\s+\.L[0-9]+\:\s+vle8\.v\s+v[0-9]+,0\([a-x0-9]+\)} 1 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-2.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-2.c index 69c6423..d5c74af 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-2.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-2.c @@ -34,4 +34,3 @@ void f (void * restrict in, void * restrict out, int n, int cond) } /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e8,\s*mf8,\s*t[au],\s*m[au]} 4 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ -/* { dg-final { scan-assembler-times {ble\t[a-x0-9]+,zero,.L[0-9]+\s*\.L[0-9]+\:\s*vle8\.v\s+v[0-9]+,0\([a-x0-9]+\)} 1 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-20.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-20.c index 78d8e9d..2d93e28 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-20.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-20.c @@ -37,4 +37,3 @@ void f (void * restrict in, void * restrict out, int n, int cond) } /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e8,\s*mf2,\s*t[au],\s*m[au]} 4 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ -/* { dg-final { scan-assembler-times {ble\t[a-x0-9]+,zero,.L[0-9]+\s+\.L[0-9]+\:\s+vle8\.v\s+v[0-9]+,0\([a-x0-9]+\)} 1 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-21.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-21.c index 993e420..ce187af 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-21.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-21.c @@ -37,4 +37,3 @@ void f (void * restrict in, void * restrict out, int n, int cond) } /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e16,\s*mf4,\s*t[au],\s*m[au]} 4 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ -/* { dg-final { scan-assembler-times {ble\t[a-x0-9]+,zero,.L[0-9]+\s+\.L[0-9]+\:\s+vle16\.v\s+v[0-9]+,0\([a-x0-9]+\)} 1 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-22.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-22.c index d1547c9..d79be09 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-22.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-22.c @@ -37,4 +37,3 @@ void f (void * restrict in, void * restrict out, int n, int cond) } /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e16,\s*mf4,\s*t[au],\s*m[au]} 4 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ -/* { dg-final { scan-assembler-times {ble\t[a-x0-9]+,zero,.L[0-9]+\s*\.L[0-9]+\:\s*vle16\.v\s+v[0-9]+,0\([a-x0-9]+\)} 1 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-23.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-23.c index 836619f..6d2cf5b 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-23.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-23.c @@ -37,4 +37,3 @@ void f (void * restrict in, void * restrict out, int n, int cond) } /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e16,\s*mf2,\s*t[au],\s*m[au]} 4 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ -/* { dg-final { scan-assembler-times {ble\t[a-x0-9]+,zero,.L[0-9]+\s*\.L[0-9]+\:\s*vle16\.v\s+v[0-9]+,0\([a-x0-9]+\)} 1 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-24.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-24.c index e61bb9c..b2e1d88 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-24.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-24.c @@ -37,4 +37,3 @@ void f (void * restrict in, void * restrict out, int n, int cond) } /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e16,\s*mf2,\s*t[au],\s*m[au]} 4 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ -/* { dg-final { scan-assembler-times {ble\t[a-x0-9]+,zero,.L[0-9]+\s*\.L[0-9]+\:\s*vle16\.v\s+v[0-9]+,0\([a-x0-9]+\)} 1 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-25.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-25.c index b4b4c66..af8f762 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-25.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-25.c @@ -37,4 +37,3 @@ void f (void * restrict in, void * restrict out, int n, int cond) } /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e32,\s*mf2,\s*t[au],\s*m[au]} 4 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ -/* { dg-final { scan-assembler-times {ble\t[a-x0-9]+,zero,.L[0-9]+\s*\.L[0-9]+\:\s*vle32\.v\s+v[0-9]+,0\([a-x0-9]+\)} 1 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-26.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-26.c index 0910b0c..f47a332 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-26.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-26.c @@ -37,4 +37,3 @@ void f (void * restrict in, void * restrict out, int n, int cond) } /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e32,\s*mf2,\s*t[au],\s*m[au]} 4 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ -/* { dg-final { scan-assembler-times {ble\t[a-x0-9]+,zero,.L[0-9]+\s*\.L[0-9]+\:\s*vle32\.v\s+v[0-9]+,0\([a-x0-9]+\)} 1 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-27.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-27.c index 661e5c0..fc9e8d5 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-27.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-27.c @@ -37,4 +37,3 @@ void f (void * restrict in, void * restrict out, int n, int cond) } /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e32,\s*mf2,\s*t[au],\s*m[au]} 4 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ -/* { dg-final { scan-assembler-times {ble\t[a-x0-9]+,zero,.L[0-9]+\s*\.L[0-9]+\:\s*vle32\.v\s+v[0-9]+,0\([a-x0-9]+\)} 1 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-28.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-28.c index 8cbbfab..8f91736a 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-28.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-28.c @@ -234,4 +234,3 @@ void f7 (void * restrict in, void * restrict out, int n, int cond) /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e8,\s*m2,\s*t[au],\s*m[au]} 4 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e8,\s*m4,\s*t[au],\s*m[au]} 4 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e8,\s*m8,\s*t[au],\s*m[au]} 4 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ -/* { dg-final { scan-assembler-times {ble\t[a-x0-9]+,zero,.L[0-9]+\s*\.L[0-9]+\:\s*vlm\.v\s*v[0-9]+,0\([a-x0-9]+\)} 7 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-3.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-3.c index 10df345..82a40c8 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-3.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-3.c @@ -34,4 +34,3 @@ void f (void * restrict in, void * restrict out, int n, int cond) } /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e8,\s*mf4,\s*t[au],\s*m[au]} 4 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ -/* { dg-final { scan-assembler-times {ble\t[a-x0-9]+,zero,.L[0-9]+\s*\.L[0-9]+\:\s*vle8\.v\s+v[0-9]+,0\([a-x0-9]+\)} 1 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-4.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-4.c index fb7197a..9069fc5 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-4.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-4.c @@ -34,4 +34,3 @@ void f (void * restrict in, void * restrict out, int n, int cond) } /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e8,\s*mf4,\s*t[au],\s*m[au]} 4 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ -/* { dg-final { scan-assembler-times {ble\t[a-x0-9]+,zero,.L[0-9]+\s*\.L[0-9]+\:\s*vle8\.v\s+v[0-9]+,0\([a-x0-9]+\)} 1 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-5.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-5.c index 6683374..e736e1c 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-5.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-5.c @@ -34,4 +34,3 @@ void f (void * restrict in, void * restrict out, int n, int cond) } /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e8,\s*mf2,\s*t[au],\s*m[au]} 4 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ -/* { dg-final { scan-assembler-times {ble\t[a-x0-9]+,zero,.L[0-9]+\s*\.L[0-9]+\:\s*vle8\.v\s+v[0-9]+,0\([a-x0-9]+\)} 1 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-6.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-6.c index 7066d77..1b09a23 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-6.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-6.c @@ -34,4 +34,3 @@ void f (void * restrict in, void * restrict out, int n, int cond) } /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e8,\s*mf2,\s*t[au],\s*m[au]} 4 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ -/* { dg-final { scan-assembler-times {ble\t[a-x0-9]+,zero,.L[0-9]+\s*\.L[0-9]+\:\s*vle8\.v\s+v[0-9]+,0\([a-x0-9]+\)} 1 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-7.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-7.c index 4528900..1f75a6a 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-7.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-7.c @@ -34,4 +34,3 @@ void f (void * restrict in, void * restrict out, int n, int cond) } /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e16,\s*mf4,\s*t[au],\s*m[au]} 4 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ -/* { dg-final { scan-assembler-times {ble\t[a-x0-9]+,zero,.L[0-9]+\s*\.L[0-9]+\:\s*vle16\.v\s+v[0-9]+,0\([a-x0-9]+\)} 1 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-8.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-8.c index 4d1acf9..00aba0a 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-8.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-8.c @@ -34,4 +34,3 @@ void f (void * restrict in, void * restrict out, int n, int cond) } /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e16,\s*mf4,\s*t[au],\s*m[au]} 4 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ -/* { dg-final { scan-assembler-times {ble\t[a-x0-9]+,zero,.L[0-9]+\s*\.L[0-9]+\:\s*vle16\.v\s+v[0-9]+,0\([a-x0-9]+\)} 1 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-9.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-9.c index 5bfc659..59feeef 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-9.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_phi-9.c @@ -34,4 +34,3 @@ void f (void * restrict in, void * restrict out, int n, int cond) } /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e16,\s*mf2,\s*t[au],\s*m[au]} 4 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ -/* { dg-final { scan-assembler-times {ble\t[a-x0-9]+,zero,.L[0-9]+\s*\.L[0-9]+\:\s*vle16\.v\s+v[0-9]+,0\([a-x0-9]+\)} 1 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */ diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_arith.h b/gcc/testsuite/gcc.target/riscv/sat/sat_arith.h index e1748a6..f094d4d 100644 --- a/gcc/testsuite/gcc.target/riscv/sat/sat_arith.h +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_arith.h @@ -770,4 +770,19 @@ sat_u_mul_##NT##_from_##WT##_fmt_6 (NT a, NT b) \ sat_u_mul_##NT##_from_##WT##_fmt_6 (a, b) #define RUN_SAT_U_MUL_FMT_6_WRAP(NT, WT, a, b) RUN_SAT_U_MUL_FMT_6(NT, WT, a, b) +#define DEF_SAT_U_MUL_FMT_7(NT, WT) \ +NT __attribute__((noinline)) \ +sat_u_mul_##NT##_from_##WT##_fmt_7 (NT a, NT b) \ +{ \ + WT x = (WT)a * (WT)b; \ + NT max = -1; \ + bool overflow_p = x > (WT)(max); \ + return -(NT)(overflow_p) | (NT)x; \ +} + +#define DEF_SAT_U_MUL_FMT_7_WRAP(NT, WT) DEF_SAT_U_MUL_FMT_7(NT, WT) +#define RUN_SAT_U_MUL_FMT_7(NT, WT, a, b) \ + sat_u_mul_##NT##_from_##WT##_fmt_7 (a, b) +#define RUN_SAT_U_MUL_FMT_7_WRAP(NT, WT, a, b) RUN_SAT_U_MUL_FMT_7(NT, WT, a, b) + #endif diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-8-u16-from-u128.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-8-u16-from-u128.c new file mode 100644 index 0000000..c392c77 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-8-u16-from-u128.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gc -mabi=lp64d -fdump-tree-optimized" } */ + +#include "sat_arith.h" + +#define NT uint16_t +#define WT uint128_t + +DEF_SAT_U_MUL_FMT_7_WRAP(NT, WT) + +/* { dg-final { scan-tree-dump-times ".SAT_MUL" 1 "optimized" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-8-u16-from-u32.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-8-u16-from-u32.c new file mode 100644 index 0000000..7fab313 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-8-u16-from-u32.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gc -mabi=lp64d -fdump-tree-optimized" } */ + +#include "sat_arith.h" + +#define NT uint16_t +#define WT uint32_t + +DEF_SAT_U_MUL_FMT_7_WRAP(NT, WT) + +/* { dg-final { scan-tree-dump-times ".SAT_MUL" 1 "optimized" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-8-u16-from-u64.rv32.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-8-u16-from-u64.rv32.c new file mode 100644 index 0000000..44939a5 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-8-u16-from-u64.rv32.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gc -mabi=ilp32 -fdump-tree-optimized" } */ + +#include "sat_arith.h" + +#define NT uint16_t +#define WT uint64_t + +DEF_SAT_U_MUL_FMT_7_WRAP(NT, WT) + +/* { dg-final { scan-tree-dump-times ".SAT_MUL" 1 "optimized" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-8-u16-from-u64.rv64.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-8-u16-from-u64.rv64.c new file mode 100644 index 0000000..4607d45 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-8-u16-from-u64.rv64.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gc -mabi=lp64d -fdump-tree-optimized" } */ + +#include "sat_arith.h" + +#define NT uint16_t +#define WT uint64_t + +DEF_SAT_U_MUL_FMT_7_WRAP(NT, WT) + +/* { dg-final { scan-tree-dump-times ".SAT_MUL" 1 "optimized" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-8-u32-from-u128.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-8-u32-from-u128.c new file mode 100644 index 0000000..18e0ffb --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-8-u32-from-u128.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gc -mabi=lp64d -fdump-tree-optimized" } */ + +#include "sat_arith.h" + +#define NT uint32_t +#define WT uint128_t + +DEF_SAT_U_MUL_FMT_7_WRAP(NT, WT) + +/* { dg-final { scan-tree-dump-times ".SAT_MUL" 1 "optimized" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-8-u32-from-u64.rv32.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-8-u32-from-u64.rv32.c new file mode 100644 index 0000000..5786ec4 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-8-u32-from-u64.rv32.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gc -mabi=ilp32 -fdump-tree-optimized" } */ + +#include "sat_arith.h" + +#define NT uint32_t +#define WT uint64_t + +DEF_SAT_U_MUL_FMT_7_WRAP(NT, WT) + +/* { dg-final { scan-tree-dump-times ".SAT_MUL" 1 "optimized" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-8-u32-from-u64.rv64.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-8-u32-from-u64.rv64.c new file mode 100644 index 0000000..9d24001 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-8-u32-from-u64.rv64.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gc -mabi=lp64d -fdump-tree-optimized" } */ + +#include "sat_arith.h" + +#define NT uint32_t +#define WT uint64_t + +DEF_SAT_U_MUL_FMT_7_WRAP(NT, WT) + +/* { dg-final { scan-tree-dump-times ".SAT_MUL" 1 "optimized" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-8-u64-from-u128.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-8-u64-from-u128.c new file mode 100644 index 0000000..93af214 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-8-u64-from-u128.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gc -mabi=lp64d -fdump-tree-optimized" } */ + +#include "sat_arith.h" + +#define NT uint64_t +#define WT uint128_t + +DEF_SAT_U_MUL_FMT_7_WRAP(NT, WT) + +/* { dg-final { scan-tree-dump-times ".SAT_MUL" 1 "optimized" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-8-u8-from-u128.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-8-u8-from-u128.c new file mode 100644 index 0000000..5d1866b --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-8-u8-from-u128.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gc -mabi=lp64d -fdump-tree-optimized" } */ + +#include "sat_arith.h" + +#define NT uint8_t +#define WT uint128_t + +DEF_SAT_U_MUL_FMT_7_WRAP(NT, WT) + +/* { dg-final { scan-tree-dump-times ".SAT_MUL" 1 "optimized" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-8-u8-from-u16.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-8-u8-from-u16.c new file mode 100644 index 0000000..b09706c --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-8-u8-from-u16.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gc -mabi=lp64d -fdump-tree-optimized" } */ + +#include "sat_arith.h" + +#define NT uint8_t +#define WT uint16_t + +DEF_SAT_U_MUL_FMT_7_WRAP(NT, WT) + +/* { dg-final { scan-tree-dump-times ".SAT_MUL" 1 "optimized" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-8-u8-from-u32.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-8-u8-from-u32.c new file mode 100644 index 0000000..99bad87 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-8-u8-from-u32.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gc -mabi=lp64d -fdump-tree-optimized" } */ + +#include "sat_arith.h" + +#define NT uint8_t +#define WT uint32_t + +DEF_SAT_U_MUL_FMT_7_WRAP(NT, WT) + +/* { dg-final { scan-tree-dump-times ".SAT_MUL" 1 "optimized" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-8-u8-from-u64.rv32.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-8-u8-from-u64.rv32.c new file mode 100644 index 0000000..4ff227b --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-8-u8-from-u64.rv32.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gc -mabi=ilp32 -fdump-tree-optimized" } */ + +#include "sat_arith.h" + +#define NT uint8_t +#define WT uint64_t + +DEF_SAT_U_MUL_FMT_7_WRAP(NT, WT) + +/* { dg-final { scan-tree-dump-times ".SAT_MUL" 1 "optimized" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-8-u8-from-u64.rv64.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-8-u8-from-u64.rv64.c new file mode 100644 index 0000000..33783f6 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-8-u8-from-u64.rv64.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gc -mabi=lp64d -fdump-tree-optimized" } */ + +#include "sat_arith.h" + +#define NT uint8_t +#define WT uint64_t + +DEF_SAT_U_MUL_FMT_7_WRAP(NT, WT) + +/* { dg-final { scan-tree-dump-times ".SAT_MUL" 1 "optimized" } } */ diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-8-u16-from-u128.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-8-u16-from-u128.c new file mode 100644 index 0000000..fb2a3f3 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-8-u16-from-u128.c @@ -0,0 +1,16 @@ +/* { dg-do run { target { rv64 } } } */ +/* { dg-additional-options "-std=c99" } */ + +#include "sat_arith.h" +#include "sat_arith_data.h" + +#define NT uint8_t +#define WT uint128_t +#define NAME usmul +#define DATA TEST_BINARY_DATA_WRAP(NT, NAME) +#define T TEST_BINARY_STRUCT_DECL_WRAP(NT, NAME) +#define RUN_BINARY(x, y) RUN_SAT_U_MUL_FMT_7_WRAP(NT, WT, x, y) + +DEF_SAT_U_MUL_FMT_7_WRAP(NT, WT) + +#include "scalar_sat_binary_run_xxx.h" diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-8-u16-from-u32.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-8-u16-from-u32.c new file mode 100644 index 0000000..3039893 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-8-u16-from-u32.c @@ -0,0 +1,16 @@ +/* { dg-do run { target { rv32 || rv64 } } } */ +/* { dg-additional-options "-std=c99" } */ + +#include "sat_arith.h" +#include "sat_arith_data.h" + +#define NT uint16_t +#define WT uint32_t +#define NAME usmul +#define DATA TEST_BINARY_DATA_WRAP(NT, NAME) +#define T TEST_BINARY_STRUCT_DECL_WRAP(NT, NAME) +#define RUN_BINARY(x, y) RUN_SAT_U_MUL_FMT_7_WRAP(NT, WT, x, y) + +DEF_SAT_U_MUL_FMT_7_WRAP(NT, WT) + +#include "scalar_sat_binary_run_xxx.h" diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-8-u16-from-u64.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-8-u16-from-u64.c new file mode 100644 index 0000000..4a26af2 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-8-u16-from-u64.c @@ -0,0 +1,16 @@ +/* { dg-do run { target { rv32 || rv64 } } } */ +/* { dg-additional-options "-std=c99" } */ + +#include "sat_arith.h" +#include "sat_arith_data.h" + +#define NT uint16_t +#define WT uint64_t +#define NAME usmul +#define DATA TEST_BINARY_DATA_WRAP(NT, NAME) +#define T TEST_BINARY_STRUCT_DECL_WRAP(NT, NAME) +#define RUN_BINARY(x, y) RUN_SAT_U_MUL_FMT_7_WRAP(NT, WT, x, y) + +DEF_SAT_U_MUL_FMT_7_WRAP(NT, WT) + +#include "scalar_sat_binary_run_xxx.h" diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-8-u32-from-u128.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-8-u32-from-u128.c new file mode 100644 index 0000000..f1fb94a --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-8-u32-from-u128.c @@ -0,0 +1,16 @@ +/* { dg-do run { target { rv64 } } } */ +/* { dg-additional-options "-std=c99" } */ + +#include "sat_arith.h" +#include "sat_arith_data.h" + +#define NT uint32_t +#define WT uint128_t +#define NAME usmul +#define DATA TEST_BINARY_DATA_WRAP(NT, NAME) +#define T TEST_BINARY_STRUCT_DECL_WRAP(NT, NAME) +#define RUN_BINARY(x, y) RUN_SAT_U_MUL_FMT_7_WRAP(NT, WT, x, y) + +DEF_SAT_U_MUL_FMT_7_WRAP(NT, WT) + +#include "scalar_sat_binary_run_xxx.h" diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-8-u32-from-u64.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-8-u32-from-u64.c new file mode 100644 index 0000000..7ef6f3c --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-8-u32-from-u64.c @@ -0,0 +1,16 @@ +/* { dg-do run { target { rv32 || rv64 } } } */ +/* { dg-additional-options "-std=c99" } */ + +#include "sat_arith.h" +#include "sat_arith_data.h" + +#define NT uint32_t +#define WT uint64_t +#define NAME usmul +#define DATA TEST_BINARY_DATA_WRAP(NT, NAME) +#define T TEST_BINARY_STRUCT_DECL_WRAP(NT, NAME) +#define RUN_BINARY(x, y) RUN_SAT_U_MUL_FMT_7_WRAP(NT, WT, x, y) + +DEF_SAT_U_MUL_FMT_7_WRAP(NT, WT) + +#include "scalar_sat_binary_run_xxx.h" diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-8-u64-from-u128.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-8-u64-from-u128.c new file mode 100644 index 0000000..badf22d --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-8-u64-from-u128.c @@ -0,0 +1,16 @@ +/* { dg-do run { target { rv64 } } } */ +/* { dg-additional-options "-std=c99" } */ + +#include "sat_arith.h" +#include "sat_arith_data.h" + +#define NT uint64_t +#define WT uint128_t +#define NAME usmul +#define DATA TEST_BINARY_DATA_WRAP(NT, NAME) +#define T TEST_BINARY_STRUCT_DECL_WRAP(NT, NAME) +#define RUN_BINARY(x, y) RUN_SAT_U_MUL_FMT_7_WRAP(NT, WT, x, y) + +DEF_SAT_U_MUL_FMT_7_WRAP(NT, WT) + +#include "scalar_sat_binary_run_xxx.h" diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-8-u8-from-u128.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-8-u8-from-u128.c new file mode 100644 index 0000000..fb2a3f3 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-8-u8-from-u128.c @@ -0,0 +1,16 @@ +/* { dg-do run { target { rv64 } } } */ +/* { dg-additional-options "-std=c99" } */ + +#include "sat_arith.h" +#include "sat_arith_data.h" + +#define NT uint8_t +#define WT uint128_t +#define NAME usmul +#define DATA TEST_BINARY_DATA_WRAP(NT, NAME) +#define T TEST_BINARY_STRUCT_DECL_WRAP(NT, NAME) +#define RUN_BINARY(x, y) RUN_SAT_U_MUL_FMT_7_WRAP(NT, WT, x, y) + +DEF_SAT_U_MUL_FMT_7_WRAP(NT, WT) + +#include "scalar_sat_binary_run_xxx.h" diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-8-u8-from-u16.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-8-u8-from-u16.c new file mode 100644 index 0000000..c367130 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-8-u8-from-u16.c @@ -0,0 +1,16 @@ +/* { dg-do run { target { rv32 || rv64 } } } */ +/* { dg-additional-options "-std=c99" } */ + +#include "sat_arith.h" +#include "sat_arith_data.h" + +#define NT uint8_t +#define WT uint16_t +#define NAME usmul +#define DATA TEST_BINARY_DATA_WRAP(NT, NAME) +#define T TEST_BINARY_STRUCT_DECL_WRAP(NT, NAME) +#define RUN_BINARY(x, y) RUN_SAT_U_MUL_FMT_7_WRAP(NT, WT, x, y) + +DEF_SAT_U_MUL_FMT_7_WRAP(NT, WT) + +#include "scalar_sat_binary_run_xxx.h" diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-8-u8-from-u32.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-8-u8-from-u32.c new file mode 100644 index 0000000..a62958c --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-8-u8-from-u32.c @@ -0,0 +1,16 @@ +/* { dg-do run { target { rv32 || rv64 } } } */ +/* { dg-additional-options "-std=c99" } */ + +#include "sat_arith.h" +#include "sat_arith_data.h" + +#define NT uint8_t +#define WT uint32_t +#define NAME usmul +#define DATA TEST_BINARY_DATA_WRAP(NT, NAME) +#define T TEST_BINARY_STRUCT_DECL_WRAP(NT, NAME) +#define RUN_BINARY(x, y) RUN_SAT_U_MUL_FMT_7_WRAP(NT, WT, x, y) + +DEF_SAT_U_MUL_FMT_7_WRAP(NT, WT) + +#include "scalar_sat_binary_run_xxx.h" diff --git a/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-8-u8-from-u64.c b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-8-u8-from-u64.c new file mode 100644 index 0000000..b67b8c6 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/sat/sat_u_mul-run-8-u8-from-u64.c @@ -0,0 +1,16 @@ +/* { dg-do run { target { rv32 || rv64 } } } */ +/* { dg-additional-options "-std=c99" } */ + +#include "sat_arith.h" +#include "sat_arith_data.h" + +#define NT uint8_t +#define WT uint64_t +#define NAME usmul +#define DATA TEST_BINARY_DATA_WRAP(NT, NAME) +#define T TEST_BINARY_STRUCT_DECL_WRAP(NT, NAME) +#define RUN_BINARY(x, y) RUN_SAT_U_MUL_FMT_7_WRAP(NT, WT, x, y) + +DEF_SAT_U_MUL_FMT_7_WRAP(NT, WT) + +#include "scalar_sat_binary_run_xxx.h" diff --git a/gcc/testsuite/gcc.target/riscv/snez.c b/gcc/testsuite/gcc.target/riscv/snez.c new file mode 100644 index 0000000..e5a7fad --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/snez.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gc -mabi=lp64" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" "-Og" "-O1" } } */ + +int f (long long a) +{ + return (a != 2) << 1; +} + +/* { dg-final { scan-assembler-times "slli\t" 1 } } */ +/* { dg-final { scan-assembler-not "srli\t" } } */ +/* { dg-final { scan-assembler-times "snez\t" 1 } } */ +/* { dg-final { scan-assembler-not "sext.w\t" } } */ + diff --git a/gcc/testsuite/gcc.target/s390/stack-protector-guard-global-1.c b/gcc/testsuite/gcc.target/s390/stack-protector-guard-global-1.c new file mode 100644 index 0000000..f276645 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/stack-protector-guard-global-1.c @@ -0,0 +1,27 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fstack-protector-all -mstack-protector-guard=global -mstack-protector-guard-record" } */ +/* { dg-final { scan-assembler-times {\n1:\n\tlarl\t%r[0-9]+,__stack_chk_guard\n} 4 } } */ + +void test_0 (void) { } + +void test_1 (void) +{ + __asm__ __volatile ("" ::: + "r0", + "r1", + "r2", + "r3", + "r4", + "r5", + "r6", + "r7", + "r8", + "r9", + "r10", + "r11", +#ifndef __PIC__ + "r12", +#endif + "r13", + "r14"); +} diff --git a/gcc/testsuite/gcc.target/s390/stack-protector-guard-global-2.c b/gcc/testsuite/gcc.target/s390/stack-protector-guard-global-2.c new file mode 100644 index 0000000..7441a87 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/stack-protector-guard-global-2.c @@ -0,0 +1,5 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fstack-protector-all -mstack-protector-guard=global -mstack-protector-guard-record -fPIC" } */ +/* { dg-final { scan-assembler-times {\n1:\n\t(larl|lg?rl)\t%r[0-9]+,__stack_chk_guard@GOTENT\n} 4 } } */ + +#include "stack-protector-guard-global-1.c" diff --git a/gcc/testsuite/gcc.target/s390/stack-protector-guard-global-3.c b/gcc/testsuite/gcc.target/s390/stack-protector-guard-global-3.c new file mode 100644 index 0000000..4ef379a --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/stack-protector-guard-global-3.c @@ -0,0 +1,6 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fstack-protector-all -mstack-protector-guard=global" } */ +/* { dg-final { scan-assembler-times {\tlarl\t%r[0-9]+,__stack_chk_guard\n} 4 } } */ +/* { dg-final { scan-assembler-not {\n1:\n} } } */ + +#include "stack-protector-guard-global-1.c" diff --git a/gcc/testsuite/gcc.target/s390/stack-protector-guard-global-4.c b/gcc/testsuite/gcc.target/s390/stack-protector-guard-global-4.c new file mode 100644 index 0000000..d57fc79 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/stack-protector-guard-global-4.c @@ -0,0 +1,6 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fstack-protector-all -mstack-protector-guard=global -fPIC" } */ +/* { dg-final { scan-assembler-times {\t(larl|lg?rl)\t%r[0-9]+,__stack_chk_guard@GOTENT\n} 4 } } */ +/* { dg-final { scan-assembler-not {\n1:\n} } } */ + +#include "stack-protector-guard-global-1.c" diff --git a/gcc/testsuite/gcc.target/sh/pr67731.c b/gcc/testsuite/gcc.target/sh/pr67731.c new file mode 100644 index 0000000..43c1657 --- /dev/null +++ b/gcc/testsuite/gcc.target/sh/pr67731.c @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -m4 -ml" } */ + +typedef struct +{ + _Bool a : 1; + _Bool b : 1; + _Bool c : 1; + _Bool d : 1; + unsigned int e : 4; +} S; + +_Bool test_00 (S* s) +{ + return s->b | s->c; +} + +_Bool test_01 (S* s) +{ + return s->b | s->c | s->d; +} + +/* { dg-final { scan-assembler-times {\ttst} 2 } } */ +/* { dg-final { scan-assembler-times {\tnegc} 2 } } */ +/* { dg-final { scan-assembler-not {\tor} } } */ diff --git a/gcc/testsuite/gcc.target/sparc/cbcond-1.c b/gcc/testsuite/gcc.target/sparc/cbcond-1.c index 74fe475..742ab1d 100644 --- a/gcc/testsuite/gcc.target/sparc/cbcond-1.c +++ b/gcc/testsuite/gcc.target/sparc/cbcond-1.c @@ -34,5 +34,5 @@ void cbcondle (int a) /* { dg-final { scan-assembler "cwbe\t%" { target ilp32 } } } */ /* { dg-final { scan-assembler "cwbne\t%" { target ilp32 } } } */ -/* { dg-final { scan-assembler "cwbl\t%" } } */ -/* { dg-final { scan-assembler "cwble\t%" } } */ +/* { dg-final { scan-assembler "cwbl|cwbge\t%" } } */ +/* { dg-final { scan-assembler "cwble|cwbg\t%" } } */ diff --git a/gcc/testsuite/gcc.target/sparc/cbcond-2.c b/gcc/testsuite/gcc.target/sparc/cbcond-2.c index da6c617..c55f9e9 100644 --- a/gcc/testsuite/gcc.target/sparc/cbcond-2.c +++ b/gcc/testsuite/gcc.target/sparc/cbcond-2.c @@ -35,5 +35,5 @@ void cbcondle (long a) /* { dg-final { scan-assembler "cxbe\t%" } } */ /* { dg-final { scan-assembler "cxbne\t%" } } */ -/* { dg-final { scan-assembler "cxbl\t%" } } */ -/* { dg-final { scan-assembler "cxble\t%" } } */ +/* { dg-final { scan-assembler "cxbl|cxbge\t%" } } */ +/* { dg-final { scan-assembler "cxble|cxbg\t%" } } */ diff --git a/gcc/testsuite/gcc.target/sparc/overflow-3.c b/gcc/testsuite/gcc.target/sparc/overflow-3.c index 52d6ab2..ce52de0 100644 --- a/gcc/testsuite/gcc.target/sparc/overflow-3.c +++ b/gcc/testsuite/gcc.target/sparc/overflow-3.c @@ -38,6 +38,6 @@ bool my_neg_overflow (int32_t a, int32_t *res) /* { dg-final { scan-assembler-times "addcc\t%" 2 } } */ /* { dg-final { scan-assembler-times "subcc\t%" 4 } } */ /* { dg-final { scan-assembler-times "addx\t%" 3 } } */ -/* { dg-final { scan-assembler-times "bvs" 3 } } */ +/* { dg-final { scan-assembler-times "bvs|bvc" 3 } } */ /* { dg-final { scan-assembler-not "cmp\t%" } } */ /* { dg-final { scan-assembler-not "save\t%" } } */ diff --git a/gcc/testsuite/gcc.target/sparc/overflow-4.c b/gcc/testsuite/gcc.target/sparc/overflow-4.c index c6121b9..2b62edf 100644 --- a/gcc/testsuite/gcc.target/sparc/overflow-4.c +++ b/gcc/testsuite/gcc.target/sparc/overflow-4.c @@ -38,7 +38,7 @@ bool my_neg_overflow (int64_t a, int64_t *res) /* { dg-final { scan-assembler-times "addcc\t%" 2 } } */ /* { dg-final { scan-assembler-times "subcc\t%" 4 } } */ /* { dg-final { scan-assembler-times "movlu\t%" 1 } } */ -/* { dg-final { scan-assembler-times "blu" 2 } } */ -/* { dg-final { scan-assembler-times "bvs" 3 } } */ +/* { dg-final { scan-assembler-times "blu|bgeu" 2 } } */ +/* { dg-final { scan-assembler-times "bvs|bvc" 3 } } */ /* { dg-final { scan-assembler-not "cmp\t%" } } */ /* { dg-final { scan-assembler-not "save\t%" } } */ diff --git a/gcc/testsuite/gcc.target/sparc/overflow-5.c b/gcc/testsuite/gcc.target/sparc/overflow-5.c index f00283f..0459a65 100644 --- a/gcc/testsuite/gcc.target/sparc/overflow-5.c +++ b/gcc/testsuite/gcc.target/sparc/overflow-5.c @@ -38,6 +38,6 @@ bool my_neg_overflow (int64_t a, int64_t *res) /* { dg-final { scan-assembler-times "addcc\t%" 2 } } */ /* { dg-final { scan-assembler-times "subcc\t%" 4 } } */ /* { dg-final { scan-assembler-times "addxc\t%" 3 } } */ -/* { dg-final { scan-assembler-times "bvs" 3 } } */ +/* { dg-final { scan-assembler-times "bvs|bvc" 3 } } */ /* { dg-final { scan-assembler-not "cmp\t%" } } */ /* { dg-final { scan-assembler-not "save\t%" } } */ diff --git a/gcc/testsuite/gcc.target/sparc/small-struct-1.c b/gcc/testsuite/gcc.target/sparc/small-struct-1.c index 4897288..1ceccd5 100644 --- a/gcc/testsuite/gcc.target/sparc/small-struct-1.c +++ b/gcc/testsuite/gcc.target/sparc/small-struct-1.c @@ -42,5 +42,5 @@ double get2x (struct vec2x v) return v.x + v.y; } -/* { dg-final { scan-assembler-not "ldx" } } */ -/* { dg-final { scan-assembler-not "stx" } } */ +/* { dg-final { scan-assembler-not "ldx" { target *-*-solaris* } } } */ +/* { dg-final { scan-assembler-not "stx" { target *-*-solaris* } } } */ diff --git a/gcc/testsuite/gcc.target/xstormy16/pr118358.c b/gcc/testsuite/gcc.target/xstormy16/pr118358.c new file mode 100644 index 0000000..0743a02 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/pr118358.c @@ -0,0 +1,90 @@ +/* PR target/118358. */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +extern void exit (int); + +typedef struct +{ + union + { + struct + { + unsigned char a3; + unsigned char a4; + } a2; + unsigned int a5; + } a0; + unsigned int a1; +} A; + +static int +foo (unsigned int *b, unsigned int n, unsigned int s, const unsigned int *d, + const unsigned int *e, A **t, unsigned int *m, A *hp, unsigned int *hn, + unsigned int *v) +{ + unsigned int a, c[15 + 1], f; + int g, h; + unsigned int i, j, k; + int l; + unsigned int ee; + unsigned int *p; + A *q, r, *u[15]; + int w; + unsigned int x[15 + 1], *xx; + int y; + unsigned int z; + for (j = 1; j <= 15; j++) + if (c[j]) + break; + if ((unsigned int) l < j) + l = j; + for (i = 15; i; i--) + if (c[i]) + break; + g = i; + for (y = 1 << j; j < i; j++, y <<= 1) + if ((y -= c[j]) < 0) + return -3; + h = -1; + z = 0; + for (; k <= g; k++) + { + while (k > w + l) + { + h++; + w += l; + if ((f = 1 << (j = k - w)) > a + 1) + ; + z = 1 << j; + if (*hn + z > 1440) + return -3; + u[h] = q = hp + *hn; + r.a0.a2.a4 = (unsigned char) l; + r.a1 = (unsigned int) (q - u[h - 1] - j); + } + for (j = i >> w; j < z; j += f) + q[j] = r; + for (j = 1 << (k - 1); i & j; j >>= 1) + i ^= j; + while ((i & ee) != x[h]) + { + h--; + w -= l; + } + } + return y != 0 && g != 1 ? (-5) : 0; +} + +unsigned int a[19] = { 3, 4, 0, 2, 2, [17] = 3, 3 }; +unsigned int d[19]; +A h[1440]; + +int +main (void) +{ + unsigned int b = 0, c = 0; + A *e = 0; + foo (a, 19, 19, 0, 0, &e, &b, h, &c, d); + exit (0); +} diff --git a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_17.f90 b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_17.f90 index c399e71..43a0115 100644 --- a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_17.f90 +++ b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_17.f90 @@ -1,7 +1,7 @@ ! { dg-do run } ! { dg-additional-sources ISO_Fortran_binding_17.c } ! { dg-options "-fcheck=all" } -! { dg-warning "command-line option '-fcheck=all' is valid for Fortran but not for C" "" { target *-*-* } 0 } +! { dg-warning "command-line option '-fcheck=all' is valid for (\[a-zA-Z0-9]+/)*Fortran(/\[a-zA-Z0-9]+)* but not for C" "" { target *-*-* } 0 } ! ! PR fortran/92470 ! diff --git a/gcc/testsuite/gfortran.dg/alloc_comp_deep_copy_5.f90 b/gcc/testsuite/gfortran.dg/alloc_comp_deep_copy_5.f90 new file mode 100644 index 0000000..c0b305e --- /dev/null +++ b/gcc/testsuite/gfortran.dg/alloc_comp_deep_copy_5.f90 @@ -0,0 +1,63 @@ +! { dg-do run } +! { dg-additional-options "-Wa,--noexecstack" { target gas } } +! { dg-additional-options "-Wl,-z,noexecstack" { target gld } } +! +! PR fortran/121628 +! Test deep copy of recursive allocatable array components with multi-level +! nesting and repeated circular assignments. This test ensures: +! 1. Deep copy works correctly for grandchildren (multi-level recursion) +! 2. Repeated circular assignments don't cause memory corruption/double-free +! 3. No trampolines are generated (verified by noexecstack flags) +! +! Contributed by Christopher Albert <albert@tugraz.at> +! and Harald Anlauf <anlauf@gcc.gnu.org> +! +program alloc_comp_deep_copy_5 + implicit none + + type :: nested_t + character(len=10) :: name + type(nested_t), allocatable :: children(:) + end type nested_t + + type(nested_t) :: a, b + + ! Build a tree with grandchildren + b%name = "root" + allocate (b%children(2)) + b%children(1)%name = "child1" + b%children(2)%name = "child2" + allocate (b%children(1)%children(1)) + b%children(1)%children(1)%name = "grandchild" + + ! Test 1: Initial assignment + a = b + if (.not. allocated(a%children)) stop 1 + if (.not. allocated(a%children(1)%children)) stop 2 + if (a%children(1)%children(1)%name /= "grandchild") stop 3 + + ! Verify deep copy by modifying a + a%children(1)%children(1)%name = "modified" + if (b%children(1)%children(1)%name /= "grandchild") stop 4 + if (a%children(1)%children(1)%name /= "modified") stop 5 + + ! Test 2: Circular assignment b=a (should not corrupt memory) + b = a + if (.not. allocated(a%children)) stop 6 + if (.not. allocated(a%children(1)%children)) stop 7 + if (.not. allocated(b%children)) stop 8 + if (.not. allocated(b%children(1)%children)) stop 9 + + ! Test 3: Circular assignment a=b (stress test) + a = b + if (.not. allocated(a%children)) stop 10 + if (.not. allocated(a%children(1)%children)) stop 11 + + ! Test 4: Another circular assignment (triggered double-free in buggy code) + b = a + if (.not. allocated(b%children)) stop 12 + if (.not. allocated(b%children(1)%children)) stop 13 + + ! Verify final state + if (b%children(1)%children(1)%name /= "modified") stop 14 +end program alloc_comp_deep_copy_5 diff --git a/gcc/testsuite/gfortran.dg/alloc_comp_deep_copy_6.f90 b/gcc/testsuite/gfortran.dg/alloc_comp_deep_copy_6.f90 new file mode 100644 index 0000000..ae20d5f --- /dev/null +++ b/gcc/testsuite/gfortran.dg/alloc_comp_deep_copy_6.f90 @@ -0,0 +1,75 @@ +! { dg-do run } +! { dg-additional-options "-Wa,--noexecstack" { target gas } } +! { dg-additional-options "-Wl,-z,noexecstack" { target gld } } +! +! PR fortran/121628 +! Test deep copy of recursive allocatable components with both data arrays +! and recursive children. This is a comprehensive test combining: +! 1. Allocatable data arrays (values) +! 2. Recursive allocatable arrays (children) +! 3. Multi-level tree structure +! 4. Complete data integrity verification after deep copy +! 5. No trampolines (noexecstack flags) +! +! Contributed by Christopher Albert <albert@tugraz.at> +! +program alloc_comp_deep_copy_6 + use, intrinsic :: iso_fortran_env, only: dp => real64 + implicit none + + type :: nested_t + real(dp), allocatable :: values(:) + type(nested_t), allocatable :: children(:) + end type nested_t + + type(nested_t) :: a, b + + ! Build nested structure with both values and children + allocate (b%values(3)) + b%values = [1.0_dp, 2.0_dp, 3.0_dp] + + allocate (b%children(2)) + allocate (b%children(1)%values(2)) + b%children(1)%values = [4.0_dp, 5.0_dp] + + allocate (b%children(2)%values(1)) + b%children(2)%values = [6.0_dp] + + ! Deeper nesting + allocate (b%children(1)%children(1)) + allocate (b%children(1)%children(1)%values(2)) + b%children(1)%children(1)%values = [7.0_dp, 8.0_dp] + + ! Deep copy + a = b + + ! Verify allocation status + if (.not. allocated(a%values)) stop 1 + if (.not. allocated(a%children)) stop 2 + if (.not. allocated(a%children(1)%values)) stop 3 + if (.not. allocated(a%children(2)%values)) stop 4 + if (.not. allocated(a%children(1)%children)) stop 5 + if (.not. allocated(a%children(1)%children(1)%values)) stop 6 + + ! Verify data integrity + if (any(a%values /= [1.0_dp, 2.0_dp, 3.0_dp])) stop 7 + if (any(a%children(1)%values /= [4.0_dp, 5.0_dp])) stop 8 + if (any(a%children(2)%values /= [6.0_dp])) stop 9 + if (any(a%children(1)%children(1)%values /= [7.0_dp, 8.0_dp])) stop 10 + + ! Verify deep copy: modify a and ensure b is unchanged + a%values(1) = -1.0_dp + a%children(1)%values(1) = -2.0_dp + a%children(2)%values(1) = -3.0_dp + a%children(1)%children(1)%values(1) = -4.0_dp + + if (any(b%values /= [1.0_dp, 2.0_dp, 3.0_dp])) stop 11 + if (any(b%children(1)%values /= [4.0_dp, 5.0_dp])) stop 12 + if (any(b%children(2)%values /= [6.0_dp])) stop 13 + if (any(b%children(1)%children(1)%values /= [7.0_dp, 8.0_dp])) stop 14 + + if (any(a%values /= [-1.0_dp, 2.0_dp, 3.0_dp])) stop 15 + if (any(a%children(1)%values /= [-2.0_dp, 5.0_dp])) stop 16 + if (any(a%children(2)%values /= [-3.0_dp])) stop 17 + if (any(a%children(1)%children(1)%values /= [-4.0_dp, 8.0_dp])) stop 18 +end program alloc_comp_deep_copy_6 diff --git a/gcc/testsuite/gfortran.dg/alloc_comp_deep_copy_7.f90 b/gcc/testsuite/gfortran.dg/alloc_comp_deep_copy_7.f90 new file mode 100644 index 0000000..749a712 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/alloc_comp_deep_copy_7.f90 @@ -0,0 +1,23 @@ +! { dg-do compile } +! +! PR fortran/121628 +! Test that derived types with multiple recursive allocatable array +! components compile without ICE. This was broken by the initial deep-copy +! patch which caused infinite compile-time recursion due to seen_derived_types +! persisting across wrapper generation. +! +! The fix saves and restores seen_derived_types when generating element +! copy wrappers to prevent inheriting parent context state. +! + +program alloc_comp_deep_copy_7 + implicit none + + type :: nested_t + type(nested_t), allocatable :: children(:) + type(nested_t), allocatable :: relatives(:) + end type nested_t + + type(nested_t) :: a + +end program alloc_comp_deep_copy_7 diff --git a/gcc/testsuite/gfortran.dg/array_constructor_typespec_1.f90 b/gcc/testsuite/gfortran.dg/array_constructor_typespec_1.f90 new file mode 100644 index 0000000..1e5989f --- /dev/null +++ b/gcc/testsuite/gfortran.dg/array_constructor_typespec_1.f90 @@ -0,0 +1,326 @@ +! { dg-do run } +! PR fortran/107721 - array constructor type-spec lost with parentheses +! PR fortran/102417 - character array constructor type-spec lost +! +! Tests type-spec preservation in array constructors with parentheses, +! nested constructors, and CLASS(*) type verification for all intrinsic types. + +program array_constructor_typespec_1 + implicit none + integer :: i, iscalar + integer, dimension(2) :: iarr + real, dimension(2) :: rarr + real :: rscalar + complex, dimension(2) :: carr + complex :: cscalar + logical, dimension(2) :: larr + character(4), dimension(3) :: charr + character(8), dimension(2) :: charr8 + character(16), dimension(3) :: charr16 + character(16), dimension(2) :: charr16_2 + character(:), allocatable :: charr17(:) + character :: x = 'a', y = 'b' + class(*), allocatable :: res(:) + character(10), dimension(1) :: charr10 + character(4), dimension(1) :: charr4_1 + character(:), allocatable :: charr0(:) + character(4), dimension(0) :: empty4 + + ! INTEGER - runtime value checks + iarr = [integer :: [1.0], [2.0]] + if (any(iarr /= [1, 2])) stop 1 + iarr = [integer :: ([1.0]), ([2.0])] + if (any(iarr /= [1, 2])) stop 2 + iarr = [integer :: ((([1.0]))), [2.0]] + if (any(iarr /= [1, 2])) stop 3 + + ! REAL - runtime value checks + rarr = [real :: [2], [3]] + if (any(rarr /= [2.0, 3.0])) stop 4 + rarr = [real :: ([2]), ([3])] + if (any(rarr /= [2.0, 3.0])) stop 5 + rarr = [real :: ((([2]))), [3]] + if (any(rarr /= [2.0, 3.0])) stop 6 + + ! COMPLEX - runtime value checks + carr = [complex :: [3], [4]] + if (any(carr /= [(3.0, 0.0), (4.0, 0.0)])) stop 7 + carr = [complex :: ([3]), ([4])] + if (any(carr /= [(3.0, 0.0), (4.0, 0.0)])) stop 8 + carr = [complex :: ((([3]))), [4]] + if (any(carr /= [(3.0, 0.0), (4.0, 0.0)])) stop 9 + + ! LOGICAL - runtime value checks + larr = [logical :: [.true.], [.false.]] + if (any(larr .neqv. [.true., .false.])) stop 10 + larr = [logical :: ([.true.]), ([.false.])] + if (any(larr .neqv. [.true., .false.])) stop 11 + + ! CHARACTER - runtime value checks (PR 102417) + charr = [character(4) :: 'a', 'b', 'c'] + if (any(charr /= ['a ', 'b ', 'c '])) stop 12 + charr = [character(4) :: ('a'), 'b', 'c'] + if (any(charr /= ['a ', 'b ', 'c '])) stop 13 + charr = [[character(4) :: 'a', 'b', 'c']] + if (any(charr /= ['a ', 'b ', 'c '])) stop 14 + + ! CHARACTER with nested constructors - length 8 + charr8 = [character(8) :: 'x', 'y'] + if (charr8(1) /= 'x ') stop 15 + if (charr8(2) /= 'y ') stop 16 + + charr8 = [character(8) :: ['a', 'b']] + if (charr8(1) /= 'a ') stop 17 + if (charr8(2) /= 'b ') stop 18 + + ! Outer constructor without type-spec, inner with type-spec. + ! With proper type-spec propagation, no length mismatch warning is needed. + charr8 = [[character(8) :: ['a', 'b']]] + if (charr8(1) /= 'a ') stop 19 + if (charr8(2) /= 'b ') stop 20 + + ! Triple-nested constructor with type-spec in middle. + charr8 = [[[character(8) :: ['a', 'b']]]] + if (charr8(1) /= 'a ') stop 21 + if (charr8(2) /= 'b ') stop 22 + + charr8 = [character(8) :: (x), (y)] + if (charr8(1) /= 'a ') stop 23 + if (charr8(2) /= 'b ') stop 24 + + charr8 = [[character(8) :: (x), (y)]] + if (charr8(1) /= 'a ') stop 25 + if (charr8(2) /= 'b ') stop 26 + + ! CHARACTER concatenation with parentheses (PR 107721 comment 14) + charr16_2 = [character(16) :: 'a' // 'c', 'b' // 'de'] + if (charr16_2(1) /= 'ac ') stop 101 + if (charr16_2(2) /= 'bde ') stop 102 + + charr16_2 = [character(16) :: 'a' // 'c', ('b' // 'de')] + if (charr16_2(1) /= 'ac ') stop 103 + if (charr16_2(2) /= 'bde ') stop 104 + + charr16_2 = [character(16) :: ('a' // 'c'), 'b' // 'de'] + if (charr16_2(1) /= 'ac ') stop 105 + if (charr16_2(2) /= 'bde ') stop 106 + + ! CHARACTER concatenation after constructor - verify length 17 + charr17 = [character(16) :: 'a' // 'c', 'b' // 'de'] // '|' + if (len(charr17) /= 17) stop 107 + if (charr17(1) /= 'ac |') stop 108 + if (charr17(2) /= 'bde |') stop 109 + + charr17 = [character(16) :: 'a' // 'c', ('b' // 'de')] // '|' + if (len(charr17) /= 17) stop 110 + if (charr17(1) /= 'ac |') stop 111 + if (charr17(2) /= 'bde |') stop 112 + + charr17 = [character(16) :: ('a' // 'c'), 'b' // 'de'] // '|' + if (len(charr17) /= 17) stop 113 + if (charr17(1) /= 'ac |') stop 114 + if (charr17(2) /= 'bde |') stop 115 + + ! CHARACTER - longer length 16 + charr16 = [character(16) :: 'a', 'b', 'c'] + if (charr16(1) /= 'a ') stop 27 + if (charr16(2) /= 'b ') stop 28 + if (charr16(3) /= 'c ') stop 29 + + charr16 = [[character(16) :: 'a', 'b', 'c']] + if (charr16(1) /= 'a ') stop 30 + if (charr16(2) /= 'b ') stop 31 + if (charr16(3) /= 'c ') stop 32 + + ! CHARACTER - truncation cases + charr8 = [character(8) :: 'abcdefghij', 'klmnopqrst'] + if (charr8(1) /= 'abcdefgh') stop 33 + if (charr8(2) /= 'klmnopqr') stop 34 + + charr8 = [[character(8) :: 'abcdefghij', 'klmnopqrst']] + if (charr8(1) /= 'abcdefgh') stop 35 + if (charr8(2) /= 'klmnopqr') stop 36 + + ! Implied-do with parentheses + iarr = [integer :: (/(1.0*i, i=1, 2)/)] + if (any(iarr /= [1, 2])) stop 37 + iarr = [integer :: ((/(1.0*i, i=1, 2)/))] + if (any(iarr /= [1, 2])) stop 38 + + ! Type verification with CLASS(*) - ensure types are actually converted + res = [integer :: ([1.0])] + call verify_integer (res, 42) + deallocate (res) + + res = [integer :: ([1.0]), ([2.0])] + call verify_integer (res, 43) + deallocate (res) + + res = [real :: ([2]), [3]] + call verify_real (res, 44) + deallocate (res) + + res = [complex :: ([3])] + call verify_complex (res, 45) + deallocate (res) + + res = [logical :: ([.true.]), [.false.]] + call verify_logical (res, 46) + deallocate (res) + + ! Parenthesized constructors - verify result TYPE not just value + res = [integer :: ([1.0])] ** 2 + call verify_integer (res, 47) + deallocate (res) + + res = [real :: ([2]), [3]] ** 2 + call verify_real (res, 48) + deallocate (res) + + res = [complex :: ([3])] ** 2 + call verify_complex (res, 49) + deallocate (res) + + ! Harald's test cases from Comment #17 - scalar // constructor patterns + charr17 = '|' // [character(16) :: 'a' // 'c', 'b' // 'de'] + if (len(charr17) /= 17) stop 116 + if (charr17(1) /= '|ac ') stop 117 + if (charr17(2) /= '|bde ') stop 118 + + charr17 = '|' // [character(16) :: 'a' // 'c', ('b' // 'de')] + if (len(charr17) /= 17) stop 119 + if (charr17(1) /= '|ac ') stop 120 + if (charr17(2) /= '|bde ') stop 121 + + charr17 = '|' // [character(16) :: ('a' // 'c'), 'b' // 'de'] + if (len(charr17) /= 17) stop 122 + if (charr17(1) /= '|ac ') stop 123 + if (charr17(2) /= '|bde ') stop 124 + + ! Comment #11: Nested array constructor with concatenation + ! The inner ['a','b'] must be padded to length 16 before concat + charr17 = [character(16) :: ['a', 'b']] // '|' + if (len(charr17) /= 17) stop 125 + if (charr17(1) /= 'a |') stop 126 + if (charr17(2) /= 'b |') stop 127 + + ! Comment #18: Outer constructor without type-spec wrapping inner with + ! type-spec. The type-spec must be propagated when flattening. + charr17 = [[character(16) :: ['a', 'b']]] // '|' + if (len(charr17) /= 17) stop 128 + if (charr17(1) /= 'a |') stop 129 + if (charr17(2) /= 'b |') stop 130 + + charr17 = '|' // [[character(16) :: ['a', 'b']]] + if (len(charr17) /= 17) stop 131 + if (charr17(1) /= '|a ') stop 132 + if (charr17(2) /= '|b ') stop 133 + + ! Harald's new test cases from Comment #22 - nested truncation and padding + ! [ character(2) :: ['abcd','efgh'] ] should truncate to 'ab', 'ef' + ! Then [ character(16) :: ... ] should pad to 'ab ', 'ef ' + + charr16_2 = [ character(16) :: [ character(2) :: ['abcd','efgh'] ] ] + if (charr16_2(1) /= 'ab ') stop 134 + if (charr16_2(2) /= 'ef ') stop 135 + + charr17 = [ character(16) :: [ character(2) :: ['abcd','efgh'] ] ] // "|" + if (len(charr17) /= 17) stop 136 + if (charr17(1) /= 'ab |') stop 137 + if (charr17(2) /= 'ef |') stop 138 + + charr17 = "|" // [ character(16) :: [ character(2) :: ['abcd','efgh'] ] ] + if (len(charr17) /= 17) stop 139 + if (charr17(1) /= '|ab ') stop 140 + if (charr17(2) /= '|ef ') stop 141 + + charr16_2 = [ character(16) :: ([ character(2) :: ['abcd','efgh'] ])] + if (charr16_2(1) /= 'ab ') stop 142 + if (charr16_2(2) /= 'ef ') stop 143 + + charr17 = [ character(16) :: ([ character(2) :: ['abcd','efgh'] ])] // "|" + if (len(charr17) /= 17) stop 144 + if (charr17(1) /= 'ab |') stop 145 + if (charr17(2) /= 'ef |') stop 146 + + charr17 = "|" // [ character(16) :: ([ character(2) :: ['abcd','efgh'] ])] + if (len(charr17) /= 17) stop 147 + if (charr17(1) /= '|ab ') stop 148 + if (charr17(2) /= '|ef ') stop 149 + deallocate (charr17) + + ! Additional torture tests + ! Triple nesting with explicit types: 'abcde'(5) -> 'ab'(2) -> 'ab '(10) + charr10 = [character(10) :: [character(2) :: [character(5) :: 'abcde']]] + if (charr10(1) /= 'ab ') stop 150 + + ! Concatenation of constructors + ! 'a'(2) // 'b'(3) -> 'a b '(5) -> 'a b '(4) + charr4_1 = [character(4) :: [character(2) :: 'a'] // [character(3) :: 'b']] + if (charr4_1(1) /= 'a b ') stop 151 + + ! Zero length strings + ! Inner zero length: 'abc' -> ''(0) -> ' '(4) + charr4_1 = [character(4) :: [character(0) :: 'abc']] + if (charr4_1(1) /= ' ') stop 152 + + ! Outer zero length: 'abc' -> 'abc '(4) -> ''(0) + charr0 = [character(0) :: [character(4) :: 'abc']] + if (len(charr0) /= 0) stop 153 + if (charr0(1) /= '') stop 154 + deallocate (charr0) + + ! Empty array constructors + empty4 = [character(4) :: ] + if (size(empty4) /= 0) stop 155 + + empty4 = [character(4) :: [character(2) :: ]] + if (size(empty4) /= 0) stop 156 + +contains + + subroutine verify_integer (x, stopcode) + class(*), intent(in) :: x(:) + integer, intent(in) :: stopcode + select type (x) + type is (integer) + ! Correct type + class default + stop stopcode + end select + end subroutine verify_integer + + subroutine verify_real (x, stopcode) + class(*), intent(in) :: x(:) + integer, intent(in) :: stopcode + select type (x) + type is (real) + ! Correct type + class default + stop stopcode + end select + end subroutine verify_real + + subroutine verify_complex (x, stopcode) + class(*), intent(in) :: x(:) + integer, intent(in) :: stopcode + select type (x) + type is (complex) + ! Correct type + class default + stop stopcode + end select + end subroutine verify_complex + + subroutine verify_logical (x, stopcode) + class(*), intent(in) :: x(:) + integer, intent(in) :: stopcode + select type (x) + type is (logical) + ! Correct type + class default + stop stopcode + end select + end subroutine verify_logical + +end program array_constructor_typespec_1 diff --git a/gcc/testsuite/gfortran.dg/array_memcpy_2.f90 b/gcc/testsuite/gfortran.dg/array_memcpy_2.f90 index 5f54bf1..a95908c 100644 --- a/gcc/testsuite/gfortran.dg/array_memcpy_2.f90 +++ b/gcc/testsuite/gfortran.dg/array_memcpy_2.f90 @@ -1,9 +1,12 @@ ! This checks that the "z = y" assignment is not considered copyable, as the ! array is of a derived type containing allocatable components. Hence, we -! we should expand the scalarized loop, which contains *two* memcpy calls. +! we should expand the scalarized loop, which contains *two* memcpy calls +! for the assignment itself, plus one for initialization. ! { dg-do compile } ! { dg-options "-O2 -fdump-tree-original" } - +! +! PR 121628 +! type :: a integer, allocatable :: i(:) end type a @@ -13,7 +16,14 @@ end type b type(b) :: y(2), z(2) + integer :: j + + do j = 1, 2 + allocate(y(j)%at(1)) + allocate(y(j)%at(1)%i(1)) + y(j)%at(1)%i(1) = j + end do z = y end -! { dg-final { scan-tree-dump-times "memcpy" 2 "original" } } +! { dg-final { scan-tree-dump-times "__builtin_memcpy" 4 "original" } } diff --git a/gcc/testsuite/gfortran.dg/assumed_charlen_dummy.f90 b/gcc/testsuite/gfortran.dg/assumed_charlen_dummy.f90 index 04f0b9f..2e0e77c 100644 --- a/gcc/testsuite/gfortran.dg/assumed_charlen_dummy.f90 +++ b/gcc/testsuite/gfortran.dg/assumed_charlen_dummy.f90 @@ -1,4 +1,5 @@ ! { dg-do compile } +! { dg-options " " } ! Test the fix for PR fortran/39893. ! Original testcase provided by Deji Akingunola. ! Reduced testcase provided by Dominique d'Humieres. diff --git a/gcc/testsuite/gfortran.dg/automatic_char_len_1.f90 b/gcc/testsuite/gfortran.dg/automatic_char_len_1.f90 index 3ccfcb7..7f102b7 100644 --- a/gcc/testsuite/gfortran.dg/automatic_char_len_1.f90 +++ b/gcc/testsuite/gfortran.dg/automatic_char_len_1.f90 @@ -1,4 +1,5 @@ ! { dg-do compile } +! { dg-options " " } ! PR18082 - Compiler would get stuck in loop, whilst treating ! the assignments. ! Test is one of PR cases. diff --git a/gcc/testsuite/gfortran.dg/c-interop/allocate-errors.f90 b/gcc/testsuite/gfortran.dg/c-interop/allocate-errors.f90 index a58d05a..57bc709 100644 --- a/gcc/testsuite/gfortran.dg/c-interop/allocate-errors.f90 +++ b/gcc/testsuite/gfortran.dg/c-interop/allocate-errors.f90 @@ -1,7 +1,7 @@ ! { dg-do run } ! { dg-additional-sources "allocate-errors-c.c dump-descriptors.c" } ! { dg-additional-options "-Wno-error -fcheck=all" } -! { dg-warning "command-line option '-fcheck=all' is valid for Fortran but not for C" "" { target *-*-* } 0 } +! { dg-warning "command-line option '-fcheck=all' is valid for (\[a-zA-Z0-9]+/)*Fortran(/\[a-zA-Z0-9]+)* but not for C" "" { target *-*-* } 0 } ! ! This program tests that the CFI_allocate and CFI_deallocate functions ! properly detect invalid arguments. All the interesting things happen diff --git a/gcc/testsuite/gfortran.dg/c-interop/establish-errors.f90 b/gcc/testsuite/gfortran.dg/c-interop/establish-errors.f90 index 307a266..9dc8889 100644 --- a/gcc/testsuite/gfortran.dg/c-interop/establish-errors.f90 +++ b/gcc/testsuite/gfortran.dg/c-interop/establish-errors.f90 @@ -2,7 +2,7 @@ ! { dg-do run } ! { dg-additional-sources "establish-errors-c.c dump-descriptors.c" } ! { dg-additional-options "-Wno-error -fcheck=all" } -! { dg-warning "command-line option '-fcheck=all' is valid for Fortran but not for C" "" { target *-*-* } 0 } +! { dg-warning "command-line option '-fcheck=all' is valid for (\[a-zA-Z0-9]+/)*Fortran(/\[a-zA-Z0-9]+)* but not for C" "" { target *-*-* } 0 } ! ! This program tests that the CFI_establish function properly detects ! invalid arguments. All the interesting things happen in the diff --git a/gcc/testsuite/gfortran.dg/c-interop/pr113338-c.c b/gcc/testsuite/gfortran.dg/c-interop/pr113338-c.c new file mode 100644 index 0000000..21a6b7a --- /dev/null +++ b/gcc/testsuite/gfortran.dg/c-interop/pr113338-c.c @@ -0,0 +1,10 @@ +/* PR fortran/113338. */ + +#include <ISO_Fortran_binding.h> + +extern void f_proc(CFI_cdesc_t* x); + +extern void c_proc(CFI_cdesc_t* x) +{ + f_proc(x); +} diff --git a/gcc/testsuite/gfortran.dg/c-interop/pr113338.f90 b/gcc/testsuite/gfortran.dg/c-interop/pr113338.f90 new file mode 100644 index 0000000..6da3378 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/c-interop/pr113338.f90 @@ -0,0 +1,80 @@ +! { dg-do run } +! { dg-additional-sources pr113338-c.c } +! { dg-additional-options "-Wno-error -O2 -std=f2018" } +! { dg-warning "command-line option '-std=f2018' is valid for (\[a-zA-Z0-9]+/)*Fortran(/\[a-zA-Z0-9]+)* but not for C" "" { target *-*-* } 0 } +! +! PR fortran/113338 - F2018 extensions to interoperability of procedures + +program example + use iso_c_binding + implicit none + + type :: t + integer :: i + end type + + interface + subroutine c_proc(x) bind(c) + import t + type(t), pointer, intent(in) :: x + end subroutine c_proc + end interface + + type(t), target :: x + + x%i = 42 + call c_proc(x) +end program + +! pointer +subroutine f_proc(x) bind(c) + type :: t + integer :: i + end type t + type(t), pointer, intent(in) :: x + if (.not. associated (x)) stop 1 +! print *, x%i + if (x%i /= 42) stop 2 +end subroutine f_proc + +!----------------------------------------------------------------------- +! Further cases some of which are also tested elsewhere in the testsuite +!----------------------------------------------------------------------- + +! character: length 1 or assumed character length -> *CFI_cdesc_t +subroutine f_char(c, s) bind(c) + character :: c(:) + character(*) :: s(:) +end subroutine f_char + +! allocatable: scalar, assumed-shape, assumed-rank -> *CFI_cdesc_t +subroutine f_a(x, y, z) bind(c) + type :: t + integer :: i + end type t + type(t), allocatable :: x + type(t), allocatable :: y(:) + type(t), allocatable :: z(..) +end subroutine f_a + +! pointer: scalar, assumed-shape, assumed-rank -> *CFI_cdesc_t +subroutine f_p(x, y, z) bind(c) + type :: t + integer :: i + end type t + type(t), pointer :: x + type(t), pointer :: y(:) + type(t), pointer :: z(..) +end subroutine f_p + +! assumed-type: assumed shape, assumed rank -> *CFI_cdesc_t +subroutine f_at_cfi(z, w) bind(c) + type(*) :: z(:) + type(*) :: w(..) +end subroutine f_at_cfi + +! assumed-type: scalar, assumed-size -> *void +subroutine f_at_void(x, y) bind(c) + type(*) :: x + type(*) :: y(*) +end subroutine f_at_void diff --git a/gcc/testsuite/gfortran.dg/c-interop/section-errors.f90 b/gcc/testsuite/gfortran.dg/c-interop/section-errors.f90 index 28328b7..bc52917 100644 --- a/gcc/testsuite/gfortran.dg/c-interop/section-errors.f90 +++ b/gcc/testsuite/gfortran.dg/c-interop/section-errors.f90 @@ -1,7 +1,7 @@ ! { dg-do run } ! { dg-additional-sources "section-errors-c.c dump-descriptors.c" } ! { dg-additional-options "-Wno-error -fcheck=all" } -! { dg-warning "command-line option '-fcheck=all' is valid for Fortran but not for C" "" { target *-*-* } 0 } +! { dg-warning "command-line option '-fcheck=all' is valid for (\[a-zA-Z0-9]+/)*Fortran(/\[a-zA-Z0-9]+)* but not for C" "" { target *-*-* } 0 } ! ! This program tests that the CFI_section function properly detects ! invalid arguments. All the interesting things happen in the diff --git a/gcc/testsuite/gfortran.dg/c-interop/select-errors.f90 b/gcc/testsuite/gfortran.dg/c-interop/select-errors.f90 index b719c9e..584a302 100644 --- a/gcc/testsuite/gfortran.dg/c-interop/select-errors.f90 +++ b/gcc/testsuite/gfortran.dg/c-interop/select-errors.f90 @@ -1,7 +1,7 @@ ! { dg-do run } ! { dg-additional-sources "select-errors-c.c dump-descriptors.c" } ! { dg-additional-options "-Wno-error -fcheck=all" } -! { dg-warning "command-line option '-fcheck=all' is valid for Fortran but not for C" "" { target *-*-* } 0 } +! { dg-warning "command-line option '-fcheck=all' is valid for (\[a-zA-Z0-9]+/)*Fortran(/\[a-zA-Z0-9]+)* but not for C" "" { target *-*-* } 0 } ! ! This program tests that the CFI_select_part function properly detects ! invalid arguments. All the interesting things happen in the diff --git a/gcc/testsuite/gfortran.dg/c-interop/setpointer-errors.f90 b/gcc/testsuite/gfortran.dg/c-interop/setpointer-errors.f90 index 84a01ce..15ea7ba 100644 --- a/gcc/testsuite/gfortran.dg/c-interop/setpointer-errors.f90 +++ b/gcc/testsuite/gfortran.dg/c-interop/setpointer-errors.f90 @@ -2,7 +2,7 @@ ! { dg-do run } ! { dg-additional-sources "setpointer-errors-c.c dump-descriptors.c" } ! { dg-additional-options "-Wno-error -fcheck=all" } -! { dg-warning "command-line option '-fcheck=all' is valid for Fortran but not for C" "" { target *-*-* } 0 } +! { dg-warning "command-line option '-fcheck=all' is valid for (\[a-zA-Z0-9]+/)*Fortran(/\[a-zA-Z0-9]+)* but not for C" "" { target *-*-* } 0 } ! ! This program tests that the CFI_setpointer function properly detects ! invalid arguments. All the interesting things happen in the diff --git a/gcc/testsuite/gfortran.dg/common_22.f90 b/gcc/testsuite/gfortran.dg/common_22.f90 index e225409..f92319b 100644 --- a/gcc/testsuite/gfortran.dg/common_22.f90 +++ b/gcc/testsuite/gfortran.dg/common_22.f90 @@ -7,18 +7,18 @@ ! Contributed by Bud Davis <jmdavis@link.com> CALL RCCFL (NVE,IR,NU3,VE (1,1,1,I)) - COMMON /CCFILE/ INTG,NT1,NT2,NT3,NVM,NVE,NFRLE,NRESF,NRESL !{ dg-error "Unexpected COMMON" } - COMMON /CCFILE/ INTG,NT1,NT2,NT3,NVM,NVE,NFRLE,NRESF,NRESL !{ dg-error "Unexpected COMMON" } + COMMON /CCFILE/ INTG,NT1,NT2,NT3,NVM,NVE,NFRLE,NRESF,NRESL !{ dg-error "COMMON statement at \\(1\\) cannot appear after executable statements" } + COMMON /CCFILE/ INTG,NT1,NT2,NT3,NVM,NVE,NFRLE,NRESF,NRESL !{ dg-error "COMMON statement at \\(1\\) cannot appear after executable statements" } ! the PR only contained the two above. ! success is no segfaults or infinite loops. ! let's check some combinations CALL ABC (INTG) - COMMON /CCFILE/ INTG,NT1,NT2,NT3,NVM,NVE,NFRLE,NRESF,NRESL !{ dg-error "Unexpected COMMON" } - COMMON /CCFILE/ INTG,NT1,NT2,NT3,NVM,NVE,NFRLE,NRESF,NRESL !{ dg-error "Unexpected COMMON" } + COMMON /CCFILE/ INTG,NT1,NT2,NT3,NVM,NVE,NFRLE,NRESF,NRESL !{ dg-error "COMMON statement at \\(1\\) cannot appear after executable statements" } + COMMON /CCFILE/ INTG,NT1,NT2,NT3,NVM,NVE,NFRLE,NRESF,NRESL !{ dg-error "COMMON statement at \\(1\\) cannot appear after executable statements" } CALL DEF (NT1) - COMMON /CCFILE/ INTG,NT1,NT2,NT3,NVM,NVE,NFRLE,NRESF,NRESL !{ dg-error "Unexpected COMMON" } - COMMON /CCFILE/ INTG,NT1,NT2,NT3,NVM,NVE,NFRLE,NRESF,NRESL !{ dg-error "Unexpected COMMON" } + COMMON /CCFILE/ INTG,NT1,NT2,NT3,NVM,NVE,NFRLE,NRESF,NRESL !{ dg-error "COMMON statement at \\(1\\) cannot appear after executable statements" } + COMMON /CCFILE/ INTG,NT1,NT2,NT3,NVM,NVE,NFRLE,NRESF,NRESL !{ dg-error "COMMON statement at \\(1\\) cannot appear after executable statements" } CALL GHI (NRESL) - COMMON /CCFILE/ INTG,NT1,NT2,NT3,NVM,NVE,NFRLE,NRESF,NRESL !{ dg-error "Unexpected COMMON" } - COMMON /CCFILE/ INTG,NT1,NT2,NT3,NVM,NVE,NFRLE,NRESF,NRESL !{ dg-error "Unexpected COMMON" } + COMMON /CCFILE/ INTG,NT1,NT2,NT3,NVM,NVE,NFRLE,NRESF,NRESL !{ dg-error "COMMON statement at \\(1\\) cannot appear after executable statements" } + COMMON /CCFILE/ INTG,NT1,NT2,NT3,NVM,NVE,NFRLE,NRESF,NRESL !{ dg-error "COMMON statement at \\(1\\) cannot appear after executable statements" } END diff --git a/gcc/testsuite/gfortran.dg/common_24.f b/gcc/testsuite/gfortran.dg/common_24.f index ea37c2a..1f35a40 100644 --- a/gcc/testsuite/gfortran.dg/common_24.f +++ b/gcc/testsuite/gfortran.dg/common_24.f @@ -7,5 +7,5 @@ c Contributed by Ilya Enkovich <ienkovich@gcc.gnu.org> COMMON /FMCOM / X(80 000 000) CALL T(XX(A)) - COMMON /FMCOM / XX(80 000 000) ! { dg-error "Unexpected COMMON" } + COMMON /FMCOM / XX(80 000 000) ! { dg-error "COMMON statement at \\(1\\) cannot appear after executable statements" } END diff --git a/gcc/testsuite/gfortran.dg/contiguous_16.f90 b/gcc/testsuite/gfortran.dg/contiguous_16.f90 new file mode 100644 index 0000000..ae1ba26 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/contiguous_16.f90 @@ -0,0 +1,51 @@ +! { dg-do run } +! { dg-options "-O2 -fdump-tree-original" } +! +! PR fortran/122977 - associate to a contiguous pointer + +program foo + integer, dimension(:), pointer, contiguous :: a + integer, dimension(:), allocatable :: u + allocate (a(4), u(4)) + if (.not. is_contiguous(a)) error stop 1 ! optimized + if (.not. is_contiguous(u)) error stop 2 ! optimized + + associate (b => a) + if (.not. is_contiguous(b)) error stop 3 ! optimized + associate (c => b) + if (.not. is_contiguous(c)) error stop 4 ! optimized + end associate + associate (c => b(1::2)) + if (is_contiguous(c)) stop 11 ! runtime check + end associate + end associate + + associate (v => u) + if (.not. is_contiguous(v)) error stop 5 ! optimized + associate (w => v) + if (.not. is_contiguous(w)) error stop 6 ! optimized + end associate + associate (w => v(1::2)) + if (is_contiguous(w)) stop 12 ! runtime check + end associate + end associate + + associate (b => a(1::2)) + if (is_contiguous(b)) stop 13 ! runtime check + associate (c => b) + if (is_contiguous(c)) stop 14 ! runtime check + end associate + end associate + + associate (v => u(1::2)) + if (is_contiguous(v)) stop 15 ! runtime check + associate (w => v) + if (is_contiguous(w)) stop 16 ! runtime check + end associate + end associate + + deallocate (a, u) +end program foo + +! { dg-final { scan-tree-dump-not "_gfortran_error_stop_numeric" "original" } } +! { dg-final { scan-tree-dump-times "_gfortran_stop_numeric" 6 "original" } } diff --git a/gcc/testsuite/gfortran.dg/do_concurrent_typespec_1.f90 b/gcc/testsuite/gfortran.dg/do_concurrent_typespec_1.f90 new file mode 100644 index 0000000..5a25739 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/do_concurrent_typespec_1.f90 @@ -0,0 +1,111 @@ +! { dg-do run } +! { dg-options "-std=f2008 -Wall" } +! +! PR fortran/96255 +! Test DO CONCURRENT with optional type specification +! Covers all shadowing scenarios per F2018 19.4(6) + +program test_do_concurrent_typespec + implicit none + integer :: test_count + test_count = 0 + + ! Test 1: Type-spec with no outer scope variable (BT_UNKNOWN) + ! Should just set the type, no shadow needed + call test_no_outer_var() + test_count = test_count + 1 + + ! Test 2: Type-spec shadows outer variable with same kind + ! Must create shadow per F2018 19.4(6) + call test_shadow_same_kind() + test_count = test_count + 1 + + ! Test 3: Type-spec shadows outer variable with different kind + ! Must create shadow per F2018 19.4(6) + call test_shadow_different_kind() + test_count = test_count + 1 + + ! Test 4: Multiple iterators with mixed scenarios + call test_multiple_iterators() + test_count = test_count + 1 + +contains + + subroutine test_no_outer_var() + implicit none + integer :: sum_val + + ! 'j' is not declared in outer scope + sum_val = 0 + do concurrent (integer :: j = 1:5) + sum_val = sum_val + j + end do + + if (sum_val /= 15) stop 1 ! 1+2+3+4+5 = 15 + end subroutine test_no_outer_var + + subroutine test_shadow_same_kind() + implicit none + integer :: i + integer :: outer_val, inner_sum + + ! Set outer 'i' to a specific value + i = 99 + outer_val = i + + ! DO CONCURRENT with type-spec should shadow 'i' + ! even though kind is the same + inner_sum = 0 + do concurrent (integer :: i = 1:3) + inner_sum = inner_sum + i + end do + + ! After loop, outer 'i' should be unchanged + if (i /= outer_val) stop 2 + if (i /= 99) stop 3 + if (inner_sum /= 6) stop 4 ! 1+2+3 = 6 + end subroutine test_shadow_same_kind + + subroutine test_shadow_different_kind() + implicit none + integer(kind=4) :: k + integer :: result + + ! Set outer 'k' to a value + k = 77 + + ! DO CONCURRENT with different kind should shadow + result = 0 + do concurrent (integer(kind=2) :: k = 1:4) + result = result + int(k, kind=4) + end do + + ! Outer 'k' should be unchanged + if (k /= 77) stop 5 + if (result /= 10) stop 6 ! 1+2+3+4 = 10 + end subroutine test_shadow_different_kind + + subroutine test_multiple_iterators() + implicit none + integer :: i, j + integer :: sum_val + + ! Set outer variables + i = 100 + j = 200 + + ! Multiple iterators: i shadows (same kind), m is new (BT_UNKNOWN) + ! Per F2018 R1125, ONE type-spec applies to ALL iterators + sum_val = 0 + do concurrent (integer :: i = 1:2, m = 1:2) + sum_val = sum_val + i * 10 + m + end do + + ! Outer i should be unchanged, j should be unchanged + if (i /= 100) stop 7 + if (j /= 200) stop 8 + ! sum = (1*10+1) + (1*10+2) + (2*10+1) + (2*10+2) = 11+12+21+22 = 66 + if (sum_val /= 66) stop 9 + end subroutine test_multiple_iterators + +end program test_do_concurrent_typespec diff --git a/gcc/testsuite/gfortran.dg/entry_23.f b/gcc/testsuite/gfortran.dg/entry_23.f index ebc5f66..d10ea92 100644 --- a/gcc/testsuite/gfortran.dg/entry_23.f +++ b/gcc/testsuite/gfortran.dg/entry_23.f @@ -1,4 +1,5 @@ ! { dg-do run } +! { dg-options " " } ! PR 97799 - this used to segfault intermittently. ! Test case by George Hockney. PROGRAM MAIN diff --git a/gcc/testsuite/gfortran.dg/finalize_59.f90 b/gcc/testsuite/gfortran.dg/finalize_59.f90 index 8be5f71..e9e68d4 100644 --- a/gcc/testsuite/gfortran.dg/finalize_59.f90 +++ b/gcc/testsuite/gfortran.dg/finalize_59.f90 @@ -187,7 +187,7 @@ Program Cds_Principal Type(Uef_Vector) :: Cds_Mod_Les_materiaux Type (Cds_Materiau_Acier_EC) :: acier_ec Class (Cds_Materiau), pointer :: pt_materiau - Character *(8) :: nom_materiau + Character(len=8) :: nom_materiau !------------------------------------------------------------------------------------------------- CaLL Cds_Mod_Les_materiaux%Add (acier_ec) nom_materiau = "12345678" @@ -199,7 +199,7 @@ Function Get_Pt_Materiau_nom (vecteur, nom_materiau) ! Fonction : !-------------------- ! Parametres en entree - Character *(8), Intent (in) :: nom_materiau + Character(len=8), Intent (in) :: nom_materiau Type (Uef_Vector) , Intent (inout) :: vecteur ! Parametres en sortie diff --git a/gcc/testsuite/gfortran.dg/finalizer_recursive_alloc_1.f90 b/gcc/testsuite/gfortran.dg/finalizer_recursive_alloc_1.f90 new file mode 100644 index 0000000..8fe2001 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/finalizer_recursive_alloc_1.f90 @@ -0,0 +1,15 @@ +! { dg-do compile } +! PR fortran/90519 + +module pr90519_finalizer_mod + implicit none + type :: t + type(t), allocatable :: child + contains + final :: finalize_t + end type t +contains + subroutine finalize_t(self) + type(t), intent(inout) :: self + end subroutine finalize_t +end module pr90519_finalizer_mod diff --git a/gcc/testsuite/gfortran.dg/finalizer_recursive_alloc_2.f90 b/gcc/testsuite/gfortran.dg/finalizer_recursive_alloc_2.f90 new file mode 100644 index 0000000..6e9edff --- /dev/null +++ b/gcc/testsuite/gfortran.dg/finalizer_recursive_alloc_2.f90 @@ -0,0 +1,32 @@ +! { dg-do run } +! { dg-output " finalizing id\\s+0\\n finalizing id\\s+1\\n finalizer count =\\s+2\\n" } +! PR fortran/90519 + +module pr90519_finalizer_run_mod + implicit none + integer :: finalizer_count = 0 + type :: tree_t + integer :: id = -1 + type(tree_t), allocatable :: child + contains + final :: finalize_tree + end type tree_t +contains + subroutine finalize_tree(self) + type(tree_t), intent(inout) :: self + finalizer_count = finalizer_count + 1 + print *, 'finalizing id', self%id + end subroutine finalize_tree +end module pr90519_finalizer_run_mod + +program test_finalizer + use pr90519_finalizer_run_mod + implicit none + block + type(tree_t) :: root + root%id = 0 + allocate(root%child) + root%child%id = 1 + end block + print *, 'finalizer count =', finalizer_count +end program test_finalizer diff --git a/gcc/testsuite/gfortran.dg/finalizer_self_assign.f90 b/gcc/testsuite/gfortran.dg/finalizer_self_assign.f90 new file mode 100644 index 0000000..4e5b807d --- /dev/null +++ b/gcc/testsuite/gfortran.dg/finalizer_self_assign.f90 @@ -0,0 +1,101 @@ +! { dg-do run } +! Test self-assignment with recursive allocatable and finalizer +! This should preserve allocatable components after a = a and a = (a) + +module self_assign_mod + implicit none + type :: node_t + integer :: value = 0 + type(node_t), allocatable :: next + contains + final :: finalize_node + end type node_t +contains + subroutine finalize_node(self) + type(node_t), intent(inout) :: self + end subroutine finalize_node +end module self_assign_mod + +program test_self_assign + use self_assign_mod + implicit none + + call test_simple_self_assign() + call test_parenthesized_self_assign() + call test_triple_parenthesized_self_assign() + call test_array_bounds() + +contains + + subroutine test_simple_self_assign() + type(node_t) :: a + + a%value = 100 + allocate(a%next) + a%next%value = 200 + + ! Simple self-assignment should preserve all components + a = a + + if (a%value /= 100) stop 1 + if (.not. allocated(a%next)) stop 2 + if (a%next%value /= 200) stop 3 + end subroutine test_simple_self_assign + + subroutine test_parenthesized_self_assign() + type(node_t) :: a + + a%value = 100 + allocate(a%next) + a%next%value = 200 + + ! Parenthesized self-assignment should also preserve all components + a = (a) + + if (a%value /= 100) stop 4 + if (.not. allocated(a%next)) stop 5 + if (a%next%value /= 200) stop 6 + end subroutine test_parenthesized_self_assign + + subroutine test_triple_parenthesized_self_assign() + type(node_t) :: a + + a%value = 100 + allocate(a%next) + a%next%value = 200 + + ! Triple-nested parentheses should also work correctly + a = (((a))) + + if (a%value /= 100) stop 7 + if (.not. allocated(a%next)) stop 8 + if (a%next%value /= 200) stop 9 + end subroutine test_triple_parenthesized_self_assign + + subroutine test_array_bounds() + type(node_t), allocatable :: b(:), c(:) + + ! Test array bounds behavior with parentheses. + ! Per F2023:10.2.1.3, lbound((b),1) = 1 even if lbound(b,1) = 5. + ! However, for b = (b) where b is already allocated with the right shape, + ! NO reallocation occurs, so bounds are preserved. + ! For c = (b) where c is unallocated, c gets allocated with default bounds. + allocate(b(5:5)) + b(5)%value = 500 + + ! Self-assignment with parentheses: no reallocation (same shape), bounds preserved + b = (b) + if (.not. allocated(b)) stop 10 + if (lbound(b, 1) /= 5) stop 11 ! Bounds preserved (no realloc) + if (ubound(b, 1) /= 5) stop 12 + if (b(5)%value /= 500) stop 13 + + ! Assignment to unallocated array: gets default (1-based) bounds + c = (b) + if (.not. allocated(c)) stop 14 + if (lbound(c, 1) /= 1) stop 15 ! Default bounds (new allocation) + if (ubound(c, 1) /= 1) stop 16 + if (c(1)%value /= 500) stop 17 + end subroutine test_array_bounds + +end program test_self_assign diff --git a/gcc/testsuite/gfortran.dg/fmt_error_10.f b/gcc/testsuite/gfortran.dg/fmt_error_10.f index fc6620a..9ae2f32 100644 --- a/gcc/testsuite/gfortran.dg/fmt_error_10.f +++ b/gcc/testsuite/gfortran.dg/fmt_error_10.f @@ -14,12 +14,13 @@ write (line,'(1pd24.15e6)',iostat=istat, iomsg=msg) 1.0d0, 1.234 ! { dg-warning "Period required" } if (istat.ne.0) STOP 3 - if (line.ne." 1.000000000000000D+001.E+00") STOP 4 + if (line.ne." 1.000000000000000D+001.E+00") STOP 2 str = '(1pd0.15)' write (line,str,iostat=istat, iomsg=msg) 1.0d0 - if (line.ne."1.000000000000000D+0") STOP 5 + if (line.ne."1.000000000000000D+000") STOP 4 read (*,str,iostat=istat, iomsg=msg) x + if (istat.ne.5006 .or. msg(1:10).ne."Zero width") STOP 6 if (x.ne.555.25) STOP 7 diff --git a/gcc/testsuite/gfortran.dg/fmt_g0_4.f08 b/gcc/testsuite/gfortran.dg/fmt_g0_4.f08 index fff6580..e93ed7f 100644 --- a/gcc/testsuite/gfortran.dg/fmt_g0_4.f08 +++ b/gcc/testsuite/gfortran.dg/fmt_g0_4.f08 @@ -1,15 +1,16 @@ -! { dg-do compile } +! { dg-do run } ! { dg-options "-std=f2008" } ! PR36725 Compile time error for g0 edit descriptor character(30) :: line write(line, '(g0.3)') 0.1 -if (line.ne." 1.000E-01") STOP 1 +if (line.ne."0.100") STOP 1 write(line, '(g0.9)') 1.0 -if (line.ne."1.000000000E+00") STOP 2 +if (line.ne."1.00000000") STOP 2 write(line, '(g0.5)') 29.23 -if (line.ne." 2.92300E+01") STOP 3 +if (line.ne."29.230") STOP 3 write(line, '(g0.8)') -28.4 -if (line.ne."-2.83999996E+01") STOP 4 +if (line.ne."-28.400000") STOP 4 write(line, '(g0.8)') -0.0001 -if (line.ne."-9.99999975E-05") STOP 5 +if (line.ne."-0.99999997E-04") STOP 5 end + diff --git a/gcc/testsuite/gfortran.dg/fmt_zero_width.f90 b/gcc/testsuite/gfortran.dg/fmt_zero_width.f90 index db2cca6..3ba897c 100644 --- a/gcc/testsuite/gfortran.dg/fmt_zero_width.f90 +++ b/gcc/testsuite/gfortran.dg/fmt_zero_width.f90 @@ -9,32 +9,32 @@ program pr90374 rn = 0.00314_4 afmt = "(D0.3)" write (aresult,fmt=afmt) rn - if (aresult /= "0.314D-2") stop 12 + if (aresult /= "0.314D-02") stop 12 afmt = "(E0.10)" write (aresult,fmt=afmt) rn - if (aresult /= "0.3139999928E-2") stop 15 + if (aresult /= "0.3139999928E-02") stop 15 afmt = "(ES0.10)" write (aresult,fmt=afmt) rn - if (aresult /= "3.1399999280E-3") stop 18 + if (aresult /= "3.1399999280E-03") stop 18 afmt = "(EN0.10)" write (aresult,fmt=afmt) rn - if (aresult /= "3.1399999280E-3") stop 21 + if (aresult /= "3.1399999280E-03") stop 21 afmt = "(G0.10)" write (aresult,fmt=afmt) rn - if (aresult /= "0.3139999928E-2") stop 24 + if (aresult /= "0.3139999928E-02") stop 24 afmt = "(E0.10e0)" write (aresult,fmt=afmt) rn if (aresult /= "0.3139999928E-2") stop 27 write (aresult,fmt="(D0.3)") rn - if (aresult /= "0.314D-2") stop 29 + if (aresult /= "0.314D-02") stop 29 write (aresult,fmt="(E0.10)") rn - if (aresult /= "0.3139999928E-2") stop 31 + if (aresult /= "0.3139999928E-02") stop 31 write (aresult,fmt="(ES0.10)") rn - if (aresult /= "3.1399999280E-3") stop 33 + if (aresult /= "3.1399999280E-03") stop 33 write (aresult,fmt="(EN0.10)") rn - if (aresult /= "3.1399999280E-3") stop 35 + if (aresult /= "3.1399999280E-03") stop 35 write (aresult,fmt="(G0.10)") rn - if (aresult /= "0.3139999928E-2") stop 37 + if (aresult /= "0.3139999928E-02") stop 37 write (aresult,fmt="(E0.10e0)") rn if (aresult /= "0.3139999928E-2") stop 39 write (aresult,fmt="(E0.10e3)") rn diff --git a/gcc/testsuite/gfortran.dg/g77/f90-intrinsic-bit.f b/gcc/testsuite/gfortran.dg/g77/f90-intrinsic-bit.f index 0ce45de..2f03db1 100644 --- a/gcc/testsuite/gfortran.dg/g77/f90-intrinsic-bit.f +++ b/gcc/testsuite/gfortran.dg/g77/f90-intrinsic-bit.f @@ -1,4 +1,5 @@ c { dg-do run } +c { dg-options " " } c f90-intrinsic-bit.f c c Test Fortran 90 diff --git a/gcc/testsuite/gfortran.dg/g77/f90-intrinsic-mathematical.f b/gcc/testsuite/gfortran.dg/g77/f90-intrinsic-mathematical.f index d151fd0..f07336e 100644 --- a/gcc/testsuite/gfortran.dg/g77/f90-intrinsic-mathematical.f +++ b/gcc/testsuite/gfortran.dg/g77/f90-intrinsic-mathematical.f @@ -1,4 +1,5 @@ c { dg-do run } +c { dg-options " " } c f90-intrinsic-mathematical.f c c Test Fortran 90 intrinsic mathematical functions - Section 13.10.3 and diff --git a/gcc/testsuite/gfortran.dg/g77/f90-intrinsic-numeric.f b/gcc/testsuite/gfortran.dg/g77/f90-intrinsic-numeric.f index c8d7c56..c01efe6 100644 --- a/gcc/testsuite/gfortran.dg/g77/f90-intrinsic-numeric.f +++ b/gcc/testsuite/gfortran.dg/g77/f90-intrinsic-numeric.f @@ -1,4 +1,5 @@ c { dg-do run } +c { dg-options " " } c f90-intrinsic-numeric.f c c Test Fortran 90 intrinsic numeric functions - Section 13.10.2 and 13.13 diff --git a/gcc/testsuite/gfortran.dg/g77/intrinsic-unix-bessel.f b/gcc/testsuite/gfortran.dg/g77/intrinsic-unix-bessel.f index b388806..406a8e4 100644 --- a/gcc/testsuite/gfortran.dg/g77/intrinsic-unix-bessel.f +++ b/gcc/testsuite/gfortran.dg/g77/intrinsic-unix-bessel.f @@ -1,4 +1,5 @@ c { dg-do run } +c { dg-options " " } c intrinsic-unix-bessel.f c c Test Bessel function intrinsics. diff --git a/gcc/testsuite/gfortran.dg/g77/intrinsic-unix-erf.f b/gcc/testsuite/gfortran.dg/g77/intrinsic-unix-erf.f index 250519a..6ed9590 100644 --- a/gcc/testsuite/gfortran.dg/g77/intrinsic-unix-erf.f +++ b/gcc/testsuite/gfortran.dg/g77/intrinsic-unix-erf.f @@ -1,4 +1,5 @@ c { dg-do run } +c { dg-options " " } c intrinsic-unix-erf.f c c Test Bessel function intrinsics. diff --git a/gcc/testsuite/gfortran.dg/goacc/routine-1.f90 b/gcc/testsuite/gfortran.dg/goacc/routine-1.f90 index 67c5f11..14617ad 100644 --- a/gcc/testsuite/gfortran.dg/goacc/routine-1.f90 +++ b/gcc/testsuite/gfortran.dg/goacc/routine-1.f90 @@ -4,7 +4,7 @@ integer :: a(n), i integer, external :: fact i = 1 - !$acc routine (fact) ! { dg-error "Unexpected \\\!\\\$ACC ROUTINE" } + !$acc routine (fact) ! { dg-error "\\!\\\$ACC ROUTINE statement at \\(1\\) cannot appear after executable statements" } !$acc routine () ! { dg-error "Syntax error in \\\!\\\$ACC ROUTINE \\\( NAME \\\)" } !$acc parallel !$acc loop @@ -21,7 +21,7 @@ recursive function fact (x) result (res) integer, intent(in) :: x integer :: res res = 1 - !$acc routine ! { dg-error "Unexpected \\\!\\\$ACC ROUTINE" } + !$acc routine ! { dg-error "\\!\\\$ACC ROUTINE statement at \\(1\\) cannot appear after executable statements" } if (x < 1) then res = 1 else @@ -32,6 +32,6 @@ subroutine incr (x) integer, intent(inout) :: x integer i i = 0 - !$acc routine ! { dg-error "Unexpected \\\!\\\$ACC ROUTINE" } + !$acc routine ! { dg-error "\\!\\\$ACC ROUTINE statement at \\(1\\) cannot appear after executable statements" } x = x + 1 end subroutine incr diff --git a/gcc/testsuite/gfortran.dg/goacc/routine-2.f90 b/gcc/testsuite/gfortran.dg/goacc/routine-2.f90 index 3be3351..6188bd8 100644 --- a/gcc/testsuite/gfortran.dg/goacc/routine-2.f90 +++ b/gcc/testsuite/gfortran.dg/goacc/routine-2.f90 @@ -7,7 +7,7 @@ integer :: res integer i i = 0 - !$acc routine ! { dg-error "Unexpected \\\!\\\$ACC ROUTINE" } + !$acc routine ! { dg-error "\\!\\\$ACC ROUTINE statement at \\(1\\) cannot appear after executable statements" } if (x < 1) then res = 1 else diff --git a/gcc/testsuite/gfortran.dg/gomp/allocate-15.f90 b/gcc/testsuite/gfortran.dg/gomp/allocate-15.f90 index e3ef841..55e4a1a 100644 --- a/gcc/testsuite/gfortran.dg/gomp/allocate-15.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/allocate-15.f90 @@ -25,7 +25,7 @@ subroutine common use m integer :: a,b,c(5) common /my/ a,b,c ! { dg-error "Sorry, !.OMP allocate for COMMON block variable 'my' at .1. not supported" } - !$omp allocate(/my/) allocator(omp_cgroup_mem_alloc) + !$omp allocate(/my/) allocator(omp_low_lat_mem_alloc) end integer function allocators() result(res) diff --git a/gcc/testsuite/gfortran.dg/gomp/allocate-7.f90 b/gcc/testsuite/gfortran.dg/gomp/allocate-7.f90 index ab85e32..e919f78 100644 --- a/gcc/testsuite/gfortran.dg/gomp/allocate-7.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/allocate-7.f90 @@ -72,9 +72,9 @@ common /com4/ y,z allocatable :: q pointer :: b !$omp allocate (c, d) allocator (omp_pteam_mem_alloc) -!$omp allocate (/com4/) allocator (omp_pteam_mem_alloc) +!$omp allocate (/com4/) allocator (omp_low_lat_mem_alloc) !$omp allocate (c) allocator (omp_pteam_mem_alloc) ! { dg-error "Duplicated variable 'c' in !.OMP ALLOCATE" } -!$omp allocate (/com4/) allocator (omp_pteam_mem_alloc) ! { dg-error "Duplicated common block '/com4/' in !.OMP ALLOCATE" } +!$omp allocate (/com4/) allocator (omp_low_lat_mem_alloc) ! { dg-error "Duplicated common block '/com4/' in !.OMP ALLOCATE" } !$omp allocate(q,x) ! { dg-error "Unexpected allocatable variable 'q' at .1. in declarative !.OMP ALLOCATE directive" } !$omp allocate(b,e) ! { dg-error "Unexpected pointer variable 'b' at .1. in declarative !.OMP ALLOCATE directive" } diff --git a/gcc/testsuite/gfortran.dg/gomp/allocate-static-3.f90 b/gcc/testsuite/gfortran.dg/gomp/allocate-static-3.f90 new file mode 100644 index 0000000..28a638c --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/allocate-static-3.f90 @@ -0,0 +1,245 @@ +! { dg-do compile } +! +! PR fortran/122892 +! +! OpenMP 6.0 clarified that the omp_{cgroup,pteam,thread}_mem_alloc +! (i.e. those with access trait != device) may only be used for +! static local variables. +! Check for this! + +module omp_lib_kinds + use iso_c_binding, only: c_int, c_intptr_t + implicit none + private :: c_int, c_intptr_t + integer, parameter :: omp_allocator_handle_kind = c_intptr_t + + integer (kind=omp_allocator_handle_kind), & + parameter :: omp_null_allocator = 0 + integer (kind=omp_allocator_handle_kind), & + parameter :: omp_default_mem_alloc = 1 + integer (kind=omp_allocator_handle_kind), & + parameter :: omp_large_cap_mem_alloc = 2 + integer (kind=omp_allocator_handle_kind), & + parameter :: omp_const_mem_alloc = 3 + integer (kind=omp_allocator_handle_kind), & + parameter :: omp_high_bw_mem_alloc = 4 + integer (kind=omp_allocator_handle_kind), & + parameter :: omp_low_lat_mem_alloc = 5 + integer (kind=omp_allocator_handle_kind), & + parameter :: omp_cgroup_mem_alloc = 6 + integer (kind=omp_allocator_handle_kind), & + parameter :: omp_pteam_mem_alloc = 7 + integer (kind=omp_allocator_handle_kind), & + parameter :: omp_thread_mem_alloc = 8 +end module + +block data + use omp_lib_kinds + implicit none + integer :: i1,i2,i3,i4,i5,i6,i7,i8 + common /b_i1/ i1 + common /b_i2/ i2 + common /b_i3/ i3 + common /b_i4/ i4 + common /b_i5/ i5 + common /b_i6/ i6 + common /b_i7/ i7 + common /b_i8/ i8 + + data i1 / 1 / + data i2 / 2 / + data i3 / 3 / + data i4 / 4 / + data i5 / 5 / + data i6 / 6 / + data i7 / 7 / + data i8 / 8 / + + !$omp allocate(/b_i1/) allocator(omp_default_mem_alloc) + !$omp allocate(/b_i2/) allocator(omp_large_cap_mem_alloc) + !$omp allocate(/b_i3/) allocator(omp_const_mem_alloc) + !$omp allocate(/b_i4/) allocator(omp_high_bw_mem_alloc) + !$omp allocate(/b_i5/) allocator(omp_low_lat_mem_alloc) + !$omp allocate(/b_i6/) allocator(omp_cgroup_mem_alloc) ! { dg-error "Predefined allocator 'omp_cgroup_mem_alloc' in ALLOCATOR clause at .1., used for list item '/b_i6/' at .2., may only be used for local static variables" } + !$omp allocate(/b_i7/) allocator(omp_pteam_mem_alloc) ! { dg-error "Predefined allocator 'omp_pteam_mem_alloc' in ALLOCATOR clause at .1., used for list item '/b_i7/' at .2., may only be used for local static variables" } + !$omp allocate(/b_i8/) allocator(omp_thread_mem_alloc) ! { dg-error "Predefined allocator 'omp_thread_mem_alloc' in ALLOCATOR clause at .1., used for list item '/b_i8/' at .2., may only be used for local static variables" } +end block data + +block data my_block_data + use omp_lib_kinds + implicit none + integer :: j1,j2,j3,j4,j5,j6,j7,j8 + common /b_j1/ j1 + common /b_j2/ j2 + common /b_j3/ j3 + common /b_j4/ j4 + common /b_j5/ j5 + common /b_j6/ j6 + common /b_j7/ j7 + common /b_j8/ j8 + + data j1 / 1 / + data j2 / 2 / + data j3 / 3 / + data j4 / 4 / + data j5 / 5 / + data j6 / 6 / + data j7 / 7 / + data j8 / 8 / + + !$omp allocate(/b_j1/) allocator(omp_default_mem_alloc) + !$omp allocate(/b_j2/) allocator(omp_large_cap_mem_alloc) + !$omp allocate(/b_j3/) allocator(omp_const_mem_alloc) + !$omp allocate(/b_j4/) allocator(omp_high_bw_mem_alloc) + !$omp allocate(/b_j5/) allocator(omp_low_lat_mem_alloc) + !$omp allocate(/b_j6/) allocator(omp_cgroup_mem_alloc) ! { dg-error "Predefined allocator 'omp_cgroup_mem_alloc' in ALLOCATOR clause at .1., used for list item '/b_j6/' at .2., may only be used for local static variables" } + !$omp allocate(/b_j7/) allocator(omp_pteam_mem_alloc) ! { dg-error "Predefined allocator 'omp_pteam_mem_alloc' in ALLOCATOR clause at .1., used for list item '/b_j7/' at .2., may only be used for local static variables" } + !$omp allocate(/b_j8/) allocator(omp_thread_mem_alloc) ! { dg-error "Predefined allocator 'omp_thread_mem_alloc' in ALLOCATOR clause at .1., used for list item '/b_j8/' at .2., may only be used for local static variables" } +end block data my_block_data + +module m + use omp_lib_kinds + implicit none + + integer :: a1,a2,a3,a4,a5,a6,a7,a8 + integer :: b1,b2,b3,b4,b5,b6,b7,b8 + common /b_b1/ b1 + common /b_b2/ b2 + common /b_b3/ b3 + common /b_b4/ b4 + common /b_b5/ b5 + common /b_b6/ b6 + common /b_b7/ b7 + common /b_b8/ b8 + + !$omp allocate(a1) allocator(omp_default_mem_alloc) + !$omp allocate(a2) allocator(omp_large_cap_mem_alloc) + !$omp allocate(a3) allocator(omp_const_mem_alloc) + !$omp allocate(a4) allocator(omp_high_bw_mem_alloc) + !$omp allocate(a5) allocator(omp_low_lat_mem_alloc) + !$omp allocate(a6) allocator(omp_cgroup_mem_alloc) ! { dg-error "Predefined allocator 'omp_cgroup_mem_alloc' in ALLOCATOR clause at .1., used for list item 'a6' at .2., may only be used for local static variables" } + !$omp allocate(a7) allocator(omp_pteam_mem_alloc) ! { dg-error "Predefined allocator 'omp_pteam_mem_alloc' in ALLOCATOR clause at .1., used for list item 'a7' at .2., may only be used for local static variables" } + !$omp allocate(a8) allocator(omp_thread_mem_alloc) ! { dg-error "Predefined allocator 'omp_thread_mem_alloc' in ALLOCATOR clause at .1., used for list item 'a8' at .2., may only be used for local static variables" } + + !$omp allocate(/b_b1/) allocator(omp_default_mem_alloc) + !$omp allocate(/b_b2/) allocator(omp_large_cap_mem_alloc) + !$omp allocate(/b_b3/) allocator(omp_const_mem_alloc) + !$omp allocate(/b_b4/) allocator(omp_high_bw_mem_alloc) + !$omp allocate(/b_b5/) allocator(omp_low_lat_mem_alloc) + !$omp allocate(/b_b6/) allocator(omp_cgroup_mem_alloc) ! { dg-error "Predefined allocator 'omp_cgroup_mem_alloc' in ALLOCATOR clause at .1., used for list item '/b_b6/' at .2., may only be used for local static variables" } + !$omp allocate(/b_b7/) allocator(omp_pteam_mem_alloc) ! { dg-error "Predefined allocator 'omp_pteam_mem_alloc' in ALLOCATOR clause at .1., used for list item '/b_b7/' at .2., may only be used for local static variables" } + !$omp allocate(/b_b8/) allocator(omp_thread_mem_alloc) ! { dg-error "Predefined allocator 'omp_thread_mem_alloc' in ALLOCATOR clause at .1., used for list item '/b_b8/' at .2., may only be used for local static variables" } +end + +program main + use omp_lib_kinds + implicit none + + integer m1,m2,m3,m4,m5,m6,m7,m8 + integer n1,n2,n3,n4,n5,n6,n7,n8 + common /b_n1/ n1 + common /b_n2/ n2 + common /b_n3/ n3 + common /b_n4/ n4 + common /b_n5/ n5 + common /b_n6/ n6 + common /b_n7/ n7 + common /b_n8/ n8 + + !$omp allocate(m1) allocator(omp_default_mem_alloc) + !$omp allocate(m2) allocator(omp_large_cap_mem_alloc) + !$omp allocate(m3) allocator(omp_const_mem_alloc) + !$omp allocate(m4) allocator(omp_high_bw_mem_alloc) + !$omp allocate(m5) allocator(omp_low_lat_mem_alloc) + !$omp allocate(m6) allocator(omp_cgroup_mem_alloc) ! { dg-error "Predefined allocator 'omp_cgroup_mem_alloc' in ALLOCATOR clause at .1., used for list item 'm6' at .2., may only be used for local static variables" } + !$omp allocate(m7) allocator(omp_pteam_mem_alloc) ! { dg-error "Predefined allocator 'omp_pteam_mem_alloc' in ALLOCATOR clause at .1., used for list item 'm7' at .2., may only be used for local static variables" } + !$omp allocate(m8) allocator(omp_thread_mem_alloc) ! { dg-error "Predefined allocator 'omp_thread_mem_alloc' in ALLOCATOR clause at .1., used for list item 'm8' at .2., may only be used for local static variables" } + + !$omp allocate(/b_n1/) allocator(omp_default_mem_alloc) + !$omp allocate(/b_n2/) allocator(omp_large_cap_mem_alloc) + !$omp allocate(/b_n3/) allocator(omp_const_mem_alloc) + !$omp allocate(/b_n4/) allocator(omp_high_bw_mem_alloc) + !$omp allocate(/b_n5/) allocator(omp_low_lat_mem_alloc) + !$omp allocate(/b_n6/) allocator(omp_cgroup_mem_alloc) ! { dg-error "Predefined allocator 'omp_cgroup_mem_alloc' in ALLOCATOR clause at .1., used for list item '/b_n6/' at .2., may only be used for local static variables" } + !$omp allocate(/b_n7/) allocator(omp_pteam_mem_alloc) ! { dg-error "Predefined allocator 'omp_pteam_mem_alloc' in ALLOCATOR clause at .1., used for list item '/b_n7/' at .2., may only be used for local static variables" } + !$omp allocate(/b_n8/) allocator(omp_thread_mem_alloc) ! { dg-error "Predefined allocator 'omp_thread_mem_alloc' in ALLOCATOR clause at .1., used for list item '/b_n8/' at .2., may only be used for local static variables" } + + block + integer, save :: o1,o2,o3,o4,o5,o6,o7,o8 + ! NOTE: COMMON statement is not allowed inside of BLOCK + + !$omp allocate(o1) allocator(omp_default_mem_alloc) + !$omp allocate(o2) allocator(omp_large_cap_mem_alloc) + !$omp allocate(o3) allocator(omp_const_mem_alloc) + !$omp allocate(o4) allocator(omp_high_bw_mem_alloc) + !$omp allocate(o5) allocator(omp_low_lat_mem_alloc) + !$omp allocate(o6) allocator(omp_cgroup_mem_alloc) + !$omp allocate(o7) allocator(omp_pteam_mem_alloc) + !$omp allocate(o8) allocator(omp_thread_mem_alloc) + end block +end + +subroutine sub + use omp_lib_kinds + implicit none + + integer, save :: s1,s2,s3,s4,s5,s6,s7,s8 + integer t1,t2,t3,t4,t5,t6,t7,t8 + common /b_t1/ t1 + common /b_t2/ t2 + common /b_t3/ t3 + common /b_t4/ t4 + common /b_t5/ t5 + common /b_t6/ t6 + common /b_t7/ t7 + common /b_t8/ t8 + + !$omp allocate(s1) allocator(omp_default_mem_alloc) + !$omp allocate(s2) allocator(omp_large_cap_mem_alloc) + !$omp allocate(s3) allocator(omp_const_mem_alloc) + !$omp allocate(s4) allocator(omp_high_bw_mem_alloc) + !$omp allocate(s5) allocator(omp_low_lat_mem_alloc) + !$omp allocate(s6) allocator(omp_cgroup_mem_alloc) + !$omp allocate(s7) allocator(omp_pteam_mem_alloc) + !$omp allocate(s8) allocator(omp_thread_mem_alloc) + + !$omp allocate(/b_t1/) allocator(omp_default_mem_alloc) + !$omp allocate(/b_t2/) allocator(omp_large_cap_mem_alloc) + !$omp allocate(/b_t3/) allocator(omp_const_mem_alloc) + !$omp allocate(/b_t4/) allocator(omp_high_bw_mem_alloc) + !$omp allocate(/b_t5/) allocator(omp_low_lat_mem_alloc) + !$omp allocate(/b_t6/) allocator(omp_cgroup_mem_alloc) ! { dg-error "Predefined allocator 'omp_cgroup_mem_alloc' in ALLOCATOR clause at .1., used for list item '/b_t6/' at .2., may only be used for local static variables" } + !$omp allocate(/b_t7/) allocator(omp_pteam_mem_alloc) ! { dg-error "Predefined allocator 'omp_pteam_mem_alloc' in ALLOCATOR clause at .1., used for list item '/b_t7/' at .2., may only be used for local static variables" } + !$omp allocate(/b_t8/) allocator(omp_thread_mem_alloc) ! { dg-error "Predefined allocator 'omp_thread_mem_alloc' in ALLOCATOR clause at .1., used for list item '/b_t8/' at .2., may only be used for local static variables" } +contains + integer function func() + integer, save :: q1,q2,q3,q4,q5,q6,q7,q8 + integer r1,r2,r3,r4,r5,r6,r7,r8 + common /b_r1/ r1 + common /b_r2/ r2 + common /b_r3/ r3 + common /b_r4/ r4 + common /b_r5/ r5 + common /b_r6/ r6 + common /b_r7/ r7 + common /b_r8/ r8 + + !$omp allocate(q1) allocator(omp_default_mem_alloc) + !$omp allocate(q2) allocator(omp_large_cap_mem_alloc) + !$omp allocate(q3) allocator(omp_const_mem_alloc) + !$omp allocate(q4) allocator(omp_high_bw_mem_alloc) + !$omp allocate(q5) allocator(omp_low_lat_mem_alloc) + !$omp allocate(q6) allocator(omp_cgroup_mem_alloc) + !$omp allocate(q7) allocator(omp_pteam_mem_alloc) + !$omp allocate(q8) allocator(omp_thread_mem_alloc) + + !$omp allocate(/b_r1/) allocator(omp_default_mem_alloc) + !$omp allocate(/b_r2/) allocator(omp_large_cap_mem_alloc) + !$omp allocate(/b_r3/) allocator(omp_const_mem_alloc) + !$omp allocate(/b_r4/) allocator(omp_high_bw_mem_alloc) + !$omp allocate(/b_r5/) allocator(omp_low_lat_mem_alloc) + !$omp allocate(/b_r6/) allocator(omp_cgroup_mem_alloc) ! { dg-error "Predefined allocator 'omp_cgroup_mem_alloc' in ALLOCATOR clause at .1., used for list item '/b_r6/' at .2., may only be used for local static variables" } + !$omp allocate(/b_r7/) allocator(omp_pteam_mem_alloc) ! { dg-error "Predefined allocator 'omp_pteam_mem_alloc' in ALLOCATOR clause at .1., used for list item '/b_r7/' at .2., may only be used for local static variables" } + !$omp allocate(/b_r8/) allocator(omp_thread_mem_alloc) ! { dg-error "Predefined allocator 'omp_thread_mem_alloc' in ALLOCATOR clause at .1., used for list item '/b_r8/' at .2., may only be used for local static variables" } + end function +end subroutine diff --git a/gcc/testsuite/gfortran.dg/gomp/crayptr2.f90 b/gcc/testsuite/gfortran.dg/gomp/crayptr2.f90 index 476d7b9..06ac604 100644 --- a/gcc/testsuite/gfortran.dg/gomp/crayptr2.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/crayptr2.f90 @@ -3,7 +3,7 @@ ! { dg-require-effective-target tls } module crayptr2 - integer :: e ! { dg-error "CRAY POINTEE attribute conflicts with THREADPRIVATE" } + integer :: e pointer (ip5, e) ! The standard is not very clear about this. @@ -12,6 +12,6 @@ module crayptr2 ! be if they are module variables. But threadprivate pointees don't ! make any sense anyway. -!$omp threadprivate (e) +!$omp threadprivate (e) ! { dg-error "CRAY POINTEE attribute conflicts with THREADPRIVATE" } end module crayptr2 diff --git a/gcc/testsuite/gfortran.dg/gomp/declare-target-2.f90 b/gcc/testsuite/gfortran.dg/gomp/declare-target-2.f90 index 93075fb..b4f1e52 100644 --- a/gcc/testsuite/gfortran.dg/gomp/declare-target-2.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/declare-target-2.f90 @@ -24,7 +24,11 @@ module declare_target_2 end interface end subroutine bar + !$omp declare target enter (q) ! { dg-error "isn.t SAVEd" } + !$omp declare target link (r) ! { dg-error "isn.t SAVEd" } + !$omp declare target local (s) ! { dg-error "isn.t SAVEd" } !$omp declare target link (baz) ! { dg-error "isn.t SAVEd" } + integer :: q, r, s call baz ! { dg-error "attribute conflicts" } end subroutine subroutine foo ! { dg-error "attribute conflicts" } diff --git a/gcc/testsuite/gfortran.dg/gomp/declare-target-4.f90 b/gcc/testsuite/gfortran.dg/gomp/declare-target-4.f90 index 55534d8..296c0db 100644 --- a/gcc/testsuite/gfortran.dg/gomp/declare-target-4.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/declare-target-4.f90 @@ -42,15 +42,14 @@ module mymod !$omp declare target to(a) device_type(nohost) !$omp declare target to(b) device_type(host) !$omp declare target to(c) device_type(any) - ! Fails in ME with "Error: wrong number of arguments specified for 'omp declare target link' attribute" - ! !$omp declare target link(e) device_type(nohost) - ! !$omp declare target link(f) device_type(host) - ! !$omp declare target link(g) device_type(any) + ! !$omp declare target link(e) device_type(nohost) ! -> invalid: only 'any' is permitted + ! !$omp declare target link(f) device_type(host) ! -> invalid: only 'any' is permitted + !$omp declare target link(g) device_type(any) !$omp declare target to(/block1/) device_type(nohost) !$omp declare target to(/block2/) device_type(host) !$omp declare target to(/block3/) device_type(any) - !$omp declare target link(/block4/) device_type(nohost) + ! !$omp declare target link(/block4/) device_type(nohost) ! -> invalid, link requires host or any !$omp declare target link(/block5/) device_type(host) !$omp declare target link(/block6/) device_type(any) contains diff --git a/gcc/testsuite/gfortran.dg/gomp/declare-target-5.f90 b/gcc/testsuite/gfortran.dg/gomp/declare-target-5.f90 index 76687d4..0dacb89 100644 --- a/gcc/testsuite/gfortran.dg/gomp/declare-target-5.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/declare-target-5.f90 @@ -4,9 +4,15 @@ end subroutine bar() !$omp declare target to(bar) device_type(nohost) - !$omp declare target to(bar) device_type(host) ! { dg-error "previous OMP DECLARE TARGET directive to a different DEVICE_TYPE" } + !$omp declare target to(bar) device_type(host) ! { dg-error "set in previous OMP DECLARE TARGET directive to the different DEVICE_TYPE 'nohost'" } end +module invalid + implicit none + integer :: d + !$omp declare target link(d) device_type(nohost) ! { dg-error "set with NOHOST specified may not appear in a LINK clause" } +end module + module mymod_one implicit none integer :: a, b, c, d, e ,f @@ -17,24 +23,21 @@ module mymod_one !$omp declare target to(a) device_type(nohost) !$omp declare target to(b) device_type(any) !$omp declare target to(c) device_type(host) - !$omp declare target link(d) device_type(nohost) !$omp declare target link(e) device_type(any) !$omp declare target link(f) device_type(host) !$omp declare target to(c) device_type(host) - !$omp declare target link(d) device_type(nohost) end module module mtest use mymod_one ! { dg-error "Cannot change attributes of USE-associated symbol" } implicit none - !$omp declare target to(a) device_type(any) ! { dg-error "previous OMP DECLARE TARGET directive to a different DEVICE_TYPE" } - !$omp declare target to(b) device_type(host) ! { dg-error "previous OMP DECLARE TARGET directive to a different DEVICE_TYPE" } - !$omp declare target to(c) device_type(nohost) ! { dg-error "previous OMP DECLARE TARGET directive to a different DEVICE_TYPE" } - !$omp declare target link(d) device_type(host) ! { dg-error "previous OMP DECLARE TARGET directive to a different DEVICE_TYPE" } - !$omp declare target link(e) device_type(nohost) ! { dg-error "previous OMP DECLARE TARGET directive to a different DEVICE_TYPE" } - !$omp declare target link(f) device_type(any) ! { dg-error "previous OMP DECLARE TARGET directive to a different DEVICE_TYPE" } + !$omp declare target to(a) device_type(any) ! { dg-error "set in previous OMP DECLARE TARGET directive to the different DEVICE_TYPE 'nohost'" } + !$omp declare target to(b) device_type(host) ! { dg-error "set in previous OMP DECLARE TARGET directive to the different DEVICE_TYPE 'any'" } + !$omp declare target to(c) device_type(nohost) ! { dg-error "set in previous OMP DECLARE TARGET directive to the different DEVICE_TYPE 'host'" } + !$omp declare target link(e) device_type(host) ! { dg-error "set in previous OMP DECLARE TARGET directive to the different DEVICE_TYPE 'any'" } + !$omp declare target link(f) device_type(any) ! { dg-error "set in previous OMP DECLARE TARGET directive to the different DEVICE_TYPE 'host'" } end module module mymod @@ -47,17 +50,15 @@ module mymod !$omp declare target to(a) device_type(nohost) !$omp declare target to(b) device_type(any) !$omp declare target to(c) device_type(host) - !$omp declare target link(d) device_type(nohost) + !$omp declare target link(d) device_type(nohost) ! { dg-error "set with NOHOST specified may not appear in a LINK clause" } !$omp declare target link(e) device_type(any) !$omp declare target link(f) device_type(host) !$omp declare target to(c) device_type(host) - !$omp declare target link(d) device_type(nohost) - - !$omp declare target to(a) device_type(any) ! { dg-error "previous OMP DECLARE TARGET directive to a different DEVICE_TYPE" } - !$omp declare target to(b) device_type(host) ! { dg-error "previous OMP DECLARE TARGET directive to a different DEVICE_TYPE" } - !$omp declare target to(c) device_type(nohost) ! { dg-error "previous OMP DECLARE TARGET directive to a different DEVICE_TYPE" } - !$omp declare target link(d) device_type(host) ! { dg-error "previous OMP DECLARE TARGET directive to a different DEVICE_TYPE" } - !$omp declare target link(e) device_type(nohost) ! { dg-error "previous OMP DECLARE TARGET directive to a different DEVICE_TYPE" } - !$omp declare target link(f) device_type(any) ! { dg-error "previous OMP DECLARE TARGET directive to a different DEVICE_TYPE" } + + !$omp declare target to(a) device_type(any) ! { dg-error "set in previous OMP DECLARE TARGET directive to the different DEVICE_TYPE 'nohost'" } + !$omp declare target to(b) device_type(host) ! { dg-error "set in previous OMP DECLARE TARGET directive to the different DEVICE_TYPE 'any'" } + !$omp declare target to(c) device_type(nohost) ! { dg-error "set in previous OMP DECLARE TARGET directive to the different DEVICE_TYPE 'host'" } + !$omp declare target link(e) device_type(host) ! { dg-error "set in previous OMP DECLARE TARGET directive to the different DEVICE_TYPE 'any'" } + !$omp declare target link(f) device_type(any) ! { dg-error "set in previous OMP DECLARE TARGET directive to the different DEVICE_TYPE 'host'" } end diff --git a/gcc/testsuite/gfortran.dg/gomp/declare-target-6.f90 b/gcc/testsuite/gfortran.dg/gomp/declare-target-6.f90 new file mode 100644 index 0000000..21970e6 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/declare-target-6.f90 @@ -0,0 +1,15 @@ +subroutine sub ! { dg-error "SUBROUTINE attribute conflicts with OMP DECLARE TARGET LINK attribute in 'sub'" } + !$omp declare target link(sub) +end subroutine sub + +subroutine sub2 ! { dg-error "SUBROUTINE attribute conflicts with OMP DECLARE TARGET LOCAL attribute in 'sub2'" } + !$omp declare target local(sub2) +end subroutine sub2 + +integer function func() ! { dg-error "PROCEDURE attribute conflicts with OMP DECLARE TARGET LINK attribute in 'func'" } + !$omp declare target link(func) +end + +integer function func2() ! { dg-error "PROCEDURE attribute conflicts with OMP DECLARE TARGET LOCAL attribute in 'func2'" } + !$omp declare target local(func2) +end diff --git a/gcc/testsuite/gfortran.dg/gomp/declare-target-indirect-2.f90 b/gcc/testsuite/gfortran.dg/gomp/declare-target-indirect-2.f90 index f6b3ae1..4345c69 100644 --- a/gcc/testsuite/gfortran.dg/gomp/declare-target-indirect-2.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/declare-target-indirect-2.f90 @@ -11,7 +11,7 @@ contains subroutine sub2 !$omp declare target indirect (.false.) to (sub2) end subroutine - ! { dg-final { scan-tree-dump "__attribute__\\\(\\\(omp declare target\\\)\\\)\\\n.*\\\nvoid sub2" "gimple" } } + ! { dg-final { scan-tree-dump "__attribute__\\\(\\\(omp declare target \\(device_type\\(any\\)\\)\\\)\\\)\\\n.*\\\nvoid sub2" "gimple" } } subroutine sub3 !$omp declare target indirect (.true.) to (sub3) @@ -21,5 +21,5 @@ contains subroutine sub4 !$omp declare target indirect (.false.) enter (sub4) end subroutine - ! { dg-final { scan-tree-dump "__attribute__\\\(\\\(omp declare target\\\)\\\)\\\n.*\\\nvoid sub4" "gimple" } } + ! { dg-final { scan-tree-dump "__attribute__\\\(\\\(omp declare target \\(device_type\\(any\\)\\)\\\)\\\)\\\n.*\\\nvoid sub4" "gimple" } } end module diff --git a/gcc/testsuite/gfortran.dg/gomp/declare-variant-17.f90 b/gcc/testsuite/gfortran.dg/gomp/declare-variant-17.f90 index df57f9c..ae5ca95 100644 --- a/gcc/testsuite/gfortran.dg/gomp/declare-variant-17.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/declare-variant-17.f90 @@ -7,11 +7,11 @@ program main continue - !$omp declare variant (base: variant) match (construct={parallel}) ! { dg-error "Unexpected \\\!\\\$OMP DECLARE VARIANT statement at .1." } + !$omp declare variant (base: variant) match (construct={parallel}) ! { dg-error "\\!\\\$OMP DECLARE VARIANT statement at \\(1\\) cannot appear after executable statements" } contains subroutine base () continue - !$omp declare variant (variant) match (construct={parallel}) ! { dg-error "Unexpected \\\!\\\$OMP DECLARE VARIANT statement at .1." } + !$omp declare variant (variant) match (construct={parallel}) ! { dg-error "\\!\\\$OMP DECLARE VARIANT statement at \\(1\\) cannot appear after executable statements" } end subroutine end program diff --git a/gcc/testsuite/gfortran.dg/gomp/dyn_groupprivate-1.f90 b/gcc/testsuite/gfortran.dg/gomp/dyn_groupprivate-1.f90 new file mode 100644 index 0000000..a3f8615 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/dyn_groupprivate-1.f90 @@ -0,0 +1,29 @@ +! { dg-do compile } +! { dg-additional-options "-fdump-tree-original" } + +implicit none + +integer :: N +N = 1024 + +!$omp target dyn_groupprivate(1024) ! { dg-message "sorry, unimplemented: 'dyn_groupprivate' clause" } +!$omp end target + +!$omp target dyn_groupprivate (1024 * N) ! { dg-message "sorry, unimplemented: 'dyn_groupprivate' clause" } +!$omp end target + +!$omp target dyn_groupprivate ( fallback ( abort ) : N) ! { dg-message "sorry, unimplemented: 'dyn_groupprivate' clause" } +!$omp end target + +!$omp target dyn_groupprivate ( fallback ( null ) : N) ! { dg-message "sorry, unimplemented: 'dyn_groupprivate' clause" } +!$omp end target + +!$omp target dyn_groupprivate ( fallback ( default_mem ) : N) ! { dg-message "sorry, unimplemented: 'dyn_groupprivate' clause" } +!$omp end target +end + +! { dg-final { scan-tree-dump-times "#pragma omp target dyn_groupprivate\\(1024\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp target dyn_groupprivate\\(D\\.\[0-9\]+\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp target dyn_groupprivate\\(fallback\\(abort\\):n\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp target dyn_groupprivate\\(fallback\\(null\\):n\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp target dyn_groupprivate\\(fallback\\(default_mem\\):n\\)" 1 "original" } } diff --git a/gcc/testsuite/gfortran.dg/gomp/dyn_groupprivate-2.f90 b/gcc/testsuite/gfortran.dg/gomp/dyn_groupprivate-2.f90 new file mode 100644 index 0000000..8410334 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/dyn_groupprivate-2.f90 @@ -0,0 +1,31 @@ +! { dg-do compile } + +implicit none + +integer, parameter :: M = 1024 +integer :: N, A(1) + +N = 1024 + +!$omp target dyn_groupprivate(0) ! OK, zero is permitted +block; end block + +!$omp target dyn_groupprivate(0) dyn_groupprivate(0) ! { dg-error "Duplicated 'dyn_groupprivate' clause" } +block; end block + +!$omp target dyn_groupprivate(-123) ! { dg-warning "INTEGER expression of DYN_GROUPPRIVATE clause at .1. must be non-negative \\\[-Wopenmp\\\]" } +block; end block + +!$omp target dyn_groupprivate (0 * M-1) ! { dg-warning "INTEGER expression of DYN_GROUPPRIVATE clause at .1. must be non-negative \\\[-Wopenmp\\\]" } +block; end block + +!$omp target dyn_groupprivate ( fallback ( other ) : N) ! { dg-error "Failed to match clause" } +block; end block + +!$omp target dyn_groupprivate ( A ) ! { dg-error "DYN_GROUPPRIVATE clause at .1. requires a scalar INTEGER expression" } +block; end block + +!$omp target dyn_groupprivate ( 1024. ) ! { dg-error "DYN_GROUPPRIVATE clause at .1. requires a scalar INTEGER expression" } +block; end block + +end diff --git a/gcc/testsuite/gfortran.dg/gomp/groupprivate-1.f90 b/gcc/testsuite/gfortran.dg/gomp/groupprivate-1.f90 new file mode 100644 index 0000000..f776c08 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/groupprivate-1.f90 @@ -0,0 +1,23 @@ +module m + implicit none + integer :: ii + integer :: x, y(20), z, v, u, k ! { dg-warning "Ignoring the 'groupprivate' attribute for 'threadprivate' variable 'k' declared at .1. \\\[-Wopenmp\\\]" } +! { dg-error "Sorry, OMP GROUPPRIVATE not implemented, used by 'x' declared at .1." "" { target *-*-* } .-1 } +! { dg-error "Sorry, OMP GROUPPRIVATE not implemented, used by 'y' declared at .1." "" { target *-*-* } .-2 } +! { dg-error "Sorry, OMP GROUPPRIVATE not implemented, used by 'z' declared at .1." "" { target *-*-* } .-3 } +! { dg-error "Sorry, OMP GROUPPRIVATE not implemented, used by 'v' declared at .1." "" { target *-*-* } .-4 } +! { dg-error "Sorry, OMP GROUPPRIVATE not implemented, used by 'u' declared at .1." "" { target *-*-* } .-5 } +! +! Note:Error different as 'groupprivate' flag is overwritten by 'threadprivate', cf. warning above. +! { dg-error "Sorry, OMP DECLARE TARGET with LOCAL clause not implemented, used by 'k' declared at .1." "" { target *-*-* } .-8 } + !$omp groupprivate(x, z) device_Type( any ) + !$omp declare target local(x) device_type ( any ) + !$omp declare target enter( ii) ,local(y), device_type ( host ) + !$omp groupprivate(y) device_type( host) + !$omp groupprivate(v) device_type (nohost ) + !$omp groupprivate(u) + + ! See also (currently unresolved) OpenMP Specification Issue 4663. + !$omp groupprivate(k) + !$omp threadprivate(k) +end module diff --git a/gcc/testsuite/gfortran.dg/gomp/groupprivate-2.f90 b/gcc/testsuite/gfortran.dg/gomp/groupprivate-2.f90 new file mode 100644 index 0000000..922d229 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/groupprivate-2.f90 @@ -0,0 +1,37 @@ +module m + implicit none + integer :: ii + integer :: x, y(20), z, v, q, r,o, b2,c + + !$omp groupprivate(x, z, o) device_Type( any ) + !$omp declare target enter(x) device_type ( any ) ! { dg-error "List item 'x' at .1. not appear in the 'enter' clause as it was previously specified in a GROUPPRIVATE directive" } + !$omp declare target to(z) device_type ( any ) ! { dg-error "List item 'z' at .1. not appear in the 'to' clause as it was previously specified in a GROUPPRIVATE directive" } + !$omp declare target link(o) device_type ( any ) ! { dg-error "List item 'o' at .1. not appear in the 'link' clause as it was previously specified in a GROUPPRIVATE directive" } + !$omp declare target enter( ii) ,local(y,c), link(r), to(q) device_type ( host ) + !$omp groupprivate(r,q) device_type(host) +! { dg-error "List item 'q' at .1. implies OMP DECLARE TARGET with the LOCAL clause, but it has been specified with a different clause before" "" { target *-*-* } .-1 } +! { dg-error "List item 'r' at .1. implies OMP DECLARE TARGET with the LOCAL clause, but it has been specified with a different clause before" "" { target *-*-* } .-2 } + !$omp groupprivate(c) ! { dg-error "List item 'c' at .1. set in previous OMP DECLARE TARGET directive to the different DEVICE_TYPE 'host'" } + !$omp groupprivate(y) device_type( any) ! { dg-error "List item 'y' at .1. set in previous OMP DECLARE TARGET directive to the different DEVICE_TYPE 'host'" } + !$omp groupprivate(v) device_type (nohost ) + !$omp groupprivate(v) ! { dg-error "Duplicate OpenMP GROUPPRIVATE attribute specified" } + + !$omp declare target link(b2) device_type(nohost) ! { dg-error "List item 'b2' at .1. set with NOHOST specified may not appear in a LINK clause" } +end module + +subroutine sub() + implicit none + integer, save :: x0,x1,x2,x3,x4 + !$omp groupprivate(x0) + !$omp groupprivate(x1) + !$omp groupprivate(x2) device_type ( any) + !$omp groupprivate(x3) device_type (host ) + !$omp groupprivate(x4) device_type( nohost) + + !$omp declare target(x0) ! { dg-error "List item 'x0' at .1. not appear in the 'enter' clause as it was previously specified in a GROUPPRIVATE directive" } + !$omp declare target device_type(any) to(x1) ! { dg-error "List item 'x1' at .1. not appear in the 'to' clause as it was previously specified in a GROUPPRIVATE directive" } + !$omp declare target device_type(any) enter(x2) ! { dg-error "List item 'x2' at .1. not appear in the 'enter' clause as it was previously specified in a GROUPPRIVATE directive" } + !$omp declare target device_type(host) link(x3) ! { dg-error "List item 'x3' at .1. not appear in the 'link' clause as it was previously specified in a GROUPPRIVATE directive" } + !$omp declare target device_type(host) local(x4) ! { dg-error "List item 'x4' at .1. set in previous OMP GROUPPRIVATE directive to the different DEVICE_TYPE 'nohost'" } + +end diff --git a/gcc/testsuite/gfortran.dg/gomp/groupprivate-3.f90 b/gcc/testsuite/gfortran.dg/gomp/groupprivate-3.f90 new file mode 100644 index 0000000..d7ccbe2 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/groupprivate-3.f90 @@ -0,0 +1,16 @@ +module m +implicit none +integer :: y = 5 ! { dg-error "!.OMP GROUPPRIVATE variable 'y' at .1. must not have an initializer" } +!$omp groupprivate(y) +end + +subroutine sub + integer :: k ! { dg-error "OpenMP groupprivate variable 'k' at .1. must have the SAVE attribute" } + !$omp groupprivate(k) +end + +subroutine sub2 + !$omp groupprivate(q) + integer, save :: q + !$omp groupprivate(q) ! { dg-error "Duplicate OpenMP GROUPPRIVATE attribute specified at .1." } +end diff --git a/gcc/testsuite/gfortran.dg/gomp/groupprivate-4.f90 b/gcc/testsuite/gfortran.dg/gomp/groupprivate-4.f90 new file mode 100644 index 0000000..2a3a054 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/groupprivate-4.f90 @@ -0,0 +1,25 @@ +module m + implicit none + integer :: ii + integer :: x, y(20), z, v, u, k + + common /b_ii/ ii + common /b_x/ x ! { dg-error "Sorry, OMP GROUPPRIVATE not implemented, used by common block '/b_x/' declared at .1." } + common /b_y/ y ! { dg-error "Sorry, OMP GROUPPRIVATE not implemented, used by common block '/b_y/' declared at .1." } + common /b_z/ z ! { dg-error "Sorry, OMP GROUPPRIVATE not implemented, used by common block '/b_z/' declared at .1." } + common /b_v/ v ! { dg-error "Sorry, OMP GROUPPRIVATE not implemented, used by common block '/b_v/' declared at .1." } + common /b_u/ u ! { dg-error "Sorry, OMP GROUPPRIVATE not implemented, used by common block '/b_u/' declared at .1." } + common /b_k/ k ! { dg-warning "Ignoring the 'groupprivate' attribute for 'threadprivate' common block '/b_k/' declared at .1. \\\[-Wopenmp\\\]" } +! { dg-error "Sorry, OMP DECLARE TARGET with LOCAL clause not implemented, used by common block '/b_k/' declared at .1." "" { target *-*-* } .-1 } + + !$omp groupprivate(/b_x/, /b_z/) device_Type( any ) + !$omp declare target local(/b_x/) device_type ( any ) + !$omp declare target enter( /b_ii/) ,local(/b_y/), device_type ( host ) + !$omp groupprivate(/b_y/) device_type( host) + !$omp groupprivate(/b_v/) device_type (nohost ) + !$omp groupprivate(/b_u/) + + ! See also (currently unresolved) OpenMP Specification Issue 4663. + !$omp groupprivate(/b_k/) + !$omp threadprivate(/b_k/) +end module diff --git a/gcc/testsuite/gfortran.dg/gomp/groupprivate-5.f90 b/gcc/testsuite/gfortran.dg/gomp/groupprivate-5.f90 new file mode 100644 index 0000000..c9f89fe --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/groupprivate-5.f90 @@ -0,0 +1,58 @@ +module m + implicit none + integer :: ii + integer :: x, y(20), z, v, q, r,o, b2,c + + common /b_ii/ ii + common /b_x/ x + common /b_y/ y + common /b_z/ z + common /b_v/ v + common /b_q/ q + common /b_r/ r + common /b_o/ o + common /b_b2/ b2 + common /b_c/ c + + !$omp groupprivate(/b_x/, /b_z/, /b_o/) device_Type( any ) + !$omp declare target enter(/b_x/) device_type ( any ) ! { dg-error "Common block '/b_x/' at .1. not appear in the 'enter' clause as it was previously specified in a GROUPPRIVATE directive" } + !$omp declare target to(/b_z/) device_type ( any ) ! { dg-error "Common block '/b_z/' at .1. not appear in the 'to' clause as it was previously specified in a GROUPPRIVATE directive" } + !$omp declare target link(/b_o/) device_type ( any ) ! { dg-error "Common block '/b_o/' at .1. not appear in the 'link' clause as it was previously specified in a GROUPPRIVATE directive" } + !$omp declare target enter( / b_ii / ) ,local(/b_y/ , /b_c/), link(/b_r/), to(/b_q/) device_type ( host ) + !$omp groupprivate( /b_r/ ,/b_q/) device_type(host) +! { dg-error "List item '/b_r/' at .1. implies OMP DECLARE TARGET with the LOCAL clause, but it has been specified with a different clause before" "" { target *-*-* } .-1 } +! { dg-error "List item '/b_q/' at .1. implies OMP DECLARE TARGET with the LOCAL clause, but it has been specified with a different clause before" "" { target *-*-* } .-2 } + !$omp groupprivate(/b_c/) ! { dg-error "List item 'b_c' at .1. set in previous OMP DECLARE TARGET directive to the different DEVICE_TYPE 'host'" } + !$omp groupprivate(/b_y/) device_type( any) ! { dg-error "List item 'b_y' at .1. set in previous OMP DECLARE TARGET directive to the different DEVICE_TYPE 'host'" } + !$omp groupprivate(/b_v/) device_type (nohost ) + !$omp groupprivate(/b_v/) ! { dg-error "Duplicate OpenMP GROUPPRIVATE attribute specified at .1." } + + !$omp declare target link(/b_b2/) device_type(nohost) ! { dg-error "Common block '/b_b2/' at .1. set with NOHOST specified may not appear in a LINK clause" } +end module + +subroutine sub() + implicit none + integer, save :: xx + integer :: x0,x1,x2,x3,x4 + + common /b_xx/ xx ! { dg-error "COMMON attribute conflicts with SAVE attribute in 'xx' at .1." } + common /b_x0/ x0 + common /b_x1/ x1 + common /b_x2/ x2 + common /b_x3/ x3 + common /b_x4/ x4 + + !$omp groupprivate(/b_xx/) ! { dg-error "COMMON attribute conflicts with SAVE attribute in 'xx' at .1." } + !$omp groupprivate(/b_x0/) + !$omp groupprivate(/b_x1/) + !$omp groupprivate(/b_x2/) device_type ( any) + !$omp groupprivate(/b_x3/) device_type (host ) + !$omp groupprivate(/b_x4/) device_type( nohost) + + !$omp declare target(/b_x0/) ! { dg-error "Common block '/b_x0/' at .1. not appear in the 'enter' clause as it was previously specified in a GROUPPRIVATE directive" } + !$omp declare target device_type(any) to(/b_x1/) ! { dg-error "Common block '/b_x1/' at .1. not appear in the 'to' clause as it was previously specified in a GROUPPRIVATE directive" } + !$omp declare target device_type(any) enter(/b_x2/) ! { dg-error "Common block '/b_x2/' at .1. not appear in the 'enter' clause as it was previously specified in a GROUPPRIVATE directive" } + !$omp declare target device_type(host) link(/b_x3/) ! { dg-error "Common block '/b_x3/' at .1. not appear in the 'link' clause as it was previously specified in a GROUPPRIVATE directive" } + !$omp declare target device_type(host) local(/b_x4/) ! { dg-error "Common block '/b_x4/' at .1. set in previous OMP GROUPPRIVATE directive to the different DEVICE_TYPE 'nohost'" } + +end diff --git a/gcc/testsuite/gfortran.dg/gomp/groupprivate-6.f90 b/gcc/testsuite/gfortran.dg/gomp/groupprivate-6.f90 new file mode 100644 index 0000000..6ae5b3d --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/groupprivate-6.f90 @@ -0,0 +1,34 @@ +module m +implicit none +integer :: y = 5 ! { dg-error "!.OMP GROUPPRIVATE variable 'y' at .1. must not have an initializer" } +common /b_y/ y +!$omp groupprivate(/b_y/) +end + +subroutine sub + integer, save :: k + common /b_k/ k ! { dg-error "COMMON attribute conflicts with SAVE attribute in 'k' at .1." } + !$omp groupprivate(/b_k/) ! { dg-error "COMMON attribute conflicts with SAVE attribute in 'k' at .1." } +end + +subroutine sub2 + common /b_q/ q + !$omp groupprivate(/b_q/) + integer :: q + !$omp groupprivate(/b_q/) ! { dg-error "Duplicate OpenMP GROUPPRIVATE attribute specified at .1." } +end + +subroutine dupl + integer :: a,b,c,d + integer :: u,v,w,x + common /b_a/ a + common /b_b/ b + common /b_c/ c + common /b_d/ d + + !$omp groupprivate(/b_a/,u,/b_a/) ! { dg-error "Duplicate OpenMP GROUPPRIVATE attribute specified" } + !$omp groupprivate(v,/b_b/,v) ! { dg-error "Duplicate OpenMP GROUPPRIVATE attribute specified" } + + !$omp threadprivate(/b_a/,u,/b_a/) ! { dg-error "Duplicate THREADPRIVATE attribute specified" } + !$omp threadprivate(v,/b_b/,v) ! { dg-error "Duplicate THREADPRIVATE attribute specified" } +end diff --git a/gcc/testsuite/gfortran.dg/gomp/interop-1.f90 b/gcc/testsuite/gfortran.dg/gomp/interop-1.f90 index eae0cb3..9dd0470 100644 --- a/gcc/testsuite/gfortran.dg/gomp/interop-1.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/interop-1.f90 @@ -19,7 +19,7 @@ end module m subroutine sub1 ! { dg-error "Program unit at .1. has OpenMP device constructs/routines but does not set !.OMP REQUIRES REVERSE_OFFLOAD but other program units do" } !$omp interop - integer :: y ! { dg-error "Unexpected data declaration statement" } + integer :: y ! { dg-error "data declaration statement at \\(1\\) cannot appear after executable statements" } end subroutine sub1 program main diff --git a/gcc/testsuite/gfortran.dg/gomp/order-2.f90 b/gcc/testsuite/gfortran.dg/gomp/order-2.f90 index 4ee3a82..8938cac 100644 --- a/gcc/testsuite/gfortran.dg/gomp/order-2.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/order-2.f90 @@ -11,14 +11,14 @@ contains implicit none integer, save :: t t = 1 - !$omp threadprivate (t1) ! { dg-error "Unexpected" } + !$omp threadprivate (t1) ! { dg-error "\\!\\\$OMP THREADPRIVATE statement at \\(1\\) cannot appear after executable statements" } end subroutine f2 subroutine f3 use m implicit none integer :: j j = 1 - !$omp declare reduction (foo:real:omp_out = omp_out + omp_in) ! { dg-error "Unexpected" } + !$omp declare reduction (foo:real:omp_out = omp_out + omp_in) ! { dg-error "\\!\\\$OMP DECLARE REDUCTION statement at \\(1\\) cannot appear after executable statements" } end subroutine f3 subroutine f4 use m @@ -26,12 +26,12 @@ contains !$omp declare target integer, save :: f4_1 f4_1 = 1 - !$omp declare target (f4_1) ! { dg-error "Unexpected" } - !$omp declare target ! { dg-error "Unexpected" } + !$omp declare target (f4_1) ! { dg-error "\\!\\\$OMP DECLARE TARGET statement at \\(1\\) cannot appear after executable statements" } + !$omp declare target ! { dg-error "\\!\\\$OMP DECLARE TARGET statement at \\(1\\) cannot appear after executable statements" } end subroutine f4 integer function f5 (a, b) integer :: a, b a = 1; b = 2 - !$omp declare simd (f5) notinbranch ! { dg-error "Unexpected" } + !$omp declare simd (f5) notinbranch ! { dg-error "\\!\\\$OMP DECLARE SIMD statement at \\(1\\) cannot appear after executable statements" } end function f5 end subroutine f1 diff --git a/gcc/testsuite/gfortran.dg/gomp/pr122369-1.f90 b/gcc/testsuite/gfortran.dg/gomp/pr122369-1.f90 new file mode 100644 index 0000000..bf4cbd5 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/pr122369-1.f90 @@ -0,0 +1,13 @@ +! { dg-do compile } +! { dg-additional-options "-Wunused-label" } + +! Check that a format label referenced in the first statement past a +! metadirective body is bound to the outer region. + +!$omp metadirective when(user={condition(.true.)}: target teams & +!$omp& distribute parallel do) + DO JCHECK = 1, MNMIN + END DO + WRITE(6,366) PCHECK, UCHECK, VCHECK + 366 FORMAT(/, ' Vcheck = ',E12.4,/) + END PROGRAM diff --git a/gcc/testsuite/gfortran.dg/gomp/pr122369-2.f90 b/gcc/testsuite/gfortran.dg/gomp/pr122369-2.f90 new file mode 100644 index 0000000..041d790 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/pr122369-2.f90 @@ -0,0 +1,37 @@ +! { dg-do compile } +! { dg-additional-options "-Wunused-label" } + +! Check that a statement label that ends a loop in the first statement past a +! metadirective body is bound to the outer region. + +implicit none +integer :: i, j +logical :: cond1, cond2 +integer :: A(0:10,0:5), B(0:10,0:5) + +cond1 = .true. +cond2 = .true. + +!$omp metadirective when(user={condition(cond1)} : parallel do collapse(2)) + do 50 j = 0, 5 +!$omp metadirective when(user={condition(.false.)} : simd) + do 51 i = 0, 10 + A(i,j) = i*10 + j + 51 continue + 50 continue + + do 55 i = 0, 5 + 55 continue + +!$omp begin metadirective when(user={condition(cond2)} : parallel do collapse(2)) + do 60 j = 0, 5 +!$omp metadirective when(user={condition(.false.)} : simd) + do 61 i = 0, 10 + B(i,j) = i*10 + j + 61 continue + 60 continue +!$omp end metadirective + + do 70 j = 0, 5 + 70 continue +end diff --git a/gcc/testsuite/gfortran.dg/gomp/pr122369-3.f90 b/gcc/testsuite/gfortran.dg/gomp/pr122369-3.f90 new file mode 100644 index 0000000..61225db --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/pr122369-3.f90 @@ -0,0 +1,23 @@ +! { dg-do compile } +! { dg-additional-options "-Wunused-label" } + +! Check that a statement label defined in the first statement past a +! metadirective body is bound to the outer region. + + +integer :: cnt, x + +cnt = 0 +!$omp begin metadirective when(user={condition(cnt > 0)} : parallel) + x = 5 +!$omp end metadirective +1234 format("Hello") +write(*,1234) + +!$omp begin metadirective when(user={condition(x > 0)} : parallel) + x = 5 +!$omp end metadirective +4567 print *, 'hello', cnt +cnt = cnt + 1 +if (cnt < 2) goto 4567 +end diff --git a/gcc/testsuite/gfortran.dg/gomp/pr122369-4.f90 b/gcc/testsuite/gfortran.dg/gomp/pr122369-4.f90 new file mode 100644 index 0000000..ff5b683 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/pr122369-4.f90 @@ -0,0 +1,16 @@ +! { dg-do compile } +! { dg-additional-options "-Wunused-label" } + +! Check that a format label defined in the first statement after a nested +! metadirective body can be referenced correctly. + +integer :: cnt, x +cnt = 0 +!$omp begin metadirective when(user={condition(cnt > 0)} : parallel) + !$omp begin metadirective when(user={condition(cnt > 0)} : parallel) + x = 5 + !$omp end metadirective + 1234 format("Hello") + write(*,1234) +!$omp end metadirective +end diff --git a/gcc/testsuite/gfortran.dg/gomp/pr122508-1.f90 b/gcc/testsuite/gfortran.dg/gomp/pr122508-1.f90 new file mode 100644 index 0000000..c64a864 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/pr122508-1.f90 @@ -0,0 +1,17 @@ +! { dg-do compile } +! { dg-additional-options "-Wunused-label" } + +! Check that a format label defined outside a metadirective body can be +! referenced correctly inside the metadirective body. + +implicit none +integer :: cnt +1345 format("The count is ", g0) + +cnt = 0 +write(*,1345) cnt + +!$omp begin metadirective when(user={condition(cnt > 0)} : parallel) + write(*,1345) cnt +!$omp end metadirective +end diff --git a/gcc/testsuite/gfortran.dg/gomp/pr122508-2.f90 b/gcc/testsuite/gfortran.dg/gomp/pr122508-2.f90 new file mode 100644 index 0000000..4528711 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/pr122508-2.f90 @@ -0,0 +1,22 @@ +! { dg-do compile } + +! Check that redefining labels across metadirective regions triggers a +! diagnostic. + +implicit none +integer :: cnt +1345 format("The count is ", g0) + +cnt = 0 +write(*,1345) cnt + +!$omp begin metadirective when(user={condition(cnt > 0)} : parallel) + 6789 format("The count is ", g0) + !$omp begin metadirective when(user={condition(cnt > 0)} : parallel) + 1345 print *, 'nested' ! { dg-error "Label 1345 at .1. already referenced as a format label" } + 6789 print *, 'world' + !$omp end metadirective + write(*,1345) cnt ! { dg-error "Label 1345 at .1. previously used as branch target" } + write(*,6789) cnt ! { dg-error "Label 6789 at .1. previously used as branch target" } +!$omp end metadirective +end diff --git a/gcc/testsuite/gfortran.dg/gomp/pr122570.f b/gcc/testsuite/gfortran.dg/gomp/pr122570.f new file mode 100644 index 0000000..9897cc6 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/pr122570.f @@ -0,0 +1,29 @@ +! { dg-do compile } +! { dg-additional-options "-Wall" } + +! PR fortran/122570 + + SUBROUTINE INITAL + implicit none (type, external) + integer :: j, n + n = 5 +!$omp metadirective & +!$omp& when(user={condition(.true.)}: target teams & +!$omp& distribute parallel do) & +!$omp& when(user={condition(.false.)}: target teams & +!$omp& distribute parallel do) + DO J=1,N + END DO + END SUBROUTINE + + SUBROUTINE CALC3 + implicit none (type, external) + integer :: i, m + m = 99 +!$omp metadirective +!$omp& when(user={condition(.false.)}: +!$omp& simd) + DO 301 I=1,M + 301 CONTINUE + 300 CONTINUE ! { dg-warning "Label 300 at .1. defined but not used \\\[-Wunused-label\\\]" } + END SUBROUTINE diff --git a/gcc/testsuite/gfortran.dg/gomp/pr78026.f03 b/gcc/testsuite/gfortran.dg/gomp/pr78026.f03 index 61f9458..8278d69 100644 --- a/gcc/testsuite/gfortran.dg/gomp/pr78026.f03 +++ b/gcc/testsuite/gfortran.dg/gomp/pr78026.f03 @@ -1,5 +1,5 @@ ! PR fortran/78026 select type (a) ! { dg-error "Selector shall be polymorphic in SELECT TYPE statement" } end select -!$omp declare simd(b) ! { dg-error "Unexpected !.OMP DECLARE SIMD statement" } +!$omp declare simd(b) ! { dg-error "\\!\\\$OMP DECLARE SIMD statement at \\(1\\) cannot appear after executable statements" } end ! { dg-error "should refer to containing procedure" "" { target *-*-* } .-1 } diff --git a/gcc/testsuite/gfortran.dg/gomp/requires-4.f90 b/gcc/testsuite/gfortran.dg/gomp/requires-4.f90 index 9d93619..0b7d4b8 100644 --- a/gcc/testsuite/gfortran.dg/gomp/requires-4.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/requires-4.f90 @@ -16,7 +16,7 @@ end subroutine foobar i = 5 ! < execution statement -!$omp requires atomic_default_mem_order(seq_cst) ! { dg-error "Unexpected ..OMP REQUIRES statement" } +!$omp requires atomic_default_mem_order(seq_cst) ! { dg-error "\\!\\\$OMP REQUIRES statement at \\(1\\) cannot appear after executable statements" } end program main diff --git a/gcc/testsuite/gfortran.dg/gomp/requires-6.f90 b/gcc/testsuite/gfortran.dg/gomp/requires-6.f90 index b20c218..dd55f93 100644 --- a/gcc/testsuite/gfortran.dg/gomp/requires-6.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/requires-6.f90 @@ -10,5 +10,5 @@ end subroutine foobar !$omp atomic i = i + 5 -!$omp requires atomic_default_mem_order(acq_rel) ! { dg-error "Unexpected !.OMP REQUIRES statement" } +!$omp requires atomic_default_mem_order(acq_rel) ! { dg-error "\\!\\\$OMP REQUIRES statement at \\(1\\) cannot appear after executable statements" } end diff --git a/gcc/testsuite/gfortran.dg/initialization_9.f90 b/gcc/testsuite/gfortran.dg/initialization_9.f90 index d904047..fe7ca63 100644 --- a/gcc/testsuite/gfortran.dg/initialization_9.f90 +++ b/gcc/testsuite/gfortran.dg/initialization_9.f90 @@ -1,4 +1,5 @@ ! { dg-do compile } +! { dg-options " " } ! ! PR fortran/31639 ! Contributed by Martin Michlmayr <tbm AT cyrius DOT com> diff --git a/gcc/testsuite/gfortran.dg/intrinsic_actual_4.f90 b/gcc/testsuite/gfortran.dg/intrinsic_actual_4.f90 index 4521c96..3358b4a 100644 --- a/gcc/testsuite/gfortran.dg/intrinsic_actual_4.f90 +++ b/gcc/testsuite/gfortran.dg/intrinsic_actual_4.f90 @@ -1,4 +1,5 @@ ! { dg-do run } +! { dg-options " " } ! Tests the fix for PR27900, in which an ICE would be caused because ! the actual argument LEN had no type. ! diff --git a/gcc/testsuite/gfortran.dg/namelist_assumed_char.f90 b/gcc/testsuite/gfortran.dg/namelist_assumed_char.f90 index b7d063c..25edf64 100644 --- a/gcc/testsuite/gfortran.dg/namelist_assumed_char.f90 +++ b/gcc/testsuite/gfortran.dg/namelist_assumed_char.f90 @@ -8,7 +8,7 @@ ! Add -std=f95, add bar() ! subroutine foo(c) - character*(*) c + character*(*) c ! { dg-warning "Old-style character length" } namelist /abc/ c ! { dg-error "nonconstant character length in namelist" } end subroutine diff --git a/gcc/testsuite/gfortran.dg/pdt_65.f03 b/gcc/testsuite/gfortran.dg/pdt_65.f03 new file mode 100644 index 0000000..d5e45c2 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pdt_65.f03 @@ -0,0 +1,135 @@ +! { dg-do compile } +! { dg-options "-fdump-tree-original" } +! +! Test fix for PR122452 +! +! Contributed by Damian Rouson <damian@archaeologic.codes> +! +module kind_parameters_m + integer, parameter :: default_real = kind(1e0) + integer, parameter :: double_precision = kind(1d0) +end module + +module tensor_m + use kind_parameters_m, only : default_real, double_precision + implicit none + + private + public :: tensor_t + + type tensor_t(k) + integer, kind :: k = default_real + real(k), allocatable, private :: values_(:) + contains + generic :: values => default_real_values, double_precision_values + procedure, private, non_overridable :: default_real_values, double_precision_values + generic :: num_components => default_real_num_components, double_precision_num_components + procedure, private :: default_real_num_components, double_precision_num_components + end type + + interface tensor_t + + pure module function construct_default_real(values) result(tensor) + implicit none + real, intent(in) :: values(:) + type(tensor_t) tensor + end function + + pure module function construct_double_precision(values) result(tensor) + implicit none + double precision, intent(in) :: values(:) + type(tensor_t(double_precision)) tensor + end function + + end interface + + interface + + pure module function default_real_values(self) result(tensor_values) + implicit none + class(tensor_t), intent(in) :: self + real, allocatable :: tensor_values(:) + end function + + pure module function double_precision_values(self) result(tensor_values) + implicit none + class(tensor_t(double_precision)), intent(in) :: self + double precision, allocatable :: tensor_values(:) + end function + + pure module function default_real_num_components(self) result(n) + implicit none + class(tensor_t), intent(in) :: self + integer n + end function + + pure module function double_precision_num_components(self) result(n) + implicit none + class(tensor_t(double_precision)), intent(in) :: self + integer n + end function + + end interface + +end module tensor_m + +submodule(tensor_m) tensor_s +contains + + pure module function construct_default_real(values) result(tensor) + implicit none + real, intent(in) :: values(:) + type(tensor_t) tensor + tensor = tensor_t ()(values) + end function + + pure module function construct_double_precision(values) result(tensor) + implicit none + double precision, intent(in) :: values(:) + type(tensor_t(double_precision)) tensor + tensor = tensor_t (double_precision)(values) + end function + + pure module function default_real_values(self) result(tensor_values) + implicit none + class(tensor_t), intent(in) :: self + real, allocatable :: tensor_values(:) + tensor_values = self%values_ + end function + + pure module function double_precision_values(self) result(tensor_values) + implicit none + class(tensor_t(double_precision)), intent(in) :: self + double precision, allocatable :: tensor_values(:) + tensor_values = self%values_ + end function + + + pure module function default_real_num_components(self) result(n) + implicit none + class(tensor_t), intent(in) :: self + integer n + n = default_real + end function + + pure module function double_precision_num_components(self) result(n) + implicit none + class(tensor_t(double_precision)), intent(in) :: self + integer n + n = double_precision + end function + +end submodule tensor_s + + + use tensor_m + type(tensor_t(kind(0e0))) :: a + type(tensor_t(kind(0D0))) :: b + a = tensor_t ([1e0,2e0]) + print *, a%num_components (), a%values () + b = tensor_t ([3d0,4d0]) + print *, b%num_components (), b%values () +end +! { dg-final { scan-tree-dump-times "construct_" 4 "original" } } +! { dg-final { scan-tree-dump-times "_components" 4 "original" } } +! { dg-final { scan-tree-dump-times "_values" 4 "original" } } diff --git a/gcc/testsuite/gfortran.dg/pdt_66.f03 b/gcc/testsuite/gfortran.dg/pdt_66.f03 new file mode 100644 index 0000000..269f6b4 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pdt_66.f03 @@ -0,0 +1,54 @@ +! { dg-do compile } +! { dg-options "-fdump-tree-original" } +! +! Check the fix for PR122501. +! +! Contributed by Damian Rouson <damian@archaeologic.codes> +! +module tensor_m + implicit none + + type tensor_t(k) + integer, kind :: k = kind(1.) + real(k), allocatable, private :: values_(:) + contains + procedure default_real_values + end type + + interface tensor_t + type(tensor_t) module function construct_default_real(values) + implicit none + real values(:) + end function + end interface + + interface + module function default_real_values(self) result(tensor_values) + implicit none + class(tensor_t) self + real, allocatable :: tensor_values(:) + end function + end interface +end module + + use tensor_m + implicit none +contains + function copy(tensor) + type(tensor_t) tensor, copy, norm_copy + associate(tensor_values => tensor%default_real_values()) + +! This gave: "Component ‘values_’ at (1) is a PRIVATE component of ‘tensor_t’" + copy = tensor_t(tensor_values) + + end associate + +! Make sure that the fix really works :-) + associate(f => tensor%default_real_values()) + associate(tensor_values => tensor%default_real_values()) + norm_copy = tensor_t(tensor_values/maxval(f)) + end associate + end associate + end function +end +! { dg-final { scan-tree-dump-times "default_real_values" 3 "original" } } diff --git a/gcc/testsuite/gfortran.dg/pdt_67.f03 b/gcc/testsuite/gfortran.dg/pdt_67.f03 new file mode 100644 index 0000000..b59d201 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pdt_67.f03 @@ -0,0 +1,36 @@ +! { dg-do compile } +! +! Check the fix for PR122524. +! +! Contributed by Damian Rouson <damian@archaeologic.codes> +! +module tensor_map_m + implicit none + + type tensor_t(k) + integer, kind :: k = kind(1.) + real(k), allocatable :: values_(:) + end type + + interface tensor_t + module function tensor(values) + implicit none + double precision values(:) + type(tensor_t(kind(0D0))) tensor + end function + end interface + + type tensor_map_t(k) + integer, kind :: k = kind(1.) + real(k) slope_ + end type + +contains + function unnormalized_tensor(self, tensor) + type(tensor_map_t(kind(0D0))) self + type(tensor_t(kind(0D0))) tensor, unnormalized_tensor + associate(unnormalized_values => tensor%values_*self%slope_) + unnormalized_tensor = tensor_t(unnormalized_values) ! Caused an ICE. + end associate + end function +end module diff --git a/gcc/testsuite/gfortran.dg/pdt_68.f03 b/gcc/testsuite/gfortran.dg/pdt_68.f03 new file mode 100644 index 0000000..b3493b1 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pdt_68.f03 @@ -0,0 +1,34 @@ +! { dg-do compile } +! { dg-options "-fdump-tree-original" } +! +! Check the fix for PR122566. +! +! Contributed by Damian Rouson <damian@archaeologic.codes> +! +module double_precision_file_m + implicit none + + type file_t + integer :: i + end type + + type, extends(file_t) :: double_precision_file_t + end type + + type, extends(double_precision_file_t) :: training_configuration_t(m) + integer, kind :: m = kind(1.) + end type + +contains + pure module function training_configuration() + type(training_configuration_t) training_configuration + training_configuration%file_t = file_t(42) ! Needed parent type to be introduced explicitly + end function +end module + + use double_precision_file_m + type(training_configuration_t) :: x + x = training_configuration () + if (x%i /= 42) stop 1 +end +! { dg-final { scan-tree-dump-times "double_precision_file_t.file_t" 2 "original" } } diff --git a/gcc/testsuite/gfortran.dg/pdt_69.f03 b/gcc/testsuite/gfortran.dg/pdt_69.f03 new file mode 100644 index 0000000..6217337 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pdt_69.f03 @@ -0,0 +1,58 @@ +! { dg-do compile } +! +! Test the fix for PR12276. +! Exmple from F2018: C.2.5 Structure constructors and generic names +! Failed in each of the functions with, for example: +! "Derived type ‘pdtt_4’ at (1) is being used before it is defined" +! For each of the functions, if the function type was declared within +! the function, all was well. +! +MODULE m + TYPE t(kind) + INTEGER, KIND :: kind + COMPLEX(kind) value + END TYPE + INTEGER,PARAMETER :: single = KIND(0.0), double = KIND(0d0) + + INTERFACE t + MODULE PROCEDURE real_to_t1, dble_to_t2, int_to_t1, int_to_t2 + END INTERFACE + + CONTAINS + TYPE(t(single)) FUNCTION real_to_t1(x) + REAL(single) x + real_to_t1%value = x + END FUNCTION + + TYPE(t(double)) FUNCTION dble_to_t2(x) + REAL(double) x + dble_to_t2%value = x + END FUNCTION + TYPE(t(single)) FUNCTION int_to_t1(x,mold) + INTEGER x + TYPE(t(single)) mold + int_to_t1%value = x + END FUNCTION + TYPE(t(double)) FUNCTION int_to_t2(x,mold) + INTEGER x + TYPE(t(double)) mold + int_to_t2%value = x + END FUNCTION + + END + + PROGRAM example + USE m + TYPE(t(single)) x + TYPE(t(double)) y + x = t(1.5) ! References real_to_t1 + print *, x%value + x = t(17,mold=x) ! References int_to_t1 + print *, x%value + y = t(1.5d0) ! References dble_to_t2 + print *, y%value + y = t(42,mold=y) ! References int_to_t2 + print *, y%value + y = t(kind(0d0)) ((0,1)) ! Uses the structure constructor for type t + print *, y%value + END diff --git a/gcc/testsuite/gfortran.dg/pdt_70.f03 b/gcc/testsuite/gfortran.dg/pdt_70.f03 new file mode 100644 index 0000000..25801ed --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pdt_70.f03 @@ -0,0 +1,112 @@ +! { dg-do run } +! +! PR104650 +! Contributed by Gerhard Steinmetz <gscfq@t-online.de> +! +module m1 + type t1 + integer :: i + contains + final :: s + end type + type t2(n) + integer, len :: n = 1 + type(t1) :: a + end type + integer :: ctr = 0 + +contains + + impure elemental subroutine s(x) + type(t1), intent(in) :: x + ctr = ctr + x%i + end +end + +! From F2018: C.2.6 Final subroutines (7.5.6, 7.5.6.2, 7.5.6.3, 7.5.6.4) +module m2 + + type t(k) + integer, kind :: k + real(k), pointer :: vector(:) => NULL () + contains + final :: finalize_t1s, finalize_t1v, finalize_t2e + end type + + integer :: flag = 0 + +contains + + impure subroutine finalize_t1s(x) + type(t(kind(0.0))) x + if (associated(x%vector)) deallocate(x%vector) + flag = flag + 1 + END subroutine + + impure subroutine finalize_t1v(x) + type(t(kind(0.0))) x(:) + do i = lbound(x,1), ubound(x,1) + if (associated(x(i)%vector)) deallocate(x(i)%vector) + flag = flag + 1 + end do + end subroutine + + impure elemental subroutine finalize_t2e(x) + type(t(kind(0.0d0))), intent(inout) :: x + if (associated(x%vector)) deallocate(x%vector) + flag = flag + 1 + end subroutine + + elemental subroutine alloc_ts (x) + type(t(kind(0.0))), intent(inout) :: x + allocate (x%vector, source = [42.0,-42.0]) + end subroutine + + elemental subroutine alloc_td (x) + type(t(kind(0.0d0))), intent(inout) :: x + allocate (x%vector, source = [42.0d0,-42.0d0]) + end subroutine + +end module + + use m1 + use m2 + integer, parameter :: dims = 2 + integer :: p = 42 + +! Test pr104650 + call u (kind(0e0), p) + if (ctr /= p * (1 + kind(0e0))) stop 1 + +! Test the standard example + call example (dims) + if (flag /= 11 + dims**2) stop 2 + +contains + + subroutine u (k, p) + integer :: k, p + type (t2(k)) :: u_k, v_k(k) + u_k%a%i = p + v_k%a%i = p + end + +! Returning from 'example' will effectively do +! call finalize_t1s(a) +! call finalize_t1v(b) +! call finalize_t2e(d) +! No final subroutine will be called for variable C because the user +! omitted to define a suitable specific procedure for it. + subroutine example(n) + type(t(kind(0.0))) a, b(10), c(n,2) + type(t(kind(0.0d0))) d(n,n) + real(kind(0.0)),target :: tgt(1) + + ! Explicit allocation to provide a valid memory refence for deallocation. + call alloc_ts(a) + call alloc_ts(b) + call alloc_ts(c) + call alloc_td(d) + end subroutine + +end diff --git a/gcc/testsuite/gfortran.dg/pdt_71.f03 b/gcc/testsuite/gfortran.dg/pdt_71.f03 new file mode 100644 index 0000000..ec9cde0 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pdt_71.f03 @@ -0,0 +1,44 @@ +! { dg-do compile } +! { dg-options "-fdump-tree-original" } +! +! Test the second part of the fix for PR103371. +! +! Compiled but gave the wrong result for the component 'z%x%n'. +! +! Contributed by Arseny Solokha <asolokha@gmx.com> +! +module m1 + implicit none + type t + integer :: n + end type + type t2 + ! t and t2 must be resolved to types in m1, not components in t2 + type(t) :: t(10) = t(1) + type(t) :: x = t(1) + integer :: t2 + type(t2), pointer :: p => NULL() + end type +end + +module m2 + type :: t(tn) + integer, kind :: tn + integer(kind=tn) :: n + end type + type :: t2(tm) + integer, kind :: tm + type(t(tm)) :: x = t(tm)(2*tm) + end type +end + + call test_m2 +contains + subroutine test_m2 + use m2 + type(t2(KIND (1))) :: z + print *, kind (z%x%n), z%x%n + end subroutine +end +! { dg-final { scan-tree-dump-times "Pdtt2_4.1.x.n = 8" 1 "original" } } +! { dg-final { scan-tree-dump-times "z = Pdtt2_4.1" 1 "original" } } diff --git a/gcc/testsuite/gfortran.dg/pdt_72.f03 b/gcc/testsuite/gfortran.dg/pdt_72.f03 new file mode 100644 index 0000000..57640bd --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pdt_72.f03 @@ -0,0 +1,110 @@ +! { dg-do compile } +! +! Tests the fix for pr122578, which failed in compilation with the errors +! shown below. +! +! Contributed by Damian Rouson <damian@archaeologic.codes> +! +module tensor_map_m + use iso_c_binding, only : c_int + implicit none + + type tensor_t(k) + integer, kind :: k = kind(1.) + real(k), allocatable :: values_(:) ! Error: Cannot convert REAL(0) to REAL(4) at (1) + contains + generic :: values => default_real_values + procedure default_real_values + end type + + interface + pure module function default_real_values(self) result(tensor_values) + implicit none + class(tensor_t), intent(in) :: self + real, allocatable :: tensor_values(:) + end function + end interface + + type tensor_map_t(k) + integer, kind :: k = kind(1.) + real(k), dimension(:), allocatable :: intercept_, slope_ + contains + generic :: map_to_training_range => default_real_map_to_training_range + procedure :: default_real_map_to_training_range + generic :: map_from_training_range => default_real_map_from_training_range + procedure :: default_real_map_from_training_range + end type + + interface + elemental module function default_real_map_to_training_range(self, tensor) result(normalized_tensor) + implicit none + class(tensor_map_t), intent(in) :: self + type(tensor_t), intent(in) :: tensor + type(tensor_t) normalized_tensor + end function + + elemental module function default_real_map_from_training_range(self, tensor) result(unnormalized_tensor) + implicit none + class(tensor_map_t), intent(in) :: self + type(tensor_t), intent(in) :: tensor + type(tensor_t) unnormalized_tensor + end function + end interface + + type activation_t + integer(c_int) :: selection_ + contains + generic :: evaluate => default_real_evaluate + procedure default_real_evaluate + end type + + interface + elemental module function default_real_evaluate(self, x) result(y) + implicit none + class(activation_t), intent(in) :: self + real, intent(in) :: x + real y + end function + end interface + + type neural_network_t(k) + integer, kind :: k = kind(1.) + type(tensor_map_t(k)) input_map_, output_map_ + real(k), allocatable :: weights_(:,:,:), biases_(:,:) + integer, allocatable :: nodes_(:) + type(activation_t) :: activation_ + contains + generic :: infer => default_real_infer + procedure default_real_infer + end type + + integer, parameter :: input_layer = 0 +contains + elemental function default_real_infer(self, inputs) result(outputs) + class(neural_network_t), intent(in) :: self + type(tensor_t), intent(in) :: inputs + type(tensor_t) outputs + real, allocatable :: a(:,:) + integer l + associate(w => self%weights_, b => self%biases_, n => self%nodes_, output_layer => ubound(self%nodes_,1)) + allocate(a(maxval(n), input_layer:output_layer)) + associate(normalized_inputs => self%input_map_%map_to_training_range(inputs)) + a(1:n(input_layer),input_layer) = normalized_inputs%values() ! Error: Symbol ‘normalized_inputs’ + ! at (1) has no IMPLICIT type + + end associate + feed_forward: & + do l = input_layer+1, output_layer + associate(z => matmul(w(1:n(l),1:n(l-1),l), a(1:n(l-1),l-1)) + b(1:n(l),l)) + a(1:n(l),l) = self%activation_%evaluate(z) + end associate + end do feed_forward + associate(normalized_outputs => tensor_t(a(1:n(output_layer), output_layer))) + outputs = self%output_map_%map_from_training_range(normalized_outputs) ! Error: Found no matching specific + ! binding for the call to the GENERIC + ! ‘map_from_training_range’ at (1) + + end associate + end associate + end function +end module diff --git a/gcc/testsuite/gfortran.dg/pdt_73.f03 b/gcc/testsuite/gfortran.dg/pdt_73.f03 new file mode 100644 index 0000000..63a9234 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pdt_73.f03 @@ -0,0 +1,18 @@ +! { dg-do compile } +! +! Tests the fix for pr122669, which falied with the error below. +! +! Contributed by Damian Rouson <damian@archaeologic.codes> +! + implicit none + type tensor_t + real, allocatable :: values_ + end type + type(tensor_t) :: random_inputs(1) + type(tensor_t), allocatable :: outputs(:) + + random_inputs = [tensor_t(1.0)] + allocate(outputs, mold=random_inputs) ! Error: Array specification or array-valued + ! SOURCE= expression required in ALLOCATE statement at (1) + print *, size(outputs) +end diff --git a/gcc/testsuite/gfortran.dg/pdt_74.f03 b/gcc/testsuite/gfortran.dg/pdt_74.f03 new file mode 100644 index 0000000..c12db79 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pdt_74.f03 @@ -0,0 +1,48 @@ +! { dg-do compile } +! +! Tests the fix for pr122670, where use only did not compile for PDTs. Also, it +! was found in the course of developing the fix that import only did not work +! either. +! +! Contributed by Damian Rouson <damian@archaeologic.codes> +! +module tensor_m + implicit none + + type tensor_t(k) + integer, kind :: k = kind(0.) + real(k), allocatable :: value_ + end type + + interface + function myfunc (arg) + import tensor_t + implicit none + type (tensor_t) myfunc + type (tensor_t), intent(in) :: arg + end function + end interface + +contains + function y(x) + type(tensor_t) x, y + y = tensor_t(x%value_) + end function +end module + +function myfunc (arg) + use tensor_m, only : tensor_t + implicit none + type (tensor_t) myfunc + type (tensor_t), intent(in) :: arg + myfunc = arg + myfunc%value_ = myfunc%value_ * 2.0 +end function + + use tensor_m, only : tensor_t, y, myfunc + implicit none + type(tensor_t) desired_output + desired_output = y(tensor_t(42.)) + desired_output = myfunc (desired_output) + print *, desired_output%value_ +end diff --git a/gcc/testsuite/gfortran.dg/pdt_75.f03 b/gcc/testsuite/gfortran.dg/pdt_75.f03 new file mode 100644 index 0000000..f700871 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pdt_75.f03 @@ -0,0 +1,35 @@ +! { dg-do compile } +! +! Tests the fix for pr122693, which failed in compilation with the errors +! shown below. +! +! Contributed by Damian Rouson <damian@archaeologic.codes> +! +module tensor_m + implicit none + + type tensor_t(k) + integer, kind :: k = kind(0.) + end type + + interface tensor_t + module function tensor(unused_stuff) + implicit none + real unused_stuff + type(tensor_t) tensor + end function + end interface + +end module + + use tensor_m + implicit none +contains + function test_passed() + logical test_passed + type(tensor_t), allocatable :: tensor_array(:) + real, parameter :: junk = 0. + tensor_array = [tensor_t(junk)] !Error: Symbol ‘junk’ at (1) has no IMPLICIT type + test_passed = .false. !Error: ‘test_passed’ at (1) is not a variable + end function +end diff --git a/gcc/testsuite/gfortran.dg/pdt_76.f03 b/gcc/testsuite/gfortran.dg/pdt_76.f03 new file mode 100644 index 0000000..22c0a3e --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pdt_76.f03 @@ -0,0 +1,21 @@ +! { dg-do compile } + +! Make sure that pr103414 is fixed. +! +! Contributed by Gerhard Steinmetz <gscfq@t-online.de> +! +function p () + type t(n) + integer, kind :: n + character(n) :: c = '' + end type + type(t(3)) :: x = t(z'1') ! { dg-error "Expected an initialization expression" } +end + +function q () + type t(n) + integer, kind :: n + character(n) :: c = '' + end type + type(t(3)) :: x(1) = [t(z'1')] ! { dg-error "Syntax error in array constructor" } +end diff --git a/gcc/testsuite/gfortran.dg/pr104466.f90 b/gcc/testsuite/gfortran.dg/pr104466.f90 index ec0e458..bc14065 100644 --- a/gcc/testsuite/gfortran.dg/pr104466.f90 +++ b/gcc/testsuite/gfortran.dg/pr104466.f90 @@ -113,4 +113,4 @@ END ! { dg-final { scan-tree-dump-not ": dependent" "lim2" } } -! { dg-final { scan-tree-dump "Moving statement\[\n\r\]_\[0-9\]+ = n" "lim2" } } +! { dg-final { scan-tree-dump "Moving statement _\[0-9\]+ = n" "lim2" } } diff --git a/gcc/testsuite/gfortran.dg/pr111022.f90 b/gcc/testsuite/gfortran.dg/pr111022.f90 index eef55ff..798ba13 100644 --- a/gcc/testsuite/gfortran.dg/pr111022.f90 +++ b/gcc/testsuite/gfortran.dg/pr111022.f90 @@ -60,13 +60,13 @@ program pr111022 write(buffer,"(E0.3E0)") .6660_4 if (buffer.ne."0.666E+0") stop 27 write(buffer,"(E0.3)") .6660_4 - if (buffer.ne."0.666E+0") stop 28 + if (buffer.ne."0.666E+00") stop 28 write(buffer,"(E0.1E0)") .6660_4 if (buffer.ne."0.7E+0") stop 29 write(buffer,"(E0.1)") .6660_4 - if (buffer.ne."0.7E+0") stop 30 + if (buffer.ne."0.7E+00") stop 30 write(buffer,"(E0.5E0)") .6660_4 if (buffer.ne."0.66600E+0") stop 31 write(buffer,"(E0.5)") .6660_4 - if (buffer.ne."0.66600E+0") stop 32 + if (buffer.ne."0.66600E+00") stop 32 end program pr111022 diff --git a/gcc/testsuite/gfortran.dg/pr112459.f90 b/gcc/testsuite/gfortran.dg/pr112459.f90 index 7db243c..290f915 100644 --- a/gcc/testsuite/gfortran.dg/pr112459.f90 +++ b/gcc/testsuite/gfortran.dg/pr112459.f90 @@ -34,4 +34,6 @@ program myprog print *,"After allocation" end program myprog ! Final subroutines were called with std=gnu and -w = > 14 "_final"s. -! { dg-final { scan-tree-dump-times "_final" 12 "original" } } +! Count reduced from 12 after PR90519 fix - separate result symbols +! disambiguate procedure references from result variables. +! { dg-final { scan-tree-dump-times "_final" 6 "original" } } diff --git a/gcc/testsuite/gfortran.dg/pr122513-2.f90 b/gcc/testsuite/gfortran.dg/pr122513-2.f90 new file mode 100644 index 0000000..3f6c5c4 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr122513-2.f90 @@ -0,0 +1,18 @@ +! { dg-do compile } + +! PR fortran/122513 + +! The error is not really new but seems to be untested +! before. The example is from the mentioned PR. + +program test + implicit none + integer :: i + do concurrent (i=1:2) default (none) local(i) ! { dg-error "Index variable 'i' at .1. cannot be specified in a locality-spec" } + block + integer, dimension(2,3), parameter :: & + ii = reshape((/ 1,2,3,4,5,6 /), (/2, 3/)) + print*,ii(i,:) + end block + end do +end program test diff --git a/gcc/testsuite/gfortran.dg/pr122513.f90 b/gcc/testsuite/gfortran.dg/pr122513.f90 new file mode 100644 index 0000000..9e12ab1 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr122513.f90 @@ -0,0 +1,13 @@ +! { dg-do compile } +! PR122513 do concurrent default (none) fails on parameter arrays +program test + implicit none + integer :: i + do concurrent (i=1:2) default (none) + block + integer, dimension(2,3), parameter :: & + ii = reshape((/ 1,2,3,4,5,6 /), (/2, 3/)) + print*,ii(i,:) + end block + end do +end program test diff --git a/gcc/testsuite/gfortran.dg/pr15140.f90 b/gcc/testsuite/gfortran.dg/pr15140.f90 index 80c08dd..7f9af4f 100644 --- a/gcc/testsuite/gfortran.dg/pr15140.f90 +++ b/gcc/testsuite/gfortran.dg/pr15140.f90 @@ -1,4 +1,5 @@ ! { dg-do run } +! { dg-options "-std=legacy" } ! PR 15140: we used to fail an assertion, because we don't use the ! argument of the subroutine directly, but instead use a copy of it. function M(NAMES) diff --git a/gcc/testsuite/gfortran.dg/pr61669.f90 b/gcc/testsuite/gfortran.dg/pr61669.f90 index 5bceafd..ce38d13 100644 --- a/gcc/testsuite/gfortran.dg/pr61669.f90 +++ b/gcc/testsuite/gfortran.dg/pr61669.f90 @@ -1,7 +1,7 @@ ! { dg-do compile } write (*,"(a)") char(12) - CHARACTER*80 A /"A"/ ! { dg-error "Unexpected data declaration statement" } - REAL*4 B ! { dg-error "Unexpected data declaration statement" } + CHARACTER*80 A /"A"/ ! { dg-error "data declaration statement at \\(1\\) cannot appear after executable statements" } + REAL*4 B ! { dg-error "data declaration statement at \\(1\\) cannot appear after executable statements" } write (*,"(a)") char(12) DATA B / 0.02 / ! { dg-warning "Obsolescent feature: DATA statement" } END diff --git a/gcc/testsuite/gfortran.dg/pr96436_4.f90 b/gcc/testsuite/gfortran.dg/pr96436_4.f90 index 7d2cfef..145c6cb 100644 --- a/gcc/testsuite/gfortran.dg/pr96436_4.f90 +++ b/gcc/testsuite/gfortran.dg/pr96436_4.f90 @@ -2,7 +2,7 @@ ! { dg-options "-std=f2018 -pedantic" } character(20) :: fmt -character(9) :: buffer +character(12) :: buffer fmt = "(1a1,f0.2,1a1)" write(buffer,fmt) ">", 3.0, "<" if (buffer.ne.">3.00<") stop 1 @@ -11,15 +11,15 @@ write(buffer,fmt) ">", 0.3, "<" if (buffer.ne.">0.30<") stop 2 fmt = "(1a1,d0.2,1a1)" write(buffer,fmt) ">", 3.0, "<" -if (buffer.ne.">0.30D+1<") stop 3 +if (buffer.ne.">0.30D+01<") stop 3 fmt = "(1a1,e0.2,1a1)" write(buffer,fmt) ">", 3.0, "<" -if (buffer.ne.">0.30E+1<") stop 4 +if (buffer.ne.">0.30E+01<") stop 4 fmt = "(1a1,en0.2,1a1)" write(buffer,fmt) ">", 3.0, "<" -if (buffer.ne.">3.00E+0<") stop 5 +if (buffer.ne.">3.00E+00<") stop 5 fmt = "(1a1,es0.2,1a1)" write(buffer,fmt) ">", 3.0, "<" -if (buffer.ne.">3.00E+0<") stop 6 +if (buffer.ne.">3.00E+00<") stop 6 end diff --git a/gcc/testsuite/gfortran.dg/pr96436_5.f90 b/gcc/testsuite/gfortran.dg/pr96436_5.f90 index 3870d98..4d95ed2 100644 --- a/gcc/testsuite/gfortran.dg/pr96436_5.f90 +++ b/gcc/testsuite/gfortran.dg/pr96436_5.f90 @@ -2,7 +2,7 @@ ! { dg-options "-pedantic" } character(20) :: fmt -character(9) :: buffer +character(12) :: buffer fmt = "(1a1,f0.2,1a1)" write(buffer,fmt) ">", 3.0, "<" if (buffer.ne.">3.00<") stop 1 @@ -11,15 +11,15 @@ write(buffer,fmt) ">", 0.30, "<" if (buffer.ne.">0.30<") stop 2 fmt = "(1a1,d0.2,1a1)" write(buffer,fmt) ">", 3.0, "<" -if (buffer.ne.">0.30D+1<") stop 3 +if (buffer.ne.">0.30D+01<") stop 3 fmt = "(1a1,e0.2,1a1)" write(buffer,fmt) ">", 3.0, "<" -if (buffer.ne.">0.30E+1<") stop 4 +if (buffer.ne.">0.30E+01<") stop 4 fmt = "(1a1,en0.2,1a1)" write(buffer,fmt) ">", 3.0, "<" -if (buffer.ne.">3.00E+0<") stop 5 +if (buffer.ne.">3.00E+00<") stop 5 fmt = "(1a1,es0.2,1a1)" write(buffer,fmt) ">", 3.0, "<" -if (buffer.ne.">3.00E+0<") stop 6 +if (buffer.ne.">3.00E+00<") stop 6 end diff --git a/gcc/testsuite/gfortran.dg/proc_target_1.f90 b/gcc/testsuite/gfortran.dg/proc_target_1.f90 new file mode 100644 index 0000000..050ee39 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/proc_target_1.f90 @@ -0,0 +1,134 @@ +! { dg-do run } +! +! PR fortran/117070 - Procedure targets in derived-type constructors +! +! Contributed by Ivan Pribec + +module funcs + implicit none + + abstract interface + function retchar() + character(len=1) :: retchar + end function retchar + end interface +contains + function a() + character(len=1) :: a + a = 'a' + end function + function b() + character(len=1) :: b + b = 'b' + end function + function c() + character(len=1) :: c + c = 'c' + end function +end module + +module dispatch_table + use funcs + implicit none + + ! Procedure container + type :: pc + procedure(retchar), pointer, nopass :: rc => null() + end type pc + + type(pc), parameter :: dtab_p(3) = [pc(a),pc(b),pc(c)] ! Parameter + type(pc) :: dtab_v(3) = [pc(a),pc(b),pc(c)] ! Variable + +contains + + ! Dynamic dispatch table + function build_table() result(table) + type(pc) :: table(3) + table = [pc(a),pc(b),pc(c)] + end function build_table + +end module + +program test + use dispatch_table + implicit none + type(pc), parameter :: table_p(3) = [pc(a),pc(b),pc(c)] ! Parameter + type(pc) :: table_v(3) = [pc(a),pc(b),pc(c)] ! Variable + type(pc) :: table(3) + + ! Get dispatch table from local variable + table = table_v + associate (abc => table(1)%rc()//table(2)%rc()//table(3)%rc()) + if (abc /= 'abc') stop 1 + end associate + + associate (abc => table_v(1)%rc()//table_v(2)%rc()//table_v(3)%rc()) + if (abc /= 'abc') stop 2 + end associate + + table = table_p + associate (abc => table(1)%rc()//table(2)%rc()//table(3)%rc()) + if (abc /= 'abc') stop 3 + end associate + +! Bogus error: +! "Operands of string concatenation operator at (1) are PROCEDURE/PROCEDURE" +! associate (abc => table_p(1)%rc()//table_p(2)%rc()//table_p(3)%rc()) +! if (abc /= 'abc') stop 4 +! end associate + + ! Get dispatch table from other module and passed via local variable + table = build_table() ! Dynamic table + associate (abc => table(1)%rc()//table(2)%rc()//table(3)%rc()) + if (abc /= 'abc') stop 5 + end associate + + table = dtab_v + associate (abc => table(1)%rc()//table(2)%rc()//table(3)%rc()) + if (abc /= 'abc') stop 6 + end associate + + table = dtab_p + associate (abc => table(1)%rc()//table(2)%rc()//table(3)%rc()) + if (abc /= 'abc') stop 7 + end associate + + ! Dispatch table from other module directly used in associate + associate (abc => dtab_v(1)%rc()//dtab_v(2)%rc()//dtab_v(3)%rc()) + if (abc /= 'abc') stop 8 + end associate + +! associate (abc => dtab_p(1)%rc()//dtab_p(2)%rc()//dtab_p(3)%rc()) +! if (abc /= 'abc') stop 9 +! end associate + + ! Several variations + block + type(pc) :: table(3) = [pc(a),pc(b),pc(c)] + associate (abc => table(1)%rc()//table(2)%rc()//table(3)%rc()) + if (abc /= 'abc') stop 10 + end associate + end block + + block + use dispatch_table, only: table => dtab_v + associate (abc => table(1)%rc()//table(2)%rc()//table(3)%rc()) + if (abc /= 'abc') stop 11 + end associate + end block + +! block +! type(pc), parameter :: table(3) = [pc(a),pc(b),pc(c)] +! associate (abc => table(1)%rc()//table(2)%rc()//table(3)%rc()) +! if (abc /= 'abc') stop 12 +! end associate +! end block + +! block +! use dispatch_table, only: table => dtab_p +! associate (abc => table(1)%rc()//table(2)%rc()//table(3)%rc()) +! if (abc /= 'abc') stop 13 +! end associate +! end block + +end program diff --git a/gcc/testsuite/gfortran.dg/pure_result.f90 b/gcc/testsuite/gfortran.dg/pure_result.f90 new file mode 100644 index 0000000..a4d30aa --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pure_result.f90 @@ -0,0 +1,49 @@ +! { dg-do compile } +! PR fortran/78640 - constraints on pure function results +! +! F2018:C1585, F2023:C1594: +! "The function result of a pure function shall not be both polymorphic and +! allocatable, or have a polymorphic allocatable ultimate component." + +program pr78640 + implicit none + + type foo_t + end type + + type bar_t + integer, allocatable :: dummy + class(*), allocatable :: c + end type bar_t + +contains + + pure function f() result(foo) ! { dg-error "is polymorphic allocatable" } + class(foo_t), allocatable :: foo + foo = foo_t() + end function + + pure function f2() ! { dg-error "is polymorphic allocatable" } + class(foo_t), allocatable :: f2 + f2 = foo_t() + end function + + pure function g() result(foo) ! { dg-error "is polymorphic allocatable" } + class(*), allocatable :: foo + foo = foo_t() + end function + + pure function g2() ! { dg-error "is polymorphic allocatable" } + class(*), allocatable :: g2 + g2 = foo_t() + end function + + pure function h() result(bar) ! { dg-error "polymorphic allocatable component" } + type(bar_t) :: bar + end function + + pure function h2() ! { dg-error "polymorphic allocatable component" } + type(bar_t) :: h2 + end function + +end diff --git a/gcc/testsuite/gfortran.dg/select_contiguous.f90 b/gcc/testsuite/gfortran.dg/select_contiguous.f90 new file mode 100644 index 0000000..b947006 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/select_contiguous.f90 @@ -0,0 +1,51 @@ +! { dg-do compile } +! { dg-options "-O2 -Wextra -fdump-tree-optimized" } +! +! PR fortran/122709 - bogus warning for contiguous pointer assignment +! to select type target +! +! Contributed by <mscfd at gmx dot net> + +module sc_mod + implicit none + public + + type :: t + integer :: i = 0 + end type t + + type :: s + class(t), dimension(:), contiguous, pointer :: p => null() + end type s + +contains + + subroutine foo(x) + class(s), intent(in) :: x + type(t), dimension(:), contiguous, pointer :: q + select type (p_ => x%p) + type is (t) + q => p_ + if (.not. is_contiguous(x%p)) stop 1 + if (.not. is_contiguous(p_)) stop 2 ! Should get optimized out + if (.not. is_contiguous(q)) stop 3 + write(*,*) 'is contiguous: ', is_contiguous(x%p), & + is_contiguous(p_), is_contiguous(q) + end select + end subroutine foo + +end module sc_mod + +program select_contiguous + use sc_mod + implicit none + + type(s) :: x + + allocate(t :: x%p(1:10)) + call foo(x) + deallocate(x%p) + +end program select_contiguous + +! { dg-final { scan-tree-dump-not "_gfortran_stop_numeric" "optimized" } } diff --git a/gcc/testsuite/gfortran.dg/spec_statement_in_exec.f90 b/gcc/testsuite/gfortran.dg/spec_statement_in_exec.f90 new file mode 100644 index 0000000..9134a1e --- /dev/null +++ b/gcc/testsuite/gfortran.dg/spec_statement_in_exec.f90 @@ -0,0 +1,26 @@ +! { dg-do compile } +! { dg-options "-fopenmp" } +! Test improved error messages for specification statements in executable section +! PR fortran/32365 - Better error message for specification statement in executable section + +subroutine test_spec_in_exec + implicit none + integer :: i + + ! First executable statement + i = 1 + + ! Test key specification statement types + integer :: j ! { dg-error "data declaration statement at \\(1\\) cannot appear after executable statements" } + real :: x ! { dg-error "data declaration statement at \\(1\\) cannot appear after executable statements" } + complex :: z ! { dg-error "data declaration statement at \\(1\\) cannot appear after executable statements" } + logical :: flag ! { dg-error "data declaration statement at \\(1\\) cannot appear after executable statements" } + character(len=20) :: name ! { dg-error "data declaration statement at \\(1\\) cannot appear after executable statements" } + double precision :: d ! { dg-error "data declaration statement at \\(1\\) cannot appear after executable statements" } + common /myblock/ i ! { dg-error "COMMON statement at \\(1\\) cannot appear after executable statements" } + equivalence (i, i) ! { dg-error "EQUIVALENCE statement at \\(1\\) cannot appear after executable statements" } + namelist /nml/ i ! { dg-error "NAMELIST statement at \\(1\\) cannot appear after executable statements" } +!$omp threadprivate(i) ! { dg-error "THREADPRIVATE statement at \\(1\\) cannot appear after executable statements" } +!$omp declare target (i) ! { dg-error "DECLARE TARGET statement at \\(1\\) cannot appear after executable statements" } + +end subroutine test_spec_in_exec diff --git a/gcc/testsuite/gfortran.dg/value_optional_3.f90 b/gcc/testsuite/gfortran.dg/value_optional_3.f90 new file mode 100644 index 0000000..58464f9 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/value_optional_3.f90 @@ -0,0 +1,51 @@ +! { dg-do run } + +module m + implicit none(type, external) + + logical :: is_present + logical :: is_allocated + integer :: has_value + +contains + + subroutine test(a) + integer, allocatable :: a + call sub_val(a) + end subroutine test + + subroutine test2(a) + integer, allocatable, optional :: a + call sub_val(a) + end subroutine test2 + + subroutine sub_val(x) + integer, optional, value :: x + if (present(x) .neqv. (is_present .and. is_allocated)) stop 1 + if (present(x)) then + if (x /= has_value) stop 2 + end if + end subroutine sub_val + +end module m + +use m +implicit none(type, external) +integer, allocatable :: b + +is_allocated = .false. +is_present = .false. +call test2() + +is_present = .true. +call test(b) +call test2(b) + +b = 4 +is_allocated = .true. +has_value = b +call test(b) +call test2(b) +deallocate(b) + +end program diff --git a/gcc/testsuite/gm2.dg/spell/iso/fail/badimport2.mod b/gcc/testsuite/gm2.dg/spell/iso/fail/badimport2.mod new file mode 100644 index 0000000..63fd338 --- /dev/null +++ b/gcc/testsuite/gm2.dg/spell/iso/fail/badimport2.mod @@ -0,0 +1,12 @@ + +(* { dg-do compile } *) +(* { dg-options "-g -c" } *) + +MODULE badimport2 ; + +FROM StrIO IMPORT Writestring ; + (* { dg-error "error: In program module 'badimport2': unknown symbol 'Writestring', did you mean WriteString?" "Writestring" { target *-*-* } 7 } *) + +BEGIN + +END badimport2. diff --git a/gcc/testsuite/gm2.dg/spell/iso/fail/badimport3.mod b/gcc/testsuite/gm2.dg/spell/iso/fail/badimport3.mod new file mode 100644 index 0000000..ab82cd5 --- /dev/null +++ b/gcc/testsuite/gm2.dg/spell/iso/fail/badimport3.mod @@ -0,0 +1,17 @@ + +(* { dg-do compile } *) +(* { dg-options "-g -c" } *) + +MODULE badimport3 ; + +CONST + Foo = 42 ; + +MODULE inner ; +IMPORT foo ; + (* { dg-error "error: In inner module 'inner': unknown symbol 'foo', did you mean Foo?" "foo" { target *-*-* } 11 } *) +END inner ; + + +BEGIN +END badimport3. diff --git a/gcc/testsuite/gm2.dg/spell/iso/fail/badimport4.mod b/gcc/testsuite/gm2.dg/spell/iso/fail/badimport4.mod new file mode 100644 index 0000000..1b310d7 --- /dev/null +++ b/gcc/testsuite/gm2.dg/spell/iso/fail/badimport4.mod @@ -0,0 +1,17 @@ + +(* { dg-do compile } *) +(* { dg-options "-g -c" } *) + +MODULE badimport4 ; + +CONST + Foo = 42 ; + +MODULE inner ; +IMPORT foo ; + (* { dg-error "error: In inner module 'inner': unknown symbol 'foo', did you mean Foo?" "foo" { target *-*-* } 11 } *) +END inner ; + + +BEGIN +END badimport4. diff --git a/gcc/testsuite/gnat.dg/class_wide6.adb b/gcc/testsuite/gnat.dg/class_wide6.adb new file mode 100644 index 0000000..1a9b56a --- /dev/null +++ b/gcc/testsuite/gnat.dg/class_wide6.adb @@ -0,0 +1,9 @@ +package body Class_Wide6 is + + function Parse (Parser: Script_Info_Parser) return Script_Info'Class is + begin + pragma Warnings(Off); + return Parse (Parser); + end; + +end Class_Wide6; diff --git a/gcc/testsuite/gnat.dg/class_wide6.ads b/gcc/testsuite/gnat.dg/class_wide6.ads new file mode 100644 index 0000000..38c3194 --- /dev/null +++ b/gcc/testsuite/gnat.dg/class_wide6.ads @@ -0,0 +1,19 @@ +-- { dg-do compile } + +with Class_Wide6_Pkg; + +package Class_Wide6 is + + type Script_Kind_Enum is (Transformer, Validator); + + type Script_Info (Script_Kind : Script_Kind_Enum) is tagged null record; + + package Base_Script_Info_Node is new Class_Wide6_Pkg (Script_Info'Class); + + type Script_Info_Parser is new Base_Script_Info_Node.Base_Node_Parser with + null record; + + overriding function Parse (Parser: Script_Info_Parser) + return Script_Info'Class; + +end Class_Wide6; diff --git a/gcc/testsuite/gnat.dg/class_wide6_pkg.ads b/gcc/testsuite/gnat.dg/class_wide6_pkg.ads new file mode 100644 index 0000000..e3bf7e9 --- /dev/null +++ b/gcc/testsuite/gnat.dg/class_wide6_pkg.ads @@ -0,0 +1,9 @@ +generic + type Data_Type (<>) is private; +package Class_Wide6_Pkg is + + type Base_Node_Parser is abstract tagged limited null record; + + function Parse (Parser: Base_Node_Parser) return Data_Type is abstract; + +end Class_Wide6_Pkg; diff --git a/gcc/testsuite/gnat.dg/generic_inst15.adb b/gcc/testsuite/gnat.dg/generic_inst15.adb new file mode 100644 index 0000000..e1abf04 --- /dev/null +++ b/gcc/testsuite/gnat.dg/generic_inst15.adb @@ -0,0 +1,27 @@ +-- { dg-do compile } + +with Ada.Command_Line; use Ada.Command_Line; +with Ada.Directories; use Ada.Directories; +with Ada.Text_IO; use Ada.Text_IO; + +with Generic_Inst15_Pkg; +with Generic_Inst15_Pkg.G; + +procedure Generic_Inst15 is + + procedure Print_Word + (Word : in out Generic_Inst15_Pkg.Word_Type; + Continue : out Boolean) + is + begin + Ada.Text_IO.Put_Line(Generic_Inst15_Pkg.Get_Word(Word)); + Continue := True; + end; + + package Word_Lister is new Generic_Inst15_Pkg.G + (Order => Generic_Inst15_Pkg.Word_Order'Val (Positive'Value (Argument(1))), + Process => Print_Word); + +begin + null; +end; diff --git a/gcc/testsuite/gnat.dg/generic_inst15_pkg-g.ads b/gcc/testsuite/gnat.dg/generic_inst15_pkg-g.ads new file mode 100644 index 0000000..371f2fe --- /dev/null +++ b/gcc/testsuite/gnat.dg/generic_inst15_pkg-g.ads @@ -0,0 +1,8 @@ +generic + Order : Word_Order; + with procedure Process + (Word : in out Word_Type; + Continue : out Boolean); +package Generic_Inst15_Pkg.G is + procedure Translate (Code : in Book_Code_Type) is null; +end Generic_Inst15_Pkg.G; diff --git a/gcc/testsuite/gnat.dg/generic_inst15_pkg.ads b/gcc/testsuite/gnat.dg/generic_inst15_pkg.ads new file mode 100644 index 0000000..d83af45 --- /dev/null +++ b/gcc/testsuite/gnat.dg/generic_inst15_pkg.ads @@ -0,0 +1,37 @@ +private with Ada.Containers.Indefinite_Vectors; +private with Ada.Strings.Unbounded; + +package Generic_Inst15_Pkg is + type Word_Order is + (wo_Alpha, + wo_Position, + wo_Frequency_Alpha, + wo_Frequency_Position); + + subtype Book_Code_Type is String (1 .. 24); + + type Word_Type is private; + type Word_Status is (ws_Single, ws_Multi, ws_Not_All, ws_Unknown); + type Translation_Index is new Natural range 1 .. 10; + + function Get_Word (Self : in Word_Type) return String; + + type Book_Type is private; + +private + + package Translation_List is new Ada.Containers.Indefinite_Vectors ( + Index_Type => Translation_Index, + Element_Type => String, + "=" => "="); + + type Word_Type is record + Is_All : Boolean := False; + Translations : Translation_List.Vector; + end record; + + type Book_Type is record + Line : Positive := 1; + Index : Positive := 1; + end record; +end Generic_Inst15_Pkg; diff --git a/gcc/testsuite/gnat.dg/object_overflow6.adb b/gcc/testsuite/gnat.dg/object_overflow6.adb new file mode 100644 index 0000000..8aa8e04 --- /dev/null +++ b/gcc/testsuite/gnat.dg/object_overflow6.adb @@ -0,0 +1,15 @@ +-- { dg-do compile } + +with System; + +procedure Object_Overflow6 is + + type Address is range 0 .. System.Memory_Size; + + type Arr is array (Address) of Character; + + A : Arr; -- { dg-warning "Storage_Error" } + +begin + A(1) := 'a'; +end; diff --git a/gcc/testsuite/gnat.dg/prefix3.adb b/gcc/testsuite/gnat.dg/prefix3.adb new file mode 100644 index 0000000..904cc03 --- /dev/null +++ b/gcc/testsuite/gnat.dg/prefix3.adb @@ -0,0 +1,8 @@ +-- { dg-do compile } + +with Prefix3_Pkg; + +procedure Prefix3 is +begin + Prefix3_Pkg.Handler.Log ("Hello"); +end; diff --git a/gcc/testsuite/gnat.dg/prefix3_pkg.adb b/gcc/testsuite/gnat.dg/prefix3_pkg.adb new file mode 100644 index 0000000..3c1e7b5 --- /dev/null +++ b/gcc/testsuite/gnat.dg/prefix3_pkg.adb @@ -0,0 +1,16 @@ +package body Prefix3_Pkg is + + My_Handler : aliased Logging := (Output => Ada.Text_IO.Current_Output); + + My_Generic_Handler : Logging_Class := My_Handler'Access; + + procedure Log (Handler : Logging; Msg : String) is + begin + Ada.Text_IO.Put_Line (Handler.Output.all, Msg); + end Log; + + function Handler return Logging_Class is (My_Generic_Handler); + + procedure Handler (To : Logging_Class) is null; + +end Prefix3_Pkg; diff --git a/gcc/testsuite/gnat.dg/prefix3_pkg.ads b/gcc/testsuite/gnat.dg/prefix3_pkg.ads new file mode 100644 index 0000000..9011748 --- /dev/null +++ b/gcc/testsuite/gnat.dg/prefix3_pkg.ads @@ -0,0 +1,16 @@ +with Ada.Text_IO; + +package Prefix3_Pkg is + + type Logging is tagged record + Output : Ada.Text_IO.File_Access; + end record; + + procedure Log (Handler : Logging; Msg : String); + + type Logging_Class is access all Logging'Class; + + function Handler return Logging_Class; + procedure Handler (To : Logging_Class); + +end Prefix3_Pkg; diff --git a/gcc/testsuite/gnat.dg/protected_subtype1.adb b/gcc/testsuite/gnat.dg/protected_subtype1.adb new file mode 100644 index 0000000..cb003c8 --- /dev/null +++ b/gcc/testsuite/gnat.dg/protected_subtype1.adb @@ -0,0 +1,26 @@ +-- { dg-do compile } + +procedure Protected_Subtype1 is + + protected type Object with Lock_Free => True is + end Object; + + protected body Object is + end Object; + + A : Object; + + subtype Object_Subtype is Object; + + B : Object_Subtype; + + type Rec is record + A : Object; + B : Object_Subtype; + end record; + + C : Rec; + +begin + null; +end; diff --git a/gcc/testsuite/gnat.dg/reduce1.adb b/gcc/testsuite/gnat.dg/reduce1.adb index 601be4b..a1cea00 100644 --- a/gcc/testsuite/gnat.dg/reduce1.adb +++ b/gcc/testsuite/gnat.dg/reduce1.adb @@ -7,8 +7,7 @@ procedure Reduce1 is A: Arr := (2, 87); - B: Positive := A'Reduce (1, Positive'Max); -- { dg-error "no suitable" } - + B: Positive := A'Reduce (1, Positive'Max); -- { dg-error "reducer must be a subprogram, an operator, or an attribute|possible swap of reducer and initial value" } begin null; end; diff --git a/gcc/testsuite/gnat.dg/reduce3.adb b/gcc/testsuite/gnat.dg/reduce3.adb new file mode 100644 index 0000000..55934d0 --- /dev/null +++ b/gcc/testsuite/gnat.dg/reduce3.adb @@ -0,0 +1,17 @@ +-- { dg-do run } +-- { dg-options "-gnat2022" } + +with Ada.Containers.Vectors; + +procedure Reduce3 is + + package Qs is new + Ada.Containers.Vectors (Index_Type => Positive, Element_Type => Positive); + + V : Qs.Vector; + Sum : Positive; + +begin + V.Append (1); + Sum := V'Reduce ("+", 0); +end; diff --git a/gcc/testsuite/gnat.dg/renaming19.adb b/gcc/testsuite/gnat.dg/renaming19.adb new file mode 100644 index 0000000..7cb5365 --- /dev/null +++ b/gcc/testsuite/gnat.dg/renaming19.adb @@ -0,0 +1,24 @@ +-- { dg-do run } + +with Ada.Text_IO; +with Renaming19_Pkg; + +procedure Renaming19 is + + Handler : aliased Renaming19_Pkg.Logging := + (Output => Ada.Text_IO.Current_Output); + + Full_Handler : aliased Renaming19_Pkg.Full_Logging := + (Output => Ada.Text_IO.Current_Output); + + Generic_Handler : access Renaming19_Pkg.Logging'Class := Handler'Access; + + procedure My_Log_3 (Msg : String) renames Generic_Handler.Log; + procedure My_Log_4 (Msg : String; Err : Natural) renames Generic_Handler.Log; + +begin + My_Log_3 ("First"); + Generic_Handler := Full_Handler'Access; + My_Log_3 ("Second"); + My_Log_4 ("Third", 3); +end; diff --git a/gcc/testsuite/gnat.dg/renaming19_pkg.adb b/gcc/testsuite/gnat.dg/renaming19_pkg.adb new file mode 100644 index 0000000..19a87aaa --- /dev/null +++ b/gcc/testsuite/gnat.dg/renaming19_pkg.adb @@ -0,0 +1,18 @@ +package body Renaming19_Pkg is + + procedure Log (Handler : Logging; Msg : String) is + begin + Ada.Text_IO.Put_Line (Handler.Output.all, Msg); + end Log; + + procedure Log (Handler : Logging; Msg : String; Err : Natural) is + begin + Ada.Text_IO.Put_Line (Handler.Output.all, Msg & Err'Image); + end Log; + + procedure Log (Handler : Full_Logging; Msg : String) is + begin + raise Program_Error; + end Log; + +end Renaming19_Pkg; diff --git a/gcc/testsuite/gnat.dg/renaming19_pkg.ads b/gcc/testsuite/gnat.dg/renaming19_pkg.ads new file mode 100644 index 0000000..77c0f61 --- /dev/null +++ b/gcc/testsuite/gnat.dg/renaming19_pkg.ads @@ -0,0 +1,16 @@ +with Ada.Text_IO; + +package Renaming19_Pkg is + + type Logging is tagged record + Output : Ada.Text_IO.File_Access; + end record; + + procedure Log (Handler : Logging; Msg : String); + procedure Log (Handler : Logging; Msg : String; Err : Natural); + + type Full_Logging is new Logging with null record; + + procedure Log (Handler : Full_Logging; Msg : String); + +end Renaming19_Pkg; diff --git a/gcc/testsuite/gnat.dg/specs/abstract1.ads b/gcc/testsuite/gnat.dg/specs/abstract1.ads new file mode 100644 index 0000000..4674424 --- /dev/null +++ b/gcc/testsuite/gnat.dg/specs/abstract1.ads @@ -0,0 +1,9 @@ +-- { dg-do compile } + +package Abstract1 is + + type T is abstract tagged null record; + + type S is abstract new T; -- { dg-error "allowed only for record extension" } + +end Abstract1; diff --git a/gcc/testsuite/gnat.dg/specs/discr8.ads b/gcc/testsuite/gnat.dg/specs/discr8.ads new file mode 100644 index 0000000..889d37a --- /dev/null +++ b/gcc/testsuite/gnat.dg/specs/discr8.ads @@ -0,0 +1,14 @@ +-- { dg-do compile } + +package Discr8 is + + type T1 (N : Natural) is null record; + + type T2 (N : Natural) is record + C1 : string (1 .. T2.n); -- { dg-error "alone as a direct name" } + C2 : string (1 .. n); + C3 : T1 (T2.n); -- { dg-error "alone as a direct name" } + C4 : T1 (n); + end record; + +end Discr8; diff --git a/gcc/testsuite/gnat.dg/specs/generic_inst9.ads b/gcc/testsuite/gnat.dg/specs/generic_inst9.ads new file mode 100644 index 0000000..d81d16b --- /dev/null +++ b/gcc/testsuite/gnat.dg/specs/generic_inst9.ads @@ -0,0 +1,20 @@ +-- { dg-do compile } + +with Generic_Inst9_Pkg1; +with Generic_Inst9_Pkg2.G; + +package Generic_Inst9 is + + type T4 is null record; + type T5 is null record; + + subtype T3 is T5; + + type T4_ptr is access T4; + type T5_ptr is access T5; + + package My_Pkg2 is new Generic_Inst9_Pkg2 (T2 => T4); + package My_G4 is new My_Pkg2.G (T4_ptr); -- { dg-bogus "does not match|abandoned" } + package My_G5 is new My_Pkg2.G (T5_ptr); -- { dg-error "does not match|abandoned" } + +end Generic_Inst9; diff --git a/gcc/testsuite/gnat.dg/specs/generic_inst9_pkg1.ads b/gcc/testsuite/gnat.dg/specs/generic_inst9_pkg1.ads new file mode 100644 index 0000000..6c7b2a3 --- /dev/null +++ b/gcc/testsuite/gnat.dg/specs/generic_inst9_pkg1.ads @@ -0,0 +1,5 @@ +generic + type T1 is private; +package Generic_Inst9_Pkg1 is + subtype T3 is T1; +end Generic_Inst9_Pkg1; diff --git a/gcc/testsuite/gnat.dg/specs/generic_inst9_pkg2-g.ads b/gcc/testsuite/gnat.dg/specs/generic_inst9_pkg2-g.ads new file mode 100644 index 0000000..5118298 --- /dev/null +++ b/gcc/testsuite/gnat.dg/specs/generic_inst9_pkg2-g.ads @@ -0,0 +1,4 @@ +generic + type T2 is access the_pak1.T3; +package Generic_Inst9_Pkg2.G is +end Generic_Inst9_Pkg2.G; diff --git a/gcc/testsuite/gnat.dg/specs/generic_inst9_pkg2.ads b/gcc/testsuite/gnat.dg/specs/generic_inst9_pkg2.ads new file mode 100644 index 0000000..53a9dee --- /dev/null +++ b/gcc/testsuite/gnat.dg/specs/generic_inst9_pkg2.ads @@ -0,0 +1,7 @@ +with Generic_Inst9_Pkg1; + +generic + type T2 is private; +package Generic_Inst9_Pkg2 is + package the_pak1 is new Generic_Inst9_Pkg1 (T1 => T2); +end Generic_Inst9_Pkg2; diff --git a/gcc/testsuite/gnat.dg/specs/limited_with4.ads b/gcc/testsuite/gnat.dg/specs/limited_with1.ads index 53fb676..f8fc01b 100644 --- a/gcc/testsuite/gnat.dg/specs/limited_with4.ads +++ b/gcc/testsuite/gnat.dg/specs/limited_with1.ads @@ -2,16 +2,16 @@ -- { dg-options "-gnatc" } with Ada.Containers.Vectors; -with Limited_With4_Pkg; +with Limited_With1_Pkg; -package Limited_With4 is +package Limited_With1 is type Object is tagged private; type Object_Ref is access all Object; type Class_Ref is access all Object'Class; package Vec is new Ada.Containers.Vectors - (Positive, Limited_With4_Pkg.Object_Ref,Limited_With4_Pkg ."="); + (Positive, Limited_With1_Pkg.Object_Ref,Limited_With1_Pkg ."="); subtype Vector is Vec.Vector; private @@ -20,4 +20,4 @@ private V : Vector; end record; -end Limited_With4; +end Limited_With1; diff --git a/gcc/testsuite/gnat.dg/specs/limited_with1_pkg.ads b/gcc/testsuite/gnat.dg/specs/limited_with1_pkg.ads new file mode 100644 index 0000000..b1d09e4 --- /dev/null +++ b/gcc/testsuite/gnat.dg/specs/limited_with1_pkg.ads @@ -0,0 +1,15 @@ +-- { dg-do compile } +-- { dg-options "-gnatc" } + +limited with Limited_With1; + +package Limited_With1_Pkg is + + type Object is tagged null record; + type Object_Ref is access all Object; + type Class_Ref is access all Object'Class; + + function Func return Limited_With1.Class_Ref; + procedure Proc (Arg : Limited_With1.Class_Ref); + +end Limited_With1_Pkg; diff --git a/gcc/testsuite/gnat.dg/specs/limited_with2-child1.ads b/gcc/testsuite/gnat.dg/specs/limited_with2-child1.ads new file mode 100644 index 0000000..aae2f74 --- /dev/null +++ b/gcc/testsuite/gnat.dg/specs/limited_with2-child1.ads @@ -0,0 +1,6 @@ +-- { dg-do compile } + +with Limited_With2.Child2; + +package Limited_With2.Child1 is +end Limited_With2.Child1; diff --git a/gcc/testsuite/gnat.dg/specs/limited_with2-child2.ads b/gcc/testsuite/gnat.dg/specs/limited_with2-child2.ads new file mode 100644 index 0000000..10c77fa --- /dev/null +++ b/gcc/testsuite/gnat.dg/specs/limited_with2-child2.ads @@ -0,0 +1,6 @@ +-- { dg-do compile } + +limited with Limited_With2.Child1; + +package Limited_With2.Child2 is +end Limited_With2.Child2; diff --git a/gcc/testsuite/gnat.dg/specs/limited_with2.ads b/gcc/testsuite/gnat.dg/specs/limited_with2.ads new file mode 100644 index 0000000..7a8cbf7 --- /dev/null +++ b/gcc/testsuite/gnat.dg/specs/limited_with2.ads @@ -0,0 +1,2 @@ +private package Limited_With2 is +end Limited_With2; diff --git a/gcc/testsuite/gnat.dg/specs/limited_with4_pkg.ads b/gcc/testsuite/gnat.dg/specs/limited_with4_pkg.ads deleted file mode 100644 index 3d690bd..0000000 --- a/gcc/testsuite/gnat.dg/specs/limited_with4_pkg.ads +++ /dev/null @@ -1,15 +0,0 @@ --- { dg-do compile } --- { dg-options "-gnatc" } - -limited with Limited_With4; - -package Limited_With4_Pkg is - - type Object is tagged null record; - type Object_Ref is access all Object; - type Class_Ref is access all Object'Class; - - function Func return Limited_With4.Class_Ref; - procedure Proc (Arg : Limited_With4.Class_Ref); - -end Limited_With4_Pkg; diff --git a/gcc/testsuite/gnat.dg/specs/unknown_discr1.ads b/gcc/testsuite/gnat.dg/specs/unknown_discr1.ads new file mode 100644 index 0000000..d1c85e1 --- /dev/null +++ b/gcc/testsuite/gnat.dg/specs/unknown_discr1.ads @@ -0,0 +1,23 @@ +-- { dg-do compile } + +with Unknown_Discr1_Pkg; use Unknown_Discr1_Pkg; +with Unknown_Discr1_Pkg.Child; +with Unknown_Discr1_Pkg.Inst; + +package Unknown_Discr1 is + + A : Tagged_Type (0); -- { dg-error "type has unknown discriminants" } + + B : Child.Derived_1 (1); -- { dg-error "type has unknown discriminants" } + + C : Child.Derived_2 (2); -- { dg-error "type has unknown discriminants" } + + D : Child.Nested.Derived_3 (3); -- { dg-error "type has unknown discriminants" } + + E : Inst.Derived_1 (1); -- { dg-error "type has unknown discriminants" } + + F : Inst.Derived_2 (2); -- { dg-error "type has unknown discriminants" } + + G : Inst.Nested.Derived_3 (3); -- { dg-error "type has unknown discriminants" } + +end Unknown_Discr1; diff --git a/gcc/testsuite/gnat.dg/specs/unknown_discr1_pkg-child.ads b/gcc/testsuite/gnat.dg/specs/unknown_discr1_pkg-child.ads new file mode 100644 index 0000000..681efbc --- /dev/null +++ b/gcc/testsuite/gnat.dg/specs/unknown_discr1_pkg-child.ads @@ -0,0 +1,17 @@ +package Unknown_Discr1_Pkg.Child is + + type Derived_1 is new Tagged_Type with null record; + + type Derived_2 is new Derived_1 with null record; + + package Nested is + + type Derived_3 is new Tagged_Type with private; + + private + + type Derived_3 is new Tagged_Type with null record; + + end Nested; + +end Unknown_Discr1_Pkg.Child; diff --git a/gcc/testsuite/gnat.dg/specs/unknown_discr1_pkg-g.ads b/gcc/testsuite/gnat.dg/specs/unknown_discr1_pkg-g.ads new file mode 100644 index 0000000..1570405 --- /dev/null +++ b/gcc/testsuite/gnat.dg/specs/unknown_discr1_pkg-g.ads @@ -0,0 +1,21 @@ +generic + + type Base (<>) is new Tagged_Type with private; + +package Unknown_Discr1_Pkg.G is + + type Derived_1 is new Base with null record; + + type Derived_2 is new Derived_1 with null record; + + package Nested is + + type Derived_3 is new Tagged_Type with private; + + private + + type Derived_3 is new Tagged_Type with null record; + + end Nested; + +end Unknown_Discr1_Pkg.G; diff --git a/gcc/testsuite/gnat.dg/specs/unknown_discr1_pkg-inst.ads b/gcc/testsuite/gnat.dg/specs/unknown_discr1_pkg-inst.ads new file mode 100644 index 0000000..5dfe119 --- /dev/null +++ b/gcc/testsuite/gnat.dg/specs/unknown_discr1_pkg-inst.ads @@ -0,0 +1,3 @@ +with Unknown_Discr1_Pkg.G; + +package Unknown_Discr1_Pkg.Inst is new Unknown_Discr1_Pkg.G (Tagged_Type); diff --git a/gcc/testsuite/gnat.dg/specs/unknown_discr1_pkg.ads b/gcc/testsuite/gnat.dg/specs/unknown_discr1_pkg.ads new file mode 100644 index 0000000..d769b4d --- /dev/null +++ b/gcc/testsuite/gnat.dg/specs/unknown_discr1_pkg.ads @@ -0,0 +1,9 @@ +package Unknown_Discr1_Pkg is + + type Tagged_Type (<>) is tagged limited private; + +private + + type Tagged_Type (Kind : Integer) is tagged limited null record; + +end Unknown_Discr1_Pkg; diff --git a/gcc/testsuite/gnat.dg/use_type4.adb b/gcc/testsuite/gnat.dg/use_type4.adb new file mode 100644 index 0000000..5ceb288 --- /dev/null +++ b/gcc/testsuite/gnat.dg/use_type4.adb @@ -0,0 +1,29 @@ +-- { dg-do compile } + +procedure Use_Type4 is + + package P1 is + type T is new Integer; + function "and" (L, R : in Integer) return T; + end P1; + + package body P1 is + function "and" (L, R : in Integer) return T is + begin + return T (L * R); + end "and"; + end P1; + + use type P1.T; + + package Renaming renames P1; + + package P2 is + use Renaming; + end P2; + + G : P1.T := Integer'(1) and Integer'(2); + +begin + null; +end; diff --git a/gcc/testsuite/gnat.dg/vect19.adb b/gcc/testsuite/gnat.dg/vect19.adb new file mode 100644 index 0000000..af6f7e6 --- /dev/null +++ b/gcc/testsuite/gnat.dg/vect19.adb @@ -0,0 +1,17 @@ +-- { dg-do compile { target i?86-*-* x86_64-*-* } } +-- { dg-options "-O3 -msse2 -gnatn -fno-tree-slp-vectorize -fdump-tree-vect-details" } + +package body Vect19 is + + function NSum (X : Arr; N : Positive) return Arr is + Ret : Arr := X; + begin + for I in 1 .. N loop + Ret := Sum (Ret, X); + end loop; + return Ret; + end; + +end Vect19; + +-- { dg-final { scan-tree-dump "vectorized 1 loops" "vect" } } diff --git a/gcc/testsuite/gnat.dg/vect19.ads b/gcc/testsuite/gnat.dg/vect19.ads new file mode 100644 index 0000000..475f8d4 --- /dev/null +++ b/gcc/testsuite/gnat.dg/vect19.ads @@ -0,0 +1,7 @@ +with Vect19_Pkg; use Vect19_Pkg; + +package Vect19 is + + function NSum (X : Arr; N : Positive) return Arr; + +end Vect19; diff --git a/gcc/testsuite/gnat.dg/vect19_pkg.adb b/gcc/testsuite/gnat.dg/vect19_pkg.adb new file mode 100644 index 0000000..4c3b999 --- /dev/null +++ b/gcc/testsuite/gnat.dg/vect19_pkg.adb @@ -0,0 +1,12 @@ +package body Vect19_Pkg is + + function Sum (X : Arr; Y : Arr) return Arr is + Result : Arr; + begin + for I in X'Range loop + Result(I) := X(I) + Y(I); + end loop; + return Result; + end; + +end Vect19_Pkg; diff --git a/gcc/testsuite/gnat.dg/vect19_pkg.ads b/gcc/testsuite/gnat.dg/vect19_pkg.ads new file mode 100644 index 0000000..accd8af --- /dev/null +++ b/gcc/testsuite/gnat.dg/vect19_pkg.ads @@ -0,0 +1,9 @@ +package Vect19_Pkg is + + type Arr is array (1 .. 4) of Float; + for Arr'Alignment use 16; + + function Sum (X : Arr; Y : Arr) return Arr; + pragma Inline (Sum); + +end Vect19_Pkg; diff --git a/gcc/testsuite/gnat.dg/warn34.adb b/gcc/testsuite/gnat.dg/warn34.adb new file mode 100644 index 0000000..57318a0 --- /dev/null +++ b/gcc/testsuite/gnat.dg/warn34.adb @@ -0,0 +1,9 @@ +-- { dg-do compile } +-- { dg-options "-gnatwk" } + +function Warn34 (F : Boolean) return String is + S : String := -- { dg-warning "could be declared constant" } + (if F then "foo" else "bar"); +begin + return S; +end; diff --git a/gcc/testsuite/jit.dg/all-non-failing-tests.h b/gcc/testsuite/jit.dg/all-non-failing-tests.h index fe9ad1d..aa9d343 100644 --- a/gcc/testsuite/jit.dg/all-non-failing-tests.h +++ b/gcc/testsuite/jit.dg/all-non-failing-tests.h @@ -8,6 +8,9 @@ hooks provided by each test case. */ #define COMBINED_TEST +/* test-abi.c: This can't be in the testcases array as it + is target-specific. */ + /* test-accessing-bitfield.c */ #define create_code create_code_accessing_bitfield #define verify_code verify_code_accessing_bitfield diff --git a/gcc/testsuite/jit.dg/test-abi.c b/gcc/testsuite/jit.dg/test-abi.c new file mode 100644 index 0000000..479fe69 --- /dev/null +++ b/gcc/testsuite/jit.dg/test-abi.c @@ -0,0 +1,51 @@ +/* { dg-do compile { target x86_64-*-* } } */ + +#include <stdlib.h> +#include <stdio.h> + +#include "libgccjit.h" + +#define TEST_COMPILING_TO_FILE +#define OUTPUT_KIND GCC_JIT_OUTPUT_KIND_ASSEMBLER +#define OUTPUT_FILENAME "output-of-test-restrict.c.s" +#include "harness.h" + +void +create_code (gcc_jit_context *ctxt, void *user_data) +{ + /* Let's try to inject the equivalent of: +__attribute__((__ms_abi__)) +int t(int x, int y) { + return x * y; +} + */ + gcc_jit_type *int_type = + gcc_jit_context_get_type (ctxt, GCC_JIT_TYPE_INT); + + gcc_jit_param *x = + gcc_jit_context_new_param (ctxt, NULL, int_type, "x"); + gcc_jit_param *y = + gcc_jit_context_new_param (ctxt, NULL, int_type, "y"); + gcc_jit_param *params[2] = {x, y}; + + gcc_jit_function *func_t = + gcc_jit_context_new_function (ctxt, NULL, + GCC_JIT_FUNCTION_EXPORTED, int_type, "t", + 2, params, 0); + gcc_jit_function_add_attribute (func_t, + GCC_JIT_FN_ATTRIBUTE_X86_MS_ABI); + + gcc_jit_block *block = gcc_jit_function_new_block (func_t, NULL); + + gcc_jit_rvalue *result = + gcc_jit_context_new_binary_op ( + ctxt, NULL, GCC_JIT_BINARY_OP_MULT, + int_type, + gcc_jit_param_as_rvalue (x), + gcc_jit_param_as_rvalue (y)); + + gcc_jit_block_end_with_return (block, NULL, result); +} + +/* { dg-final { jit-verify-output-file-was-created "" } } */ +/* { dg-final { jit-verify-assembler-output "movl\\s+%ecx, %eax" } } */ diff --git a/gcc/testsuite/lib/algol68-dg.exp b/gcc/testsuite/lib/algol68-dg.exp new file mode 100644 index 0000000..5dcfb51 --- /dev/null +++ b/gcc/testsuite/lib/algol68-dg.exp @@ -0,0 +1,96 @@ +# Copyright (C) 1997-2024 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# <http://www.gnu.org/licenses/>. + +load_lib gcc-dg.exp + +# Define ALGOL68 callbacks for dg.exp. + +proc algol68-dg-test { prog do_what extra_tool_flags } { + return [gcc-dg-test-1 algol68_target_compile $prog $do_what $extra_tool_flags] +} + +proc algol68-dg-prune { system text } { + return [gcc-dg-prune $system $text] +} + +# Global modules options +set MODULES_OPTIONS "" + +# Modified dg-runtest that can cycle through a list of optimization options +# as c-torture does. +proc algol68-dg-runtest { testcases flags default-extra-flags } { + global runtests + global TORTURE_OPTIONS + global MODULES_OPTIONS + + foreach test $testcases { + # If we're only testing specific files and this isn't one of + # them, skip it. + if ![runtest_file_p $runtests $test] { + continue + } + + # look if this is dg-do-run test, in which case + # we cycle through the option list, otherwise we don't + if [expr [search_for $test "dg-do run"]] { + set option_list $TORTURE_OPTIONS + } else { + set option_list [list { -O2 } ] + } + + set nshort [file tail [file dirname $test]]/[file tail $test] + + foreach flags_t $option_list { + verbose "Testing $nshort, $flags $flags_t" 1 + dg-test $test "$MODULES_OPTIONS $flags $flags_t" ${default-extra-flags} + } + } +} + +# Build a series of modules ACCESSed by this test. +# +# The first to dg-modules is a list of module names. The source file +# for a given module MODULE is assumed to be MODULE.a68, and that file +# must reside in the current directory. +# +# The second option to dg-modules, which is optional, can be used to +# specify additional options to be passed to ga68 when it compiles the +# modules. + +proc dg-modules { args } { + + global objdir + global srcdir + global subdir + + if { [llength $args] != 2 && [llength $args] != 3 } { + error "[lindex $args 0]: invalid arguments" + } + set modules [lindex $args 1] + + set module_options {} + if { [llength $args] == 3 } { + set module_options [lindex $args 2] + } + + foreach module $modules { + set srcfile "${module}.a68" + set objfile "${module}.o" + # Compile the module + set comp_output [algol68_target_compile $srcdir/$subdir/$srcfile \ + $objdir/$objfile object $module_options] + } +} diff --git a/gcc/testsuite/lib/algol68-torture.exp b/gcc/testsuite/lib/algol68-torture.exp new file mode 100644 index 0000000..6da5636 --- /dev/null +++ b/gcc/testsuite/lib/algol68-torture.exp @@ -0,0 +1,483 @@ +# Copyright (C) 2009-2024 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# <http://www.gnu.org/licenses/>. + +# Please email any bugs, comments, and/or additions to this file to +# the author. + +load_lib dg.exp + +load_lib target-supports.exp + +load_lib target-utils.exp + +# The default option list can be overridden by +# TORTURE_OPTIONS="{ { list1 } ... { listN } }" + +if ![info exists TORTURE_OPTIONS] { + set TORTURE_OPTIONS [list \ + { -O0 } { -O1 } { -O2 } \ + { -O2 -fomit-frame-pointer -finline-functions } \ + { -O2 -fomit-frame-pointer -finline-functions -funroll-loops } \ + { -O2 -fcheck=bounds } \ + { -O2 -fcheck=nil } \ + { -O3 -g } \ + { -Os }] + + if [check_effective_target_lto] { + set TORTURE_OPTIONS \ + [concat $TORTURE_OPTIONS [list {-flto}]] + } +} + +# Location of built modules +set BUILT_MODULES_DIR "" + +# Build a series of modules ACCESSed by this test. +# +# The first to dg-modules is a list of module names. The source file +# for a given module MODULE is assumed to be MODULE.a68, and that file +# must reside in the current directory. +# +# The second option to dg-modules, which is optional, can be used to +# specify additional options to be passed to ga68 when it compiles the +# modules. + +proc dg-modules { args } { + + global objdir + global srcdir + global subdir + global algol68_module_objects + + if { [llength $args] != 2 && [llength $args] != 3 } { + error "[lindex $args 0]: invalid arguments" + } + set modules [lindex $args 1] + + set module_options {} + if { [llength $args] == 3 } { + set module_options [lindex $args 2] + } + + foreach module $modules { + set srcfile "${module}.a68" + set objfile "${module}.o" + # Compile the module + set comp_output [algol68_target_compile $srcdir/$subdir/$srcfile \ + $objdir/$objfile object $module_options] + lappend algol68_module_objects $objfile + } +} + +# +# algol68-torture-compile -- compile an algol68/execute/torture testcase. +# +# SRC is the full pathname of the testcase. +# OPTION is the specific compiler flag we're testing (eg: -O2). +# +proc algol68-torture-compile { src option } { + global output + global srcdir tmpdir + global host_triplet + + set output "$tmpdir/[file tail [file rootname $src]].o" + + regsub "(?q)$srcdir/" $src "" testcase + + # If we couldn't rip $srcdir out of `src' then just do the best we can. + # The point is to reduce the unnecessary noise in the logs. Don't strip + # out too much because different testcases with the same name can confuse + # `test-tool'. + if [string match "/*" $testcase] { + set testcase "[file tail [file dirname $src]]/[file tail $src]" + } + + verbose "Testing $testcase, $option" 1 + + # Run the compiler and get results in comp_output. + set options "" + lappend options "additional_flags=-w $option" + + set comp_output [algol68_target_compile "$src" "$output" object $options] + + # See if we got something bad. + set fatal_signal "*algol68*: Internal compiler error: program*got fatal signal" + + if [string match "$fatal_signal 6" $comp_output] then { + algol68_fail $testcase "Got Signal 6, $option" + catch { remote_file build delete $output } + return + } + + if [string match "$fatal_signal 11" $comp_output] then { + algol68_fail $testcase "Got Signal 11, $option" + catch { remote_file build delete $output } + return + } + + if [regexp -line -- "internal compiler error.*" $comp_output ice] then { + algol68_fail $testcase "$option ($ice)" + catch { remote_file build delete $output } + return + } + + # We shouldn't get these because of -w, but just in case. + if [string match "*algol68*:*warning:*" $comp_output] then { + warning "$testcase: (with warnings) $option" + send_log "$comp_output\n" + unresolved "$testcase, $option" + catch { remote_file build delete $output } + return + } + + # Prune warnings we know are unwanted. + set comp_output [prune_warnings $comp_output] + + # Report if the testcase is not supported. + set unsupported_message [algol68_check_unsupported_p $comp_output] + if { $unsupported_message != "" } { + unsupported "$testcase: $unsupported_message" + catch { remote_file build delete $output } + return + } + + # remove any leftover LF/CR to make sure any output is legit + regsub -all -- "\[\r\n\]*" $comp_output "" comp_output + + # If any message remains, we fail. + if ![string match "" $comp_output] then { + algol68_fail $testcase $option + catch { remote_file build delete $output } + return + } + + algol68_pass $testcase $option + catch { remote_file build delete $output } +} + + +# +# algol68-torture-execute -- compile and execute a testcase. +# +# SRC is the full pathname of the testcase. +# +# If the testcase has an associated .x file, we source that to run the +# test instead. We use .x so that we don't lengthen the existing filename +# to more than 14 chars. +# +proc algol68-torture-execute { src } { + global output + global srcdir tmpdir + global tool + global compiler_conditional_xfail_data + global TORTURE_OPTIONS + global BUILT_MODULES_DIR + global errorCode errorInfo + global algol68_module_objects + global algol68_compile_args + global algol68_execute_args + global dg-extra-tool-flags + + set dg-excess-errors-flag 0 + set dg-messages "" + set dg-extra-tool-flags "" + set dg-final-code "" + + # `dg-output-text' is a list of two elements: pass/fail and text. + # Leave second element off for now (indicates "don't perform test") + set dg-output-text "P" + + # The list of module objects to include in the compilation line + # is built by dg-get-options while processing the { dg-modules } + # marks. See the dg-modules procedure above. + set algol68_module_objects "" + + set tmp [dg-get-options $src] + foreach op $tmp { + verbose "Processing option: $op" 3 + set status [catch $op errmsg] + if { $status != 0 } { + if { 0 && [info exists errorInfo] } { + # This also prints a backtrace which will just confuse + # testcase writers, so it's disabled. + perror "$src: $errorInfo\n" + } else { + perror "$src: $errmsg for \"$op\"\n" + } + perror "$src: $errmsg for \"$op\"" 0 + return + } + } + + # Check for alternate driver. + set additional_flags "" + if [file exists [file rootname $src].x] { + verbose "Using alternate driver [file rootname [file tail $src]].x" 2 + set done_p 0 + catch "set done_p \[source [file rootname $src].x\]" + if { $done_p } { + return + } + } + + # Setup the options for the testcase run. + set option_list $TORTURE_OPTIONS + set executable $tmpdir/[file tail [file rootname $src].x] + regsub "(?q)$srcdir/" $src "" testcase + + if { ! [info exists algol68_compile_args] } { + set algol68_compile_args "" + } + if { ! [info exists algol68_execute_args] } { + set algol68_execute_args "" + } + + # If we couldn't rip $srcdir out of `src' then just do the best we can. + # The point is to reduce the unnecessary noise in the logs. Don't strip + # out too much because different testcases with the same name can confuse + # `test-tool'. + if [string match "/*" $testcase] { + set testcase "[file tail [file dirname $src]]/[file tail $src]" + } + + # Walk the list of options and compile and run the testcase for all + # options that are not explicitly disabled by the .x script (if present). + foreach option $option_list { + + # Torture_{compile,execute}_xfail are set by the .x script. + if [info exists torture_compile_xfail] { + setup_xfail $torture_compile_xfail + } + + # Torture_execute_before_{compile,execute} can be set by the .x script. + if [info exists torture_eval_before_compile] { + set ignore_me [eval $torture_eval_before_compile] + } + + # FIXME: We should make sure that the modules required by this testcase + # exist. If not, the testcase should XFAIL. + + # Compile the testcase. + catch { remote_file build delete $executable } + verbose "Testing $testcase, $option" 1 + + set options "" + lappend options "additional_flags=-w $option" + if { ${dg-extra-tool-flags} != "" } { + lappend options "additional_flags=${dg-extra-tool-flags}" + } + if { $additional_flags != "" } { + lappend options "additional_flags=$additional_flags" + } + if { $algol68_compile_args != "" } { + lappend options "additional_flags=$algol68_compile_args" + } + if { $BUILT_MODULES_DIR != "" } { + lappend options "additional_flags=-I$BUILT_MODULES_DIR" + } + if { $algol68_module_objects != "" } { + lappend options "additional_flags=$algol68_module_objects" + } + set comp_output [algol68_target_compile "$src" "$executable" executable $options] + + # See if we got something bad. + set fatal_signal "*algol68*: Internal compiler error: program*got fatal signal" + + if [string match "$fatal_signal 6" $comp_output] then { + algol68_fail $testcase "Got Signal 6, $option" + catch { remote_file build delete $executable } + continue + } + + if [string match "$fatal_signal 11" $comp_output] then { + algol68_fail $testcase "Got Signal 11, $option" + catch { remote_file build delete $executable } + continue + } + + if [regexp -line -- "internal compiler error.*" $comp_output ice] then { + algol68_fail $testcase "$option ($ice)" + catch { remote_file build delete $executable } + continue + } + + # We shouldn't get these because of -w, but just in case. + if [string match "*algol68*:*warning:*" $comp_output] then { + warning "$testcase: (with warnings) $option" + send_log "$comp_output\n" + unresolved "$testcase, $option" + catch { remote_file build delete $executable } + continue + } + + # Prune warnings we know are unwanted. + set comp_output [prune_warnings $comp_output] + + # Report if the testcase is not supported. + set unsupported_message [algol68_check_unsupported_p $comp_output] + if { $unsupported_message != "" } { + unsupported "$testcase: $unsupported_message" + continue + } elseif ![file exists $executable] { + if ![is3way] { + fail "$testcase compilation, $option" + untested "$testcase execution, $option" + continue + } else { + # FIXME: since we can't test for the existence of a remote + # file without short of doing an remote file list, we assume + # that since we got no output, it must have compiled. + pass "$testcase compilation, $option" + } + } else { + pass "$testcase compilation, $option" + } + + if [info exists torture_execute_xfail] { + setup_xfail $torture_execute_xfail + } + + if [info exists torture_eval_before_execute] { + set ignore_me [eval $torture_eval_before_execute] + } + + # Run the testcase, and analyse the output. + set result [algol68_load "$executable" "$algol68_execute_args" ""] + set status [lindex $result 0] + set output [lindex $result 1] + if { $status eq "pass" } { + pass "$testcase execution test, $option" + verbose "Exec succeeded." 3 + if { [llength ${dg-output-text}] > 1 } { + if { [lindex ${dg-output-text} 0] eq "F" } { + setup_xfail "*-*-*" + } + set texttmp [lindex ${dg-output-text} 1] + if { ![regexp -- $texttmp $output] } { + fail "$testcase output pattern test, $option" + send_log "Output was:\n${output}\nShould match:\n$texttmp\n" + verbose "Failed test for output pattern $texttmp" 3 + } else { + pass "$testcase output pattern test, $option" + verbose "Passed test for output pattern $texttmp" 3 + } + unset texttmp + } + } elseif { $status eq "fail" } { + if {[info exists errorCode]} { + verbose "Exec failed, errorCode: $errorCode" 3 + } else { + verbose "Exec failed, errorCode not defined!" 3 + } + fail "$testcase execution test, $option" + } else { + $status "$testcase execution, $option" + } + catch { remote_file build delete $executable } + } +} + + +# +# search_for_re -- looks for a string match in a file +# +proc search_for_re { file pattern } { + set fd [open $file r] + while { [gets $fd cur_line]>=0 } { + set lower [string tolower $cur_line] + if [regexp "$pattern" $lower] then { + close $fd + return 1 + } + } + close $fd + return 0 +} + + +# +# algol68-torture -- the algol68-torture testcase source file processor +# +# This runs compilation only tests (no execute tests). +# +# SRC is the full pathname of the testcase, or just a file name in which +# case we prepend $srcdir/$subdir. +# +# If the testcase has an associated .x file, we source that to run the +# test instead. We use .x so that we don't lengthen the existing filename +# to more than 14 chars. +# +proc algol68-torture { args } { + global srcdir subdir + global compiler_conditional_xfail_data + global TORTURE_OPTIONS + + set src [lindex $args 0] + if { [llength $args] > 1 } { + set options [lindex $args 1] + } else { + set options "" + } + + # Prepend $srdir/$subdir if missing. + if ![string match "*/*" $src] { + set src "$srcdir/$subdir/$src" + } + + # Check for alternate driver. + if [file exists [file rootname $src].x] { + verbose "Using alternate driver [file rootname [file tail $src]].x" 2 + set done_p 0 + catch "set done_p \[source [file rootname $src].x\]" + if { $done_p } { + return + } + } + + # loop through all the options + set option_list $TORTURE_OPTIONS + foreach option $option_list { + + # torture_compile_xfail is set by the .x script (if present) + if [info exists torture_compile_xfail] { + setup_xfail $torture_compile_xfail + } + + # torture_execute_before_compile is set by the .x script (if present) + if [info exists torture_eval_before_compile] { + set ignore_me [eval $torture_eval_before_compile] + } + + algol68-torture-compile $src "$option $options" + } +} + +# +# add-ieee-options -- add options necessary for 100% ieee conformance. +# +proc add-ieee-options { } { + # Ensure that excess precision does not cause problems. + if { [istarget i?86-*-*] + || [istarget m68k-*-*] } then { + uplevel 1 lappend additional_flags "-ffloat-store" + } + + # Enable full IEEE compliance mode. + if { [istarget alpha*-*-*] + || [istarget sh*-*-*] } then { + uplevel 1 lappend additional_flags "-mieee" + } +} diff --git a/gcc/testsuite/lib/algol68.exp b/gcc/testsuite/lib/algol68.exp new file mode 100644 index 0000000..a7a0090 --- /dev/null +++ b/gcc/testsuite/lib/algol68.exp @@ -0,0 +1,219 @@ +# Copyright (C) 2012-2024 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# <http://www.gnu.org/licenses/>. + +# +# ALGOL68 support library routines +# + +load_lib prune.exp +load_lib gcc-defs.exp +load_lib timeout.exp +load_lib target-libpath.exp + +# +# ALGOL68_UNDER_TEST is the compiler under test. +# + +set algol68_compile_options "" + + +# +# algol68_include_flags -- include flags for the gcc tree structure +# + +proc algol68_include_flags { paths } { + global srcdir + global TESTING_IN_BUILD_TREE + + set flags "" + + if { [is_remote host] || ![info exists TESTING_IN_BUILD_TREE] } { + return "${flags}" + } + + set gccpath ${paths} + + return "$flags" +} + +# +# algol68_link_flags -- linker flags for the gcc tree structure +# + +proc algol68_link_flags { paths } { + global srcdir + global ld_library_path + global shlib_ext + global SHARED_OPTION + global ALGOL68_UNDER_TEST + + set gccpath ${paths} + set libio_dir "" + set flags "" + set ld_library_path "." + set shlib_ext [get_shlib_extension] + set SHARED_OPTION "" + verbose "shared lib extension: $shlib_ext" + + # We need to add options to locate libga68. + set target_wants_B_option 0 + if { [istarget *-*-darwin9* ] || [istarget *-*-darwin\[12\]* ] } { + set target_wants_B_option 1 + } + + if { $gccpath != "" } { + # Path to libga68.spec. + append flags "-B${gccpath}/libga68 " + if { [file exists "${gccpath}/libga68/.libs/libga68.a"] \ + || [file exists "${gccpath}/libga68/.libs/libga68.${shlib_ext}"] } { + if { $target_wants_B_option } { + append flags "-B${gccpath}/libga68/.libs " + } else { + append flags "-L${gccpath}/libga68/.libs " + } + append ld_library_path ":${gccpath}/libga68/.libs" + } + # Static linking is default. If only the shared lib is available adjust + # flags to always use it. If both are available, set SHARED_OPTION which + # will be added to PERMUTE_ARGS + if { [file exists "${gccpath}/libga68/src/.libs/libga68.${shlib_ext}"] } { + if { [file exists "${gccpath}/libga68/src/.libs/libga68.a"] } { + set SHARED_OPTION "-shared-libga68" + } else { +# append flags "-shared-libga68 " + } + } + if [file exists "${gccpath}/libiberty/libiberty.a"] { + append flags "-L${gccpath}/libiberty " + } + append ld_library_path [gcc-set-multilib-library-path $ALGOL68_UNDER_TEST] + } + + set_ld_library_path_env_vars + + return "$flags" +} + +# +# algol68_init -- called at the start of each subdir of tests +# + +proc algol68_init { args } { + global subdir + global algol68_initialized + global base_dir + global tmpdir + global libdir + global gluefile wrap_flags + global objdir srcdir + global ALWAYS_ALGOL68FLAGS + global TOOL_EXECUTABLE TOOL_OPTIONS + global ALGOL68_UNDER_TEST + global TESTING_IN_BUILD_TREE + global gcc_warning_prefix + global gcc_error_prefix + + # We set LC_ALL and LANG to C so that we get the same error messages as expected. + setenv LC_ALL C + setenv LANG C + + if ![info exists ALGOL68_UNDER_TEST] then { + if [info exists TOOL_EXECUTABLE] { + set ALGOL68_UNDER_TEST $TOOL_EXECUTABLE + } else { + if { [is_remote host] || ! [info exists TESTING_IN_BUILD_TREE] } { + set ALGOL68_UNDER_TEST [transform ga68] + } else { + set ALGOL68_UNDER_TEST [findfile $base_dir/../../ga68 "$base_dir/../../ga68 -B$base_dir/../../" [findfile $base_dir/ga68 "$base_dir/ga68 -B$base_dir/" [transform ga68]]] + } + } + } + + if ![is_remote host] { + if { [which $ALGOL68_UNDER_TEST] == 0 } then { + perror "ALGOL68_UNDER_TEST ($ALGOL68_UNDER_TEST) does not exist" + exit 1 + } + } + + if ![info exists tmpdir] { + set tmpdir "/tmp" + } + + if [info exists gluefile] { + unset gluefile + } + + set gcc_warning_prefix "warning:" + set gcc_error_prefix "(fatal )?error:" + + verbose "algol68 is initialized" 3 +} + +# +# algol68_target_compile -- compile a source file +# + +proc algol68_target_compile { source dest type options } { + global tmpdir + global gluefile wrap_flags + global ALWAYS_ALGOL68FLAGS + global ALGOL68_UNDER_TEST + global individual_timeout + global TEST_ALWAYS_FLAGS + + # HACK: guard against infinite loops in the compiler + set individual_timeout 20 + + if { [target_info needs_status_wrapper] != "" && [info exists gluefile] } { + lappend options "libs=${gluefile}" + lappend options "ldflags=${wrap_flags}" + } + + set ALWAYS_ALGOL68FLAGS "" + + # TEST_ALWAYS_FLAGS are flags that should be passed to every + # compilation. They are passed first to allow individual + # tests to override them. + if [info exists TEST_ALWAYS_FLAGS] { + lappend ALWAYS_ALGOL68FLAGS "additional_flags=$TEST_ALWAYS_FLAGS" + } + + if ![is_remote host] { + if [info exists TOOL_OPTIONS] { + lappend ALWAYS_ALGOL68FLAGS "additional_flags=[algol68_include_flags [get_multilibs ${TOOL_OPTIONS}] ]" + lappend ALWAYS_ALGOL68FLAGS "ldflags=[algol68_link_flags [get_multilibs ${TOOL_OPTIONS}] ]" + } else { + lappend ALWAYS_ALGOL68FLAGS "additional_flags=[algol68_include_flags [get_multilibs] ]" + lappend ALWAYS_ALGOL68FLAGS "ldflags=[algol68_link_flags [get_multilibs] ]" + } + } + + if [info exists TOOL_OPTIONS] { + lappend ALWAYS_ALGOL68FLAGS "additional_flags=$TOOL_OPTIONS" + } + + verbose -log "ALWAYS_ALGOL68FLAGS set to $ALWAYS_ALGOL68FLAGS" + + lappend options "timeout=[timeout_value]" + lappend options "compiler=$ALGOL68_UNDER_TEST" + + set options [concat "$ALWAYS_ALGOL68FLAGS" $options] + set options [dg-additional-files-options $options $source $dest $type] + set ret [target_compile $source $dest $type $options] + unset individual_timeout + return $ret +} diff --git a/gcc/testsuite/lib/g++-dg.exp b/gcc/testsuite/lib/g++-dg.exp index 042a917..abecd88 100644 --- a/gcc/testsuite/lib/g++-dg.exp +++ b/gcc/testsuite/lib/g++-dg.exp @@ -78,7 +78,7 @@ proc g++-std-flags { test } { # The order of this list is significant: first $cxx_default, # then the oldest and newest, then others in rough order of # importance based on test coverage and usage. - foreach ver { 17 98 26 11 20 14 23 } { + foreach ver { 20 98 26 17 11 14 23 } { set cmpver $ver if { $ver == 98 } { set cmpver 03 } if { [llength $std_list] < 3 diff --git a/gcc/testsuite/lib/gcc-defs.exp b/gcc/testsuite/lib/gcc-defs.exp index d66c833..61bf5f8 100644 --- a/gcc/testsuite/lib/gcc-defs.exp +++ b/gcc/testsuite/lib/gcc-defs.exp @@ -553,7 +553,7 @@ proc handle-dg-regexps { text } { # Escape newlines in $rexp so that we can print them in # pass/fail results. - set escaped_regex [string map {"\n" "\\n"} $rexp] + set escaped_regex [string map {"\n" "\\n" "\r" "\\r"} $rexp] verbose "escaped_regex: ${escaped_regex}" 4 set title "$testname_with_flags dg-regexp $linenum" diff --git a/gcc/testsuite/lib/lto.exp b/gcc/testsuite/lib/lto.exp index 9231e85..a35a3fc 100644 --- a/gcc/testsuite/lib/lto.exp +++ b/gcc/testsuite/lib/lto.exp @@ -309,6 +309,43 @@ proc lto-obj { source dest optall optfile optstr xfaildata } { ${tool}_check_compile "$testcase $dest assemble" $optstr $dest $comp_output } +proc lto-build-archive { testname objlist dest } { + global testcase + global tool + global GCC_UNDER_TEST + + upvar dg-messages-by-file dg-messages-by-file + + verbose "lto-build-archive" 2 + file_on_host delete $dest + + # Check that all of the objects were built successfully. + foreach obj [split $objlist] { + if ![file_on_host exists $obj] then { + unresolved "$testcase $testname build-archive" + return + } + } + + # Hack up the gcc-ar command from $GCC_UNDER_TEST. + set ar_cmd [file dirname [lindex $GCC_UNDER_TEST 0]] + set ar_cmd "$ar_cmd/gcc-ar [lrange $GCC_UNDER_TEST 1 end]" + set ar_output [remote_exec host "$ar_cmd rcs $dest $objlist"] + set retval [lindex $ar_output 0] + set retmsg [lindex $ar_output 1] + + # If any message remains, we fail. Don't bother overriding tool since + # we're not really looking to match any specific error or warning patterns + # here. + if ![string match "0" $retval] then { + ${tool}_fail $testcase "ar returned $retval: $retmsg" + return 0 + } else { + ${tool}_pass $testcase "archive" + return 0 + } +} + # lto-link-and-maybe-run -- link the object files and run the executable # if compile_type is set to "run" # @@ -379,7 +416,8 @@ proc lto-link-and-maybe-run { testname objlist dest optall optfile optstr } { } # Return if we only needed to link. - if { ![string compare "link" $compile_type] } { + if { ![string compare "link" $compile_type] \ + || ![string compare "ar-link" $compile_type] } { return } @@ -510,6 +548,8 @@ proc lto-get-options-main { src } { set compile_type "run" } elseif { ![string compare "link" $dgdo] } { set compile_type "link" + } elseif { ![string compare "ar-link" $dgdo] } { + set compile_type "ar-link" } else { warning "lto.exp does not support dg-lto-do $dgdo" } @@ -691,6 +731,12 @@ proc lto-execute-1 { src1 sid } { # Get the base name of this test, for use in messages. set testcase [lindex ${src_list} 0] + # The test needs to build all but the main file into an archive and then + # link them all together. + if { ![string compare "ar-link" $compile_type] } { + set arname "${sid}_${base}.a" + } + # Remove the $srcdir and $tmpdir prefixes from $src1. (It would # be possible to use "regsub" here, if we were careful to escape # all regular expression characters in $srcdir and $tmpdir, but @@ -755,8 +801,24 @@ proc lto-execute-1 { src1 sid } { incr i } + # Bundle all but the main file into an archive. Update objlist to only + # have the archive and the last file. + if { ![string compare "ar-link" $compile_type] } { + set mainsrc [lindex $obj_list 0] + set obj_list [lrange $obj_list 1 end] + lto-build-archive \ + "[lindex $obj_list 1]-[lindex $obj_list end]" \ + $obj_list $arname + + set obj_list "" + lappend obj_list $mainsrc + lappend obj_list $arname + set num_srcs 2 + } + # Link (using the compiler under test), run, and clean up tests. if { ![string compare "run" $compile_type] \ + || ![string compare "ar-link" $compile_type] \ || ![string compare "link" $compile_type] } { # Filter out any link options we were asked to suppress. @@ -772,6 +834,10 @@ proc lto-execute-1 { src1 sid } { "[lindex $obj_list 0]-[lindex $obj_list end]" \ $obj_list $execname $filtered ${dg-extra-ld-options} \ $filtered + + if (![string compare "ar-link" $compile_type]) { + file_on_host delete $arname + } } @@ -818,6 +884,7 @@ proc lto-execute-1 { src1 sid } { unset testname_with_flags if { ![string compare "run" $compile_type] \ + || ![string compare "ar-link" $compile_type] \ || ![string compare "link" $compile_type] } { file_on_host delete $execname } diff --git a/gcc/testsuite/lib/scanasm.exp b/gcc/testsuite/lib/scanasm.exp index 51952a6..7530391 100644 --- a/gcc/testsuite/lib/scanasm.exp +++ b/gcc/testsuite/lib/scanasm.exp @@ -885,6 +885,8 @@ proc configure_check-function-bodies { config } { set up_config(end) {^\}$} } elseif { [istarget *-*-darwin*] } { set up_config(end) {^LFE[0-9]+} + } elseif { [istarget aarch64*-*-mingw32] } { + set up_config(end) {seh_endproc} } else { set up_config(end) {^\s*\.size} } diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index f90cd26..6251f4e 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -981,6 +981,18 @@ proc add_options_for_tls { flags } { return $flags } +# Add to FLAGS all the target-specific flags needed to use check-function-bodies. + +proc add_options_for_check_function_bodies { flags } { + if { [istarget i?86-*-solaris2*] || [istarget x86_64-*-solaris2*] } { + # check-function-bodies relies on the .cfi_* directives, which are + # off on Solaris/x86 with as and ld. Similarly it also expects + # the .LFB/.LFE labels, which aren't emitted for 32-bit. + return "-fdwarf2-cfi-asm -fasynchronous-unwind-tables $flags " + } + return $flags +} + # Return 1 if indirect jumps are supported, 0 otherwise. proc check_effective_target_indirect_jumps {} { @@ -5169,18 +5181,39 @@ proc check_effective_target_arm_vfp3_ok { } { # Return 1 if this is an ARM target supporting -mfpu=fp-armv8 # -mfloat-abi=softfp. -proc check_effective_target_arm_v8_vfp_ok {} { - if { [check_effective_target_arm32] } { - return [check_no_compiler_messages arm_v8_vfp_ok object { - int foo (void) - { - __asm__ volatile ("vrinta.f32.f32 s0, s0"); - return 0; - } - } "-mfpu=fp-armv8 -mfloat-abi=softfp"] - } else { - return 0 +proc check_effective_target_arm_v8_vfp_ok_nocache {} { + global et_arm_v8_vfp_flags + set et_arm_v8_vfp_flags "" + foreach flags { + "" + "-mfloat-abi=softfp" + "-mcpu=unset -march=armv8-a+simd -mfpu=auto" + "-mcpu=unset -march=armv8-a+simd -mfpu=auto -mfloat-abi=softfp" + } { + if { [check_no_compiler_messages_nocache arm_v8_vfp_ok object { + #if __ARM_ARCH < 8 + #error not armv8 or later + #endif + #if __ARM_ARCH_PROFILE == 'M' + #error incompatible profile + #endif + int foo (void) + { + __asm__ volatile ("vrinta.f32.f32 s0, s0"); + return 0; + } + } "$flags"] } { + set et_arm_v8_vfp_flags "$flags" + return 1 + } } + + return 0 +} + +proc check_effective_target_arm_v8_vfp_ok { } { + return [check_cached_effective_target arm_v8_vfp_ok \ + check_effective_target_arm_v8_vfp_ok_nocache] } # Return 1 if this is an ARM target supporting -mfpu=vfp @@ -5455,7 +5488,8 @@ proc add_options_for_arm_v8_vfp { flags } { if { ! [check_effective_target_arm_v8_vfp_ok] } { return "$flags" } - return "$flags -mfpu=fp-armv8 -mfloat-abi=softfp" + global et_arm_v8_vfp_flags + return "$flags $et_arm_v8_vfp_flags" } proc add_options_for_arm_v8_neon { flags } { @@ -6941,6 +6975,60 @@ proc add_options_for_arm_v8_1m_mve { flags } { return "$flags $et_arm_v8_1m_mve_flags" } +# Return 1 if the target supports ARMv8.1-M MVE without floating point +# instructions, 0 otherwise. The test is valid for ARM. +# Record the command line options needed. + +proc check_effective_target_arm_v8_1m_mve_nofp_ok_nocache { } { + global et_arm_v8_1m_mve_nofp_flags + set et_arm_v8_1m_mve_nofp_flags "" + + if { ![istarget arm*-*-*] } { + return 0; + } + + # Iterate through sets of options to find the compiler flags that + # need to be added to the -march option. + foreach flags { + "" + "-mfloat-abi=softfp" + "-mfpu=auto -mcpu=unset -march=armv8.1-m.main+mve" + "-mfpu=auto -mcpu=unset -march=armv8.1-m.main+mve -mfloat-abi=softfp" + } { + if { [check_no_compiler_messages_nocache \ + arm_v8_1m_mve_ok object { + #if !defined (__ARM_FEATURE_MVE) + #error "__ARM_FEATURE_MVE not defined" + #endif + #if (__ARM_FEATURE_MVE & 2) + #error "__ARM_FEATURE_MVE for floating point defined" + #endif + #if __ARM_BIG_ENDIAN + #error "MVE intrinsics are not supported in Big-Endian mode." + #endif + #include <arm_mve.h> + } "$flags -mthumb"] } { + set et_arm_v8_1m_mve_nofp_flags "$flags -mthumb --save-temps" + return 1 + } + } + + return 0; +} + +proc check_effective_target_arm_v8_1m_mve_nofp_ok { } { + return [check_cached_effective_target arm_v8_1m_mve_nofp_ok \ + check_effective_target_arm_v8_1m_mve_nofp_ok_nocache] +} + +proc add_options_for_arm_v8_1m_mve_nofp { flags } { + if { ! [check_effective_target_arm_v8_1m_mve_nofp_ok] } { + return "$flags" + } + global et_arm_v8_1m_mve_nofp_flags + return "$flags $et_arm_v8_1m_mve_nofp_flags" +} + proc check_effective_target_arm_v8_2a_dotprod_neon_ok { } { return [check_cached_effective_target arm_v8_2a_dotprod_neon_ok \ check_effective_target_arm_v8_2a_dotprod_neon_ok_nocache] @@ -12070,7 +12158,7 @@ proc check_effective_target_c++ { } { return 0 } -set cxx_default "c++17" +set cxx_default "c++20" # Check whether the current active language standard supports the features # of C++11/C++14 by checking for the presence of one of the -std flags. # This assumes that the default for the compiler is $cxx_default, and that @@ -14674,3 +14762,11 @@ proc check_effective_target_fentry { } { } }] } + +# Check if valgrind executable exists in PATH on host +proc check_effective_target_valgrind { } { + if { [which valgrind] != 0 } { + return 1 + } + return 0 +} diff --git a/gcc/testsuite/obj-c++.dg/exceptions-3.mm b/gcc/testsuite/obj-c++.dg/exceptions-3.mm index 7cf77a7..fb6982c 100644 --- a/gcc/testsuite/obj-c++.dg/exceptions-3.mm +++ b/gcc/testsuite/obj-c++.dg/exceptions-3.mm @@ -1,5 +1,5 @@ /* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010. */ -/* { dg-options "-fobjc-exceptions" } */ +/* { dg-options "-fobjc-exceptions -std=gnu++17" } */ /* { dg-do compile } */ // { dg-additional-options "-Wno-objc-root-class" } diff --git a/gcc/testsuite/obj-c++.dg/exceptions-5.mm b/gcc/testsuite/obj-c++.dg/exceptions-5.mm index 4547a75..2423e30 100644 --- a/gcc/testsuite/obj-c++.dg/exceptions-5.mm +++ b/gcc/testsuite/obj-c++.dg/exceptions-5.mm @@ -1,5 +1,5 @@ /* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010. */ -/* { dg-options "-fobjc-exceptions" } */ +/* { dg-options "-fobjc-exceptions -std=gnu++17" } */ /* { dg-do compile } */ // { dg-additional-options "-Wno-objc-root-class" } diff --git a/gcc/testsuite/rust/borrowck/reference.rs b/gcc/testsuite/rust/borrowck/reference.rs index c4b9f7d..1bef938 100644 --- a/gcc/testsuite/rust/borrowck/reference.rs +++ b/gcc/testsuite/rust/borrowck/reference.rs @@ -1,6 +1,7 @@ // { dg-additional-options "-frust-compile-until=compilation -frust-borrowcheck -fdiagnostics-show-caret -fdiagnostics-show-line-numbers" } // { dg-enable-nn-line-numbers "" } +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/borrowck/tmp.rs b/gcc/testsuite/rust/borrowck/tmp.rs index 545a278..210153f 100644 --- a/gcc/testsuite/rust/borrowck/tmp.rs +++ b/gcc/testsuite/rust/borrowck/tmp.rs @@ -1,6 +1,7 @@ // { dg-additional-options "-frust-compile-until=compilation -frust-borrowcheck -fdiagnostics-show-caret -fdiagnostics-show-line-numbers" } // { dg-enable-nn-line-numbers "" } +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/additional-trait-bounds1.rs b/gcc/testsuite/rust/compile/additional-trait-bounds1.rs index 449a72f..c629aba 100644 --- a/gcc/testsuite/rust/compile/additional-trait-bounds1.rs +++ b/gcc/testsuite/rust/compile/additional-trait-bounds1.rs @@ -1,4 +1,4 @@ -#![feature(optin_builtin_traits)] +#![feature(optin_builtin_traits, lang_items)] pub unsafe auto trait Send {} #[lang = "sync"] diff --git a/gcc/testsuite/rust/compile/additional-trait-bounds2.rs b/gcc/testsuite/rust/compile/additional-trait-bounds2.rs index 1c49b75..7140b3b 100644 --- a/gcc/testsuite/rust/compile/additional-trait-bounds2.rs +++ b/gcc/testsuite/rust/compile/additional-trait-bounds2.rs @@ -1,4 +1,4 @@ -#![feature(optin_builtin_traits)] +#![feature(optin_builtin_traits, lang_items)] pub unsafe auto trait Send {} #[lang = "sync"] diff --git a/gcc/testsuite/rust/compile/additional-trait-bounds2nr2.rs b/gcc/testsuite/rust/compile/additional-trait-bounds2nr2.rs index 1c49b75..7140b3b 100644 --- a/gcc/testsuite/rust/compile/additional-trait-bounds2nr2.rs +++ b/gcc/testsuite/rust/compile/additional-trait-bounds2nr2.rs @@ -1,4 +1,4 @@ -#![feature(optin_builtin_traits)] +#![feature(optin_builtin_traits, lang_items)] pub unsafe auto trait Send {} #[lang = "sync"] diff --git a/gcc/testsuite/rust/compile/auto_traits1.rs b/gcc/testsuite/rust/compile/auto_traits1.rs index 192052d..e9f5e0a 100644 --- a/gcc/testsuite/rust/compile/auto_traits1.rs +++ b/gcc/testsuite/rust/compile/auto_traits1.rs @@ -1,6 +1,6 @@ // { dg-additional-options "-frust-compile-until=typecheck" } -#![feature(optin_builtin_traits)] +#![feature(optin_builtin_traits, lang_items)] pub unsafe auto trait Send {} #[lang = "sync"] diff --git a/gcc/testsuite/rust/compile/auto_traits2.rs b/gcc/testsuite/rust/compile/auto_traits2.rs index 7004761..eda22b5 100644 --- a/gcc/testsuite/rust/compile/auto_traits2.rs +++ b/gcc/testsuite/rust/compile/auto_traits2.rs @@ -1,4 +1,4 @@ -#![feature(optin_builtin_traits)] +#![feature(optin_builtin_traits, lang_items)] pub unsafe auto trait Send {} #[lang = "sync"] diff --git a/gcc/testsuite/rust/compile/bad-rpit1.rs b/gcc/testsuite/rust/compile/bad-rpit1.rs index d8c21b1..c728e36 100644 --- a/gcc/testsuite/rust/compile/bad-rpit1.rs +++ b/gcc/testsuite/rust/compile/bad-rpit1.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/compile/black_box.rs b/gcc/testsuite/rust/compile/black_box.rs index 80615af..35d9e9e 100644 --- a/gcc/testsuite/rust/compile/black_box.rs +++ b/gcc/testsuite/rust/compile/black_box.rs @@ -1,5 +1,5 @@ // { dg-options "-fdump-tree-gimple" } -#![feature(rustc_attrs)] +#![feature(rustc_attrs, lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/bounds1.rs b/gcc/testsuite/rust/compile/bounds1.rs index a02e6f6..5891f71 100644 --- a/gcc/testsuite/rust/compile/bounds1.rs +++ b/gcc/testsuite/rust/compile/bounds1.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/box_syntax_feature_gate.rs b/gcc/testsuite/rust/compile/box_syntax_feature_gate.rs index 5f62a59..62e7c10 100644 --- a/gcc/testsuite/rust/compile/box_syntax_feature_gate.rs +++ b/gcc/testsuite/rust/compile/box_syntax_feature_gate.rs @@ -1,4 +1,5 @@ // { dg-options "-frust-compile-until=lowering" } +#![feature(lang_items)] #[lang = "owned_box"] pub struct Box<T>; diff --git a/gcc/testsuite/rust/compile/braced_macro_arm.rs b/gcc/testsuite/rust/compile/braced_macro_arm.rs index 1446878..8782cf9 100644 --- a/gcc/testsuite/rust/compile/braced_macro_arm.rs +++ b/gcc/testsuite/rust/compile/braced_macro_arm.rs @@ -7,12 +7,9 @@ macro_rules! m { fn h(c: bool) { match c { - // { dg-error "failed to parse statement or expression in block expression" "" { target *-*-* } .-1 } true => m! {} false => () // { dg-error "exprwithoutblock requires comma after match case expression in match arm \\(if not final case\\)" "" { target *-*-* } .-1 } - // { dg-error "unrecognised token .false. for start of item" "" { target *-*-* } .-2 } - // { dg-error "failed to parse item in crate" "" { target *-*-* } .-3 } }; } diff --git a/gcc/testsuite/rust/compile/bug-with-default-generic.rs b/gcc/testsuite/rust/compile/bug-with-default-generic.rs index 25f46a0..3f31fcc 100644 --- a/gcc/testsuite/rust/compile/bug-with-default-generic.rs +++ b/gcc/testsuite/rust/compile/bug-with-default-generic.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/canonical_paths1.rs b/gcc/testsuite/rust/compile/canonical_paths1.rs index bd6f3b2..f80d6e6 100644 --- a/gcc/testsuite/rust/compile/canonical_paths1.rs +++ b/gcc/testsuite/rust/compile/canonical_paths1.rs @@ -1,4 +1,5 @@ // { dg-additional-options "-w -fdump-tree-gimple -frust-crate=example" } +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/cast_generics.rs b/gcc/testsuite/rust/compile/cast_generics.rs index 469fa94..6da9193 100644 --- a/gcc/testsuite/rust/compile/cast_generics.rs +++ b/gcc/testsuite/rust/compile/cast_generics.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/closure_no_type_anno.rs b/gcc/testsuite/rust/compile/closure_no_type_anno.rs index b647da7..2aab16f 100644 --- a/gcc/testsuite/rust/compile/closure_no_type_anno.rs +++ b/gcc/testsuite/rust/compile/closure_no_type_anno.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/cmp1.rs b/gcc/testsuite/rust/compile/cmp1.rs index 4da5b1c..db1589e 100644 --- a/gcc/testsuite/rust/compile/cmp1.rs +++ b/gcc/testsuite/rust/compile/cmp1.rs @@ -1,6 +1,7 @@ // { dg-options "-w" } // taken from https://github.com/rust-lang/rust/blob/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/core/src/cmp.rs#L98 +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/complex_qualified_path_in_expr.rs b/gcc/testsuite/rust/compile/complex_qualified_path_in_expr.rs index 5036410..85bdaf0 100644 --- a/gcc/testsuite/rust/compile/complex_qualified_path_in_expr.rs +++ b/gcc/testsuite/rust/compile/complex_qualified_path_in_expr.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/const-issue1440.rs b/gcc/testsuite/rust/compile/const-issue1440.rs index 3a2989c..43748cf2 100644 --- a/gcc/testsuite/rust/compile/const-issue1440.rs +++ b/gcc/testsuite/rust/compile/const-issue1440.rs @@ -1,6 +1,7 @@ // { dg-additional-options "-w" } #![feature(intrinsics)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/const_generics_1.rs b/gcc/testsuite/rust/compile/const_generics_1.rs index 5d4ca64..b22e07e 100644 --- a/gcc/testsuite/rust/compile/const_generics_1.rs +++ b/gcc/testsuite/rust/compile/const_generics_1.rs @@ -3,6 +3,7 @@ // There are errors about unused generic parameters, but we can't handle that yet. // Still, this code is invalid Rust. +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/const_generics_10.rs b/gcc/testsuite/rust/compile/const_generics_10.rs index 7e3bc86..1300126 100644 --- a/gcc/testsuite/rust/compile/const_generics_10.rs +++ b/gcc/testsuite/rust/compile/const_generics_10.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/compile/const_generics_11.rs b/gcc/testsuite/rust/compile/const_generics_11.rs index de902ee..381d9f4 100644 --- a/gcc/testsuite/rust/compile/const_generics_11.rs +++ b/gcc/testsuite/rust/compile/const_generics_11.rs @@ -1,5 +1,5 @@ // { dg-options "-w" } - +#![feature(lang_items)] #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/compile/const_generics_12.rs b/gcc/testsuite/rust/compile/const_generics_12.rs index a17c525..88b151f 100644 --- a/gcc/testsuite/rust/compile/const_generics_12.rs +++ b/gcc/testsuite/rust/compile/const_generics_12.rs @@ -1,5 +1,5 @@ // { dg-options "-w" } - +#![feature(lang_items)] #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/compile/const_generics_13.rs b/gcc/testsuite/rust/compile/const_generics_13.rs index 20dd0b9..bf8e78e 100644 --- a/gcc/testsuite/rust/compile/const_generics_13.rs +++ b/gcc/testsuite/rust/compile/const_generics_13.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/compile/const_generics_14.rs b/gcc/testsuite/rust/compile/const_generics_14.rs index 4d52efb..e0d206f 100644 --- a/gcc/testsuite/rust/compile/const_generics_14.rs +++ b/gcc/testsuite/rust/compile/const_generics_14.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/compile/const_generics_15.rs b/gcc/testsuite/rust/compile/const_generics_15.rs index a160abf..158548c 100644 --- a/gcc/testsuite/rust/compile/const_generics_15.rs +++ b/gcc/testsuite/rust/compile/const_generics_15.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/compile/const_generics_16.rs b/gcc/testsuite/rust/compile/const_generics_16.rs index 060dbda..467be6a 100644 --- a/gcc/testsuite/rust/compile/const_generics_16.rs +++ b/gcc/testsuite/rust/compile/const_generics_16.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/compile/const_generics_17.rs b/gcc/testsuite/rust/compile/const_generics_17.rs new file mode 100644 index 0000000..f65ca22 --- /dev/null +++ b/gcc/testsuite/rust/compile/const_generics_17.rs @@ -0,0 +1,3 @@ +struct Foo<const N: u32 = 1, const O: bool>; // { dg-error "invalid order for generic parameters: generic parameters with a default must be trailing" } + +impl<const N: u32> Foo<N> {} diff --git a/gcc/testsuite/rust/compile/const_generics_18.rs b/gcc/testsuite/rust/compile/const_generics_18.rs new file mode 100644 index 0000000..09bb860 --- /dev/null +++ b/gcc/testsuite/rust/compile/const_generics_18.rs @@ -0,0 +1,11 @@ +#![feature(lang_items)] +#[lang = "sized"] +trait Sized {} + +struct Foo<const N: usize>; +type Alias = Foo<4>; + +fn main() -> i32 { + let _x: Alias = Foo::<4> {}; + 0 +} diff --git a/gcc/testsuite/rust/compile/const_generics_19.rs b/gcc/testsuite/rust/compile/const_generics_19.rs new file mode 100644 index 0000000..73c1419 --- /dev/null +++ b/gcc/testsuite/rust/compile/const_generics_19.rs @@ -0,0 +1,11 @@ +#![feature(lang_items)] +#[lang = "sized"] +trait Sized {} + +struct Foo<const N: usize>; +struct Wrapper<T>(T); + +fn main() -> i32 { + let _: Wrapper<Foo<3>> = Wrapper(Foo::<3> {}); + 0 +} diff --git a/gcc/testsuite/rust/compile/const_generics_3.rs b/gcc/testsuite/rust/compile/const_generics_3.rs index 3415f17..528cf69 100644 --- a/gcc/testsuite/rust/compile/const_generics_3.rs +++ b/gcc/testsuite/rust/compile/const_generics_3.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/compile/const_generics_8.rs b/gcc/testsuite/rust/compile/const_generics_8.rs index ce5e1b5..32b7a19 100644 --- a/gcc/testsuite/rust/compile/const_generics_8.rs +++ b/gcc/testsuite/rust/compile/const_generics_8.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/const_generics_9.rs b/gcc/testsuite/rust/compile/const_generics_9.rs index 98e2d3f..a3f7485 100644 --- a/gcc/testsuite/rust/compile/const_generics_9.rs +++ b/gcc/testsuite/rust/compile/const_generics_9.rs @@ -1,5 +1,5 @@ // { dg-options "-w" } - +#![feature(lang_items)] #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/compile/decl_macro6.rs b/gcc/testsuite/rust/compile/decl_macro6.rs index 5c5e700..b290b4c 100644 --- a/gcc/testsuite/rust/compile/decl_macro6.rs +++ b/gcc/testsuite/rust/compile/decl_macro6.rs @@ -2,4 +2,3 @@ macro m {} // { dg-error "unexpected token .\}. - expecting delimiters .for a macro matcher." "" { target *-*-* } .-1 } // { dg-error "required first macro rule in declarative macro definition could not be parsed" "" { target *-*-* } .-2 } -// { dg-error "failed to parse item in crate" "" { target *-*-* } .-3 } diff --git a/gcc/testsuite/rust/compile/decl_macro7.rs b/gcc/testsuite/rust/compile/decl_macro7.rs index 7327fb5..8007544 100644 --- a/gcc/testsuite/rust/compile/decl_macro7.rs +++ b/gcc/testsuite/rust/compile/decl_macro7.rs @@ -1,4 +1,3 @@ #![feature(decl_macro)] pub macro hello() [ "Hello" ] // { dg-error "only braces can be used for a macro transcriber in declarative macro definition" "" { target *-*-* } .-1 } -// { dg-error "failed to parse item in crate" }
\ No newline at end of file diff --git a/gcc/testsuite/rust/compile/derive-debug1.rs b/gcc/testsuite/rust/compile/derive-debug1.rs index 5927374..f69be0d 100644 --- a/gcc/testsuite/rust/compile/derive-debug1.rs +++ b/gcc/testsuite/rust/compile/derive-debug1.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/compile/derive-default1.rs b/gcc/testsuite/rust/compile/derive-default1.rs index 902c65e..ad31d5a 100644 --- a/gcc/testsuite/rust/compile/derive-default1.rs +++ b/gcc/testsuite/rust/compile/derive-default1.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + #[derive(Default)] struct Foo { _a: i32, _b: i64, _c: u8 } diff --git a/gcc/testsuite/rust/compile/derive-eq-invalid.rs b/gcc/testsuite/rust/compile/derive-eq-invalid.rs index b0bf856..47fac78 100644 --- a/gcc/testsuite/rust/compile/derive-eq-invalid.rs +++ b/gcc/testsuite/rust/compile/derive-eq-invalid.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + mod core { mod cmp { #[lang = "eq"] diff --git a/gcc/testsuite/rust/compile/derive-hash1.rs b/gcc/testsuite/rust/compile/derive-hash1.rs index 80e1e2d..cdcc9b1 100644 --- a/gcc/testsuite/rust/compile/derive-hash1.rs +++ b/gcc/testsuite/rust/compile/derive-hash1.rs @@ -1,4 +1,4 @@ -#![feature(intrinsics)] +#![feature(intrinsics, lang_items)] #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/compile/derive-partialeq1.rs b/gcc/testsuite/rust/compile/derive-partialeq1.rs index 35e33fb..fbeb054 100644 --- a/gcc/testsuite/rust/compile/derive-partialeq1.rs +++ b/gcc/testsuite/rust/compile/derive-partialeq1.rs @@ -1,4 +1,4 @@ -#![feature(intrinsics)] +#![feature(intrinsics, lang_items)] #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/compile/derive_clone_enum1.rs b/gcc/testsuite/rust/compile/derive_clone_enum1.rs index 947dc5c6..7dc0a80 100644 --- a/gcc/testsuite/rust/compile/derive_clone_enum1.rs +++ b/gcc/testsuite/rust/compile/derive_clone_enum1.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + #[lang = "clone"] trait Clone { pub fn clone(&self) -> Self; diff --git a/gcc/testsuite/rust/compile/derive_clone_enum2.rs b/gcc/testsuite/rust/compile/derive_clone_enum2.rs index c7a4ad5..6f5b29a 100644 --- a/gcc/testsuite/rust/compile/derive_clone_enum2.rs +++ b/gcc/testsuite/rust/compile/derive_clone_enum2.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + #[lang = "clone"] trait Clone { pub fn clone(&self) -> Self; diff --git a/gcc/testsuite/rust/compile/derive_clone_enum3.rs b/gcc/testsuite/rust/compile/derive_clone_enum3.rs index 92fd6ee..7c76ab2 100644 --- a/gcc/testsuite/rust/compile/derive_clone_enum3.rs +++ b/gcc/testsuite/rust/compile/derive_clone_enum3.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + #[lang = "clone"] trait Clone { pub fn clone(&self) -> Self; diff --git a/gcc/testsuite/rust/compile/derive_macro1.rs b/gcc/testsuite/rust/compile/derive_macro1.rs index 8c42aba..df7c8e3 100644 --- a/gcc/testsuite/rust/compile/derive_macro1.rs +++ b/gcc/testsuite/rust/compile/derive_macro1.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/derive_macro3.rs b/gcc/testsuite/rust/compile/derive_macro3.rs index ad40cae..37b1d50 100644 --- a/gcc/testsuite/rust/compile/derive_macro3.rs +++ b/gcc/testsuite/rust/compile/derive_macro3.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/derive_macro4.rs b/gcc/testsuite/rust/compile/derive_macro4.rs index 8bf1bca..7429019 100644 --- a/gcc/testsuite/rust/compile/derive_macro4.rs +++ b/gcc/testsuite/rust/compile/derive_macro4.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/derive_macro6.rs b/gcc/testsuite/rust/compile/derive_macro6.rs index 412144d..d575ff1 100644 --- a/gcc/testsuite/rust/compile/derive_macro6.rs +++ b/gcc/testsuite/rust/compile/derive_macro6.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/derive_partial_ord1.rs b/gcc/testsuite/rust/compile/derive_partial_ord1.rs index eeca62d..4d26de5 100644 --- a/gcc/testsuite/rust/compile/derive_partial_ord1.rs +++ b/gcc/testsuite/rust/compile/derive_partial_ord1.rs @@ -1,6 +1,6 @@ // { dg-additional-options "-w" } -#![feature(intrinsics)] +#![feature(intrinsics, lang_items)] mod core { mod option { diff --git a/gcc/testsuite/rust/compile/e0579-neg-float-fail.rs b/gcc/testsuite/rust/compile/e0579-neg-float-fail.rs new file mode 100644 index 0000000..fefe221 --- /dev/null +++ b/gcc/testsuite/rust/compile/e0579-neg-float-fail.rs @@ -0,0 +1,9 @@ +#![feature(exclusive_range_pattern)] + +fn main() { + let x = 1.0; + + match x { // { dg-message "sorry, unimplemented: match on floating-point types is not yet supported" } + -1.0f32..-1.2f32 => 2, // { dg-error "lower range bound must be less than upper .E0579." } + }; +}
\ No newline at end of file diff --git a/gcc/testsuite/rust/compile/e0579-neg-float.rs b/gcc/testsuite/rust/compile/e0579-neg-float.rs new file mode 100644 index 0000000..cc60e80 --- /dev/null +++ b/gcc/testsuite/rust/compile/e0579-neg-float.rs @@ -0,0 +1,9 @@ +#![feature(exclusive_range_pattern)] + +fn main() { + let x = 1.0; + + match x { // { dg-message "sorry, unimplemented: match on floating-point types is not yet supported" } + -1.2f32..-1.0f32 => 2, + }; +}
\ No newline at end of file diff --git a/gcc/testsuite/rust/compile/expand_macro_qual_path_in_type.rs b/gcc/testsuite/rust/compile/expand_macro_qual_path_in_type.rs index 2d60197..16d120f 100644 --- a/gcc/testsuite/rust/compile/expand_macro_qual_path_in_type.rs +++ b/gcc/testsuite/rust/compile/expand_macro_qual_path_in_type.rs @@ -1,5 +1,6 @@ // this SEGVs in lowering for now // { dg-additional-options "-frust-compile-until=nameresolution" } +#![feature(lang_items)] macro_rules! forward_ref_binop { (impl $imp:ident, $method:ident for $t:ty, $u:ty) => { diff --git a/gcc/testsuite/rust/compile/expected_type_args2.rs b/gcc/testsuite/rust/compile/expected_type_args2.rs index 11a70be..22702e3 100644 --- a/gcc/testsuite/rust/compile/expected_type_args2.rs +++ b/gcc/testsuite/rust/compile/expected_type_args2.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/expected_type_args3.rs b/gcc/testsuite/rust/compile/expected_type_args3.rs index 7003f7a..0916ec9 100644 --- a/gcc/testsuite/rust/compile/expected_type_args3.rs +++ b/gcc/testsuite/rust/compile/expected_type_args3.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/extern_generics.rs b/gcc/testsuite/rust/compile/extern_generics.rs index 26f97a6..0312626 100644 --- a/gcc/testsuite/rust/compile/extern_generics.rs +++ b/gcc/testsuite/rust/compile/extern_generics.rs @@ -1,4 +1,5 @@ -#[lang="sized"] +#![feature(lang_items)] +#[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/compile/extern_type_item_missing_semi.rs b/gcc/testsuite/rust/compile/extern_type_item_missing_semi.rs index a42af02..cd4d4e2 100644 --- a/gcc/testsuite/rust/compile/extern_type_item_missing_semi.rs +++ b/gcc/testsuite/rust/compile/extern_type_item_missing_semi.rs @@ -4,4 +4,3 @@ extern "C" { type F; type E // { dg-error "failed to parse" } } // { dg-error "expecting" } -// { dg-error "failed to parse item in crate" "" { target *-*-* } .-1 } diff --git a/gcc/testsuite/rust/compile/for-loop1.rs b/gcc/testsuite/rust/compile/for-loop1.rs index 21e0399..d42cf67 100644 --- a/gcc/testsuite/rust/compile/for-loop1.rs +++ b/gcc/testsuite/rust/compile/for-loop1.rs @@ -1,5 +1,5 @@ // { dg-output "loop\r*\nloop\r*\n" } -#![feature(intrinsics)] +#![feature(intrinsics, lang_items)] pub use option::Option::{self, None, Some}; pub use result::Result::{self, Err, Ok}; diff --git a/gcc/testsuite/rust/compile/for-loop2.rs b/gcc/testsuite/rust/compile/for-loop2.rs index a0ad066..680fd86 100644 --- a/gcc/testsuite/rust/compile/for-loop2.rs +++ b/gcc/testsuite/rust/compile/for-loop2.rs @@ -1,5 +1,5 @@ // { dg-output "1\r*\n2\r*\n" } -#![feature(intrinsics)] +#![feature(intrinsics, lang_items)] pub use option::Option::{self, None, Some}; pub use result::Result::{self, Err, Ok}; diff --git a/gcc/testsuite/rust/compile/format_args_basic_expansion.rs b/gcc/testsuite/rust/compile/format_args_basic_expansion.rs index cedb62c..59101ac 100644 --- a/gcc/testsuite/rust/compile/format_args_basic_expansion.rs +++ b/gcc/testsuite/rust/compile/format_args_basic_expansion.rs @@ -1,4 +1,4 @@ -#![feature(rustc_attrs)] +#![feature(rustc_attrs, lang_items)] #[rustc_builtin_macro] macro_rules! format_args { diff --git a/gcc/testsuite/rust/compile/format_args_concat.rs b/gcc/testsuite/rust/compile/format_args_concat.rs index b180667..695cde65 100644 --- a/gcc/testsuite/rust/compile/format_args_concat.rs +++ b/gcc/testsuite/rust/compile/format_args_concat.rs @@ -1,4 +1,4 @@ -#![feature(rustc_attrs)] +#![feature(rustc_attrs, lang_items)] #[rustc_builtin_macro] macro_rules! format_args { diff --git a/gcc/testsuite/rust/compile/format_args_extra_comma.rs b/gcc/testsuite/rust/compile/format_args_extra_comma.rs index dc48a3a..5b8fee5 100644 --- a/gcc/testsuite/rust/compile/format_args_extra_comma.rs +++ b/gcc/testsuite/rust/compile/format_args_extra_comma.rs @@ -1,4 +1,4 @@ -#![feature(rustc_attrs)] +#![feature(rustc_attrs, lang_items)] #[rustc_builtin_macro] macro_rules! format_args { diff --git a/gcc/testsuite/rust/compile/gat1.rs b/gcc/testsuite/rust/compile/gat1.rs new file mode 100644 index 0000000..032f64e --- /dev/null +++ b/gcc/testsuite/rust/compile/gat1.rs @@ -0,0 +1,4 @@ +trait Foo { + type Bar<T>; + type Baz<'a>; +} diff --git a/gcc/testsuite/rust/compile/generics1.rs b/gcc/testsuite/rust/compile/generics1.rs index 9e440af..cf3c9e4 100644 --- a/gcc/testsuite/rust/compile/generics1.rs +++ b/gcc/testsuite/rust/compile/generics1.rs @@ -1,5 +1,6 @@ // { dg-error "mismatched types, expected .i32. but got .i8." "" { target *-*-* } 0 } +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/generics11.rs b/gcc/testsuite/rust/compile/generics11.rs index 10b5880..7202baf 100644 --- a/gcc/testsuite/rust/compile/generics11.rs +++ b/gcc/testsuite/rust/compile/generics11.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/generics12.rs b/gcc/testsuite/rust/compile/generics12.rs index b32f566..21613fb 100644 --- a/gcc/testsuite/rust/compile/generics12.rs +++ b/gcc/testsuite/rust/compile/generics12.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/generics14.rs b/gcc/testsuite/rust/compile/generics14.rs new file mode 100644 index 0000000..d97fd35 --- /dev/null +++ b/gcc/testsuite/rust/compile/generics14.rs @@ -0,0 +1 @@ +struct Foo<const N: i32, 'a>; // { dg-error "invalid order for generic parameters: lifetime parameters must be declared prior to type and const parameters" } diff --git a/gcc/testsuite/rust/compile/generics2.rs b/gcc/testsuite/rust/compile/generics2.rs index 4c95fd1..0ed8a5f 100644 --- a/gcc/testsuite/rust/compile/generics2.rs +++ b/gcc/testsuite/rust/compile/generics2.rs @@ -1,5 +1,6 @@ // { dg-error "mismatched types, expected .i32. but got .i8." "" { target *-*-* } 0 } +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/generics3.rs b/gcc/testsuite/rust/compile/generics3.rs index 514d713..112a247 100644 --- a/gcc/testsuite/rust/compile/generics3.rs +++ b/gcc/testsuite/rust/compile/generics3.rs @@ -1,4 +1,5 @@ // { dg-error "mismatched types, expected .i32. but got .i8." "" { target *-*-* } 0 } +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/generics4.rs b/gcc/testsuite/rust/compile/generics4.rs index c4dbc43..e8333d6 100644 --- a/gcc/testsuite/rust/compile/generics4.rs +++ b/gcc/testsuite/rust/compile/generics4.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/generics6.rs b/gcc/testsuite/rust/compile/generics6.rs index d77c559..67029cd0 100644 --- a/gcc/testsuite/rust/compile/generics6.rs +++ b/gcc/testsuite/rust/compile/generics6.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/generics7.rs b/gcc/testsuite/rust/compile/generics7.rs index dcedead..e2283a4 100644 --- a/gcc/testsuite/rust/compile/generics7.rs +++ b/gcc/testsuite/rust/compile/generics7.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/generics8.rs b/gcc/testsuite/rust/compile/generics8.rs index 2d30a9e..b38b277 100644 --- a/gcc/testsuite/rust/compile/generics8.rs +++ b/gcc/testsuite/rust/compile/generics8.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/if_let_expr.rs b/gcc/testsuite/rust/compile/if_let_expr.rs index b0879e5..407abd4 100644 --- a/gcc/testsuite/rust/compile/if_let_expr.rs +++ b/gcc/testsuite/rust/compile/if_let_expr.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/impl_fnptr.rs b/gcc/testsuite/rust/compile/impl_fnptr.rs index 20c9d88..e7c1bb1 100644 --- a/gcc/testsuite/rust/compile/impl_fnptr.rs +++ b/gcc/testsuite/rust/compile/impl_fnptr.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/impl_trait_diag.rs b/gcc/testsuite/rust/compile/impl_trait_diag.rs index 54a0cd2..e78d2f5 100644 --- a/gcc/testsuite/rust/compile/impl_trait_diag.rs +++ b/gcc/testsuite/rust/compile/impl_trait_diag.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/impl_trait_generic_arg.rs b/gcc/testsuite/rust/compile/impl_trait_generic_arg.rs index ecdb088..a304bd6 100644 --- a/gcc/testsuite/rust/compile/impl_trait_generic_arg.rs +++ b/gcc/testsuite/rust/compile/impl_trait_generic_arg.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-1005.rs b/gcc/testsuite/rust/compile/issue-1005.rs index 15d4bef..4c51b30 100644 --- a/gcc/testsuite/rust/compile/issue-1005.rs +++ b/gcc/testsuite/rust/compile/issue-1005.rs @@ -1,4 +1,5 @@ // { dg-additional-options "-w" } +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-1019.rs b/gcc/testsuite/rust/compile/issue-1019.rs index 1f77ba9..5bf786c 100644 --- a/gcc/testsuite/rust/compile/issue-1019.rs +++ b/gcc/testsuite/rust/compile/issue-1019.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-1031.rs b/gcc/testsuite/rust/compile/issue-1031.rs index cd1da47..785573a 100644 --- a/gcc/testsuite/rust/compile/issue-1031.rs +++ b/gcc/testsuite/rust/compile/issue-1031.rs @@ -1,5 +1,6 @@ #![feature(intrinsics)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-1034.rs b/gcc/testsuite/rust/compile/issue-1034.rs index d40005e..ef5f7c7 100644 --- a/gcc/testsuite/rust/compile/issue-1034.rs +++ b/gcc/testsuite/rust/compile/issue-1034.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-1128.rs b/gcc/testsuite/rust/compile/issue-1128.rs index 8960ebb..de46919 100644 --- a/gcc/testsuite/rust/compile/issue-1128.rs +++ b/gcc/testsuite/rust/compile/issue-1128.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-1129-2.rs b/gcc/testsuite/rust/compile/issue-1129-2.rs index cfe01b5..4b4f004 100644 --- a/gcc/testsuite/rust/compile/issue-1129-2.rs +++ b/gcc/testsuite/rust/compile/issue-1129-2.rs @@ -1,4 +1,5 @@ // { dg-additional-options "-w" } +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-1130.rs b/gcc/testsuite/rust/compile/issue-1130.rs index 115e6aa..0219ed2 100644 --- a/gcc/testsuite/rust/compile/issue-1130.rs +++ b/gcc/testsuite/rust/compile/issue-1130.rs @@ -1,6 +1,7 @@ // { dg-additional-options "-w" } #![feature(intrinsics)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-1131.rs b/gcc/testsuite/rust/compile/issue-1131.rs index 86eeb98..c014e73 100644 --- a/gcc/testsuite/rust/compile/issue-1131.rs +++ b/gcc/testsuite/rust/compile/issue-1131.rs @@ -1,5 +1,6 @@ #![feature(intrinsics)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-1165.rs b/gcc/testsuite/rust/compile/issue-1165.rs index a637823..ce57ebf 100644 --- a/gcc/testsuite/rust/compile/issue-1165.rs +++ b/gcc/testsuite/rust/compile/issue-1165.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-1173.rs b/gcc/testsuite/rust/compile/issue-1173.rs index a8fd93e..59b0adf 100644 --- a/gcc/testsuite/rust/compile/issue-1173.rs +++ b/gcc/testsuite/rust/compile/issue-1173.rs @@ -2,6 +2,7 @@ #![feature(intrinsics)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-1235.rs b/gcc/testsuite/rust/compile/issue-1235.rs index 7c85ac4..6376e9e 100644 --- a/gcc/testsuite/rust/compile/issue-1235.rs +++ b/gcc/testsuite/rust/compile/issue-1235.rs @@ -1,4 +1,5 @@ // { dg-additional-options "-w" } +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-1237.rs b/gcc/testsuite/rust/compile/issue-1237.rs index 79b60b0..506a6bf 100644 --- a/gcc/testsuite/rust/compile/issue-1237.rs +++ b/gcc/testsuite/rust/compile/issue-1237.rs @@ -1,6 +1,7 @@ // { dg-additional-options "-w" } #![feature(intrinsics)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-1289.rs b/gcc/testsuite/rust/compile/issue-1289.rs index 9251d79..58ab0b6 100644 --- a/gcc/testsuite/rust/compile/issue-1289.rs +++ b/gcc/testsuite/rust/compile/issue-1289.rs @@ -1,5 +1,6 @@ #![feature(intrinsics)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-1383.rs b/gcc/testsuite/rust/compile/issue-1383.rs index dac4b2a..f8ccd57 100644 --- a/gcc/testsuite/rust/compile/issue-1383.rs +++ b/gcc/testsuite/rust/compile/issue-1383.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-1447.rs b/gcc/testsuite/rust/compile/issue-1447.rs index 6d58f7a..afeef17 100644 --- a/gcc/testsuite/rust/compile/issue-1447.rs +++ b/gcc/testsuite/rust/compile/issue-1447.rs @@ -1,4 +1,5 @@ // { dg-options "-w" } +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-1483.rs b/gcc/testsuite/rust/compile/issue-1483.rs index eda7e13..96ca72e 100644 --- a/gcc/testsuite/rust/compile/issue-1483.rs +++ b/gcc/testsuite/rust/compile/issue-1483.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-1485.rs b/gcc/testsuite/rust/compile/issue-1485.rs index a0cd5a0..958fcd1 100644 --- a/gcc/testsuite/rust/compile/issue-1485.rs +++ b/gcc/testsuite/rust/compile/issue-1485.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-1487.rs b/gcc/testsuite/rust/compile/issue-1487.rs index 4a4d759..dd34651 100644 --- a/gcc/testsuite/rust/compile/issue-1487.rs +++ b/gcc/testsuite/rust/compile/issue-1487.rs @@ -1,4 +1,6 @@ // { dg-options "-w" } +#![feature(lang_items)] + #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-1589.rs b/gcc/testsuite/rust/compile/issue-1589.rs index 1dd7a45..dd7b4c0 100644 --- a/gcc/testsuite/rust/compile/issue-1589.rs +++ b/gcc/testsuite/rust/compile/issue-1589.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-1725-1.rs b/gcc/testsuite/rust/compile/issue-1725-1.rs index a02e6f6..5891f71 100644 --- a/gcc/testsuite/rust/compile/issue-1725-1.rs +++ b/gcc/testsuite/rust/compile/issue-1725-1.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-1725-2.rs b/gcc/testsuite/rust/compile/issue-1725-2.rs index d6a2d68..3386f27 100644 --- a/gcc/testsuite/rust/compile/issue-1725-2.rs +++ b/gcc/testsuite/rust/compile/issue-1725-2.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-1786.rs b/gcc/testsuite/rust/compile/issue-1786.rs index 1c46fee..e4f94bd 100644 --- a/gcc/testsuite/rust/compile/issue-1786.rs +++ b/gcc/testsuite/rust/compile/issue-1786.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-1893.rs b/gcc/testsuite/rust/compile/issue-1893.rs index 46c53e9..47cde45 100644 --- a/gcc/testsuite/rust/compile/issue-1893.rs +++ b/gcc/testsuite/rust/compile/issue-1893.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-1901.rs b/gcc/testsuite/rust/compile/issue-1901.rs index b43e34f..110b939 100644 --- a/gcc/testsuite/rust/compile/issue-1901.rs +++ b/gcc/testsuite/rust/compile/issue-1901.rs @@ -1,5 +1,6 @@ #![feature(intrinsics)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-1930.rs b/gcc/testsuite/rust/compile/issue-1930.rs index 071b3da..5eea229 100644 --- a/gcc/testsuite/rust/compile/issue-1930.rs +++ b/gcc/testsuite/rust/compile/issue-1930.rs @@ -1,4 +1,5 @@ // { dg-options "-w" } +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-1981.rs b/gcc/testsuite/rust/compile/issue-1981.rs index de9588c..c71cecf 100644 --- a/gcc/testsuite/rust/compile/issue-1981.rs +++ b/gcc/testsuite/rust/compile/issue-1981.rs @@ -1,5 +1,6 @@ #![feature(intrinsics)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-2015.rs b/gcc/testsuite/rust/compile/issue-2015.rs index 7e03651..5763096 100644 --- a/gcc/testsuite/rust/compile/issue-2015.rs +++ b/gcc/testsuite/rust/compile/issue-2015.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-2019-1.rs b/gcc/testsuite/rust/compile/issue-2019-1.rs index e91e347..e3174b1 100644 --- a/gcc/testsuite/rust/compile/issue-2019-1.rs +++ b/gcc/testsuite/rust/compile/issue-2019-1.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-2019-2.rs b/gcc/testsuite/rust/compile/issue-2019-2.rs index 9f7c0c0..eefe44d 100644 --- a/gcc/testsuite/rust/compile/issue-2019-2.rs +++ b/gcc/testsuite/rust/compile/issue-2019-2.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-2019-3.rs b/gcc/testsuite/rust/compile/issue-2019-3.rs index c95ce43..7f00d82 100644 --- a/gcc/testsuite/rust/compile/issue-2019-3.rs +++ b/gcc/testsuite/rust/compile/issue-2019-3.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-2036.rs b/gcc/testsuite/rust/compile/issue-2036.rs index 8701b20..03b8ed0 100644 --- a/gcc/testsuite/rust/compile/issue-2036.rs +++ b/gcc/testsuite/rust/compile/issue-2036.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-2037.rs b/gcc/testsuite/rust/compile/issue-2037.rs index 8adcb97..0d929d5 100644 --- a/gcc/testsuite/rust/compile/issue-2037.rs +++ b/gcc/testsuite/rust/compile/issue-2037.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-2070.rs b/gcc/testsuite/rust/compile/issue-2070.rs index 981e599..f4dc360 100644 --- a/gcc/testsuite/rust/compile/issue-2070.rs +++ b/gcc/testsuite/rust/compile/issue-2070.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-2105.rs b/gcc/testsuite/rust/compile/issue-2105.rs index 28f170e..4446b26 100644 --- a/gcc/testsuite/rust/compile/issue-2105.rs +++ b/gcc/testsuite/rust/compile/issue-2105.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-2106.rs b/gcc/testsuite/rust/compile/issue-2106.rs index 4af57c8..a75d21b 100644 --- a/gcc/testsuite/rust/compile/issue-2106.rs +++ b/gcc/testsuite/rust/compile/issue-2106.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-2135.rs b/gcc/testsuite/rust/compile/issue-2135.rs index 9f4d3e1..e2d5ed2 100644 --- a/gcc/testsuite/rust/compile/issue-2135.rs +++ b/gcc/testsuite/rust/compile/issue-2135.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-2136-1.rs b/gcc/testsuite/rust/compile/issue-2136-1.rs index f0af551..eee8a68 100644 --- a/gcc/testsuite/rust/compile/issue-2136-1.rs +++ b/gcc/testsuite/rust/compile/issue-2136-1.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-2136-2.rs b/gcc/testsuite/rust/compile/issue-2136-2.rs index b25820d..b30c9d2 100644 --- a/gcc/testsuite/rust/compile/issue-2136-2.rs +++ b/gcc/testsuite/rust/compile/issue-2136-2.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-2139.rs b/gcc/testsuite/rust/compile/issue-2139.rs index 65f82f3..ba3736f 100644 --- a/gcc/testsuite/rust/compile/issue-2139.rs +++ b/gcc/testsuite/rust/compile/issue-2139.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-2142.rs b/gcc/testsuite/rust/compile/issue-2142.rs index a3ec228..e4c0c92 100644 --- a/gcc/testsuite/rust/compile/issue-2142.rs +++ b/gcc/testsuite/rust/compile/issue-2142.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-2165.rs b/gcc/testsuite/rust/compile/issue-2165.rs index 5bbde65..38288e9 100644 --- a/gcc/testsuite/rust/compile/issue-2165.rs +++ b/gcc/testsuite/rust/compile/issue-2165.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-2166.rs b/gcc/testsuite/rust/compile/issue-2166.rs index 142ed17..d9e07a6 100644 --- a/gcc/testsuite/rust/compile/issue-2166.rs +++ b/gcc/testsuite/rust/compile/issue-2166.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-2187.rs b/gcc/testsuite/rust/compile/issue-2187.rs index deef417..78d843e 100644 --- a/gcc/testsuite/rust/compile/issue-2187.rs +++ b/gcc/testsuite/rust/compile/issue-2187.rs @@ -8,4 +8,3 @@ const D: &'static str = " "; ERROR_TIME // { dg-error "unrecognised token" "" { target *-*-* } .-1 } -// { dg-error "failed to parse item in crate" "" { target *-*-* } .-2 } diff --git a/gcc/testsuite/rust/compile/issue-2190-1.rs b/gcc/testsuite/rust/compile/issue-2190-1.rs index 927f90d..ad0f168 100644 --- a/gcc/testsuite/rust/compile/issue-2190-1.rs +++ b/gcc/testsuite/rust/compile/issue-2190-1.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-2190-2.rs b/gcc/testsuite/rust/compile/issue-2190-2.rs index 1c93338..c1abfb6 100644 --- a/gcc/testsuite/rust/compile/issue-2190-2.rs +++ b/gcc/testsuite/rust/compile/issue-2190-2.rs @@ -1,4 +1,5 @@ // { dg-options "-w" } +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-2195.rs b/gcc/testsuite/rust/compile/issue-2195.rs index fc158c3..0a917a8 100644 --- a/gcc/testsuite/rust/compile/issue-2195.rs +++ b/gcc/testsuite/rust/compile/issue-2195.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-2238.rs b/gcc/testsuite/rust/compile/issue-2238.rs index 6a43a13..6bbbca4 100644 --- a/gcc/testsuite/rust/compile/issue-2238.rs +++ b/gcc/testsuite/rust/compile/issue-2238.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-2304.rs b/gcc/testsuite/rust/compile/issue-2304.rs index 8313033..cef8fc8 100644 --- a/gcc/testsuite/rust/compile/issue-2304.rs +++ b/gcc/testsuite/rust/compile/issue-2304.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-2323.rs b/gcc/testsuite/rust/compile/issue-2323.rs index 02a3f90..2c69214 100644 --- a/gcc/testsuite/rust/compile/issue-2323.rs +++ b/gcc/testsuite/rust/compile/issue-2323.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-2330.rs b/gcc/testsuite/rust/compile/issue-2330.rs index 6ab46c7..21637cb 100644 --- a/gcc/testsuite/rust/compile/issue-2330.rs +++ b/gcc/testsuite/rust/compile/issue-2330.rs @@ -1,5 +1,5 @@ // { dg-options "-w" } -#![feature(intrinsics)] +#![feature(intrinsics, lang_items)] pub use option::Option::{self, None, Some}; pub use result::Result::{self, Err, Ok}; diff --git a/gcc/testsuite/rust/compile/issue-2369.rs b/gcc/testsuite/rust/compile/issue-2369.rs index 9475aef..e5a3030 100644 --- a/gcc/testsuite/rust/compile/issue-2369.rs +++ b/gcc/testsuite/rust/compile/issue-2369.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-2375.rs b/gcc/testsuite/rust/compile/issue-2375.rs index a61fef8..e3b9c9f 100644 --- a/gcc/testsuite/rust/compile/issue-2375.rs +++ b/gcc/testsuite/rust/compile/issue-2375.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-2478.rs b/gcc/testsuite/rust/compile/issue-2478.rs index 7fe4e2d..1cce4b2 100644 --- a/gcc/testsuite/rust/compile/issue-2478.rs +++ b/gcc/testsuite/rust/compile/issue-2478.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-2499.rs b/gcc/testsuite/rust/compile/issue-2499.rs index 662d58f..f6d40d8 100644 --- a/gcc/testsuite/rust/compile/issue-2499.rs +++ b/gcc/testsuite/rust/compile/issue-2499.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-2723-1.rs b/gcc/testsuite/rust/compile/issue-2723-1.rs index 261956d..5c77383 100644 --- a/gcc/testsuite/rust/compile/issue-2723-1.rs +++ b/gcc/testsuite/rust/compile/issue-2723-1.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-2723-2.rs b/gcc/testsuite/rust/compile/issue-2723-2.rs index c7609d1..4baf088 100644 --- a/gcc/testsuite/rust/compile/issue-2723-2.rs +++ b/gcc/testsuite/rust/compile/issue-2723-2.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-2725.rs b/gcc/testsuite/rust/compile/issue-2725.rs index a344bc8..06b1a89 100644 --- a/gcc/testsuite/rust/compile/issue-2725.rs +++ b/gcc/testsuite/rust/compile/issue-2725.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} trait Trait: ?Sized {} // { dg-error ".?Trait. is not permitted in supertraits" } diff --git a/gcc/testsuite/rust/compile/issue-2747.rs b/gcc/testsuite/rust/compile/issue-2747.rs index a9c09e7..fe4b572 100644 --- a/gcc/testsuite/rust/compile/issue-2747.rs +++ b/gcc/testsuite/rust/compile/issue-2747.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-2772-1.rs b/gcc/testsuite/rust/compile/issue-2772-1.rs index 69977db..aad8591 100644 --- a/gcc/testsuite/rust/compile/issue-2772-1.rs +++ b/gcc/testsuite/rust/compile/issue-2772-1.rs @@ -1,4 +1,5 @@ // { dg-options "-w" } +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-2772-2.rs b/gcc/testsuite/rust/compile/issue-2772-2.rs index b05f2b1..0e18324 100644 --- a/gcc/testsuite/rust/compile/issue-2772-2.rs +++ b/gcc/testsuite/rust/compile/issue-2772-2.rs @@ -1,4 +1,5 @@ // { dg-options "-w" } +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-2775.rs b/gcc/testsuite/rust/compile/issue-2775.rs index 3ad7085..d67ced3 100644 --- a/gcc/testsuite/rust/compile/issue-2775.rs +++ b/gcc/testsuite/rust/compile/issue-2775.rs @@ -1,4 +1,5 @@ // { dg-options "-w" } +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-2782.rs b/gcc/testsuite/rust/compile/issue-2782.rs index e199c88..61fc20c 100644 --- a/gcc/testsuite/rust/compile/issue-2782.rs +++ b/gcc/testsuite/rust/compile/issue-2782.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-2907.rs b/gcc/testsuite/rust/compile/issue-2907.rs index fdf1953..8c0d496 100644 --- a/gcc/testsuite/rust/compile/issue-2907.rs +++ b/gcc/testsuite/rust/compile/issue-2907.rs @@ -1,5 +1,6 @@ #![feature(lang_items)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-2951.rs b/gcc/testsuite/rust/compile/issue-2951.rs index d30a3bf..218332d 100644 --- a/gcc/testsuite/rust/compile/issue-2951.rs +++ b/gcc/testsuite/rust/compile/issue-2951.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-2953-1.rs b/gcc/testsuite/rust/compile/issue-2953-1.rs index d07059e..d3289b9 100644 --- a/gcc/testsuite/rust/compile/issue-2953-1.rs +++ b/gcc/testsuite/rust/compile/issue-2953-1.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + #[lang = "sized"] pub trait Sized { // Empty. diff --git a/gcc/testsuite/rust/compile/issue-2953-2.rs b/gcc/testsuite/rust/compile/issue-2953-2.rs index 5927624..5fbd6c4 100644 --- a/gcc/testsuite/rust/compile/issue-2953-2.rs +++ b/gcc/testsuite/rust/compile/issue-2953-2.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + #[lang = "sized"] pub trait Sized { // Empty. diff --git a/gcc/testsuite/rust/compile/issue-2954.rs b/gcc/testsuite/rust/compile/issue-2954.rs index 52f7c91..973ee0a 100644 --- a/gcc/testsuite/rust/compile/issue-2954.rs +++ b/gcc/testsuite/rust/compile/issue-2954.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-2987.rs b/gcc/testsuite/rust/compile/issue-2987.rs index 1ab5fdc..9560bde 100644 --- a/gcc/testsuite/rust/compile/issue-2987.rs +++ b/gcc/testsuite/rust/compile/issue-2987.rs @@ -1,5 +1,6 @@ // { dg-options "-w" } Currently there are a lot of warnings produced from inside clone/copy // builtins +#![feature(lang_items)] #[lang = "copy"] trait Copy {} diff --git a/gcc/testsuite/rust/compile/issue-3009.rs b/gcc/testsuite/rust/compile/issue-3009.rs index 2eb4ef3..3d6fb9f 100644 --- a/gcc/testsuite/rust/compile/issue-3009.rs +++ b/gcc/testsuite/rust/compile/issue-3009.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-3022.rs b/gcc/testsuite/rust/compile/issue-3022.rs index b8b8e6f..e9358c9 100644 --- a/gcc/testsuite/rust/compile/issue-3022.rs +++ b/gcc/testsuite/rust/compile/issue-3022.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-3030.rs b/gcc/testsuite/rust/compile/issue-3030.rs index 0a1866d..94222b7 100644 --- a/gcc/testsuite/rust/compile/issue-3030.rs +++ b/gcc/testsuite/rust/compile/issue-3030.rs @@ -1,5 +1,6 @@ #![feature(negative_impls)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-3032-1.rs b/gcc/testsuite/rust/compile/issue-3032-1.rs index e9eb027..7338cb9 100644 --- a/gcc/testsuite/rust/compile/issue-3032-1.rs +++ b/gcc/testsuite/rust/compile/issue-3032-1.rs @@ -1,4 +1,4 @@ -#![feature(negative_impls)] +#![feature(negative_impls, lang_items)] #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-3032-2.rs b/gcc/testsuite/rust/compile/issue-3032-2.rs index 9e09d41..37c081b 100644 --- a/gcc/testsuite/rust/compile/issue-3032-2.rs +++ b/gcc/testsuite/rust/compile/issue-3032-2.rs @@ -1,4 +1,4 @@ -#![feature(negative_impls)] +#![feature(negative_impls, lang_items)] #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-3033.rs b/gcc/testsuite/rust/compile/issue-3033.rs index 9085b76..7adce5b 100644 --- a/gcc/testsuite/rust/compile/issue-3033.rs +++ b/gcc/testsuite/rust/compile/issue-3033.rs @@ -1,4 +1,4 @@ -#![feature(negative_impls)] +#![feature(negative_impls, lang_items)] #[lang = "copy"] trait Copy {} diff --git a/gcc/testsuite/rust/compile/issue-3035.rs b/gcc/testsuite/rust/compile/issue-3035.rs index 3266d84..80c2ab6 100644 --- a/gcc/testsuite/rust/compile/issue-3035.rs +++ b/gcc/testsuite/rust/compile/issue-3035.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-3036.rs b/gcc/testsuite/rust/compile/issue-3036.rs index 4418ccc..39856d5 100644 --- a/gcc/testsuite/rust/compile/issue-3036.rs +++ b/gcc/testsuite/rust/compile/issue-3036.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-3045-1.rs b/gcc/testsuite/rust/compile/issue-3045-1.rs index a1328f2..1f62e368 100644 --- a/gcc/testsuite/rust/compile/issue-3045-1.rs +++ b/gcc/testsuite/rust/compile/issue-3045-1.rs @@ -1,4 +1,4 @@ -#![feature(dropck_eyepatch)] +#![feature(dropck_eyepatch, lang_items)] #[allow(dead_code)] #[lang = "sized"] diff --git a/gcc/testsuite/rust/compile/issue-3045-2.rs b/gcc/testsuite/rust/compile/issue-3045-2.rs index 177707fb..4c90d4d 100644 --- a/gcc/testsuite/rust/compile/issue-3045-2.rs +++ b/gcc/testsuite/rust/compile/issue-3045-2.rs @@ -1,4 +1,4 @@ -#![feature(dropck_eyepatch)] +#![feature(dropck_eyepatch, lang_items)] #[allow(dead_code)] #[lang = "sized"] diff --git a/gcc/testsuite/rust/compile/issue-3144.rs b/gcc/testsuite/rust/compile/issue-3144.rs index 4e61078..02c6ff6 100644 --- a/gcc/testsuite/rust/compile/issue-3144.rs +++ b/gcc/testsuite/rust/compile/issue-3144.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-3242.rs b/gcc/testsuite/rust/compile/issue-3242.rs index a4542aea0..a6bd1c8 100644 --- a/gcc/testsuite/rust/compile/issue-3242.rs +++ b/gcc/testsuite/rust/compile/issue-3242.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-3304.rs b/gcc/testsuite/rust/compile/issue-3304.rs index cc376fa..aa857e2 100644 --- a/gcc/testsuite/rust/compile/issue-3304.rs +++ b/gcc/testsuite/rust/compile/issue-3304.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-3382.rs b/gcc/testsuite/rust/compile/issue-3382.rs index 6f4382f..c26494c 100644 --- a/gcc/testsuite/rust/compile/issue-3382.rs +++ b/gcc/testsuite/rust/compile/issue-3382.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-3402-1.rs b/gcc/testsuite/rust/compile/issue-3402-1.rs index ed603ce..cd13b74 100644 --- a/gcc/testsuite/rust/compile/issue-3402-1.rs +++ b/gcc/testsuite/rust/compile/issue-3402-1.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + pub struct Foo { a: i32, // { dg-warning "field is never read" "" { target *-*-* } .-1 } diff --git a/gcc/testsuite/rust/compile/issue-3402-2.rs b/gcc/testsuite/rust/compile/issue-3402-2.rs index b665af2..33d72e0 100644 --- a/gcc/testsuite/rust/compile/issue-3402-2.rs +++ b/gcc/testsuite/rust/compile/issue-3402-2.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + pub struct Bar(i32); #[lang = "sized"] diff --git a/gcc/testsuite/rust/compile/issue-3403.rs b/gcc/testsuite/rust/compile/issue-3403.rs index ced6b4e..6a3f720 100644 --- a/gcc/testsuite/rust/compile/issue-3403.rs +++ b/gcc/testsuite/rust/compile/issue-3403.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + pub struct Foo { a: i32, // { dg-warning "field is never read" "" { target *-*-* } .-1 } diff --git a/gcc/testsuite/rust/compile/issue-3454.rs b/gcc/testsuite/rust/compile/issue-3454.rs index 2a3c0c7..e2a5a39 100644 --- a/gcc/testsuite/rust/compile/issue-3454.rs +++ b/gcc/testsuite/rust/compile/issue-3454.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-3551.rs b/gcc/testsuite/rust/compile/issue-3551.rs index 6d6a812..55303b2 100644 --- a/gcc/testsuite/rust/compile/issue-3551.rs +++ b/gcc/testsuite/rust/compile/issue-3551.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-3554-2.rs b/gcc/testsuite/rust/compile/issue-3554-2.rs index e455a8b..3710e57 100644 --- a/gcc/testsuite/rust/compile/issue-3554-2.rs +++ b/gcc/testsuite/rust/compile/issue-3554-2.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-3599.rs b/gcc/testsuite/rust/compile/issue-3599.rs index 1d29fac..a41d2b3 100644 --- a/gcc/testsuite/rust/compile/issue-3599.rs +++ b/gcc/testsuite/rust/compile/issue-3599.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-3617.rs b/gcc/testsuite/rust/compile/issue-3617.rs new file mode 100644 index 0000000..64c2166 --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-3617.rs @@ -0,0 +1,14 @@ +macro_rules! quote_tokens { + () => { + #[macro_export] + macro_rules! inner { + () => { + $crate:: + } + } + }; +} + +pub fn main() { + quote_tokens!(); +} diff --git a/gcc/testsuite/rust/compile/issue-3642.rs b/gcc/testsuite/rust/compile/issue-3642.rs index 6d9decc..30abfd3 100644 --- a/gcc/testsuite/rust/compile/issue-3642.rs +++ b/gcc/testsuite/rust/compile/issue-3642.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-3659.rs b/gcc/testsuite/rust/compile/issue-3659.rs new file mode 100644 index 0000000..ffbc634 --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-3659.rs @@ -0,0 +1,10 @@ +#![feature(exclusive_range_pattern)] + +fn main() { + let x = 3; + + match x { + 0..-1 => 2, // { dg-error "lower range bound must be less than upper .E0579." } + _ => 3, + }; +} diff --git a/gcc/testsuite/rust/compile/issue-3711.rs b/gcc/testsuite/rust/compile/issue-3711.rs index a3f9c39..911d4ad 100644 --- a/gcc/testsuite/rust/compile/issue-3711.rs +++ b/gcc/testsuite/rust/compile/issue-3711.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-3836.rs b/gcc/testsuite/rust/compile/issue-3836.rs index a228795..8cc661f 100644 --- a/gcc/testsuite/rust/compile/issue-3836.rs +++ b/gcc/testsuite/rust/compile/issue-3836.rs @@ -1,4 +1,6 @@ // { dg-options "-w" } +#![feature(lang_items)] + mod core { mod option { pub enum Option<T> { diff --git a/gcc/testsuite/rust/compile/issue-3898.rs b/gcc/testsuite/rust/compile/issue-3898.rs index 114370c..8199267 100644 --- a/gcc/testsuite/rust/compile/issue-3898.rs +++ b/gcc/testsuite/rust/compile/issue-3898.rs @@ -1,4 +1,5 @@ // { dg-additional-options "-frust-compile-until=lowering" } +#![feature(lang_items)] #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-3915.rs b/gcc/testsuite/rust/compile/issue-3915.rs index 7132036..5cd8dc0 100644 --- a/gcc/testsuite/rust/compile/issue-3915.rs +++ b/gcc/testsuite/rust/compile/issue-3915.rs @@ -1,4 +1,6 @@ // { dg-options "-w" } +#![feature(lang_items)] + #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-3916.rs b/gcc/testsuite/rust/compile/issue-3916.rs index 59b522b..c4adb64 100644 --- a/gcc/testsuite/rust/compile/issue-3916.rs +++ b/gcc/testsuite/rust/compile/issue-3916.rs @@ -1,4 +1,4 @@ -#![feature(rustc_attrs)] +#![feature(rustc_attrs, lang_items)] #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-3969.rs b/gcc/testsuite/rust/compile/issue-3969.rs index 9608589..6715978 100644 --- a/gcc/testsuite/rust/compile/issue-3969.rs +++ b/gcc/testsuite/rust/compile/issue-3969.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + #[lang = "sized"] pub trait Sized { // Empty. diff --git a/gcc/testsuite/rust/compile/issue-3971.rs b/gcc/testsuite/rust/compile/issue-3971.rs new file mode 100644 index 0000000..5607d2d --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-3971.rs @@ -0,0 +1,11 @@ +#[lang = "copy"] +trait Copy {} + +// since the macro expansion fails, the current nameres fixpoint error is emitted - just accept it for now +#[derive(Copy)] +// { dg-error "derive may only be applied to structs, enums and unions" "" { target *-*-* } .-1 } +// { dg-excess-errors "could not resolve trait" } + +pub fn check_ge(a: i32, b: i32) -> bool { + a >= b +} diff --git a/gcc/testsuite/rust/compile/issue-402.rs b/gcc/testsuite/rust/compile/issue-402.rs index 2c99fc8..ec398e9 100644 --- a/gcc/testsuite/rust/compile/issue-402.rs +++ b/gcc/testsuite/rust/compile/issue-402.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-407-2.rs b/gcc/testsuite/rust/compile/issue-407-2.rs index 2d60d6d..6dad861 100644 --- a/gcc/testsuite/rust/compile/issue-407-2.rs +++ b/gcc/testsuite/rust/compile/issue-407-2.rs @@ -2,15 +2,8 @@ pub fn loopy() { let mut a = 1; loop { - // { dg-error {failed to parse statement or expression in block expression} "" { target *-*-* } .-1 } if a < 40 { - // { dg-error {failed to parse statement or expression in block expression} "" { target *-*-* } .-1 } a + = 1; // { dg-error "found unexpected token '=' in null denotation" } - // { dg-error {failed to parse statement or expression in block expression} "" { target *-*-* } .-1 } - // { dg-error {failed to parse if body block expression in if expression} "" { target *-*-* } .-2 } - // { dg-error {could not parse loop body in \(infinite\) loop expression} "" { target *-*-* } .-3 } - // { dg-error {unrecognised token 'integer literal' for start of item} "" { target *-*-* } .-4 } - // { dg-error {failed to parse item in crate} "" { target *-*-* } .-5 } } else { break; } diff --git a/gcc/testsuite/rust/compile/issue-407.rs b/gcc/testsuite/rust/compile/issue-407.rs index bd0d306..3a9dbeb 100644 --- a/gcc/testsuite/rust/compile/issue-407.rs +++ b/gcc/testsuite/rust/compile/issue-407.rs @@ -2,7 +2,4 @@ fn test() { let mut a = 1; a + = 1; // { dg-error "found unexpected token '=' in null denotation" } - // { dg-error {failed to parse statement or expression in block expression} "" { target *-*-* } .-1 } - // { dg-error {unrecognised token 'integer literal' for start of item} "" { target *-*-* } .-2 } - // { dg-error {failed to parse item in crate} "" { target *-*-* } .-3 } } diff --git a/gcc/testsuite/rust/compile/issue-4090-1.rs b/gcc/testsuite/rust/compile/issue-4090-1.rs index 9f83835..0411943 100644 --- a/gcc/testsuite/rust/compile/issue-4090-1.rs +++ b/gcc/testsuite/rust/compile/issue-4090-1.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + mod core { mod marker { #[lang = "sized"] diff --git a/gcc/testsuite/rust/compile/issue-4090-2.rs b/gcc/testsuite/rust/compile/issue-4090-2.rs index 75d6b7c..7b76c0a 100644 --- a/gcc/testsuite/rust/compile/issue-4090-2.rs +++ b/gcc/testsuite/rust/compile/issue-4090-2.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + mod core { mod marker { #[lang = "sized"] diff --git a/gcc/testsuite/rust/compile/issue-4140-1.rs b/gcc/testsuite/rust/compile/issue-4140-1.rs new file mode 100644 index 0000000..8b68b3e --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-4140-1.rs @@ -0,0 +1,18 @@ +pub enum TypeCtor { + Slice, + Array, +} +pub struct B<T>(T); + +macro_rules! ty_app { + ($_a:pat) => { + ApplicationTy($ctor) // { dg-error "unexpected token" } + // { dg-error "failed to parse tuple struct items" "" { target *-*-* } .-1 } + }; +} + +pub fn foo(ty: ApplicationTy) { // { dg-error "could not resolve type path 'ApplicationTy'" } + match ty { + ty_app!(bean::Array) => {} + } +} diff --git a/gcc/testsuite/rust/compile/issue-4140-2.rs b/gcc/testsuite/rust/compile/issue-4140-2.rs new file mode 100644 index 0000000..bcccddb --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-4140-2.rs @@ -0,0 +1,12 @@ +macro_rules! ty_app { + ($_a:pat) => { + ($ctor) + }; +} + +pub fn foo() { + match ty { + // { dg-error "Cannot find path" "4140" { target *-*-* } 0 } + ty_app!(bean::Array) => {} // { dg-error "unrecognised token" "4140" { target *-*-* } 0 } + } +} diff --git a/gcc/testsuite/rust/compile/issue-4162.rs b/gcc/testsuite/rust/compile/issue-4162.rs new file mode 100644 index 0000000..ffaa92d --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-4162.rs @@ -0,0 +1,6 @@ +pub fn main() { + while let = 5 + // { dg-error "should be at least 1 pattern" "" { target *-*-* } .-1 } + {} +} + diff --git a/gcc/testsuite/rust/compile/issue-4188.rs b/gcc/testsuite/rust/compile/issue-4188.rs new file mode 100644 index 0000000..32b175d --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-4188.rs @@ -0,0 +1,13 @@ +trait MemoryUnit { + extern "C" fn read_dword(&'s self) -> u16 {} + // { dg-error {failed to resolve lifetime} "" { target *-*-* } .-1 } + // { dg-error {mismatched types} "" { target *-*-* } .-2 } +} + +impl MemoryUnit for MemoryUnit { + extern "C" fn read_dword(&'s self) -> u16 { + let b16 = self.read_word() as u16; + + b16 << 8 + } +} diff --git a/gcc/testsuite/rust/compile/issue-4212.rs b/gcc/testsuite/rust/compile/issue-4212.rs index e068e45..e7bf113 100644 --- a/gcc/testsuite/rust/compile/issue-4212.rs +++ b/gcc/testsuite/rust/compile/issue-4212.rs @@ -1,5 +1,5 @@ #![derive(PartialOrd, PartialEq)] -// { dg-error "derive attribute cannot be used at crate level" "" { target *-*-* } .-1 } +// { dg-error "attribute cannot be used at crate level" "" { target *-*-* } .-1 } pub fn check_ge(a: i32, b: i32) -> bool { a >= b } diff --git a/gcc/testsuite/rust/compile/issue-4219.rs b/gcc/testsuite/rust/compile/issue-4219.rs new file mode 100644 index 0000000..d6e70e9 --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-4219.rs @@ -0,0 +1,5 @@ +#![inline] +// { dg-error "attribute cannot be used at crate level" "" { target *-*-* } .-1 } +pub fn check_ge(a: i32, b: i32) -> bool { + a >= b +} diff --git a/gcc/testsuite/rust/compile/issue-4222.rs b/gcc/testsuite/rust/compile/issue-4222.rs new file mode 100644 index 0000000..b829c6f --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-4222.rs @@ -0,0 +1,3 @@ +#![cfg(false)] +// { dg-error ".false. predicate key cannot be a literal" "" { target *-*-* } .-1 } +fn a() {} diff --git a/gcc/testsuite/rust/compile/issue-4226.rs b/gcc/testsuite/rust/compile/issue-4226.rs new file mode 100644 index 0000000..553faf2 --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-4226.rs @@ -0,0 +1,3 @@ +#[doc] +// { dg-error "attribute must be of the form ...doc.hidden.inline....... or ...doc = string.." "" { target *-*-* } .-1 } +pub fn a(){} diff --git a/gcc/testsuite/rust/compile/issue-4242.rs b/gcc/testsuite/rust/compile/issue-4242.rs new file mode 100644 index 0000000..ecbe258 --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-4242.rs @@ -0,0 +1,10 @@ +#![feature(exclusive_range_pattern)] + +fn main() { + let x = 1; + + match x { + -55..0 => 2, + -99..-55 => 3, + }; +}
\ No newline at end of file diff --git a/gcc/testsuite/rust/compile/issue-4261.rs b/gcc/testsuite/rust/compile/issue-4261.rs new file mode 100644 index 0000000..32beafa --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-4261.rs @@ -0,0 +1,3 @@ +#[cfg()] +// { dg-error "malformed .cfg. attribute input" "" { target *-*-* } .-1 } +fn a() {} diff --git a/gcc/testsuite/rust/compile/issue-4262.rs b/gcc/testsuite/rust/compile/issue-4262.rs new file mode 100644 index 0000000..2ce1cb4 --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-4262.rs @@ -0,0 +1,3 @@ +#[cfg] +// { dg-error ".cfg. is not followed by parentheses" "" { target *-*-* } .-1 } +fn a() {} diff --git a/gcc/testsuite/rust/compile/issue-4267.rs b/gcc/testsuite/rust/compile/issue-4267.rs new file mode 100644 index 0000000..f507748 --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-4267.rs @@ -0,0 +1,3 @@ +#[cfg(a,a)] +// { dg-error "multiple .cfg. predicates are specified" "" { target *-*-* } .-1 } +fn a(){} diff --git a/gcc/testsuite/rust/compile/issue-850.rs b/gcc/testsuite/rust/compile/issue-850.rs index e42b557..c6a5f31 100644 --- a/gcc/testsuite/rust/compile/issue-850.rs +++ b/gcc/testsuite/rust/compile/issue-850.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-855.rs b/gcc/testsuite/rust/compile/issue-855.rs index 9e450dd..3736d08 100644 --- a/gcc/testsuite/rust/compile/issue-855.rs +++ b/gcc/testsuite/rust/compile/issue-855.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + pub use result::Result::{self, Err, Ok}; #[lang = "sized"] diff --git a/gcc/testsuite/rust/compile/issue-867.rs b/gcc/testsuite/rust/compile/issue-867.rs index e5f9b29..1aa29b3 100644 --- a/gcc/testsuite/rust/compile/issue-867.rs +++ b/gcc/testsuite/rust/compile/issue-867.rs @@ -1,8 +1,4 @@ fn main() { let _ = 42; let a = _ + 123; // { dg-error "use of '_' is not allowed on the right-side of an assignment" } - // { dg-error {failed to parse expression in let statement} "" { target *-*-* } .-1 } - // { dg-error {failed to parse statement or expression in block expression} "" { target *-*-* } .-2 } - // { dg-error {unrecognised token '\}' for start of item} "" { target *-*-* } .+2 } - // { dg-error {failed to parse item in crate} "" { target *-*-* } .+1 } } diff --git a/gcc/testsuite/rust/compile/issue-925.rs b/gcc/testsuite/rust/compile/issue-925.rs index 507fe94..34c611b 100644 --- a/gcc/testsuite/rust/compile/issue-925.rs +++ b/gcc/testsuite/rust/compile/issue-925.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/iterators1.rs b/gcc/testsuite/rust/compile/iterators1.rs index 2ea3d74..4bbc47e 100644 --- a/gcc/testsuite/rust/compile/iterators1.rs +++ b/gcc/testsuite/rust/compile/iterators1.rs @@ -1,4 +1,4 @@ -#![feature(intrinsics)] +#![feature(intrinsics, lang_items)] pub use option::Option::{self, None, Some}; pub use result::Result::{self, Err, Ok}; diff --git a/gcc/testsuite/rust/compile/lang_feature_gate.rs b/gcc/testsuite/rust/compile/lang_feature_gate.rs new file mode 100644 index 0000000..4cd485e --- /dev/null +++ b/gcc/testsuite/rust/compile/lang_feature_gate.rs @@ -0,0 +1,2 @@ +#[lang = "sized"] // { dg-error "lang items are subject to change. add .#!.feature.lang_items... to the crate attributes to enable" } +pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/macros/builtin/option_env1.rs b/gcc/testsuite/rust/compile/macros/builtin/option_env1.rs index cf9f65b..b96c1ee 100644 --- a/gcc/testsuite/rust/compile/macros/builtin/option_env1.rs +++ b/gcc/testsuite/rust/compile/macros/builtin/option_env1.rs @@ -1,4 +1,4 @@ -#![feature(rustc_attrs)] +#![feature(rustc_attrs, lang_items)] #[rustc_builtin_macro] macro_rules! option_env { diff --git a/gcc/testsuite/rust/compile/macros/builtin/option_env2.rs b/gcc/testsuite/rust/compile/macros/builtin/option_env2.rs index 63f7254..ef0e563 100644 --- a/gcc/testsuite/rust/compile/macros/builtin/option_env2.rs +++ b/gcc/testsuite/rust/compile/macros/builtin/option_env2.rs @@ -1,4 +1,4 @@ -#![feature(rustc_attrs)] +#![feature(rustc_attrs, lang_items)] #[rustc_builtin_macro] macro_rules! option_env { diff --git a/gcc/testsuite/rust/compile/macros/builtin/option_env3.rs b/gcc/testsuite/rust/compile/macros/builtin/option_env3.rs index ad6dd4c..545f3c8 100644 --- a/gcc/testsuite/rust/compile/macros/builtin/option_env3.rs +++ b/gcc/testsuite/rust/compile/macros/builtin/option_env3.rs @@ -1,4 +1,4 @@ -#![feature(rustc_attrs)] +#![feature(rustc_attrs, lang_items)] #[rustc_builtin_macro] macro_rules! option_env { diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro-issue1053-2.rs b/gcc/testsuite/rust/compile/macros/mbe/macro-issue1053-2.rs index 3145990..fc96caa 100644 --- a/gcc/testsuite/rust/compile/macros/mbe/macro-issue1053-2.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro-issue1053-2.rs @@ -1,5 +1,4 @@ macro_rules! m { ($e:expr $(forbidden)*) => {{}}; // { dg-error "token .identifier. is not allowed after .expr. fragment" } // { dg-error "required first macro rule in macro rules definition could not be parsed" "" { target *-*-* } .-1 } - // { dg-error "failed to parse item in crate" "" { target *-*-* } .-2 } } diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro-issue1395-2.rs b/gcc/testsuite/rust/compile/macros/mbe/macro-issue1395-2.rs index 1df6a3a..7ff380d 100644 --- a/gcc/testsuite/rust/compile/macros/mbe/macro-issue1395-2.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro-issue1395-2.rs @@ -2,6 +2,5 @@ macro_rules! try { // { dg-error "expecting .identifier. but .try. found" "" { target *-*-* } .-1 } - // { dg-error "failed to parse item in crate" "" { target *-*-* } .-2 } () => {}; } diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro-issue1400.rs b/gcc/testsuite/rust/compile/macros/mbe/macro-issue1400.rs index 5c51b78..0708128 100644 --- a/gcc/testsuite/rust/compile/macros/mbe/macro-issue1400.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro-issue1400.rs @@ -1,5 +1,6 @@ // { dg-additional-options "-w" } +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro-issue3608.rs b/gcc/testsuite/rust/compile/macros/mbe/macro-issue3608.rs new file mode 100644 index 0000000..b081d45 --- /dev/null +++ b/gcc/testsuite/rust/compile/macros/mbe/macro-issue3608.rs @@ -0,0 +1,10 @@ +include!(; + +struct Baz { + +impl Bar for + + +fn main() { )// { dg-error "unexpected closing delimiter .\\)." } + // { dg-error "unexpected token .end of file. - expecting closing delimiter .\}. .for a delimited token tree." "" { target *-*-* } .+2 } + // { dg-error "unexpected token .end of file. - expecting closing delimiter .\\). .for a macro invocation semi." "" { target *-*-* } .+1 } diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro-issue3708.rs b/gcc/testsuite/rust/compile/macros/mbe/macro-issue3708.rs index bcbc8dd..bbf0276 100644 --- a/gcc/testsuite/rust/compile/macros/mbe/macro-issue3708.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro-issue3708.rs @@ -1,4 +1,5 @@ // { dg-additional-options "-frust-compile-until=lowering" } +#![feature(lang_items)] macro_rules! impl_fn_for_zst { ($( diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro-issue3709-2.rs b/gcc/testsuite/rust/compile/macros/mbe/macro-issue3709-2.rs index 47514f1..4d76497 100644 --- a/gcc/testsuite/rust/compile/macros/mbe/macro-issue3709-2.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro-issue3709-2.rs @@ -1,4 +1,5 @@ // { dg-additional-options "-frust-compile-until=lowering" } +#![feature(lang_items)] macro_rules! impl_fn_for_zst { ($( diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro20.rs b/gcc/testsuite/rust/compile/macros/mbe/macro20.rs index e03455b..4481834 100644 --- a/gcc/testsuite/rust/compile/macros/mbe/macro20.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro20.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro23.rs b/gcc/testsuite/rust/compile/macros/mbe/macro23.rs index a6a2afd..3add715 100644 --- a/gcc/testsuite/rust/compile/macros/mbe/macro23.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro23.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro27.rs b/gcc/testsuite/rust/compile/macros/mbe/macro27.rs index ee7833b..b9f392f 100644 --- a/gcc/testsuite/rust/compile/macros/mbe/macro27.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro27.rs @@ -2,7 +2,6 @@ macro_rules! m { ($a:expr tok) => { // { dg-error "token .identifier. is not allowed after .expr. fragment" "" { target *-*-* } .-1 } // { dg-error "required first macro rule in macro rules definition could not be parsed" "" { target *-*-* } .-2 } - // { dg-error "failed to parse item in crate" "" { target *-*-* } .-3 } $a }; } diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro28.rs b/gcc/testsuite/rust/compile/macros/mbe/macro28.rs index 8002f28..bbe55a7 100644 --- a/gcc/testsuite/rust/compile/macros/mbe/macro28.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro28.rs @@ -2,7 +2,6 @@ macro_rules! m { ($a:expr $(tok $es:expr)*) => { // { dg-error "token .identifier. is not allowed after .expr. fragment" "" { target *-*-* } .-1 } // { dg-error "required first macro rule in macro rules definition could not be parsed" "" { target *-*-* } .-2 } - // { dg-error "failed to parse item in crate" "" { target *-*-* } .-3 } $a }; } diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro29.rs b/gcc/testsuite/rust/compile/macros/mbe/macro29.rs index 39f5021..a6c9eb5 100644 --- a/gcc/testsuite/rust/compile/macros/mbe/macro29.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro29.rs @@ -2,7 +2,6 @@ macro_rules! m { ($($es:expr)* tok) => { // { dg-error "token .identifier. is not allowed after .expr. fragment" "" { target *-*-* } .-1 } // { dg-error "required first macro rule in macro rules definition could not be parsed" "" { target *-*-* } .-2 } - // { dg-error "failed to parse item in crate" "" { target *-*-* } .-3 } $a }; } diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro30.rs b/gcc/testsuite/rust/compile/macros/mbe/macro30.rs index 35064bc0..097272e 100644 --- a/gcc/testsuite/rust/compile/macros/mbe/macro30.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro30.rs @@ -2,7 +2,6 @@ macro_rules! m { ($e:expr $f:expr) => { // { dg-error "fragment is not allowed after .expr. fragment" "" { target *-*-* } .-1 } // { dg-error "required first macro rule in macro rules definition could not be parsed" "" { target *-*-* } .-2 } - // { dg-error "failed to parse item in crate" "" { target *-*-* } .-3 } $e }; } diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro31.rs b/gcc/testsuite/rust/compile/macros/mbe/macro31.rs index 6674a5f..30fae48 100644 --- a/gcc/testsuite/rust/compile/macros/mbe/macro31.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro31.rs @@ -2,7 +2,6 @@ macro_rules! m { ($($e:expr)* $($f:expr)*) => { // { dg-error "fragment is not allowed after .expr. fragment" "" { target *-*-* } .-1 } // { dg-error "required first macro rule in macro rules definition could not be parsed" "" { target *-*-* } .-2 } - // { dg-error "failed to parse item in crate" "" { target *-*-* } .-3 } $e }; } diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro33.rs b/gcc/testsuite/rust/compile/macros/mbe/macro33.rs index 2ccd33e..a73d245 100644 --- a/gcc/testsuite/rust/compile/macros/mbe/macro33.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro33.rs @@ -1,5 +1,4 @@ macro_rules! forbidden_frag { ($t:ty $not_block:ident) => {{}}; // { dg-error "fragment specifier .ident. is not allowed after .ty. fragments" } // { dg-error "required first macro rule in macro rules definition could not be parsed" "" { target *-*-* } .-1 } - // { dg-error "failed to parse item in crate" "" { target *-*-* } .-2 } } diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro35.rs b/gcc/testsuite/rust/compile/macros/mbe/macro35.rs index 07b157b..8c295d4 100644 --- a/gcc/testsuite/rust/compile/macros/mbe/macro35.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro35.rs @@ -3,5 +3,4 @@ macro_rules! inside_matcher { // { dg-error "failed to parse macro matcher" "" { target *-*-* } .-1 } // { dg-error "failed to parse macro match" "" { target *-*-* } .-2 } // { dg-error "required first macro rule" "" { target *-*-* } .-3 } - // { dg-error "failed to parse item in crate" "" { target *-*-* } .-4 } } diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro37.rs b/gcc/testsuite/rust/compile/macros/mbe/macro37.rs index 5713d90..26f79d8 100644 --- a/gcc/testsuite/rust/compile/macros/mbe/macro37.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro37.rs @@ -1,5 +1,4 @@ macro_rules! invalid_after_zeroable { ($e:expr $(,)* forbidden) => {{}}; // { dg-error "token .identifier. is not allowed after .expr. fragment" } // { dg-error "required first macro rule" "" { target *-*-* } .-1 } - // { dg-error "failed to parse item in crate" "" { target *-*-* } .-2 } } diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro38.rs b/gcc/testsuite/rust/compile/macros/mbe/macro38.rs index eb294ae..e297492 100644 --- a/gcc/testsuite/rust/compile/macros/mbe/macro38.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro38.rs @@ -1,5 +1,4 @@ macro_rules! invalid_after_zeroable_multi { ($e:expr $(,)? $(;)* $(=>)? forbidden) => {{}}; // { dg-error "token .identifier. is not allowed after .expr. fragment" } // { dg-error "required first macro rule" "" { target *-*-* } .-1 } - // { dg-error "failed to parse item in crate" "" { target *-*-* } .-2 } } diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro39.rs b/gcc/testsuite/rust/compile/macros/mbe/macro39.rs index f5c498c..867ec21 100644 --- a/gcc/testsuite/rust/compile/macros/mbe/macro39.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro39.rs @@ -1,5 +1,4 @@ macro_rules! m { ($e:expr (, parenthesis_forbidden)) => {{}}; // { dg-error "token .\\(. at start of matcher is not allowed after .expr. fragment" } // { dg-error "required first macro rule" "" { target *-*-* } .-1 } - // { dg-error "failed to parse item in crate" "" { target *-*-* } .-2 } } diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro40.rs b/gcc/testsuite/rust/compile/macros/mbe/macro40.rs index f9d048e..39cbf5a 100644 --- a/gcc/testsuite/rust/compile/macros/mbe/macro40.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro40.rs @@ -1,5 +1,6 @@ // { dg-additional-options "-w" } +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro48.rs b/gcc/testsuite/rust/compile/macros/mbe/macro48.rs index 6b3b369..aff5d19 100644 --- a/gcc/testsuite/rust/compile/macros/mbe/macro48.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro48.rs @@ -1,8 +1,7 @@ // Check that "priv" is not in the follow set of :vis. -// { dg-error "token .priv. is not allowed after .vis. fragment" "#359" { target *-*-* } .+4 } -// { dg-error "required first macro rule in macro rules definition could not be parsed" "" { target *-*-* } .+3 } -// { dg-error "failed to parse item in crate" "" { target *-*-* } .+2 } +// { dg-error "token .priv. is not allowed after .vis. fragment" "#359" { target *-*-* } .+3 } +// { dg-error "required first macro rule in macro rules definition could not be parsed" "" { target *-*-* } .+2 } macro_rules! my_mac { ($v:vis priv) => { $v struct Foo(i32); diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro49.rs b/gcc/testsuite/rust/compile/macros/mbe/macro49.rs index 9d63ff1..850cf44 100644 --- a/gcc/testsuite/rust/compile/macros/mbe/macro49.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro49.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro54.rs b/gcc/testsuite/rust/compile/macros/mbe/macro54.rs index d3b3f80..1cc4b3d 100644 --- a/gcc/testsuite/rust/compile/macros/mbe/macro54.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro54.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/multiple_bindings1.rs b/gcc/testsuite/rust/compile/multiple_bindings1.rs index 8a2e18c..c433a0d 100644 --- a/gcc/testsuite/rust/compile/multiple_bindings1.rs +++ b/gcc/testsuite/rust/compile/multiple_bindings1.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/name_resolution2.rs b/gcc/testsuite/rust/compile/name_resolution2.rs index 564c5d2..997bf55 100644 --- a/gcc/testsuite/rust/compile/name_resolution2.rs +++ b/gcc/testsuite/rust/compile/name_resolution2.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/name_resolution4.rs b/gcc/testsuite/rust/compile/name_resolution4.rs index 0fc72f6..2da1aae 100644 --- a/gcc/testsuite/rust/compile/name_resolution4.rs +++ b/gcc/testsuite/rust/compile/name_resolution4.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/nested_generic.rs b/gcc/testsuite/rust/compile/nested_generic.rs index 322b3c5..b7dae27 100644 --- a/gcc/testsuite/rust/compile/nested_generic.rs +++ b/gcc/testsuite/rust/compile/nested_generic.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/parse_associated_type_as_generic_arg.rs b/gcc/testsuite/rust/compile/parse_associated_type_as_generic_arg.rs index ba1042a..9190c40 100644 --- a/gcc/testsuite/rust/compile/parse_associated_type_as_generic_arg.rs +++ b/gcc/testsuite/rust/compile/parse_associated_type_as_generic_arg.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/parse_associated_type_as_generic_arg2.rs b/gcc/testsuite/rust/compile/parse_associated_type_as_generic_arg2.rs index a2662c2..c50823b 100644 --- a/gcc/testsuite/rust/compile/parse_associated_type_as_generic_arg2.rs +++ b/gcc/testsuite/rust/compile/parse_associated_type_as_generic_arg2.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/parse_associated_type_as_generic_arg3.rs b/gcc/testsuite/rust/compile/parse_associated_type_as_generic_arg3.rs index b4342e8..fa65b55 100644 --- a/gcc/testsuite/rust/compile/parse_associated_type_as_generic_arg3.rs +++ b/gcc/testsuite/rust/compile/parse_associated_type_as_generic_arg3.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/parse_closure_bind.rs b/gcc/testsuite/rust/compile/parse_closure_bind.rs index 1e08197..4513846 100644 --- a/gcc/testsuite/rust/compile/parse_closure_bind.rs +++ b/gcc/testsuite/rust/compile/parse_closure_bind.rs @@ -1,5 +1,6 @@ // { dg-additional-options "-frust-compile-until=typecheck" } // TODO: this should typecheck +#![feature(lang_items)] #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/compile/parse_complex_generic_application.rs b/gcc/testsuite/rust/compile/parse_complex_generic_application.rs index 02877dd..b678cb2 100644 --- a/gcc/testsuite/rust/compile/parse_complex_generic_application.rs +++ b/gcc/testsuite/rust/compile/parse_complex_generic_application.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/parse_complex_generic_application2.rs b/gcc/testsuite/rust/compile/parse_complex_generic_application2.rs index 5ebc94f..41ce21a 100644 --- a/gcc/testsuite/rust/compile/parse_complex_generic_application2.rs +++ b/gcc/testsuite/rust/compile/parse_complex_generic_application2.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/parse_invalid_specialization.rs b/gcc/testsuite/rust/compile/parse_invalid_specialization.rs index 1ce7384..68e2120 100644 --- a/gcc/testsuite/rust/compile/parse_invalid_specialization.rs +++ b/gcc/testsuite/rust/compile/parse_invalid_specialization.rs @@ -1,4 +1,3 @@ default fn f() { // { dg-error ".default. is only allowed on items within .impl. blocks" "" { target *-*-* } .-1 } - // { dg-error "failed to parse item in crate" "" { target *-*-* } .-2 } } diff --git a/gcc/testsuite/rust/compile/parse_simple_path_fail_1.rs b/gcc/testsuite/rust/compile/parse_simple_path_fail_1.rs index c112e40..1d52abb 100644 --- a/gcc/testsuite/rust/compile/parse_simple_path_fail_1.rs +++ b/gcc/testsuite/rust/compile/parse_simple_path_fail_1.rs @@ -1,3 +1,2 @@ pub(in crate::) struct S; // { dg-error "expecting ... but .::. found" "" { target *-*-* } .-1 } -// { dg-error "failed to parse item in crate" "" { target *-*-* } .-2 } diff --git a/gcc/testsuite/rust/compile/parse_simple_path_fail_2.rs b/gcc/testsuite/rust/compile/parse_simple_path_fail_2.rs index 94c49c3..1205f19 100644 --- a/gcc/testsuite/rust/compile/parse_simple_path_fail_2.rs +++ b/gcc/testsuite/rust/compile/parse_simple_path_fail_2.rs @@ -5,5 +5,3 @@ mod A { use A{B}; // { dg-error "unexpected token" "" { target *-*-* } .-1 } // { dg-error "could not parse use tree" "" { target *-*-* } .-2 } -// { dg-error "failed to parse item in crate" "" { target *-*-* } 10 } -// ^^^ TODO: should the above error happen at line 10? diff --git a/gcc/testsuite/rust/compile/path_as_generic_arg.rs b/gcc/testsuite/rust/compile/path_as_generic_arg.rs index 21baf80..aff4ce2 100644 --- a/gcc/testsuite/rust/compile/path_as_generic_arg.rs +++ b/gcc/testsuite/rust/compile/path_as_generic_arg.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/privacy4.rs b/gcc/testsuite/rust/compile/privacy4.rs index 7865f6a..5da43ff 100644 --- a/gcc/testsuite/rust/compile/privacy4.rs +++ b/gcc/testsuite/rust/compile/privacy4.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/privacy6.rs b/gcc/testsuite/rust/compile/privacy6.rs index e1e0fac..72d1a3b 100644 --- a/gcc/testsuite/rust/compile/privacy6.rs +++ b/gcc/testsuite/rust/compile/privacy6.rs @@ -1,5 +1,6 @@ // { dg-additional-options "-w" } +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/raw-byte-string-loc.rs b/gcc/testsuite/rust/compile/raw-byte-string-loc.rs index b71b6e5..6082118 100644 --- a/gcc/testsuite/rust/compile/raw-byte-string-loc.rs +++ b/gcc/testsuite/rust/compile/raw-byte-string-loc.rs @@ -3,4 +3,3 @@ const X: &'static u8 = br#"12 BREAK // { dg-error "unrecognised token" "" { target *-*-* } .-1 } -// { dg-error "failed to parse item" "" { target *-*-* } .-2 } diff --git a/gcc/testsuite/rust/compile/raw-string-loc.rs b/gcc/testsuite/rust/compile/raw-string-loc.rs index 26331ea..9e32790 100644 --- a/gcc/testsuite/rust/compile/raw-string-loc.rs +++ b/gcc/testsuite/rust/compile/raw-string-loc.rs @@ -3,4 +3,3 @@ const X: &'static str = r#"12 BREAK // { dg-error "unrecognised token" "" { target *-*-* } .-1 } -// { dg-error "failed to parse item" "" { target *-*-* } .-2 } diff --git a/gcc/testsuite/rust/compile/raw_ref_op_invalid.rs b/gcc/testsuite/rust/compile/raw_ref_op_invalid.rs index 90e169f..42ec63d 100644 --- a/gcc/testsuite/rust/compile/raw_ref_op_invalid.rs +++ b/gcc/testsuite/rust/compile/raw_ref_op_invalid.rs @@ -7,6 +7,4 @@ pub struct Toto { pub fn test(mut toto: Toto) { let _c = &raw toto.u; //{ dg-error "expecting .;. but .identifier. found" "" { target *-*-* } } - //{ dg-excess-errors "Additional errors for parent items" { target *-*-* } } - } diff --git a/gcc/testsuite/rust/compile/self_const_ptr.rs b/gcc/testsuite/rust/compile/self_const_ptr.rs index 014fe1b..51e339e 100644 --- a/gcc/testsuite/rust/compile/self_const_ptr.rs +++ b/gcc/testsuite/rust/compile/self_const_ptr.rs @@ -4,5 +4,4 @@ impl MyStruct { pub fn do_something(*const self) {} // { dg-error "cannot pass .self. by raw pointer" "" { target *-*-* } .-1 } // { dg-error "failed to parse inherent impl item in inherent impl" "" { target *-*-* } .-2 } - // { dg-error "failed to parse item in crate" "" { target *-*-* } .-3 } } diff --git a/gcc/testsuite/rust/compile/self_mut_ptr.rs b/gcc/testsuite/rust/compile/self_mut_ptr.rs index 2a127b7..c986ef6 100644 --- a/gcc/testsuite/rust/compile/self_mut_ptr.rs +++ b/gcc/testsuite/rust/compile/self_mut_ptr.rs @@ -4,5 +4,4 @@ impl MyStruct { pub fn do_something(*mut self) {} // { dg-error "cannot pass .self. by raw pointer" "" { target *-*-* } .-1 } // { dg-error "failed to parse inherent impl item in inherent impl" "" { target *-*-* } .-2 } - // { dg-error "failed to parse item in crate" "" { target *-*-* } .-3 } } diff --git a/gcc/testsuite/rust/compile/self_ptr.rs b/gcc/testsuite/rust/compile/self_ptr.rs index fd7ff6c..2b3128c 100644 --- a/gcc/testsuite/rust/compile/self_ptr.rs +++ b/gcc/testsuite/rust/compile/self_ptr.rs @@ -4,5 +4,4 @@ impl MyStruct { pub fn do_something(*self) {} // { dg-error "cannot pass .self. by raw pointer" "" { target *-*-* } .-1 } // { dg-error "failed to parse inherent impl item in inherent impl" "" { target *-*-* } .-2 } - // { dg-error "failed to parse item in crate" "" { target *-*-* } .-3 } } diff --git a/gcc/testsuite/rust/compile/silly-order-bug.rs b/gcc/testsuite/rust/compile/silly-order-bug.rs index 0d9cf1d..cdc8b2f 100644 --- a/gcc/testsuite/rust/compile/silly-order-bug.rs +++ b/gcc/testsuite/rust/compile/silly-order-bug.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/compile/sizeof-stray-infer-var-bug.rs b/gcc/testsuite/rust/compile/sizeof-stray-infer-var-bug.rs index c46a97d..7377a26 100644 --- a/gcc/testsuite/rust/compile/sizeof-stray-infer-var-bug.rs +++ b/gcc/testsuite/rust/compile/sizeof-stray-infer-var-bug.rs @@ -1,5 +1,6 @@ #![feature(intrinsics)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/static_var1.rs b/gcc/testsuite/rust/compile/static_var1.rs index b3b5751..fdd2876 100644 --- a/gcc/testsuite/rust/compile/static_var1.rs +++ b/gcc/testsuite/rust/compile/static_var1.rs @@ -1,5 +1,5 @@ static x = 3; // { dg-error "expecting ':' but '=' found" } -fn main() {// { dg-error "failed to parse item in crate" } +fn main() { let y = x +1; } diff --git a/gcc/testsuite/rust/compile/stmt_with_block_dot.rs b/gcc/testsuite/rust/compile/stmt_with_block_dot.rs index c7037af..5a3721e 100644 --- a/gcc/testsuite/rust/compile/stmt_with_block_dot.rs +++ b/gcc/testsuite/rust/compile/stmt_with_block_dot.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/structural-eq-peq.rs b/gcc/testsuite/rust/compile/structural-eq-peq.rs index d04c295..9bdc98d3d 100644 --- a/gcc/testsuite/rust/compile/structural-eq-peq.rs +++ b/gcc/testsuite/rust/compile/structural-eq-peq.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + #[lang = "structural_peq"] pub trait StructuralPartialEq { // Empty. diff --git a/gcc/testsuite/rust/compile/torture/associated_types1.rs b/gcc/testsuite/rust/compile/torture/associated_types1.rs index 2be7037..4fc76af 100644 --- a/gcc/testsuite/rust/compile/torture/associated_types1.rs +++ b/gcc/testsuite/rust/compile/torture/associated_types1.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/forward_decl_5.rs b/gcc/testsuite/rust/compile/torture/forward_decl_5.rs index 670ab0a..9d0660c 100644 --- a/gcc/testsuite/rust/compile/torture/forward_decl_5.rs +++ b/gcc/testsuite/rust/compile/torture/forward_decl_5.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/generics1.rs b/gcc/testsuite/rust/compile/torture/generics1.rs index b32eddd..1d4c0f2 100644 --- a/gcc/testsuite/rust/compile/torture/generics1.rs +++ b/gcc/testsuite/rust/compile/torture/generics1.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/generics10.rs b/gcc/testsuite/rust/compile/torture/generics10.rs index 1a17e84..af12d7d 100644 --- a/gcc/testsuite/rust/compile/torture/generics10.rs +++ b/gcc/testsuite/rust/compile/torture/generics10.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/generics11.rs b/gcc/testsuite/rust/compile/torture/generics11.rs index 9d5e719..0e2939f 100644 --- a/gcc/testsuite/rust/compile/torture/generics11.rs +++ b/gcc/testsuite/rust/compile/torture/generics11.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/generics12.rs b/gcc/testsuite/rust/compile/torture/generics12.rs index 9347b24..cf841dd 100644 --- a/gcc/testsuite/rust/compile/torture/generics12.rs +++ b/gcc/testsuite/rust/compile/torture/generics12.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/generics13.rs b/gcc/testsuite/rust/compile/torture/generics13.rs index 00b26ec..b83521f 100644 --- a/gcc/testsuite/rust/compile/torture/generics13.rs +++ b/gcc/testsuite/rust/compile/torture/generics13.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/generics14.rs b/gcc/testsuite/rust/compile/torture/generics14.rs index 5be39eb..bf5b2955 100644 --- a/gcc/testsuite/rust/compile/torture/generics14.rs +++ b/gcc/testsuite/rust/compile/torture/generics14.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/generics15.rs b/gcc/testsuite/rust/compile/torture/generics15.rs index 2b1f31c..ab65007 100644 --- a/gcc/testsuite/rust/compile/torture/generics15.rs +++ b/gcc/testsuite/rust/compile/torture/generics15.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/generics16.rs b/gcc/testsuite/rust/compile/torture/generics16.rs index a9fa2eb..0701c94 100644 --- a/gcc/testsuite/rust/compile/torture/generics16.rs +++ b/gcc/testsuite/rust/compile/torture/generics16.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/generics17.rs b/gcc/testsuite/rust/compile/torture/generics17.rs index 9a04158..a52de9b 100644 --- a/gcc/testsuite/rust/compile/torture/generics17.rs +++ b/gcc/testsuite/rust/compile/torture/generics17.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/generics18.rs b/gcc/testsuite/rust/compile/torture/generics18.rs index cb7b1fa..8a239f2 100644 --- a/gcc/testsuite/rust/compile/torture/generics18.rs +++ b/gcc/testsuite/rust/compile/torture/generics18.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/generics19.rs b/gcc/testsuite/rust/compile/torture/generics19.rs index c98599f..4b372b6 100644 --- a/gcc/testsuite/rust/compile/torture/generics19.rs +++ b/gcc/testsuite/rust/compile/torture/generics19.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/generics2.rs b/gcc/testsuite/rust/compile/torture/generics2.rs index e720b422..61fd574 100644 --- a/gcc/testsuite/rust/compile/torture/generics2.rs +++ b/gcc/testsuite/rust/compile/torture/generics2.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/generics20.rs b/gcc/testsuite/rust/compile/torture/generics20.rs index 92b022e..985189e 100644 --- a/gcc/testsuite/rust/compile/torture/generics20.rs +++ b/gcc/testsuite/rust/compile/torture/generics20.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/generics21.rs b/gcc/testsuite/rust/compile/torture/generics21.rs index 1c74ea4..2986e69 100644 --- a/gcc/testsuite/rust/compile/torture/generics21.rs +++ b/gcc/testsuite/rust/compile/torture/generics21.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/generics22.rs b/gcc/testsuite/rust/compile/torture/generics22.rs index b838e6e..b5c5f9a 100644 --- a/gcc/testsuite/rust/compile/torture/generics22.rs +++ b/gcc/testsuite/rust/compile/torture/generics22.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/generics23.rs b/gcc/testsuite/rust/compile/torture/generics23.rs index bf4dfb5..d0da16f 100644 --- a/gcc/testsuite/rust/compile/torture/generics23.rs +++ b/gcc/testsuite/rust/compile/torture/generics23.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/generics24.rs b/gcc/testsuite/rust/compile/torture/generics24.rs index ce782c0..8655ca5 100644 --- a/gcc/testsuite/rust/compile/torture/generics24.rs +++ b/gcc/testsuite/rust/compile/torture/generics24.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/generics25.rs b/gcc/testsuite/rust/compile/torture/generics25.rs index 4fe952a..a711e21 100644 --- a/gcc/testsuite/rust/compile/torture/generics25.rs +++ b/gcc/testsuite/rust/compile/torture/generics25.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/generics26.rs b/gcc/testsuite/rust/compile/torture/generics26.rs index 0111add..3a5dcac 100644 --- a/gcc/testsuite/rust/compile/torture/generics26.rs +++ b/gcc/testsuite/rust/compile/torture/generics26.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/generics27.rs b/gcc/testsuite/rust/compile/torture/generics27.rs index c4ca4db..db8fe76 100644 --- a/gcc/testsuite/rust/compile/torture/generics27.rs +++ b/gcc/testsuite/rust/compile/torture/generics27.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/generics28.rs b/gcc/testsuite/rust/compile/torture/generics28.rs index c1ffd9c..f815ef5 100644 --- a/gcc/testsuite/rust/compile/torture/generics28.rs +++ b/gcc/testsuite/rust/compile/torture/generics28.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/generics29.rs b/gcc/testsuite/rust/compile/torture/generics29.rs index baf53e4..4a35b3b 100644 --- a/gcc/testsuite/rust/compile/torture/generics29.rs +++ b/gcc/testsuite/rust/compile/torture/generics29.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/generics3.rs b/gcc/testsuite/rust/compile/torture/generics3.rs index 4c5dabc..ae12d00 100644 --- a/gcc/testsuite/rust/compile/torture/generics3.rs +++ b/gcc/testsuite/rust/compile/torture/generics3.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/generics30.rs b/gcc/testsuite/rust/compile/torture/generics30.rs index a84f140..f592e77 100644 --- a/gcc/testsuite/rust/compile/torture/generics30.rs +++ b/gcc/testsuite/rust/compile/torture/generics30.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/generics31.rs b/gcc/testsuite/rust/compile/torture/generics31.rs index f8e2f36..a393a4c 100644 --- a/gcc/testsuite/rust/compile/torture/generics31.rs +++ b/gcc/testsuite/rust/compile/torture/generics31.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/generics32.rs b/gcc/testsuite/rust/compile/torture/generics32.rs index 49c4539..f332a77 100644 --- a/gcc/testsuite/rust/compile/torture/generics32.rs +++ b/gcc/testsuite/rust/compile/torture/generics32.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/generics4.rs b/gcc/testsuite/rust/compile/torture/generics4.rs index 54bdf56..3d4875b 100644 --- a/gcc/testsuite/rust/compile/torture/generics4.rs +++ b/gcc/testsuite/rust/compile/torture/generics4.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/generics5.rs b/gcc/testsuite/rust/compile/torture/generics5.rs index df27fdd..3fcf13b 100644 --- a/gcc/testsuite/rust/compile/torture/generics5.rs +++ b/gcc/testsuite/rust/compile/torture/generics5.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/generics6.rs b/gcc/testsuite/rust/compile/torture/generics6.rs index 16b85fb..79d1ab8 100644 --- a/gcc/testsuite/rust/compile/torture/generics6.rs +++ b/gcc/testsuite/rust/compile/torture/generics6.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/generics7.rs b/gcc/testsuite/rust/compile/torture/generics7.rs index 66454d6..0eb1db1 100644 --- a/gcc/testsuite/rust/compile/torture/generics7.rs +++ b/gcc/testsuite/rust/compile/torture/generics7.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/generics8.rs b/gcc/testsuite/rust/compile/torture/generics8.rs index bc6d09b..b46b1a2 100644 --- a/gcc/testsuite/rust/compile/torture/generics8.rs +++ b/gcc/testsuite/rust/compile/torture/generics8.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/generics9.rs b/gcc/testsuite/rust/compile/torture/generics9.rs index 3d9d748..fa926ee 100644 --- a/gcc/testsuite/rust/compile/torture/generics9.rs +++ b/gcc/testsuite/rust/compile/torture/generics9.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/identifier-missing-impl-1.rs b/gcc/testsuite/rust/compile/torture/identifier-missing-impl-1.rs index 2389fa5..8a9b031 100644 --- a/gcc/testsuite/rust/compile/torture/identifier-missing-impl-1.rs +++ b/gcc/testsuite/rust/compile/torture/identifier-missing-impl-1.rs @@ -4,7 +4,6 @@ impl I { fn () { // { dg-error {expecting 'identifier' but '\(' found} "" { target *-*-* } .-1 } // { dg-error {failed to parse inherent impl item in inherent impl} "" { target *-*-* } .-2 } - // { dg-error {failed to parse item in crate} "" { target *-*-* } .-3 } } } diff --git a/gcc/testsuite/rust/compile/torture/intrinsics-2.rs b/gcc/testsuite/rust/compile/torture/intrinsics-2.rs index a6cd8f8..23151b1 100644 --- a/gcc/testsuite/rust/compile/torture/intrinsics-2.rs +++ b/gcc/testsuite/rust/compile/torture/intrinsics-2.rs @@ -2,6 +2,7 @@ #![feature(intrinsics)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/intrinsics-4.rs b/gcc/testsuite/rust/compile/torture/intrinsics-4.rs index 3d26e99..51fc3c1 100644 --- a/gcc/testsuite/rust/compile/torture/intrinsics-4.rs +++ b/gcc/testsuite/rust/compile/torture/intrinsics-4.rs @@ -1,5 +1,6 @@ #![feature(intrinsics)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/intrinsics-5.rs b/gcc/testsuite/rust/compile/torture/intrinsics-5.rs index 7a62cca..a015c2a 100644 --- a/gcc/testsuite/rust/compile/torture/intrinsics-5.rs +++ b/gcc/testsuite/rust/compile/torture/intrinsics-5.rs @@ -1,5 +1,6 @@ #![feature(intrinsics)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/intrinsics-6.rs b/gcc/testsuite/rust/compile/torture/intrinsics-6.rs index 0e26345..12821a0 100644 --- a/gcc/testsuite/rust/compile/torture/intrinsics-6.rs +++ b/gcc/testsuite/rust/compile/torture/intrinsics-6.rs @@ -1,5 +1,6 @@ #![feature(intrinsics)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/intrinsics-7.rs b/gcc/testsuite/rust/compile/torture/intrinsics-7.rs index 754aacb..6dc9187c 100644 --- a/gcc/testsuite/rust/compile/torture/intrinsics-7.rs +++ b/gcc/testsuite/rust/compile/torture/intrinsics-7.rs @@ -1,5 +1,6 @@ #![feature(intrinsics)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/intrinsics-8.rs b/gcc/testsuite/rust/compile/torture/intrinsics-8.rs index b9bd83c..22b1012 100644 --- a/gcc/testsuite/rust/compile/torture/intrinsics-8.rs +++ b/gcc/testsuite/rust/compile/torture/intrinsics-8.rs @@ -1,5 +1,6 @@ #![feature(intrinsics)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/issue-1024.rs b/gcc/testsuite/rust/compile/torture/issue-1024.rs index 819e329..c732565 100644 --- a/gcc/testsuite/rust/compile/torture/issue-1024.rs +++ b/gcc/testsuite/rust/compile/torture/issue-1024.rs @@ -1,5 +1,6 @@ #![feature(intrinsics)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/issue-1075.rs b/gcc/testsuite/rust/compile/torture/issue-1075.rs index d23774b..5584678 100644 --- a/gcc/testsuite/rust/compile/torture/issue-1075.rs +++ b/gcc/testsuite/rust/compile/torture/issue-1075.rs @@ -1,6 +1,7 @@ // { dg-additional-options "-w" } #![feature(intrinsics)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/issue-1432.rs b/gcc/testsuite/rust/compile/torture/issue-1432.rs index 5b526fd..df1b527 100644 --- a/gcc/testsuite/rust/compile/torture/issue-1432.rs +++ b/gcc/testsuite/rust/compile/torture/issue-1432.rs @@ -1,6 +1,7 @@ // { dg-additional-options "-w" } #![feature(intrinsics)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/issue-1555.rs b/gcc/testsuite/rust/compile/torture/issue-1555.rs index bee8952..b2f675a 100644 --- a/gcc/testsuite/rust/compile/torture/issue-1555.rs +++ b/gcc/testsuite/rust/compile/torture/issue-1555.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/issue-368.rs b/gcc/testsuite/rust/compile/torture/issue-368.rs index 775e70d..a657a7c 100644 --- a/gcc/testsuite/rust/compile/torture/issue-368.rs +++ b/gcc/testsuite/rust/compile/torture/issue-368.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/issue-808.rs b/gcc/testsuite/rust/compile/torture/issue-808.rs index 4186d54..f739d22 100644 --- a/gcc/testsuite/rust/compile/torture/issue-808.rs +++ b/gcc/testsuite/rust/compile/torture/issue-808.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/issue-862.rs b/gcc/testsuite/rust/compile/torture/issue-862.rs index d9ac912..88d6d65 100644 --- a/gcc/testsuite/rust/compile/torture/issue-862.rs +++ b/gcc/testsuite/rust/compile/torture/issue-862.rs @@ -1,5 +1,6 @@ // { dg-additional-options "-w" } +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/issue-893-2.rs b/gcc/testsuite/rust/compile/torture/issue-893-2.rs index 3df27b8..2e4ec14 100644 --- a/gcc/testsuite/rust/compile/torture/issue-893-2.rs +++ b/gcc/testsuite/rust/compile/torture/issue-893-2.rs @@ -1,4 +1,5 @@ // { dg-additional-options "-w" } +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/issue-893.rs b/gcc/testsuite/rust/compile/torture/issue-893.rs index f96b5c3..bd77c8d 100644 --- a/gcc/testsuite/rust/compile/torture/issue-893.rs +++ b/gcc/testsuite/rust/compile/torture/issue-893.rs @@ -1,4 +1,5 @@ // { dg-additional-options "-w" } +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/must_use2.rs b/gcc/testsuite/rust/compile/torture/must_use2.rs index cf6643e..9c9a1a7 100644 --- a/gcc/testsuite/rust/compile/torture/must_use2.rs +++ b/gcc/testsuite/rust/compile/torture/must_use2.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/nested_fn2.rs b/gcc/testsuite/rust/compile/torture/nested_fn2.rs index ad7a10b..57cee8a 100644 --- a/gcc/testsuite/rust/compile/torture/nested_fn2.rs +++ b/gcc/testsuite/rust/compile/torture/nested_fn2.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/phantom_data.rs b/gcc/testsuite/rust/compile/torture/phantom_data.rs index d6c5adc..a5b70a5 100644 --- a/gcc/testsuite/rust/compile/torture/phantom_data.rs +++ b/gcc/testsuite/rust/compile/torture/phantom_data.rs @@ -1,4 +1,5 @@ // { dg-options "-w" } +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/range-lang-item1.rs b/gcc/testsuite/rust/compile/torture/range-lang-item1.rs index 604fee8..db10f85 100644 --- a/gcc/testsuite/rust/compile/torture/range-lang-item1.rs +++ b/gcc/testsuite/rust/compile/torture/range-lang-item1.rs @@ -1,4 +1,5 @@ // { dg-additional-options "-w" } +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/traits1.rs b/gcc/testsuite/rust/compile/torture/traits1.rs index 8929501..6fe943c 100644 --- a/gcc/testsuite/rust/compile/torture/traits1.rs +++ b/gcc/testsuite/rust/compile/torture/traits1.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/traits10.rs b/gcc/testsuite/rust/compile/torture/traits10.rs index 4cf36e3..4710445 100644 --- a/gcc/testsuite/rust/compile/torture/traits10.rs +++ b/gcc/testsuite/rust/compile/torture/traits10.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/traits11.rs b/gcc/testsuite/rust/compile/torture/traits11.rs index 02383a5..1cab51f 100644 --- a/gcc/testsuite/rust/compile/torture/traits11.rs +++ b/gcc/testsuite/rust/compile/torture/traits11.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/traits12.rs b/gcc/testsuite/rust/compile/torture/traits12.rs index 8648022..3e340eb 100644 --- a/gcc/testsuite/rust/compile/torture/traits12.rs +++ b/gcc/testsuite/rust/compile/torture/traits12.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/traits13.rs b/gcc/testsuite/rust/compile/torture/traits13.rs index 5d9c819..ce70a28 100644 --- a/gcc/testsuite/rust/compile/torture/traits13.rs +++ b/gcc/testsuite/rust/compile/torture/traits13.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/traits14.rs b/gcc/testsuite/rust/compile/torture/traits14.rs index ab546a8..2996ecf 100644 --- a/gcc/testsuite/rust/compile/torture/traits14.rs +++ b/gcc/testsuite/rust/compile/torture/traits14.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/traits15.rs b/gcc/testsuite/rust/compile/torture/traits15.rs index c1863a8..c875577 100644 --- a/gcc/testsuite/rust/compile/torture/traits15.rs +++ b/gcc/testsuite/rust/compile/torture/traits15.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/traits16.rs b/gcc/testsuite/rust/compile/torture/traits16.rs index 8c8e682..7dc546c 100644 --- a/gcc/testsuite/rust/compile/torture/traits16.rs +++ b/gcc/testsuite/rust/compile/torture/traits16.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/traits17.rs b/gcc/testsuite/rust/compile/torture/traits17.rs index 268c2bd..9ee267e 100644 --- a/gcc/testsuite/rust/compile/torture/traits17.rs +++ b/gcc/testsuite/rust/compile/torture/traits17.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/traits18.rs b/gcc/testsuite/rust/compile/torture/traits18.rs index 512152e..bd32f70 100644 --- a/gcc/testsuite/rust/compile/torture/traits18.rs +++ b/gcc/testsuite/rust/compile/torture/traits18.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/traits19.rs b/gcc/testsuite/rust/compile/torture/traits19.rs index 4be898d..bd1a6e2 100644 --- a/gcc/testsuite/rust/compile/torture/traits19.rs +++ b/gcc/testsuite/rust/compile/torture/traits19.rs @@ -1,4 +1,5 @@ // { dg-additional-options "-w" } +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/traits2.rs b/gcc/testsuite/rust/compile/torture/traits2.rs index a9dca94..f0a33d9 100644 --- a/gcc/testsuite/rust/compile/torture/traits2.rs +++ b/gcc/testsuite/rust/compile/torture/traits2.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/traits3.rs b/gcc/testsuite/rust/compile/torture/traits3.rs index dad6dda..d06a68f 100644 --- a/gcc/testsuite/rust/compile/torture/traits3.rs +++ b/gcc/testsuite/rust/compile/torture/traits3.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/traits4.rs b/gcc/testsuite/rust/compile/torture/traits4.rs index 49c4db2..716d657 100644 --- a/gcc/testsuite/rust/compile/torture/traits4.rs +++ b/gcc/testsuite/rust/compile/torture/traits4.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/traits5.rs b/gcc/testsuite/rust/compile/torture/traits5.rs index c60a259..86e83e5 100644 --- a/gcc/testsuite/rust/compile/torture/traits5.rs +++ b/gcc/testsuite/rust/compile/torture/traits5.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/traits6.rs b/gcc/testsuite/rust/compile/torture/traits6.rs index f117353..f1c4e84 100644 --- a/gcc/testsuite/rust/compile/torture/traits6.rs +++ b/gcc/testsuite/rust/compile/torture/traits6.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/traits7.rs b/gcc/testsuite/rust/compile/torture/traits7.rs index 545fd39..928dd62 100644 --- a/gcc/testsuite/rust/compile/torture/traits7.rs +++ b/gcc/testsuite/rust/compile/torture/traits7.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/traits8.rs b/gcc/testsuite/rust/compile/torture/traits8.rs index cc0875b..f2515e8 100644 --- a/gcc/testsuite/rust/compile/torture/traits8.rs +++ b/gcc/testsuite/rust/compile/torture/traits8.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/traits9.rs b/gcc/testsuite/rust/compile/torture/traits9.rs index 3a7c37f..8015a35 100644 --- a/gcc/testsuite/rust/compile/torture/traits9.rs +++ b/gcc/testsuite/rust/compile/torture/traits9.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/transmute-size-check-1.rs b/gcc/testsuite/rust/compile/torture/transmute-size-check-1.rs index 7b98779..4de1843 100644 --- a/gcc/testsuite/rust/compile/torture/transmute-size-check-1.rs +++ b/gcc/testsuite/rust/compile/torture/transmute-size-check-1.rs @@ -1,5 +1,6 @@ #![feature(intrinsics)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/transmute1.rs b/gcc/testsuite/rust/compile/torture/transmute1.rs index be9fb1d..fc1d94a 100644 --- a/gcc/testsuite/rust/compile/torture/transmute1.rs +++ b/gcc/testsuite/rust/compile/torture/transmute1.rs @@ -1,5 +1,6 @@ #![feature(intrinsics)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/uninit-intrinsic-1.rs b/gcc/testsuite/rust/compile/torture/uninit-intrinsic-1.rs index af1cb54..50083e5 100644 --- a/gcc/testsuite/rust/compile/torture/uninit-intrinsic-1.rs +++ b/gcc/testsuite/rust/compile/torture/uninit-intrinsic-1.rs @@ -1,5 +1,6 @@ #![feature(intrinsics)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/utf8_identifiers.rs b/gcc/testsuite/rust/compile/torture/utf8_identifiers.rs index 696fcc0..f7d6b37 100644 --- a/gcc/testsuite/rust/compile/torture/utf8_identifiers.rs +++ b/gcc/testsuite/rust/compile/torture/utf8_identifiers.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/traits1.rs b/gcc/testsuite/rust/compile/traits1.rs index 779662c..d67a6cd 100644 --- a/gcc/testsuite/rust/compile/traits1.rs +++ b/gcc/testsuite/rust/compile/traits1.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/traits10.rs b/gcc/testsuite/rust/compile/traits10.rs index da6c155..5e6e7e2 100644 --- a/gcc/testsuite/rust/compile/traits10.rs +++ b/gcc/testsuite/rust/compile/traits10.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/traits11.rs b/gcc/testsuite/rust/compile/traits11.rs index ac8ccdf..6aa860b 100644 --- a/gcc/testsuite/rust/compile/traits11.rs +++ b/gcc/testsuite/rust/compile/traits11.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/traits12.rs b/gcc/testsuite/rust/compile/traits12.rs index b194e07..99f10a2 100644 --- a/gcc/testsuite/rust/compile/traits12.rs +++ b/gcc/testsuite/rust/compile/traits12.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/traits2.rs b/gcc/testsuite/rust/compile/traits2.rs index a76f4c0..857ab28 100644 --- a/gcc/testsuite/rust/compile/traits2.rs +++ b/gcc/testsuite/rust/compile/traits2.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/traits3.rs b/gcc/testsuite/rust/compile/traits3.rs index 119132f..c4e3185 100644 --- a/gcc/testsuite/rust/compile/traits3.rs +++ b/gcc/testsuite/rust/compile/traits3.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/traits4.rs b/gcc/testsuite/rust/compile/traits4.rs index 4388b5e..11a0c78 100644 --- a/gcc/testsuite/rust/compile/traits4.rs +++ b/gcc/testsuite/rust/compile/traits4.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/traits5.rs b/gcc/testsuite/rust/compile/traits5.rs index 4e9dcc1..5bb6793 100644 --- a/gcc/testsuite/rust/compile/traits5.rs +++ b/gcc/testsuite/rust/compile/traits5.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/traits6.rs b/gcc/testsuite/rust/compile/traits6.rs index d081dd1..b4922cc 100644 --- a/gcc/testsuite/rust/compile/traits6.rs +++ b/gcc/testsuite/rust/compile/traits6.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/traits7.rs b/gcc/testsuite/rust/compile/traits7.rs index 68f3f38..62e197e 100644 --- a/gcc/testsuite/rust/compile/traits7.rs +++ b/gcc/testsuite/rust/compile/traits7.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/traits8.rs b/gcc/testsuite/rust/compile/traits8.rs index ccba9fa..117ba54 100644 --- a/gcc/testsuite/rust/compile/traits8.rs +++ b/gcc/testsuite/rust/compile/traits8.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/traits9.rs b/gcc/testsuite/rust/compile/traits9.rs index f4308e8..3341244 100644 --- a/gcc/testsuite/rust/compile/traits9.rs +++ b/gcc/testsuite/rust/compile/traits9.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/try-expr1.rs b/gcc/testsuite/rust/compile/try-expr1.rs index f1a7865..f6e460e 100644 --- a/gcc/testsuite/rust/compile/try-expr1.rs +++ b/gcc/testsuite/rust/compile/try-expr1.rs @@ -1,4 +1,5 @@ // { dg-additional-options "-frust-compile-until=typecheck" } +#![feature(lang_items)] #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/compile/try-trait.rs b/gcc/testsuite/rust/compile/try-trait.rs index 9ec135d..3c0a88c 100644 --- a/gcc/testsuite/rust/compile/try-trait.rs +++ b/gcc/testsuite/rust/compile/try-trait.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/compile/try_block1.rs b/gcc/testsuite/rust/compile/try_block1.rs index 7ae0536..9ace029 100644 --- a/gcc/testsuite/rust/compile/try_block1.rs +++ b/gcc/testsuite/rust/compile/try_block1.rs @@ -1,4 +1,5 @@ // { dg-additional-options "-frust-edition=2018" } +#![feature(lang_items)] #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/compile/type-bindings1.rs b/gcc/testsuite/rust/compile/type-bindings1.rs index ef0b471..fabb487 100644 --- a/gcc/testsuite/rust/compile/type-bindings1.rs +++ b/gcc/testsuite/rust/compile/type-bindings1.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/unconstrained_type_param.rs b/gcc/testsuite/rust/compile/unconstrained_type_param.rs index 60554da..dccfc9e 100644 --- a/gcc/testsuite/rust/compile/unconstrained_type_param.rs +++ b/gcc/testsuite/rust/compile/unconstrained_type_param.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/unify-errors1.rs b/gcc/testsuite/rust/compile/unify-errors1.rs index 0fe95ef..e101059 100644 --- a/gcc/testsuite/rust/compile/unify-errors1.rs +++ b/gcc/testsuite/rust/compile/unify-errors1.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/compile/unsafe10.rs b/gcc/testsuite/rust/compile/unsafe10.rs index 5861c15..12c0483 100644 --- a/gcc/testsuite/rust/compile/unsafe10.rs +++ b/gcc/testsuite/rust/compile/unsafe10.rs @@ -1,5 +1,6 @@ #![feature(intrinsics)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/v0-mangle1.rs b/gcc/testsuite/rust/compile/v0-mangle1.rs index 04c546e..b4a8c13 100644 --- a/gcc/testsuite/rust/compile/v0-mangle1.rs +++ b/gcc/testsuite/rust/compile/v0-mangle1.rs @@ -1,4 +1,5 @@ // { dg-additional-options -frust-mangling=v0 } +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/v0-mangle2.rs b/gcc/testsuite/rust/compile/v0-mangle2.rs index d092dcc..4378dd8 100644 --- a/gcc/testsuite/rust/compile/v0-mangle2.rs +++ b/gcc/testsuite/rust/compile/v0-mangle2.rs @@ -1,4 +1,5 @@ // { dg-additional-options -frust-mangling=v0 } +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/while_let1.rs b/gcc/testsuite/rust/compile/while_let1.rs index a3fa305..03d84df 100644 --- a/gcc/testsuite/rust/compile/while_let1.rs +++ b/gcc/testsuite/rust/compile/while_let1.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + // use self::Ordering::*; // use Ordering::*; diff --git a/gcc/testsuite/rust/core/core.exp b/gcc/testsuite/rust/core/core.exp index 330c6d5..45bdbb5 100644 --- a/gcc/testsuite/rust/core/core.exp +++ b/gcc/testsuite/rust/core/core.exp @@ -30,7 +30,7 @@ set saved-dg-do-what-default ${dg-do-what-default} set dg-do-what-default "compile" set individual_timeout 600 dg-additional-files [lsort [glob -nocomplain $srcdir/../../libgrust/rustc-lib/*]] -dg-runtest $srcdir/../../libgrust/rustc-lib/core/src/lib.rs "-frust-edition=2018 -frust-crate=core -frust-compile-until=astvalidation -w" "" +dg-runtest $srcdir/../../libgrust/rustc-lib/core/src/lib.rs "-frust-edition=2018 -frust-crate=core -frust-compile-until=nameresolution -w" "" set dg-do-what-default ${saved-dg-do-what-default} # All done. diff --git a/gcc/testsuite/rust/execute/black_box.rs b/gcc/testsuite/rust/execute/black_box.rs index 58d10a3..8fa2cce 100644 --- a/gcc/testsuite/rust/execute/black_box.rs +++ b/gcc/testsuite/rust/execute/black_box.rs @@ -1,5 +1,5 @@ /* { dg-output "Value is: 42\r*\n" } */ -#![feature(rustc_attrs)] +#![feature(rustc_attrs, lang_items)] extern "C" { fn printf(s: *const i8, ...); diff --git a/gcc/testsuite/rust/execute/torture/atomic_load.rs b/gcc/testsuite/rust/execute/torture/atomic_load.rs index 11da848..c272700 100644 --- a/gcc/testsuite/rust/execute/torture/atomic_load.rs +++ b/gcc/testsuite/rust/execute/torture/atomic_load.rs @@ -1,5 +1,6 @@ #![feature(intrinsics)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/atomic_store.rs b/gcc/testsuite/rust/execute/torture/atomic_store.rs index 1b46678..acf7c64c 100644 --- a/gcc/testsuite/rust/execute/torture/atomic_store.rs +++ b/gcc/testsuite/rust/execute/torture/atomic_store.rs @@ -1,5 +1,6 @@ #![feature(intrinsics)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/basic_partial_ord1.rs b/gcc/testsuite/rust/execute/torture/basic_partial_ord1.rs index 0431629..d51c95d 100644 --- a/gcc/testsuite/rust/execute/torture/basic_partial_ord1.rs +++ b/gcc/testsuite/rust/execute/torture/basic_partial_ord1.rs @@ -1,4 +1,6 @@ /* { dg-output "less\r*" }*/ +#![feature(lang_items)] + mod core { mod option { pub enum Option<T> { diff --git a/gcc/testsuite/rust/execute/torture/basic_partial_ord2.rs b/gcc/testsuite/rust/execute/torture/basic_partial_ord2.rs index b6a9695..86c26df 100644 --- a/gcc/testsuite/rust/execute/torture/basic_partial_ord2.rs +++ b/gcc/testsuite/rust/execute/torture/basic_partial_ord2.rs @@ -1,5 +1,7 @@ /* { dg-output "<><=>=\r*" } */ /* { dg-options "-w" } */ +#![feature(lang_items)] + mod core { mod option { pub enum Option<T> { diff --git a/gcc/testsuite/rust/execute/torture/builtin_macro_option_env.rs b/gcc/testsuite/rust/execute/torture/builtin_macro_option_env.rs index 56fbeaa..708c2aa 100644 --- a/gcc/testsuite/rust/execute/torture/builtin_macro_option_env.rs +++ b/gcc/testsuite/rust/execute/torture/builtin_macro_option_env.rs @@ -1,7 +1,7 @@ // { dg-output "VALUE\r*\nVALUE\r*\n" } // { dg-set-compiler-env-var ENV_MACRO_TEST "VALUE" } -#![feature(rustc_attrs)] +#![feature(rustc_attrs, lang_items)] #[rustc_builtin_macro] macro_rules! option_env { diff --git a/gcc/testsuite/rust/execute/torture/closure1.rs b/gcc/testsuite/rust/execute/torture/closure1.rs index e956413..1a5e498 100644 --- a/gcc/testsuite/rust/execute/torture/closure1.rs +++ b/gcc/testsuite/rust/execute/torture/closure1.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/closure2.rs b/gcc/testsuite/rust/execute/torture/closure2.rs index deca784..06f385f 100644 --- a/gcc/testsuite/rust/execute/torture/closure2.rs +++ b/gcc/testsuite/rust/execute/torture/closure2.rs @@ -1,4 +1,6 @@ // { dg-output "3\r*\n" } +#![feature(lang_items)] + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/execute/torture/closure3.rs b/gcc/testsuite/rust/execute/torture/closure3.rs index 98ec261..e9c6244 100644 --- a/gcc/testsuite/rust/execute/torture/closure3.rs +++ b/gcc/testsuite/rust/execute/torture/closure3.rs @@ -1,4 +1,6 @@ // { dg-output "3\r*\n" } +#![feature(lang_items)] + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/execute/torture/closure4.rs b/gcc/testsuite/rust/execute/torture/closure4.rs index 0701776..3f845dc 100644 --- a/gcc/testsuite/rust/execute/torture/closure4.rs +++ b/gcc/testsuite/rust/execute/torture/closure4.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/coercion1.rs b/gcc/testsuite/rust/execute/torture/coercion1.rs index 335f496..e6511b9 100644 --- a/gcc/testsuite/rust/execute/torture/coercion1.rs +++ b/gcc/testsuite/rust/execute/torture/coercion1.rs @@ -1,4 +1,6 @@ /* { dg-output "123\r*\n123\r*\n" } */ +#![feature(lang_items)] + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/execute/torture/coercion2.rs b/gcc/testsuite/rust/execute/torture/coercion2.rs index 6be8602..cf316e4 100644 --- a/gcc/testsuite/rust/execute/torture/coercion2.rs +++ b/gcc/testsuite/rust/execute/torture/coercion2.rs @@ -1,4 +1,6 @@ /* { dg-output "123\r*\n123\r*\n" } */ +#![feature(lang_items)] + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/execute/torture/coercion3.rs b/gcc/testsuite/rust/execute/torture/coercion3.rs index 0686056..a870bea 100644 --- a/gcc/testsuite/rust/execute/torture/coercion3.rs +++ b/gcc/testsuite/rust/execute/torture/coercion3.rs @@ -1,4 +1,5 @@ // { dg-output "123\r*\n" } +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/const-generics-1.rs b/gcc/testsuite/rust/execute/torture/const-generics-1.rs index dbb7afe..3ad1b3b 100644 --- a/gcc/testsuite/rust/execute/torture/const-generics-1.rs +++ b/gcc/testsuite/rust/execute/torture/const-generics-1.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/const-generics-2.rs b/gcc/testsuite/rust/execute/torture/const-generics-2.rs new file mode 100644 index 0000000..6ed5535 --- /dev/null +++ b/gcc/testsuite/rust/execute/torture/const-generics-2.rs @@ -0,0 +1,22 @@ +#![feature(lang_items)] + +#[lang = "sized"] +trait Sized {} + +trait Magic { + fn magic(&self) -> usize; +} + +struct Foo<const N: usize>; + +impl<const N: usize> Magic for Foo<N> { + fn magic(&self) -> usize { + N + } +} + +fn main() -> i32 { + let f = Foo::<7> {}; + let n = f.magic(); + n as i32 - 7 +} diff --git a/gcc/testsuite/rust/execute/torture/const-generics-3.rs b/gcc/testsuite/rust/execute/torture/const-generics-3.rs new file mode 100644 index 0000000..289b865 --- /dev/null +++ b/gcc/testsuite/rust/execute/torture/const-generics-3.rs @@ -0,0 +1,14 @@ +#![feature(lang_items)] +#[lang = "sized"] +pub trait Sized {} + +fn simd_shuffle<const N: usize>(idx: [u32; N]) -> [u32; N] { + idx +} + +fn main() -> i32 { + let a = [1u32, 2, 3, 4]; + let out = simd_shuffle(a); + let _check: [u32; 4] = out; + 0 +} diff --git a/gcc/testsuite/rust/execute/torture/const-generics-4.rs b/gcc/testsuite/rust/execute/torture/const-generics-4.rs new file mode 100644 index 0000000..9104f24 --- /dev/null +++ b/gcc/testsuite/rust/execute/torture/const-generics-4.rs @@ -0,0 +1,44 @@ +#![feature(lang_items)] +#[lang = "sized"] +trait Sized {} + +#[allow(unused)] +macro_rules! simd_shuffle { + ($x:expr, $y:expr, $idx:expr $(,)?) => {{ + simd_shuffle( + $x, + $y, + const { + let v: [u32; _] = $idx; + v + }, + ) + }}; +} + +const fn simd_shuffle(_a: [u32; 4], _b: [u32; 4], idx: [u32; 4]) -> [u32; 4] { + idx +} + +fn main() -> i32 { + let a = [1, 2, 3, 4]; + let b = [5, 6, 7, 8]; + let indices = [3, 2, 1, 0]; + + let result: [u32; 4] = simd_shuffle!(a, b, indices); + + if result[0] != 3 { + return 1; + } + if result[1] != 2 { + return 2; + } + if result[2] != 1 { + return 3; + } + if result[3] != 0 { + return 4; + } + + 0 +} diff --git a/gcc/testsuite/rust/execute/torture/const-generics-5.rs b/gcc/testsuite/rust/execute/torture/const-generics-5.rs new file mode 100644 index 0000000..91006ed --- /dev/null +++ b/gcc/testsuite/rust/execute/torture/const-generics-5.rs @@ -0,0 +1,15 @@ +#![feature(lang_items)] + +#[lang = "sized"] +trait Sized {} + +struct Foo<const N: usize>; + +impl<const N: usize> Foo<N> { + const VALUE: usize = N; +} + +fn main() -> i32 { + let val = Foo::<7>::VALUE; + val as i32 - 7 +} diff --git a/gcc/testsuite/rust/execute/torture/const-generics-6.rs b/gcc/testsuite/rust/execute/torture/const-generics-6.rs new file mode 100644 index 0000000..0aa7fae --- /dev/null +++ b/gcc/testsuite/rust/execute/torture/const-generics-6.rs @@ -0,0 +1,17 @@ +#![feature(lang_items)] + +#[lang = "sized"] +trait Sized {} + +struct Foo<const N: usize>; + +impl<const N: usize> Foo<N> { + const VALUE: usize = N; + const SQUARE: usize = N * N; +} + +fn main() -> i32 { + let a = Foo::<5>::VALUE; // 5 + let b = Foo::<5>::SQUARE; // 25 + (a + b) as i32 - 30 +} diff --git a/gcc/testsuite/rust/execute/torture/const-generics-7.rs b/gcc/testsuite/rust/execute/torture/const-generics-7.rs new file mode 100644 index 0000000..c75d897 --- /dev/null +++ b/gcc/testsuite/rust/execute/torture/const-generics-7.rs @@ -0,0 +1,23 @@ +#![feature(intrinsics)] + +#![feature(lang_items)] +#[lang = "sized"] +pub trait Sized {} + +mod mem { + extern "rust-intrinsic" { + #[rustc_const_stable(feature = "const_size_of", since = "1.40.0")] + pub fn size_of<T>() -> usize; + } +} + +struct Foo<T>; + +impl<T> Foo<T> { + const MAGIC: usize = mem::size_of::<T>(); +} + +fn main() -> i32 { + let sz = Foo::<u16>::MAGIC; + sz as i32 - 2 +} diff --git a/gcc/testsuite/rust/execute/torture/copy_nonoverlapping1.rs b/gcc/testsuite/rust/execute/torture/copy_nonoverlapping1.rs index 15bb811..662f813 100644 --- a/gcc/testsuite/rust/execute/torture/copy_nonoverlapping1.rs +++ b/gcc/testsuite/rust/execute/torture/copy_nonoverlapping1.rs @@ -1,4 +1,5 @@ #![feature(intrinsics)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/derive-default1.rs b/gcc/testsuite/rust/execute/torture/derive-default1.rs index 4bcafa0..775f5be 100644 --- a/gcc/testsuite/rust/execute/torture/derive-default1.rs +++ b/gcc/testsuite/rust/execute/torture/derive-default1.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + #[derive(Default)] struct Foo { a: i32 } #[derive(Default)] diff --git a/gcc/testsuite/rust/execute/torture/derive-partialeq1.rs b/gcc/testsuite/rust/execute/torture/derive-partialeq1.rs index 67b2773..442ee67 100644 --- a/gcc/testsuite/rust/execute/torture/derive-partialeq1.rs +++ b/gcc/testsuite/rust/execute/torture/derive-partialeq1.rs @@ -1,6 +1,6 @@ // { dg-output "true\r*\nfalse\r*\nfalse\r*\n" } -#![feature(intrinsics)] +#![feature(intrinsics, lang_items)] #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/derive-partialeq2.rs b/gcc/testsuite/rust/execute/torture/derive-partialeq2.rs index e316017..1f4c374 100644 --- a/gcc/testsuite/rust/execute/torture/derive-partialeq2.rs +++ b/gcc/testsuite/rust/execute/torture/derive-partialeq2.rs @@ -1,6 +1,6 @@ // { dg-output "true\r*\nfalse\r*\nfalse\r*\nfalse\r*\nfalse\r*\n" } -#![feature(intrinsics)] +#![feature(intrinsics, lang_items)] pub mod core { pub mod intrinsics { diff --git a/gcc/testsuite/rust/execute/torture/derive_clone_enum1.rs b/gcc/testsuite/rust/execute/torture/derive_clone_enum1.rs index 542ecd8..28a120f 100644 --- a/gcc/testsuite/rust/execute/torture/derive_clone_enum1.rs +++ b/gcc/testsuite/rust/execute/torture/derive_clone_enum1.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + #[lang = "clone"] trait Clone { pub fn clone(&self) -> Self; diff --git a/gcc/testsuite/rust/execute/torture/derive_macro1.rs b/gcc/testsuite/rust/execute/torture/derive_macro1.rs index 22cfaaa..780a30f 100644 --- a/gcc/testsuite/rust/execute/torture/derive_macro1.rs +++ b/gcc/testsuite/rust/execute/torture/derive_macro1.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/derive_macro3.rs b/gcc/testsuite/rust/execute/torture/derive_macro3.rs index 4138a5b..e8fe94c 100644 --- a/gcc/testsuite/rust/execute/torture/derive_macro3.rs +++ b/gcc/testsuite/rust/execute/torture/derive_macro3.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/derive_macro4.rs b/gcc/testsuite/rust/execute/torture/derive_macro4.rs index 38c4808..adeeb8d 100644 --- a/gcc/testsuite/rust/execute/torture/derive_macro4.rs +++ b/gcc/testsuite/rust/execute/torture/derive_macro4.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/enum_intrinsics1.rs b/gcc/testsuite/rust/execute/torture/enum_intrinsics1.rs index c30bbd3..66011b5 100644 --- a/gcc/testsuite/rust/execute/torture/enum_intrinsics1.rs +++ b/gcc/testsuite/rust/execute/torture/enum_intrinsics1.rs @@ -1,6 +1,7 @@ /* { dg-output "0\r*\n2\r*\n" } */ #![feature(intrinsics)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/enum_intrinsics2.rs b/gcc/testsuite/rust/execute/torture/enum_intrinsics2.rs index c1bae35..5f7d5ff 100644 --- a/gcc/testsuite/rust/execute/torture/enum_intrinsics2.rs +++ b/gcc/testsuite/rust/execute/torture/enum_intrinsics2.rs @@ -1,5 +1,6 @@ #![feature(intrinsics)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/for-loop1.rs b/gcc/testsuite/rust/execute/torture/for-loop1.rs index 3342189..e48a4b1 100644 --- a/gcc/testsuite/rust/execute/torture/for-loop1.rs +++ b/gcc/testsuite/rust/execute/torture/for-loop1.rs @@ -1,5 +1,5 @@ // { dg-output "loop\r*\nloop\r*\n" } -#![feature(intrinsics)] +#![feature(intrinsics, lang_items)] pub use option::Option::{self, None, Some}; pub use result::Result::{self, Err, Ok}; diff --git a/gcc/testsuite/rust/execute/torture/for-loop2.rs b/gcc/testsuite/rust/execute/torture/for-loop2.rs index 4f5dfe1..022e951 100644 --- a/gcc/testsuite/rust/execute/torture/for-loop2.rs +++ b/gcc/testsuite/rust/execute/torture/for-loop2.rs @@ -1,5 +1,5 @@ // { dg-output "loop1\r*\nloop2\r*\n" } -#![feature(intrinsics)] +#![feature(intrinsics, lang_items)] pub use option::Option::{self, None, Some}; pub use result::Result::{self, Err, Ok}; diff --git a/gcc/testsuite/rust/execute/torture/gat1.rs b/gcc/testsuite/rust/execute/torture/gat1.rs new file mode 100644 index 0000000..9a60986 --- /dev/null +++ b/gcc/testsuite/rust/execute/torture/gat1.rs @@ -0,0 +1,20 @@ +#![feature(lang_items)] + +#[lang = "sized"] +trait Sized {} + +pub struct MyBuf; + +trait Foo { + type Bar<T>: Sized; +} + +impl Foo for MyBuf { + type Bar<T> = T; +} + +type A = <MyBuf as Foo>::Bar<u32>; +fn main() -> i32 { + let a: A = 1; + a as i32 - 1 +} diff --git a/gcc/testsuite/rust/execute/torture/impl_desugar-2.rs b/gcc/testsuite/rust/execute/torture/impl_desugar-2.rs index c73ea34..d1d63ce 100644 --- a/gcc/testsuite/rust/execute/torture/impl_desugar-2.rs +++ b/gcc/testsuite/rust/execute/torture/impl_desugar-2.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/impl_desugar.rs b/gcc/testsuite/rust/execute/torture/impl_desugar.rs index 22d3951..77309de 100644 --- a/gcc/testsuite/rust/execute/torture/impl_desugar.rs +++ b/gcc/testsuite/rust/execute/torture/impl_desugar.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/impl_rpit1.rs b/gcc/testsuite/rust/execute/torture/impl_rpit1.rs index 8ce5f21..9de4dff 100644 --- a/gcc/testsuite/rust/execute/torture/impl_rpit1.rs +++ b/gcc/testsuite/rust/execute/torture/impl_rpit1.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/impl_rpit2.rs b/gcc/testsuite/rust/execute/torture/impl_rpit2.rs index f7cbbb6..0f2e7e0 100644 --- a/gcc/testsuite/rust/execute/torture/impl_rpit2.rs +++ b/gcc/testsuite/rust/execute/torture/impl_rpit2.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/impl_rpit3.rs b/gcc/testsuite/rust/execute/torture/impl_rpit3.rs index dd68eb2..ec55f6a 100644 --- a/gcc/testsuite/rust/execute/torture/impl_rpit3.rs +++ b/gcc/testsuite/rust/execute/torture/impl_rpit3.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/impl_trait1.rs b/gcc/testsuite/rust/execute/torture/impl_trait1.rs index 33a5c8c..e578ed8 100644 --- a/gcc/testsuite/rust/execute/torture/impl_trait1.rs +++ b/gcc/testsuite/rust/execute/torture/impl_trait1.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/impl_trait2.rs b/gcc/testsuite/rust/execute/torture/impl_trait2.rs index 29f393d..d13765e 100644 --- a/gcc/testsuite/rust/execute/torture/impl_trait2.rs +++ b/gcc/testsuite/rust/execute/torture/impl_trait2.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/impl_trait3.rs b/gcc/testsuite/rust/execute/torture/impl_trait3.rs index c1cec07..588b11d 100644 --- a/gcc/testsuite/rust/execute/torture/impl_trait3.rs +++ b/gcc/testsuite/rust/execute/torture/impl_trait3.rs @@ -1,4 +1,5 @@ /* { dg-output "Hello from Message\r*\n" } */ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/impl_trait4.rs b/gcc/testsuite/rust/execute/torture/impl_trait4.rs index 67d0095..e054949 100644 --- a/gcc/testsuite/rust/execute/torture/impl_trait4.rs +++ b/gcc/testsuite/rust/execute/torture/impl_trait4.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/index1.rs b/gcc/testsuite/rust/execute/torture/index1.rs index 19e58e3..1071b35 100644 --- a/gcc/testsuite/rust/execute/torture/index1.rs +++ b/gcc/testsuite/rust/execute/torture/index1.rs @@ -1,4 +1,5 @@ // { dg-additional-options "-w" } +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/issue-1120.rs b/gcc/testsuite/rust/execute/torture/issue-1120.rs index 7dfa26f..d7ef483 100644 --- a/gcc/testsuite/rust/execute/torture/issue-1120.rs +++ b/gcc/testsuite/rust/execute/torture/issue-1120.rs @@ -1,6 +1,7 @@ // { dg-additional-options "-w" } #![feature(intrinsics)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/issue-1133.rs b/gcc/testsuite/rust/execute/torture/issue-1133.rs index 29f532e..788b0ea 100644 --- a/gcc/testsuite/rust/execute/torture/issue-1133.rs +++ b/gcc/testsuite/rust/execute/torture/issue-1133.rs @@ -1,6 +1,7 @@ // { dg-additional-options "-w" } #![feature(intrinsics)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/issue-1198.rs b/gcc/testsuite/rust/execute/torture/issue-1198.rs index d5c3d89..d50faba 100644 --- a/gcc/testsuite/rust/execute/torture/issue-1198.rs +++ b/gcc/testsuite/rust/execute/torture/issue-1198.rs @@ -1,4 +1,6 @@ /* { dg-output "foo_deref\r*\nimm_deref\r*\n123\r*\n" } */ +#![feature(lang_items)] + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/execute/torture/issue-1232.rs b/gcc/testsuite/rust/execute/torture/issue-1232.rs index 6fb42b3..d0db0ee 100644 --- a/gcc/testsuite/rust/execute/torture/issue-1232.rs +++ b/gcc/testsuite/rust/execute/torture/issue-1232.rs @@ -2,6 +2,7 @@ // { dg-output "slice_access=3\r*\n" } #![feature(intrinsics)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/issue-1249.rs b/gcc/testsuite/rust/execute/torture/issue-1249.rs index e7a261c..548600a 100644 --- a/gcc/testsuite/rust/execute/torture/issue-1249.rs +++ b/gcc/testsuite/rust/execute/torture/issue-1249.rs @@ -1,6 +1,7 @@ // { dg-options "-w" } // { dg-output "1\r*\n2\r*\n" } +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/issue-1436.rs b/gcc/testsuite/rust/execute/torture/issue-1436.rs index 5d90907..23620ab 100644 --- a/gcc/testsuite/rust/execute/torture/issue-1436.rs +++ b/gcc/testsuite/rust/execute/torture/issue-1436.rs @@ -2,6 +2,7 @@ #![feature(intrinsics)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/issue-1481.rs b/gcc/testsuite/rust/execute/torture/issue-1481.rs index 2ff78d9..e63e2bd 100644 --- a/gcc/testsuite/rust/execute/torture/issue-1481.rs +++ b/gcc/testsuite/rust/execute/torture/issue-1481.rs @@ -1,5 +1,6 @@ /* { dg-output "called Foo::print\\(\\)\r*" } */ /* { dg-options "-w" } */ +#![feature(lang_items)] #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/issue-1482.rs b/gcc/testsuite/rust/execute/torture/issue-1482.rs index ed8dc81..3b1b398 100644 --- a/gcc/testsuite/rust/execute/torture/issue-1482.rs +++ b/gcc/testsuite/rust/execute/torture/issue-1482.rs @@ -1,3 +1,5 @@ +#![feature(lang_items)] + #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/issue-1496.rs b/gcc/testsuite/rust/execute/torture/issue-1496.rs index 36291a7..26dd1ef 100644 --- a/gcc/testsuite/rust/execute/torture/issue-1496.rs +++ b/gcc/testsuite/rust/execute/torture/issue-1496.rs @@ -1,4 +1,6 @@ /* { dg-output "foo_deref\r*\nimm_deref\r*\n123\r*\n" } */ +#![feature(lang_items)] + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/execute/torture/issue-1720-2.rs b/gcc/testsuite/rust/execute/torture/issue-1720-2.rs index 9c5356e..d90072f 100644 --- a/gcc/testsuite/rust/execute/torture/issue-1720-2.rs +++ b/gcc/testsuite/rust/execute/torture/issue-1720-2.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/issue-1720.rs b/gcc/testsuite/rust/execute/torture/issue-1720.rs index 2218282..5da45ee 100644 --- a/gcc/testsuite/rust/execute/torture/issue-1720.rs +++ b/gcc/testsuite/rust/execute/torture/issue-1720.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/issue-2005.rs b/gcc/testsuite/rust/execute/torture/issue-2005.rs index 87edb95..29d4454 100644 --- a/gcc/testsuite/rust/execute/torture/issue-2005.rs +++ b/gcc/testsuite/rust/execute/torture/issue-2005.rs @@ -1,6 +1,6 @@ // { dg-additional-options "-w" } /* { dg-output "WORKS\r?\n" } */ -#![feature(intrinsics)] +#![feature(intrinsics, lang_items)] mod core { mod option { diff --git a/gcc/testsuite/rust/execute/torture/issue-2052.rs b/gcc/testsuite/rust/execute/torture/issue-2052.rs index bf5d6a7..a30ddc4 100644 --- a/gcc/testsuite/rust/execute/torture/issue-2052.rs +++ b/gcc/testsuite/rust/execute/torture/issue-2052.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/issue-2179.rs b/gcc/testsuite/rust/execute/torture/issue-2179.rs index 8a5ec1b..c5da7ee 100644 --- a/gcc/testsuite/rust/execute/torture/issue-2179.rs +++ b/gcc/testsuite/rust/execute/torture/issue-2179.rs @@ -1,4 +1,5 @@ // { dg-output "123\r*\n" } +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/issue-2180.rs b/gcc/testsuite/rust/execute/torture/issue-2180.rs index 6bd7172..ee18c8b 100644 --- a/gcc/testsuite/rust/execute/torture/issue-2180.rs +++ b/gcc/testsuite/rust/execute/torture/issue-2180.rs @@ -1,4 +1,5 @@ // { dg-output "123\r*\n" } +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/issue-2236.rs b/gcc/testsuite/rust/execute/torture/issue-2236.rs index 850b997..b7f2888 100644 --- a/gcc/testsuite/rust/execute/torture/issue-2236.rs +++ b/gcc/testsuite/rust/execute/torture/issue-2236.rs @@ -1,4 +1,5 @@ // { dg-options "-w" } +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/issue-2583.rs b/gcc/testsuite/rust/execute/torture/issue-2583.rs index 4ff12fc..c45d61d 100644 --- a/gcc/testsuite/rust/execute/torture/issue-2583.rs +++ b/gcc/testsuite/rust/execute/torture/issue-2583.rs @@ -1,5 +1,6 @@ #![feature(intrinsics)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/issue-3126.rs b/gcc/testsuite/rust/execute/torture/issue-3126.rs index f505146..65bc07d 100644 --- a/gcc/testsuite/rust/execute/torture/issue-3126.rs +++ b/gcc/testsuite/rust/execute/torture/issue-3126.rs @@ -1,4 +1,6 @@ /* { dg-output "child\r*\n" }*/ +#![feature(lang_items)] + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/execute/torture/issue-3381.rs b/gcc/testsuite/rust/execute/torture/issue-3381.rs index 62dbcd0..02d96d7 100644 --- a/gcc/testsuite/rust/execute/torture/issue-3381.rs +++ b/gcc/testsuite/rust/execute/torture/issue-3381.rs @@ -1,4 +1,6 @@ /* { dg-output "Err: 15\r*\n" } */ +#![feature(lang_items)] + #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/issue-3502.rs b/gcc/testsuite/rust/execute/torture/issue-3502.rs index f07a126..aa38858 100644 --- a/gcc/testsuite/rust/execute/torture/issue-3502.rs +++ b/gcc/testsuite/rust/execute/torture/issue-3502.rs @@ -1,4 +1,6 @@ /* { dg-output "parent 123\r*\nchild\r*\n" } */ +#![feature(lang_items)] + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/execute/torture/issue-3836.rs b/gcc/testsuite/rust/execute/torture/issue-3836.rs index 61ad424..5c93736 100644 --- a/gcc/testsuite/rust/execute/torture/issue-3836.rs +++ b/gcc/testsuite/rust/execute/torture/issue-3836.rs @@ -1,7 +1,7 @@ // { dg-options "-w" } // { dg-output "less\r*\n" } -#![feature(intrinsics)] +#![feature(intrinsics, lang_items)] mod core { mod option { diff --git a/gcc/testsuite/rust/execute/torture/issue-4242.rs b/gcc/testsuite/rust/execute/torture/issue-4242.rs new file mode 100644 index 0000000..867adc9 --- /dev/null +++ b/gcc/testsuite/rust/execute/torture/issue-4242.rs @@ -0,0 +1,11 @@ +#![feature(exclusive_range_pattern)] + +fn main() -> i32 { + let x = -77; + + match x { + -55..99 => 1, + -99..-55 => 0, // the correct case + _ => 1, + } +}
\ No newline at end of file diff --git a/gcc/testsuite/rust/execute/torture/issue-647.rs b/gcc/testsuite/rust/execute/torture/issue-647.rs index 6a35655..fbf4a1e 100644 --- a/gcc/testsuite/rust/execute/torture/issue-647.rs +++ b/gcc/testsuite/rust/execute/torture/issue-647.rs @@ -1,4 +1,6 @@ /* { dg-output "Hello World 123\r*\n" }*/ +#![feature(lang_items)] + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/execute/torture/issue-845.rs b/gcc/testsuite/rust/execute/torture/issue-845.rs index b11ccd5..060cf0b 100644 --- a/gcc/testsuite/rust/execute/torture/issue-845.rs +++ b/gcc/testsuite/rust/execute/torture/issue-845.rs @@ -1,5 +1,7 @@ // { dg-output "Foo::bar\r*\n" } // { dg-additional-options "-w" } +#![feature(lang_items)] + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/execute/torture/issue-851.rs b/gcc/testsuite/rust/execute/torture/issue-851.rs index 1361235..093143f 100644 --- a/gcc/testsuite/rust/execute/torture/issue-851.rs +++ b/gcc/testsuite/rust/execute/torture/issue-851.rs @@ -1,4 +1,6 @@ /* { dg-output "Result: 123\r*\n" } */ +#![feature(lang_items)] + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/execute/torture/issue-858.rs b/gcc/testsuite/rust/execute/torture/issue-858.rs index 0b1118b..63518ce 100644 --- a/gcc/testsuite/rust/execute/torture/issue-858.rs +++ b/gcc/testsuite/rust/execute/torture/issue-858.rs @@ -1,4 +1,6 @@ /* { dg-output "Result: 123\r*\n" } */ +#![feature(lang_items)] + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/execute/torture/iter1.rs b/gcc/testsuite/rust/execute/torture/iter1.rs index 233eb60..84b5033 100644 --- a/gcc/testsuite/rust/execute/torture/iter1.rs +++ b/gcc/testsuite/rust/execute/torture/iter1.rs @@ -1,5 +1,5 @@ // { dg-output "1\r*\n2\r*\n" } -#![feature(intrinsics)] +#![feature(intrinsics, lang_items)] pub use option::Option::{self, None, Some}; pub use result::Result::{self, Err, Ok}; diff --git a/gcc/testsuite/rust/execute/torture/literalpattern_neg.rs b/gcc/testsuite/rust/execute/torture/literalpattern_neg.rs new file mode 100644 index 0000000..3553c4a --- /dev/null +++ b/gcc/testsuite/rust/execute/torture/literalpattern_neg.rs @@ -0,0 +1,9 @@ +fn main() -> i32 { + let x = -55; + + match x { + 55 => 1, + -55 => 0, // correct case + _ => 1 + } +}
\ No newline at end of file diff --git a/gcc/testsuite/rust/execute/torture/macros23.rs b/gcc/testsuite/rust/execute/torture/macros23.rs index b27985d..ef958af 100644 --- a/gcc/testsuite/rust/execute/torture/macros23.rs +++ b/gcc/testsuite/rust/execute/torture/macros23.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/macros28.rs b/gcc/testsuite/rust/execute/torture/macros28.rs index 46d9cfc..db1d9f2 100644 --- a/gcc/testsuite/rust/execute/torture/macros28.rs +++ b/gcc/testsuite/rust/execute/torture/macros28.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/method2.rs b/gcc/testsuite/rust/execute/torture/method2.rs index e5f630a..0355a750 100644 --- a/gcc/testsuite/rust/execute/torture/method2.rs +++ b/gcc/testsuite/rust/execute/torture/method2.rs @@ -1,5 +1,7 @@ // { dg-additional-options "-w" } // { dg-output "foo_deref\r*\nimm_deref\r*\n" } +#![feature(lang_items)] + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/execute/torture/method3.rs b/gcc/testsuite/rust/execute/torture/method3.rs index 9a7865c..70b7792 100644 --- a/gcc/testsuite/rust/execute/torture/method3.rs +++ b/gcc/testsuite/rust/execute/torture/method3.rs @@ -1,5 +1,7 @@ // { dg-additional-options "-w" } // { dg-output "mut_deref\r*\nfoobar: 123\r*\n" } +#![feature(lang_items)] + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/execute/torture/method4.rs b/gcc/testsuite/rust/execute/torture/method4.rs index e20618f..f4b3a33 100644 --- a/gcc/testsuite/rust/execute/torture/method4.rs +++ b/gcc/testsuite/rust/execute/torture/method4.rs @@ -1,5 +1,7 @@ // { dg-additional-options "-w" } // { dg-output "mut_deref\r*\nfoobar: 123\r*\n" } +#![feature(lang_items)] + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/execute/torture/min_specialization2.rs b/gcc/testsuite/rust/execute/torture/min_specialization2.rs index 74faee4..b3eac27 100644 --- a/gcc/testsuite/rust/execute/torture/min_specialization2.rs +++ b/gcc/testsuite/rust/execute/torture/min_specialization2.rs @@ -1,4 +1,4 @@ -#![feature(min_specialization)] +#![feature(min_specialization, lang_items)] #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/min_specialization3.rs b/gcc/testsuite/rust/execute/torture/min_specialization3.rs index 9eccd97..b73a8ac 100644 --- a/gcc/testsuite/rust/execute/torture/min_specialization3.rs +++ b/gcc/testsuite/rust/execute/torture/min_specialization3.rs @@ -1,4 +1,4 @@ -#![feature(min_specialization)] +#![feature(min_specialization, lang_items)] #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/operator_overload_1.rs b/gcc/testsuite/rust/execute/torture/operator_overload_1.rs index 9aed393..0fc6372 100644 --- a/gcc/testsuite/rust/execute/torture/operator_overload_1.rs +++ b/gcc/testsuite/rust/execute/torture/operator_overload_1.rs @@ -1,4 +1,6 @@ /* { dg-output "3\r*\n" } */ +#![feature(lang_items)] + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/execute/torture/operator_overload_10.rs b/gcc/testsuite/rust/execute/torture/operator_overload_10.rs index 921ec5f..6989347 100644 --- a/gcc/testsuite/rust/execute/torture/operator_overload_10.rs +++ b/gcc/testsuite/rust/execute/torture/operator_overload_10.rs @@ -1,4 +1,6 @@ /* { dg-output "foo_deref\r*\n123\r*\n" } */ +#![feature(lang_items)] + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/execute/torture/operator_overload_11.rs b/gcc/testsuite/rust/execute/torture/operator_overload_11.rs index f0359fb..d0b45a7 100644 --- a/gcc/testsuite/rust/execute/torture/operator_overload_11.rs +++ b/gcc/testsuite/rust/execute/torture/operator_overload_11.rs @@ -1,5 +1,7 @@ // { dg-output "1\r*\n" } // { dg-additional-options "-w" } +#![feature(lang_items)] + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/execute/torture/operator_overload_12.rs b/gcc/testsuite/rust/execute/torture/operator_overload_12.rs index 2cd5c69..a0e1bc8 100644 --- a/gcc/testsuite/rust/execute/torture/operator_overload_12.rs +++ b/gcc/testsuite/rust/execute/torture/operator_overload_12.rs @@ -1,5 +1,7 @@ // { dg-output "1\r*\n" } // { dg-additional-options "-w" } +#![feature(lang_items)] + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/execute/torture/operator_overload_2.rs b/gcc/testsuite/rust/execute/torture/operator_overload_2.rs index 6862415..dfc2530 100644 --- a/gcc/testsuite/rust/execute/torture/operator_overload_2.rs +++ b/gcc/testsuite/rust/execute/torture/operator_overload_2.rs @@ -1,4 +1,6 @@ /* { dg-output "3\r*\n" } */ +#![feature(lang_items)] + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/execute/torture/operator_overload_3.rs b/gcc/testsuite/rust/execute/torture/operator_overload_3.rs index 6c1a8b8..6807143 100644 --- a/gcc/testsuite/rust/execute/torture/operator_overload_3.rs +++ b/gcc/testsuite/rust/execute/torture/operator_overload_3.rs @@ -1,4 +1,6 @@ /* { dg-output "3\r*\n3\r*\n" } */ +#![feature(lang_items)] + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/execute/torture/operator_overload_4.rs b/gcc/testsuite/rust/execute/torture/operator_overload_4.rs index c8235c6..3f68bf1 100644 --- a/gcc/testsuite/rust/execute/torture/operator_overload_4.rs +++ b/gcc/testsuite/rust/execute/torture/operator_overload_4.rs @@ -1,4 +1,6 @@ /* { dg-output "neg\r*\n" } */ +#![feature(lang_items)] + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/execute/torture/operator_overload_5.rs b/gcc/testsuite/rust/execute/torture/operator_overload_5.rs index eeef5bc..b5c1fd6 100644 --- a/gcc/testsuite/rust/execute/torture/operator_overload_5.rs +++ b/gcc/testsuite/rust/execute/torture/operator_overload_5.rs @@ -1,4 +1,6 @@ /* { dg-output "not\r*\n" } */ +#![feature(lang_items)] + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/execute/torture/operator_overload_6.rs b/gcc/testsuite/rust/execute/torture/operator_overload_6.rs index d5ffae5..0a69758 100644 --- a/gcc/testsuite/rust/execute/torture/operator_overload_6.rs +++ b/gcc/testsuite/rust/execute/torture/operator_overload_6.rs @@ -1,4 +1,6 @@ /* { dg-output "add_assign\r*\n3\r*\n" } */ +#![feature(lang_items)] + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/execute/torture/operator_overload_7.rs b/gcc/testsuite/rust/execute/torture/operator_overload_7.rs index 7226b26..e1bd7c4 100644 --- a/gcc/testsuite/rust/execute/torture/operator_overload_7.rs +++ b/gcc/testsuite/rust/execute/torture/operator_overload_7.rs @@ -1,4 +1,6 @@ /* { dg-output "imm_deref\r*\n123\r*\n" } */ +#![feature(lang_items)] + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/execute/torture/operator_overload_8.rs b/gcc/testsuite/rust/execute/torture/operator_overload_8.rs index 4b589a8..8324768 100644 --- a/gcc/testsuite/rust/execute/torture/operator_overload_8.rs +++ b/gcc/testsuite/rust/execute/torture/operator_overload_8.rs @@ -1,4 +1,6 @@ /* { dg-output "imm_deref\r*\n123\r*\n" } */ +#![feature(lang_items)] + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/execute/torture/operator_overload_9.rs b/gcc/testsuite/rust/execute/torture/operator_overload_9.rs index 5fc0428..4d10f78 100644 --- a/gcc/testsuite/rust/execute/torture/operator_overload_9.rs +++ b/gcc/testsuite/rust/execute/torture/operator_overload_9.rs @@ -1,4 +1,6 @@ /* { dg-output "mut_deref\r*\n123\r*\n" } */ +#![feature(lang_items)] + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/execute/torture/partial-eq-1.rs b/gcc/testsuite/rust/execute/torture/partial-eq-1.rs index db123a1..fa918f3 100644 --- a/gcc/testsuite/rust/execute/torture/partial-eq-1.rs +++ b/gcc/testsuite/rust/execute/torture/partial-eq-1.rs @@ -1,5 +1,6 @@ /* { dg-output "a == b\r*\na != c\r*\n" }*/ /* { dg-options "-w" } */ +#![feature(lang_items)] mod core { mod marker { diff --git a/gcc/testsuite/rust/execute/torture/partial-eq-2.rs b/gcc/testsuite/rust/execute/torture/partial-eq-2.rs index debed8c..e132ef0 100644 --- a/gcc/testsuite/rust/execute/torture/partial-eq-2.rs +++ b/gcc/testsuite/rust/execute/torture/partial-eq-2.rs @@ -1,6 +1,7 @@ /* { dg-output "a == b\r*\na != c\r*\n" }*/ /* { dg-options "-w" } */ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/partial-eq-3.rs b/gcc/testsuite/rust/execute/torture/partial-eq-3.rs index 849910a..4ace3d9 100644 --- a/gcc/testsuite/rust/execute/torture/partial-eq-3.rs +++ b/gcc/testsuite/rust/execute/torture/partial-eq-3.rs @@ -1,7 +1,7 @@ /* { dg-output "a == b\r*\na != c\r*\n" }*/ /* { dg-options "-w" } */ -#![feature(intrinsics)] +#![feature(intrinsics, lang_items)] mod core { mod option { diff --git a/gcc/testsuite/rust/execute/torture/partial-eq-4.rs b/gcc/testsuite/rust/execute/torture/partial-eq-4.rs index b6997d8..d1835db 100644 --- a/gcc/testsuite/rust/execute/torture/partial-eq-4.rs +++ b/gcc/testsuite/rust/execute/torture/partial-eq-4.rs @@ -1,7 +1,7 @@ /* { dg-output "a == b\r*\na != c\r*\n" }*/ /* { dg-options "-w" } */ -#![feature(intrinsics)] +#![feature(intrinsics, lang_items)] mod core { mod option { diff --git a/gcc/testsuite/rust/execute/torture/partial-ord-1.rs b/gcc/testsuite/rust/execute/torture/partial-ord-1.rs index a3558e7..b1546a3 100644 --- a/gcc/testsuite/rust/execute/torture/partial-ord-1.rs +++ b/gcc/testsuite/rust/execute/torture/partial-ord-1.rs @@ -1,4 +1,5 @@ /* { dg-output "x == y\r*\nx > z\r*\n" }*/ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/partial-ord-2.rs b/gcc/testsuite/rust/execute/torture/partial-ord-2.rs index d3b713f..76cdc2a 100644 --- a/gcc/testsuite/rust/execute/torture/partial-ord-2.rs +++ b/gcc/testsuite/rust/execute/torture/partial-ord-2.rs @@ -1,6 +1,6 @@ /* { dg-output "x == y\r*\nx > z\r*\n" }*/ -#![feature(intrinsics)] +#![feature(intrinsics, lang_items)] mod core { mod option { diff --git a/gcc/testsuite/rust/execute/torture/partial-ord-3.rs b/gcc/testsuite/rust/execute/torture/partial-ord-3.rs index 7aec07c..dd8072f 100644 --- a/gcc/testsuite/rust/execute/torture/partial-ord-3.rs +++ b/gcc/testsuite/rust/execute/torture/partial-ord-3.rs @@ -1,7 +1,7 @@ /* { dg-output "x == y\r*\nx > z\r*\nx < z\r*\nx >= y\r*\nx <= y\r*\n" } */ /* { dg-options "-w" } */ -#![feature(intrinsics)] +#![feature(intrinsics, lang_items)] mod core { mod option { diff --git a/gcc/testsuite/rust/execute/torture/partial-ord-4.rs b/gcc/testsuite/rust/execute/torture/partial-ord-4.rs index fd52f32..de13074 100644 --- a/gcc/testsuite/rust/execute/torture/partial-ord-4.rs +++ b/gcc/testsuite/rust/execute/torture/partial-ord-4.rs @@ -1,7 +1,7 @@ /* { dg-output "a == b\r*\na != c\r*\n" }*/ /* { dg-options "-w" } */ -#![feature(intrinsics)] +#![feature(intrinsics, lang_items)] mod core { mod option { diff --git a/gcc/testsuite/rust/execute/torture/partial-ord-5.rs b/gcc/testsuite/rust/execute/torture/partial-ord-5.rs index 721d2aa..b87a08e 100644 --- a/gcc/testsuite/rust/execute/torture/partial-ord-5.rs +++ b/gcc/testsuite/rust/execute/torture/partial-ord-5.rs @@ -1,7 +1,7 @@ /* { dg-output "a == b\r*\na != c\r*\na >= c\r*\na <= b\r*\na > c\r*\nc < b\r*\n" } */ /* { dg-options "-w" } */ -#![feature(intrinsics)] +#![feature(intrinsics, lang_items)] mod core { mod option { diff --git a/gcc/testsuite/rust/execute/torture/partial-ord-6.rs b/gcc/testsuite/rust/execute/torture/partial-ord-6.rs index 5d64f8c..04f13cd 100644 --- a/gcc/testsuite/rust/execute/torture/partial-ord-6.rs +++ b/gcc/testsuite/rust/execute/torture/partial-ord-6.rs @@ -1,7 +1,7 @@ // { dg-additional-options "-w" } /* { dg-output "Foo A < B\r?\nFoo B < C\r?\nFoo C == C\r?\nBar x < y\r?\nBarFull s1 < s2\r?\n" } */ -#![feature(intrinsics)] +#![feature(intrinsics, lang_items)] mod core { mod option { diff --git a/gcc/testsuite/rust/execute/torture/prefetch_data.rs b/gcc/testsuite/rust/execute/torture/prefetch_data.rs index 2a847fb..a155e67 100644 --- a/gcc/testsuite/rust/execute/torture/prefetch_data.rs +++ b/gcc/testsuite/rust/execute/torture/prefetch_data.rs @@ -1,5 +1,6 @@ #![feature(intrinsics)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/ref-pattern2.rs b/gcc/testsuite/rust/execute/torture/ref-pattern2.rs index 8e71724..cde7ea5 100644 --- a/gcc/testsuite/rust/execute/torture/ref-pattern2.rs +++ b/gcc/testsuite/rust/execute/torture/ref-pattern2.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/sip-hasher.rs b/gcc/testsuite/rust/execute/torture/sip-hasher.rs index 60826a3..32cdc22 100644 --- a/gcc/testsuite/rust/execute/torture/sip-hasher.rs +++ b/gcc/testsuite/rust/execute/torture/sip-hasher.rs @@ -1,8 +1,7 @@ // { dg-skip-if "" { *-*-* } { "-m32" } { "" } } // { dg-options "-w" } // { dg-output "Hash: 0x63d53fd2170bbb8c\r*\n" } -#![feature(intrinsics)] -#![feature(rustc_attrs)] +#![feature(intrinsics, lang_items, rustc_attrs)] #[lang = "sized"] trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/slice-magic.rs b/gcc/testsuite/rust/execute/torture/slice-magic.rs index 1f56187..521a251 100644 --- a/gcc/testsuite/rust/execute/torture/slice-magic.rs +++ b/gcc/testsuite/rust/execute/torture/slice-magic.rs @@ -1,6 +1,7 @@ // { dg-additional-options "-w" } #![feature(intrinsics)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/slice-magic2.rs b/gcc/testsuite/rust/execute/torture/slice-magic2.rs index 20f113e..75c04f3 100644 --- a/gcc/testsuite/rust/execute/torture/slice-magic2.rs +++ b/gcc/testsuite/rust/execute/torture/slice-magic2.rs @@ -1,6 +1,7 @@ // { dg-additional-options "-w" } #![feature(intrinsics)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/slice1.rs b/gcc/testsuite/rust/execute/torture/slice1.rs index 2683179..317ff7a 100644 --- a/gcc/testsuite/rust/execute/torture/slice1.rs +++ b/gcc/testsuite/rust/execute/torture/slice1.rs @@ -1,4 +1,5 @@ // { dg-additional-options "-w" } +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/str-layout1.rs b/gcc/testsuite/rust/execute/torture/str-layout1.rs index fb3b4e3..a28d265 100644 --- a/gcc/testsuite/rust/execute/torture/str-layout1.rs +++ b/gcc/testsuite/rust/execute/torture/str-layout1.rs @@ -2,6 +2,7 @@ // { dg-output "t1sz=5 t2sz=10\r*" } #![feature(intrinsics)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/trait1.rs b/gcc/testsuite/rust/execute/torture/trait1.rs index f8a5959..db5b6e2 100644 --- a/gcc/testsuite/rust/execute/torture/trait1.rs +++ b/gcc/testsuite/rust/execute/torture/trait1.rs @@ -1,4 +1,6 @@ /* { dg-output "S::f\r*\nT1::f\r*\nT2::f\r*\n" } */ +#![feature(lang_items)] + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/execute/torture/trait10.rs b/gcc/testsuite/rust/execute/torture/trait10.rs index 4e576eb..4eb9546 100644 --- a/gcc/testsuite/rust/execute/torture/trait10.rs +++ b/gcc/testsuite/rust/execute/torture/trait10.rs @@ -1,4 +1,6 @@ /* { dg-output "123\r*\n" } */ +#![feature(lang_items)] + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/execute/torture/trait11.rs b/gcc/testsuite/rust/execute/torture/trait11.rs index cca084a..84add74 100644 --- a/gcc/testsuite/rust/execute/torture/trait11.rs +++ b/gcc/testsuite/rust/execute/torture/trait11.rs @@ -1,4 +1,5 @@ /* { dg-output "3\r*\n" } */ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/trait12.rs b/gcc/testsuite/rust/execute/torture/trait12.rs index d174a89..dd7a644 100644 --- a/gcc/testsuite/rust/execute/torture/trait12.rs +++ b/gcc/testsuite/rust/execute/torture/trait12.rs @@ -1,4 +1,6 @@ /* { dg-output "3\r*\n" } */ +#![feature(lang_items)] + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/execute/torture/trait13.rs b/gcc/testsuite/rust/execute/torture/trait13.rs index 0d8f894..25912bd 100644 --- a/gcc/testsuite/rust/execute/torture/trait13.rs +++ b/gcc/testsuite/rust/execute/torture/trait13.rs @@ -1,4 +1,6 @@ /* { dg-output "123\r*\n456\r*\n" } */ +#![feature(lang_items)] + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/execute/torture/trait14.rs b/gcc/testsuite/rust/execute/torture/trait14.rs index 759950e..ebc0c5c 100644 --- a/gcc/testsuite/rust/execute/torture/trait14.rs +++ b/gcc/testsuite/rust/execute/torture/trait14.rs @@ -1,4 +1,5 @@ /* { dg-output "parent123\r*\nchild\r*\n" } */ +#![feature(lang_items)] extern "C" { fn printf(s: *const i8, ...); diff --git a/gcc/testsuite/rust/execute/torture/trait15.rs b/gcc/testsuite/rust/execute/torture/trait15.rs index 53469d7..59f8dc3 100644 --- a/gcc/testsuite/rust/execute/torture/trait15.rs +++ b/gcc/testsuite/rust/execute/torture/trait15.rs @@ -1,6 +1,8 @@ /* { dg-output "parent123\r*\nchild\r*\n" } */ // Testing generics passing with supertraits +#![feature(lang_items)] + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/execute/torture/trait2.rs b/gcc/testsuite/rust/execute/torture/trait2.rs index d5fd546..db69c1e 100644 --- a/gcc/testsuite/rust/execute/torture/trait2.rs +++ b/gcc/testsuite/rust/execute/torture/trait2.rs @@ -1,4 +1,6 @@ /* { dg-output "Bar::A = 456\r*\n<Foo as Bar>::A = 456\r*\n" } */ +#![feature(lang_items)] + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/execute/torture/trait3.rs b/gcc/testsuite/rust/execute/torture/trait3.rs index 668b437..d39d324 100644 --- a/gcc/testsuite/rust/execute/torture/trait3.rs +++ b/gcc/testsuite/rust/execute/torture/trait3.rs @@ -1,4 +1,6 @@ /* { dg-output "123, 777\r*" } */ +#![feature(lang_items)] + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/execute/torture/trait4.rs b/gcc/testsuite/rust/execute/torture/trait4.rs index 61c2d15..fb1eaae 100644 --- a/gcc/testsuite/rust/execute/torture/trait4.rs +++ b/gcc/testsuite/rust/execute/torture/trait4.rs @@ -1,4 +1,6 @@ /* { dg-output "123\r*\n" }*/ +#![feature(lang_items)] + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/execute/torture/trait5.rs b/gcc/testsuite/rust/execute/torture/trait5.rs index 7cd7d1a..67b5dd4 100644 --- a/gcc/testsuite/rust/execute/torture/trait5.rs +++ b/gcc/testsuite/rust/execute/torture/trait5.rs @@ -1,4 +1,6 @@ /* { dg-output "123\r*\n123\r*\n" } */ +#![feature(lang_items)] + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/execute/torture/trait6.rs b/gcc/testsuite/rust/execute/torture/trait6.rs index de5ddc1..baa075b 100644 --- a/gcc/testsuite/rust/execute/torture/trait6.rs +++ b/gcc/testsuite/rust/execute/torture/trait6.rs @@ -1,4 +1,6 @@ /* { dg-output "123\r*\n" } */ +#![feature(lang_items)] + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/execute/torture/trait7.rs b/gcc/testsuite/rust/execute/torture/trait7.rs index 21f1575..47d40ae 100644 --- a/gcc/testsuite/rust/execute/torture/trait7.rs +++ b/gcc/testsuite/rust/execute/torture/trait7.rs @@ -1,4 +1,6 @@ /* { dg-output "123\r*\n" } */ +#![feature(lang_items)] + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/execute/torture/trait8.rs b/gcc/testsuite/rust/execute/torture/trait8.rs index 69e784e..cbce3c1 100644 --- a/gcc/testsuite/rust/execute/torture/trait8.rs +++ b/gcc/testsuite/rust/execute/torture/trait8.rs @@ -1,4 +1,6 @@ /* { dg-output "123\r*\n" } */ +#![feature(lang_items)] + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/execute/torture/trait9.rs b/gcc/testsuite/rust/execute/torture/trait9.rs index f60554a..3448eb8 100644 --- a/gcc/testsuite/rust/execute/torture/trait9.rs +++ b/gcc/testsuite/rust/execute/torture/trait9.rs @@ -1,4 +1,6 @@ /* { dg-output "3\r*\n" } */ +#![feature(lang_items)] + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/execute/torture/transmute1.rs b/gcc/testsuite/rust/execute/torture/transmute1.rs index d89affd..8da1ae7 100644 --- a/gcc/testsuite/rust/execute/torture/transmute1.rs +++ b/gcc/testsuite/rust/execute/torture/transmute1.rs @@ -1,5 +1,5 @@ // { dg-additional-options "-w" } -#![feature(intrinsics)] +#![feature(intrinsics, lang_items)] extern "rust-intrinsic" { fn transmute<T, U>(value: T) -> U; diff --git a/gcc/testsuite/rust/execute/torture/wrapping_op1.rs b/gcc/testsuite/rust/execute/torture/wrapping_op1.rs index e0c100c..ba9b168 100644 --- a/gcc/testsuite/rust/execute/torture/wrapping_op1.rs +++ b/gcc/testsuite/rust/execute/torture/wrapping_op1.rs @@ -1,5 +1,6 @@ #![feature(intrinsics)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/wrapping_op2.rs b/gcc/testsuite/rust/execute/torture/wrapping_op2.rs index 6928992..5e6a37d 100644 --- a/gcc/testsuite/rust/execute/torture/wrapping_op2.rs +++ b/gcc/testsuite/rust/execute/torture/wrapping_op2.rs @@ -1,5 +1,6 @@ #![feature(intrinsics)] +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/link/generic_function_1.rs b/gcc/testsuite/rust/link/generic_function_1.rs index 46d0e82..dab62f0 100644 --- a/gcc/testsuite/rust/link/generic_function_1.rs +++ b/gcc/testsuite/rust/link/generic_function_1.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/link/trait_import_1.rs b/gcc/testsuite/rust/link/trait_import_1.rs index e54b0e1..589871d 100644 --- a/gcc/testsuite/rust/link/trait_import_1.rs +++ b/gcc/testsuite/rust/link/trait_import_1.rs @@ -1,3 +1,4 @@ +#![feature(lang_items)] #[lang = "sized"] pub trait Sized {} |
