-
Notifications
You must be signed in to change notification settings - Fork 4
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
14 changed files
with
243 additions
and
41 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
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,34 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
runs-on: macos-latest | ||
strategy: | ||
matrix: | ||
# Testing all levels because there was a bug that only happened with -O1. (#224) | ||
opt-level: ['-O0', '-O1', '-O2', '-O3'] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: brew install bash diffutils llvm@13 | ||
- run: make | ||
- run: ./runtests.sh --verbose --jou-flags "${{ matrix.opt-level }}" | ||
- run: ./runtests.sh --verbose --jou-flags "${{ matrix.opt-level }} --verbose" | ||
- run: make clean | ||
- name: Check that "make clean" deleted all files not committed to Git | ||
shell: bash | ||
run: | | ||
if [ "$(git status --porcelain --ignored)" != "" ]; then | ||
git status --ignored | ||
exit 1 | ||
fi | ||
compare-compilers: | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: brew install bash diffutils llvm@13 | ||
- run: ./compare_compilers.sh |
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
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
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
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
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
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
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
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
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
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,26 @@ | ||
# A call to the _jou_macos_startup() function is inserted to the | ||
# start of every Jou program when compiling for MacOS. | ||
|
||
# On macos, the C "global variables" stdin, stdout and stderr have | ||
# different names. For simplicity, Jou redefines them as variables | ||
# with the same names and assigns the correct values to them. | ||
# | ||
# We can't import FILE from io.jou here, because then we would be | ||
# trying to define a variable that already exists. | ||
global stdin: void* | ||
global stdout: void* | ||
global stderr: void* | ||
declare global __stdinp: void* | ||
declare global __stdoutp: void* | ||
declare global __stderrp: void* | ||
|
||
def _jou_macos_startup() -> void: | ||
stdin = __stdinp | ||
stdout = __stdoutp | ||
stderr = __stderrp | ||
|
||
# On linux, C's errno is a macro that expands to (*__errno_location()). | ||
# On macos it expands to (*__error()) instead. Let's make it consistent. | ||
declare __error() -> int* | ||
def __errno_location() -> int*: | ||
return __error() |
Oops, something went wrong.