================
@@ -44,7 +44,7 @@ void foo2() {
   // expected-warning@+1 {{'register' attribute only applies to 
cbuffer/tbuffer and external global variables}}
   extern RWBuffer<float> U2 : register(u5);
 }
-// FIXME: expect-error once fix 
https://github.com/llvm/llvm-project/issues/57886.
+// expected-error@+1 {{invalid register name prefix 'u' for 'float' (expected 
't')}}
----------------
bob80905 wrote:

I don't have a prior example to base this off of at hand, but I think I saw 
some hlsl with a builtin type bound to a register and the valid prefix was 't'.
To answer your question, the assignment is represented as a VarDecl, so the 
compiler assumes this resource is a Sampler, UAV, or  SRV. Then the resource 
type is analyzed to see if it's a builtin (float happens to be a builtin).
Then we check the binding prefix to see if it's 't', and if not, emit an error. 
float is a builtin type, and the prefix isn't t, so that's why this test case 
expects 't'.
What prefix should it expect, if any?

https://github.com/llvm/llvm-project/pull/87578
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to