[compiler-rt] 60084d4 - [sanitizer] Replace -mllvm -asan-use-after-return in compile-rt tests with -fsanitize-address-use-after-return (NFC)

Kevin Athey via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 11 15:13:28 PDT 2021


Author: Kevin Athey
Date: 2021-06-11T15:13:22-07:00
New Revision: 60084d490059719b950b5800715c3c0637218bc5

URL: https://github.com/llvm/llvm-project/commit/60084d490059719b950b5800715c3c0637218bc5
DIFF: https://github.com/llvm/llvm-project/commit/60084d490059719b950b5800715c3c0637218bc5.diff

LOG: [sanitizer] Replace -mllvm -asan-use-after-return in compile-rt tests with -fsanitize-address-use-after-return (NFC)

for issue: https://github.com/google/sanitizers/issues/1394

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D104146

Added: 
    

Modified: 
    compiler-rt/test/asan/TestCases/Linux/uar_signals.cpp
    compiler-rt/test/asan/TestCases/Posix/stack-use-after-return.cpp
    compiler-rt/test/asan/TestCases/Windows/dll_stack_use_after_return.cpp
    compiler-rt/test/asan/TestCases/Windows/stack_use_after_return.cpp
    compiler-rt/test/asan/TestCases/heavy_uar_test.cpp
    compiler-rt/test/asan/TestCases/pass-struct-byval-uar.cpp
    compiler-rt/test/asan/TestCases/scariness_score_test.cpp
    compiler-rt/test/asan/TestCases/uar_and_exceptions.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/asan/TestCases/Linux/uar_signals.cpp b/compiler-rt/test/asan/TestCases/Linux/uar_signals.cpp
index 71671e66b577a..07604b7af5d08 100644
--- a/compiler-rt/test/asan/TestCases/Linux/uar_signals.cpp
+++ b/compiler-rt/test/asan/TestCases/Linux/uar_signals.cpp
@@ -1,8 +1,8 @@
 // This test checks that the implementation of use-after-return
 // is async-signal-safe.
 // RUN: %clangxx_asan -std=c++11 -O1 %s -o %t -pthread && %run %t
-// RUN: %clangxx_asan -std=c++11 -O1 %s -o %t -pthread -mllvm -asan-use-after-return=never && %run %t
-// RUN: %clangxx_asan -std=c++11 -O1 %s -o %t -pthread -mllvm -asan-use-after-return=always && %run %t
+// RUN: %clangxx_asan -std=c++11 -O1 %s -o %t -pthread -fsanitize-address-use-after-return=never && %run %t
+// RUN: %clangxx_asan -std=c++11 -O1 %s -o %t -pthread -fsanitize-address-use-after-return=always && %run %t
 // REQUIRES: stable-runtime
 #include <signal.h>
 #include <stdlib.h>

diff  --git a/compiler-rt/test/asan/TestCases/Posix/stack-use-after-return.cpp b/compiler-rt/test/asan/TestCases/Posix/stack-use-after-return.cpp
index 1deee8f1cd397..d13b6187a8c87 100644
--- a/compiler-rt/test/asan/TestCases/Posix/stack-use-after-return.cpp
+++ b/compiler-rt/test/asan/TestCases/Posix/stack-use-after-return.cpp
@@ -3,14 +3,14 @@
 // RUN: %clangxx_asan  -O2 %s -pthread -o %t && %env_asan_opts=detect_stack_use_after_return=1 not %run %t 2>&1 | FileCheck %s
 // RUN: %clangxx_asan  -O3 %s -pthread -o %t && %env_asan_opts=detect_stack_use_after_return=1 not %run %t 2>&1 | FileCheck %s
 // RUN: %env_asan_opts=detect_stack_use_after_return=0 %run %t
