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`.
This commit is contained in:
parent
afa7f5bc8a
commit
d032a4b079
1 changed files with 6 additions and 1 deletions
|
|
@ -15,9 +15,14 @@
|
|||
|
||||
use std::iter;
|
||||
|
||||
// CHECK: @helper([[USIZE:i[0-9]+]] %arg0)
|
||||
#[no_mangle]
|
||||
pub fn helper(_: usize) {
|
||||
}
|
||||
|
||||
// CHECK-LABEL: @repeat_take_collect
|
||||
#[no_mangle]
|
||||
pub fn repeat_take_collect() -> Vec<u8> {
|
||||
// CHECK: call void @llvm.memset.p0i8
|
||||
// CHECK: call void @llvm.memset.p0i8.[[USIZE]](i8* {{(nonnull )?}}%{{[0-9]+}}, i8 42, [[USIZE]] 100000, i32 1, i1 false)
|
||||
iter::repeat(42).take(100000).collect()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue