Files
rust/tests/ui/cross-crate/llvm-miscompile-MarkValue-MaybeLive.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
576 B
Rust
Raw Normal View History

2025-05-03 17:22:52 +02:00
//! Regression test for <https://github.com/rust-lang/rust/issues/76387>
//! Tests that LLVM doesn't miscompile this
//! See upstream fix: <https://reviews.llvm.org/D88529>.
//@ compile-flags: -C opt-level=3
//@ aux-build: llvm-miscompile-MarkValue-MaybeLive.rs
//@ run-pass
extern crate llvm_miscompile_MarkValue_MaybeLive;
use llvm_miscompile_MarkValue_MaybeLive::FatPtr;
fn print(data: &[u8]) {
println!("{:#?}", data);
}
fn main() {
let ptr = FatPtr::new(20);
let data = unsafe { std::slice::from_raw_parts(ptr.as_ptr(), ptr.len()) };
print(data);
}