2020-04-14 09:52:19 -05:00
|
|
|
// revisions: cfail1 cfail2
|
|
|
|
// build-pass
|
|
|
|
|
|
|
|
// rust-lang/rust#69798:
|
|
|
|
//
|
2022-08-17 21:13:37 -05:00
|
|
|
// This is analogous to cgu_invalidated_when_import_added, but it covers a
|
2020-04-14 09:52:19 -05:00
|
|
|
// problem uncovered where a change to the *export* set caused a link failure
|
|
|
|
// when reusing post-LTO optimized object code.
|
|
|
|
|
|
|
|
pub struct Foo {}
|
|
|
|
impl Drop for Foo {
|
|
|
|
fn drop(&mut self) {
|
|
|
|
println!("Dropping Foo");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#[no_mangle]
|
|
|
|
pub extern "C" fn run() {
|
|
|
|
thread_local! { pub static FOO : Foo = Foo { } ; }
|
|
|
|
|
|
|
|
#[cfg(cfail2)]
|
|
|
|
{
|
|
|
|
FOO.with(|_f| ())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn main() { run() }
|