rust/src/test/ui/debuginfo-lto.rs
Thomas Lively 2bf59bea48 Upgrade Emscripten targets to use upstream LLVM backend
- Compatible with Emscripten 1.38.46-upstream or later upstream.
 - Refactors the Emscripten target spec to share code with other wasm
   targets.
 - Replaces the old incorrect wasm32 C call ABI with the correct one,
   preserving the old one as wasm32_bindgen_compat for wasm-bindgen
   compatibility.
 - Updates the varargs ABI used by Emscripten and deletes the old one.
 - Removes the obsolete wasm32-experimental-emscripten target.
 - Uses EMCC_CFLAGS on CI to avoid the timeout problems with #63649.
2019-10-16 17:06:48 -07:00

26 lines
778 B
Rust

// 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);
}