| 1 |
/* { dg-additional-options "-O0 -fsanitize=undefined" } */ |
| 2 |
|
| 3 |
extern char *foo (char *dest, const char *src) |
| 4 |
__attribute__ ((__nonnull__ (1, 2))); |
| 5 |
|
| 6 |
unsigned bar(const char *str) |
| 7 |
__attribute__ ((__nonnull__ ())); |
| 8 |
|
| 9 |
unsigned test(const char *str, unsigned **pv) |
| 10 |
__attribute__ ((__nonnull__ ())); |
| 11 |
|
| 12 |
unsigned test(const char* str, unsigned **pv) |
| 13 |
{ |
| 14 |
char buffer[130]; |
| 15 |
|
| 16 |
*pv = 0; |
| 17 |
|
| 18 |
foo(buffer, str); |
| 19 |
if (bar(buffer)) |
| 20 |
{ |
| 21 |
const char *ptr = 0; |
| 22 |
foo(buffer, str); |
| 23 |
return bar(buffer); |
| 24 |
} |
| 25 |
return 0; |
| 26 |
} |