1 // Test that the preloaded runtime works without linking the static library.
2 
3 // RUN: %clang %s -o %t
4 // RUN: env LD_PRELOAD=%shared_libscudo not %run %t 2>&1 | FileCheck %s
5 
6 // This way of setting LD_PRELOAD does not work with Android test runner.
7 // REQUIRES: !android
8 
9 #include <assert.h>
10 #include <stdlib.h>
11 
12 int main(int argc, char *argv[]) {
13   void *p = malloc(sizeof(int));
14   assert(p);
15   free(p);
16   free(p);
17   return 0;
18 }
19 
20 // CHECK: ERROR: invalid chunk state
21