From a4b7ed7a42c716ab9f05e351f003d589124fd55d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:18:58 +0200 Subject: Adding upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/lto/debuginfo-lto.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tests/ui/lto/debuginfo-lto.rs (limited to 'tests/ui/lto/debuginfo-lto.rs') diff --git a/tests/ui/lto/debuginfo-lto.rs b/tests/ui/lto/debuginfo-lto.rs new file mode 100644 index 000000000..43f75b034 --- /dev/null +++ b/tests/ui/lto/debuginfo-lto.rs @@ -0,0 +1,25 @@ +// run-pass +// This test case makes sure that we don't run into LLVM's dreaded +// "possible ODR violation" assertion when compiling with LTO + Debuginfo. +// It covers cases that have traditionally been prone to cause this error. +// If new cases emerge, add them to this file. + +// aux-build:debuginfo-lto-aux.rs +// compile-flags: -C lto -g +// no-prefer-dynamic +// ignore-asmjs wasm2js does not support source maps yet + +extern crate debuginfo_lto_aux; + +fn some_fn(x: i32) -> i32 { + x + 1 +} + +fn main() { + let i = 0; + let _ = debuginfo_lto_aux::mk_struct_with_lt(&i); + let _ = debuginfo_lto_aux::mk_regular_struct(1); + let _ = debuginfo_lto_aux::take_fn(some_fn, 1); + let _ = debuginfo_lto_aux::with_closure(22); + let _ = debuginfo_lto_aux::generic_fn(0f32); +} -- cgit v1.2.3