Skip to content

Commit d978a1c

Browse files
authored
Rollup merge of #121531 - saethlin:ignore-less-debug, r=compiler-errors
Ignore less tests in debug builds Since #120594 and #120863, nearly all UB-detecting debug assertions get compiled out of code that is monomorphized by a crate built with debug assertions disabled. Which means that if we default all our codegen tests to `-Cdebug-assertions=no`, most of them work just fine against a sysroot built with debug assertions. I also tried to explain a bit better why some tests need to be skipped, for those that still need to be skipped.
2 parents b87a713 + 2f3c0b9 commit d978a1c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+14
-62
lines changed

src/tools/compiletest/src/runtest.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2503,8 +2503,11 @@ impl<'test> TestCx<'test> {
25032503
// overridden by `compile-flags`.
25042504
rustc.arg("-Copt-level=2");
25052505
}
2506-
RunPassValgrind | Pretty | DebugInfo | Codegen | Rustdoc | RustdocJson | RunMake
2507-
| CodegenUnits | JsDocTest | Assembly => {
2506+
Assembly | Codegen => {
2507+
rustc.arg("-Cdebug-assertions=no");
2508+
}
2509+
RunPassValgrind | Pretty | DebugInfo | Rustdoc | RustdocJson | RunMake
2510+
| CodegenUnits | JsDocTest => {
25082511
// do not use JSON output
25092512
}
25102513
}

tests/assembly/option-nonzero-eq.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
//@ compile-flags: --crate-type=lib -O -C llvm-args=-x86-asm-syntax=intel
66
//@ only-x86_64
77
//@ ignore-sgx
8-
//@ ignore-debug
98

109
use std::cmp::Ordering;
1110

tests/assembly/slice-is_ascii.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
//@ compile-flags: --crate-type=lib -O -C llvm-args=-x86-asm-syntax=intel
66
//@ only-x86_64
77
//@ ignore-sgx
8-
//@ ignore-debug
98

109
#![feature(str_internals)]
1110

tests/assembly/static-relocation-model.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//@ [A64] needs-llvm-components: aarch64
77
//@ [ppc64le] compile-flags: --target powerpc64le-unknown-linux-gnu -Crelocation-model=static
88
//@ [ppc64le] needs-llvm-components: powerpc
9-
//@ ignore-debug: alignment checks insert panics that we don't have a lang item for
109

1110
#![feature(no_core, lang_items)]
1211
#![no_core]

tests/codegen/align-offset.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ compile-flags: -O
2-
//@ ignore-debug (debug assertions in `slice::from_raw_parts` block optimizations)
32

43
#![crate_type = "lib"]
54

tests/codegen/array-map.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//@ compile-flags: -C opt-level=3 -C target-cpu=x86-64-v3
22
//@ only-x86_64
3-
//@ ignore-debug (the extra assertions get in the way)
43

54
#![crate_type = "lib"]
65

tests/codegen/ascii-char.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ compile-flags: -C opt-level=1
2-
//@ ignore-debug (the extra assertions get in the way)
32

43
#![crate_type = "lib"]
54
#![feature(ascii_char)]

tests/codegen/binary-search-index-no-bound-check.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ compile-flags: -O
2-
//@ ignore-debug: the debug assertions get in the way
32
#![crate_type = "lib"]
43

54
// Make sure no bounds checks are emitted when slicing or indexing

tests/codegen/infallible-unwrap-in-opt-z.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ compile-flags: -C opt-level=z --edition=2021
2-
//@ ignore-debug
32

43
#![crate_type = "lib"]
54

tests/codegen/issue-97217.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ compile-flags: -C opt-level=3
2-
//@ ignore-debug: the debug assertions get in the way
32
//@ min-llvm-version: 17.0.2
43
#![crate_type = "lib"]
54

0 commit comments

Comments
 (0)