summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/compilable/test20906.d
blob: 86ffedaa79403b46ac737f946a07d64a73aa8d77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* 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;
}