diff --git a/integration_tests/CMakeLists.txt b/integration_tests/CMakeLists.txt index 7e2be504a5..d05382962f 100644 --- a/integration_tests/CMakeLists.txt +++ b/integration_tests/CMakeLists.txt @@ -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) diff --git a/integration_tests/symbolics_08.py b/integration_tests/symbolics_08.py new file mode 100644 index 0000000000..c360b60f37 --- /dev/null +++ b/integration_tests/symbolics_08.py @@ -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() \ No newline at end of file