[RS6000] Tests that use int128_t and -m32
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / bfp / scalar-test-data-class-13.c
blob5b99989d4676cae79dcc72e0d5b5e5e598fd148c
1 /* { dg-do run { target { powerpc*-*-* } } } */
2 /* { dg-require-effective-target p9vector_hw } */
3 /* { dg-options "-mdejagnu-cpu=power9" } */
5 #include <altivec.h>
6 #include <stdbool.h>
7 #include <stdlib.h>
9 bool
10 test_zero (float *p)
12 float source = *p;
15 0x40 Test for NaN
16 0x20 Test for +Infinity
17 0x10 Test for -Infinity
18 0x08 Test for +Zero
19 0x04 Test for -Zero
20 0x02 Test for +Denormal
21 0x01 Test for -Denormal
23 return scalar_test_data_class (source, 12);
26 int
27 main ()
29 /* A Zero value has a biased exponent value of zero and a zero
30 * fraction value. The sign may be either positive or negative. */
31 unsigned int zero_plus_image = 0x0;
32 unsigned int zero_minus_image = 0x80000000;
33 unsigned int non_zero_image = 0x60000000;
35 float *zero_plus_p = (float *) &zero_plus_image;
36 float *zero_minus_p = (float *) &zero_minus_image;
37 float *not_zero_p = (float *) &non_zero_image;
39 if (!test_zero (zero_plus_p))
40 abort ();
41 if (!test_zero (zero_minus_p))
42 abort ();
43 if (test_zero (not_zero_p))
44 abort ();
45 return 0;