llvm-project/clang/test/CodeGenHLSL/resources/RWBuffer-constructor-opt.hlsl
Helena Kotas 3b2a1a5d9b
[HLSL][NFC] Move all resource tests under CodeGenHLSL\resources (#152035)
Also removes an outdated test buffer-array-operator.hlsl. Array operator on resources is tested in StructuredBuffers-subscripts.hlsl and RWBuffer-subscript.hlsl.
2025-08-05 10:05:05 -07:00

16 lines
534 B
HLSL

// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -emit-llvm -O3 -o - %s | FileCheck %s
// RUN: %clang_cc1 -triple spirv-vulkan-compute -x hlsl -emit-llvm -O3 -o - %s | FileCheck %s
// All references to unused resources should be removed by optimizations.
RWBuffer<float> Buf : register(u5, space3);
[shader("compute")]
[numthreads(1, 1, 1)]
void main() {
// CHECK-NOT: resource.handlefrombinding
// CHECK: define void @main()
// CHECK-NEXT: entry:
// CHECK-NEXT: ret void
// CHECK-NOT: resource.handlefrombinding
}