Skip to content

Commit d224256

Browse files
committed
rewrite sanitizer-cdylib-link to rmake
1 parent fe3fbf0 commit d224256

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

tests/run-make/sanitizer-cdylib-link/Makefile

-16
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Identical to sanitizer-dylib-link, but with a cdylib.
2+
// This test builds a shared object, then an executable that links it as a native
3+
// rust library (contrast to an rlib). The shared library and executable both
4+
// are compiled with address sanitizer, and we assert that a fault in the cdylib
5+
// is correctly detected.
6+
// See https://github.com/rust-lang/rust/pull/38699
7+
8+
//@ needs-sanitizer-support
9+
//@ needs-sanitizer-address
10+
11+
use run_make_support::{run_fail, rustc};
12+
13+
fn main() {
14+
rustc().arg("-g").arg("-Zsanitizer=address").crate_type("cdylib").input("library.rs").run();
15+
rustc().arg("-g").arg("-Zsanitizer=address").crate_type("bin").input("program.rs").run();
16+
run_fail("program").assert_stderr_contains("stack-buffer-overflow");
17+
}

0 commit comments

Comments
 (0)