-// RUN: %clangxx_asan  -O0 %s -pthread -o %t -mllvm -asan-use-after-return=always && not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan  -O1 %s -pthread -o %t -mllvm -asan-use-after-return=always && not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan  -O2 %s -pthread -o %t -mllvm -asan-use-after-return=always && not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan  -O3 %s -pthread -o %t -mllvm -asan-use-after-return=always && not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan  -O3 %s -pthread -o %t -mllvm -asan-use-after-return=never && %run %t
+// RUN: %clangxx_asan  -O0 %s -pthread -o %t -fsanitize-address-use-after-return=always && not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan  -O1 %s -pthread -o %t -fsanitize-address-use-after-return=always && not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan  -O2 %s -pthread -o %t -fsanitize-address-use-after-return=always && not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan  -O3 %s -pthread -o %t -fsanitize-address-use-after-return=always && not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan  -O3 %s -pthread -o %t -fsanitize-address-use-after-return=never && %run %t
 // Regression test for a CHECK failure with small stack size and large frame.
 // RUN: %clangxx_asan  -O3 %s -pthread -o %t -DkSize=10000 -DUseThread -DkStackSize=131072 && %env_asan_opts=detect_stack_use_after_return=1 not %run %t 2>&1 | FileCheck --check-prefix=THREAD %s
-// RUN: %clangxx_asan  -O3 %s -pthread -o %t -DkSize=10000 -DUseThread -DkStackSize=131072 -mllvm -asan-use-after-return=always && not %run %t 2>&1 | FileCheck --check-prefix=THREAD %s
+// RUN: %clangxx_asan  -O3 %s -pthread -o %t -DkSize=10000 -DUseThread -DkStackSize=131072 -fsanitize-address-use-after-return=always && not %run %t 2>&1 | FileCheck --check-prefix=THREAD %s
 //
 // Test that we can find UAR in a thread other than main (UAR mode: runtime):
 // RUN: %clangxx_asan  -DUseThread -O2 %s -pthread -o %t && %env_asan_opts=detect_stack_use_after_return=1 not %run %t 2>&1 | FileCheck --check-prefix=THREAD %s
@@ -22,7 +22,7 @@
 // RUN: %env_asan_opts=detect_stack_use_after_return=1:min_uar_stack_size_log=24:max_uar_stack_size_log=24:verbosity=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-24 %s
 //
 // Test that we can find UAR in a thread other than main (UAR mode: always):
-// RUN: %clangxx_asan  -DUseThread -O2 %s -pthread -o %t -mllvm -asan-use-after-return=always && not %run %t 2>&1 | FileCheck --check-prefix=THREAD %s
+// RUN: %clangxx_asan  -DUseThread -O2 %s -pthread -o %t -fsanitize-address-use-after-return=always && not %run %t 2>&1 | FileCheck --check-prefix=THREAD %s
 //
 // Test the max_uar_stack_size_log/min_uar_stack_size_log flag.
 // (uses the previous)

diff  --git a/compiler-rt/test/asan/TestCases/Windows/dll_stack_use_after_return.cpp b/compiler-rt/test/asan/TestCases/Windows/dll_stack_use_after_return.cpp
index 9c8095cd5fbc3..e2c295dfa5017 100644
--- a/compiler-rt/test/asan/TestCases/Windows/dll_stack_use_after_return.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/dll_stack_use_after_return.cpp
@@ -1,7 +1,7 @@
 // RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
 // RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll
 // RUN: %env_asan_opts=detect_stack_use_after_return=1 not %run %t %t.dll 2>&1 | FileCheck %s
-// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll -mllvm -asan-use-after-return=always
+// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll -fsanitize-address-use-after-return=always
 // RUN: not %run %t %t.dll 2>&1 | FileCheck %s
 
 #include <malloc.h>

diff  --git a/compiler-rt/test/asan/TestCases/Windows/stack_use_after_return.cpp b/compiler-rt/test/asan/TestCases/Windows/stack_use_after_return.cpp
index bdeba17dd4f5b..c180bc9d152f1 100644
--- a/compiler-rt/test/asan/TestCases/Windows/stack_use_after_return.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/stack_use_after_return.cpp
@@ -1,6 +1,6 @@
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: %env_asan_opts=detect_stack_use_after_return=1 not %run %t 2>&1 | FileCheck %s
-// RUN: %clang_cl_asan -Od %s -Fe%t -mllvm -asan-use-after-return=always
+// RUN: %clang_cl_asan -Od %s -Fe%t -fsanitize-address-use-after-return=always
 // RUN: not %run %t 2>&1 | FileCheck %s
 
 char *x;

