diff options
Diffstat (limited to 'tests/compute/select-expr.slang')
| -rw-r--r-- | tests/compute/select-expr.slang | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/compute/select-expr.slang b/tests/compute/select-expr.slang new file mode 100644 index 000000000..d90708ab9 --- /dev/null +++ b/tests/compute/select-expr.slang @@ -0,0 +1,18 @@ +//TEST(smoke,compute):COMPARE_COMPUTE: +//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):dxbinding(0),glbinding(0),out + + +// Test IR code generation for the `?:` "select" operator + +int test(int input) +{ + return input > 1 ? -input : input; +} + +RWStructuredBuffer<int> outputBuffer; + +[numthreads(4, 1, 1)] +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + outputBuffer[dispatchThreadID.x] = test((int) dispatchThreadID.x); +}
\ No newline at end of file |
