summaryrefslogtreecommitdiffstats
path: root/tests/bugs
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2024-10-09 01:23:56 +0800
committerGitHub <noreply@github.com>2024-10-08 10:23:56 -0700
commit50f44c178de4c614dc45fc48938e6881c0373f6a (patch)
tree6e4c33fb14e3955a496dd65faf36041e83fddc49 /tests/bugs
parent842dee3b6b62c7eb37134e3e27b2ebebdde99b42 (diff)
Look through attributes and rates when determining by reference initialization (#5023)
* Look through attributes and rates when determining by reference initialization Closes #5022 * Make type of unwrapAttributedType more specific * loosen type of unwrapAttributedType * Discard changes to source/slang/slang-emit-spirv.cpp * Discard changes to source/slang/slang-ir-check-differentiability.cpp * Discard changes to source/slang/slang-ir.cpp * Discard changes to source/slang/slang-ir.h * Update slang-ir-use-uninitialized-values.cpp * Remove redundant cast --------- Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'tests/bugs')
-rw-r--r--tests/bugs/gh-5022.slang22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/bugs/gh-5022.slang b/tests/bugs/gh-5022.slang
new file mode 100644
index 000000000..6d1b71991
--- /dev/null
+++ b/tests/bugs/gh-5022.slang
@@ -0,0 +1,22 @@
+//TEST(smoke,compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu
+
+// CHECK: 0
+// CHECK-NEXT: 1
+// CHECK-NEXT: 2
+// CHECK-NEXT: 3
+
+//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer
+RWStructuredBuffer<int> outputBuffer;
+
+groupshared int myInt;
+
+void set(__ref groupshared int i){ i = 1; }
+int use(__ref groupshared int i){ return i; }
+
+[numthreads(4, 1, 1)]
+void computeMain(uint i : SV_GroupIndex)
+{
+ set(myInt);
+ use(myInt);
+ outputBuffer[i] = i;
+}