diff options
Diffstat (limited to 'tests/diagnostics')
| -rw-r--r-- | tests/diagnostics/sccp-div-by-zero.slang | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/diagnostics/sccp-div-by-zero.slang b/tests/diagnostics/sccp-div-by-zero.slang new file mode 100644 index 000000000..b7c85fe10 --- /dev/null +++ b/tests/diagnostics/sccp-div-by-zero.slang @@ -0,0 +1,19 @@ +//TEST:SIMPLE(filecheck=CHECK): -entry computeMain -profile cs_5_0 -target hlsl +RWStructuredBuffer<uint> outputBuffer; + +// CHECK: divide by zero +uint check<let b : bool>() +{ + return 1 / int(b); +} + +[numthreads(4, 1, 1)] +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + uint tid = dispatchThreadID.x; + + uint a = check<false>(); + uint b = check<true>(); + + outputBuffer[tid] = a + b; +}
\ No newline at end of file |
