OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [gcc.dg/] [format/] [attr-4.c] - Blame information for rev 437

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* Test for format attributes: test use of __attribute__
2
   in prefix attributes.  */
3
/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
4
/* { dg-do compile } */
5
/* { dg-options "-std=gnu99 -Wformat" } */
6
 
7
#define DONT_GNU_PROTOTYPE
8
#include "format.h"
9
 
10
extern __attribute__((format(gnu_attr_printf, 1, 2))) void tformatprintf0 (const char *, ...);
11
extern void __attribute__((format(gnu_attr_printf, 1, 2))) tformatprintf1 (const char *, ...);
12
extern void foo (void), __attribute__((format(gnu_attr_printf, 1, 2))) tformatprintf2 (const char *, ...);
13
extern __attribute__((noreturn)) void bar (void), __attribute__((format(gnu_attr_printf, 1, 2))) tformatprintf3 (const char *, ...);
14
 
15
void
16
baz (int i, int *ip, double d)
17
{
18
  tformatprintf0 ("%d", i);
19
  tformatprintf0 ("%"); /* { dg-warning "format" "attribute format printf case 0" } */
20
  tformatprintf1 ("%d", i);
21
  tformatprintf1 ("%"); /* { dg-warning "format" "attribute format printf case 1" } */
22
  tformatprintf2 ("%d", i);
23
  tformatprintf2 ("%"); /* { dg-warning "format" "attribute format printf case 2" } */
24
  tformatprintf3 ("%d", i);
25
  tformatprintf3 ("%"); /* { dg-warning "format" "attribute format printf case 3" } */
26
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.