Skip to content

Commit

Permalink
Merge pull request lcompilers#2430 from Thirumalai-Shaktivel/symbolic_02
Browse files Browse the repository at this point in the history
Enable llvm tests for symbolics
  • Loading branch information
certik authored Nov 29, 2023
2 parents 56b300b + 05f10bb commit 20b249e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions integration_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -714,9 +714,9 @@ RUN(NAME symbolics_07 LABELS cpython_sym c_sym llvm_sym NOFAST)
RUN(NAME symbolics_08 LABELS cpython_sym c_sym llvm_sym)
RUN(NAME symbolics_09 LABELS cpython_sym c_sym llvm_sym NOFAST)
RUN(NAME symbolics_10 LABELS cpython_sym c_sym llvm_sym NOFAST)
RUN(NAME symbolics_11 LABELS cpython_sym c_sym NOFAST)
RUN(NAME symbolics_11 LABELS cpython_sym c_sym llvm_sym NOFAST)
RUN(NAME symbolics_12 LABELS cpython_sym c_sym llvm_sym NOFAST)
RUN(NAME symbolics_13 LABELS cpython_sym c_sym NOFAST)
RUN(NAME symbolics_13 LABELS cpython_sym c_sym llvm_sym NOFAST)

RUN(NAME sizeof_01 LABELS llvm c
EXTRAFILES sizeof_01b.c)
Expand Down
11 changes: 6 additions & 5 deletions src/libasr/codegen/asr_to_llvm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7766,9 +7766,9 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor<ASRToLLVMVisitor>
if (llvm_symtab.find(h) != llvm_symtab.end()) {
tmp = llvm_symtab[h];
if( !ASRUtils::is_array(arg->m_type) ) {

if (x_abi == ASR::abiType::Source && ASR::is_a<ASR::CPtr_t>(*arg->m_type)) {
if (arg->m_intent == intent_local) {
if ( orig_arg_intent != ASRUtils::intent_out &&
arg->m_intent == intent_local ) {
// Local variable of type
// CPtr is a void**, so we
// have to load it
Expand Down Expand Up @@ -7815,9 +7815,10 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor<ASRToLLVMVisitor>
}
}
} else if (is_a<ASR::CPtr_t>(*arg_type)) {
if (arg->m_intent == intent_local) {
// Local variable of type
// CPtr is a void**, so we
if ( arg->m_intent == intent_local ||
arg->m_intent == ASRUtils::intent_out) {
// Local variable or Dummy out argument
// of type CPtr is a void**, so we
// have to load it
tmp = CreateLoad(tmp);
}
Expand Down
1 change: 1 addition & 0 deletions src/libasr/codegen/llvm_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1267,6 +1267,7 @@ namespace LCompilers {
break;
}
case (ASR::ttypeType::CPtr) : {
a_kind = 8;
llvm_type = llvm::Type::getVoidTy(context)->getPointerTo();
break;
}
Expand Down

0 comments on commit 20b249e

Please sign in to comment.