c++: normalizing ttp constraints [PR115656]
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / ppc-fma-5.c
blob5b5d02573f82757b37f3e3c6ffac81b009712c17
1 /* { dg-do run { target { powerpc*-*-* } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* { dg-require-effective-target powerpc_fprs } */
4 /* { dg-options "-O2 -mdejagnu-cpu=power5 -std=c99" } */
6 #ifndef __FP_FAST_FMA
7 #error "__FP_FAST_FMA should be defined"
8 #endif
10 #ifndef __FP_FAST_FMAF
11 #error "__FP_FAST_FMAF should be defined"
12 #endif
14 double d_a = 2.0, d_b = 3.0, d_c = 4.0;
15 float f_a = 2.0f, f_b = 3.0f, f_c = 4.0f;
17 int
18 main (void)
20 if (__builtin_fma (d_a, d_b, d_c) != (2.0 * 3.0) + 4.0)
21 __builtin_abort ();
23 if (__builtin_fmaf (f_a, f_b, f_c) != (2.0f * 3.0f) + 4.0f)
24 __builtin_abort ();
26 return 0;