aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/CodeGen/DirectX/Binding/binding-overlap-2.ll
blob: dd50428b4b7a7e3f03d44aa555108441231e3ca0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
; RUN: not opt -S -passes='dxil-post-optimization-validation' -mtriple=dxil-pc-shadermodel6.3-library %s 2>&1 | FileCheck %s

; Check overlap error for two resources with identical binding

; R overlaps exactly with S
; RWBuffer<float> R : register(u5, space10);
; RWBuffer<float> S : register(u5, space10);

; CHECK: error: resource R at register 5 overlaps with resource S at register 5 in space 10

@R.str = private unnamed_addr constant [2 x i8] c"R\00", align 1
@S.str = private unnamed_addr constant [2 x i8] c"S\00", align 1

define void @test_overlapping() {
entry:
  %h1 = call target("dx.TypedBuffer", float, 1, 0, 0) @llvm.dx.resource.handlefrombinding(i32 10, i32 5, i32 1, i32 0, i1 false, ptr @R.str)
  %h2 = call target("dx.TypedBuffer", float, 1, 0, 0) @llvm.dx.resource.handlefrombinding(i32 10, i32 5, i32 1, i32 0, i1 false, ptr @S.str)
  ret void
}