mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-27 05:06:06 +00:00
[test][asan] Remove -fsanitize-address-use-after-scope
It's enabled by default in D31479.
This commit is contained in:
parent
18014fe0a9
commit
cd269daf25
@ -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>
|
||||
|
||||
|
@ -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
|
||||
|
@ -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>
|
||||
|
||||
|
@ -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.
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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>
|
||||
|
||||
|
@ -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];
|
||||
|
||||
|
@ -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>
|
||||
|
@ -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;
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user