| 1 | // Test various -fsanitize= additional flags combinations. |
| 2 | |
| 3 | // RUN: %clang_scudo %s -o %t |
| 4 | // RUN: not %run %t 2>&1 | FileCheck %s |
| 5 | |
| 6 | // RUN: %clang_scudo -shared-libsan %s -o %t |
| 7 | // RUN: env LD_LIBRARY_PATH=`dirname %shared_libscudo`:$LD_LIBRARY_PATH not %run %t 2>&1 | FileCheck %s |
| 8 | // RUN: %clang_scudo -shared-libsan -fsanitize-minimal-runtime %s -o %t |
| 9 | // RUN: env LD_LIBRARY_PATH=`dirname %shared_minlibscudo`:$LD_LIBRARY_PATH not %run %t 2>&1 | FileCheck %s |
| 10 | |
| 11 | // RUN: %clang_scudo -static-libsan %s -o %t |
| 12 | // RUN: not %run %t 2>&1 | FileCheck %s |
| 13 | // RUN: %clang_scudo -static-libsan -fsanitize-minimal-runtime %s -o %t |
| 14 | // RUN: not %run %t 2>&1 | FileCheck %s |
| 15 | |
| 16 | #include <assert.h> |
| 17 | #include <stdlib.h> |
| 18 | |
| 19 | int main(int argc, char *argv[]) { |
| 20 | unsigned long *p = (unsigned long *)malloc(size: sizeof(unsigned long)); |
| 21 | assert(p); |
| 22 | *p = 0; |
| 23 | free(ptr: p); |
| 24 | free(ptr: p); |
| 25 | return 0; |
| 26 | } |
| 27 | |
| 28 | // CHECK: ERROR: invalid chunk state |
| 29 | |