diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt index 52410382828ce..fa41547d060e7 100644 --- a/src/tools/tidy/src/allowed_run_make_makefiles.txt +++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt @@ -48,7 +48,6 @@ run-make/incr-add-rust-src-component/Makefile run-make/incr-foreign-head-span/Makefile run-make/interdependent-c-libraries/Makefile run-make/issue-107094/Makefile -run-make/issue-109934-lto-debuginfo/Makefile run-make/issue-14698/Makefile run-make/issue-15460/Makefile run-make/issue-18943/Makefile diff --git a/tests/run-make/issue-109934-lto-debuginfo/Makefile b/tests/run-make/issue-109934-lto-debuginfo/Makefile deleted file mode 100644 index 3b7a99d3dbc62..0000000000000 --- a/tests/run-make/issue-109934-lto-debuginfo/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -# ignore-cross-compile -include ../tools.mk - -# With the upgrade to LLVM 16, this was getting: -# -# error: Cannot represent a difference across sections -# -# The error stemmed from DI function definitions under type scopes, fixed by -# only declaring in type scope and defining the subprogram elsewhere. - -all: - $(RUSTC) lib.rs --test -C lto=fat -C debuginfo=2 -C incremental=$(TMPDIR)/inc-fat diff --git a/tests/run-make/issue-109934-lto-debuginfo/lib.rs b/tests/run-make/issue-109934-lto-debuginfo/lib.rs deleted file mode 100644 index c405928bd1824..0000000000000 --- a/tests/run-make/issue-109934-lto-debuginfo/lib.rs +++ /dev/null @@ -1,9 +0,0 @@ -extern crate alloc; - -#[cfg(test)] -mod tests { - #[test] - fn something_alloc() { - assert_eq!(Vec::::new(), Vec::::new()); - } -} diff --git a/tests/ui/lto/debuginfo-lto-alloc.rs b/tests/ui/lto/debuginfo-lto-alloc.rs new file mode 100644 index 0000000000000..459103c354c1c --- /dev/null +++ b/tests/ui/lto/debuginfo-lto-alloc.rs @@ -0,0 +1,22 @@ +// With the upgrade to LLVM 16, the following error appeared when using +// link-time-optimization (LTO) alloc and debug compilation mode simultaneously: +// +// error: Cannot represent a difference across sections +// +// The error stemmed from DI function definitions under type scopes, fixed by +// only declaring in type scope and defining the subprogram elsewhere. +// This test reproduces the circumstances that caused the error to appear, and checks +// that compilation is successful. + +//@ check-pass +//@ compile-flags: --test -C debuginfo=2 -C lto=fat -C incremental=inc-fat + +extern crate alloc; + +#[cfg(test)] +mod tests { + #[test] + fn something_alloc() { + assert_eq!(Vec::::new(), Vec::::new()); + } +}