Skip to content

Commit 814fec9

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

File tree

3 files changed

+22
-21
lines changed

3 files changed

+22
-21
lines changed

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)