MATCH: Improve `A CMP 0 ? A : -A` set of patterns to use bitwise_equal_p.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / fail145.d
blob1e90237d0c336c019f2cfcba88f833c07fc185b7
1 /*
2 REQUIRED_ARGS: -checkaction=context
3 TEST_OUTPUT:
4 ---
5 fail_compilation/fail145.d(14): Error: `assert(i && (i < 0))` failed
6 fail_compilation/fail145.d(27): called from here: `bar(7)`
7 ---
8 */
10 //import core.stdc.stdio : printf;
12 int bar(int i)
14 assert(i && i < 0);
15 foreach_reverse (k, v; "hello")
17 i <<= 1;
18 if (k == 2)
19 break;
20 i += v;
22 return i;
25 void main()
27 static b = bar(7);
28 auto c = bar(7);
29 //printf("b = %d, %d\n", b, c);
30 assert(b && b == 674);