Skip to content

Commit fe3fbf0

Browse files
committed
rewrite sanitizer-dylib-link to rmake
1 parent 952d916 commit fe3fbf0

File tree

3 files changed

+16
-18
lines changed

3 files changed

+16
-18
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-2
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ run-make/reproducible-build-2/Makefile
7070
run-make/reproducible-build/Makefile
7171
run-make/rlib-format-packed-bundled-libs-2/Makefile
7272
run-make/rlib-format-packed-bundled-libs/Makefile
73-
run-make/sanitizer-cdylib-link/Makefile
74-
run-make/sanitizer-dylib-link/Makefile
7573
run-make/sanitizer-staticlib-link/Makefile
7674
run-make/share-generics-dylib/Makefile
7775
run-make/simd-ffi/Makefile

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

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

0 commit comments

Comments
 (0)