Skip to content

Commit

Permalink
figuring out cause of error
Browse files Browse the repository at this point in the history
skipping ctest, checking if integration tests pass
  • Loading branch information
Vipul-Cariappa committed Jul 23, 2024
1 parent 17dca10 commit 388e640
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ jobs:
- name: Test Linux LLVM ${{ matrix.llvm-version }}
shell: bash -e -l {0}
run: |
ctest --output-on-failure
# ctest --output-on-failure
cd integration_tests
./run_tests.py -b llvm llvm_jit
./run_tests.py -b llvm llvm_jit -f
Expand Down
106 changes: 53 additions & 53 deletions src/lpython/tests/test_llvm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,59 +41,59 @@ define i64 @f2()
//CHECK(e.execfn<int64_t>("f2") == 5);
}

// TEST_CASE("llvm 1 fail") {
// LCompilers::LLVMEvaluator e;
// CHECK_THROWS_AS(e.add_module(R"""(
// define i64 @f1()
// {
// ; FAIL: "=x" is incorrect syntax
// %1 =x alloca i64
// }
// )"""), LCompilers::LCompilersException);
// CHECK_THROWS_WITH(e.add_module(R"""(
// define i64 @f1()
// {
// ; FAIL: "=x" is incorrect syntax
// %1 =x alloca i64
// }
// )"""), "parse_module(): Invalid LLVM IR");
// }


// TEST_CASE("llvm 2") {
// LCompilers::LLVMEvaluator e;
// e.add_module(R"""(
// @count = global i64 0

// define i64 @f1()
// {
// store i64 4, i64* @count
// %1 = load i64, i64* @count
// ret i64 %1
// }
// )""");
// CHECK(e.execfn<int64_t>("f1") == 4);

// e.add_module(R"""(
// @count = external global i64

// define i64 @f2()
// {
// %1 = load i64, i64* @count
// ret i64 %1
// }
// )""");
// CHECK(e.execfn<int64_t>("f2") == 4);

// CHECK_THROWS_AS(e.add_module(R"""(
// define i64 @f3()
// {
// ; FAIL: @count is not defined
// %1 = load i64, i64* @count
// ret i64 %1
// }
// )"""), LCompilers::LCompilersException);
// }
TEST_CASE("llvm 1 fail") {
LCompilers::LLVMEvaluator e;
CHECK_THROWS_AS(e.add_module(R"""(
define i64 @f1()
{
; FAIL: "=x" is incorrect syntax
%1 =x alloca i64
}
)"""), LCompilers::LCompilersException);
CHECK_THROWS_WITH(e.add_module(R"""(
define i64 @f1()
{
; FAIL: "=x" is incorrect syntax
%1 =x alloca i64
}
)"""), "parse_module(): Invalid LLVM IR");
}


TEST_CASE("llvm 2") {
LCompilers::LLVMEvaluator e;
e.add_module(R"""(
@count = global i64 0
define i64 @f1()
{
store i64 4, i64* @count
%1 = load i64, i64* @count
ret i64 %1
}
)""");
CHECK(e.execfn<int64_t>("f1") == 4);

e.add_module(R"""(
@count = external global i64
define i64 @f2()
{
%1 = load i64, i64* @count
ret i64 %1
}
)""");
CHECK(e.execfn<int64_t>("f2") == 4);

CHECK_THROWS_AS(e.add_module(R"""(
define i64 @f3()
{
; FAIL: @count is not defined
%1 = load i64, i64* @count
ret i64 %1
}
)"""), LCompilers::LCompilersException);
}

TEST_CASE("llvm 3") {
LCompilers::LLVMEvaluator e;
Expand Down

0 comments on commit 388e640

Please sign in to comment.