[clang] [HLSL][SPIR-V] Fix clang driver lang target test (PR #70330)

Natalie Chouinard via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 26 06:41:18 PDT 2023


https://github.com/sudonatalie created https://github.com/llvm/llvm-project/pull/70330

This test has been failing since the SPIR-V backend started failing explicitly on unsupported shader types. Switched this test to a compute shader since it is currently the only type supported.

>From 4738a535e24114ce24647f0935b1cec897bf0a1b Mon Sep 17 00:00:00 2001
From: Natalie Chouinard <chouinard at google.com>
Date: Thu, 26 Oct 2023 13:21:23 +0000
Subject: [PATCH] [HLSL][SPIR-V] Fix clang driver lang target test

This test has been failing since the SPIR-V backend started failing
explicitly on unsupported shader types. Switched this test to a compute
shader since it is currently the only type supported.
---
 clang/test/Driver/hlsl-lang-targets-spirv.hlsl | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/clang/test/Driver/hlsl-lang-targets-spirv.hlsl b/clang/test/Driver/hlsl-lang-targets-spirv.hlsl
index ff29f143ba1dc8e..e04d71263770bbb 100644
--- a/clang/test/Driver/hlsl-lang-targets-spirv.hlsl
+++ b/clang/test/Driver/hlsl-lang-targets-spirv.hlsl
@@ -2,8 +2,8 @@
 
 // Supported targets
 //
-// RUN: %clang -target dxil-unknown-shadermodel6.2-pixel %s -S -o /dev/null 2>&1 | FileCheck --check-prefix=CHECK-VALID %s
-// RUN: %clang -target spirv-unknown-shadermodel6.2-library %s -S -o /dev/null 2>&1 | FileCheck --check-prefix=CHECK-VALID %s
+// RUN: %clang -target dxil-unknown-shadermodel6.2-compute %s -S -o /dev/null 2>&1 | FileCheck --allow-empty --check-prefix=CHECK-VALID %s
+// RUN: %clang -target spirv-unknown-shadermodel6.2-compute %s -S -o /dev/null 2>&1 | FileCheck --allow-empty --check-prefix=CHECK-VALID %s
 
 // Empty shader model
 //
@@ -27,5 +27,5 @@
 // CHECK-NO-ENV: error: shader stage is required in target '{{.*}}' for HLSL code generation
 // CHECK-BAD-ENV: error: shader stage '{{.*}}' in target '{{.*}}' is invalid for HLSL code generation
 
-[shader("pixel")]
+[shader("compute"), numthreads(1,1,1)]
 void main() {}



More information about the cfe-commits mailing list