Merge from trunk:
[official-gcc.git] / main / gcc / testsuite / c-c++-common / ubsan / attrib-4.c
blobba0f00cfb7f653cce38eefd970929b9b9a415c4a
1 /* { dg-do compile } */
2 /* { dg-options "-fsanitize=undefined" } */
4 /* Test that we don't instrument functions marked with
5 no_sanitize_undefined attribute. */
7 struct S { int a[16]; };
9 __attribute__((no_sanitize_undefined)) long long
10 foo (int *a, long long *b, struct S *c)
12 return a[1] + *b + c->a[a[0]];
15 /* { dg-final { scan-assembler-not "__ubsan_handle" } } */