(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
divmod-6-simode.c
       1  /* { dg-require-effective-target divmod_simode } */
       2  /* { dg-options "-O2 -fdump-tree-widening_mul-details" } */
       3  
       4  typedef int SImode __attribute__((mode(SI)));
       5  typedef unsigned USImode __attribute__((mode(SI)));
       6  
       7  extern int cond;
       8  void foo(void);
       9  
      10  #define FOO(smalltype, bigtype, no)  \
      11  bigtype f_##no(smalltype x, bigtype y) \
      12  {					 \
      13    bigtype q = x / y;                     \
      14    bigtype r1 = 0, r2 = 0;                \
      15    if (cond)                              \
      16      r1 = x % y;                          \
      17    else                                   \
      18      r2 = x % y;                          \
      19    return q + r1 + r2;                    \
      20  }
      21  
      22  FOO(SImode, SImode, 1)
      23  FOO(SImode, USImode, 2)
      24  FOO(USImode, USImode, 3)
      25  
      26  /* { dg-final { scan-tree-dump-times "DIVMOD" 3 "widening_mul" } } */