diff options
| author | Yong He <yonghe@outlook.com> | 2024-09-09 08:18:26 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-09 23:18:26 +0800 |
| commit | 110d82fb75f19ac83e3a297e4783304481f66ce7 (patch) | |
| tree | 3fd1ecaf7be8a1e282e2f6dffa57981dfa2645b1 /tests | |
| parent | 69ee8f63cdb0dad573f65b0b5fc45aad01ec8321 (diff) | |
Fix generic IInteger `mod` implementation. (#5037)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/bugs/gh-5026.slang | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/bugs/gh-5026.slang b/tests/bugs/gh-5026.slang new file mode 100644 index 000000000..1080d1180 --- /dev/null +++ b/tests/bugs/gh-5026.slang @@ -0,0 +1,23 @@ +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type + +// CHECK: type: int32_t +// CHECK-NEXT: 0 +// CHECK-NEXT: 0 +// CHECK-NEXT: 0 +// CHECK-NEXT: 0 + +//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer +RWStructuredBuffer<int> outputBuffer; + +T myMod<T : __BuiltinArithmeticType>(T x, T y) +{ + return x % y; +} + +[numthreads(4, 1, 1)] +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + int c = 1; + int d = 1; + outputBuffer[dispatchThreadID.x] = myMod(c,d); +}
\ No newline at end of file |
