dmd/compiler/test/compilable/test20906.d
2022-07-09 18:53:07 +02:00

14 lines
279 B
D

/* REQUIRED_ARGS: -O
* No divide-by-zero constant folding errors
* https://issues.dlang.org/show_bug.cgi?id=20906
*/
int test12()
{
int x = 0;
int a = x && 1 / x;
int b = !x || 1 / x;
int c = x ? 1 / x : 1;
int d = !x ? 1 : 1 / x;
return a | b | c;
}