|
| 1 | +; REQUIRES: dxil-1-9 |
| 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.HitObject = type { i8* } |
| 8 | + |
| 9 | +; CHECK: Function: ?main@@YAXXZ: error: Use of undef coherence hint or num coherence hint bits in MaybeReorderThread. |
| 10 | +; CHECK-NEXT: note: at 'call void @dx.op.maybeReorderThread(i32 268, %dx.types.HitObject %nop, i32 1, i32 undef)' |
| 11 | + |
| 12 | +; CHECK: Function: ?main@@YAXXZ: error: Use of undef coherence hint or num coherence hint bits in MaybeReorderThread. |
| 13 | +; CHECK-NEXT: note: at 'call void @dx.op.maybeReorderThread(i32 268, %dx.types.HitObject %nop, i32 undef, i32 1)' |
| 14 | + |
| 15 | +; CHECK: Function: ?main@@YAXXZ: error: HitObject is undef. |
| 16 | +; CHECK-NEXT: note: at 'call void @dx.op.maybeReorderThread(i32 268, %dx.types.HitObject undef, i32 11, i32 0)' |
| 17 | + |
| 18 | +; CHECK: Validation failed. |
| 19 | + |
| 20 | +; Function Attrs: nounwind |
| 21 | +define void @"\01?main@@YAXXZ"() #0 { |
| 22 | + %nop = call %dx.types.HitObject @dx.op.hitObject_MakeNop(i32 266) ; HitObject_MakeNop() |
| 23 | + |
| 24 | + ; Validate that hit object is not undef. |
| 25 | + call void @dx.op.maybeReorderThread(i32 268, %dx.types.HitObject undef, i32 11, i32 0) ; MaybeReorderThread(hitObject,coherenceHint,numCoherenceHintBitsFromLSB) |
| 26 | + |
| 27 | + ; Validate that coherence hint is not undef while numCoherenceHintBitsFromLSB is not 0. |
| 28 | + call void @dx.op.maybeReorderThread(i32 268, %dx.types.HitObject %nop, i32 undef, i32 1) ; MaybeReorderThread(hitObject,coherenceHint,numCoherenceHintBitsFromLSB) |
| 29 | + |
| 30 | + ; Validate that num coherence hint bits from LSB is not undef. |
| 31 | + call void @dx.op.maybeReorderThread(i32 268, %dx.types.HitObject %nop, i32 1, i32 undef) ; MaybeReorderThread(hitObject,coherenceHint,numCoherenceHintBitsFromLSB) |
| 32 | + ret void |
| 33 | +} |
| 34 | + |
| 35 | +; Function Attrs: nounwind readnone |
| 36 | +declare %dx.types.HitObject @dx.op.hitObject_MakeNop(i32) #1 |
| 37 | + |
| 38 | +; Function Attrs: nounwind |
| 39 | +declare void @dx.op.maybeReorderThread(i32, %dx.types.HitObject, i32, i32) #0 |
| 40 | + |
| 41 | +attributes #0 = { nounwind } |
| 42 | +attributes #1 = { nounwind readnone } |
| 43 | + |
| 44 | +!dx.version = !{!0} |
| 45 | +!dx.valver = !{!0} |
| 46 | +!dx.shaderModel = !{!1} |
| 47 | +!dx.typeAnnotations = !{!2} |
| 48 | +!dx.entryPoints = !{!6, !8} |
| 49 | + |
| 50 | +!0 = !{i32 1, i32 9} |
| 51 | +!1 = !{!"lib", i32 6, i32 9} |
| 52 | +!2 = !{i32 1, void ()* @"\01?main@@YAXXZ", !3} |
| 53 | +!3 = !{!4} |
| 54 | +!4 = !{i32 1, !5, !5} |
| 55 | +!5 = !{} |
| 56 | +!6 = !{null, !"", null, null, !7} |
| 57 | +!7 = !{i32 0, i64 0} |
| 58 | +!8 = !{void ()* @"\01?main@@YAXXZ", !"\01?main@@YAXXZ", null, null, !9} |
| 59 | +!9 = !{i32 8, i32 7, i32 5, !10} |
| 60 | +!10 = !{i32 0} |
0 commit comments