Skip to content

Added tests based on basic_new_stack function #2199

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions integration_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,7 @@ RUN(NAME symbolics_04 LABELS cpython_sym c_sym)
RUN(NAME symbolics_05 LABELS cpython_sym c_sym)
RUN(NAME symbolics_06 LABELS cpython_sym c_sym)
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 sizeof_01 LABELS llvm c
EXTRAFILES sizeof_01b.c)
Expand Down
26 changes: 26 additions & 0 deletions integration_tests/symbolics_08.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from lpython import ccall, CPtr, p_c_pointer, pointer, i64, empty_c_void_p
import os

@ccall(header="symengine/cwrapper.h", c_shared_lib="symengine", c_shared_lib_path=f"{os.environ['CONDA_PREFIX']}/lib")
def basic_new_stack(x: CPtr) -> None:
pass

@ccall(header="symengine/cwrapper.h", c_shared_lib="symengine", c_shared_lib_path=f"{os.environ['CONDA_PREFIX']}/lib")
def basic_const_pi(x: CPtr) -> None:
pass

@ccall(header="symengine/cwrapper.h", c_shared_lib="symengine", c_shared_lib_path=f"{os.environ['CONDA_PREFIX']}/lib")
def basic_str(x: CPtr) -> str:
pass

def main0():
y: i64 = i64(0)
x: CPtr = empty_c_void_p()
p_c_pointer(pointer(y, i64), x)
basic_new_stack(x)
basic_const_pi(x)
s: str = basic_str(x)
print(s)
assert s == "pi"

main0()