Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / pr83210.c
blobcf985d29daef156e9776e47de9326fb6c32dabb4
1 /* PR target/83210 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2" } */
4 /* { dg-final { scan-assembler-not {\mmul[lq]\M} } } */
6 void bar (void);
8 unsigned
9 f1 (unsigned int x)
11 unsigned res;
12 if (__builtin_mul_overflow (x, 2, &res))
13 bar ();
14 return res;
17 unsigned long
18 f2 (unsigned long x)
20 unsigned long res;
21 if (__builtin_mul_overflow (16, x, &res))
22 bar ();
23 return res;
26 unsigned long long
27 f3 (unsigned long long x)
29 unsigned long long res;
30 if (__builtin_mul_overflow (x, (1ULL << (__SIZEOF_LONG_LONG__ * __CHAR_BIT__ - 1)), &res))
31 bar ();
32 return res;
35 #ifdef __SIZEOF_INT128__
36 unsigned __int128
37 f4 (unsigned __int128 x)
39 unsigned __int128 res;
40 if (__builtin_mul_overflow (x, (((unsigned __int128) 1) << (__SIZEOF_INT128__ * __CHAR_BIT__ / 2)), &res))
41 bar ();
42 return res;
45 unsigned __int128
46 f5 (unsigned __int128 x)
48 unsigned __int128 res;
49 if (__builtin_mul_overflow (x, (((unsigned __int128) 1) << (__SIZEOF_INT128__ * __CHAR_BIT__ / 2 + 3)), &res))
50 bar ();
51 return res;
53 #endif