(root)/
gcc-13.2.0/
gcc/
testsuite/
c-c++-common/
ubsan/
pr66313.c
       1  /* { dg-do run } */
       2  /* { dg-options "-fsanitize=undefined -fsanitize-undefined-trap-on-error" } */
       3  
       4  int __attribute__((noinline,noclone))
       5  f(int a, int b, int c)
       6  {
       7    return a * b + a * c;
       8  }
       9  int __attribute__((noinline,noclone))
      10  g(int a)
      11  {
      12    return a * (__INT_MAX__/2) + a * (__INT_MAX__/2 + 2);
      13  }
      14  int __attribute__((noinline,noclone))
      15  h(int a, int b)
      16  {
      17    return a * (__INT_MAX__/2 + 1) + b * (__INT_MAX__/2 + 1);
      18  }
      19  int main()
      20  {
      21    volatile int tem = f(0, __INT_MAX__, __INT_MAX__);
      22    tem = f(-1, __INT_MAX__/2 + 1, __INT_MAX__/2 + 1);
      23    tem = g(-1);
      24    tem = h(-1, -1);
      25    return 0;
      26  }