Skip to content

Commit

Permalink
simplify test
Browse files Browse the repository at this point in the history
  • Loading branch information
crusso committed Dec 19, 2023
1 parent 7714bcd commit 1aa6697
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions test/run-drun/region-nat32-bug.mo
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,33 @@ import Region "stable-region/Region";
let r = Region.new();
let 0 = Region.grow(r, 1);

var i : Nat32 = 0;
while(i < 0xFFFF_FF00) {
do {
var i : Nat32 = 0;
while(i < 0xFFFF) {
Region.storeNat32(r, 0, i);
let i32 = Region.loadNat32(r, 0);
let i64 = Region.loadNat64(r, 0);
if (i32 != i or Prim.nat64ToNat32(i64) != i) {
Prim.debugPrint(debug_show({i;i64;i32;bytes=Region.loadBlob(r,0,4)}));
assert(false);
};
i += 256;
i += 1;
};
};

do {
var i : Nat32 = 0xFFFF_FFFF;
while(i > 0xFFFF_0000) {
Region.storeNat32(r, 0, i);
let i32 = Region.loadNat32(r, 0);
let i64 = Region.loadNat64(r, 0);
if (i32 != i or Prim.nat64ToNat32(i64) != i) {
Prim.debugPrint(debug_show({i;i64;i32;bytes=Region.loadBlob(r,0,4)}));
assert(false);
};
i -= 1;
};
}

//SKIP run-low
//SKIP run
Expand Down

0 comments on commit 1aa6697

Please sign in to comment.