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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [format/] [cmn-err-1.c] - Blame information for rev 149

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

Line No. Rev Author Line
1 149 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-error "unknown|too many" } */
31
  cmn_err_func (0, "%d", l);             /* { dg-error "expects type" } */
32
  cmn_err_func (0, "%b");                /* { dg-error "too few" } */
33
  cmn_err_func (0, "%b", i);             /* { dg-error "too few" } */
34
  cmn_err_func (0, "%b", i, i);          /* { dg-error "expects type" } */
35
  cmn_err_func (0, "%b", string, i);     /* { dg-error "expects type" } */
36
  cmn_err_func (0, "%p", 3);            /* { dg-error "expects type" } */
37
  return 0;
38
}

powered by: WebSVN 2.1.0

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