Files
clang-p2996/clang/test/CodeGenHLSL/builtins/StructuredBuffers-subscripts.hlsl
Helena Kotas af872d5473 [HLSL] Add RWStructuredBuffer definition to HLSLExternalSemaSource (#113477)
Add tests for RWStructuredBuffer class definition. Use shared test files
for all structured buffers' constructor and subscript tests. Keep AST
and element-type tests separate for each buffer type because they longer
and failures would be harder to match.

Fixes #112775
2024-10-24 10:34:04 -07:00

18 lines
560 B
HLSL

// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -emit-llvm -o - -O0 %s | FileCheck %s
StructuredBuffer<int> In;
RWStructuredBuffer<int> Out;
[numthreads(1,1,1)]
void main(unsigned GI : SV_GroupIndex) {
Out[GI] = In[GI];
}
// Even at -O0 the subscript operators get inlined. The -O0 IR is a bit messy
// and confusing to follow so the match here is pretty weak.
// CHECK: define void @main()
// Verify inlining leaves only calls to "llvm." intrinsics
// CHECK-NOT: call {{[^@]*}} @{{[^l][^l][^v][^m][^\.]}}
// CHECK: ret void