From 9762f12c6c60d7306040dd1717b708763cc803a4 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Wed, 30 Jun 2021 21:44:54 +0200 Subject: [PATCH] [Orc] Run the examples as part of the tests Enable the Orc C-Bindings for testing. Reviewed By: lhames Differential Revision: https://reviews.llvm.org/D104637 --- llvm/test/CMakeLists.txt | 4 ++++ .../OrcV2Examples/orcv2-cbindings-add-object-file.test | 3 +++ .../Examples/OrcV2Examples/orcv2-cbindings-basic-usage.test | 3 +++ .../orcv2-cbindings-reflect-process-symbols.test | 3 +++ .../OrcV2Examples/orcv2-cbindings-removable-code.test | 3 +++ llvm/test/lit.cfg.py | 6 +++++- 6 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 llvm/test/Examples/OrcV2Examples/orcv2-cbindings-add-object-file.test create mode 100644 llvm/test/Examples/OrcV2Examples/orcv2-cbindings-basic-usage.test create mode 100644 llvm/test/Examples/OrcV2Examples/orcv2-cbindings-reflect-process-symbols.test create mode 100644 llvm/test/Examples/OrcV2Examples/orcv2-cbindings-removable-code.test diff --git a/llvm/test/CMakeLists.txt b/llvm/test/CMakeLists.txt index 84be4dd3b329..7fd52d207df4 100644 --- a/llvm/test/CMakeLists.txt +++ b/llvm/test/CMakeLists.txt @@ -162,6 +162,10 @@ if(LLVM_BUILD_EXAMPLES) Kaleidoscope-Ch6 Kaleidoscope-Ch7 LLJITWithThinLTOSummaries + OrcV2CBindingsBasicUsage + OrcV2CBindingsAddObjectFile + OrcV2CBindingsRemovableCode + OrcV2CBindingsReflectProcessSymbols ) if(CMAKE_HOST_UNIX) list(APPEND LLVM_TEST_DEPENDS diff --git a/llvm/test/Examples/OrcV2Examples/orcv2-cbindings-add-object-file.test b/llvm/test/Examples/OrcV2Examples/orcv2-cbindings-add-object-file.test new file mode 100644 index 000000000000..95cb1109e209 --- /dev/null +++ b/llvm/test/Examples/OrcV2Examples/orcv2-cbindings-add-object-file.test @@ -0,0 +1,3 @@ +# RUN: OrcV2CBindingsAddObjectFile 2>&1 | FileCheck %s + +# CHECK: 1 + 2 = 3 diff --git a/llvm/test/Examples/OrcV2Examples/orcv2-cbindings-basic-usage.test b/llvm/test/Examples/OrcV2Examples/orcv2-cbindings-basic-usage.test new file mode 100644 index 000000000000..3e7ce3f3b724 --- /dev/null +++ b/llvm/test/Examples/OrcV2Examples/orcv2-cbindings-basic-usage.test @@ -0,0 +1,3 @@ +# RUN: OrcV2CBindingsBasicUsage 2>&1 | FileCheck %s + +# CHECK: 1 + 2 = 3 diff --git a/llvm/test/Examples/OrcV2Examples/orcv2-cbindings-reflect-process-symbols.test b/llvm/test/Examples/OrcV2Examples/orcv2-cbindings-reflect-process-symbols.test new file mode 100644 index 000000000000..f52e0325fc80 --- /dev/null +++ b/llvm/test/Examples/OrcV2Examples/orcv2-cbindings-reflect-process-symbols.test @@ -0,0 +1,3 @@ +# RUN: OrcV2CBindingsReflectProcessSymbols 2>&1 | FileCheck %s + +# CHECK: 3 * 4 + 5 = 17 diff --git a/llvm/test/Examples/OrcV2Examples/orcv2-cbindings-removable-code.test b/llvm/test/Examples/OrcV2Examples/orcv2-cbindings-removable-code.test new file mode 100644 index 000000000000..fbbb380c9084 --- /dev/null +++ b/llvm/test/Examples/OrcV2Examples/orcv2-cbindings-removable-code.test @@ -0,0 +1,3 @@ +# RUN: OrcV2CBindingsRemovableCode 2>&1 | FileCheck %s + +# CHECK: 1 + 2 = 3 diff --git a/llvm/test/lit.cfg.py b/llvm/test/lit.cfg.py index b5b8ee9f4d26..e8de805eae71 100644 --- a/llvm/test/lit.cfg.py +++ b/llvm/test/lit.cfg.py @@ -182,7 +182,11 @@ tools.extend([ ToolSubst('Kaleidoscope-Ch7', unresolved='ignore'), ToolSubst('Kaleidoscope-Ch8', unresolved='ignore'), ToolSubst('LLJITWithThinLTOSummaries', unresolved='ignore'), - ToolSubst('LLJITWithRemoteDebugging', unresolved='ignore')]) + ToolSubst('LLJITWithRemoteDebugging', unresolved='ignore'), + ToolSubst('OrcV2CBindingsBasicUsage', unresolved='ignore'), + ToolSubst('OrcV2CBindingsAddObjectFile', unresolved='ignore'), + ToolSubst('OrcV2CBindingsRemovableCode', unresolved='ignore'), + ToolSubst('OrcV2CBindingsReflectProcessSymbols', unresolved='ignore')]) llvm_config.add_tool_substitutions(tools, config.llvm_tools_dir)