summaryrefslogtreecommitdiffstats
path: root/tests/run-coverage/while_early_ret.coverage
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/run-coverage/while_early_ret.coverage
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/run-coverage/while_early_ret.coverage')
-rw-r--r--tests/run-coverage/while_early_ret.coverage84
1 files changed, 42 insertions, 42 deletions
diff --git a/tests/run-coverage/while_early_ret.coverage b/tests/run-coverage/while_early_ret.coverage
index 2ce94e013..97808447a 100644
--- a/tests/run-coverage/while_early_ret.coverage
+++ b/tests/run-coverage/while_early_ret.coverage
@@ -1,43 +1,43 @@
- 1| |#![allow(unused_assignments)]
- 2| |// failure-status: 1
- 3| |
- 4| 1|fn main() -> Result<(),u8> {
- 5| 1| let mut countdown = 10;
- 6| | while
- 7| 7| countdown
- 8| 7| >
- 9| 7| 0
- 10| | {
- 11| | if
- 12| 7| countdown
- 13| 7| <
- 14| 7| 5
- 15| | {
- 16| | return
- 17| | if
- 18| 1| countdown
- 19| 1| >
- 20| 1| 8
- 21| | {
- 22| 0| Ok(())
- 23| | }
- 24| | else
- 25| | {
- 26| 1| Err(1)
- 27| | }
- 28| | ;
- 29| 6| }
- 30| 6| countdown
- 31| 6| -=
- 32| 6| 1
- 33| | ;
- 34| | }
- 35| 0| Ok(())
- 36| 1|}
- 37| |
- 38| |// ISSUE(77553): Originally, this test had `Err(1)` on line 22 (instead of `Ok(())`) and
- 39| |// `std::process::exit(2)` on line 26 (instead of `Err(1)`); and this worked as expected on Linux
- 40| |// and MacOS. But on Windows (MSVC, at least), the call to `std::process::exit()` exits the program
- 41| |// without saving the InstrProf coverage counters. The use of `std::process:exit()` is not critical
- 42| |// to the coverage test for early returns, but this is a limitation that should be fixed.
+ LL| |#![allow(unused_assignments)]
+ LL| |// failure-status: 1
+ LL| |
+ LL| 1|fn main() -> Result<(),u8> {
+ LL| 1| let mut countdown = 10;
+ LL| | while
+ LL| 7| countdown
+ LL| 7| >
+ LL| 7| 0
+ LL| | {
+ LL| | if
+ LL| 7| countdown
+ LL| 7| <
+ LL| 7| 5
+ LL| | {
+ LL| | return
+ LL| | if
+ LL| 1| countdown
+ LL| 1| >
+ LL| 1| 8
+ LL| | {
+ LL| 0| Ok(())
+ LL| | }
+ LL| | else
+ LL| | {
+ LL| 1| Err(1)
+ LL| | }
+ LL| | ;
+ LL| 6| }
+ LL| 6| countdown
+ LL| 6| -=
+ LL| 6| 1
+ LL| | ;
+ LL| | }
+ LL| 0| Ok(())
+ LL| 1|}
+ LL| |
+ LL| |// ISSUE(77553): Originally, this test had `Err(1)` on line 22 (instead of `Ok(())`) and
+ LL| |// `std::process::exit(2)` on line 26 (instead of `Err(1)`); and this worked as expected on Linux
+ LL| |// and MacOS. But on Windows (MSVC, at least), the call to `std::process::exit()` exits the program
+ LL| |// without saving the InstrProf coverage counters. The use of `std::process:exit()` is not critical
+ LL| |// to the coverage test for early returns, but this is a limitation that should be fixed.