diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/compute/modern-syntax.slang | 26 | ||||
| -rw-r--r-- | tests/compute/modern-syntax.slang.expected.txt | 4 |
2 files changed, 30 insertions, 0 deletions
diff --git a/tests/compute/modern-syntax.slang b/tests/compute/modern-syntax.slang new file mode 100644 index 000000000..c0a1f1442 --- /dev/null +++ b/tests/compute/modern-syntax.slang @@ -0,0 +1,26 @@ +// modern-syntax.slang +//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute + +// This file exists to confirm that declarations using "modern" +// syntax are handled correctly by the compiler front-end. + +typealias MyInt = int; + +func test(val: MyInt) -> MyInt +{ + var tmp = val; + let c : MyInt = 16; + tmp += c; + return tmp; +} + +//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):dxbinding(0),glbinding(0),out +RWStructuredBuffer<int> outputBuffer; + +[numthreads(4, 1, 1)] +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + uint tid = dispatchThreadID.x; + int val = test(tid); + outputBuffer[tid] = val; +}
\ No newline at end of file diff --git a/tests/compute/modern-syntax.slang.expected.txt b/tests/compute/modern-syntax.slang.expected.txt new file mode 100644 index 000000000..a0d427709 --- /dev/null +++ b/tests/compute/modern-syntax.slang.expected.txt @@ -0,0 +1,4 @@ +10 +11 +12 +13 |
