if(NOT IREE_INPUT_STABLEHLO AND NOT IREE_HOST_BIN_DIR)
  return()
endif()

### BAZEL_TO_CMAKE_PRESERVES_ALL_CONTENT_ABOVE_THIS_LINE ###
################################################################################
# Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
# tests/e2e/stablehlo_models/BUILD.bazel                                       #
#                                                                              #
# Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
# CMake-only content.                                                          #
#                                                                              #
# To disable autogeneration for this file entirely, delete this header.        #
################################################################################

iree_add_all_subdirs()

iree_lit_test_suite(
  NAME
    lit
  SRCS
    "collatz.mlir"
    "edge_detection.mlir"
    "fragment_000.mlir"
    "fullyconnected.mlir"
    "mnist_fake_weights.mlir"
    "unidirectional_lstm.mlir"
  TOOLS
    ${IREE_LLD_TARGET}
    FileCheck
    iree-run-mlir
  LABELS
    "driver=local-task"
    "hostonly"
)

### BAZEL_TO_CMAKE_PRESERVES_ALL_CONTENT_BELOW_THIS_LINE ###

iree_static_linker_test(
  NAME
    mnist_fake_weights_llvm_cpu_static_bytecode_test
  SRC
    "mnist_fake_weights.mlir"
  STATIC_LIB_PREFIX
    mnist_fake_weights_linked
  ENTRY_FUNCTION
    "predict"
  FUNCTION_INPUTS
    "1x28x28x1xf32"
  COMPILER_FLAGS
    "--iree-input-type=stablehlo"
)

iree_static_linker_test(
  NAME
    mnist_fake_weights_llvm_cpu_static_c_test
  SRC
    "mnist_fake_weights.mlir"
  STATIC_LIB_PREFIX
    mnist_fake_weights_linked
  ENTRY_FUNCTION
    "predict"
  FUNCTION_INPUTS
    "1x28x28x1xf32"
  COMPILER_FLAGS
    "--iree-input-type=stablehlo"
    "--iree-vm-target-index-bits=32"
  EMITC
)

iree_static_linker_test(
  NAME
    simple_mul_llvm_cpu_static_bytecode_test
  SRC
    "${IREE_ROOT_DIR}/samples/static_library/simple_mul.mlir"
  STATIC_LIB_PREFIX
    simple_mul_dispatch_0
  ENTRY_FUNCTION
    "simple_mul"
  FUNCTION_INPUTS
    "4xf32,4xf32"
)

iree_static_linker_test(
  NAME
    simple_mul_llvm_cpu_static_c_test
  SRC
    "${IREE_ROOT_DIR}/samples/static_library/simple_mul.mlir"
  STATIC_LIB_PREFIX
    simple_mul_dispatch_0
  ENTRY_FUNCTION
    "simple_mul"
  FUNCTION_INPUTS
    "4xf32,4xf32"
  COMPILER_FLAGS
    "--iree-vm-target-index-bits=32"
  EMITC
)
