Skip to content

Commit c4d69b7

Browse files
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.
1 parent 6448183 commit c4d69b7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/codegen/noalias-box-off.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
#![crate_type = "lib"]
44

55
// CHECK-LABEL: @box_should_not_have_noalias_if_disabled(
6-
// CHECK-NOT: noalias{{.*}}%
6+
// CHECK-NOT: noalias
7+
// CHECK-SAME: %foo)
78
#[no_mangle]
8-
pub fn box_should_not_have_noalias_if_disabled(_b: Box<u8>) {}
9+
pub fn box_should_not_have_noalias_if_disabled(foo: Box<u8>) {
10+
drop(foo);
11+
}

0 commit comments

Comments
 (0)