================
@@ -0,0 +1,41 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-compute -emit-llvm 
-disable-llvm-passes -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-compute -emit-llvm 
-disable-llvm-passes -o - -DCHECK2 %s | FileCheck %s -check-prefix=CHECK2
+
+// Regression test for issue llvm/llvm-project#183788
+
+// empty struct
+struct A {
+};
+
+// struct with a resource which does not contribute to cbuffer layout
+struct B {
+    RWBuffer<float> Buf;
+};
+
+cbuffer CB {
+  A a[2];
+#ifdef CHECK2
+  int i;
+#endif
+}
+
+B b[2][2];
+#ifdef CHECK2
+int j;
+#endif
+
+[numthreads(4,4,4)]
+void main() {
+}
+
+// CHECK-NOT: @CB.cb = global target("dx.CBuffer", %__cblayout_CB)
----------------
bob80905 wrote:

Is there anything here we can run CHECK against? If nothing makes sense, that's 
fine.

https://github.com/llvm/llvm-project/pull/184276
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to