(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
i386/
pr54703.c
       1  /* PR target/54703 */
       2  /* { dg-do run { target sse2_runtime } } */
       3  /* { dg-options "-O -msse2" } */
       4  /* { dg-additional-options "-mavx -mtune=bdver1" { target avx_runtime } } */
       5  
       6  extern void abort (void);
       7  typedef double V __attribute__((vector_size(16)));
       8  
       9  union {
      10    unsigned long long m[2];
      11    V v;
      12  } u = { { 0xffffffffff000000ULL, 0xffffffffff000000ULL } };
      13  
      14  static inline V
      15  foo (V x)
      16  {
      17    V y = __builtin_ia32_andpd (x, u.v);
      18    V z = __builtin_ia32_subpd (x, y);
      19    return __builtin_ia32_mulpd (y, z);
      20  }
      21  
      22  void
      23  test (V *x)
      24  {
      25    V a = { 2.1, 2.1 };
      26    *x = foo (foo (a));
      27  }
      28  
      29  int
      30  main ()
      31  {
      32    test (&u.v);
      33    if (u.m[0] != 0x3acbf487f0a30550ULL || u.m[1] != u.m[0])
      34      abort ();
      35    return 0;
      36  }