OSDN Git Service

* gcc.dg/pragma-darwin.c: Improve for ppc64.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / format / builtin-1.c
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" } */
7
8 #include "format.h"
9
10 void
11 foo (int i)
12 {
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" } */
17
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" } */
22 }