rust/tests/assembly
Urgau 5ec56e5fbb
Rollup merge of #136659 - wesleywiser:dwarf_version_lto_merge_behavior, r=jieyouxu
Pick the max DWARF version when LTO'ing modules with different versions

Currently, when rustc compiles code with `-Clto` enabled that was built
with different choices for `-Zdwarf-version`, a warning will be
reported. It's very easy to observe this by compiling most anything (eg,
"hello world") and specifying `-Clto -Zdwarf-version=5` since the
standard library is distributed with `-Zdwarf-version=4`.

This behavior isn't actually useful for a few reasons:
- From observation, LLVM chooses to pick the highest DWARF version
  anyway after issuing the warning.
- Clang specifies that in this case, the max version should be picked
  without a warning and as a general principle, we want to support
  x-lang LTO with Clang which implies using the same module flag merge
  behaviors.
- Debuggers need to be able to handle a variety of versions within the
  same debugging session as you can easily have some parts of a binary
  (or some dynamic libraries within an application) all compiled with
  different DWARF versions.

This commit changes the module flag merge behavior to match Clang and
use the highest version of DWARF. It also adds a test to ensure this
behavior is respected in the case of two crates being LTO'd together and
adds a test to ensure no warning is printed.

Fixes #130041 which fails due to these warnings being printed

