[HWASAN] Copy some ASAN independent unit tests from ASAN to LSAN
authorKirill Stoimenov <kstoimenov@google.com>
Tue, 24 Jan 2023 23:46:04 +0000 (23:46 +0000)
committerKirill Stoimenov <kstoimenov@google.com>
Wed, 25 Jan 2023 00:39:52 +0000 (00:39 +0000)
Reviewed By: vitalybuka

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

compiler-rt/test/lsan/TestCases/Linux/leak_check_segv.cpp [moved from compiler-rt/test/asan/TestCases/Linux/leak_check_segv.cpp with 87% similarity]
compiler-rt/test/lsan/TestCases/Linux/signal_during_stop_the_world.cpp [moved from compiler-rt/test/asan/TestCases/Linux/signal_during_stop_the_world.cpp with 95% similarity]
compiler-rt/test/lsan/TestCases/lsan_annotations.cpp [moved from compiler-rt/test/asan/TestCases/lsan_annotations.cpp with 74% similarity]
compiler-rt/test/lsan/TestCases/lsan_crash.cpp [moved from compiler-rt/test/asan/TestCases/lsan_crash.cpp with 89% similarity]

@@ -1,6 +1,5 @@
 // Test that SIGSEGV during leak checking does not crash the process.
-// RUN: %clangxx_asan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s
-// REQUIRES: leak-detection
+// RUN: %clangxx_lsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s
 #include <stdlib.h>
 #include <stdio.h>
 #include <sys/mman.h>
@@ -2,7 +2,7 @@
 // Historically StopTheWorld crashed because did not handle EINTR properly.
 // The test is somewhat convoluted, but that's what caused crashes previously.
 
-// RUN: %clangxx_asan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_lsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -1,6 +1,6 @@
 // Check that LSan annotations work fine.
-// RUN: %clangxx_asan -O0 %s -o %t && %run %t
-// RUN: %clangxx_asan -O3 %s -o %t && %run %t
+// RUN: %clangxx_lsan -O0 %s -o %t && %run %t
+// RUN: %clangxx_lsan -O3 %s -o %t && %run %t
 
 #include <sanitizer/lsan_interface.h>
 #include <stdlib.h>
@@ -1,4 +1,4 @@
-// RUN: %clangxx_asan -O2 %s --std=c++14 -o %t && %run %t
+// RUN: %clangxx_lsan -O2 %s --std=c++14 -o %t && %run %t
 
 #include <atomic>
 #include <memory>