2024-07-29 15:16:55 -05:00
|
|
|
// Check if the pdb file contains the following information in the LF_BUILDINFO:
|
|
|
|
// 1. full path to the compiler (cl)
|
|
|
|
// 2. the commandline args to compile it (cmd)
|
|
|
|
// This is because these used to be missing in #96475.
|
|
|
|
// See https://github.com/rust-lang/rust/pull/113492
|
|
|
|
|
|
|
|
//@ only-windows-msvc
|
|
|
|
// Reason: pdb files are unique to this architecture
|
|
|
|
|
2024-07-29 15:28:38 -05:00
|
|
|
use run_make_support::{assert_contains, bstr, env_var, rfs, rustc};
|
2024-07-29 15:16:55 -05:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
rustc()
|
|
|
|
.input("main.rs")
|
|
|
|
.arg("-g")
|
|
|
|
.crate_name("my_crate_name")
|
|
|
|
.crate_type("bin")
|
|
|
|
.metadata("dc9ef878b0a48666")
|
|
|
|
.run();
|
2024-07-29 15:28:38 -05:00
|
|
|
let tests = [
|
|
|
|
&env_var("RUSTC"),
|
2024-07-29 15:16:55 -05:00
|
|
|
r#""main.rs""#,
|
|
|
|
r#""-g""#,
|
|
|
|
r#""--crate-name""#,
|
|
|
|
r#""my_crate_name""#,
|
|
|
|
r#""--crate-type""#,
|
|
|
|
r#""bin""#,
|
2024-07-29 15:28:38 -05:00
|
|
|
r#""-Cmetadata=dc9ef878b0a48666""#,
|
2024-07-29 15:16:55 -05:00
|
|
|
];
|
2024-07-29 15:28:38 -05:00
|
|
|
for test in tests {
|
|
|
|
assert_pdb_contains(test);
|
2024-07-29 15:16:55 -05:00
|
|
|
}
|
|
|
|
}
|
2024-07-29 15:28:38 -05:00
|
|
|
|
|
|
|
fn assert_pdb_contains(needle: &str) {
|
|
|
|
let needle = needle.as_bytes();
|
|
|
|
use bstr::ByteSlice;
|
|
|
|
assert!(&rfs::read("my_crate_name.pdb").find(needle).is_some());
|
|
|
|
}
|