summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/language-feature/interfaces/pointer-marshalling-no-int64.slang61
1 files changed, 61 insertions, 0 deletions
diff --git a/tests/language-feature/interfaces/pointer-marshalling-no-int64.slang b/tests/language-feature/interfaces/pointer-marshalling-no-int64.slang
new file mode 100644
index 000000000..030a8b6c7
--- /dev/null
+++ b/tests/language-feature/interfaces/pointer-marshalling-no-int64.slang
@@ -0,0 +1,61 @@
+//TEST:SIMPLE(filecheck=CHECK): -target spirv
+
+// CHECK-NOT: Int64
+
+RWStructuredBuffer<uint> result;
+
+struct Data
+{
+ uint *index_buffer;
+ uint type;
+};
+
+ConstantBuffer<Data> global_data;
+
+interface IIndexFetcher
+{
+ uint get_index();
+};
+
+struct IndexFetcherU32 : IIndexFetcher
+{
+ uint *m_ptr;
+
+ __init(uint *ptr)
+ {
+ m_ptr = ptr;
+ }
+
+ uint get_index()
+ {
+ return 42; // Simplified to avoid dereference issues
+ }
+};
+
+struct IndexFetcherSimple : IIndexFetcher
+{
+ uint value;
+
+ __init(uint val)
+ {
+ value = val;
+ }
+
+ uint get_index()
+ {
+ return value;
+ }
+};
+
+[shader("compute")]
+void main()
+{
+ IIndexFetcher pf;
+ if (global_data.type == 0) {
+ pf = IndexFetcherU32(global_data.index_buffer);
+ } else {
+ pf = IndexFetcherSimple(100);
+ }
+
+ result[0] = pf.get_index();
+} \ No newline at end of file