diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
commit | 218caa410aa38c29984be31a5229b9fa717560ee (patch) | |
tree | c54bd55eeb6e4c508940a30e94c0032fbd45d677 /tests/codegen | |
parent | Releasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | tests/codegen-units/item-collection/asm-sym.rs (renamed from src/test/codegen-units/item-collection/asm-sym.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/item-collection/auxiliary/cgu_export_trait_method.rs (renamed from src/test/codegen-units/item-collection/auxiliary/cgu_export_trait_method.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/item-collection/auxiliary/cgu_extern_closures.rs (renamed from src/test/codegen-units/item-collection/auxiliary/cgu_extern_closures.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/item-collection/auxiliary/cgu_generic_function.rs (renamed from src/test/codegen-units/item-collection/auxiliary/cgu_generic_function.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/item-collection/cross-crate-closures.rs (renamed from src/test/codegen-units/item-collection/cross-crate-closures.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/item-collection/cross-crate-generic-functions.rs (renamed from src/test/codegen-units/item-collection/cross-crate-generic-functions.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/item-collection/cross-crate-trait-method.rs (renamed from src/test/codegen-units/item-collection/cross-crate-trait-method.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/item-collection/drop_in_place_intrinsic.rs (renamed from src/test/codegen-units/item-collection/drop_in_place_intrinsic.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/item-collection/function-as-argument.rs (renamed from src/test/codegen-units/item-collection/function-as-argument.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/item-collection/generic-drop-glue.rs (renamed from src/test/codegen-units/item-collection/generic-drop-glue.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/item-collection/generic-functions.rs (renamed from src/test/codegen-units/item-collection/generic-functions.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/item-collection/generic-impl.rs (renamed from src/test/codegen-units/item-collection/generic-impl.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/item-collection/impl-in-non-instantiated-generic.rs (renamed from src/test/codegen-units/item-collection/impl-in-non-instantiated-generic.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/item-collection/implicit-panic-call.rs (renamed from src/test/codegen-units/item-collection/implicit-panic-call.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/item-collection/instantiation-through-vtable.rs (renamed from src/test/codegen-units/item-collection/instantiation-through-vtable.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/item-collection/items-within-generic-items.rs (renamed from src/test/codegen-units/item-collection/items-within-generic-items.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/item-collection/non-generic-closures.rs (renamed from src/test/codegen-units/item-collection/non-generic-closures.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/item-collection/non-generic-drop-glue.rs (renamed from src/test/codegen-units/item-collection/non-generic-drop-glue.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/item-collection/non-generic-functions.rs (renamed from src/test/codegen-units/item-collection/non-generic-functions.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/item-collection/overloaded-operators.rs (renamed from src/test/codegen-units/item-collection/overloaded-operators.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/item-collection/static-init.rs (renamed from src/test/codegen-units/item-collection/static-init.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/item-collection/statics-and-consts.rs (renamed from src/test/codegen-units/item-collection/statics-and-consts.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/item-collection/trait-implementations.rs (renamed from src/test/codegen-units/item-collection/trait-implementations.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/item-collection/trait-method-as-argument.rs (renamed from src/test/codegen-units/item-collection/trait-method-as-argument.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/item-collection/trait-method-default-impl.rs (renamed from src/test/codegen-units/item-collection/trait-method-default-impl.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/item-collection/transitive-drop-glue.rs (renamed from src/test/codegen-units/item-collection/transitive-drop-glue.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/item-collection/tuple-drop-glue.rs (renamed from src/test/codegen-units/item-collection/tuple-drop-glue.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/item-collection/unreferenced-const-fn.rs (renamed from src/test/codegen-units/item-collection/unreferenced-const-fn.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/item-collection/unreferenced-inline-function.rs (renamed from src/test/codegen-units/item-collection/unreferenced-inline-function.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/item-collection/unsizing.rs (renamed from src/test/codegen-units/item-collection/unsizing.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/item-collection/unused-traits-and-generics.rs (renamed from src/test/codegen-units/item-collection/unused-traits-and-generics.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/partitioning/auxiliary/cgu_explicit_inlining.rs (renamed from src/test/codegen-units/partitioning/auxiliary/cgu_explicit_inlining.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/partitioning/auxiliary/cgu_extern_drop_glue.rs (renamed from src/test/codegen-units/partitioning/auxiliary/cgu_extern_drop_glue.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/partitioning/auxiliary/cgu_generic_function.rs (renamed from src/test/codegen-units/partitioning/auxiliary/cgu_generic_function.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/partitioning/auxiliary/shared_generics_aux.rs (renamed from src/test/codegen-units/partitioning/auxiliary/shared_generics_aux.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/partitioning/extern-drop-glue.rs (renamed from src/test/codegen-units/partitioning/extern-drop-glue.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/partitioning/extern-generic.rs (renamed from src/test/codegen-units/partitioning/extern-generic.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/partitioning/incremental-merging.rs (renamed from src/test/codegen-units/partitioning/incremental-merging.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/partitioning/inlining-from-extern-crate.rs (renamed from src/test/codegen-units/partitioning/inlining-from-extern-crate.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/partitioning/local-drop-glue.rs (renamed from src/test/codegen-units/partitioning/local-drop-glue.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/partitioning/local-generic.rs (renamed from src/test/codegen-units/partitioning/local-generic.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/partitioning/local-inlining-but-not-all.rs (renamed from src/test/codegen-units/partitioning/local-inlining-but-not-all.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/partitioning/local-inlining.rs (renamed from src/test/codegen-units/partitioning/local-inlining.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/partitioning/local-transitive-inlining.rs (renamed from src/test/codegen-units/partitioning/local-transitive-inlining.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/partitioning/methods-are-with-self-type.rs (renamed from src/test/codegen-units/partitioning/methods-are-with-self-type.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/partitioning/regular-modules.rs (renamed from src/test/codegen-units/partitioning/regular-modules.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/partitioning/shared-generics.rs (renamed from src/test/codegen-units/partitioning/shared-generics.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/partitioning/statics.rs (renamed from src/test/codegen-units/partitioning/statics.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/partitioning/vtable-through-const.rs (renamed from src/test/codegen-units/partitioning/vtable-through-const.rs) | 0 | ||||
-rw-r--r-- | tests/codegen-units/polymorphization/unused_type_parameters.rs (renamed from src/test/codegen-units/polymorphization/unused_type_parameters.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/README.md (renamed from src/test/codegen/README.md) | 0 | ||||
-rw-r--r-- | tests/codegen/abi-efiapi.rs (renamed from src/test/codegen/abi-efiapi.rs) | 2 | ||||
-rw-r--r-- | tests/codegen/abi-main-signature-16bit-c-int.rs (renamed from src/test/codegen/abi-main-signature-16bit-c-int.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/abi-main-signature-32bit-c-int.rs (renamed from src/test/codegen/abi-main-signature-32bit-c-int.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/abi-repr-ext.rs (renamed from src/test/codegen/abi-repr-ext.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/abi-sysv64.rs (renamed from src/test/codegen/abi-sysv64.rs) | 2 | ||||
-rw-r--r-- | tests/codegen/abi-x86-interrupt.rs (renamed from src/test/codegen/abi-x86-interrupt.rs) | 2 | ||||
-rw-r--r-- | tests/codegen/abi-x86_64_sysv.rs (renamed from src/test/codegen/abi-x86_64_sysv.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/adjustments.rs (renamed from src/test/codegen/adjustments.rs) | 2 | ||||
-rw-r--r-- | tests/codegen/align-enum.rs (renamed from src/test/codegen/align-enum.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/align-fn.rs (renamed from src/test/codegen/align-fn.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/align-struct.rs (renamed from src/test/codegen/align-struct.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/alloc-optimisation.rs (renamed from src/test/codegen/alloc-optimisation.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/array-clone.rs (renamed from src/test/codegen/array-clone.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/array-equality.rs (renamed from src/test/codegen/array-equality.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/asm-clobber_abi.rs (renamed from src/test/codegen/asm-clobber_abi.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/asm-clobbers.rs (renamed from src/test/codegen/asm-clobbers.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/asm-may_unwind.rs (renamed from src/test/codegen/asm-may_unwind.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/asm-multiple-options.rs (renamed from src/test/codegen/asm-multiple-options.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/asm-options.rs (renamed from src/test/codegen/asm-options.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/asm-powerpc-clobbers.rs (renamed from src/test/codegen/asm-powerpc-clobbers.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/asm-sanitize-llvm.rs (renamed from src/test/codegen/asm-sanitize-llvm.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/asm-target-clobbers.rs (renamed from src/test/codegen/asm-target-clobbers.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/async-fn-debug-awaitee-field.rs (renamed from src/test/codegen/async-fn-debug-awaitee-field.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/async-fn-debug-msvc.rs (renamed from src/test/codegen/async-fn-debug-msvc.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/async-fn-debug.rs (renamed from src/test/codegen/async-fn-debug.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/atomic-operations.rs (renamed from src/test/codegen/atomic-operations.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/autovectorize-f32x4.rs (renamed from src/test/codegen/autovectorize-f32x4.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/auxiliary/extern_decl.rs (renamed from src/test/codegen/auxiliary/extern_decl.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/auxiliary/nounwind.rs (renamed from src/test/codegen/auxiliary/nounwind.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/auxiliary/static_dllimport_aux.rs (renamed from src/test/codegen/auxiliary/static_dllimport_aux.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/auxiliary/thread_local_aux.rs (renamed from src/test/codegen/auxiliary/thread_local_aux.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/avr/avr-func-addrspace.rs | 111 | ||||
-rw-r--r-- | tests/codegen/binary-search-index-no-bound-check.rs (renamed from src/test/codegen/binary-search-index-no-bound-check.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/bool-cmp.rs (renamed from src/test/codegen/bool-cmp.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/box-maybe-uninit-llvm14.rs | 34 | ||||
-rw-r--r-- | tests/codegen/box-maybe-uninit.rs | 33 | ||||
-rw-r--r-- | tests/codegen/bpf-alu32.rs (renamed from src/test/codegen/bpf-alu32.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/branch-protection.rs (renamed from src/test/codegen/branch-protection.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/c-variadic-copy.rs (renamed from src/test/codegen/c-variadic-copy.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/c-variadic-opt.rs (renamed from src/test/codegen/c-variadic-opt.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/c-variadic.rs (renamed from src/test/codegen/c-variadic.rs) | 2 | ||||
-rw-r--r-- | tests/codegen/call-llvm-intrinsics.rs (renamed from src/test/codegen/call-llvm-intrinsics.rs) | 2 | ||||
-rw-r--r-- | tests/codegen/call-metadata.rs (renamed from src/test/codegen/call-metadata.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/catch-unwind.rs (renamed from src/test/codegen/catch-unwind.rs) | 2 | ||||
-rw-r--r-- | tests/codegen/cdylib-external-inline-fns.rs (renamed from src/test/codegen/cdylib-external-inline-fns.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/cf-protection.rs (renamed from src/test/codegen/cf-protection.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/cfguard-checks.rs (renamed from src/test/codegen/cfguard-checks.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/cfguard-disabled.rs (renamed from src/test/codegen/cfguard-disabled.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/cfguard-nochecks.rs (renamed from src/test/codegen/cfguard-nochecks.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/cfguard-non-msvc.rs (renamed from src/test/codegen/cfguard-non-msvc.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/codemodels.rs (renamed from src/test/codegen/codemodels.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/coercions.rs (renamed from src/test/codegen/coercions.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/cold-call-declare-and-call.rs (renamed from src/test/codegen/cold-call-declare-and-call.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/comparison-operators-newtype.rs | 49 | ||||
-rw-r--r-- | tests/codegen/consts.rs (renamed from src/test/codegen/consts.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/dealloc-no-unwind.rs (renamed from src/test/codegen/dealloc-no-unwind.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/debug-alignment.rs (renamed from src/test/codegen/debug-alignment.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/debug-column-msvc.rs (renamed from src/test/codegen/debug-column-msvc.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/debug-column.rs (renamed from src/test/codegen/debug-column.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/debug-compile-unit-path.rs (renamed from src/test/codegen/debug-compile-unit-path.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/debug-linkage-name.rs (renamed from src/test/codegen/debug-linkage-name.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/debug-vtable.rs (renamed from src/test/codegen/debug-vtable.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/debuginfo-generic-closure-env-names.rs (renamed from src/test/codegen/debuginfo-generic-closure-env-names.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/deduced-param-attrs.rs (renamed from src/test/codegen/deduced-param-attrs.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/default-requires-uwtable.rs (renamed from src/test/codegen/default-requires-uwtable.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/dllimports/auxiliary/dummy.rs (renamed from src/test/codegen/dllimports/auxiliary/dummy.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/dllimports/auxiliary/wrapper.rs (renamed from src/test/codegen/dllimports/auxiliary/wrapper.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/dllimports/main.rs | 43 | ||||
-rw-r--r-- | tests/codegen/drop.rs (renamed from src/test/codegen/drop.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/dst-vtable-align-nonzero.rs | 61 | ||||
-rw-r--r-- | tests/codegen/dst-vtable-size-range.rs | 35 | ||||
-rw-r--r-- | tests/codegen/enum-bounds-check-derived-idx.rs (renamed from src/test/codegen/enum-bounds-check-derived-idx.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/enum-bounds-check-issue-13926.rs (renamed from src/test/codegen/enum-bounds-check-issue-13926.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/enum-bounds-check-issue-82871.rs (renamed from src/test/codegen/enum-bounds-check-issue-82871.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/enum-bounds-check.rs (renamed from src/test/codegen/enum-bounds-check.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/enum-debug-clike.rs (renamed from src/test/codegen/enum-debug-clike.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/enum-debug-niche-2.rs (renamed from src/test/codegen/enum-debug-niche-2.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/enum-debug-niche.rs (renamed from src/test/codegen/enum-debug-niche.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/enum-debug-tagged.rs (renamed from src/test/codegen/enum-debug-tagged.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/enum-discriminant-value.rs (renamed from src/test/codegen/enum-discriminant-value.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/enum-match.rs (renamed from src/test/codegen/enum-match.rs) | 10 | ||||
-rw-r--r-- | tests/codegen/export-no-mangle.rs (renamed from src/test/codegen/export-no-mangle.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/external-no-mangle-fns.rs (renamed from src/test/codegen/external-no-mangle-fns.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/external-no-mangle-statics.rs (renamed from src/test/codegen/external-no-mangle-statics.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/fastcall-inreg.rs | 41 | ||||
-rw-r--r-- | tests/codegen/fatptr.rs (renamed from src/test/codegen/fatptr.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/fewer-names.rs (renamed from src/test/codegen/fewer-names.rs) | 4 | ||||
-rw-r--r-- | tests/codegen/ffi-const.rs (renamed from src/test/codegen/ffi-const.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/ffi-out-of-bounds-loads.rs (renamed from src/test/codegen/ffi-out-of-bounds-loads.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/ffi-pure.rs (renamed from src/test/codegen/ffi-pure.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/ffi-returns-twice.rs (renamed from src/test/codegen/ffi-returns-twice.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/float_math.rs (renamed from src/test/codegen/float_math.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/fn-impl-trait-self.rs (renamed from src/test/codegen/fn-impl-trait-self.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/foo.s (renamed from src/test/codegen/foo.s) | 0 | ||||
-rw-r--r-- | tests/codegen/force-frame-pointers.rs (renamed from src/test/codegen/force-frame-pointers.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/force-no-unwind-tables.rs (renamed from src/test/codegen/force-no-unwind-tables.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/force-unwind-tables.rs (renamed from src/test/codegen/force-unwind-tables.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/frame-pointer.rs (renamed from src/test/codegen/frame-pointer.rs) | 2 | ||||
-rw-r--r-- | tests/codegen/function-arguments-noopt.rs (renamed from src/test/codegen/function-arguments-noopt.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/function-arguments.rs (renamed from src/test/codegen/function-arguments.rs) | 60 | ||||
-rw-r--r-- | tests/codegen/gdb_debug_script_load.rs (renamed from src/test/codegen/gdb_debug_script_load.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/generator-debug-msvc.rs (renamed from src/test/codegen/generator-debug-msvc.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/generator-debug.rs (renamed from src/test/codegen/generator-debug.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/generic-debug.rs (renamed from src/test/codegen/generic-debug.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/global_asm.rs (renamed from src/test/codegen/global_asm.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/global_asm_include.rs (renamed from src/test/codegen/global_asm_include.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/global_asm_x2.rs (renamed from src/test/codegen/global_asm_x2.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/i686-macosx-deployment-target.rs (renamed from src/test/codegen/i686-macosx-deployment-target.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/i686-no-macosx-deployment-target.rs (renamed from src/test/codegen/i686-no-macosx-deployment-target.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/inline-always-works-always.rs (renamed from src/test/codegen/inline-always-works-always.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/inline-debuginfo.rs (renamed from src/test/codegen/inline-debuginfo.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/inline-hint.rs (renamed from src/test/codegen/inline-hint.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/instrument-coverage.rs (renamed from src/test/codegen/instrument-coverage.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/instrument-mcount.rs (renamed from src/test/codegen/instrument-mcount.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/integer-cmp.rs (renamed from src/test/codegen/integer-cmp.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/integer-overflow.rs (renamed from src/test/codegen/integer-overflow.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/internalize-closures.rs (renamed from src/test/codegen/internalize-closures.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/intrinsic-no-unnamed-attr.rs (renamed from src/test/codegen/intrinsic-no-unnamed-attr.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/intrinsics/const_eval_select.rs (renamed from src/test/codegen/intrinsics/const_eval_select.rs) | 2 | ||||
-rw-r--r-- | tests/codegen/intrinsics/exact_div.rs (renamed from src/test/codegen/intrinsics/exact_div.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/intrinsics/likely.rs (renamed from src/test/codegen/intrinsics/likely.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/intrinsics/mask.rs (renamed from src/test/codegen/intrinsics/mask.rs) | 3 | ||||
-rw-r--r-- | tests/codegen/intrinsics/nearby.rs (renamed from src/test/codegen/intrinsics/nearby.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/intrinsics/nontemporal.rs (renamed from src/test/codegen/intrinsics/nontemporal.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/intrinsics/offset_from.rs (renamed from src/test/codegen/intrinsics/offset_from.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/intrinsics/prefetch.rs (renamed from src/test/codegen/intrinsics/prefetch.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/intrinsics/unchecked_math.rs (renamed from src/test/codegen/intrinsics/unchecked_math.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/intrinsics/volatile.rs (renamed from src/test/codegen/intrinsics/volatile.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/intrinsics/volatile_order.rs (renamed from src/test/codegen/intrinsics/volatile_order.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/issue-103285-ptr-addr-overflow-check.rs (renamed from src/test/codegen/issue-103285-ptr-addr-overflow-check.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/issue-103840.rs | 9 | ||||
-rw-r--r-- | tests/codegen/issue-105386-ub-in-debuginfo.rs | 22 | ||||
-rw-r--r-- | tests/codegen/issue-13018.rs (renamed from src/test/codegen/issue-13018.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/issue-15953.rs (renamed from src/test/codegen/issue-15953.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/issue-27130.rs (renamed from src/test/codegen/issue-27130.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/issue-32031.rs (renamed from src/test/codegen/issue-32031.rs) | 2 | ||||
-rw-r--r-- | tests/codegen/issue-32364.rs (renamed from src/test/codegen/issue-32364.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/issue-34634.rs (renamed from src/test/codegen/issue-34634.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/issue-34947-pow-i32.rs (renamed from src/test/codegen/issue-34947-pow-i32.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/issue-37945.rs (renamed from src/test/codegen/issue-37945.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/issue-44056-macos-tls-align.rs (renamed from src/test/codegen/issue-44056-macos-tls-align.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/issue-45222.rs (renamed from src/test/codegen/issue-45222.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/issue-45466.rs (renamed from src/test/codegen/issue-45466.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/issue-45964-bounds-check-slice-pos.rs (renamed from src/test/codegen/issue-45964-bounds-check-slice-pos.rs) | 1 | ||||
-rw-r--r-- | tests/codegen/issue-47278.rs (renamed from src/test/codegen/issue-47278.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/issue-47442.rs (renamed from src/test/codegen/issue-47442.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/issue-56267-2.rs (renamed from src/test/codegen/issue-56267-2.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/issue-56267.rs (renamed from src/test/codegen/issue-56267.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/issue-56927.rs (renamed from src/test/codegen/issue-56927.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/issue-58881.rs (renamed from src/test/codegen/issue-58881.rs) | 2 | ||||
-rw-r--r-- | tests/codegen/issue-59352.rs (renamed from src/test/codegen/issue-59352.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/issue-69101-bounds-check.rs (renamed from src/test/codegen/issue-69101-bounds-check.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/issue-73031.rs (renamed from src/test/codegen/issue-73031.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/issue-73338-effecient-cmp.rs (renamed from src/test/codegen/issue-73338-effecient-cmp.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/issue-73396-bounds-check-after-position.rs (renamed from src/test/codegen/issue-73396-bounds-check-after-position.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/issue-73827-bounds-check-index-in-subexpr.rs (renamed from src/test/codegen/issue-73827-bounds-check-index-in-subexpr.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/issue-75525-bounds-checks.rs (renamed from src/test/codegen/issue-75525-bounds-checks.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/issue-75546.rs (renamed from src/test/codegen/issue-75546.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/issue-75659.rs (renamed from src/test/codegen/issue-75659.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/issue-77812.rs (renamed from src/test/codegen/issue-77812.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/issue-81408-dllimport-thinlto-windows.rs (renamed from src/test/codegen/issue-81408-dllimport-thinlto-windows.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/issue-84268.rs (renamed from src/test/codegen/issue-84268.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/issue-85872-multiple-reverse.rs (renamed from src/test/codegen/issue-85872-multiple-reverse.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/issue-86106.rs | 62 | ||||
-rw-r--r-- | tests/codegen/issue-96274.rs (renamed from src/test/codegen/issue-96274.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/issue-96497-slice-size-nowrap.rs (renamed from src/test/codegen/issue-96497-slice-size-nowrap.rs) | 2 | ||||
-rw-r--r-- | tests/codegen/issue-98156-const-arg-temp-lifetime.rs (renamed from src/test/codegen/issue-98156-const-arg-temp-lifetime.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/issue-98294-get-mut-copy-from-slice-opt.rs (renamed from src/test/codegen/issue-98294-get-mut-copy-from-slice-opt.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/iter-repeat-n-trivial-drop.rs (renamed from src/test/codegen/iter-repeat-n-trivial-drop.rs) | 2 | ||||
-rw-r--r-- | tests/codegen/layout-size-checks.rs (renamed from src/test/codegen/layout-size-checks.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/lifetime_start_end.rs (renamed from src/test/codegen/lifetime_start_end.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/link-dead-code.rs (renamed from src/test/codegen/link-dead-code.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/link_section.rs (renamed from src/test/codegen/link_section.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/loads.rs (renamed from src/test/codegen/loads.rs) | 8 | ||||
-rw-r--r-- | tests/codegen/local-generics-in-exe-internalized.rs (renamed from src/test/codegen/local-generics-in-exe-internalized.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/lto-removes-invokes.rs (renamed from src/test/codegen/lto-removes-invokes.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/mainsubprogram.rs (renamed from src/test/codegen/mainsubprogram.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/mainsubprogramstart.rs (renamed from src/test/codegen/mainsubprogramstart.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/match-optimized.rs (renamed from src/test/codegen/match-optimized.rs) | 2 | ||||
-rw-r--r-- | tests/codegen/match-optimizes-away.rs (renamed from src/test/codegen/match-optimizes-away.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/match-unoptimized.rs (renamed from src/test/codegen/match-unoptimized.rs) | 2 | ||||
-rw-r--r-- | tests/codegen/mem-replace-direct-memcpy.rs (renamed from src/test/codegen/mem-replace-direct-memcpy.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/merge-functions.rs (renamed from src/test/codegen/merge-functions.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/mir-inlined-line-numbers.rs (renamed from src/test/codegen/mir-inlined-line-numbers.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/mir_zst_stores.rs (renamed from src/test/codegen/mir_zst_stores.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/move-operands.rs | 12 | ||||
-rw-r--r-- | tests/codegen/naked-functions.rs (renamed from src/test/codegen/naked-functions.rs) | 2 | ||||
-rw-r--r-- | tests/codegen/naked-nocoverage.rs (renamed from src/test/codegen/naked-nocoverage.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/naked-noinline.rs (renamed from src/test/codegen/naked-noinline.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/no-assumes-on-casts.rs (renamed from src/test/codegen/no-assumes-on-casts.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/no-dllimport-w-cross-lang-lto.rs (renamed from src/test/codegen/no-dllimport-w-cross-lang-lto.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/no-jump-tables.rs | 22 | ||||
-rw-r--r-- | tests/codegen/no-plt.rs (renamed from src/test/codegen/no-plt.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/noalias-box-off.rs (renamed from src/test/codegen/noalias-box-off.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/noalias-box.rs (renamed from src/test/codegen/noalias-box.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/noalias-flag.rs | 23 | ||||
-rw-r--r-- | tests/codegen/noalias-refcell.rs (renamed from src/test/codegen/noalias-refcell.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/noalias-rwlockreadguard.rs (renamed from src/test/codegen/noalias-rwlockreadguard.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/noalias-unpin.rs (renamed from src/test/codegen/noalias-unpin.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/non-terminate/infinite-loop-1.rs (renamed from src/test/codegen/non-terminate/infinite-loop-1.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/non-terminate/infinite-loop-2.rs (renamed from src/test/codegen/non-terminate/infinite-loop-2.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/non-terminate/infinite-recursion.rs (renamed from src/test/codegen/non-terminate/infinite-recursion.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/non-terminate/nonempty-infinite-loop.rs (renamed from src/test/codegen/non-terminate/nonempty-infinite-loop.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/noreturn-uninhabited.rs (renamed from src/test/codegen/noreturn-uninhabited.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/noreturnflag.rs (renamed from src/test/codegen/noreturnflag.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/nounwind.rs (renamed from src/test/codegen/nounwind.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/nrvo.rs (renamed from src/test/codegen/nrvo.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/optimize-attr-1.rs (renamed from src/test/codegen/optimize-attr-1.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/option-nonzero-eq.rs (renamed from src/test/codegen/option-nonzero-eq.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/packed.rs (renamed from src/test/codegen/packed.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/panic-abort-windows.rs (renamed from src/test/codegen/panic-abort-windows.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/panic-in-drop-abort.rs (renamed from src/test/codegen/panic-in-drop-abort.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/panic-unwind-default-uwtable.rs (renamed from src/test/codegen/panic-unwind-default-uwtable.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/personality_lifetimes.rs (renamed from src/test/codegen/personality_lifetimes.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/pgo-counter-bias.rs | 10 | ||||
-rw-r--r-- | tests/codegen/pgo-instrumentation.rs (renamed from src/test/codegen/pgo-instrumentation.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/pic-relocation-model.rs (renamed from src/test/codegen/pic-relocation-model.rs) | 2 | ||||
-rw-r--r-- | tests/codegen/pie-relocation-model.rs (renamed from src/test/codegen/pie-relocation-model.rs) | 2 | ||||
-rw-r--r-- | tests/codegen/refs.rs (renamed from src/test/codegen/refs.rs) | 2 | ||||
-rw-r--r-- | tests/codegen/remap_path_prefix/aux_mod.rs (renamed from src/test/codegen/remap_path_prefix/aux_mod.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/remap_path_prefix/auxiliary/remap_path_prefix_aux.rs (renamed from src/test/codegen/remap_path_prefix/auxiliary/remap_path_prefix_aux.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/remap_path_prefix/auxiliary/xcrate-generic.rs (renamed from src/test/codegen/remap_path_prefix/auxiliary/xcrate-generic.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/remap_path_prefix/issue-73167-remap-std.rs (renamed from src/test/codegen/remap_path_prefix/issue-73167-remap-std.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/remap_path_prefix/main.rs | 28 | ||||
-rw-r--r-- | tests/codegen/remap_path_prefix/xcrate-generic.rs (renamed from src/test/codegen/remap_path_prefix/xcrate-generic.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/repeat-trusted-len.rs (renamed from src/test/codegen/repeat-trusted-len.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/repr-transparent-aggregates-1.rs (renamed from src/test/codegen/repr-transparent-aggregates-1.rs) | 1 | ||||
-rw-r--r-- | tests/codegen/repr-transparent-aggregates-2.rs (renamed from src/test/codegen/repr-transparent-aggregates-2.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/repr-transparent-aggregates-3.rs (renamed from src/test/codegen/repr-transparent-aggregates-3.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/repr-transparent-sysv64.rs (renamed from src/test/codegen/repr-transparent-sysv64.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/repr-transparent.rs (renamed from src/test/codegen/repr-transparent.rs) | 29 | ||||
-rw-r--r-- | tests/codegen/riscv-abi/call-llvm-intrinsics.rs (renamed from src/test/codegen/riscv-abi/call-llvm-intrinsics.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/riscv-abi/riscv64-lp64-lp64f-lp64d-abi.rs (renamed from src/test/codegen/riscv-abi/riscv64-lp64-lp64f-lp64d-abi.rs) | 18 | ||||
-rw-r--r-- | tests/codegen/riscv-abi/riscv64-lp64d-abi.rs (renamed from src/test/codegen/riscv-abi/riscv64-lp64d-abi.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/riscv-abi/riscv64-lp64f-lp64d-abi.rs (renamed from src/test/codegen/riscv-abi/riscv64-lp64f-lp64d-abi.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/sanitizer-cfi-add-canonical-jump-tables-flag.rs (renamed from src/test/codegen/sanitizer-cfi-add-canonical-jump-tables-flag.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/sanitizer-cfi-emit-type-checks.rs (renamed from src/test/codegen/sanitizer-cfi-emit-type-checks.rs) | 2 | ||||
-rw-r--r-- | tests/codegen/sanitizer-cfi-emit-type-metadata-id-itanium-cxx-abi.rs (renamed from src/test/codegen/sanitizer-cfi-emit-type-metadata-id-itanium-cxx-abi.rs) | 22 | ||||
-rw-r--r-- | tests/codegen/sanitizer-cfi-emit-type-metadata-itanium-cxx-abi.rs (renamed from src/test/codegen/sanitizer-cfi-emit-type-metadata-itanium-cxx-abi.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/sanitizer-kcfi-add-kcfi-flag.rs | 11 | ||||
-rw-r--r-- | tests/codegen/sanitizer-kcfi-emit-kcfi-operand-bundle-itanium-cxx-abi.rs | 44 | ||||
-rw-r--r-- | tests/codegen/sanitizer-memory-track-orgins.rs (renamed from src/test/codegen/sanitizer-memory-track-orgins.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/sanitizer-no-sanitize-inlining.rs (renamed from src/test/codegen/sanitizer-no-sanitize-inlining.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/sanitizer-no-sanitize.rs (renamed from src/test/codegen/sanitizer-no-sanitize.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/sanitizer-recover.rs (renamed from src/test/codegen/sanitizer-recover.rs) | 10 | ||||
-rw-r--r-- | tests/codegen/sanitizer_memtag_attr_check.rs (renamed from src/test/codegen/sanitizer_memtag_attr_check.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/sanitizer_scs_attr_check.rs (renamed from src/test/codegen/sanitizer_scs_attr_check.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/scalar-pair-bool.rs (renamed from src/test/codegen/scalar-pair-bool.rs) | 4 | ||||
-rw-r--r-- | tests/codegen/set-discriminant-invalid.rs (renamed from src/test/codegen/set-discriminant-invalid.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/simd-intrinsic/simd-intrinsic-float-abs.rs (renamed from src/test/codegen/simd-intrinsic/simd-intrinsic-float-abs.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/simd-intrinsic/simd-intrinsic-float-ceil.rs (renamed from src/test/codegen/simd-intrinsic/simd-intrinsic-float-ceil.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/simd-intrinsic/simd-intrinsic-float-cos.rs (renamed from src/test/codegen/simd-intrinsic/simd-intrinsic-float-cos.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/simd-intrinsic/simd-intrinsic-float-exp.rs (renamed from src/test/codegen/simd-intrinsic/simd-intrinsic-float-exp.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/simd-intrinsic/simd-intrinsic-float-exp2.rs (renamed from src/test/codegen/simd-intrinsic/simd-intrinsic-float-exp2.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/simd-intrinsic/simd-intrinsic-float-floor.rs (renamed from src/test/codegen/simd-intrinsic/simd-intrinsic-float-floor.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/simd-intrinsic/simd-intrinsic-float-fma.rs (renamed from src/test/codegen/simd-intrinsic/simd-intrinsic-float-fma.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/simd-intrinsic/simd-intrinsic-float-fsqrt.rs (renamed from src/test/codegen/simd-intrinsic/simd-intrinsic-float-fsqrt.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/simd-intrinsic/simd-intrinsic-float-log.rs (renamed from src/test/codegen/simd-intrinsic/simd-intrinsic-float-log.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/simd-intrinsic/simd-intrinsic-float-log10.rs (renamed from src/test/codegen/simd-intrinsic/simd-intrinsic-float-log10.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/simd-intrinsic/simd-intrinsic-float-log2.rs (renamed from src/test/codegen/simd-intrinsic/simd-intrinsic-float-log2.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/simd-intrinsic/simd-intrinsic-float-minmax.rs (renamed from src/test/codegen/simd-intrinsic/simd-intrinsic-float-minmax.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/simd-intrinsic/simd-intrinsic-float-pow.rs (renamed from src/test/codegen/simd-intrinsic/simd-intrinsic-float-pow.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/simd-intrinsic/simd-intrinsic-float-powi.rs (renamed from src/test/codegen/simd-intrinsic/simd-intrinsic-float-powi.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/simd-intrinsic/simd-intrinsic-float-sin.rs (renamed from src/test/codegen/simd-intrinsic/simd-intrinsic-float-sin.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/simd-intrinsic/simd-intrinsic-generic-arithmetic-saturating.rs (renamed from src/test/codegen/simd-intrinsic/simd-intrinsic-generic-arithmetic-saturating.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/simd-intrinsic/simd-intrinsic-generic-bitmask.rs (renamed from src/test/codegen/simd-intrinsic/simd-intrinsic-generic-bitmask.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/simd-intrinsic/simd-intrinsic-generic-extract-insert.rs (renamed from src/test/codegen/simd-intrinsic/simd-intrinsic-generic-extract-insert.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/simd-intrinsic/simd-intrinsic-generic-gather.rs (renamed from src/test/codegen/simd-intrinsic/simd-intrinsic-generic-gather.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/simd-intrinsic/simd-intrinsic-generic-scatter.rs (renamed from src/test/codegen/simd-intrinsic/simd-intrinsic-generic-scatter.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/simd-intrinsic/simd-intrinsic-generic-select.rs (renamed from src/test/codegen/simd-intrinsic/simd-intrinsic-generic-select.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/simd-intrinsic/simd-intrinsic-transmute-array.rs (renamed from src/test/codegen/simd-intrinsic/simd-intrinsic-transmute-array.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/simd-wide-sum.rs (renamed from src/test/codegen/simd-wide-sum.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/simd_arith_offset.rs (renamed from src/test/codegen/simd_arith_offset.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/slice-as_chunks.rs (renamed from src/test/codegen/slice-as_chunks.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/slice-init.rs (renamed from src/test/codegen/slice-init.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/slice-iter-len-eq-zero.rs (renamed from src/test/codegen/slice-iter-len-eq-zero.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/slice-position-bounds-check.rs (renamed from src/test/codegen/slice-position-bounds-check.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/slice-ref-equality.rs (renamed from src/test/codegen/slice-ref-equality.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/slice-reverse.rs (renamed from src/test/codegen/slice-reverse.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/slice-windows-no-bounds-check.rs (renamed from src/test/codegen/slice-windows-no-bounds-check.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/slice_as_from_ptr_range.rs (renamed from src/test/codegen/slice_as_from_ptr_range.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/some-abis-do-extend-params-to-32-bits.rs (renamed from src/test/codegen/some-abis-do-extend-params-to-32-bits.rs) | 2 | ||||
-rw-r--r-- | tests/codegen/some-global-nonnull.rs (renamed from src/test/codegen/some-global-nonnull.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/sparc-struct-abi.rs (renamed from src/test/codegen/sparc-struct-abi.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs (renamed from src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs (renamed from src/test/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/src-hash-algorithm/src-hash-algorithm-sha256.rs (renamed from src/test/codegen/src-hash-algorithm/src-hash-algorithm-sha256.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/sse42-implies-crc32.rs (renamed from src/test/codegen/sse42-implies-crc32.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/stack-probes-call.rs (renamed from src/test/codegen/stack-probes-call.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/stack-probes-inline.rs (renamed from src/test/codegen/stack-probes-inline.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/stack-protector.rs (renamed from src/test/codegen/stack-protector.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/static-relocation-model-msvc.rs (renamed from src/test/codegen/static-relocation-model-msvc.rs) | 4 | ||||
-rw-r--r-- | tests/codegen/staticlib-external-inline-fns.rs (renamed from src/test/codegen/staticlib-external-inline-fns.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/stores.rs (renamed from src/test/codegen/stores.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/swap-large-types.rs (renamed from src/test/codegen/swap-large-types.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/swap-simd-types.rs (renamed from src/test/codegen/swap-simd-types.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/swap-small-types.rs (renamed from src/test/codegen/swap-small-types.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/target-cpu-on-functions.rs (renamed from src/test/codegen/target-cpu-on-functions.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/target-feature-overrides.rs (renamed from src/test/codegen/target-feature-overrides.rs) | 2 | ||||
-rw-r--r-- | tests/codegen/thread-local.rs (renamed from src/test/codegen/thread-local.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/to_vec.rs (renamed from src/test/codegen/to_vec.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/transmute-scalar.rs (renamed from src/test/codegen/transmute-scalar.rs) | 10 | ||||
-rw-r--r-- | tests/codegen/try_identity.rs (renamed from src/test/codegen/try_identity.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/try_question_mark_nop.rs (renamed from src/test/codegen/try_question_mark_nop.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/tune-cpu-on-functions.rs (renamed from src/test/codegen/tune-cpu-on-functions.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/tuple-layout-opt.rs (renamed from src/test/codegen/tuple-layout-opt.rs) | 2 | ||||
-rw-r--r-- | tests/codegen/unchecked-float-casts.rs (renamed from src/test/codegen/unchecked-float-casts.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/unchecked_shifts.rs (renamed from src/test/codegen/unchecked_shifts.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/uninit-consts.rs (renamed from src/test/codegen/uninit-consts.rs) | 2 | ||||
-rw-r--r-- | tests/codegen/union-abi.rs (renamed from src/test/codegen/union-abi.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/unpadded-simd.rs (renamed from src/test/codegen/unpadded-simd.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/unwind-abis/aapcs-unwind-abi.rs (renamed from src/test/codegen/unwind-abis/aapcs-unwind-abi.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/unwind-abis/c-unwind-abi-panic-abort.rs (renamed from src/test/codegen/unwind-abis/c-unwind-abi-panic-abort.rs) | 3 | ||||
-rw-r--r-- | tests/codegen/unwind-abis/c-unwind-abi.rs (renamed from src/test/codegen/unwind-abis/c-unwind-abi.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/unwind-abis/cdecl-unwind-abi.rs (renamed from src/test/codegen/unwind-abis/cdecl-unwind-abi.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/unwind-abis/fastcall-unwind-abi.rs (renamed from src/test/codegen/unwind-abis/fastcall-unwind-abi.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/unwind-abis/nounwind-on-stable-panic-abort.rs (renamed from src/test/codegen/unwind-abis/nounwind-on-stable-panic-abort.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/unwind-abis/nounwind-on-stable-panic-unwind.rs (renamed from src/test/codegen/unwind-abis/nounwind-on-stable-panic-unwind.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/unwind-abis/nounwind.rs (renamed from src/test/codegen/unwind-abis/nounwind.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/unwind-abis/stdcall-unwind-abi.rs (renamed from src/test/codegen/unwind-abis/stdcall-unwind-abi.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/unwind-abis/system-unwind-abi.rs (renamed from src/test/codegen/unwind-abis/system-unwind-abi.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/unwind-abis/sysv64-unwind-abi.rs (renamed from src/test/codegen/unwind-abis/sysv64-unwind-abi.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/unwind-abis/thiscall-unwind-abi.rs (renamed from src/test/codegen/unwind-abis/thiscall-unwind-abi.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/unwind-abis/vectorcall-unwind-abi.rs (renamed from src/test/codegen/unwind-abis/vectorcall-unwind-abi.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/unwind-abis/win64-unwind-abi.rs (renamed from src/test/codegen/unwind-abis/win64-unwind-abi.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/unwind-and-panic-abort.rs | 17 | ||||
-rw-r--r-- | tests/codegen/unwind-extern-exports.rs (renamed from src/test/codegen/unwind-extern-exports.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/unwind-extern-imports.rs (renamed from src/test/codegen/unwind-extern-imports.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/used_with_arg.rs (renamed from src/test/codegen/used_with_arg.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/var-names.rs (renamed from src/test/codegen/var-names.rs) | 2 | ||||
-rw-r--r-- | tests/codegen/vec-calloc-llvm14.rs (renamed from src/test/codegen/vec-calloc-llvm14.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/vec-calloc.rs (renamed from src/test/codegen/vec-calloc.rs) | 19 | ||||
-rw-r--r-- | tests/codegen/vec-in-place.rs (renamed from src/test/codegen/vec-in-place.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/vec-iter-collect-len.rs (renamed from src/test/codegen/vec-iter-collect-len.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/vec-optimizes-away.rs (renamed from src/test/codegen/vec-optimizes-away.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/vec-shrink-panik.rs | 47 | ||||
-rw-r--r-- | tests/codegen/vecdeque_no_panic.rs (renamed from src/test/codegen/vecdeque_no_panic.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/virtual-function-elimination-32bit.rs (renamed from src/test/codegen/virtual-function-elimination-32bit.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/virtual-function-elimination.rs (renamed from src/test/codegen/virtual-function-elimination.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/wasm_casts_trapping.rs (renamed from src/test/codegen/wasm_casts_trapping.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/x86_64-macosx-deployment-target.rs (renamed from src/test/codegen/x86_64-macosx-deployment-target.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/x86_64-no-macosx-deployment-target.rs (renamed from src/test/codegen/x86_64-no-macosx-deployment-target.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/zip.rs (renamed from src/test/codegen/zip.rs) | 0 | ||||
-rw-r--r-- | tests/codegen/zst-offset.rs (renamed from src/test/codegen/zst-offset.rs) | 11 |
395 files changed, 882 insertions, 99 deletions
diff --git a/src/test/codegen-units/item-collection/asm-sym.rs b/tests/codegen-units/item-collection/asm-sym.rs index 8bafb95bc..8bafb95bc 100644 --- a/src/test/codegen-units/item-collection/asm-sym.rs +++ b/tests/codegen-units/item-collection/asm-sym.rs diff --git a/src/test/codegen-units/item-collection/auxiliary/cgu_export_trait_method.rs b/tests/codegen-units/item-collection/auxiliary/cgu_export_trait_method.rs index ecea26dc4..ecea26dc4 100644 --- a/src/test/codegen-units/item-collection/auxiliary/cgu_export_trait_method.rs +++ b/tests/codegen-units/item-collection/auxiliary/cgu_export_trait_method.rs diff --git a/src/test/codegen-units/item-collection/auxiliary/cgu_extern_closures.rs b/tests/codegen-units/item-collection/auxiliary/cgu_extern_closures.rs index 05ea0a89f..05ea0a89f 100644 --- a/src/test/codegen-units/item-collection/auxiliary/cgu_extern_closures.rs +++ b/tests/codegen-units/item-collection/auxiliary/cgu_extern_closures.rs diff --git a/src/test/codegen-units/item-collection/auxiliary/cgu_generic_function.rs b/tests/codegen-units/item-collection/auxiliary/cgu_generic_function.rs index 3926f2957..3926f2957 100644 --- a/src/test/codegen-units/item-collection/auxiliary/cgu_generic_function.rs +++ b/tests/codegen-units/item-collection/auxiliary/cgu_generic_function.rs diff --git a/src/test/codegen-units/item-collection/cross-crate-closures.rs b/tests/codegen-units/item-collection/cross-crate-closures.rs index 6af344fab..6af344fab 100644 --- a/src/test/codegen-units/item-collection/cross-crate-closures.rs +++ b/tests/codegen-units/item-collection/cross-crate-closures.rs diff --git a/src/test/codegen-units/item-collection/cross-crate-generic-functions.rs b/tests/codegen-units/item-collection/cross-crate-generic-functions.rs index 7289ceee9..7289ceee9 100644 --- a/src/test/codegen-units/item-collection/cross-crate-generic-functions.rs +++ b/tests/codegen-units/item-collection/cross-crate-generic-functions.rs diff --git a/src/test/codegen-units/item-collection/cross-crate-trait-method.rs b/tests/codegen-units/item-collection/cross-crate-trait-method.rs index dc0984c8a..dc0984c8a 100644 --- a/src/test/codegen-units/item-collection/cross-crate-trait-method.rs +++ b/tests/codegen-units/item-collection/cross-crate-trait-method.rs diff --git a/src/test/codegen-units/item-collection/drop_in_place_intrinsic.rs b/tests/codegen-units/item-collection/drop_in_place_intrinsic.rs index a3f1fb5e7..a3f1fb5e7 100644 --- a/src/test/codegen-units/item-collection/drop_in_place_intrinsic.rs +++ b/tests/codegen-units/item-collection/drop_in_place_intrinsic.rs diff --git a/src/test/codegen-units/item-collection/function-as-argument.rs b/tests/codegen-units/item-collection/function-as-argument.rs index ea500c311..ea500c311 100644 --- a/src/test/codegen-units/item-collection/function-as-argument.rs +++ b/tests/codegen-units/item-collection/function-as-argument.rs diff --git a/src/test/codegen-units/item-collection/generic-drop-glue.rs b/tests/codegen-units/item-collection/generic-drop-glue.rs index 6df4ff7e5..6df4ff7e5 100644 --- a/src/test/codegen-units/item-collection/generic-drop-glue.rs +++ b/tests/codegen-units/item-collection/generic-drop-glue.rs diff --git a/src/test/codegen-units/item-collection/generic-functions.rs b/tests/codegen-units/item-collection/generic-functions.rs index 04383bb8e..04383bb8e 100644 --- a/src/test/codegen-units/item-collection/generic-functions.rs +++ b/tests/codegen-units/item-collection/generic-functions.rs diff --git a/src/test/codegen-units/item-collection/generic-impl.rs b/tests/codegen-units/item-collection/generic-impl.rs index 4260230c2..4260230c2 100644 --- a/src/test/codegen-units/item-collection/generic-impl.rs +++ b/tests/codegen-units/item-collection/generic-impl.rs diff --git a/src/test/codegen-units/item-collection/impl-in-non-instantiated-generic.rs b/tests/codegen-units/item-collection/impl-in-non-instantiated-generic.rs index c01398eb2..c01398eb2 100644 --- a/src/test/codegen-units/item-collection/impl-in-non-instantiated-generic.rs +++ b/tests/codegen-units/item-collection/impl-in-non-instantiated-generic.rs diff --git a/src/test/codegen-units/item-collection/implicit-panic-call.rs b/tests/codegen-units/item-collection/implicit-panic-call.rs index abec7ad50..abec7ad50 100644 --- a/src/test/codegen-units/item-collection/implicit-panic-call.rs +++ b/tests/codegen-units/item-collection/implicit-panic-call.rs diff --git a/src/test/codegen-units/item-collection/instantiation-through-vtable.rs b/tests/codegen-units/item-collection/instantiation-through-vtable.rs index e78226d40..e78226d40 100644 --- a/src/test/codegen-units/item-collection/instantiation-through-vtable.rs +++ b/tests/codegen-units/item-collection/instantiation-through-vtable.rs diff --git a/src/test/codegen-units/item-collection/items-within-generic-items.rs b/tests/codegen-units/item-collection/items-within-generic-items.rs index d37d7f7d9..d37d7f7d9 100644 --- a/src/test/codegen-units/item-collection/items-within-generic-items.rs +++ b/tests/codegen-units/item-collection/items-within-generic-items.rs diff --git a/src/test/codegen-units/item-collection/non-generic-closures.rs b/tests/codegen-units/item-collection/non-generic-closures.rs index 379fbcf26..379fbcf26 100644 --- a/src/test/codegen-units/item-collection/non-generic-closures.rs +++ b/tests/codegen-units/item-collection/non-generic-closures.rs diff --git a/src/test/codegen-units/item-collection/non-generic-drop-glue.rs b/tests/codegen-units/item-collection/non-generic-drop-glue.rs index 06f76f7db..06f76f7db 100644 --- a/src/test/codegen-units/item-collection/non-generic-drop-glue.rs +++ b/tests/codegen-units/item-collection/non-generic-drop-glue.rs diff --git a/src/test/codegen-units/item-collection/non-generic-functions.rs b/tests/codegen-units/item-collection/non-generic-functions.rs index 092e64562..092e64562 100644 --- a/src/test/codegen-units/item-collection/non-generic-functions.rs +++ b/tests/codegen-units/item-collection/non-generic-functions.rs diff --git a/src/test/codegen-units/item-collection/overloaded-operators.rs b/tests/codegen-units/item-collection/overloaded-operators.rs index 2be7eba1d..2be7eba1d 100644 --- a/src/test/codegen-units/item-collection/overloaded-operators.rs +++ b/tests/codegen-units/item-collection/overloaded-operators.rs diff --git a/src/test/codegen-units/item-collection/static-init.rs b/tests/codegen-units/item-collection/static-init.rs index 287ec8f24..287ec8f24 100644 --- a/src/test/codegen-units/item-collection/static-init.rs +++ b/tests/codegen-units/item-collection/static-init.rs diff --git a/src/test/codegen-units/item-collection/statics-and-consts.rs b/tests/codegen-units/item-collection/statics-and-consts.rs index 49a8d3dff..49a8d3dff 100644 --- a/src/test/codegen-units/item-collection/statics-and-consts.rs +++ b/tests/codegen-units/item-collection/statics-and-consts.rs diff --git a/src/test/codegen-units/item-collection/trait-implementations.rs b/tests/codegen-units/item-collection/trait-implementations.rs index a816cb032..a816cb032 100644 --- a/src/test/codegen-units/item-collection/trait-implementations.rs +++ b/tests/codegen-units/item-collection/trait-implementations.rs diff --git a/src/test/codegen-units/item-collection/trait-method-as-argument.rs b/tests/codegen-units/item-collection/trait-method-as-argument.rs index 235569728..235569728 100644 --- a/src/test/codegen-units/item-collection/trait-method-as-argument.rs +++ b/tests/codegen-units/item-collection/trait-method-as-argument.rs diff --git a/src/test/codegen-units/item-collection/trait-method-default-impl.rs b/tests/codegen-units/item-collection/trait-method-default-impl.rs index bfcdb6fa1..bfcdb6fa1 100644 --- a/src/test/codegen-units/item-collection/trait-method-default-impl.rs +++ b/tests/codegen-units/item-collection/trait-method-default-impl.rs diff --git a/src/test/codegen-units/item-collection/transitive-drop-glue.rs b/tests/codegen-units/item-collection/transitive-drop-glue.rs index e286c800b..e286c800b 100644 --- a/src/test/codegen-units/item-collection/transitive-drop-glue.rs +++ b/tests/codegen-units/item-collection/transitive-drop-glue.rs diff --git a/src/test/codegen-units/item-collection/tuple-drop-glue.rs b/tests/codegen-units/item-collection/tuple-drop-glue.rs index ae3b2e081..ae3b2e081 100644 --- a/src/test/codegen-units/item-collection/tuple-drop-glue.rs +++ b/tests/codegen-units/item-collection/tuple-drop-glue.rs diff --git a/src/test/codegen-units/item-collection/unreferenced-const-fn.rs b/tests/codegen-units/item-collection/unreferenced-const-fn.rs index 17b92eae0..17b92eae0 100644 --- a/src/test/codegen-units/item-collection/unreferenced-const-fn.rs +++ b/tests/codegen-units/item-collection/unreferenced-const-fn.rs diff --git a/src/test/codegen-units/item-collection/unreferenced-inline-function.rs b/tests/codegen-units/item-collection/unreferenced-inline-function.rs index 4d095e4d6..4d095e4d6 100644 --- a/src/test/codegen-units/item-collection/unreferenced-inline-function.rs +++ b/tests/codegen-units/item-collection/unreferenced-inline-function.rs diff --git a/src/test/codegen-units/item-collection/unsizing.rs b/tests/codegen-units/item-collection/unsizing.rs index 111a72312..111a72312 100644 --- a/src/test/codegen-units/item-collection/unsizing.rs +++ b/tests/codegen-units/item-collection/unsizing.rs diff --git a/src/test/codegen-units/item-collection/unused-traits-and-generics.rs b/tests/codegen-units/item-collection/unused-traits-and-generics.rs index 561dc1a5c..561dc1a5c 100644 --- a/src/test/codegen-units/item-collection/unused-traits-and-generics.rs +++ b/tests/codegen-units/item-collection/unused-traits-and-generics.rs diff --git a/src/test/codegen-units/partitioning/auxiliary/cgu_explicit_inlining.rs b/tests/codegen-units/partitioning/auxiliary/cgu_explicit_inlining.rs index 4a3a63cc1..4a3a63cc1 100644 --- a/src/test/codegen-units/partitioning/auxiliary/cgu_explicit_inlining.rs +++ b/tests/codegen-units/partitioning/auxiliary/cgu_explicit_inlining.rs diff --git a/src/test/codegen-units/partitioning/auxiliary/cgu_extern_drop_glue.rs b/tests/codegen-units/partitioning/auxiliary/cgu_extern_drop_glue.rs index b5fec2337..b5fec2337 100644 --- a/src/test/codegen-units/partitioning/auxiliary/cgu_extern_drop_glue.rs +++ b/tests/codegen-units/partitioning/auxiliary/cgu_extern_drop_glue.rs diff --git a/src/test/codegen-units/partitioning/auxiliary/cgu_generic_function.rs b/tests/codegen-units/partitioning/auxiliary/cgu_generic_function.rs index 3926f2957..3926f2957 100644 --- a/src/test/codegen-units/partitioning/auxiliary/cgu_generic_function.rs +++ b/tests/codegen-units/partitioning/auxiliary/cgu_generic_function.rs diff --git a/src/test/codegen-units/partitioning/auxiliary/shared_generics_aux.rs b/tests/codegen-units/partitioning/auxiliary/shared_generics_aux.rs index ffbd0dc54..ffbd0dc54 100644 --- a/src/test/codegen-units/partitioning/auxiliary/shared_generics_aux.rs +++ b/tests/codegen-units/partitioning/auxiliary/shared_generics_aux.rs diff --git a/src/test/codegen-units/partitioning/extern-drop-glue.rs b/tests/codegen-units/partitioning/extern-drop-glue.rs index c73d2a10a..c73d2a10a 100644 --- a/src/test/codegen-units/partitioning/extern-drop-glue.rs +++ b/tests/codegen-units/partitioning/extern-drop-glue.rs diff --git a/src/test/codegen-units/partitioning/extern-generic.rs b/tests/codegen-units/partitioning/extern-generic.rs index 638ec079a..638ec079a 100644 --- a/src/test/codegen-units/partitioning/extern-generic.rs +++ b/tests/codegen-units/partitioning/extern-generic.rs diff --git a/src/test/codegen-units/partitioning/incremental-merging.rs b/tests/codegen-units/partitioning/incremental-merging.rs index 118b7bdf4..118b7bdf4 100644 --- a/src/test/codegen-units/partitioning/incremental-merging.rs +++ b/tests/codegen-units/partitioning/incremental-merging.rs diff --git a/src/test/codegen-units/partitioning/inlining-from-extern-crate.rs b/tests/codegen-units/partitioning/inlining-from-extern-crate.rs index 1cc21632e..1cc21632e 100644 --- a/src/test/codegen-units/partitioning/inlining-from-extern-crate.rs +++ b/tests/codegen-units/partitioning/inlining-from-extern-crate.rs diff --git a/src/test/codegen-units/partitioning/local-drop-glue.rs b/tests/codegen-units/partitioning/local-drop-glue.rs index 2fd853a44..2fd853a44 100644 --- a/src/test/codegen-units/partitioning/local-drop-glue.rs +++ b/tests/codegen-units/partitioning/local-drop-glue.rs diff --git a/src/test/codegen-units/partitioning/local-generic.rs b/tests/codegen-units/partitioning/local-generic.rs index 38aec7291..38aec7291 100644 --- a/src/test/codegen-units/partitioning/local-generic.rs +++ b/tests/codegen-units/partitioning/local-generic.rs diff --git a/src/test/codegen-units/partitioning/local-inlining-but-not-all.rs b/tests/codegen-units/partitioning/local-inlining-but-not-all.rs index 318f0c28a..318f0c28a 100644 --- a/src/test/codegen-units/partitioning/local-inlining-but-not-all.rs +++ b/tests/codegen-units/partitioning/local-inlining-but-not-all.rs diff --git a/src/test/codegen-units/partitioning/local-inlining.rs b/tests/codegen-units/partitioning/local-inlining.rs index 841a428e9..841a428e9 100644 --- a/src/test/codegen-units/partitioning/local-inlining.rs +++ b/tests/codegen-units/partitioning/local-inlining.rs diff --git a/src/test/codegen-units/partitioning/local-transitive-inlining.rs b/tests/codegen-units/partitioning/local-transitive-inlining.rs index 03c37954d..03c37954d 100644 --- a/src/test/codegen-units/partitioning/local-transitive-inlining.rs +++ b/tests/codegen-units/partitioning/local-transitive-inlining.rs diff --git a/src/test/codegen-units/partitioning/methods-are-with-self-type.rs b/tests/codegen-units/partitioning/methods-are-with-self-type.rs index 8220dc12e..8220dc12e 100644 --- a/src/test/codegen-units/partitioning/methods-are-with-self-type.rs +++ b/tests/codegen-units/partitioning/methods-are-with-self-type.rs diff --git a/src/test/codegen-units/partitioning/regular-modules.rs b/tests/codegen-units/partitioning/regular-modules.rs index ce7fe9c3a..ce7fe9c3a 100644 --- a/src/test/codegen-units/partitioning/regular-modules.rs +++ b/tests/codegen-units/partitioning/regular-modules.rs diff --git a/src/test/codegen-units/partitioning/shared-generics.rs b/tests/codegen-units/partitioning/shared-generics.rs index ebe96bfb7..ebe96bfb7 100644 --- a/src/test/codegen-units/partitioning/shared-generics.rs +++ b/tests/codegen-units/partitioning/shared-generics.rs diff --git a/src/test/codegen-units/partitioning/statics.rs b/tests/codegen-units/partitioning/statics.rs index b11d6696d..b11d6696d 100644 --- a/src/test/codegen-units/partitioning/statics.rs +++ b/tests/codegen-units/partitioning/statics.rs diff --git a/src/test/codegen-units/partitioning/vtable-through-const.rs b/tests/codegen-units/partitioning/vtable-through-const.rs index cedcca804..cedcca804 100644 --- a/src/test/codegen-units/partitioning/vtable-through-const.rs +++ b/tests/codegen-units/partitioning/vtable-through-const.rs diff --git a/src/test/codegen-units/polymorphization/unused_type_parameters.rs b/tests/codegen-units/polymorphization/unused_type_parameters.rs index c2e06d067..c2e06d067 100644 --- a/src/test/codegen-units/polymorphization/unused_type_parameters.rs +++ b/tests/codegen-units/polymorphization/unused_type_parameters.rs diff --git a/src/test/codegen/README.md b/tests/codegen/README.md index 8f2daaafc..8f2daaafc 100644 --- a/src/test/codegen/README.md +++ b/tests/codegen/README.md diff --git a/src/test/codegen/abi-efiapi.rs b/tests/codegen/abi-efiapi.rs index 9061d7432..9502ebf59 100644 --- a/src/test/codegen/abi-efiapi.rs +++ b/tests/codegen/abi-efiapi.rs @@ -14,7 +14,7 @@ // compile-flags: -C no-prepopulate-passes #![crate_type = "lib"] -#![feature(no_core, lang_items, abi_efiapi)] +#![feature(no_core, lang_items)] #![no_core] #[lang="sized"] diff --git a/src/test/codegen/abi-main-signature-16bit-c-int.rs b/tests/codegen/abi-main-signature-16bit-c-int.rs index 4ed491dfb..4ed491dfb 100644 --- a/src/test/codegen/abi-main-signature-16bit-c-int.rs +++ b/tests/codegen/abi-main-signature-16bit-c-int.rs diff --git a/src/test/codegen/abi-main-signature-32bit-c-int.rs b/tests/codegen/abi-main-signature-32bit-c-int.rs index 7f22ddcfc..7f22ddcfc 100644 --- a/src/test/codegen/abi-main-signature-32bit-c-int.rs +++ b/tests/codegen/abi-main-signature-32bit-c-int.rs diff --git a/src/test/codegen/abi-repr-ext.rs b/tests/codegen/abi-repr-ext.rs index 23ade3c72..23ade3c72 100644 --- a/src/test/codegen/abi-repr-ext.rs +++ b/tests/codegen/abi-repr-ext.rs diff --git a/src/test/codegen/abi-sysv64.rs b/tests/codegen/abi-sysv64.rs index dfc312279..3c2d4e719 100644 --- a/src/test/codegen/abi-sysv64.rs +++ b/tests/codegen/abi-sysv64.rs @@ -3,7 +3,7 @@ // of the sysv64 abi. // // needs-llvm-components: x86 -// compile-flags: -C no-prepopulate-passes --target=x86_64-unknown-linux-gnu +// compile-flags: -C no-prepopulate-passes --target=x86_64-unknown-linux-gnu -Copt-level=0 #![crate_type = "lib"] #![no_core] diff --git a/src/test/codegen/abi-x86-interrupt.rs b/tests/codegen/abi-x86-interrupt.rs index d612f603e..928ad5a9b 100644 --- a/src/test/codegen/abi-x86-interrupt.rs +++ b/tests/codegen/abi-x86-interrupt.rs @@ -3,7 +3,7 @@ // of the x86-interrupt abi. // needs-llvm-components: x86 -// compile-flags: -C no-prepopulate-passes --target=x86_64-unknown-linux-gnu +// compile-flags: -C no-prepopulate-passes --target=x86_64-unknown-linux-gnu -Copt-level=0 #![crate_type = "lib"] #![no_core] diff --git a/src/test/codegen/abi-x86_64_sysv.rs b/tests/codegen/abi-x86_64_sysv.rs index 84e06023e..84e06023e 100644 --- a/src/test/codegen/abi-x86_64_sysv.rs +++ b/tests/codegen/abi-x86_64_sysv.rs diff --git a/src/test/codegen/adjustments.rs b/tests/codegen/adjustments.rs index 39880c934..6d2247517 100644 --- a/src/test/codegen/adjustments.rs +++ b/tests/codegen/adjustments.rs @@ -1,4 +1,4 @@ -// compile-flags: -C no-prepopulate-passes +// compile-flags: -C no-prepopulate-passes -Copt-level=0 #![crate_type = "lib"] diff --git a/src/test/codegen/align-enum.rs b/tests/codegen/align-enum.rs index 70f09ace0..70f09ace0 100644 --- a/src/test/codegen/align-enum.rs +++ b/tests/codegen/align-enum.rs diff --git a/src/test/codegen/align-fn.rs b/tests/codegen/align-fn.rs index c5886cf28..c5886cf28 100644 --- a/src/test/codegen/align-fn.rs +++ b/tests/codegen/align-fn.rs diff --git a/src/test/codegen/align-struct.rs b/tests/codegen/align-struct.rs index a2f47354b..a2f47354b 100644 --- a/src/test/codegen/align-struct.rs +++ b/tests/codegen/align-struct.rs diff --git a/src/test/codegen/alloc-optimisation.rs b/tests/codegen/alloc-optimisation.rs index c3ffaeb95..c3ffaeb95 100644 --- a/src/test/codegen/alloc-optimisation.rs +++ b/tests/codegen/alloc-optimisation.rs diff --git a/src/test/codegen/array-clone.rs b/tests/codegen/array-clone.rs index 0d42963bc..0d42963bc 100644 --- a/src/test/codegen/array-clone.rs +++ b/tests/codegen/array-clone.rs diff --git a/src/test/codegen/array-equality.rs b/tests/codegen/array-equality.rs index cd5e82a92..cd5e82a92 100644 --- a/src/test/codegen/array-equality.rs +++ b/tests/codegen/array-equality.rs diff --git a/src/test/codegen/asm-clobber_abi.rs b/tests/codegen/asm-clobber_abi.rs index f70caea2f..f70caea2f 100644 --- a/src/test/codegen/asm-clobber_abi.rs +++ b/tests/codegen/asm-clobber_abi.rs diff --git a/src/test/codegen/asm-clobbers.rs b/tests/codegen/asm-clobbers.rs index 2ef10a283..2ef10a283 100644 --- a/src/test/codegen/asm-clobbers.rs +++ b/tests/codegen/asm-clobbers.rs diff --git a/src/test/codegen/asm-may_unwind.rs b/tests/codegen/asm-may_unwind.rs index c97933035..c97933035 100644 --- a/src/test/codegen/asm-may_unwind.rs +++ b/tests/codegen/asm-may_unwind.rs diff --git a/src/test/codegen/asm-multiple-options.rs b/tests/codegen/asm-multiple-options.rs index 1ae37d627..1ae37d627 100644 --- a/src/test/codegen/asm-multiple-options.rs +++ b/tests/codegen/asm-multiple-options.rs diff --git a/src/test/codegen/asm-options.rs b/tests/codegen/asm-options.rs index 963b60cfe..963b60cfe 100644 --- a/src/test/codegen/asm-options.rs +++ b/tests/codegen/asm-options.rs diff --git a/src/test/codegen/asm-powerpc-clobbers.rs b/tests/codegen/asm-powerpc-clobbers.rs index 10b20ba6b..10b20ba6b 100644 --- a/src/test/codegen/asm-powerpc-clobbers.rs +++ b/tests/codegen/asm-powerpc-clobbers.rs diff --git a/src/test/codegen/asm-sanitize-llvm.rs b/tests/codegen/asm-sanitize-llvm.rs index 6dcacd08c..6dcacd08c 100644 --- a/src/test/codegen/asm-sanitize-llvm.rs +++ b/tests/codegen/asm-sanitize-llvm.rs diff --git a/src/test/codegen/asm-target-clobbers.rs b/tests/codegen/asm-target-clobbers.rs index ac30e18ec..ac30e18ec 100644 --- a/src/test/codegen/asm-target-clobbers.rs +++ b/tests/codegen/asm-target-clobbers.rs diff --git a/src/test/codegen/async-fn-debug-awaitee-field.rs b/tests/codegen/async-fn-debug-awaitee-field.rs index bc2686158..bc2686158 100644 --- a/src/test/codegen/async-fn-debug-awaitee-field.rs +++ b/tests/codegen/async-fn-debug-awaitee-field.rs diff --git a/src/test/codegen/async-fn-debug-msvc.rs b/tests/codegen/async-fn-debug-msvc.rs index 73c652c9d..73c652c9d 100644 --- a/src/test/codegen/async-fn-debug-msvc.rs +++ b/tests/codegen/async-fn-debug-msvc.rs diff --git a/src/test/codegen/async-fn-debug.rs b/tests/codegen/async-fn-debug.rs index 9f6058a71..9f6058a71 100644 --- a/src/test/codegen/async-fn-debug.rs +++ b/tests/codegen/async-fn-debug.rs diff --git a/src/test/codegen/atomic-operations.rs b/tests/codegen/atomic-operations.rs index d2bc618df..d2bc618df 100644 --- a/src/test/codegen/atomic-operations.rs +++ b/tests/codegen/atomic-operations.rs diff --git a/src/test/codegen/autovectorize-f32x4.rs b/tests/codegen/autovectorize-f32x4.rs index 6b09c8fc9..6b09c8fc9 100644 --- a/src/test/codegen/autovectorize-f32x4.rs +++ b/tests/codegen/autovectorize-f32x4.rs diff --git a/src/test/codegen/auxiliary/extern_decl.rs b/tests/codegen/auxiliary/extern_decl.rs index edc483518..edc483518 100644 --- a/src/test/codegen/auxiliary/extern_decl.rs +++ b/tests/codegen/auxiliary/extern_decl.rs diff --git a/src/test/codegen/auxiliary/nounwind.rs b/tests/codegen/auxiliary/nounwind.rs index 73c5aee33..73c5aee33 100644 --- a/src/test/codegen/auxiliary/nounwind.rs +++ b/tests/codegen/auxiliary/nounwind.rs diff --git a/src/test/codegen/auxiliary/static_dllimport_aux.rs b/tests/codegen/auxiliary/static_dllimport_aux.rs index afb0dc42f..afb0dc42f 100644 --- a/src/test/codegen/auxiliary/static_dllimport_aux.rs +++ b/tests/codegen/auxiliary/static_dllimport_aux.rs diff --git a/src/test/codegen/auxiliary/thread_local_aux.rs b/tests/codegen/auxiliary/thread_local_aux.rs index bebaa7754..bebaa7754 100644 --- a/src/test/codegen/auxiliary/thread_local_aux.rs +++ b/tests/codegen/auxiliary/thread_local_aux.rs diff --git a/tests/codegen/avr/avr-func-addrspace.rs b/tests/codegen/avr/avr-func-addrspace.rs new file mode 100644 index 000000000..e9740e30d --- /dev/null +++ b/tests/codegen/avr/avr-func-addrspace.rs @@ -0,0 +1,111 @@ +// compile-flags: -O --target=avr-unknown-gnu-atmega328 --crate-type=rlib +// needs-llvm-components: avr + +// This test validates that function pointers can be stored in global variables +// and called upon. It ensures that Rust emits function pointers in the correct +// address space to LLVM so that an assertion error relating to casting is +// not triggered. +// +// It also validates that functions can be called through function pointers +// through traits. + +#![feature(no_core, lang_items, intrinsics, unboxed_closures, arbitrary_self_types)] +#![crate_type = "lib"] +#![no_core] + +#[lang = "sized"] +pub trait Sized { } +#[lang = "copy"] +pub trait Copy { } +#[lang = "receiver"] +pub trait Receiver { } +#[lang = "tuple_trait"] +pub trait Tuple { } + +pub struct Result<T, E> { _a: T, _b: E } + +impl Copy for usize {} +impl Copy for &usize {} + +#[lang = "drop_in_place"] +pub unsafe fn drop_in_place<T: ?Sized>(_: *mut T) {} + +#[lang = "fn_once"] +pub trait FnOnce<Args: Tuple> { + #[lang = "fn_once_output"] + type Output; + + extern "rust-call" fn call_once(self, args: Args) -> Self::Output; +} + +#[lang = "fn_mut"] +pub trait FnMut<Args: Tuple> : FnOnce<Args> { + extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output; +} + +#[lang = "fn"] +pub trait Fn<Args: Tuple>: FnOnce<Args> { + /// Performs the call operation. + extern "rust-call" fn call(&self, args: Args) -> Self::Output; +} + +extern "rust-intrinsic" { + pub fn transmute<Src, Dst>(src: Src) -> Dst; +} + +pub static mut STORAGE_FOO: fn(&usize, &mut u32) -> Result<(), ()> = arbitrary_black_box; +pub static mut STORAGE_BAR: u32 = 12; + +fn arbitrary_black_box(ptr: &usize, _: &mut u32) -> Result<(), ()> { + let raw_ptr = ptr as *const usize; + let _v: usize = unsafe { *raw_ptr }; + loop {} +} + +#[inline(never)] +#[no_mangle] +fn call_through_fn_trait(a: &mut impl Fn<(), Output=()>) { + (*a)() +} + +#[inline(never)] +fn update_bar_value() { + unsafe { + STORAGE_BAR = 88; + } +} + +// CHECK: define dso_local void @test(){{.+}}addrspace(1) +#[no_mangle] +pub extern "C" fn test() { + let mut buf = 7; + + // A call through the Fn trait must use address space 1. + // + // CHECK: call{{.+}}addrspace(1) void @call_through_fn_trait() + call_through_fn_trait(&mut update_bar_value); + + // A call through a global variable must use address space 1. + // CHECK: load {{.*}}addrspace(1){{.+}}FOO + unsafe { + STORAGE_FOO(&1, &mut buf); + } +} + +// Validate that we can codegen transmutes between data ptrs and fn ptrs. + +// CHECK: define{{.+}}{{void \(\) addrspace\(1\)\*|ptr addrspace\(1\)}} @transmute_data_ptr_to_fn({{\{\}\*|ptr}}{{.*}} %x) +#[no_mangle] +pub unsafe fn transmute_data_ptr_to_fn(x: *const ()) -> fn() { + // It doesn't matter precisely how this is codegenned (through memory or an addrspacecast), + // as long as it doesn't cause a verifier error by using `bitcast`. + transmute(x) +} + +// CHECK: define{{.+}}{{\{\}\*|ptr}} @transmute_fn_ptr_to_data({{void \(\) addrspace\(1\)\*|ptr addrspace\(1\)}}{{.*}} %x) +#[no_mangle] +pub unsafe fn transmute_fn_ptr_to_data(x: fn()) -> *const () { + // It doesn't matter precisely how this is codegenned (through memory or an addrspacecast), + // as long as it doesn't cause a verifier error by using `bitcast`. + transmute(x) +} diff --git a/src/test/codegen/binary-search-index-no-bound-check.rs b/tests/codegen/binary-search-index-no-bound-check.rs index c1766a4a4..c1766a4a4 100644 --- a/src/test/codegen/binary-search-index-no-bound-check.rs +++ b/tests/codegen/binary-search-index-no-bound-check.rs diff --git a/src/test/codegen/bool-cmp.rs b/tests/codegen/bool-cmp.rs index 5090f7c37..5090f7c37 100644 --- a/src/test/codegen/bool-cmp.rs +++ b/tests/codegen/bool-cmp.rs diff --git a/tests/codegen/box-maybe-uninit-llvm14.rs b/tests/codegen/box-maybe-uninit-llvm14.rs new file mode 100644 index 000000000..b0c88f76c --- /dev/null +++ b/tests/codegen/box-maybe-uninit-llvm14.rs @@ -0,0 +1,34 @@ +// compile-flags: -O + +// Once we're done with llvm 14 and earlier, this test can be deleted. + +#![crate_type = "lib"] + +use std::mem::MaybeUninit; + +// Boxing a `MaybeUninit` value should not copy junk from the stack +#[no_mangle] +pub fn box_uninitialized() -> Box<MaybeUninit<usize>> { + // CHECK-LABEL: @box_uninitialized + // CHECK-NOT: store + // CHECK-NOT: alloca + // CHECK-NOT: memcpy + // CHECK-NOT: memset + Box::new(MaybeUninit::uninit()) +} + +// https://github.com/rust-lang/rust/issues/58201 +#[no_mangle] +pub fn box_uninitialized2() -> Box<MaybeUninit<[usize; 1024 * 1024]>> { + // CHECK-LABEL: @box_uninitialized2 + // CHECK-NOT: store + // CHECK-NOT: alloca + // CHECK-NOT: memcpy + // CHECK-NOT: memset + Box::new(MaybeUninit::uninit()) +} + +// Hide the LLVM 15+ `allocalign` attribute in the declaration of __rust_alloc +// from the CHECK-NOT above. We don't check the attributes here because we can't rely +// on all of them being set until LLVM 15. +// CHECK: declare noalias{{.*}} @__rust_alloc(i{{[0-9]+}} noundef, i{{[0-9]+.*}} noundef) diff --git a/tests/codegen/box-maybe-uninit.rs b/tests/codegen/box-maybe-uninit.rs new file mode 100644 index 000000000..2f8896699 --- /dev/null +++ b/tests/codegen/box-maybe-uninit.rs @@ -0,0 +1,33 @@ +// compile-flags: -O +// min-llvm-version: 15.0 +#![crate_type = "lib"] + +use std::mem::MaybeUninit; + +// Boxing a `MaybeUninit` value should not copy junk from the stack +#[no_mangle] +pub fn box_uninitialized() -> Box<MaybeUninit<usize>> { + // CHECK-LABEL: @box_uninitialized + // CHECK-NOT: store + // CHECK-NOT: alloca + // CHECK-NOT: memcpy + // CHECK-NOT: memset + Box::new(MaybeUninit::uninit()) +} + +// https://github.com/rust-lang/rust/issues/58201 +#[no_mangle] +pub fn box_uninitialized2() -> Box<MaybeUninit<[usize; 1024 * 1024]>> { + // CHECK-LABEL: @box_uninitialized2 + // CHECK-NOT: store + // CHECK-NOT: alloca + // CHECK-NOT: memcpy + // CHECK-NOT: memset + Box::new(MaybeUninit::uninit()) +} + +// Hide the `allocalign` attribute in the declaration of __rust_alloc +// from the CHECK-NOT above, and also verify the attributes got set reasonably. +// CHECK: declare noalias noundef ptr @__rust_alloc(i{{[0-9]+}} noundef, i{{[0-9]+}} allocalign noundef) unnamed_addr [[RUST_ALLOC_ATTRS:#[0-9]+]] + +// CHECK-DAG: attributes [[RUST_ALLOC_ATTRS]] = { {{.*}} allockind("alloc,uninitialized,aligned") allocsize(0) uwtable "alloc-family"="__rust_alloc" {{.*}} } diff --git a/src/test/codegen/bpf-alu32.rs b/tests/codegen/bpf-alu32.rs index c68bffd03..c68bffd03 100644 --- a/src/test/codegen/bpf-alu32.rs +++ b/tests/codegen/bpf-alu32.rs diff --git a/src/test/codegen/branch-protection.rs b/tests/codegen/branch-protection.rs index 994c71b26..994c71b26 100644 --- a/src/test/codegen/branch-protection.rs +++ b/tests/codegen/branch-protection.rs diff --git a/src/test/codegen/c-variadic-copy.rs b/tests/codegen/c-variadic-copy.rs index 4c61c4fcf..4c61c4fcf 100644 --- a/src/test/codegen/c-variadic-copy.rs +++ b/tests/codegen/c-variadic-copy.rs diff --git a/src/test/codegen/c-variadic-opt.rs b/tests/codegen/c-variadic-opt.rs index 969dce80f..969dce80f 100644 --- a/src/test/codegen/c-variadic-opt.rs +++ b/tests/codegen/c-variadic-opt.rs diff --git a/src/test/codegen/c-variadic.rs b/tests/codegen/c-variadic.rs index a5be56c47..cab326522 100644 --- a/src/test/codegen/c-variadic.rs +++ b/tests/codegen/c-variadic.rs @@ -1,5 +1,5 @@ // ignore-wasm32-bare compiled with panic=abort by default -// compile-flags: -C no-prepopulate-passes +// compile-flags: -C no-prepopulate-passes -Copt-level=0 // #![crate_type = "lib"] diff --git a/src/test/codegen/call-llvm-intrinsics.rs b/tests/codegen/call-llvm-intrinsics.rs index 998099c23..cb8abae19 100644 --- a/src/test/codegen/call-llvm-intrinsics.rs +++ b/tests/codegen/call-llvm-intrinsics.rs @@ -1,4 +1,4 @@ -// compile-flags: -C no-prepopulate-passes +// compile-flags: -C no-prepopulate-passes -Copt-level=0 // ignore-riscv64 diff --git a/src/test/codegen/call-metadata.rs b/tests/codegen/call-metadata.rs index 1c30c08d3..1c30c08d3 100644 --- a/src/test/codegen/call-metadata.rs +++ b/tests/codegen/call-metadata.rs diff --git a/src/test/codegen/catch-unwind.rs b/tests/codegen/catch-unwind.rs index 3ea3a24bf..b90ef104c 100644 --- a/src/test/codegen/catch-unwind.rs +++ b/tests/codegen/catch-unwind.rs @@ -8,6 +8,8 @@ // On riscv the closure is another function, placed before fn foo so CHECK can't // find it // ignore-riscv64 FIXME +// On s390x the closure is also in another function +// ignore-s390x FIXME #![crate_type = "lib"] #![feature(c_unwind)] diff --git a/src/test/codegen/cdylib-external-inline-fns.rs b/tests/codegen/cdylib-external-inline-fns.rs index 9118afd43..9118afd43 100644 --- a/src/test/codegen/cdylib-external-inline-fns.rs +++ b/tests/codegen/cdylib-external-inline-fns.rs diff --git a/src/test/codegen/cf-protection.rs b/tests/codegen/cf-protection.rs index ccbc863f5..ccbc863f5 100644 --- a/src/test/codegen/cf-protection.rs +++ b/tests/codegen/cf-protection.rs diff --git a/src/test/codegen/cfguard-checks.rs b/tests/codegen/cfguard-checks.rs index 571a2654b..571a2654b 100644 --- a/src/test/codegen/cfguard-checks.rs +++ b/tests/codegen/cfguard-checks.rs diff --git a/src/test/codegen/cfguard-disabled.rs b/tests/codegen/cfguard-disabled.rs index c3f8f4116..c3f8f4116 100644 --- a/src/test/codegen/cfguard-disabled.rs +++ b/tests/codegen/cfguard-disabled.rs diff --git a/src/test/codegen/cfguard-nochecks.rs b/tests/codegen/cfguard-nochecks.rs index 3847c3e81..3847c3e81 100644 --- a/src/test/codegen/cfguard-nochecks.rs +++ b/tests/codegen/cfguard-nochecks.rs diff --git a/src/test/codegen/cfguard-non-msvc.rs b/tests/codegen/cfguard-non-msvc.rs index 6278a951e..6278a951e 100644 --- a/src/test/codegen/cfguard-non-msvc.rs +++ b/tests/codegen/cfguard-non-msvc.rs diff --git a/src/test/codegen/codemodels.rs b/tests/codegen/codemodels.rs index 2328f5feb..2328f5feb 100644 --- a/src/test/codegen/codemodels.rs +++ b/tests/codegen/codemodels.rs diff --git a/src/test/codegen/coercions.rs b/tests/codegen/coercions.rs index d645ca6b1..d645ca6b1 100644 --- a/src/test/codegen/coercions.rs +++ b/tests/codegen/coercions.rs diff --git a/src/test/codegen/cold-call-declare-and-call.rs b/tests/codegen/cold-call-declare-and-call.rs index 71d49478b..71d49478b 100644 --- a/src/test/codegen/cold-call-declare-and-call.rs +++ b/tests/codegen/cold-call-declare-and-call.rs diff --git a/tests/codegen/comparison-operators-newtype.rs b/tests/codegen/comparison-operators-newtype.rs new file mode 100644 index 000000000..683a2bd4f --- /dev/null +++ b/tests/codegen/comparison-operators-newtype.rs @@ -0,0 +1,49 @@ +// The `derive(PartialOrd)` for a newtype doesn't override `lt`/`le`/`gt`/`ge`. +// This double-checks that the `Option<Ordering>` intermediate values used +// in the operators for such a type all optimize away. + +// compile-flags: -C opt-level=1 +// min-llvm-version: 15.0 + +#![crate_type = "lib"] + +use std::cmp::Ordering; + +#[derive(PartialOrd, PartialEq)] +pub struct Foo(u16); + +// CHECK-LABEL: @check_lt +// CHECK-SAME: (i16 noundef %[[A:.+]], i16 noundef %[[B:.+]]) +#[no_mangle] +pub fn check_lt(a: Foo, b: Foo) -> bool { + // CHECK: %[[R:.+]] = icmp ult i16 %[[A]], %[[B]] + // CHECK-NEXT: ret i1 %[[R]] + a < b +} + +// CHECK-LABEL: @check_le +// CHECK-SAME: (i16 noundef %[[A:.+]], i16 noundef %[[B:.+]]) +#[no_mangle] +pub fn check_le(a: Foo, b: Foo) -> bool { + // CHECK: %[[R:.+]] = icmp ule i16 %[[A]], %[[B]] + // CHECK-NEXT: ret i1 %[[R]] + a <= b +} + +// CHECK-LABEL: @check_gt +// CHECK-SAME: (i16 noundef %[[A:.+]], i16 noundef %[[B:.+]]) +#[no_mangle] +pub fn check_gt(a: Foo, b: Foo) -> bool { + // CHECK: %[[R:.+]] = icmp ugt i16 %[[A]], %[[B]] + // CHECK-NEXT: ret i1 %[[R]] + a > b +} + +// CHECK-LABEL: @check_ge +// CHECK-SAME: (i16 noundef %[[A:.+]], i16 noundef %[[B:.+]]) +#[no_mangle] +pub fn check_ge(a: Foo, b: Foo) -> bool { + // CHECK: %[[R:.+]] = icmp uge i16 %[[A]], %[[B]] + // CHECK-NEXT: ret i1 %[[R]] + a >= b +} diff --git a/src/test/codegen/consts.rs b/tests/codegen/consts.rs index 260d9de86..260d9de86 100644 --- a/src/test/codegen/consts.rs +++ b/tests/codegen/consts.rs diff --git a/src/test/codegen/dealloc-no-unwind.rs b/tests/codegen/dealloc-no-unwind.rs index 3812ef44f..3812ef44f 100644 --- a/src/test/codegen/dealloc-no-unwind.rs +++ b/tests/codegen/dealloc-no-unwind.rs diff --git a/src/test/codegen/debug-alignment.rs b/tests/codegen/debug-alignment.rs index f6c1062e0..f6c1062e0 100644 --- a/src/test/codegen/debug-alignment.rs +++ b/tests/codegen/debug-alignment.rs diff --git a/src/test/codegen/debug-column-msvc.rs b/tests/codegen/debug-column-msvc.rs index aad8b372a..aad8b372a 100644 --- a/src/test/codegen/debug-column-msvc.rs +++ b/tests/codegen/debug-column-msvc.rs diff --git a/src/test/codegen/debug-column.rs b/tests/codegen/debug-column.rs index e61642b8e..e61642b8e 100644 --- a/src/test/codegen/debug-column.rs +++ b/tests/codegen/debug-column.rs diff --git a/src/test/codegen/debug-compile-unit-path.rs b/tests/codegen/debug-compile-unit-path.rs index 3661be046..3661be046 100644 --- a/src/test/codegen/debug-compile-unit-path.rs +++ b/tests/codegen/debug-compile-unit-path.rs diff --git a/src/test/codegen/debug-linkage-name.rs b/tests/codegen/debug-linkage-name.rs index 9011a7da5..9011a7da5 100644 --- a/src/test/codegen/debug-linkage-name.rs +++ b/tests/codegen/debug-linkage-name.rs diff --git a/src/test/codegen/debug-vtable.rs b/tests/codegen/debug-vtable.rs index bdd312878..bdd312878 100644 --- a/src/test/codegen/debug-vtable.rs +++ b/tests/codegen/debug-vtable.rs diff --git a/src/test/codegen/debuginfo-generic-closure-env-names.rs b/tests/codegen/debuginfo-generic-closure-env-names.rs index b29f8b4a0..b29f8b4a0 100644 --- a/src/test/codegen/debuginfo-generic-closure-env-names.rs +++ b/tests/codegen/debuginfo-generic-closure-env-names.rs diff --git a/src/test/codegen/deduced-param-attrs.rs b/tests/codegen/deduced-param-attrs.rs index 153046eef..153046eef 100644 --- a/src/test/codegen/deduced-param-attrs.rs +++ b/tests/codegen/deduced-param-attrs.rs diff --git a/src/test/codegen/default-requires-uwtable.rs b/tests/codegen/default-requires-uwtable.rs index 5d77d3f14..5d77d3f14 100644 --- a/src/test/codegen/default-requires-uwtable.rs +++ b/tests/codegen/default-requires-uwtable.rs diff --git a/src/test/codegen/dllimports/auxiliary/dummy.rs b/tests/codegen/dllimports/auxiliary/dummy.rs index 113a164f1..113a164f1 100644 --- a/src/test/codegen/dllimports/auxiliary/dummy.rs +++ b/tests/codegen/dllimports/auxiliary/dummy.rs diff --git a/src/test/codegen/dllimports/auxiliary/wrapper.rs b/tests/codegen/dllimports/auxiliary/wrapper.rs index 7aa90920a..7aa90920a 100644 --- a/src/test/codegen/dllimports/auxiliary/wrapper.rs +++ b/tests/codegen/dllimports/auxiliary/wrapper.rs diff --git a/tests/codegen/dllimports/main.rs b/tests/codegen/dllimports/main.rs new file mode 100644 index 000000000..383940e95 --- /dev/null +++ b/tests/codegen/dllimports/main.rs @@ -0,0 +1,43 @@ + // This test is for *-windows-msvc only. +// only-windows +// ignore-gnu + +// aux-build:dummy.rs +// aux-build:wrapper.rs + +extern crate wrapper; + +// Check that external symbols coming from foreign dylibs are adorned with 'dllimport', +// whereas symbols coming from foreign staticlibs are not. (RFC-1717) + +// CHECK: @dylib_global1 = external dllimport local_unnamed_addr global i32 +// CHECK: @dylib_global2 = external dllimport local_unnamed_addr global i32 +// CHECK: @static_global1 = external local_unnamed_addr global i32 +// CHECK: @static_global2 = external local_unnamed_addr global i32 + +// CHECK: declare dllimport noundef i32 @dylib_func1(i32 noundef) +// CHECK: declare dllimport noundef i32 @dylib_func2(i32 noundef) +// CHECK: declare noundef i32 @static_func1(i32 noundef) +// CHECK: declare noundef i32 @static_func2(i32 noundef) + +#[link(name = "dummy", kind="dylib")] +extern "C" { + pub fn dylib_func1(x: i32) -> i32; + pub static dylib_global1: i32; +} + +#[link(name = "dummy", kind="static")] +extern "C" { + pub fn static_func1(x: i32) -> i32; + pub static static_global1: i32; +} + +fn main() { + unsafe { + dylib_func1(dylib_global1); + wrapper::dylib_func2(wrapper::dylib_global2); + + static_func1(static_global1); + wrapper::static_func2(wrapper::static_global2); + } +} diff --git a/src/test/codegen/drop.rs b/tests/codegen/drop.rs index 994028271..994028271 100644 --- a/src/test/codegen/drop.rs +++ b/tests/codegen/drop.rs diff --git a/tests/codegen/dst-vtable-align-nonzero.rs b/tests/codegen/dst-vtable-align-nonzero.rs new file mode 100644 index 000000000..54f6e7f99 --- /dev/null +++ b/tests/codegen/dst-vtable-align-nonzero.rs @@ -0,0 +1,61 @@ +// compile-flags: -O -Z merge-functions=disabled + +#![crate_type = "lib"] +#![feature(core_intrinsics)] + +// This test checks that we annotate alignment loads from vtables with nonzero range metadata, +// and that this allows LLVM to eliminate redundant `align >= 1` checks. + +pub trait Trait { + fn f(&self); +} + +pub struct WrapperWithAlign1<T: ?Sized> { x: u8, y: T } + +pub struct WrapperWithAlign2<T: ?Sized> { x: u16, y: T } + +pub struct Struct<W: ?Sized> { + _field: i8, + dst: W, +} + +// CHECK-LABEL: @eliminates_runtime_check_when_align_1 +#[no_mangle] +pub fn eliminates_runtime_check_when_align_1( + x: &Struct<WrapperWithAlign1<dyn Trait>> +) -> &WrapperWithAlign1<dyn Trait> { + // CHECK: load [[USIZE:i[0-9]+]], {{.+}} !range [[RANGE_META:![0-9]+]] + // CHECK-NOT: llvm.umax + // CHECK-NOT: icmp + // CHECK-NOT: select + // CHECK: ret + &x.dst +} + +// CHECK-LABEL: @does_not_eliminate_runtime_check_when_align_2 +#[no_mangle] +pub fn does_not_eliminate_runtime_check_when_align_2( + x: &Struct<WrapperWithAlign2<dyn Trait>> +) -> &WrapperWithAlign2<dyn Trait> { + // CHECK: [[X0:%[0-9]+]] = load [[USIZE]], {{.+}} !range [[RANGE_META]] + // CHECK: {{icmp|llvm.umax}} + // CHECK: ret + &x.dst +} + +// CHECK-LABEL: @align_load_from_align_of_val +#[no_mangle] +pub fn align_load_from_align_of_val(x: &dyn Trait) -> usize { + // CHECK: {{%[0-9]+}} = load [[USIZE]], {{.+}} !range [[RANGE_META]] + core::mem::align_of_val(x) +} + +// CHECK-LABEL: @align_load_from_vtable_align_intrinsic +#[no_mangle] +pub unsafe fn align_load_from_vtable_align_intrinsic(x: &dyn Trait) -> usize { + let (data, vtable): (*const (), *const ()) = core::mem::transmute(x); + // CHECK: {{%[0-9]+}} = load [[USIZE]], {{.+}} !range [[RANGE_META]] + core::intrinsics::vtable_align(vtable) +} + +// CHECK: [[RANGE_META]] = !{[[USIZE]] 1, [[USIZE]] 0} diff --git a/tests/codegen/dst-vtable-size-range.rs b/tests/codegen/dst-vtable-size-range.rs new file mode 100644 index 000000000..671c8abde --- /dev/null +++ b/tests/codegen/dst-vtable-size-range.rs @@ -0,0 +1,35 @@ +// compile-flags: -O -Z merge-functions=disabled + +#![crate_type = "lib"] +#![feature(core_intrinsics)] + +// Check that we annotate size loads from vtables with 0..(isize::MAX + 1) range metadata. + +pub trait Trait { + fn f(&self); +} + +// Note that rustc uses inclusive bounds, but LLVM uses exclusive bounds for range metadata. +// CHECK-LABEL: @generate_exclusive_bound +#[no_mangle] +pub fn generate_exclusive_bound() -> usize { + // CHECK: ret [[USIZE:i[0-9]+]] [[EXCLUSIVE_BOUND:[-0-9]+]] + isize::MAX as usize + 1 +} + +// CHECK-LABEL: @size_load_from_size_of_val +#[no_mangle] +pub fn size_load_from_size_of_val(x: &dyn Trait) -> usize { + // CHECK: {{%[0-9]+}} = load [[USIZE]], {{.+}} !range [[RANGE_META:![0-9]+]] + core::mem::size_of_val(x) +} + +// CHECK-LABEL: @size_load_from_vtable_size_intrinsic +#[no_mangle] +pub unsafe fn size_load_from_vtable_size_intrinsic(x: &dyn Trait) -> usize { + let (data, vtable): (*const (), *const ()) = core::mem::transmute(x); + // CHECK: {{%[0-9]+}} = load [[USIZE]], {{.+}} !range [[RANGE_META]] + core::intrinsics::vtable_size(vtable) +} + +// CHECK: [[RANGE_META]] = !{[[USIZE]] 0, [[USIZE]] [[EXCLUSIVE_BOUND]]} diff --git a/src/test/codegen/enum-bounds-check-derived-idx.rs b/tests/codegen/enum-bounds-check-derived-idx.rs index aa66c2ed0..aa66c2ed0 100644 --- a/src/test/codegen/enum-bounds-check-derived-idx.rs +++ b/tests/codegen/enum-bounds-check-derived-idx.rs diff --git a/src/test/codegen/enum-bounds-check-issue-13926.rs b/tests/codegen/enum-bounds-check-issue-13926.rs index b26945bc5..b26945bc5 100644 --- a/src/test/codegen/enum-bounds-check-issue-13926.rs +++ b/tests/codegen/enum-bounds-check-issue-13926.rs diff --git a/src/test/codegen/enum-bounds-check-issue-82871.rs b/tests/codegen/enum-bounds-check-issue-82871.rs index 32fdc4a5f..32fdc4a5f 100644 --- a/src/test/codegen/enum-bounds-check-issue-82871.rs +++ b/tests/codegen/enum-bounds-check-issue-82871.rs diff --git a/src/test/codegen/enum-bounds-check.rs b/tests/codegen/enum-bounds-check.rs index 17322d591..17322d591 100644 --- a/src/test/codegen/enum-bounds-check.rs +++ b/tests/codegen/enum-bounds-check.rs diff --git a/src/test/codegen/enum-debug-clike.rs b/tests/codegen/enum-debug-clike.rs index 1e369a2c4..1e369a2c4 100644 --- a/src/test/codegen/enum-debug-clike.rs +++ b/tests/codegen/enum-debug-clike.rs diff --git a/src/test/codegen/enum-debug-niche-2.rs b/tests/codegen/enum-debug-niche-2.rs index 9c72ad9d2..9c72ad9d2 100644 --- a/src/test/codegen/enum-debug-niche-2.rs +++ b/tests/codegen/enum-debug-niche-2.rs diff --git a/src/test/codegen/enum-debug-niche.rs b/tests/codegen/enum-debug-niche.rs index b718a6854..b718a6854 100644 --- a/src/test/codegen/enum-debug-niche.rs +++ b/tests/codegen/enum-debug-niche.rs diff --git a/src/test/codegen/enum-debug-tagged.rs b/tests/codegen/enum-debug-tagged.rs index 095c49ac3..095c49ac3 100644 --- a/src/test/codegen/enum-debug-tagged.rs +++ b/tests/codegen/enum-debug-tagged.rs diff --git a/src/test/codegen/enum-discriminant-value.rs b/tests/codegen/enum-discriminant-value.rs index cc14c2120..cc14c2120 100644 --- a/src/test/codegen/enum-discriminant-value.rs +++ b/tests/codegen/enum-discriminant-value.rs diff --git a/src/test/codegen/enum-match.rs b/tests/codegen/enum-match.rs index 44f1b408d..5f8063a27 100644 --- a/src/test/codegen/enum-match.rs +++ b/tests/codegen/enum-match.rs @@ -11,7 +11,7 @@ pub enum Enum0 { B, } -// CHECK: define i8 @match0{{.*}} +// CHECK: define noundef i8 @match0{{.*}} // CHECK-NEXT: start: // CHECK-NEXT: %1 = icmp eq i8 %0, 2 // CHECK-NEXT: %2 = and i8 %0, 1 @@ -32,10 +32,10 @@ pub enum Enum1 { C, } -// CHECK: define i8 @match1{{.*}} +// CHECK: define noundef i8 @match1{{.*}} // CHECK-NEXT: start: -// CHECK-NEXT: %1 = {{.*}}call i8 @llvm.usub.sat.i8(i8 %0, i8 1) -// CHECK-NEXT: switch i8 %1, label {{.*}} [ +// CHECK-NEXT: [[DISCR:%.*]] = {{.*}}call i8 @llvm.usub.sat.i8(i8 %0, i8 1) +// CHECK-NEXT: switch i8 [[DISCR]], label {{.*}} [ #[no_mangle] pub fn match1(e: Enum1) -> u8 { use Enum1::*; @@ -88,7 +88,7 @@ pub enum Enum2 { E, } -// CHECK: define i8 @match2{{.*}} +// CHECK: define noundef i8 @match2{{.*}} // CHECK-NEXT: start: // CHECK-NEXT: %1 = add i8 %0, 2 // CHECK-NEXT: %2 = zext i8 %1 to i64 diff --git a/src/test/codegen/export-no-mangle.rs b/tests/codegen/export-no-mangle.rs index a89d48ee1..a89d48ee1 100644 --- a/src/test/codegen/export-no-mangle.rs +++ b/tests/codegen/export-no-mangle.rs diff --git a/src/test/codegen/external-no-mangle-fns.rs b/tests/codegen/external-no-mangle-fns.rs index 70349b2ec..70349b2ec 100644 --- a/src/test/codegen/external-no-mangle-fns.rs +++ b/tests/codegen/external-no-mangle-fns.rs diff --git a/src/test/codegen/external-no-mangle-statics.rs b/tests/codegen/external-no-mangle-statics.rs index c6ecb7aa9..c6ecb7aa9 100644 --- a/src/test/codegen/external-no-mangle-statics.rs +++ b/tests/codegen/external-no-mangle-statics.rs diff --git a/tests/codegen/fastcall-inreg.rs b/tests/codegen/fastcall-inreg.rs new file mode 100644 index 000000000..02f5d5459 --- /dev/null +++ b/tests/codegen/fastcall-inreg.rs @@ -0,0 +1,41 @@ +// Checks if the "fastcall" calling convention marks function arguments +// as "inreg" like the C/C++ compilers for the platforms. +// x86 only. + +// compile-flags: --target i686-unknown-linux-gnu -O -C no-prepopulate-passes +// needs-llvm-components: x86 + +#![crate_type = "lib"] +#![no_core] +#![feature(no_core, lang_items)] + +#[lang = "sized"] +trait Sized {} +#[lang = "copy"] +trait Copy {} + +pub mod tests { + // CHECK: @f1(i32 inreg noundef %_1, i32 inreg noundef %_2, i32 noundef %_3) + #[no_mangle] + pub extern "fastcall" fn f1(_: i32, _: i32, _: i32) {} + + // CHECK: @f2({{i32\*|ptr}} inreg noundef %_1, {{i32\*|ptr}} inreg noundef %_2, {{i32\*|ptr}} noundef %_3) + #[no_mangle] + pub extern "fastcall" fn f2(_: *const i32, _: *const i32, _: *const i32) {} + + // CHECK: @f3(float noundef %_1, i32 inreg noundef %_2, i32 inreg noundef %_3, i32 noundef %_4) + #[no_mangle] + pub extern "fastcall" fn f3(_: f32, _: i32, _: i32, _: i32) {} + + // CHECK: @f4(i32 inreg noundef %_1, float noundef %_2, i32 inreg noundef %_3, i32 noundef %_4) + #[no_mangle] + pub extern "fastcall" fn f4(_: i32, _: f32, _: i32, _: i32) {} + + // CHECK: @f5(i64 noundef %_1, i32 noundef %_2) + #[no_mangle] + pub extern "fastcall" fn f5(_: i64, _: i32) {} + + // CHECK: @f6(i1 inreg noundef zeroext %_1, i32 inreg noundef %_2, i32 noundef %_3) + #[no_mangle] + pub extern "fastcall" fn f6(_: bool, _: i32, _: i32) {} +} diff --git a/src/test/codegen/fatptr.rs b/tests/codegen/fatptr.rs index 1c49b5714..1c49b5714 100644 --- a/src/test/codegen/fatptr.rs +++ b/tests/codegen/fatptr.rs diff --git a/src/test/codegen/fewer-names.rs b/tests/codegen/fewer-names.rs index 7307e0379..ac8cba06b 100644 --- a/src/test/codegen/fewer-names.rs +++ b/tests/codegen/fewer-names.rs @@ -7,11 +7,11 @@ #[no_mangle] pub fn sum(x: u32, y: u32) -> u32 { -// YES-LABEL: define{{.*}}i32 @sum(i32 %0, i32 %1) +// YES-LABEL: define{{.*}}i32 @sum(i32 noundef %0, i32 noundef %1) // YES-NEXT: %3 = add i32 %1, %0 // YES-NEXT: ret i32 %3 -// NO-LABEL: define{{.*}}i32 @sum(i32 %x, i32 %y) +// NO-LABEL: define{{.*}}i32 @sum(i32 noundef %x, i32 noundef %y) // NO-NEXT: start: // NO-NEXT: %z = add i32 %y, %x // NO-NEXT: ret i32 %z diff --git a/src/test/codegen/ffi-const.rs b/tests/codegen/ffi-const.rs index 937205034..937205034 100644 --- a/src/test/codegen/ffi-const.rs +++ b/tests/codegen/ffi-const.rs diff --git a/src/test/codegen/ffi-out-of-bounds-loads.rs b/tests/codegen/ffi-out-of-bounds-loads.rs index 099726b2f..099726b2f 100644 --- a/src/test/codegen/ffi-out-of-bounds-loads.rs +++ b/tests/codegen/ffi-out-of-bounds-loads.rs diff --git a/src/test/codegen/ffi-pure.rs b/tests/codegen/ffi-pure.rs index 2ed735813..2ed735813 100644 --- a/src/test/codegen/ffi-pure.rs +++ b/tests/codegen/ffi-pure.rs diff --git a/src/test/codegen/ffi-returns-twice.rs b/tests/codegen/ffi-returns-twice.rs index 0fbe03f0b..0fbe03f0b 100644 --- a/src/test/codegen/ffi-returns-twice.rs +++ b/tests/codegen/ffi-returns-twice.rs diff --git a/src/test/codegen/float_math.rs b/tests/codegen/float_math.rs index 592e09452..592e09452 100644 --- a/src/test/codegen/float_math.rs +++ b/tests/codegen/float_math.rs diff --git a/src/test/codegen/fn-impl-trait-self.rs b/tests/codegen/fn-impl-trait-self.rs index 0abc8a409..0abc8a409 100644 --- a/src/test/codegen/fn-impl-trait-self.rs +++ b/tests/codegen/fn-impl-trait-self.rs diff --git a/src/test/codegen/foo.s b/tests/codegen/foo.s index 304d82aa0..304d82aa0 100644 --- a/src/test/codegen/foo.s +++ b/tests/codegen/foo.s diff --git a/src/test/codegen/force-frame-pointers.rs b/tests/codegen/force-frame-pointers.rs index 637c42346..637c42346 100644 --- a/src/test/codegen/force-frame-pointers.rs +++ b/tests/codegen/force-frame-pointers.rs diff --git a/src/test/codegen/force-no-unwind-tables.rs b/tests/codegen/force-no-unwind-tables.rs index 3ee23f05e..3ee23f05e 100644 --- a/src/test/codegen/force-no-unwind-tables.rs +++ b/tests/codegen/force-no-unwind-tables.rs diff --git a/src/test/codegen/force-unwind-tables.rs b/tests/codegen/force-unwind-tables.rs index 4c0a5602c..4c0a5602c 100644 --- a/src/test/codegen/force-unwind-tables.rs +++ b/tests/codegen/force-unwind-tables.rs diff --git a/src/test/codegen/frame-pointer.rs b/tests/codegen/frame-pointer.rs index f7c02d479..d8933262e 100644 --- a/src/test/codegen/frame-pointer.rs +++ b/tests/codegen/frame-pointer.rs @@ -1,4 +1,4 @@ -// compile-flags: --crate-type=rlib +// compile-flags: --crate-type=rlib -Copt-level=0 // revisions: aarch64-apple aarch64-linux force x64-apple x64-linux // [aarch64-apple] needs-llvm-components: aarch64 // [aarch64-apple] compile-flags: --target=aarch64-apple-darwin diff --git a/src/test/codegen/function-arguments-noopt.rs b/tests/codegen/function-arguments-noopt.rs index ff76405a4..ff76405a4 100644 --- a/src/test/codegen/function-arguments-noopt.rs +++ b/tests/codegen/function-arguments-noopt.rs diff --git a/src/test/codegen/function-arguments.rs b/tests/codegen/function-arguments.rs index 44fee9523..1f979d7b9 100644 --- a/src/test/codegen/function-arguments.rs +++ b/tests/codegen/function-arguments.rs @@ -1,11 +1,11 @@ // compile-flags: -O -C no-prepopulate-passes #![crate_type = "lib"] -#![feature(rustc_attrs)] use std::mem::MaybeUninit; use std::num::NonZeroU64; use std::marker::PhantomPinned; +use std::ptr::NonNull; pub struct S { _field: [i32; 8], @@ -61,7 +61,7 @@ pub fn maybeuninit_char(x: MaybeUninit<char>) -> MaybeUninit<char> { x } -// CHECK: i64 @int(i64 %x) +// CHECK: noundef i64 @int(i64 noundef %x) #[no_mangle] pub fn int(x: u64) -> u64 { x @@ -73,7 +73,7 @@ pub fn nonzero_int(x: NonZeroU64) -> NonZeroU64 { x } -// CHECK: i64 @option_nonzero_int(i64 %x) +// CHECK: noundef i64 @option_nonzero_int(i64 noundef %x) #[no_mangle] pub fn option_nonzero_int(x: Option<NonZeroU64>) -> Option<NonZeroU64> { x @@ -138,14 +138,30 @@ pub fn indirect_struct(_: S) { pub fn borrowed_struct(_: &S) { } -// CHECK: @raw_struct({{%S\*|ptr}} %_1) +// CHECK: @option_borrow({{i32\*|ptr}} noalias noundef readonly align 4 dereferenceable_or_null(4) %x) +#[no_mangle] +pub fn option_borrow(x: Option<&i32>) { +} + +// CHECK: @option_borrow_mut({{i32\*|ptr}} noalias noundef align 4 dereferenceable_or_null(4) %x) +#[no_mangle] +pub fn option_borrow_mut(x: Option<&mut i32>) { +} + +// CHECK: @raw_struct({{%S\*|ptr}} noundef %_1) #[no_mangle] pub fn raw_struct(_: *const S) { } +// CHECK: @raw_option_nonnull_struct({{i32\*|ptr}} noundef %_1) +#[no_mangle] +pub fn raw_option_nonnull_struct(_: Option<NonNull<S>>) { +} + + // `Box` can get deallocated during execution of the function, so it should // not get `dereferenceable`. -// CHECK: noalias noundef nonnull align 4 {{i32\*|ptr}} @_box({{i32\*|ptr}} noalias noundef nonnull align 4 %x) +// CHECK: noundef nonnull align 4 {{i32\*|ptr}} @_box({{i32\*|ptr}} noalias noundef nonnull align 4 %x) #[no_mangle] pub fn _box(x: Box<i32>) -> Box<i32> { x @@ -160,35 +176,35 @@ pub fn struct_return() -> S { } // Hack to get the correct size for the length part in slices -// CHECK: @helper([[USIZE:i[0-9]+]] %_1) +// CHECK: @helper([[USIZE:i[0-9]+]] noundef %_1) #[no_mangle] pub fn helper(_: usize) { } -// CHECK: @slice({{\[0 x i8\]\*|ptr}} noalias noundef nonnull readonly align 1 %_1.0, [[USIZE]] %_1.1) +// CHECK: @slice({{\[0 x i8\]\*|ptr}} noalias noundef nonnull readonly align 1 %_1.0, [[USIZE]] noundef %_1.1) // FIXME #25759 This should also have `nocapture` #[no_mangle] pub fn slice(_: &[u8]) { } -// CHECK: @mutable_slice({{\[0 x i8\]\*|ptr}} noalias noundef nonnull align 1 %_1.0, [[USIZE]] %_1.1) +// CHECK: @mutable_slice({{\[0 x i8\]\*|ptr}} noalias noundef nonnull align 1 %_1.0, [[USIZE]] noundef %_1.1) // FIXME #25759 This should also have `nocapture` #[no_mangle] pub fn mutable_slice(_: &mut [u8]) { } -// CHECK: @unsafe_slice({{\[0 x i16\]\*|ptr}} noundef nonnull align 2 %_1.0, [[USIZE]] %_1.1) +// CHECK: @unsafe_slice({{\[0 x i16\]\*|ptr}} noundef nonnull align 2 %_1.0, [[USIZE]] noundef %_1.1) // unsafe interior means this isn't actually readonly and there may be aliases ... #[no_mangle] pub fn unsafe_slice(_: &[UnsafeInner]) { } -// CHECK: @raw_slice({{\[0 x i8\]\*|ptr}} %_1.0, [[USIZE]] %_1.1) +// CHECK: @raw_slice({{\[0 x i8\]\*|ptr}} noundef %_1.0, [[USIZE]] noundef %_1.1) #[no_mangle] pub fn raw_slice(_: *const [u8]) { } -// CHECK: @str({{\[0 x i8\]\*|ptr}} noalias noundef nonnull readonly align 1 %_1.0, [[USIZE]] %_1.1) +// CHECK: @str({{\[0 x i8\]\*|ptr}} noalias noundef nonnull readonly align 1 %_1.0, [[USIZE]] noundef %_1.1) // FIXME #25759 This should also have `nocapture` #[no_mangle] pub fn str(_: &[u8]) { @@ -197,26 +213,36 @@ pub fn str(_: &[u8]) { // CHECK: @trait_borrow({{\{\}\*|ptr}} noundef nonnull align 1 %_1.0, {{.+}} noalias noundef readonly align {{.*}} dereferenceable({{.*}}) %_1.1) // FIXME #25759 This should also have `nocapture` #[no_mangle] -pub fn trait_borrow(_: &Drop) { +pub fn trait_borrow(_: &dyn Drop) { +} + +// CHECK: @option_trait_borrow({{i8\*|ptr}} noundef align 1 %x.0, {{i8\*|ptr}} %x.1) +#[no_mangle] +pub fn option_trait_borrow(x: Option<&dyn Drop>) { +} + +// CHECK: @option_trait_borrow_mut({{i8\*|ptr}} noundef align 1 %x.0, {{i8\*|ptr}} %x.1) +#[no_mangle] +pub fn option_trait_borrow_mut(x: Option<&mut dyn Drop>) { } -// CHECK: @trait_raw({{\{\}\*|ptr}} %_1.0, {{.+}} noalias noundef readonly align {{.*}} dereferenceable({{.*}}) %_1.1) +// CHECK: @trait_raw({{\{\}\*|ptr}} noundef %_1.0, {{.+}} noalias noundef readonly align {{.*}} dereferenceable({{.*}}) %_1.1) #[no_mangle] -pub fn trait_raw(_: *const Drop) { +pub fn trait_raw(_: *const dyn Drop) { } // CHECK: @trait_box({{\{\}\*|ptr}} noalias noundef nonnull align 1{{( %0)?}}, {{.+}} noalias noundef readonly align {{.*}} dereferenceable({{.*}}){{( %1)?}}) #[no_mangle] -pub fn trait_box(_: Box<Drop>) { +pub fn trait_box(_: Box<dyn Drop>) { } // CHECK: { {{i8\*|ptr}}, {{i8\*|ptr}} } @trait_option({{i8\*|ptr}} noalias noundef align 1 %x.0, {{i8\*|ptr}} %x.1) #[no_mangle] -pub fn trait_option(x: Option<Box<Drop>>) -> Option<Box<Drop>> { +pub fn trait_option(x: Option<Box<dyn Drop>>) -> Option<Box<dyn Drop>> { x } -// CHECK: { {{\[0 x i16\]\*|ptr}}, [[USIZE]] } @return_slice({{\[0 x i16\]\*|ptr}} noalias noundef nonnull readonly align 2 %x.0, [[USIZE]] %x.1) +// CHECK: { {{\[0 x i16\]\*|ptr}}, [[USIZE]] } @return_slice({{\[0 x i16\]\*|ptr}} noalias noundef nonnull readonly align 2 %x.0, [[USIZE]] noundef %x.1) #[no_mangle] pub fn return_slice(x: &[u16]) -> &[u16] { x diff --git a/src/test/codegen/gdb_debug_script_load.rs b/tests/codegen/gdb_debug_script_load.rs index 002be8d1b..002be8d1b 100644 --- a/src/test/codegen/gdb_debug_script_load.rs +++ b/tests/codegen/gdb_debug_script_load.rs diff --git a/src/test/codegen/generator-debug-msvc.rs b/tests/codegen/generator-debug-msvc.rs index 9d70ccdef..9d70ccdef 100644 --- a/src/test/codegen/generator-debug-msvc.rs +++ b/tests/codegen/generator-debug-msvc.rs diff --git a/src/test/codegen/generator-debug.rs b/tests/codegen/generator-debug.rs index 3ec860f2c..3ec860f2c 100644 --- a/src/test/codegen/generator-debug.rs +++ b/tests/codegen/generator-debug.rs diff --git a/src/test/codegen/generic-debug.rs b/tests/codegen/generic-debug.rs index eea16805c..eea16805c 100644 --- a/src/test/codegen/generic-debug.rs +++ b/tests/codegen/generic-debug.rs diff --git a/src/test/codegen/global_asm.rs b/tests/codegen/global_asm.rs index fab84868f..fab84868f 100644 --- a/src/test/codegen/global_asm.rs +++ b/tests/codegen/global_asm.rs diff --git a/src/test/codegen/global_asm_include.rs b/tests/codegen/global_asm_include.rs index 02ee91645..02ee91645 100644 --- a/src/test/codegen/global_asm_include.rs +++ b/tests/codegen/global_asm_include.rs diff --git a/src/test/codegen/global_asm_x2.rs b/tests/codegen/global_asm_x2.rs index bdcf0ea84..bdcf0ea84 100644 --- a/src/test/codegen/global_asm_x2.rs +++ b/tests/codegen/global_asm_x2.rs diff --git a/src/test/codegen/i686-macosx-deployment-target.rs b/tests/codegen/i686-macosx-deployment-target.rs index 17258a264..17258a264 100644 --- a/src/test/codegen/i686-macosx-deployment-target.rs +++ b/tests/codegen/i686-macosx-deployment-target.rs diff --git a/src/test/codegen/i686-no-macosx-deployment-target.rs b/tests/codegen/i686-no-macosx-deployment-target.rs index 043040a95..043040a95 100644 --- a/src/test/codegen/i686-no-macosx-deployment-target.rs +++ b/tests/codegen/i686-no-macosx-deployment-target.rs diff --git a/src/test/codegen/inline-always-works-always.rs b/tests/codegen/inline-always-works-always.rs index 912af782a..912af782a 100644 --- a/src/test/codegen/inline-always-works-always.rs +++ b/tests/codegen/inline-always-works-always.rs diff --git a/src/test/codegen/inline-debuginfo.rs b/tests/codegen/inline-debuginfo.rs index 5b230361f..5b230361f 100644 --- a/src/test/codegen/inline-debuginfo.rs +++ b/tests/codegen/inline-debuginfo.rs diff --git a/src/test/codegen/inline-hint.rs b/tests/codegen/inline-hint.rs index d3ea1915a..d3ea1915a 100644 --- a/src/test/codegen/inline-hint.rs +++ b/tests/codegen/inline-hint.rs diff --git a/src/test/codegen/instrument-coverage.rs b/tests/codegen/instrument-coverage.rs index 78f8875a2..78f8875a2 100644 --- a/src/test/codegen/instrument-coverage.rs +++ b/tests/codegen/instrument-coverage.rs diff --git a/src/test/codegen/instrument-mcount.rs b/tests/codegen/instrument-mcount.rs index b26076e7a..b26076e7a 100644 --- a/src/test/codegen/instrument-mcount.rs +++ b/tests/codegen/instrument-mcount.rs diff --git a/src/test/codegen/integer-cmp.rs b/tests/codegen/integer-cmp.rs index 8ada3cf09..8ada3cf09 100644 --- a/src/test/codegen/integer-cmp.rs +++ b/tests/codegen/integer-cmp.rs diff --git a/src/test/codegen/integer-overflow.rs b/tests/codegen/integer-overflow.rs index 183de56db..183de56db 100644 --- a/src/test/codegen/integer-overflow.rs +++ b/tests/codegen/integer-overflow.rs diff --git a/src/test/codegen/internalize-closures.rs b/tests/codegen/internalize-closures.rs index ab3dc3fba..ab3dc3fba 100644 --- a/src/test/codegen/internalize-closures.rs +++ b/tests/codegen/internalize-closures.rs diff --git a/src/test/codegen/intrinsic-no-unnamed-attr.rs b/tests/codegen/intrinsic-no-unnamed-attr.rs index c8a8e0b3e..c8a8e0b3e 100644 --- a/src/test/codegen/intrinsic-no-unnamed-attr.rs +++ b/tests/codegen/intrinsic-no-unnamed-attr.rs diff --git a/src/test/codegen/intrinsics/const_eval_select.rs b/tests/codegen/intrinsics/const_eval_select.rs index db8a04763..f3877dc6b 100644 --- a/src/test/codegen/intrinsics/const_eval_select.rs +++ b/tests/codegen/intrinsics/const_eval_select.rs @@ -1,4 +1,4 @@ -// compile-flags: -C no-prepopulate-passes +// compile-flags: -C no-prepopulate-passes -Copt-level=0 #![crate_type = "lib"] #![feature(const_eval_select)] diff --git a/src/test/codegen/intrinsics/exact_div.rs b/tests/codegen/intrinsics/exact_div.rs index 68eaa3999..68eaa3999 100644 --- a/src/test/codegen/intrinsics/exact_div.rs +++ b/tests/codegen/intrinsics/exact_div.rs diff --git a/src/test/codegen/intrinsics/likely.rs b/tests/codegen/intrinsics/likely.rs index c5a0185bd..c5a0185bd 100644 --- a/src/test/codegen/intrinsics/likely.rs +++ b/tests/codegen/intrinsics/likely.rs diff --git a/src/test/codegen/intrinsics/mask.rs b/tests/codegen/intrinsics/mask.rs index 2e984db1b..8f93da2e5 100644 --- a/src/test/codegen/intrinsics/mask.rs +++ b/tests/codegen/intrinsics/mask.rs @@ -1,3 +1,4 @@ +// compile-flags: -Copt-level=0 #![crate_type = "lib"] #![feature(core_intrinsics)] @@ -6,6 +7,6 @@ #[no_mangle] pub fn mask_ptr(ptr: *const u16, mask: usize) -> *const u16 { // CHECK: call - // CHECK-SAME: @llvm.ptrmask.{{p0|p0i8}}.[[WORD]]({{ptr|i8\*}} {{%ptr|%0}}, [[WORD]] %mask) + // CHECK-SAME: @llvm.ptrmask.{{p0|p0i8}}.[[WORD]]({{ptr|i8\*}} {{%ptr|%1}}, [[WORD]] %mask) core::intrinsics::ptr_mask(ptr, mask) } diff --git a/src/test/codegen/intrinsics/nearby.rs b/tests/codegen/intrinsics/nearby.rs index 520fe2f18..520fe2f18 100644 --- a/src/test/codegen/intrinsics/nearby.rs +++ b/tests/codegen/intrinsics/nearby.rs diff --git a/src/test/codegen/intrinsics/nontemporal.rs b/tests/codegen/intrinsics/nontemporal.rs index d8ee29452..d8ee29452 100644 --- a/src/test/codegen/intrinsics/nontemporal.rs +++ b/tests/codegen/intrinsics/nontemporal.rs diff --git a/src/test/codegen/intrinsics/offset_from.rs b/tests/codegen/intrinsics/offset_from.rs index d0de4c835..d0de4c835 100644 --- a/src/test/codegen/intrinsics/offset_from.rs +++ b/tests/codegen/intrinsics/offset_from.rs diff --git a/src/test/codegen/intrinsics/prefetch.rs b/tests/codegen/intrinsics/prefetch.rs index 59d7fa638..59d7fa638 100644 --- a/src/test/codegen/intrinsics/prefetch.rs +++ b/tests/codegen/intrinsics/prefetch.rs diff --git a/src/test/codegen/intrinsics/unchecked_math.rs b/tests/codegen/intrinsics/unchecked_math.rs index 419c120ed..419c120ed 100644 --- a/src/test/codegen/intrinsics/unchecked_math.rs +++ b/tests/codegen/intrinsics/unchecked_math.rs diff --git a/src/test/codegen/intrinsics/volatile.rs b/tests/codegen/intrinsics/volatile.rs index 7980c00e7..7980c00e7 100644 --- a/src/test/codegen/intrinsics/volatile.rs +++ b/tests/codegen/intrinsics/volatile.rs diff --git a/src/test/codegen/intrinsics/volatile_order.rs b/tests/codegen/intrinsics/volatile_order.rs index 99469831a..99469831a 100644 --- a/src/test/codegen/intrinsics/volatile_order.rs +++ b/tests/codegen/intrinsics/volatile_order.rs diff --git a/src/test/codegen/issue-103285-ptr-addr-overflow-check.rs b/tests/codegen/issue-103285-ptr-addr-overflow-check.rs index a3499babe..a3499babe 100644 --- a/src/test/codegen/issue-103285-ptr-addr-overflow-check.rs +++ b/tests/codegen/issue-103285-ptr-addr-overflow-check.rs diff --git a/tests/codegen/issue-103840.rs b/tests/codegen/issue-103840.rs new file mode 100644 index 000000000..f19d7031b --- /dev/null +++ b/tests/codegen/issue-103840.rs @@ -0,0 +1,9 @@ +// compile-flags: -O +#![crate_type = "lib"] + +pub fn foo(t: &mut Vec<usize>) { + // CHECK-NOT: __rust_dealloc + let mut taken = std::mem::take(t); + taken.pop(); + *t = taken; +} diff --git a/tests/codegen/issue-105386-ub-in-debuginfo.rs b/tests/codegen/issue-105386-ub-in-debuginfo.rs new file mode 100644 index 000000000..d54ac9e33 --- /dev/null +++ b/tests/codegen/issue-105386-ub-in-debuginfo.rs @@ -0,0 +1,22 @@ +// compile-flags: --crate-type=lib -O -Cdebuginfo=2 -Cno-prepopulate-passes +// min-llvm-version: 15.0 # this test uses opaque pointer notation +#![feature(stmt_expr_attributes)] + +pub struct S([usize; 8]); + +#[no_mangle] +pub fn outer_function(x: S, y: S) -> usize { + (#[inline(always)]|| { + let _z = x; + y.0[0] + })() +} + +// Check that we do not attempt to load from the spilled arg before it is assigned to +// when generating debuginfo. +// CHECK-LABEL: @outer_function +// CHECK: [[spill:%.*]] = alloca %"[closure@{{.*.rs}}:9:23: 9:25]" +// CHECK-NOT: [[ptr_tmp:%.*]] = getelementptr inbounds %"[closure@{{.*.rs}}:9:23: 9:25]", ptr [[spill]] +// CHECK-NOT: [[load:%.*]] = load ptr, ptr +// CHECK: call void @llvm.lifetime.start{{.*}}({{.*}}, ptr [[spill]]) +// CHECK: call void @llvm.memcpy{{.*}}(ptr {{align .*}} [[spill]], ptr {{align .*}} %x diff --git a/src/test/codegen/issue-13018.rs b/tests/codegen/issue-13018.rs index b70ea1f48..b70ea1f48 100644 --- a/src/test/codegen/issue-13018.rs +++ b/tests/codegen/issue-13018.rs diff --git a/src/test/codegen/issue-15953.rs b/tests/codegen/issue-15953.rs index 28d284289..28d284289 100644 --- a/src/test/codegen/issue-15953.rs +++ b/tests/codegen/issue-15953.rs diff --git a/src/test/codegen/issue-27130.rs b/tests/codegen/issue-27130.rs index e5ee94e1f..e5ee94e1f 100644 --- a/src/test/codegen/issue-27130.rs +++ b/tests/codegen/issue-27130.rs diff --git a/src/test/codegen/issue-32031.rs b/tests/codegen/issue-32031.rs index 82ba32557..abef92c19 100644 --- a/src/test/codegen/issue-32031.rs +++ b/tests/codegen/issue-32031.rs @@ -1,4 +1,4 @@ -// compile-flags: -C no-prepopulate-passes +// compile-flags: -C no-prepopulate-passes -Copt-level=0 #![crate_type = "lib"] diff --git a/src/test/codegen/issue-32364.rs b/tests/codegen/issue-32364.rs index 85493a4bb..85493a4bb 100644 --- a/src/test/codegen/issue-32364.rs +++ b/tests/codegen/issue-32364.rs diff --git a/src/test/codegen/issue-34634.rs b/tests/codegen/issue-34634.rs index f53fa240c..f53fa240c 100644 --- a/src/test/codegen/issue-34634.rs +++ b/tests/codegen/issue-34634.rs diff --git a/src/test/codegen/issue-34947-pow-i32.rs b/tests/codegen/issue-34947-pow-i32.rs index 653da8e8b..653da8e8b 100644 --- a/src/test/codegen/issue-34947-pow-i32.rs +++ b/tests/codegen/issue-34947-pow-i32.rs diff --git a/src/test/codegen/issue-37945.rs b/tests/codegen/issue-37945.rs index fe54375bb..fe54375bb 100644 --- a/src/test/codegen/issue-37945.rs +++ b/tests/codegen/issue-37945.rs diff --git a/src/test/codegen/issue-44056-macos-tls-align.rs b/tests/codegen/issue-44056-macos-tls-align.rs index 1a3923f1b..1a3923f1b 100644 --- a/src/test/codegen/issue-44056-macos-tls-align.rs +++ b/tests/codegen/issue-44056-macos-tls-align.rs diff --git a/src/test/codegen/issue-45222.rs b/tests/codegen/issue-45222.rs index e9b05e648..e9b05e648 100644 --- a/src/test/codegen/issue-45222.rs +++ b/tests/codegen/issue-45222.rs diff --git a/src/test/codegen/issue-45466.rs b/tests/codegen/issue-45466.rs index c79542767..c79542767 100644 --- a/src/test/codegen/issue-45466.rs +++ b/tests/codegen/issue-45466.rs diff --git a/src/test/codegen/issue-45964-bounds-check-slice-pos.rs b/tests/codegen/issue-45964-bounds-check-slice-pos.rs index aa59c713b..1daa213fc 100644 --- a/src/test/codegen/issue-45964-bounds-check-slice-pos.rs +++ b/tests/codegen/issue-45964-bounds-check-slice-pos.rs @@ -2,6 +2,7 @@ // prevent optimizing away bounds checks // compile-flags: -O +// ignore-debug: the debug assertions get in the way #![crate_type="rlib"] diff --git a/src/test/codegen/issue-47278.rs b/tests/codegen/issue-47278.rs index 9076274f4..9076274f4 100644 --- a/src/test/codegen/issue-47278.rs +++ b/tests/codegen/issue-47278.rs diff --git a/src/test/codegen/issue-47442.rs b/tests/codegen/issue-47442.rs index 6944336d3..6944336d3 100644 --- a/src/test/codegen/issue-47442.rs +++ b/tests/codegen/issue-47442.rs diff --git a/src/test/codegen/issue-56267-2.rs b/tests/codegen/issue-56267-2.rs index 4dc9ebfeb..4dc9ebfeb 100644 --- a/src/test/codegen/issue-56267-2.rs +++ b/tests/codegen/issue-56267-2.rs diff --git a/src/test/codegen/issue-56267.rs b/tests/codegen/issue-56267.rs index 7bdd25779..7bdd25779 100644 --- a/src/test/codegen/issue-56267.rs +++ b/tests/codegen/issue-56267.rs diff --git a/src/test/codegen/issue-56927.rs b/tests/codegen/issue-56927.rs index 044d72181..044d72181 100644 --- a/src/test/codegen/issue-56927.rs +++ b/tests/codegen/issue-56927.rs diff --git a/src/test/codegen/issue-58881.rs b/tests/codegen/issue-58881.rs index 0900a3337..00f8953d9 100644 --- a/src/test/codegen/issue-58881.rs +++ b/tests/codegen/issue-58881.rs @@ -1,4 +1,4 @@ -// compile-flags: -C no-prepopulate-passes +// compile-flags: -C no-prepopulate-passes -Copt-level=0 // // only-x86_64 // ignore-windows diff --git a/src/test/codegen/issue-59352.rs b/tests/codegen/issue-59352.rs index d271fe027..d271fe027 100644 --- a/src/test/codegen/issue-59352.rs +++ b/tests/codegen/issue-59352.rs diff --git a/src/test/codegen/issue-69101-bounds-check.rs b/tests/codegen/issue-69101-bounds-check.rs index a3aca3a29..a3aca3a29 100644 --- a/src/test/codegen/issue-69101-bounds-check.rs +++ b/tests/codegen/issue-69101-bounds-check.rs diff --git a/src/test/codegen/issue-73031.rs b/tests/codegen/issue-73031.rs index a09c4bcfb..a09c4bcfb 100644 --- a/src/test/codegen/issue-73031.rs +++ b/tests/codegen/issue-73031.rs diff --git a/src/test/codegen/issue-73338-effecient-cmp.rs b/tests/codegen/issue-73338-effecient-cmp.rs index 85c2bbfd0..85c2bbfd0 100644 --- a/src/test/codegen/issue-73338-effecient-cmp.rs +++ b/tests/codegen/issue-73338-effecient-cmp.rs diff --git a/src/test/codegen/issue-73396-bounds-check-after-position.rs b/tests/codegen/issue-73396-bounds-check-after-position.rs index 8d07a67a1..8d07a67a1 100644 --- a/src/test/codegen/issue-73396-bounds-check-after-position.rs +++ b/tests/codegen/issue-73396-bounds-check-after-position.rs diff --git a/src/test/codegen/issue-73827-bounds-check-index-in-subexpr.rs b/tests/codegen/issue-73827-bounds-check-index-in-subexpr.rs index 1ad05906e..1ad05906e 100644 --- a/src/test/codegen/issue-73827-bounds-check-index-in-subexpr.rs +++ b/tests/codegen/issue-73827-bounds-check-index-in-subexpr.rs diff --git a/src/test/codegen/issue-75525-bounds-checks.rs b/tests/codegen/issue-75525-bounds-checks.rs index 2d363d8f7..2d363d8f7 100644 --- a/src/test/codegen/issue-75525-bounds-checks.rs +++ b/tests/codegen/issue-75525-bounds-checks.rs diff --git a/src/test/codegen/issue-75546.rs b/tests/codegen/issue-75546.rs index 470a9e040..470a9e040 100644 --- a/src/test/codegen/issue-75546.rs +++ b/tests/codegen/issue-75546.rs diff --git a/src/test/codegen/issue-75659.rs b/tests/codegen/issue-75659.rs index 6bcb59aff..6bcb59aff 100644 --- a/src/test/codegen/issue-75659.rs +++ b/tests/codegen/issue-75659.rs diff --git a/src/test/codegen/issue-77812.rs b/tests/codegen/issue-77812.rs index 4cc824145..4cc824145 100644 --- a/src/test/codegen/issue-77812.rs +++ b/tests/codegen/issue-77812.rs diff --git a/src/test/codegen/issue-81408-dllimport-thinlto-windows.rs b/tests/codegen/issue-81408-dllimport-thinlto-windows.rs index 0b6ab4f7e..0b6ab4f7e 100644 --- a/src/test/codegen/issue-81408-dllimport-thinlto-windows.rs +++ b/tests/codegen/issue-81408-dllimport-thinlto-windows.rs diff --git a/src/test/codegen/issue-84268.rs b/tests/codegen/issue-84268.rs index 7ca195447..7ca195447 100644 --- a/src/test/codegen/issue-84268.rs +++ b/tests/codegen/issue-84268.rs diff --git a/src/test/codegen/issue-85872-multiple-reverse.rs b/tests/codegen/issue-85872-multiple-reverse.rs index 591a1aca7..591a1aca7 100644 --- a/src/test/codegen/issue-85872-multiple-reverse.rs +++ b/tests/codegen/issue-85872-multiple-reverse.rs diff --git a/tests/codegen/issue-86106.rs b/tests/codegen/issue-86106.rs new file mode 100644 index 000000000..9ccbcb24f --- /dev/null +++ b/tests/codegen/issue-86106.rs @@ -0,0 +1,62 @@ +// min-llvm-version: 15.0 +// compile-flags: -C opt-level=3 -Z merge-functions=disabled + +// The below two functions ensure that both `String::new()` and `"".to_string()` +// produce the identical code. + +#![crate_type = "lib"] + +// CHECK-LABEL: define void @string_new +#[no_mangle] +pub fn string_new() -> String { + // CHECK-NOT: load i8 + // CHECK: store i{{32|64}} + // CHECK-NEXT: getelementptr + // CHECK-NEXT: store ptr + // CHECK-NEXT: getelementptr + // CHECK-NEXT: store i{{32|64}} + // CHECK-NEXT: ret void + String::new() +} + +// CHECK-LABEL: define void @empty_to_string +#[no_mangle] +pub fn empty_to_string() -> String { + // CHECK-NOT: load i8 + // CHECK: store i{{32|64}} + // CHECK-NEXT: getelementptr + // CHECK-NEXT: store ptr + // CHECK-NEXT: getelementptr + // CHECK-NEXT: store i{{32|64}} + // CHECK-NEXT: ret void + "".to_string() +} + +// The below two functions ensure that both `vec![]` and `vec![].clone()` +// produce the identical code. + +// CHECK-LABEL: @empty_vec +#[no_mangle] +pub fn empty_vec() -> Vec<u8> { + // CHECK: store i{{32|64}} + // CHECK-NOT: load i8 + // CHECK-NEXT: getelementptr + // CHECK-NEXT: store ptr + // CHECK-NEXT: getelementptr + // CHECK-NEXT: store i{{32|64}} + // CHECK-NEXT: ret void + vec![] +} + +// CHECK-LABEL: @empty_vec_clone +#[no_mangle] +pub fn empty_vec_clone() -> Vec<u8> { + // CHECK: store i{{32|64}} + // CHECK-NOT: load i8 + // CHECK-NEXT: getelementptr + // CHECK-NEXT: store ptr + // CHECK-NEXT: getelementptr + // CHECK-NEXT: store i{{32|64}} + // CHECK-NEXT: ret void + vec![].clone() +} diff --git a/src/test/codegen/issue-96274.rs b/tests/codegen/issue-96274.rs index 28bfcce0d..28bfcce0d 100644 --- a/src/test/codegen/issue-96274.rs +++ b/tests/codegen/issue-96274.rs diff --git a/src/test/codegen/issue-96497-slice-size-nowrap.rs b/tests/codegen/issue-96497-slice-size-nowrap.rs index a5dbef934..0413ed6b2 100644 --- a/src/test/codegen/issue-96497-slice-size-nowrap.rs +++ b/tests/codegen/issue-96497-slice-size-nowrap.rs @@ -3,7 +3,7 @@ // in some situations, see https://github.com/rust-lang/rust/issues/96497#issuecomment-1112865218 // compile-flags: -O -// min-llvm-version: 14.0 +// min-llvm-version: 15.0 #![crate_type="lib"] diff --git a/src/test/codegen/issue-98156-const-arg-temp-lifetime.rs b/tests/codegen/issue-98156-const-arg-temp-lifetime.rs index 12ace5fff..12ace5fff 100644 --- a/src/test/codegen/issue-98156-const-arg-temp-lifetime.rs +++ b/tests/codegen/issue-98156-const-arg-temp-lifetime.rs diff --git a/src/test/codegen/issue-98294-get-mut-copy-from-slice-opt.rs b/tests/codegen/issue-98294-get-mut-copy-from-slice-opt.rs index 7da29cd79..7da29cd79 100644 --- a/src/test/codegen/issue-98294-get-mut-copy-from-slice-opt.rs +++ b/tests/codegen/issue-98294-get-mut-copy-from-slice-opt.rs diff --git a/src/test/codegen/iter-repeat-n-trivial-drop.rs b/tests/codegen/iter-repeat-n-trivial-drop.rs index 20e1d9b4d..24059f190 100644 --- a/src/test/codegen/iter-repeat-n-trivial-drop.rs +++ b/tests/codegen/iter-repeat-n-trivial-drop.rs @@ -46,7 +46,7 @@ pub fn iter_repeat_n_next(it: &mut std::iter::RepeatN<NotCopy>) -> Option<NotCop #[no_mangle] // CHECK-LABEL: @vec_extend_via_iter_repeat_n pub fn vec_extend_via_iter_repeat_n() -> Vec<u8> { - // CHECK: %[[ADDR:.+]] = tail call dereferenceable_or_null(1234) ptr @__rust_alloc(i64 1234, i64 1) + // CHECK: %[[ADDR:.+]] = tail call noundef dereferenceable_or_null(1234) ptr @__rust_alloc(i64 noundef 1234, i64 noundef 1) // CHECK: tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1234) %[[ADDR]], i8 42, i64 1234, let n = 1234_usize; diff --git a/src/test/codegen/layout-size-checks.rs b/tests/codegen/layout-size-checks.rs index d067cc10a..d067cc10a 100644 --- a/src/test/codegen/layout-size-checks.rs +++ b/tests/codegen/layout-size-checks.rs diff --git a/src/test/codegen/lifetime_start_end.rs b/tests/codegen/lifetime_start_end.rs index 471a0b8ce..471a0b8ce 100644 --- a/src/test/codegen/lifetime_start_end.rs +++ b/tests/codegen/lifetime_start_end.rs diff --git a/src/test/codegen/link-dead-code.rs b/tests/codegen/link-dead-code.rs index de5a237c5..de5a237c5 100644 --- a/src/test/codegen/link-dead-code.rs +++ b/tests/codegen/link-dead-code.rs diff --git a/src/test/codegen/link_section.rs b/tests/codegen/link_section.rs index 88b8692b0..88b8692b0 100644 --- a/src/test/codegen/link_section.rs +++ b/tests/codegen/link_section.rs diff --git a/src/test/codegen/loads.rs b/tests/codegen/loads.rs index f448306ba..f29a26596 100644 --- a/src/test/codegen/loads.rs +++ b/tests/codegen/loads.rs @@ -50,8 +50,8 @@ pub fn load_scalar_pair<'a>(x: &(&'a i32, &'a Align16)) -> (&'a i32, &'a Align16 // CHECK-LABEL: @load_raw_pointer #[no_mangle] pub fn load_raw_pointer<'a>(x: &*const i32) -> *const i32 { - // loaded raw pointer should not have !nonnull, !align, or !noundef metadata - // CHECK: load {{i32\*|ptr}}, {{i32\*\*|ptr}} %x, align [[PTR_ALIGNMENT]]{{$}} + // loaded raw pointer should not have !nonnull or !align metadata + // CHECK: load {{i32\*|ptr}}, {{i32\*\*|ptr}} %x, align [[PTR_ALIGNMENT]], !noundef ![[NOUNDEF:[0-9]+]]{{$}} *x } @@ -93,7 +93,7 @@ pub fn load_maybeuninit_enum_bool(x: &MaybeUninit<MyBool>) -> MaybeUninit<MyBool // CHECK-LABEL: @load_int #[no_mangle] pub fn load_int(x: &u16) -> u16 { - // CHECK: load i16, {{i16\*|ptr}} %x, align 2{{$}} + // CHECK: load i16, {{i16\*|ptr}} %x, align 2, !noundef ![[NOUNDEF]]{{$}} *x } @@ -107,7 +107,7 @@ pub fn load_nonzero_int(x: &NonZeroU16) -> NonZeroU16 { // CHECK-LABEL: @load_option_nonzero_int #[no_mangle] pub fn load_option_nonzero_int(x: &Option<NonZeroU16>) -> Option<NonZeroU16> { - // CHECK: load i16, {{i16\*|ptr}} %x, align 2{{$}} + // CHECK: load i16, {{i16\*|ptr}} %x, align 2, !noundef ![[NOUNDEF]]{{$}} *x } diff --git a/src/test/codegen/local-generics-in-exe-internalized.rs b/tests/codegen/local-generics-in-exe-internalized.rs index e5430fbf1..e5430fbf1 100644 --- a/src/test/codegen/local-generics-in-exe-internalized.rs +++ b/tests/codegen/local-generics-in-exe-internalized.rs diff --git a/src/test/codegen/lto-removes-invokes.rs b/tests/codegen/lto-removes-invokes.rs index 3979a97dc..3979a97dc 100644 --- a/src/test/codegen/lto-removes-invokes.rs +++ b/tests/codegen/lto-removes-invokes.rs diff --git a/src/test/codegen/mainsubprogram.rs b/tests/codegen/mainsubprogram.rs index 790db3343..790db3343 100644 --- a/src/test/codegen/mainsubprogram.rs +++ b/tests/codegen/mainsubprogram.rs diff --git a/src/test/codegen/mainsubprogramstart.rs b/tests/codegen/mainsubprogramstart.rs index d4de9f59a..d4de9f59a 100644 --- a/src/test/codegen/mainsubprogramstart.rs +++ b/tests/codegen/mainsubprogramstart.rs diff --git a/src/test/codegen/match-optimized.rs b/tests/codegen/match-optimized.rs index 36402cc73..520c46a0d 100644 --- a/src/test/codegen/match-optimized.rs +++ b/tests/codegen/match-optimized.rs @@ -42,7 +42,7 @@ pub enum E2 { } // For optimized code we produce a switch with an unreachable target as the `otherwise` so LLVM -// knows the possible values. Compare with `src/test/codegen/match-unoptimized.rs`. +// knows the possible values. Compare with `tests/codegen/match-unoptimized.rs`. // CHECK-LABEL: @exhaustive_match_2 #[no_mangle] diff --git a/src/test/codegen/match-optimizes-away.rs b/tests/codegen/match-optimizes-away.rs index 8f66c518c..8f66c518c 100644 --- a/src/test/codegen/match-optimizes-away.rs +++ b/tests/codegen/match-optimizes-away.rs diff --git a/src/test/codegen/match-unoptimized.rs b/tests/codegen/match-unoptimized.rs index be40b29e3..78ea4f9b4 100644 --- a/src/test/codegen/match-unoptimized.rs +++ b/tests/codegen/match-unoptimized.rs @@ -9,7 +9,7 @@ pub enum E2 { } // For unoptimized code we produce a `br` instead of a `switch`. Compare with -// `src/test/codegen/match-optimized.rs` +// `tests/codegen/match-optimized.rs` // CHECK-LABEL: @exhaustive_match_2 #[no_mangle] diff --git a/src/test/codegen/mem-replace-direct-memcpy.rs b/tests/codegen/mem-replace-direct-memcpy.rs index e8bbf0e1b..e8bbf0e1b 100644 --- a/src/test/codegen/mem-replace-direct-memcpy.rs +++ b/tests/codegen/mem-replace-direct-memcpy.rs diff --git a/src/test/codegen/merge-functions.rs b/tests/codegen/merge-functions.rs index 8e8fe5c96..8e8fe5c96 100644 --- a/src/test/codegen/merge-functions.rs +++ b/tests/codegen/merge-functions.rs diff --git a/src/test/codegen/mir-inlined-line-numbers.rs b/tests/codegen/mir-inlined-line-numbers.rs index 19d83f0ee..19d83f0ee 100644 --- a/src/test/codegen/mir-inlined-line-numbers.rs +++ b/tests/codegen/mir-inlined-line-numbers.rs diff --git a/src/test/codegen/mir_zst_stores.rs b/tests/codegen/mir_zst_stores.rs index 17e7ba309..17e7ba309 100644 --- a/src/test/codegen/mir_zst_stores.rs +++ b/tests/codegen/mir_zst_stores.rs diff --git a/tests/codegen/move-operands.rs b/tests/codegen/move-operands.rs new file mode 100644 index 000000000..6c51324a3 --- /dev/null +++ b/tests/codegen/move-operands.rs @@ -0,0 +1,12 @@ +// compile-flags: -C no-prepopulate-passes -Zmir-enable-passes=+DestinationPropagation + +#![crate_type = "lib"] + +type T = [u8; 256]; + +#[no_mangle] +pub fn f(a: T, b: fn(_: T, _: T)) { + // CHECK: call void @llvm.memcpy.{{.*}}({{i8\*|ptr}} align 1 %{{.*}}, {{i8\*|ptr}} align 1 %{{.*}}, {{.*}} 256, i1 false) + // CHECK-NOT: call void @llvm.memcpy.{{.*}}({{i8\*|ptr}} align 1 %{{.*}}, {{i8\*|ptr}} align 1 %{{.*}}, {{.*}} 256, i1 false) + b(a, a) +} diff --git a/src/test/codegen/naked-functions.rs b/tests/codegen/naked-functions.rs index 51c7a0c61..e05bbc26e 100644 --- a/src/test/codegen/naked-functions.rs +++ b/tests/codegen/naked-functions.rs @@ -1,4 +1,4 @@ -// compile-flags: -C no-prepopulate-passes +// compile-flags: -C no-prepopulate-passes -Copt-level=0 // needs-asm-support // only-x86_64 diff --git a/src/test/codegen/naked-nocoverage.rs b/tests/codegen/naked-nocoverage.rs index 91a6260bf..91a6260bf 100644 --- a/src/test/codegen/naked-nocoverage.rs +++ b/tests/codegen/naked-nocoverage.rs diff --git a/src/test/codegen/naked-noinline.rs b/tests/codegen/naked-noinline.rs index c0ac69f4e..c0ac69f4e 100644 --- a/src/test/codegen/naked-noinline.rs +++ b/tests/codegen/naked-noinline.rs diff --git a/src/test/codegen/no-assumes-on-casts.rs b/tests/codegen/no-assumes-on-casts.rs index b5cfa2775..b5cfa2775 100644 --- a/src/test/codegen/no-assumes-on-casts.rs +++ b/tests/codegen/no-assumes-on-casts.rs diff --git a/src/test/codegen/no-dllimport-w-cross-lang-lto.rs b/tests/codegen/no-dllimport-w-cross-lang-lto.rs index 33fc2bc15..33fc2bc15 100644 --- a/src/test/codegen/no-dllimport-w-cross-lang-lto.rs +++ b/tests/codegen/no-dllimport-w-cross-lang-lto.rs diff --git a/tests/codegen/no-jump-tables.rs b/tests/codegen/no-jump-tables.rs new file mode 100644 index 000000000..8e2cb4756 --- /dev/null +++ b/tests/codegen/no-jump-tables.rs @@ -0,0 +1,22 @@ +// Test that the `no-jump-tables` function attribute are (not) emitted when +// the `-Zno-jump-tables` flag is (not) set. + +// revisions: unset set +// needs-llvm-components: x86 +// compile-flags: --target x86_64-unknown-linux-gnu +// [set] compile-flags: -Zno-jump-tables + +#![crate_type = "lib"] +#![feature(no_core, lang_items)] +#![no_core] + +#[lang = "sized"] +trait Sized {} + +#[no_mangle] +pub fn foo() { + // CHECK: @foo() unnamed_addr #0 + + // unset-NOT: attributes #0 = { {{.*}}"no-jump-tables"="true"{{.*}} } + // set: attributes #0 = { {{.*}}"no-jump-tables"="true"{{.*}} } +} diff --git a/src/test/codegen/no-plt.rs b/tests/codegen/no-plt.rs index b36e9ae88..b36e9ae88 100644 --- a/src/test/codegen/no-plt.rs +++ b/tests/codegen/no-plt.rs diff --git a/src/test/codegen/noalias-box-off.rs b/tests/codegen/noalias-box-off.rs index afd17c7c1..afd17c7c1 100644 --- a/src/test/codegen/noalias-box-off.rs +++ b/tests/codegen/noalias-box-off.rs diff --git a/src/test/codegen/noalias-box.rs b/tests/codegen/noalias-box.rs index a3d1f093d..a3d1f093d 100644 --- a/src/test/codegen/noalias-box.rs +++ b/tests/codegen/noalias-box.rs diff --git a/tests/codegen/noalias-flag.rs b/tests/codegen/noalias-flag.rs new file mode 100644 index 000000000..a9ec61e28 --- /dev/null +++ b/tests/codegen/noalias-flag.rs @@ -0,0 +1,23 @@ +// compile-flags: -O -Zmutable-noalias=no + +#![crate_type = "lib"] + +// `-Zmutable-noalias=no` should disable noalias on mut refs... + +// CHECK-LABEL: @test_mut_ref( +// CHECK-NOT: noalias +// CHECK-SAME: %x +#[no_mangle] +pub fn test_mut_ref(x: &mut i32) -> &mut i32 { + x +} + +// ...but not on shared refs + +// CHECK-LABEL: @test_ref( +// CHECK-SAME: noalias +// CHECK-SAME: %x +#[no_mangle] +pub fn test_ref(x: &i32) -> &i32 { + x +} diff --git a/src/test/codegen/noalias-refcell.rs b/tests/codegen/noalias-refcell.rs index dba73937a..dba73937a 100644 --- a/src/test/codegen/noalias-refcell.rs +++ b/tests/codegen/noalias-refcell.rs diff --git a/src/test/codegen/noalias-rwlockreadguard.rs b/tests/codegen/noalias-rwlockreadguard.rs index 7f7b46c85..7f7b46c85 100644 --- a/src/test/codegen/noalias-rwlockreadguard.rs +++ b/tests/codegen/noalias-rwlockreadguard.rs diff --git a/src/test/codegen/noalias-unpin.rs b/tests/codegen/noalias-unpin.rs index 8ca9b98ee..8ca9b98ee 100644 --- a/src/test/codegen/noalias-unpin.rs +++ b/tests/codegen/noalias-unpin.rs diff --git a/src/test/codegen/non-terminate/infinite-loop-1.rs b/tests/codegen/non-terminate/infinite-loop-1.rs index fa9c66b47..fa9c66b47 100644 --- a/src/test/codegen/non-terminate/infinite-loop-1.rs +++ b/tests/codegen/non-terminate/infinite-loop-1.rs diff --git a/src/test/codegen/non-terminate/infinite-loop-2.rs b/tests/codegen/non-terminate/infinite-loop-2.rs index 81d62ab33..81d62ab33 100644 --- a/src/test/codegen/non-terminate/infinite-loop-2.rs +++ b/tests/codegen/non-terminate/infinite-loop-2.rs diff --git a/src/test/codegen/non-terminate/infinite-recursion.rs b/tests/codegen/non-terminate/infinite-recursion.rs index 6d1f2d4bf..6d1f2d4bf 100644 --- a/src/test/codegen/non-terminate/infinite-recursion.rs +++ b/tests/codegen/non-terminate/infinite-recursion.rs diff --git a/src/test/codegen/non-terminate/nonempty-infinite-loop.rs b/tests/codegen/non-terminate/nonempty-infinite-loop.rs index 5e25e04fc..5e25e04fc 100644 --- a/src/test/codegen/non-terminate/nonempty-infinite-loop.rs +++ b/tests/codegen/non-terminate/nonempty-infinite-loop.rs diff --git a/src/test/codegen/noreturn-uninhabited.rs b/tests/codegen/noreturn-uninhabited.rs index 49f93cf62..49f93cf62 100644 --- a/src/test/codegen/noreturn-uninhabited.rs +++ b/tests/codegen/noreturn-uninhabited.rs diff --git a/src/test/codegen/noreturnflag.rs b/tests/codegen/noreturnflag.rs index 95c100571..95c100571 100644 --- a/src/test/codegen/noreturnflag.rs +++ b/tests/codegen/noreturnflag.rs diff --git a/src/test/codegen/nounwind.rs b/tests/codegen/nounwind.rs index f639c60b8..f639c60b8 100644 --- a/src/test/codegen/nounwind.rs +++ b/tests/codegen/nounwind.rs diff --git a/src/test/codegen/nrvo.rs b/tests/codegen/nrvo.rs index fddb0d1fb..fddb0d1fb 100644 --- a/src/test/codegen/nrvo.rs +++ b/tests/codegen/nrvo.rs diff --git a/src/test/codegen/optimize-attr-1.rs b/tests/codegen/optimize-attr-1.rs index 22abe06e7..22abe06e7 100644 --- a/src/test/codegen/optimize-attr-1.rs +++ b/tests/codegen/optimize-attr-1.rs diff --git a/src/test/codegen/option-nonzero-eq.rs b/tests/codegen/option-nonzero-eq.rs index 598dcc19b..598dcc19b 100644 --- a/src/test/codegen/option-nonzero-eq.rs +++ b/tests/codegen/option-nonzero-eq.rs diff --git a/src/test/codegen/packed.rs b/tests/codegen/packed.rs index fd63b4f0a..fd63b4f0a 100644 --- a/src/test/codegen/packed.rs +++ b/tests/codegen/packed.rs diff --git a/src/test/codegen/panic-abort-windows.rs b/tests/codegen/panic-abort-windows.rs index 2ee29762d..2ee29762d 100644 --- a/src/test/codegen/panic-abort-windows.rs +++ b/tests/codegen/panic-abort-windows.rs diff --git a/src/test/codegen/panic-in-drop-abort.rs b/tests/codegen/panic-in-drop-abort.rs index 7a84484c4..7a84484c4 100644 --- a/src/test/codegen/panic-in-drop-abort.rs +++ b/tests/codegen/panic-in-drop-abort.rs diff --git a/src/test/codegen/panic-unwind-default-uwtable.rs b/tests/codegen/panic-unwind-default-uwtable.rs index 4c85008cf..4c85008cf 100644 --- a/src/test/codegen/panic-unwind-default-uwtable.rs +++ b/tests/codegen/panic-unwind-default-uwtable.rs diff --git a/src/test/codegen/personality_lifetimes.rs b/tests/codegen/personality_lifetimes.rs index 2104022f5..2104022f5 100644 --- a/src/test/codegen/personality_lifetimes.rs +++ b/tests/codegen/personality_lifetimes.rs diff --git a/tests/codegen/pgo-counter-bias.rs b/tests/codegen/pgo-counter-bias.rs new file mode 100644 index 000000000..28caa7f4a --- /dev/null +++ b/tests/codegen/pgo-counter-bias.rs @@ -0,0 +1,10 @@ +// Test that __llvm_profile_counter_bias does not get internalized by lto. + +// ignore-macos -runtime-counter-relocation not honored on Mach-O +// compile-flags: -Cprofile-generate -Cllvm-args=-runtime-counter-relocation -Clto=fat +// needs-profiler-support +// no-prefer-dynamic + +// CHECK: @__llvm_profile_counter_bias = {{.*}}global + +pub fn main() {} diff --git a/src/test/codegen/pgo-instrumentation.rs b/tests/codegen/pgo-instrumentation.rs index 05c2d2fc0..05c2d2fc0 100644 --- a/src/test/codegen/pgo-instrumentation.rs +++ b/tests/codegen/pgo-instrumentation.rs diff --git a/src/test/codegen/pic-relocation-model.rs b/tests/codegen/pic-relocation-model.rs index 602a08067..518e949ff 100644 --- a/src/test/codegen/pic-relocation-model.rs +++ b/tests/codegen/pic-relocation-model.rs @@ -1,4 +1,4 @@ -// compile-flags: -C relocation-model=pic +// compile-flags: -C relocation-model=pic -Copt-level=0 #![crate_type = "rlib"] diff --git a/src/test/codegen/pie-relocation-model.rs b/tests/codegen/pie-relocation-model.rs index ec44edc06..941cca922 100644 --- a/src/test/codegen/pie-relocation-model.rs +++ b/tests/codegen/pie-relocation-model.rs @@ -1,4 +1,4 @@ -// compile-flags: -C relocation-model=pie +// compile-flags: -C relocation-model=pie -Copt-level=0 // only-x86_64-unknown-linux-gnu #![crate_type = "rlib"] diff --git a/src/test/codegen/refs.rs b/tests/codegen/refs.rs index 0b796754d..a52897667 100644 --- a/src/test/codegen/refs.rs +++ b/tests/codegen/refs.rs @@ -1,4 +1,4 @@ -// compile-flags: -C no-prepopulate-passes -Zmir-opt-level=0 +// compile-flags: -C no-prepopulate-passes -Zmir-opt-level=0 -Copt-level=0 #![crate_type = "lib"] diff --git a/src/test/codegen/remap_path_prefix/aux_mod.rs b/tests/codegen/remap_path_prefix/aux_mod.rs index 44cc4bb72..44cc4bb72 100644 --- a/src/test/codegen/remap_path_prefix/aux_mod.rs +++ b/tests/codegen/remap_path_prefix/aux_mod.rs diff --git a/src/test/codegen/remap_path_prefix/auxiliary/remap_path_prefix_aux.rs b/tests/codegen/remap_path_prefix/auxiliary/remap_path_prefix_aux.rs index 887915955..887915955 100644 --- a/src/test/codegen/remap_path_prefix/auxiliary/remap_path_prefix_aux.rs +++ b/tests/codegen/remap_path_prefix/auxiliary/remap_path_prefix_aux.rs diff --git a/src/test/codegen/remap_path_prefix/auxiliary/xcrate-generic.rs b/tests/codegen/remap_path_prefix/auxiliary/xcrate-generic.rs index 59092dbf6..59092dbf6 100644 --- a/src/test/codegen/remap_path_prefix/auxiliary/xcrate-generic.rs +++ b/tests/codegen/remap_path_prefix/auxiliary/xcrate-generic.rs diff --git a/src/test/codegen/remap_path_prefix/issue-73167-remap-std.rs b/tests/codegen/remap_path_prefix/issue-73167-remap-std.rs index b66abc6be..b66abc6be 100644 --- a/src/test/codegen/remap_path_prefix/issue-73167-remap-std.rs +++ b/tests/codegen/remap_path_prefix/issue-73167-remap-std.rs diff --git a/tests/codegen/remap_path_prefix/main.rs b/tests/codegen/remap_path_prefix/main.rs new file mode 100644 index 000000000..78ebbccfc --- /dev/null +++ b/tests/codegen/remap_path_prefix/main.rs @@ -0,0 +1,28 @@ +// ignore-windows +// + +// compile-flags: -g -C no-prepopulate-passes --remap-path-prefix={{cwd}}=/the/cwd --remap-path-prefix={{src-base}}=/the/src -Zinline-mir=no +// aux-build:remap_path_prefix_aux.rs + +extern crate remap_path_prefix_aux; + +// Here we check that submodules and include files are found using the path without +// remapping. This test requires that rustc is called with an absolute path. +mod aux_mod; +include!("aux_mod.rs"); + +// Here we check that the expansion of the file!() macro is mapped. +// CHECK: @alloc2 = private unnamed_addr constant <{ [34 x i8] }> <{ [34 x i8] c"/the/src/remap_path_prefix/main.rs" }> +pub static FILE_PATH: &'static str = file!(); + +fn main() { + remap_path_prefix_aux::some_aux_function(); + aux_mod::some_aux_mod_function(); + some_aux_mod_function(); +} + +// Here we check that local debuginfo is mapped correctly. +// CHECK: !DIFile(filename: "/the/src/remap_path_prefix/main.rs", directory: "" + +// And here that debuginfo from other crates are expanded to absolute paths. +// CHECK: !DIFile(filename: "/the/aux-src/remap_path_prefix_aux.rs", directory: "" diff --git a/src/test/codegen/remap_path_prefix/xcrate-generic.rs b/tests/codegen/remap_path_prefix/xcrate-generic.rs index 7a9d2ca9b..7a9d2ca9b 100644 --- a/src/test/codegen/remap_path_prefix/xcrate-generic.rs +++ b/tests/codegen/remap_path_prefix/xcrate-generic.rs diff --git a/src/test/codegen/repeat-trusted-len.rs b/tests/codegen/repeat-trusted-len.rs index 87c8fe135..87c8fe135 100644 --- a/src/test/codegen/repeat-trusted-len.rs +++ b/tests/codegen/repeat-trusted-len.rs diff --git a/src/test/codegen/repr-transparent-aggregates-1.rs b/tests/codegen/repr-transparent-aggregates-1.rs index 9d18c5f03..f733de12b 100644 --- a/src/test/codegen/repr-transparent-aggregates-1.rs +++ b/tests/codegen/repr-transparent-aggregates-1.rs @@ -8,6 +8,7 @@ // ignore-powerpc // ignore-powerpc64 // ignore-riscv64 see codegen/riscv-abi +// ignore-s390x // ignore-windows // See repr-transparent.rs diff --git a/src/test/codegen/repr-transparent-aggregates-2.rs b/tests/codegen/repr-transparent-aggregates-2.rs index df7e88f08..df7e88f08 100644 --- a/src/test/codegen/repr-transparent-aggregates-2.rs +++ b/tests/codegen/repr-transparent-aggregates-2.rs diff --git a/src/test/codegen/repr-transparent-aggregates-3.rs b/tests/codegen/repr-transparent-aggregates-3.rs index 0db17e6b1..0db17e6b1 100644 --- a/src/test/codegen/repr-transparent-aggregates-3.rs +++ b/tests/codegen/repr-transparent-aggregates-3.rs diff --git a/src/test/codegen/repr-transparent-sysv64.rs b/tests/codegen/repr-transparent-sysv64.rs index 886b0dd9e..886b0dd9e 100644 --- a/src/test/codegen/repr-transparent-sysv64.rs +++ b/tests/codegen/repr-transparent-sysv64.rs diff --git a/src/test/codegen/repr-transparent.rs b/tests/codegen/repr-transparent.rs index c68ba8460..311cbfbaa 100644 --- a/src/test/codegen/repr-transparent.rs +++ b/tests/codegen/repr-transparent.rs @@ -2,6 +2,7 @@ // ignore-riscv64 riscv64 has an i128 type used with test_Vector // see codegen/riscv-abi for riscv functiona call tests +// ignore-s390x s390x with default march passes vector types per reference #![crate_type="lib"] #![feature(repr_simd, transparent_unions)] @@ -17,21 +18,21 @@ pub struct Zst2(()); #[repr(transparent)] pub struct F32(f32); -// CHECK: define{{.*}}float @test_F32(float %_1) +// CHECK: define{{.*}}float @test_F32(float noundef %_1) #[no_mangle] pub extern "C" fn test_F32(_: F32) -> F32 { loop {} } #[repr(transparent)] pub struct Ptr(*mut u8); -// CHECK: define{{.*}}{{i8\*|ptr}} @test_Ptr({{i8\*|ptr}} %_1) +// CHECK: define{{.*}}{{i8\*|ptr}} @test_Ptr({{i8\*|ptr}} noundef %_1) #[no_mangle] pub extern "C" fn test_Ptr(_: Ptr) -> Ptr { loop {} } #[repr(transparent)] pub struct WithZst(u64, Zst1); -// CHECK: define{{.*}}i64 @test_WithZst(i64 %_1) +// CHECK: define{{.*}}i64 @test_WithZst(i64 noundef %_1) #[no_mangle] pub extern "C" fn test_WithZst(_: WithZst) -> WithZst { loop {} } @@ -39,14 +40,14 @@ pub extern "C" fn test_WithZst(_: WithZst) -> WithZst { loop {} } pub struct WithZeroSizedArray(*const f32, [i8; 0]); // Apparently we use i32* when newtype-unwrapping f32 pointers. Whatever. -// CHECK: define{{.*}}{{i32\*|ptr}} @test_WithZeroSizedArray({{i32\*|ptr}} %_1) +// CHECK: define{{.*}}{{i32\*|ptr}} @test_WithZeroSizedArray({{i32\*|ptr}} noundef %_1) #[no_mangle] pub extern "C" fn test_WithZeroSizedArray(_: WithZeroSizedArray) -> WithZeroSizedArray { loop {} } #[repr(transparent)] pub struct Generic<T>(T); -// CHECK: define{{.*}}double @test_Generic(double %_1) +// CHECK: define{{.*}}double @test_Generic(double noundef %_1) #[no_mangle] pub extern "C" fn test_Generic(_: Generic<f64>) -> Generic<f64> { loop {} } @@ -63,7 +64,7 @@ pub extern "C" fn test_Gpz(_: GenericPlusZst<Bool>) -> GenericPlusZst<Bool> { lo #[repr(transparent)] pub struct LifetimePhantom<'a, T: 'a>(*const T, PhantomData<&'a T>); -// CHECK: define{{.*}}{{i16\*|ptr}} @test_LifetimePhantom({{i16\*|ptr}} %_1) +// CHECK: define{{.*}}{{i16\*|ptr}} @test_LifetimePhantom({{i16\*|ptr}} noundef %_1) #[no_mangle] pub extern "C" fn test_LifetimePhantom(_: LifetimePhantom<i16>) -> LifetimePhantom<i16> { loop {} } @@ -73,28 +74,28 @@ pub struct UnitPhantom<T, U> { val: T, unit: PhantomData<U> } pub struct Px; -// CHECK: define{{.*}}float @test_UnitPhantom(float %_1) +// CHECK: define{{.*}}float @test_UnitPhantom(float noundef %_1) #[no_mangle] pub extern "C" fn test_UnitPhantom(_: UnitPhantom<f32, Px>) -> UnitPhantom<f32, Px> { loop {} } #[repr(transparent)] pub struct TwoZsts(Zst1, i8, Zst2); -// CHECK: define{{( dso_local)?}}{{( signext)?}} i8 @test_TwoZsts(i8{{( signext)?}} %_1) +// CHECK: define{{( dso_local)?}} noundef{{( signext)?}} i8 @test_TwoZsts(i8 noundef{{( signext)?}} %_1) #[no_mangle] pub extern "C" fn test_TwoZsts(_: TwoZsts) -> TwoZsts { loop {} } #[repr(transparent)] pub struct Nested1(Zst2, Generic<f64>); -// CHECK: define{{.*}}double @test_Nested1(double %_1) +// CHECK: define{{.*}}double @test_Nested1(double noundef %_1) #[no_mangle] pub extern "C" fn test_Nested1(_: Nested1) -> Nested1 { loop {} } #[repr(transparent)] pub struct Nested2(Nested1, Zst1); -// CHECK: define{{.*}}double @test_Nested2(double %_1) +// CHECK: define{{.*}}double @test_Nested2(double noundef %_1) #[no_mangle] pub extern "C" fn test_Nested2(_: Nested2) -> Nested2 { loop {} } @@ -114,7 +115,7 @@ impl<T: ?Sized> Mirror for T { type It = Self; } #[repr(transparent)] pub struct StructWithProjection(<f32 as Mirror>::It); -// CHECK: define{{.*}}float @test_Projection(float %_1) +// CHECK: define{{.*}}float @test_Projection(float noundef %_1) #[no_mangle] pub extern "C" fn test_Projection(_: StructWithProjection) -> StructWithProjection { loop {} } @@ -123,7 +124,7 @@ pub enum EnumF32 { Variant(F32) } -// CHECK: define{{.*}}float @test_EnumF32(float %_1) +// CHECK: define{{.*}}float @test_EnumF32(float noundef %_1) #[no_mangle] pub extern "C" fn test_EnumF32(_: EnumF32) -> EnumF32 { loop {} } @@ -132,7 +133,7 @@ pub enum EnumF32WithZsts { Variant(Zst1, F32, Zst2) } -// CHECK: define{{.*}}float @test_EnumF32WithZsts(float %_1) +// CHECK: define{{.*}}float @test_EnumF32WithZsts(float noundef %_1) #[no_mangle] pub extern "C" fn test_EnumF32WithZsts(_: EnumF32WithZsts) -> EnumF32WithZsts { loop {} } @@ -141,7 +142,7 @@ pub union UnionF32 { field: F32, } -// CHECK: define{{.*}}float @test_UnionF32(float %_1) +// CHECK: define{{.*}} float @test_UnionF32(float %_1) #[no_mangle] pub extern "C" fn test_UnionF32(_: UnionF32) -> UnionF32 { loop {} } diff --git a/src/test/codegen/riscv-abi/call-llvm-intrinsics.rs b/tests/codegen/riscv-abi/call-llvm-intrinsics.rs index 31a88f2c0..31a88f2c0 100644 --- a/src/test/codegen/riscv-abi/call-llvm-intrinsics.rs +++ b/tests/codegen/riscv-abi/call-llvm-intrinsics.rs diff --git a/src/test/codegen/riscv-abi/riscv64-lp64-lp64f-lp64d-abi.rs b/tests/codegen/riscv-abi/riscv64-lp64-lp64f-lp64d-abi.rs index 61c4b7b51..045f01985 100644 --- a/src/test/codegen/riscv-abi/riscv64-lp64-lp64f-lp64d-abi.rs +++ b/tests/codegen/riscv-abi/riscv64-lp64-lp64f-lp64d-abi.rs @@ -29,25 +29,25 @@ pub extern "C" fn f_scalar_0(a: bool) -> bool { a } -// CHECK: define signext i8 @f_scalar_1(i8 signext %x) +// CHECK: define noundef signext i8 @f_scalar_1(i8 noundef signext %x) #[no_mangle] pub extern "C" fn f_scalar_1(x: i8) -> i8 { x } -// CHECK: define zeroext i8 @f_scalar_2(i8 zeroext %x) +// CHECK: define noundef zeroext i8 @f_scalar_2(i8 noundef zeroext %x) #[no_mangle] pub extern "C" fn f_scalar_2(x: u8) -> u8 { x } -// CHECK: define signext i32 @f_scalar_3(i32 signext %x) +// CHECK: define noundef signext i32 @f_scalar_3(i32 noundef signext %x) #[no_mangle] pub extern "C" fn f_scalar_3(x: i32) -> u32 { x as u32 } -// CHECK: define i64 @f_scalar_4(i64 %x) +// CHECK: define noundef i64 @f_scalar_4(i64 noundef %x) #[no_mangle] pub extern "C" fn f_scalar_4(x: i64) -> i64 { x @@ -132,13 +132,13 @@ pub struct Large { pub extern "C" fn f_agg_large(mut x: Large) { } -// CHECK: define void @f_agg_large_ret({{%Large\*|ptr}} {{.*}}sret{{.*}}, i32 signext %i, i8 signext %j) +// CHECK: define void @f_agg_large_ret({{%Large\*|ptr}} {{.*}}sret{{.*}}, i32 noundef signext %i, i8 noundef signext %j) #[no_mangle] pub extern "C" fn f_agg_large_ret(i: i32, j: i8) -> Large { Large { a: 1, b: 2, c: 3, d: 4 } } -// CHECK: define void @f_scalar_stack_1(i64 %0, [2 x i64] %1, i128 %2, {{%Large\*|ptr}} {{.*}}%d, i8 zeroext %e, i8 signext %f, i8 %g, i8 %h) +// CHECK: define void @f_scalar_stack_1(i64 %0, [2 x i64] %1, i128 %2, {{%Large\*|ptr}} {{.*}}%d, i8 noundef zeroext %e, i8 noundef signext %f, i8 noundef %g, i8 noundef %h) #[no_mangle] pub extern "C" fn f_scalar_stack_1( a: Tiny, @@ -152,7 +152,7 @@ pub extern "C" fn f_scalar_stack_1( ) { } -// CHECK: define void @f_scalar_stack_2({{%Large\*|ptr}} {{.*}}sret{{.*}} %0, i64 %a, i128 %1, i128 %2, i64 %d, i8 zeroext %e, i8 %f, i8 %g) +// CHECK: define void @f_scalar_stack_2({{%Large\*|ptr}} {{.*}}sret{{.*}} %0, i64 noundef %a, i128 %1, i128 %2, i64 noundef %d, i8 noundef zeroext %e, i8 noundef %f, i8 noundef %g) #[no_mangle] pub extern "C" fn f_scalar_stack_2( a: u64, @@ -172,7 +172,7 @@ extern "C" { #[no_mangle] pub unsafe extern "C" fn f_va_caller() { - // CHECK: call signext i32 (i32, ...) @f_va_callee(i32 signext 1, i32 signext 2, i64 3, double {{.*}}, double {{.*}}, i64 {{.*}}, [2 x i64] {{.*}}, i128 {{.*}}, {{%Large\*|ptr}} {{.*}}) + // CHECK: call noundef signext i32 (i32, ...) @f_va_callee(i32 noundef signext 1, i32 noundef signext 2, i64 noundef 3, double {{.*}}, double {{.*}}, i64 {{.*}}, [2 x i64] {{.*}}, i128 {{.*}}, {{%Large\*|ptr}} {{.*}}) f_va_callee( 1, 2i32, @@ -184,6 +184,6 @@ pub unsafe extern "C" fn f_va_caller() { SmallAligned { a: 11 }, Large { a: 12, b: 13, c: 14, d: 15 }, ); - // CHECK: call signext i32 (i32, ...) @f_va_callee(i32 signext 1, i32 signext 2, i32 signext 3, i32 signext 4, i128 {{.*}}, i32 signext 6, i32 signext 7, i32 8, i32 9) + // CHECK: call noundef signext i32 (i32, ...) @f_va_callee(i32 noundef signext 1, i32 noundef signext 2, i32 noundef signext 3, i32 noundef signext 4, i128 {{.*}}, i32 noundef signext 6, i32 noundef signext 7, i32 noundef 8, i32 noundef 9) f_va_callee(1, 2i32, 3i32, 4i32, SmallAligned { a: 5 }, 6i32, 7i32, 8i32, 9i32); } diff --git a/src/test/codegen/riscv-abi/riscv64-lp64d-abi.rs b/tests/codegen/riscv-abi/riscv64-lp64d-abi.rs index 1555acadf..1555acadf 100644 --- a/src/test/codegen/riscv-abi/riscv64-lp64d-abi.rs +++ b/tests/codegen/riscv-abi/riscv64-lp64d-abi.rs diff --git a/src/test/codegen/riscv-abi/riscv64-lp64f-lp64d-abi.rs b/tests/codegen/riscv-abi/riscv64-lp64f-lp64d-abi.rs index f08fabed4..f08fabed4 100644 --- a/src/test/codegen/riscv-abi/riscv64-lp64f-lp64d-abi.rs +++ b/tests/codegen/riscv-abi/riscv64-lp64f-lp64d-abi.rs diff --git a/src/test/codegen/sanitizer-cfi-add-canonical-jump-tables-flag.rs b/tests/codegen/sanitizer-cfi-add-canonical-jump-tables-flag.rs index c42fbba74..c42fbba74 100644 --- a/src/test/codegen/sanitizer-cfi-add-canonical-jump-tables-flag.rs +++ b/tests/codegen/sanitizer-cfi-add-canonical-jump-tables-flag.rs diff --git a/src/test/codegen/sanitizer-cfi-emit-type-checks.rs b/tests/codegen/sanitizer-cfi-emit-type-checks.rs index 8be5186de..597b867eb 100644 --- a/src/test/codegen/sanitizer-cfi-emit-type-checks.rs +++ b/tests/codegen/sanitizer-cfi-emit-type-checks.rs @@ -1,7 +1,7 @@ // Verifies that pointer type membership tests for indirect calls are emitted. // // needs-sanitizer-cfi -// compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi +// compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi -Copt-level=0 #![crate_type="lib"] diff --git a/src/test/codegen/sanitizer-cfi-emit-type-metadata-id-itanium-cxx-abi.rs b/tests/codegen/sanitizer-cfi-emit-type-metadata-id-itanium-cxx-abi.rs index ece2adbdf..b9c339143 100644 --- a/src/test/codegen/sanitizer-cfi-emit-type-metadata-id-itanium-cxx-abi.rs +++ b/tests/codegen/sanitizer-cfi-emit-type-metadata-id-itanium-cxx-abi.rs @@ -131,6 +131,13 @@ pub struct Type13<'a> { member3: &'a Type13<'a>, } +// Helper type to allow `Type14<Bar>` to be a unique ID +pub struct Bar; + +// repr(transparent) parameterized type +#[repr(transparent)] +pub struct Type14<T>(T); + pub fn foo0(_: ()) { } // CHECK: define{{.*}}foo0{{.*}}!type ![[TYPE0:[0-9]+]] pub fn foo1(_: c_void, _: ()) { } @@ -425,6 +432,12 @@ pub fn foo145(_: Type13, _: Type13) { } // CHECK: define{{.*}}foo145{{.*}}!type ![[TYPE145:[0-9]+]] pub fn foo146(_: Type13, _: Type13, _: Type13) { } // CHECK: define{{.*}}foo146{{.*}}!type ![[TYPE146:[0-9]+]] +pub fn foo147(_: Type14<Bar>) { } +// CHECK: define{{.*}}foo147{{.*}}!type ![[TYPE147:[0-9]+]] +pub fn foo148(_: Type14<Bar>, _: Type14<Bar>) { } +// CHECK: define{{.*}}foo148{{.*}}!type ![[TYPE148:[0-9]+]] +pub fn foo149(_: Type14<Bar>, _: Type14<Bar>, _: Type14<Bar>) { } +// CHECK: define{{.*}}foo149{{.*}}!type ![[TYPE149:[0-9]+]] // CHECK: ![[TYPE0]] = !{i64 0, !"_ZTSFvvE"} // CHECK: ![[TYPE1]] = !{i64 0, !"_ZTSFvvvE"} @@ -570,6 +583,9 @@ pub fn foo146(_: Type13, _: Type13, _: Type13) { } // CHECK: ![[TYPE141]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtC{{[[:print:]]+}}_51sanitizer_cfi_emit_type_metadata_id_itanium_cxx_abi3FooE"} // CHECK: ![[TYPE142]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtC{{[[:print:]]+}}_51sanitizer_cfi_emit_type_metadata_id_itanium_cxx_abi3FooS_E"} // CHECK: ![[TYPE143]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtC{{[[:print:]]+}}_51sanitizer_cfi_emit_type_metadata_id_itanium_cxx_abi3FooS_S_E"} -// CHECK: ![[TYPE144]] = !{i64 0, !"_ZTSFvu3refIu3refIvEEE"} -// CHECK: ![[TYPE145]] = !{i64 0, !"_ZTSFvu3refIu3refIvEES0_E"} -// CHECK: ![[TYPE146]] = !{i64 0, !"_ZTSFvu3refIu3refIvEES0_S0_E"} +// CHECK: ![[TYPE144]] = !{i64 0, !"_ZTSFvu3refIvEE"} +// CHECK: ![[TYPE145]] = !{i64 0, !"_ZTSFvu3refIvES_E"} +// CHECK: ![[TYPE146]] = !{i64 0, !"_ZTSFvu3refIvES_S_E"} +// CHECK: ![[TYPE147]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtC{{[[:print:]]+}}_51sanitizer_cfi_emit_type_metadata_id_itanium_cxx_abi3BarE +// CHECK: ![[TYPE148]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtC{{[[:print:]]+}}_51sanitizer_cfi_emit_type_metadata_id_itanium_cxx_abi3BarS_E +// CHECK: ![[TYPE149]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtC{{[[:print:]]+}}_51sanitizer_cfi_emit_type_metadata_id_itanium_cxx_abi3BarS_S_E diff --git a/src/test/codegen/sanitizer-cfi-emit-type-metadata-itanium-cxx-abi.rs b/tests/codegen/sanitizer-cfi-emit-type-metadata-itanium-cxx-abi.rs index bafc4c659..bafc4c659 100644 --- a/src/test/codegen/sanitizer-cfi-emit-type-metadata-itanium-cxx-abi.rs +++ b/tests/codegen/sanitizer-cfi-emit-type-metadata-itanium-cxx-abi.rs diff --git a/tests/codegen/sanitizer-kcfi-add-kcfi-flag.rs b/tests/codegen/sanitizer-kcfi-add-kcfi-flag.rs new file mode 100644 index 000000000..c2eb852ae --- /dev/null +++ b/tests/codegen/sanitizer-kcfi-add-kcfi-flag.rs @@ -0,0 +1,11 @@ +// Verifies that "kcfi" module flag is added. +// +// needs-sanitizer-kcfi +// compile-flags: -Ctarget-feature=-crt-static -Zsanitizer=kcfi + +#![crate_type="lib"] + +pub fn foo() { +} + +// CHECK: !{{[0-9]+}} = !{i32 4, !"kcfi", i32 1} diff --git a/tests/codegen/sanitizer-kcfi-emit-kcfi-operand-bundle-itanium-cxx-abi.rs b/tests/codegen/sanitizer-kcfi-emit-kcfi-operand-bundle-itanium-cxx-abi.rs new file mode 100644 index 000000000..2537df80a --- /dev/null +++ b/tests/codegen/sanitizer-kcfi-emit-kcfi-operand-bundle-itanium-cxx-abi.rs @@ -0,0 +1,44 @@ +// Verifies that KCFI type metadata for functions are emitted. +// +// revisions: aarch64 x86_64 +// [aarch64] compile-flags: --target aarch64-unknown-none +// [aarch64] needs-llvm-components: aarch64 +// [x86_64] compile-flags: --target x86_64-unknown-none +// [x86_64] needs-llvm-components: +// compile-flags: -Cno-prepopulate-passes -Zsanitizer=kcfi -Copt-level=0 + +#![crate_type="lib"] +#![feature(no_core, lang_items)] +#![no_core] + +#[lang="sized"] +trait Sized { } +#[lang="copy"] +trait Copy { } + +impl Copy for i32 {} + +pub fn foo(f: fn(i32) -> i32, arg: i32) -> i32 { + // CHECK-LABEL: define{{.*}}foo + // CHECK-SAME: {{.*}}!{{<unknown kind #36>|kcfi_type}} ![[TYPE1:[0-9]+]] + // CHECK: call i32 %f(i32 %arg){{.*}}[ "kcfi"(i32 -1666898348) ] + f(arg) +} + +pub fn bar(f: fn(i32, i32) -> i32, arg1: i32, arg2: i32) -> i32 { + // CHECK-LABEL: define{{.*}}bar + // CHECK-SAME: {{.*}}!{{<unknown kind #36>|kcfi_type}} ![[TYPE2:[0-9]+]] + // CHECK: call i32 %f(i32 %arg1, i32 %arg2){{.*}}[ "kcfi"(i32 -1789026986) ] + f(arg1, arg2) +} + +pub fn baz(f: fn(i32, i32, i32) -> i32, arg1: i32, arg2: i32, arg3: i32) -> i32 { + // CHECK-LABEL: define{{.*}}baz + // CHECK-SAME: {{.*}}!{{<unknown kind #36>|kcfi_type}} ![[TYPE3:[0-9]+]] + // CHECK: call i32 %f(i32 %arg1, i32 %arg2, i32 %arg3){{.*}}[ "kcfi"(i32 1248878270) ] + f(arg1, arg2, arg3) +} + +// CHECK: ![[TYPE1]] = !{i32 653723426} +// CHECK: ![[TYPE2]] = !{i32 412174924} +// CHECK: ![[TYPE3]] = !{i32 -636668840} diff --git a/src/test/codegen/sanitizer-memory-track-orgins.rs b/tests/codegen/sanitizer-memory-track-orgins.rs index 4bd50508d..4bd50508d 100644 --- a/src/test/codegen/sanitizer-memory-track-orgins.rs +++ b/tests/codegen/sanitizer-memory-track-orgins.rs diff --git a/src/test/codegen/sanitizer-no-sanitize-inlining.rs b/tests/codegen/sanitizer-no-sanitize-inlining.rs index f4af60bae..f4af60bae 100644 --- a/src/test/codegen/sanitizer-no-sanitize-inlining.rs +++ b/tests/codegen/sanitizer-no-sanitize-inlining.rs diff --git a/src/test/codegen/sanitizer-no-sanitize.rs b/tests/codegen/sanitizer-no-sanitize.rs index fb9d249da..fb9d249da 100644 --- a/src/test/codegen/sanitizer-no-sanitize.rs +++ b/tests/codegen/sanitizer-no-sanitize.rs diff --git a/src/test/codegen/sanitizer-recover.rs b/tests/codegen/sanitizer-recover.rs index 7ce0fa0a2..7b00fcf8e 100644 --- a/src/test/codegen/sanitizer-recover.rs +++ b/tests/codegen/sanitizer-recover.rs @@ -6,8 +6,8 @@ // revisions:ASAN ASAN-RECOVER MSAN MSAN-RECOVER MSAN-RECOVER-LTO // no-prefer-dynamic // -//[ASAN] compile-flags: -Zsanitizer=address -//[ASAN-RECOVER] compile-flags: -Zsanitizer=address -Zsanitizer-recover=address +//[ASAN] compile-flags: -Zsanitizer=address -Copt-level=0 +//[ASAN-RECOVER] compile-flags: -Zsanitizer=address -Zsanitizer-recover=address -Copt-level=0 //[MSAN] compile-flags: -Zsanitizer=memory //[MSAN-RECOVER] compile-flags: -Zsanitizer=memory -Zsanitizer-recover=memory //[MSAN-RECOVER-LTO] compile-flags: -Zsanitizer=memory -Zsanitizer-recover=memory -C lto=fat @@ -26,17 +26,17 @@ // ASAN-RECOVER-NOT: unreachable // ASAN: } // -// MSAN-LABEL: define dso_local i32 @penguin( +// MSAN-LABEL: define dso_local noundef i32 @penguin( // MSAN: call void @__msan_warning{{(_with_origin_noreturn\(i32 0\)|_noreturn\(\))}} // MSAN: unreachable // MSAN: } // -// MSAN-RECOVER-LABEL: define dso_local i32 @penguin( +// MSAN-RECOVER-LABEL: define dso_local noundef i32 @penguin( // MSAN-RECOVER: call void @__msan_warning{{(_with_origin\(i32 0\)|\(\))}} // MSAN-RECOVER-NOT: unreachable // MSAN-RECOVER: } // -// MSAN-RECOVER-LTO-LABEL: define dso_local i32 @penguin( +// MSAN-RECOVER-LTO-LABEL: define dso_local noundef i32 @penguin( // MSAN-RECOVER-LTO: call void @__msan_warning{{(_with_origin\(i32 0\)|\(\))}} // MSAN-RECOVER-LTO-NOT: unreachable // MSAN-RECOVER-LTO: } diff --git a/src/test/codegen/sanitizer_memtag_attr_check.rs b/tests/codegen/sanitizer_memtag_attr_check.rs index 2fd362656..2fd362656 100644 --- a/src/test/codegen/sanitizer_memtag_attr_check.rs +++ b/tests/codegen/sanitizer_memtag_attr_check.rs diff --git a/src/test/codegen/sanitizer_scs_attr_check.rs b/tests/codegen/sanitizer_scs_attr_check.rs index a885d9117..a885d9117 100644 --- a/src/test/codegen/sanitizer_scs_attr_check.rs +++ b/tests/codegen/sanitizer_scs_attr_check.rs diff --git a/src/test/codegen/scalar-pair-bool.rs b/tests/codegen/scalar-pair-bool.rs index 264f28fdb..8e8365b6a 100644 --- a/src/test/codegen/scalar-pair-bool.rs +++ b/tests/codegen/scalar-pair-bool.rs @@ -8,13 +8,13 @@ pub fn pair_bool_bool(pair: (bool, bool)) -> (bool, bool) { pair } -// CHECK: define{{.*}}{ i8, i32 } @pair_bool_i32(i1 noundef zeroext %pair.0, i32 %pair.1) +// CHECK: define{{.*}}{ i8, i32 } @pair_bool_i32(i1 noundef zeroext %pair.0, i32 noundef %pair.1) #[no_mangle] pub fn pair_bool_i32(pair: (bool, i32)) -> (bool, i32) { pair } -// CHECK: define{{.*}}{ i32, i8 } @pair_i32_bool(i32 %pair.0, i1 noundef zeroext %pair.1) +// CHECK: define{{.*}}{ i32, i8 } @pair_i32_bool(i32 noundef %pair.0, i1 noundef zeroext %pair.1) #[no_mangle] pub fn pair_i32_bool(pair: (i32, bool)) -> (i32, bool) { pair diff --git a/src/test/codegen/set-discriminant-invalid.rs b/tests/codegen/set-discriminant-invalid.rs index bccb9e4c7..bccb9e4c7 100644 --- a/src/test/codegen/set-discriminant-invalid.rs +++ b/tests/codegen/set-discriminant-invalid.rs diff --git a/src/test/codegen/simd-intrinsic/simd-intrinsic-float-abs.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-abs.rs index e7bb2327a..e7bb2327a 100644 --- a/src/test/codegen/simd-intrinsic/simd-intrinsic-float-abs.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-abs.rs diff --git a/src/test/codegen/simd-intrinsic/simd-intrinsic-float-ceil.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-ceil.rs index e33482d75..e33482d75 100644 --- a/src/test/codegen/simd-intrinsic/simd-intrinsic-float-ceil.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-ceil.rs diff --git a/src/test/codegen/simd-intrinsic/simd-intrinsic-float-cos.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-cos.rs index 0f52952bc..0f52952bc 100644 --- a/src/test/codegen/simd-intrinsic/simd-intrinsic-float-cos.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-cos.rs diff --git a/src/test/codegen/simd-intrinsic/simd-intrinsic-float-exp.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-exp.rs index 1154acf69..1154acf69 100644 --- a/src/test/codegen/simd-intrinsic/simd-intrinsic-float-exp.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-exp.rs diff --git a/src/test/codegen/simd-intrinsic/simd-intrinsic-float-exp2.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-exp2.rs index 929dc9ac8..929dc9ac8 100644 --- a/src/test/codegen/simd-intrinsic/simd-intrinsic-float-exp2.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-exp2.rs diff --git a/src/test/codegen/simd-intrinsic/simd-intrinsic-float-floor.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-floor.rs index 56ca644f6..56ca644f6 100644 --- a/src/test/codegen/simd-intrinsic/simd-intrinsic-float-floor.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-floor.rs diff --git a/src/test/codegen/simd-intrinsic/simd-intrinsic-float-fma.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-fma.rs index fd65cb72b..fd65cb72b 100644 --- a/src/test/codegen/simd-intrinsic/simd-intrinsic-float-fma.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-fma.rs diff --git a/src/test/codegen/simd-intrinsic/simd-intrinsic-float-fsqrt.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-fsqrt.rs index adc191925..adc191925 100644 --- a/src/test/codegen/simd-intrinsic/simd-intrinsic-float-fsqrt.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-fsqrt.rs diff --git a/src/test/codegen/simd-intrinsic/simd-intrinsic-float-log.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-log.rs index c072519c0..c072519c0 100644 --- a/src/test/codegen/simd-intrinsic/simd-intrinsic-float-log.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-log.rs diff --git a/src/test/codegen/simd-intrinsic/simd-intrinsic-float-log10.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-log10.rs index 5fd648995..5fd648995 100644 --- a/src/test/codegen/simd-intrinsic/simd-intrinsic-float-log10.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-log10.rs diff --git a/src/test/codegen/simd-intrinsic/simd-intrinsic-float-log2.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-log2.rs index 35175f0ca..35175f0ca 100644 --- a/src/test/codegen/simd-intrinsic/simd-intrinsic-float-log2.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-log2.rs diff --git a/src/test/codegen/simd-intrinsic/simd-intrinsic-float-minmax.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-minmax.rs index 4e0abed78..4e0abed78 100644 --- a/src/test/codegen/simd-intrinsic/simd-intrinsic-float-minmax.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-minmax.rs diff --git a/src/test/codegen/simd-intrinsic/simd-intrinsic-float-pow.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-pow.rs index 3b8d611ab..3b8d611ab 100644 --- a/src/test/codegen/simd-intrinsic/simd-intrinsic-float-pow.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-pow.rs diff --git a/src/test/codegen/simd-intrinsic/simd-intrinsic-float-powi.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-powi.rs index e80c50c10..e80c50c10 100644 --- a/src/test/codegen/simd-intrinsic/simd-intrinsic-float-powi.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-powi.rs diff --git a/src/test/codegen/simd-intrinsic/simd-intrinsic-float-sin.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-sin.rs index 9e3fab49a..9e3fab49a 100644 --- a/src/test/codegen/simd-intrinsic/simd-intrinsic-float-sin.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-sin.rs diff --git a/src/test/codegen/simd-intrinsic/simd-intrinsic-generic-arithmetic-saturating.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-arithmetic-saturating.rs index 6fb0ceb40..6fb0ceb40 100644 --- a/src/test/codegen/simd-intrinsic/simd-intrinsic-generic-arithmetic-saturating.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-arithmetic-saturating.rs diff --git a/src/test/codegen/simd-intrinsic/simd-intrinsic-generic-bitmask.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-bitmask.rs index 4a98d797b..4a98d797b 100644 --- a/src/test/codegen/simd-intrinsic/simd-intrinsic-generic-bitmask.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-bitmask.rs diff --git a/src/test/codegen/simd-intrinsic/simd-intrinsic-generic-extract-insert.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-extract-insert.rs index b5b0b1330..b5b0b1330 100644 --- a/src/test/codegen/simd-intrinsic/simd-intrinsic-generic-extract-insert.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-extract-insert.rs diff --git a/src/test/codegen/simd-intrinsic/simd-intrinsic-generic-gather.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-gather.rs index cacc32f2f..cacc32f2f 100644 --- a/src/test/codegen/simd-intrinsic/simd-intrinsic-generic-gather.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-gather.rs diff --git a/src/test/codegen/simd-intrinsic/simd-intrinsic-generic-scatter.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-scatter.rs index 94ecaf609..94ecaf609 100644 --- a/src/test/codegen/simd-intrinsic/simd-intrinsic-generic-scatter.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-scatter.rs diff --git a/src/test/codegen/simd-intrinsic/simd-intrinsic-generic-select.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-select.rs index 03bb22655..03bb22655 100644 --- a/src/test/codegen/simd-intrinsic/simd-intrinsic-generic-select.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-select.rs diff --git a/src/test/codegen/simd-intrinsic/simd-intrinsic-transmute-array.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-transmute-array.rs index db5b60567..db5b60567 100644 --- a/src/test/codegen/simd-intrinsic/simd-intrinsic-transmute-array.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-transmute-array.rs diff --git a/src/test/codegen/simd-wide-sum.rs b/tests/codegen/simd-wide-sum.rs index 04314dc29..04314dc29 100644 --- a/src/test/codegen/simd-wide-sum.rs +++ b/tests/codegen/simd-wide-sum.rs diff --git a/src/test/codegen/simd_arith_offset.rs b/tests/codegen/simd_arith_offset.rs index 7b623a22a..7b623a22a 100644 --- a/src/test/codegen/simd_arith_offset.rs +++ b/tests/codegen/simd_arith_offset.rs diff --git a/src/test/codegen/slice-as_chunks.rs b/tests/codegen/slice-as_chunks.rs index 48e3f73fc..48e3f73fc 100644 --- a/src/test/codegen/slice-as_chunks.rs +++ b/tests/codegen/slice-as_chunks.rs diff --git a/src/test/codegen/slice-init.rs b/tests/codegen/slice-init.rs index 794b773a7..794b773a7 100644 --- a/src/test/codegen/slice-init.rs +++ b/tests/codegen/slice-init.rs diff --git a/src/test/codegen/slice-iter-len-eq-zero.rs b/tests/codegen/slice-iter-len-eq-zero.rs index 894b0ec3d..894b0ec3d 100644 --- a/src/test/codegen/slice-iter-len-eq-zero.rs +++ b/tests/codegen/slice-iter-len-eq-zero.rs diff --git a/src/test/codegen/slice-position-bounds-check.rs b/tests/codegen/slice-position-bounds-check.rs index b494f42b2..b494f42b2 100644 --- a/src/test/codegen/slice-position-bounds-check.rs +++ b/tests/codegen/slice-position-bounds-check.rs diff --git a/src/test/codegen/slice-ref-equality.rs b/tests/codegen/slice-ref-equality.rs index 47fde12bf..47fde12bf 100644 --- a/src/test/codegen/slice-ref-equality.rs +++ b/tests/codegen/slice-ref-equality.rs diff --git a/src/test/codegen/slice-reverse.rs b/tests/codegen/slice-reverse.rs index e50b22f3a..e50b22f3a 100644 --- a/src/test/codegen/slice-reverse.rs +++ b/tests/codegen/slice-reverse.rs diff --git a/src/test/codegen/slice-windows-no-bounds-check.rs b/tests/codegen/slice-windows-no-bounds-check.rs index 4f5f4425c..4f5f4425c 100644 --- a/src/test/codegen/slice-windows-no-bounds-check.rs +++ b/tests/codegen/slice-windows-no-bounds-check.rs diff --git a/src/test/codegen/slice_as_from_ptr_range.rs b/tests/codegen/slice_as_from_ptr_range.rs index 0e3fefd97..0e3fefd97 100644 --- a/src/test/codegen/slice_as_from_ptr_range.rs +++ b/tests/codegen/slice_as_from_ptr_range.rs diff --git a/src/test/codegen/some-abis-do-extend-params-to-32-bits.rs b/tests/codegen/some-abis-do-extend-params-to-32-bits.rs index 7fc34af3d..9f2d9d065 100644 --- a/src/test/codegen/some-abis-do-extend-params-to-32-bits.rs +++ b/tests/codegen/some-abis-do-extend-params-to-32-bits.rs @@ -1,4 +1,4 @@ -// compile-flags: -Cno-prepopulate-passes +// compile-flags: -Cno-prepopulate-passes -Copt-level=0 // revisions:x86_64 i686 aarch64-apple aarch64-windows aarch64-linux arm riscv diff --git a/src/test/codegen/some-global-nonnull.rs b/tests/codegen/some-global-nonnull.rs index 59c47de41..59c47de41 100644 --- a/src/test/codegen/some-global-nonnull.rs +++ b/tests/codegen/some-global-nonnull.rs diff --git a/src/test/codegen/sparc-struct-abi.rs b/tests/codegen/sparc-struct-abi.rs index e8816e4f3..e8816e4f3 100644 --- a/src/test/codegen/sparc-struct-abi.rs +++ b/tests/codegen/sparc-struct-abi.rs diff --git a/src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs b/tests/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs index 64be11277..64be11277 100644 --- a/src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs +++ b/tests/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs diff --git a/src/test/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs b/tests/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs index 54e071521..54e071521 100644 --- a/src/test/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs +++ b/tests/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs diff --git a/src/test/codegen/src-hash-algorithm/src-hash-algorithm-sha256.rs b/tests/codegen/src-hash-algorithm/src-hash-algorithm-sha256.rs index dc7db8e23..dc7db8e23 100644 --- a/src/test/codegen/src-hash-algorithm/src-hash-algorithm-sha256.rs +++ b/tests/codegen/src-hash-algorithm/src-hash-algorithm-sha256.rs diff --git a/src/test/codegen/sse42-implies-crc32.rs b/tests/codegen/sse42-implies-crc32.rs index 47b1a8993..47b1a8993 100644 --- a/src/test/codegen/sse42-implies-crc32.rs +++ b/tests/codegen/sse42-implies-crc32.rs diff --git a/src/test/codegen/stack-probes-call.rs b/tests/codegen/stack-probes-call.rs index a18fd41c2..a18fd41c2 100644 --- a/src/test/codegen/stack-probes-call.rs +++ b/tests/codegen/stack-probes-call.rs diff --git a/src/test/codegen/stack-probes-inline.rs b/tests/codegen/stack-probes-inline.rs index a6b781de5..a6b781de5 100644 --- a/src/test/codegen/stack-probes-inline.rs +++ b/tests/codegen/stack-probes-inline.rs diff --git a/src/test/codegen/stack-protector.rs b/tests/codegen/stack-protector.rs index a24e6f1e4..a24e6f1e4 100644 --- a/src/test/codegen/stack-protector.rs +++ b/tests/codegen/stack-protector.rs diff --git a/src/test/codegen/static-relocation-model-msvc.rs b/tests/codegen/static-relocation-model-msvc.rs index b2afc7deb..735ef7081 100644 --- a/src/test/codegen/static-relocation-model-msvc.rs +++ b/tests/codegen/static-relocation-model-msvc.rs @@ -15,8 +15,8 @@ extern crate extern_decl; // it to be marked `dso_local` as well, given the static relocation model. // // CHECK: @extern_static = external dso_local local_unnamed_addr global i8 -// CHECK: define dso_local i8 @access_extern() {{.*}} -// CHECK: declare dso_local i8 @extern_fn() {{.*}} +// CHECK: define dso_local noundef i8 @access_extern() {{.*}} +// CHECK: declare dso_local noundef i8 @extern_fn() {{.*}} #[no_mangle] pub fn access_extern() -> u8 { diff --git a/src/test/codegen/staticlib-external-inline-fns.rs b/tests/codegen/staticlib-external-inline-fns.rs index 432c063e8..432c063e8 100644 --- a/src/test/codegen/staticlib-external-inline-fns.rs +++ b/tests/codegen/staticlib-external-inline-fns.rs diff --git a/src/test/codegen/stores.rs b/tests/codegen/stores.rs index 837256e53..837256e53 100644 --- a/src/test/codegen/stores.rs +++ b/tests/codegen/stores.rs diff --git a/src/test/codegen/swap-large-types.rs b/tests/codegen/swap-large-types.rs index 4a6840357..4a6840357 100644 --- a/src/test/codegen/swap-large-types.rs +++ b/tests/codegen/swap-large-types.rs diff --git a/src/test/codegen/swap-simd-types.rs b/tests/codegen/swap-simd-types.rs index c90b277eb..c90b277eb 100644 --- a/src/test/codegen/swap-simd-types.rs +++ b/tests/codegen/swap-simd-types.rs diff --git a/src/test/codegen/swap-small-types.rs b/tests/codegen/swap-small-types.rs index 03e2a2327..03e2a2327 100644 --- a/src/test/codegen/swap-small-types.rs +++ b/tests/codegen/swap-small-types.rs diff --git a/src/test/codegen/target-cpu-on-functions.rs b/tests/codegen/target-cpu-on-functions.rs index c043eceb5..c043eceb5 100644 --- a/src/test/codegen/target-cpu-on-functions.rs +++ b/tests/codegen/target-cpu-on-functions.rs diff --git a/src/test/codegen/target-feature-overrides.rs b/tests/codegen/target-feature-overrides.rs index 4be77e36e..1bebf66f0 100644 --- a/src/test/codegen/target-feature-overrides.rs +++ b/tests/codegen/target-feature-overrides.rs @@ -4,7 +4,7 @@ // [COMPAT] compile-flags: -Ctarget-feature=+avx2,+avx // [INCOMPAT] compile-flags: -Ctarget-feature=-avx2,-avx -// See also src/test/assembly/target-feature-multiple.rs +// See also tests/assembly/target-feature-multiple.rs #![feature(no_core, lang_items)] #![crate_type = "lib"] #![no_core] diff --git a/src/test/codegen/thread-local.rs b/tests/codegen/thread-local.rs index 0f1b29ca7..0f1b29ca7 100644 --- a/src/test/codegen/thread-local.rs +++ b/tests/codegen/thread-local.rs diff --git a/src/test/codegen/to_vec.rs b/tests/codegen/to_vec.rs index 60dc4efcb..60dc4efcb 100644 --- a/src/test/codegen/to_vec.rs +++ b/tests/codegen/to_vec.rs diff --git a/src/test/codegen/transmute-scalar.rs b/tests/codegen/transmute-scalar.rs index a7e5deeff..260dcbac0 100644 --- a/src/test/codegen/transmute-scalar.rs +++ b/tests/codegen/transmute-scalar.rs @@ -5,7 +5,7 @@ // FIXME(eddyb) all of these tests show memory stores and loads, even after a // scalar `bitcast`, more special-casing is required to remove `alloca` usage. -// CHECK-LABEL: define{{.*}}i32 @f32_to_bits(float %x) +// CHECK-LABEL: define{{.*}}i32 @f32_to_bits(float noundef %x) // CHECK: store i32 %{{.*}}, {{.*}} %0 // CHECK-NEXT: %[[RES:.*]] = load i32, {{.*}} %0 // CHECK: ret i32 %[[RES]] @@ -24,7 +24,7 @@ pub fn bool_to_byte(b: bool) -> u8 { unsafe { std::mem::transmute(b) } } -// CHECK-LABEL: define{{.*}}noundef zeroext i1 @byte_to_bool(i8 %byte) +// CHECK-LABEL: define{{.*}}noundef zeroext i1 @byte_to_bool(i8 noundef %byte) // CHECK: %1 = trunc i8 %byte to i1 // CHECK-NEXT: %2 = zext i1 %1 to i8 // CHECK-NEXT: store i8 %2, {{.*}} %0 @@ -36,7 +36,7 @@ pub unsafe fn byte_to_bool(byte: u8) -> bool { std::mem::transmute(byte) } -// CHECK-LABEL: define{{.*}}{{i8\*|ptr}} @ptr_to_ptr({{i16\*|ptr}} %p) +// CHECK-LABEL: define{{.*}}{{i8\*|ptr}} @ptr_to_ptr({{i16\*|ptr}} noundef %p) // CHECK: store {{i8\*|ptr}} %{{.*}}, {{.*}} %0 // CHECK-NEXT: %[[RES:.*]] = load {{i8\*|ptr}}, {{.*}} %0 // CHECK: ret {{i8\*|ptr}} %[[RES]] @@ -52,7 +52,7 @@ pub fn ptr_to_ptr(p: *mut u16) -> *mut u8 { // Tests below show the non-special-cased behavior (with the possible // future special-cased instructions in the "NOTE(eddyb)" comments). -// CHECK: define{{.*}}[[USIZE:i[0-9]+]] @ptr_to_int({{i16\*|ptr}} %p) +// CHECK: define{{.*}}[[USIZE:i[0-9]+]] @ptr_to_int({{i16\*|ptr}} noundef %p) // NOTE(eddyb) see above, the following two CHECK lines should ideally be this: // %2 = ptrtoint i16* %p to [[USIZE]] @@ -66,7 +66,7 @@ pub fn ptr_to_int(p: *mut u16) -> usize { unsafe { std::mem::transmute(p) } } -// CHECK: define{{.*}}{{i16\*|ptr}} @int_to_ptr([[USIZE]] %i) +// CHECK: define{{.*}}{{i16\*|ptr}} @int_to_ptr([[USIZE]] noundef %i) // NOTE(eddyb) see above, the following two CHECK lines should ideally be this: // %2 = inttoptr [[USIZE]] %i to i16* diff --git a/src/test/codegen/try_identity.rs b/tests/codegen/try_identity.rs index 92be90014..92be90014 100644 --- a/src/test/codegen/try_identity.rs +++ b/tests/codegen/try_identity.rs diff --git a/src/test/codegen/try_question_mark_nop.rs b/tests/codegen/try_question_mark_nop.rs index d23938776..d23938776 100644 --- a/src/test/codegen/try_question_mark_nop.rs +++ b/tests/codegen/try_question_mark_nop.rs diff --git a/src/test/codegen/tune-cpu-on-functions.rs b/tests/codegen/tune-cpu-on-functions.rs index ed8dc0e93..ed8dc0e93 100644 --- a/src/test/codegen/tune-cpu-on-functions.rs +++ b/tests/codegen/tune-cpu-on-functions.rs diff --git a/src/test/codegen/tuple-layout-opt.rs b/tests/codegen/tuple-layout-opt.rs index e86c75f3f..35f760851 100644 --- a/src/test/codegen/tuple-layout-opt.rs +++ b/tests/codegen/tuple-layout-opt.rs @@ -1,5 +1,5 @@ // ignore-emscripten -// compile-flags: -C no-prepopulate-passes +// compile-flags: -C no-prepopulate-passes -Copt-level=0 // Test that tuples get optimized layout, in particular with a ZST in the last field (#63244) diff --git a/src/test/codegen/unchecked-float-casts.rs b/tests/codegen/unchecked-float-casts.rs index 4e3bfcd43..4e3bfcd43 100644 --- a/src/test/codegen/unchecked-float-casts.rs +++ b/tests/codegen/unchecked-float-casts.rs diff --git a/src/test/codegen/unchecked_shifts.rs b/tests/codegen/unchecked_shifts.rs index 60d0cb09a..60d0cb09a 100644 --- a/src/test/codegen/unchecked_shifts.rs +++ b/tests/codegen/unchecked_shifts.rs diff --git a/src/test/codegen/uninit-consts.rs b/tests/codegen/uninit-consts.rs index 4c07740b3..98a6761f8 100644 --- a/src/test/codegen/uninit-consts.rs +++ b/tests/codegen/uninit-consts.rs @@ -14,7 +14,7 @@ pub struct PartiallyUninit { // CHECK: [[FULLY_UNINIT:@[0-9]+]] = private unnamed_addr constant <{ [10 x i8] }> undef -// CHECK: [[PARTIALLY_UNINIT:@[0-9]+]] = private unnamed_addr constant <{ [4 x i8], [12 x i8] }> <{ [4 x i8] c"\EF\BE\AD\DE", [12 x i8] undef }>, align 4 +// CHECK: [[PARTIALLY_UNINIT:@[0-9]+]] = private unnamed_addr constant <{ [4 x i8], [12 x i8] }> <{ [4 x i8] c"{{\\EF\\BE\\AD\\DE|\\DE\\AD\\BE\\EF}}", [12 x i8] undef }>, align 4 // This shouldn't contain undef, since it contains more chunks // than the default value of uninit_const_chunk_threshold. diff --git a/src/test/codegen/union-abi.rs b/tests/codegen/union-abi.rs index c18f2a49f..c18f2a49f 100644 --- a/src/test/codegen/union-abi.rs +++ b/tests/codegen/union-abi.rs diff --git a/src/test/codegen/unpadded-simd.rs b/tests/codegen/unpadded-simd.rs index eb44dbd93..eb44dbd93 100644 --- a/src/test/codegen/unpadded-simd.rs +++ b/tests/codegen/unpadded-simd.rs diff --git a/src/test/codegen/unwind-abis/aapcs-unwind-abi.rs b/tests/codegen/unwind-abis/aapcs-unwind-abi.rs index c092e28a0..c092e28a0 100644 --- a/src/test/codegen/unwind-abis/aapcs-unwind-abi.rs +++ b/tests/codegen/unwind-abis/aapcs-unwind-abi.rs diff --git a/src/test/codegen/unwind-abis/c-unwind-abi-panic-abort.rs b/tests/codegen/unwind-abis/c-unwind-abi-panic-abort.rs index 8447bbeb1..ea5bae18e 100644 --- a/src/test/codegen/unwind-abis/c-unwind-abi-panic-abort.rs +++ b/tests/codegen/unwind-abis/c-unwind-abi-panic-abort.rs @@ -9,7 +9,8 @@ // CHECK: @rust_item_that_can_unwind() unnamed_addr [[ATTR0:#[0-9]+]] #[no_mangle] pub unsafe extern "C-unwind" fn rust_item_that_can_unwind() { - // CHECK: call void @_ZN4core9panicking15panic_no_unwind + // Handle both legacy and v0 symbol mangling. + // CHECK: call void @{{.*core9panicking19panic_cannot_unwind}} may_unwind(); } diff --git a/src/test/codegen/unwind-abis/c-unwind-abi.rs b/tests/codegen/unwind-abis/c-unwind-abi.rs index e258dbcac..e258dbcac 100644 --- a/src/test/codegen/unwind-abis/c-unwind-abi.rs +++ b/tests/codegen/unwind-abis/c-unwind-abi.rs diff --git a/src/test/codegen/unwind-abis/cdecl-unwind-abi.rs b/tests/codegen/unwind-abis/cdecl-unwind-abi.rs index 19a722883..19a722883 100644 --- a/src/test/codegen/unwind-abis/cdecl-unwind-abi.rs +++ b/tests/codegen/unwind-abis/cdecl-unwind-abi.rs diff --git a/src/test/codegen/unwind-abis/fastcall-unwind-abi.rs b/tests/codegen/unwind-abis/fastcall-unwind-abi.rs index b74099a5d..b74099a5d 100644 --- a/src/test/codegen/unwind-abis/fastcall-unwind-abi.rs +++ b/tests/codegen/unwind-abis/fastcall-unwind-abi.rs diff --git a/src/test/codegen/unwind-abis/nounwind-on-stable-panic-abort.rs b/tests/codegen/unwind-abis/nounwind-on-stable-panic-abort.rs index 106d593b2..106d593b2 100644 --- a/src/test/codegen/unwind-abis/nounwind-on-stable-panic-abort.rs +++ b/tests/codegen/unwind-abis/nounwind-on-stable-panic-abort.rs diff --git a/src/test/codegen/unwind-abis/nounwind-on-stable-panic-unwind.rs b/tests/codegen/unwind-abis/nounwind-on-stable-panic-unwind.rs index c1c5bbdda..c1c5bbdda 100644 --- a/src/test/codegen/unwind-abis/nounwind-on-stable-panic-unwind.rs +++ b/tests/codegen/unwind-abis/nounwind-on-stable-panic-unwind.rs diff --git a/src/test/codegen/unwind-abis/nounwind.rs b/tests/codegen/unwind-abis/nounwind.rs index c46d71733..c46d71733 100644 --- a/src/test/codegen/unwind-abis/nounwind.rs +++ b/tests/codegen/unwind-abis/nounwind.rs diff --git a/src/test/codegen/unwind-abis/stdcall-unwind-abi.rs b/tests/codegen/unwind-abis/stdcall-unwind-abi.rs index 8eff0719f..8eff0719f 100644 --- a/src/test/codegen/unwind-abis/stdcall-unwind-abi.rs +++ b/tests/codegen/unwind-abis/stdcall-unwind-abi.rs diff --git a/src/test/codegen/unwind-abis/system-unwind-abi.rs b/tests/codegen/unwind-abis/system-unwind-abi.rs index 2591c1d48..2591c1d48 100644 --- a/src/test/codegen/unwind-abis/system-unwind-abi.rs +++ b/tests/codegen/unwind-abis/system-unwind-abi.rs diff --git a/src/test/codegen/unwind-abis/sysv64-unwind-abi.rs b/tests/codegen/unwind-abis/sysv64-unwind-abi.rs index 694fde17c..694fde17c 100644 --- a/src/test/codegen/unwind-abis/sysv64-unwind-abi.rs +++ b/tests/codegen/unwind-abis/sysv64-unwind-abi.rs diff --git a/src/test/codegen/unwind-abis/thiscall-unwind-abi.rs b/tests/codegen/unwind-abis/thiscall-unwind-abi.rs index 7e81367fc..7e81367fc 100644 --- a/src/test/codegen/unwind-abis/thiscall-unwind-abi.rs +++ b/tests/codegen/unwind-abis/thiscall-unwind-abi.rs diff --git a/src/test/codegen/unwind-abis/vectorcall-unwind-abi.rs b/tests/codegen/unwind-abis/vectorcall-unwind-abi.rs index d7eca2a97..d7eca2a97 100644 --- a/src/test/codegen/unwind-abis/vectorcall-unwind-abi.rs +++ b/tests/codegen/unwind-abis/vectorcall-unwind-abi.rs diff --git a/src/test/codegen/unwind-abis/win64-unwind-abi.rs b/tests/codegen/unwind-abis/win64-unwind-abi.rs index 6591348c3..6591348c3 100644 --- a/src/test/codegen/unwind-abis/win64-unwind-abi.rs +++ b/tests/codegen/unwind-abis/win64-unwind-abi.rs diff --git a/tests/codegen/unwind-and-panic-abort.rs b/tests/codegen/unwind-and-panic-abort.rs new file mode 100644 index 000000000..e43e73b96 --- /dev/null +++ b/tests/codegen/unwind-and-panic-abort.rs @@ -0,0 +1,17 @@ +// compile-flags: -C panic=abort + +#![crate_type = "lib"] +#![feature(c_unwind)] + +extern "C-unwind" { + fn bar(); +} + +// CHECK: Function Attrs:{{.*}}nounwind +// CHECK-NEXT: define{{.*}}void @foo +// Handle both legacy and v0 symbol mangling. +// CHECK: call void @{{.*core9panicking19panic_cannot_unwind}} +#[no_mangle] +pub unsafe extern "C" fn foo() { + bar(); +} diff --git a/src/test/codegen/unwind-extern-exports.rs b/tests/codegen/unwind-extern-exports.rs index 6ac3c079f..6ac3c079f 100644 --- a/src/test/codegen/unwind-extern-exports.rs +++ b/tests/codegen/unwind-extern-exports.rs diff --git a/src/test/codegen/unwind-extern-imports.rs b/tests/codegen/unwind-extern-imports.rs index e33e3e805..e33e3e805 100644 --- a/src/test/codegen/unwind-extern-imports.rs +++ b/tests/codegen/unwind-extern-imports.rs diff --git a/src/test/codegen/used_with_arg.rs b/tests/codegen/used_with_arg.rs index 4515cb2ae..4515cb2ae 100644 --- a/src/test/codegen/used_with_arg.rs +++ b/tests/codegen/used_with_arg.rs diff --git a/src/test/codegen/var-names.rs b/tests/codegen/var-names.rs index 8f1b03870..d4715efad 100644 --- a/src/test/codegen/var-names.rs +++ b/tests/codegen/var-names.rs @@ -2,7 +2,7 @@ #![crate_type = "lib"] -// CHECK-LABEL: define{{.*}}i32 @test(i32 %a, i32 %b) +// CHECK-LABEL: define{{.*}}i32 @test(i32 noundef %a, i32 noundef %b) #[no_mangle] pub fn test(a: u32, b: u32) -> u32 { let c = a + b; diff --git a/src/test/codegen/vec-calloc-llvm14.rs b/tests/codegen/vec-calloc-llvm14.rs index 08302796c..08302796c 100644 --- a/src/test/codegen/vec-calloc-llvm14.rs +++ b/tests/codegen/vec-calloc-llvm14.rs diff --git a/src/test/codegen/vec-calloc.rs b/tests/codegen/vec-calloc.rs index ae6e448f1..4481a9d1e 100644 --- a/src/test/codegen/vec-calloc.rs +++ b/tests/codegen/vec-calloc.rs @@ -161,7 +161,24 @@ pub fn vec_option_bool(n: usize) -> Vec<Option<bool>> { vec![Some(false); n] } +// CHECK-LABEL: @vec_option_i32 +#[no_mangle] +pub fn vec_option_i32(n: usize) -> Vec<Option<i32>> { + // CHECK-NOT: call {{.*}}alloc::vec::from_elem + // CHECK-NOT: call {{.*}}reserve + // CHECK-NOT: call {{.*}}__rust_alloc( + + // CHECK: call {{.*}}__rust_alloc_zeroed( + + // CHECK-NOT: call {{.*}}alloc::vec::from_elem + // CHECK-NOT: call {{.*}}reserve + // CHECK-NOT: call {{.*}}__rust_alloc( + + // CHECK: ret void + vec![None; n] +} + // Ensure that __rust_alloc_zeroed gets the right attributes for LLVM to optimize it away. -// CHECK: declare noalias ptr @__rust_alloc_zeroed(i64, i64 allocalign) unnamed_addr [[RUST_ALLOC_ZEROED_ATTRS:#[0-9]+]] +// CHECK: declare noalias noundef ptr @__rust_alloc_zeroed(i64 noundef, i64 allocalign noundef) unnamed_addr [[RUST_ALLOC_ZEROED_ATTRS:#[0-9]+]] // CHECK-DAG: attributes [[RUST_ALLOC_ZEROED_ATTRS]] = { {{.*}} allockind("alloc,zeroed,aligned") allocsize(0) uwtable "alloc-family"="__rust_alloc" {{.*}} } diff --git a/src/test/codegen/vec-in-place.rs b/tests/codegen/vec-in-place.rs index 5df366905..5df366905 100644 --- a/src/test/codegen/vec-in-place.rs +++ b/tests/codegen/vec-in-place.rs diff --git a/src/test/codegen/vec-iter-collect-len.rs b/tests/codegen/vec-iter-collect-len.rs index 73348ddd0..73348ddd0 100644 --- a/src/test/codegen/vec-iter-collect-len.rs +++ b/tests/codegen/vec-iter-collect-len.rs diff --git a/src/test/codegen/vec-optimizes-away.rs b/tests/codegen/vec-optimizes-away.rs index 9143fad23..9143fad23 100644 --- a/src/test/codegen/vec-optimizes-away.rs +++ b/tests/codegen/vec-optimizes-away.rs diff --git a/tests/codegen/vec-shrink-panik.rs b/tests/codegen/vec-shrink-panik.rs new file mode 100644 index 000000000..aa6589dc3 --- /dev/null +++ b/tests/codegen/vec-shrink-panik.rs @@ -0,0 +1,47 @@ +// compile-flags: -O +// ignore-debug: the debug assertions get in the way +#![crate_type = "lib"] +#![feature(shrink_to)] + +// Make sure that `Vec::shrink_to_fit` never emits panics via `RawVec::shrink_to_fit`, +// "Tried to shrink to a larger capacity", because the length is *always* <= capacity. + +// CHECK-LABEL: @shrink_to_fit +#[no_mangle] +pub fn shrink_to_fit(vec: &mut Vec<u32>) { + // CHECK-NOT: panic + vec.shrink_to_fit(); +} + +// CHECK-LABEL: @issue71861 +#[no_mangle] +pub fn issue71861(vec: Vec<u32>) -> Box<[u32]> { + // CHECK-NOT: panic + + // Call to panic_cannot_unwind in case of double-panic is expected, + // but other panics are not. + // CHECK: cleanup + // CHECK-NEXT: ; call core::panicking::panic_cannot_unwind + // CHECK-NEXT: panic_cannot_unwind + + // CHECK-NOT: panic + vec.into_boxed_slice() +} + +// CHECK-LABEL: @issue75636 +#[no_mangle] +pub fn issue75636<'a>(iter: &[&'a str]) -> Box<[&'a str]> { + // CHECK-NOT: panic + + // Call to panic_cannot_unwind in case of double-panic is expected, + // but other panics are not. + // CHECK: cleanup + // CHECK-NEXT: ; call core::panicking::panic_cannot_unwind + // CHECK-NEXT: panic_cannot_unwind + + // CHECK-NOT: panic + iter.iter().copied().collect() +} + +// CHECK: ; core::panicking::panic_cannot_unwind +// CHECK: declare void @{{.*}}panic_cannot_unwind diff --git a/src/test/codegen/vecdeque_no_panic.rs b/tests/codegen/vecdeque_no_panic.rs index cbf420bad..cbf420bad 100644 --- a/src/test/codegen/vecdeque_no_panic.rs +++ b/tests/codegen/vecdeque_no_panic.rs diff --git a/src/test/codegen/virtual-function-elimination-32bit.rs b/tests/codegen/virtual-function-elimination-32bit.rs index 6f963363a..6f963363a 100644 --- a/src/test/codegen/virtual-function-elimination-32bit.rs +++ b/tests/codegen/virtual-function-elimination-32bit.rs diff --git a/src/test/codegen/virtual-function-elimination.rs b/tests/codegen/virtual-function-elimination.rs index 4cf7e12fe..4cf7e12fe 100644 --- a/src/test/codegen/virtual-function-elimination.rs +++ b/tests/codegen/virtual-function-elimination.rs diff --git a/src/test/codegen/wasm_casts_trapping.rs b/tests/codegen/wasm_casts_trapping.rs index eb06c4975..eb06c4975 100644 --- a/src/test/codegen/wasm_casts_trapping.rs +++ b/tests/codegen/wasm_casts_trapping.rs diff --git a/src/test/codegen/x86_64-macosx-deployment-target.rs b/tests/codegen/x86_64-macosx-deployment-target.rs index 8e673d11d..8e673d11d 100644 --- a/src/test/codegen/x86_64-macosx-deployment-target.rs +++ b/tests/codegen/x86_64-macosx-deployment-target.rs diff --git a/src/test/codegen/x86_64-no-macosx-deployment-target.rs b/tests/codegen/x86_64-no-macosx-deployment-target.rs index 25ae6924d..25ae6924d 100644 --- a/src/test/codegen/x86_64-no-macosx-deployment-target.rs +++ b/tests/codegen/x86_64-no-macosx-deployment-target.rs diff --git a/src/test/codegen/zip.rs b/tests/codegen/zip.rs index e55f4f1a2..e55f4f1a2 100644 --- a/src/test/codegen/zip.rs +++ b/tests/codegen/zip.rs diff --git a/src/test/codegen/zst-offset.rs b/tests/codegen/zst-offset.rs index 29d2a1754..cef4b9bda 100644 --- a/src/test/codegen/zst-offset.rs +++ b/tests/codegen/zst-offset.rs @@ -1,4 +1,4 @@ -// compile-flags: -C no-prepopulate-passes +// compile-flags: -C no-prepopulate-passes -Copt-level=0 #![crate_type = "lib"] #![feature(repr_simd)] @@ -15,7 +15,7 @@ pub fn helper(_: usize) { pub fn scalar_layout(s: &(u64, ())) { // CHECK: getelementptr i8, {{.+}}, [[USIZE]] 8 let x = &s.1; - &x; // keep variable in an alloca + witness(&x); // keep variable in an alloca } // Check that we correctly generate a GEP for a ZST that is not included in ScalarPair layout @@ -24,7 +24,7 @@ pub fn scalar_layout(s: &(u64, ())) { pub fn scalarpair_layout(s: &(u64, u32, ())) { // CHECK: getelementptr i8, {{.+}}, [[USIZE]] 12 let x = &s.2; - &x; // keep variable in an alloca + witness(&x); // keep variable in an alloca } #[repr(simd)] @@ -36,5 +36,8 @@ pub struct U64x4(u64, u64, u64, u64); pub fn vector_layout(s: &(U64x4, ())) { // CHECK: getelementptr i8, {{.+}}, [[USIZE]] 32 let x = &s.1; - &x; // keep variable in an alloca + witness(&x); // keep variable in an alloca } + +#[inline(never)] +fn witness(_: &impl Sized) {} |