summaryrefslogtreecommitdiffstats
path: root/tests/ui/sanitize
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
commitc23a457e72abe608715ac76f076f47dc42af07a5 (patch)
tree2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /tests/ui/sanitize
parentReleasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz
rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/sanitize')
-rw-r--r--tests/ui/sanitize/cfg.rs32
1 files changed, 22 insertions, 10 deletions
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();
+}