diff --git a/tests/codegen/autovectorize-f32x4.rs b/tests/codegen/autovectorize-f32x4.rs index 474ff1c4e91..54392be707f 100644 --- a/tests/codegen/autovectorize-f32x4.rs +++ b/tests/codegen/autovectorize-f32x4.rs @@ -30,3 +30,13 @@ } c } + +// CHECK-LABEL: @auto_vectorize_array_from_fn +#[no_mangle] +pub fn auto_vectorize_array_from_fn(a: [f32; 4], b: [f32; 4]) -> [f32; 4] { +// CHECK: load <4 x float> +// CHECK: load <4 x float> +// CHECK: fadd <4 x float> +// CHECK: store <4 x float> + std::array::from_fn(|i| a[i] + b[i]) +}