diff options
Diffstat (limited to 'tests/language-feature')
| -rw-r--r-- | tests/language-feature/namespaces/namespace-import/overload-resolve.slang | 25 |
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 +} |
