From c4d69b717f7dc6a469a65a1194ccdba2a833fefc Mon Sep 17 00:00:00 2001 From: Erik Desjardins Date: Sat, 20 May 2023 19:41:28 -0400 Subject: [PATCH] make noalias-box-off filecheck more precise The CHECK, -NOT, -SAME pattern ensures that the `CHECK-NOT: noalias` is limited to only one line, and won't match unrelated lines further down in the file. Explicit drop call added to preserve the `foo` argument name, since names of unused arguments are not preserved. --- tests/codegen/noalias-box-off.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/codegen/noalias-box-off.rs b/tests/codegen/noalias-box-off.rs index aef3fd73994..c82c53b2a48 100644 --- a/tests/codegen/noalias-box-off.rs +++ b/tests/codegen/noalias-box-off.rs @@ -3,6 +3,9 @@ #![crate_type = "lib"] // CHECK-LABEL: @box_should_not_have_noalias_if_disabled( -// CHECK-NOT: noalias{{.*}}% +// CHECK-NOT: noalias +// CHECK-SAME: %foo) #[no_mangle] -pub fn box_should_not_have_noalias_if_disabled(_b: Box) {} +pub fn box_should_not_have_noalias_if_disabled(foo: Box) { + drop(foo); +}