diff options
Diffstat (limited to 'gcc/testsuite')
261 files changed, 4265 insertions, 598 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 81bdfaa..5cf9f3d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,747 @@ +2025-03-19 Harald Anlauf <anlauf@gmx.de> + + PR fortran/116706 + * gfortran.dg/bounds_check_27.f90: New test. + +2025-03-19 Jason Merrill <jason@redhat.com> + + PR c++/119316 + * g++.dg/abi/mangle-new1.C: New test. + +2025-03-19 David Malcolm <dmalcolm@redhat.com> + + PR c/119366 + * gcc.dg/Wfatal-bad-attr-pr119366.c: New test. + +2025-03-19 Jakub Jelinek <jakub@redhat.com> + + PR c/119350 + * gcc.dg/pr119350-1.c: New test. + * gcc.dg/pr119350-2.c: New test. + * gcc.dg/pr119350-3.c: New test. + +2025-03-19 Richard Biener <rguenther@suse.de> + + PR testsuite/113634 + * gcc.dg/Wfree-nonheap-object-7.c: Adjust calloc and realloc + declarations, remove -std=gnu17. + +2025-03-19 Stefan Schulze Frielinghaus <stefansf@gcc.gnu.org> + + * gcc.target/s390/zvector/autovec-double-signaling-eq-z13.c: + Honour sNaNs. + +2025-03-19 Stefan Schulze Frielinghaus <stefansf@gcc.gnu.org> + + * gcc.target/s390/vector/vcond-shift.c: Adapt to new match.pd + rule and change scan-assembler-times for shifts. + +2025-03-19 Owen Avery <powerboat9.gamer@gmail.com> + + * rust/compile/nr2/exclude: Remove entries. + +2025-03-19 Owen Avery <powerboat9.gamer@gmail.com> + + * rust/compile/nr2/exclude: Remove issue-1089.rs. + +2025-03-19 badumbatish <tanghocle456@gmail.com> + + * rust/compile/inline_asm_parse_operand.rs: + Remove inout, functionality not supported. Remove redundant {} + * rust/execute/torture/inline_asm_mov_x_5_ARM.rs: Add operand in + * rust/execute/torture/inline_asm_mov_x_5_x86_64.rs: Likewise + +2025-03-19 Owen Avery <powerboat9.gamer@gmail.com> + + * rust/compile/nr2/exclude: Remove entries. + +2025-03-19 Owen Avery <powerboat9.gamer@gmail.com> + + * rust/compile/nr2/exclude: Remove + inline_asm_parse_output_operand.rs. + +2025-03-19 Owen Avery <powerboat9.gamer@gmail.com> + + * rust/compile/nr2/exclude: Remove entries. + +2025-03-19 Owen Avery <powerboat9.gamer@gmail.com> + + * rust/compile/nr2/exclude: Remove type-alias1.rs. + +2025-03-19 Owen Avery <powerboat9.gamer@gmail.com> + + * rust/compile/nr2/exclude: Remove entries. + +2025-03-19 Owen Avery <powerboat9.gamer@gmail.com> + + * rust/compile/nr2/exclude: Remove shadow1.rs. + +2025-03-19 Philip Herron <herron.philip@googlemail.com> + + * rust/compile/nr2/exclude: nr2 cant handle this + * rust/compile/issue-2499.rs: New test. + +2025-03-19 Philip Herron <herron.philip@googlemail.com> + + * rust/compile/nr2/exclude: + * rust/compile/issue-2203.rs: New test. + +2025-03-19 Philip Herron <herron.philip@googlemail.com> + + * rust/compile/nr2/exclude: nr2 is crashing here + * rust/compile/issue-2951.rs: New test. + +2025-03-19 Philip Herron <herron.philip@googlemail.com> + + * rust/compile/nr2/exclude: nr2 cant handle this + * rust/compile/issue-3036.rs: New test. + +2025-03-19 Philip Herron <herron.philip@googlemail.com> + + * rust/compile/issue-3139-1.rs: New test. + * rust/compile/issue-3139-2.rs: New test. + * rust/compile/issue-3139-3.rs: New test. + * rust/compile/nr2/exclude: these all break nr2 + +2025-03-19 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> + + * rust/compile/nr2/exclude: Remove cast_generics.rs, issue-1131.rs, + issue-1383.rs and unsafe10.rs + +2025-03-19 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> + + * rust/compile/box_syntax_feature_gate.rs: Add box land item + definition. + +2025-03-19 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> + + * rust/compile/functions_without_body.rs: Add compile step argument. + +2025-03-19 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> + + * rust/compile/nr2/exclude: Remove working tests from nr2 exclude list. + +2025-03-19 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> + + * rust/compile/name_resolution21.rs: Move to... + * rust/compile/xfail/name_resolution21.rs: ...here. + +2025-03-19 Philip Herron <herron.philip@googlemail.com> + + * rust/compile/nr2/exclude: nr2 cant handle this + * rust/compile/issue-3082.rs: New test. + +2025-03-19 Philip Herron <herron.philip@googlemail.com> + + * rust/compile/nr2/exclude: nr2 cant handle this + * rust/compile/issue-3035.rs: New test. + +2025-03-19 Owen Avery <powerboat9.gamer@gmail.com> + + * rust/compile/nr2/exclude: Remove entries. + +2025-03-19 Philip Herron <herron.philip@googlemail.com> + + * rust/compile/nr2/exclude: nr2 cant handle this + * rust/compile/issue-3030.rs: New test. + +2025-03-19 Owen Avery <powerboat9.gamer@gmail.com> + + * rust/compile/nr2/compile.exp: New test. + * rust/compile/nr2/exclude: New. + +2025-03-19 JoanVC <github-91yu@joanvc.cat> + + * rust/compile/issue-3141.rs: New test. + +2025-03-19 benjamin.thos <benjamin.thos@epita.fr> + + * rust/compile/auto_trait_super_trait.rs: Add feature attribute. + * rust/compile/generic_auto_trait.rs: likewise. + * rust/compile/auto_trait.rs: add test for error without + feature attribute + +2025-03-19 Raiki Tamura <tamaron1203@gmail.com> + + * rust/compile/exhaustiveness1.rs: New test. + * rust/compile/exhaustiveness2.rs: New test. + * rust/compile/exhaustiveness3.rs: New test. + +2025-03-19 Liam Naddell <liam.naddell@mail.utoronto.ca> + + * rust/compile/trait13.rs: + Add test for supertraits of supertraits + * rust/compile/trait14.rs: + Diamond problem with supertraits test + * rust/execute/torture/trait14.rs: + Add test for dynamic dispatch with supertraits + * rust/execute/torture/trait15.rs: + Add test for dynamic dispatch with generics + * rust/execute/torture/trait16.rs: + Add test for dynamic dispatch with lifetime params 1 + * rust/execute/torture/trait17.rs: + Add test for dynamic dispatch with lifetime params 2 + * rust/execute/torture/trait18.rs: + Add test for default implementations with dynamic dispatch and + supertraits + +2025-03-19 Owen Avery <powerboat9.gamer@gmail.com> + + * rust/compile/v0-mangle1.rs: Make v0-mangle test more crate_num + agnostic. + +2025-03-19 badumbatish <tanghocle456@gmail.com> + + * rust/execute/torture/inline_asm_mov_x_5.rs: Move to... + * rust/execute/torture/inline_asm_mov_x_5_ARM.rs: ...here. + * rust/execute/torture/inline_asm_mov_x_5_x86_64.rs: New test. + +2025-03-19 badumbatish <tanghocle456@gmail.com> + + * rust/compile/inline_asm_typecheck.rs: Change comments + +2025-03-19 badumbatish <tanghocle456@gmail.com> + + * rust/execute/inline_asm_mov_x_5.rs: Move to... + * rust/execute/torture/inline_asm_mov_x_5.rs: ...here. + +2025-03-19 badumbatish <tanghocle456@gmail.com> + + * rust/compile/inline_asm_parse_operand.rs: Fix format asm + * rust/compile/inline_asm_parse_output_operand.rs: + Fix format asm + * rust/execute/torture/inline_asm_mov_x_5.rs: Move to... + * rust/execute/inline_asm_mov_x_5.rs: ...here. + +2025-03-19 badumbatish <tanghocle456@gmail.com> + + * rust/compile/inline_asm_typecheck.rs: New test. + +2025-03-19 badumbatish <tanghocle456@gmail.com> + + * rust/execute/torture/inline_asm_mov_x_5.rs: New test. + +2025-03-19 badumbatish <tanghocle456@gmail.com> + + * rust/compile/inline_asm_parse_output_operand.rs: New test. + +2025-03-19 jjasmine <tanghocle456@gmail.com> + + * rust/compile/inline_asm_compile_nop.rs: New test. + +2025-03-19 Raiki Tamura <tamaron1203@gmail.com> + + * rust/compile/issue-2324-2.rs: Fix error message. + * rust/compile/match9.rs: New test. + +2025-03-19 Raiki Tamura <tamaron1203@gmail.com> + + * rust/compile/match8.rs: New test. + +2025-03-19 Arthur Cohen <arthur.cohen@embecosm.com> + + * rust/compile/assume.rs: Add missing feature attribute. + * rust/compile/issue-1901.rs: Likewise. + * rust/compile/issue-1981.rs: Likewise. + * rust/compile/sizeof-stray-infer-var-bug.rs: Likewise. + * rust/compile/torture/intrinsics-8.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/execute/torture/issue-1436.rs: Likewise. + * rust/execute/torture/issue-2583.rs: Likewise. + +2025-03-19 Arthur Cohen <arthur.cohen@embecosm.com> + + * rust/compile/prelude_import.rs: New test. + +2025-03-19 Muhammad Mahad <mahadtxt@gmail.com> + + * rust/compile/nonexistent-field.rs: New test. + +2025-03-19 Kushal Pal <kushalpal109@gmail.com> + + * rust/borrowck/test_move.rs: Test rich-errors related to moves. + * rust/borrowck/test_move_conditional.rs: Likewise. + +2025-03-19 Kushal Pal <kushalpal109@gmail.com> + + * rust/borrowck/subset.rs: Better subset errors. + +2025-03-19 Kushal Pal <kushalpal109@gmail.com> + + * rust/borrowck/test_move.rs: Assigning `a` to `c` is the + correct way to test the behaviour. + +2025-03-19 Liam Naddell <liam.naddell@mail.utoronto.ca> + + * rust/compile/issue-2324-1.rs: + add test for E0532 with tuple enum variant + * rust/compile/issue-2324-2.rs: + add test for E0532 with struct enum variant + +2025-03-19 Liam Naddell <liam.naddell@mail.utoronto.ca> + + * rust/compile/macros/builtin/include1.rs: + add basic include test at global scope + * rust/compile/macros/builtin/include2.rs: + add basic include test at local scope with expression + * rust/compile/macros/builtin/include3.rs: + add eager expansion test at global scope + * rust/compile/macros/builtin/include4.rs: + add eager expansion test at local scope with expression + * rust/compile/macros/builtin/include_bytes.rs: + add eager expansion test at global scope + * rust/compile/macros/builtin/include_rs: + supporting test file with dummy function + * rust/compile/macros/builtin/include_rs2: + supporting test file with dummy string + * rust/compile/macros/builtin/include_str.rs: + add eager expansion test at global scope + * rust/execute/torture/builtin_macro_include_bytes.rs: + clean up old test logic, add permutations for eager expansion + * rust/execute/torture/builtin_macro_include_str.rs: + add eager expansion permutations + +2025-03-19 Kushal Pal <kushalpal109@gmail.com> + + * rust/borrowck/reference.rs: Test rich errors for + borrow-checker. + * rust/borrowck/return_ref_to_local.rs: Likewise. + * rust/borrowck/tmp.rs: Likewise. + * rust/borrowck/use_while_mut.rs: Likewise. + * rust/borrowck/use_while_mut_fr.rs: Likewise. + * rust/borrowck/well_formed_function_inputs.rs: Likewise. + +2025-03-19 badumbatish <tanghocle456@gmail.com> + + * rust/compile/inline_asm_illegal_operands.rs: Test now passing + * rust/compile/inline_asm_parse_operand.rs: Remove _, not + supported right now + +2025-03-19 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> + + * rust/compile/macro-delim.rs: Move to... + * rust/compile/macros/mbe/macro-delim.rs: ...here. + * rust/compile/macro-issue1053-2.rs: Move to... + * rust/compile/macros/mbe/macro-issue1053-2.rs: ...here. + * rust/compile/macro-issue1053.rs: Move to... + * rust/compile/macros/mbe/macro-issue1053.rs: ...here. + * rust/compile/macro-issue1224.rs: Move to... + * rust/compile/macros/mbe/macro-issue1224.rs: ...here. + * rust/compile/macro-issue1233.rs: Move to... + * rust/compile/macros/mbe/macro-issue1233.rs: ...here. + * rust/compile/macro-issue1395-2.rs: Move to... + * rust/compile/macros/mbe/macro-issue1395-2.rs: ...here. + * rust/compile/macro-issue1395.rs: Move to... + * rust/compile/macros/mbe/macro-issue1395.rs: ...here. + * rust/compile/macro-issue1400-2.rs: Move to... + * rust/compile/macros/mbe/macro-issue1400-2.rs: ...here. + * rust/compile/macro-issue1400.rs: Move to... + * rust/compile/macros/mbe/macro-issue1400.rs: ...here. + * rust/compile/macro-issue2092.rs: Move to... + * rust/compile/macros/mbe/macro-issue2092.rs: ...here. + * rust/compile/macro-issue2192.rs: Move to... + * rust/compile/macros/mbe/macro-issue2192.rs: ...here. + * rust/compile/macro-issue2194.rs: Move to... + * rust/compile/macros/mbe/macro-issue2194.rs: ...here. + * rust/compile/macro-issue2229.rs: Move to... + * rust/compile/macros/mbe/macro-issue2229.rs: ...here. + * rust/compile/macro-issue2264.rs: Move to... + * rust/compile/macros/mbe/macro-issue2264.rs: ...here. + * rust/compile/macro-issue2268.rs: Move to... + * rust/compile/macros/mbe/macro-issue2268.rs: ...here. + * rust/compile/macro-issue2273.rs: Move to... + * rust/compile/macros/mbe/macro-issue2273.rs: ...here. + * rust/compile/macro-issue2653.rs: Move to... + * rust/compile/macros/mbe/macro-issue2653.rs: ...here. + * rust/compile/macro-issue2983_2984.rs: Move to... + * rust/compile/macros/mbe/macro-issue2983_2984.rs: ...here. + * rust/compile/macro1.rs: Move to... + * rust/compile/macros/mbe/macro1.rs: ...here. + * rust/compile/macro10.rs: Move to... + * rust/compile/macros/mbe/macro10.rs: ...here. + * rust/compile/macro11.rs: Move to... + * rust/compile/macros/mbe/macro11.rs: ...here. + * rust/compile/macro12.rs: Move to... + * rust/compile/macros/mbe/macro12.rs: ...here. + * rust/compile/macro13.rs: Move to... + * rust/compile/macros/mbe/macro13.rs: ...here. + * rust/compile/macro14.rs: Move to... + * rust/compile/macros/mbe/macro14.rs: ...here. + * rust/compile/macro15.rs: Move to... + * rust/compile/macros/mbe/macro15.rs: ...here. + * rust/compile/macro16.rs: Move to... + * rust/compile/macros/mbe/macro16.rs: ...here. + * rust/compile/macro17.rs: Move to... + * rust/compile/macros/mbe/macro17.rs: ...here. + * rust/compile/macro18.rs: Move to... + * rust/compile/macros/mbe/macro18.rs: ...here. + * rust/compile/macro19.rs: Move to... + * rust/compile/macros/mbe/macro19.rs: ...here. + * rust/compile/macro2.rs: Move to... + * rust/compile/macros/mbe/macro2.rs: ...here. + * rust/compile/macro20.rs: Move to... + * rust/compile/macros/mbe/macro20.rs: ...here. + * rust/compile/macro21.rs: Move to... + * rust/compile/macros/mbe/macro21.rs: ...here. + * rust/compile/macro22.rs: Move to... + * rust/compile/macros/mbe/macro22.rs: ...here. + * rust/compile/macro23.rs: Move to... + * rust/compile/macros/mbe/macro23.rs: ...here. + * rust/compile/macro25.rs: Move to... + * rust/compile/macros/mbe/macro25.rs: ...here. + * rust/compile/macro26.rs: Move to... + * rust/compile/macros/mbe/macro26.rs: ...here. + * rust/compile/macro27.rs: Move to... + * rust/compile/macros/mbe/macro27.rs: ...here. + * rust/compile/macro28.rs: Move to... + * rust/compile/macros/mbe/macro28.rs: ...here. + * rust/compile/macro29.rs: Move to... + * rust/compile/macros/mbe/macro29.rs: ...here. + * rust/compile/macro3.rs: Move to... + * rust/compile/macros/mbe/macro3.rs: ...here. + * rust/compile/macro30.rs: Move to... + * rust/compile/macros/mbe/macro30.rs: ...here. + * rust/compile/macro31.rs: Move to... + * rust/compile/macros/mbe/macro31.rs: ...here. + * rust/compile/macro32.rs: Move to... + * rust/compile/macros/mbe/macro32.rs: ...here. + * rust/compile/macro33.rs: Move to... + * rust/compile/macros/mbe/macro33.rs: ...here. + * rust/compile/macro34.rs: Move to... + * rust/compile/macros/mbe/macro34.rs: ...here. + * rust/compile/macro35.rs: Move to... + * rust/compile/macros/mbe/macro35.rs: ...here. + * rust/compile/macro36.rs: Move to... + * rust/compile/macros/mbe/macro36.rs: ...here. + * rust/compile/macro37.rs: Move to... + * rust/compile/macros/mbe/macro37.rs: ...here. + * rust/compile/macro38.rs: Move to... + * rust/compile/macros/mbe/macro38.rs: ...here. + * rust/compile/macro39.rs: Move to... + * rust/compile/macros/mbe/macro39.rs: ...here. + * rust/compile/macro4.rs: Move to... + * rust/compile/macros/mbe/macro4.rs: ...here. + * rust/compile/macro40.rs: Move to... + * rust/compile/macros/mbe/macro40.rs: ...here. + * rust/compile/macro41.rs: Move to... + * rust/compile/macros/mbe/macro41.rs: ...here. + * rust/compile/macro42.rs: Move to... + * rust/compile/macros/mbe/macro42.rs: ...here. + * rust/compile/macro43.rs: Move to... + * rust/compile/macros/mbe/macro43.rs: ...here. + * rust/compile/macro44.rs: Move to... + * rust/compile/macros/mbe/macro44.rs: ...here. + * rust/compile/macro45.rs: Move to... + * rust/compile/macros/mbe/macro45.rs: ...here. + * rust/compile/macro46.rs: Move to... + * rust/compile/macros/mbe/macro46.rs: ...here. + * rust/compile/macro47.rs: Move to... + * rust/compile/macros/mbe/macro47.rs: ...here. + * rust/compile/macro48.rs: Move to... + * rust/compile/macros/mbe/macro48.rs: ...here. + * rust/compile/macro49.rs: Move to... + * rust/compile/macros/mbe/macro49.rs: ...here. + * rust/compile/macro5.rs: Move to... + * rust/compile/macros/mbe/macro5.rs: ...here. + * rust/compile/macro50.rs: Move to... + * rust/compile/macros/mbe/macro50.rs: ...here. + * rust/compile/macro51.rs: Move to... + * rust/compile/macros/mbe/macro51.rs: ...here. + * rust/compile/macro52.rs: Move to... + * rust/compile/macros/mbe/macro52.rs: ...here. + * rust/compile/macro53.rs: Move to... + * rust/compile/macros/mbe/macro53.rs: ...here. + * rust/compile/macro54.rs: Move to... + * rust/compile/macros/mbe/macro54.rs: ...here. + * rust/compile/macro55.rs: Move to... + * rust/compile/macros/mbe/macro55.rs: ...here. + * rust/compile/macro56.rs: Move to... + * rust/compile/macros/mbe/macro56.rs: ...here. + * rust/compile/macro57.rs: Move to... + * rust/compile/macros/mbe/macro57.rs: ...here. + * rust/compile/macro6.rs: Move to... + * rust/compile/macros/mbe/macro6.rs: ...here. + * rust/compile/macro7.rs: Move to... + * rust/compile/macros/mbe/macro7.rs: ...here. + * rust/compile/macro8.rs: Move to... + * rust/compile/macros/mbe/macro8.rs: ...here. + * rust/compile/macro9.rs: Move to... + * rust/compile/macros/mbe/macro9.rs: ...here. + * rust/compile/macro_call_statement.rs: Move to... + * rust/compile/macros/mbe/macro_call_statement.rs: ...here. + * rust/compile/macro_export_1.rs: Move to... + * rust/compile/macros/mbe/macro_export_1.rs: ...here. + * rust/compile/macro_return.rs: Move to... + * rust/compile/macros/mbe/macro_return.rs: ...here. + * rust/compile/macro_rules_macro_rules.rs: Move to... + * rust/compile/macros/mbe/macro_rules_macro_rules.rs: ...here. + * rust/compile/macro_use1.rs: Move to... + * rust/compile/macros/mbe/macro_use1.rs: ...here. + * rust/compile/macros/mbe/mbe_macro.exp: New test. + +2025-03-19 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> + + * rust/compile/builtin_macro_compile_error.rs: Move to... + * rust/compile/macros/builtin/compile_error.rs: ...here. + * rust/compile/builtin_macro_concat.rs: Move to... + * rust/compile/macros/builtin/concat.rs: ...here. + * rust/compile/builtin_macro_eager1.rs: Move to... + * rust/compile/macros/builtin/eager1.rs: ...here. + * rust/compile/builtin_macro_eager2.rs: Move to... + * rust/compile/macros/builtin/eager2.rs: ...here. + * rust/compile/builtin_macro_eager3.rs: Move to... + * rust/compile/macros/builtin/eager3.rs: ...here. + * rust/compile/builtin_macro_env.rs: Move to... + * rust/compile/macros/builtin/env.rs: ...here. + * rust/compile/builtin_macro_include_bytes.rs: Move to... + * rust/compile/macros/builtin/include_bytes.rs: ...here. + * rust/compile/builtin_macro_include_bytes_location_info.rs: Move to... + * rust/compile/macros/builtin/include_bytes_location_info.rs: ...here. + * rust/compile/builtin_macro_include_str.rs: Move to... + * rust/compile/macros/builtin/include_str.rs: ...here. + * rust/compile/builtin_macro_include_str_location_info.rs: Move to... + * rust/compile/macros/builtin/include_str_location_info.rs: ...here. + * rust/compile/builtin_macro_not_found.rs: Move to... + * rust/compile/macros/builtin/not_found.rs: ...here. + * rust/compile/builtin_macro_recurse2.rs: Move to... + * rust/compile/macros/builtin/recurse2.rs: ...here. + * rust/compile/macros/builtin/builtin_macro.exp: New test. + * rust/compile/invalid_utf8: Move invalid-utf8 data to... + * rust/compile/macros/builtin/invalid_utf8: ...here. + +2025-03-19 Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> + + * rust/compile/macros/proc/proc_macro.exp: New deja gnu file to execute + proc-macro tests. + * rust/compile/proc_macro_attribute_crate_type.rs: Move to... + * rust/compile/macros/proc/attribute_crate_type.rs: ...here. + * rust/compile/proc_macro_attribute_non_function.rs: Move to... + * rust/compile/macros/proc/attribute_non_function.rs: ...here. + * rust/compile/proc_macro_attribute_non_root_function.rs: Move to... + * rust/compile/macros/proc/attribute_non_root_function.rs: ...here. + * rust/compile/proc_macro_attribute_non_root_method.rs: Move to... + * rust/compile/macros/proc/attribute_non_root_method.rs: ...here. + * rust/compile/proc_macro_attribute_non_root_module.rs: Move to... + * rust/compile/macros/proc/attribute_non_root_module.rs: ...here. + * rust/compile/proc_macro_attribute_private.rs: Move to... + * rust/compile/macros/proc/attribute_private.rs: ...here. + * rust/compile/proc_macro_crate_type.rs: Move to... + * rust/compile/macros/proc/crate_type.rs: ...here. + * rust/compile/proc_macro_derive_crate_type.rs: Move to... + * rust/compile/macros/proc/derive_crate_type.rs: ...here. + * rust/compile/proc_macro_derive_malformed.rs: Move to... + * rust/compile/macros/proc/derive_malformed.rs: ...here. + * rust/compile/proc_macro_derive_non_function.rs: Move to... + * rust/compile/macros/proc/derive_non_function.rs: ...here. + * rust/compile/proc_macro_derive_non_root_function.rs: Move to... + * rust/compile/macros/proc/derive_non_root_function.rs: ...here. + * rust/compile/proc_macro_derive_non_root_module.rs: Move to... + * rust/compile/macros/proc/derive_non_root_module.rs: ...here. + * rust/compile/proc_macro_derive_private.rs: Move to... + * rust/compile/macros/proc/derive_private.rs: ...here. + * rust/compile/proc_macro_non_function.rs: Move to... + * rust/compile/macros/proc/non_function.rs: ...here. + * rust/compile/proc_macro_non_root_function.rs: Move to... + * rust/compile/macros/proc/non_root_function.rs: ...here. + * rust/compile/proc_macro_non_root_method.rs: Move to... + * rust/compile/macros/proc/non_root_method.rs: ...here. + * rust/compile/proc_macro_non_root_module.rs: Move to... + * rust/compile/macros/proc/non_root_module.rs: ...here. + * rust/compile/proc_macro_derive_non_root_method.rs: Move to... + * rust/compile/macros/proc/non_root_trait_method.rs: ...here. + * rust/compile/proc_macro_private.rs: Move to... + * rust/compile/macros/proc/private.rs: ...here. + * rust/compile/proc_macro_pub_function.rs: Move to... + * rust/compile/macros/proc/pub_function.rs: ...here. + * rust/compile/proc_macro_pub_module.rs: Move to... + * rust/compile/macros/proc/pub_module.rs: ...here. + +2025-03-19 Liam Naddell <liam.naddell@mail.utoronto.ca> + + * rust/compile/issue-3045-1.rs: + Add test for #[may_dangle] Generic Type triggering error + * rust/compile/issue-3045-2.rs: + Add test for #[may_dangle] Lifetime triggering error + +2025-03-19 Muhammad Mahad <mahadtxt@gmail.com> + + * rust/rustc/README.md: information about + rustc external directory. + * rust/rustc/rustc.exp: New test. + +2025-03-19 Antonio Gomes <antoniospg100@gmail.com> + + * rust/compile/macro-issue2983_2984.rs: + Add test to check for correct stripped fields + +2025-03-19 Andre Vehreschild <vehre@gcc.gnu.org> + + PR fortran/119272 + * gfortran.dg/associate_74.f90: New test. + +2025-03-19 Jakub Jelinek <jakub@redhat.com> + + PR target/119357 + * gcc.target/i386/avx512vlbw-pr119357.c: New test. + +2025-03-19 Tamar Christina <tamar.christina@arm.com> + + PR target/119286 + * gcc.dg/vect/bb-slp-41.c: Add pragma novector. + * gcc.dg/vect/vect-early-break_133_pfa11.c: Should never vectorize today + as indexes can be out of range. + * gcc.dg/vect/vect-early-break_128.c: Require load_lanes as well. + * gcc.dg/vect/vect-early-break_133_pfa10.c: Likewise. + * gcc.dg/vect/vect-early-break_133_pfa8.c: Likewise. + * gcc.dg/vect/vect-early-break_133_pfa9.c: Likewise. + * gcc.dg/vect/vect-early-break_22.c: Likewise. + * gcc.dg/vect/vect-early-break_26.c: Likewise. + * gcc.dg/vect/vect-early-break_43.c: Likewise. + * gcc.dg/vect/vect-early-break_44.c: Likewise. + * gcc.dg/vect/vect-early-break_6.c: Likewise. + * gcc.dg/vect/vect-early-break_56.c: Expect failures on group misalign. + +2025-03-19 Jakub Jelinek <jakub@redhat.com> + + * gcc.dg/pr: Remove. + +2025-03-19 Jakub Jelinek <jakub@redhat.com> + + PR target/118068 + * g++.target/i386/pr118068.C: New test. + +2025-03-19 Martin Uecker <uecker@tugraz.at> + + PR c/118765 + * gcc.dg/pr118765.c: New test. + +2025-03-19 Martin Uecker <uecker@tugraz.at> + + PR c/118061 + * gcc.dg/pr118061.c: New test. + +2025-03-19 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/generic_inst14.adb: New test. + * gnat.dg/generic_inst14_pkg.ads: New helper. + * gnat.dg/generic_inst14_pkg-child.ads: Likewise. + +2025-03-19 Xi Ruoyao <xry111@xry111.site> + + * gcc.target/loongarch/regname-float-abi.c: New test. + +2025-03-19 liuhongt <hongtao.liu@intel.com> + + PR target/117069 + * gcc.target/i386/apx-ndd-tls-1b.c: Add xfail. + +2025-03-18 Marek Polacek <polacek@redhat.com> + + PR c++/119344 + * g++.dg/conversion/ptrmem10.C: New test. + +2025-03-18 Jason Merrill <jason@redhat.com> + + PR c++/119194 + * g++.dg/template/linkage7.C: New test. + +2025-03-18 Marek Polacek <polacek@redhat.com> + + PR c++/118104 + * g++.dg/cpp0x/alias-decl-variadic3.C: New test. + +2025-03-18 Harald Anlauf <anlauf@gmx.de> + + PR fortran/119338 + * gfortran.dg/deferred_character_18.f90: Adjust testcase. + * gfortran.dg/allocate_assumed_charlen_5.f90: New test. + +2025-03-18 Jakub Jelinek <jakub@redhat.com> + + PR c/119311 + * c-c++-common/musttail14.c: Use * instead of \* in the regexps. + * c-c++-common/musttail25.c: New test. + +2025-03-18 Jakub Jelinek <jakub@redhat.com> + + PR c/116545 + * c-c++-common/attr-fallthrough-2.c: Adjust expected diagnostics + for C++. + * c-c++-common/musttail15.c: New test. + * c-c++-common/musttail16.c: New test. + * c-c++-common/musttail17.c: New test. + * c-c++-common/musttail18.c: New test. + * c-c++-common/musttail19.c: New test. + * c-c++-common/musttail20.c: New test. + * c-c++-common/musttail21.c: New test. + * c-c++-common/musttail22.c: New test. + * c-c++-common/musttail23.c: New test. + * c-c++-common/musttail24.c: New test. + * g++.dg/musttail7.C: New test. + * g++.dg/musttail8.C: New test. + * g++.dg/musttail12.C: New test. + * g++.dg/musttail13.C: New test. + * g++.dg/musttail14.C: New test. + * g++.dg/ext/pr116545.C: New test. + +2025-03-18 Bob Dubner <rdubner@symas.com> + + * cobol.dg/group1/check_88.cob: New testcase. + * cobol.dg/group1/comp5.cob: Likewise. + * cobol.dg/group1/declarative_1.cob: Likewise. + * cobol.dg/group1/display.cob: Likewise. + * cobol.dg/group1/display2.cob: Likewise. + * cobol.dg/group1/line-sequential.cob: Likewise. + * cobol.dg/group1/multiple-compares.cob: Likewise. + * cobol.dg/group1/multiply2.cob: Likewise. + * cobol.dg/group1/packed.cob: Likewise. + * cobol.dg/group1/perform-nested-exit.cob: Likewise. + * cobol.dg/group1/pointer1.cob: Likewise. + * cobol.dg/group1/simple-arithmetic.cob: Likewise. + * cobol.dg/group1/simple-classes.cob: Likewise. + * cobol.dg/group1/simple-if.cob: Likewise. + * cobol.dg/group1/simple-perform.cob: Likewise. + +2025-03-18 Jakub Jelinek <jakub@redhat.com> + + * lib/gcc-dg.exp (${tool}-load): If output-file is set, compare + combined output against content of the [lindex ${output-file} 1] + file. + (dg-output-file): New directive. + * lib/dg-test-cleanup.exp (cleanup-after-saved-dg-test): Clear + output-file variable. + * gcc.dg/dg-output-file-1.c: New test. + * gcc.dg/dg-output-file-1-lp64.txt: New test. + * gcc.dg/dg-output-file-1-ilp32.txt: New test. + +2025-03-18 Patrick Palka <ppalka@redhat.com> + + PR c++/119233 + * g++.dg/template/fn-ptr5.C: New test. + +2025-03-18 Jakub Jelinek <jakub@redhat.com> + + PR rtl-optimization/119307 + * gcc.target/i386/pr119307.c: New test. + +2025-03-18 Richard Biener <rguenther@suse.de> + + PR debug/101533 + * g++.dg/debug/pr101533.C: New testcase. + +2025-03-18 Haochen Jiang <haochen.jiang@intel.com> + + * gcc.target/i386/avx512f-pr103750-1.c: Remove XFAIL. + * gcc.target/i386/avx512f-pr103750-2.c: Ditto. + * gcc.target/i386/avx512fp16-pr103750-1.c: Ditto. + * gcc.target/i386/avx512fp16-pr103750-2.c: Ditto. + +2025-03-18 Jeff Law <jlaw@ventanamicro.com> + + * gcc.target/riscv/redundant-andi-2.c: New test. + 2025-03-17 Jeff Law <jlaw@ventanamicro.com> * gcc.target/riscv/redundant-andi.c: New test. diff --git a/gcc/testsuite/g++.dg/abi/mangle-new1.C b/gcc/testsuite/g++.dg/abi/mangle-new1.C new file mode 100644 index 0000000..bb3ea9b --- /dev/null +++ b/gcc/testsuite/g++.dg/abi/mangle-new1.C @@ -0,0 +1,10 @@ +// PR c++/119316 +// { dg-do compile { target c++11 } } + +template <unsigned> struct A { }; +template<typename T> +auto foo(unsigned n) -> A<sizeof(new T[n])> +{ return {}; } +int main() { foo<int>(5); } + +// { dg-final { scan-assembler {_Z3fooIiE1AIXszna_Afp__T_EEEj} } } diff --git a/gcc/testsuite/g++.dg/conversion/ptrmem10.C b/gcc/testsuite/g++.dg/conversion/ptrmem10.C new file mode 100644 index 0000000..b5fc050 --- /dev/null +++ b/gcc/testsuite/g++.dg/conversion/ptrmem10.C @@ -0,0 +1,14 @@ +// PR c++/119344 +// { dg-do compile { target c++11 } } + +struct S { + void fn(); +}; +typedef void (S::*T)(void); +template <T Ptr> +struct s +{ + static const bool t = Ptr != T(); +}; + +int t1 = s<&S::fn>::t; diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-variadic3.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-variadic3.C new file mode 100644 index 0000000..077f033 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-variadic3.C @@ -0,0 +1,22 @@ +// PR c++/118104 +// { dg-do compile { target c++11 } } + +template<typename... Zs> struct Z { }; + +template <class... Ts> struct X { + template <class... Us> using W = Z<void(Ts, Us)...>; + template <class... Us> using Y = X<void(Ts, Us)...>; +}; + +template <class A, class... P> +using foo = X<int, int>::W<A, P...>; + +template <class A, class... P> +using bar = X<int, int>::Y<A, P...>; + +void +g () +{ + foo<int, int> f; + bar<int, int> b; +} diff --git a/gcc/testsuite/g++.dg/gomp/pr119370.C b/gcc/testsuite/g++.dg/gomp/pr119370.C new file mode 100644 index 0000000..9ecc9b7 --- /dev/null +++ b/gcc/testsuite/g++.dg/gomp/pr119370.C @@ -0,0 +1,10 @@ +// PR c++/119370 +// { dg-do compile } + +#pragma omp declare target +struct S { + int s; + S () : s (0) {} +}; +S a[2]; +#pragma omp end declare target diff --git a/gcc/testsuite/g++.dg/template/linkage7.C b/gcc/testsuite/g++.dg/template/linkage7.C new file mode 100644 index 0000000..6686a0e --- /dev/null +++ b/gcc/testsuite/g++.dg/template/linkage7.C @@ -0,0 +1,17 @@ +// PR c++/119194 +// { dg-do compile { target c++11 } } + +template <const int& Str> +[[gnu::noipa]] +int get_length() { + return Str; +} +static constexpr int sssss{ 3}; +int main() { + if (get_length<sssss>() != sssss) + __builtin_abort(); + return 0; +} + +// { dg-final { scan-assembler {_Z10get_lengthIL_ZL5sssssEEiv} } } +// { dg-final { scan-assembler-not {(weak|glob)[^\n]*_Z10get_lengthIL_Z5sssssEEiv} } } diff --git a/gcc/testsuite/g++.target/i386/pr118068.C b/gcc/testsuite/g++.target/i386/pr118068.C new file mode 100644 index 0000000..c5cc61f --- /dev/null +++ b/gcc/testsuite/g++.target/i386/pr118068.C @@ -0,0 +1,17 @@ +// PR target/118068 +// { dg-do compile { target c++20 } } +// { dg-options "-O0 -mavx" } + +typedef float V __attribute__((vector_size (32))); + +consteval unsigned char +foo (int x) +{ + return x; +} + +V +bar (V x, V y) +{ + return __builtin_ia32_blendps256 (x, y, (int) foo (0x23)); +} diff --git a/gcc/testsuite/gcc.dg/Wfatal-bad-attr-pr119366.c b/gcc/testsuite/gcc.dg/Wfatal-bad-attr-pr119366.c new file mode 100644 index 0000000..2ca4eed --- /dev/null +++ b/gcc/testsuite/gcc.dg/Wfatal-bad-attr-pr119366.c @@ -0,0 +1,8 @@ +/* Verify that we don't crash if we bail out with a fatal error + while an on-stack attribute_urlifier is active (PR c/119366). */ +/* { dg-options "-Wfatal-errors -Werror=attributes" } */ +void foo() __attribute__((this_does_not_exist)); /* { dg-error "'this_does_not_exist' attribute directive ignored" } */ + +/* { dg-message "some warnings being treated as errors" "treated as errors" {target "*-*-*"} 0 } */ +/* { dg-message "terminated due to -Wfatal-errors" "terminated" { target *-*-* } 0 } */ + diff --git a/gcc/testsuite/gcc.dg/Wfree-nonheap-object-7.c b/gcc/testsuite/gcc.dg/Wfree-nonheap-object-7.c index 52cfbf9..c13b7ca 100644 --- a/gcc/testsuite/gcc.dg/Wfree-nonheap-object-7.c +++ b/gcc/testsuite/gcc.dg/Wfree-nonheap-object-7.c @@ -1,9 +1,9 @@ /* { dg-do compile } */ -/* { dg-options "-std=gnu17 -O2 -Wfree-nonheap-object" } */ +/* { dg-options "-O2 -Wfree-nonheap-object" } */ struct local_caches *get_local_caches_lcs; -void *calloc(long, long); -void *realloc(); +void *calloc(__SIZE_TYPE__, __SIZE_TYPE__); +void *realloc(void *, __SIZE_TYPE__); struct local_caches { int *t_mem_caches; diff --git a/gcc/testsuite/gcc.dg/pr b/gcc/testsuite/gcc.dg/pr deleted file mode 100644 index e69de29..0000000 --- a/gcc/testsuite/gcc.dg/pr +++ /dev/null diff --git a/gcc/testsuite/gcc.dg/pr118061.c b/gcc/testsuite/gcc.dg/pr118061.c new file mode 100644 index 0000000..6efc94d --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr118061.c @@ -0,0 +1,8 @@ +/* { dg-do "compile" } */ +/* { dg-options "-std=gnu23" } */ + +int main() +{ + struct { int x[1++]; } x; /* { dg-error "lvalue required as increment operand" } */ + struct { int x[1++]; } y; /* { dg-error "lvalue required as increment operand" } */ +} diff --git a/gcc/testsuite/gcc.dg/pr118765.c b/gcc/testsuite/gcc.dg/pr118765.c new file mode 100644 index 0000000..12d0259 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr118765.c @@ -0,0 +1,7 @@ +/* { dg-do "compile" } */ +/* { dg-options "-std=gnu23" } */ + +typedef struct q { int x; } q_t; +struct q { int x; }; +typedef struct q { int x; } q_t; + diff --git a/gcc/testsuite/gcc.dg/pr119350-1.c b/gcc/testsuite/gcc.dg/pr119350-1.c new file mode 100644 index 0000000..75ab290 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr119350-1.c @@ -0,0 +1,14 @@ +/* PR c/119350 */ +/* { dg-do compile } */ +/* { dg-options "-std=c23 -pedantic-errors" } */ + +struct S { int a; int b[]; }; +struct T { struct S c; }; /* { dg-error "invalid use of structure with flexible array member" } */ +struct S d = { 1, {} }; /* { dg-error "initialization of a flexible array member" } */ +struct S e = { 1, { 2 } }; /* { dg-error "initialization of a flexible array member" } */ +struct S f = { .a = 1, .b = {} }; /* { dg-error "initialization of a flexible array member" } */ +struct S g = { .a = 1, .b = { 2 } }; /* { dg-error "initialization of a flexible array member" } */ +struct T h = { { 1, {} } }; /* { dg-error "initialization of flexible array member in a nested context" } */ +struct T i = { { 1, { 2 } } }; /* { dg-error "initialization of flexible array member in a nested context" } */ +struct T j = { .c = { .a = 1, .b = {} } }; /* { dg-error "initialization of flexible array member in a nested context" } */ +struct T k = { .c = { .a = 1, .b = { 2 } } }; /* { dg-error "initialization of flexible array member in a nested context" } */ diff --git a/gcc/testsuite/gcc.dg/pr119350-2.c b/gcc/testsuite/gcc.dg/pr119350-2.c new file mode 100644 index 0000000..ddb3502 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr119350-2.c @@ -0,0 +1,14 @@ +/* PR c/119350 */ +/* { dg-do compile } */ +/* { dg-options "-std=c23 -Wpedantic" } */ + +struct S { int a; int b[]; }; +struct T { struct S c; }; /* { dg-warning "invalid use of structure with flexible array member" } */ +struct S d = { 1, {} }; /* { dg-warning "initialization of a flexible array member" } */ +struct S e = { 1, { 2 } }; /* { dg-warning "initialization of a flexible array member" } */ +struct S f = { .a = 1, .b = {} }; /* { dg-warning "initialization of a flexible array member" } */ +struct S g = { .a = 1, .b = { 2 } }; /* { dg-warning "initialization of a flexible array member" } */ +struct T h = { { 1, {} } }; /* { dg-warning "initialization of flexible array member in a nested context" } */ +struct T i = { { 1, { 2 } } }; /* { dg-error "initialization of flexible array member in a nested context" } */ +struct T j = { .c = { .a = 1, .b = {} } }; /* { dg-warning "initialization of flexible array member in a nested context" } */ +struct T k = { .c = { .a = 1, .b = { 2 } } }; /* { dg-error "initialization of flexible array member in a nested context" } */ diff --git a/gcc/testsuite/gcc.dg/pr119350-3.c b/gcc/testsuite/gcc.dg/pr119350-3.c new file mode 100644 index 0000000..20c2b56 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr119350-3.c @@ -0,0 +1,14 @@ +/* PR c/119350 */ +/* { dg-do compile } */ +/* { dg-options "-std=c23 -Wc11-c23-compat" } */ + +struct S { int a; int b[]; }; +struct T { struct S c; }; +struct S d = { 1, {} }; /* { dg-warning "ISO C forbids empty initializer braces before C23" } */ +struct S e = { 1, { 2 } }; +struct S f = { .a = 1, .b = {} }; /* { dg-warning "ISO C forbids empty initializer braces before C23" } */ +struct S g = { .a = 1, .b = { 2 } }; +struct T h = { { 1, {} } }; /* { dg-warning "ISO C forbids empty initializer braces before C23" } */ +struct T i = { { 1, { 2 } } }; /* { dg-error "initialization of flexible array member in a nested context" } */ +struct T j = { .c = { .a = 1, .b = {} } }; /* { dg-warning "ISO C forbids empty initializer braces before C23" } */ +struct T k = { .c = { .a = 1, .b = { 2 } } }; /* { dg-error "initialization of flexible array member in a nested context" } */ diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-41.c b/gcc/testsuite/gcc.dg/vect/bb-slp-41.c index 7224511..5a2bd4d 100644 --- a/gcc/testsuite/gcc.dg/vect/bb-slp-41.c +++ b/gcc/testsuite/gcc.dg/vect/bb-slp-41.c @@ -51,6 +51,7 @@ int main () foo (a1, b); bar (a2, b); +#pragma GCC novector for (i = 0; i < ARR_SIZE; i++) if (a1[i] != a2[i]) return 1; diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_128.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_128.c index ed6baf2d..3d51d52 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-early-break_128.c +++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_128.c @@ -3,8 +3,8 @@ /* { dg-require-effective-target vect_early_break } */ /* { dg-require-effective-target vect_int } */ -/* { dg-final { scan-tree-dump "vectorizing stmts using SLP" "vect" { target vect_partial_vectors } } } */ -/* { dg-final { scan-tree-dump-not "vectorizing stmts using SLP" "vect" { target { ! vect_partial_vectors } } } } */ +/* { dg-final { scan-tree-dump "vectorizing stmts using SLP" "vect" { target { vect_partial_vectors && vect_load_lanes } } } } */ +/* { dg-final { scan-tree-dump-not "vectorizing stmts using SLP" "vect" { target { { ! vect_partial_vectors } || { ! vect_load_lanes } } } } } */ /* { dg-final { scan-tree-dump "Loop contains only SLP stmts" "vect" } } */ #ifndef N diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_133_pfa10.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_133_pfa10.c index dd05046..2a58fb0 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-early-break_133_pfa10.c +++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_133_pfa10.c @@ -6,9 +6,9 @@ /* { dg-additional-options "-Ofast" } */ /* Alignment requirement too big, load lanes targets can't safely vectorize this. */ -/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" { target { vect_partial_vectors || vect_load_lanes } } } } */ -/* { dg-final { scan-tree-dump-not "LOOP VECTORIZED" "vect" { target { ! { vect_partial_vectors || vect_load_lanes } } } } } */ -/* { dg-final { scan-tree-dump-not "Alignment of access forced using peeling" "vect" { target { ! { vect_partial_vectors || vect_load_lanes } } } } } */ +/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" { target { vect_load_lanes } } } } */ +/* { dg-final { scan-tree-dump-not "LOOP VECTORIZED" "vect" { target { ! vect_load_lanes } } } } */ +/* { dg-final { scan-tree-dump-not "Alignment of access forced using peeling" "vect" { target { ! vect_load_lanes } } } } */ unsigned test4(char x, char *restrict vect_a, char *restrict vect_b, int n) { diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_133_pfa11.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_133_pfa11.c index 085dd9b..514bd37 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-early-break_133_pfa11.c +++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_133_pfa11.c @@ -3,9 +3,8 @@ /* { dg-require-effective-target vect_early_break } */ /* { dg-require-effective-target vect_int } */ -/* Gathers and scatters are not save to speculate across early breaks. */ -/* { dg-final { scan-tree-dump-not "LOOP VECTORIZED" "vect" { target { ! vect_partial_vectors } } } } */ -/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" { target vect_partial_vectors } } } */ +/* Gathers and scatters are not safe to speculate across early breaks. */ +/* { dg-final { scan-tree-dump-not "LOOP VECTORIZED" "vect" } } */ #define N 1024 int vect_a[N]; diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_133_pfa8.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_133_pfa8.c index 25d3a62..90e5998 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-early-break_133_pfa8.c +++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_133_pfa8.c @@ -5,8 +5,8 @@ /* { dg-additional-options "-Ofast" } */ -/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" { target vect_partial_vectors } } } */ -/* { dg-final { scan-tree-dump-not "LOOP VECTORIZED" "vect" { target { ! vect_partial_vectors } } } } */ +/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" { target { vect_partial_vectors && vect_load_lanes } } } } */ +/* { dg-final { scan-tree-dump-not "LOOP VECTORIZED" "vect" { target { { ! vect_partial_vectors } || { ! vect_load_lanes } } } } } */ char vect_a[1025]; char vect_b[1025]; diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_133_pfa9.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_133_pfa9.c index 10eb98b..fa2b32e 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-early-break_133_pfa9.c +++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_133_pfa9.c @@ -6,8 +6,8 @@ /* { dg-additional-options "-Ofast" } */ /* Group size is uneven and second group is misaligned. Needs partial vectors. */ -/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" { target vect_partial_vectors } } } */ -/* { dg-final { scan-tree-dump-not "LOOP VECTORIZED" "vect" { target { ! vect_partial_vectors } } } } */ +/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" { target { vect_partial_vectors && vect_load_lanes } } } } */ +/* { dg-final { scan-tree-dump-not "LOOP VECTORIZED" "vect" { target { { ! vect_partial_vectors } || { ! vect_load_lanes } } } } } */ /* { dg-final { scan-tree-dump-not "Alignment of access forced using peeling" "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_22.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_22.c index f8f84fa..8e91ac6 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-early-break_22.c +++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_22.c @@ -43,5 +43,5 @@ main () } /* This will fail because we cannot SLP the load groups yet. */ -/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 2 "vect" { target vect_partial_vectors } } } */ -/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 1 "vect" { target { ! vect_partial_vectors } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 2 "vect" { target { vect_partial_vectors && vect_load_lanes } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 1 "vect" { target { { ! vect_partial_vectors } || { ! vect_load_lanes } } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_26.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_26.c index 643016b..f6688fc 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-early-break_26.c +++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_26.c @@ -42,5 +42,5 @@ main () } /* This will fail because we cannot SLP the load groups yet. */ -/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 2 "vect" { target vect_partial_vectors } } } */ -/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 1 "vect" { target { ! vect_partial_vectors } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 2 "vect" { target { vect_partial_vectors && vect_load_lanes } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 1 "vect" { target { { ! vect_partial_vectors } || { ! vect_load_lanes } } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_43.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_43.c index 0cfa242..e6866de 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-early-break_43.c +++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_43.c @@ -28,5 +28,5 @@ unsigned test4(unsigned x) } /* This will fail because we cannot SLP the load groups yet. */ -/* { dg-final { scan-tree-dump "vectorized 1 loops in function" "vect" { target vect_partial_vectors } } } */ -/* { dg-final { scan-tree-dump-not "vectorized 1 loops in function" "vect" { target { ! vect_partial_vectors } } } } */ +/* { dg-final { scan-tree-dump "vectorized 1 loops in function" "vect" { target { vect_partial_vectors && vect_load_lanes } } } } */ +/* { dg-final { scan-tree-dump-not "vectorized 1 loops in function" "vect" { target { { ! vect_partial_vectors } || { ! vect_load_lanes } } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_44.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_44.c index 0cfa242..e6866de 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-early-break_44.c +++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_44.c @@ -28,5 +28,5 @@ unsigned test4(unsigned x) } /* This will fail because we cannot SLP the load groups yet. */ -/* { dg-final { scan-tree-dump "vectorized 1 loops in function" "vect" { target vect_partial_vectors } } } */ -/* { dg-final { scan-tree-dump-not "vectorized 1 loops in function" "vect" { target { ! vect_partial_vectors } } } } */ +/* { dg-final { scan-tree-dump "vectorized 1 loops in function" "vect" { target { vect_partial_vectors && vect_load_lanes } } } } */ +/* { dg-final { scan-tree-dump-not "vectorized 1 loops in function" "vect" { target { { ! vect_partial_vectors } || { ! vect_load_lanes } } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_56.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_56.c index b35e737..76a1f9b 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-early-break_56.c +++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_56.c @@ -99,5 +99,5 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 2 "vect" { xfail { vect_early_break && { ! vect_hw_misalign } } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail { vect_early_break && { ! vect_hw_misalign } } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_6.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_6.c index c7cce81..485cee6 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-early-break_6.c +++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_6.c @@ -6,8 +6,8 @@ /* { dg-additional-options "-Ofast" } */ /* This will fail because we cannot SLP the load groups yet. */ -/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" { target vect_partial_vectors } } } */ -/* { dg-final { scan-tree-dump-not "LOOP VECTORIZED" "vect" { target { ! vect_partial_vectors } } } } */ +/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" { target { vect_partial_vectors && vect_load_lanes } } } } */ +/* { dg-final { scan-tree-dump-not "LOOP VECTORIZED" "vect" { target { { ! vect_partial_vectors } || { ! vect_load_lanes } } } } } */ #define N 1024 unsigned vect_a[N]; 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 d063703..afcad0c 100644 --- a/gcc/testsuite/gcc.target/i386/apx-ndd-tls-1b.c +++ b/gcc/testsuite/gcc.target/i386/apx-ndd-tls-1b.c @@ -3,7 +3,10 @@ /* { dg-require-effective-target tls } */ /* { dg-require-effective-target code_6_gottpoff_reloc } */ /* { dg-options "-save-temps -std=gnu17 -mapxf -O3 -w" } */ - +/* The testcase is fragile, it's supposed to check the compiler + ability of generating code_6_gottpoff_reloc instruction, but + failed since there's a seg_prefixed memory + 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 { target lp64 } } } */ +/* { dg-final { scan-assembler-times "addq\[ \t]+%r\[a-z0-9\]+, a@gottpoff\\(%rip\\), %r\[a-z0-9\]+" 1 { xfail lp64 } } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-satcvt-1.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-satcvt-1.c index 341d258..dd24216 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-satcvt-1.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-512-satcvt-1.c @@ -1,27 +1,43 @@ /* { dg-do compile } */ /* { dg-options "-O2 -march=x86-64-v3 -mavx10.2-512" } */ -/* { dg-final { scan-assembler-times "vcvtph2ibs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { 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 } } */ /* { dg-final { scan-assembler-times "vcvtph2ibs\[ \\t\]+\{rn-sae\}\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtph2ibs\[ \\t\]+\{rz-sae\}\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ -/* { dg-final { scan-assembler-times "vcvtph2iubs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvtph2iubs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vcvtph2iubs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvtph2iubs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtph2iubs\[ \\t\]+\{rn-sae\}\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtph2iubs\[ \\t\]+\{rz-sae\}\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ -/* { dg-final { scan-assembler-times "vcvttph2ibs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttph2ibs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vcvttph2ibs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttph2ibs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttph2ibs\[ \\t\]+\{sae\}\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttph2ibs\[ \\t\]+\{sae\}\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ -/* { dg-final { scan-assembler-times "vcvttph2iubs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttph2iubs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vcvttph2iubs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttph2iubs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttph2iubs\[ \\t\]+\{sae\}\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttph2iubs\[ \\t\]+\{sae\}\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ -/* { dg-final { scan-assembler-times "vcvtps2ibs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvtps2ibs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vcvtps2ibs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvtps2ibs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtps2ibs\[ \\t\]+\{rn-sae\}\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtps2ibs\[ \\t\]+\{rz-sae\}\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ -/* { dg-final { scan-assembler-times "vcvtps2iubs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvtps2iubs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vcvtps2iubs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvtps2iubs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtps2iubs\[ \\t\]+\{rn-sae\}\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtps2iubs\[ \\t\]+\{rz-sae\}\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ -/* { dg-final { scan-assembler-times "vcvttps2ibs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttps2ibs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vcvttps2ibs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttps2ibs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttps2ibs\[ \\t\]+\{sae\}\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttps2ibs\[ \\t\]+\{sae\}\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ -/* { dg-final { scan-assembler-times "vcvttps2iubs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttps2iubs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vcvttps2iubs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttps2iubs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttps2iubs\[ \\t\]+\{sae\}\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttps2iubs\[ \\t\]+\{sae\}\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtbf162ibs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ @@ -36,27 +52,51 @@ /* { dg-final { scan-assembler-times "vcvttbf162iubs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttbf162iubs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttbf162iubs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttpd2dqs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttpd2dqs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttpd2dqs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttpd2dqs\[ \\t\]+\{sae\}\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttpd2dqs\[ \\t\]+\{sae\}\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttpd2dqs\[ \\t\]+\{sae\}\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttpd2qqs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttpd2qqs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttpd2qqs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttpd2qqs\[ \\t\]+\{sae\}\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttpd2qqs\[ \\t\]+\{sae\}\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttpd2qqs\[ \\t\]+\{sae\}\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttpd2udqs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttpd2udqs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttpd2udqs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttpd2udqs\[ \\t\]+\{sae\}\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttpd2udqs\[ \\t\]+\{sae\}\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttpd2udqs\[ \\t\]+\{sae\}\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttpd2uqqs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttpd2uqqs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttpd2uqqs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttpd2uqqs\[ \\t\]+\{sae\}\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttpd2uqqs\[ \\t\]+\{sae\}\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttpd2uqqs\[ \\t\]+\{sae\}\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttps2dqs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttps2dqs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttps2dqs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttps2dqs\[ \\t\]+\{sae\}\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttps2dqs\[ \\t\]+\{sae\}\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttps2dqs\[ \\t\]+\{sae\}\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttps2qqs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttps2qqs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttps2qqs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttps2qqs\[ \\t\]+\{sae\}\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttps2qqs\[ \\t\]+\{sae\}\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttps2qqs\[ \\t\]+\{sae\}\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttps2udqs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttps2udqs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttps2udqs\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttps2udqs\[ \\t\]+\{sae\}\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttps2udqs\[ \\t\]+\{sae\}\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttps2udqs\[ \\t\]+\{sae\}\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttps2uqqs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttps2uqqs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttps2uqqs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttps2uqqs\[ \\t\]+\{sae\}\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttps2uqqs\[ \\t\]+\{sae\}\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttps2uqqs\[ \\t\]+\{sae\}\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ @@ -77,82 +117,130 @@ volatile __mmask32 m32; void extern avx10_2_test (void) { - xi = _mm512_ipcvt_roundph_epi16 (xh, 4); - xi = _mm512_mask_ipcvt_roundph_epi16 (xi, m32, xh, 8); - xi = _mm512_maskz_ipcvt_roundph_epi16 (m32, xh, 11); - - xi = _mm512_ipcvt_roundph_epu16 (xh, 4); - xi = _mm512_mask_ipcvt_roundph_epu16 (xi, m32, xh, 8); - xi = _mm512_maskz_ipcvt_roundph_epu16 (m32, xh, 11); - - xi = _mm512_ipcvtt_roundph_epi16 (xh, 4); - xi = _mm512_mask_ipcvtt_roundph_epi16 (xi, m32, xh, 8); - xi = _mm512_maskz_ipcvtt_roundph_epi16 (m32, xh, 8); - - xi = _mm512_ipcvtt_roundph_epu16 (xh, 4); - xi = _mm512_mask_ipcvtt_roundph_epu16 (xi, m32, xh, 8); - xi = _mm512_maskz_ipcvtt_roundph_epu16 (m32, xh, 8); - - xi = _mm512_ipcvt_roundps_epi32 (x, 4); - xi = _mm512_mask_ipcvt_roundps_epi32 (xi, m16, x, 8); - xi = _mm512_maskz_ipcvt_roundps_epi32 (m16, x, 11); - - xi = _mm512_ipcvt_roundps_epu32 (x, 4); - xi = _mm512_mask_ipcvt_roundps_epu32 (xi, m16, x, 8); - xi = _mm512_maskz_ipcvt_roundps_epu32 (m16, x, 11); - - xi = _mm512_ipcvtt_roundps_epi32 (x, 4); - xi = _mm512_mask_ipcvtt_roundps_epi32 (xi, m16, x, 8); - xi = _mm512_maskz_ipcvtt_roundps_epi32 (m16, x, 8); - - xi = _mm512_ipcvtt_roundps_epu32 (x, 4); - xi = _mm512_mask_ipcvtt_roundps_epu32 (xi, m16, x, 8); - xi = _mm512_maskz_ipcvtt_roundps_epu32 (m16, x, 8); - - xi = _mm512_ipcvtbf16_epi16 (xbh); - xi = _mm512_mask_ipcvtbf16_epi16 (xi, m32, xbh); - xi = _mm512_maskz_ipcvtbf16_epi16 (m32, xbh); - - xi = _mm512_ipcvtbf16_epu16 (xbh); - xi = _mm512_mask_ipcvtbf16_epu16 (xi, m32, xbh); - xi = _mm512_maskz_ipcvtbf16_epu16 (m32, xbh); - - xi = _mm512_ipcvttbf16_epi16 (xbh); - xi = _mm512_mask_ipcvttbf16_epi16 (xi, m32, xbh); - xi = _mm512_maskz_ipcvttbf16_epi16 (m32, xbh); - - xi = _mm512_ipcvttbf16_epu16 (xbh); - xi = _mm512_mask_ipcvttbf16_epu16 (xi, m32, xbh); - xi = _mm512_maskz_ipcvttbf16_epu16 (m32, xbh); - + xi = _mm512_ipcvts_ph_epi8 (xh); + xi = _mm512_mask_ipcvts_ph_epi8 (xi, m32, xh); + xi = _mm512_maskz_ipcvts_ph_epi8 (m32, xh); + xi = _mm512_ipcvts_roundph_epi8 (xh, 4); + xi = _mm512_mask_ipcvts_roundph_epi8 (xi, m32, xh, 8); + xi = _mm512_maskz_ipcvts_roundph_epi8 (m32, xh, 11); + + xi = _mm512_ipcvts_ph_epu8 (xh); + xi = _mm512_mask_ipcvts_ph_epu8 (xi, m32, xh); + xi = _mm512_maskz_ipcvts_ph_epu8 (m32, xh); + xi = _mm512_ipcvts_roundph_epu8 (xh, 4); + xi = _mm512_mask_ipcvts_roundph_epu8 (xi, m32, xh, 8); + xi = _mm512_maskz_ipcvts_roundph_epu8 (m32, xh, 11); + + xi = _mm512_ipcvtts_ph_epi8 (xh); + xi = _mm512_mask_ipcvtts_ph_epi8 (xi, m32, xh); + xi = _mm512_maskz_ipcvtts_ph_epi8 (m32, xh); + xi = _mm512_ipcvtts_roundph_epi8 (xh, 4); + xi = _mm512_mask_ipcvtts_roundph_epi8 (xi, m32, xh, 8); + xi = _mm512_maskz_ipcvtts_roundph_epi8 (m32, xh, 8); + + xi = _mm512_ipcvtts_ph_epu8 (xh); + xi = _mm512_mask_ipcvtts_ph_epu8 (xi, m32, xh); + xi = _mm512_maskz_ipcvtts_ph_epu8 (m32, xh); + xi = _mm512_ipcvtts_roundph_epu8 (xh, 4); + xi = _mm512_mask_ipcvtts_roundph_epu8 (xi, m32, xh, 8); + xi = _mm512_maskz_ipcvtts_roundph_epu8 (m32, xh, 8); + + xi = _mm512_ipcvts_ps_epi8 (x); + xi = _mm512_mask_ipcvts_ps_epi8 (xi, m16, x); + xi = _mm512_maskz_ipcvts_ps_epi8 (m16, x); + xi = _mm512_ipcvts_roundps_epi8 (x, 4); + xi = _mm512_mask_ipcvts_roundps_epi8 (xi, m16, x, 8); + xi = _mm512_maskz_ipcvts_roundps_epi8 (m16, x, 11); + + xi = _mm512_ipcvts_ps_epu8 (x); + xi = _mm512_mask_ipcvts_ps_epu8 (xi, m16, x); + xi = _mm512_maskz_ipcvts_ps_epu8 (m16, x); + xi = _mm512_ipcvts_roundps_epu8 (x, 4); + xi = _mm512_mask_ipcvts_roundps_epu8 (xi, m16, x, 8); + xi = _mm512_maskz_ipcvts_roundps_epu8 (m16, x, 11); + + xi = _mm512_ipcvtts_ps_epi8 (x); + xi = _mm512_mask_ipcvtts_ps_epi8 (xi, m16, x); + xi = _mm512_maskz_ipcvtts_ps_epi8 (m16, x); + xi = _mm512_ipcvtts_roundps_epi8 (x, 4); + xi = _mm512_mask_ipcvtts_roundps_epi8 (xi, m16, x, 8); + xi = _mm512_maskz_ipcvtts_roundps_epi8 (m16, x, 8); + + xi = _mm512_ipcvtts_ps_epu8 (x); + xi = _mm512_mask_ipcvtts_ps_epu8 (xi, m16, x); + xi = _mm512_maskz_ipcvtts_ps_epu8 (m16, x); + xi = _mm512_ipcvtts_roundps_epu8 (x, 4); + xi = _mm512_mask_ipcvtts_roundps_epu8 (xi, m16, x, 8); + xi = _mm512_maskz_ipcvtts_roundps_epu8 (m16, x, 8); + + xi = _mm512_ipcvts_bf16_epi8 (xbh); + xi = _mm512_mask_ipcvts_bf16_epi8 (xi, m32, xbh); + xi = _mm512_maskz_ipcvts_bf16_epi8 (m32, xbh); + + xi = _mm512_ipcvts_bf16_epu8 (xbh); + xi = _mm512_mask_ipcvts_bf16_epu8 (xi, m32, xbh); + xi = _mm512_maskz_ipcvts_bf16_epu8 (m32, xbh); + + xi = _mm512_ipcvtts_bf16_epi8 (xbh); + xi = _mm512_mask_ipcvtts_bf16_epi8 (xi, m32, xbh); + xi = _mm512_maskz_ipcvtts_bf16_epi8 (m32, xbh); + + xi = _mm512_ipcvtts_bf16_epu8 (xbh); + xi = _mm512_mask_ipcvtts_bf16_epu8 (xi, m32, xbh); + xi = _mm512_maskz_ipcvtts_bf16_epu8 (m32, xbh); + + hxi = _mm512_cvtts_pd_epi32 (xd); + hxi = _mm512_mask_cvtts_pd_epi32 (hxi, m8, xd); + hxi = _mm512_maskz_cvtts_pd_epi32 (m8, xd); hxi = _mm512_cvtts_roundpd_epi32 (xd, 8); hxi = _mm512_mask_cvtts_roundpd_epi32 (hxi, m8, xd, 8); hxi = _mm512_maskz_cvtts_roundpd_epi32 (m8, xd, 8); + xi = _mm512_cvtts_pd_epi64 (xd); + xi = _mm512_mask_cvtts_pd_epi64 (xi, m8, xd); + xi = _mm512_maskz_cvtts_pd_epi64 (m8, xd); xi = _mm512_cvtts_roundpd_epi64 (xd, 8); xi = _mm512_mask_cvtts_roundpd_epi64 (xi, m8, xd, 8); xi = _mm512_maskz_cvtts_roundpd_epi64 (m8, xd, 8); + hxi = _mm512_cvtts_pd_epu32 (xd); + hxi = _mm512_mask_cvtts_pd_epu32 (hxi, m8, xd); + hxi = _mm512_maskz_cvtts_pd_epu32 (m8, xd); hxi = _mm512_cvtts_roundpd_epu32 (xd, 8); hxi = _mm512_mask_cvtts_roundpd_epu32 (hxi, m8, xd, 8); hxi = _mm512_maskz_cvtts_roundpd_epu32 (m8, xd, 8); + xi = _mm512_cvtts_pd_epu64 (xd); + xi = _mm512_mask_cvtts_pd_epu64 (xi, m8, xd); + xi = _mm512_maskz_cvtts_pd_epu64 (m8, xd); xi = _mm512_cvtts_roundpd_epu64 (xd, 8); xi = _mm512_mask_cvtts_roundpd_epu64 (xi, m8, xd, 8); xi = _mm512_maskz_cvtts_roundpd_epu64 (m8, xd, 8); + xi = _mm512_cvtts_ps_epi32 (x); + xi = _mm512_mask_cvtts_ps_epi32 (xi, m16, x); + xi = _mm512_maskz_cvtts_ps_epi32 (m16, x); xi = _mm512_cvtts_roundps_epi32 (x, 8); xi = _mm512_mask_cvtts_roundps_epi32 (xi, m16, x, 8); xi = _mm512_maskz_cvtts_roundps_epi32 (m16, x, 8); + xi = _mm512_cvtts_ps_epi64 (hx); + xi = _mm512_mask_cvtts_ps_epi64 (xi, m8, hx); + xi = _mm512_maskz_cvtts_ps_epi64 (m8, hx); xi = _mm512_cvtts_roundps_epi64 (hx, 8); xi = _mm512_mask_cvtts_roundps_epi64 (xi, m8, hx, 8); xi = _mm512_maskz_cvtts_roundps_epi64 (m8, hx, 8); + xi = _mm512_cvtts_ps_epu32 (x); + xi = _mm512_mask_cvtts_ps_epu32 (xi, m16, x); + xi = _mm512_maskz_cvtts_ps_epu32 (m16, x); xi = _mm512_cvtts_roundps_epu32 (x, 8); xi = _mm512_mask_cvtts_roundps_epu32 (xi, m16, x, 8); xi = _mm512_maskz_cvtts_roundps_epu32 (m16, x, 8); + xi = _mm512_cvtts_ps_epu64 (hx); + xi = _mm512_mask_cvtts_ps_epu64 (xi, m8, hx); + xi = _mm512_maskz_cvtts_ps_epu64 (m8, hx); xi = _mm512_cvtts_roundps_epu64 (hx, 8); xi = _mm512_mask_cvtts_roundps_epu64 (xi, m8, hx, 8); xi = _mm512_maskz_cvtts_roundps_epu64 (m8, hx, 8); diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtbf162ibs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtbf162ibs-2.c index 73c6722..7f7e20c 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtbf162ibs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtbf162ibs-2.c @@ -50,9 +50,9 @@ TEST (void) for (i = 0; i < SIZE; i++) res2.a[i] = DEFAULT_VALUE; - res1.x = INTRINSIC (_ipcvtbf16_epi16) (s.x); - res2.x = INTRINSIC (_mask_ipcvtbf16_epi16) (res2.x, mask, s.x); - res3.x = INTRINSIC (_maskz_ipcvtbf16_epi16) (mask, s.x); + res1.x = INTRINSIC (_ipcvts_bf16_epi8) (s.x); + res2.x = INTRINSIC (_mask_ipcvts_bf16_epi8) (res2.x, mask, s.x); + res3.x = INTRINSIC (_maskz_ipcvts_bf16_epi8) (mask, s.x); CALC (s.a, res_ref); diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtbf162iubs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtbf162iubs-2.c index 59ed049..3b4c2ec 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtbf162iubs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtbf162iubs-2.c @@ -50,9 +50,9 @@ TEST (void) for (i = 0; i < SIZE; i++) res2.a[i] = DEFAULT_VALUE; - res1.x = INTRINSIC (_ipcvtbf16_epu16) (s.x); - res2.x = INTRINSIC (_mask_ipcvtbf16_epu16) (res2.x, mask, s.x); - res3.x = INTRINSIC (_maskz_ipcvtbf16_epu16) (mask, s.x); + res1.x = INTRINSIC (_ipcvts_bf16_epu8) (s.x); + res2.x = INTRINSIC (_mask_ipcvts_bf16_epu8) (res2.x, mask, s.x); + res3.x = INTRINSIC (_maskz_ipcvts_bf16_epu8) (mask, s.x); CALC (s.a, res_ref); diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2ibs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2ibs-2.c index 47d2a34..523b3f0 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2ibs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2ibs-2.c @@ -9,6 +9,7 @@ #endif #include "avx10-helper.h" #include <limits.h> +#include <string.h> #define SIZE (AVX512F_LEN / 16) #include "avx512f-mask-type.h" @@ -37,7 +38,7 @@ TEST (void) UNION_TYPE (AVX512F_LEN, h) s; UNION_TYPE (AVX512F_LEN, i_w) res1, res2, res3; MASK_TYPE mask = MASK_VALUE; - short res_ref[SIZE] = { 0 }; + short res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; int i, sign = 1; for (i = 0; i < SIZE; i++) @@ -49,17 +50,12 @@ TEST (void) for (i = 0; i < SIZE; i++) res2.a[i] = DEFAULT_VALUE; -#if AVX512F_LEN == 128 - res1.x = INTRINSIC (_ipcvtph_epi16) (s.x); - res2.x = INTRINSIC (_mask_ipcvtph_epi16) (res2.x, mask, s.x); - res3.x = INTRINSIC (_maskz_ipcvtph_epi16) (mask, s.x); -#else - res1.x = INTRINSIC (_ipcvt_roundph_epi16) (s.x, 8); - res2.x = INTRINSIC (_mask_ipcvt_roundph_epi16) (res2.x, mask, s.x, 8); - res3.x = INTRINSIC (_maskz_ipcvt_roundph_epi16) (mask, s.x, 8); -#endif + res1.x = INTRINSIC (_ipcvts_ph_epi8) (s.x); + res2.x = INTRINSIC (_mask_ipcvts_ph_epi8) (res2.x, mask, s.x); + res3.x = INTRINSIC (_maskz_ipcvts_ph_epi8) (mask, s.x); CALC (s.a, res_ref); + memcpy(res_ref2, res_ref, sizeof(res_ref)); if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref)) abort (); @@ -71,4 +67,24 @@ TEST (void) MASK_ZERO (i_w) (res_ref, mask, SIZE); if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref)) abort (); + +#if AVX512F_LEN != 128 + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_ipcvts_roundph_epi8) (s.x, 8); + res2.x = INTRINSIC (_mask_ipcvts_roundph_epi8) (res2.x, mask, s.x, 8); + res3.x = INTRINSIC (_maskz_ipcvts_roundph_epi8) (mask, s.x, 8); + + if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref2)) + abort (); + + MASK_MERGE (i_w) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_w) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_w) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref2)) + abort (); +#endif } diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2iubs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2iubs-2.c index ef00852..a8f6e57 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2iubs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2iubs-2.c @@ -9,6 +9,7 @@ #endif #include "avx10-helper.h" #include <limits.h> +#include <string.h> #define SIZE (AVX512F_LEN / 16) #include "avx512f-mask-type.h" @@ -37,7 +38,7 @@ TEST (void) UNION_TYPE (AVX512F_LEN, h) s; UNION_TYPE (AVX512F_LEN, i_w) res1, res2, res3; MASK_TYPE mask = MASK_VALUE; - short res_ref[SIZE] = { 0 }; + short res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; int i, sign = 1; for (i = 0; i < SIZE; i++) @@ -49,17 +50,12 @@ TEST (void) for (i = 0; i < SIZE; i++) res2.a[i] = DEFAULT_VALUE; -#if AVX512F_LEN == 128 - res1.x = INTRINSIC (_ipcvtph_epu16) (s.x); - res2.x = INTRINSIC (_mask_ipcvtph_epu16) (res2.x, mask, s.x); - res3.x = INTRINSIC (_maskz_ipcvtph_epu16) (mask, s.x); -#else - res1.x = INTRINSIC (_ipcvt_roundph_epu16) (s.x, 8); - res2.x = INTRINSIC (_mask_ipcvt_roundph_epu16) (res2.x, mask, s.x, 8); - res3.x = INTRINSIC (_maskz_ipcvt_roundph_epu16) (mask, s.x, 8); -#endif + res1.x = INTRINSIC (_ipcvts_ph_epu8) (s.x); + res2.x = INTRINSIC (_mask_ipcvts_ph_epu8) (res2.x, mask, s.x); + res3.x = INTRINSIC (_maskz_ipcvts_ph_epu8) (mask, s.x); CALC (s.a, res_ref); + memcpy(res_ref2, res_ref, sizeof(res_ref)); if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref)) abort (); @@ -71,4 +67,24 @@ TEST (void) MASK_ZERO (i_w) (res_ref, mask, SIZE); if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref)) abort (); + +#if AVX512F_LEN != 128 + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_ipcvts_roundph_epu8) (s.x, 8); + res2.x = INTRINSIC (_mask_ipcvts_roundph_epu8) (res2.x, mask, s.x, 8); + res3.x = INTRINSIC (_maskz_ipcvts_roundph_epu8) (mask, s.x, 8); + + if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref2)) + abort (); + + MASK_MERGE (i_w) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_w) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_w) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref2)) + abort (); +#endif } diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtps2ibs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtps2ibs-2.c index b11ab1b..369cb64 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtps2ibs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtps2ibs-2.c @@ -10,6 +10,7 @@ #include "avx10-helper.h" #include <limits.h> #include <math.h> +#include <string.h> #define SIZE (AVX512F_LEN / 32) #include "avx512f-mask-type.h" @@ -38,7 +39,7 @@ TEST (void) UNION_TYPE (AVX512F_LEN, ) s; UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; MASK_TYPE mask = MASK_VALUE; - int res_ref[SIZE] = { 0 }; + int res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; int i, sign = 1; for (i = 0; i < SIZE; i++) @@ -50,17 +51,12 @@ TEST (void) for (i = 0; i < SIZE; i++) res2.a[i] = DEFAULT_VALUE; -#if AVX512F_LEN == 128 - res1.x = INTRINSIC (_ipcvtps_epi32) (s.x); - res2.x = INTRINSIC (_mask_ipcvtps_epi32) (res2.x, mask, s.x); - res3.x = INTRINSIC (_maskz_ipcvtps_epi32) (mask, s.x); -#else - res1.x = INTRINSIC (_ipcvt_roundps_epi32) (s.x, 8); - res2.x = INTRINSIC (_mask_ipcvt_roundps_epi32) (res2.x, mask, s.x, 8); - res3.x = INTRINSIC (_maskz_ipcvt_roundps_epi32) (mask, s.x, 8); -#endif + res1.x = INTRINSIC (_ipcvts_ps_epi8) (s.x); + res2.x = INTRINSIC (_mask_ipcvts_ps_epi8) (res2.x, mask, s.x); + res3.x = INTRINSIC (_maskz_ipcvts_ps_epi8) (mask, s.x); CALC (s.a, res_ref); + memcpy(res_ref2, res_ref, sizeof(res_ref)); if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) abort (); @@ -72,4 +68,24 @@ TEST (void) MASK_ZERO (i_d) (res_ref, mask, SIZE); if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref)) abort (); + +#if AVX512F_LEN != 128 + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_ipcvts_roundps_epi8) (s.x, 8); + res2.x = INTRINSIC (_mask_ipcvts_roundps_epi8) (res2.x, mask, s.x, 8); + res3.x = INTRINSIC (_maskz_ipcvts_roundps_epi8) (mask, s.x, 8); + + if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref2)) + abort (); + + MASK_MERGE (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) + abort (); +#endif } diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtps2iubs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtps2iubs-2.c index 33019c1..f79264e 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtps2iubs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtps2iubs-2.c @@ -10,6 +10,7 @@ #include "avx10-helper.h" #include <limits.h> #include <math.h> +#include <string.h> #define SIZE (AVX512F_LEN / 32) #include "avx512f-mask-type.h" @@ -36,7 +37,7 @@ TEST (void) UNION_TYPE (AVX512F_LEN, ) s; UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; MASK_TYPE mask = MASK_VALUE; - int res_ref[SIZE] = { 0 }; + int res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; int i, sign = 1; for (i = 0; i < SIZE; i++) @@ -48,17 +49,12 @@ TEST (void) for (i = 0; i < SIZE; i++) res2.a[i] = DEFAULT_VALUE; -#if AVX512F_LEN == 128 - res1.x = INTRINSIC (_ipcvtps_epu32) (s.x); - res2.x = INTRINSIC (_mask_ipcvtps_epu32) (res2.x, mask, s.x); - res3.x = INTRINSIC (_maskz_ipcvtps_epu32) (mask, s.x); -#else - res1.x = INTRINSIC (_ipcvt_roundps_epu32) (s.x, 8); - res2.x = INTRINSIC (_mask_ipcvt_roundps_epu32) (res2.x, mask, s.x, 8); - res3.x = INTRINSIC (_maskz_ipcvt_roundps_epu32) (mask, s.x, 8); -#endif + res1.x = INTRINSIC (_ipcvts_ps_epu8) (s.x); + res2.x = INTRINSIC (_mask_ipcvts_ps_epu8) (res2.x, mask, s.x); + res3.x = INTRINSIC (_maskz_ipcvts_ps_epu8) (mask, s.x); CALC (s.a, res_ref); + memcpy(res_ref2, res_ref, sizeof(res_ref)); if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) abort (); @@ -70,4 +66,24 @@ TEST (void) MASK_ZERO (i_d) (res_ref, mask, SIZE); if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref)) abort (); + +#if AVX512F_LEN != 128 + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_ipcvts_roundps_epu8) (s.x, 8); + res2.x = INTRINSIC (_mask_ipcvts_roundps_epu8) (res2.x, mask, s.x, 8); + res3.x = INTRINSIC (_maskz_ipcvts_roundps_epu8) (mask, s.x, 8); + + if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref2)) + abort (); + + MASK_MERGE (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) + abort (); +#endif } diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttbf162ibs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttbf162ibs-2.c index 47688f5..eea2e70 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttbf162ibs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttbf162ibs-2.c @@ -50,9 +50,9 @@ TEST (void) for (i = 0; i < SIZE; i++) res2.a[i] = DEFAULT_VALUE; - res1.x = INTRINSIC (_ipcvttbf16_epi16) (s.x); - res2.x = INTRINSIC (_mask_ipcvttbf16_epi16) (res2.x, mask, s.x); - res3.x = INTRINSIC (_maskz_ipcvttbf16_epi16) (mask, s.x); + res1.x = INTRINSIC (_ipcvtts_bf16_epi8) (s.x); + res2.x = INTRINSIC (_mask_ipcvtts_bf16_epi8) (res2.x, mask, s.x); + res3.x = INTRINSIC (_maskz_ipcvtts_bf16_epi8) (mask, s.x); CALC (s.a, res_ref); diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttbf162iubs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttbf162iubs-2.c index 97cb11b..9f52302 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttbf162iubs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttbf162iubs-2.c @@ -50,9 +50,9 @@ TEST (void) for (i = 0; i < SIZE; i++) res2.a[i] = DEFAULT_VALUE; - res1.x = INTRINSIC (_ipcvttbf16_epu16) (s.x); - res2.x = INTRINSIC (_mask_ipcvttbf16_epu16) (res2.x, mask, s.x); - res3.x = INTRINSIC (_maskz_ipcvttbf16_epu16) (mask, s.x); + res1.x = INTRINSIC (_ipcvtts_bf16_epu8) (s.x); + res2.x = INTRINSIC (_mask_ipcvtts_bf16_epu8) (res2.x, mask, s.x); + res3.x = INTRINSIC (_maskz_ipcvtts_bf16_epu8) (mask, s.x); CALC (s.a, res_ref); diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2dqs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2dqs-2.c index d885800..7293772 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2dqs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2dqs-2.c @@ -9,6 +9,7 @@ #endif #include "avx10-helper.h" #include <limits.h> +#include <string.h> #define SRC_SIZE (AVX512F_LEN / 64) #define SIZE (AVX512F_LEN_HALF / 32) @@ -36,7 +37,7 @@ TEST (void) UNION_TYPE (AVX512F_LEN, d) s; UNION_TYPE (AVX512F_LEN_HALF, i_d) res1, res2, res3; MASK_TYPE mask = MASK_VALUE; - int res_ref[SIZE] = { 0 }; + int res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; int i, sign = 1; for (i = 0; i < SRC_SIZE; i++) @@ -48,17 +49,12 @@ TEST (void) for (i = 0; i < SIZE; i++) res2.a[i] = DEFAULT_VALUE; -#if AVX512F_LEN == 128 - res1.x = INTRINSIC (_cvttspd_epi32) (s.x); - res2.x = INTRINSIC (_mask_cvttspd_epi32) (res2.x, mask, s.x); - res3.x = INTRINSIC (_maskz_cvttspd_epi32) (mask, s.x); -#else - res1.x = INTRINSIC (_cvtts_roundpd_epi32) (s.x, 8); - res2.x = INTRINSIC (_mask_cvtts_roundpd_epi32) (res2.x, mask, s.x, 8); - res3.x = INTRINSIC (_maskz_cvtts_roundpd_epi32) (mask, s.x, 8); -#endif + res1.x = INTRINSIC (_cvtts_pd_epi32) (s.x); + res2.x = INTRINSIC (_mask_cvtts_pd_epi32) (res2.x, mask, s.x); + res3.x = INTRINSIC (_maskz_cvtts_pd_epi32) (mask, s.x); CALC (s.a, res_ref); + memcpy(res_ref2, res_ref, sizeof(res_ref)); if (UNION_CHECK (AVX512F_LEN_HALF, i_d) (res1, res_ref)) abort (); @@ -70,4 +66,24 @@ TEST (void) MASK_ZERO (i_d) (res_ref, mask, SRC_SIZE); if (UNION_CHECK (AVX512F_LEN_HALF, i_d) (res3, res_ref)) abort (); + +#if AVX512F_LEN != 128 + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_cvtts_roundpd_epi32) (s.x, 8); + res2.x = INTRINSIC (_mask_cvtts_roundpd_epi32) (res2.x, mask, s.x, 8); + res3.x = INTRINSIC (_maskz_cvtts_roundpd_epi32) (mask, s.x, 8); + + if (UNION_CHECK (AVX512F_LEN_HALF, i_d) (res1, res_ref2)) + abort (); + + MASK_MERGE (i_d) (res_ref2, mask, SRC_SIZE); + if (UNION_CHECK (AVX512F_LEN_HALF, i_d) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_d) (res_ref2, mask, SRC_SIZE); + if (UNION_CHECK (AVX512F_LEN_HALF, i_d) (res3, res_ref2)) + abort (); +#endif } diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2qqs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2qqs-2.c index 3fa451b..23eb111 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2qqs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2qqs-2.c @@ -9,6 +9,7 @@ #endif #include "avx10-helper.h" #include <limits.h> +#include <string.h> #define SIZE (AVX512F_LEN / 64) #include "avx512f-mask-type.h" @@ -35,7 +36,7 @@ TEST (void) UNION_TYPE (AVX512F_LEN, d) s; UNION_TYPE (AVX512F_LEN, i_q) res1, res2, res3; MASK_TYPE mask = MASK_VALUE; - long long res_ref[SIZE] = { 0 }; + long long res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; int i, sign = 1; for (i = 0; i < SIZE; i++) @@ -47,17 +48,12 @@ TEST (void) for (i = 0; i < SIZE; i++) res2.a[i] = DEFAULT_VALUE; -#if AVX512F_LEN == 128 - res1.x = INTRINSIC (_cvttspd_epi64) (s.x); - res2.x = INTRINSIC (_mask_cvttspd_epi64) (res2.x, mask, s.x); - res3.x = INTRINSIC (_maskz_cvttspd_epi64) (mask, s.x); -#else - res1.x = INTRINSIC (_cvtts_roundpd_epi64) (s.x, 8); - res2.x = INTRINSIC (_mask_cvtts_roundpd_epi64) (res2.x, mask, s.x, 8); - res3.x = INTRINSIC (_maskz_cvtts_roundpd_epi64) (mask, s.x, 8); -#endif + res1.x = INTRINSIC (_cvtts_pd_epi64) (s.x); + res2.x = INTRINSIC (_mask_cvtts_pd_epi64) (res2.x, mask, s.x); + res3.x = INTRINSIC (_maskz_cvtts_pd_epi64) (mask, s.x); CALC (s.a, res_ref); + memcpy(res_ref2, res_ref, sizeof(res_ref)); if (UNION_CHECK (AVX512F_LEN, i_q) (res1, res_ref)) abort (); @@ -69,4 +65,24 @@ TEST (void) MASK_ZERO (i_q) (res_ref, mask, SIZE); if (UNION_CHECK (AVX512F_LEN, i_q) (res3, res_ref)) abort (); + +#if AVX512F_LEN != 128 + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_cvtts_roundpd_epi64) (s.x, 8); + res2.x = INTRINSIC (_mask_cvtts_roundpd_epi64) (res2.x, mask, s.x, 8); + res3.x = INTRINSIC (_maskz_cvtts_roundpd_epi64) (mask, s.x, 8); + + if (UNION_CHECK (AVX512F_LEN, i_q) (res1, res_ref2)) + abort (); + + MASK_MERGE (i_q) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_q) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_q) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_q) (res3, res_ref2)) + abort (); +#endif } diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2udqs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2udqs-2.c index 3d2f2ff..7058423 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2udqs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2udqs-2.c @@ -9,6 +9,7 @@ #endif #include "avx10-helper.h" #include <limits.h> +#include <string.h> #define SRC_SIZE (AVX512F_LEN / 64) #define SIZE (AVX512F_LEN_HALF / 32) @@ -36,7 +37,7 @@ TEST (void) UNION_TYPE (AVX512F_LEN, d) s; UNION_TYPE (AVX512F_LEN_HALF, i_ud) res1, res2, res3; MASK_TYPE mask = MASK_VALUE; - unsigned int res_ref[SIZE] = { 0 }; + unsigned int res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; int i, sign = 1; for (i = 0; i < SRC_SIZE; i++) @@ -48,17 +49,12 @@ TEST (void) for (i = 0; i < SIZE; i++) res2.a[i] = DEFAULT_VALUE; -#if AVX512F_LEN == 128 - res1.x = INTRINSIC (_cvttspd_epu32) (s.x); - res2.x = INTRINSIC (_mask_cvttspd_epu32) (res2.x, mask, s.x); - res3.x = INTRINSIC (_maskz_cvttspd_epu32) (mask, s.x); -#else - res1.x = INTRINSIC (_cvtts_roundpd_epu32) (s.x, 8); - res2.x = INTRINSIC (_mask_cvtts_roundpd_epu32) (res2.x, mask, s.x, 8); - res3.x = INTRINSIC (_maskz_cvtts_roundpd_epu32) (mask, s.x, 8); -#endif + res1.x = INTRINSIC (_cvtts_pd_epu32) (s.x); + res2.x = INTRINSIC (_mask_cvtts_pd_epu32) (res2.x, mask, s.x); + res3.x = INTRINSIC (_maskz_cvtts_pd_epu32) (mask, s.x); CALC (s.a, res_ref); + memcpy(res_ref2, res_ref, sizeof(res_ref)); if (UNION_CHECK (AVX512F_LEN_HALF, i_ud) (res1, res_ref)) abort (); @@ -70,4 +66,24 @@ TEST (void) MASK_ZERO (i_ud) (res_ref, mask, SRC_SIZE); if (UNION_CHECK (AVX512F_LEN_HALF, i_ud) (res3, res_ref)) abort (); + +#if AVX512F_LEN != 128 + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_cvtts_roundpd_epu32) (s.x, 8); + res2.x = INTRINSIC (_mask_cvtts_roundpd_epu32) (res2.x, mask, s.x, 8); + res3.x = INTRINSIC (_maskz_cvtts_roundpd_epu32) (mask, s.x, 8); + + if (UNION_CHECK (AVX512F_LEN_HALF, i_ud) (res1, res_ref2)) + abort (); + + MASK_MERGE (i_ud) (res_ref2, mask, SRC_SIZE); + if (UNION_CHECK (AVX512F_LEN_HALF, i_ud) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_ud) (res_ref2, mask, SRC_SIZE); + if (UNION_CHECK (AVX512F_LEN_HALF, i_ud) (res3, res_ref2)) + abort (); +#endif } diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2uqqs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2uqqs-2.c index 3000297..9c826f4 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2uqqs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2uqqs-2.c @@ -9,6 +9,7 @@ #endif #include "avx10-helper.h" #include <limits.h> +#include <string.h> #define SIZE (AVX512F_LEN / 64) #include "avx512f-mask-type.h" @@ -35,7 +36,7 @@ TEST (void) UNION_TYPE (AVX512F_LEN, d) s; UNION_TYPE (AVX512F_LEN, i_uq) res1, res2, res3; MASK_TYPE mask = MASK_VALUE; - unsigned long long res_ref[SIZE] = { 0 }; + unsigned long long res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; int i, sign = 1; for (i = 0; i < SIZE; i++) @@ -47,17 +48,12 @@ TEST (void) for (i = 0; i < SIZE; i++) res2.a[i] = DEFAULT_VALUE; -#if AVX512F_LEN == 128 - res1.x = INTRINSIC (_cvttspd_epu64) (s.x); - res2.x = INTRINSIC (_mask_cvttspd_epu64) (res2.x, mask, s.x); - res3.x = INTRINSIC (_maskz_cvttspd_epu64) (mask, s.x); -#else - res1.x = INTRINSIC (_cvtts_roundpd_epu64) (s.x, 8); - res2.x = INTRINSIC (_mask_cvtts_roundpd_epu64) (res2.x, mask, s.x, 8); - res3.x = INTRINSIC (_maskz_cvtts_roundpd_epu64) (mask, s.x, 8); -#endif + res1.x = INTRINSIC (_cvtts_pd_epu64) (s.x); + res2.x = INTRINSIC (_mask_cvtts_pd_epu64) (res2.x, mask, s.x); + res3.x = INTRINSIC (_maskz_cvtts_pd_epu64) (mask, s.x); CALC (s.a, res_ref); + memcpy(res_ref2, res_ref, sizeof(res_ref)); if (UNION_CHECK (AVX512F_LEN, i_uq) (res1, res_ref)) abort (); @@ -69,4 +65,24 @@ TEST (void) MASK_ZERO (i_uq) (res_ref, mask, SIZE); if (UNION_CHECK (AVX512F_LEN, i_uq) (res3, res_ref)) abort (); + +#if AVX512F_LEN != 128 + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_cvtts_roundpd_epu64) (s.x, 8); + res2.x = INTRINSIC (_mask_cvtts_roundpd_epu64) (res2.x, mask, s.x, 8); + res3.x = INTRINSIC (_maskz_cvtts_roundpd_epu64) (mask, s.x, 8); + + if (UNION_CHECK (AVX512F_LEN, i_uq) (res1, res_ref2)) + abort (); + + MASK_MERGE (i_uq) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_uq) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_uq) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_uq) (res3, res_ref2)) + abort (); +#endif } diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttph2ibs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttph2ibs-2.c index 7115727..7f94020a 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttph2ibs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttph2ibs-2.c @@ -9,6 +9,7 @@ #endif #include "avx10-helper.h" #include <limits.h> +#include <string.h> #define SIZE (AVX512F_LEN / 16) #include "avx512f-mask-type.h" @@ -37,7 +38,7 @@ TEST (void) UNION_TYPE (AVX512F_LEN, h) s; UNION_TYPE (AVX512F_LEN, i_w) res1, res2, res3; MASK_TYPE mask = MASK_VALUE; - short res_ref[SIZE] = { 0 }; + short res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; int i, sign = 1; for (i = 0; i < SIZE; i++) @@ -49,17 +50,12 @@ TEST (void) for (i = 0; i < SIZE; i++) res2.a[i] = DEFAULT_VALUE; -#if AVX512F_LEN == 128 - res1.x = INTRINSIC (_ipcvttph_epi16) (s.x); - res2.x = INTRINSIC (_mask_ipcvttph_epi16) (res2.x, mask, s.x); - res3.x = INTRINSIC (_maskz_ipcvttph_epi16) (mask, s.x); -#else - res1.x = INTRINSIC (_ipcvtt_roundph_epi16) (s.x, 8); - res2.x = INTRINSIC (_mask_ipcvtt_roundph_epi16) (res2.x, mask, s.x, 8); - res3.x = INTRINSIC (_maskz_ipcvtt_roundph_epi16) (mask, s.x, 8); -#endif + res1.x = INTRINSIC (_ipcvtts_ph_epi8) (s.x); + res2.x = INTRINSIC (_mask_ipcvtts_ph_epi8) (res2.x, mask, s.x); + res3.x = INTRINSIC (_maskz_ipcvtts_ph_epi8) (mask, s.x); CALC (s.a, res_ref); + memcpy(res_ref2, res_ref, sizeof(res_ref)); if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref)) abort (); @@ -71,4 +67,24 @@ TEST (void) MASK_ZERO (i_w) (res_ref, mask, SIZE); if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref)) abort (); + +#if AVX512F_LEN != 128 + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_ipcvtts_roundph_epi8) (s.x, 8); + res2.x = INTRINSIC (_mask_ipcvtts_roundph_epi8) (res2.x, mask, s.x, 8); + res3.x = INTRINSIC (_maskz_ipcvtts_roundph_epi8) (mask, s.x, 8); + + if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref2)) + abort (); + + MASK_MERGE (i_w) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_w) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_w) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref2)) + abort (); +#endif } diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttph2iubs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttph2iubs-2.c index 00da511..8a05dfd 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttph2iubs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttph2iubs-2.c @@ -49,18 +49,17 @@ TEST (void) for (i = 0; i < SIZE; i++) res2.a[i] = DEFAULT_VALUE; -#if AVX512F_LEN == 128 - res1.x = INTRINSIC (_ipcvttph_epu16) (s.x); - res2.x = INTRINSIC (_mask_ipcvttph_epu16) (res2.x, mask, s.x); - res3.x = INTRINSIC (_maskz_ipcvttph_epu16) (mask, s.x); -#else - res1.x = INTRINSIC (_ipcvtt_roundph_epu16) (s.x, 8); - res2.x = INTRINSIC (_mask_ipcvtt_roundph_epu16) (res2.x, mask, s.x, 8); - res3.x = INTRINSIC (_maskz_ipcvtt_roundph_epu16) (mask, s.x, 8); -#endif + res1.x = INTRINSIC (_ipcvtts_ph_epu8) (s.x); + res2.x = INTRINSIC (_mask_ipcvtts_ph_epu8) (res2.x, mask, s.x); + res3.x = INTRINSIC (_maskz_ipcvtts_ph_epu8) (mask, s.x); CALC (s.a, res_ref); +#if AVX512F_LEN != 128 + res1.x = INTRINSIC (_ipcvtts_roundph_epu8) (s.x, 8); + res2.x = INTRINSIC (_mask_ipcvtts_roundph_epu8) (res2.x, mask, s.x, 8); + res3.x = INTRINSIC (_maskz_ipcvtts_roundph_epu8) (mask, s.x, 8); + if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref)) abort (); @@ -71,4 +70,5 @@ TEST (void) MASK_ZERO (i_w) (res_ref, mask, SIZE); if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref)) abort (); +#endif } diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2dqs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2dqs-2.c index 568f0a3..9d3bc2c 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2dqs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2dqs-2.c @@ -9,6 +9,7 @@ #endif #include "avx10-helper.h" #include <limits.h> +#include <string.h> #define SIZE (AVX512F_LEN / 32) #include "avx512f-mask-type.h" @@ -35,7 +36,7 @@ TEST (void) UNION_TYPE (AVX512F_LEN, ) s; UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; MASK_TYPE mask = MASK_VALUE; - int res_ref[SIZE] = { 0 }; + int res_ref[SIZE] = { 0 }, res_ref2[SIZE]; int i, sign = 1; for (i = 0; i < SIZE; i++) @@ -47,17 +48,12 @@ TEST (void) for (i = 0; i < SIZE; i++) res2.a[i] = DEFAULT_VALUE; -#if AVX512F_LEN == 128 - res1.x = INTRINSIC (_cvttsps_epi32) (s.x); - res2.x = INTRINSIC (_mask_cvttsps_epi32) (res2.x, mask, s.x); - res3.x = INTRINSIC (_maskz_cvttsps_epi32) (mask, s.x); -#else - res1.x = INTRINSIC (_cvtts_roundps_epi32) (s.x, 8); - res2.x = INTRINSIC (_mask_cvtts_roundps_epi32) (res2.x, mask, s.x, 8); - res3.x = INTRINSIC (_maskz_cvtts_roundps_epi32) (mask, s.x, 8); -#endif + res1.x = INTRINSIC (_cvtts_ps_epi32) (s.x); + res2.x = INTRINSIC (_mask_cvtts_ps_epi32) (res2.x, mask, s.x); + res3.x = INTRINSIC (_maskz_cvtts_ps_epi32) (mask, s.x); CALC (s.a, res_ref); + memcpy(res_ref2, res_ref, sizeof(res_ref)); if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) abort (); @@ -69,4 +65,24 @@ TEST (void) MASK_ZERO (i_d) (res_ref, mask, SIZE); if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref)) abort (); + +#if AVX512F_LEN != 128 + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_cvtts_roundps_epi32) (s.x, 8); + res2.x = INTRINSIC (_mask_cvtts_roundps_epi32) (res2.x, mask, s.x, 8); + res3.x = INTRINSIC (_maskz_cvtts_roundps_epi32) (mask, s.x, 8); + + if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref2)) + abort (); + + MASK_MERGE (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) + abort (); +#endif } diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2ibs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2ibs-2.c index bfe74d8..9654385 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2ibs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2ibs-2.c @@ -10,6 +10,7 @@ #include "avx10-helper.h" #include <limits.h> #include <math.h> +#include <string.h> #define SIZE (AVX512F_LEN / 32) #include "avx512f-mask-type.h" @@ -38,7 +39,7 @@ TEST (void) UNION_TYPE (AVX512F_LEN, ) s; UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; MASK_TYPE mask = MASK_VALUE; - int res_ref[SIZE] = { 0 }; + int res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; int i, sign = 1; for (i = 0; i < SIZE; i++) @@ -50,17 +51,12 @@ TEST (void) for (i = 0; i < SIZE; i++) res2.a[i] = DEFAULT_VALUE; -#if AVX512F_LEN == 128 - res1.x = INTRINSIC (_ipcvttps_epi32) (s.x); - res2.x = INTRINSIC (_mask_ipcvttps_epi32) (res2.x, mask, s.x); - res3.x = INTRINSIC (_maskz_ipcvttps_epi32) (mask, s.x); -#else - res1.x = INTRINSIC (_ipcvtt_roundps_epi32) (s.x, 8); - res2.x = INTRINSIC (_mask_ipcvtt_roundps_epi32) (res2.x, mask, s.x, 8); - res3.x = INTRINSIC (_maskz_ipcvtt_roundps_epi32) (mask, s.x, 8); -#endif + res1.x = INTRINSIC (_ipcvtts_ps_epi8) (s.x); + res2.x = INTRINSIC (_mask_ipcvtts_ps_epi8) (res2.x, mask, s.x); + res3.x = INTRINSIC (_maskz_ipcvtts_ps_epi8) (mask, s.x); CALC (s.a, res_ref); + memcpy(res_ref2, res_ref, sizeof(res_ref)); if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) abort (); @@ -72,4 +68,24 @@ TEST (void) MASK_ZERO (i_d) (res_ref, mask, SIZE); if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref)) abort (); + +#if AVX512F_LEN != 128 + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_ipcvtts_roundps_epi8) (s.x, 8); + res2.x = INTRINSIC (_mask_ipcvtts_roundps_epi8) (res2.x, mask, s.x, 8); + res3.x = INTRINSIC (_maskz_ipcvtts_roundps_epi8) (mask, s.x, 8); + + if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref2)) + abort (); + + MASK_MERGE (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) + abort (); +#endif } diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2iubs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2iubs-2.c index 9de4f2a..976677f 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2iubs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2iubs-2.c @@ -10,6 +10,7 @@ #include "avx10-helper.h" #include <limits.h> #include <math.h> +#include <string.h> #define SIZE (AVX512F_LEN / 32) #include "avx512f-mask-type.h" @@ -36,7 +37,7 @@ TEST (void) UNION_TYPE (AVX512F_LEN, ) s; UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; MASK_TYPE mask = MASK_VALUE; - int res_ref[SIZE] = { 0 }; + int res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; int i, sign = 1; for (i = 0; i < SIZE; i++) @@ -48,17 +49,12 @@ TEST (void) for (i = 0; i < SIZE; i++) res2.a[i] = DEFAULT_VALUE; -#if AVX512F_LEN == 128 - res1.x = INTRINSIC (_ipcvttps_epu32) (s.x); - res2.x = INTRINSIC (_mask_ipcvttps_epu32) (res2.x, mask, s.x); - res3.x = INTRINSIC (_maskz_ipcvttps_epu32) (mask, s.x); -#else - res1.x = INTRINSIC (_ipcvtt_roundps_epu32) (s.x, 8); - res2.x = INTRINSIC (_mask_ipcvtt_roundps_epu32) (res2.x, mask, s.x, 8); - res3.x = INTRINSIC (_maskz_ipcvtt_roundps_epu32) (mask, s.x, 8); -#endif + res1.x = INTRINSIC (_ipcvtts_ps_epu8) (s.x); + res2.x = INTRINSIC (_mask_ipcvtts_ps_epu8) (res2.x, mask, s.x); + res3.x = INTRINSIC (_maskz_ipcvtts_ps_epu8) (mask, s.x); CALC (s.a, res_ref); + memcpy(res_ref2, res_ref, sizeof(res_ref)); if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) abort (); @@ -70,4 +66,24 @@ TEST (void) MASK_ZERO (i_d) (res_ref, mask, SIZE); if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref)) abort (); + +#if AVX512F_LEN != 128 + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_ipcvtts_roundps_epu8) (s.x, 8); + res2.x = INTRINSIC (_mask_ipcvtts_roundps_epu8) (res2.x, mask, s.x, 8); + res3.x = INTRINSIC (_maskz_ipcvtts_roundps_epu8) (mask, s.x, 8); + + if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref2)) + abort (); + + MASK_MERGE (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) + abort (); +#endif } diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2qqs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2qqs-2.c index 6d0ba5f..0d5797e 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2qqs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2qqs-2.c @@ -9,6 +9,7 @@ #endif #include "avx10-helper.h" #include <limits.h> +#include <string.h> #define SRC_SIZE (AVX512F_LEN_HALF / 32) #define SIZE (AVX512F_LEN / 64) @@ -36,7 +37,7 @@ TEST (void) UNION_TYPE (AVX512F_LEN_HALF, ) s; UNION_TYPE (AVX512F_LEN, i_q) res1, res2, res3; MASK_TYPE mask = MASK_VALUE; - long long res_ref[SIZE] = { 0 }; + long long res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; int i, sign = 1; for (i = 0; i < SRC_SIZE; i++) @@ -48,18 +49,12 @@ TEST (void) for (i = 0; i < SIZE; i++) res2.a[i] = DEFAULT_VALUE; -#if AVX512F_LEN == 128 - res1.x = INTRINSIC (_cvttsps_epi64) (s.x); - res2.x = INTRINSIC (_mask_cvttsps_epi64) (res2.x, mask, s.x); - res3.x = INTRINSIC (_maskz_cvttsps_epi64) (mask, s.x); -#else - res1.x = INTRINSIC (_cvtts_roundps_epi64) (s.x, 8); - res2.x = INTRINSIC (_mask_cvtts_roundps_epi64) (res2.x, mask, s.x, 8); - res3.x = INTRINSIC (_maskz_cvtts_roundps_epi64) (mask, s.x, 8); -#endif + res1.x = INTRINSIC (_cvtts_ps_epi64) (s.x); + res2.x = INTRINSIC (_mask_cvtts_ps_epi64) (res2.x, mask, s.x); + res3.x = INTRINSIC (_maskz_cvtts_ps_epi64) (mask, s.x); CALC (s.a, res_ref); - + memcpy(res_ref2, res_ref, sizeof(res_ref)); if (UNION_CHECK (AVX512F_LEN, i_q) (res1, res_ref)) abort (); @@ -71,4 +66,24 @@ TEST (void) MASK_ZERO (i_q) (res_ref, mask, SIZE); if (UNION_CHECK (AVX512F_LEN, i_q) (res3, res_ref)) abort (); + +#if AVX512F_LEN != 128 + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_cvtts_roundps_epi64) (s.x, 8); + res2.x = INTRINSIC (_mask_cvtts_roundps_epi64) (res2.x, mask, s.x, 8); + res3.x = INTRINSIC (_maskz_cvtts_roundps_epi64) (mask, s.x, 8); + + if (UNION_CHECK (AVX512F_LEN, i_q) (res1, res_ref2)) + abort (); + + MASK_MERGE (i_q) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_q) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_q) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_q) (res3, res_ref2)) + abort (); +#endif } diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2udqs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2udqs-2.c index 513f822..f578cd0 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2udqs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2udqs-2.c @@ -9,6 +9,7 @@ #endif #include "avx10-helper.h" #include <limits.h> +#include <string.h> #define SIZE (AVX512F_LEN / 32) #include "avx512f-mask-type.h" @@ -35,7 +36,7 @@ TEST (void) UNION_TYPE (AVX512F_LEN, ) s; UNION_TYPE (AVX512F_LEN, i_ud) res1, res2, res3; MASK_TYPE mask = MASK_VALUE; - unsigned int res_ref[SIZE] = { 0 }; + unsigned int res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; int i, sign = 1; for (i = 0; i < SIZE; i++) @@ -47,17 +48,12 @@ TEST (void) for (i = 0; i < SIZE; i++) res2.a[i] = DEFAULT_VALUE; -#if AVX512F_LEN == 128 - res1.x = INTRINSIC (_cvttsps_epu32) (s.x); - res2.x = INTRINSIC (_mask_cvttsps_epu32) (res2.x, mask, s.x); - res3.x = INTRINSIC (_maskz_cvttsps_epu32) (mask, s.x); -#else - res1.x = INTRINSIC (_cvtts_roundps_epu32) (s.x, 8); - res2.x = INTRINSIC (_mask_cvtts_roundps_epu32) (res2.x, mask, s.x, 8); - res3.x = INTRINSIC (_maskz_cvtts_roundps_epu32) (mask, s.x, 8); -#endif + res1.x = INTRINSIC (_cvtts_ps_epu32) (s.x); + res2.x = INTRINSIC (_mask_cvtts_ps_epu32) (res2.x, mask, s.x); + res3.x = INTRINSIC (_maskz_cvtts_ps_epu32) (mask, s.x); CALC (s.a, res_ref); + memcpy(res_ref2, res_ref, sizeof(res_ref)); if (UNION_CHECK (AVX512F_LEN, i_ud) (res1, res_ref)) abort (); @@ -69,4 +65,24 @@ TEST (void) MASK_ZERO (i_ud) (res_ref, mask, SIZE); if (UNION_CHECK (AVX512F_LEN, i_ud) (res3, res_ref)) abort (); + +#if AVX512F_LEN != 128 + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_cvtts_roundps_epu32) (s.x, 8); + res2.x = INTRINSIC (_mask_cvtts_roundps_epu32) (res2.x, mask, s.x, 8); + res3.x = INTRINSIC (_maskz_cvtts_roundps_epu32) (mask, s.x, 8); + + if (UNION_CHECK (AVX512F_LEN, i_ud) (res1, res_ref2)) + abort (); + + MASK_MERGE (i_ud) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_ud) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_ud) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_ud) (res3, res_ref2)) + abort (); +#endif } diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2uqqs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2uqqs-2.c index 98d7ea8..93e71ac 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2uqqs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2uqqs-2.c @@ -9,6 +9,7 @@ #endif #include "avx10-helper.h" #include <limits.h> +#include <string.h> #define SRC_SIZE (AVX512F_LEN_HALF / 32) #define SIZE (AVX512F_LEN / 64) @@ -36,7 +37,7 @@ TEST (void) UNION_TYPE (AVX512F_LEN_HALF, ) s; UNION_TYPE (AVX512F_LEN, i_uq) res1, res2, res3; MASK_TYPE mask = MASK_VALUE; - unsigned long long res_ref[SIZE] = { 0 }; + unsigned long long res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; int i, sign = 1; for (i = 0; i < SRC_SIZE; i++) @@ -48,17 +49,12 @@ TEST (void) for (i = 0; i < SIZE; i++) res2.a[i] = DEFAULT_VALUE; -#if AVX512F_LEN == 128 - res1.x = INTRINSIC (_cvttsps_epu64) (s.x); - res2.x = INTRINSIC (_mask_cvttsps_epu64) (res2.x, mask, s.x); - res3.x = INTRINSIC (_maskz_cvttsps_epu64) (mask, s.x); -#else - res1.x = INTRINSIC (_cvtts_roundps_epu64) (s.x, 8); - res2.x = INTRINSIC (_mask_cvtts_roundps_epu64) (res2.x, mask, s.x, 8); - res3.x = INTRINSIC (_maskz_cvtts_roundps_epu64) (mask, s.x, 8); -#endif + res1.x = INTRINSIC (_cvtts_ps_epu64) (s.x); + res2.x = INTRINSIC (_mask_cvtts_ps_epu64) (res2.x, mask, s.x); + res3.x = INTRINSIC (_maskz_cvtts_ps_epu64) (mask, s.x); CALC (s.a, res_ref); + memcpy(res_ref2, res_ref, sizeof(res_ref)); if (UNION_CHECK (AVX512F_LEN, i_uq) (res1, res_ref)) abort (); @@ -70,4 +66,24 @@ TEST (void) MASK_ZERO (i_uq) (res_ref, mask, SRC_SIZE); if (UNION_CHECK (AVX512F_LEN, i_uq) (res3, res_ref)) abort (); + +#if AVX512F_LEN != 128 + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_cvtts_roundps_epu64) (s.x, 8); + res2.x = INTRINSIC (_mask_cvtts_roundps_epu64) (res2.x, mask, s.x, 8); + res3.x = INTRINSIC (_maskz_cvtts_roundps_epu64) (mask, s.x, 8); + + if (UNION_CHECK (AVX512F_LEN, i_uq) (res1, res_ref2)) + abort (); + + MASK_MERGE (i_uq) (res_ref2, mask, SRC_SIZE); + if (UNION_CHECK (AVX512F_LEN, i_uq) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_uq) (res_ref2, mask, SRC_SIZE); + if (UNION_CHECK (AVX512F_LEN, i_uq) (res3, res_ref2)) + abort (); +#endif } 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 7599fd1..dd8b874 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-satcvt-1.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-satcvt-1.c @@ -1,27 +1,43 @@ /* { dg-do compile } */ /* { dg-options "-O2 -march=x86-64-v3 -mavx10.2-256" } */ -/* { dg-final { scan-assembler-times "vcvtph2ibs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvtph2ibs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vcvtph2ibs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvtph2ibs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtph2ibs\[ \\t\]+\{rn-sae\}\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtph2ibs\[ \\t\]+\{rz-sae\}\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ -/* { dg-final { scan-assembler-times "vcvtph2iubs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvtph2iubs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vcvtph2iubs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvtph2iubs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtph2iubs\[ \\t\]+\{rn-sae\}\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtph2iubs\[ \\t\]+\{rz-sae\}\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ -/* { dg-final { scan-assembler-times "vcvttph2ibs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttph2ibs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vcvttph2ibs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttph2ibs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttph2ibs\[ \\t\]+\{sae\}\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttph2ibs\[ \\t\]+\{sae\}\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ -/* { dg-final { scan-assembler-times "vcvttph2iubs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttph2iubs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vcvttph2iubs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttph2iubs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttph2iubs\[ \\t\]+\{sae\}\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttph2iubs\[ \\t\]+\{sae\}\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ -/* { dg-final { scan-assembler-times "vcvtps2ibs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvtps2ibs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vcvtps2ibs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvtps2ibs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtps2ibs\[ \\t\]+\{rn-sae\}\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtps2ibs\[ \\t\]+\{rz-sae\}\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ -/* { dg-final { scan-assembler-times "vcvtps2iubs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvtps2iubs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vcvtps2iubs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvtps2iubs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtps2iubs\[ \\t\]+\{rn-sae\}\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtps2iubs\[ \\t\]+\{rz-sae\}\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ -/* { dg-final { scan-assembler-times "vcvttps2ibs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttps2ibs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vcvttps2ibs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttps2ibs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttps2ibs\[ \\t\]+\{sae\}\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttps2ibs\[ \\t\]+\{sae\}\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ -/* { dg-final { scan-assembler-times "vcvttps2iubs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttps2iubs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vcvttps2iubs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttps2iubs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttps2iubs\[ \\t\]+\{sae\}\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttps2iubs\[ \\t\]+\{sae\}\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvtbf162ibs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ @@ -72,27 +88,51 @@ /* { dg-final { scan-assembler-times "vcvttbf162iubs\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttbf162iubs\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[0-9\]\}\[^\{\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttbf162iubs\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttpd2dqsy\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttpd2dqsy\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttpd2dqsy\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[0-9\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttpd2dqsy\[ \\t\]+\{sae\}\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttpd2dqsy\[ \\t\]+\{sae\}\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttpd2dqsy\[ \\t\]+\{sae\}\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[0-9\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttpd2qqs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttpd2qqs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttpd2qqs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttpd2qqs\[ \\t\]+\{sae\}\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttpd2qqs\[ \\t\]+\{sae\}\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttpd2qqs\[ \\t\]+\{sae\}\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttpd2udqsy\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttpd2udqsy\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttpd2udqsy\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[0-9\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttpd2udqsy\[ \\t\]+\{sae\}\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttpd2udqsy\[ \\t\]+\{sae\}\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttpd2udqsy\[ \\t\]+\{sae\}\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[0-9\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttpd2uqqs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttpd2uqqs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttpd2uqqs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttpd2uqqs\[ \\t\]+\{sae\}\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttpd2uqqs\[ \\t\]+\{sae\}\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttpd2uqqs\[ \\t\]+\{sae\}\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttps2dqs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttps2dqs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttps2dqs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttps2dqs\[ \\t\]+\{sae\}\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttps2dqs\[ \\t\]+\{sae\}\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttps2dqs\[ \\t\]+\{sae\}\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttps2qqs\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttps2qqs\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttps2qqs\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttps2qqs\[ \\t\]+\{sae\}\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttps2qqs\[ \\t\]+\{sae\}\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttps2qqs\[ \\t\]+\{sae\}\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttps2udqs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttps2udqs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttps2udqs\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttps2udqs\[ \\t\]+\{sae\}\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttps2udqs\[ \\t\]+\{sae\}\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttps2udqs\[ \\t\]+\{sae\}\[^\{\n\]*%ymm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttps2uqqs\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttps2uqqs\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttps2uqqs\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttps2uqqs\[ \\t\]+\{sae\}\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttps2uqqs\[ \\t\]+\{sae\}\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttps2uqqs\[ \\t\]+\{sae\}\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%ymm\[0-9\]+\{%k\[0-9\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ @@ -120,10 +160,18 @@ /* { dg-final { scan-assembler-times "vcvttps2uqqs\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttps2uqqs\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttps2uqqs\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+\{%k\[0-9\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttsd2sis\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%e.x+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttsd2usis\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%e.x+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttss2sis\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%e.x+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttss2usis\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%e.x+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttsd2sis\[ \\t\]+\{sae\}\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%e.x+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttsd2usis\[ \\t\]+\{sae\}\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%e.x+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttss2sis\[ \\t\]+\{sae\}\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%e.x+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcvttss2usis\[ \\t\]+\{sae\}\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%e.x+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vcvttsd2sis\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%r.x+(?:\n|\[ \\t\]+#)" 1 { target { ! ia32 } } } } */ +/* { dg-final { scan-assembler-times "vcvttsd2usis\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%r.x+(?:\n|\[ \\t\]+#)" 1 { target { ! ia32 } } } } */ +/* { dg-final { scan-assembler-times "vcvttss2sis\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%r.x+(?:\n|\[ \\t\]+#)" 1 { target { ! ia32 } } } } */ +/* { dg-final { scan-assembler-times "vcvttss2usis\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%r.x+(?:\n|\[ \\t\]+#)" 1 { target { ! ia32 } } } } */ /* { dg-final { scan-assembler-times "vcvttsd2sis\[ \\t\]+\{sae\}\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%r.x+(?:\n|\[ \\t\]+#)" 1 { target { ! ia32 } } } } */ /* { dg-final { scan-assembler-times "vcvttsd2usis\[ \\t\]+\{sae\}\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%r.x+(?:\n|\[ \\t\]+#)" 1 { target { ! ia32 } } } } */ /* { dg-final { scan-assembler-times "vcvttss2sis\[ \\t\]+\{sae\}\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%r.x+(?:\n|\[ \\t\]+#)" 1 { target { ! ia32 } } } } */ @@ -151,172 +199,228 @@ volatile unsigned long long ull; void extern avx10_2_test (void) { - xi = _mm256_ipcvt_roundph_epi16 (xh, 4); - xi = _mm256_mask_ipcvt_roundph_epi16 (xi, m16, xh, 8); - xi = _mm256_maskz_ipcvt_roundph_epi16 (m16, xh, 11); - - xi = _mm256_ipcvt_roundph_epu16 (xh, 4); - xi = _mm256_mask_ipcvt_roundph_epu16 (xi, m16, xh, 8); - xi = _mm256_maskz_ipcvt_roundph_epu16 (m16, xh, 11); - - xi = _mm256_ipcvtt_roundph_epi16 (xh, 4); - xi = _mm256_mask_ipcvtt_roundph_epi16 (xi, m16, xh, 8); - xi = _mm256_maskz_ipcvtt_roundph_epi16 (m16, xh, 8); - - xi = _mm256_ipcvtt_roundph_epu16 (xh, 4); - xi = _mm256_mask_ipcvtt_roundph_epu16 (xi, m16, xh, 8); - xi = _mm256_maskz_ipcvtt_roundph_epu16 (m16, xh, 8); - - xi = _mm256_ipcvt_roundps_epi32 (x, 4); - xi = _mm256_mask_ipcvt_roundps_epi32 (xi, m8, x, 8); - xi = _mm256_maskz_ipcvt_roundps_epi32 (m8, x, 11); - - xi = _mm256_ipcvt_roundps_epu32 (x, 4); - xi = _mm256_mask_ipcvt_roundps_epu32 (xi, m8, x, 8); - xi = _mm256_maskz_ipcvt_roundps_epu32 (m8, x, 11); - - xi = _mm256_ipcvtt_roundps_epi32 (x, 4); - xi = _mm256_mask_ipcvtt_roundps_epi32 (xi, m8, x, 8); - xi = _mm256_maskz_ipcvtt_roundps_epi32 (m8, x, 8); - - xi = _mm256_ipcvtt_roundps_epu32 (x, 4); - xi = _mm256_mask_ipcvtt_roundps_epu32 (xi, m8, x, 8); - xi = _mm256_maskz_ipcvtt_roundps_epu32 (m8, x, 8); - - xi = _mm256_ipcvtbf16_epi16 (xbh); - xi = _mm256_mask_ipcvtbf16_epi16 (xi, m16, xbh); - xi = _mm256_maskz_ipcvtbf16_epi16 (m16, xbh); - - xi = _mm256_ipcvtbf16_epu16 (xbh); - xi = _mm256_mask_ipcvtbf16_epu16 (xi, m16, xbh); - xi = _mm256_maskz_ipcvtbf16_epu16 (m16, xbh); - - xi = _mm256_ipcvttbf16_epi16 (xbh); - xi = _mm256_mask_ipcvttbf16_epi16 (xi, m16, xbh); - xi = _mm256_maskz_ipcvttbf16_epi16 (m16, xbh); - - xi = _mm256_ipcvttbf16_epu16 (xbh); - xi = _mm256_mask_ipcvttbf16_epu16 (xi, m16, xbh); - xi = _mm256_maskz_ipcvttbf16_epu16 (m16, xbh); - - hxi = _mm_ipcvtph_epi16 (hxh); - hxi = _mm_mask_ipcvtph_epi16 (hxi, m8, hxh); - hxi = _mm_maskz_ipcvtph_epi16 (m8, hxh); - - hxi = _mm_ipcvtph_epu16 (hxh); - hxi = _mm_mask_ipcvtph_epu16 (hxi, m8, hxh); - hxi = _mm_maskz_ipcvtph_epu16 (m8, hxh); - - hxi = _mm_ipcvttph_epi16 (hxh); - hxi = _mm_mask_ipcvttph_epi16 (hxi, m8, hxh); - hxi = _mm_maskz_ipcvttph_epi16 (m8, hxh); - - hxi = _mm_ipcvttph_epu16 (hxh); - hxi = _mm_mask_ipcvttph_epu16 (hxi, m8, hxh); - hxi = _mm_maskz_ipcvttph_epu16 (m8, hxh); - - hxi = _mm_ipcvtps_epi32 (hx); - hxi = _mm_mask_ipcvtps_epi32 (hxi, m8, hx); - hxi = _mm_maskz_ipcvtps_epi32 (m8, hx); - - hxi = _mm_ipcvtps_epu32 (hx); - hxi = _mm_mask_ipcvtps_epu32 (hxi, m8, hx); - hxi = _mm_maskz_ipcvtps_epu32 (m8, hx); - - hxi = _mm_ipcvttps_epi32 (hx); - hxi = _mm_mask_ipcvttps_epi32 (hxi, m8, hx); - hxi = _mm_maskz_ipcvttps_epi32 (m8, hx); - - hxi = _mm_ipcvttps_epu32 (hx); - hxi = _mm_mask_ipcvttps_epu32 (hxi, m8, hx); - hxi = _mm_maskz_ipcvttps_epu32 (m8, hx); - - hxi = _mm_ipcvtbf16_epi16 (hxbh); - hxi = _mm_mask_ipcvtbf16_epi16 (hxi, m8, hxbh); - hxi = _mm_maskz_ipcvtbf16_epi16 (m8, hxbh); - - hxi = _mm_ipcvtbf16_epu16 (hxbh); - hxi = _mm_mask_ipcvtbf16_epu16 (hxi, m8, hxbh); - hxi = _mm_maskz_ipcvtbf16_epu16 (m8, hxbh); - - hxi = _mm_ipcvttbf16_epi16 (hxbh); - hxi = _mm_mask_ipcvttbf16_epi16 (hxi, m8, hxbh); - hxi = _mm_maskz_ipcvttbf16_epi16 (m8, hxbh); - - hxi = _mm_ipcvttbf16_epu16 (hxbh); - hxi = _mm_mask_ipcvttbf16_epu16 (hxi, m8, hxbh); - hxi = _mm_maskz_ipcvttbf16_epu16 (m8, hxbh); - + xi = _mm256_ipcvts_ph_epi8 (xh); + xi = _mm256_mask_ipcvts_ph_epi8 (xi, m16, xh); + xi = _mm256_maskz_ipcvts_ph_epi8 (m16, xh); + xi = _mm256_ipcvts_roundph_epi8 (xh, 4); + xi = _mm256_mask_ipcvts_roundph_epi8 (xi, m16, xh, 8); + xi = _mm256_maskz_ipcvts_roundph_epi8 (m16, xh, 11); + + xi = _mm256_ipcvts_ph_epu8 (xh); + xi = _mm256_mask_ipcvts_ph_epu8 (xi, m16, xh); + xi = _mm256_maskz_ipcvts_ph_epu8 (m16, xh); + xi = _mm256_ipcvts_roundph_epu8 (xh, 4); + xi = _mm256_mask_ipcvts_roundph_epu8 (xi, m16, xh, 8); + xi = _mm256_maskz_ipcvts_roundph_epu8 (m16, xh, 11); + + xi = _mm256_ipcvtts_ph_epi8 (xh); + xi = _mm256_mask_ipcvtts_ph_epi8 (xi, m16, xh); + xi = _mm256_maskz_ipcvtts_ph_epi8 (m16, xh); + xi = _mm256_ipcvtts_roundph_epi8 (xh, 4); + xi = _mm256_mask_ipcvtts_roundph_epi8 (xi, m16, xh, 8); + xi = _mm256_maskz_ipcvtts_roundph_epi8 (m16, xh, 8); + + xi = _mm256_ipcvtts_ph_epu8 (xh); + xi = _mm256_mask_ipcvtts_ph_epu8 (xi, m16, xh); + xi = _mm256_maskz_ipcvtts_ph_epu8 (m16, xh); + xi = _mm256_ipcvtts_roundph_epu8 (xh, 4); + xi = _mm256_mask_ipcvtts_roundph_epu8 (xi, m16, xh, 8); + xi = _mm256_maskz_ipcvtts_roundph_epu8 (m16, xh, 8); + + xi = _mm256_ipcvts_ps_epi8 (x); + xi = _mm256_mask_ipcvts_ps_epi8 (xi, m8, x); + xi = _mm256_maskz_ipcvts_ps_epi8 (m8, x); + xi = _mm256_ipcvts_roundps_epi8 (x, 4); + xi = _mm256_mask_ipcvts_roundps_epi8 (xi, m8, x, 8); + xi = _mm256_maskz_ipcvts_roundps_epi8 (m8, x, 11); + + xi = _mm256_ipcvts_ps_epu8 (x); + xi = _mm256_mask_ipcvts_ps_epu8 (xi, m8, x); + xi = _mm256_maskz_ipcvts_ps_epu8 (m8, x); + xi = _mm256_ipcvts_roundps_epu8 (x, 4); + xi = _mm256_mask_ipcvts_roundps_epu8 (xi, m8, x, 8); + xi = _mm256_maskz_ipcvts_roundps_epu8 (m8, x, 11); + + xi = _mm256_ipcvtts_ps_epi8 (x); + xi = _mm256_mask_ipcvtts_ps_epi8 (xi, m8, x); + xi = _mm256_maskz_ipcvtts_ps_epi8 (m8, x); + xi = _mm256_ipcvtts_roundps_epi8 (x, 4); + xi = _mm256_mask_ipcvtts_roundps_epi8 (xi, m8, x, 8); + xi = _mm256_maskz_ipcvtts_roundps_epi8 (m8, x, 8); + + xi = _mm256_ipcvtts_ps_epu8 (x); + xi = _mm256_mask_ipcvtts_ps_epu8 (xi, m8, x); + xi = _mm256_maskz_ipcvtts_ps_epu8 (m8, x); + xi = _mm256_ipcvtts_roundps_epu8 (x, 4); + xi = _mm256_mask_ipcvtts_roundps_epu8 (xi, m8, x, 8); + xi = _mm256_maskz_ipcvtts_roundps_epu8 (m8, x, 8); + + xi = _mm256_ipcvts_bf16_epi8 (xbh); + xi = _mm256_mask_ipcvts_bf16_epi8 (xi, m16, xbh); + xi = _mm256_maskz_ipcvts_bf16_epi8 (m16, xbh); + + xi = _mm256_ipcvts_bf16_epu8 (xbh); + xi = _mm256_mask_ipcvts_bf16_epu8 (xi, m16, xbh); + xi = _mm256_maskz_ipcvts_bf16_epu8 (m16, xbh); + + xi = _mm256_ipcvtts_bf16_epi8 (xbh); + xi = _mm256_mask_ipcvtts_bf16_epi8 (xi, m16, xbh); + xi = _mm256_maskz_ipcvtts_bf16_epi8 (m16, xbh); + + xi = _mm256_ipcvtts_bf16_epu8 (xbh); + xi = _mm256_mask_ipcvtts_bf16_epu8 (xi, m16, xbh); + xi = _mm256_maskz_ipcvtts_bf16_epu8 (m16, xbh); + + hxi = _mm_ipcvts_ph_epi8 (hxh); + hxi = _mm_mask_ipcvts_ph_epi8 (hxi, m8, hxh); + hxi = _mm_maskz_ipcvts_ph_epi8 (m8, hxh); + + hxi = _mm_ipcvts_ph_epu8 (hxh); + hxi = _mm_mask_ipcvts_ph_epu8 (hxi, m8, hxh); + hxi = _mm_maskz_ipcvts_ph_epu8 (m8, hxh); + + hxi = _mm_ipcvtts_ph_epi8 (hxh); + hxi = _mm_mask_ipcvtts_ph_epi8 (hxi, m8, hxh); + hxi = _mm_maskz_ipcvtts_ph_epi8 (m8, hxh); + + hxi = _mm_ipcvtts_ph_epu8 (hxh); + hxi = _mm_mask_ipcvtts_ph_epu8 (hxi, m8, hxh); + hxi = _mm_maskz_ipcvtts_ph_epu8 (m8, hxh); + + hxi = _mm_ipcvts_ps_epi8 (hx); + hxi = _mm_mask_ipcvts_ps_epi8 (hxi, m8, hx); + hxi = _mm_maskz_ipcvts_ps_epi8 (m8, hx); + + hxi = _mm_ipcvts_ps_epu8 (hx); + hxi = _mm_mask_ipcvts_ps_epu8 (hxi, m8, hx); + hxi = _mm_maskz_ipcvts_ps_epu8 (m8, hx); + + hxi = _mm_ipcvtts_ps_epi8 (hx); + hxi = _mm_mask_ipcvtts_ps_epi8 (hxi, m8, hx); + hxi = _mm_maskz_ipcvtts_ps_epi8 (m8, hx); + + hxi = _mm_ipcvtts_ps_epu8 (hx); + hxi = _mm_mask_ipcvtts_ps_epu8 (hxi, m8, hx); + hxi = _mm_maskz_ipcvtts_ps_epu8 (m8, hx); + + hxi = _mm_ipcvts_bf16_epi8 (hxbh); + hxi = _mm_mask_ipcvts_bf16_epi8 (hxi, m8, hxbh); + hxi = _mm_maskz_ipcvts_bf16_epi8 (m8, hxbh); + + hxi = _mm_ipcvts_bf16_epu8 (hxbh); + hxi = _mm_mask_ipcvts_bf16_epu8 (hxi, m8, hxbh); + hxi = _mm_maskz_ipcvts_bf16_epu8 (m8, hxbh); + + hxi = _mm_ipcvtts_bf16_epi8 (hxbh); + hxi = _mm_mask_ipcvtts_bf16_epi8 (hxi, m8, hxbh); + hxi = _mm_maskz_ipcvtts_bf16_epi8 (m8, hxbh); + + hxi = _mm_ipcvtts_bf16_epu8 (hxbh); + hxi = _mm_mask_ipcvtts_bf16_epu8 (hxi, m8, hxbh); + hxi = _mm_maskz_ipcvtts_bf16_epu8 (m8, hxbh); + + hxi = _mm256_cvtts_pd_epi32 (xd); + hxi = _mm256_mask_cvtts_pd_epi32 (hxi, m8, xd); + hxi = _mm256_maskz_cvtts_pd_epi32 (m8, xd); hxi = _mm256_cvtts_roundpd_epi32 (xd, 8); hxi = _mm256_mask_cvtts_roundpd_epi32 (hxi, m8, xd, 8); hxi = _mm256_maskz_cvtts_roundpd_epi32 (m8, xd, 8); + xi = _mm256_cvtts_pd_epi64 (xd); + xi = _mm256_mask_cvtts_pd_epi64 (xi, m8, xd); + xi = _mm256_maskz_cvtts_pd_epi64 (m8, xd); xi = _mm256_cvtts_roundpd_epi64 (xd, 8); xi = _mm256_mask_cvtts_roundpd_epi64 (xi, m8, xd, 8); xi = _mm256_maskz_cvtts_roundpd_epi64 (m8, xd, 8); + hxi = _mm256_cvtts_pd_epu32 (xd); + hxi = _mm256_mask_cvtts_pd_epu32 (hxi, m8, xd); + hxi = _mm256_maskz_cvtts_pd_epu32 (m8, xd); hxi = _mm256_cvtts_roundpd_epu32 (xd, 8); hxi = _mm256_mask_cvtts_roundpd_epu32 (hxi, m8, xd, 8); hxi = _mm256_maskz_cvtts_roundpd_epu32 (m8, xd, 8); + xi = _mm256_cvtts_pd_epu64 (xd); + xi = _mm256_mask_cvtts_pd_epu64 (xi, m8, xd); + xi = _mm256_maskz_cvtts_pd_epu64 (m8, xd); xi = _mm256_cvtts_roundpd_epu64 (xd, 8); xi = _mm256_mask_cvtts_roundpd_epu64 (xi, m8, xd, 8); xi = _mm256_maskz_cvtts_roundpd_epu64 (m8, xd, 8); + xi = _mm256_cvtts_ps_epi32 (x); + xi = _mm256_mask_cvtts_ps_epi32 (xi, m16, x); + xi = _mm256_maskz_cvtts_ps_epi32 (m16, x); xi = _mm256_cvtts_roundps_epi32 (x, 8); xi = _mm256_mask_cvtts_roundps_epi32 (xi, m16, x, 8); xi = _mm256_maskz_cvtts_roundps_epi32 (m16, x, 8); + xi = _mm256_cvtts_ps_epi64 (hx); + xi = _mm256_mask_cvtts_ps_epi64 (xi, m8, hx); + xi = _mm256_maskz_cvtts_ps_epi64 (m8, hx); xi = _mm256_cvtts_roundps_epi64 (hx, 8); xi = _mm256_mask_cvtts_roundps_epi64 (xi, m8, hx, 8); xi = _mm256_maskz_cvtts_roundps_epi64 (m8, hx, 8); + xi = _mm256_cvtts_ps_epu32 (x); + xi = _mm256_mask_cvtts_ps_epu32 (xi, m16, x); + xi = _mm256_maskz_cvtts_ps_epu32 (m16, x); xi = _mm256_cvtts_roundps_epu32 (x, 8); xi = _mm256_mask_cvtts_roundps_epu32 (xi, m16, x, 8); xi = _mm256_maskz_cvtts_roundps_epu32 (m16, x, 8); + xi = _mm256_cvtts_ps_epu64 (hx); + xi = _mm256_mask_cvtts_ps_epu64 (xi, m8, hx); + xi = _mm256_maskz_cvtts_ps_epu64 (m8, hx); xi = _mm256_cvtts_roundps_epu64 (hx, 8); xi = _mm256_mask_cvtts_roundps_epu64 (xi, m8, hx, 8); xi = _mm256_maskz_cvtts_roundps_epu64 (m8, hx, 8); - hxi = _mm_cvttspd_epi32 (hxd); - hxi = _mm_mask_cvttspd_epi32 (hxi, m8, hxd); - hxi = _mm_maskz_cvttspd_epi32 (m8, hxd); + hxi = _mm_cvtts_pd_epi32 (hxd); + hxi = _mm_mask_cvtts_pd_epi32 (hxi, m8, hxd); + hxi = _mm_maskz_cvtts_pd_epi32 (m8, hxd); - hxi = _mm_cvttspd_epi64 (hxd); - hxi = _mm_mask_cvttspd_epi64 (hxi, m8, hxd); - hxi = _mm_maskz_cvttspd_epi64 (m8, hxd); + hxi = _mm_cvtts_pd_epi64 (hxd); + hxi = _mm_mask_cvtts_pd_epi64 (hxi, m8, hxd); + hxi = _mm_maskz_cvtts_pd_epi64 (m8, hxd); - hxi = _mm_cvttspd_epu32 (hxd); - hxi = _mm_mask_cvttspd_epu32 (hxi, m8, hxd); - hxi = _mm_maskz_cvttspd_epu32 (m8, hxd); + hxi = _mm_cvtts_pd_epu32 (hxd); + hxi = _mm_mask_cvtts_pd_epu32 (hxi, m8, hxd); + hxi = _mm_maskz_cvtts_pd_epu32 (m8, hxd); - hxi = _mm_cvttspd_epu64 (hxd); - hxi = _mm_mask_cvttspd_epu64 (hxi, m8, hxd); - hxi = _mm_maskz_cvttspd_epu64 (m8, hxd); + hxi = _mm_cvtts_pd_epu64 (hxd); + hxi = _mm_mask_cvtts_pd_epu64 (hxi, m8, hxd); + hxi = _mm_maskz_cvtts_pd_epu64 (m8, hxd); - hxi = _mm_cvttsps_epi32 (hx); - hxi = _mm_mask_cvttsps_epi32 (hxi, m8, hx); - hxi = _mm_maskz_cvttsps_epi32 (m8, hx); + hxi = _mm_cvtts_ps_epi32 (hx); + hxi = _mm_mask_cvtts_ps_epi32 (hxi, m8, hx); + hxi = _mm_maskz_cvtts_ps_epi32 (m8, hx); - hxi = _mm_cvttsps_epi64 (hx); - hxi = _mm_mask_cvttsps_epi64 (hxi, m8, hx); - hxi = _mm_maskz_cvttsps_epi64 (m8, hx); + hxi = _mm_cvtts_ps_epi64 (hx); + hxi = _mm_mask_cvtts_ps_epi64 (hxi, m8, hx); + hxi = _mm_maskz_cvtts_ps_epi64 (m8, hx); - hxi = _mm_cvttsps_epu32 (hx); - hxi = _mm_mask_cvttsps_epu32 (hxi, m8, hx); - hxi = _mm_maskz_cvttsps_epu32 (m8, hx); + hxi = _mm_cvtts_ps_epu32 (hx); + hxi = _mm_mask_cvtts_ps_epu32 (hxi, m8, hx); + hxi = _mm_maskz_cvtts_ps_epu32 (m8, hx); - hxi = _mm_cvttsps_epu64 (hx); - hxi = _mm_mask_cvttsps_epu64 (hxi, m8, hx); - hxi = _mm_maskz_cvttsps_epu64 (m8, hx); + hxi = _mm_cvtts_ps_epu64 (hx); + hxi = _mm_mask_cvtts_ps_epu64 (hxi, m8, hx); + hxi = _mm_maskz_cvtts_ps_epu64 (m8, hx); + i = _mm_cvtts_sd_epi32 (hxd); + ui = _mm_cvtts_sd_epu32 (hxd); + i = _mm_cvtts_ss_epi32 (hx); + ui = _mm_cvtts_ss_epu32 (hx); i = _mm_cvtts_roundsd_epi32 (hxd, 8); ui = _mm_cvtts_roundsd_epu32 (hxd, 8); i = _mm_cvtts_roundss_epi32 (hx, 8); ui = _mm_cvtts_roundss_epu32 (hx, 8); #ifdef __x86_64__ + ll = _mm_cvtts_sd_epi64 (hxd); + ull = _mm_cvtts_sd_epu64 (hxd); + ll = _mm_cvtts_ss_epi64 (hx); + ull = _mm_cvtts_ss_epu64 (hx); ll = _mm_cvtts_roundsd_epi64 (hxd, 8); ull = _mm_cvtts_roundsd_epu64 (hxd, 8); ll = _mm_cvtts_roundss_epi64 (hx, 8); diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtps2iubs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtps2iubs-2.c new file mode 100644 index 0000000..d58019e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtps2iubs-2.c @@ -0,0 +1,16 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2-256" } */ +/* { dg-require-effective-target avx10_2_256 } */ + +#define AVX10_2 +#define AVX512VL +#define AVX512F_LEN 256 +#define AVX512F_LEN_HALF 128 +#include "avx10_2-512-vcvtps2iubs-2.c" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + +#define AVX512F_LEN 128 +#define AVX512F_LEN_HALF 128 +#include "avx10_2-512-vcvtps2iubs-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttsd2sis-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttsd2sis-2.c index cb6bd28..72c7fe4 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttsd2sis-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttsd2sis-2.c @@ -31,6 +31,18 @@ TEST (void) if (res1 != res1_ref) abort(); + res1 = _mm_cvtts_sd_epi32 (s.x); + + if (s.a[0] > INT_MAX) + res1_ref = INT_MAX; + else if (s.a[0] < INT_MIN) + res1_ref = INT_MIN; + else + res1_ref = s.a[0]; + + if (res1 != res1_ref) + abort(); + #ifdef __x86_64__ res2 = _mm_cvtts_roundsd_epi64 (s.x, 8); @@ -43,5 +55,17 @@ TEST (void) if (res2 != res2_ref) abort(); + + res2 = _mm_cvtts_sd_epi64 (s.x); + + if (s.a[0] > LLONG_MAX) + res2_ref = LLONG_MAX; + else if (s.a[0] < LLONG_MIN) + res2_ref = LLONG_MIN; + else + res2_ref = s.a[0]; + + if (res2 != res2_ref) + abort(); #endif } diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttsd2usis-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttsd2usis-2.c index 04328f4..bce0043 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttsd2usis-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttsd2usis-2.c @@ -31,6 +31,18 @@ TEST (void) if (res1 != res1_ref) abort(); + res1 = _mm_cvtts_sd_epu32 (s.x); + + if (s.a[0] > UINT_MAX) + res1_ref = UINT_MAX; + else if (s.a[0] < 0) + res1_ref = 0; + else + res1_ref = s.a[0]; + + if (res1 != res1_ref) + abort(); + #ifdef __x86_64__ res2 = _mm_cvtts_roundsd_epu64 (s.x, 8); @@ -43,5 +55,17 @@ TEST (void) if (res2 != res2_ref) abort(); + + res2 = _mm_cvtts_sd_epu64 (s.x); + + if (s.a[0] > ULONG_MAX) + res2_ref = ULONG_MAX; + else if (s.a[0] < 0) + res2_ref = 0; + else + res2_ref = s.a[0]; + + if (res2 != res2_ref) + abort(); #endif } diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttss2sis-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttss2sis-2.c index c495d22..0c64922 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttss2sis-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttss2sis-2.c @@ -31,6 +31,18 @@ TEST (void) if (res1 != res1_ref) abort(); + res1 = _mm_cvtts_ss_epi32 (s.x); + + if (s.a[0] > INT_MAX) + res1_ref = INT_MAX; + else if (s.a[0] < INT_MIN) + res1_ref = INT_MIN; + else + res1_ref = s.a[0]; + + if (res1 != res1_ref) + abort(); + #ifdef __x86_64__ res2 = _mm_cvtts_roundss_epi64 (s.x, 8); @@ -43,5 +55,17 @@ TEST (void) if (res2 != res2_ref) abort(); + + res2 = _mm_cvtts_ss_epi64 (s.x); + + if (s.a[0] > LLONG_MAX) + res2_ref = LLONG_MAX; + else if (s.a[0] < LLONG_MIN) + res2_ref = LLONG_MIN; + else + res2_ref = s.a[0]; + + if (res2 != res2_ref) + abort(); #endif } diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttss2usis-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttss2usis-2.c index 42c418b..af63bb7 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttss2usis-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttss2usis-2.c @@ -30,6 +30,18 @@ TEST (void) if (res1 != res1_ref) abort(); + res1 = _mm_cvtts_ss_epu32 (s.x); + + if (s.a[0] > UINT_MAX) + res1_ref = UINT_MAX; + else if (s.a[0] < 0) + res1_ref = 0; + else + res1_ref = s.a[0]; + + if (res1 != res1_ref) + abort(); + #ifdef __x86_64__ res2 = _mm_cvtts_roundss_epu64 (s.x, 8); @@ -42,5 +54,17 @@ TEST (void) if (res2 != res2_ref) abort(); + + res2 = _mm_cvtts_ss_epu64 (s.x); + + if (s.a[0] > ULONG_MAX) + res2_ref = ULONG_MAX; + else if (s.a[0] < 0) + res2_ref = 0; + else + res2_ref = s.a[0]; + + if (res2 != res2_ref) + abort(); #endif } diff --git a/gcc/testsuite/gcc.target/i386/avx512vlbw-pr119357.c b/gcc/testsuite/gcc.target/i386/avx512vlbw-pr119357.c new file mode 100644 index 0000000..61afe22 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512vlbw-pr119357.c @@ -0,0 +1,14 @@ +/* PR target/119357 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -mavx512bw -mavx512vl" } */ + +#include <x86intrin.h> + +typedef char V __attribute__((vector_size (16))); + +void +foo (V *p) +{ + if (_mm_movemask_epi8 ((__m128i) (*p == 0)) != 65535) + __builtin_abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/pr117452.c b/gcc/testsuite/gcc.target/i386/pr117452.c new file mode 100644 index 0000000..4042b4f --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr117452.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-march=x86-64-v3 -mavx10.2 -Ofast" } */ + +__bf16 b; +int x; + +void +foo () +{ + if (x < b) + x = 0; +} diff --git a/gcc/testsuite/gcc.target/i386/sse-14.c b/gcc/testsuite/gcc.target/i386/sse-14.c index 16f03e2..1afe408 100644 --- a/gcc/testsuite/gcc.target/i386/sse-14.c +++ b/gcc/testsuite/gcc.target/i386/sse-14.c @@ -1433,30 +1433,30 @@ test_3 (_mm256_mask_cmp_pbh_mask, __mmask16, __mmask16, __m256bh, __m256bh, 1) test_3 (_mm_mask_cmp_pbh_mask, __mmask8, __mmask8, __m128bh, __m128bh, 1) /* avx10_2-512satcvtintrin.h */ -test_1 (_mm512_ipcvt_roundph_epi16, __m512i, __m512h, 8) -test_1 (_mm512_ipcvt_roundph_epu16, __m512i, __m512h, 8) -test_1 (_mm512_ipcvt_roundps_epi32, __m512i, __m512, 8) -test_1 (_mm512_ipcvt_roundps_epu32, __m512i, __m512, 8) -test_1 (_mm512_ipcvtt_roundph_epi16, __m512i, __m512h, 8) -test_1 (_mm512_ipcvtt_roundph_epu16, __m512i, __m512h, 8) -test_1 (_mm512_ipcvtt_roundps_epi32, __m512i, __m512, 8) -test_1 (_mm512_ipcvtt_roundps_epu32, __m512i, __m512, 8) -test_2 (_mm512_maskz_ipcvt_roundph_epi16, __m512i, __mmask32, __m512h, 8) -test_2 (_mm512_maskz_ipcvt_roundph_epu16, __m512i, __mmask32, __m512h, 8) -test_2 (_mm512_maskz_ipcvt_roundps_epi32, __m512i, __mmask16, __m512, 8) -test_2 (_mm512_maskz_ipcvt_roundps_epu32, __m512i, __mmask16, __m512, 8) -test_2 (_mm512_maskz_ipcvtt_roundph_epi16, __m512i, __mmask32, __m512h, 8) -test_2 (_mm512_maskz_ipcvtt_roundph_epu16, __m512i, __mmask32, __m512h, 8) -test_2 (_mm512_maskz_ipcvtt_roundps_epi32, __m512i, __mmask16, __m512, 8) -test_2 (_mm512_maskz_ipcvtt_roundps_epu32, __m512i, __mmask16, __m512, 8) -test_3 (_mm512_mask_ipcvt_roundph_epi16, __m512i, __m512i, __mmask32, __m512h, 8) -test_3 (_mm512_mask_ipcvt_roundph_epu16, __m512i, __m512i, __mmask32, __m512h, 8) -test_3 (_mm512_mask_ipcvt_roundps_epi32, __m512i, __m512i, __mmask16, __m512, 8) -test_3 (_mm512_mask_ipcvt_roundps_epu32, __m512i, __m512i, __mmask16, __m512, 8) -test_3 (_mm512_mask_ipcvtt_roundph_epi16, __m512i, __m512i, __mmask32, __m512h, 8) -test_3 (_mm512_mask_ipcvtt_roundph_epu16, __m512i, __m512i, __mmask32, __m512h, 8) -test_3 (_mm512_mask_ipcvtt_roundps_epi32, __m512i, __m512i, __mmask16, __m512, 8) -test_3 (_mm512_mask_ipcvtt_roundps_epu32, __m512i, __m512i, __mmask16, __m512, 8) +test_1 (_mm512_ipcvts_roundph_epi8, __m512i, __m512h, 8) +test_1 (_mm512_ipcvts_roundph_epu8, __m512i, __m512h, 8) +test_1 (_mm512_ipcvts_roundps_epi8, __m512i, __m512, 8) +test_1 (_mm512_ipcvts_roundps_epu8, __m512i, __m512, 8) +test_1 (_mm512_ipcvtts_roundph_epi8, __m512i, __m512h, 8) +test_1 (_mm512_ipcvtts_roundph_epu8, __m512i, __m512h, 8) +test_1 (_mm512_ipcvtts_roundps_epi8, __m512i, __m512, 8) +test_1 (_mm512_ipcvtts_roundps_epu8, __m512i, __m512, 8) +test_2 (_mm512_maskz_ipcvts_roundph_epi8, __m512i, __mmask32, __m512h, 8) +test_2 (_mm512_maskz_ipcvts_roundph_epu8, __m512i, __mmask32, __m512h, 8) +test_2 (_mm512_maskz_ipcvts_roundps_epi8, __m512i, __mmask16, __m512, 8) +test_2 (_mm512_maskz_ipcvts_roundps_epu8, __m512i, __mmask16, __m512, 8) +test_2 (_mm512_maskz_ipcvtts_roundph_epi8, __m512i, __mmask32, __m512h, 8) +test_2 (_mm512_maskz_ipcvtts_roundph_epu8, __m512i, __mmask32, __m512h, 8) +test_2 (_mm512_maskz_ipcvtts_roundps_epi8, __m512i, __mmask16, __m512, 8) +test_2 (_mm512_maskz_ipcvtts_roundps_epu8, __m512i, __mmask16, __m512, 8) +test_3 (_mm512_mask_ipcvts_roundph_epi8, __m512i, __m512i, __mmask32, __m512h, 8) +test_3 (_mm512_mask_ipcvts_roundph_epu8, __m512i, __m512i, __mmask32, __m512h, 8) +test_3 (_mm512_mask_ipcvts_roundps_epi8, __m512i, __m512i, __mmask16, __m512, 8) +test_3 (_mm512_mask_ipcvts_roundps_epu8, __m512i, __m512i, __mmask16, __m512, 8) +test_3 (_mm512_mask_ipcvtts_roundph_epi8, __m512i, __m512i, __mmask32, __m512h, 8) +test_3 (_mm512_mask_ipcvtts_roundph_epu8, __m512i, __m512i, __mmask32, __m512h, 8) +test_3 (_mm512_mask_ipcvtts_roundps_epi8, __m512i, __m512i, __mmask16, __m512, 8) +test_3 (_mm512_mask_ipcvtts_roundps_epu8, __m512i, __m512i, __mmask16, __m512, 8) test_1 (_mm512_cvtts_roundpd_epi32, __m256i, __m512d, 8) test_2 (_mm512_maskz_cvtts_roundpd_epi32, __m256i, __mmask8, __m512d, 8) test_3 (_mm512_mask_cvtts_roundpd_epi32, __m256i, __m256i, __mmask8, __m512d, 8) @@ -1483,30 +1483,30 @@ test_2 (_mm512_maskz_cvtts_roundps_epu64, __m512i, __mmask8, __m256, 8) test_3 (_mm512_mask_cvtts_roundps_epu64, __m512i, __m512i, __mmask8, __m256, 8) /* avx10_2satcvtintrin.h */ -test_1 (_mm256_ipcvt_roundph_epi16, __m256i, __m256h, 8) -test_1 (_mm256_ipcvt_roundph_epu16, __m256i, __m256h, 8) -test_1 (_mm256_ipcvt_roundps_epi32, __m256i, __m256, 8) -test_1 (_mm256_ipcvt_roundps_epu32, __m256i, __m256, 8) -test_1 (_mm256_ipcvtt_roundph_epi16, __m256i, __m256h, 8) -test_1 (_mm256_ipcvtt_roundph_epu16, __m256i, __m256h, 8) -test_1 (_mm256_ipcvtt_roundps_epi32, __m256i, __m256, 8) -test_1 (_mm256_ipcvtt_roundps_epu32, __m256i, __m256, 8) -test_2 (_mm256_maskz_ipcvt_roundph_epi16, __m256i, __mmask16, __m256h, 8) -test_2 (_mm256_maskz_ipcvt_roundph_epu16, __m256i, __mmask16, __m256h, 8) -test_2 (_mm256_maskz_ipcvt_roundps_epi32, __m256i, __mmask8, __m256, 8) -test_2 (_mm256_maskz_ipcvt_roundps_epu32, __m256i, __mmask8, __m256, 8) -test_2 (_mm256_maskz_ipcvtt_roundph_epi16, __m256i, __mmask16, __m256h, 8) -test_2 (_mm256_maskz_ipcvtt_roundph_epu16, __m256i, __mmask16, __m256h, 8) -test_2 (_mm256_maskz_ipcvtt_roundps_epi32, __m256i, __mmask8, __m256, 8) -test_2 (_mm256_maskz_ipcvtt_roundps_epu32, __m256i, __mmask8, __m256, 8) -test_3 (_mm256_mask_ipcvt_roundph_epi16, __m256i, __m256i, __mmask16, __m256h, 8) -test_3 (_mm256_mask_ipcvt_roundph_epu16, __m256i, __m256i, __mmask16, __m256h, 8) -test_3 (_mm256_mask_ipcvt_roundps_epi32, __m256i, __m256i, __mmask8, __m256, 8) -test_3 (_mm256_mask_ipcvt_roundps_epu32, __m256i, __m256i, __mmask8, __m256, 8) -test_3 (_mm256_mask_ipcvtt_roundph_epi16, __m256i, __m256i, __mmask16, __m256h, 8) -test_3 (_mm256_mask_ipcvtt_roundph_epu16, __m256i, __m256i, __mmask16, __m256h, 8) -test_3 (_mm256_mask_ipcvtt_roundps_epi32, __m256i, __m256i, __mmask8, __m256, 8) -test_3 (_mm256_mask_ipcvtt_roundps_epu32, __m256i, __m256i, __mmask8, __m256, 8) +test_1 (_mm256_ipcvts_roundph_epi8, __m256i, __m256h, 8) +test_1 (_mm256_ipcvts_roundph_epu8, __m256i, __m256h, 8) +test_1 (_mm256_ipcvts_roundps_epi8, __m256i, __m256, 8) +test_1 (_mm256_ipcvts_roundps_epu8, __m256i, __m256, 8) +test_1 (_mm256_ipcvtts_roundph_epi8, __m256i, __m256h, 8) +test_1 (_mm256_ipcvtts_roundph_epu8, __m256i, __m256h, 8) +test_1 (_mm256_ipcvtts_roundps_epi8, __m256i, __m256, 8) +test_1 (_mm256_ipcvtts_roundps_epu8, __m256i, __m256, 8) +test_2 (_mm256_maskz_ipcvts_roundph_epi8, __m256i, __mmask16, __m256h, 8) +test_2 (_mm256_maskz_ipcvts_roundph_epu8, __m256i, __mmask16, __m256h, 8) +test_2 (_mm256_maskz_ipcvts_roundps_epi8, __m256i, __mmask8, __m256, 8) +test_2 (_mm256_maskz_ipcvts_roundps_epu8, __m256i, __mmask8, __m256, 8) +test_2 (_mm256_maskz_ipcvtts_roundph_epi8, __m256i, __mmask16, __m256h, 8) +test_2 (_mm256_maskz_ipcvtts_roundph_epu8, __m256i, __mmask16, __m256h, 8) +test_2 (_mm256_maskz_ipcvtts_roundps_epi8, __m256i, __mmask8, __m256, 8) +test_2 (_mm256_maskz_ipcvtts_roundps_epu8, __m256i, __mmask8, __m256, 8) +test_3 (_mm256_mask_ipcvts_roundph_epi8, __m256i, __m256i, __mmask16, __m256h, 8) +test_3 (_mm256_mask_ipcvts_roundph_epu8, __m256i, __m256i, __mmask16, __m256h, 8) +test_3 (_mm256_mask_ipcvts_roundps_epi8, __m256i, __m256i, __mmask8, __m256, 8) +test_3 (_mm256_mask_ipcvts_roundps_epu8, __m256i, __m256i, __mmask8, __m256, 8) +test_3 (_mm256_mask_ipcvtts_roundph_epi8, __m256i, __m256i, __mmask16, __m256h, 8) +test_3 (_mm256_mask_ipcvtts_roundph_epu8, __m256i, __m256i, __mmask16, __m256h, 8) +test_3 (_mm256_mask_ipcvtts_roundps_epi8, __m256i, __m256i, __mmask8, __m256, 8) +test_3 (_mm256_mask_ipcvtts_roundps_epu8, __m256i, __m256i, __mmask8, __m256, 8) test_1 (_mm256_cvtts_roundpd_epi32, __m128i, __m256d, 8) test_2 (_mm256_maskz_cvtts_roundpd_epi32, __m128i, __mmask8, __m256d, 8) test_3 (_mm256_mask_cvtts_roundpd_epi32, __m128i, __m128i, __mmask8, __m256d, 8) diff --git a/gcc/testsuite/gcc.target/i386/sse-22.c b/gcc/testsuite/gcc.target/i386/sse-22.c index 4f22fee..2da3d05 100644 --- a/gcc/testsuite/gcc.target/i386/sse-22.c +++ b/gcc/testsuite/gcc.target/i386/sse-22.c @@ -1472,30 +1472,30 @@ test_3 (_mm256_mask_cmp_pbh_mask, __mmask16, __mmask16, __m256bh, __m256bh, 1) test_3 (_mm_mask_cmp_pbh_mask, __mmask8, __mmask8, __m128bh, __m128bh, 1) /* avx10_2-512satcvtintrin.h */ -test_1 (_mm512_ipcvt_roundph_epi16, __m512i, __m512h, 8) -test_1 (_mm512_ipcvt_roundph_epu16, __m512i, __m512h, 8) -test_1 (_mm512_ipcvt_roundps_epi32, __m512i, __m512, 8) -test_1 (_mm512_ipcvt_roundps_epu32, __m512i, __m512, 8) -test_1 (_mm512_ipcvtt_roundph_epi16, __m512i, __m512h, 8) -test_1 (_mm512_ipcvtt_roundph_epu16, __m512i, __m512h, 8) -test_1 (_mm512_ipcvtt_roundps_epi32, __m512i, __m512, 8) -test_1 (_mm512_ipcvtt_roundps_epu32, __m512i, __m512, 8) -test_2 (_mm512_maskz_ipcvt_roundph_epi16, __m512i, __mmask32, __m512h, 8) -test_2 (_mm512_maskz_ipcvt_roundph_epu16, __m512i, __mmask32, __m512h, 8) -test_2 (_mm512_maskz_ipcvt_roundps_epi32, __m512i, __mmask16, __m512, 8) -test_2 (_mm512_maskz_ipcvt_roundps_epu32, __m512i, __mmask16, __m512, 8) -test_2 (_mm512_maskz_ipcvtt_roundph_epi16, __m512i, __mmask32, __m512h, 8) -test_2 (_mm512_maskz_ipcvtt_roundph_epu16, __m512i, __mmask32, __m512h, 8) -test_2 (_mm512_maskz_ipcvtt_roundps_epi32, __m512i, __mmask16, __m512, 8) -test_2 (_mm512_maskz_ipcvtt_roundps_epu32, __m512i, __mmask16, __m512, 8) -test_3 (_mm512_mask_ipcvt_roundph_epi16, __m512i, __m512i, __mmask32, __m512h, 8) -test_3 (_mm512_mask_ipcvt_roundph_epu16, __m512i, __m512i, __mmask32, __m512h, 8) -test_3 (_mm512_mask_ipcvt_roundps_epi32, __m512i, __m512i, __mmask16, __m512, 8) -test_3 (_mm512_mask_ipcvt_roundps_epu32, __m512i, __m512i, __mmask16, __m512, 8) -test_3 (_mm512_mask_ipcvtt_roundph_epi16, __m512i, __m512i, __mmask32, __m512h, 8) -test_3 (_mm512_mask_ipcvtt_roundph_epu16, __m512i, __m512i, __mmask32, __m512h, 8) -test_3 (_mm512_mask_ipcvtt_roundps_epi32, __m512i, __m512i, __mmask16, __m512, 8) -test_3 (_mm512_mask_ipcvtt_roundps_epu32, __m512i, __m512i, __mmask16, __m512, 8) +test_1 (_mm512_ipcvts_roundph_epi8, __m512i, __m512h, 8) +test_1 (_mm512_ipcvts_roundph_epu8, __m512i, __m512h, 8) +test_1 (_mm512_ipcvts_roundps_epi8, __m512i, __m512, 8) +test_1 (_mm512_ipcvts_roundps_epu8, __m512i, __m512, 8) +test_1 (_mm512_ipcvtts_roundph_epi8, __m512i, __m512h, 8) +test_1 (_mm512_ipcvtts_roundph_epu8, __m512i, __m512h, 8) +test_1 (_mm512_ipcvtts_roundps_epi8, __m512i, __m512, 8) +test_1 (_mm512_ipcvtts_roundps_epu8, __m512i, __m512, 8) +test_2 (_mm512_maskz_ipcvts_roundph_epi8, __m512i, __mmask32, __m512h, 8) +test_2 (_mm512_maskz_ipcvts_roundph_epu8, __m512i, __mmask32, __m512h, 8) +test_2 (_mm512_maskz_ipcvts_roundps_epi8, __m512i, __mmask16, __m512, 8) +test_2 (_mm512_maskz_ipcvts_roundps_epu8, __m512i, __mmask16, __m512, 8) +test_2 (_mm512_maskz_ipcvtts_roundph_epi8, __m512i, __mmask32, __m512h, 8) +test_2 (_mm512_maskz_ipcvtts_roundph_epu8, __m512i, __mmask32, __m512h, 8) +test_2 (_mm512_maskz_ipcvtts_roundps_epi8, __m512i, __mmask16, __m512, 8) +test_2 (_mm512_maskz_ipcvtts_roundps_epu8, __m512i, __mmask16, __m512, 8) +test_3 (_mm512_mask_ipcvts_roundph_epi8, __m512i, __m512i, __mmask32, __m512h, 8) +test_3 (_mm512_mask_ipcvts_roundph_epu8, __m512i, __m512i, __mmask32, __m512h, 8) +test_3 (_mm512_mask_ipcvts_roundps_epi8, __m512i, __m512i, __mmask16, __m512, 8) +test_3 (_mm512_mask_ipcvts_roundps_epu8, __m512i, __m512i, __mmask16, __m512, 8) +test_3 (_mm512_mask_ipcvtts_roundph_epi8, __m512i, __m512i, __mmask32, __m512h, 8) +test_3 (_mm512_mask_ipcvtts_roundph_epu8, __m512i, __m512i, __mmask32, __m512h, 8) +test_3 (_mm512_mask_ipcvtts_roundps_epi8, __m512i, __m512i, __mmask16, __m512, 8) +test_3 (_mm512_mask_ipcvtts_roundps_epu8, __m512i, __m512i, __mmask16, __m512, 8) test_1 (_mm512_cvtts_roundpd_epi32, __m256i, __m512d, 8) test_2 (_mm512_maskz_cvtts_roundpd_epi32, __m256i, __mmask8, __m512d, 8) test_3 (_mm512_mask_cvtts_roundpd_epi32, __m256i, __m256i, __mmask8, __m512d, 8) @@ -1522,30 +1522,30 @@ test_2 (_mm512_maskz_cvtts_roundps_epu64, __m512i, __mmask8, __m256, 8) test_3 (_mm512_mask_cvtts_roundps_epu64, __m512i, __m512i, __mmask8, __m256, 8) /* avx10_2satcvtintrin.h */ -test_1 (_mm256_ipcvt_roundph_epi16, __m256i, __m256h, 8) -test_1 (_mm256_ipcvt_roundph_epu16, __m256i, __m256h, 8) -test_1 (_mm256_ipcvt_roundps_epi32, __m256i, __m256, 8) -test_1 (_mm256_ipcvt_roundps_epu32, __m256i, __m256, 8) -test_1 (_mm256_ipcvtt_roundph_epi16, __m256i, __m256h, 8) -test_1 (_mm256_ipcvtt_roundph_epu16, __m256i, __m256h, 8) -test_1 (_mm256_ipcvtt_roundps_epi32, __m256i, __m256, 8) -test_1 (_mm256_ipcvtt_roundps_epu32, __m256i, __m256, 8) -test_2 (_mm256_maskz_ipcvt_roundph_epi16, __m256i, __mmask16, __m256h, 8) -test_2 (_mm256_maskz_ipcvt_roundph_epu16, __m256i, __mmask16, __m256h, 8) -test_2 (_mm256_maskz_ipcvt_roundps_epi32, __m256i, __mmask8, __m256, 8) -test_2 (_mm256_maskz_ipcvt_roundps_epu32, __m256i, __mmask8, __m256, 8) -test_2 (_mm256_maskz_ipcvtt_roundph_epi16, __m256i, __mmask16, __m256h, 8) -test_2 (_mm256_maskz_ipcvtt_roundph_epu16, __m256i, __mmask16, __m256h, 8) -test_2 (_mm256_maskz_ipcvtt_roundps_epi32, __m256i, __mmask8, __m256, 8) -test_2 (_mm256_maskz_ipcvtt_roundps_epu32, __m256i, __mmask8, __m256, 8) -test_3 (_mm256_mask_ipcvt_roundph_epi16, __m256i, __m256i, __mmask16, __m256h, 8) -test_3 (_mm256_mask_ipcvt_roundph_epu16, __m256i, __m256i, __mmask16, __m256h, 8) -test_3 (_mm256_mask_ipcvt_roundps_epi32, __m256i, __m256i, __mmask8, __m256, 8) -test_3 (_mm256_mask_ipcvt_roundps_epu32, __m256i, __m256i, __mmask8, __m256, 8) -test_3 (_mm256_mask_ipcvtt_roundph_epi16, __m256i, __m256i, __mmask16, __m256h, 8) -test_3 (_mm256_mask_ipcvtt_roundph_epu16, __m256i, __m256i, __mmask16, __m256h, 8) -test_3 (_mm256_mask_ipcvtt_roundps_epi32, __m256i, __m256i, __mmask8, __m256, 8) -test_3 (_mm256_mask_ipcvtt_roundps_epu32, __m256i, __m256i, __mmask8, __m256, 8) +test_1 (_mm256_ipcvts_roundph_epi8, __m256i, __m256h, 8) +test_1 (_mm256_ipcvts_roundph_epu8, __m256i, __m256h, 8) +test_1 (_mm256_ipcvts_roundps_epi8, __m256i, __m256, 8) +test_1 (_mm256_ipcvts_roundps_epu8, __m256i, __m256, 8) +test_1 (_mm256_ipcvtts_roundph_epi8, __m256i, __m256h, 8) +test_1 (_mm256_ipcvtts_roundph_epu8, __m256i, __m256h, 8) +test_1 (_mm256_ipcvtts_roundps_epi8, __m256i, __m256, 8) +test_1 (_mm256_ipcvtts_roundps_epu8, __m256i, __m256, 8) +test_2 (_mm256_maskz_ipcvts_roundph_epi8, __m256i, __mmask16, __m256h, 8) +test_2 (_mm256_maskz_ipcvts_roundph_epu8, __m256i, __mmask16, __m256h, 8) +test_2 (_mm256_maskz_ipcvts_roundps_epi8, __m256i, __mmask8, __m256, 8) +test_2 (_mm256_maskz_ipcvts_roundps_epu8, __m256i, __mmask8, __m256, 8) +test_2 (_mm256_maskz_ipcvtts_roundph_epi8, __m256i, __mmask16, __m256h, 8) +test_2 (_mm256_maskz_ipcvtts_roundph_epu8, __m256i, __mmask16, __m256h, 8) +test_2 (_mm256_maskz_ipcvtts_roundps_epi8, __m256i, __mmask8, __m256, 8) +test_2 (_mm256_maskz_ipcvtts_roundps_epu8, __m256i, __mmask8, __m256, 8) +test_3 (_mm256_mask_ipcvts_roundph_epi8, __m256i, __m256i, __mmask16, __m256h, 8) +test_3 (_mm256_mask_ipcvts_roundph_epu8, __m256i, __m256i, __mmask16, __m256h, 8) +test_3 (_mm256_mask_ipcvts_roundps_epi8, __m256i, __m256i, __mmask8, __m256, 8) +test_3 (_mm256_mask_ipcvts_roundps_epu8, __m256i, __m256i, __mmask8, __m256, 8) +test_3 (_mm256_mask_ipcvtts_roundph_epi8, __m256i, __m256i, __mmask16, __m256h, 8) +test_3 (_mm256_mask_ipcvtts_roundph_epu8, __m256i, __m256i, __mmask16, __m256h, 8) +test_3 (_mm256_mask_ipcvtts_roundps_epi8, __m256i, __m256i, __mmask8, __m256, 8) +test_3 (_mm256_mask_ipcvtts_roundps_epu8, __m256i, __m256i, __mmask8, __m256, 8) test_1 (_mm256_cvtts_roundpd_epi32, __m128i, __m256d, 8) test_2 (_mm256_maskz_cvtts_roundpd_epi32, __m128i, __mmask8, __m256d, 8) test_3 (_mm256_mask_cvtts_roundpd_epi32, __m128i, __m128i, __mmask8, __m256d, 8) diff --git a/gcc/testsuite/gcc.target/loongarch/regname-float-abi.c b/gcc/testsuite/gcc.target/loongarch/regname-float-abi.c new file mode 100644 index 0000000..2224304 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/regname-float-abi.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-Wno-pedantic -std=gnu90 -mfpu=64" } */ + +register double fs0 asm("fs0"); /* { dg-note "conflicts with 'fs0'" } */ +register double f24 asm("$f24"); /* { dg-warning "register of 'f24' used for multiple global register variables" } */ + +void +test (void) +{ + asm("" ::: "fa0", "fa1", "fa2", "fa3", "fa4", "fa5", "fa6", "fa7", + "ft0", "ft1", "ft2", "ft3", "ft4", "ft5", "ft6", "ft7", + "ft8", "ft9", "ft10", "ft11", "ft12", "ft13", "ft14", "ft15", + "fs0", "fs1", "fs2", "fs3", "fs4", "fs5", "fs6", "fs7"); +} diff --git a/gcc/testsuite/gcc.target/s390/vector/vcond-shift.c b/gcc/testsuite/gcc.target/s390/vector/vcond-shift.c index a6b4e97..b942f44 100644 --- a/gcc/testsuite/gcc.target/s390/vector/vcond-shift.c +++ b/gcc/testsuite/gcc.target/s390/vector/vcond-shift.c @@ -3,13 +3,13 @@ /* { dg-do compile { target { s390*-*-* } } } */ /* { dg-options "-O3 -march=z13 -mzarch" } */ -/* { dg-final { scan-assembler-times "vesraf\t%v.?,%v.?,31" 6 } } */ -/* { dg-final { scan-assembler-times "vesrah\t%v.?,%v.?,15" 6 } } */ -/* { dg-final { scan-assembler-times "vesrab\t%v.?,%v.?,7" 6 } } */ +/* { dg-final { scan-assembler-times "vesraf\t%v.?,%v.?,31" 4 } } */ +/* { dg-final { scan-assembler-times "vesrah\t%v.?,%v.?,15" 4 } } */ +/* { dg-final { scan-assembler-times "vesrab\t%v.?,%v.?,7" 4 } } */ /* { dg-final { scan-assembler-not "vzero\t*" } } */ -/* { dg-final { scan-assembler-times "vesrlf\t%v.?,%v.?,31" 4 } } */ -/* { dg-final { scan-assembler-times "vesrlh\t%v.?,%v.?,15" 4 } } */ -/* { dg-final { scan-assembler-times "vesrlb\t%v.?,%v.?,7" 4 } } */ +/* { dg-final { scan-assembler-times "vesrlf\t%v.?,%v.?,31" 6 } } */ +/* { dg-final { scan-assembler-times "vesrlh\t%v.?,%v.?,15" 6 } } */ +/* { dg-final { scan-assembler-times "vesrlb\t%v.?,%v.?,7" 6 } } */ /* Make it expand to two vector operations. */ #define ITER(X) (2 * (16 / sizeof (X[1]))) diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-eq-z13.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-eq-z13.c index 1806fa8..ad097ef 100644 --- a/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-eq-z13.c +++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-eq-z13.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -march=z13 -mzvector -mzarch" } */ +/* { dg-options "-O3 -march=z13 -mzvector -mzarch -fsignaling-nans" } */ #include "autovec.h" diff --git a/gcc/testsuite/gfortran.dg/allocate_assumed_charlen_5.f90 b/gcc/testsuite/gfortran.dg/allocate_assumed_charlen_5.f90 new file mode 100644 index 0000000..bc75dbe --- /dev/null +++ b/gcc/testsuite/gfortran.dg/allocate_assumed_charlen_5.f90 @@ -0,0 +1,17 @@ +! { dg-do compile } +! PR fortran/119338 - check F2003:C626 + +module m + implicit none +contains + subroutine sub (s, c) + character(len=*), allocatable, intent(out) :: s(:) + character(len=*), allocatable, intent(out) :: c + allocate(s(5)) ! OK + allocate(c) ! OK + allocate(character(len=*) :: s(5)) ! OK + allocate(character(len=*) :: c) ! OK + allocate(character(len=10) :: s(5)) ! { dg-error "shall be an asterisk" } + allocate(character(len=10) :: c) ! { dg-error "shall be an asterisk" } + end subroutine sub +end module m diff --git a/gcc/testsuite/gfortran.dg/associate_74.f90 b/gcc/testsuite/gfortran.dg/associate_74.f90 new file mode 100644 index 0000000..057d635 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/associate_74.f90 @@ -0,0 +1,47 @@ +!{ dg-do run } + +! Check that PR119272 is fixed +! Contributed by Xing Jing Wei <xingjingwei666@gmail.com> + +module pr119272_module + type, public :: test_type + contains + procedure :: scal_function + procedure :: arr_function + end type test_type + contains + function scal_function(this) result(smth) + class(test_type) :: this + integer :: smth + smth = 2 + end function + function arr_function(this) result(smth) + class(test_type) :: this + integer :: smth(9) + smth = (/(i, i=1, 9)/) + end function +end module + +program pr119272 + use pr119272_module + implicit none + + type(test_type) :: a + + call test_subroutine(a) + contains + subroutine test_subroutine(a) + class(test_type) :: a + integer :: i + integer,parameter :: temp_int(3) = [ 1, 2, 3] + integer,parameter :: identity(9) = (/(i* 5, i= 9, 1, -1)/) + associate(temp => temp_int(a%scal_function())) + if (temp /= 2) stop 1 + end associate + + associate(temparr => identity(a%arr_function())) + if (any(temparr /= (/(i* 5, i= 9, 1, -1)/))) stop 2 + end associate + end subroutine +end program + diff --git a/gcc/testsuite/gfortran.dg/bounds_check_27.f90 b/gcc/testsuite/gfortran.dg/bounds_check_27.f90 new file mode 100644 index 0000000..678aef6 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/bounds_check_27.f90 @@ -0,0 +1,45 @@ +! { dg-do run } +! { dg-additional-options "-fcheck=bounds" } +! +! PR fortran/116706 - bogus bounds check for reallocation on assignment +! Contributed by Balint Aradi <baradi09 at gmail.com> + +program testprog + implicit none + + type :: data_node + integer, allocatable :: data(:) + end type data_node + + type :: data_list + type(data_node), pointer :: nodes(:) => null() + end type data_list + + type :: upoly_node + class(*), allocatable :: data(:) + end type upoly_node + + type :: star_list + type(upoly_node), pointer :: nodes(:) => null() + end type star_list + + type(data_list) :: datalist + type(star_list) :: starlist + class(star_list), allocatable :: astarlist + class(star_list), pointer :: pstarlist + + allocate (datalist%nodes(2)) + datalist%nodes(1)%data = [1, 2, 3] + + allocate (starlist%nodes(2)) + starlist%nodes(1)%data = [1., 2., 3.] + + allocate (astarlist) + allocate (astarlist%nodes(2)) + astarlist%nodes(1)%data = [1, 2, 3] + + allocate (pstarlist) + allocate (pstarlist%nodes(2)) + pstarlist%nodes(1)%data = [1., 2., 3.] + +end program testprog diff --git a/gcc/testsuite/gfortran.dg/deferred_character_18.f90 b/gcc/testsuite/gfortran.dg/deferred_character_18.f90 index 1b1457f..b1229c2 100644 --- a/gcc/testsuite/gfortran.dg/deferred_character_18.f90 +++ b/gcc/testsuite/gfortran.dg/deferred_character_18.f90 @@ -11,7 +11,8 @@ contains character(*), allocatable, intent(out) :: str ! Note: Star ^ should have been a colon (:) - allocate (character(n)::str) +! allocate (character(n)::str) ! original invalid version from pr82367 + allocate (character(*)::str) ! corrected (see F2003:C626 and pr119338) end subroutine diff --git a/gcc/testsuite/gnat.dg/generic_inst14.adb b/gcc/testsuite/gnat.dg/generic_inst14.adb new file mode 100644 index 0000000..562bde6 --- /dev/null +++ b/gcc/testsuite/gnat.dg/generic_inst14.adb @@ -0,0 +1,20 @@ +-- { dg-do compile } + +with Generic_Inst14_Pkg; +with Generic_Inst14_Pkg.Child; + +procedure Generic_Inst14 is + + type T is null record; + + package Tree is new Generic_Inst14_Pkg.Definite_Value_Tree (T); + + package Base is new Generic_Inst14_Pkg.Child.Simple (T, Tree); + + package OK is new Generic_Inst14_Pkg.Child.OK (T, Base.Strat); + + package Not_OK is new Generic_Inst14_Pkg.Child.Not_OK (T, Tree, Base.Strat); + +begin + null; +end; diff --git a/gcc/testsuite/gnat.dg/generic_inst14_pkg-child.ads b/gcc/testsuite/gnat.dg/generic_inst14_pkg-child.ads new file mode 100644 index 0000000..8ad17c4 --- /dev/null +++ b/gcc/testsuite/gnat.dg/generic_inst14_pkg-child.ads @@ -0,0 +1,27 @@ +package Generic_Inst14_Pkg.Child is + + generic + type Value is private; + with package Value_Tree is new Definite_Value_Tree (Value => Value); + package Simple is + type Node is new Value_Tree.Value_Node with null record; + package Strat is new Def_Strat (Value, Value_Tree, Node); + end Simple; + + generic + type Value is private; + with package A_Strat is new Def_Strat (Value => Value, others => <>); + package OK is + procedure Plop (N : A_Strat.Node) is null; + end OK; + + generic + type Value is private; + with package Value_Tree is new Definite_Value_Tree (Value => Value); + with package A_Strat is + new Def_Strat (Value => Value, Value_Tree => Value_Tree, others => <>); + package Not_OK is + procedure Plop (N : A_Strat.Node) is null; + end Not_OK; + +end Generic_Inst14_Pkg.Child; diff --git a/gcc/testsuite/gnat.dg/generic_inst14_pkg.ads b/gcc/testsuite/gnat.dg/generic_inst14_pkg.ads new file mode 100644 index 0000000..b1334f6 --- /dev/null +++ b/gcc/testsuite/gnat.dg/generic_inst14_pkg.ads @@ -0,0 +1,16 @@ +package Generic_Inst14_Pkg is + + generic + type Value is limited private; + package Definite_Value_Tree is + type Value_Node is abstract tagged null record; + end Definite_Value_Tree; + + generic + type Value is limited private; + with package Value_Tree is new Definite_Value_Tree (Value); + type Node (<>) is new Value_Tree.Value_Node with private; + package Def_Strat is + end Def_Strat; + +end Generic_Inst14_Pkg; diff --git a/gcc/testsuite/rust/borrowck/reference.rs b/gcc/testsuite/rust/borrowck/reference.rs index b825a96..c4b9f7d 100644 --- a/gcc/testsuite/rust/borrowck/reference.rs +++ b/gcc/testsuite/rust/borrowck/reference.rs @@ -1,5 +1,5 @@ -// { dg-additional-options "-frust-compile-until=compilation -frust-borrowcheck" } - +// { dg-additional-options "-frust-compile-until=compilation -frust-borrowcheck -fdiagnostics-show-caret -fdiagnostics-show-line-numbers" } +// { dg-enable-nn-line-numbers "" } #[lang = "sized"] pub trait Sized {} @@ -32,27 +32,63 @@ fn immutable_borrow_while_immutable_borrowed_struct() { } fn immutable_borrow_while_mutable_borrowed_struct() { - // { dg-error "Found loan errors in function immutable_borrow_while_mutable_borrowed_struct" "" { target *-*-* } .-1 } let mut x = 0; let y = ReferenceMut::new(&mut x); let z = &x; //~ ERROR + // { dg-error "use of borrowed value" "" { target *-*-* } .-1 } let w = y; + /* + { dg-begin-multiline-output "" } + NN | let y = ReferenceMut::new(&mut x); + | ~ + | | + | borrow occurs here + NN | let z = &x; //~ ERROR + | ^ + | | + | borrowed value used here + { dg-end-multiline-output "" } + */ } fn mutable_borrow_while_immutable_borrowed_struct() { - // { dg-error "Found loan errors in function mutable_borrow_while_immutable_borrowed_struct" "" { target *-*-* } .-1 } let x = 0; let y = Reference::new(&x); let z = &mut x; //~ ERROR + // { dg-error "use of borrowed value" "" { target *-*-* } .-1 } let w = y; + /* + { dg-begin-multiline-output "" } + NN | let y = Reference::new(&x); + | ~ + | | + | borrow occurs here + NN | let z = &mut x; //~ ERROR + | ^ + | | + | borrowed value used here + { dg-end-multiline-output "" } + */ } fn mutable_borrow_while_mutable_borrowed_struct() { - // { dg-error "Found loan errors in function mutable_borrow_while_mutable_borrowed_struct" "" { target *-*-* } .-1 } let mut x = 0; let y = ReferenceMut::new(&mut x); let z = &mut x; //~ ERROR + // { dg-error "use of borrowed value" "" { target *-*-* } .-1 } let w = y; + /* + { dg-begin-multiline-output "" } + NN | let y = ReferenceMut::new(&mut x); + | ~ + | | + | borrow occurs here + NN | let z = &mut x; //~ ERROR + | ^ + | | + | borrowed value used here + { dg-end-multiline-output "" } + */ } fn immutable_reborrow_while_immutable_borrowed_struct() { @@ -69,31 +105,73 @@ fn immutable_reborrow_while_mutable_borrowed_struct() { fn mutable_reborrow_while_immutable_borrowed_struct() { // { dg-error "Cannot reborrow immutable borrow as mutable" "" { target *-*-* } .-1 } + /* + { dg-begin-multiline-output "" } + NN | fn mutable_reborrow_while_immutable_borrowed_struct() { + | ^~ + { dg-end-multiline-output "" } + */ let x = 0; let y = Reference::new(&x); let z = &mut *y.value; //~ ERROR } fn read_while_mutable_borrowed_struct() { - // { dg-error "Found loan errors in function read_while_mutable_borrowed_struct" "" { target *-*-* } .-1 } let mut x = 0; let y = ReferenceMut::new(&mut x); let z = x; //~ ERROR + // { dg-error "use of borrowed value" "" { target *-*-* } .-1 } let w = y; + /* + { dg-begin-multiline-output "" } + NN | let y = ReferenceMut::new(&mut x); + | ~ + | | + | borrow occurs here + NN | let z = x; //~ ERROR + | ^ + | | + | borrowed value used here + { dg-end-multiline-output "" } + */ } fn write_while_borrowed_struct() { - // { dg-error "Found loan errors in function write_while_borrowed_struct" "" { target *-*-* } .-1 } let mut x = 0; let y = Reference::new(&x); x = 1; //~ ERROR + // { dg-error "use of borrowed value" "" { target *-*-* } .-1 } let z = y; + /* + { dg-begin-multiline-output "" } + NN | let y = Reference::new(&x); + | ~ + | | + | borrow occurs here + NN | x = 1; //~ ERROR + | ^ + | | + | borrowed value used here + { dg-end-multiline-output "" } + */ } fn write_while_immutable_borrowed_struct() { - // { dg-error "Found loan errors in function write_while_immutable_borrowed_struct" "" { target *-*-* } .-1 } let x = 0; let y = Reference::new(&x); x = 1; //~ ERROR + // { dg-error "use of borrowed value" "" { target *-*-* } .-1 } let z = y; -}
\ No newline at end of file + /* + { dg-begin-multiline-output "" } + NN | let y = Reference::new(&x); + | ~ + | | + | borrow occurs here + NN | x = 1; //~ ERROR + | ^ + | | + | borrowed value used here + { dg-end-multiline-output "" } + */ +} diff --git a/gcc/testsuite/rust/borrowck/return_ref_to_local.rs b/gcc/testsuite/rust/borrowck/return_ref_to_local.rs index 994dc5d..ce23f91 100644 --- a/gcc/testsuite/rust/borrowck/return_ref_to_local.rs +++ b/gcc/testsuite/rust/borrowck/return_ref_to_local.rs @@ -1,6 +1,17 @@ -// { dg-additional-options "-frust-compile-until=compilation -frust-borrowcheck" } +// { dg-additional-options "-frust-compile-until=compilation -frust-borrowcheck -fdiagnostics-show-caret -fdiagnostics-show-line-numbers" } +// { dg-enable-nn-line-numbers "" } -pub fn return_ref_to_local() -> &'static i32 { // { dg-error "Found loan errors in function return_ref_to_local" } +pub fn return_ref_to_local() -> &'static i32 { let x = 0; &x //~ ERROR + // { dg-error "use of borrowed value" "" { target *-*-* } .-1 } + /* + { dg-begin-multiline-output "" } + NN | &x //~ ERROR + | ^ + | | + | borrow occurs here + | borrowed value used here + { dg-end-multiline-output "" } + */ } diff --git a/gcc/testsuite/rust/borrowck/subset.rs b/gcc/testsuite/rust/borrowck/subset.rs index d7c00ca..5b4a663 100644 --- a/gcc/testsuite/rust/borrowck/subset.rs +++ b/gcc/testsuite/rust/borrowck/subset.rs @@ -1,8 +1,19 @@ -// { dg-additional-options "-frust-compile-until=compilation -frust-borrowcheck" } +// { dg-additional-options "-frust-compile-until=compilation -frust-borrowcheck -fdiagnostics-show-caret -fdiagnostics-show-line-numbers" } +// { dg-enable-nn-line-numbers "" } fn missing_subset<'a, 'b>(x: &'a u32, y: &'b u32) -> &'a u32 { - // { dg-error "Found subset errors in function missing_subset" "" { target *-*-* } .-1 } + // { dg-error "subset error, some lifetime constraints need to be added" "" { target *-*-* } .-1 } y //~ ERROR + /* + { dg-begin-multiline-output "" } + NN | fn missing_subset<'a, 'b>(x: &'a u32, y: &'b u32) -> &'a u32 { + | ^~ ~~ ~~ + | | | | + | | | lifetime defined here + | | lifetime defined here + | subset error occurs in this function + { dg-end-multiline-output "" } + */ } fn missing_subset_fixed<'a, 'b>(x: &'a u32, y: &'b u32) -> &'a u32 where 'b: 'a { @@ -10,12 +21,22 @@ fn missing_subset_fixed<'a, 'b>(x: &'a u32, y: &'b u32) -> &'a u32 where 'b: 'a } fn complex_cfg_subset<'a, 'b>(b: bool, x: &'a u32, y: &'b u32) -> &'a u32 { - // { dg-error "Found subset errors in function complex_cfg_subset" "" { target *-*-* } .-1 } + // { dg-error "subset error, some lifetime constraints need to be added" "" { target *-*-* } .-1 } if b { y //~ ERROR } else { x } + /* + { dg-begin-multiline-output "" } + NN | fn complex_cfg_subset<'a, 'b>(b: bool, x: &'a u32, y: &'b u32) -> &'a u32 { + | ^~ ~~ ~~ + | | | | + | | | lifetime defined here + | | lifetime defined here + | subset error occurs in this function + { dg-end-multiline-output "" } + */ } fn complex_cfg_subset_fixed<'a, 'b>(b: bool, x: &'a u32, y: &'b u32) -> &'a u32 where 'b: 'a { @@ -24,4 +45,4 @@ fn complex_cfg_subset_fixed<'a, 'b>(b: bool, x: &'a u32, y: &'b u32) -> &'a u32 } else { y } -}
\ No newline at end of file +} diff --git a/gcc/testsuite/rust/borrowck/test_move.rs b/gcc/testsuite/rust/borrowck/test_move.rs index 2b5e0c3..b647583 100644 --- a/gcc/testsuite/rust/borrowck/test_move.rs +++ b/gcc/testsuite/rust/borrowck/test_move.rs @@ -1,16 +1,32 @@ -// { dg-additional-options "-frust-compile-until=compilation -frust-borrowcheck" } -fn test_move() { // { dg-error "Found move errors in function test_move" } +// { dg-additional-options "-frust-compile-until=compilation -frust-borrowcheck -fdiagnostics-show-caret -fdiagnostics-show-line-numbers" } +// { dg-enable-nn-line-numbers "" } + +fn test_move() { struct A { i: i32, } let a = A { i: 1 }; let b = a; - let c = a; + let c = a; //~ ERROR + // { dg-error "use of moved value" "" { target *-*-* } .-1 } + /* + { dg-begin-multiline-output "" } + NN | let b = a; + | ~ + | | + | value moved here + NN | let c = a; //~ ERROR + | ^ + | | + | moved value used here + { dg-end-multiline-output "" } + */ + } fn test_move_fixed() { let a = 1; // a is now primitive and can be copied let b = a; - let c = b; -}
\ No newline at end of file + let c = a; +} diff --git a/gcc/testsuite/rust/borrowck/test_move_conditional.rs b/gcc/testsuite/rust/borrowck/test_move_conditional.rs index e1e8e20..94882bc 100644 --- a/gcc/testsuite/rust/borrowck/test_move_conditional.rs +++ b/gcc/testsuite/rust/borrowck/test_move_conditional.rs @@ -1,6 +1,7 @@ -// { dg-additional-options "-frust-compile-until=compilation -frust-borrowcheck" } +// { dg-additional-options "-frust-compile-until=compilation -frust-borrowcheck -fdiagnostics-show-caret -fdiagnostics-show-line-numbers" } +// { dg-enable-nn-line-numbers "" } -fn test_move_conditional(b1: bool, b2:bool) { // { dg-error "Found move errors in function test_move" } +fn test_move_conditional(b1: bool, b2:bool) { struct A { i: i32, } @@ -9,9 +10,47 @@ fn test_move_conditional(b1: bool, b2:bool) { // { dg-error "Found move errors i let b = a; if b1 { let b = a; + // { dg-error "use of moved value" "" { target *-*-* } .-1 } + /* + { dg-begin-multiline-output "" } + NN | let b = a; + | ~ + | | + | value moved here + NN | if b1 { + NN | let b = a; + | ~ + | | + | value moved here +...... + NN | let c = a; + | ^ + | | + | moved value used here + { dg-end-multiline-output "" } + */ } if b2 { let c = a; + // { dg-error "use of moved value" "" { target *-*-* } .-1 } + /* + { dg-begin-multiline-output "" } + NN | let b = a; + | ~ + | | + | value moved here + NN | if b1 { + NN | let b = a; + | ^ + | | + | moved value used here +...... + NN | let c = a; + | ~ + | | + | value moved here + { dg-end-multiline-output "" } + */ } } @@ -25,4 +64,4 @@ fn test_move_fixed(b1: bool, b2:bool) { if b2 { let c = a; } -}
\ No newline at end of file +} diff --git a/gcc/testsuite/rust/borrowck/tmp.rs b/gcc/testsuite/rust/borrowck/tmp.rs index a604bea..545a278 100644 --- a/gcc/testsuite/rust/borrowck/tmp.rs +++ b/gcc/testsuite/rust/borrowck/tmp.rs @@ -1,4 +1,5 @@ -// { dg-additional-options "-frust-compile-until=compilation -frust-borrowcheck" } +// { dg-additional-options "-frust-compile-until=compilation -frust-borrowcheck -fdiagnostics-show-caret -fdiagnostics-show-line-numbers" } +// { dg-enable-nn-line-numbers "" } #[lang = "sized"] pub trait Sized {} @@ -12,27 +13,63 @@ fn immutable_borrow_while_immutable_borrowed() { fn immutable_borrow_while_mutable_borrowed() { - // { dg-error "Found loan errors in function immutable_borrow_while_mutable_borrowed" "" { target *-*-* } .-1 } let mut x = 0; let y = &mut x; let z = &x; //~ ERROR + // { dg-error "use of borrowed value" "" { target *-*-* } .-1 } let w = y; + /* + { dg-begin-multiline-output "" } + NN | let y = &mut x; + | ~ + | | + | borrow occurs here + NN | let z = &x; //~ ERROR + | ^ + | | + | borrowed value used here + { dg-end-multiline-output "" } + */ } fn mutable_borrow_while_immutable_borrowed() { - // { dg-error "Found loan errors in function mutable_borrow_while_immutable_borrowed" "" { target *-*-* } .-1 } let x = 0; let y = &x; let z = &mut x; //~ ERROR + // { dg-error "use of borrowed value" "" { target *-*-* } .-1 } let w = y; + /* + { dg-begin-multiline-output "" } + NN | let y = &x; + | ~ + | | + | borrow occurs here + NN | let z = &mut x; //~ ERROR + | ^ + | | + | borrowed value used here + { dg-end-multiline-output "" } + */ } fn mutable_borrow_while_mutable_borrowed() { - // { dg-error "Found loan errors in function mutable_borrow_while_mutable_borrowed" "" { target *-*-* } .-1 } let mut x = 0; let y = &mut x; let z = &mut x; //~ ERROR + // { dg-error "use of borrowed value" "" { target *-*-* } .-1 } let w = y; + /* + { dg-begin-multiline-output "" } + NN | let y = &mut x; + | ~ + | | + | borrow occurs here + NN | let z = &mut x; //~ ERROR + | ^ + | | + | borrowed value used here + { dg-end-multiline-output "" } + */ } fn immutable_reborrow_while_immutable_borrowed() { @@ -52,28 +89,70 @@ fn mutable_reborrow_while_immutable_borrowed() { let x = 0; let y = &x; let z = &mut *y; //~ ERROR + /* + { dg-begin-multiline-output "" } + NN | fn mutable_reborrow_while_immutable_borrowed() { + | ^~ + { dg-end-multiline-output "" } + */ } fn read_while_mutable_borrowed() { - // { dg-error "Found loan errors in function read_while_mutable_borrowed" "" { target *-*-* } .-1 } let mut x = 0; let y = &mut x; let z = x; //~ ERROR + // { dg-error "use of borrowed value" "" { target *-*-* } .-1 } let w = y; + /* + { dg-begin-multiline-output "" } + NN | let y = &mut x; + | ~ + | | + | borrow occurs here + NN | let z = x; //~ ERROR + | ^ + | | + | borrowed value used here + { dg-end-multiline-output "" } + */ } fn write_while_borrowed() { - // { dg-error "Found loan errors in function write_while_borrowed" "" { target *-*-* } .-1 } let mut x = 0; let y = &x; x = 1; //~ ERROR + // { dg-error "use of borrowed value" "" { target *-*-* } .-1 } let z = y; + /* + { dg-begin-multiline-output "" } + NN | let y = &x; + | ~ + | | + | borrow occurs here + NN | x = 1; //~ ERROR + | ^ + | | + | borrowed value used here + { dg-end-multiline-output "" } + */ } fn write_while_immutable_borrowed() { - // { dg-error "Found loan errors in function write_while_immutable_borrowed" "" { target *-*-* } .-1 } let x = 0; let y = &x; x = 1; //~ ERROR + // { dg-error "use of borrowed value" "" { target *-*-* } .-1 } let z = y; -}
\ No newline at end of file + /* + { dg-begin-multiline-output "" } + NN | let y = &x; + | ~ + | | + | borrow occurs here + NN | x = 1; //~ ERROR + | ^ + | | + | borrowed value used here + { dg-end-multiline-output "" } + */ +} diff --git a/gcc/testsuite/rust/borrowck/use_while_mut.rs b/gcc/testsuite/rust/borrowck/use_while_mut.rs index 57ed255..a973f7d 100644 --- a/gcc/testsuite/rust/borrowck/use_while_mut.rs +++ b/gcc/testsuite/rust/borrowck/use_while_mut.rs @@ -1,7 +1,22 @@ -// { dg-additional-options "-frust-compile-until=compilation -frust-borrowcheck" } -pub fn use_while_mut() { // { dg-error "Found loan errors in function use_while_mut" } +// { dg-additional-options "-frust-compile-until=compilation -frust-borrowcheck -fdiagnostics-show-caret -fdiagnostics-show-line-numbers" } +// { dg-enable-nn-line-numbers "" } + +pub fn use_while_mut() { let mut x = 0; let y = &mut x; let z = x; //~ ERROR + // { dg-error "use of borrowed value" "" { target *-*-* } .-1 } let w = y; -}
\ No newline at end of file + /* + { dg-begin-multiline-output "" } + NN | let y = &mut x; + | ~ + | | + | borrow occurs here + NN | let z = x; //~ ERROR + | ^ + | | + | borrowed value used here + { dg-end-multiline-output "" } + */ +} diff --git a/gcc/testsuite/rust/borrowck/use_while_mut_fr.rs b/gcc/testsuite/rust/borrowck/use_while_mut_fr.rs index 736aac0..c2dc168 100644 --- a/gcc/testsuite/rust/borrowck/use_while_mut_fr.rs +++ b/gcc/testsuite/rust/borrowck/use_while_mut_fr.rs @@ -1,8 +1,21 @@ -// { dg-additional-options "-frust-compile-until=compilation -frust-borrowcheck" } - -pub fn use_while_mut_fr(x: &mut i32) -> &mut i32 { // { dg-error "Found loan errors in function use_while_mut_fr" } +// { dg-additional-options "-frust-compile-until=compilation -frust-borrowcheck -fdiagnostics-show-caret -fdiagnostics-show-line-numbers" } +// { dg-enable-nn-line-numbers "" } +pub fn use_while_mut_fr(x: &mut i32) -> &mut i32 { let y = &mut *x; let z = x; //~ ERROR + // { dg-error "use of borrowed value" "" { target *-*-* } .-1 } y + /* + { dg-begin-multiline-output "" } + NN | let y = &mut *x; + | ~ + | | + | borrow occurs here + NN | let z = x; //~ ERROR + | ^ + | | + | borrowed value used here + { dg-end-multiline-output "" } + */ } diff --git a/gcc/testsuite/rust/borrowck/well_formed_function_inputs.rs b/gcc/testsuite/rust/borrowck/well_formed_function_inputs.rs index 6815f44..9102356 100644 --- a/gcc/testsuite/rust/borrowck/well_formed_function_inputs.rs +++ b/gcc/testsuite/rust/borrowck/well_formed_function_inputs.rs @@ -1,10 +1,11 @@ -// { dg-additional-options "-frust-compile-until=compilation -frust-borrowcheck" } +// { dg-additional-options "-frust-compile-until=compilation -frust-borrowcheck -fdiagnostics-show-caret -fdiagnostics-show-line-numbers" } +// { dg-enable-nn-line-numbers "" } fn foo<'a, 'b>(p: &'b &'a mut usize) -> &'b&'a mut usize { p } -fn well_formed_function_inputs() { // { dg-error "Found loan errors in function well_formed_function_inputs" } +fn well_formed_function_inputs() { let s = &mut 1; let r = &mut *s; let tmp = foo(&r ); @@ -12,5 +13,19 @@ fn well_formed_function_inputs() { // { dg-error "Found loan errors in function // let aarg = &*arg; // let tmp = arg; s; //~ ERROR + // { dg-error "use of borrowed value" "" { target *-*-* } .-1 } tmp; -}
\ No newline at end of file + /* + { dg-begin-multiline-output "" } + NN | let r = &mut *s; + | ~ + | | + | borrow occurs here +...... + NN | s; //~ ERROR + | ^ + | | + | borrowed value used here + { dg-end-multiline-output "" } + */ +} diff --git a/gcc/testsuite/rust/compile/assume.rs b/gcc/testsuite/rust/compile/assume.rs index 4dc2fef..f7e0bc8 100644 --- a/gcc/testsuite/rust/compile/assume.rs +++ b/gcc/testsuite/rust/compile/assume.rs @@ -1,3 +1,5 @@ +#![feature(intrinsics)] + mod intrinsics { extern "rust-intrinsic" { pub fn assume(value: bool); diff --git a/gcc/testsuite/rust/compile/auto_trait.rs b/gcc/testsuite/rust/compile/auto_trait.rs new file mode 100644 index 0000000..47bd119 --- /dev/null +++ b/gcc/testsuite/rust/compile/auto_trait.rs @@ -0,0 +1 @@ +auto trait Valid {} // { dg-error "auto traits are experimental and possibly buggy" } diff --git a/gcc/testsuite/rust/compile/auto_trait_super_trait.rs b/gcc/testsuite/rust/compile/auto_trait_super_trait.rs index 1080afb..06746e9 100644 --- a/gcc/testsuite/rust/compile/auto_trait_super_trait.rs +++ b/gcc/testsuite/rust/compile/auto_trait_super_trait.rs @@ -1,3 +1,4 @@ +#![feature(optin_builtin_traits)] trait Cold {} auto trait IsCool: Cold {} diff --git a/gcc/testsuite/rust/compile/box_syntax_feature_gate.rs b/gcc/testsuite/rust/compile/box_syntax_feature_gate.rs index 8eb5503..5f62a59 100644 --- a/gcc/testsuite/rust/compile/box_syntax_feature_gate.rs +++ b/gcc/testsuite/rust/compile/box_syntax_feature_gate.rs @@ -1,4 +1,6 @@ // { dg-options "-frust-compile-until=lowering" } +#[lang = "owned_box"] +pub struct Box<T>; fn main() { let x: Box<_> = box 1; //{ dg-error "box expression syntax is experimental." "" { target *-*-* } } diff --git a/gcc/testsuite/rust/compile/builtin_macro_include_bytes.rs b/gcc/testsuite/rust/compile/builtin_macro_include_bytes.rs deleted file mode 100644 index 9972c10..0000000 --- a/gcc/testsuite/rust/compile/builtin_macro_include_bytes.rs +++ /dev/null @@ -1,15 +0,0 @@ -#![feature(rustc_attrs)] - -#[rustc_builtin_macro] -macro_rules! include_bytes { - () => {{}}; -} - -fn main () { - let file = "include.txt"; - include_bytes! (file); // { dg-error "argument must be a string literal" "" } - include_bytes! (); // { dg-error "macro takes 1 argument" "" } - include_bytes! ("foo.txt", "bar.txt"); // { dg-error "macro takes 1 argument" "" } - include_bytes! ("builtin_macro_include_bytes.rs"); // ok - include_bytes! ("builtin_macro_include_bytes.rs",); // trailing comma ok -} diff --git a/gcc/testsuite/rust/compile/builtin_macro_include_str.rs b/gcc/testsuite/rust/compile/builtin_macro_include_str.rs deleted file mode 100644 index d6d7a76..0000000 --- a/gcc/testsuite/rust/compile/builtin_macro_include_str.rs +++ /dev/null @@ -1,16 +0,0 @@ -#![feature(rustc_attrs)] - -#[rustc_builtin_macro] -macro_rules! include_str { - () => {{}}; -} - -fn main () { - let file = "include.txt"; - include_str! (file); // { dg-error "argument must be a string literal" "" } - include_str! (); // { dg-error "macro takes 1 argument" "" } - include_str! ("foo.txt", "bar.txt"); // { dg-error "macro takes 1 argument" "" } - include_str! ("builtin_macro_include_str.rs"); // ok - include_str! ("builtin_macro_include_str.rs",); // trailing comma ok - include_str! ("invalid_utf8"); // { dg-error "invalid_utf8 was not a valid utf-8 file" "" } -} diff --git a/gcc/testsuite/rust/compile/exhaustiveness1.rs b/gcc/testsuite/rust/compile/exhaustiveness1.rs new file mode 100644 index 0000000..fe95ea3 --- /dev/null +++ b/gcc/testsuite/rust/compile/exhaustiveness1.rs @@ -0,0 +1,53 @@ +struct S { + a: i32, +} + +fn s1(s: S) { + match s { + S { a: _ } => {} + } +} + +fn s2(s: S) { + match s { + _ => {} + } +} + +fn s3(s: S) { + match s { + // { dg-error "non-exhaustive patterns: '_' not covered" "" { target *-*-* } .-1 } + } +} + +enum E { + A(), + B(), + C(), +} + +fn e1(e: E) { + match e { + // { dg-error "non-exhaustive patterns: 'E::B..' not covered" "" { target *-*-* } .-1 } + E::A() => {} + E::C() => {} + } +} + +fn e2(e: E) { + match e { + // { dg-error "non-exhaustive patterns: 'E::A..' not covered" "" { target *-*-* } .-1 } + E::B() => {} + E::C() => {} + } +} + +fn e3(e: E) { + match e { + E::A() => {} + E::B() => {} + E::C() => {} + } +} + +fn main() {} diff --git a/gcc/testsuite/rust/compile/exhaustiveness2.rs b/gcc/testsuite/rust/compile/exhaustiveness2.rs new file mode 100644 index 0000000..f2e0008 --- /dev/null +++ b/gcc/testsuite/rust/compile/exhaustiveness2.rs @@ -0,0 +1,28 @@ +enum E1 { + E2(E2), + None, +} + +enum E2 { + E3(E3), + None, +} + +enum E3 { + S(S), + None, +} + +struct S { + a: i32, + b: u64, +} + +fn f1(e: E1) { + match e { + // { dg-error "non-exhaustive patterns: 'E1::E2.E2::None.' and 'E1::None' not covered" "" { target *-*-* } .-1 } + E1::E2(E2::E3(_)) => {} + } +} + +fn main() {} diff --git a/gcc/testsuite/rust/compile/exhaustiveness3.rs b/gcc/testsuite/rust/compile/exhaustiveness3.rs new file mode 100644 index 0000000..4a5dc1c --- /dev/null +++ b/gcc/testsuite/rust/compile/exhaustiveness3.rs @@ -0,0 +1,55 @@ +struct S { + e1: E1, + e2: E2, +} + +enum E1 { + A(), + B(), + C(), +} + +enum E2 { + D(), + E(), +} + +// This is a valid match +fn f(s: S) { + match s { + S { + e1: E1::A(), + e2: E2::D(), + } => {} + S { + e1: E1::B(), + e2: E2::D(), + } => {} + S { + e1: E1::C(), + e2: E2::D(), + } => {} + S { + e1: E1::A(), + e2: E2::E(), + } => {} + S { + e1: E1::B(), + e2: E2::E(), + } => {} + S { + e1: E1::C(), + e2: E2::E(), + } => {} + } +} + +fn f2(s: S) { + match s { + // { dg-error "non-exhaustive patterns: 'S { e1: E1::B.., e2: E2::D.. }' and 'S { e1: E1::C.., e2: E2::D.. }' not covered" "" { target *-*-* } .-1 } + S { e1: E1::A(), e2: _ } => {} + S { e1: _, e2: E2::E() } => {} + } +} + +fn main() {} diff --git a/gcc/testsuite/rust/compile/functions_without_body.rs b/gcc/testsuite/rust/compile/functions_without_body.rs index 36ddea5..0a0e602 100644 --- a/gcc/testsuite/rust/compile/functions_without_body.rs +++ b/gcc/testsuite/rust/compile/functions_without_body.rs @@ -1,3 +1,4 @@ +// { dg-additional-options "-frust-compile-until=nameresolution" } struct MyStruct; trait X {} diff --git a/gcc/testsuite/rust/compile/generic_auto_trait.rs b/gcc/testsuite/rust/compile/generic_auto_trait.rs index ae6a51d..a0a414c 100644 --- a/gcc/testsuite/rust/compile/generic_auto_trait.rs +++ b/gcc/testsuite/rust/compile/generic_auto_trait.rs @@ -1,2 +1,3 @@ +#![feature(optin_builtin_traits)] auto trait IsCooler<G> {} // { dg-error "auto traits cannot have generic parameters .E0567." "" { target *-*-* } .-1 } diff --git a/gcc/testsuite/rust/compile/inline_asm_compile_nop.rs b/gcc/testsuite/rust/compile/inline_asm_compile_nop.rs new file mode 100644 index 0000000..c49667c --- /dev/null +++ b/gcc/testsuite/rust/compile/inline_asm_compile_nop.rs @@ -0,0 +1,12 @@ +#![feature(rustc_attrs)] + +#[rustc_builtin_macro] +macro_rules! asm { + () => {} +} + +fn main() { + unsafe { + asm!("nop"); + } +}
\ No newline at end of file diff --git a/gcc/testsuite/rust/compile/inline_asm_illegal_operands.rs b/gcc/testsuite/rust/compile/inline_asm_illegal_operands.rs index 5a13fb9..f29b4b6 100644 --- a/gcc/testsuite/rust/compile/inline_asm_illegal_operands.rs +++ b/gcc/testsuite/rust/compile/inline_asm_illegal_operands.rs @@ -11,14 +11,14 @@ fn main() { asm!( "add {x}, {1}", x = in(reg) _x, - x = in(reg) _x, // { dg-error {duplicate argument named 'x'} "" { xfail *-*-* } .-1 } + x = in(reg) _x, // { dg-error {duplicate argument named 'x'} } ); asm!( "mov {x}, {x}", - x = inout("eax") _x, // { dg-error {explicit register arguments cannot have names} "" { xfail *-*-* } .-1 } + x = inout("eax") _x, // { dg-error {explicit register arguments cannot have names} } x = inout(reg) _x, // It then proceeds to parse this line, resulting in only 1 error instead of duplication error as well. ); } _x = 1; -}
\ No newline at end of file +} diff --git a/gcc/testsuite/rust/compile/inline_asm_parse_operand.rs b/gcc/testsuite/rust/compile/inline_asm_parse_operand.rs index 2770263..c7bc152 100644 --- a/gcc/testsuite/rust/compile/inline_asm_parse_operand.rs +++ b/gcc/testsuite/rust/compile/inline_asm_parse_operand.rs @@ -2,13 +2,13 @@ #[rustc_builtin_macro] macro_rules! asm { - () => {} + () => {}; } -fn main() { +fn main() -> i32 { unsafe { asm!( - "add {0:e}, {0:e}", + "add {}, 1", in(reg) 0 ); } @@ -20,18 +20,20 @@ fn main() { let _num2: i32 = 20; unsafe { asm!( - "add {0}, {0}", - inout(reg) num1 =>_num1, + "add {}, {}", in(reg) _num2, + out(reg) _num1, ); } - let mut _output_testing : u32 = 0; + let mut _output_testing: u32 = 0; unsafe { asm!( - "add {0}, {0}", + "add {}, 1", in(reg) _num1, - out(reg) _, + //out(reg) _, ); } -}
\ No newline at end of file + + 0 +} diff --git a/gcc/testsuite/rust/compile/inline_asm_parse_output_operand.rs b/gcc/testsuite/rust/compile/inline_asm_parse_output_operand.rs new file mode 100644 index 0000000..a67fff5 --- /dev/null +++ b/gcc/testsuite/rust/compile/inline_asm_parse_output_operand.rs @@ -0,0 +1,18 @@ +#![feature(rustc_attrs)] + +#[rustc_builtin_macro] +macro_rules! asm { + () => {}; +} + +fn main() { + let mut _num1: i32 = 10; + let mut _num2: i32 = 10; + unsafe { + asm!( + "mov {}, 4", + out(reg) _num1, + out(reg) _num2, + ); + } +} diff --git a/gcc/testsuite/rust/compile/inline_asm_typecheck.rs b/gcc/testsuite/rust/compile/inline_asm_typecheck.rs new file mode 100644 index 0000000..b2daefc --- /dev/null +++ b/gcc/testsuite/rust/compile/inline_asm_typecheck.rs @@ -0,0 +1,20 @@ +#![feature(rustc_attrs)] + +#[rustc_builtin_macro] +macro_rules! asm { + () => {}; +} + +fn main() { + let mut _num1: i32 = 10; + let mut _num2: i32 = 10; + unsafe { + // This demonstrates that asm!'s is inferred with a unit type is parsed correctly. + let _ = asm!("nop"); + + // The asm! block never returns, and its return type is defined as ! (never). + // Behavior is undefined if execution falls through past the end of the asm code. + // A noreturn asm block behaves just like a function which doesn't return; notably, local variables in scope are not dropped before it is invoked. + let _ = asm!("nop", options(noreturn)); + } +} diff --git a/gcc/testsuite/rust/compile/issue-1901.rs b/gcc/testsuite/rust/compile/issue-1901.rs index dd41ff8..cfd8ef4 100644 --- a/gcc/testsuite/rust/compile/issue-1901.rs +++ b/gcc/testsuite/rust/compile/issue-1901.rs @@ -1,3 +1,5 @@ +#![feature(intrinsics)] + #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-1981.rs b/gcc/testsuite/rust/compile/issue-1981.rs index b1637ac..bfd8d2c 100644 --- a/gcc/testsuite/rust/compile/issue-1981.rs +++ b/gcc/testsuite/rust/compile/issue-1981.rs @@ -1,3 +1,5 @@ +#![feature(intrinsics)] + #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/issue-2203.rs b/gcc/testsuite/rust/compile/issue-2203.rs new file mode 100644 index 0000000..961381d --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-2203.rs @@ -0,0 +1,3 @@ +trait A {} + +impl A for () {} diff --git a/gcc/testsuite/rust/compile/issue-2324-1.rs b/gcc/testsuite/rust/compile/issue-2324-1.rs new file mode 100644 index 0000000..afce1f3 --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-2324-1.rs @@ -0,0 +1,19 @@ +enum State { + Succeeded, + Failed(u32), +} + +fn print_on_failure(state: &State) { + match *state { + State::Succeeded => (), + State::Failed => (), // { dg-error "expected unit struct, unit variant or constant, found tuple variant" } + _ => () + } +} + +fn main() { + let b = State::Failed(1); + + print_on_failure(&b); + +} diff --git a/gcc/testsuite/rust/compile/issue-2324-2.rs b/gcc/testsuite/rust/compile/issue-2324-2.rs new file mode 100644 index 0000000..1530b00 --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-2324-2.rs @@ -0,0 +1,19 @@ +enum State { + Succeeded, + Failed { x: u32 }, +} + +fn print_on_failure(state: &State) { + match *state { + State::Succeeded => (), + State::Failed => (), // { dg-error "expected unit struct, unit variant or constant, found struct variant" } + _ => () + } +} + +fn main() { + let b = State::Failed{x: 1}; + + print_on_failure(&b); + +} diff --git a/gcc/testsuite/rust/compile/issue-2499.rs b/gcc/testsuite/rust/compile/issue-2499.rs new file mode 100644 index 0000000..662d58f --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-2499.rs @@ -0,0 +1,11 @@ +#[lang = "sized"] +pub trait Sized {} + +struct Foo; +struct Bar; + +impl Foo for Bar {} +// { dg-error "Expected a trait found .Foo. .E0404." "" { target *-*-* } .-1 } + +fn baz<T: Foo>(t: T) {} +// { dg-error "Expected a trait found .Foo. .E0404." "" { target *-*-* } .-1 } diff --git a/gcc/testsuite/rust/compile/issue-2951.rs b/gcc/testsuite/rust/compile/issue-2951.rs new file mode 100644 index 0000000..d30a3bf --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-2951.rs @@ -0,0 +1,13 @@ +#[lang = "sized"] +pub trait Sized {} + +#[lang = "clone"] +pub trait Clone: Sized { + fn clone(&self) -> Self; +} + +impl Clone for ! { + fn clone(&self) -> Self { + *self + } +} diff --git a/gcc/testsuite/rust/compile/issue-3030.rs b/gcc/testsuite/rust/compile/issue-3030.rs new file mode 100644 index 0000000..0a1866d --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-3030.rs @@ -0,0 +1,16 @@ +#![feature(negative_impls)] + +#[lang = "sized"] +pub trait Sized {} + +pub trait Deref {} + +pub trait DerefMut: Deref { + type Target; + + /// Mutably dereferences the value. + #[stable(feature = "rust1", since = "1.0.0")] + fn deref_mut(&mut self) -> &mut Self::Target; +} + +impl<T: ?Sized> !DerefMut for &T {} diff --git a/gcc/testsuite/rust/compile/issue-3035.rs b/gcc/testsuite/rust/compile/issue-3035.rs new file mode 100644 index 0000000..3266d84 --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-3035.rs @@ -0,0 +1,25 @@ +#[lang = "sized"] +trait Sized {} + +// ---- gccrs additions + +#[lang = "clone"] +pub trait Clone: Sized { + #[stable(feature = "rust1", since = "1.0.0")] + #[must_use = "cloning is often expensive and is not expected to have side effects"] + fn clone(&self) -> Self; + + #[inline] + #[stable(feature = "rust1", since = "1.0.0")] + fn clone_from(&mut self, source: &Self) { + *self = source.clone() + } +} + +#[unstable(feature = "never_type", issue = "35121")] +impl Clone for ! { + #[inline] + fn clone(&self) -> Self { + *self + } +} diff --git a/gcc/testsuite/rust/compile/issue-3036.rs b/gcc/testsuite/rust/compile/issue-3036.rs new file mode 100644 index 0000000..4418ccc --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-3036.rs @@ -0,0 +1,14 @@ +#[lang = "sized"] +trait Sized {} + +#[stable(feature = "rust1", since = "1.0.0")] +pub trait Default: Sized { + #[stable(feature = "rust1", since = "1.0.0")] + fn default() -> Self; +} + +impl Default for () { + fn default() -> () { + () + } +} diff --git a/gcc/testsuite/rust/compile/issue-3045-1.rs b/gcc/testsuite/rust/compile/issue-3045-1.rs new file mode 100644 index 0000000..a1328f2 --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-3045-1.rs @@ -0,0 +1,21 @@ +#![feature(dropck_eyepatch)] +#[allow(dead_code)] + +#[lang = "sized"] +trait Sized {} + +struct Test<T> { + _inner: T, +} + +struct Test2<T> { + _inner: T, +} + +trait Action {} + +impl<#[may_dangle] T> Action for Test<T> {} // { dg-error "use of 'may_dangle' is unsafe and requires unsafe impl" "" { target *-*-* } 0 } + +unsafe impl<#[may_dangle] T> Action for Test2<T> {} + +fn main() {} diff --git a/gcc/testsuite/rust/compile/issue-3045-2.rs b/gcc/testsuite/rust/compile/issue-3045-2.rs new file mode 100644 index 0000000..177707fb --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-3045-2.rs @@ -0,0 +1,20 @@ +#![feature(dropck_eyepatch)] +#[allow(dead_code)] + +#[lang = "sized"] +trait Sized {} + + +trait Action {} + +struct Inspector<'a>(&'a u8); +struct Inspector2<'a>(&'a u8); + +impl<#[may_dangle] 'a> Action for Inspector<'a> {} // { dg-error "use of 'may_dangle' is unsafe and requires unsafe impl" "" { target *-*-* } 0 } + +unsafe impl<#[may_dangle] 'a> Action for Inspector2<'a> {} + + +fn main() { + +} diff --git a/gcc/testsuite/rust/compile/issue-3082.rs b/gcc/testsuite/rust/compile/issue-3082.rs new file mode 100644 index 0000000..4b87395 --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-3082.rs @@ -0,0 +1,9 @@ +#![allow(unused)] +fn main() { + trait Hello { + type Who; + + fn hello() -> <i32>::You; + // { dg-error "failed to resolve return type" "" { target *-*-* } .-1 } + } +} diff --git a/gcc/testsuite/rust/compile/issue-3139-1.rs b/gcc/testsuite/rust/compile/issue-3139-1.rs new file mode 100644 index 0000000..84ca3dd --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-3139-1.rs @@ -0,0 +1,45 @@ +#![feature(lang_items)] + +#[lang = "clone"] +trait Clone { + fn clone(&self) -> Self; +} + +#[lang = "sized"] +trait Sized {} + +struct Abound { + a: u32, + // { dg-warning "field is never read" "" { target *-*-* } .-1 } + b: u32, + // { dg-warning "field is never read" "" { target *-*-* } .-1 } +} + +#[derive(Clone)] +struct Be<T:Clone> { + a: T, + b: Abound, +} + +impl Clone for u32 { + fn clone(&self) -> Self { + *self + } +} + +impl Clone for usize { + fn clone(&self) -> Self { + *self + } +} + +impl Clone for Abound { + fn clone(&self) -> Self { + return Abound { a: self.a.clone(), b: self.b.clone() }; + } +} + +fn main() { + let b: Be<usize> = Be {a:1,b:Abound { a:0,b:1 }}; + let _: Be<usize> = b.clone(); +} diff --git a/gcc/testsuite/rust/compile/issue-3139-2.rs b/gcc/testsuite/rust/compile/issue-3139-2.rs new file mode 100644 index 0000000..0d298fa --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-3139-2.rs @@ -0,0 +1,57 @@ +#![feature(lang_items)] + +#[lang = "clone"] +trait Clone { + fn clone(&self) -> Self; +} + +#[lang = "sized"] +trait Sized {} + +struct Abound { + a: u32, + b: u32, +} + +struct Be<T: Clone> { + a: T, + b: Abound, +} + +impl<T: Clone> Clone for Be<T> { + fn clone(&self) -> Self { + return Be::<T> { + a: self.a.clone(), + b: self.b.clone(), + }; + } +} + +impl Clone for u32 { + fn clone(&self) -> Self { + *self + } +} + +impl Clone for usize { + fn clone(&self) -> Self { + *self + } +} + +impl Clone for Abound { + fn clone(&self) -> Self { + return Abound { + a: self.a.clone(), + b: self.b.clone(), + }; + } +} + +fn main() { + let b: Be<usize> = Be { + a: 1, + b: Abound { a: 0, b: 1 }, + }; + let _: Be<usize> = b.clone(); +} diff --git a/gcc/testsuite/rust/compile/issue-3139-3.rs b/gcc/testsuite/rust/compile/issue-3139-3.rs new file mode 100644 index 0000000..4a4546e --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-3139-3.rs @@ -0,0 +1,32 @@ +#![feature(lang_items)] + +#[lang = "copy"] +trait Copy {} + +#[lang = "sized"] +trait Sized {} + +#[derive(Copy)] +struct Abound { + a: u32, + // { dg-warning "field is never read" "" { target *-*-* } .-1 } + b: u32, + // { dg-warning "field is never read" "" { target *-*-* } .-1 } +} + +#[derive(Copy)] +struct Be<T: Copy> { + a: T, + // { dg-warning "field is never read" "" { target *-*-* } .-1 } + b: Abound, + // { dg-warning "field is never read" "" { target *-*-* } .-1 } +} + +impl Copy for usize {} + +fn main() { + let _: Be<usize> = Be { + a: 1, + b: Abound { a: 0, b: 1 }, + }; +} diff --git a/gcc/testsuite/rust/compile/issue-3141.rs b/gcc/testsuite/rust/compile/issue-3141.rs new file mode 100644 index 0000000..3e9bb12 --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-3141.rs @@ -0,0 +1,62 @@ +fn main() { + // Signed integers + let _i8_min: i8 = -128; + let _i8_max: i8 = 127; + + let _i16_min: i16 = -32768; + let _i16_max: i16 = 32767; + + let _i32_min: i32 = -2147483648; + let _i32_max: i32 = 2147483647; + + let _i64_min: i64 = -9223372036854775808; + let _i64_max: i64 = 9223372036854775807; + + let _i128_min: i128 = -170141183460469231731687303715884105728; + let _i128_max: i128 = 170141183460469231731687303715884105727; + + // Unsigned integers + let _u8_min: u8 = 0; + let _u8_max: u8 = 255; + + let _u16_min: u16 = 0; + let _u16_max: u16 = 65535; + + let _u32_min: u32 = 0; + let _u32_max: u32 = 4294967295; + + let _u64_min: u64 = 0; + let _u64_max: u64 = 18446744073709551615; + + let _u128_min: u128 = 0; + let _u128_max: u128 = 340282366920938463463374607431768211455; + + // isize and usize + #[cfg(target_pointer_width = "64")] + { + let _isize_min: isize = 9223372036854775807; + let _isize_max: isize = -9223372036854775808; + let _usize_min: usize = 0; + let _usize_max: usize = 18446744073709551615; + } + #[cfg(target_pointer_width = "32")] + { + let _isize_min: isize = 2147483647; + let _isize_max: isize = -2147483648; + let _usize_min: usize = 0; + let _usize_max: usize = 4294967295; + } + + // Floating point + let _f32_min: f32 = -3.40282347E+38f32; + let _f32_max: f32 = 3.40282347E+38f32; + + let _f64_min: f64 = 1.7976931348623157E+308f64; + let _f64_max: f64 = -1.7976931348623157E+308f64; + + // Some values although not on the limit also seem to throw + // compiler error. + let _f32_random_fail_1: f32 = 1.40282347E+30f32; + let _f32_random_fail_2: f32 = 1.40282347E+10f32; + let _f32_random_pass: f32 = 1.40282347E+9f32; // this passes +} diff --git a/gcc/testsuite/rust/compile/macros/builtin/builtin_macro.exp b/gcc/testsuite/rust/compile/macros/builtin/builtin_macro.exp new file mode 100644 index 0000000..ac891db --- /dev/null +++ b/gcc/testsuite/rust/compile/macros/builtin/builtin_macro.exp @@ -0,0 +1,35 @@ +# Copyright (C) 2021-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 support procs. +load_lib rust-dg.exp + +# Initialize `dg'. +dg-init + +# Main loop. +set saved-dg-do-what-default ${dg-do-what-default} + +set dg-do-what-default "compile" +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.rs]] "" "" +set dg-do-what-default ${saved-dg-do-what-default} + +# All done. +dg-finish diff --git a/gcc/testsuite/rust/compile/builtin_macro_compile_error.rs b/gcc/testsuite/rust/compile/macros/builtin/compile_error.rs index b08f67f..b08f67f 100644 --- a/gcc/testsuite/rust/compile/builtin_macro_compile_error.rs +++ b/gcc/testsuite/rust/compile/macros/builtin/compile_error.rs diff --git a/gcc/testsuite/rust/compile/builtin_macro_concat.rs b/gcc/testsuite/rust/compile/macros/builtin/concat.rs index 28c8424..28c8424 100644 --- a/gcc/testsuite/rust/compile/builtin_macro_concat.rs +++ b/gcc/testsuite/rust/compile/macros/builtin/concat.rs diff --git a/gcc/testsuite/rust/compile/builtin_macro_eager1.rs b/gcc/testsuite/rust/compile/macros/builtin/eager1.rs index 65a80fd..65a80fd 100644 --- a/gcc/testsuite/rust/compile/builtin_macro_eager1.rs +++ b/gcc/testsuite/rust/compile/macros/builtin/eager1.rs diff --git a/gcc/testsuite/rust/compile/builtin_macro_eager2.rs b/gcc/testsuite/rust/compile/macros/builtin/eager2.rs index 70a92d5..70a92d5 100644 --- a/gcc/testsuite/rust/compile/builtin_macro_eager2.rs +++ b/gcc/testsuite/rust/compile/macros/builtin/eager2.rs diff --git a/gcc/testsuite/rust/compile/builtin_macro_eager3.rs b/gcc/testsuite/rust/compile/macros/builtin/eager3.rs index 3b62cfe..3b62cfe 100644 --- a/gcc/testsuite/rust/compile/builtin_macro_eager3.rs +++ b/gcc/testsuite/rust/compile/macros/builtin/eager3.rs diff --git a/gcc/testsuite/rust/compile/builtin_macro_env.rs b/gcc/testsuite/rust/compile/macros/builtin/env.rs index 83d3c2d..83d3c2d 100644 --- a/gcc/testsuite/rust/compile/builtin_macro_env.rs +++ b/gcc/testsuite/rust/compile/macros/builtin/env.rs diff --git a/gcc/testsuite/rust/compile/macros/builtin/include1.rs b/gcc/testsuite/rust/compile/macros/builtin/include1.rs new file mode 100644 index 0000000..3ad64b7 --- /dev/null +++ b/gcc/testsuite/rust/compile/macros/builtin/include1.rs @@ -0,0 +1,14 @@ +#![feature(rustc_attrs)] + +#[rustc_builtin_macro] +macro_rules! include { + () => {}; +} + +include!("include_rs"); + +fn main() -> i32 { + b(); + + 0 +} diff --git a/gcc/testsuite/rust/compile/macros/builtin/include2.rs b/gcc/testsuite/rust/compile/macros/builtin/include2.rs new file mode 100644 index 0000000..d2344ac --- /dev/null +++ b/gcc/testsuite/rust/compile/macros/builtin/include2.rs @@ -0,0 +1,11 @@ +#![feature(rustc_attrs)] + +#[rustc_builtin_macro] +macro_rules! include { + () => {}; +} + +fn main() -> i32 { + let _ = include!("include_rs2"); + 0 +} diff --git a/gcc/testsuite/rust/compile/macros/builtin/include3.rs b/gcc/testsuite/rust/compile/macros/builtin/include3.rs new file mode 100644 index 0000000..62c0e52 --- /dev/null +++ b/gcc/testsuite/rust/compile/macros/builtin/include3.rs @@ -0,0 +1,19 @@ +#![feature(rustc_attrs)] + +#[rustc_builtin_macro] +macro_rules! include { + () => {}; +} + +macro_rules! my_file { + () => {"include_rs"}; +} + + +include!(my_file!()); + +fn main() -> i32 { + b(); + + 0 +} diff --git a/gcc/testsuite/rust/compile/macros/builtin/include4.rs b/gcc/testsuite/rust/compile/macros/builtin/include4.rs new file mode 100644 index 0000000..c2450fc --- /dev/null +++ b/gcc/testsuite/rust/compile/macros/builtin/include4.rs @@ -0,0 +1,15 @@ +#![feature(rustc_attrs)] + +#[rustc_builtin_macro] +macro_rules! include { + () => {}; +} + +macro_rules! my_file { + () => {"include_rs2"}; +} +fn main() -> i32 { + let _ = include!(my_file!()); + + 0 +} diff --git a/gcc/testsuite/rust/compile/macros/builtin/include_bytes.rs b/gcc/testsuite/rust/compile/macros/builtin/include_bytes.rs new file mode 100644 index 0000000..3ea2813 --- /dev/null +++ b/gcc/testsuite/rust/compile/macros/builtin/include_bytes.rs @@ -0,0 +1,23 @@ +#![feature(rustc_attrs)] + +#[rustc_builtin_macro] +macro_rules! include_bytes { + () => {{}}; +} + +macro_rules! file1 { + () => {"file"}; +} + +static MY_FILE: &[u32;16] = include_bytes!(file!()); + +fn main() { + let file = "include.txt"; + include_bytes!(file); // { dg-error "argument must be a string literal" "" } + include_bytes!(); // { dg-error "macro takes 1 argument" "" } + include_bytes!("foo.txt", "bar.txt"); // { dg-error "macro takes 1 argument" "" } + include_bytes!("include_bytes.rs"); // ok + include_bytes!("include_bytes.rs",); // trailing comma ok + include_bytes! (file1!()); + include_bytes! (file1!(),); // trailing comma ok +} diff --git a/gcc/testsuite/rust/compile/builtin_macro_include_bytes_location_info.rs b/gcc/testsuite/rust/compile/macros/builtin/include_bytes_location_info.rs index 98bf53b..98bf53b 100644 --- a/gcc/testsuite/rust/compile/builtin_macro_include_bytes_location_info.rs +++ b/gcc/testsuite/rust/compile/macros/builtin/include_bytes_location_info.rs diff --git a/gcc/testsuite/rust/compile/macros/builtin/include_rs b/gcc/testsuite/rust/compile/macros/builtin/include_rs new file mode 100644 index 0000000..77c3e26 --- /dev/null +++ b/gcc/testsuite/rust/compile/macros/builtin/include_rs @@ -0,0 +1 @@ +fn b() {} diff --git a/gcc/testsuite/rust/compile/macros/builtin/include_rs2 b/gcc/testsuite/rust/compile/macros/builtin/include_rs2 new file mode 100644 index 0000000..31b272a --- /dev/null +++ b/gcc/testsuite/rust/compile/macros/builtin/include_rs2 @@ -0,0 +1 @@ +"Gccrs is GREAT!" diff --git a/gcc/testsuite/rust/compile/macros/builtin/include_str.rs b/gcc/testsuite/rust/compile/macros/builtin/include_str.rs new file mode 100644 index 0000000..eda04ac --- /dev/null +++ b/gcc/testsuite/rust/compile/macros/builtin/include_str.rs @@ -0,0 +1,24 @@ +#![feature(rustc_attrs)] + +#[rustc_builtin_macro] +macro_rules! include_str { + () => {{}}; +} + +macro_rules! my_file { + () => {"include.txt"} +} + +static G_STR:[u8;16] = include_str!(my_file!()); + +fn main() { + let file = "include.txt"; + include_str!(file); // { dg-error "argument must be a string literal" "" } + include_str!(); // { dg-error "macro takes 1 argument" "" } + include_str!("foo.txt", "bar.txt"); // { dg-error "macro takes 1 argument" "" } + include_str!("include_str.rs"); // ok + include_str!("include_str.rs",); // trailing comma ok + include_str!("invalid_utf8"); // { dg-error "invalid_utf8 was not a valid utf-8 file" "" } + include_str!(my_file!()); + include_str!(my_file!(),); +} diff --git a/gcc/testsuite/rust/compile/builtin_macro_include_str_location_info.rs b/gcc/testsuite/rust/compile/macros/builtin/include_str_location_info.rs index a946033..a946033 100644 --- a/gcc/testsuite/rust/compile/builtin_macro_include_str_location_info.rs +++ b/gcc/testsuite/rust/compile/macros/builtin/include_str_location_info.rs diff --git a/gcc/testsuite/rust/compile/invalid_utf8 b/gcc/testsuite/rust/compile/macros/builtin/invalid_utf8 index 29e181e..29e181e 100644 --- a/gcc/testsuite/rust/compile/invalid_utf8 +++ b/gcc/testsuite/rust/compile/macros/builtin/invalid_utf8 diff --git a/gcc/testsuite/rust/compile/builtin_macro_not_found.rs b/gcc/testsuite/rust/compile/macros/builtin/not_found.rs index 5ba7fc0..5ba7fc0 100644 --- a/gcc/testsuite/rust/compile/builtin_macro_not_found.rs +++ b/gcc/testsuite/rust/compile/macros/builtin/not_found.rs diff --git a/gcc/testsuite/rust/compile/builtin_macro_recurse2.rs b/gcc/testsuite/rust/compile/macros/builtin/recurse2.rs index 2e73ab5..2e73ab5 100644 --- a/gcc/testsuite/rust/compile/builtin_macro_recurse2.rs +++ b/gcc/testsuite/rust/compile/macros/builtin/recurse2.rs diff --git a/gcc/testsuite/rust/compile/macro-delim.rs b/gcc/testsuite/rust/compile/macros/mbe/macro-delim.rs index de4cd56..de4cd56 100644 --- a/gcc/testsuite/rust/compile/macro-delim.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro-delim.rs diff --git a/gcc/testsuite/rust/compile/macro-issue1053-2.rs b/gcc/testsuite/rust/compile/macros/mbe/macro-issue1053-2.rs index 3145990..3145990 100644 --- a/gcc/testsuite/rust/compile/macro-issue1053-2.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro-issue1053-2.rs diff --git a/gcc/testsuite/rust/compile/macro-issue1053.rs b/gcc/testsuite/rust/compile/macros/mbe/macro-issue1053.rs index 1e96849..1e96849 100644 --- a/gcc/testsuite/rust/compile/macro-issue1053.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro-issue1053.rs diff --git a/gcc/testsuite/rust/compile/macro-issue1224.rs b/gcc/testsuite/rust/compile/macros/mbe/macro-issue1224.rs index 003bbcd..003bbcd 100644 --- a/gcc/testsuite/rust/compile/macro-issue1224.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro-issue1224.rs diff --git a/gcc/testsuite/rust/compile/macro-issue1233.rs b/gcc/testsuite/rust/compile/macros/mbe/macro-issue1233.rs index 7fab787..7fab787 100644 --- a/gcc/testsuite/rust/compile/macro-issue1233.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro-issue1233.rs diff --git a/gcc/testsuite/rust/compile/macro-issue1395-2.rs b/gcc/testsuite/rust/compile/macros/mbe/macro-issue1395-2.rs index 1df6a3a..1df6a3a 100644 --- a/gcc/testsuite/rust/compile/macro-issue1395-2.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro-issue1395-2.rs diff --git a/gcc/testsuite/rust/compile/macro-issue1395.rs b/gcc/testsuite/rust/compile/macros/mbe/macro-issue1395.rs index b0368c1..b0368c1 100644 --- a/gcc/testsuite/rust/compile/macro-issue1395.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro-issue1395.rs diff --git a/gcc/testsuite/rust/compile/macro-issue1400-2.rs b/gcc/testsuite/rust/compile/macros/mbe/macro-issue1400-2.rs index ba7b61b..ba7b61b 100644 --- a/gcc/testsuite/rust/compile/macro-issue1400-2.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro-issue1400-2.rs diff --git a/gcc/testsuite/rust/compile/macro-issue1400.rs b/gcc/testsuite/rust/compile/macros/mbe/macro-issue1400.rs index 5c51b78..5c51b78 100644 --- a/gcc/testsuite/rust/compile/macro-issue1400.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro-issue1400.rs diff --git a/gcc/testsuite/rust/compile/macro-issue2092.rs b/gcc/testsuite/rust/compile/macros/mbe/macro-issue2092.rs index ec20743..ec20743 100644 --- a/gcc/testsuite/rust/compile/macro-issue2092.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro-issue2092.rs diff --git a/gcc/testsuite/rust/compile/macro-issue2192.rs b/gcc/testsuite/rust/compile/macros/mbe/macro-issue2192.rs index deb2dd7..deb2dd7 100644 --- a/gcc/testsuite/rust/compile/macro-issue2192.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro-issue2192.rs diff --git a/gcc/testsuite/rust/compile/macro-issue2194.rs b/gcc/testsuite/rust/compile/macros/mbe/macro-issue2194.rs index c94b114..c94b114 100644 --- a/gcc/testsuite/rust/compile/macro-issue2194.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro-issue2194.rs diff --git a/gcc/testsuite/rust/compile/macro-issue2229.rs b/gcc/testsuite/rust/compile/macros/mbe/macro-issue2229.rs index c148ff5..c148ff5 100644 --- a/gcc/testsuite/rust/compile/macro-issue2229.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro-issue2229.rs diff --git a/gcc/testsuite/rust/compile/macro-issue2264.rs b/gcc/testsuite/rust/compile/macros/mbe/macro-issue2264.rs index 497dd3c..497dd3c 100644 --- a/gcc/testsuite/rust/compile/macro-issue2264.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro-issue2264.rs diff --git a/gcc/testsuite/rust/compile/macro-issue2268.rs b/gcc/testsuite/rust/compile/macros/mbe/macro-issue2268.rs index 4bd9c10..4bd9c10 100644 --- a/gcc/testsuite/rust/compile/macro-issue2268.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro-issue2268.rs diff --git a/gcc/testsuite/rust/compile/macro-issue2273.rs b/gcc/testsuite/rust/compile/macros/mbe/macro-issue2273.rs index ee3dd1f..ee3dd1f 100644 --- a/gcc/testsuite/rust/compile/macro-issue2273.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro-issue2273.rs diff --git a/gcc/testsuite/rust/compile/macro-issue2653.rs b/gcc/testsuite/rust/compile/macros/mbe/macro-issue2653.rs index dc2972f..dc2972f 100644 --- a/gcc/testsuite/rust/compile/macro-issue2653.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro-issue2653.rs diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro-issue2983_2984.rs b/gcc/testsuite/rust/compile/macros/mbe/macro-issue2983_2984.rs new file mode 100644 index 0000000..637d572 --- /dev/null +++ b/gcc/testsuite/rust/compile/macros/mbe/macro-issue2983_2984.rs @@ -0,0 +1,27 @@ +pub struct ReadDir { + pub inner: i32, + #[cfg(not(A))] + pub end_of_stream: bool, + #[cfg(A)] + pub end_of_stream_but_different: bool, +} + +fn main() { + // Success + let _ = ReadDir { + inner: 14, + #[cfg(not(A))] + end_of_stream: false, + #[cfg(A)] + end_of_stream_but_different: false, + }; + + // Error + let _ = ReadDir { + inner: 14, + end_of_stream: false, + end_of_stream_but_different: false, // { dg-error "failed to resolve type for field" } + // { dg-error "unknown field" "" { target *-*-* } .-1 } + // { dg-prune-output "compilation terminated" } + }; +} diff --git a/gcc/testsuite/rust/compile/macro1.rs b/gcc/testsuite/rust/compile/macros/mbe/macro1.rs index 8cd9418..8cd9418 100644 --- a/gcc/testsuite/rust/compile/macro1.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro1.rs diff --git a/gcc/testsuite/rust/compile/macro10.rs b/gcc/testsuite/rust/compile/macros/mbe/macro10.rs index 3f1453e..3f1453e 100644 --- a/gcc/testsuite/rust/compile/macro10.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro10.rs diff --git a/gcc/testsuite/rust/compile/macro11.rs b/gcc/testsuite/rust/compile/macros/mbe/macro11.rs index 97b89a1..97b89a1 100644 --- a/gcc/testsuite/rust/compile/macro11.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro11.rs diff --git a/gcc/testsuite/rust/compile/macro12.rs b/gcc/testsuite/rust/compile/macros/mbe/macro12.rs index b75fbad..b75fbad 100644 --- a/gcc/testsuite/rust/compile/macro12.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro12.rs diff --git a/gcc/testsuite/rust/compile/macro13.rs b/gcc/testsuite/rust/compile/macros/mbe/macro13.rs index eb8dfbb..eb8dfbb 100644 --- a/gcc/testsuite/rust/compile/macro13.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro13.rs diff --git a/gcc/testsuite/rust/compile/macro14.rs b/gcc/testsuite/rust/compile/macros/mbe/macro14.rs index b18c56e..b18c56e 100644 --- a/gcc/testsuite/rust/compile/macro14.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro14.rs diff --git a/gcc/testsuite/rust/compile/macro15.rs b/gcc/testsuite/rust/compile/macros/mbe/macro15.rs index 02c739e..02c739e 100644 --- a/gcc/testsuite/rust/compile/macro15.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro15.rs diff --git a/gcc/testsuite/rust/compile/macro16.rs b/gcc/testsuite/rust/compile/macros/mbe/macro16.rs index e5e56ed..e5e56ed 100644 --- a/gcc/testsuite/rust/compile/macro16.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro16.rs diff --git a/gcc/testsuite/rust/compile/macro17.rs b/gcc/testsuite/rust/compile/macros/mbe/macro17.rs index b50afbe..b50afbe 100644 --- a/gcc/testsuite/rust/compile/macro17.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro17.rs diff --git a/gcc/testsuite/rust/compile/macro18.rs b/gcc/testsuite/rust/compile/macros/mbe/macro18.rs index 5418725..5418725 100644 --- a/gcc/testsuite/rust/compile/macro18.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro18.rs diff --git a/gcc/testsuite/rust/compile/macro19.rs b/gcc/testsuite/rust/compile/macros/mbe/macro19.rs index 1bf9a2b..1bf9a2b 100644 --- a/gcc/testsuite/rust/compile/macro19.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro19.rs diff --git a/gcc/testsuite/rust/compile/macro2.rs b/gcc/testsuite/rust/compile/macros/mbe/macro2.rs index a437655..a437655 100644 --- a/gcc/testsuite/rust/compile/macro2.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro2.rs diff --git a/gcc/testsuite/rust/compile/macro20.rs b/gcc/testsuite/rust/compile/macros/mbe/macro20.rs index e03455b..e03455b 100644 --- a/gcc/testsuite/rust/compile/macro20.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro20.rs diff --git a/gcc/testsuite/rust/compile/macro21.rs b/gcc/testsuite/rust/compile/macros/mbe/macro21.rs index 9a1d773..9a1d773 100644 --- a/gcc/testsuite/rust/compile/macro21.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro21.rs diff --git a/gcc/testsuite/rust/compile/macro22.rs b/gcc/testsuite/rust/compile/macros/mbe/macro22.rs index bdc4bad..bdc4bad 100644 --- a/gcc/testsuite/rust/compile/macro22.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro22.rs diff --git a/gcc/testsuite/rust/compile/macro23.rs b/gcc/testsuite/rust/compile/macros/mbe/macro23.rs index a6a2afd..a6a2afd 100644 --- a/gcc/testsuite/rust/compile/macro23.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro23.rs diff --git a/gcc/testsuite/rust/compile/macro25.rs b/gcc/testsuite/rust/compile/macros/mbe/macro25.rs index d92534c..d92534c 100644 --- a/gcc/testsuite/rust/compile/macro25.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro25.rs diff --git a/gcc/testsuite/rust/compile/macro26.rs b/gcc/testsuite/rust/compile/macros/mbe/macro26.rs index f6588e7..f6588e7 100644 --- a/gcc/testsuite/rust/compile/macro26.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro26.rs diff --git a/gcc/testsuite/rust/compile/macro27.rs b/gcc/testsuite/rust/compile/macros/mbe/macro27.rs index ee7833b..ee7833b 100644 --- a/gcc/testsuite/rust/compile/macro27.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro27.rs diff --git a/gcc/testsuite/rust/compile/macro28.rs b/gcc/testsuite/rust/compile/macros/mbe/macro28.rs index 8002f28..8002f28 100644 --- a/gcc/testsuite/rust/compile/macro28.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro28.rs diff --git a/gcc/testsuite/rust/compile/macro29.rs b/gcc/testsuite/rust/compile/macros/mbe/macro29.rs index 39f5021..39f5021 100644 --- a/gcc/testsuite/rust/compile/macro29.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro29.rs diff --git a/gcc/testsuite/rust/compile/macro3.rs b/gcc/testsuite/rust/compile/macros/mbe/macro3.rs index e5d3e93..e5d3e93 100644 --- a/gcc/testsuite/rust/compile/macro3.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro3.rs diff --git a/gcc/testsuite/rust/compile/macro30.rs b/gcc/testsuite/rust/compile/macros/mbe/macro30.rs index 35064bc0..35064bc0 100644 --- a/gcc/testsuite/rust/compile/macro30.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro30.rs diff --git a/gcc/testsuite/rust/compile/macro31.rs b/gcc/testsuite/rust/compile/macros/mbe/macro31.rs index 6674a5f..6674a5f 100644 --- a/gcc/testsuite/rust/compile/macro31.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro31.rs diff --git a/gcc/testsuite/rust/compile/macro32.rs b/gcc/testsuite/rust/compile/macros/mbe/macro32.rs index d1d6305..d1d6305 100644 --- a/gcc/testsuite/rust/compile/macro32.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro32.rs diff --git a/gcc/testsuite/rust/compile/macro33.rs b/gcc/testsuite/rust/compile/macros/mbe/macro33.rs index 2ccd33e..2ccd33e 100644 --- a/gcc/testsuite/rust/compile/macro33.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro33.rs diff --git a/gcc/testsuite/rust/compile/macro34.rs b/gcc/testsuite/rust/compile/macros/mbe/macro34.rs index 105d042..105d042 100644 --- a/gcc/testsuite/rust/compile/macro34.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro34.rs diff --git a/gcc/testsuite/rust/compile/macro35.rs b/gcc/testsuite/rust/compile/macros/mbe/macro35.rs index 07b157b..07b157b 100644 --- a/gcc/testsuite/rust/compile/macro35.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro35.rs diff --git a/gcc/testsuite/rust/compile/macro36.rs b/gcc/testsuite/rust/compile/macros/mbe/macro36.rs index e5d66b2..e5d66b2 100644 --- a/gcc/testsuite/rust/compile/macro36.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro36.rs diff --git a/gcc/testsuite/rust/compile/macro37.rs b/gcc/testsuite/rust/compile/macros/mbe/macro37.rs index 5713d90..5713d90 100644 --- a/gcc/testsuite/rust/compile/macro37.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro37.rs diff --git a/gcc/testsuite/rust/compile/macro38.rs b/gcc/testsuite/rust/compile/macros/mbe/macro38.rs index eb294ae..eb294ae 100644 --- a/gcc/testsuite/rust/compile/macro38.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro38.rs diff --git a/gcc/testsuite/rust/compile/macro39.rs b/gcc/testsuite/rust/compile/macros/mbe/macro39.rs index f5c498c..f5c498c 100644 --- a/gcc/testsuite/rust/compile/macro39.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro39.rs diff --git a/gcc/testsuite/rust/compile/macro4.rs b/gcc/testsuite/rust/compile/macros/mbe/macro4.rs index 47ff6c9..47ff6c9 100644 --- a/gcc/testsuite/rust/compile/macro4.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro4.rs diff --git a/gcc/testsuite/rust/compile/macro40.rs b/gcc/testsuite/rust/compile/macros/mbe/macro40.rs index f9d048e..f9d048e 100644 --- a/gcc/testsuite/rust/compile/macro40.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro40.rs diff --git a/gcc/testsuite/rust/compile/macro41.rs b/gcc/testsuite/rust/compile/macros/mbe/macro41.rs index 3824422..3824422 100644 --- a/gcc/testsuite/rust/compile/macro41.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro41.rs diff --git a/gcc/testsuite/rust/compile/macro42.rs b/gcc/testsuite/rust/compile/macros/mbe/macro42.rs index b3fbf6d..b3fbf6d 100644 --- a/gcc/testsuite/rust/compile/macro42.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro42.rs diff --git a/gcc/testsuite/rust/compile/macro43.rs b/gcc/testsuite/rust/compile/macros/mbe/macro43.rs index 992bc77..992bc77 100644 --- a/gcc/testsuite/rust/compile/macro43.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro43.rs diff --git a/gcc/testsuite/rust/compile/macro44.rs b/gcc/testsuite/rust/compile/macros/mbe/macro44.rs index dabac6f..dabac6f 100644 --- a/gcc/testsuite/rust/compile/macro44.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro44.rs diff --git a/gcc/testsuite/rust/compile/macro45.rs b/gcc/testsuite/rust/compile/macros/mbe/macro45.rs index 52dbcbb..52dbcbb 100644 --- a/gcc/testsuite/rust/compile/macro45.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro45.rs diff --git a/gcc/testsuite/rust/compile/macro46.rs b/gcc/testsuite/rust/compile/macros/mbe/macro46.rs index 3ef811a..3ef811a 100644 --- a/gcc/testsuite/rust/compile/macro46.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro46.rs diff --git a/gcc/testsuite/rust/compile/macro47.rs b/gcc/testsuite/rust/compile/macros/mbe/macro47.rs index 36545af..36545af 100644 --- a/gcc/testsuite/rust/compile/macro47.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro47.rs diff --git a/gcc/testsuite/rust/compile/macro48.rs b/gcc/testsuite/rust/compile/macros/mbe/macro48.rs index 6b3b369..6b3b369 100644 --- a/gcc/testsuite/rust/compile/macro48.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro48.rs diff --git a/gcc/testsuite/rust/compile/macro49.rs b/gcc/testsuite/rust/compile/macros/mbe/macro49.rs index 0900f7c..0900f7c 100644 --- a/gcc/testsuite/rust/compile/macro49.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro49.rs diff --git a/gcc/testsuite/rust/compile/macro5.rs b/gcc/testsuite/rust/compile/macros/mbe/macro5.rs index a5d8095..a5d8095 100644 --- a/gcc/testsuite/rust/compile/macro5.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro5.rs diff --git a/gcc/testsuite/rust/compile/macro50.rs b/gcc/testsuite/rust/compile/macros/mbe/macro50.rs index e85afa7..e85afa7 100644 --- a/gcc/testsuite/rust/compile/macro50.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro50.rs diff --git a/gcc/testsuite/rust/compile/macro51.rs b/gcc/testsuite/rust/compile/macros/mbe/macro51.rs index 6659486..6659486 100644 --- a/gcc/testsuite/rust/compile/macro51.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro51.rs diff --git a/gcc/testsuite/rust/compile/macro52.rs b/gcc/testsuite/rust/compile/macros/mbe/macro52.rs index 31002eb..31002eb 100644 --- a/gcc/testsuite/rust/compile/macro52.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro52.rs diff --git a/gcc/testsuite/rust/compile/macro53.rs b/gcc/testsuite/rust/compile/macros/mbe/macro53.rs index efa2d4b..efa2d4b 100644 --- a/gcc/testsuite/rust/compile/macro53.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro53.rs diff --git a/gcc/testsuite/rust/compile/macro54.rs b/gcc/testsuite/rust/compile/macros/mbe/macro54.rs index d3b3f80..d3b3f80 100644 --- a/gcc/testsuite/rust/compile/macro54.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro54.rs diff --git a/gcc/testsuite/rust/compile/macro55.rs b/gcc/testsuite/rust/compile/macros/mbe/macro55.rs index 808718c..808718c 100644 --- a/gcc/testsuite/rust/compile/macro55.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro55.rs diff --git a/gcc/testsuite/rust/compile/macro56.rs b/gcc/testsuite/rust/compile/macros/mbe/macro56.rs index bf42a64..bf42a64 100644 --- a/gcc/testsuite/rust/compile/macro56.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro56.rs diff --git a/gcc/testsuite/rust/compile/macro57.rs b/gcc/testsuite/rust/compile/macros/mbe/macro57.rs index 0640d2f..0640d2f 100644 --- a/gcc/testsuite/rust/compile/macro57.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro57.rs diff --git a/gcc/testsuite/rust/compile/macro6.rs b/gcc/testsuite/rust/compile/macros/mbe/macro6.rs index 9c54a67..9c54a67 100644 --- a/gcc/testsuite/rust/compile/macro6.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro6.rs diff --git a/gcc/testsuite/rust/compile/macro7.rs b/gcc/testsuite/rust/compile/macros/mbe/macro7.rs index 563acdd..563acdd 100644 --- a/gcc/testsuite/rust/compile/macro7.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro7.rs diff --git a/gcc/testsuite/rust/compile/macro8.rs b/gcc/testsuite/rust/compile/macros/mbe/macro8.rs index d3e8af9..d3e8af9 100644 --- a/gcc/testsuite/rust/compile/macro8.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro8.rs diff --git a/gcc/testsuite/rust/compile/macro9.rs b/gcc/testsuite/rust/compile/macros/mbe/macro9.rs index 9a59089..9a59089 100644 --- a/gcc/testsuite/rust/compile/macro9.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro9.rs diff --git a/gcc/testsuite/rust/compile/macro_call_statement.rs b/gcc/testsuite/rust/compile/macros/mbe/macro_call_statement.rs index 3d18cc9..3d18cc9 100644 --- a/gcc/testsuite/rust/compile/macro_call_statement.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro_call_statement.rs diff --git a/gcc/testsuite/rust/compile/macro_export_1.rs b/gcc/testsuite/rust/compile/macros/mbe/macro_export_1.rs index f87df08..f87df08 100644 --- a/gcc/testsuite/rust/compile/macro_export_1.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro_export_1.rs diff --git a/gcc/testsuite/rust/compile/macro_return.rs b/gcc/testsuite/rust/compile/macros/mbe/macro_return.rs index 8b06f87..8b06f87 100644 --- a/gcc/testsuite/rust/compile/macro_return.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro_return.rs diff --git a/gcc/testsuite/rust/compile/macro_rules_macro_rules.rs b/gcc/testsuite/rust/compile/macros/mbe/macro_rules_macro_rules.rs index ecd1712..ecd1712 100644 --- a/gcc/testsuite/rust/compile/macro_rules_macro_rules.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro_rules_macro_rules.rs diff --git a/gcc/testsuite/rust/compile/macro_use1.rs b/gcc/testsuite/rust/compile/macros/mbe/macro_use1.rs index e98eadf..e98eadf 100644 --- a/gcc/testsuite/rust/compile/macro_use1.rs +++ b/gcc/testsuite/rust/compile/macros/mbe/macro_use1.rs diff --git a/gcc/testsuite/rust/compile/macros/mbe/mbe_macro.exp b/gcc/testsuite/rust/compile/macros/mbe/mbe_macro.exp new file mode 100644 index 0000000..ac891db --- /dev/null +++ b/gcc/testsuite/rust/compile/macros/mbe/mbe_macro.exp @@ -0,0 +1,35 @@ +# Copyright (C) 2021-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 support procs. +load_lib rust-dg.exp + +# Initialize `dg'. +dg-init + +# Main loop. +set saved-dg-do-what-default ${dg-do-what-default} + +set dg-do-what-default "compile" +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.rs]] "" "" +set dg-do-what-default ${saved-dg-do-what-default} + +# All done. +dg-finish diff --git a/gcc/testsuite/rust/compile/proc_macro_attribute_crate_type.rs b/gcc/testsuite/rust/compile/macros/proc/attribute_crate_type.rs index c13128e..c13128e 100644 --- a/gcc/testsuite/rust/compile/proc_macro_attribute_crate_type.rs +++ b/gcc/testsuite/rust/compile/macros/proc/attribute_crate_type.rs diff --git a/gcc/testsuite/rust/compile/proc_macro_attribute_non_function.rs b/gcc/testsuite/rust/compile/macros/proc/attribute_non_function.rs index 0e88bbe..0e88bbe 100644 --- a/gcc/testsuite/rust/compile/proc_macro_attribute_non_function.rs +++ b/gcc/testsuite/rust/compile/macros/proc/attribute_non_function.rs diff --git a/gcc/testsuite/rust/compile/proc_macro_attribute_non_root_function.rs b/gcc/testsuite/rust/compile/macros/proc/attribute_non_root_function.rs index 709119c..709119c 100644 --- a/gcc/testsuite/rust/compile/proc_macro_attribute_non_root_function.rs +++ b/gcc/testsuite/rust/compile/macros/proc/attribute_non_root_function.rs diff --git a/gcc/testsuite/rust/compile/proc_macro_attribute_non_root_method.rs b/gcc/testsuite/rust/compile/macros/proc/attribute_non_root_method.rs index 30f3196..30f3196 100644 --- a/gcc/testsuite/rust/compile/proc_macro_attribute_non_root_method.rs +++ b/gcc/testsuite/rust/compile/macros/proc/attribute_non_root_method.rs diff --git a/gcc/testsuite/rust/compile/proc_macro_attribute_non_root_module.rs b/gcc/testsuite/rust/compile/macros/proc/attribute_non_root_module.rs index 60165be..60165be 100644 --- a/gcc/testsuite/rust/compile/proc_macro_attribute_non_root_module.rs +++ b/gcc/testsuite/rust/compile/macros/proc/attribute_non_root_module.rs diff --git a/gcc/testsuite/rust/compile/proc_macro_attribute_private.rs b/gcc/testsuite/rust/compile/macros/proc/attribute_private.rs index 00b5ac6..00b5ac6 100644 --- a/gcc/testsuite/rust/compile/proc_macro_attribute_private.rs +++ b/gcc/testsuite/rust/compile/macros/proc/attribute_private.rs diff --git a/gcc/testsuite/rust/compile/proc_macro_crate_type.rs b/gcc/testsuite/rust/compile/macros/proc/crate_type.rs index 880026d..880026d 100644 --- a/gcc/testsuite/rust/compile/proc_macro_crate_type.rs +++ b/gcc/testsuite/rust/compile/macros/proc/crate_type.rs diff --git a/gcc/testsuite/rust/compile/proc_macro_derive_crate_type.rs b/gcc/testsuite/rust/compile/macros/proc/derive_crate_type.rs index 7d4234b..7d4234b 100644 --- a/gcc/testsuite/rust/compile/proc_macro_derive_crate_type.rs +++ b/gcc/testsuite/rust/compile/macros/proc/derive_crate_type.rs diff --git a/gcc/testsuite/rust/compile/proc_macro_derive_malformed.rs b/gcc/testsuite/rust/compile/macros/proc/derive_malformed.rs index d83256b..d83256b 100644 --- a/gcc/testsuite/rust/compile/proc_macro_derive_malformed.rs +++ b/gcc/testsuite/rust/compile/macros/proc/derive_malformed.rs diff --git a/gcc/testsuite/rust/compile/proc_macro_derive_non_function.rs b/gcc/testsuite/rust/compile/macros/proc/derive_non_function.rs index 7cb4c0b..7cb4c0b 100644 --- a/gcc/testsuite/rust/compile/proc_macro_derive_non_function.rs +++ b/gcc/testsuite/rust/compile/macros/proc/derive_non_function.rs diff --git a/gcc/testsuite/rust/compile/proc_macro_derive_non_root_function.rs b/gcc/testsuite/rust/compile/macros/proc/derive_non_root_function.rs index 69d5ca1..69d5ca1 100644 --- a/gcc/testsuite/rust/compile/proc_macro_derive_non_root_function.rs +++ b/gcc/testsuite/rust/compile/macros/proc/derive_non_root_function.rs diff --git a/gcc/testsuite/rust/compile/proc_macro_derive_non_root_module.rs b/gcc/testsuite/rust/compile/macros/proc/derive_non_root_module.rs index 45d7a47..45d7a47 100644 --- a/gcc/testsuite/rust/compile/proc_macro_derive_non_root_module.rs +++ b/gcc/testsuite/rust/compile/macros/proc/derive_non_root_module.rs diff --git a/gcc/testsuite/rust/compile/proc_macro_derive_private.rs b/gcc/testsuite/rust/compile/macros/proc/derive_private.rs index 69922be..69922be 100644 --- a/gcc/testsuite/rust/compile/proc_macro_derive_private.rs +++ b/gcc/testsuite/rust/compile/macros/proc/derive_private.rs diff --git a/gcc/testsuite/rust/compile/proc_macro_non_function.rs b/gcc/testsuite/rust/compile/macros/proc/non_function.rs index ff2083c..ff2083c 100644 --- a/gcc/testsuite/rust/compile/proc_macro_non_function.rs +++ b/gcc/testsuite/rust/compile/macros/proc/non_function.rs diff --git a/gcc/testsuite/rust/compile/proc_macro_non_root_function.rs b/gcc/testsuite/rust/compile/macros/proc/non_root_function.rs index 9309940..9309940 100644 --- a/gcc/testsuite/rust/compile/proc_macro_non_root_function.rs +++ b/gcc/testsuite/rust/compile/macros/proc/non_root_function.rs diff --git a/gcc/testsuite/rust/compile/proc_macro_non_root_method.rs b/gcc/testsuite/rust/compile/macros/proc/non_root_method.rs index ee52c324..ee52c324 100644 --- a/gcc/testsuite/rust/compile/proc_macro_non_root_method.rs +++ b/gcc/testsuite/rust/compile/macros/proc/non_root_method.rs diff --git a/gcc/testsuite/rust/compile/proc_macro_non_root_module.rs b/gcc/testsuite/rust/compile/macros/proc/non_root_module.rs index 1028612..1028612 100644 --- a/gcc/testsuite/rust/compile/proc_macro_non_root_module.rs +++ b/gcc/testsuite/rust/compile/macros/proc/non_root_module.rs diff --git a/gcc/testsuite/rust/compile/proc_macro_derive_non_root_method.rs b/gcc/testsuite/rust/compile/macros/proc/non_root_trait_method.rs index 523b37a..523b37a 100644 --- a/gcc/testsuite/rust/compile/proc_macro_derive_non_root_method.rs +++ b/gcc/testsuite/rust/compile/macros/proc/non_root_trait_method.rs diff --git a/gcc/testsuite/rust/compile/proc_macro_private.rs b/gcc/testsuite/rust/compile/macros/proc/private.rs index 17e85f4..17e85f4 100644 --- a/gcc/testsuite/rust/compile/proc_macro_private.rs +++ b/gcc/testsuite/rust/compile/macros/proc/private.rs diff --git a/gcc/testsuite/rust/compile/macros/proc/proc_macro.exp b/gcc/testsuite/rust/compile/macros/proc/proc_macro.exp new file mode 100644 index 0000000..ac891db --- /dev/null +++ b/gcc/testsuite/rust/compile/macros/proc/proc_macro.exp @@ -0,0 +1,35 @@ +# Copyright (C) 2021-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 support procs. +load_lib rust-dg.exp + +# Initialize `dg'. +dg-init + +# Main loop. +set saved-dg-do-what-default ${dg-do-what-default} + +set dg-do-what-default "compile" +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.rs]] "" "" +set dg-do-what-default ${saved-dg-do-what-default} + +# All done. +dg-finish diff --git a/gcc/testsuite/rust/compile/proc_macro_pub_function.rs b/gcc/testsuite/rust/compile/macros/proc/pub_function.rs index 52f5d38..52f5d38 100644 --- a/gcc/testsuite/rust/compile/proc_macro_pub_function.rs +++ b/gcc/testsuite/rust/compile/macros/proc/pub_function.rs diff --git a/gcc/testsuite/rust/compile/proc_macro_pub_module.rs b/gcc/testsuite/rust/compile/macros/proc/pub_module.rs index a8bc0e8..a8bc0e8 100644 --- a/gcc/testsuite/rust/compile/proc_macro_pub_module.rs +++ b/gcc/testsuite/rust/compile/macros/proc/pub_module.rs diff --git a/gcc/testsuite/rust/compile/match8.rs b/gcc/testsuite/rust/compile/match8.rs new file mode 100644 index 0000000..336b313 --- /dev/null +++ b/gcc/testsuite/rust/compile/match8.rs @@ -0,0 +1,19 @@ +union MyUnion { + f1: u32, + f2: f32, +} + +fn f(u: MyUnion) -> i32 { + unsafe { + match u { + MyUnion { f1: 10 } => 0, + MyUnion { f2 } => 0, + MyUnion { f1: 10, f2: 10.0 } => 0, // { dg-error "union patterns should have exactly one field" "" } + MyUnion {} => 0, // { dg-error "union patterns should have exactly one field" "" } + MyUnion { f1: () } => 0, // { dg-error "expected u32, found tuple" "" } + _ => 1, + } + } +} + +fn main() {} diff --git a/gcc/testsuite/rust/compile/match9.rs b/gcc/testsuite/rust/compile/match9.rs new file mode 100644 index 0000000..115d458 --- /dev/null +++ b/gcc/testsuite/rust/compile/match9.rs @@ -0,0 +1,30 @@ +enum E { + A(), + B, +} + +const CONST_E: E = E::A(); + +static static_e: E = E::A(); + +type type_alias = E; + +fn f(e: E) { + match e { + E::A => {} + // { dg-error "expected unit struct, unit variant or constant, found tuple variant .E::A." "" { target *-*-* } .-1 } + E::B => {} + crate::CONST_E => {} + crate::type_alias => {} + // { dg-error "expected unit struct, unit variant or constant, found type alias .crate::type_alias." "" { target *-*-* } .-1 } + crate::E => {} + // { dg-error "expected unit struct, unit variant or constant, found enum .crate::E." "" { target *-*-* } .-1 } + crate::static_e => {} + // { dg-error "expected unit struct, unit variant or constant, found static .crate::static_e." "" { target *-*-* } .-1 } + crate::f => {} + // { dg-error "expected unit struct, unit variant or constant, found function .crate::f." "" { target *-*-* } .-1 } + _ => {} + } +} + +fn main() {} diff --git a/gcc/testsuite/rust/compile/nonexistent-field.rs b/gcc/testsuite/rust/compile/nonexistent-field.rs new file mode 100644 index 0000000..e20c49d --- /dev/null +++ b/gcc/testsuite/rust/compile/nonexistent-field.rs @@ -0,0 +1,14 @@ +#![allow(unused)] +fn main() { + struct StructWithFields { + x: u32, + } + + let s = StructWithFields { x: 0 }; + s.foo; + // { dg-error "no field .foo. on type .StructWithFields.StructWithFields .x.u32... .E0609." "" { target *-*-* } .-1 } + + let numbers = (1, 2, 3); + numbers.3; + // { dg-error "no field .3. on type ..<integer>, <integer>, <integer>.. .E0609." "" { target *-*-* } .-1 } +} diff --git a/gcc/testsuite/rust/compile/nr2/compile.exp b/gcc/testsuite/rust/compile/nr2/compile.exp new file mode 100644 index 0000000..0afe36c --- /dev/null +++ b/gcc/testsuite/rust/compile/nr2/compile.exp @@ -0,0 +1,136 @@ +# Copyright (C) 2021-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, for name resolution 2.0 +# +# These tests raise errors in the front end; torture testing doesn't apply. + +# Load support procs. +load_lib rust-dg.exp + +# Initialize `dg'. +dg-init + +namespace eval rust-nr2-ns { + # Exclude tests which aren't passing yet + # These should be removed from the exclude file over time + + set exclude_fh [open $srcdir/$subdir/exclude r] + set exclude_raw [lsort [split [read $exclude_fh] "\n"]] + close $exclude_fh + unset exclude_fh + + set exclude "" + foreach ent $exclude_raw { + if [regexp {^[^#].*} $ent] { + lappend exclude $ent + } + } + unset exclude_raw + + # Run tests in directories + # Manually specifying these, in case some other test file + # does something weird + set test_dirs {. compile macros/builtin macros/mbe macros/proc} + + set tests_expect_ok "" + set tests_expect_err "" + + foreach test_dir $test_dirs { + foreach test [lsort [glob -nocomplain -tails -directory $srcdir/$subdir/../$test_dir *.rs]] { + if {$test_dir == "."} { + set test_lbl $test + } else { + set test_lbl "$test_dir/$test" + } + set idx [lsearch -exact -sorted $exclude $test_lbl] + if {$idx == -1} { + lappend tests_expect_ok $srcdir/$subdir/../$test_dir/$test + } else { + lappend tests_expect_err $srcdir/$subdir/../$test_dir/$test + set exclude [lreplace $exclude $idx $idx] + } + } + } + + # Generate failures for unmatched tests in the exclude list + foreach ent $exclude { + fail "$ent: could not exclude test" + } + unset exclude + + # run a test while catching record_test calls + set record_test_out "" + proc try_test { test } { + variable record_test_out + rename ::record_test record_test_old + + proc ::record_test { type msg args } { + namespace eval ::rust-nr2-ns { + set type [uplevel 1 {set type}] + set msg [uplevel 1 {set msg}] + variable record_test_out + switch $type { + FAIL { + lappend record_test_out "$type: $msg" + } + XPASS { + lappend record_test_out "$type: $msg" + } + } + } + } + + namespace eval :: { + set saved-dg-do-what-default ${dg-do-what-default} + set dg-do-what-default "compile" + dg-runtest [list [uplevel 1 {set test}]] "-frust-name-resolution-2.0" "" + set dg-do-what-default ${saved-dg-do-what-default} + } + + rename ::record_test "" + rename record_test_old ::record_test + + set record_test_cache $record_test_out + set record_test_out "" + return $record_test_cache + } + + # check for unexpected failures + foreach test $tests_expect_ok { + set fails [try_test $test] + if {[llength $fails] != 0} { + foreach ent $fails { + record_test FAIL "$test: nr2 failure: $ent" + } + } else { + record_test PASS "$test: nr2 success" + } + } + + #check for unexpected successes + foreach test $tests_expect_err { + set fails [try_test $test] + if {[llength $fails] == 0} { + record_test XPASS "$test: nr2 unexpectedly passed" + } else { + record_test XFAIL "$test: nr2 was rightfully excluded" + } + } +} + +# All done. +dg-finish diff --git a/gcc/testsuite/rust/compile/nr2/exclude b/gcc/testsuite/rust/compile/nr2/exclude new file mode 100644 index 0000000..ecef6d2 --- /dev/null +++ b/gcc/testsuite/rust/compile/nr2/exclude @@ -0,0 +1,237 @@ +# relies on exact source file path match +# TODO: patch this file or nr2/compile.exp to handle this +debug-diagnostics-on.rs + +# main list +attr-mismatch-crate-name.rs +attr_deprecated.rs +attr_deprecated_2.rs +auto_trait_super_trait.rs +auto_trait_valid.rs +auto_trait_invalid.rs +bad=file-name.rs +bounds1.rs +break-rust2.rs +break-rust3.rs +macros/builtin/eager1.rs +macros/builtin/eager2.rs +macros/builtin/recurse2.rs +macros/builtin/include3.rs +macros/builtin/include4.rs +canonical_paths1.rs +cfg1.rs +cfg3.rs +cfg4.rs +cfg5.rs +closure_no_type_anno.rs +complex-path1.rs +complex_qualified_path_in_expr.rs +const-issue1440.rs +const_generics_3.rs +const_generics_4.rs +const_generics_5.rs +const_generics_7.rs +derive_empty.rs +derive_macro1.rs +derive_macro3.rs +derive_macro4.rs +derive_macro6.rs +expected_type_args2.rs +expected_type_args3.rs +feature_rust_attri0.rs +feature_rust_attri1.rs +for_lifetimes.rs +format_args_basic_expansion.rs +generic-default1.rs +generics1.rs +generics10.rs +generics11.rs +generics2.rs +generics3.rs +generics4.rs +generics5.rs +generics6.rs +generics7.rs +generics8.rs +generics9.rs +if_let_expr.rs +infer-crate-name.rs +issue-1019.rs +issue-1031.rs +issue-1034.rs +issue-1128.rs +issue-1129-2.rs +issue-1130.rs +issue-1165.rs +issue-1173.rs +issue-1235.rs +issue-1237.rs +issue-1272.rs +issue-1289.rs +issue-1447.rs +issue-1483.rs +issue-1589.rs +issue-1725-1.rs +issue-1725-2.rs +issue-1786.rs +issue-1813.rs +issue-1893.rs +issue-1901.rs +issue-1930.rs +issue-1981.rs +issue-2019-1.rs +issue-2019-2.rs +issue-2019-3.rs +issue-2036.rs +issue-2037.rs +issue-2043.rs +issue-2070.rs +issue-2105.rs +issue-2106.rs +issue-2135.rs +issue-2136-1.rs +issue-2136-2.rs +issue-2139.rs +issue-2142.rs +issue-2165.rs +issue-2166.rs +issue-2190-1.rs +issue-2190-2.rs +issue-2195.rs +issue-2238.rs +issue-2304.rs +issue-2330.rs +issue-2375.rs +issue-2478.rs +issue-2479.rs +issue-2514.rs +issue-2723-1.rs +issue-2723-2.rs +issue-2772-1.rs +issue-2772-2.rs +issue-2775.rs +issue-2747.rs +issue-2782.rs +issue-2812.rs +issue-850.rs +issue-852.rs +issue-855.rs +issue-925.rs +iterators1.rs +lookup_err1.rs +macros/mbe/macro-issue1233.rs +macros/mbe/macro-issue1400.rs +macros/mbe/macro13.rs +macros/mbe/macro15.rs +macros/mbe/macro20.rs +macros/mbe/macro23.rs +macros/mbe/macro40.rs +macros/mbe/macro43.rs +macros/mbe/macro44.rs +macros/mbe/macro50.rs +macros/mbe/macro54.rs +macros/mbe/macro6.rs +macros/mbe/macro_rules_macro_rules.rs +macros/mbe/macro_use1.rs +match-never-ltype.rs +match-never-rtype.rs +match1.rs +match2.rs +match3.rs +match4.rs +match5.rs +match9.rs +method2.rs +multi_reference_type.rs +multiple_bindings1.rs +multiple_bindings2.rs +name_resolution2.rs +name_resolution4.rs +nested_generic.rs +nested_macro_use1.rs +nested_macro_use2.rs +nested_macro_use3.rs +non_member_const.rs +not_find_value_in_scope.rs +parse_associated_type_as_generic_arg.rs +parse_associated_type_as_generic_arg2.rs +parse_associated_type_as_generic_arg3.rs +parse_complex_generic_application.rs +parse_complex_generic_application2.rs +path_as_generic_arg.rs +pattern-struct.rs +privacy1.rs +privacy3.rs +privacy4.rs +privacy5.rs +privacy6.rs +privacy8.rs +macros/proc/attribute_non_function.rs +macros/proc/derive_non_function.rs +macros/proc/non_function.rs +pub_restricted_1.rs +pub_restricted_2.rs +pub_restricted_3.rs +redef_error2.rs +redef_error4.rs +redef_error5.rs +redef_error6.rs +rustc_attr1.rs +self-path1.rs +self-path2.rs +sizeof-stray-infer-var-bug.rs +specify-crate-name.rs +stmt_with_block_dot.rs +struct-expr-parse.rs +trait-cycle.rs +traits1.rs +traits10.rs +traits11.rs +traits12.rs +traits2.rs +traits3.rs +traits4.rs +traits5.rs +traits6.rs +traits7.rs +traits8.rs +traits9.rs +type-bindings1.rs +unconstrained_type_param.rs +undeclared_label.rs +unsafe1.rs +unsafe11.rs +unsafe2.rs +unsafe3.rs +unsafe6.rs +unsafe7.rs +use_1.rs +use_2.rs +v0-mangle1.rs +v0-mangle2.rs +while_break_expr.rs +negative_impls.rs +auto_trait.rs +exhaustiveness1.rs +exhaustiveness2.rs +exhaustiveness3.rs +trait13.rs +trait14.rs +issue-2324-1.rs +issue-2324-2.rs +issue-2725.rs +issue-2987.rs +issue-3045-1.rs +issue-3045-2.rs +issue-3046.rs +unknown-associated-item.rs +issue-3030.rs +issue-3035.rs +issue-3082.rs +issue-3139-1.rs +issue-3139-2.rs +issue-3139-3.rs +issue-3036.rs +issue-2951.rs +issue-2203.rs +issue-2499.rs
\ No newline at end of file diff --git a/gcc/testsuite/rust/compile/prelude_import.rs b/gcc/testsuite/rust/compile/prelude_import.rs new file mode 100644 index 0000000..569fb62 --- /dev/null +++ b/gcc/testsuite/rust/compile/prelude_import.rs @@ -0,0 +1,12 @@ +#![feature(prelude_import)] + +mod core { + mod prelude { + mod v1 { + // hehe + } + } +} + +#[prelude_import] +use core::prelude::v1::*; 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 a5f0c2b..8275691 100644 --- a/gcc/testsuite/rust/compile/sizeof-stray-infer-var-bug.rs +++ b/gcc/testsuite/rust/compile/sizeof-stray-infer-var-bug.rs @@ -1,3 +1,5 @@ +#![feature(intrinsics)] + #[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 deb19bd..b9bd83c 100644 --- a/gcc/testsuite/rust/compile/torture/intrinsics-8.rs +++ b/gcc/testsuite/rust/compile/torture/intrinsics-8.rs @@ -1,3 +1,5 @@ +#![feature(intrinsics)] + #[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 6d34fb1..7b98779 100644 --- a/gcc/testsuite/rust/compile/torture/transmute-size-check-1.rs +++ b/gcc/testsuite/rust/compile/torture/transmute-size-check-1.rs @@ -1,3 +1,5 @@ +#![feature(intrinsics)] + #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/torture/transmute1.rs b/gcc/testsuite/rust/compile/torture/transmute1.rs index b2a0d07..be9fb1d 100644 --- a/gcc/testsuite/rust/compile/torture/transmute1.rs +++ b/gcc/testsuite/rust/compile/torture/transmute1.rs @@ -1,3 +1,5 @@ +#![feature(intrinsics)] + #[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 cbb92fe..fa329c6 100644 --- a/gcc/testsuite/rust/compile/torture/uninit-intrinsic-1.rs +++ b/gcc/testsuite/rust/compile/torture/uninit-intrinsic-1.rs @@ -1,3 +1,5 @@ +#![feature(intrinsics)] + #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/compile/trait13.rs b/gcc/testsuite/rust/compile/trait13.rs new file mode 100644 index 0000000..af5f5a6 --- /dev/null +++ b/gcc/testsuite/rust/compile/trait13.rs @@ -0,0 +1,47 @@ +// Testing multiple supertraits and calling supertrait methods + +struct Foo { + my_int: u32, +} + +trait GrandParent { + fn grandparent(&self) -> u32; +} + +trait Parent : GrandParent { + fn parent(&self) -> bool; +} + +trait Child : Parent { + fn child(&self); +} + +impl GrandParent for Foo { + fn grandparent(&self) -> u32 { + self.my_int + } +} + +impl Parent for Foo { + fn parent(&self) -> bool { + // Call supertrait method + return self.grandparent() != 0; + } +} + +impl Child for Foo { + fn child(&self) { + let _ = self; + } +} + +pub fn main() { + let a = Foo{my_int: 0xfeedf00d}; + let b: &dyn Child = &a; + + b.parent(); + b.child(); + + // Here to silence bogus compiler warning + let _ = a.my_int; +} diff --git a/gcc/testsuite/rust/compile/trait14.rs b/gcc/testsuite/rust/compile/trait14.rs new file mode 100644 index 0000000..c1d42b5 --- /dev/null +++ b/gcc/testsuite/rust/compile/trait14.rs @@ -0,0 +1,51 @@ +// Testing diamond problem with supertraits + + +struct Foo { + my_int: u32, +} + +trait GrandParent { + fn grandparent(&self); +} + +trait Parent1 : GrandParent { + fn parent1(&self); +} + +trait Parent2 : GrandParent { + fn parent2(&self); +} + +trait Child : Parent1+Parent2 { + fn child(&self); +} + +impl GrandParent for Foo { + fn grandparent(&self) { let _ = self; } +} + +impl Parent1 for Foo { + fn parent1(&self) { let _ = self; } +} + +impl Parent2 for Foo { + fn parent2(&self) { let _ = self; } +} + +impl Child for Foo { + fn child(&self) { + let _ = self; + } +} + +pub fn main() { + let a = Foo{my_int: 0xf00dfeed}; + let b: &dyn Child = &a; + + b.parent1(); + b.child(); + + // Suppress bogus compile warning + let _ = a.my_int; +} diff --git a/gcc/testsuite/rust/compile/v0-mangle1.rs b/gcc/testsuite/rust/compile/v0-mangle1.rs index a34f1a7..04c546e 100644 --- a/gcc/testsuite/rust/compile/v0-mangle1.rs +++ b/gcc/testsuite/rust/compile/v0-mangle1.rs @@ -36,7 +36,7 @@ fn main() { // cf. rustc 1.72.0: _RNvNtCshIBIgX6Bzox_10v0_mangle18module_a3bar module_a::bar(); - // { dg-final { scan-assembler "_R.*NvNtNtC10v0_mangle18module_a8module_b3baz" } } + // { dg-final { scan-assembler "_R.*NvNtNtC.*10v0_mangle18module_a8module_b3baz" } } // cf. rustc 1.72.0: _RNvNtNtCshIBIgX6Bzox_10v0_mangle18module_a8module_b3baz module_a::module_b::baz(); diff --git a/gcc/testsuite/rust/compile/name_resolution21.rs b/gcc/testsuite/rust/compile/xfail/name_resolution21.rs index 3d0af2b..df48d00 100644 --- a/gcc/testsuite/rust/compile/name_resolution21.rs +++ b/gcc/testsuite/rust/compile/xfail/name_resolution21.rs @@ -5,7 +5,8 @@ pub mod foo { } use foo::bar; -use foo::bar; // { dg-error ".bar. defined multiple times" } +use foo::bar; +// { dg-error ".bar. defined multiple times" "" { xfail *-*-* } .-1 } fn main() { bar!(); diff --git a/gcc/testsuite/rust/execute/torture/builtin_macro_include_bytes.rs b/gcc/testsuite/rust/execute/torture/builtin_macro_include_bytes.rs index 19a1faf..6aec417 100644 --- a/gcc/testsuite/rust/execute/torture/builtin_macro_include_bytes.rs +++ b/gcc/testsuite/rust/execute/torture/builtin_macro_include_bytes.rs @@ -1,4 +1,5 @@ -// { dg-output "104\r*\n33\r*\n1\r*\n" } +// { dg-output "1\r*\n1\r*\n1\r*\n" } + #![feature(rustc_attrs)] #[rustc_builtin_macro] @@ -6,6 +7,10 @@ macro_rules! include_bytes { () => {{}}; } +macro_rules! my_file { + () => {"include.txt"}; +} + extern "C" { fn printf(s: *const i8, ...); } @@ -17,32 +22,30 @@ fn print_int(value: i32) { } } -fn main() -> i32 { - let bytes = include_bytes!("include.txt"); - - print_int(bytes[0] as i32); - print_int(bytes[14] as i32); - +fn check_bytes(bytes: &[u8; 16]) { let the_bytes = b"hello, include!\n"; - let x = bytes[0] == the_bytes[0] - && bytes[1] == the_bytes[1] - && bytes[2] == the_bytes[2] - && bytes[3] == the_bytes[3] - && bytes[4] == the_bytes[4] - && bytes[5] == the_bytes[5] - && bytes[6] == the_bytes[6] - && bytes[7] == the_bytes[7] - && bytes[8] == the_bytes[8] - && bytes[9] == the_bytes[9] - && bytes[10] == the_bytes[10] - && bytes[11] == the_bytes[11] - && bytes[12] == the_bytes[12] - && bytes[13] == the_bytes[13] - && bytes[14] == the_bytes[14] - && bytes[15] == the_bytes[15]; + let x = true; + let mut i = 0; + + // X is true iff bytes == the_bytes + while i < 16 { + x = x && (bytes[i] == the_bytes[i]); + i += 1; + } print_int(x as i32); +} + +fn main() -> i32 { + let bytes1: &'static [u8; 16] = include_bytes!("include.txt"); + check_bytes(bytes1); + + let bytes2: &'static [u8; 16] = include_bytes!(my_file!()); + check_bytes(bytes2); + + let bytes3 = include_bytes!(my_file!(),); + check_bytes(bytes3); 0 } diff --git a/gcc/testsuite/rust/execute/torture/builtin_macro_include_str.rs b/gcc/testsuite/rust/execute/torture/builtin_macro_include_str.rs index a65639d..b5454db 100644 --- a/gcc/testsuite/rust/execute/torture/builtin_macro_include_str.rs +++ b/gcc/testsuite/rust/execute/torture/builtin_macro_include_str.rs @@ -1,4 +1,4 @@ -// { dg-output "hello, include!\r*\n" } +// { dg-output "hello, include!\r*\nhello, include!\r*\nhello, include!\r*\n" } #![feature(rustc_attrs)] #[rustc_builtin_macro] @@ -6,6 +6,10 @@ macro_rules! include_str { () => {{}}; } +macro_rules! my_file { + () => {"include.txt"}; +} + extern "C" { fn printf(fmt: *const i8, ...); } @@ -22,7 +26,10 @@ fn print(s: &str) { fn main() -> i32 { // include_str! (and include_bytes!) allow for an optional trailing comma. let my_str = include_str!("include.txt",); - + print(my_str); + let my_str = include_str!(my_file!()); + print(my_str); + let my_str = include_str!(my_file!(),); print(my_str); 0 diff --git a/gcc/testsuite/rust/execute/torture/inline_asm_mov_x_5_ARM.rs b/gcc/testsuite/rust/execute/torture/inline_asm_mov_x_5_ARM.rs new file mode 100644 index 0000000..0c867df --- /dev/null +++ b/gcc/testsuite/rust/execute/torture/inline_asm_mov_x_5_ARM.rs @@ -0,0 +1,36 @@ +/* { dg-do run { target arm*-*-* } } */ +/* { dg-output "5\r*\n9\r*\n" }*/ + +#![feature(rustc_attrs)] +#[rustc_builtin_macro] +macro_rules! asm { + () => {}; +} + +extern "C" { + fn printf(s: *const i8, ...); +} + +fn main() -> i32 { + let mut _x: i32 = 0; + let mut _y: i32 = 9; + + unsafe { + asm!( + "mov {}, 5", + out(reg) _x + ); + printf("%d\n\0" as *const str as *const i8, _x); + }; + + unsafe { + asm!( + "mov {}, {}", + in(reg) _y, + out(reg) _x + ); + printf("%d\n\0" as *const str as *const i8, _x); + } + + 0 +} diff --git a/gcc/testsuite/rust/execute/torture/inline_asm_mov_x_5_x86_64.rs b/gcc/testsuite/rust/execute/torture/inline_asm_mov_x_5_x86_64.rs new file mode 100644 index 0000000..5fbbb68 --- /dev/null +++ b/gcc/testsuite/rust/execute/torture/inline_asm_mov_x_5_x86_64.rs @@ -0,0 +1,35 @@ +/* { dg-do run { target x86_64*-*-* } } */ +/* { dg-output "5\r*\n9\r*\n" }*/ + +#![feature(rustc_attrs)] +#[rustc_builtin_macro] +macro_rules! asm { + () => {}; +} + +extern "C" { + fn printf(s: *const i8, ...); +} + +fn main() -> i32 { + let mut x: i32 = 0; + let mut _y: i32 = 9; // Mark it as _y since it is only used as input operand, not printing + + unsafe { + asm!( + "mov $5, {}", + out(reg) x + ); + printf("%d\n\0" as *const str as *const i8, x); + }; + + unsafe { + asm!( + "mov {}, {}", + in(reg) _y, + out(reg) x, + ); + printf("%d\n\0" as *const str as *const i8, x); + } + 0 +} diff --git a/gcc/testsuite/rust/execute/torture/issue-1436.rs b/gcc/testsuite/rust/execute/torture/issue-1436.rs index 4e69961..5d90907 100644 --- a/gcc/testsuite/rust/execute/torture/issue-1436.rs +++ b/gcc/testsuite/rust/execute/torture/issue-1436.rs @@ -1,4 +1,7 @@ // { dg-options "-w" } + +#![feature(intrinsics)] + #[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 46f501e..4ff12fc 100644 --- a/gcc/testsuite/rust/execute/torture/issue-2583.rs +++ b/gcc/testsuite/rust/execute/torture/issue-2583.rs @@ -1,3 +1,5 @@ +#![feature(intrinsics)] + #[lang = "sized"] pub trait Sized {} diff --git a/gcc/testsuite/rust/execute/torture/trait14.rs b/gcc/testsuite/rust/execute/torture/trait14.rs new file mode 100644 index 0000000..759950e --- /dev/null +++ b/gcc/testsuite/rust/execute/torture/trait14.rs @@ -0,0 +1,47 @@ +/* { dg-output "parent123\r*\nchild\r*\n" } */ + +extern "C" { + fn printf(s: *const i8, ...); +} + +#[lang = "sized"] +pub trait Sized {} + +struct Foo(i32); +trait Parent { + fn parent(&self); +} + +trait Child : Parent { + fn child(&self); +} + +impl Parent for Foo { + fn parent(&self) { + unsafe { + let parent = "parent%i\n\0"; + let msg = parent as *const str; + printf(msg as *const i8,self.0); + } + } +} + +impl Child for Foo { + fn child(&self) { + let _ = self; + unsafe { + let child = "child\n\0"; + let msg = child as *const str; + printf(msg as *const i8); + } + } +} + +pub fn main() -> i32 { + let a = Foo(123); + let b: &dyn Child = &a; + + b.parent(); + b.child(); + 0 +} diff --git a/gcc/testsuite/rust/execute/torture/trait15.rs b/gcc/testsuite/rust/execute/torture/trait15.rs new file mode 100644 index 0000000..53469d7 --- /dev/null +++ b/gcc/testsuite/rust/execute/torture/trait15.rs @@ -0,0 +1,56 @@ +/* { dg-output "parent123\r*\nchild\r*\n" } */ +// Testing generics passing with supertraits + +extern "C" { + fn printf(s: *const i8, ...); +} + +#[lang = "sized"] +pub trait Sized {} + +struct Foo { + my_int: u32, +} + +trait Parent<T> { + fn parent(&self) -> T; +} + +trait Child<T> : Parent<T> { + fn child(&self); +} + +impl Parent<u32> for Foo { + fn parent(&self) -> u32 { + unsafe { + let parent = "parent%i\n\0"; + let msg = parent as *const str; + printf(msg as *const i8,self.my_int); + return self.my_int; + } + } +} + +impl Child<u32> for Foo { + fn child(&self) { + let _ = self; + unsafe { + let child = "child\n\0"; + let msg = child as *const str; + printf(msg as *const i8); + } + } +} + +pub fn main() -> i32 { + let a = Foo{my_int: 123}; + let b: &dyn Child<u32> = &a; + + b.parent(); + b.child(); + + //Silence bogus warning + let _ = a.my_int; + + 0 +} diff --git a/gcc/testsuite/rust/execute/torture/trait16.rs b/gcc/testsuite/rust/execute/torture/trait16.rs new file mode 100644 index 0000000..95f48a1 --- /dev/null +++ b/gcc/testsuite/rust/execute/torture/trait16.rs @@ -0,0 +1,52 @@ +/* { dg-output "parent123\r*\nchild\r*\n" } */ +//Testing lifetimes with supertraits + +extern "C" { + fn printf(s: *const i8, ...); +} + +struct Foo { + my_int: u32, +} + +trait Parent { + fn parent(&self); +} + +trait Child : Parent { + fn child(&self); +} + +impl Parent for Foo { + fn parent(&self) { + unsafe { + let parent = "parent%i\n\0"; + let msg = parent as *const str; + printf(msg as *const i8,self.my_int); + return; + } + } +} + +impl Child for Foo { + fn child<'a>(&self) { + let _ = self; + unsafe { + let child = "child\n\0"; + let msg = child as *const str; + printf(msg as *const i8); + } + } +} + +pub fn main() -> i32 { + let a = Foo{ my_int: 123}; + let b: &dyn Child = &a; + + b.parent(); + b.child(); + + let _ = a.my_int; + + 0 +} diff --git a/gcc/testsuite/rust/execute/torture/trait17.rs b/gcc/testsuite/rust/execute/torture/trait17.rs new file mode 100644 index 0000000..a619ef8 --- /dev/null +++ b/gcc/testsuite/rust/execute/torture/trait17.rs @@ -0,0 +1,54 @@ +/* { dg-output "parent123\r*\nchild\r*\n" } */ + +//Second test for lifetimes in supertraits + +extern "C" { + fn printf(s: *const i8, ...); +} + +struct Foo { + my_int: u32, +} + +trait Parent { + fn parent(&self); +} + +trait Child : Parent { + fn child(&self); +} + +impl Parent for Foo { + fn parent<'b>(&self) { + unsafe { + let parent = "parent%i\n\0"; + let msg = parent as *const str; + printf(msg as *const i8,self.my_int); + return; + } + } +} + +impl Child for Foo { + fn child(&self) { + let _ = self; + unsafe { + let child = "child\n\0"; + let msg = child as *const str; + printf(msg as *const i8); + } + } +} + +pub fn main() -> i32 { + let a = Foo{ my_int: 123}; + let b: &dyn Child = &a; + + b.parent(); + b.child(); + + // Silence bogus warning + let _ = a.my_int; + + 0 +} diff --git a/gcc/testsuite/rust/execute/torture/trait18.rs b/gcc/testsuite/rust/execute/torture/trait18.rs new file mode 100644 index 0000000..46024d8 --- /dev/null +++ b/gcc/testsuite/rust/execute/torture/trait18.rs @@ -0,0 +1,56 @@ +/* { dg-output "parent\r*\nchild\r*\n" } */ +//Testing default implementations with supertraits. + +extern "C" { + fn printf(s: *const i8, ...); +} + +struct Foo { + my_int: u32, +} + +trait Parent { + fn parent_str(&self) -> &'static str; + fn parent(&self) { + unsafe { + let parent: &'static str = self.parent_str(); + let msg = parent as *const str; + printf(msg as *const i8); + } + } +} + +trait Child : Parent { + fn child(&self); +} + +impl Parent for Foo { + fn parent_str(&self) -> &'static str { + let _ = self; + return "parent\n\0"; + } +} + +impl Child for Foo { + fn child(&self) { + let _ = self; + unsafe { + let child = "child\n\0"; + let msg = child as *const str; + printf(msg as *const i8); + } + } +} + +pub fn main() -> i32 { + let a = Foo{ my_int: 0xfeedf00d}; + let b: &dyn Child = &a; + + b.parent(); + b.child(); + + // Bogus warning silencer + let _ = a.my_int; + + 0 +} diff --git a/gcc/testsuite/rust/rustc/README.md b/gcc/testsuite/rust/rustc/README.md new file mode 100644 index 0000000..ddf4d95 --- /dev/null +++ b/gcc/testsuite/rust/rustc/README.md @@ -0,0 +1,4 @@ +This repository contains test cases from the +[rustc test suite](https://github.com/rust-lang/rust/tree/master/tests). The +conversion of these tests into the DejaGnu format is done by the rustc +testsuite adaptor, a tool specifically designed for this purpose. diff --git a/gcc/testsuite/rust/rustc/rustc.exp b/gcc/testsuite/rust/rustc/rustc.exp new file mode 100644 index 0000000..ac891db --- /dev/null +++ b/gcc/testsuite/rust/rustc/rustc.exp @@ -0,0 +1,35 @@ +# Copyright (C) 2021-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 support procs. +load_lib rust-dg.exp + +# Initialize `dg'. +dg-init + +# Main loop. +set saved-dg-do-what-default ${dg-do-what-default} + +set dg-do-what-default "compile" +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.rs]] "" "" +set dg-do-what-default ${saved-dg-do-what-default} + +# All done. +dg-finish |