diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/bugs/static-method.slang | 34 | ||||
| -rw-r--r-- | tests/bugs/static-method.slang.expected.txt | 4 |
2 files changed, 38 insertions, 0 deletions
diff --git a/tests/bugs/static-method.slang b/tests/bugs/static-method.slang new file mode 100644 index 000000000..dfb13b4a8 --- /dev/null +++ b/tests/bugs/static-method.slang @@ -0,0 +1,34 @@ +// static-method.slang + +//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute + +struct S +{ + static void doThing(in out int x, int y) + { + x += y; + } +} + +//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out +RWStructuredBuffer<int> outputBuffer : register(u0); + +int test(int t) +{ + // TODO: This case is currently being mis-handled by the parser +// S::doThing(t, 0x10); + + (S::doThing(t, 0x200)); + + (S::doThing)(t, 0x4000); + + return t; +} + +[numthreads(4)] +void computeMain(uint3 tid : SV_DispatchThreadID) +{ + int val = tid.x; + val = test(val); + outputBuffer[tid.x] = val; +} diff --git a/tests/bugs/static-method.slang.expected.txt b/tests/bugs/static-method.slang.expected.txt new file mode 100644 index 000000000..017c3bd20 --- /dev/null +++ b/tests/bugs/static-method.slang.expected.txt @@ -0,0 +1,4 @@ +4200 +4201 +4202 +4203 |