diff  --git a/compiler-rt/test/asan/TestCases/heavy_uar_test.cpp b/compiler-rt/test/asan/TestCases/heavy_uar_test.cpp
index 3a615fea476de..68eab14a916ae 100644
--- a/compiler-rt/test/asan/TestCases/heavy_uar_test.cpp
+++ b/compiler-rt/test/asan/TestCases/heavy_uar_test.cpp
@@ -1,7 +1,7 @@
 // RUN: %clangxx_asan -O0 %s -o %t && %env_asan_opts=detect_stack_use_after_return=1 not %run %t 2>&1 | FileCheck %s
 // RUN: %clangxx_asan -O2 %s -o %t && %env_asan_opts=detect_stack_use_after_return=1 not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O0 %s -o %t -mllvm -asan-use-after-return=always && not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O2 %s -o %t -mllvm -asan-use-after-return=always && not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O0 %s -o %t -fsanitize-address-use-after-return=always && not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O2 %s -o %t -fsanitize-address-use-after-return=always && not %run %t 2>&1 | FileCheck %s
 // XFAIL: windows-msvc
 
 // FIXME: Fix this test under GCC.

diff  --git a/compiler-rt/test/asan/TestCases/pass-struct-byval-uar.cpp b/compiler-rt/test/asan/TestCases/pass-struct-byval-uar.cpp
index 650a5de89bead..254ca29380e48 100644
--- a/compiler-rt/test/asan/TestCases/pass-struct-byval-uar.cpp
+++ b/compiler-rt/test/asan/TestCases/pass-struct-byval-uar.cpp
@@ -4,9 +4,9 @@
 // RUN:     FileCheck --check-prefix=CHECK-NO-UAR %s
 // RUN: not %env_asan_opts=detect_stack_use_after_return=1 %run %t 2>&1 | \
 // RUN:     FileCheck --check-prefix=CHECK-UAR %s
-// RUN: %clangxx_asan -O0 %s -o %t -mllvm -asan-use-after-return=never && \
+// RUN: %clangxx_asan -O0 %s -o %t -fsanitize-address-use-after-return=never && \
 // RUN:     %run %t 2>&1 | FileCheck --check-prefix=CHECK-NO-UAR %s
-// RUN: %clangxx_asan -O0 %s -o %t -mllvm -asan-use-after-return=always && \
+// RUN: %clangxx_asan -O0 %s -o %t -fsanitize-address-use-after-return=always && \
 // RUN:     not %run %t 2>&1 | FileCheck --check-prefix=CHECK-UAR %s
 //
 // On several architectures, the IR does not use byval arguments for foo() and

diff  --git a/compiler-rt/test/asan/TestCases/scariness_score_test.cpp b/compiler-rt/test/asan/TestCases/scariness_score_test.cpp
index 2c6ae85fc27e1..b0df90cb71b31 100644
--- a/compiler-rt/test/asan/TestCases/scariness_score_test.cpp
+++ b/compiler-rt/test/asan/TestCases/scariness_score_test.cpp
@@ -36,7 +36,7 @@
 // RUN: not %run %t 27 2>&1 | FileCheck %s --check-prefix=CHECK27
 //
 // UAR Mode: always
-// RUN: %clangxx_asan -O0 %s -o %t -mllvm -asan-use-after-return=always
+// RUN: %clangxx_asan -O0 %s -o %t -fsanitize-address-use-after-return=always
 // On OSX and Windows, alloc_dealloc_mismatch=1 isn't 100% reliable, so it's
 // off by default. It's safe for these tests, though, so we turn it on.
 // RUN: export %env_asan_opts=handle_abort=1:print_scariness=1:alloc_dealloc_mismatch=1

diff  --git a/compiler-rt/test/asan/TestCases/uar_and_exceptions.cpp b/compiler-rt/test/asan/TestCases/uar_and_exceptions.cpp
index b3a8fb476d3d4..8b70380e3bee3 100644
--- a/compiler-rt/test/asan/TestCases/uar_and_exceptions.cpp
+++ b/compiler-rt/test/asan/TestCases/uar_and_exceptions.cpp
@@ -1,7 +1,7 @@
 // Test that use-after-return works with exceptions.
 // RUN: %clangxx_asan -O0 %s -o %t
 // RUN: %env_asan_opts=detect_stack_use_after_return=1 %run %t
-// RUN: %clangxx_asan -O0 %s -o %t -mllvm -asan-use-after-return=always
+// RUN: %clangxx_asan -O0 %s -o %t -fsanitize-address-use-after-return=always
 // RUN: %run %t
 
 #include <stdio.h>


        


More information about the llvm-commits mailing list