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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [format/] [cmn-err-1.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
/* { dg-do compile { target *-*-solaris2.* } } */
2
/* { dg-options "-Wformat" } */
3
 
4
#include "format.h"
5
 
6
void cmn_err_func (int level, char * format, ...)
7
  __attribute__((format (cmn_err, 2, 3)));
8
 
9
void cmn_err_func (int level, char * format, ...)
10
{
11
}
12
 
13
const char *string = "foo";
14
 
15
int main()
16
{
17
  int i = 1;
18
  long l = 2;
19
  llong ll = 3;
20
 
21
  cmn_err_func (0, "%s", string);
22
  cmn_err_func (0, "%d %D %o %O %x %X %u", i, i, i, i, i, i, i);
23
  cmn_err_func (0, "%ld %lD %lo %lO %lx %lX %lu", l, l, l, l, l, l, l);
24
  cmn_err_func (0, "%lld %llD %llo %llO %llx %llX %llu",
25
                ll, ll, ll, ll, ll, ll, ll);
26
  cmn_err_func (0, "%b %s", i, "\01Foo", string);
27
  cmn_err_func (0, "%p", string);
28
  cmn_err_func (0, "%16b", i, "\01Foo");
29
 
30
  cmn_err_func (0, "%i", i);             /* { dg-warning "unknown|too many" } */
31
  cmn_err_func (0, "%d", l);             /* { dg-warning "expects argument" } */
32
  cmn_err_func (0, "%b");                /* { dg-warning "'int'" } */
33
/* { dg-warning "'char \\*'" "" { target *-*-solaris2.* } 32 } */
34
  cmn_err_func (0, "%b", i);             /* { dg-warning "matching" } */
35
  cmn_err_func (0, "%b", i, i);          /* { dg-warning "expects argument" } */
36
  cmn_err_func (0, "%b", string, i);     /* { dg-warning "expects argument" } */
37
  cmn_err_func (0, "%p", 3);             /* { dg-warning "expects argument" } */
38
  return 0;
39
}

powered by: WebSVN 2.1.0

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