rust/tests/ui/lto
Wesley Wiser bbc40e7822 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 withing 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
updates the test added in the previous commit to ensure no warning is
printed.
2025-02-08 16:33:36 +00:00
..
auxiliary Add tests for -Zdwarf-version lto behavior 2025-02-08 16:33:36 +00:00
all-crates.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
debuginfo-lto-alloc.rs Don't output test artifacts into working directory 2024-07-21 13:45:55 -04:00
debuginfo-lto.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
dwarf-mixed-versions-lto.rs Add tests for -Zdwarf-version lto behavior 2025-02-08 16:33:36 +00:00
dylib-works.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
fat-lto.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-11154.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-11154.stderr Overhaul rustc_codegen_ssa:🔙:write::Diagnostic. 2024-02-22 12:51:11 +11:00
issue-100772.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-105637.rs Fix some typos in comments 2024-04-25 10:47:24 +08:00
issue-105637.run.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
lto-and-no-bitcode-in-rlib.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
lto-and-no-bitcode-in-rlib.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
lto-duplicate-symbols.rs Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
lto-duplicate-symbols.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
lto-many-codegen-units.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
lto-opt-level-s.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
lto-opt-level-z.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
lto-rustc-loads-linker-plugin.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
lto-still-runs-thread-dtors.rs Update tests for hidden references to mutable static 2024-09-13 14:10:56 +03:00
lto-thin-rustc-loads-linker-plugin.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
msvc-imp-present.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
thin-lto-global-allocator.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
thin-lto-inlines2.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
thin-lto-inlines.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
weak-works.rs Enable more tests on Windows 2025-02-03 10:39:32 -05:00