[compiler-rt] r349736 - [asan] Fix and re-enable few test on Android

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 20 02:15:51 PST 2018


Author: vitalybuka
Date: Thu Dec 20 02:15:51 2018
New Revision: 349736

URL: http://llvm.org/viewvc/llvm-project?rev=349736&view=rev
Log:
[asan] Fix and re-enable few test on Android

Modified:
    compiler-rt/trunk/test/asan/TestCases/Linux/asan_rt_confict_test-2.cc
    compiler-rt/trunk/test/asan/TestCases/Linux/local_alias.cc
    compiler-rt/trunk/test/asan/TestCases/Linux/odr-violation.cc
    compiler-rt/trunk/test/asan/TestCases/Linux/odr-vtable.cc
    compiler-rt/trunk/test/asan/TestCases/Linux/odr_c_test.c
    compiler-rt/trunk/test/asan/TestCases/Linux/preinit_test.cc

Modified: compiler-rt/trunk/test/asan/TestCases/Linux/asan_rt_confict_test-2.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Linux/asan_rt_confict_test-2.cc?rev=349736&r1=349735&r2=349736&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/Linux/asan_rt_confict_test-2.cc (original)
+++ compiler-rt/trunk/test/asan/TestCases/Linux/asan_rt_confict_test-2.cc Thu Dec 20 02:15:51 2018
@@ -1,12 +1,11 @@
 // Test that mixed static/dynamic sanitization of program objects
 // is prohibited.
 //
-// RUN: %clangxx_asan -DBUILD_SO=1 -fPIC -shared %s -o %t.so
-// RUN: %clangxx_asan_static %s %t.so -o %t
+// RUN: %clangxx_asan -DBUILD_SO=1 -fPIC -shared %s -o %dynamiclib
+// RUN: %clangxx_asan_static %s %ld_flags_rpath_exe -o %t
 // RUN: not %run %t 2>&1 | FileCheck %s
 
 // REQUIRES: asan-dynamic-runtime
-// XFAIL: android
 
 #if BUILD_SO
 char dummy;

Modified: compiler-rt/trunk/test/asan/TestCases/Linux/local_alias.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Linux/local_alias.cc?rev=349736&r1=349735&r2=349736&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/Linux/local_alias.cc (original)
+++ compiler-rt/trunk/test/asan/TestCases/Linux/local_alias.cc Thu Dec 20 02:15:51 2018
@@ -4,13 +4,10 @@
 // false positive global-buffer-overflow due to sanitized library poisons
 // globals from non-sanitized one.
 //
-// FIXME: https://github.com/google/sanitizers/issues/316
-// XFAIL: android
-//
-// RUN: %clangxx_asan -DBUILD_INSTRUMENTED_DSO=1 -fPIC -shared -mllvm -asan-use-private-alias %s -o %t-INSTRUMENTED-SO.so
-// RUN: %clangxx -DBUILD_UNINSTRUMENTED_DSO=1 -fPIC -shared %s -o %t-UNINSTRUMENTED-SO.so
+// RUN: %clangxx_asan -DBUILD_INSTRUMENTED_DSO=1 -fPIC -shared -mllvm -asan-use-private-alias %s -o %dynamiclib1
+// RUN: %clangxx -DBUILD_UNINSTRUMENTED_DSO=1 -fPIC -shared %s -o %dynamiclib2
 // RUN: %clangxx %s -c -mllvm -asan-use-private-alias -o %t.o
-// RUN: %clangxx_asan %t.o %t-UNINSTRUMENTED-SO.so %t-INSTRUMENTED-SO.so -o %t-EXE
+// RUN: %clangxx_asan %t.o %ld_flags_rpath_exe2 %ld_flags_rpath_exe1 -o %t-EXE
 // RUN: %run %t-EXE
 
 #if defined (BUILD_INSTRUMENTED_DSO)

Modified: compiler-rt/trunk/test/asan/TestCases/Linux/odr-violation.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Linux/odr-violation.cc?rev=349736&r1=349735&r2=349736&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/Linux/odr-violation.cc (original)
+++ compiler-rt/trunk/test/asan/TestCases/Linux/odr-violation.cc Thu Dec 20 02:15:51 2018
@@ -1,19 +1,16 @@
-// FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=316
-// XFAIL: android
-//
 // We use fast_unwind_on_malloc=0 to have full unwinding even w/o frame
 // pointers. This setting is not on by default because it's too expensive.
 //
 // Different size: detect a bug if detect_odr_violation>=1
