Introduce tests for -fsanitize-address-use-after-scope
[platform/upstream/linaro-gcc.git] / gcc / testsuite / gcc.dg / asan / use-after-scope-4.c
1 // { dg-do run }
2
3 int
4 __attribute__((no_sanitize_address))
5 main (void)
6 {
7   char *ptr;
8   char *ptr2;
9   {
10     char my_char[9];
11     ptr = &my_char[0];
12     __builtin_memcpy (&ptr2, &ptr, sizeof (ptr2));
13   }
14
15   *(ptr2+9) = 'c';
16 }