diff options
Diffstat (limited to 'tests/bugs')
| -rw-r--r-- | tests/bugs/gh-2959.slang | 16 | ||||
| -rw-r--r-- | tests/bugs/gh-3408.slang | 21 |
2 files changed, 37 insertions, 0 deletions
diff --git a/tests/bugs/gh-2959.slang b/tests/bugs/gh-2959.slang new file mode 100644 index 000000000..b478fa938 --- /dev/null +++ b/tests/bugs/gh-2959.slang @@ -0,0 +1,16 @@ +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=BUF): -shaderobj -output-using-type + +//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer +RWStructuredBuffer<uint> outputBuffer; + +static uint g_values[2] = { 0, 1 }; + +[numthreads(2, 1, 1)] +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + uint tid = dispatchThreadID.x; + + outputBuffer[tid] = g_values[tid]; + // BUF: 0 + // BUF: 1 +} diff --git a/tests/bugs/gh-3408.slang b/tests/bugs/gh-3408.slang new file mode 100644 index 000000000..a24befe91 --- /dev/null +++ b/tests/bugs/gh-3408.slang @@ -0,0 +1,21 @@ +//TEST:SIMPLE(filecheck=CHECK): -entry computeMain -stage compute -target glsl +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=BUF): -shaderobj -vk + +//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer +RWStructuredBuffer<int> outputBuffer; + +[numthreads(4, 1, 1)] +void computeMain(int3 dispatchThreadID : SV_DispatchThreadID) +{ + // CHECK-NOT: {{\b}}if{{\b}} + + int tid = dispatchThreadID.x; + + static int a[] = { 1, 2 }; + + outputBuffer[dispatchThreadID.x] = a[tid & 1]; + // BUF: 1 + // BUF: 2 + // BUF: 1 + // BUF: 2 +} |
