[llvm] cd269da - [test][asan] Remove -fsanitize-address-use-after-scope
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Sat Aug 13 00:05:11 PDT 2022
Author: Vitaly Buka
Date: 2022-08-13T00:04:55-07:00
New Revision: cd269daf25016f7115424a51ab5e7977a80e072d
URL: https://github.com/llvm/llvm-project/commit/cd269daf25016f7115424a51ab5e7977a80e072d
DIFF: https://github.com/llvm/llvm-project/commit/cd269daf25016f7115424a51ab5e7977a80e072d.diff
LOG: [test][asan] Remove -fsanitize-address-use-after-scope
It's enabled by default in D31479.
Added:
Modified:
compiler-rt/test/asan/TestCases/use-after-scope-capture.cpp
compiler-rt/test/asan/TestCases/use-after-scope-conversion.cpp
compiler-rt/test/asan/TestCases/use-after-scope-dtor-order.cpp
compiler-rt/test/asan/TestCases/use-after-scope-goto.cpp
compiler-rt/test/asan/TestCases/use-after-scope-if.cpp
compiler-rt/test/asan/TestCases/use-after-scope-inlined.cpp
compiler-rt/test/asan/TestCases/use-after-scope-loop-bug.cpp
compiler-rt/test/asan/TestCases/use-after-scope-loop-removed.cpp
compiler-rt/test/asan/TestCases/use-after-scope-loop.cpp
compiler-rt/test/asan/TestCases/use-after-scope-nobug.cpp
compiler-rt/test/asan/TestCases/use-after-scope-temp.cpp
compiler-rt/test/asan/TestCases/use-after-scope-temp2.cpp
compiler-rt/test/asan/TestCases/use-after-scope-types.cpp
compiler-rt/test/asan/TestCases/use-after-scope.cpp
llvm/cmake/modules/HandleLLVMOptions.cmake
Removed:
################################################################################
diff --git a/compiler-rt/test/asan/TestCases/use-after-scope-capture.cpp b/compiler-rt/test/asan/TestCases/use-after-scope-capture.cpp
index 19444b80d935c..b3dbfb6dc89de 100644
--- a/compiler-rt/test/asan/TestCases/use-after-scope-capture.cpp
+++ b/compiler-rt/test/asan/TestCases/use-after-scope-capture.cpp
@@ -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>
diff --git a/compiler-rt/test/asan/TestCases/use-after-scope-conversion.cpp b/compiler-rt/test/asan/TestCases/use-after-scope-conversion.cpp
index 4ada3ba5d00a1..dc632935b96dd 100644
--- a/compiler-rt/test/asan/TestCases/use-after-scope-conversion.cpp
+++ b/compiler-rt/test/asan/TestCases/use-after-scope-conversion.cpp
@@ -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
diff --git a/compiler-rt/test/asan/TestCases/use-after-scope-dtor-order.cpp b/compiler-rt/test/asan/TestCases/use-after-scope-dtor-order.cpp
index 43c17106010b7..42f62c72397ec 100644
--- a/compiler-rt/test/asan/TestCases/use-after-scope-dtor-order.cpp
+++ b/compiler-rt/test/asan/TestCases/use-after-scope-dtor-order.cpp
@@ -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>
diff --git a/compiler-rt/test/asan/TestCases/use-after-scope-goto.cpp b/compiler-rt/test/asan/TestCases/use-after-scope-goto.cpp
index 351cbe995efb2..b0acd26fe932d 100644
--- a/compiler-rt/test/asan/TestCases/use-after-scope-goto.cpp
+++ b/compiler-rt/test/asan/TestCases/use-after-scope-goto.cpp
@@ -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.
diff --git a/compiler-rt/test/asan/TestCases/use-after-scope-if.cpp b/compiler-rt/test/asan/TestCases/use-after-scope-if.cpp
index 579008385fe4d..4c6cf34eaa9fd 100644
--- a/compiler-rt/test/asan/TestCases/use-after-scope-if.cpp
+++ b/compiler-rt/test/asan/TestCases/use-after-scope-if.cpp
@@ -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;
diff --git a/compiler-rt/test/asan/TestCases/use-after-scope-inlined.cpp b/compiler-rt/test/asan/TestCases/use-after-scope-inlined.cpp
index ce72fa23685f5..1014ff919b9ef 100644
--- a/compiler-rt/test/asan/TestCases/use-after-scope-inlined.cpp
+++ b/compiler-rt/test/asan/TestCases/use-after-scope-inlined.cpp
@@ -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;
diff --git a/compiler-rt/test/asan/TestCases/use-after-scope-loop-bug.cpp b/compiler-rt/test/asan/TestCases/use-after-scope-loop-bug.cpp
index b5b02d7f101b5..286b6441a5698 100644
--- a/compiler-rt/test/asan/TestCases/use-after-scope-loop-bug.cpp
+++ b/compiler-rt/test/asan/TestCases/use-after-scope-loop-bug.cpp
@@ -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;
diff --git a/compiler-rt/test/asan/TestCases/use-after-scope-loop-removed.cpp b/compiler-rt/test/asan/TestCases/use-after-scope-loop-removed.cpp
index 0e8944e93c838..8a8a7b60deb6b 100644
--- a/compiler-rt/test/asan/TestCases/use-after-scope-loop-removed.cpp
+++ b/compiler-rt/test/asan/TestCases/use-after-scope-loop-removed.cpp
@@ -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>
diff --git a/compiler-rt/test/asan/TestCases/use-after-scope-loop.cpp b/compiler-rt/test/asan/TestCases/use-after-scope-loop.cpp
index dcd6435aefcf5..3e199056930cb 100644
--- a/compiler-rt/test/asan/TestCases/use-after-scope-loop.cpp
+++ b/compiler-rt/test/asan/TestCases/use-after-scope-loop.cpp
@@ -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];
diff --git a/compiler-rt/test/asan/TestCases/use-after-scope-nobug.cpp b/compiler-rt/test/asan/TestCases/use-after-scope-nobug.cpp
index cf471dc345fa0..e401c94672b06 100644
--- a/compiler-rt/test/asan/TestCases/use-after-scope-nobug.cpp
+++ b/compiler-rt/test/asan/TestCases/use-after-scope-nobug.cpp
@@ -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>
diff --git a/compiler-rt/test/asan/TestCases/use-after-scope-temp.cpp b/compiler-rt/test/asan/TestCases/use-after-scope-temp.cpp
index 2a2981caf9389..29680f37bfa53 100644
--- a/compiler-rt/test/asan/TestCases/use-after-scope-temp.cpp
+++ b/compiler-rt/test/asan/TestCases/use-after-scope-temp.cpp
@@ -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;
diff --git a/compiler-rt/test/asan/TestCases/use-after-scope-temp2.cpp b/compiler-rt/test/asan/TestCases/use-after-scope-temp2.cpp
index 48688ebbcca7f..b98d6f12911a7 100644
--- a/compiler-rt/test/asan/TestCases/use-after-scope-temp2.cpp
+++ b/compiler-rt/test/asan/TestCases/use-after-scope-temp2.cpp
@@ -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 {
diff --git a/compiler-rt/test/asan/TestCases/use-after-scope-types.cpp b/compiler-rt/test/asan/TestCases/use-after-scope-types.cpp
index dd077e9a35110..5751a0a09bb4e 100644
--- a/compiler-rt/test/asan/TestCases/use-after-scope-types.cpp
+++ b/compiler-rt/test/asan/TestCases/use-after-scope-types.cpp
@@ -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
diff --git a/compiler-rt/test/asan/TestCases/use-after-scope.cpp b/compiler-rt/test/asan/TestCases/use-after-scope.cpp
index fdc937bb6f3e1..eb61679d2b2aa 100644
--- a/compiler-rt/test/asan/TestCases/use-after-scope.cpp
+++ b/compiler-rt/test/asan/TestCases/use-after-scope.cpp
@@ -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;
diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
index ba525e62f3966..151bab84a7a89 100644
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
+++ b/llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -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()
More information about the llvm-commits
mailing list