[compiler-rt] r259001 - using /system/bin/sh on android in tests.

Mike Aizatsky via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 27 15:58:23 PST 2016


Author: aizatsky
Date: Wed Jan 27 17:58:23 2016
New Revision: 259001

URL: http://llvm.org/viewvc/llvm-project?rev=259001&view=rev
Log:
using /system/bin/sh on android in tests.

Subscribers: tberghammer, danalbert, srhines

Differential Revision: http://reviews.llvm.org/D16654

Modified:
    compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_linux_test.cc

Modified: compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_linux_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_linux_test.cc?rev=259001&r1=259000&r2=259001&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_linux_test.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_linux_test.cc Wed Jan 27 17:58:23 2016
@@ -266,9 +266,14 @@ TEST(SanitizerLinux, ThreadSelfTest) {
 TEST(SanitizerCommon, StartSubprocessTest) {
   int pipe_fds[2];
   ASSERT_EQ(0, pipe(pipe_fds));
-  const char *argv[] = {"/bin/sh", "-c", "echo -n 'hello'"};
-  int pid = StartSubprocess("/bin/sh", const_cast<char **>(&argv[0]),
-                            kInvalidFd /* stdin */, pipe_fds[1] /* stdout */);
+#if SANITIZER_ANDROID
+  const char *shell = "/system/bin/sh";
+#else
+  const char *shell = "/bin/sh";
+#endif
+  const char *argv[] = {shell, "-c", "echo -n 'hello'"};
+  int pid = StartSubprocess(shell, argv,
+                            /* stdin */ kInvalidFd, /* stdout */ pipe_fds[1]);
   ASSERT_GT(pid, 0);
 
   // wait for process to finish.




More information about the llvm-commits mailing list