Skip to content

Commit 5ddf971

Browse files
committed
Update test for LF_BUILDINFO cl and cmd
1 parent 38e3a57 commit 5ddf971

File tree

2 files changed

+9
-19
lines changed

2 files changed

+9
-19
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
CHECK: LF_BUILDINFO
2+
CHECK: rustc.exe
3+
CHECK: main.rs
4+
CHECK: "-g" "--crate-name" "my_crate_name" "--crate-type" "bin" "-Cmetadata=dc9ef878b0a48666"

tests/run-make/pdb-buildinfo-cl-cmd/rmake.rs

+5-19
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//@ only-windows-msvc
88
// Reason: pdb files are unique to this architecture
99

10-
use run_make_support::{assert_contains, bstr, env_var, rfs, rustc};
10+
use run_make_support::{llvm, rustc};
1111

1212
fn main() {
1313
rustc()
@@ -17,23 +17,9 @@ fn main() {
1717
.crate_type("bin")
1818
.metadata("dc9ef878b0a48666")
1919
.run();
20-
let tests = [
21-
&env_var("RUSTC"),
22-
r#""main.rs""#,
23-
r#""-g""#,
24-
r#""--crate-name""#,
25-
r#""my_crate_name""#,
26-
r#""--crate-type""#,
27-
r#""bin""#,
28-
r#""-Cmetadata=dc9ef878b0a48666""#,
29-
];
30-
for test in tests {
31-
assert_pdb_contains(test);
32-
}
33-
}
3420

35-
fn assert_pdb_contains(needle: &str) {
36-
let needle = needle.as_bytes();
37-
use bstr::ByteSlice;
38-
assert!(&rfs::read("my_crate_name.pdb").find(needle).is_some());
21+
let pdbutil_result =
22+
llvm::LlvmPdbutil::new().arg("dump").arg("-ids").input("my_crate_name.pdb").run();
23+
24+
llvm::llvm_filecheck().patterns("filecheck.txt").stdin_buf(pdbutil_result.stdout_utf8()).run();
3925
}

0 commit comments

Comments
 (0)