summaryrefslogtreecommitdiffstats
path: root/tests/spirv/pointer-bug-2.slang
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-03-07 23:44:19 -0800
committerGitHub <noreply@github.com>2024-03-07 23:44:19 -0800
commitfaaa532aeda5bb171222134a7128254a34b87a2a (patch)
tree7b421f94aaba96f0efaa665a1ad276a766bb6dd3 /tests/spirv/pointer-bug-2.slang
parenta810aa31f5f366d69e67be96c169fec7d6041df7 (diff)
[SPIRV] Fix pointer lowering bug. (#3713)
* [SPIRV] Fix pointer lowering bug. * Update falcor CI setting.
Diffstat (limited to 'tests/spirv/pointer-bug-2.slang')
-rw-r--r--tests/spirv/pointer-bug-2.slang41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/spirv/pointer-bug-2.slang b/tests/spirv/pointer-bug-2.slang
new file mode 100644
index 000000000..e7729151b
--- /dev/null
+++ b/tests/spirv/pointer-bug-2.slang
@@ -0,0 +1,41 @@
+//TEST:SIMPLE(filecheck=CHECK): -target spirv -emit-spirv-directly -O0
+
+struct Tester0
+{
+ uint i;
+};
+
+struct Tester1
+{
+ Tester0 * tester0;
+};
+
+struct Tester2
+{
+ Tester1* tester1;
+};
+
+struct Tester3
+{
+ uint* i_ptr;
+};
+
+struct Push
+{
+ Tester2 * tester2;
+ Tester3 * tester3;
+};
+
+[[vk::push_constant]] Push push;
+[shader("compute")]
+[numthreads(1, 1, 1)]
+void main(uint3 dtid : SV_DispatchThreadID)
+{
+ Tester3 tester3 = push.tester3[0];
+ if (uint64_t(tester3.i_ptr) != 0)
+ {
+ return;
+ }
+}
+
+// CHECK: OpEntryPoint \ No newline at end of file