annotate gcc/testsuite/c-c++-common/pr28656.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++/28656 */
kono
parents:
diff changeset
2 /* { dg-do compile } */
kono
parents:
diff changeset
3 /* { dg-options "-Wnonnull" } */
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 #ifdef __cplusplus
kono
parents:
diff changeset
6 extern "C" {
kono
parents:
diff changeset
7 #endif
kono
parents:
diff changeset
8 extern void *memcpy (void *__restrict, const void *__restrict, __SIZE_TYPE__)
kono
parents:
diff changeset
9 __attribute__((nonnull (1), nonnull (2), nonnull (1, 2), nonnull));
kono
parents:
diff changeset
10 #ifdef __cplusplus
kono
parents:
diff changeset
11 }
kono
parents:
diff changeset
12 #endif
kono
parents:
diff changeset
13
kono
parents:
diff changeset
14 extern void bar (void *p1, void *p2, void *p3, void *p4, void *p5)
kono
parents:
diff changeset
15 __attribute__((nonnull (1), nonnull (1, 3), nonnull (3, 5), nonnull (4)));
kono
parents:
diff changeset
16
kono
parents:
diff changeset
17 void
kono
parents:
diff changeset
18 foo (void)
kono
parents:
diff changeset
19 {
kono
parents:
diff changeset
20 memcpy (0, 0, 0);
kono
parents:
diff changeset
21 /* { dg-warning "null argument where non-null required\[^\n\r\]*argument 1" "" { target *-*-* } .-1 } */
kono
parents:
diff changeset
22 /* { dg-warning "null argument where non-null required\[^\n\r\]*argument 2" "" { target *-*-* } .-2 } */
kono
parents:
diff changeset
23
kono
parents:
diff changeset
24 bar (0, 0, 0, 0, 0);
kono
parents:
diff changeset
25 /* { dg-warning "null argument where non-null required\[^\n\r\]*argument 1" "" { target *-*-* } .-1 } */
kono
parents:
diff changeset
26 /* { dg-warning "null argument where non-null required\[^\n\r\]*argument 3" "" { target *-*-* } .-2 } */
kono
parents:
diff changeset
27 /* { dg-warning "null argument where non-null required\[^\n\r\]*argument 4" "" { target *-*-* } .-3 } */
kono
parents:
diff changeset
28 /* { dg-warning "null argument where non-null required\[^\n\r\]*argument 5" "" { target *-*-* } .-4 } */
kono
parents:
diff changeset
29 }