diff options
Diffstat (limited to 'tests/codegen/issue-47442.rs')
-rw-r--r-- | tests/codegen/issue-47442.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/codegen/issue-47442.rs b/tests/codegen/issue-47442.rs new file mode 100644 index 000000000..6944336d3 --- /dev/null +++ b/tests/codegen/issue-47442.rs @@ -0,0 +1,22 @@ +// check that we don't emit unneeded `resume` cleanup blocks for every +// destructor. + +// CHECK-NOT: Unwind + +#![feature(test)] +#![crate_type="rlib"] + +extern crate test; + +struct Foo {} + +impl Drop for Foo { + fn drop(&mut self) { + test::black_box(()); + } +} + +#[no_mangle] +pub fn foo() { + let _foo = Foo {}; +} |