1 // { dg-do run } 2 3 #define FN(NAME) \ 4 NAME (void) \ 5 { \ 6 char *ptr; \ 7 char *ptr2; \ 8 { \ 9 char my_char[9]; \ 10 ptr = &my_char[0]; \ 11 __builtin_memcpy (&ptr2, &ptr, sizeof (ptr2)); \ 12 } \ 13 \ 14 *(ptr2+9) = 'c'; \ 15 } 16 17 void 18 __attribute__((no_sanitize(("address")))) 19 __attribute__((no_sanitize(("undefined")))) 20 __attribute__((no_sanitize(("address")))) 21 __attribute__((no_sanitize(("null")))) FN(fn1)22FN (fn1) 23 24 void 25 __attribute__((no_sanitize(("all")))) 26 FN (fn2) 27 28 void 29 __attribute__((no_sanitize_address)) 30 FN (fn3) 31 32 int 33 main (void) 34 { 35 fn1 (); 36 fn2 (); 37 fn3 (); 38 39 return 0; 40 } 41