[WebAssembly] Add end-to-end codegen tests for wasm_simd128.h

Add a test checking that each SIMD intrinsic produces the expected instruction.
Since this test spans both clang and LLVM, place it in a new
intrinsic-header-tests subdirectory of cross-project-tests.

This revives D101684 now that cross-project-tests exists. In practice, the tests
of lowering from wasm_simd128.h to LLVM IR were not as useful as this end-to-end
test.

Updates the version check of gdb in cross-project-tests/lit.cfg.py so that
unexpected version formats do not prevent the new tests from running.

Depends on D121661.

Differential Revision: https://reviews.llvm.org/D121662
This commit is contained in:
Thomas Lively 2022-03-17 15:22:17 -07:00
parent 6316129e06
commit 7062094bbc
5 changed files with 1287 additions and 2 deletions

View File

@ -78,6 +78,13 @@ add_lit_testsuite(check-debuginfo "Running debuginfo tests"
DEPENDS ${CROSS_PROJECT_TEST_DEPS}
)
# Add alias for intrinsic header test subset.
add_lit_testsuite(check-intrinsic-headers "Running intrinsic header tests"
${CMAKE_CURRENT_BINARY_DIR}/intrinsic-header-tests
EXCLUDE_FROM_CHECK_ALL
DEPENDS ${CROSS_PROJECT_TEST_DEPS}
)
# Add check-cross-project-* targets.
add_lit_testsuites(CROSS_PROJECT ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS ${CROSS_PROJECT_TEST_DEPS}
@ -85,3 +92,4 @@ add_lit_testsuites(CROSS_PROJECT ${CMAKE_CURRENT_SOURCE_DIR}
set_target_properties(check-cross-project PROPERTIES FOLDER "Tests")
set_target_properties(check-debuginfo PROPERTIES FOLDER "Tests")
set_target_properties(check-intrinsic-headers PROPERTIES FOLDER "Tests")

View File

@ -0,0 +1,3 @@
-*- rst -*-
This is a collection of tests to check that the expected assembly is generated
from clang intrinsic headers.

View File

@ -0,0 +1,2 @@
if 'clang' not in config.available_features:
config.unsupported = True

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,9 @@ import platform
import re
import subprocess
import sys
from distutils.version import StrictVersion
# TODO: LooseVersion is undocumented; use something else.
from distutils.version import LooseVersion
import lit.formats
import lit.util
@ -246,7 +248,7 @@ dwarf_version_string = get_clang_default_dwarf_version_string(config.host_triple
gdb_version_string = get_gdb_version_string()
if dwarf_version_string and gdb_version_string:
if int(dwarf_version_string) >= 5:
if StrictVersion(gdb_version_string) < StrictVersion('10.1'):
if LooseVersion(gdb_version_string) < LooseVersion('10.1'):
# Example for llgdb-tests, which use lldb on darwin but gdb elsewhere:
# XFAIL: !system-darwin && gdb-clang-incompatibility
config.available_features.add('gdb-clang-incompatibility')
@ -255,3 +257,7 @@ if dwarf_version_string and gdb_version_string:
llvm_config.feature_config(
[('--build-mode', {'Debug|RelWithDebInfo': 'debug-info'})]
)
# Allow 'REQUIRES: XXX-registered-target' in tests.
for arch in config.targets_to_build:
config.available_features.add(arch.lower() + '-registered-target')