Skip to content

Commit

Permalink
Test ksc-mlir on examples from test/ksc
Browse files Browse the repository at this point in the history
  • Loading branch information
dcrc2 committed Mar 22, 2021
1 parent d1745fa commit 2ec314a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
15 changes: 14 additions & 1 deletion test/builds/build_and_test_mlir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ jobs:

steps:

- script: sh ./test/builds/mkdirs.sh
displayName: 'Make directories [userInstall]'

- script: echo "##vso[task.setvariable variable=LLVM_BRANCH]$(cat $(Build.Repository.LocalPath)/etc/llvm-branch.txt)"

- task: Cache@2
Expand All @@ -27,4 +30,14 @@ jobs:
condition: ne(variables.CACHE_RESTORED, 'true')

- script: sh ./test/builds/build_and_test_kscmlir.sh
displayName: Testing Ksc MLIR [userTest]
displayName: Building and testing Ksc MLIR [userTest]

- script: sh ./test/builds/install_linux.sh || (sleep 30 && sh ./test/builds/install_linux.sh) || (sleep 30 && sh ./test/builds/install_linux.sh)
displayName: 'Install dependencies [userInstall]'

- script: /opt/cabal/3.0/bin/cabal v2-install --with-ghc /opt/ghc/8.6.5/bin/ghc-8.6.5 --installdir=build/bin --overwrite-policy=always --install-method=copy
displayName: 'Building ksc [userInstall]'

- script: sh ./test/builds/test_kscmlir_examples.sh
displayName: Testing Ksc MLIR on examples from ksc [userTest]

12 changes: 12 additions & 0 deletions test/builds/test_kscmlir_examples.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
set -e

mkdir -p obj/test/kscmlir/examples

for example in ex0; do
echo "Testing example $example.ks"
./build/bin/ksc --generate-cpp \
--ks-source-file test/ksc/$example.ks \
--ks-output-file obj/test/kscmlir/examples/$example.kso \
--cpp-output-file /dev/null
./build/bin/ksc-mlir MLIR obj/test/kscmlir/examples/$example.kso > /dev/null
done

0 comments on commit 2ec314a

Please sign in to comment.