1 /* Test __bf16 built-in functions. */
3 /* { dg-options "" } */
4 /* { dg-add-options bfloat16 } */
5 /* { dg-add-options ieee } */
6 /* { dg-require-effective-target bfloat16_runtime } */
8 extern void exit (int);
9 extern void abort (void);
11 extern __bf16 test_type
;
12 extern __typeof (__builtin_nansf16b ("")) test_type
;
14 volatile __bf16 inf_cst
= (__bf16
) __builtin_inff ();
15 volatile __bf16 huge_val_cst
= (__bf16
) __builtin_huge_valf ();
16 volatile __bf16 nan_cst
= (__bf16
) __builtin_nanf ("");
17 volatile __bf16 nans_cst
= __builtin_nansf16b ("");
18 volatile __bf16 neg0
= -0.0bf16
, neg1
= -1.0bf16
, one
= 1.0;
24 if (!__builtin_isinf (inf_cst
))
26 if (!__builtin_isinf (huge_val_cst
))
28 if (inf_cst
!= huge_val_cst
)
30 if (!__builtin_isnan (nan_cst
))
32 if (!__builtin_isnan (nans_cst
))
34 r
= __builtin_fabsf (neg1
);
37 r
= __builtin_copysignf (one
, neg0
);
40 r
= __builtin_copysignf (inf_cst
, neg1
);
41 if (r
!= -huge_val_cst
)
43 r
= __builtin_copysignf (-inf_cst
, one
);
44 if (r
!= huge_val_cst
)