Skip to content

Commit 2f2eb22

Browse files
committed
Use leading_zeros instead of ilog2 in tests.
1 parent b455e43 commit 2f2eb22

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Diff for: tests/codegen/cast-optimized.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66

77
// CHECK-LABEL: @u32_index
88
#[no_mangle]
9-
pub fn u32_index(c: u32) -> [bool; 21] {
10-
let mut array = [false; 21];
9+
pub fn u32_index(c: u32) -> [bool; 22] {
10+
let mut array = [false; 22];
1111

12-
let index = c.ilog2();
12+
let index = 32 - c.leading_zeros();
1313

1414
// CHECK: call core::panicking::panic
1515
array[index as usize] = true;
@@ -19,14 +19,14 @@ pub fn u32_index(c: u32) -> [bool; 21] {
1919

2020
// CHECK-LABEL: @char_as_u32_index
2121
#[no_mangle]
22-
pub fn char_as_u32_index(c: char) -> [bool; 21] {
22+
pub fn char_as_u32_index(c: char) -> [bool; 22] {
2323
// CHECK: %[[B:.+]] = icmp ult i32 %c, 1114112
2424
// CHECK: call void @llvm.assume(i1 %[[B]])
2525
let c = c as u32;
2626

27-
let mut array = [false; 21];
27+
let mut array = [false; 22];
2828

29-
let index = c.ilog2();
29+
let index = 32 - c.leading_zeros();
3030

3131
// CHECK-NOT: call core::panicking::panic
3232
array[index as usize] = true;

0 commit comments

Comments
 (0)