2 /* { dg-options "-fsanitize=nonnull-attribute,returns-nonnull-attribute" } */
5 void *a
, *b
, *c
= (void *) &q
, *d
, *e
, *f
= (void *) &q
, *g
, *h
;
7 __attribute__((returns_nonnull
, nonnull (1, 3)))
9 foo (void *p
, void *q
, void *r
)
17 bar (const void *a
, const void *b
)
19 int c
= *(const int *) a
;
20 int d
= *(const int *) b
;
27 asm volatile ("" : : : "memory");
31 __builtin_memset (d
, '\0', q
);
35 /* { dg-output "\.c:13:\[0-9]*:\[^\n\r]*null pointer returned from function declared to never return null\[^\n\r]*(\n|\r\n|\r)" } */
36 /* { dg-output "\[^\n\r]*\.c:29:\[0-9]*:\[^\n\r]*null pointer passed as argument 1, which is declared to never be null\[^\n\r]*(\n|\r\n|\r)" } */
37 /* { dg-output "\[^\n\r]*\.c:30:\[0-9]*:\[^\n\r]*null pointer passed as argument 3, which is declared to never be null\[^\n\r]*(\n|\r\n|\r)" } */
38 /* { dg-output "\[^\n\r]*\.c:31:\[0-9]*:\[^\n\r]*null pointer passed as argument 1, which is declared to never be null" } */