Skip to content

Commit 219b46b

Browse files
pnkfelixMark-Simulacrum
authored andcommitted
Tests.
Namely, a regression test for issue rust-lang#69798 (export added), and the inverse of that test (export removd).
1 parent 951ebf6 commit 219b46b

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// revisions: cfail1 cfail2
2+
// build-pass
3+
4+
// rust-lang/rust#69798:
5+
//
6+
// This is analgous to cgu_invalidated_when_import_added, but it covers a
7+
// problem uncovered where a change to the *export* set caused a link failure
8+
// when reusing post-LTO optimized object code.
9+
10+
pub struct Foo {}
11+
impl Drop for Foo {
12+
fn drop(&mut self) {
13+
println!("Dropping Foo");
14+
}
15+
}
16+
#[no_mangle]
17+
pub extern "C" fn run() {
18+
thread_local! { pub static FOO : Foo = Foo { } ; }
19+
20+
#[cfg(cfail2)]
21+
{
22+
FOO.with(|_f| ())
23+
}
24+
}
25+
26+
pub fn main() { run() }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// revisions: cfail1 cfail2
2+
// build-pass
3+
4+
// rust-lang/rust#69798:
5+
//
6+
// This is analgous to cgu_invalidated_when_export_added, but it covers the
7+
// other direction. This is analogous to cgu_invalidated_when_import_added: we
8+
// include it, because it may uncover bugs in variant implementation strategies.
9+
10+
pub struct Foo {}
11+
impl Drop for Foo {
12+
fn drop(&mut self) {
13+
println!("Dropping Foo");
14+
}
15+
}
16+
#[no_mangle]
17+
pub extern "C" fn run() {
18+
thread_local! { pub static FOO : Foo = Foo { } ; }
19+
20+
#[cfg(cfail1)]
21+
{
22+
FOO.with(|_f| ())
23+
}
24+
}
25+
26+
pub fn main() { run() }

0 commit comments

Comments
 (0)