Rollup merge of #73044 - tmiasko:compiletest-san, r=nikomatsakis
compiletest: Add directives to detect sanitizer support
Add needs-sanitizer-{address,leak,memory,thread} directive indicating
that test requires target with support for specific sanitizer.
This is an addition to the existing needs-sanitizer-support directive
indicating that test requires a sanitizer runtime library.
The existing needs-sanitizer-support directive could be incorporated into the
new ones, but I decided to retain it, since it enables running sanitizer
codegen tests even when building of sanitizer runtime libraries is disabled.
This commit is contained in:
commit
0851036ae3
20 changed files with 75 additions and 30 deletions
|
|
@ -1,9 +1,7 @@
|
|||
// Verifies that MemorySanitizer track-origins level can be controlled
|
||||
// with -Zsanitizer-memory-track-origins option.
|
||||
//
|
||||
// needs-sanitizer-support
|
||||
// only-linux
|
||||
// only-x86_64
|
||||
// needs-sanitizer-memory
|
||||
// revisions:MSAN-0 MSAN-1 MSAN-2 MSAN-1-LTO MSAN-2-LTO
|
||||
//
|
||||
//[MSAN-0] compile-flags: -Zsanitizer=memory
|
||||
|
|
|
|||
|
|
@ -1,11 +1,9 @@
|
|||
// Verifies that no_sanitize attribute prevents inlining when
|
||||
// given sanitizer is enabled, but has no effect on inlining otherwise.
|
||||
//
|
||||
// needs-sanitizer-support
|
||||
// only-x86_64
|
||||
//
|
||||
// needs-sanitizer-address
|
||||
// needs-sanitizer-leak
|
||||
// revisions: ASAN LSAN
|
||||
//
|
||||
//[ASAN] compile-flags: -Zsanitizer=address -C opt-level=3 -Z mir-opt-level=3
|
||||
//[LSAN] compile-flags: -Zsanitizer=leak -C opt-level=3 -Z mir-opt-level=3
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// Verifies that no_sanitze attribute can be used to
|
||||
// selectively disable sanitizer instrumentation.
|
||||
//
|
||||
// needs-sanitizer-support
|
||||
// needs-sanitizer-address
|
||||
// compile-flags: -Zsanitizer=address
|
||||
|
||||
#![crate_type="lib"]
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
// Verifies that AddressSanitizer and MemorySanitizer
|
||||
// recovery mode can be enabled with -Zsanitizer-recover.
|
||||
//
|
||||
// needs-sanitizer-support
|
||||
// only-linux
|
||||
// only-x86_64
|
||||
// needs-sanitizer-address
|
||||
// needs-sanitizer-memory
|
||||
// revisions:ASAN ASAN-RECOVER MSAN MSAN-RECOVER MSAN-RECOVER-LTO
|
||||
// no-prefer-dynamic
|
||||
//
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# needs-sanitizer-support
|
||||
# only-x86_64
|
||||
# needs-sanitizer-address
|
||||
# only-linux
|
||||
|
||||
-include ../tools.mk
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# needs-sanitizer-support
|
||||
# only-x86_64
|
||||
# needs-sanitizer-address
|
||||
# only-linux
|
||||
|
||||
-include ../tools.mk
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# needs-sanitizer-support
|
||||
# only-x86_64
|
||||
# needs-sanitizer-address
|
||||
# only-linux
|
||||
|
||||
-include ../tools.mk
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
// needs-sanitizer-support
|
||||
// needs-sanitizer-address
|
||||
// compile-flags: --test -Z sanitizer=address
|
||||
//
|
||||
// #43031: Verify that rustdoc passes `-Z` options to rustc. Use an extern
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// needs-sanitizer-support
|
||||
// only-x86_64
|
||||
// needs-sanitizer-address
|
||||
//
|
||||
// compile-flags: -Z sanitizer=address -O -g
|
||||
//
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// needs-sanitizer-support
|
||||
// only-x86_64
|
||||
// needs-sanitizer-address
|
||||
//
|
||||
// compile-flags: -Z sanitizer=address -O
|
||||
//
|
||||
|
|
|
|||
|
|
@ -2,8 +2,10 @@
|
|||
// the `#[cfg(sanitize = "option")]` attribute is configured.
|
||||
|
||||
// needs-sanitizer-support
|
||||
// only-linux
|
||||
// only-x86_64
|
||||
// needs-sanitizer-address
|
||||
// needs-sanitizer-leak
|
||||
// needs-sanitizer-memory
|
||||
// needs-sanitizer-thread
|
||||
// check-pass
|
||||
// revisions: address leak memory thread
|
||||
//[address]compile-flags: -Zsanitizer=address --cfg address
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
// miscompilation which was subsequently detected by AddressSanitizer as UB.
|
||||
//
|
||||
// needs-sanitizer-support
|
||||
// only-x86_64
|
||||
// needs-sanitizer-address
|
||||
//
|
||||
// compile-flags: -Copt-level=0 -Zsanitizer=address
|
||||
// run-pass
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// needs-sanitizer-support
|
||||
// only-x86_64
|
||||
// needs-sanitizer-leak
|
||||
//
|
||||
// compile-flags: -Z sanitizer=leak -O
|
||||
//
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
// needs-sanitizer-support
|
||||
// only-linux
|
||||
// only-x86_64
|
||||
// needs-sanitizer-memory
|
||||
//
|
||||
// compile-flags: -Z sanitizer=memory -Zsanitizer-memory-track-origins -O
|
||||
//
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
//
|
||||
// min-llvm-version 9.0
|
||||
// needs-sanitizer-support
|
||||
// only-x86_64
|
||||
// needs-sanitizer-address
|
||||
//
|
||||
// no-prefer-dynamic
|
||||
// revisions: opt0 opt1
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
// would occasionally fail, making test flaky.
|
||||
//
|
||||
// needs-sanitizer-support
|
||||
// only-x86_64
|
||||
// needs-sanitizer-thread
|
||||
//
|
||||
// compile-flags: -Z sanitizer=thread -O
|
||||
//
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// needs-sanitizer-support
|
||||
// only-x86_64
|
||||
// needs-sanitizer-address
|
||||
//
|
||||
// compile-flags: -Zsanitizer=address
|
||||
// run-fail
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue