Skip to content

Commit 56c64cb

Browse files
committed
rewrite sanitizer-dylib-link to rmake
1 parent 035bce8 commit 56c64cb

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ run-make/reproducible-build/Makefile
7575
run-make/rlib-format-packed-bundled-libs-2/Makefile
7676
run-make/rlib-format-packed-bundled-libs-3/Makefile
7777
run-make/rlib-format-packed-bundled-libs/Makefile
78-
run-make/sanitizer-cdylib-link/Makefile
79-
run-make/sanitizer-dylib-link/Makefile
8078
run-make/sanitizer-staticlib-link/Makefile
8179
run-make/share-generics-dylib/Makefile
8280
run-make/simd-ffi/Makefile

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

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 16 additions & 0 deletions
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)