1 // compile-flags: -C no-prepopulate-passes
7 impl Drop for SomeUniqueName {
12 pub fn possibly_unwinding() {
15 // CHECK-LABEL: @droppy
18 // Check that there are exactly 6 drop calls. The cleanups for the unwinding should be reused, so
19 // that's one new drop call per call to possibly_unwinding(), and finally 3 drop calls for the
20 // regular function exit. We used to have problems with quadratic growths of drop calls in such
22 // FIXME(eddyb) the `void @` forces a match on the instruction, instead of the
23 // comment, that's `; call core::ptr::real_drop_in_place::<drop::SomeUniqueName>`
24 // for the `v0` mangling, should switch to matching on that once `legacy` is gone.
25 // CHECK-NOT: invoke void @{{.*}}drop_in_place{{.*}}SomeUniqueName
26 // CHECK: call void @{{.*}}drop_in_place{{.*}}SomeUniqueName
27 // CHECK: call void @{{.*}}drop_in_place{{.*}}SomeUniqueName
28 // CHECK-NOT: call void @{{.*}}drop_in_place{{.*}}SomeUniqueName
29 // CHECK: invoke void @{{.*}}drop_in_place{{.*}}SomeUniqueName
30 // CHECK: call void @{{.*}}drop_in_place{{.*}}SomeUniqueName
31 // CHECK: invoke void @{{.*}}drop_in_place{{.*}}SomeUniqueName
32 // CHECK: call void @{{.*}}drop_in_place{{.*}}SomeUniqueName
33 // CHECK-NOT: {{(call|invoke) void @.*}}drop_in_place{{.*}}SomeUniqueName
34 // The next line checks for the } that ends the function definition
35 // CHECK-LABEL: {{^[}]}}
36 let _s = SomeUniqueName;
38 let _s = SomeUniqueName;
40 let _s = SomeUniqueName;