Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / scudo / preload.cpp
blob7fa8df4c693140dceb709d26cd412f2c8f09ce15
1 // Test that the preloaded runtime works without linking the static library.
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
7 // This way of setting LD_PRELOAD does not work with Android test runner.
8 // REQUIRES: !android
10 #include <assert.h>
12 int 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;
21 // CHECK: ERROR: invalid chunk state