Debian Codegraph @

gcc/testsuite/c-c++-common/asan/pr61530.c

raw
1 /* { dg-do run } */
2 /* { dg-shouldfail "asan" } */
3
4 __attribute__((noinline,noclone)) void
5 foo (char *a, char *b) {
6 a[0] = b[0] = 0;
7 __builtin_memcpy(a, b, 4);
8 }
9
10 int
11 main () {
12 char a, b;
13 foo (&a, &b);
14 return 0;
15 }
16
17 /* { dg-output "ERROR: AddressSanitizer: stack-buffer-overflow" } */