29 lines · c
1// Test various -fsanitize= additional flags combinations.2 3// RUN: %clang_scudo %s -o %t4// RUN: not %run %t 2>&1 | FileCheck %s5 6// RUN: %clang_scudo -shared-libsan %s -o %t7// RUN: env LD_LIBRARY_PATH=`dirname %shared_libscudo`:$LD_LIBRARY_PATH not %run %t 2>&1 | FileCheck %s8// RUN: %clang_scudo -shared-libsan -fsanitize-minimal-runtime %s -o %t9// RUN: env LD_LIBRARY_PATH=`dirname %shared_minlibscudo`:$LD_LIBRARY_PATH not %run %t 2>&1 | FileCheck %s10 11// RUN: %clang_scudo -static-libsan %s -o %t12// RUN: not %run %t 2>&1 | FileCheck %s13// RUN: %clang_scudo -static-libsan -fsanitize-minimal-runtime %s -o %t14// RUN: not %run %t 2>&1 | FileCheck %s15 16#include <assert.h>17#include <stdlib.h>18 19int 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;26}27 28// CHECK: ERROR: invalid chunk state29