summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-12-09 04:46:09 -0800
committerGitHub <noreply@github.com>2024-12-09 20:46:09 +0800
commit2bec21e91164c8533e93540dc8b610fb24205b7e (patch)
treeadca3721cc12231f0e020ea722ae182cab2a369b /tests
parent2e7774a2bfa0da2c5c57fd28c17b26b3b1c3c064 (diff)
Fix crash on recursive types. (#5796)
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/diagnostics/recursive-type.slang14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/diagnostics/recursive-type.slang b/tests/diagnostics/recursive-type.slang
new file mode 100644
index 000000000..90f49aa86
--- /dev/null
+++ b/tests/diagnostics/recursive-type.slang
@@ -0,0 +1,14 @@
+//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK):-target spirv
+
+// CHECK: error 41001:
+
+struct Outer {
+ Outer next; // non-pointer
+ int y;
+};
+RWStructuredBuffer<Outer> Buf;
+
+[numthreads(1,1,1)]
+void csmain() {
+ Buf[0].y = 0;
+} \ No newline at end of file