Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / scudo / fsanitize.c
blob7e5d5451f7263adb87b93a5ba2bd819be854298b
1 // Test various -fsanitize= additional flags combinations.
3 // RUN: %clang_scudo %s -o %t
4 // RUN: not %run %t 2>&1 | FileCheck %s
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
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
16 #include <assert.h>
17 #include <stdlib.h>
19 int main(int argc, char *argv[]) {
20 unsigned long *p = (unsigned long *)malloc(sizeof(unsigned long));
21 assert(p);
22 *p = 0;
23 free(p);
24 free(p);
25 return 0;
28 // CHECK: ERROR: invalid chunk state