Files
rust/tests/codegen-llvm/btree-empty-drop.rs
Jake Drew 4cf035f681 Checking that an empty BTreeMap drop compiles down to only a ret void,
and that function only match drop_btree exactly. As the previous dealloc
also passed on old code so didn't catch the regression
2026-09-23 10:00:52 +02:00

16 lines
372 B
Rust

// Regression test for https://github.com/rust-lang/rust/issues/161375
// Checking that an empty BTree's drop is optimized away.
//@ compile-flags: -Copt-level=3
#![crate_type = "lib"]
use std::collections::BTreeMap;
// CHECK-LABEL: @drop_btree(
// CHECK-NEXT: {{.*}}:
// CHECK-NEXT: ret void
#[no_mangle]
pub fn drop_btree() {
let _ = BTreeMap::<(), ()>::new();
}