blob: 8a7560e0adc15a1c464453e884d1ed9d189524bc [file]
; RUN: not opt -S -passes='dxil-post-optimization-validation' -mtriple=dxil-pc-shadermodel6.3-library %s 2>&1 | FileCheck %s
; CHECK: RWStructuredBuffers may increment or decrement their counters, but not both.
define void @inc_and_dec() {
entry:
%handle = call target("dx.RawBuffer", float, 1, 0) @llvm.dx.resource.handlefromheap(i32 10)
call i32 @llvm.dx.resource.updatecounter(target("dx.RawBuffer", float, 1, 0) %handle, i8 -1)
%handle2 = call target("dx.RawBuffer", float, 1, 0) @llvm.dx.resource.handlefromheap(i32 10)
call i32 @llvm.dx.resource.updatecounter(target("dx.RawBuffer", float, 1, 0) %handle2, i8 1)
ret void
}