rust/tests/ui/sanitizer/cfi/drop-in-place.rs
Ramon de C Valle 66c93ac8ba CFI: Move CFI ui tests to cfi directory
Moves the CFI ui tests to the cfi directory and removes the cfi prefix
from tests file names similarly to how the cfi codegen tests are
organized.
2024-08-12 14:59:50 -07:00

21 lines
491 B
Rust

// Verifies that drops can be called on arbitrary trait objects.
//
// FIXME(#122848): Remove only-linux when fixed.
//@ only-linux
//@ needs-sanitizer-cfi
//@ compile-flags: -Clto -Copt-level=0 -Cprefer-dynamic=off -Ctarget-feature=-crt-static -Zsanitizer=cfi
//@ run-pass
struct EmptyDrop;
struct NonEmptyDrop;
impl Drop for NonEmptyDrop {
fn drop(&mut self) {}
}
fn main() {
let _ = Box::new(EmptyDrop) as Box<dyn Send>;
let _ = Box::new(NonEmptyDrop) as Box<dyn Send>;
}