summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-03-18 17:21:48 -0700
committerGitHub <noreply@github.com>2024-03-18 17:21:48 -0700
commit26e25f6e73a9808ad93c98ad34907e3a27b6726c (patch)
treee9d8d024bf927bd0f8e1ed5f7c5fcbfb9c3bd21c /tests
parentf96a3fea6704da866e96e453f722a951c214ba28 (diff)
Check for cylic types. (#3790)
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs/cyclic-type.slang21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/bugs/cyclic-type.slang b/tests/bugs/cyclic-type.slang
new file mode 100644
index 000000000..49591fbe6
--- /dev/null
+++ b/tests/bugs/cyclic-type.slang
@@ -0,0 +1,21 @@
+
+//TEST:SIMPLE(filecheck=CHECK):-target spirv -emit-spirv-directly
+
+// CHECK: error 41001:
+
+struct TA
+{
+ TB tb;
+}
+
+struct TB
+{
+ TA ta[2];
+}
+
+[numthreads(1,1,1)]
+void main()
+{
+ TA ta;
+ ta.tb.ta[0] = ta;
+} \ No newline at end of file