diff --git a/test/builds/build_and_test_mlir.yml b/test/builds/build_and_test_mlir.yml index 97c9b0b5f..8f45d4384 100644 --- a/test/builds/build_and_test_mlir.yml +++ b/test/builds/build_and_test_mlir.yml @@ -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 @@ -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] + diff --git a/test/builds/test_kscmlir_examples.sh b/test/builds/test_kscmlir_examples.sh new file mode 100644 index 000000000..a22318668 --- /dev/null +++ b/test/builds/test_kscmlir_examples.sh @@ -0,0 +1,13 @@ +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 src/runtime/prelude.ks \ + --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