cc #103057
2025-02-09 00:37:28 +01:00
..
asm tests/assembly/asm: Remove uses of rustc_attrs and lang_items features by using minicore 2024-12-18 02:59:07 +09:00
auxiliary Add tests for -Zdwarf-version lto behavior 2025-02-08 16:33:36 +00:00
compiletest-self-test tests/assembly: add minicore compiletest self-test 2024-10-31 18:20:11 +08:00
libs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
nvptx-kernel-abi Restore previous ABI for f_single_u8_arg 2025-01-26 14:14:33 +00:00
simd Ignore reduce-fadd-unordered on SGX platform 2024-09-16 16:54:48 +02:00
stack-protector Update the minimum external LLVM to 18 2024-09-18 13:53:31 -07:00
targets add nto80 x86-64 and aarch64 target 2025-01-24 12:41:49 +00:00
aarch64-naked-fn-no-bti-prolog.rs more asm! -> naked_asm! in tests 2024-10-06 18:12:25 +02:00
aarch64-pointer-auth.rs rustc_codegen_llvm: Add a new 'pc' option to branch-protection 2024-10-31 11:59:17 +00:00
align_offset.rs Run rustfmt on tests/assembly/. 2024-05-30 16:15:46 +10:00
breakpoint.rs Add core::arch::breakpoint and test 2024-12-02 23:56:24 -08:00
closure-inherit-target-feature.rs Run rustfmt on tests/assembly/. 2024-05-30 16:15:46 +10:00
cmse.rs Improve assembly test for CMSE ABIs 2024-09-23 18:57:38 +02:00
dwarf-mixed-versions-lto.rs Add tests for -Zdwarf-version lto behavior 2025-02-08 16:33:36 +00:00
dwarf4.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
dwarf5.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
is_aligned.rs Run rustfmt on tests/assembly/. 2024-05-30 16:15:46 +10:00
issue-83585-small-pod-struct-equality.rs Fix tests for 32 bits targets 2024-06-11 07:45:16 +00:00
manual-eq-efficient.rs Add test for efficient codegen of manual eq implementations of a small struct 2024-04-30 13:21:08 +00:00
niche-prefer-zero.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
nvptx-arch-default.rs NVPTX: Enable previously disabled tests 2024-03-11 13:35:58 +01:00
nvptx-arch-emit-asm.rs NVPTX: Enable previously disabled tests 2024-03-11 13:35:58 +01:00
nvptx-arch-link-arg.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
nvptx-arch-target-cpu.rs NVPTX: Enable previously disabled tests 2024-03-11 13:35:58 +01:00
nvptx-atomics.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
nvptx-c-abi-arg-v7.rs NVPTX:_Especially add the DoubleI32 struct as a nvptx abi test case since it was used as an example when discussing possible problems 2024-05-31 23:12:33 +02:00
nvptx-c-abi-ret-v7.rs NVPTX:_Especially add the DoubleI32 struct as a nvptx abi test case since it was used as an example when discussing possible problems 2024-05-31 23:12:33 +02:00
nvptx-internalizing.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
nvptx-linking-binary.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
nvptx-linking-cdylib.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
nvptx-safe-naming.rs NVPTX: Enable previously disabled tests 2024-03-11 13:35:58 +01:00
panic-no-unwind-no-uwtable.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
panic-unwind-no-uwtable.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
pic-relocation-model.rs Run rustfmt on tests/assembly/. 2024-05-30 16:15:46 +10:00
pie-relocation-model.rs Run rustfmt on tests/assembly/. 2024-05-30 16:15:46 +10:00
powerpc64-struct-abi.rs allow different sized load and store 2025-01-23 20:53:04 -05:00
riscv-soft-abi-with-float-features.rs tests: use max-llvm-major-version instead of ignore-llvm-version range like N - 99 2024-11-14 17:44:54 +08:00
rust-abi-arg-attr.rs remove support for rustc_safe_intrinsic attribute; use rustc_intrinsic functions instead 2024-11-08 09:16:00 +01:00
s390x-backchain-toggle.rs tests: add an assembly scanning test for s390x backchain switch 2024-09-04 08:10:53 -06:00
s390x-vector-abi.rs Support s390x z13 vector ABI 2024-11-14 22:14:11 +09:00
simd-bitmask.rs Update the minimum external LLVM to 18 2024-09-18 13:53:31 -07:00
simd-intrinsic-gather.rs Consistently use the most significant bit of vector masks 2025-01-26 16:44:23 +01:00
simd-intrinsic-mask-load.rs Consistently use the most significant bit of vector masks 2025-01-26 16:44:23 +01:00
simd-intrinsic-mask-reduce.rs Consistently use the most significant bit of vector masks 2025-01-26 16:44:23 +01:00
simd-intrinsic-mask-store.rs Consistently use the most significant bit of vector masks 2025-01-26 16:44:23 +01:00
simd-intrinsic-scatter.rs Consistently use the most significant bit of vector masks 2025-01-26 16:44:23 +01:00
simd-intrinsic-select.rs Consistently use the most significant bit of vector masks 2025-01-26 16:44:23 +01:00
slice-is_ascii.rs Ignore less tests in debug builds 2024-02-23 18:04:01 -05:00
small_data_threshold.rs Remove a footgun-y feature / relic of the past from the compiletest DSL 2025-02-03 05:45:18 +01:00
sparc-struct-abi.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
stack-probes.rs Update the minimum external LLVM to 18 2024-09-18 13:53:31 -07:00
static-relocation-model.rs Run rustfmt on tests/assembly/. 2024-05-30 16:15:46 +10:00
strict_provenance.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
target-feature-multiple.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
wasm32-naked-fn.rs work around the wasm32-unknown-unknown ABI being broken 2025-01-20 16:57:09 +01:00
wasm_exceptions.rs Fix wasm_exceptions test 2024-06-19 21:26:48 +01:00
x86-return-float.rs adjust asm test 2024-10-22 12:21:00 +01:00
x86_64-array-pair-load-store-merge.rs Make more of the test suite run on Mac Catalyst 2024-05-28 12:31:33 +02:00
x86_64-bigint-helpers.rs Fix x86_64-bigint-helpers test on LLVM 20 2025-01-23 10:15:04 +01:00
x86_64-cmp.rs tests: use max-llvm-major-version instead of ignore-llvm-version range like N - 99 2024-11-14 17:44:54 +08:00
x86_64-floating-point-clamp.rs Add inline comments why we're forcing the target cpu 2024-05-01 16:54:20 -07:00
x86_64-fortanix-unknown-sgx-lvi-generic-load.rs Run rustfmt on tests/assembly/. 2024-05-30 16:15:46 +10:00
x86_64-fortanix-unknown-sgx-lvi-generic-ret.rs Run rustfmt on tests/assembly/. 2024-05-30 16:15:46 +10:00
x86_64-fortanix-unknown-sgx-lvi-inline-assembly.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
x86_64-function-return.rs Make more of the test suite run on Mac Catalyst 2024-05-28 12:31:33 +02:00
x86_64-naked-fn-no-cet-prolog.rs more asm! -> naked_asm! in tests 2024-10-06 18:12:25 +02:00
x86_64-no-jump-tables.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
x86_64-sse_crc.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
x86_64-typed-swap.rs Avoid non-windows non-linux in assembly x64 test 2024-03-23 00:02:53 -07:00
x86_64-windows-float-abi.rs Match LLVM ABI in extern "C" functions for f128 on Windows 2024-07-30 20:23:33 +01:00