1 /* PR tree-optimization/83369 - Missing diagnostics during inlining
3 { dg-options "-O2 -Wall" } */
15 __attribute ((nonnull (1, 2)))
17 my_strcpy (char *restrict dst
, const char *restrict src
, size_t size
)
19 size_t len
= strlen (src
); /* { dg-warning "argument 1 null where non-null expected" } */
21 memcpy (dst
, src
, len
+ 1); /* { dg-warning "argument 2 null where non-null expected" } */
24 memcpy (dst
, src
, size
- 1); /* { dg-warning "argument 2 null where non-null expected" } */
30 void test (struct Test
* test
)
33 my_strcpy (buf
, test
->s1
, sizeof buf
);
35 my_strcpy (buf
, test
->s2
, sizeof buf
);
37 my_strcpy (buf
, test
->s2
, sizeof buf
);
40 /* Verify that the inlining context is printed for -Wnonnull:
41 { dg-message "function .my_strcpy..*inlined from .test." "" { target *-*-* } 0 } */