rust/tests/assembly/dwarf-mixed-versions-lto.rs
Lukas Woodtli 264f2c6699 DWARF mixed versions with LTO on MIPS
On MIPS the DWARF version is stored in 2 bytes with the `.2byte`
assembler directive.
2025-02-24 11:58:38 +01:00

20 lines
655 B
Rust

// This test ensures that if LTO occurs between crates with different DWARF versions, we
// will choose the highest DWARF version for the final binary. This matches Clang's behavior.
// Note: `.2byte` directive is used on MIPS.
//@ only-linux
//@ aux-build:dwarf-mixed-versions-lto-aux.rs
//@ compile-flags: -C lto -g -Zdwarf-version=5
//@ assembly-output: emit-asm
//@ no-prefer-dynamic
extern crate dwarf_mixed_versions_lto_aux;
fn main() {
dwarf_mixed_versions_lto_aux::check_is_even(&0);
}
// CHECK: .section .debug_info
// CHECK-NOT: {{\.(short|hword|2byte)}} 2
// CHECK-NOT: {{\.(short|hword|2byte)}} 4
// CHECK: {{\.(short|hword|2byte)}} 5