diff options
Diffstat (limited to 'tests/language-feature')
| -rw-r--r-- | tests/language-feature/constants/static-array-indexing.slang | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/language-feature/constants/static-array-indexing.slang b/tests/language-feature/constants/static-array-indexing.slang new file mode 100644 index 000000000..0a7963b34 --- /dev/null +++ b/tests/language-feature/constants/static-array-indexing.slang @@ -0,0 +1,18 @@ +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK): + +int check<int v>() +{ + return v; +} + +//TEST_INPUT:ubuffer(data=[0], stride=4):out,name=outputBuffer +RWStructuredBuffer<int> outputBuffer; + +[numthreads(1, 1, 1)] +void computeMain(int3 dispatchThreadID : SV_DispatchThreadID) +{ + int tid = dispatchThreadID.x; + const int a[] = { 1, 2, 3, 4 }; + // CHECK: 4 + outputBuffer[tid] = check<a[3]>(); +} |
