Skip to content

Commit d032a4b

Browse files
committed
Strengthen the repeat-trusted-len test
Simply checking for the presence of `llvm.memset` is too brittle because this instrinsic can be used for seemingly trivial operations, such as zero-initializing a `RawVec`.
1 parent afa7f5b commit d032a4b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/test/codegen/repeat-trusted-len.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,14 @@
1515

1616
use std::iter;
1717

18+
// CHECK: @helper([[USIZE:i[0-9]+]] %arg0)
19+
#[no_mangle]
20+
pub fn helper(_: usize) {
21+
}
22+
1823
// CHECK-LABEL: @repeat_take_collect
1924
#[no_mangle]
2025
pub fn repeat_take_collect() -> Vec<u8> {
21-
// CHECK: call void @llvm.memset.p0i8
26+
// CHECK: call void @llvm.memset.p0i8.[[USIZE]](i8* {{(nonnull )?}}%{{[0-9]+}}, i8 42, [[USIZE]] 100000, i32 1, i1 false)
2227
iter::repeat(42).take(100000).collect()
2328
}

0 commit comments

Comments
 (0)