annotate gcc/testsuite/gcc.dg/pr15360-1.c @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Static declarations followed by extern are OK even if the extern
kono
parents:
diff changeset
2 declaration is initialized. Bug 15360 from hozelda at
kono
parents:
diff changeset
3 yahoo.com. */
kono
parents:
diff changeset
4 /* Origin: Joseph Myers <jsm@polyomino.org.uk> */
kono
parents:
diff changeset
5 /* { dg-do compile } */
kono
parents:
diff changeset
6 /* { dg-options "" } */
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 static int a;
kono
parents:
diff changeset
9 static int a;
kono
parents:
diff changeset
10 extern int a;
kono
parents:
diff changeset
11 static int a;
kono
parents:
diff changeset
12
kono
parents:
diff changeset
13 static int b;
kono
parents:
diff changeset
14 extern int b = 1; /* { dg-warning "initialized and declared" "extern init warning" } */
kono
parents:
diff changeset
15 static int b;
kono
parents:
diff changeset
16 static int b;
kono
parents:
diff changeset
17
kono
parents:
diff changeset
18 static int c; /* { dg-message "note: previous declaration" } */
kono
parents:
diff changeset
19 int c; /* { dg-error "non-static" "correct error" } */
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21 static int d; /* { dg-message "note: previous declaration" } */
kono
parents:
diff changeset
22 int d = 1; /* { dg-error "non-static" "correct error" } */
kono
parents:
diff changeset
23
kono
parents:
diff changeset
24 void foo (void) { extern int e = 1; } /* { dg-error "has both" "extern init in function" } */