1 /* PR target/82274 */ 2 /* { dg-do run } */ 3 /* { dg-options "-O2" } */ 4 5 int main()6main () 7 { 8 #ifdef __SIZEOF_INT128__ 9 __int128 m = -(((__int128) 1) << (__CHAR_BIT__ * __SIZEOF_INT128__ / 2)); 10 volatile __int128 mv = m; 11 __int128 r; 12 #else 13 long long m = -(1LL << (__CHAR_BIT__ * __SIZEOF_LONG_LONG__ / 2)); 14 volatile long long mv = m; 15 long long r; 16 #endif 17 if (!__builtin_mul_overflow (mv, mv, &r)) 18 __builtin_abort (); 19 if (!__builtin_mul_overflow_p (mv, mv, r)) 20 __builtin_abort (); 21 if (!__builtin_mul_overflow (m, m, &r)) 22 __builtin_abort (); 23 if (!__builtin_mul_overflow_p (m, m, r)) 24 __builtin_abort (); 25 return 0; 26 } 27