OSDN Git Service

* gcc.dg/dfp/func-array.c: Support -DDBG to report individual failures.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / builtins-30.c
1 /* { 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 }