From 31d011a399e7d105fb82283c788e55019ecdbaa2 Mon Sep 17 00:00:00 2001 From: andrewtkent Date: Tue, 27 Jan 2026 13:27:30 -0800 Subject: [PATCH] Add FileCheck annotations to simplify_match.rs Remove `skip-filecheck` and add FileCheck directives to verify that GVN propagates the constant `false` and eliminates the match entirely. The test now verifies: - The debug info shows `x` as `const false` (constant propagation) - No `switchInt` remains (match elimination) - The function body is just `return` (dead code elimination) --- tests/mir-opt/simplify_match.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/mir-opt/simplify_match.rs b/tests/mir-opt/simplify_match.rs index b035b6339fae..ca9dac40aa91 100644 --- a/tests/mir-opt/simplify_match.rs +++ b/tests/mir-opt/simplify_match.rs @@ -1,9 +1,15 @@ -// skip-filecheck +//! Test that GVN propagates the constant `false` and eliminates the match. // EMIT_MIR_FOR_EACH_PANIC_STRATEGY + #[inline(never)] fn noop() {} // EMIT_MIR simplify_match.main.GVN.diff +// CHECK-LABEL: fn main( +// CHECK: debug x => const false; +// CHECK-NOT: switchInt +// CHECK: bb0: { +// CHECK-NEXT: return; fn main() { match { let x = false;