summaryrefslogtreecommitdiffstats
path: root/tests/coverage-map/status-quo/inline-dead.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/coverage-map/status-quo/inline-dead.rs')
-rw-r--r--tests/coverage-map/status-quo/inline-dead.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/coverage-map/status-quo/inline-dead.rs b/tests/coverage-map/status-quo/inline-dead.rs
new file mode 100644
index 000000000..854fa0629
--- /dev/null
+++ b/tests/coverage-map/status-quo/inline-dead.rs
@@ -0,0 +1,27 @@
+// Regression test for issue #98833.
+// compile-flags: -Zinline-mir -Cdebug-assertions=off
+
+fn main() {
+ println!("{}", live::<false>());
+
+ let f = |x: bool| {
+ debug_assert!(
+ x
+ );
+ };
+ f(false);
+}
+
+#[inline]
+fn live<const B: bool>() -> u32 {
+ if B {
+ dead()
+ } else {
+ 0
+ }
+}
+
+#[inline]
+fn dead() -> u32 {
+ 42
+}