[TTC-9] Make LSan compliant with recovery mode when running on top of ASan
[platform/upstream/gcc.git] / gcc / testsuite / gcc.dg / asan / leak_recover-2.c
1 /* { dg-do run } */
2 /* { dg-set-target-env-var ASAN_OPTIONS "halt_on_error=1" } */
3 /* { dg-shouldfail "asan" } */
4
5 #include <stdlib.h>
6
7 int f () {
8   volatile int* a = malloc(20);
9   a[0] = 1;
10   return a[0];
11 }
12
13 int main() {
14   f();
15 }
16
17 /* { dg-output {Direct leak of 20 byte} }  */