Home | History | Annotate | Download | only in tests
      1 
      2 #include <pthread.h>
      3 #include <stdlib.h>
      4 
      5 
      6 
      7 // This demonstrates an error for a pre_mem_{read,write} event that comes
      8 // from the core, rather than a syscall (ie. part == Vg_CorePart instead of
      9 // part == Vg_CoreSyscall).
     10 
     11 
     12 int main(void)
     13 {
     14    pthread_key_t* key  = malloc(sizeof(pthread_key_t));
     15    pthread_key_t* key2 = malloc(sizeof(pthread_key_t));
     16 
     17    pthread_key_create ( (pthread_key_t*)((long)key + 1), NULL );
     18    free(key2);
     19    pthread_key_create (                        key2    , NULL );
     20 
     21    return 0;
     22 }
     23