Skip to content

Commit 29aaa11

Browse files
Added more prove-rs failing tests (#577)
Added some failing tests, specifically: - `assert_eq_exp-fail.rs`: which fails since the operand inside `assert_eq` that is an addition expression being treated as an `Operand::Constant` which is then promoted to the `GlobalAlloc`s. So @gtrepta you were right that `assert_eq` was working, but only with `Operand::{Copy,Move}`. I encourage you to run `rustc --emir mir` to see the promoted constant in the textual mir. - `bitwise-fail.rs`: which fails since the bitwise operators are not implemented --------- Co-authored-by: devops <[email protected]>
1 parent d131a7d commit 29aaa11

File tree

9 files changed

+75
-4
lines changed

9 files changed

+75
-4
lines changed

kmir/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "kmir"
7-
version = "0.3.155"
7+
version = "0.3.156"
88
description = ""
99
requires-python = "~=3.10"
1010
dependencies = [

kmir/src/kmir/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
from typing import Final
22

3-
VERSION: Final = '0.3.155'
3+
VERSION: Final = '0.3.156'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
fn main() {
2+
let a = 42;
3+
4+
assert_eq!(3 + 39, a);
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
fn and(x: i32, y: i32) -> i32 {
2+
x & y
3+
}
4+
5+
fn or(x: i32, y: i32) -> i32 {
6+
x | y
7+
}
8+
9+
fn xor(x: i32, y: i32) -> i32 {
10+
x ^ y
11+
}
12+
13+
fn shift_left(x: i32, y: i32) -> i32 {
14+
x << y
15+
}
16+
17+
fn shift_right(x: i32, y: i32) -> i32 {
18+
x >> y
19+
}
20+
21+
fn main() {
22+
assert!(and(3, 4) == 0);
23+
24+
assert!(or(3, 4) == 7);
25+
26+
assert!(xor(3, 7) == 4);
27+
28+
assert!(shift_left(1, 4) == 16);
29+
30+
assert!(shift_right(32, 4) == 2);
31+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
┌─ 1 (root, init)
3+
│ #init ( symbol ( "assert_eq_exp_fail" ) globalAllocEntry ( 0 , Memory ( allocati
4+
│ function: main
5+
│ span: 93
6+
7+
│ (88 steps)
8+
└─ 3 (stuck, leaf)
9+
#readProjection ( typedValue ( Any , ty ( 25 ) , mutabilityNot ) , projectionEle
10+
function: main
11+
span: 101
12+
13+
14+
┌─ 2 (root, leaf, target, terminal)
15+
│ #EndProgram
16+
17+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
┌─ 1 (root, init)
3+
│ #init ( symbol ( "bitwise_fail" ) globalAllocEntry ( 5 , Memory ( allocation ( .
4+
│ function: main
5+
│ span: 68
6+
7+
│ (30 steps)
8+
└─ 3 (stuck, leaf)
9+
#compute ( binOpBitAnd , typedValue ( Integer ( 3 , 32 , true ) , ty ( 16 ) , mu
10+
span: 50
11+
12+
13+
┌─ 2 (root, leaf, target, terminal)
14+
│ #EndProgram
15+
16+

kmir/src/tests/integration/test_integration.py

+2
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,8 @@ def test_prove(spec: Path, tmp_path: Path, kmir: KMIR) -> None:
438438
PROVING_FILES = list(PROVING_DIR.glob('*.rs'))
439439
PROVE_RS_SHOW_SPECS = [
440440
'local-raw-fail',
441+
'assert_eq_exp-fail',
442+
'bitwise-fail',
441443
]
442444

443445

kmir/uv.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package/version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.3.155
1+
0.3.156

0 commit comments

Comments
 (0)