annotate gcc/testsuite/gcc.dg/mismatch-decl-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 /* This test assumes -fbuiltin and not -fansi to get "index" and "memchr" builtin DECLs. */
kono
parents:
diff changeset
2 /* { dg-do compile } */
kono
parents:
diff changeset
3 /* { dg-options "" } */
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 /* The bug this is testing is that if a new decl conflicts with an
kono
parents:
diff changeset
6 explicit decl, you don't get the "changes type of builtin" message,
kono
parents:
diff changeset
7 but if there was *also* a builtin, you *also* don't get the
kono
parents:
diff changeset
8 "previous declaration was here" message, leaving you with no clue
kono
parents:
diff changeset
9 where the previous declaration came from. */
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 extern char foo(int,int); /* { dg-message "previous declaration of 'foo' was here" } */
kono
parents:
diff changeset
12 extern char *index(const char *,int); /* { dg-message "previous declaration of 'index' was here" } */
kono
parents:
diff changeset
13
kono
parents:
diff changeset
14 /* This changes the type of "index", which is both a builtin and an
kono
parents:
diff changeset
15 explicit decl. */
kono
parents:
diff changeset
16 int index; /* { dg-error "redeclared as different kind of symbol" } */
kono
parents:
diff changeset
17
kono
parents:
diff changeset
18 /* This changes the type of "memchr", which is only a builtin. */
kono
parents:
diff changeset
19 int memchr; /* { dg-warning "built-in function 'memchr' declared as non-function" } */
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21 /* This changes the type of "foo", which is only an explicit decl. */
kono
parents:
diff changeset
22 int foo; /* { dg-error "redeclared as different kind of symbol" } */