|  | 
|  | 1 | +; REQUIRES: dxil-1-8 | 
|  | 2 | +; RUN: not %dxv %s 2>&1 | FileCheck %s | 
|  | 3 | + | 
|  | 4 | +; Buffer Definitions: | 
|  | 5 | +; | 
|  | 6 | +; | 
|  | 7 | +; Resource Bindings: | 
|  | 8 | +; | 
|  | 9 | +; Name                                 Type  Format         Dim      ID      HLSL Bind  Count | 
|  | 10 | +; ------------------------------ ---------- ------- ----------- ------- -------------- ------ | 
|  | 11 | +; BAB                                   UAV    byte         r/w      U0             u1     1 | 
|  | 12 | +; | 
|  | 13 | +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" | 
|  | 14 | +target triple = "dxil-ms-dx" | 
|  | 15 | + | 
|  | 16 | +%dx.types.Handle = type { i8* } | 
|  | 17 | +%dx.types.ResourceProperties = type { i32, i32 } | 
|  | 18 | +%struct.RWByteAddressBuffer = type { i32 } | 
|  | 19 | + | 
|  | 20 | +@"\01?BAB@@3URWByteAddressBuffer@@A" = external constant %dx.types.Handle, align 4 | 
|  | 21 | + | 
|  | 22 | +; CHECK: Function: ?main@@YAXXZ: error: Invalid semantic flags on DXIL operation 'BarrierByMemoryType' | 
|  | 23 | +; CHECK-NEXT: note: at 'call void @dx.op.barrierByMemoryType(i32 244, i32 1, i32 8)' in block '#0' of function '?main@@YAXXZ'. | 
|  | 24 | +; CHECK-NEXT: Function: ?main@@YAXXZ: error: Invalid semantic flags on DXIL operation 'barrierByMemoryHandle' | 
|  | 25 | +; CHECK-NEXT: note: at 'call void @dx.op.barrierByMemoryHandle(i32 245, %dx.types.Handle %3, i32 8)' in block '#0' of function '?main@@YAXXZ'. | 
|  | 26 | +; CHECK-NEXT: Function: ?main@@YAXXZ: error: Entry function performs some operation that is incompatible with the shader stage or other entry properties.  See other errors for details. | 
|  | 27 | +; CHECK-NEXT: Function: ?main@@YAXXZ: error: Function uses features incompatible with the shader model. | 
|  | 28 | +; CHECK-NEXT: Validation failed. | 
|  | 29 | + | 
|  | 30 | +; Function Attrs: nounwind | 
|  | 31 | +define void @"\01?main@@YAXXZ"() #0 { | 
|  | 32 | +  %1 = load %dx.types.Handle, %dx.types.Handle* @"\01?BAB@@3URWByteAddressBuffer@@A", align 4 | 
|  | 33 | +  call void @dx.op.barrierByMemoryType(i32 244, i32 1, i32 8)  ; BarrierByMemoryType(MemoryTypeFlags,SemanticFlags) | 
|  | 34 | +  %2 = call %dx.types.Handle @dx.op.createHandleForLib.dx.types.Handle(i32 160, %dx.types.Handle %1)  ; CreateHandleForLib(Resource) | 
|  | 35 | +  %3 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %2, %dx.types.ResourceProperties { i32 4107, i32 0 })  ; AnnotateHandle(res,props)  resource: RWByteAddressBuffer | 
|  | 36 | +  call void @dx.op.barrierByMemoryHandle(i32 245, %dx.types.Handle %3, i32 8)  ; BarrierByMemoryHandle(object,SemanticFlags) | 
|  | 37 | +  ret void | 
|  | 38 | +} | 
|  | 39 | + | 
|  | 40 | +; Function Attrs: noduplicate nounwind | 
|  | 41 | +declare void @dx.op.barrierByMemoryType(i32, i32, i32) #1 | 
|  | 42 | + | 
|  | 43 | +; Function Attrs: noduplicate nounwind | 
|  | 44 | +declare void @dx.op.barrierByMemoryHandle(i32, %dx.types.Handle, i32) #1 | 
|  | 45 | + | 
|  | 46 | +; Function Attrs: nounwind readnone | 
|  | 47 | +declare %dx.types.Handle @dx.op.annotateHandle(i32, %dx.types.Handle, %dx.types.ResourceProperties) #2 | 
|  | 48 | + | 
|  | 49 | +; Function Attrs: nounwind readonly | 
|  | 50 | +declare %dx.types.Handle @dx.op.createHandleForLib.dx.types.Handle(i32, %dx.types.Handle) #3 | 
|  | 51 | + | 
|  | 52 | +attributes #0 = { nounwind } | 
|  | 53 | +attributes #1 = { noduplicate nounwind } | 
|  | 54 | +attributes #2 = { nounwind readnone } | 
|  | 55 | +attributes #3 = { nounwind readonly } | 
|  | 56 | + | 
|  | 57 | +!dx.version = !{!0} | 
|  | 58 | +!dx.valver = !{!0} | 
|  | 59 | +!dx.shaderModel = !{!1} | 
|  | 60 | +!dx.resources = !{!2} | 
|  | 61 | +!dx.typeAnnotations = !{!5} | 
|  | 62 | +!dx.entryPoints = !{!9, !11} | 
|  | 63 | + | 
|  | 64 | +!0 = !{i32 1, i32 8} | 
|  | 65 | +!1 = !{!"lib", i32 6, i32 8} | 
|  | 66 | +!2 = !{null, !3, null, null} | 
|  | 67 | +!3 = !{!4} | 
|  | 68 | +!4 = !{i32 0, %struct.RWByteAddressBuffer* bitcast (%dx.types.Handle* @"\01?BAB@@3URWByteAddressBuffer@@A" to %struct.RWByteAddressBuffer*), !"BAB", i32 0, i32 1, i32 1, i32 11, i1 false, i1 false, i1 false, null} | 
|  | 69 | +!5 = !{i32 1, void ()* @"\01?main@@YAXXZ", !6} | 
|  | 70 | +!6 = !{!7} | 
|  | 71 | +!7 = !{i32 1, !8, !8} | 
|  | 72 | +!8 = !{} | 
|  | 73 | +!9 = !{null, !"", null, !2, !10} | 
|  | 74 | +!10 = !{i32 0, i64 8589934608} | 
|  | 75 | +!11 = !{void ()* @"\01?main@@YAXXZ", !"\01?main@@YAXXZ", null, null, !12} | 
|  | 76 | +!12 = !{i32 8, i32 7, i32 5, !13} | 
|  | 77 | +!13 = !{i32 0} | 
0 commit comments