Skip to content

Commit 2adfa14

Browse files
committed
rewrite issue-109934-lto-debuginfo as an ui test
1 parent 80fb4ca commit 2adfa14

File tree

4 files changed

+22
-22
lines changed

4 files changed

+22
-22
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ run-make/incr-add-rust-src-component/Makefile
4848
run-make/incr-foreign-head-span/Makefile
4949
run-make/interdependent-c-libraries/Makefile
5050
run-make/issue-107094/Makefile
51-
run-make/issue-109934-lto-debuginfo/Makefile
5251
run-make/issue-14698/Makefile
5352
run-make/issue-15460/Makefile
5453
run-make/issue-18943/Makefile

tests/run-make/issue-109934-lto-debuginfo/Makefile

-12
This file was deleted.

tests/run-make/issue-109934-lto-debuginfo/lib.rs

-9
This file was deleted.

tests/ui/lto/debuginfo-lto-alloc.rs

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// With the upgrade to LLVM 16, the following error appeared when using
2+
// link-time-optimization (LTO) alloc and debug compilation mode simultaneously:
3+
//
4+
// error: Cannot represent a difference across sections
5+
//
6+
// The error stemmed from DI function definitions under type scopes, fixed by
7+
// only declaring in type scope and defining the subprogram elsewhere.
8+
// This test reproduces the circumstances that caused the error to appear, and checks
9+
// that compilation is successful.
10+
11+
//@ check-pass
12+
//@ compile-flags: --test -C debuginfo=2 -C lto=fat -C incremental=inc-fat
13+
14+
extern crate alloc;
15+
16+
#[cfg(test)]
17+
mod tests {
18+
#[test]
19+
fn something_alloc() {
20+
assert_eq!(Vec::<u32>::new(), Vec::<u32>::new());
21+
}
22+
}

0 commit comments

Comments
 (0)