-// RUN: %clangxx_asan -DBUILD_SO=1 -fPIC -shared %s -o %t-ODR-SO.so
-// RUN: %clangxx_asan %s %t-ODR-SO.so -Wl,-R. -o %t-ODR-EXE
+// RUN: %clangxx_asan -DBUILD_SO=1 -fPIC -shared %s -o %dynamiclib
+// RUN: %clangxx_asan %s %ld_flags_rpath_exe -o %t-ODR-EXE
 // RUN: %env_asan_opts=fast_unwind_on_malloc=0:detect_odr_violation=1 not %run %t-ODR-EXE 2>&1 | FileCheck %s
 // RUN: %env_asan_opts=fast_unwind_on_malloc=0:detect_odr_violation=2 not %run %t-ODR-EXE 2>&1 | FileCheck %s
 // RUN: %env_asan_opts=fast_unwind_on_malloc=0:detect_odr_violation=0     %run %t-ODR-EXE 2>&1 | FileCheck %s --check-prefix=DISABLED
 // RUN: %env_asan_opts=fast_unwind_on_malloc=0                        not %run %t-ODR-EXE 2>&1 | FileCheck %s
 //
 // Same size: report a bug only if detect_odr_violation>=2.
-// RUN: %clangxx_asan -DBUILD_SO=1 -fPIC -shared %s -o %t-ODR-SO.so -DSZ=100
+// RUN: %clangxx_asan -DBUILD_SO=1 -fPIC -shared %s -o %dynamiclib -DSZ=100
 // RUN: %env_asan_opts=fast_unwind_on_malloc=0:detect_odr_violation=1     %run %t-ODR-EXE 2>&1 | FileCheck %s --check-prefix=DISABLED
 // RUN: %env_asan_opts=fast_unwind_on_malloc=0:detect_odr_violation=2 not %run %t-ODR-EXE 2>&1 | FileCheck %s
 // RUN: %env_asan_opts=fast_unwind_on_malloc=0                        not %run %t-ODR-EXE 2>&1 | FileCheck %s
@@ -24,18 +21,18 @@
 // RUN: rm -f %t.supp
 //
 // Use private aliases for global variables without indicator symbol.
-// RUN: %clangxx_asan -DBUILD_SO=1 -fPIC -shared -mllvm -asan-use-private-alias %s -o %t-ODR-SO.so -DSZ=100
-// RUN: %clangxx_asan -mllvm -asan-use-private-alias %s %t-ODR-SO.so -Wl,-R. -o %t-ODR-EXE
+// RUN: %clangxx_asan -DBUILD_SO=1 -fPIC -shared -mllvm -asan-use-private-alias %s -o %dynamiclib -DSZ=100
+// RUN: %clangxx_asan -mllvm -asan-use-private-alias %s %ld_flags_rpath_exe -o %t-ODR-EXE
 // RUN: %env_asan_opts=fast_unwind_on_malloc=0 %run %t-ODR-EXE 2>&1 | FileCheck %s --check-prefix=DISABLED
 
 // Use private aliases for global variables: use indicator symbol to detect ODR violation.
-// RUN: %clangxx_asan -DBUILD_SO=1 -fPIC -shared -mllvm -asan-use-private-alias -mllvm -asan-use-odr-indicator  %s -o %t-ODR-SO.so -DSZ=100
-// RUN: %clangxx_asan -mllvm -asan-use-private-alias -mllvm -asan-use-odr-indicator %s %t-ODR-SO.so -Wl,-R. -o %t-ODR-EXE
+// RUN: %clangxx_asan -DBUILD_SO=1 -fPIC -shared -mllvm -asan-use-private-alias -mllvm -asan-use-odr-indicator  %s -o %dynamiclib -DSZ=100
+// RUN: %clangxx_asan -mllvm -asan-use-private-alias -mllvm -asan-use-odr-indicator %s %ld_flags_rpath_exe -o %t-ODR-EXE
 // RUN: %env_asan_opts=fast_unwind_on_malloc=0 not %run %t-ODR-EXE 2>&1 | FileCheck %s
 
 // Same as above but with clang switches.
-// RUN: %clangxx_asan -DBUILD_SO=1 -fPIC -shared -fsanitize-address-use-odr-indicator %s -o %t-ODR-SO.so -DSZ=100
-// RUN: %clangxx_asan -fsanitize-address-use-odr-indicator %s %t-ODR-SO.so -Wl,-R. -o %t-ODR-EXE
+// RUN: %clangxx_asan -DBUILD_SO=1 -fPIC -shared -fsanitize-address-use-odr-indicator %s -o %dynamiclib -DSZ=100
+// RUN: %clangxx_asan -fsanitize-address-use-odr-indicator %s %ld_flags_rpath_exe -o %t-ODR-EXE
 // RUN: %env_asan_opts=fast_unwind_on_malloc=0 not %run %t-ODR-EXE 2>&1 | FileCheck %s
 
 // GNU driver doesn't handle .so files properly.
