about summary refs log tree commit diff
path: root/tests/ui/instrument-coverage/mcdc-condition-limit.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-10-08 07:08:41 +0000
committerbors <bors@rust-lang.org>2024-10-08 07:08:41 +0000
commitcf24c73141a77db730f4b7fda69dcd7e8b113b51 (patch)
tree036b31c635fb5651cefd0f859046e5a174f8aef2 /tests/ui/instrument-coverage/mcdc-condition-limit.rs
parente6c46db4e9fd11e3183c397a59d946731034ede6 (diff)
parentacd64fa0d9e5c17de02a5b2a592163a377e33bcc (diff)
downloadrust-cf24c73141a77db730f4b7fda69dcd7e8b113b51.tar.gz
rust-cf24c73141a77db730f4b7fda69dcd7e8b113b51.zip
Auto merge of #126733 - ZhuUx:llvm-19-adapt, r=Zalathar
[Coverage][MCDC] Adapt mcdc to llvm 19

Related issue: #126672

Also finish task 4 at #124144

[llvm #82448](https://github.com/llvm/llvm-project/pull/82448) has introduced some break changes into mcdc, causing incompatibility between llvm 18 and 19. This draft adapts to that change and gives up supporting for llvm-18.
Diffstat (limited to 'tests/ui/instrument-coverage/mcdc-condition-limit.rs')
-rw-r--r--tests/ui/instrument-coverage/mcdc-condition-limit.rs16
1 files changed, 4 insertions, 12 deletions
diff --git a/tests/ui/instrument-coverage/mcdc-condition-limit.rs b/tests/ui/instrument-coverage/mcdc-condition-limit.rs
index 91ff6381df7..118ae482fc6 100644
--- a/tests/ui/instrument-coverage/mcdc-condition-limit.rs
+++ b/tests/ui/instrument-coverage/mcdc-condition-limit.rs
@@ -1,5 +1,6 @@
 //@ edition: 2021
-//@ revisions: good bad
+//@ min-llvm-version: 19
+//@ revisions: good
 //@ check-pass
 //@ compile-flags: -Cinstrument-coverage -Zcoverage-options=mcdc -Zno-profiler-runtime
 
@@ -14,18 +15,9 @@
 
 #[cfg(good)]
 fn main() {
-    // 6 conditions is OK, so no diagnostic.
-    let [a, b, c, d, e, f] = <[bool; 6]>::default();
-    if a && b && c && d && e && f {
-        core::hint::black_box("hello");
-    }
-}
-
-#[cfg(bad)]
-fn main() {
-    // 7 conditions is too many, so issue a diagnostic.
+    // 7 conditions is allowed, so no diagnostic.
     let [a, b, c, d, e, f, g] = <[bool; 7]>::default();
-    if a && b && c && d && e && f && g { //[bad]~ WARNING number of conditions in decision
+    if a && b && c && d && e && f && g {
         core::hint::black_box("hello");
     }
 }