(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.c-torture/
execute/
pr56899.c
       1  /* PR tree-optimization/56899 */
       2  
       3  #if __SIZEOF_INT__ == 4 && __CHAR_BIT__ == 8
       4  __attribute__((noinline, noclone)) void
       5  f1 (int v)
       6  {
       7    int x = -214748365 * (v - 1);
       8    if (x != -1932735285)
       9      __builtin_abort ();
      10  }
      11  
      12  __attribute__((noinline, noclone)) void
      13  f2 (int v)
      14  {
      15    int x = 214748365 * (v + 1);
      16    if (x != -1932735285)
      17      __builtin_abort ();
      18  }
      19  
      20  __attribute__((noinline, noclone)) void
      21  f3 (unsigned int v)
      22  {
      23    unsigned int x = -214748365U * (v - 1);
      24    if (x != -1932735285U)
      25      __builtin_abort ();
      26  }
      27  
      28  __attribute__((noinline, noclone)) void
      29  f4 (unsigned int v)
      30  {
      31    unsigned int x = 214748365U * (v + 1);
      32    if (x != -1932735285U)
      33      __builtin_abort ();
      34  }
      35  #endif
      36  
      37  int
      38  main ()
      39  {
      40  #if __SIZEOF_INT__ == 4 && __CHAR_BIT__ == 8
      41    f1 (10);
      42    f2 (-10);
      43    f3 (10);
      44    f4 (-10U);
      45  #endif
      46    return 0;
      47  }