[flang] Fix crash in HLFIR generation (#118399)
[llvm-project.git] / mlir / test / CAPI / CMakeLists.txt
blobe795672bce5d12d3d718ee444a0960de19ca5385
1 function(_add_capi_test_executable name)
2   cmake_parse_arguments(ARG
3     ""
4     ""
5     "LINK_LIBS"
6     ${ARGN})
7   set(LLVM_LINK_COMPONENTS
8     )
9   add_llvm_executable(${name}
10     PARTIAL_SOURCES_INTENDED
11     ${ARG_UNPARSED_ARGUMENTS})
12   set_target_properties(${name} PROPERTIES FOLDER "MLIR/Tests")
13   set_target_properties(${name} PROPERTIES EXCLUDE_FROM_ALL ON)
15   llvm_update_compile_flags(${name})
16   if(MLIR_BUILD_MLIR_C_DYLIB)
17     target_link_libraries(${name} PRIVATE
18       LLVMCore
19       MLIR-C)
20   else()
21     target_link_libraries(${name} PRIVATE
22       ${ARG_LINK_LIBS})
23   endif()
24 endfunction(_add_capi_test_executable)
26 if(MLIR_ENABLE_EXECUTION_ENGINE)
27   _add_capi_test_executable(mlir-capi-execution-engine-test
28     execution_engine.c
29   LINK_LIBS PRIVATE
30     MLIRCAPIConversion
31     MLIRCAPIExecutionEngine
32     MLIRCAPIRegisterEverything
34 endif()
36 _add_capi_test_executable(mlir-capi-ir-test
37   ir.c
38   LINK_LIBS PRIVATE
39     MLIRCAPIIR
40     MLIRCAPIFunc
41     MLIRCAPIRegisterEverything
44 _add_capi_test_executable(mlir-capi-irdl-test
45   irdl.c
46   LINK_LIBS PRIVATE
47     MLIRCAPIIR
48     MLIRCAPIIRDL
51 _add_capi_test_executable(mlir-capi-llvm-test
52   llvm.c
53   LINK_LIBS PRIVATE
54     MLIRCAPIIR
55     MLIRCAPILLVM
56     MLIRCAPIRegisterEverything
59 _add_capi_test_executable(mlir-capi-pass-test
60   pass.c
61   LINK_LIBS PRIVATE
62     MLIRCAPIFunc
63     MLIRCAPIIR
64     MLIRCAPIRegisterEverything
65     MLIRCAPITransforms
68 _add_capi_test_executable(mlir-capi-pdl-test
69   pdl.c
70   LINK_LIBS PRIVATE
71     MLIRCAPIIR
72     MLIRCAPIRegisterEverything
73     MLIRCAPIPDL
76 _add_capi_test_executable(mlir-capi-sparse-tensor-test
77   sparse_tensor.c
78   LINK_LIBS PRIVATE
79     MLIRCAPIIR
80     MLIRCAPIRegisterEverything
81     MLIRCAPISparseTensor
84 _add_capi_test_executable(mlir-capi-quant-test
85   quant.c
86   LINK_LIBS PRIVATE
87     MLIRCAPIIR
88     MLIRCAPIRegisterEverything
89     MLIRCAPIQuant
92 _add_capi_test_executable(mlir-capi-rewrite-test
93   rewrite.c
94   LINK_LIBS PRIVATE
95     MLIRCAPIIR
96     MLIRCAPIRegisterEverything
97     MLIRCAPITransforms
101 _add_capi_test_executable(mlir-capi-transform-test
102   transform.c
103   LINK_LIBS PRIVATE
104     MLIRCAPIIR
105     MLIRCAPIRegisterEverything
106     MLIRCAPITransformDialect
109 _add_capi_test_executable(mlir-capi-transform-interpreter-test
110   transform_interpreter.c
111   LINK_LIBS PRIVATE
112     MLIRCAPIIR
113     MLIRCAPIRegisterEverything
114     MLIRCAPITransformDialect
115     MLIRCAPITransformDialectTransforms
118 _add_capi_test_executable(mlir-capi-translation-test
119   translation.c
120   LINK_LIBS PRIVATE
121     MLIRCAPIIR
122     MLIRCAPILLVM
123     MLIRCAPIRegisterEverything
124     MLIRCAPITarget