1 // Test that the preloaded runtime works without linking the static library.
2 
3 // RUN: %clang %s -lstdc++ -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 
11 int main(int argc, char *argv[]) {
12   int *p = new int;
13   assert(p);
14   *p = 0;
15   delete p;
16   delete p;
17   return 0;
18 }
19 
20 // CHECK: ERROR: invalid chunk state
21