Skip to content

Commit

Permalink
Unrolled build for rust-lang#125305
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#125305 - jwong101:120493-codegen-test, r=the8472

add some codegen tests for issue 120493

I forgot to add these in rust-lang#123878.
  • Loading branch information
rust-timer authored May 20, 2024
2 parents 474bee7 + a4efe6f commit fdc8281
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/codegen/vec-in-place.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,25 @@ pub fn vec_iterator_cast_deaggregate_fold(vec: Vec<Baz>) -> Vec<[u64; 4]> {
// correct.
vec.into_iter().map(|e| unsafe { std::mem::transmute(e) }).collect()
}

// CHECK-LABEL: @vec_iterator_cast_unwrap_drop
#[no_mangle]
pub fn vec_iterator_cast_unwrap_drop(vec: Vec<Wrapper<String>>) -> Vec<String> {
// CHECK-NOT: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}
// CHECK-NOT: call
// CHECK-NOT: %{{.*}} = mul
// CHECK-NOT: %{{.*}} = udiv

vec.into_iter().map(|Wrapper(e)| e).collect()
}

// CHECK-LABEL: @vec_iterator_cast_wrap_drop
#[no_mangle]
pub fn vec_iterator_cast_wrap_drop(vec: Vec<String>) -> Vec<Wrapper<String>> {
// CHECK-NOT: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}
// CHECK-NOT: call
// CHECK-NOT: %{{.*}} = mul
// CHECK-NOT: %{{.*}} = udiv

vec.into_iter().map(Wrapper).collect()
}

0 comments on commit fdc8281

Please sign in to comment.