-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# RUN: | ||
cargo run -p ylc -- -in=%s -o=out.o | ||
gcc out.o -o a.exe | ||
./a.exe | ||
# IN: | ||
define u32 @main() { | ||
entry: | ||
%1 = u32 5 | ||
ret u32 %1 | ||
} | ||
|
||
# EXIT_CODE=5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# RUN: | ||
cargo run -p ylc -- -in=%s -o=out.o | ||
gcc out.o -o a.exe | ||
./a.exe | ||
# IN: | ||
define u32 @main() { | ||
entry: | ||
%1 = u32 68 | ||
%2 = u32 %1 | ||
ret u32 %1 | ||
} | ||
|
||
# EXIT_CODE=68 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# RUN: | ||
cargo run -p ylc -- -in=%s -o=out.o | ||
gcc out.o -o a.exe | ||
./a.exe | ||
# IN: | ||
|
||
define u32 @func(u32 %0, u32 %1) { | ||
entry: | ||
%2 = add u32 %0, %1 | ||
%3 = sub u32 %2, 5 | ||
br cond %3 isnt0, is0 | ||
|
||
isnt0: | ||
ret u32 4 | ||
|
||
is0: | ||
ret u32 0 | ||
} | ||
define u32 @main() { | ||
entry: | ||
%1 = u32 9 | ||
%2 = u32 21 | ||
|
||
%3 = call u32 func u32 %1 u32 %2 | ||
|
||
%4 = add u32 %3, 6 | ||
|
||
ret u32 %4 | ||
} | ||
|
||
# EXIT_CODE=10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# RUN: | ||
cargo run -p ylc -- -in=%s -o=out.o | ||
gcc out.o -o a.exe | ||
./a.exe | ||
# IN: | ||
define u32 @main() { | ||
entry: | ||
ret u32 3 | ||
} | ||
|
||
# EXIT_CODE=3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# RUN: | ||
cargo run -p ylc -- -in=%s -o=out.o | ||
gcc out.o -o a.exe | ||
./a.exe | ||
# IN: | ||
define u32 @main(u32 %0) { | ||
entry: | ||
ret u32 %0 | ||
} | ||
|
||
# EXIT_CODE=1 |