20 lines · plain
1; RUN: not opt -S -passes='dxil-post-optimization-validation' -mtriple=dxil-pc-shadermodel6.3-library %s 2>&1 | FileCheck %s2 3; Check overlap error for two resources with identical binding4 5; R overlaps exactly with S6; RWBuffer<float> R : register(u5, space10);7; RWBuffer<float> S : register(u5, space10);8 9; CHECK: error: resource R at register 5 overlaps with resource S at register 5 in space 1010 11@R.str = private unnamed_addr constant [2 x i8] c"R\00", align 112@S.str = private unnamed_addr constant [2 x i8] c"S\00", align 113 14define void @test_overlapping() {15entry:16 %h1 = call target("dx.TypedBuffer", float, 1, 0, 0) @llvm.dx.resource.handlefrombinding(i32 10, i32 5, i32 1, i32 0, ptr @R.str)17 %h2 = call target("dx.TypedBuffer", float, 1, 0, 0) @llvm.dx.resource.handlefrombinding(i32 10, i32 5, i32 1, i32 0, ptr @S.str)18 ret void19}20