@@ -60,6 +57,6 @@ int main(int argc, char **argv) {
 
 // CHECK: These globals were registered at these points:
 // CHECK: ODR-EXE
-// CHECK: ODR-SO
+// CHECK: odr-violation.cc.dynamic
 // CHECK: SUMMARY: AddressSanitizer: odr-violation: global 'foo::G' at {{.*}}odr-violation.cc
 // DISABLED: PASS

Modified: compiler-rt/trunk/test/asan/TestCases/Linux/odr-vtable.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Linux/odr-vtable.cc?rev=349736&r1=349735&r2=349736&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/Linux/odr-vtable.cc (original)
+++ compiler-rt/trunk/test/asan/TestCases/Linux/odr-vtable.cc Thu Dec 20 02:15:51 2018
@@ -1,9 +1,6 @@
-// FIXME: Same as test/asan/TestCases/Linux/odr-violation.cc ?
-// XFAIL: android
-
-// RUN: %clangxx_asan -fno-rtti -DBUILD_SO1 -fPIC -shared %s -o %t1.so
-// RUN: %clangxx_asan -fno-rtti -DBUILD_SO2 -fPIC -shared %s -o %t2.so
-// RUN: %clangxx_asan -fno-rtti %t1.so %t2.so %s -Wl,-R. -o %t
+// RUN: %clangxx_asan -fno-rtti -DBUILD_SO1 -fPIC -shared %s -o %dynamiclib1
+// RUN: %clangxx_asan -fno-rtti -DBUILD_SO2 -fPIC -shared %s -o %dynamiclib2
+// RUN: %clangxx_asan -fno-rtti %s %ld_flags_rpath_exe1 %ld_flags_rpath_exe2 -o %t
 // RUN: %env_asan_opts=fast_unwind_on_malloc=0:detect_odr_violation=2 not %run %t 2>&1 | FileCheck %s
 
 struct XYZ {

Modified: compiler-rt/trunk/test/asan/TestCases/Linux/odr_c_test.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Linux/odr_c_test.c?rev=349736&r1=349735&r2=349736&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/Linux/odr_c_test.c (original)
+++ compiler-rt/trunk/test/asan/TestCases/Linux/odr_c_test.c Thu Dec 20 02:15:51 2018
@@ -1,13 +1,11 @@
 // Test that we can properly report an ODR violation
 // between an instrumented global and a non-instrumented global.
 
-// RUN: %clang_asan %s -fPIC -shared -o %t-1.so  -DFILE1
-// RUN: %clang_asan %s -fPIC -shared -o %t-2.so  -DFILE2
-// RUN: %clang_asan %s -fPIE %t-1.so %t-2.so -Wl,-R`pwd` -o %t
+// RUN: %clang_asan %s -fPIC -shared -o %dynamiclib1  -DFILE1
+// RUN: %clang_asan %s -fPIC -shared -o %dynamiclib2  -DFILE2
+// RUN: %clang_asan %s -fPIE %ld_flags_rpath_exe1 %ld_flags_rpath_exe2 -o %t
 // RUN: not %run %t 2>&1 | FileCheck %s
 //
-// REQUIRES: x86_64-target-arch
-//
 // CHECK: The following global variable is not properly aligned.
 // CHECK: ERROR: AddressSanitizer: odr-violation
 #if defined(FILE1)

Modified: compiler-rt/trunk/test/asan/TestCases/Linux/preinit_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Linux/preinit_test.cc?rev=349736&r1=349735&r2=349736&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/Linux/preinit_test.cc (original)
+++ compiler-rt/trunk/test/asan/TestCases/Linux/preinit_test.cc Thu Dec 20 02:15:51 2018
@@ -1,8 +1,5 @@
-// FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=316
-// XFAIL: android
-//
-// RUN: %clangxx      -DFUNC=zzzz %s -shared -o %t.so -fPIC
-// RUN: %clangxx_asan -DFUNC=main %s         -o %t    -Wl,-R. %t.so
+// RUN: %clangxx -DFUNC=zzzz %s -shared -o %dynamiclib -fPIC
+// RUN: %clangxx_asan -DFUNC=main %s -o %t %ld_flags_rpath_exe
 // RUN: %run %t
 
 // GNU driver doesn't handle .so files properly.




More information about the llvm-commits mailing list