From 87d21bfd8d4c3faffecf3151fa8ceece0e7ec876 Mon Sep 17 00:00:00 2001 From: Kirsten <32720576+kirstenmg@users.noreply.github.com> Date: Thu, 6 Jun 2024 17:02:43 -0700 Subject: [PATCH] Remove returns from main --- tests/passing/peggy_comparison/branch_hoisting.bril | 4 ++-- .../peggy_comparison/conditional_constant_folding.bril | 3 +-- tests/passing/peggy_comparison/dead_loop_deletion.bril | 4 ++-- tests/passing/peggy_comparison/if_true.bril | 7 ++++--- tests/passing/peggy_comparison/loop_based_code_motion.bril | 4 ++-- .../peggy_comparison/loop_invariant_code_motion.bril | 1 + tests/passing/peggy_comparison/loop_peeling.bril | 5 +++-- tests/passing/peggy_comparison/loop_unroll.bril | 4 ++-- tests/passing/peggy_comparison/simple_loop_unswitch.bril | 4 ++-- 9 files changed, 19 insertions(+), 17 deletions(-) diff --git a/tests/passing/peggy_comparison/branch_hoisting.bril b/tests/passing/peggy_comparison/branch_hoisting.bril index 141084a87..0674ba17a 100644 --- a/tests/passing/peggy_comparison/branch_hoisting.bril +++ b/tests/passing/peggy_comparison/branch_hoisting.bril @@ -1,5 +1,5 @@ # ARGS: 0 -@main(n: int): int { +@main(n: int) { zero: int = const 0; x: int = id zero; y: int = id zero; @@ -29,5 +29,5 @@ jmp .pred; .end: - ret x; + print x; } \ No newline at end of file diff --git a/tests/passing/peggy_comparison/conditional_constant_folding.bril b/tests/passing/peggy_comparison/conditional_constant_folding.bril index d7304b9e7..f103408fc 100644 --- a/tests/passing/peggy_comparison/conditional_constant_folding.bril +++ b/tests/passing/peggy_comparison/conditional_constant_folding.bril @@ -1,5 +1,5 @@ # ARGS: 4 -@main(x: int): int { +@main(x: int) { five: int = const 5; four: int = const 4; twenty: int = const 20; @@ -25,5 +25,4 @@ .end: print res; - ret res; } \ No newline at end of file diff --git a/tests/passing/peggy_comparison/dead_loop_deletion.bril b/tests/passing/peggy_comparison/dead_loop_deletion.bril index d14185e0a..9805af44a 100644 --- a/tests/passing/peggy_comparison/dead_loop_deletion.bril +++ b/tests/passing/peggy_comparison/dead_loop_deletion.bril @@ -1,4 +1,4 @@ -@main(): int { +@main { j: int = const 3; i: int = const 0; forty: int = const 40; @@ -16,5 +16,5 @@ .loop_end: j: int = const 2; - ret j; + print j; } \ No newline at end of file diff --git a/tests/passing/peggy_comparison/if_true.bril b/tests/passing/peggy_comparison/if_true.bril index 3434ed51e..4fbe2c8cb 100644 --- a/tests/passing/peggy_comparison/if_true.bril +++ b/tests/passing/peggy_comparison/if_true.bril @@ -1,12 +1,13 @@ -@main(x: int): int { +# ARGS: 20 +@main(x: int) { cond: bool = const true; br cond .thn .els; .thn: - ret x; + print x; .els: one: int = const 1; res: int = sub x one; - ret res; + print res; } \ No newline at end of file diff --git a/tests/passing/peggy_comparison/loop_based_code_motion.bril b/tests/passing/peggy_comparison/loop_based_code_motion.bril index ec68357e4..f24443f4f 100644 --- a/tests/passing/peggy_comparison/loop_based_code_motion.bril +++ b/tests/passing/peggy_comparison/loop_based_code_motion.bril @@ -1,4 +1,4 @@ -@main: int { +@main { x: int = const 0; three: int = const 3; @@ -15,5 +15,5 @@ five: int = const 5; x: int = mul x five; - ret x; + print x; } \ No newline at end of file diff --git a/tests/passing/peggy_comparison/loop_invariant_code_motion.bril b/tests/passing/peggy_comparison/loop_invariant_code_motion.bril index 43eb09a45..de2262e37 100644 --- a/tests/passing/peggy_comparison/loop_invariant_code_motion.bril +++ b/tests/passing/peggy_comparison/loop_invariant_code_motion.bril @@ -1,3 +1,4 @@ +# ARGS: 30 10 @main(n: int, m: int) { i: int = const 0; twenty: int = const 20; diff --git a/tests/passing/peggy_comparison/loop_peeling.bril b/tests/passing/peggy_comparison/loop_peeling.bril index d2c50e9a9..38a8eda38 100644 --- a/tests/passing/peggy_comparison/loop_peeling.bril +++ b/tests/passing/peggy_comparison/loop_peeling.bril @@ -1,4 +1,5 @@ -@main(n: int): int { +# ARGS: 5 +@main(n: int) { x: int = const 0; i: int = const 0; @@ -14,5 +15,5 @@ jmp .loop_test; .loop_end: - ret x; + print x; } \ No newline at end of file diff --git a/tests/passing/peggy_comparison/loop_unroll.bril b/tests/passing/peggy_comparison/loop_unroll.bril index c913c1972..5ca6656aa 100644 --- a/tests/passing/peggy_comparison/loop_unroll.bril +++ b/tests/passing/peggy_comparison/loop_unroll.bril @@ -1,4 +1,4 @@ -@main: int { +@main { i: int = const 0; one: int = const 1; @@ -11,5 +11,5 @@ jmp .loop_test; .loop_end: - ret i; + print i; } \ No newline at end of file diff --git a/tests/passing/peggy_comparison/simple_loop_unswitch.bril b/tests/passing/peggy_comparison/simple_loop_unswitch.bril index de7a80cd4..ceb95c04e 100644 --- a/tests/passing/peggy_comparison/simple_loop_unswitch.bril +++ b/tests/passing/peggy_comparison/simple_loop_unswitch.bril @@ -1,5 +1,5 @@ # ARGS: 40 -@main(n: int): int { +@main(n: int) { one: int = const 1; zero: int = const 0; i: int = id zero; @@ -24,5 +24,5 @@ jmp .loop_test; .loop_end: - ret j; + print j; } \ No newline at end of file