99; CHECK-PRETTY: SRV u32 buf T3 t3,space5 24
1010; CHECK-PRETTY: UAV i32 buf U0 u7,space2 1
1111; CHECK-PRETTY: UAV f32 buf U1 u5,space3 1
12+ ; CHECK-PRETTY: cbuffer NA NA CB0 cb0 1
1213
1314target triple = "dxil-pc-shadermodel6.6-compute"
1415
@@ -63,6 +64,12 @@ define void @test_bindings() {
6364 ; CHECK: [[BUF5:%.*]] = call %dx.types.Handle @dx.op.createHandleFromBinding(i32 217, %dx.types.ResBind { i32 7, i32 -1, i32 0, i8 0 }, i32 %[[IX]], i1 false) #[[#ATTR]]
6465 ; CHECK: call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle [[BUF5]], %dx.types.ResourceProperties { i32 10, i32 1033 }) #[[#ATTR]]
6566
67+ ; cbuffer cb0 : register(b0) { int4 i; float4 f; }
68+ %cb0 = call target ("dx.CBuffer" , target ("dx.Layout" , {<4 x i32 >, <4 x float >}, 32 , 0 , 16 ))
69+ @llvm.dx.resource.handlefrombinding (i32 0 , i32 0 , i32 1 , i32 0 , i1 false )
70+ ; CHECK: [[BUF6:%.*]] = call %dx.types.Handle @dx.op.createHandleFromBinding(i32 217, %dx.types.ResBind { i32 0, i32 0, i32 0, i8 2 }, i32 0, i1 false) #[[#ATTR]]
71+ ; CHECK: call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle [[BUF6]], %dx.types.ResourceProperties { i32 13, i32 32 }) #[[#ATTR]]
72+
6673 ret void
6774}
6875
@@ -72,8 +79,9 @@ define void @test_bindings() {
7279; contents of the metadata are tested elsewhere.
7380;
7481; CHECK: !dx.resources = !{[[RESMD:![0-9]+]]}
75- ; CHECK: [[RESMD]] = !{[[SRVMD:![0-9]+]], [[UAVMD:![0-9]+]], null , null}
82+ ; CHECK: [[RESMD]] = !{[[SRVMD:![0-9]+]], [[UAVMD:![0-9]+]], [[CBUFMD:![0-9]+]] , null}
7683; CHECK-DAG: [[SRVMD]] = !{!{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}}
7784; CHECK-DAG: [[UAVMD]] = !{!{{[0-9]+}}, !{{[0-9]+}}}
85+ ; CHECK-DAG: [[CBUFMD]] = !{!{{[0-9]+}}}
7886
7987attributes #0 = { nocallback nofree nosync nounwind willreturn memory(none) }
0 commit comments