test/wcc/data: grow the declarative compiler corpus to 1,224 fixtures
The r-prefixed waves absorb the runtime, reject, and byte-compare rows of the migrated native carriers; each fixture is one directory with one case.ww and a //ww:error, //ww:compile, //ww:run, or //ww:run-exit directive covering both frontends.
This commit is contained in:
18
test/wcc/data/alias_fsarg2_bound/case.ww
Normal file
18
test/wcc/data/alias_fsarg2_bound/case.ww
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
//ww:error c "#271/#165: float-bearing struct arg from a non-ident source" ww "#272/#276/#277: aggregate return reaches scalar default"
|
||||||
|
package main;
|
||||||
|
|
||||||
|
type fs0 = struct { x: f64 };
|
||||||
|
type fs = fs0;
|
||||||
|
|
||||||
|
fn mk() fs = {
|
||||||
|
let s: fs;
|
||||||
|
s.x = 2.5;
|
||||||
|
return s;
|
||||||
|
};
|
||||||
|
|
||||||
|
fn g(p: fs) f64 = { return p.x; };
|
||||||
|
|
||||||
|
export fn main() i32 = {
|
||||||
|
if (g(mk()) != 2.5) { return 1; };
|
||||||
|
return 0;
|
||||||
|
};
|
||||||
9
test/wcc/data/arrlit_slice_assign_named_accept/case.ww
Normal file
9
test/wcc/data/arrlit_slice_assign_named_accept/case.ww
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
//ww:run-exit 1
|
||||||
|
package main;
|
||||||
|
|
||||||
|
export fn main() i32 = {
|
||||||
|
let a: [3]i32 = [1, 2, 3];
|
||||||
|
let s: []i32 = a[0:1];
|
||||||
|
s = a;
|
||||||
|
return s[0];
|
||||||
|
};
|
||||||
8
test/wcc/data/arrlit_slice_reject_assign/case.ww
Normal file
8
test/wcc/data/arrlit_slice_reject_assign/case.ww
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
//ww:error c "cannot assign [3]int to []i32" ww "array literal cannot borrow as a slice here; bind it to a `let` first"
|
||||||
|
package main;
|
||||||
|
|
||||||
|
export fn main() i32 = {
|
||||||
|
let s: []i32 = [0, 0];
|
||||||
|
s = [1, 2, 3];
|
||||||
|
return s[0];
|
||||||
|
};
|
||||||
9
test/wcc/data/r56_cast_i16_high_bits/case.ww
Normal file
9
test/wcc/data/r56_cast_i16_high_bits/case.ww
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
fn main() i32 = {
|
||||||
|
let x: i64 = 0xFFFF8000i64;
|
||||||
|
let y: i16 = x: i16;
|
||||||
|
let z: i64 = y: i64;
|
||||||
|
if (z == -32768i64) { return 42; };
|
||||||
|
return 0;
|
||||||
|
};
|
||||||
9
test/wcc/data/r56_cast_i16_low_negative/case.ww
Normal file
9
test/wcc/data/r56_cast_i16_low_negative/case.ww
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
fn main() i32 = {
|
||||||
|
let x: i64 = 0x8000i64;
|
||||||
|
let y: i16 = x: i16;
|
||||||
|
let z: i64 = y: i64;
|
||||||
|
if (z == -32768i64) { return 42; };
|
||||||
|
return 0;
|
||||||
|
};
|
||||||
9
test/wcc/data/r56_cast_i32_high_bits/case.ww
Normal file
9
test/wcc/data/r56_cast_i32_high_bits/case.ww
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
fn main() i32 = {
|
||||||
|
let x: i64 = -2147483648i64;
|
||||||
|
let y: i32 = x: i32;
|
||||||
|
let z: i64 = y: i64;
|
||||||
|
if (z == -2147483648i64) { return 42; };
|
||||||
|
return 0;
|
||||||
|
};
|
||||||
9
test/wcc/data/r56_cast_i32_low_negative/case.ww
Normal file
9
test/wcc/data/r56_cast_i32_low_negative/case.ww
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
fn main() i32 = {
|
||||||
|
let x: i64 = 0x80000000i64;
|
||||||
|
let y: i32 = x: i32;
|
||||||
|
let z: i64 = y: i64;
|
||||||
|
if (z == -2147483648i64) { return 42; };
|
||||||
|
return 0;
|
||||||
|
};
|
||||||
9
test/wcc/data/r56_cast_i32_wrap_positive/case.ww
Normal file
9
test/wcc/data/r56_cast_i32_wrap_positive/case.ww
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
fn main() i32 = {
|
||||||
|
let x: i64 = 0x80000000i64;
|
||||||
|
let y: i32 = (x - 1i64): i32;
|
||||||
|
let z: i64 = y: i64;
|
||||||
|
if (z == 2147483647i64) { return 42; };
|
||||||
|
return 0;
|
||||||
|
};
|
||||||
9
test/wcc/data/r56_cast_i8_high_bits/case.ww
Normal file
9
test/wcc/data/r56_cast_i8_high_bits/case.ww
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
fn main() i32 = {
|
||||||
|
let x: i64 = 0xFFFFFF80i64;
|
||||||
|
let y: i8 = x: i8;
|
||||||
|
let z: i64 = y: i64;
|
||||||
|
if (z == -128i64) { return 42; };
|
||||||
|
return 0;
|
||||||
|
};
|
||||||
9
test/wcc/data/r56_cast_i8_low_negative/case.ww
Normal file
9
test/wcc/data/r56_cast_i8_low_negative/case.ww
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
fn main() i32 = {
|
||||||
|
let x: i64 = 0x80i64;
|
||||||
|
let y: i8 = x: i8;
|
||||||
|
let z: i64 = y: i64;
|
||||||
|
if (z == -128i64) { return 42; };
|
||||||
|
return 0;
|
||||||
|
};
|
||||||
9
test/wcc/data/r56_cast_i8_positive_max/case.ww
Normal file
9
test/wcc/data/r56_cast_i8_positive_max/case.ww
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
fn main() i32 = {
|
||||||
|
let x: i64 = 0x7Fi64;
|
||||||
|
let y: i8 = x: i8;
|
||||||
|
let z: i64 = y: i64;
|
||||||
|
if (z == 127i64) { return 42; };
|
||||||
|
return 0;
|
||||||
|
};
|
||||||
9
test/wcc/data/r56_cast_i8bang_signed/case.ww
Normal file
9
test/wcc/data/r56_cast_i8bang_signed/case.ww
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
type i8x = !i8;
|
||||||
|
fn main() i32 = {
|
||||||
|
let y: i8x = 0xFF80i64: i8x;
|
||||||
|
let z: i64 = y: i64;
|
||||||
|
if (z == -128i64) { return 42; };
|
||||||
|
return 0;
|
||||||
|
};
|
||||||
9
test/wcc/data/r56_cast_u8bang_unsigned/case.ww
Normal file
9
test/wcc/data/r56_cast_u8bang_unsigned/case.ww
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
type u8x = !u8;
|
||||||
|
fn main() i32 = {
|
||||||
|
let y: u8x = 0x1FFu64: u8x;
|
||||||
|
let z: u64 = y: u64;
|
||||||
|
if (z == 0xFFu64) { return 42; };
|
||||||
|
return 0;
|
||||||
|
};
|
||||||
8
test/wcc/data/r56_def_negative_i32/case.ww
Normal file
8
test/wcc/data/r56_def_negative_i32/case.ww
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
def NEG: i32 = -100;
|
||||||
|
fn main() i32 = {
|
||||||
|
let x: i32 = NEG;
|
||||||
|
if (x == -100) { return 42; };
|
||||||
|
return 1;
|
||||||
|
};
|
||||||
8
test/wcc/data/r56_def_negative_i64/case.ww
Normal file
8
test/wcc/data/r56_def_negative_i64/case.ww
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
def NEG: i64 = -1234567890i64;
|
||||||
|
fn main() i32 = {
|
||||||
|
let x: i64 = NEG;
|
||||||
|
if (x == -1234567890i64) { return 42; };
|
||||||
|
return 1;
|
||||||
|
};
|
||||||
8
test/wcc/data/r56_def_positive_i32/case.ww
Normal file
8
test/wcc/data/r56_def_positive_i32/case.ww
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
def POS: i32 = 100;
|
||||||
|
fn main() i32 = {
|
||||||
|
let x: i32 = POS;
|
||||||
|
if (x == 100) { return 42; };
|
||||||
|
return 1;
|
||||||
|
};
|
||||||
8
test/wcc/data/r56_def_tilde_i32/case.ww
Normal file
8
test/wcc/data/r56_def_tilde_i32/case.ww
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
def NTIL: i32 = ~0;
|
||||||
|
fn main() i32 = {
|
||||||
|
let x: i32 = NTIL;
|
||||||
|
if (x == -1) { return 42; };
|
||||||
|
return 1;
|
||||||
|
};
|
||||||
8
test/wcc/data/r56_def_tilde_u32/case.ww
Normal file
8
test/wcc/data/r56_def_tilde_u32/case.ww
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
def UMAX: u32 = ~0u32;
|
||||||
|
fn main() i32 = {
|
||||||
|
let x: u32 = UMAX;
|
||||||
|
if (x == 4294967295u32) { return 42; };
|
||||||
|
return 1;
|
||||||
|
};
|
||||||
8
test/wcc/data/r56_def_unary_plus_i32/case.ww
Normal file
8
test/wcc/data/r56_def_unary_plus_i32/case.ww
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
def P: i32 = +5;
|
||||||
|
fn main() i32 = {
|
||||||
|
let x: i32 = P;
|
||||||
|
if (x == 5) { return 42; };
|
||||||
|
return 1;
|
||||||
|
};
|
||||||
10
test/wcc/data/r56_strarg_local_chain/case.ww
Normal file
10
test/wcc/data/r56_strarg_local_chain/case.ww
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
type inner = struct { s: str, pad: i32 };
|
||||||
|
type outer = struct { i: inner, tag: i32 };
|
||||||
|
fn slen(s: str) i32 = { return s.len: i32; };
|
||||||
|
fn main() i32 = {
|
||||||
|
let o: outer; o.i.s = "qrstuvw";
|
||||||
|
if (slen(o.i.s) != 7) { return 1; };
|
||||||
|
return 42;
|
||||||
|
};
|
||||||
11
test/wcc/data/r56_strarg_ptr_chain/case.ww
Normal file
11
test/wcc/data/r56_strarg_ptr_chain/case.ww
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
type inner = struct { s: str, pad: i32 };
|
||||||
|
type outer = struct { i: inner, tag: i32 };
|
||||||
|
fn slen(s: str) i32 = { return s.len: i32; };
|
||||||
|
fn main() i32 = {
|
||||||
|
let o: outer; o.i.s = "abcdef";
|
||||||
|
let p: *outer = &o;
|
||||||
|
if (slen(p.i.s) != 6) { return 1; };
|
||||||
|
return 42;
|
||||||
|
};
|
||||||
10
test/wcc/data/r56_strarg_ptr_field/case.ww
Normal file
10
test/wcc/data/r56_strarg_ptr_field/case.ww
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
type outer = struct { s: str, x: i32 };
|
||||||
|
fn slen(s: str) i32 = { return s.len: i32; };
|
||||||
|
fn main() i32 = {
|
||||||
|
let o: outer; o.s = "hello";
|
||||||
|
let p: *outer = &o;
|
||||||
|
if (slen(p.s) != 5) { return 1; };
|
||||||
|
return 42;
|
||||||
|
};
|
||||||
4
test/wcc/data/r630_global_address/case.ww
Normal file
4
test/wcc/data/r630_global_address/case.ww
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
//ww:run-exit 55
|
||||||
|
package main;
|
||||||
|
let counter: i32 = 11;
|
||||||
|
fn main() i32 = { let p: *i32 = &counter; *p = 55; return counter; };
|
||||||
4
test/wcc/data/r630_global_assign/case.ww
Normal file
4
test/wcc/data/r630_global_assign/case.ww
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
//ww:run-exit 99
|
||||||
|
package main;
|
||||||
|
let counter: i32 = 0;
|
||||||
|
fn main() i32 = { counter = 99; return counter; };
|
||||||
5
test/wcc/data/r630_global_compound/case.ww
Normal file
5
test/wcc/data/r630_global_compound/case.ww
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
//ww:run-exit 4
|
||||||
|
package main;
|
||||||
|
let counter: i32 = 1;
|
||||||
|
fn inc() void = { counter += 1; };
|
||||||
|
fn main() i32 = { inc(); inc(); inc(); return counter; };
|
||||||
4
test/wcc/data/r630_global_f32_literal/case.ww
Normal file
4
test/wcc/data/r630_global_f32_literal/case.ww
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
//ww:run-exit 4
|
||||||
|
package main;
|
||||||
|
let half: f32 = 4.25;
|
||||||
|
fn main() i32 = { return half: i32; };
|
||||||
5
test/wcc/data/r630_global_f64_arith/case.ww
Normal file
5
test/wcc/data/r630_global_f64_arith/case.ww
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
//ww:run-exit 11
|
||||||
|
package main;
|
||||||
|
let a: f64 = 7.5;
|
||||||
|
let b: f64 = 4.25;
|
||||||
|
fn main() i32 = { let s: f64 = a + b; return s: i32; };
|
||||||
4
test/wcc/data/r630_global_f64_literal/case.ww
Normal file
4
test/wcc/data/r630_global_f64_literal/case.ww
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
//ww:run-exit 7
|
||||||
|
package main;
|
||||||
|
let pi: f64 = 7.5;
|
||||||
|
fn main() i32 = { return pi: i32; };
|
||||||
4
test/wcc/data/r630_global_f64_reassign/case.ww
Normal file
4
test/wcc/data/r630_global_f64_reassign/case.ww
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
//ww:run-exit 7
|
||||||
|
package main;
|
||||||
|
let pi: f64 = 1.0;
|
||||||
|
fn main() i32 = { pi = 7.5; return pi: i32; };
|
||||||
4
test/wcc/data/r630_global_f64_zero_init/case.ww
Normal file
4
test/wcc/data/r630_global_f64_zero_init/case.ww
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
//ww:run-exit 0
|
||||||
|
package main;
|
||||||
|
let z: f64;
|
||||||
|
fn main() i32 = { return z: i32; };
|
||||||
5
test/wcc/data/r630_global_narrow_field/case.ww
Normal file
5
test/wcc/data/r630_global_narrow_field/case.ww
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
type packet = struct { hdr: u8, body: u32 };
|
||||||
|
let pkt: packet;
|
||||||
|
fn main() i32 = { pkt.hdr = 42u8; pkt.body = 999u32; return pkt.hdr: i32; };
|
||||||
4
test/wcc/data/r630_global_read/case.ww
Normal file
4
test/wcc/data/r630_global_read/case.ww
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
let counter: i32 = 42;
|
||||||
|
fn main() i32 = { return counter; };
|
||||||
4
test/wcc/data/r630_global_slice_cap_raw/case.ww
Normal file
4
test/wcc/data/r630_global_slice_cap_raw/case.ww
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
//ww:run-exit 99
|
||||||
|
package main;
|
||||||
|
let buf: []u8;
|
||||||
|
fn main() i32 = { let p: *u64 = (&buf): *u64; p[2] = 99u64; return buf.cap: i32; };
|
||||||
10
test/wcc/data/r630_global_slice_reassign/case.ww
Normal file
10
test/wcc/data/r630_global_slice_reassign/case.ww
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
//ww:run-exit 106
|
||||||
|
package main;
|
||||||
|
let dst: []u8;
|
||||||
|
let src: []u8;
|
||||||
|
fn main() i32 = {
|
||||||
|
let p: *u64 = (&src): *u64;
|
||||||
|
p[0] = 0x1000u64; p[1] = 7u64; p[2] = 99u64;
|
||||||
|
dst = src;
|
||||||
|
return dst.len: i32 + dst.cap: i32;
|
||||||
|
};
|
||||||
4
test/wcc/data/r630_global_slice_zero_init/case.ww
Normal file
4
test/wcc/data/r630_global_slice_zero_init/case.ww
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
//ww:run-exit 0
|
||||||
|
package main;
|
||||||
|
let buf: []u8;
|
||||||
|
fn main() i32 = { return (buf.len + buf.cap): i32; };
|
||||||
4
test/wcc/data/r630_global_str_literal/case.ww
Normal file
4
test/wcc/data/r630_global_str_literal/case.ww
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
//ww:run-exit 11
|
||||||
|
package main;
|
||||||
|
let g: str = "hello world";
|
||||||
|
fn main() i32 = { return g.len: i32; };
|
||||||
4
test/wcc/data/r630_global_str_literal_bytes/case.ww
Normal file
4
test/wcc/data/r630_global_str_literal_bytes/case.ww
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
//ww:run-exit 104
|
||||||
|
package main;
|
||||||
|
let g: str = "hello";
|
||||||
|
fn main() i32 = { let p: *u8 = g.ptr; return p[0]: i32; };
|
||||||
5
test/wcc/data/r630_global_str_reassign/case.ww
Normal file
5
test/wcc/data/r630_global_str_reassign/case.ww
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
//ww:run-exit 7
|
||||||
|
package main;
|
||||||
|
let msg: str;
|
||||||
|
fn set(s: str) void = { msg = s; };
|
||||||
|
fn main() i32 = { set("abcdefg"); return msg.len: i32; };
|
||||||
4
test/wcc/data/r630_global_str_zero_init/case.ww
Normal file
4
test/wcc/data/r630_global_str_zero_init/case.ww
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
//ww:run-exit 5
|
||||||
|
package main;
|
||||||
|
let msg: str;
|
||||||
|
fn main() i32 = { msg = "hello"; return msg.len: i32; };
|
||||||
6
test/wcc/data/r630_global_struct_compound/case.ww
Normal file
6
test/wcc/data/r630_global_struct_compound/case.ww
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
type counter = struct { n: i64 };
|
||||||
|
let c: counter;
|
||||||
|
fn bump(d: i64) void = { c.n += d; };
|
||||||
|
fn main() i32 = { bump(10i64); bump(15i64); bump(17i64); return c.n: i32; };
|
||||||
5
test/wcc/data/r630_global_struct_fields/case.ww
Normal file
5
test/wcc/data/r630_global_struct_fields/case.ww
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
type point = struct { x: i32, y: i32 };
|
||||||
|
let p: point;
|
||||||
|
fn main() i32 = { p.x = 7; p.y = 35; return p.x + p.y; };
|
||||||
15
test/wcc/data/r630_global_tagged_i64/case.ww
Normal file
15
test/wcc/data/r630_global_tagged_i64/case.ww
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
type tok = (i64 | str | void);
|
||||||
|
type ent = struct { id: i32, t: tok };
|
||||||
|
let e: ent;
|
||||||
|
fn main() i32 = {
|
||||||
|
e.t = 42i64: tok;
|
||||||
|
let v: tok = e.t;
|
||||||
|
match (v) {
|
||||||
|
case let n: i64 => return n: i32;
|
||||||
|
case let s: str => return 1;
|
||||||
|
case void => return 2;
|
||||||
|
};
|
||||||
|
return 0;
|
||||||
|
};
|
||||||
15
test/wcc/data/r630_global_tagged_str/case.ww
Normal file
15
test/wcc/data/r630_global_tagged_str/case.ww
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
//ww:run-exit 5
|
||||||
|
package main;
|
||||||
|
type tok = (i64 | str | void);
|
||||||
|
type ent = struct { id: i32, t: tok };
|
||||||
|
let e: ent;
|
||||||
|
fn main() i32 = {
|
||||||
|
e.t = "hello";
|
||||||
|
let v: tok = e.t;
|
||||||
|
match (v) {
|
||||||
|
case let n: i64 => return 1;
|
||||||
|
case let s: str => return s.len: i32;
|
||||||
|
case void => return 2;
|
||||||
|
};
|
||||||
|
return 0;
|
||||||
|
};
|
||||||
15
test/wcc/data/r630_global_tagged_void/case.ww
Normal file
15
test/wcc/data/r630_global_tagged_void/case.ww
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
//ww:run-exit 7
|
||||||
|
package main;
|
||||||
|
type tok = (i64 | str | void);
|
||||||
|
type ent = struct { id: i32, t: tok };
|
||||||
|
let e: ent;
|
||||||
|
fn main() i32 = {
|
||||||
|
e.t = void;
|
||||||
|
let v: tok = e.t;
|
||||||
|
match (v) {
|
||||||
|
case let n: i64 => return 1;
|
||||||
|
case let s: str => return 2;
|
||||||
|
case void => return 7;
|
||||||
|
};
|
||||||
|
return 0;
|
||||||
|
};
|
||||||
4
test/wcc/data/r630_global_u64_read/case.ww
Normal file
4
test/wcc/data/r630_global_u64_read/case.ww
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
//ww:run-exit 123
|
||||||
|
package main;
|
||||||
|
let val: u64 = 123u64;
|
||||||
|
fn main() i32 = { return val: i32; };
|
||||||
4
test/wcc/data/r630_global_zero_init/case.ww
Normal file
4
test/wcc/data/r630_global_zero_init/case.ww
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
//ww:run-exit 7
|
||||||
|
package main;
|
||||||
|
let counter: i32;
|
||||||
|
fn main() i32 = { counter = 7; return counter; };
|
||||||
10
test/wcc/data/r630_local_slice_reassign/case.ww
Normal file
10
test/wcc/data/r630_local_slice_reassign/case.ww
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
//ww:run-exit 4
|
||||||
|
package main;
|
||||||
|
fn main() i32 = {
|
||||||
|
let arr: [16]u8;
|
||||||
|
let i: i32 = 0;
|
||||||
|
for (i < 16) { arr[i] = i: u8; i += 1; };
|
||||||
|
let s: []u8 = arr[3:10];
|
||||||
|
s = arr[1:5];
|
||||||
|
return s.len: i32;
|
||||||
|
};
|
||||||
4
test/wcc/data/r630_local_slice_return/case.ww
Normal file
4
test/wcc/data/r630_local_slice_return/case.ww
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
//ww:run-exit 6
|
||||||
|
package main;
|
||||||
|
fn mkslice() []u8 = { let arr: [16]u8; return arr[3:9]; };
|
||||||
|
fn main() i32 = { let s: []u8 = mkslice(); return s.len: i32; };
|
||||||
6
test/wcc/data/r650_alias_local_write_ptr_read/case.ww
Normal file
6
test/wcc/data/r650_alias_local_write_ptr_read/case.ww
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
type inner = struct { a: i32, b: i32 };
|
||||||
|
type outer = struct { i: inner, x: i32 };
|
||||||
|
fn get(o: *outer) i32 = { return o.i.a; };
|
||||||
|
fn main() i32 = { let o: outer; o.i.a = 0; o.i.b = 0; o.x = 0; let p: *outer = &o; o.i.a = 42; return get(p); };
|
||||||
5
test/wcc/data/r650_alias_ptr_write_local_read/case.ww
Normal file
5
test/wcc/data/r650_alias_ptr_write_local_read/case.ww
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
type inner = struct { a: i32, b: i32 };
|
||||||
|
type outer = struct { i: inner, x: i32 };
|
||||||
|
fn main() i32 = { let o: outer; o.i.a = 0; o.i.b = 0; o.x = 0; let p: *outer = &o; p.i.a = 42; return o.i.a; };
|
||||||
6
test/wcc/data/r650_global_root/case.ww
Normal file
6
test/wcc/data/r650_global_root/case.ww
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
//ww:run-exit 14
|
||||||
|
package main;
|
||||||
|
type inner = struct { a: i32, b: i32 };
|
||||||
|
type outer = struct { i: inner, x: i32 };
|
||||||
|
let g: outer;
|
||||||
|
fn main() i32 = { g.i.a = 11; g.x = 3; return g.i.a + g.x; };
|
||||||
5
test/wcc/data/r650_i32_leaf/case.ww
Normal file
5
test/wcc/data/r650_i32_leaf/case.ww
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
type holder = struct { val: i32, pad: i32 };
|
||||||
|
type box = struct { h: holder, tag: i32 };
|
||||||
|
fn main() i32 = { let b: box; b.h.val = 0x12345; b.h.pad = 0; b.tag = 0; if (b.h.val == 0x12345) { return 42; }; return 0; };
|
||||||
6
test/wcc/data/r650_ptr_2deep_read/case.ww
Normal file
6
test/wcc/data/r650_ptr_2deep_read/case.ww
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
//ww:run-exit 7
|
||||||
|
package main;
|
||||||
|
type inner = struct { a: i32, b: i32 };
|
||||||
|
type outer = struct { i: inner, x: i32 };
|
||||||
|
fn get(o: *outer) i32 = { return o.i.a; };
|
||||||
|
fn main() i32 = { let v: outer; v.i.a = 7; v.i.b = 0; v.x = 0; return get(&v); };
|
||||||
6
test/wcc/data/r650_ptr_2deep_write/case.ww
Normal file
6
test/wcc/data/r650_ptr_2deep_write/case.ww
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
//ww:run-exit 5
|
||||||
|
package main;
|
||||||
|
type inner = struct { a: i32, b: i32 };
|
||||||
|
type outer = struct { i: inner, x: i32 };
|
||||||
|
fn set(o: *outer) void = { o.i.a = 5; };
|
||||||
|
fn main() i32 = { let v: outer; v.i.a = 0; v.i.b = 0; v.x = 0; set(&v); return v.i.a; };
|
||||||
8
test/wcc/data/r650_ptr_3deep/case.ww
Normal file
8
test/wcc/data/r650_ptr_3deep/case.ww
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
//ww:run-exit 9
|
||||||
|
package main;
|
||||||
|
type a3 = struct { x: i32 };
|
||||||
|
type a2 = struct { a: a3 };
|
||||||
|
type a1 = struct { a: a2 };
|
||||||
|
fn put(p: *a1) void = { p.a.a.x = 9; };
|
||||||
|
fn get(p: *a1) i32 = { return p.a.a.x; };
|
||||||
|
fn main() i32 = { let v: a1; v.a.a.x = 0; put(&v); return get(&v); };
|
||||||
6
test/wcc/data/r650_ptr_f64_leaf/case.ww
Normal file
6
test/wcc/data/r650_ptr_f64_leaf/case.ww
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
type holder = struct { v: f64, pad: i32 };
|
||||||
|
type box = struct { h: holder, tag: i32 };
|
||||||
|
fn put(b: *box) void = { b.h.v = 0.5f64; };
|
||||||
|
fn main() i32 = { let b: box; b.h.v = 0.0f64; b.h.pad = 0; b.tag = 0; put(&b); if (b.h.v == 0.5f64) { return 42; }; return 0; };
|
||||||
6
test/wcc/data/r650_ptr_i16_leaf/case.ww
Normal file
6
test/wcc/data/r650_ptr_i16_leaf/case.ww
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
type holder = struct { v: i16, pad: i16 };
|
||||||
|
type box = struct { h: holder, tag: i32 };
|
||||||
|
fn put(b: *box) void = { b.h.v = 4321i16; };
|
||||||
|
fn main() i32 = { let b: box; b.h.v = 0i16; b.h.pad = 0i16; b.tag = 0; put(&b); if (b.h.v == 4321i16) { return 42; }; return 0; };
|
||||||
6
test/wcc/data/r650_ptr_i16_negative/case.ww
Normal file
6
test/wcc/data/r650_ptr_i16_negative/case.ww
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
type holder = struct { v: i16, pad: i16 };
|
||||||
|
type box = struct { h: holder, tag: i32 };
|
||||||
|
fn put(b: *box) void = { b.h.v = -7i16; };
|
||||||
|
fn main() i32 = { let b: box; b.h.v = 0i16; b.h.pad = 0i16; b.tag = 0; put(&b); let r: i32 = b.h.v: i32; if (r == -7) { return 42; }; return 0; };
|
||||||
6
test/wcc/data/r650_ptr_i32_leaf/case.ww
Normal file
6
test/wcc/data/r650_ptr_i32_leaf/case.ww
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
type holder = struct { v: i32, pad: i32 };
|
||||||
|
type box = struct { h: holder, tag: i32 };
|
||||||
|
fn put(b: *box) void = { b.h.v = 0x12345; };
|
||||||
|
fn main() i32 = { let b: box; b.h.v = 0; b.h.pad = 0; b.tag = 0; put(&b); if (b.h.v == 0x12345) { return 42; }; return 0; };
|
||||||
6
test/wcc/data/r650_ptr_i32_negative/case.ww
Normal file
6
test/wcc/data/r650_ptr_i32_negative/case.ww
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
type holder = struct { v: i32, pad: i32 };
|
||||||
|
type box = struct { h: holder, tag: i32 };
|
||||||
|
fn put(b: *box) void = { b.h.v = -7; };
|
||||||
|
fn main() i32 = { let b: box; b.h.v = 0; b.h.pad = 0; b.tag = 0; put(&b); if (b.h.v < 0) { return 42; }; return 0; };
|
||||||
6
test/wcc/data/r650_ptr_i8_negative/case.ww
Normal file
6
test/wcc/data/r650_ptr_i8_negative/case.ww
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
type holder = struct { v: i8, pad: i8 };
|
||||||
|
type box = struct { h: holder, tag: i32 };
|
||||||
|
fn put(b: *box) void = { b.h.v = -7i8; };
|
||||||
|
fn main() i32 = { let b: box; b.h.v = 0i8; b.h.pad = 0i8; b.tag = 0; put(&b); let r: i32 = b.h.v: i32; if (r == -7) { return 42; }; return 0; };
|
||||||
5
test/wcc/data/r650_ptr_local/case.ww
Normal file
5
test/wcc/data/r650_ptr_local/case.ww
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
//ww:run-exit 13
|
||||||
|
package main;
|
||||||
|
type inner = struct { a: i32, b: i32 };
|
||||||
|
type outer = struct { i: inner, x: i32 };
|
||||||
|
fn main() i32 = { let v: outer; v.i.a = 0; v.i.b = 0; v.x = 0; let p: *outer = &v; p.i.a = 13; return p.i.a; };
|
||||||
5
test/wcc/data/r650_ptr_single_read/case.ww
Normal file
5
test/wcc/data/r650_ptr_single_read/case.ww
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
type outer = struct { f: i32, g: i32 };
|
||||||
|
fn get(o: *outer) i32 = { return o.f; };
|
||||||
|
fn main() i32 = { let x: outer; x.f = 42; x.g = 0; return get(&x); };
|
||||||
5
test/wcc/data/r650_ptr_single_write/case.ww
Normal file
5
test/wcc/data/r650_ptr_single_write/case.ww
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
type outer = struct { f: i32, g: i32 };
|
||||||
|
fn set(o: *outer) void = { o.f = 42; };
|
||||||
|
fn main() i32 = { let x: outer; x.f = 0; x.g = 0; set(&x); return x.f; };
|
||||||
5
test/wcc/data/r650_ptr_slice_pseudo/case.ww
Normal file
5
test/wcc/data/r650_ptr_slice_pseudo/case.ww
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
//ww:run-exit 5
|
||||||
|
package main;
|
||||||
|
type bag = struct { buf: []u8, x: i32 };
|
||||||
|
fn setlen(b: *bag, n: i32) void = { b.buf.len = n; };
|
||||||
|
fn main() i32 = { let b: bag; let nope: []u8; b.buf = nope; b.x = 0; setlen(&b, 5); return b.buf.len: i32; };
|
||||||
6
test/wcc/data/r650_ptr_str_leaf/case.ww
Normal file
6
test/wcc/data/r650_ptr_str_leaf/case.ww
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
type holder = struct { s: str, pad: i32 };
|
||||||
|
type box = struct { h: holder, tag: i32 };
|
||||||
|
fn put(b: *box) void = { b.h.s = "abc"; };
|
||||||
|
fn main() i32 = { let b: box; let empty: str; b.h.s = empty; b.h.pad = 0; b.tag = 0; put(&b); if (b.h.s.len == 3) { return 42; }; return 0; };
|
||||||
6
test/wcc/data/r650_ptr_u8_leaf/case.ww
Normal file
6
test/wcc/data/r650_ptr_u8_leaf/case.ww
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
//ww:run-exit 99
|
||||||
|
package main;
|
||||||
|
type holder = struct { v: u8, pad: u8 };
|
||||||
|
type box = struct { h: holder, tag: i32 };
|
||||||
|
fn put(b: *box) void = { b.h.v = 99u8; };
|
||||||
|
fn main() i32 = { let b: box; b.h.v = 0u8; b.h.pad = 0u8; b.tag = 0; put(&b); return b.h.v: i32; };
|
||||||
9
test/wcc/data/r650_slice_field_pseudo/case.ww
Normal file
9
test/wcc/data/r650_slice_field_pseudo/case.ww
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
//ww:run-exit 5
|
||||||
|
package main;
|
||||||
|
type bag = struct { buf: []u8, x: i32 };
|
||||||
|
fn main() i32 = {
|
||||||
|
let arr: [8]u8; let i: i32 = 0;
|
||||||
|
for (i < 8) { arr[i] = i: u8; i = i + 1; };
|
||||||
|
let b: bag; b.buf.ptr = &arr[0]; b.buf.len = 5; b.buf.cap = 8; b.x = 0;
|
||||||
|
return b.buf.len;
|
||||||
|
};
|
||||||
5
test/wcc/data/r650_u32_leaf/case.ww
Normal file
5
test/wcc/data/r650_u32_leaf/case.ww
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
type holder = struct { val: u32, pad: u32 };
|
||||||
|
type box = struct { h: holder, tag: i32 };
|
||||||
|
fn main() i32 = { let b: box; b.h.val = 4321u32; b.h.pad = 0u32; b.tag = 0; if (b.h.val == 4321u32) { return 42; }; return 0; };
|
||||||
5
test/wcc/data/r650_u8_leaf/case.ww
Normal file
5
test/wcc/data/r650_u8_leaf/case.ww
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
//ww:run-exit 99
|
||||||
|
package main;
|
||||||
|
type holder = struct { val: u8, pad: u8 };
|
||||||
|
type box = struct { h: holder, tag: i32 };
|
||||||
|
fn main() i32 = { let b: box; b.h.val = 99u8; b.h.pad = 0u8; b.tag = 0; return b.h.val: i32; };
|
||||||
5
test/wcc/data/r650_value_2deep_read_write/case.ww
Normal file
5
test/wcc/data/r650_value_2deep_read_write/case.ww
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
//ww:run-exit 15
|
||||||
|
package main;
|
||||||
|
type inner = struct { a: i32, b: i32, c: i32 };
|
||||||
|
type outer = struct { i: inner, x: i32 };
|
||||||
|
fn main() i32 = { let o: outer; o.i.a = 10; o.x = 5; return o.i.a + o.x; };
|
||||||
6
test/wcc/data/r650_value_3deep/case.ww
Normal file
6
test/wcc/data/r650_value_3deep/case.ww
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
//ww:run-exit 7
|
||||||
|
package main;
|
||||||
|
type a3 = struct { a: i32 };
|
||||||
|
type a2 = struct { a: a3 };
|
||||||
|
type a1 = struct { a: a2 };
|
||||||
|
fn main() i32 = { let v: a1; v.a.a.a = 7; return v.a.a.a; };
|
||||||
4
test/wcc/data/r660_alias_i8_cast_narrow/case.ww
Normal file
4
test/wcc/data/r660_alias_i8_cast_narrow/case.ww
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
type myflag = i8;
|
||||||
|
fn main() i32 = { let x: i64 = 0xFF80i64; let y: myflag = x: myflag; let z: i64 = y: i64; if (z == -128i64) { return 42; }; return 0; };
|
||||||
5
test/wcc/data/r660_alias_i8_field/case.ww
Normal file
5
test/wcc/data/r660_alias_i8_field/case.ww
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
type myflag = i8;
|
||||||
|
type box = struct { v: myflag, pad: i8 };
|
||||||
|
fn main() i32 = { let b: box; b.v = -1i64: myflag; b.pad = 0i8; let z: i64 = b.v: i64; if (z == -1i64) { return 42; }; return 0; };
|
||||||
5
test/wcc/data/r660_alias_u8_field/case.ww
Normal file
5
test/wcc/data/r660_alias_u8_field/case.ww
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
type byteflag = u8;
|
||||||
|
type box = struct { v: byteflag, pad: u8 };
|
||||||
|
fn main() i32 = { let b: box; b.v = 0xFFu64: byteflag; b.pad = 0u8; let z: u64 = b.v: u64; if (z == 0xFFu64) { return 42; }; return 0; };
|
||||||
5
test/wcc/data/r660_bang_i32_deref_widen/case.ww
Normal file
5
test/wcc/data/r660_bang_i32_deref_widen/case.ww
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
type myinv = !i32;
|
||||||
|
fn setneg(p: *myinv) void = { *p = -16i64: myinv; };
|
||||||
|
fn main() i32 = { let x: myinv = 0i64: myinv; setneg(&x); let z: i64 = x: i64; if (z == -16i64) { return 42; }; return 0; };
|
||||||
4
test/wcc/data/r660_bool_field_load/case.ww
Normal file
4
test/wcc/data/r660_bool_field_load/case.ww
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
type box = struct { v: bool, pad: bool };
|
||||||
|
fn main() i32 = { let b: box; b.v = true; b.pad = false; if (b.v) { return 42; }; return 0; };
|
||||||
5
test/wcc/data/r660_chained_i16_leaf/case.ww
Normal file
5
test/wcc/data/r660_chained_i16_leaf/case.ww
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
type inner = struct { v: i16, pad: i16 };
|
||||||
|
type outer = struct { i: inner, tag: i32 };
|
||||||
|
fn main() i32 = { let o: outer; o.i.v = -32768i64: i16; o.i.pad = 0i16; o.tag = 0; let z: i64 = o.i.v: i64; if (z == -32768i64) { return 42; }; return 0; };
|
||||||
5
test/wcc/data/r660_chained_i8_leaf/case.ww
Normal file
5
test/wcc/data/r660_chained_i8_leaf/case.ww
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
type inner = struct { v: i8, pad: i8 };
|
||||||
|
type outer = struct { i: inner, tag: i32 };
|
||||||
|
fn main() i32 = { let o: outer; o.i.v = -1i64: i8; o.i.pad = 0i8; o.tag = 0; let z: i64 = o.i.v: i64; if (z == -1i64) { return 42; }; return 0; };
|
||||||
3
test/wcc/data/r660_deref_compound_u32/case.ww
Normal file
3
test/wcc/data/r660_deref_compound_u32/case.ww
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
fn main() i32 = { let x: u32 = 0x80000001u32; let p: *u32 = &x; *p >>= 1u32; if (x == 0x40000000u32) { return 42; }; return 0; };
|
||||||
4
test/wcc/data/r660_i16_field_load/case.ww
Normal file
4
test/wcc/data/r660_i16_field_load/case.ww
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
type box = struct { v: i16, pad: i16 };
|
||||||
|
fn main() i32 = { let b: box; b.v = -32768i64: i16; b.pad = 0i64: i16; let z: i64 = b.v: i64; if (z == -32768i64) { return 42; }; return 0; };
|
||||||
4
test/wcc/data/r660_i16_out_param_negative/case.ww
Normal file
4
test/wcc/data/r660_i16_out_param_negative/case.ww
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
fn setneg(p: *i16) void = { *p = -16i64: i16; };
|
||||||
|
fn main() i32 = { let x: i16 = 0i16; setneg(&x); let z: i64 = x: i64; if (z == -16i64) { return 42; }; return 0; };
|
||||||
4
test/wcc/data/r660_i32_compound_after_deref/case.ww
Normal file
4
test/wcc/data/r660_i32_compound_after_deref/case.ww
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
fn setv(p: *i32, v: i32) void = { *p = v; };
|
||||||
|
fn main() i32 = { let x: i32 = 0i32; setv(&x, 0x7FFFFFFEi32); x += 1i32; if (x == 0x7FFFFFFFi32) { return 42; }; return 0; };
|
||||||
4
test/wcc/data/r660_i32_field_load/case.ww
Normal file
4
test/wcc/data/r660_i32_field_load/case.ww
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
type box = struct { v: i32, pad: i32 };
|
||||||
|
fn main() i32 = { let b: box; b.v = -2147483648i64: i32; b.pad = 0i32; let z: i64 = b.v: i64; if (z == -2147483648i64) { return 42; }; return 0; };
|
||||||
5
test/wcc/data/r660_i32_global_negative_deref/case.ww
Normal file
5
test/wcc/data/r660_i32_global_negative_deref/case.ww
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
let g: i32 = 0i32;
|
||||||
|
fn setneg(p: *i32) void = { *p = -16i32; };
|
||||||
|
fn main() i32 = { setneg(&g); let z: i64 = g: i64; if (z == -16i64) { return 42; }; return 0; };
|
||||||
4
test/wcc/data/r660_i32_out_param_negative/case.ww
Normal file
4
test/wcc/data/r660_i32_out_param_negative/case.ww
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
fn setneg(p: *i32) void = { *p = -16i32; };
|
||||||
|
fn main() i32 = { let x: i32 = 0i32; setneg(&x); let z: i64 = x: i64; if (z == -16i64) { return 42; }; return 0; };
|
||||||
4
test/wcc/data/r660_i64_out_param_negative/case.ww
Normal file
4
test/wcc/data/r660_i64_out_param_negative/case.ww
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
fn setneg(p: *i64) void = { *p = -16i64; };
|
||||||
|
fn main() i32 = { let x: i64 = 0i64; setneg(&x); if (x == -16i64) { return 42; }; return 0; };
|
||||||
4
test/wcc/data/r660_i8_field_load/case.ww
Normal file
4
test/wcc/data/r660_i8_field_load/case.ww
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
type box = struct { v: i8, pad: i8 };
|
||||||
|
fn main() i32 = { let b: box; b.v = -1i64: i8; b.pad = 0i64: i8; let z: i64 = b.v: i64; if (z == -1i64) { return 42; }; return 0; };
|
||||||
4
test/wcc/data/r660_i8_out_param_negative/case.ww
Normal file
4
test/wcc/data/r660_i8_out_param_negative/case.ww
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
fn setneg(p: *i8) void = { *p = -16i64: i8; };
|
||||||
|
fn main() i32 = { let x: i8 = 0i8; setneg(&x); let z: i64 = x: i64; if (z == -16i64) { return 42; }; return 0; };
|
||||||
4
test/wcc/data/r660_u16_field_load/case.ww
Normal file
4
test/wcc/data/r660_u16_field_load/case.ww
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
type box = struct { v: u16, pad: u16 };
|
||||||
|
fn main() i32 = { let b: box; b.v = 0xFFFFu64: u16; b.pad = 0u16; let z: u64 = b.v: u64; if (z == 0xFFFFu64) { return 42; }; return 0; };
|
||||||
4
test/wcc/data/r660_u32_field_load/case.ww
Normal file
4
test/wcc/data/r660_u32_field_load/case.ww
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
type box = struct { v: u32, pad: u32 };
|
||||||
|
fn main() i32 = { let b: box; b.v = 0xFFFFFFFFu64: u32; b.pad = 0u32; let z: u64 = b.v: u64; if (z == 0xFFFFFFFFu64) { return 42; }; return 0; };
|
||||||
4
test/wcc/data/r660_u8_field_load/case.ww
Normal file
4
test/wcc/data/r660_u8_field_load/case.ww
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
type box = struct { v: u8, pad: u8 };
|
||||||
|
fn main() i32 = { let b: box; b.v = 0xFFu64: u8; b.pad = 0u8; let z: u64 = b.v: u64; if (z == 0xFFu64) { return 42; }; return 0; };
|
||||||
4
test/wcc/data/r670_f64_9args/case.ww
Normal file
4
test/wcc/data/r670_f64_9args/case.ww
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
fn s9f(a: f64, b: f64, c: f64, d: f64, e: f64, f: f64, g: f64, h: f64, i: f64) f64 = { return a + b + c + d + e + f + g + h + i; };
|
||||||
|
fn main() i32 = { let r: f64 = s9f(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); if ((r: i64) == 45i64) { return 42; }; return 0; };
|
||||||
4
test/wcc/data/r670_i64_7args/case.ww
Normal file
4
test/wcc/data/r670_i64_7args/case.ww
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
fn s7(a: i64, b: i64, c: i64, d: i64, e: i64, f: i64, g: i64) i64 = { return a + b + c + d + e + f + g; };
|
||||||
|
fn main() i32 = { let r: i64 = s7(1i64, 2i64, 3i64, 4i64, 5i64, 6i64, 7i64); if (r == 28i64) { return 42; }; return 0; };
|
||||||
4
test/wcc/data/r670_i64_7args_signed/case.ww
Normal file
4
test/wcc/data/r670_i64_7args_signed/case.ww
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
fn s7(a: i64, b: i64, c: i64, d: i64, e: i64, f: i64, g: i64) i64 = { return a + b + c + d + e + f + g; };
|
||||||
|
fn main() i32 = { let r: i64 = s7(-1i64, -2i64, -3i64, -4i64, -5i64, -6i64, 49i64); if (r == 28i64) { return 42; }; return 0; };
|
||||||
4
test/wcc/data/r670_i64_8args/case.ww
Normal file
4
test/wcc/data/r670_i64_8args/case.ww
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
fn s8(a: i64, b: i64, c: i64, d: i64, e: i64, f: i64, g: i64, h: i64) i64 = { return a + b + c + d + e + f + g + h; };
|
||||||
|
fn main() i32 = { let r: i64 = s8(1i64, 2i64, 3i64, 4i64, 5i64, 6i64, 7i64, 8i64); if (r == 36i64) { return 42; }; return 0; };
|
||||||
6
test/wcc/data/r670_mixed_5i_3f_4i/case.ww
Normal file
6
test/wcc/data/r670_mixed_5i_3f_4i/case.ww
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
fn mx(a: i64, b: i64, c: i64, d: i64, e: i64, f1: f64, f2: f64, f3: f64, g: i64, h: i64, i: i64, j: i64) i64 = {
|
||||||
|
return a + b + c + d + e + (f1: i64) + (f2: i64) + (f3: i64) + g + h + i + j;
|
||||||
|
};
|
||||||
|
fn main() i32 = { let r: i64 = mx(1i64, 2i64, 3i64, 4i64, 5i64, 6.0, 7.0, 8.0, 9i64, 10i64, 11i64, 12i64); if (r == 78i64) { return 42; }; return 0; };
|
||||||
4
test/wcc/data/r670_slice_purestack_arg7/case.ww
Normal file
4
test/wcc/data/r670_slice_purestack_arg7/case.ww
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
fn ss(a: i64, b: i64, c: i64, d: i64, e: i64, f: i64, xs: []i64) i64 = { let i: i32 = 0; let acc: i64 = a + b + c + d + e + f; for (i < xs.len: i32) { acc = acc + xs[i]; i = i + 1; }; return acc; };
|
||||||
|
fn main() i32 = { let buf: [3]i64; buf[0] = 100i64; buf[1] = 200i64; buf[2] = 300i64; let s: []i64 = buf[0:3]; let r: i64 = ss(1i64, 2i64, 3i64, 4i64, 5i64, 6i64, s); if (r == 621i64) { return 42; }; return 0; };
|
||||||
4
test/wcc/data/r670_slice_straddle_arg5/case.ww
Normal file
4
test/wcc/data/r670_slice_straddle_arg5/case.ww
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
fn ss(a: i64, b: i64, c: i64, d: i64, xs: []i64) i64 = { let i: i32 = 0; let acc: i64 = a + b + c + d; for (i < xs.len: i32) { acc = acc + xs[i]; i = i + 1; }; return acc + (xs.cap: i64); };
|
||||||
|
fn main() i32 = { let buf: [3]i64; buf[0] = 100i64; buf[1] = 200i64; buf[2] = 300i64; let s: []i64 = buf[0:3]; let r: i64 = ss(1i64, 2i64, 3i64, 4i64, s); if (r == 613i64) { return 42; }; return 0; };
|
||||||
4
test/wcc/data/r670_slice_straddle_arg6/case.ww
Normal file
4
test/wcc/data/r670_slice_straddle_arg6/case.ww
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
//ww:run-exit 42
|
||||||
|
package main;
|
||||||
|
fn ss(a: i64, b: i64, c: i64, d: i64, e: i64, xs: []i64) i64 = { let i: i32 = 0; let acc: i64 = a + b + c + d + e; for (i < xs.len: i32) { acc = acc + xs[i]; i = i + 1; }; return acc + (xs.cap: i64); };
|
||||||
|
fn main() i32 = { let buf: [3]i64; buf[0] = 100i64; buf[1] = 200i64; buf[2] = 300i64; let s: []i64 = buf[0:3]; let r: i64 = ss(1i64, 2i64, 3i64, 4i64, 5i64, s); if (r == 618i64) { return 42; }; return 0; };
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user