diff options
| author | Zalathar <Zalathar@users.noreply.github.com> | 2023-06-12 18:07:04 +1000 |
|---|---|---|
| committer | Zalathar <Zalathar@users.noreply.github.com> | 2023-06-28 11:09:19 +1000 |
| commit | e0625b4586c5a0f855a1157b09ae384f5de0ecf7 (patch) | |
| tree | d6f6d80e1d6b9aaec8b6340986a3e22475775651 /tests/run-coverage/inline-dead.coverage | |
| parent | 22e119bbacd3aa11db04d84947b4fb2c5ccb0435 (diff) | |
| download | rust-e0625b4586c5a0f855a1157b09ae384f5de0ecf7.tar.gz rust-e0625b4586c5a0f855a1157b09ae384f5de0ecf7.zip | |
Migrate most of the existing coverage tests over to `run-coverage`
Diffstat (limited to 'tests/run-coverage/inline-dead.coverage')
| -rw-r--r-- | tests/run-coverage/inline-dead.coverage | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/run-coverage/inline-dead.coverage b/tests/run-coverage/inline-dead.coverage new file mode 100644 index 00000000000..a59fe1146f4 --- /dev/null +++ b/tests/run-coverage/inline-dead.coverage @@ -0,0 +1,28 @@ + 1| |// Regression test for issue #98833. + 2| |// compile-flags: -Zinline-mir -Cdebug-assertions=off + 3| | + 4| 1|fn main() { + 5| 1| println!("{}", live::<false>()); + 6| 1| + 7| 1| let f = |x: bool| { + 8| | debug_assert!( + 9| 0| x + 10| | ); + 11| 1| }; + 12| 1| f(false); + 13| 1|} + 14| | + 15| |#[inline] + 16| 1|fn live<const B: bool>() -> u32 { + 17| 1| if B { + 18| 0| dead() + 19| | } else { + 20| 1| 0 + 21| | } + 22| 1|} + 23| | + 24| |#[inline] + 25| 0|fn dead() -> u32 { + 26| 0| 42 + 27| 0|} + |
