Skip to content

Commit f6d8ebd

Browse files
committed
revert changes to test_match
1 parent a167c28 commit f6d8ebd

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

crates/lean_compiler/tests/test_compiler.rs

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,11 +405,27 @@ fn test_inlined_2() {
405405
fn test_match() {
406406
let program = r#"
407407
fn main() {
408-
func_match(1);
408+
for x in 0..3 unroll {
409+
func_match(x);
410+
}
411+
for x in 0..2 unroll {
412+
match x {
413+
0 => {
414+
y = 10 * (x + 8);
415+
z = 10 * y;
416+
print(z);
417+
}
418+
1 => {
419+
y = 10 * x;
420+
z = func_2(y);
421+
print(z);
422+
}
423+
}
424+
}
409425
return;
410426
}
411427
412-
fn func_match(x) {
428+
fn func_match(x) inline {
413429
match x {
414430
0 => {
415431
print(41);
@@ -419,6 +435,8 @@ fn test_match() {
419435
print(y + 1);
420436
}
421437
2 => {
438+
y = 10 * x;
439+
print(y);
422440
}
423441
}
424442
return;
@@ -427,6 +445,10 @@ fn test_match() {
427445
fn func_1(x) -> 1 {
428446
return x * x * x * x;
429447
}
448+
449+
fn func_2(x) inline -> 1 {
450+
return x * x * x * x * x * x;
451+
}
430452
"#;
431453
compile_and_run(program.to_string(), (&[], &[]), DEFAULT_NO_VEC_RUNTIME_MEMORY, false);
432454
}

0 commit comments

Comments
 (0)