Skip to content

Commit

Permalink
Update baselines and some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vineethk committed Apr 10, 2024
1 parent f1a4351 commit 071dbf2
Show file tree
Hide file tree
Showing 27 changed files with 403 additions and 265 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,6 @@ fun assign::assign_struct($t0: &mut assign::S) {
4: write_ref($t0, $t1)
5: return ()
}


============ bytecode verification succeeded ========
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module 0x42::assign {

struct S {
struct S has drop {
f: u64,
g: T
}

struct T {
struct T has drop {
h: u64
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ public fun assign::main(): (u64, u64) {
1: $t1 := 3
2: return ($t0, $t1)
}


============ bytecode verification succeeded ========
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,6 @@ fun borrow::mut_param($t0: u64): u64 {
3: $t1 := read_ref($t2)
4: return $t1
}


============ bytecode verification succeeded ========
Original file line number Diff line number Diff line change
Expand Up @@ -350,3 +350,6 @@ public fun M::testb(): u64 {
6: $t0 := +($t1, $t4)
7: return $t0
}


============ bytecode verification succeeded ========
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,6 @@ fun m::will_autoref(): address {
3: $t0 := read_ref($t3)
4: return $t0
}


============ bytecode verification succeeded ========
Original file line number Diff line number Diff line change
Expand Up @@ -211,3 +211,6 @@ fun fields::write_val($t0: fields::S): fields::S {
5: $t1 := infer($t0)
6: return $t1
}


============ bytecode verification succeeded ========
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
module 0x42::fields {

struct S {
struct S has drop {
f: u64,
g: T
}

struct T {
struct T has drop {
h: u64
}

struct G<X> {
struct G<X> has drop {
f: X
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,3 +292,16 @@ fun freeze_mut_ref::t8($t0: bool, $t1: &mut freeze_mut_ref::S, $t2: &freeze_mut_
6: label L2
7: return ()
}


Diagnostics:
error: mutable reference in local `s` requires exclusive access but is borrowed
┌─ tests/bytecode-generator/freeze_mut_ref.move:66:35
65 │ let f = &mut ({x = x + 1; s}).f;
│ ----------------------- previous mutable field borrow
66 │ let g = &mut ({x = x + 1; s}).f;
│ ^ requirement enforced here
·
69 │ *({*f = 0; z = y; g}) = 2;
│ ------ conflicting reference `f` used here
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,6 @@ fun globals::write($t0: address, $t1: u64): u64 {
4: $t2 := 9
5: return $t2
}


============ bytecode verification succeeded ========
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,6 @@ fun if_else::if_else_nested($t0: bool, $t1: u64): u64 {
19: label L5
20: return $t2
}


============ bytecode verification succeeded ========
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,6 @@ fun inline_specs::succ($t0: u64): u64 {
1: $t1 := +($t0, $t2)
2: return $t1
}


============ bytecode verification succeeded ========
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,6 @@ fun loops::while_loop_with_break_and_continue($t0: u64): u64 {
30: $t1 := infer($t0)
31: return $t1
}


============ bytecode verification succeeded ========
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,6 @@ fun operators::order($t0: u64, $t1: u64): bool {
23: label L8
24: return $t2
}


============ bytecode verification succeeded ========
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ module 0x42::operators {
x && y || x && !y || !x && y || !x && !y
}

fun equality<T>(x: T, y: T): bool {
fun equality<T: drop>(x: T, y: T): bool {
x == y
}

fun inequality<T>(x: T, y: T): bool {
fun inequality<T: drop>(x: T, y: T): bool {
x != y
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,6 @@ fun pack_unpack::pack6($t0: u8, $t1: u8, $t2: u8): pack_unpack::S {
2: $t3 := pack pack_unpack::S($t2, $t5, $t4)
3: return $t3
}


============ bytecode verification succeeded ========
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,6 @@ fun pack_unpack::unpack($t0: pack_unpack::S): (u64, u64) {
3: $t2 := infer($t4)
4: return ($t1, $t2)
}


============ bytecode verification succeeded ========
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,6 @@ fun reference_conversion::use_it(): u64 {
5: $t0 := reference_conversion::deref($t4)
6: return $t0
}


============ bytecode verification succeeded ========
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ public fun m::foo($t0: &m::S): u8 {
4: $t1 := read_ref($t5)
5: return $t1
}


============ bytecode verification succeeded ========
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ fun vector::create(): vector<u64> {
0: $t0 := ["1", "2", "3"]
1: return $t0
}


============ bytecode verification succeeded ========
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ L1: loc1: u64
L2: loc2: u64
L3: loc3: u64
L4: loc4: u64
L5: loc5: u64
L6: loc6: u64
B0:
0: LdU64(0)
1: LdConst[1](Vector(U64): [1, 1, 0, 0, 0, 0, 0, 0, 0])
Expand All @@ -91,34 +93,38 @@ B1:
6: ImmBorrowLoc[0](loc0: vector<u64>)
7: Call 1vector::is_empty<u64>(&vector<u64>): bool
8: Not
9: BrFalse(16)
9: BrFalse(20)
B2:
10: MutBorrowLoc[0](loc0: vector<u64>)
11: VecPopBack(5)
12: StLoc[2](loc2: u64)
13: LdU64(0)
14: StLoc[1](loc1: u64)
15: Branch(17)
13: MoveLoc[1](loc1: u64)
14: StLoc[3](loc3: u64)
15: MoveLoc[2](loc2: u64)
16: StLoc[4](loc4: u64)
17: LdU64(0)
18: StLoc[1](loc1: u64)
19: Branch(21)
B3:
16: Branch(18)
20: Branch(22)
B4:
17: Branch(6)
21: Branch(6)
B5:
18: MoveLoc[1](loc1: u64)
19: StLoc[3](loc3: u64)
20: LdU64(0)
21: StLoc[4](loc4: u64)
22: MoveLoc[3](loc3: u64)
23: MoveLoc[4](loc4: u64)
24: Eq
25: BrFalse(27)
22: MoveLoc[1](loc1: u64)
23: StLoc[5](loc5: u64)
24: LdU64(0)
25: StLoc[6](loc6: u64)
26: MoveLoc[5](loc5: u64)
27: MoveLoc[6](loc6: u64)
28: Eq
29: BrFalse(31)
B6:
26: Branch(29)
30: Branch(33)
B7:
27: LdU64(0)
28: Abort
31: LdU64(0)
32: Abort
B8:
29: Ret
33: Ret
}
}
============ bytecode verification succeeded ========
Loading

0 comments on commit 071dbf2

Please sign in to comment.