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:
20
test/wcc/data/r75_modparam_same_module_same_leaf/case.ww
Normal file
20
test/wcc/data/r75_modparam_same_module_same_leaf/case.ww
Normal file
@@ -0,0 +1,20 @@
|
||||
//ww:run
|
||||
package main;
|
||||
fn variadic_foo(a: i32, xs: i32...) i32 = {
|
||||
return a + xs.len;
|
||||
};
|
||||
fn scalar_foo(a: i32, n: (u8 | []u8)) i32 = {
|
||||
match (n) {
|
||||
case let c: u8 => return a + (c: i32);
|
||||
case let s: []u8 => return a + s.len;
|
||||
};
|
||||
return 0;
|
||||
};
|
||||
export fn main() i32 = {
|
||||
let n: (u8 | []u8) = 5u8;
|
||||
let a: i32 = variadic_foo(1, 2, 3, 4);
|
||||
let b: i32 = scalar_foo(10, n);
|
||||
if (a != 4) { return 30; };
|
||||
if (b != 15) { return 31; };
|
||||
return 0;
|
||||
};
|
||||
Reference in New Issue
Block a user