dawn-cmake/test/tint/statements/compound_assign/divide_by_zero.wgsl.expected.hlsl
James Price 508a9660a5 hlsl: Implement compound assignment
Use the ExpandCompoundAssignment transform to convert compound
assignments to regular assignments.

Bug: tint:1325
Change-Id: Ic843964ec24d8a2f00f801823f8f8bbf1c6fab5c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/85284
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-03-31 22:30:10 +00:00

19 lines
358 B
HLSL

[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
static int a = 0;
static float b = 0.0f;
void foo(int maybe_zero) {
a = (a / 1);
a = (a % 1);
a = (a / (maybe_zero == 0 ? 1 : maybe_zero));
a = (a % (maybe_zero == 0 ? 1 : maybe_zero));
b = (b / 0.0f);
b = (b % 0.0f);
b = (b / float(maybe_zero));
b = (b % float(maybe_zero));
}