Skip to content

Commit

Permalink
Check LLVM warning in target test
Browse files Browse the repository at this point in the history
Change-Id: Ibfd0beb6dda00aa2a93cd0b47cf28f045e3fde5c
  • Loading branch information
lhutton1 committed Jan 28, 2024
1 parent 528711a commit 0f625dd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/python/target/test_llvm_features_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
LLVM_VERSION = codegen.llvm_version_major()


def test_llvm_targets():
def test_llvm_targets(capfd):

##
## check LLVM backend
Expand All @@ -39,6 +39,13 @@ def test_llvm_targets():
assert codegen.llvm_get_system_x86_vendor() == _ffi_api.llvm_get_system_x86_vendor()
assert str(codegen.llvm_get_targets()) == str(_ffi_api.llvm_get_targets())

tvm.target.codegen.llvm_get_cpu_features(
tvm.target.Target("llvm -mtriple=x86_64-linux-gnu -mcpu=dummy")
)
expected_str = ("Error: LLVM cpu architecture `-mcpu=dummy` is not valid in "
"`-mtriple=x86_64-linux-gnu`, cpu architecture ignored")
assert expected_str in capfd.readouterr().err


min_llvm_version, llvm_target, cpu_arch, cpu_features, is_supported = tvm.testing.parameters(
(-1, "x86_64", "sandybridge", "sse4.1", True),
Expand Down

0 comments on commit 0f625dd

Please sign in to comment.