diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/float-range-2.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/float-range-2.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/float-range-2.c b/gcc/testsuite/gcc.dg/float-range-2.c new file mode 100644 index 000000000..d6c0b8a40 --- /dev/null +++ b/gcc/testsuite/gcc.dg/float-range-2.c @@ -0,0 +1,14 @@ +/* Floating constants outside the range of their type should receive a + pedwarn, not a warning. This includes INFINITY if the target does + not support infinities. */ +/* Origin: Joseph Myers <jsm@polyomino.org.uk> */ +/* { dg-do compile { target vax-*-* pdp11-*-* } } */ +/* { dg-options "-ansi -pedantic-errors" } */ + +void +f (void) +{ + float a = __builtin_inff (); /* { dg-error "target format does not support infinity" } */ + double b = __builtin_inf (); /* { dg-error "target format does not support infinity" } */ + long double c = __builtin_infl (); /* { dg-error "target format does not support infinity" } */ +} |