OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [format/] [c90-printf-2.c] - Blame information for rev 154

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* Test for printf formats.  Formats using C99 features should be rejected
2
   outside of C99 mode.
3
*/
4
/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
5
/* { dg-do compile } */
6
/* { dg-options "-std=iso9899:1990 -pedantic -Wformat" } */
7
 
8
#include "format.h"
9
 
10
void
11
foo (int i, double d, llong ll, intmax_t j, size_t z, ptrdiff_t t)
12
{
13
  /* Some tests already in c90-printf-1.c, e.g. %lf.  */
14
  /* The widths hh, ll, j, z, t are new.  */
15
  printf ("%hhd", i); /* { dg-warning "length|C" "%hh in C90" } */
16
  printf ("%lld", ll); /* { dg-warning "length|C" "%ll in C90" } */
17
  printf ("%jd", j); /* { dg-warning "length|C" "%j in C90" } */
18
  printf ("%zu", z); /* { dg-warning "length|C" "%z in C90" } */
19
  printf ("%td", t); /* { dg-warning "length|C" "%t in C90" } */
20
  /* The formats F, a, A are new.  */
21
  printf ("%F", d); /* { dg-warning "C" "%F in C90" } */
22
  printf ("%a", d); /* { dg-warning "C" "%a in C90" } */
23
  printf ("%A", d); /* { dg-warning "C" "%A in C90" } */
24
}

powered by: WebSVN 2.1.0

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