[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)
Joshua Batista via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 20 16:40:00 PDT 2024
================
@@ -0,0 +1,76 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify
+
+// This test validates the diagnostics that are emitted when a variable with a "resource" type
+// is bound to a register using the register annotation
+
+// expected-error at +1 {{binding type 'b' only applies to constant buffer resources}}
+RWBuffer<int> a : register(b2, space1);
+
+// expected-error at +1 {{binding type 't' only applies to srv resources}}
+RWBuffer<int> b : register(t2, space1);
+
+// NOT YET IMPLEMENTED : {{invalid register name prefix 'u' for register type 'Texture1D' (expected 't')}}
----------------
bob80905 wrote:
Yes, I've removed a bunch of the not yet implemented cases. Instead of enumerating through all resource kinds, I've just gone and tested binding mismatches for all possible register types in the resource case.
https://github.com/llvm/llvm-project/pull/97103
More information about the cfe-commits
mailing list