Mark some MLIR tests as requiring the native target to be configured

This makes `ninja check-mlir` work without the host targets configured.
This commit is contained in:
Mehdi Amini 2022-01-14 06:57:51 +00:00
parent 28b6e2cb3d
commit 5a68a85d85
6 changed files with 20 additions and 14 deletions

View File

@ -9,6 +9,8 @@
/* RUN: mlir-capi-execution-engine-test 2>&1 | FileCheck %s
*/
/* REQUIRES: llvm_has_native_target
*/
#include "mlir-c/Conversion.h"
#include "mlir-c/ExecutionEngine.h"

View File

@ -29,6 +29,12 @@ if (MLIR_INCLUDE_INTEGRATION_TESTS)
# Passed to lit.site.cfg.py.in to set up the path where to find the libraries.
set(MLIR_INTEGRATION_TEST_DIR ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
# The native target may not be enabled when cross compiling, raise an error.
if(NOT TARGET ${LLVM_NATIVE_ARCH})
message(FATAL_ERROR "MLIR_INCLUDE_INTEGRATION_TESTS requires a native target")
endif()
# Copy test data over.
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/Integration/data/mttkrp_b.tns
${CMAKE_CURRENT_SOURCE_DIR}/Integration/data/test.mtx

View File

@ -107,12 +107,10 @@ llvm_config.add_tool_substitutions(tools, tool_dirs)
config.environment['FILECHECK_OPTS'] = "-enable-var-scope --allow-unused-prefixes=false"
# LLVM can be configured with an empty default triple
# by passing ` -DLLVM_DEFAULT_TARGET_TRIPLE="" `.
# This is how LLVM filters tests that require the host target
# to be available for JIT tests.
if config.target_triple:
config.available_features.add('default_triple')
if config.native_target in config.targets_to_build:
config.available_features.add('llvm_has_native_target')
# Add the python path for both the source and binary tree.
# Note that presently, the python sources come from the source tree and the

View File

@ -4,11 +4,7 @@ import sys
if sys.platform == 'win32':
config.unsupported = True
# Requires a non-empty default triple for these tests.
# Passing ` -DLLVM_DEFAULT_TARGET_TRIPLE="" ` when the
# host target isn't available is how LLVM filters
# tests that require the host target to be available
# for JIT tests.
if 'default_triple' not in config.available_features:
# Requires the native target to be configured in.
if 'llvm_has_native_target' not in config.available_features:
config.unsupported = True

View File

@ -1,5 +1,5 @@
# RUN: %PYTHON %s 2>&1 | FileCheck %s
# REQUIRES: llvm_has_native_target
import gc, sys
from mlir.ir import *
from mlir.passmanager import *

View File

@ -7,7 +7,6 @@ endfunction()
add_subdirectory(Analysis)
add_subdirectory(Conversion)
add_subdirectory(Dialect)
add_subdirectory(ExecutionEngine)
add_subdirectory(Interfaces)
add_subdirectory(IR)
add_subdirectory(Pass)
@ -15,3 +14,8 @@ add_subdirectory(Support)
add_subdirectory(Rewrite)
add_subdirectory(TableGen)
add_subdirectory(Transforms)
# The native target may not be enabled when cross compiling.
if(TARGET ${LLVM_NATIVE_ARCH})
add_subdirectory(ExecutionEngine)
endif()