Debian Codegraph @

gcc/testsuite/c-c++-common/hwasan/stack-tagging-disable.c

raw
1 /* { dg-do compile } */
2 /* { dg-additional-options "--param hwasan-instrument-stack=0" } */
3
4
5 /* No stack tagging => no calls to __hwasan_tag_memory. */
6 int __attribute__ ((noinline))
7 accessing_pointers (int *left, int *right)
8 {
9 int x = right[2];
10 left[3] = right[1];
11 return right[1] + left[2];
12 }
13
14 int __attribute__ ((noinline))
15 using_stack (int num)
16 {
17 int big_array[10];
18 int other_array[20];
19 accessing_pointers(other_array, big_array);
20 return big_array[num];
21 }
22
23 #ifndef ARG
24 #define ARG 0
25 #endif
26 int __attribute__ ((noinline))
27 main ()
28 {
29 using_stack (ARG);
30 return 0;
31 }
32
33 /* { dg-final { scan-assembler-not "__hwasan_tag_memory" } } */