Skip to content

Commit fa7b40c

Browse files
figuring out cause of error
skipping ctest, checking if integration tests pass
1 parent f2aa76e commit fa7b40c

File tree

2 files changed

+54
-54
lines changed

2 files changed

+54
-54
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ jobs:
540540
- name: Test Linux LLVM ${{ matrix.llvm-version }}
541541
shell: bash -e -l {0}
542542
run: |
543-
ctest --output-on-failure
543+
# ctest --output-on-failure
544544
cd integration_tests
545545
./run_tests.py -b llvm llvm_jit
546546
./run_tests.py -b llvm llvm_jit -f

src/lpython/tests/test_llvm.cpp

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -41,59 +41,59 @@ define i64 @f2()
4141
//CHECK(e.execfn<int64_t>("f2") == 5);
4242
}
4343

44-
// TEST_CASE("llvm 1 fail") {
45-
// LCompilers::LLVMEvaluator e;
46-
// CHECK_THROWS_AS(e.add_module(R"""(
47-
// define i64 @f1()
48-
// {
49-
// ; FAIL: "=x" is incorrect syntax
50-
// %1 =x alloca i64
51-
// }
52-
// )"""), LCompilers::LCompilersException);
53-
// CHECK_THROWS_WITH(e.add_module(R"""(
54-
// define i64 @f1()
55-
// {
56-
// ; FAIL: "=x" is incorrect syntax
57-
// %1 =x alloca i64
58-
// }
59-
// )"""), "parse_module(): Invalid LLVM IR");
60-
// }
61-
62-
63-
// TEST_CASE("llvm 2") {
64-
// LCompilers::LLVMEvaluator e;
65-
// e.add_module(R"""(
66-
// @count = global i64 0
67-
68-
// define i64 @f1()
69-
// {
70-
// store i64 4, i64* @count
71-
// %1 = load i64, i64* @count
72-
// ret i64 %1
73-
// }
74-
// )""");
75-
// CHECK(e.execfn<int64_t>("f1") == 4);
76-
77-
// e.add_module(R"""(
78-
// @count = external global i64
79-
80-
// define i64 @f2()
81-
// {
82-
// %1 = load i64, i64* @count
83-
// ret i64 %1
84-
// }
85-
// )""");
86-
// CHECK(e.execfn<int64_t>("f2") == 4);
87-
88-
// CHECK_THROWS_AS(e.add_module(R"""(
89-
// define i64 @f3()
90-
// {
91-
// ; FAIL: @count is not defined
92-
// %1 = load i64, i64* @count
93-
// ret i64 %1
94-
// }
95-
// )"""), LCompilers::LCompilersException);
96-
// }
44+
TEST_CASE("llvm 1 fail") {
45+
LCompilers::LLVMEvaluator e;
46+
CHECK_THROWS_AS(e.add_module(R"""(
47+
define i64 @f1()
48+
{
49+
; FAIL: "=x" is incorrect syntax
50+
%1 =x alloca i64
51+
}
52+
)"""), LCompilers::LCompilersException);
53+
CHECK_THROWS_WITH(e.add_module(R"""(
54+
define i64 @f1()
55+
{
56+
; FAIL: "=x" is incorrect syntax
57+
%1 =x alloca i64
58+
}
59+
)"""), "parse_module(): Invalid LLVM IR");
60+
}
61+
62+
63+
TEST_CASE("llvm 2") {
64+
LCompilers::LLVMEvaluator e;
65+
e.add_module(R"""(
66+
@count = global i64 0
67+
68+
define i64 @f1()
69+
{
70+
store i64 4, i64* @count
71+
%1 = load i64, i64* @count
72+
ret i64 %1
73+
}
74+
)""");
75+
CHECK(e.execfn<int64_t>("f1") == 4);
76+
77+
e.add_module(R"""(
78+
@count = external global i64
79+
80+
define i64 @f2()
81+
{
82+
%1 = load i64, i64* @count
83+
ret i64 %1
84+
}
85+
)""");
86+
CHECK(e.execfn<int64_t>("f2") == 4);
87+
88+
CHECK_THROWS_AS(e.add_module(R"""(
89+
define i64 @f3()
90+
{
91+
; FAIL: @count is not defined
92+
%1 = load i64, i64* @count
93+
ret i64 %1
94+
}
95+
)"""), LCompilers::LCompilersException);
96+
}
9797

9898
TEST_CASE("llvm 3") {
9999
LCompilers::LLVMEvaluator e;

0 commit comments

Comments
 (0)