(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
pr102224.c
       1  /* PR target/102224 */
       2  /* { dg-do run } */
       3  /* { dg-options "-O2" } */
       4  
       5  __attribute__((noipa)) float
       6  foo (float x)
       7  {
       8    return x * __builtin_copysignf (1.0f, x);
       9  }
      10  
      11  __attribute__((noipa)) float
      12  bar (float x, float y)
      13  {
      14    return x * __builtin_copysignf (1.0f, y);
      15  }
      16  
      17  __attribute__((noipa)) float
      18  baz (float z, float x)
      19  {
      20    return x * __builtin_copysignf (1.0f, x);
      21  }
      22  
      23  __attribute__((noipa)) float
      24  qux (float z, float x, float y)
      25  {
      26    return x * __builtin_copysignf (1.0f, y);
      27  }
      28  
      29  int
      30  main ()
      31  {
      32    if (foo (1.0f) != 1.0f
      33        || foo (-4.0f) != 4.0f)
      34      __builtin_abort ();
      35    if (bar (1.25f, 7.25f) != 1.25f
      36        || bar (1.75f, -3.25f) != -1.75f
      37        || bar (-2.25f, 7.5f) != -2.25f
      38        || bar (-3.0f, -4.0f) != 3.0f)
      39      __builtin_abort ();
      40    if (baz (5.5f, 1.0f) != 1.0f
      41        || baz (4.25f, -4.0f) != 4.0f)
      42      __builtin_abort ();
      43    if (qux (1.0f, 1.25f, 7.25f) != 1.25f
      44        || qux (2.0f, 1.75f, -3.25f) != -1.75f
      45        || qux (3.0f, -2.25f, 7.5f) != -2.25f
      46        || qux (4.0f, -3.0f, -4.0f) != 3.0f)
      47      __builtin_abort ();
      48    return 0;
      49  }