2 // { dg-options "-O2" }
4 struct A { int i : 1; };
5 struct B { int j : 3; };
13 return __builtin_add_overflow_p (x, y, a.i) + 2 * __builtin_mul_overflow_p (x, y, s.j);
16 __attribute__((noinline, noclone)) int
19 return foo <B> (x, y);
22 #if __cplusplus >= 201402L
29 return __builtin_add_overflow_p (x, y, a.i) + 2 * __builtin_mul_overflow_p (x, y, s.j);
32 constexpr int t1 = baz <B> (0, 0);
33 constexpr int t2 = baz <B> (1, -1);
34 constexpr int t3 = baz <B> (1, -4);
35 constexpr int t4 = baz <B> (-4, 4);
36 constexpr int t5 = baz <B> (4, 2);
37 static_assert (t1 == 0, "");
38 static_assert (t2 == 0, "");
39 static_assert (t3 == 1, "");
40 static_assert (t4 == 2, "");
41 static_assert (t5 == 3, "");