Debian Codegraph @

gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-sig-6.c

raw
1 /* { dg-do run { target { powerpc*-*-* } } } */
2 /* { dg-require-effective-target p9vector_hw } */
3 /* { dg-options "-mdejagnu-cpu=power9" } */
4 /* { dg-require-effective-target has_arch_ppc64 } */
5
6 /* This test should succeed only on 64-bit configurations. */
7 #include <altivec.h>
8 #include <stdlib.h>
9
10 unsigned long long int
11 get_significand (double *p)
12 {
13 double source = *p;
14
15 return scalar_extract_sig (source);
16 }
17
18 int
19 main ()
20 {
21 double x = (double) (0x1100LL << 50);
22 double z = (double) (0x1101LL << 37);
23
24 if (get_significand (&x) != 0x11000000000000ULL)
25 abort ();
26 if (get_significand (&z) != 0x11010000000000ULL)
27 abort ();
28 return 0;
29 }