From e02c5b5930c2c9ba3e5423fe12e2ef0155017297 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 30 May 2024 20:31:36 +0200 Subject: Merging upstream version 1.74.1+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/sanitize/cfg.rs | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) (limited to 'tests/ui/sanitize') diff --git a/tests/ui/sanitize/cfg.rs b/tests/ui/sanitize/cfg.rs index c0f08a6d1..761c646ec 100644 --- a/tests/ui/sanitize/cfg.rs +++ b/tests/ui/sanitize/cfg.rs @@ -1,23 +1,31 @@ // Verifies that when compiling with -Zsanitizer=option, // the `#[cfg(sanitize = "option")]` attribute is configured. -// needs-sanitizer-support -// needs-sanitizer-address -// needs-sanitizer-cfi -// needs-sanitizer-kcfi -// needs-sanitizer-leak -// needs-sanitizer-memory -// needs-sanitizer-thread // check-pass -// revisions: address leak memory thread +// 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 -//[kcfi]compile-flags: -Zsanitizer=kcfi --cfg kcfi +//[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 //[leak]compile-flags: -Zsanitizer=leak --cfg leak +//[memory]needs-sanitizer-memory //[memory]compile-flags: -Zsanitizer=memory --cfg memory +//[thread]needs-sanitizer-thread //[thread]compile-flags: -Zsanitizer=thread --cfg thread -#![feature(cfg_sanitize)] +#![feature(cfg_sanitize, no_core, lang_items)] +#![crate_type="lib"] +#![no_core] + +#[lang="sized"] +trait Sized { } +#[lang="copy"] +trait Copy { } #[cfg(all(sanitize = "address", address))] fn main() {} @@ -36,3 +44,7 @@ fn main() {} #[cfg(all(sanitize = "thread", thread))] fn main() {} + +pub fn check() { + main(); +} -- cgit v1.2.3