blob: 7fa8df4c693140dceb709d26cd412f2c8f09ce15 [file] [log] [blame]
Andrew Top61a84952019-04-30 15:07:33 -07001// 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// RUN: env LD_PRELOAD=%shared_minlibscudo not %run %t 2>&1 | FileCheck %s
6
7// This way of setting LD_PRELOAD does not work with Android test runner.
8// REQUIRES: !android
9
10#include <assert.h>
11
12int main(int argc, char *argv[]) {
13 int *p = new int;
14 assert(p);
15 *p = 0;
16 delete p;
17 delete p;
18 return 0;
19}
20
21// CHECK: ERROR: invalid chunk state