summaryrefslogtreecommitdiffstats
path: root/tests/ui/sanitize
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:35 +0000
commitd1b2d29528b7794b41e66fc2136e395a02f8529b (patch)
treea4a17504b260206dec3cf55b2dca82929a348ac2 /tests/ui/sanitize
parentReleasing progress-linux version 1.72.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.tar.xz
rustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.zip
Merging upstream version 1.73.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/sanitize')
-rw-r--r--tests/ui/sanitize/address.rs3
-rw-r--r--tests/ui/sanitize/badfree.rs1
-rw-r--r--tests/ui/sanitize/issue-111184-generator-witness.rs4
-rw-r--r--tests/ui/sanitize/issue-114275-cfi-const-expr-in-arry-len.rs15
-rw-r--r--tests/ui/sanitize/issue-72154-lifetime-markers.rs1
-rw-r--r--tests/ui/sanitize/new-llvm-pass-manager-thin-lto.rs1
-rw-r--r--tests/ui/sanitize/sanitizer-cfi-requires-lto.rs2
-rw-r--r--tests/ui/sanitize/sanitizer-cfi-requires-lto.stderr2
-rw-r--r--tests/ui/sanitize/sanitizer-cfi-with-rustc-lto-requires-single-codegen-unit.rs8
-rw-r--r--tests/ui/sanitize/sanitizer-cfi-with-rustc-lto-requires-single-codegen-unit.stderr4
-rw-r--r--tests/ui/sanitize/use-after-scope.rs1
11 files changed, 37 insertions, 5 deletions
diff --git a/tests/ui/sanitize/address.rs b/tests/ui/sanitize/address.rs
index 5b2cea875..1faab1fd2 100644
--- a/tests/ui/sanitize/address.rs
+++ b/tests/ui/sanitize/address.rs
@@ -1,11 +1,12 @@
// needs-sanitizer-support
// needs-sanitizer-address
+// ignore-cross-compile
//
// compile-flags: -Z sanitizer=address -O -g
//
// run-fail
// error-pattern: AddressSanitizer: stack-buffer-overflow
-// error-pattern: 'xs' (line 13) <== Memory access at offset
+// error-pattern: 'xs' (line 14) <== Memory access at offset
use std::hint::black_box;
diff --git a/tests/ui/sanitize/badfree.rs b/tests/ui/sanitize/badfree.rs
index 095a6f469..c8d1ce7df 100644
--- a/tests/ui/sanitize/badfree.rs
+++ b/tests/ui/sanitize/badfree.rs
@@ -1,5 +1,6 @@
// needs-sanitizer-support
// needs-sanitizer-address
+// ignore-cross-compile
//
// compile-flags: -Z sanitizer=address -O
//
diff --git a/tests/ui/sanitize/issue-111184-generator-witness.rs b/tests/ui/sanitize/issue-111184-generator-witness.rs
index 8f4118057..d36d8bce5 100644
--- a/tests/ui/sanitize/issue-111184-generator-witness.rs
+++ b/tests/ui/sanitize/issue-111184-generator-witness.rs
@@ -2,10 +2,10 @@
// encode_ty and caused the compiler to ICE.
//
// needs-sanitizer-cfi
-// compile-flags: -Clto -Ctarget-feature=-crt-static -Zsanitizer=cfi --edition=2021
+// compile-flags: -Ccodegen-units=1 -Clto -Ctarget-feature=-crt-static -Zsanitizer=cfi --edition=2021
// no-prefer-dynamic
// only-x86_64-unknown-linux-gnu
-// run-pass
+// build-pass
use std::future::Future;
diff --git a/tests/ui/sanitize/issue-114275-cfi-const-expr-in-arry-len.rs b/tests/ui/sanitize/issue-114275-cfi-const-expr-in-arry-len.rs
new file mode 100644
index 000000000..8f870be13
--- /dev/null
+++ b/tests/ui/sanitize/issue-114275-cfi-const-expr-in-arry-len.rs
@@ -0,0 +1,15 @@
+// Regression test for issue 114275 `typeid::typeid_itanium_cxx_abi::transform_ty`
+// was expecting array type lengths to be evaluated, this was causing an ICE.
+//
+// build-pass
+// compile-flags: -Ccodegen-units=1 -Clto -Zsanitizer=cfi -Ctarget-feature=-crt-static
+// needs-sanitizer-cfi
+
+#![crate_type = "lib"]
+
+#[repr(transparent)]
+pub struct Array([u8; 1 * 1]);
+
+pub extern "C" fn array() -> Array {
+ loop {}
+}
diff --git a/tests/ui/sanitize/issue-72154-lifetime-markers.rs b/tests/ui/sanitize/issue-72154-lifetime-markers.rs
index b2e182238..3d9c51daa 100644
--- a/tests/ui/sanitize/issue-72154-lifetime-markers.rs
+++ b/tests/ui/sanitize/issue-72154-lifetime-markers.rs
@@ -5,6 +5,7 @@
//
// needs-sanitizer-support
// needs-sanitizer-address
+// ignore-cross-compile
//
// compile-flags: -Copt-level=0 -Zsanitizer=address
// run-pass
diff --git a/tests/ui/sanitize/new-llvm-pass-manager-thin-lto.rs b/tests/ui/sanitize/new-llvm-pass-manager-thin-lto.rs
index 33e18e355..052a40598 100644
--- a/tests/ui/sanitize/new-llvm-pass-manager-thin-lto.rs
+++ b/tests/ui/sanitize/new-llvm-pass-manager-thin-lto.rs
@@ -4,6 +4,7 @@
//
// needs-sanitizer-support
// needs-sanitizer-address
+// ignore-cross-compile
//
// no-prefer-dynamic
// revisions: opt0 opt1
diff --git a/tests/ui/sanitize/sanitizer-cfi-requires-lto.rs b/tests/ui/sanitize/sanitizer-cfi-requires-lto.rs
index 29e32889f..e9a49dd3f 100644
--- a/tests/ui/sanitize/sanitizer-cfi-requires-lto.rs
+++ b/tests/ui/sanitize/sanitizer-cfi-requires-lto.rs
@@ -1,4 +1,4 @@
-// Verifies that `-Zsanitizer=cfi` requires `-Clto`, `-Clto=thin`, or `-Clinker-plugin-lto`.
+// Verifies that `-Zsanitizer=cfi` requires `-Clto` or `-Clinker-plugin-lto`.
//
// needs-sanitizer-cfi
// compile-flags: -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi
diff --git a/tests/ui/sanitize/sanitizer-cfi-requires-lto.stderr b/tests/ui/sanitize/sanitizer-cfi-requires-lto.stderr
index 5e706b513..8cd9c5444 100644
--- a/tests/ui/sanitize/sanitizer-cfi-requires-lto.stderr
+++ b/tests/ui/sanitize/sanitizer-cfi-requires-lto.stderr
@@ -1,4 +1,4 @@
-error: `-Zsanitizer=cfi` requires `-Clto`, `-Clto=thin`, or `-Clinker-plugin-lto`
+error: `-Zsanitizer=cfi` requires `-Clto` or `-Clinker-plugin-lto`
error: aborting due to previous error
diff --git a/tests/ui/sanitize/sanitizer-cfi-with-rustc-lto-requires-single-codegen-unit.rs b/tests/ui/sanitize/sanitizer-cfi-with-rustc-lto-requires-single-codegen-unit.rs
new file mode 100644
index 000000000..a13c12c17
--- /dev/null
+++ b/tests/ui/sanitize/sanitizer-cfi-with-rustc-lto-requires-single-codegen-unit.rs
@@ -0,0 +1,8 @@
+// Verifies that `-Zsanitizer=cfi` with `-Clto` or `-Clto=thin` requires `-Ccodegen-units=1`.
+//
+// needs-sanitizer-cfi
+// compile-flags: -Ccodegen-units=2 -Clto -Ctarget-feature=-crt-static -Zsanitizer=cfi
+
+#![feature(no_core)]
+#![no_core]
+#![no_main]
diff --git a/tests/ui/sanitize/sanitizer-cfi-with-rustc-lto-requires-single-codegen-unit.stderr b/tests/ui/sanitize/sanitizer-cfi-with-rustc-lto-requires-single-codegen-unit.stderr
new file mode 100644
index 000000000..136f49360
--- /dev/null
+++ b/tests/ui/sanitize/sanitizer-cfi-with-rustc-lto-requires-single-codegen-unit.stderr
@@ -0,0 +1,4 @@
+error: `-Zsanitizer=cfi` with `-Clto` requires `-Ccodegen-units=1`
+
+error: aborting due to previous error
+
diff --git a/tests/ui/sanitize/use-after-scope.rs b/tests/ui/sanitize/use-after-scope.rs
index 30be2ae6f..de63eea19 100644
--- a/tests/ui/sanitize/use-after-scope.rs
+++ b/tests/ui/sanitize/use-after-scope.rs
@@ -1,5 +1,6 @@
// needs-sanitizer-support
// needs-sanitizer-address
+// ignore-cross-compile
//
// compile-flags: -Zsanitizer=address
// run-fail