Skip to content

Commit 7384e92

Browse files
authored
Merge pull request #2199 from anutosh491/GSoC_PR_9
Added tests based on basic_new_stack function
2 parents 9a84918 + b87a25b commit 7384e92

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

integration_tests/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,7 @@ RUN(NAME symbolics_04 LABELS cpython_sym c_sym)
646646
RUN(NAME symbolics_05 LABELS cpython_sym c_sym)
647647
RUN(NAME symbolics_06 LABELS cpython_sym c_sym)
648648
RUN(NAME symbolics_07 LABELS cpython_sym c_sym llvm_sym NOFAST)
649+
RUN(NAME symbolics_08 LABELS cpython_sym c_sym llvm_sym)
649650

650651
RUN(NAME sizeof_01 LABELS llvm c
651652
EXTRAFILES sizeof_01b.c)

integration_tests/symbolics_08.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
from lpython import ccall, CPtr, p_c_pointer, pointer, i64, empty_c_void_p
2+
import os
3+
4+
@ccall(header="symengine/cwrapper.h", c_shared_lib="symengine", c_shared_lib_path=f"{os.environ['CONDA_PREFIX']}/lib")
5+
def basic_new_stack(x: CPtr) -> None:
6+
pass
7+
8+
@ccall(header="symengine/cwrapper.h", c_shared_lib="symengine", c_shared_lib_path=f"{os.environ['CONDA_PREFIX']}/lib")
9+
def basic_const_pi(x: CPtr) -> None:
10+
pass
11+
12+
@ccall(header="symengine/cwrapper.h", c_shared_lib="symengine", c_shared_lib_path=f"{os.environ['CONDA_PREFIX']}/lib")
13+
def basic_str(x: CPtr) -> str:
14+
pass
15+
16+
def main0():
17+
y: i64 = i64(0)
18+
x: CPtr = empty_c_void_p()
19+
p_c_pointer(pointer(y, i64), x)
20+
basic_new_stack(x)
21+
basic_const_pi(x)
22+
s: str = basic_str(x)
23+
print(s)
24+
assert s == "pi"
25+
26+
main0()

0 commit comments

Comments
 (0)