Fix broken MinGW build of gcc.c
[official-gcc.git] / gcc / testsuite / g++.dg / asan / interception-failure-test-1.C
blobd326e56cf932e2d253c52d8267652da33541dfe4
1 // If user provides his own libc functions, ASan doesn't
2 // intercept these functions.
4 // { dg-do run }
5 // { dg-options "-fno-builtin-malloc -fno-builtin-free" }
6 // { dg-additional-options "-D__NO_INLINE__" { target { *-*-linux-gnu } } }
8 #include <stdlib.h>
9 #include <stdio.h>
11 extern "C" long strtol(const char *nptr, char **endptr, int base) {
12   fprintf(stderr, "my_strtol_interceptor\n");
13   return 0;
16 int main() {
17   char *x = (char*)malloc(10);
18   free(x);
19   return (int)strtol(x, 0, 10);
22 // { dg-output "my_strtol_interceptor" }