2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / gcc.dg / format / builtin-1.c
blobba1cab6473a7936aa1e8f1b733496690076fe6fc
1 /* Test for format extensions. Test that the __builtin functions get their
2 default attributes even with -ffreestanding.
3 */
4 /* Origin: Joseph Myers <jsm28@cam.ac.uk> */
5 /* { dg-do compile } */
6 /* { dg-options "-std=gnu99 -Wformat -ffreestanding" } */
8 #include "format.h"
10 void
11 foo (int i)
13 __builtin_fprintf (stdout, "%d", i);
14 __builtin_fprintf (stdout, "%ld", i); /* { dg-warning "format" "__builtin_fprintf" } */
15 __builtin_printf ("%d", i);
16 __builtin_printf ("%ld", i); /* { dg-warning "format" "__builtin_printf" } */
18 __builtin_fprintf_unlocked (stdout, "%d", i);
19 __builtin_fprintf_unlocked (stdout, "%ld", i); /* { dg-warning "format" "__builtin_fprintf_unlocked" } */
20 __builtin_printf_unlocked ("%d", i);
21 __builtin_printf_unlocked ("%ld", i); /* { dg-warning "format" "__builtin_printf_unlocked" } */