Pirama Arumuga Nainar | 799172d | 2016-03-03 15:50:30 -0800 | [diff] [blame^] | 1 | // 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 | |
| 12 | int global; |
| 13 | |
| 14 | int 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 | } |