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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [format/] [ms_plus-1.c] - Blame information for rev 689

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* Test for printf formats using string literal plus constant.
2
 */
3
/* Origin: Jakub Jelinek <jakub@redhat.com> */
4
/* { dg-do compile { target { *-*-mingw* } } } */
5
/* { dg-options "-std=iso9899:1990 -pedantic -Wformat=2" } */
6
 
7
#define USE_SYSTEM_FORMATS
8
#include "format.h"
9
 
10
void
11
foo (int i)
12
{
13
  printf ("%%d\n" + 1, i);
14
  printf (5 + "%.-*d%3d\n", i);
15
  printf ("%d%d" + 2, i, i);    /* { dg-warning "arguments" "wrong number of args" } */
16
  printf (3 + "%d\n");          /* { dg-warning "zero-length" "zero-length string" } */
17
  printf ("%d\n" + i, i);       /* { dg-warning "not a string" "non-constant addend" } */
18
  printf ("%d\n" + 10);         /* { dg-warning "not a string" "too large addend" } */
19
  printf ("%d\n" - 1, i);       /* { dg-warning "not a string" "minus constant" } */
20
  printf ("%d\n" + -1, i);      /* { dg-warning "not a string" "negative addend" } */
21
}

powered by: WebSVN 2.1.0

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