Skip to content

Commit

Permalink
Update the shifts tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sonmarcho committed Nov 29, 2023
1 parent 86c0021 commit 83a6dfe
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions tests/src/shifts.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
//! Exercise the translation of bit shifts
#![allow(dead_code)]

fn f(a: u32) -> u32 {
let mut t = a >> 16;
t <<= 2;
t
pub fn shift_u32(a: u32) -> u32 {
let i: usize = 16;
let mut t = a >> i;
t <<= i;
t
}

pub fn shift_i32(a: i32) -> i32 {
let i: isize = 16;
let mut t = a >> i;
t <<= i;
t
}

0 comments on commit 83a6dfe

Please sign in to comment.