about summary refs log tree commit diff
path: root/tests/coverage/loop-break.coverage
diff options
context:
space:
mode:
authorZalathar <Zalathar@users.noreply.github.com>2024-06-12 22:48:11 +1000
committerZalathar <Zalathar@users.noreply.github.com>2024-06-12 22:48:11 +1000
commit0bfdb8d33dd89099fc2b573d3df4c2347ffa2dbb (patch)
tree1f53fe6abc3b161f559c1d63cc889d1bc6ab6b7f /tests/coverage/loop-break.coverage
parentdc6def3042074f38e7c6bdaba3038fb2b1f0e2aa (diff)
downloadrust-0bfdb8d33dd89099fc2b573d3df4c2347ffa2dbb.tar.gz
rust-0bfdb8d33dd89099fc2b573d3df4c2347ffa2dbb.zip
coverage: Add `tests/coverage/loop-break.rs`
This is a modified copy of `tests/mir-opt/coverage/instrument_coverage.rs`.
Diffstat (limited to 'tests/coverage/loop-break.coverage')
-rw-r--r--tests/coverage/loop-break.coverage14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/coverage/loop-break.coverage b/tests/coverage/loop-break.coverage
new file mode 100644
index 00000000000..cea7dee83f1
--- /dev/null
+++ b/tests/coverage/loop-break.coverage
@@ -0,0 +1,14 @@
+   LL|       |//@ edition: 2021
+   LL|       |
+   LL|      1|fn main() {
+   LL|      1|    loop {
+   LL|      1|        if core::hint::black_box(true) {
+   LL|      1|            break;
+   LL|      0|        }
+   LL|       |    }
+   LL|      1|}
+   LL|       |
+   LL|       |// This test is a lightly-modified version of `tests/mir-opt/coverage/instrument_coverage.rs`.
+   LL|       |// If this test needs to be blessed, then the mir-opt version probably needs to
+   LL|       |// be blessed too!
+