diff --git a/lib/sanitizer_common/tests/sanitizer_linux_test.cpp b/lib/sanitizer_common/tests/sanitizer_linux_test.cpp
index 025cba9..338c4d3 100644
--- a/lib/sanitizer_common/tests/sanitizer_linux_test.cpp
+++ b/lib/sanitizer_common/tests/sanitizer_linux_test.cpp
@@ -13,18 +13,17 @@
 #include "sanitizer_common/sanitizer_platform.h"
 #if SANITIZER_LINUX
 
-#include "sanitizer_common/sanitizer_linux.h"
+#  include <pthread.h>
+#  include <sched.h>
+#  include <stdlib.h>
 
-#include "sanitizer_common/sanitizer_common.h"
-#include "sanitizer_common/sanitizer_file.h"
-#include "gtest/gtest.h"
+#  include <algorithm>
+#  include <vector>
 
-#include <pthread.h>
-#include <sched.h>
-#include <stdlib.h>
-
-#include <algorithm>
-#include <vector>
+#  include "gtest/gtest.h"
+#  include "sanitizer_common/sanitizer_common.h"
+#  include "sanitizer_common/sanitizer_file.h"
+#  include "sanitizer_common/sanitizer_linux.h"
 
 namespace __sanitizer {
 
@@ -109,9 +108,8 @@
 void ThreadListerTest::SpawnTidReporter(pthread_t *pthread_id, tid_t *tid) {
   pthread_mutex_lock(&thread_arg.tid_reported_mutex);
   thread_arg.reported_tid = -1;
-  ASSERT_EQ(0, pthread_create(pthread_id, NULL,
-                              TidReporterThread,
-                              &thread_arg));
+  ASSERT_EQ(0,
+            pthread_create(pthread_id, NULL, TidReporterThread, &thread_arg));
   while (thread_arg.reported_tid == (tid_t)(-1))
     pthread_cond_wait(&thread_arg.tid_reported_cond,
                       &thread_arg.tid_reported_mutex);
@@ -129,8 +127,8 @@
 static bool Includes(std::vector<tid_t> first, std::vector<tid_t> second) {
   std::sort(first.begin(), first.end());
   std::sort(second.begin(), second.end());
-  return std::includes(first.begin(), first.end(),
-                       second.begin(), second.end());
+  return std::includes(first.begin(), first.end(), second.begin(),
+                       second.end());
 }
 
 static bool HasElement(const std::vector<tid_t> &vector, tid_t element) {
@@ -187,7 +185,7 @@
   EXPECT_EQ(0, getenv(kEnvName));
 }
 
-#if (defined(__x86_64__) || defined(__i386__)) && !SANITIZER_ANDROID
+#  if (defined(__x86_64__) || defined(__i386__)) && !SANITIZER_ANDROID
 // libpthread puts the thread descriptor at the end of stack space.
 void *thread_descriptor_size_test_func(void *arg) {
   uptr descr_addr = (uptr)pthread_self();
@@ -206,48 +204,48 @@
   ASSERT_EQ(0, pthread_join(tid, &result));
   EXPECT_EQ((uptr)result, ThreadDescriptorSize());
 }
-#endif
+#  endif
 
 TEST(SanitizerCommon, LibraryNameIs) {
   EXPECT_FALSE(LibraryNameIs("", ""));
 
   char full_name[256];
-  const char *paths[] = { "", "/", "/path/to/" };
-  const char *suffixes[] = { "", "-linux", ".1.2", "-linux.1.2" };
-  const char *base_names[] = { "lib", "lib.0", "lib-i386" };
-  const char *wrong_names[] = { "", "lib.9", "lib-x86_64" };
+  const char *paths[] = {"", "/", "/path/to/"};
+  const char *suffixes[] = {"", "-linux", ".1.2", "-linux.1.2"};
+  const char *base_names[] = {"lib", "lib.0", "lib-i386"};
+  const char *wrong_names[] = {"", "lib.9", "lib-x86_64"};
   for (uptr i = 0; i < ARRAY_SIZE(paths); i++)
     for (uptr j = 0; j < ARRAY_SIZE(suffixes); j++) {
       for (uptr k = 0; k < ARRAY_SIZE(base_names); k++) {
         internal_snprintf(full_name, ARRAY_SIZE(full_name), "%s%s%s.so",
                           paths[i], base_names[k], suffixes[j]);
         EXPECT_TRUE(LibraryNameIs(full_name, base_names[k]))
-            << "Full name " << full_name
-            << " doesn't match base name " << base_names[k];
+            << "Full name " << full_name << " doesn't match base name "
+            << base_names[k];
         for (uptr m = 0; m < ARRAY_SIZE(wrong_names); m++)
           EXPECT_FALSE(LibraryNameIs(full_name, wrong_names[m]))
-            << "Full name " << full_name
-            << " matches base name " << wrong_names[m];
+              << "Full name " << full_name << " matches base name "
+              << wrong_names[m];
       }
     }
 }
 
-#if defined(__mips64)
+#  if defined(__mips64)
 // Effectively, this is a test for ThreadDescriptorSize() which is used to
 // compute ThreadSelf().
 TEST(SanitizerLinux, ThreadSelfTest) {
   ASSERT_EQ(pthread_self(), ThreadSelf());
 }
-#endif
+#  endif
 
 TEST(SanitizerCommon, StartSubprocessTest) {
   int pipe_fds[2];
   ASSERT_EQ(0, pipe(pipe_fds));
-#if SANITIZER_ANDROID
+#  if SANITIZER_ANDROID
   const char *shell = "/system/bin/sh";
-#else
+#  else
   const char *shell = "/bin/sh";
-#endif
+#  endif
   const char *argv[] = {shell, "-c", "echo -n 'hello'", (char *)NULL};
   int pid = StartSubprocess(shell, argv, GetEnviron(),
                             /* stdin */ kInvalidFd, /* stdout */ pipe_fds[1]);
