blob: dbab5253d8c153ddff16e2a3234da599911f76e0 [file] [log] [blame]
Pirama Arumuga Nainar799172d2016-03-03 15:50:30 -08001// Check that sanitizers on OS X crash the process by default (i.e.
2// abort_on_error=1). See also Linux/abort_on_error.cc.
3
4// RUN: %clangxx %s -o %t
5
6// Intentionally don't inherit the default options.
7// RUN: %tool_options='' not --crash %run %t 2>&1
8
9// When we use lit's default options, we shouldn't crash.
10// RUN: not %run %t 2>&1
11
12int global;
13
14int main() {
15 volatile int *a = new int[100];
16 delete[] a;
17 global = a[0]; // use-after-free: triggers ASan report.
18 return 0;
19}