Files
rust/tests/codegen-llvm/large_data_threshold.rs
Jakob Koschel 7eaf48cc1f Pass LargeDataThreshold to LLVM module IR
Before, LargeDataThreshold was only set via `LLVMRustCreateTargetMachine`.
When LTO is enabled, this information is required to be passed into the
generated LLVM module IR files since the LTO linker spins up its own
TargetMachine and otherwise has no knowledge of the LargeDataThreshold.

Currently, `-Z large-data-threshold` has no affect at all when compiling
with LTO.
This commit makes sure that if `-Z large-data-threshold` is passed and
not 0, it is preserved and stored into the generated LLVM IR.
2026-08-24 12:31:48 +00:00

10 lines
312 B
Rust

//@ only-x86_64
//@ revisions: DEFAULT EXPLICIT
//@[DEFAULT] compile-flags: -C code-model=medium
//@[EXPLICIT] compile-flags: -C code-model=medium -Z large-data-threshold=1024
#![crate_type = "lib"]
// DEFAULT-NOT: !"Large Data Threshold"
// EXPLICIT: !{{[0-9]+}} = !{i32 1, !"Large Data Threshold", i64 1024}