(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
i386/
avx2-pr99517-1.c
       1  /* PR ipa/99517 */
       2  /* { dg-do run { target avx2 } } */
       3  /* { dg-additional-sources "avx2-pr99517-2.c" } */
       4  /* { dg-options "-O2 -mavx2" } */
       5  
       6  #include "avx2-check.h"
       7  
       8  typedef signed char v32qi __attribute__((vector_size(32)));
       9  typedef int v4si __attribute__((vector_size(16)));
      10  typedef long long int v4di __attribute__((vector_size(32)));
      11  typedef double v4df __attribute__((vector_size(32)));
      12  extern v32qi foo (v4si);
      13  extern v32qi bar (v4si);
      14  
      15  static void
      16  avx2_test (void)
      17  {
      18    v4si a = { 1, -2, 3, -4 };
      19    __asm ("" : "+x" (a));
      20    v4di b = (v4di) bar (a);
      21    v4df c = (v4df) foo (a);
      22    if (b[0] != 1 || c[0] != 1.0 || b[1] != -2 || c[1] != -2.0
      23        || b[2] != 3 || c[2] != 3.0 || b[3] != -4 || c[3] != -4.0)
      24      __builtin_abort ();
      25  }