summaryrefslogtreecommitdiff
path: root/tests/src/bitwise.rs
diff options
context:
space:
mode:
authorGuillaume Boisseau2024-05-24 14:37:29 +0200
committerGitHub2024-05-24 14:37:29 +0200
commit3c8ea6df20f92be9c341bbfb748f65d6c598fead (patch)
tree63429c0be3daff353dbc6d667618e4028490cc79 /tests/src/bitwise.rs
parentc6c9e351546a723e62cc21579b2359dba3bfb56f (diff)
parent41f78066da5cc10af6312ab1bef71e45ff460688 (diff)
Merge pull request #197 from AeneasVerif/test-harness3
Diffstat (limited to '')
-rw-r--r--tests/src/bitwise.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/src/bitwise.rs b/tests/src/bitwise.rs
new file mode 100644
index 00000000..9f48cb04
--- /dev/null
+++ b/tests/src/bitwise.rs
@@ -0,0 +1,27 @@
+//! Exercise the bitwise operations
+
+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
+}
+
+pub fn xor_u32(a: u32, b: u32) -> u32 {
+ a ^ b
+}
+
+pub fn or_u32(a: u32, b: u32) -> u32 {
+ a | b
+}
+
+pub fn and_u32(a: u32, b: u32) -> u32 {
+ a & b
+}