================
@@ -0,0 +1,71 @@
+// 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
+
+/*
+template<typename T>
+struct [[hlsl::resource_class(SRV)]] MyTemplatedSRV {
+  T x;
+};
+
+struct [[hlsl::resource_class(SRV)]] MySRV {
+  int x;
+};
+
+struct [[hlsl::resource_class(Sampler)]] MySampler {
+  int x;
+};
+
+struct [[hlsl::resource_class(UAV)]] MyUAV {
+  int x;
+};
+
+struct [[hlsl::resource_class(CBuffer)]] MyCBuffer {
+  int x;
+};
+*/ 
----------------
damyanp wrote:

Is there a reason for all this commented out stuff here?

I don't think that there are any examples in this file of how we expect these 
to eventually look:

```c++
template<typename T>
struct MyTemplatedSRV {
  __resource_handle_t [[hlsl::resource_class(srv)]] handle;
};
```

See #104861.

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

Reply via email to