]>
git.proxmox.com Git - rustc.git/blob - tests/codegen/drop.rs
1 // ignore-wasm32-bare compiled with panic=abort by default
2 // compile-flags: -C no-prepopulate-passes
8 impl Drop
for SomeUniqueName
{
13 pub fn possibly_unwinding() {
16 // CHECK-LABEL: @droppy
19 // Check that there are exactly 6 drop calls. The cleanups for the unwinding should be reused, so
20 // that's one new drop call per call to possibly_unwinding(), and finally 3 drop calls for the
21 // regular function exit. We used to have problems with quadratic growths of drop calls in such
23 // FIXME(eddyb) the `void @` forces a match on the instruction, instead of the
24 // comment, that's `; call core::ptr::drop_in_place::<drop::SomeUniqueName>`
25 // for the `v0` mangling, should switch to matching on that once `legacy` is gone.
26 // CHECK-COUNT-6: {{(call|invoke) void @.*}}drop_in_place{{.*}}SomeUniqueName
27 // CHECK-NOT: {{(call|invoke) void @.*}}drop_in_place{{.*}}SomeUniqueName
28 // The next line checks for the } that ends the function definition
29 // CHECK-LABEL: {{^[}]}}
30 let _s
= SomeUniqueName
;
32 let _s
= SomeUniqueName
;
34 let _s
= SomeUniqueName
;