llvm-project/clang/test/CodeGenHLSL/builtins/StructuredBuffer-subscript.hlsl
Thurston Dang 4a0bf8377e Reapply "[HLSL] update StructuredBuffer subscript test for alwaysinline (#109023)"
This reverts commit da03d17698f205fe8ebc54c32994c8ce2c51a81e.

I mistakenly reverted this fix-forward.
2024-09-17 22:54:04 +00:00

18 lines
558 B
HLSL

// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -emit-llvm -o - -O0 %s | FileCheck %s
StructuredBuffer<int> In;
StructuredBuffer<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