1  /* { dg-do run { target { powerpc*-*-* } } } */
       2  /* { dg-require-effective-target p9vector_hw } */
       3  /* { dg-options "-mdejagnu-cpu=power9" } */
       4  
       5  /* This test should succeed on 32-bit and 64-bit configurations.  */
       6  #include <altivec.h>
       7  #include <stdlib.h>
       8  
       9  char
      10  compare_exponents_unordered (double *exponent1_p, double *exponent2_p)
      11  {
      12    double exponent1 = *exponent1_p;
      13    double exponent2 = *exponent2_p;
      14  
      15    /* This test succeeds if either exponent1 or exponent2 is NaN. */
      16    if (scalar_cmp_exp_unordered (exponent1, exponent2))
      17      return 't';
      18    else
      19      return 'f';
      20  }
      21  
      22  int
      23  main ()
      24  {
      25    /* NaN is denoted by exponent = 2047 and fraction != 0 */
      26    unsigned long long int nan_image = 0x7ff0000000000003LL;
      27    double *nan_ptr = (double *) &nan_image;
      28  
      29    double x = (double) (0x1100LL << 50);
      30    double y = (double) (0x1101LL << 50);
      31    double z = (double) (0x1101LL << 37);
      32  
      33    if (compare_exponents_unordered (&x, nan_ptr) == 'f')
      34      abort ();
      35    if (compare_exponents_unordered (&x, &z) == 't')
      36      abort ();
      37    return 0;
      38  }