Update ChangeLog and version files for release
[official-gcc.git] / gcc / testsuite / c-c++-common / asan / sanity-check-pure-c-1.c
blob78d15e1aad3b0180df98b3af5b4c2532343a5add
1 /* { dg-do run } */
2 /* { dg-options "-fno-builtin-malloc -fno-builtin-free" } */
3 /* { dg-shouldfail "asan" } */
5 #include <stdlib.h>
6 int main() {
7 char *x = (char*)malloc(10);
8 free(x);
9 return x[5];
12 /* { dg-output "heap-use-after-free.*(\n|\r\n|\r)" } */
13 /* { dg-output " #0 \[^\n\r]*(in _*(interceptor_|)free|\[(\])\[^\n\r]*(\n|\r\n|\r)" } */
14 /* { dg-output " #1 \[^\n\r]*(in _*main (\[^\n\r]*sanity-check-pure-c-1.c:8|\[^\n\r]*:0)|\[(\]).*(\n|\r\n|\r)" } */
15 /* { dg-output " #0 \[^\n\r]*(in _*(interceptor_|)malloc|\[(\])\[^\n\r]*(\n|\r\n|\r)" } */
16 /* { dg-output " #1 \[^\n\r]*(in _*main (\[^\n\r]*sanity-check-pure-c-1.c:7|\[^\n\r]*:0)|\[(\])\[^\n\r]*(\n|\r\n|\r)" } */