about summary refs log tree commit diff
path: root/tests/codegen
diff options
context:
space:
mode:
authorMarkus Reiter <me@reitermark.us>2024-07-21 18:21:13 +0200
committerMarkus Reiter <me@reitermark.us>2024-07-21 18:21:33 +0200
commit2f2eb22b736f0eb364bd6c6119a3d3b90bf882ff (patch)
treeae5b9b2e654d09caf3abc26655f4ec3d9a67dfe2 /tests/codegen
parentb455e437298683fce04aefa29951cbb1ada3c929 (diff)
downloadrust-2f2eb22b736f0eb364bd6c6119a3d3b90bf882ff.tar.gz
rust-2f2eb22b736f0eb364bd6c6119a3d3b90bf882ff.zip
Use `leading_zeros` instead of `ilog2` in tests.
Diffstat (limited to 'tests/codegen')
-rw-r--r--tests/codegen/cast-optimized.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/codegen/cast-optimized.rs b/tests/codegen/cast-optimized.rs
index 1c8687923d0..313b2b4f0d6 100644
--- a/tests/codegen/cast-optimized.rs
+++ b/tests/codegen/cast-optimized.rs
@@ -6,10 +6,10 @@
 
 // CHECK-LABEL: @u32_index
 #[no_mangle]
-pub fn u32_index(c: u32) -> [bool; 21] {
-    let mut array = [false; 21];
+pub fn u32_index(c: u32) -> [bool; 22] {
+    let mut array = [false; 22];
 
-    let index = c.ilog2();
+    let index = 32 - c.leading_zeros();
 
     // CHECK: call core::panicking::panic
     array[index as usize] = true;
@@ -19,14 +19,14 @@ pub fn u32_index(c: u32) -> [bool; 21] {
 
 // CHECK-LABEL: @char_as_u32_index
 #[no_mangle]
-pub fn char_as_u32_index(c: char) -> [bool; 21] {
+pub fn char_as_u32_index(c: char) -> [bool; 22] {
     // CHECK: %[[B:.+]] = icmp ult i32 %c, 1114112
     // CHECK: call void @llvm.assume(i1 %[[B]])
     let c = c as u32;
 
-    let mut array = [false; 21];
+    let mut array = [false; 22];
 
-    let index = c.ilog2();
+    let index = 32 - c.leading_zeros();
 
     // CHECK-NOT: call core::panicking::panic
     array[index as usize] = true;