Skip to content

Commit d559090

Browse files
authored
Merge pull request #2190 from anutosh491/GSoC_Pr_7
Added test based on basic_new_heap function
2 parents 0001e55 + 380d594 commit d559090

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

integration_tests/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,7 @@ RUN(NAME symbolics_03 LABELS cpython_sym c_sym)
624624
RUN(NAME symbolics_04 LABELS cpython_sym c_sym)
625625
RUN(NAME symbolics_05 LABELS cpython_sym c_sym)
626626
RUN(NAME symbolics_06 LABELS cpython_sym c_sym)
627+
RUN(NAME symbolics_07 LABELS cpython_sym c_sym)
627628

628629
RUN(NAME sizeof_01 LABELS llvm c
629630
EXTRAFILES sizeof_01b.c)

integration_tests/symbolics_07.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
from lpython import ccall
2+
3+
@ccall(header="symengine/cwrapper.h")
4+
def basic_new_heap() -> CPtr:
5+
pass
6+
7+
@ccall(header="symengine/cwrapper.h")
8+
def basic_const_pi(x: CPtr) -> None:
9+
pass
10+
11+
@ccall(header="symengine/cwrapper.h")
12+
def basic_str(x: CPtr) -> str:
13+
pass
14+
15+
def main0():
16+
x: CPtr = basic_new_heap()
17+
basic_const_pi(x)
18+
s: str = basic_str(x)
19+
print(s)
20+
assert s == "pi"
21+
22+
main0()

0 commit comments

Comments
 (0)