summaryrefslogtreecommitdiffstats
path: root/tests/spirv
diff options
context:
space:
mode:
Diffstat (limited to 'tests/spirv')
-rw-r--r--tests/spirv/global-pointer.slang14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/spirv/global-pointer.slang b/tests/spirv/global-pointer.slang
new file mode 100644
index 000000000..e373920eb
--- /dev/null
+++ b/tests/spirv/global-pointer.slang
@@ -0,0 +1,14 @@
+//TEST:SIMPLE(filecheck=CHECK): -target spirv
+
+// CHECK: OpDecorate %g_Instance AliasedPointer
+
+static int* g_Instance = nullptr;
+
+[vk::push_constant] int* dest;
+
+[numthreads(1)]
+void ComputeMain(int tid : SV_DispatchThreadID) {
+ // int* g_Instance = nullptr;
+ if (tid % 2 == 0) g_Instance = dest;
+ if (g_Instance) g_Instance[tid] = 123;
+} \ No newline at end of file