diff --git a/tests/run-make/pdb-sobjname/filecheck.txt b/tests/run-make/pdb-sobjname/filecheck.txt new file mode 100644 index 0000000000000..80e5c0037e8b2 --- /dev/null +++ b/tests/run-make/pdb-sobjname/filecheck.txt @@ -0,0 +1 @@ +CHECK: S_OBJNAME{{.+}}my_great_crate_name{{.+}}.o \ No newline at end of file diff --git a/tests/run-make/pdb-sobjname/main.rs b/tests/run-make/pdb-sobjname/main.rs new file mode 100644 index 0000000000000..f328e4d9d04c3 --- /dev/null +++ b/tests/run-make/pdb-sobjname/main.rs @@ -0,0 +1 @@ +fn main() {} diff --git a/tests/run-make/pdb-sobjname/rmake.rs b/tests/run-make/pdb-sobjname/rmake.rs new file mode 100644 index 0000000000000..a9c9013c4bdfa --- /dev/null +++ b/tests/run-make/pdb-sobjname/rmake.rs @@ -0,0 +1,18 @@ +// Check if the pdb file contains an S_OBJNAME entry with the name of the .o file + +// This is because it used to be missing in #96475. +// See https://github.com/rust-lang/rust/pull/115704 + +//@ only-windows-msvc +// Reason: pdb files are unique to this architecture + +use run_make_support::{llvm, rustc}; + +fn main() { + rustc().input("main.rs").arg("-g").crate_name("my_great_crate_name").crate_type("bin").run(); + + let pdbutil_result = + llvm::LlvmPdbutil::new().arg("dump").arg("-symbols").input("my_great_crate_name.pdb").run(); + + llvm::llvm_filecheck().patterns("filecheck.txt").stdin_buf(pdbutil_result.stdout_utf8()).run(); +}