annotate gcc/testsuite/gcc.dg/pr56980.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 /* PR c/56980 */
kono
parents:
diff changeset
2 /* { dg-do compile } */
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 typedef struct A { int i; } B;
kono
parents:
diff changeset
5 typedef union U { int i; } V;
kono
parents:
diff changeset
6 typedef enum E { G } F;
kono
parents:
diff changeset
7
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
8 void foo_s (struct A); /* { dg-message "expected .struct A. but argument is of type 'B \\*' {aka 'struct A \\*'}" } */
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
9 void foo_u (union U); /* { dg-message "expected .union U. but argument is of type 'V \\*' {aka 'union U \\*'}" } */
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
10 void foo_e (enum E); /* { dg-message "expected .enum E. but argument is of type 'F \\*' {aka 'enum E \\*'}" } */
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
11 void foo_sp (B *); /* { dg-message "expected 'B \\*' {aka 'struct A \\*'} but argument is of type .struct B \\*." } */
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
12 void foo_up (V *); /* { dg-message "expected 'V \\*' {aka 'union U \\*'} but argument is of type .union V \\*." } */
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
13 void foo_ep (F *); /* { dg-message "expected 'F \\*' {aka 'enum E \\*'} but argument is of type .enum F \\*." } */
111
kono
parents:
diff changeset
14
kono
parents:
diff changeset
15 void
kono
parents:
diff changeset
16 bar (B *b, V *v, F *f)
kono
parents:
diff changeset
17 {
kono
parents:
diff changeset
18 foo_s (b); /* { dg-error "incompatible" } */
kono
parents:
diff changeset
19 foo_u (v); /* { dg-error "incompatible" } */
kono
parents:
diff changeset
20 foo_e (f); /* { dg-error "incompatible" } */
kono
parents:
diff changeset
21 foo_sp ((struct B *) b); /* { dg-error "passing argument" } */
kono
parents:
diff changeset
22 foo_up ((union V *) v); /* { dg-error "passing argument" } */
kono
parents:
diff changeset
23 foo_ep (__extension__ (enum F *) f); /* { dg-error "passing argument" } */
kono
parents:
diff changeset
24 }