Files
rust/tests/ui
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
..
2025-02-04 10:57:49 +00:00
2025-01-07 16:04:14 +01:00
2025-01-24 22:08:39 +00:00
2024-12-12 23:36:27 +00:00
2024-12-31 23:46:39 +08:00
2025-01-30 17:10:19 +00:00
2025-01-07 16:04:14 +01:00
2024-12-13 14:18:41 -08:00
2025-01-07 16:04:14 +01:00
2025-02-07 16:02:19 +00:00
2024-12-12 23:36:27 +00:00
2025-02-04 21:42:43 +05:30
2025-02-08 22:28:21 +00:00
2024-11-16 20:03:31 +00:00
2025-01-28 19:35:51 +00:00
2025-01-07 16:04:14 +01:00
2025-01-26 13:55:59 +00:00
2025-02-03 10:39:32 -05:00
2025-01-30 20:37:56 -07:00
2025-01-06 06:11:06 +00:00
2025-01-29 15:45:13 +00:00
2024-12-25 10:36:32 +01:00
2025-02-03 19:00:22 +00:00
2025-01-23 10:55:01 +00:00
2025-02-04 21:42:43 +05:30
2024-10-28 14:20:28 +11:00
2024-10-28 14:20:28 +11:00
2024-12-02 03:43:50 -07:00
2024-10-30 16:47:47 -07:00

UI Tests

This folder contains rustc's UI tests.

Test Directives (Headers)

Typically, a UI test will have some test directives / headers which are special comments that tell compiletest how to build and interpret a test.

As part of an ongoing effort to rewrite compiletest (see https://github.com/rust-lang/compiler-team/issues/536), a major change proposal to change legacy compiletest-style headers // <directive> to ui_test-style headers //@ <directive> was accepted (see https://github.com/rust-lang/compiler-team/issues/512.

An example directive is ignore-test. In legacy compiletest style, the header would be written as

// ignore-test

but in ui_test style, the header would be written as

//@ ignore-test

compiletest is changed to accept only //@ directives for UI tests (currently), and will reject and report an error if it encounters any comments // <content> that may be parsed as a legacy compiletest-style test header. To fix this, you should migrate to the ui_test-style header //@ <content>.