brintos

brintos / llvm-project-archived public Read only

0
0
Text · 757 B · d40a281 Raw
30 lines · c
1// Test recovery mode.2//3// RUN: %clang_asan -fsanitize-recover=address %s -o %t4//5// RUN: env not %run %t 2>&1 | FileCheck %s6// RUN: %env_asan_opts=halt_on_error=true not %run %t 2>&1 | FileCheck %s7// RUN: %env_asan_opts=halt_on_error=false %run %t 2>&1 | FileCheck %s --check-prefix CHECK-RECOVER8// XFAIL: msvc9#include <string.h>10 11volatile int ten = 10;12 13int main() {14  char x[10];15  // CHECK: WRITE of size 1116  // CHECK-RECOVER: WRITE of size 1117  memset(x, 0, 11);18  // CHECK-NOT: READ of size 119  // CHECK-RECOVER: READ of size 120  volatile int res = x[ten];21  // CHECK-NOT: WRITE of size 122  // CHECK-RECOVER: WRITE of size 123  x[ten] = res + 3;24  // CHECK-NOT: READ of size 125  // CHECK-RECOVER: READ of size 126  res = x[ten];27  return  0;28}29 30