]> git.lizzy.rs Git - rust.git/blob - tests/ui/lto/debuginfo-lto.rs
Suggest coercion of `Result` using `?`
[rust.git] / tests / ui / lto / debuginfo-lto.rs
1 // run-pass
2 // This test case makes sure that we don't run into LLVM's dreaded
3 // "possible ODR violation" assertion when compiling with LTO + Debuginfo.
4 // It covers cases that have traditionally been prone to cause this error.
5 // If new cases emerge, add them to this file.
6
7 // aux-build:debuginfo-lto-aux.rs
8 // compile-flags: -C lto -g
9 // no-prefer-dynamic
10 // ignore-asmjs wasm2js does not support source maps yet
11
12 extern crate debuginfo_lto_aux;
13
14 fn some_fn(x: i32) -> i32 {
15     x + 1
16 }
17
18 fn main() {
19     let i = 0;
20     let _ = debuginfo_lto_aux::mk_struct_with_lt(&i);
21     let _ = debuginfo_lto_aux::mk_regular_struct(1);
22     let _ = debuginfo_lto_aux::take_fn(some_fn, 1);
23     let _ = debuginfo_lto_aux::with_closure(22);
24     let _ = debuginfo_lto_aux::generic_fn(0f32);
25 }