Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
TEST: Define and use llvm_py as backend
  • Loading branch information
ubaidsk committed Jul 26, 2023
commit bf7595325b2400a5955187195954e801bfff01b7
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,8 @@ jobs:
shell: bash -e -l {0}
run: |
cd integration_tests
./run_tests.py -b cpython c_py
./run_tests.py -b cpython c_py -f
./run_tests.py -b cpython c_py llvm_py
./run_tests.py -b cpython c_py llvm_py -f

sympy:
name: Run SymPy tests
Expand Down
17 changes: 17 additions & 0 deletions integration_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,23 @@ macro(RUN_UTIL RUN_FAIL RUN_NAME RUN_FILE_NAME RUN_LABELS RUN_EXTRAFILES RUN_EXT
if (${fail})
set_tests_properties(${name} PROPERTIES WILL_FAIL TRUE)
endif()
elseif (KIND STREQUAL "llvm_py")
add_custom_command(
OUTPUT ${name}.o
COMMAND ${LPYTHON} -c ${extra_args} ${CMAKE_CURRENT_SOURCE_DIR}/${file_name}.py -o ${name}.o
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file_name}.py
VERBATIM)
add_executable(${name} ${name}.o ${extra_files})
target_include_directories(${name} PRIVATE ${CMAKE_SOURCE_DIR} ${NUMPY_INCLUDE_DIR})
set_target_properties(${name} PROPERTIES LINKER_LANGUAGE C)
target_link_libraries(${name} lpython_rtlib Python::Python)
add_test(${name} ${CMAKE_CURRENT_BINARY_DIR}/${name})
if (labels)
set_tests_properties(${name} PROPERTIES LABELS "${labels}")
endif()
if (${fail})
set_tests_properties(${name} PROPERTIES WILL_FAIL TRUE)
endif()
elseif(KIND STREQUAL "llvm_sym")
add_custom_command(
OUTPUT ${name}.o
Expand Down
4 changes: 2 additions & 2 deletions integration_tests/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# Initialization
DEFAULT_THREADS_TO_USE = 8 # default no of threads is 8
SUPPORTED_BACKENDS = ['llvm', 'c', 'wasm', 'cpython', 'x86', 'wasm_x86', 'wasm_x64', 'c_py', 'c_sym', 'cpython_sym', 'llvm_sym']
SUPPORTED_BACKENDS = ['llvm', 'c', 'wasm', 'cpython', 'x86', 'wasm_x86', 'wasm_x64', 'c_py', 'c_sym', 'cpython_sym', 'llvm_sym', 'llvm_py']
BASE_DIR = os.path.dirname(os.path.realpath(__file__))
LPYTHON_PATH = f"{BASE_DIR}/../src/bin"

Expand Down Expand Up @@ -62,7 +62,7 @@ def main():
DEFAULT_THREADS_TO_USE = args.no_of_threads or DEFAULT_THREADS_TO_USE
fast_tests = "yes" if args.fast else "no"
for backend in args.backends:
python_libs_req = "yes" if backend in ["c_py", "c_sym", "llvm_sym"] else "no"
python_libs_req = "yes" if backend in ["c_py", "c_sym", "llvm_sym", 'llvm_py'] else "no"
test_backend(backend)


Expand Down