File tree 2 files changed +17
-16
lines changed
tests/run-make/sanitizer-cdylib-link
2 files changed +17
-16
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments