Skip to content

Commit

Permalink
Remove returns from main
Browse files Browse the repository at this point in the history
  • Loading branch information
kirstenmg committed Oct 31, 2024
1 parent 7c9b2fe commit ef8ea4b
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 17 deletions.
4 changes: 2 additions & 2 deletions tests/passing/peggy_comparison/branch_hoisting.bril
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -29,5 +29,5 @@
jmp .pred;

.end:
ret x;
print x;
}
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -25,5 +25,4 @@

.end:
print res;
ret res;
}
4 changes: 2 additions & 2 deletions tests/passing/peggy_comparison/dead_loop_deletion.bril
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@main(): int {
@main {
j: int = const 3;
i: int = const 0;
forty: int = const 40;
Expand All @@ -16,5 +16,5 @@
.loop_end:
j: int = const 2;

ret j;
print j;
}
7 changes: 4 additions & 3 deletions tests/passing/peggy_comparison/if_true.bril
Original file line number Diff line number Diff line change
@@ -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;
}
4 changes: 2 additions & 2 deletions tests/passing/peggy_comparison/loop_based_code_motion.bril
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@main: int {
@main {
x: int = const 0;
three: int = const 3;

Expand All @@ -15,5 +15,5 @@
five: int = const 5;
x: int = mul x five;

ret x;
print x;
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# ARGS: 30 10
@main(n: int, m: int) {
i: int = const 0;
twenty: int = const 20;
Expand Down
5 changes: 3 additions & 2 deletions tests/passing/peggy_comparison/loop_peeling.bril
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@main(n: int): int {
# ARGS: 5
@main(n: int) {
x: int = const 0;
i: int = const 0;

Expand All @@ -14,5 +15,5 @@
jmp .loop_test;

.loop_end:
ret x;
print x;
}
4 changes: 2 additions & 2 deletions tests/passing/peggy_comparison/loop_unroll.bril
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@main: int {
@main {
i: int = const 0;
one: int = const 1;

Expand All @@ -11,5 +11,5 @@
jmp .loop_test;

.loop_end:
ret i;
print i;
}
4 changes: 2 additions & 2 deletions tests/passing/peggy_comparison/simple_loop_unswitch.bril
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -24,5 +24,5 @@
jmp .loop_test;

.loop_end:
ret j;
print j;
}

0 comments on commit ef8ea4b

Please sign in to comment.