Skip to content

Commit 0851036

Browse files
authored
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.
2 parents 1dc6c3c + d40e624 commit 0851036

File tree

20 files changed

+75
-30
lines changed

20 files changed

+75
-30
lines changed

src/test/codegen/sanitizer-memory-track-orgins.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
// Verifies that MemorySanitizer track-origins level can be controlled
22
// with -Zsanitizer-memory-track-origins option.
33
//
4-
// needs-sanitizer-support
5-
// only-linux
6-
// only-x86_64
4+
// needs-sanitizer-memory
75
// revisions:MSAN-0 MSAN-1 MSAN-2 MSAN-1-LTO MSAN-2-LTO
86
//
97
//[MSAN-0] compile-flags: -Zsanitizer=memory

src/test/codegen/sanitizer-no-sanitize-inlining.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
// Verifies that no_sanitize attribute prevents inlining when
22
// given sanitizer is enabled, but has no effect on inlining otherwise.
33
//
4-
// needs-sanitizer-support
5-
// only-x86_64
6-
//
4+
// needs-sanitizer-address
5+
// needs-sanitizer-leak
76
// revisions: ASAN LSAN
8-
//
97
//[ASAN] compile-flags: -Zsanitizer=address -C opt-level=3 -Z mir-opt-level=3
108
//[LSAN] compile-flags: -Zsanitizer=leak -C opt-level=3 -Z mir-opt-level=3
119

src/test/codegen/sanitizer-no-sanitize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Verifies that no_sanitze attribute can be used to
22
// selectively disable sanitizer instrumentation.
33
//
4-
// needs-sanitizer-support
4+
// needs-sanitizer-address
55
// compile-flags: -Zsanitizer=address
66

77
#![crate_type="lib"]

src/test/codegen/sanitizer-recover.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
// Verifies that AddressSanitizer and MemorySanitizer
22
// recovery mode can be enabled with -Zsanitizer-recover.
33
//
4-
// needs-sanitizer-support
5-
// only-linux
6-
// only-x86_64
4+
// needs-sanitizer-address
5+
// needs-sanitizer-memory
76
// revisions:ASAN ASAN-RECOVER MSAN MSAN-RECOVER MSAN-RECOVER-LTO
87
// no-prefer-dynamic
98
//

src/test/run-make-fulldeps/sanitizer-cdylib-link/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# needs-sanitizer-support
2-
# only-x86_64
2+
# needs-sanitizer-address
33
# only-linux
44

55
-include ../tools.mk

src/test/run-make-fulldeps/sanitizer-dylib-link/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# needs-sanitizer-support
2-
# only-x86_64
2+
# needs-sanitizer-address
33
# only-linux
44

55
-include ../tools.mk

src/test/run-make-fulldeps/sanitizer-staticlib-link/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# needs-sanitizer-support
2-
# only-x86_64
2+
# needs-sanitizer-address
33
# only-linux
44

55
-include ../tools.mk

src/test/rustdoc/sanitizer-option.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// needs-sanitizer-support
2+
// needs-sanitizer-address
23
// compile-flags: --test -Z sanitizer=address
34
//
45
// #43031: Verify that rustdoc passes `-Z` options to rustc. Use an extern

src/test/ui/sanitize/address.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// needs-sanitizer-support
2-
// only-x86_64
2+
// needs-sanitizer-address
33
//
44
// compile-flags: -Z sanitizer=address -O -g
55
//

src/test/ui/sanitize/badfree.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// needs-sanitizer-support
2-
// only-x86_64
2+
// needs-sanitizer-address
33
//
44
// compile-flags: -Z sanitizer=address -O
55
//

0 commit comments

Comments
 (0)