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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [format/] [ms_c90-printf-2.c] - Blame information for rev 801

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

Line No. Rev Author Line
1 689 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 { target { *-*-mingw* } } } */
6
/* { dg-options "-std=iso9899:1990 -pedantic -Wformat" } */
7
 
8
#define USE_SYSTEM_FORMATS
9
#include "format.h"
10
 
11
void
12
foo (int i, double d, llong ll, intmax_t j, size_t z, ptrdiff_t t)
13
{
14
  /* Some tests already in c90-printf-1.c, e.g. %lf.  */
15
  /* The widths hh, ll, j, z, t are new.  */
16
  printf ("%hhd", i); /* { dg-warning "unknown|format" "%hh is unsupported" } */
17
  printf ("%I64d", ll); /* { dg-warning "length|C" "%I64 in C90" } */
18
  printf ("%jd", j); /* { dg-warning "unknown|format" "%j is unsupported" } */
19
  printf ("%zu", z); /* { dg-warning "unknown|format" "%z is unsupported" } */
20
  printf ("%td", t); /* { dg-warning "unknown|format" "%t is unsupported" } */
21
  /* The formats F, a, A are new.  */
22
  printf ("%F", d); /* { dg-warning "unknown|format" "%F is unsupported" } */
23
  printf ("%a", d); /* { dg-warning "unknown|format" "%a is unsupported" } */
24
  printf ("%A", d); /* { dg-warning "unknown|format" "%A is unsupported" } */
25
}

powered by: WebSVN 2.1.0

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