about summary refs log tree commit diff
path: root/src/tools/compiletest
diff options
context:
space:
mode:
authorZalathar <Zalathar@users.noreply.github.com>2023-10-26 21:34:49 +1100
committerZalathar <Zalathar@users.noreply.github.com>2023-11-07 11:15:18 +1100
commit7f8a6de72c1ddf25775da648dc42198847ca0a23 (patch)
tree9f61261774adacd6df3aa8c70fcb4d0fb1dd6ee3 /src/tools/compiletest
parent189d6c71f3bb6c52113b5639a80839791974fd22 (diff)
downloadrust-7f8a6de72c1ddf25775da648dc42198847ca0a23.tar.gz
rust-7f8a6de72c1ddf25775da648dc42198847ca0a23.zip
coverage: Use `-Copt-level=2` by default in run-coverage tests
This is a step towards being able to unify the two coverage test directories.

There are two tests that require adjustment:

- `overflow.rs` requires an explicit `-Coverflow-checks=yes`
- `sort_groups.rs` is sensitive to provably unused instantiations
Diffstat (limited to 'src/tools/compiletest')
-rw-r--r--src/tools/compiletest/src/runtest.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index e74d66a8599..4c6f46ef0dc 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -2481,9 +2481,9 @@ impl<'test> TestCx<'test> {
             RunCoverage => {
                 rustc.arg("-Cinstrument-coverage");
                 // Coverage reports are sometimes sensitive to optimizations,
-                // and the current snapshots assume no optimization unless
+                // and the current snapshots assume `opt-level=2` unless
                 // overridden by `compile-flags`.
-                rustc.arg("-Copt-level=0");
+                rustc.arg("-Copt-level=2");
             }
             RunPassValgrind | Pretty | DebugInfo | Codegen | Rustdoc | RustdocJson | RunMake
             | CodegenUnits | JsDocTest | Assembly => {