Skip to content

Commit

Permalink
Fix test on targets with crt-static default
Browse files Browse the repository at this point in the history
  • Loading branch information
tmiasko committed Sep 22, 2023
1 parent 34c248d commit 9090ed8
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 11 deletions.
5 changes: 3 additions & 2 deletions tests/codegen/sanitizer/address-sanitizer-globals-tracking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
// only-linux
//
// revisions:ASAN ASAN-FAT-LTO
//[ASAN] compile-flags: -Zsanitizer=address
//[ASAN-FAT-LTO] compile-flags: -Zsanitizer=address -Cprefer-dynamic=false -Clto=fat
// compile-flags: -Zsanitizer=address -Ctarget-feature=-crt-static
//[ASAN] compile-flags:
//[ASAN-FAT-LTO] compile-flags: -Cprefer-dynamic=false -Clto=fat

#![crate_type="staticlib"]

Expand Down
11 changes: 6 additions & 5 deletions tests/codegen/sanitizer/memory-track-origins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
// needs-sanitizer-memory
// revisions:MSAN-0 MSAN-1 MSAN-2 MSAN-1-LTO MSAN-2-LTO
//
//[MSAN-0] compile-flags: -Zsanitizer=memory
//[MSAN-1] compile-flags: -Zsanitizer=memory -Zsanitizer-memory-track-origins=1
//[MSAN-2] compile-flags: -Zsanitizer=memory -Zsanitizer-memory-track-origins
//[MSAN-1-LTO] compile-flags: -Zsanitizer=memory -Zsanitizer-memory-track-origins=1 -C lto=fat
//[MSAN-2-LTO] compile-flags: -Zsanitizer=memory -Zsanitizer-memory-track-origins -C lto=fat
// compile-flags: -Zsanitizer=memory -Ctarget-feature=-crt-static
//[MSAN-0] compile-flags:
//[MSAN-1] compile-flags: -Zsanitizer-memory-track-origins=1
//[MSAN-2] compile-flags: -Zsanitizer-memory-track-origins
//[MSAN-1-LTO] compile-flags: -Zsanitizer-memory-track-origins=1 -C lto=fat
//[MSAN-2-LTO] compile-flags: -Zsanitizer-memory-track-origins -C lto=fat

#![crate_type="lib"]

Expand Down
5 changes: 3 additions & 2 deletions tests/codegen/sanitizer/no-sanitize-inlining.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
// needs-sanitizer-address
// needs-sanitizer-leak
// revisions: ASAN LSAN
//[ASAN] compile-flags: -Zsanitizer=address -C opt-level=3 -Z mir-opt-level=4
//[LSAN] compile-flags: -Zsanitizer=leak -C opt-level=3 -Z mir-opt-level=4
// compile-flags: -Copt-level=3 -Zmir-opt-level=4 -Ctarget-feature=-crt-static
//[ASAN] compile-flags: -Zsanitizer=address
//[LSAN] compile-flags: -Zsanitizer=leak

#![crate_type="lib"]
#![feature(no_sanitize)]
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/sanitizer/no-sanitize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// selectively disable sanitizer instrumentation.
//
// needs-sanitizer-address
// compile-flags: -Zsanitizer=address
// compile-flags: -Zsanitizer=address -Ctarget-feature=-crt-static

#![crate_type="lib"]
#![feature(no_sanitize)]
Expand Down
1 change: 1 addition & 0 deletions tests/codegen/sanitizer/sanitizer-recover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// revisions:ASAN ASAN-RECOVER MSAN MSAN-RECOVER MSAN-RECOVER-LTO
// no-prefer-dynamic
//
// compile-flags: -Ctarget-feature=-crt-static
//[ASAN] compile-flags: -Zsanitizer=address -Copt-level=0
//[ASAN-RECOVER] compile-flags: -Zsanitizer=address -Zsanitizer-recover=address -Copt-level=0
//[MSAN] compile-flags: -Zsanitizer=memory
Expand Down
3 changes: 2 additions & 1 deletion tests/ui/sanitize/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@

// check-pass
// revisions: address cfi kcfi leak memory thread
//compile-flags: -Ctarget-feature=-crt-static
//[address]needs-sanitizer-address
//[address]compile-flags: -Zsanitizer=address --cfg address
//[cfi]needs-sanitizer-cfi
//[cfi]compile-flags: -Zsanitizer=cfi --cfg cfi
//[cfi]compile-flags: -Clto -Ccodegen-units=1 -Ctarget-feature=-crt-static
//[cfi]compile-flags: -Clto -Ccodegen-units=1
//[kcfi]needs-llvm-components: x86
//[kcfi]compile-flags: -Zsanitizer=kcfi --cfg kcfi --target x86_64-unknown-none
//[leak]needs-sanitizer-leak
Expand Down

0 comments on commit 9090ed8

Please sign in to comment.