[compiler-rt] r345394 - [sanitizer] Fix mallopt test on Android.

Evgeniy Stepanov via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 26 08:13:20 PDT 2018


Author: eugenis
Date: Fri Oct 26 08:13:20 2018
New Revision: 345394

URL: http://llvm.org/viewvc/llvm-project?rev=345394&view=rev
Log:
[sanitizer] Fix mallopt test on Android.

There is not a single common mallopt option between gnu/linux and
android, so simply use a random number there.

Modified:
    compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/mallopt.cc

Modified: compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/mallopt.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/mallopt.cc?rev=345394&r1=345393&r2=345394&view=diff
==============================================================================
--- compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/mallopt.cc (original)
+++ compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/mallopt.cc Fri Oct 26 08:13:20 2018
@@ -4,6 +4,7 @@
 #include <malloc.h>
 
 int main() {
-  int res = mallopt(M_ARENA_MAX, 0);
+  // Try a random mallopt option, possibly invalid.
+  int res = mallopt(-42, 0);
   assert(res == 0 || res == 1);
 }




More information about the llvm-commits mailing list