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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [builtins-30.c] - Blame information for rev 867

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

Line No. Rev Author Line
1 149 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-Wall -Wshadow" } */
3
 
4
extern double strtod (const char *, char **);
5
#define UNUSED __attribute__ ((unused))
6
 
7
/* A built-in function may be overridden by an old-style definition
8
   specifying too few arguments... */
9
double cos ()
10
{  /* { dg-warning "shadows a built-in" } */
11
  /* { dg-warning "warning: number of arguments doesn't match built-in prototype" "built-in" { target *-*-* } 10 } */
12
  return strtod ("nan", 0);
13
}
14
 
15
/* the right number, but the wrong type, arguments... */
16
double sin (foo)
17
     int foo UNUSED;  /* { dg-warning "shadows a built-in" } */
18
{  /* { dg-warning "warning: argument 'foo' doesn't match built-in prototype" } */
19
  return strtod ("nan", 0);
20
}
21
 
22
/* or too many arguments.  */
23
long double cosl (foo, bar)
24
     const char *foo UNUSED;  /* { dg-warning "shadows a built-in" } */
25
     int bar UNUSED;
26
{  /* { dg-warning "warning: number of arguments doesn't match built-in prototype" } */
27
  /* { dg-warning "warning: argument 'foo' doesn't match built-in prototype" "foo" { target *-*-* } 26 } */
28
  return strtod ("nan", 0);
29
}

powered by: WebSVN 2.1.0

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