(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
ipa/
ipa-icf-5.c
       1  /* { dg-do compile { target c99_runtime } } */
       2  /* { dg-options "-O2 -fdump-ipa-icf-optimized"  } */
       3  
       4  #include <complex.h>
       5  
       6  static double test;
       7  
       8  __attribute__ ((noinline))
       9  double f1(void)
      10  {
      11    double complex z1 = 1.0 + 3.0 * I;
      12    double complex z2 = 1.0 - 4.0 * I;
      13  
      14    unsigned a = 123;
      15    unsigned b = 321;
      16  
      17    if (a & b)
      18      return 1.2f;
      19  
      20    if(cimag(z1) > 1)
      21      return 1.0f;
      22  
      23    test = cimag(z1) + 2;
      24  
      25    return cimag(z1 + z2);
      26  }
      27  
      28  __attribute__ ((noinline))
      29  double f2(void)
      30  {
      31    double complex z1 = 1.0 + 3.0 * I;
      32    double complex z2 = 1.0 - 4.0 * I;
      33  
      34    unsigned a = 123;
      35    unsigned b = 321;
      36  
      37    if (a & b)
      38      return 1.2f;
      39  
      40    if(cimag(z1) > 1)
      41      return 1.0f;
      42  
      43    test = cimag(z1) + 2;
      44  
      45    return cimag(z1 + z2);
      46  }
      47  
      48  int main()
      49  {
      50    return 1;
      51  }
      52  
      53  /* { dg-final { scan-ipa-dump "Semantic equality hit:f1/\[0-9+\]+->f2/\[0-9+\]+" "icf"  } } */
      54  /* { dg-final { scan-ipa-dump "Equal symbols: 1" "icf"  } } */