diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2020-02-13 12:35:40 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-13 12:35:40 -0500 |
| commit | fd61c775f2e0e744c4bbbc2672d42e17c6863c1c (patch) | |
| tree | 753df099b956914081d78a20678b09bd558d00d3 /tests | |
| parent | f07834e19a34d5f9c03d681083b5ba30e262889d (diff) | |
* Fix for unary - on glsl (#1222)
* Test to check fix
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/bugs/negative-literal.slang | 14 | ||||
| -rw-r--r-- | tests/bugs/negative-literal.slang.expected.txt | 4 |
2 files changed, 18 insertions, 0 deletions
diff --git a/tests/bugs/negative-literal.slang b/tests/bugs/negative-literal.slang new file mode 100644 index 000000000..586cd601c --- /dev/null +++ b/tests/bugs/negative-literal.slang @@ -0,0 +1,14 @@ +//TEST(compute):COMPARE_COMPUTE_EX:-cpu -compute -compile-arg -O3 +//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute +//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -dx12 +//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute + +//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer +RWStructuredBuffer<float> outputBuffer; + +[numthreads(4, 1, 1)] +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + float v = asfloat((int(dispatchThreadID.x) & -2147483648) | 1065353216); + outputBuffer[dispatchThreadID.x] = v; +} diff --git a/tests/bugs/negative-literal.slang.expected.txt b/tests/bugs/negative-literal.slang.expected.txt new file mode 100644 index 000000000..cc5e55ab6 --- /dev/null +++ b/tests/bugs/negative-literal.slang.expected.txt @@ -0,0 +1,4 @@ +3F800000 +3F800000 +3F800000 +3F800000 |
