URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Go to most recent revision |
Details |
Compare with Previous |
View Log
Line No. |
Rev |
Author |
Line |
1 |
689 |
jeremybenn |
/* PR c/5503
|
2 |
|
|
Test whether argument checking is done for fputs, bzero and bcmp. */
|
3 |
|
|
typedef struct { int i; } FILE;
|
4 |
|
|
typedef __SIZE_TYPE__ size_t;
|
5 |
|
|
int fputs (const char *, FILE *);
|
6 |
|
|
void bzero (void *, size_t);
|
7 |
|
|
int bcmp (const void *, const void *, size_t);
|
8 |
|
|
|
9 |
|
|
char buf[32];
|
10 |
|
|
FILE *f;
|
11 |
|
|
|
12 |
|
|
int main ()
|
13 |
|
|
{
|
14 |
|
|
fputs ("foo"); /* { dg-error "too few" } */
|
15 |
|
|
fputs ("foo", "bar", "baz"); /* { dg-error "too many" } */
|
16 |
|
|
fputs (21, 43);
|
17 |
|
|
bzero (buf); /* { dg-error "too few" } */
|
18 |
|
|
bzero (21); /* { dg-error "too few" } */
|
19 |
|
|
bcmp (buf, buf + 16); /* { dg-error "too few" } */
|
20 |
|
|
bcmp (21); /* { dg-error "too few" } */
|
21 |
|
|
fputs ("foo", f);
|
22 |
|
|
bzero (buf, 32);
|
23 |
|
|
bcmp (buf, buf + 16, 16);
|
24 |
|
|
return 0;
|
25 |
|
|
}
|
26 |
|
|
|
27 |
|
|
/* { dg-warning "passing argument 2 of" "2nd incompatible" { target *-*-* } 15 } */
|
28 |
|
|
/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 5 } */
|
29 |
|
|
/* { dg-warning "passing argument 1 of" "1st incompatible" { target *-*-* } 16 } */
|
30 |
|
|
/* { dg-warning "passing argument 2 of" "2nd incompatible" { target *-*-* } 16 } */
|
31 |
|
|
/* { dg-warning "passing argument 1 of" "1st incompatible" { target *-*-* } 18 } */
|
32 |
|
|
/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 6 } */
|
33 |
|
|
/* { dg-warning "passing argument 1 of" "1st incompatible" { target *-*-* } 20 } */
|
34 |
|
|
/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 7 } */
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.