brintos

brintos / llvm-project-archived public Read only

0
0
Text · 534 B · 7fa8df4 Raw
22 lines · cpp
1// Test that the preloaded runtime works without linking the static library.2 3// RUN: %clang %s -lstdc++ -o %t4// RUN: env LD_PRELOAD=%shared_libscudo    not %run %t 2>&1 | FileCheck %s5// RUN: env LD_PRELOAD=%shared_minlibscudo not %run %t 2>&1 | FileCheck %s6 7// This way of setting LD_PRELOAD does not work with Android test runner.8// REQUIRES: !android9 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 state22