Skip to content

DXIL Validator fails to catch reserved OpCode #8144

@tex3d

Description

@tex3d

Description
The DXIL Validator should not allow a reserved DXIL OpCode to be used.

Steps to Reproduce
Try the following validation test that uses a reserved DXIL OpCode. The validator succeeds but should have caught the illegal use of a reserved OpCode.

; RUN: not %dxv %s 2>&1 | FileCheck %s
target datalayout = "e-m:e-p:32:32-i1:32-i8:32-i16:32-i32:32-i64:64-f16:32-f32:32-f64:64-n8:16:32:64"
target triple = "dxil-ms-dx"

define void @main() {
  call void @dx.op.reserved(i32 302)
  ret void
}

; Function Attrs: nounwind
declare void @dx.op.reserved(i32) #0

attributes #0 = { nounwind}

!llvm.ident = !{!0}
!dx.version = !{!1}
!dx.valver = !{!1}
!dx.shaderModel = !{!2}
!dx.resources = !{!3}
!dx.entryPoints = !{!4}

!0 = !{!"hand-crafted"}
!1 = !{i32 1, i32 10}
!2 = !{!"vs", i32 6, i32 10}
!3 = !{null, null, null, null}
!4 = !{void ()* @main, !"main", !5, !3, null}
!5 = !{null, null, null}

Actual Behavior
Validator succeeds, when it should have failed.

Environment

  • DXC version latest
  • Host Operating System any

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug, regression, crash

    Type

    No type

    Projects

    Status

    Triaged

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions