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 resource arrays.4 5; A overlaps with B6; RWBuffer<float> A[10] : register(u0);7; RWBuffer<float> B[10] : register(u5);8 9; CHECK: error: resource A at register 0 overlaps with resource B at register 5 in space 010 11@A.str = private unnamed_addr constant [2 x i8] c"A\00", align 112@B.str = private unnamed_addr constant [2 x i8] c"B\00", align 113 14define void @test_overlapping() {15entry:16 %h1 = call target("dx.TypedBuffer", float, 1, 0, 0) @llvm.dx.resource.handlefrombinding(i32 0, i32 0, i32 10, i32 4, ptr @A.str)17 %h2 = call target("dx.TypedBuffer", float, 1, 0, 0) @llvm.dx.resource.handlefrombinding(i32 0, i32 5, i32 10, i32 4, ptr @B.str)18 ret void19}20