summaryrefslogtreecommitdiffstats
path: root/tests/language-feature
diff options
context:
space:
mode:
authorSai Praveen Bangaru <31557731+saipraveenb25@users.noreply.github.com>2025-02-27 10:28:13 -0800
committerGitHub <noreply@github.com>2025-02-27 10:28:13 -0800
commit1fb3c1536587d6ed085f13af78101cbfb3481dca (patch)
tree14347c566f1567bebe0f8f95b3488bc90b09a271 /tests/language-feature
parent3c096a7d3e796850ab6a54e50bb33595483ec7bd (diff)
Fix overload resolution for `ModuleDeclarationDecl` (#6483)
* Fix overload resolution for `MemberExp`r's base expression Also fixed an issue where `ModuleDeclarationDecl` priority during overload resolution was inverted. * Made the fix slightly simpler.. * Update overload-resolve.slang
Diffstat (limited to 'tests/language-feature')
-rw-r--r--tests/language-feature/namespaces/namespace-import/overload-resolve.slang25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/language-feature/namespaces/namespace-import/overload-resolve.slang b/tests/language-feature/namespaces/namespace-import/overload-resolve.slang
new file mode 100644
index 000000000..0b483d916
--- /dev/null
+++ b/tests/language-feature/namespaces/namespace-import/overload-resolve.slang
@@ -0,0 +1,25 @@
+//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK): -shaderobj
+
+module test;
+
+namespace test
+{
+ vector<uint, N> f<int N>(vector<uint, N> x)
+ {
+ return x;
+ }
+}
+
+//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer
+RWStructuredBuffer<int> outputBuffer;
+
+[numthreads(1, 1, 1)]
+void computeMain(int3 dispatchThreadID : SV_DispatchThreadID)
+{
+ int tid = dispatchThreadID.x;
+ int inVal = tid;
+ // Should be able to resolve 'test' properly (and not get confused by the module declaration with the same name)
+ int outVal = test.f<3>(vector<uint, 3>(1, 2, 3)).y;
+ outputBuffer[tid] = outVal;
+ // CHECK: 2
+}