[clang] [HLSL] Correct SPIRV CHECKs in derivative tests (PR #176609)

Gregory Roth via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 17 15:21:05 PST 2026


================
@@ -1,26 +1,20 @@
 // RUN: %clang_cc1 -finclude-default-header  -x hlsl  -triple dxil-pc-shadermodel6.3-library %s \
 // RUN:  -emit-llvm -disable-llvm-passes -fnative-half-type -o - | \
-// RUN:  FileCheck %s --check-prefixes=CHECK
+// RUN:  FileCheck %s -DTGT=dx
 // RUN: %clang_cc1 -finclude-default-header  -x hlsl  -triple spirv-pc-vulkan-compute  %s \
 // RUN:  -emit-llvm -disable-llvm-passes -fnative-half-type -o - | \
-// RUN:  FileCheck %s --check-prefixes=CHECK-SPIRV
+// RUN:  FileCheck %s -DTGT=spv
 
 // CHECK-LABEL: half @_Z19test_f16_ddx_coarseDh
-// CHECK: %hlsl.ddx.coarse = call {{.*}} half @llvm.dx.ddx.coarse.f16(half %{{.*}})
+// CHECK: %hlsl.ddx.coarse = call {{.*}} half @llvm.[[TGT]].ddx.coarse.f16(half %{{.*}})
 // CHECK: ret half %hlsl.ddx.coarse
-// CHECK-LABEL-SPIRV: half @_Z19test_f16_ddx_coarseDh
----------------
pow2clk wrote:

For reference, this was the problem. The prefix was set to CHECK-SPIRV, for which you'd need to append -LABEL to make it a LABEL check. By infixing LABEL instead, FileCheck doesn't recognize this and the comment has no effect. I chose to refactor the approach since the checks differed so little anyway.

https://github.com/llvm/llvm-project/pull/176609


More information about the cfe-commits mailing list