Skip to content

Commit 642cb58

Browse files
authored
Enable isinf.16.test with metal shader converter 3 (#230)
The Metal Shader Converter 3 beta released today fixes this test. This change marks it as unsupported on Metal with older versions of the shader converter.
1 parent 904291f commit 642cb58

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

test/Feature/HLSLLib/isinf.16.test

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ DescriptorSets:
5858
# llvm/llvm-project#141089
5959
# XFAIL: Clang-Vulkan
6060
# issue with 16 bit ops; no hlk tests
61-
# XFAIL: Clang-Metal
61+
62+
# A bug in the Metal Shader Converter caused it to mis-translate this operation.
63+
# Version 3 fixes this issue.
64+
# UNSUPPORTED: Clang-Metal && !metal-shaderconverter-3.0.0-or-later
6265

6366
# REQUIRES: Half
6467
# RUN: split-file %s %t

test/lit.cfg.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,18 @@ def setDeviceFeatures(config, device, compiler):
9898
ExtraCompilerArgs = ["-spirv", "-fspv-target-env=vulkan1.3"]
9999
if config.offloadtest_enable_metal:
100100
ExtraCompilerArgs = ["-metal"]
101+
# metal-irconverter version: 3.0.0
102+
MSCVersionOutput = subprocess.check_output(
103+
["metal-shaderconverter", "--version"]
104+
).decode("UTF-8")
105+
VersionRegex = re.compile("metal-irconverter version: ([0-9]+)\.([0-9]+)\.([0-9]+)")
106+
VersionMatch = VersionRegex.match(MSCVersionOutput)
107+
if VersionMatch:
108+
FullVersion = ".".join(VersionMatch.groups()[0:3])
109+
config.available_features.add("metal-shaderconverter-%s" % FullVersion)
110+
MajorVersion = int(VersionMatch.group(1))
111+
for I in range(1, MajorVersion + 1):
112+
config.available_features.add("metal-shaderconverter-%s.0.0-or-later" % I)
101113

102114
HLSLCompiler = ""
103115
if config.offloadtest_test_clang:

0 commit comments

Comments
 (0)