[test][asan] Remove -fsanitize-address-use-after-scope

It's enabled by default in D31479.
This commit is contained in:
Vitaly Buka 2022-08-12 22:36:26 -07:00
parent 18014fe0a9
commit cd269daf25
15 changed files with 14 additions and 31 deletions

View File

@ -1,5 +1,4 @@
// RUN: %clangxx_asan -O1 -fsanitize-address-use-after-scope %s -o %t && \
// RUN: not %run %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s
#include <functional>

View File

@ -1,4 +1,4 @@
// RUN: %clangxx_asan -O0 -fsanitize-address-use-after-scope %s -o %t
// RUN: %clangxx_asan -O0 %s -o %t
// RUN: not %run %t 'A' 2>&1 | FileCheck %s
// RUN: not %run %t 'B' 2>&1 | FileCheck %s

View File

@ -1,5 +1,4 @@
// RUN: %clangxx_asan -O1 -fsanitize-address-use-after-scope %s -o %t && \
// RUN: not %run %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s
#include <stdio.h>

View File

@ -1,4 +1,4 @@
// RUN: %clangxx_asan -O0 -fsanitize-address-use-after-scope %s -o %t && %run %t
// RUN: %clangxx_asan -O0 %s -o %t && %run %t
// Function jumps over variable initialization making lifetime analysis
// ambiguous. Asan should ignore such variable and program must not fail.

View File

@ -1,5 +1,4 @@
// RUN: %clangxx_asan -O1 -fsanitize-address-use-after-scope %s -o %t && \
// RUN: not %run %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s
int *p;
bool b = true;

View File

@ -2,8 +2,7 @@
// happens. "always_inline" is not enough, as Clang doesn't emit
// llvm.lifetime intrinsics at -O0.
//
// RUN: %clangxx_asan -O2 -fsanitize-address-use-after-scope %s -o %t && \
// RUN: not %run %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s
int *arr;

View File

@ -1,5 +1,4 @@
// RUN: %clangxx_asan -O1 -fsanitize-address-use-after-scope %s -o %t && \
// RUN: not %run %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s
volatile int *p;

View File

@ -1,5 +1,4 @@
// RUN: %clangxx_asan -O1 -fsanitize-address-use-after-scope %s -o %t && \
// RUN: not %run %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s
#include <stdlib.h>

View File

@ -1,5 +1,4 @@
// RUN: %clangxx_asan -O1 -fsanitize-address-use-after-scope %s -o %t && \
// RUN: not %run %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s
int *p[3];

View File

@ -1,4 +1,4 @@
// RUN: %clangxx_asan -O1 -fsanitize-address-use-after-scope %s -o %t && %run %t
// RUN: %clangxx_asan -O1 %s -o %t && %run %t
#include <stdio.h>
#include <stdlib.h>

View File

@ -1,4 +1,4 @@
// RUN: %clangxx_asan -O1 -fsanitize-address-use-after-scope %s -o %t && not %run %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s
struct IntHolder {
int val;

View File

@ -1,5 +1,4 @@
// RUN: %clangxx_asan -O1 -fsanitize-address-use-after-scope %s -o %t && \
// RUN: not %run %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s
struct IntHolder {
__attribute__((noinline)) const IntHolder &Self() const {

View File

@ -1,4 +1,4 @@
// RUN: %clangxx_asan -O0 -fsanitize-address-use-after-scope %s -o %t
// RUN: %clangxx_asan -O0 %s -o %t
// RUN: not %run %t 0 2>&1 | FileCheck %s
// RUN: not %run %t 1 2>&1 | FileCheck %s
// RUN: not %run %t 2 2>&1 | FileCheck %s

View File

@ -1,9 +1,4 @@
// RUN: %clangxx_asan -O1 -fsanitize-address-use-after-scope %s -o %t && \
// RUN: not %run %t 2>&1 | FileCheck %s
// -fsanitize-address-use-after-scope is now on by default:
// RUN: %clangxx_asan -O1 %s -o %t && \
// RUN: not %run %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s
volatile int *p = 0;

View File

@ -913,10 +913,6 @@ if(LLVM_USE_SANITIZER)
else()
message(FATAL_ERROR "LLVM_USE_SANITIZER is not supported on this platform.")
endif()
if (LLVM_USE_SANITIZER MATCHES "(Undefined;)?Address(;Undefined)?")
add_flag_if_supported("-fsanitize-address-use-after-scope"
FSANITIZE_USE_AFTER_SCOPE_FLAG)
endif()
if (LLVM_USE_SANITIZE_COVERAGE)
append("-fsanitize=fuzzer-no-link" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
endif()