Skip to content

Commit d1c52ad

Browse files
committed
Added test for size_of_val (showing it is stuck)
1 parent 558c0c4 commit d1c52ad

3 files changed

Lines changed: 23 additions & 1 deletion

File tree

kmir/src/tests/integration/data/prove-rs/intrinsics.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,10 @@ pub fn test_ctlz_nonzero() {
5959
let r = unsafe { intrinsics::ctlz_nonzero(x) };
6060
assert!(r == 31);
6161
}
62+
63+
#[no_mangle]
64+
pub fn test_size_of_val() {
65+
let x: u32 = 0;
66+
let r = unsafe { intrinsics::size_of_val(&x as *const u32) };
67+
assert!(r == 4);
68+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
┌─ 1 (root, init)
3+
│ #execTerminator ( terminator ( ... kind: terminatorKindCall ( ... func: operandC
4+
│ span: 0
5+
6+
│ (32 steps)
7+
└─ 3 (stuck, leaf)
8+
#execIntrinsic ( IntrinsicFunction ( symbol ( "size_of_val" ) ) , operandMove (
9+
span: 232
10+
11+
12+
┌─ 2 (root, leaf, target, terminal)
13+
│ #EndProgram ~> .K
14+
15+

kmir/src/tests/integration/test_integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
PROVE_DIR = (Path(__file__).parent / 'data' / 'prove-rs').resolve(strict=True)
2929
PROVE_FILES = list(PROVE_DIR.glob('*.*'))
3030
PROVE_START_SYMBOLS = {
31-
'intrinsics': ['main', 'test_rotate_left', 'test_bswap', 'test_ctpop', 'test_ctlz_nonzero'],
31+
'intrinsics': ['main', 'test_rotate_left', 'test_bswap', 'test_ctpop', 'test_ctlz_nonzero', 'test_size_of_val'],
3232
'symbolic-args-fail': ['main', 'eats_all_args'],
3333
'symbolic-structs-fail': ['eats_struct_args'],
3434
'unchecked_arithmetic': ['unchecked_add_i32', 'unchecked_sub_usize', 'unchecked_mul_isize'],

0 commit comments

Comments
 (0)