File tree Expand file tree Collapse file tree 4 files changed +29
-3
lines changed Expand file tree Collapse file tree 4 files changed +29
-3
lines changed Original file line number Diff line number Diff line change @@ -717,6 +717,7 @@ RUN(NAME symbolics_10 LABELS cpython_sym c_sym llvm_sym NOFAST)
717
717
RUN (NAME symbolics_11 LABELS cpython_sym c_sym llvm_sym NOFAST )
718
718
RUN (NAME symbolics_12 LABELS cpython_sym c_sym llvm_sym NOFAST )
719
719
RUN (NAME symbolics_13 LABELS cpython_sym c_sym llvm_sym NOFAST )
720
+ RUN (NAME test_gruntz LABELS cpython_sym llvm_sym NOFAST )
720
721
721
722
RUN (NAME sizeof_01 LABELS llvm c
722
723
EXTRAFILES sizeof_01b.c )
@@ -775,7 +776,7 @@ RUN(NAME func_dep_03 LABELS cpython llvm c)
775
776
RUN (NAME func_dep_04 LABELS cpython llvm c )
776
777
RUN (NAME func_internal_def_01 LABELS cpython llvm NOFAST )
777
778
RUN (NAME func_01 LABELS cpython llvm )
778
- RUN (NAME func_02 LABELS c_sym )
779
+ RUN (NAME func_02 LABELS c_sym llvm_sym NOFAST )
779
780
780
781
RUN (NAME float_01 LABELS cpython llvm c wasm wasm_x64 )
781
782
RUN (NAME recursive_01 LABELS cpython llvm c wasm wasm_x64 wasm_x86 )
Original file line number Diff line number Diff line change 1
- from lpython import S
1
+ from lpython import S , Out
2
2
from sympy import pi
3
3
4
4
def func (r : Out [S ]) -> None :
Original file line number Diff line number Diff line change
1
+ from lpython import S
2
+ from sympy import Symbol
3
+
4
+ def mmrv (e : S , x : S ) -> list [S ]:
5
+ l : list [S ] = []
6
+ if not e .has (x ):
7
+ return l
8
+ else :
9
+ raise
10
+
11
+ def test_mrv1 ():
12
+ x : S = Symbol ("x" )
13
+ y : S = Symbol ("y" )
14
+ ans : list [S ] = mmrv (y , x )
15
+ assert len (ans ) == 0
16
+
17
+ test_mrv1 ()
Original file line number Diff line number Diff line change @@ -120,6 +120,14 @@ namespace LCompilers {
120
120
ASR::is_a<ASR::SymbolicExpression_t>(*ASRUtils::expr_type (var)));
121
121
}
122
122
123
+ static inline bool is_symbolic_list_type (ASR::expr_t * var) {
124
+ if (ASR::is_a<ASR::List_t>(*ASRUtils::expr_type (var))) {
125
+ ASR::List_t *list = ASR::down_cast<ASR::List_t>(ASRUtils::expr_type (var));
126
+ return (list->m_type ->type == ASR::ttypeType::SymbolicExpression);
127
+ }
128
+ return false ;
129
+ }
130
+
123
131
template <class Struct >
124
132
class PassVisitor : public ASR ::ASRPassBaseWalkVisitor<Struct> {
125
133
@@ -788,7 +796,7 @@ namespace LCompilers {
788
796
* in avoiding deep copies and the destination memory directly gets
789
797
* filled inside the function.
790
798
*/
791
- if ( is_array_or_struct_or_symbolic (x->m_return_var )) {
799
+ if ( is_array_or_struct_or_symbolic (x->m_return_var ) || is_symbolic_list_type (x-> m_return_var ) ) {
792
800
for ( auto & s_item: x->m_symtab ->get_scope () ) {
793
801
ASR::symbol_t * curr_sym = s_item.second ;
794
802
if ( curr_sym->type == ASR::symbolType::Variable ) {
You can’t perform that action at this time.
0 commit comments