1 // Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // This test case makes sure that we don't run into LLVM's dreaded
12 // "possible ODR violation" assertion when compiling with LTO + Debuginfo.
13 // It covers cases that have traditionally been prone to cause this error.
14 // If new cases emerge, add them to this file.
16 // aux-build:debuginfo-lto-aux.rs
17 // compile-flags: -C lto -g
20 extern crate debuginfo_lto_aux;
22 fn some_fn(x: i32) -> i32 {
28 let _ = debuginfo_lto_aux::mk_struct_with_lt(&i);
29 let _ = debuginfo_lto_aux::mk_regular_struct(1);
30 let _ = debuginfo_lto_aux::take_fn(some_fn, 1);
31 let _ = debuginfo_lto_aux::with_closure(22);
32 let _ = debuginfo_lto_aux::generic_fn(0f32);