mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
add codegen test
This commit is contained in:
parent
6c67e55270
commit
17f4c2a487
13
src/test/codegen/vec-in-place.rs
Normal file
13
src/test/codegen/vec-in-place.rs
Normal file
@ -0,0 +1,13 @@
|
||||
// compile-flags: -O
|
||||
// min-llvm-version: 11.0
|
||||
#![crate_type = "lib"]
|
||||
|
||||
// Ensure that trivial casts of vec elements are O(1)
|
||||
|
||||
// CHECK-LABEL: @vec_iterator_cast
|
||||
#[no_mangle]
|
||||
pub fn vec_iterator_cast(vec: Vec<isize>) -> Vec<usize> {
|
||||
// CHECK-NOT: loop
|
||||
// CHECK-NOT: call
|
||||
vec.into_iter().map(|e| e as usize).collect()
|
||||
}
|
Loading…
Reference in New Issue
Block a user