diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/format/builtin-1.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/format/builtin-1.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/format/builtin-1.c b/gcc/testsuite/gcc.dg/format/builtin-1.c new file mode 100644 index 0000000..e128635 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/builtin-1.c @@ -0,0 +1,17 @@ +/* Test for format extensions. Test that the __builtin functions get their + default attributes even with -ffreestanding. +*/ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile } */ +/* { dg-options "-std=gnu99 -Wformat -ffreestanding" } */ + +#include "format.h" + +void +foo (int i) +{ + __builtin_fprintf (stdout, "%d", i); + __builtin_fprintf (stdout, "%ld", i); /* { dg-warning "format" "__builtin_fprintf" } */ + __builtin_printf ("%d", i); + __builtin_printf ("%ld", i); /* { dg-warning "format" "__builtin_printf" } */ +} |