Skip to content

Commit

Permalink
Null tests
Browse files Browse the repository at this point in the history
  • Loading branch information
btwj committed Jan 15, 2024
1 parent e8915f2 commit e6a7a5a
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/variants/ub_null00.v3
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//@execute 0=false;1=false;2=true;3=false;4=false;5=true
type A00 #unboxed {
case X(a: u64);
case Y(b: u32);
}

var n: A00;

var arr: Array<A00> = [n, n, n, A00.X(12), A00.Y(34), A00.X(0)];
var arr2 = [A00.X(12), A00.Y(34), A00.X(0), n, n, n];

def main(a: int) -> bool {
return arr[a] == arr2[a];
}
14 changes: 14 additions & 0 deletions test/variants/ub_null01.v3
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//@execute 0=false;1=false;2=true;3=false;4=false;5=true
type A00 {
case X(a: u64) #unboxed;
case Y(b: u32);
}

var n: A00;

var arr: Array<A00> = [n, n, n, A00.X(12), A00.Y(34), A00.X(0)];
var arr2 = [A00.X(12), A00.Y(34), A00.X(0), n, n, n];

def main(a: int) -> bool {
return arr[a] == arr2[a];
}
14 changes: 14 additions & 0 deletions test/variants/ub_null02.v3
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//@execute 0=false;1=false;2=true;3=false;4=false;5=true
type A00 {
case X(a: u64);
case Y(b: u32) #unboxed;
}

var n: A00;

var arr: Array<A00> = [n, n, n, A00.X(12), A00.Y(34), A00.X(0)];
var arr2 = [A00.X(12), A00.Y(34), A00.X(0), n, n, n];

def main(a: int) -> bool {
return arr[a] == arr2[a];
}

0 comments on commit e6a7a5a

Please sign in to comment.