[SPIRV][NFC] Update SPV_INTEL_function_pointers tests to check spirv-val output (#182549)

https://github.com/KhronosGroup/SPIRV-Tools/pull/6232 added support for
`SPV_INTEL_function_pointers` on `spirv-val`.

This PR updates some relevant tests to run `spirv-val` and document why
some others are failing.
This commit is contained in:
Juan Manuel Martinez Caamaño 2026-03-20 13:16:36 -03:00 committed by GitHub
parent 93d7583f4f
commit bb070ea56b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 27 additions and 9 deletions

View File

@ -1,5 +1,9 @@
; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown --spirv-ext=+SPV_INTEL_function_pointers %s -o - | FileCheck %s
; TODO: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}
; Fails with:
; Expected input to have storage class Workgroup, CrossWorkgroup or Function: SpecConstantOp
; %51 = OpSpecConstantOp %_ptr_Generic_uchar PtrCastToGeneric %50
; Likely a limitation from spirv-val
; TODO: %if spirv-tools %{ llc -O0 -mtriple=spirv32-unknown-unknown --spirv-ext=+SPV_INTEL_function_pointers %s -o - -filetype=obj | spirv-val %}
; CHECK-DAG: OpName %[[I9:.*]] "_ZN13BaseIncrement9incrementEPi"
; CHECK-DAG: OpName %[[I29:.*]] "_ZN12IncrementBy29incrementEPi"

View File

@ -1,5 +1,9 @@
; RUN: llc -verify-machineinstrs -O0 --spirv-ext=+SPV_INTEL_function_pointers %s -o - | FileCheck %s
; TODO: %if spirv-tools %{ llc -O0 %s -o - -filetype=obj | spirv-val %}
; The backend is generating an invalid comparison. Issue https://github.com/llvm/llvm-project/issues/185409
; Fails with:
; The types of Operand 1 and Operand 2 must match
; %15 = OpPtrEqual %bool %12 %arg
; TODO: %if spirv-tools %{ llc -O0 --spirv-ext=+SPV_INTEL_function_pointers %s -o - -filetype=obj | spirv-val %}
; CHECK-DAG: OpCapability FunctionPointersINTEL
; CHECK: OpExtension "SPV_INTEL_function_pointers"

View File

@ -1,5 +1,5 @@
; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown --spirv-ext=+SPV_INTEL_function_pointers %s -o - | FileCheck %s
; TODO: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown --spirv-ext=+SPV_INTEL_function_pointers %s -o - -filetype=obj | spirv-val %}
; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv32-unknown-unknown --spirv-ext=+SPV_INTEL_function_pointers %s -o - -filetype=obj | spirv-val %}
; CHECK-DAG: OpCapability FunctionPointersINTEL
; CHECK-DAG: OpCapability Int64

View File

@ -1,5 +1,8 @@
; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown --spirv-ext=+SPV_INTEL_function_pointers %s -o - | FileCheck %s
; TODO: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}
; The backend seems to be generating invalid code. Fails with:
; OpConstantComposite Constituent <id> '18[%18]' type does not match the Result Type <id> '14[%struct_ident_t]'s member type
; Issue https://github.com/llvm/llvm-project/issues/185412
; TODO: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown --spirv-ext=+SPV_INTEL_function_pointers %s -o - -filetype=obj | spirv-val %}
; This test verifies that indirect calls with functions lacking return statements
; are don't cause an error.

View File

@ -1,5 +1,5 @@
; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown --spirv-ext=+SPV_INTEL_function_pointers %s -o - | FileCheck %s
; TODO: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}
; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown --spirv-ext=+SPV_INTEL_function_pointers %s -o - -filetype=obj | spirv-val %}
; CHECK-DAG: OpCapability Int8
; CHECK-DAG: OpCapability FunctionPointersINTEL

View File

@ -3,7 +3,10 @@
; work also for function pointers.
; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown %s -o - --spirv-ext=+SPV_INTEL_function_pointers | FileCheck %s
; TODO: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}
; Fails with:
; Invalid use of function type result id '7[%7]'.
; %_ptr_Generic_7 = OpTypePointer Generic %7
; TODO: %if spirv-tools %{ llc -O0 -mtriple=spirv32-unknown-unknown %s -o - -filetype=obj --spirv-ext=+SPV_INTEL_function_pointers | spirv-val %}
; CHECK-COUNT-3: %[[#]] = OpSpecConstantOp %[[#]] PtrCastToGeneric %[[#]]
; CHECK-COUNT-3: OpPtrCastToGeneric

View File

@ -1,5 +1,5 @@
; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown --spirv-ext=+SPV_INTEL_function_pointers %s -o - | FileCheck --implicit-check-not=entry %s
; TODO: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown --spirv-ext=+SPV_INTEL_function_pointers %s -o - -filetype=obj | spirv-val %}
; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown --spirv-ext=+SPV_INTEL_function_pointers %s -o - -filetype=obj | spirv-val %}
declare spir_func i32 @_Z12get_local_idj(i32)

View File

@ -1,6 +1,7 @@
; RUN: llc -mtriple=spirv32-unknown-unknown -O0 %s -o - --spirv-ext=+SPV_INTEL_function_pointers | FileCheck %s
; This still fails validation, because %foo is considered undefined.
; Fails with:
; `Expected input to have storage class Workgroup, CrossWorkgroup or Function: PtrCastToGeneric`
; Seem like a spirv-val limitation.
; TODO: %if spirv-tools %{ llc -O0 -mtriple=spirv32-unknown-unknown %s -o - --spirv-ext=+SPV_INTEL_function_pointers -filetype=obj | spirv-val %}
; CHECK-DAG: OpCapability FunctionPointersINTEL

View File

@ -1,4 +1,7 @@
; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown --spirv-ext=+SPV_INTEL_function_pointers %s -o - | FileCheck %s
; Fails with:
; OpConstantComposite must not have spec constant operands: <id> '37[%37]'
; Likely same issue as https://github.com/llvm/llvm-project/issues/186756
; TODO: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown --spirv-ext=+SPV_INTEL_function_pointers %s -o - -filetype=obj | spirv-val %}
; CHECK: OpCapability Kernel