about summary refs log tree commit diff
path: root/tests/codegen/array-map.rs
diff options
context:
space:
mode:
authorScott McMurray <scottmcm@users.noreply.github.com>2023-02-03 03:27:51 -0800
committerScott McMurray <scottmcm@users.noreply.github.com>2023-02-04 16:44:51 -0800
commit5bc328fdeff50b742a8136d0633924514d4d76b8 (patch)
tree09d950684bda2a834a15b40d275f11752dcb6743 /tests/codegen/array-map.rs
parent52df0558ea349fa65036e61f0a647ea8072ec3f5 (diff)
downloadrust-5bc328fdeff50b742a8136d0633924514d4d76b8.tar.gz
rust-5bc328fdeff50b742a8136d0633924514d4d76b8.zip
Allow canonicalizing the `array::map` loop in trusted cases
Diffstat (limited to 'tests/codegen/array-map.rs')
-rw-r--r--tests/codegen/array-map.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/codegen/array-map.rs b/tests/codegen/array-map.rs
index 1154659eea5..9298e89e397 100644
--- a/tests/codegen/array-map.rs
+++ b/tests/codegen/array-map.rs
@@ -43,5 +43,7 @@ pub fn long_integer_map(x: [u32; 64]) -> [u32; 64] {
     // CHECK-NEXT: alloca [64 x i32]
     // CHECK-NEXT: alloca %"core::mem::manually_drop::ManuallyDrop<[u32; 64]>"
     // CHECK-NOT: alloca
-    x.map(|x| 2 * x + 1)
+    // CHECK: mul <{{[0-9]+}} x i32>
+    // CHECK: add <{{[0-9]+}} x i32>
+    x.map(|x| 13 * x + 7)
 }