annotate gcc/testsuite/gcc.dg/func-args-1.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Test messages for wrong number of arguments to function. */
kono
parents:
diff changeset
2 /* Origin: Joseph Myers <jsm@polyomino.org.uk> */
kono
parents:
diff changeset
3 /* { dg-do compile } */
kono
parents:
diff changeset
4 /* { dg-options "" } */
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 void f0(void); /* { dg-message "note: declared here" } */
kono
parents:
diff changeset
7 void f1(int); /* { dg-message "note: declared here" } */
kono
parents:
diff changeset
8 void f1v(int, ...); /* { dg-message "note: declared here" } */
kono
parents:
diff changeset
9 void f2(int, int); /* { dg-message "note: declared here" } */
kono
parents:
diff changeset
10 void f2v(int, int, ...); /* { dg-message "note: declared here" } */
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 struct s {
kono
parents:
diff changeset
13 void (*f0)(void);
kono
parents:
diff changeset
14 void (*f1)(int);
kono
parents:
diff changeset
15 void (*f1v)(int, ...);
kono
parents:
diff changeset
16 void (*f2)(int, int);
kono
parents:
diff changeset
17 void (*f2v)(int, int, ...);
kono
parents:
diff changeset
18 } x;
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 void
kono
parents:
diff changeset
21 g (int a)
kono
parents:
diff changeset
22 {
kono
parents:
diff changeset
23 f0();
kono
parents:
diff changeset
24 x.f0();
kono
parents:
diff changeset
25 f0(a); /* { dg-error "too many arguments to function 'f0'" } */
kono
parents:
diff changeset
26 x.f0(a); /* { dg-error "too many arguments to function 'x.f0'" } */
kono
parents:
diff changeset
27 f0(a, a); /* { dg-error "too many arguments to function 'f0'" } */
kono
parents:
diff changeset
28 x.f0(a, a); /* { dg-error "too many arguments to function 'x.f0'" } */
kono
parents:
diff changeset
29 f1(); /* { dg-error "too few arguments to function 'f1'" } */
kono
parents:
diff changeset
30 x.f1(); /* { dg-error "too few arguments to function 'x.f1'" } */
kono
parents:
diff changeset
31 f1(a);
kono
parents:
diff changeset
32 x.f1(a);
kono
parents:
diff changeset
33 f1(a, a); /* { dg-error "too many arguments to function 'f1'" } */
kono
parents:
diff changeset
34 x.f1(a, a); /* { dg-error "too many arguments to function 'x.f1'" } */
kono
parents:
diff changeset
35 f1v(); /* { dg-error "too few arguments to function 'f1v'" } */
kono
parents:
diff changeset
36 x.f1v(); /* { dg-error "too few arguments to function 'x.f1v'" } */
kono
parents:
diff changeset
37 f1v(a);
kono
parents:
diff changeset
38 x.f1v(a);
kono
parents:
diff changeset
39 f1v(a, a);
kono
parents:
diff changeset
40 x.f1v(a, a);
kono
parents:
diff changeset
41 f2(a); /* { dg-error "too few arguments to function 'f2'" } */
kono
parents:
diff changeset
42 x.f2(a); /* { dg-error "too few arguments to function 'x.f2'" } */
kono
parents:
diff changeset
43 f2(a, a);
kono
parents:
diff changeset
44 x.f2(a, a);
kono
parents:
diff changeset
45 f2(a, a, a); /* { dg-error "too many arguments to function 'f2'" } */
kono
parents:
diff changeset
46 x.f2(a, a, a); /* { dg-error "too many arguments to function 'x.f2'" } */
kono
parents:
diff changeset
47 f2v(a); /* { dg-error "too few arguments to function 'f2v'" } */
kono
parents:
diff changeset
48 x.f2v(a); /* { dg-error "too few arguments to function 'x.f2v'" } */
kono
parents:
diff changeset
49 f2v(a, a);
kono
parents:
diff changeset
50 x.f2v(a, a);
kono
parents:
diff changeset
51 f2v(a, a, a);
kono
parents:
diff changeset
52 x.f2v(a, a, a);
kono
parents:
diff changeset
53 }