|
| 1 | +; REQUIRES: dxil-1-8 |
| 2 | +; RUN: not %dxv %s 2>&1 | FileCheck %s |
| 3 | + |
| 4 | +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" |
| 5 | +target triple = "dxil-ms-dx" |
| 6 | + |
| 7 | +%dx.types.Handle = type { i8* } |
| 8 | +%dx.types.ResBind = type { i32, i32, i32, i8 } |
| 9 | +%dx.types.ResourceProperties = type { i32, i32 } |
| 10 | +%dx.types.ResRet.f32 = type { float, float, float, float, i32 } |
| 11 | +%"class.Texture2D<float>" = type { float, %"class.Texture2D<float>::mips_type" } |
| 12 | +%"class.Texture2D<float>::mips_type" = type { i32 } |
| 13 | +%struct.SamplerComparisonState = type { i32 } |
| 14 | + |
| 15 | + |
| 16 | +define void @main() { |
| 17 | + %1 = call %dx.types.Handle @dx.op.createHandleFromBinding(i32 217, %dx.types.ResBind zeroinitializer, i32 0, i1 false) ; CreateHandleFromBinding(bind,index,nonUniformIndex) |
| 18 | + %2 = call %dx.types.Handle @dx.op.createHandleFromBinding(i32 217, %dx.types.ResBind { i32 0, i32 0, i32 0, i8 3 }, i32 0, i1 false) ; CreateHandleFromBinding(bind,index,nonUniformIndex) |
| 19 | + |
| 20 | + |
| 21 | +; CHECK: error: 'dx.op.loadInput.f32' is not a DXILOpFuncition for DXILOpcode 'LoadInput'. |
| 22 | +; CHECK: note: at '%3 = call float @dx.op.loadInput.f32(i32 4, i32 0, i32 0, i8 0)' in block '#0' of function 'main'. |
| 23 | + |
| 24 | + %3 = call float @dx.op.loadInput.f32(i32 4, i32 0, i32 0, i8 0) ; LoadInput(inputSigId,rowIndex,colIndex,gsVertexAxis) |
| 25 | + |
| 26 | +; CHECK: error: 'dx.op.loadInput.f32' is not a DXILOpFuncition for DXILOpcode 'LoadInput'. |
| 27 | +; CHECK: note: at '%4 = call float @dx.op.loadInput.f32(i32 4, i32 0, i32 0, i8 1)' in block '#0' of function 'main'. |
| 28 | + |
| 29 | + %4 = call float @dx.op.loadInput.f32(i32 4, i32 0, i32 0, i8 1) ; LoadInput(inputSigId,rowIndex,colIndex,gsVertexAxis) |
| 30 | + |
| 31 | + |
| 32 | +; CHECK: error: 'dx.op.annotateHandle' is not a DXILOpFuncition for DXILOpcode 'MinPrecXRegStore'. |
| 33 | +; CHECK: note: at '%5 = call %dx.types.Handle @dx.op.annotateHandle(i32 3, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 2, i32 265 })' in block '#0' of function 'main'. |
| 34 | + |
| 35 | + %5 = call %dx.types.Handle @dx.op.annotateHandle(i32 3, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 2, i32 265 }) ; AnnotateHandle(res,props) resource: Texture2D<F32> |
| 36 | + |
| 37 | +; CHECK: error: 'dx.op.annotateHandle2' is not a DXILOpFuncition for DXILOpcode 'AnnotateHandle'. |
| 38 | +; CHECK: note: at '%6 = call %dx.types.Handle @dx.op.annotateHandle2(i32 216, %dx.types.Handle %2, %dx.types.ResourceProperties { i32 32782, i32 0 })' in block '#0' of function 'main'. |
| 39 | + |
| 40 | + %6 = call %dx.types.Handle @dx.op.annotateHandle2(i32 216, %dx.types.Handle %2, %dx.types.ResourceProperties { i32 32782, i32 0 }) ; AnnotateHandle(res,props) resource: SamplerComparisonState |
| 41 | + |
| 42 | +; CHECK: error: DXILOpCode must be [0..258]. 1999981 specified. |
| 43 | +; CHECK: note: at '%7 = call float @dx.op.calculateLOD.f32(i32 1999981, %dx.types.Handle %5, %dx.types.Handle %6, float %3, float %4, float undef, i1 true)' in block '#0' of function 'main'. |
| 44 | + |
| 45 | + %7 = call float @dx.op.calculateLOD.f32(i32 1999981, %dx.types.Handle %5, %dx.types.Handle %6, float %3, float %4, float undef, i1 true) ; CalculateLOD(handle,sampler,coord0,coord1,coord2,clamped) |
| 46 | + |
| 47 | + %I = call i32 @dx.op.loadInput.i32(i32 4, i32 0, i32 0, i8 0, i32 undef) ; LoadInput(inputSigId,rowIndex,colIndex,gsVertexAxis) |
| 48 | + |
| 49 | +; CHECK: error: Opcode of DXIL operation must be an immediate constant. |
| 50 | +; CHECK: note: at 'call void @dx.op.storeOutput.f32(i32 %I, i32 0, i32 0, i8 0, float %7)' in block '#0' of function 'main'. |
| 51 | + call void @dx.op.storeOutput.f32(i32 %I, i32 0, i32 0, i8 0, float %7) ; StoreOutput(outputSigId,rowIndex,colIndex,value) |
| 52 | + |
| 53 | + |
| 54 | +; CHECK-DAG: error: Opcode SampleCmpBias not valid in shader model ps_6_7. |
| 55 | + %CmpBias = call %dx.types.ResRet.f32 @dx.op.sampleCmpBias.f32(i32 255, %dx.types.Handle %5, %dx.types.Handle %6, float %3, float %4, float undef, float undef, i32 0, i32 0, i32 undef, float 5.000000e-01, float 5.000000e-01, float undef) ; SampleCmpBias(srv,sampler,coord0,coord1,coord2,coord3,offset0,offset1,offset2,compareValue,bias,clamp) |
| 56 | + |
| 57 | + ret void |
| 58 | +} |
| 59 | + |
| 60 | + |
| 61 | +; CHECK-DAG: error: DXIL intrinsic overload must be valid. |
| 62 | +; CHECK-DAG: note: at '%4 = call float @dx.op.loadInput.f32(i32 4, i32 0, i32 0, i8 1)' in block '#0' of function 'main'. |
| 63 | +; CHECK-DAG: error: DXIL intrinsic overload must be valid. |
| 64 | +; CHECK-DAG: note: at '%3 = call float @dx.op.loadInput.f32(i32 4, i32 0, i32 0, i8 0)' in block '#0' of function 'main'. |
| 65 | +; CHECK-DAG: error: DXIL intrinsic overload must be valid. |
| 66 | +; CHECK-DAG: note: at '%5 = call %dx.types.Handle @dx.op.annotateHandle(i32 3, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 2, i32 265 })' in block '#0' of function 'main'. |
| 67 | + |
| 68 | +; Function Attrs: nounwind readnone |
| 69 | +declare float @dx.op.loadInput.f32(i32, i32, i32, i8) #0 |
| 70 | + |
| 71 | +; Function Attrs: nounwind |
| 72 | +declare void @dx.op.storeOutput.f32(i32, i32, i32, i8, float) #1 |
| 73 | + |
| 74 | +; Function Attrs: nounwind readonly |
| 75 | +declare float @dx.op.calculateLOD.f32(i32, %dx.types.Handle, %dx.types.Handle, float, float, float, i1) #2 |
| 76 | + |
| 77 | +; Function Attrs: nounwind readnone |
| 78 | +declare %dx.types.Handle @dx.op.annotateHandle(i32, %dx.types.Handle, %dx.types.ResourceProperties) #0 |
| 79 | + |
| 80 | +declare %dx.types.Handle @dx.op.annotateHandle2(i32, %dx.types.Handle, %dx.types.ResourceProperties) #0 |
| 81 | + |
| 82 | +; Function Attrs: nounwind readnone |
| 83 | +declare %dx.types.Handle @dx.op.createHandleFromBinding(i32, %dx.types.ResBind, i32, i1) #0 |
| 84 | + |
| 85 | +declare i32 @dx.op.loadInput.i32(i32, i32, i32, i8, i32) #0 |
| 86 | + |
| 87 | +; Function Attrs: nounwind readonly |
| 88 | +declare %dx.types.ResRet.f32 @dx.op.sampleCmpBias.f32(i32, %dx.types.Handle, %dx.types.Handle, float, float, float, float, i32, i32, i32, float, float, float) #2 |
| 89 | + |
| 90 | +attributes #0 = { nounwind readnone } |
| 91 | +attributes #1 = { nounwind } |
| 92 | +attributes #2 = { nounwind readonly } |
| 93 | + |
| 94 | +!llvm.ident = !{!0} |
| 95 | +!dx.version = !{!1} |
| 96 | +!dx.valver = !{!1} |
| 97 | +!dx.shaderModel = !{!2} |
| 98 | +!dx.resources = !{!3} |
| 99 | +!dx.viewIdState = !{!9} |
| 100 | +!dx.entryPoints = !{!10} |
| 101 | + |
| 102 | +!0 = !{!"dxc(private) 1.7.0.4396 (test_time, 849f8b884-dirty)"} |
| 103 | +!1 = !{i32 1, i32 7} |
| 104 | +!2 = !{!"ps", i32 6, i32 7} |
| 105 | +!3 = !{!4, null, null, !7} |
| 106 | +!4 = !{!5} |
| 107 | +!5 = !{i32 0, %"class.Texture2D<float>"* undef, !"", i32 0, i32 0, i32 1, i32 2, i32 0, !6} |
| 108 | +!6 = !{i32 0, i32 9} |
| 109 | +!7 = !{!8} |
| 110 | +!8 = !{i32 0, %struct.SamplerComparisonState* undef, !"", i32 0, i32 0, i32 1, i32 1, null} |
| 111 | +!9 = !{[4 x i32] [i32 2, i32 1, i32 1, i32 1]} |
| 112 | +!10 = !{void ()* @main, !"main", !11, !3, null} |
| 113 | +!11 = !{!12, !16, null} |
| 114 | +!12 = !{!13} |
| 115 | +!13 = !{i32 0, !"A", i8 9, i8 0, !14, i8 2, i32 1, i8 2, i32 0, i8 0, !15} |
| 116 | +!14 = !{i32 0} |
| 117 | +!15 = !{i32 3, i32 3} |
| 118 | +!16 = !{!17} |
| 119 | +!17 = !{i32 0, !"SV_Target", i8 9, i8 16, !14, i8 0, i32 1, i8 1, i32 0, i8 0, !18} |
| 120 | +!18 = !{i32 3, i32 1} |
0 commit comments