Home | History | Annotate | Download | only in tests
      1 
      2 // Bruce Lowekamp <lowekamp (at) sipeerior.com> reported that in a program with a
      3 // reachable leak, if you do:
      4 //
      5 //   valgrind --leak-check=yes --gen-suppressions=yes --show-reachable=no -q
      6 //
      7 // it gives the y/n/c suppression prompt for errors that aren't shown.  This
      8 // test checks that is fixed.
      9 //
     10 // [The .vgtest file was later changed to use --leak-check=all so that if a
     11 // suppression is (erroneously?) generated, the test doesn't wait for the user
     12 // to press 'y', because that pauses the entire regtest system.]
     13 
     14 #include <stdlib.h>
     15 
     16 int* a;
     17 
     18 int main ( void )
     19 {
     20   a = malloc(1000);  // Becomes a reachable leak.
     21   a[0] = 0;
     22   return a[0];
     23 }
     24