Skip to content

Commit 20b249e

Browse files
authored
Merge pull request #2430 from Thirumalai-Shaktivel/symbolic_02
Enable llvm tests for symbolics
2 parents 56b300b + 05f10bb commit 20b249e

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

integration_tests/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -714,9 +714,9 @@ RUN(NAME symbolics_07 LABELS cpython_sym c_sym llvm_sym NOFAST)
714714
RUN(NAME symbolics_08 LABELS cpython_sym c_sym llvm_sym)
715715
RUN(NAME symbolics_09 LABELS cpython_sym c_sym llvm_sym NOFAST)
716716
RUN(NAME symbolics_10 LABELS cpython_sym c_sym llvm_sym NOFAST)
717-
RUN(NAME symbolics_11 LABELS cpython_sym c_sym NOFAST)
717+
RUN(NAME symbolics_11 LABELS cpython_sym c_sym llvm_sym NOFAST)
718718
RUN(NAME symbolics_12 LABELS cpython_sym c_sym llvm_sym NOFAST)
719-
RUN(NAME symbolics_13 LABELS cpython_sym c_sym NOFAST)
719+
RUN(NAME symbolics_13 LABELS cpython_sym c_sym llvm_sym NOFAST)
720720

721721
RUN(NAME sizeof_01 LABELS llvm c
722722
EXTRAFILES sizeof_01b.c)

src/libasr/codegen/asr_to_llvm.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7766,9 +7766,9 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor<ASRToLLVMVisitor>
77667766
if (llvm_symtab.find(h) != llvm_symtab.end()) {
77677767
tmp = llvm_symtab[h];
77687768
if( !ASRUtils::is_array(arg->m_type) ) {
7769-
77707769
if (x_abi == ASR::abiType::Source && ASR::is_a<ASR::CPtr_t>(*arg->m_type)) {
7771-
if (arg->m_intent == intent_local) {
7770+
if ( orig_arg_intent != ASRUtils::intent_out &&
7771+
arg->m_intent == intent_local ) {
77727772
// Local variable of type
77737773
// CPtr is a void**, so we
77747774
// have to load it
@@ -7815,9 +7815,10 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor<ASRToLLVMVisitor>
78157815
}
78167816
}
78177817
} else if (is_a<ASR::CPtr_t>(*arg_type)) {
7818-
if (arg->m_intent == intent_local) {
7819-
// Local variable of type
7820-
// CPtr is a void**, so we
7818+
if ( arg->m_intent == intent_local ||
7819+
arg->m_intent == ASRUtils::intent_out) {
7820+
// Local variable or Dummy out argument
7821+
// of type CPtr is a void**, so we
78217822
// have to load it
78227823
tmp = CreateLoad(tmp);
78237824
}

src/libasr/codegen/llvm_utils.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,6 +1267,7 @@ namespace LCompilers {
12671267
break;
12681268
}
12691269
case (ASR::ttypeType::CPtr) : {
1270+
a_kind = 8;
12701271
llvm_type = llvm::Type::getVoidTy(context)->getPointerTo();
12711272
break;
12721273
}

0 commit comments

Comments
 (0)