(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
i386/
sse2-mmx-10.c
       1  /* { dg-do run } */
       2  /* { dg-options "-O2 -fno-strict-aliasing -msse2" } */
       3  /* { dg-additional-options "-mno-mmx" { target { ! ia32 } } } */
       4  
       5  #include "sse2-check.h"
       6  #include "mmx-vals.h"
       7  
       8  __attribute__((noinline, noclone))
       9  static void
      10  test_from_int  (long long *ll1, long long *r)
      11  {
      12    int i1 = *(int *) ll1;
      13    *(__m64 *) r = _m_from_int (i1);
      14  }
      15  
      16  /* Routine to manually compute the results */
      17  static void
      18  compute_correct_result (long long *ll1, long long *r)
      19  {
      20    int *res = (int *) r;
      21    res[0] = *(int *) ll1;
      22    res[1] = 0;
      23  }
      24  
      25  static void
      26  sse2_test (void)
      27  {
      28    int i;
      29    long long r, ck;
      30    int fail = 0;
      31  
      32    /* Run the MMX tests */
      33    for (i = 0; i < MMX_num_ops; i++)
      34      {
      35        test_from_int (&MMXops[i], &r);
      36        compute_correct_result (&MMXops[i], &ck);
      37        if (ck != r)
      38  	fail++;
      39      }
      40  
      41    if (fail != 0)
      42      abort ();
      43  }