annotate gcc/testsuite/gcc.dg/20020104-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 whether statement with no effect warnings are not given for last
kono
parents:
diff changeset
2 statements inside of statement expression. */
kono
parents:
diff changeset
3 /* { dg-do compile } */
kono
parents:
diff changeset
4 /* { dg-options "-O -Wall" } */
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 void bar (char *p, char *q);
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 int main()
kono
parents:
diff changeset
9 {
kono
parents:
diff changeset
10 char foo [32], *p;
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 ({
kono
parents:
diff changeset
13 void *s = (foo);
kono
parents:
diff changeset
14 __builtin_memset (s, '\0', sizeof (foo));
kono
parents:
diff changeset
15 s; /* { dg-warning "no effect" "statement with no effect warning" } */
kono
parents:
diff changeset
16 s; /* { dg-bogus "no effect" "bogus statement with no effect warning" } */
kono
parents:
diff changeset
17 });
kono
parents:
diff changeset
18 p = foo;
kono
parents:
diff changeset
19 p; /* { dg-warning "no effect" "statement with no effect warning" } */
kono
parents:
diff changeset
20 bar (foo, p);
kono
parents:
diff changeset
21 return 0;
kono
parents:
diff changeset
22 }