[compiler-rt] be36604 - [ASan] rename left/right to before/after.

Florian Mayer via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 6 13:25:24 PDT 2022


Author: Florian Mayer
Date: 2022-09-06T13:25:15-07:00
New Revision: be366041fa652a53ad51b60dfa127214b6dbf529

URL: https://github.com/llvm/llvm-project/commit/be366041fa652a53ad51b60dfa127214b6dbf529
DIFF: https://github.com/llvm/llvm-project/commit/be366041fa652a53ad51b60dfa127214b6dbf529.diff

LOG: [ASan] rename left/right to before/after.

left/right is a weird way to refer to address ordering.

Reviewed By: eugenis, MaskRay

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

Added: 
    

Modified: 
    compiler-rt/lib/asan/asan_allocator.cpp
    compiler-rt/lib/asan/asan_descriptions.cpp
    compiler-rt/lib/asan/tests/asan_mem_test.cpp
    compiler-rt/lib/asan/tests/asan_oob_test.cpp
    compiler-rt/lib/asan/tests/asan_str_test.cpp
    compiler-rt/lib/asan/tests/asan_test.cpp
    compiler-rt/test/asan/TestCases/Darwin/address-range-limit.mm
    compiler-rt/test/asan/TestCases/Darwin/dead-strip.c
    compiler-rt/test/asan/TestCases/Darwin/haswell-symbolication.cpp
    compiler-rt/test/asan/TestCases/Linux/global-overflow-bfd.cpp
    compiler-rt/test/asan/TestCases/Linux/global-overflow-lld.cpp
    compiler-rt/test/asan/TestCases/Linux/malloc-in-qsort.cpp
    compiler-rt/test/asan/TestCases/Linux/overflow-in-qsort.cpp
    compiler-rt/test/asan/TestCases/PR52382.c
    compiler-rt/test/asan/TestCases/Posix/start-deactivated.cpp
    compiler-rt/test/asan/TestCases/Windows/calloc_left_oob.cpp
    compiler-rt/test/asan/TestCases/Windows/calloc_right_oob.cpp
    compiler-rt/test/asan/TestCases/Windows/dll_malloc_left_oob.cpp
    compiler-rt/test/asan/TestCases/Windows/dll_operator_array_new_left_oob.cpp
    compiler-rt/test/asan/TestCases/Windows/dll_operator_array_new_with_dtor_left_oob.cpp
    compiler-rt/test/asan/TestCases/Windows/fuse-lld-globals.cpp
    compiler-rt/test/asan/TestCases/Windows/global_const_string_oob.cpp
    compiler-rt/test/asan/TestCases/Windows/intercept_strdup.cpp
    compiler-rt/test/asan/TestCases/Windows/malloc_left_oob.cpp
    compiler-rt/test/asan/TestCases/Windows/malloc_right_oob.cpp
    compiler-rt/test/asan/TestCases/Windows/operator_array_new_left_oob.cpp
    compiler-rt/test/asan/TestCases/Windows/operator_array_new_right_oob.cpp
    compiler-rt/test/asan/TestCases/Windows/operator_array_new_with_dtor_left_oob.cpp
    compiler-rt/test/asan/TestCases/Windows/operator_new_left_oob.cpp
    compiler-rt/test/asan/TestCases/Windows/operator_new_right_oob.cpp
    compiler-rt/test/asan/TestCases/Windows/realloc_left_oob.cpp
    compiler-rt/test/asan/TestCases/Windows/realloc_right_oob.cpp
    compiler-rt/test/asan/TestCases/Windows/symbols_path.cpp
    compiler-rt/test/asan/TestCases/Windows/wrong_downcast_on_heap.cpp
    compiler-rt/test/asan/TestCases/global-demangle.cpp
    compiler-rt/test/asan/TestCases/global-location-nodebug.cpp
    compiler-rt/test/asan/TestCases/global-location.cpp
    compiler-rt/test/asan/TestCases/global-overflow.cpp
    compiler-rt/test/asan/TestCases/global-underflow.cpp
    compiler-rt/test/asan/TestCases/heap-overflow.cpp
    compiler-rt/test/asan/TestCases/huge_negative_hea_oob.cpp
    compiler-rt/test/asan/TestCases/large_func_test.cpp
    compiler-rt/test/asan/TestCases/load_and_store_n.cpp
    compiler-rt/test/asan/TestCases/partial_right.cpp
    compiler-rt/test/asan/TestCases/poison_partial.cpp
    compiler-rt/test/asan/TestCases/strncpy-overflow.cpp
    compiler-rt/test/asan/TestCases/unaligned_loads_and_stores.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/asan/asan_allocator.cpp b/compiler-rt/lib/asan/asan_allocator.cpp
index 7b7a289c2d25a..52d7eff7281e3 100644
--- a/compiler-rt/lib/asan/asan_allocator.cpp
+++ b/compiler-rt/lib/asan/asan_allocator.cpp
@@ -803,8 +803,8 @@ struct Allocator {
     sptr offset = 0;
     if (!m1 || AsanChunkView(m1).AddrIsAtLeft(addr, 1, &offset)) {
       // The address is in the chunk's left redzone, so maybe it is actually
-      // a right buffer overflow from the other chunk to the left.
-      // Search a bit to the left to see if there is another chunk.
+      // a right buffer overflow from the other chunk before.
+      // Search a bit before to see if there is another chunk.
       AsanChunk *m2 = nullptr;
       for (uptr l = 1; l < GetPageSizeCached(); l++) {
         m2 = GetAsanChunkByAddr(addr - l);

diff  --git a/compiler-rt/lib/asan/asan_descriptions.cpp b/compiler-rt/lib/asan/asan_descriptions.cpp
index d7d961685793d..fbe92572b55b2 100644
--- a/compiler-rt/lib/asan/asan_descriptions.cpp
+++ b/compiler-rt/lib/asan/asan_descriptions.cpp
@@ -129,11 +129,11 @@ static void PrintHeapChunkAccess(uptr addr, const ChunkAccess &descr) {
   str.append("%s", d.Location());
   switch (descr.access_type) {
     case kAccessTypeLeft:
-      str.append("%p is located %zd bytes to the left of",
+      str.append("%p is located %zd bytes before",
                  (void *)descr.bad_addr, descr.offset);
       break;
     case kAccessTypeRight:
-      str.append("%p is located %zd bytes to the right of",
+      str.append("%p is located %zd bytes after",
                  (void *)descr.bad_addr, descr.offset);
       break;
     case kAccessTypeInside:
@@ -279,17 +279,17 @@ static void DescribeAddressRelativeToGlobal(uptr addr, uptr access_size,
   Decorator d;
   str.append("%s", d.Location());
   if (addr < g.beg) {
-    str.append("%p is located %zd bytes to the left", (void *)addr,
+    str.append("%p is located %zd bytes before", (void *)addr,
                g.beg - addr);
   } else if (addr + access_size > g.beg + g.size) {
     if (addr < g.beg + g.size) addr = g.beg + g.size;
-    str.append("%p is located %zd bytes to the right", (void *)addr,
+    str.append("%p is located %zd bytes after", (void *)addr,
                addr - (g.beg + g.size));
   } else {
     // Can it happen?
-    str.append("%p is located %zd bytes inside", (void *)addr, addr - g.beg);
+    str.append("%p is located %zd bytes inside of", (void *)addr, addr - g.beg);
   }
-  str.append(" of global variable '%s' defined in '",
+  str.append(" global variable '%s' defined in '",
              MaybeDemangleGlobalName(g.name));
   PrintGlobalLocation(&str, g);
   str.append("' (0x%zx) of size %zu\n", g.beg, g.size);

diff  --git a/compiler-rt/lib/asan/tests/asan_mem_test.cpp b/compiler-rt/lib/asan/tests/asan_mem_test.cpp
index e2af1b8d79a95..5408a10a7c612 100644
--- a/compiler-rt/lib/asan/tests/asan_mem_test.cpp
+++ b/compiler-rt/lib/asan/tests/asan_mem_test.cpp
@@ -37,18 +37,18 @@ void MemSetOOBTestTemplate(size_t length) {
   MEMSET(array + length, 0, zero);
   MEMSET(array + length + 1, 0, zero);
 
-  // try to memset bytes to the right of array
+  // try to memset bytes after array
   EXPECT_DEATH(MEMSET(array, 0, size + 1),
                RightOOBWriteMessage(0));
   EXPECT_DEATH(MEMSET((char*)(array + length) - 1, element, 6),
                RightOOBWriteMessage(0));
   EXPECT_DEATH(MEMSET(array + 1, element, size + sizeof(T)),
                RightOOBWriteMessage(0));
-  // whole interval is to the right
+  // whole interval is after
   EXPECT_DEATH(MEMSET(array + length + 1, 0, 10),
                RightOOBWriteMessage(sizeof(T)));
 
-  // try to memset bytes to the left of array
+  // try to memset bytes before array
   EXPECT_DEATH(MEMSET((char*)array - 1, element, size),
                LeftOOBWriteMessage(1));
   EXPECT_DEATH(MEMSET((char*)array - 5, 0, 6),
@@ -58,11 +58,11 @@ void MemSetOOBTestTemplate(size_t length) {
     EXPECT_DEATH(memset(array - 5, element, size + 5 * sizeof(T)),
                  LeftOOBWriteMessage(5 * sizeof(T)));
   }
-  // whole interval is to the left
+  // whole interval is before
   EXPECT_DEATH(MEMSET(array - 2, 0, sizeof(T)),
                LeftOOBWriteMessage(2 * sizeof(T)));
 
-  // try to memset bytes both to the left & to the right
+  // try to memset bytes both before & after
   EXPECT_DEATH(MEMSET((char*)array - 2, element, size + 4),
                LeftOOBWriteMessage(2));
 
@@ -114,7 +114,7 @@ TEST(AddressSanitizer, LargeOOBInMemset) {
     // fprintf(stderr, "  large oob memset: %p %p %zd\n", x1, x2, size);
     // Do a memset on x1 with huge out-of-bound access that will end up in x2.
     EXPECT_DEATH(Ident(memset)(x1, 0, size * 2),
-                 "is located 0 bytes to the right");
+                 "is located 0 bytes after");
     delete [] x1;
     delete [] x2;
     return;
@@ -143,25 +143,25 @@ void MemTransferOOBTestTemplate(size_t length) {
   M::transfer(dest, src - 1, zero);
   M::transfer(dest, src, zero);
 
-  // try to change mem to the right of dest
+  // try to change mem after dest
   EXPECT_DEATH(M::transfer(dest + 1, src, size),
                RightOOBWriteMessage(0));
   EXPECT_DEATH(M::transfer((char*)(dest + length) - 1, src, 5),
                RightOOBWriteMessage(0));
 
-  // try to change mem to the left of dest
+  // try to change mem before dest
   EXPECT_DEATH(M::transfer(dest - 2, src, size),
                LeftOOBWriteMessage(2 * sizeof(T)));
   EXPECT_DEATH(M::transfer((char*)dest - 3, src, 4),
                LeftOOBWriteMessage(3));
 
-  // try to access mem to the right of src
+  // try to access mem after src
   EXPECT_DEATH(M::transfer(dest, src + 2, size),
                RightOOBReadMessage(0));
   EXPECT_DEATH(M::transfer(dest, (char*)(src + length) - 3, 6),
                RightOOBReadMessage(0));
 
-  // try to access mem to the left of src
+  // try to access mem before src
   EXPECT_DEATH(M::transfer(dest, src - 1, size),
                LeftOOBReadMessage(sizeof(T)));
   EXPECT_DEATH(M::transfer(dest, (char*)src - 6, 7),

diff  --git a/compiler-rt/lib/asan/tests/asan_oob_test.cpp b/compiler-rt/lib/asan/tests/asan_oob_test.cpp
index 6b178b5917d6a..56f573c1fc482 100644
--- a/compiler-rt/lib/asan/tests/asan_oob_test.cpp
+++ b/compiler-rt/lib/asan/tests/asan_oob_test.cpp
@@ -30,7 +30,7 @@ NOINLINE void oob_test(int size, int off) {
 
 static std::string GetLeftOOBMessage(int off) {
   char str[100];
-  sprintf(str, "is located.*%d byte.*to the left", off);
+  sprintf(str, "is located.*%d byte.*before", off);
   return str;
 }
 
@@ -38,12 +38,12 @@ static std::string GetRightOOBMessage(int off) {
   char str[100];
 #if !defined(_WIN32)
   // FIXME: Fix PR42868 and remove SEGV match.
-  sprintf(str, "is located.*%d byte.*to the right|SEGV", off);
+  sprintf(str, "is located.*%d byte.*after|SEGV", off);
 #else
   // `|` doesn't work in googletest's regexes on Windows,
   // see googletest/docs/advanced.md#regular-expression-syntax
   // But it's not needed on Windows anyways.
-  sprintf(str, "is located.*%d byte.*to the right", off);
+  sprintf(str, "is located.*%d byte.*after", off);
 #endif
   return str;
 }

diff  --git a/compiler-rt/lib/asan/tests/asan_str_test.cpp b/compiler-rt/lib/asan/tests/asan_str_test.cpp
index 12b8e5a5e671b..1bf6c3581d3aa 100644
--- a/compiler-rt/lib/asan/tests/asan_str_test.cpp
+++ b/compiler-rt/lib/asan/tests/asan_str_test.cpp
@@ -51,7 +51,7 @@ std::string RightOOBReadMessage(OOBKind oob_kind, int oob_distance) {
 }  // namespace
 
 // Input to a test is a zero-terminated string str with given length
-// Accesses to the bytes to the left and to the right of str
+// Accesses to the bytes before and after str
 // are presumed to produce OOB errors
 void StrLenOOBTestTemplate(char *str, size_t length, OOBKind oob_kind) {
   // Normal strlen calls
@@ -62,7 +62,7 @@ void StrLenOOBTestTemplate(char *str, size_t length, OOBKind oob_kind) {
   }
   // Arg of strlen is not malloced, OOB access
   if (oob_kind != OOBKind::Global) {
-    // We don't insert RedZones to the left of global variables
+    // We don't insert RedZones before global variables
     EXPECT_DEATH(Ident(strlen(str - 1)), LeftOOBReadMessage(oob_kind, 1));
     EXPECT_DEATH(Ident(strlen(str - 5)), LeftOOBReadMessage(oob_kind, 5));
   }

diff  --git a/compiler-rt/lib/asan/tests/asan_test.cpp b/compiler-rt/lib/asan/tests/asan_test.cpp
index eb61410d768fe..7aa0de5aa0a10 100644
--- a/compiler-rt/lib/asan/tests/asan_test.cpp
+++ b/compiler-rt/lib/asan/tests/asan_test.cpp
@@ -313,7 +313,7 @@ TEST(AddressSanitizer, SignalTest) {
 
 static void TestLargeMalloc(size_t size) {
   char buff[1024];
-  sprintf(buff, "is located 1 bytes to the left of %lu-byte", (long)size);
+  sprintf(buff, "is located 1 bytes before %lu-byte", (long)size);
   EXPECT_DEATH(Ident((char*)malloc(size))[-1] = 0, buff);
 }
 
@@ -329,7 +329,7 @@ TEST(AddressSanitizer, HugeMallocTest) {
   if (SANITIZER_WORDSIZE != 64 || ASAN_AVOID_EXPENSIVE_TESTS) return;
   size_t n_megs = 4100;
   EXPECT_DEATH(Ident((char*)malloc(n_megs << 20))[-1] = 0,
-               "is located 1 bytes to the left|"
+               "is located 1 bytes before|"
                "AddressSanitizer failed to allocate");
 }
 #endif
@@ -345,9 +345,9 @@ TEST(AddressSanitizer, memalign) {
   for (int align = 16; align <= (1 << 23); align *= 2) {
     size_t size = align * 5;
     EXPECT_DEATH(MemalignRun(align, size, -1),
-                 "is located 1 bytes to the left");
+                 "is located 1 bytes before");
     EXPECT_DEATH(MemalignRun(align, size, size + 1),
-                 "is located 1 bytes to the right");
+                 "is located 1 bytes after");
   }
 }
 #endif  // SANITIZER_TEST_HAS_MEMALIGN
@@ -734,7 +734,7 @@ TEST(AddressSanitizer, Store128Test) {
   EXPECT_DEATH(_mm_store_si128((__m128i*)p, value_wide),
                "WRITE of size 16");
   EXPECT_DEATH(_mm_store_si128((__m128i*)p, value_wide),
-               "located 0 bytes to the right of 12-byte");
+               "located 0 bytes after 12-byte");
   free(a);
 }
 #endif
@@ -747,7 +747,7 @@ std::string RightOOBErrorMessage(int oob_distance, bool is_write) {
 #if !GTEST_USES_SIMPLE_RE
           "buffer-overflow.*%s.*"
 #endif
-          "located %d bytes to the right",
+          "located %d bytes after",
 #if !GTEST_USES_SIMPLE_RE
           is_write ? "WRITE" : "READ",
 #endif
@@ -771,7 +771,7 @@ std::string LeftOOBErrorMessage(int oob_distance, bool is_write) {
 #if !GTEST_USES_SIMPLE_RE
           ASAN_PCRE_DOTALL "%s.*"
 #endif
-          "located %d bytes to the left",
+          "located %d bytes before",
 #if !GTEST_USES_SIMPLE_RE
           is_write ? "WRITE" : "READ",
 #endif
@@ -790,7 +790,7 @@ std::string LeftOOBReadMessage(int oob_distance) {
 std::string LeftOOBAccessMessage(int oob_distance) {
   assert(oob_distance > 0);
   char expected_str[100];
-  sprintf(expected_str, "located %d bytes to the left", oob_distance);
+  sprintf(expected_str, "located %d bytes before", oob_distance);
   return std::string(expected_str);
 }
 
@@ -812,7 +812,7 @@ char* MallocAndMemsetString(size_t size) {
   EXPECT_DEATH(READ_N_BYTES,                                             \
                ASAN_PCRE_DOTALL                                          \
                "AddressSanitizer: heap-buffer-overflow"                  \
-               ".* is located 0 bytes to the right of 10-byte region");  \
+               ".* is located 0 bytes after 10-byte region");  \
   close(fd);                                                             \
   delete [] x;                                                           \
 
@@ -1013,23 +1013,23 @@ TEST(AddressSanitizer, GlobalTest) {
   glob5[Ident(4)] = 0;
 
   EXPECT_DEATH(glob5[Ident(5)] = 0,
-               "0 bytes to the right of global variable.*glob5.* size 5");
+               "0 bytes after global variable.*glob5.* size 5");
   EXPECT_DEATH(glob5[Ident(5+6)] = 0,
-               "6 bytes to the right of global variable.*glob5.* size 5");
+               "6 bytes after global variable.*glob5.* size 5");
   Ident(static110);  // avoid optimizations
   static110[Ident(0)] = 0;
   static110[Ident(109)] = 0;
   EXPECT_DEATH(static110[Ident(110)] = 0,
-               "0 bytes to the right of global variable");
+               "0 bytes after global variable");
   EXPECT_DEATH(static110[Ident(110+7)] = 0,
-               "7 bytes to the right of global variable");
+               "7 bytes after global variable");
 
   Ident(func_static15);  // avoid optimizations
   func_static15[Ident(0)] = 0;
   EXPECT_DEATH(func_static15[Ident(15)] = 0,
-               "0 bytes to the right of global variable");
+               "0 bytes after global variable");
   EXPECT_DEATH(func_static15[Ident(15 + 9)] = 0,
-               "9 bytes to the right of global variable");
+               "9 bytes after global variable");
 
   Ident(fs1);
   Ident(fs2);
@@ -1037,12 +1037,12 @@ TEST(AddressSanitizer, GlobalTest) {
 
   // We don't create left redzones, so this is not 100% guaranteed to fail.
   // But most likely will.
-  EXPECT_DEATH(fs2[Ident(-1)] = 0, "is located.*of global variable");
+  EXPECT_DEATH(fs2[Ident(-1)] = 0, "is located.* global variable");
 
   EXPECT_DEATH(Ident(Ident(ConstGlob)[8]),
-               "is located 1 bytes to the right of .*ConstGlob");
+               "is located 1 bytes after .*ConstGlob");
   EXPECT_DEATH(Ident(Ident(StaticConstGlob)[5]),
-               "is located 2 bytes to the right of .*StaticConstGlob");
+               "is located 2 bytes after .*StaticConstGlob");
 
   // call stuff from another file.
   GlobalsTest(0);

diff  --git a/compiler-rt/test/asan/TestCases/Darwin/address-range-limit.mm b/compiler-rt/test/asan/TestCases/Darwin/address-range-limit.mm
index 5f0fd89f88992..7a389ca688cbf 100644
--- a/compiler-rt/test/asan/TestCases/Darwin/address-range-limit.mm
+++ b/compiler-rt/test/asan/TestCases/Darwin/address-range-limit.mm
@@ -38,4 +38,4 @@ int main(int argc, char *argv[]) {
 // CHECK: AddressSanitizer: heap-buffer-overflow
 // CHECK: WRITE of size 1
 // CHECK: {{#0 .* in main}}
-// CHECK: is located 0 bytes to the right of 10-byte region
+// CHECK: is located 0 bytes after 10-byte region

diff  --git a/compiler-rt/test/asan/TestCases/Darwin/dead-strip.c b/compiler-rt/test/asan/TestCases/Darwin/dead-strip.c
index cbbbe27f5d9f8..1b96bbf124c29 100644
--- a/compiler-rt/test/asan/TestCases/Darwin/dead-strip.c
+++ b/compiler-rt/test/asan/TestCases/Darwin/dead-strip.c
@@ -18,6 +18,6 @@ int dead[1] = {};
 
 int main(int argc, char *argv[]) {
   alive[argc] = 0;
-  // ASAN-CHECK: {{0x.* is located 0 bytes to the right of global variable}}
+  // ASAN-CHECK: {{0x.* is located 0 bytes after global variable}}
   return 0;
 }

diff  --git a/compiler-rt/test/asan/TestCases/Darwin/haswell-symbolication.cpp b/compiler-rt/test/asan/TestCases/Darwin/haswell-symbolication.cpp
index f5ed831f2224f..aa0b351adf45b 100644
--- a/compiler-rt/test/asan/TestCases/Darwin/haswell-symbolication.cpp
+++ b/compiler-rt/test/asan/TestCases/Darwin/haswell-symbolication.cpp
@@ -86,7 +86,7 @@ void faulty_func(char *p) {
   // CHECK: AddressSanitizer: global-buffer-overflow
   // CHECK-LI: #0 0x{{.*}} in faulty_func{{.*}} {{.*}}haswell-symbolication.cpp:[[@LINE-2]]
   // CHECK-NOLI: #0 0x{{.*}} in faulty_func{{.*}} {{.*}}haswell-symbolication
-  // CHECK: is located 2 bytes to the right of global variable 'faulty_global'
+  // CHECK: is located 2 bytes after global variable 'faulty_global'
   // CHECK-NOT: LLVMSymbolizer: error reading file
 }
 

diff  --git a/compiler-rt/test/asan/TestCases/Linux/global-overflow-bfd.cpp b/compiler-rt/test/asan/TestCases/Linux/global-overflow-bfd.cpp
index 117a761af91fc..bf82a517df37e 100644
--- a/compiler-rt/test/asan/TestCases/Linux/global-overflow-bfd.cpp
+++ b/compiler-rt/test/asan/TestCases/Linux/global-overflow-bfd.cpp
@@ -12,7 +12,7 @@ int main(int argc, char **argv) {
   memset(ZZZ, 0, 10);
   int res = YYY[argc * 10];  // BOOOM
   // CHECK: {{READ of size 1 at}}
-  // CHECK: {{located 0 bytes to the right of global variable}}
+  // CHECK: {{located 0 bytes after global variable}}
   res += XXX[argc] + ZZZ[argc];
   return res;
 }

diff  --git a/compiler-rt/test/asan/TestCases/Linux/global-overflow-lld.cpp b/compiler-rt/test/asan/TestCases/Linux/global-overflow-lld.cpp
index f4d0bc9776047..c926f3b43dda6 100644
--- a/compiler-rt/test/asan/TestCases/Linux/global-overflow-lld.cpp
+++ b/compiler-rt/test/asan/TestCases/Linux/global-overflow-lld.cpp
@@ -13,7 +13,7 @@ int main(int argc, char **argv) {
   memset(ZZZ, 0, 10);
   int res = YYY[argc * 10];  // BOOOM
   // CHECK: {{READ of size 1 at}}
-  // CHECK: {{located 0 bytes to the right of global variable}}
+  // CHECK: {{located 0 bytes after global variable}}
   res += XXX[argc] + ZZZ[argc];
   return res;
 }

diff  --git a/compiler-rt/test/asan/TestCases/Linux/malloc-in-qsort.cpp b/compiler-rt/test/asan/TestCases/Linux/malloc-in-qsort.cpp
index ea239244290f9..3544324c81a03 100644
--- a/compiler-rt/test/asan/TestCases/Linux/malloc-in-qsort.cpp
+++ b/compiler-rt/test/asan/TestCases/Linux/malloc-in-qsort.cpp
@@ -41,12 +41,12 @@ int main() {
 
 // Fast unwind may not unwind through qsort.
 // CHECK-FAST: ERROR: AddressSanitizer: heap-buffer-overflow
-// CHECK-FAST: is located 0 bytes to the right
+// CHECK-FAST: is located 0 bytes after
 // CHECK-FAST: #0{{.*}}operator new
 // CHECK-FAST-NEXT: #1{{.*}}QsortCallback
 
 // CHECK-SLOW: ERROR: AddressSanitizer: heap-buffer-overflow
-// CHECK-SLOW: is located 0 bytes to the right
+// CHECK-SLOW: is located 0 bytes after
 // CHECK-SLOW: #0{{.*}}operator new
 // CHECK-SLOW-NEXT: #1{{.*}}QsortCallback
 // CHECK-SLOW: #{{.*}}MyQsort

diff  --git a/compiler-rt/test/asan/TestCases/Linux/overflow-in-qsort.cpp b/compiler-rt/test/asan/TestCases/Linux/overflow-in-qsort.cpp
index 6990518e43ac9..9d380a218e8d9 100644
--- a/compiler-rt/test/asan/TestCases/Linux/overflow-in-qsort.cpp
+++ b/compiler-rt/test/asan/TestCases/Linux/overflow-in-qsort.cpp
@@ -40,10 +40,10 @@ int main() {
 // Fast unwind may not unwind through qsort.
 // CHECK-FAST: ERROR: AddressSanitizer: global-buffer-overflow
 // CHECK-FAST: #0{{.*}} in QsortCallback
-// CHECK-FAST: is located 0 bytes to the right of global variable 'global_array
+// CHECK-FAST: is located 0 bytes after global variable 'global_array
 
 // CHECK-SLOW: ERROR: AddressSanitizer: global-buffer-overflow
 // CHECK-SLOW: #0{{.*}} in QsortCallback
 // CHECK-SLOW: #{{.*}} in MyQsort
 // CHECK-SLOW: #{{.*}} in main
-// CHECK-SLOW: is located 0 bytes to the right of global variable 'global_array
+// CHECK-SLOW: is located 0 bytes after global variable 'global_array

diff  --git a/compiler-rt/test/asan/TestCases/PR52382.c b/compiler-rt/test/asan/TestCases/PR52382.c
index 9cab2b9640844..5a46683939597 100644
--- a/compiler-rt/test/asan/TestCases/PR52382.c
+++ b/compiler-rt/test/asan/TestCases/PR52382.c
@@ -9,4 +9,4 @@ int global_array[100] = {-1};
 int main(void) { return global_array[103]; }
 
 // CHECK: AddressSanitizer: global-buffer-overflow on address
-// CHECK: is located 12 bytes to the right of global variable 'global_array'
+// CHECK: is located 12 bytes after global variable 'global_array'

diff  --git a/compiler-rt/test/asan/TestCases/Posix/start-deactivated.cpp b/compiler-rt/test/asan/TestCases/Posix/start-deactivated.cpp
index c4f5f8c74a024..4ddfd423167d3 100644
--- a/compiler-rt/test/asan/TestCases/Posix/start-deactivated.cpp
+++ b/compiler-rt/test/asan/TestCases/Posix/start-deactivated.cpp
@@ -115,7 +115,7 @@ int main(int argc, char *argv[]) {
   // CHECK: AddressSanitizer: heap-buffer-overflow
   // CHECK: READ of size 1
   // CHECK: {{#0 .* in do_another_bad_thing}}
-  // CHECK: is located 5 bytes to the right of 100-byte region
+  // CHECK: is located 5 bytes after 100-byte region
   // CHECK: in do_another_bad_thing
 
   return 0;

diff  --git a/compiler-rt/test/asan/TestCases/Windows/calloc_left_oob.cpp b/compiler-rt/test/asan/TestCases/Windows/calloc_left_oob.cpp
index 309f4d36f6417..b83d6354d8035 100644
--- a/compiler-rt/test/asan/TestCases/Windows/calloc_left_oob.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/calloc_left_oob.cpp
@@ -9,7 +9,7 @@ int main() {
 // CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
 // CHECK: WRITE of size 4 at [[ADDR]] thread T0
 // CHECK-NEXT: {{#0 .* main .*calloc_left_oob.cpp}}:[[@LINE-3]]
-// CHECK: [[ADDR]] is located 4 bytes to the left of 168-byte region
+// CHECK: [[ADDR]] is located 4 bytes before 168-byte region
 // CHECK: allocated by thread T0 here:
 // CHECK-NEXT: {{#0 .* calloc }}
 // CHECK-NEXT: {{#1 .* main .*calloc_left_oob.cpp}}:[[@LINE-8]]

diff  --git a/compiler-rt/test/asan/TestCases/Windows/calloc_right_oob.cpp b/compiler-rt/test/asan/TestCases/Windows/calloc_right_oob.cpp
index 723da55356db2..504b67380793f 100644
--- a/compiler-rt/test/asan/TestCases/Windows/calloc_right_oob.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/calloc_right_oob.cpp
@@ -9,7 +9,7 @@ int main() {
 // CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
 // CHECK: WRITE of size 4 at [[ADDR]] thread T0
 // CHECK-NEXT: {{#0 .* main .*calloc_right_oob.cpp}}:[[@LINE-3]]
-// CHECK: [[ADDR]] is located 0 bytes to the right of 168-byte region
+// CHECK: [[ADDR]] is located 0 bytes after 168-byte region
 // CHECK: allocated by thread T0 here:
 // CHECK-NEXT: {{#0 .* calloc }}
 // CHECK-NEXT: {{#1 .* main .*calloc_right_oob.cpp}}:[[@LINE-8]]

diff  --git a/compiler-rt/test/asan/TestCases/Windows/dll_malloc_left_oob.cpp b/compiler-rt/test/asan/TestCases/Windows/dll_malloc_left_oob.cpp
index bab8577148076..194f31fe57d8c 100644
--- a/compiler-rt/test/asan/TestCases/Windows/dll_malloc_left_oob.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/dll_malloc_left_oob.cpp
@@ -12,7 +12,7 @@ int test_function() {
 // CHECK-NEXT: test_function {{.*}}dll_malloc_left_oob.cpp:[[@LINE-3]]
 // CHECK-NEXT: main {{.*}}dll_host.cpp
 //
-// CHECK: [[ADDR]] is located 1 bytes to the left of 42-byte region
+// CHECK: [[ADDR]] is located 1 bytes before 42-byte region
 // CHECK-LABEL: allocated by thread T0 here:
 // CHECK-NEXT:   malloc
 // CHECK-NEXT:   test_function {{.*}}dll_malloc_left_oob.cpp:[[@LINE-10]]

diff  --git a/compiler-rt/test/asan/TestCases/Windows/dll_operator_array_new_left_oob.cpp b/compiler-rt/test/asan/TestCases/Windows/dll_operator_array_new_left_oob.cpp
index 95064d7aeb0da..b5e980ae0b0bd 100644
--- a/compiler-rt/test/asan/TestCases/Windows/dll_operator_array_new_left_oob.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/dll_operator_array_new_left_oob.cpp
@@ -11,7 +11,7 @@ int test_function() {
 // CHECK-NEXT: test_function {{.*}}dll_operator_array_new_left_oob.cpp:[[@LINE-3]]
 // CHECK-NEXT: main {{.*}}dll_host.cpp
 //
-// CHECK: [[ADDR]] is located 1 bytes to the left of 42-byte region
+// CHECK: [[ADDR]] is located 1 bytes before 42-byte region
 // CHECK-LABEL: allocated by thread T0 here:
 // FIXME: Should get rid of the malloc/free frames called from the inside of
 // operator new/delete in DLLs when using -MT CRT.

diff  --git a/compiler-rt/test/asan/TestCases/Windows/dll_operator_array_new_with_dtor_left_oob.cpp b/compiler-rt/test/asan/TestCases/Windows/dll_operator_array_new_with_dtor_left_oob.cpp
index e81057d889d94..5e34071ce48c8 100644
--- a/compiler-rt/test/asan/TestCases/Windows/dll_operator_array_new_with_dtor_left_oob.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/dll_operator_array_new_with_dtor_left_oob.cpp
@@ -21,7 +21,7 @@ int test_function() {
 // FIXME: Currently it says "4 bytes ... left of 172-byte region",
 //        should be "8 bytes ... left of 168-byte region", see
 //        https://code.google.com/p/address-sanitizer/issues/detail?id=314
-// CHECK: [[ADDR]] is located {{.*}} bytes to the left of {{(172|176)}}-byte region
+// CHECK: [[ADDR]] is located {{.*}} bytes before {{(172|176)}}-byte region
 // FIXME: Should get rid of the malloc/free frames called from the inside of
 // operator new/delete in DLLs when using -MT CRT.
 // FIXME: The operator new frame should have [].

diff  --git a/compiler-rt/test/asan/TestCases/Windows/fuse-lld-globals.cpp b/compiler-rt/test/asan/TestCases/Windows/fuse-lld-globals.cpp
index cb068431e12e1..3ee413b7dfd4e 100644
--- a/compiler-rt/test/asan/TestCases/Windows/fuse-lld-globals.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/fuse-lld-globals.cpp
@@ -11,7 +11,7 @@ int main(int argc, char **argv) {
   int res = YYY[argc * 10];  // BOOOM
   // CHECK: {{READ of size 1 at 0x.* thread T0}}
   // CHECK: {{    #0 0x.* in main .*fuse-lld-globals.cpp:}}[[@LINE-2]]
-  // CHECK: {{0x.* is located 0 bytes to the right of global variable}}
+  // CHECK: {{0x.* is located 0 bytes after global variable}}
   // CHECK:   {{.*YYY.* of size 10}}
   res += XXX[argc] + ZZZ[argc];
   return res;

diff  --git a/compiler-rt/test/asan/TestCases/Windows/global_const_string_oob.cpp b/compiler-rt/test/asan/TestCases/Windows/global_const_string_oob.cpp
index 2c5c8644149e5..adc9b24c16240 100644
--- a/compiler-rt/test/asan/TestCases/Windows/global_const_string_oob.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/global_const_string_oob.cpp
@@ -13,7 +13,7 @@ int main(void) {
   // CHECK: AddressSanitizer: global-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
   // CHECK: READ of size 1 at [[ADDR]] thread T0
   // CHECK-NEXT:   {{#0 .* main .*global_const_string_oob.cpp:}}[[@LINE-5]]
-  // CHECK: [[ADDR]] is located 5 bytes to the right of global variable [[STR:.*]] defined in {{'.*global_const_string_oob.cpp' .*}} of size 11
+  // CHECK: [[ADDR]] is located 5 bytes after global variable [[STR:.*]] defined in {{'.*global_const_string_oob.cpp' .*}} of size 11
   // CHECK:   [[STR]] is ascii string 'foobarspam'
   return 0;
 }

diff  --git a/compiler-rt/test/asan/TestCases/Windows/intercept_strdup.cpp b/compiler-rt/test/asan/TestCases/Windows/intercept_strdup.cpp
index 46a59ead60c28..0e4bd13a321dd 100644
--- a/compiler-rt/test/asan/TestCases/Windows/intercept_strdup.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/intercept_strdup.cpp
@@ -18,7 +18,7 @@ int main() {
 // CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
 // CHECK: WRITE of size 1 at [[ADDR]] thread T0
 // CHECK:   {{#0 .* main .*}}intercept_strdup.cpp:[[@LINE-3]]
-// CHECK: [[ADDR]] is located 1 bytes to the left of 6-byte region
+// CHECK: [[ADDR]] is located 1 bytes before 6-byte region
 // CHECK: allocated by thread T0 here:
 //
 // The first frame is our wrapper normally but will be malloc in the dynamic

diff  --git a/compiler-rt/test/asan/TestCases/Windows/malloc_left_oob.cpp b/compiler-rt/test/asan/TestCases/Windows/malloc_left_oob.cpp
index cf8a1b7086c31..4b92e11ff093e 100644
--- a/compiler-rt/test/asan/TestCases/Windows/malloc_left_oob.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/malloc_left_oob.cpp
@@ -9,7 +9,7 @@ int main() {
 // CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
 // CHECK: WRITE of size 1 at [[ADDR]] thread T0
 // CHECK-NEXT: {{#0 .* main .*malloc_left_oob.cpp}}:[[@LINE-3]]
-// CHECK: [[ADDR]] is located 1 bytes to the left of 42-byte region
+// CHECK: [[ADDR]] is located 1 bytes before 42-byte region
 // CHECK: allocated by thread T0 here:
 // CHECK-NEXT: {{#0 .* malloc }}
 // CHECK-NEXT: {{#1 .* main .*malloc_left_oob.cpp}}:[[@LINE-8]]

diff  --git a/compiler-rt/test/asan/TestCases/Windows/malloc_right_oob.cpp b/compiler-rt/test/asan/TestCases/Windows/malloc_right_oob.cpp
index acb55a3a2c407..890503ceaff9b 100644
--- a/compiler-rt/test/asan/TestCases/Windows/malloc_right_oob.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/malloc_right_oob.cpp
@@ -9,7 +9,7 @@ int main() {
 // CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
 // CHECK: WRITE of size 1 at [[ADDR]] thread T0
 // CHECK-NEXT: {{#0 .* main .*malloc_right_oob.cpp}}:[[@LINE-3]]
-// CHECK: [[ADDR]] is located 0 bytes to the right of 42-byte region
+// CHECK: [[ADDR]] is located 0 bytes after 42-byte region
 // CHECK: allocated by thread T0 here:
 // CHECK-NEXT: {{#0 .* malloc }}
 // CHECK-NEXT: {{#1 .* main .*malloc_right_oob.cpp}}:[[@LINE-8]]

diff  --git a/compiler-rt/test/asan/TestCases/Windows/operator_array_new_left_oob.cpp b/compiler-rt/test/asan/TestCases/Windows/operator_array_new_left_oob.cpp
index a1abd7e1ea71f..d06bcb22da596 100644
--- a/compiler-rt/test/asan/TestCases/Windows/operator_array_new_left_oob.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/operator_array_new_left_oob.cpp
@@ -8,7 +8,7 @@ int main() {
 // CHECK: WRITE of size 1 at [[ADDR]] thread T0
 // CHECK-NEXT: {{#0 .* main .*operator_array_new_left_oob.cpp}}:[[@LINE-3]]
 //
-// CHECK: [[ADDR]] is located 1 bytes to the left of 42-byte region
+// CHECK: [[ADDR]] is located 1 bytes before 42-byte region
 // CHECK-LABEL: allocated by thread T0 here:
 // FIXME: The 'operator new' frame should have [].
 // CHECK-NEXT: {{#0 .* operator new}}

diff  --git a/compiler-rt/test/asan/TestCases/Windows/operator_array_new_right_oob.cpp b/compiler-rt/test/asan/TestCases/Windows/operator_array_new_right_oob.cpp
index 05395c0bfb321..c60a351594304 100644
--- a/compiler-rt/test/asan/TestCases/Windows/operator_array_new_right_oob.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/operator_array_new_right_oob.cpp
@@ -9,7 +9,7 @@ int main() {
 // CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
 // CHECK: WRITE of size 1 at [[ADDR]] thread T0
 // CHECK:   {{#0 .* main .*operator_array_new_right_oob.cpp}}:[[@LINE-3]]
-// CHECK: [[ADDR]] is located 0 bytes to the right of 42-byte region
+// CHECK: [[ADDR]] is located 0 bytes after 42-byte region
 // CHECK: allocated by thread T0 here:
 // FIXME: The 'operator new' frame should have [].
 // CHECK:   {{#0 .* operator new}}

diff  --git a/compiler-rt/test/asan/TestCases/Windows/operator_array_new_with_dtor_left_oob.cpp b/compiler-rt/test/asan/TestCases/Windows/operator_array_new_with_dtor_left_oob.cpp
index 97e85f4f96123..42904089481cf 100644
--- a/compiler-rt/test/asan/TestCases/Windows/operator_array_new_with_dtor_left_oob.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/operator_array_new_with_dtor_left_oob.cpp
@@ -18,7 +18,7 @@ int main() {
 // FIXME: Currently it says "4 bytes ... left of 172-byte region",
 //        should be "8 bytes ... left of 168-byte region", see
 //        https://code.google.com/p/address-sanitizer/issues/detail?id=314
-// CHECK: [[ADDR]] is located {{.*}} bytes to the left of {{(172|176)}}-byte region
+// CHECK: [[ADDR]] is located {{.*}} bytes before {{(172|176)}}-byte region
 // CHECK-LABEL: allocated by thread T0 here:
 // FIXME: The 'operator new' frame should have [].
 // CHECK-NEXT: {{#0 .* operator new}}

diff  --git a/compiler-rt/test/asan/TestCases/Windows/operator_new_left_oob.cpp b/compiler-rt/test/asan/TestCases/Windows/operator_new_left_oob.cpp
index 404b6a2842f0d..f339496b56ffc 100644
--- a/compiler-rt/test/asan/TestCases/Windows/operator_new_left_oob.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/operator_new_left_oob.cpp
@@ -9,7 +9,7 @@ int main() {
 // CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
 // CHECK: WRITE of size 1 at [[ADDR]] thread T0
 // CHECK:   {{#0 .* main .*operator_new_left_oob.cpp}}:[[@LINE-3]]
-// CHECK: [[ADDR]] is located 1 bytes to the left of 1-byte region
+// CHECK: [[ADDR]] is located 1 bytes before 1-byte region
 // CHECK: allocated by thread T0 here:
 // CHECK:   {{#0 .* operator new}}
 // CHECK:   {{#1 .* main .*operator_new_left_oob.cpp}}:[[@LINE-8]]

diff  --git a/compiler-rt/test/asan/TestCases/Windows/operator_new_right_oob.cpp b/compiler-rt/test/asan/TestCases/Windows/operator_new_right_oob.cpp
index 113266bbba861..8e76790b021fa 100644
--- a/compiler-rt/test/asan/TestCases/Windows/operator_new_right_oob.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/operator_new_right_oob.cpp
@@ -9,7 +9,7 @@ int main() {
 // CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
 // CHECK: WRITE of size 1 at [[ADDR]] thread T0
 // CHECK:   {{#0 .* main .*operator_new_right_oob.cpp}}:[[@LINE-3]]
-// CHECK: [[ADDR]] is located 0 bytes to the right of 1-byte region
+// CHECK: [[ADDR]] is located 0 bytes after 1-byte region
 // CHECK: allocated by thread T0 here:
 // CHECK:   {{#0 .* operator new}}
 // CHECK:   {{#1 .* main .*operator_new_right_oob.cpp}}:[[@LINE-8]]

diff  --git a/compiler-rt/test/asan/TestCases/Windows/realloc_left_oob.cpp b/compiler-rt/test/asan/TestCases/Windows/realloc_left_oob.cpp
index 08fd6c91b404c..709f8ea7f3476 100644
--- a/compiler-rt/test/asan/TestCases/Windows/realloc_left_oob.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/realloc_left_oob.cpp
@@ -9,7 +9,7 @@ int main() {
 // CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
 // CHECK: WRITE of size 1 at [[ADDR]] thread T0
 // CHECK-NEXT: {{#0 .* main .*realloc_left_oob.cpp}}:[[@LINE-3]]
-// CHECK: [[ADDR]] is located 1 bytes to the left of 42-byte region
+// CHECK: [[ADDR]] is located 1 bytes before 42-byte region
 // CHECK: allocated by thread T0 here:
 // CHECK-NEXT: {{#0 .* realloc }}
 // CHECK-NEXT: {{#1 .* main .*realloc_left_oob.cpp}}:[[@LINE-8]]

diff  --git a/compiler-rt/test/asan/TestCases/Windows/realloc_right_oob.cpp b/compiler-rt/test/asan/TestCases/Windows/realloc_right_oob.cpp
index aded5a057e2c6..5ae7eee5d35bf 100644
--- a/compiler-rt/test/asan/TestCases/Windows/realloc_right_oob.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/realloc_right_oob.cpp
@@ -9,7 +9,7 @@ int main() {
 // CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
 // CHECK: WRITE of size 1 at [[ADDR]] thread T0
 // CHECK-NEXT: {{#0 .* main .*realloc_right_oob.cpp}}:[[@LINE-3]]
-// CHECK: [[ADDR]] is located 0 bytes to the right of 42-byte region
+// CHECK: [[ADDR]] is located 0 bytes after 42-byte region
 // CHECK: allocated by thread T0 here:
 // CHECK-NEXT: {{#0 .* realloc }}
 // CHECK-NEXT: {{#1 .* main .*realloc_right_oob.cpp}}:[[@LINE-8]]

diff  --git a/compiler-rt/test/asan/TestCases/Windows/symbols_path.cpp b/compiler-rt/test/asan/TestCases/Windows/symbols_path.cpp
index bb07570d8a3f9..812ccf2e251a7 100644
--- a/compiler-rt/test/asan/TestCases/Windows/symbols_path.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/symbols_path.cpp
@@ -14,7 +14,7 @@ int main() {
 // CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
 // CHECK: WRITE of size 1 at [[ADDR]] thread T0
 // CHECK-NEXT: {{#0 .* main .*symbols_path.cpp}}:[[@LINE-3]]
-// CHECK: [[ADDR]] is located 1 bytes to the left of 42-byte region
+// CHECK: [[ADDR]] is located 1 bytes before 42-byte region
 // CHECK: allocated by thread T0 here:
 // CHECK-NEXT: {{#0 .* malloc}}
 // CHECK-NEXT: {{#1 .* main .*symbols_path.cpp}}:[[@LINE-8]]

diff  --git a/compiler-rt/test/asan/TestCases/Windows/wrong_downcast_on_heap.cpp b/compiler-rt/test/asan/TestCases/Windows/wrong_downcast_on_heap.cpp
index b9627089436e6..ec5a92d9c615b 100644
--- a/compiler-rt/test/asan/TestCases/Windows/wrong_downcast_on_heap.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/wrong_downcast_on_heap.cpp
@@ -18,7 +18,7 @@ int main(void) {
 // CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
 // CHECK: WRITE of size 4 at [[ADDR]] thread T0
 // CHECK:   {{#0 0x[0-9a-f]* in main .*wrong_downcast_on_heap.cpp}}:[[@LINE-3]]
-// CHECK: [[ADDR]] is located 0 bytes to the right of 4-byte region
+// CHECK: [[ADDR]] is located 0 bytes after 4-byte region
 // CHECK: allocated by thread T0 here:
 // CHECK:   #0 {{.*}} operator new
   return 0;

diff  --git a/compiler-rt/test/asan/TestCases/global-demangle.cpp b/compiler-rt/test/asan/TestCases/global-demangle.cpp
index 844a851a77228..564e2263daa65 100644
--- a/compiler-rt/test/asan/TestCases/global-demangle.cpp
+++ b/compiler-rt/test/asan/TestCases/global-demangle.cpp
@@ -11,7 +11,7 @@ char YYY::ZZZ[] = "abc";
 int main(int argc, char **argv) {
   return (int)XXX::YYY::ZZZ[argc + 5];  // BOOM
   // CHECK: {{READ of size 1 at 0x.*}}
-  // CHECK: {{0x.* is located 2 bytes to the right of global variable}}
+  // CHECK: {{0x.* is located 2 bytes after global variable}}
   // CHECK: '{{.*}}XXX::YYY::ZZZ{{.*}}' {{.*}} of size 4
   // CHECK: '{{.*}}XXX::YYY::ZZZ{{.*}}' is ascii string 'abc'
 }

diff  --git a/compiler-rt/test/asan/TestCases/global-location-nodebug.cpp b/compiler-rt/test/asan/TestCases/global-location-nodebug.cpp
index 0c8f05feaa127..d1b20d7399e60 100644
--- a/compiler-rt/test/asan/TestCases/global-location-nodebug.cpp
+++ b/compiler-rt/test/asan/TestCases/global-location-nodebug.cpp
@@ -15,8 +15,8 @@
 // UNSUPPORTED: windows
 
 // CHECK: AddressSanitizer: global-buffer-overflow
-// CLASS_STATIC-NO-G: 0x{{.*}} is located 4 bytes to the right of global variable '{{.*}}C::array{{.*}}' defined in '{{.*}}global-location.cpp' {{.*}} of size 40
-// GLOB-NO-G: 0x{{.*}} is located 4 bytes to the right of global variable '{{.*}}global{{.*}}' defined in '{{.*}}global-location.cpp' {{.*}} of size 40
-// FUNC_STATIC-NO-G: 0x{{.*}} is located 4 bytes to the right of global variable '{{.*}}main::array{{.*}}' defined in '{{.*}}global-location.cpp' {{.*}} of size 40
-// LITERAL-NO-G: 0x{{.*}} is located 0 bytes to the right of global variable {{.*}} defined in '{{.*}}global-location.cpp' {{.*}} of size 11
+// CLASS_STATIC-NO-G: 0x{{.*}} is located 4 bytes after global variable '{{.*}}C::array{{.*}}' defined in '{{.*}}global-location.cpp' {{.*}} of size 40
+// GLOB-NO-G: 0x{{.*}} is located 4 bytes after global variable '{{.*}}global{{.*}}' defined in '{{.*}}global-location.cpp' {{.*}} of size 40
+// FUNC_STATIC-NO-G: 0x{{.*}} is located 4 bytes after global variable '{{.*}}main::array{{.*}}' defined in '{{.*}}global-location.cpp' {{.*}} of size 40
+// LITERAL-NO-G: 0x{{.*}} is located 0 bytes after global variable {{.*}} defined in '{{.*}}global-location.cpp' {{.*}} of size 11
 // CHECK: SUMMARY: AddressSanitizer: global-buffer-overflow

diff  --git a/compiler-rt/test/asan/TestCases/global-location.cpp b/compiler-rt/test/asan/TestCases/global-location.cpp
index 742c4f77effc5..c5fe34b6332c3 100644
--- a/compiler-rt/test/asan/TestCases/global-location.cpp
+++ b/compiler-rt/test/asan/TestCases/global-location.cpp
@@ -16,11 +16,11 @@
 
 struct C {
   static int array[10];
-  // CLASS_STATIC:      0x{{.*}} is located 4 bytes to the right of global variable 'C::array' defined in '{{.*}}global-location.cpp:[[@LINE-1]]' {{.*}} of size 40
+  // CLASS_STATIC:      0x{{.*}} is located 4 bytes after global variable 'C::array' defined in '{{.*}}global-location.cpp:[[@LINE-1]]' {{.*}} of size 40
 };
 
 int global[10];
-// GLOB:      0x{{.*}} is located 4 bytes to the right of global variable 'global' defined in '{{.*}}global-location.cpp:[[@LINE-1]]' {{.*}} of size 40
+// GLOB:      0x{{.*}} is located 4 bytes after global variable 'global' defined in '{{.*}}global-location.cpp:[[@LINE-1]]' {{.*}} of size 40
 int C::array[10];
 
 int main(int argc, char **argv) {
@@ -30,12 +30,12 @@ int main(int argc, char **argv) {
   case 'c': return C::array[one * 11];
   case 'f':
     static int array[10];
-    // FUNC_STATIC:      0x{{.*}} is located 4 bytes to the right of global variable 'main::array' defined in '{{.*}}global-location.cpp:[[@LINE-1]]' {{.*}} of size 40
+    // FUNC_STATIC:      0x{{.*}} is located 4 bytes after global variable 'main::array' defined in '{{.*}}global-location.cpp:[[@LINE-1]]' {{.*}} of size 40
     memset(array, 0, 10);
     return array[one * 11];
   case 'l':
     const char *str = "0123456789";
-    // LITERAL:      0x{{.*}} is located 0 bytes to the right of global variable {{.*}} defined in '{{.*}}global-location.cpp:[[@LINE-1]]' {{.*}} of size 11
+    // LITERAL:      0x{{.*}} is located 0 bytes after global variable {{.*}} defined in '{{.*}}global-location.cpp:[[@LINE-1]]' {{.*}} of size 11
     return str[one * 11];
   }
   return 0;

diff  --git a/compiler-rt/test/asan/TestCases/global-overflow.cpp b/compiler-rt/test/asan/TestCases/global-overflow.cpp
index d0aab2adee33c..df44d67658572 100644
--- a/compiler-rt/test/asan/TestCases/global-overflow.cpp
+++ b/compiler-rt/test/asan/TestCases/global-overflow.cpp
@@ -14,7 +14,7 @@ int main(int argc, char **argv) {
   int res = YYY[argc * 10];  // BOOOM
   // CHECK: {{READ of size 1 at 0x.* thread T0}}
   // CHECK: {{    #0 0x.* in main .*global-overflow.cpp:}}[[@LINE-2]]
-  // CHECK: {{0x.* is located 0 bytes to the right of global variable}}
+  // CHECK: {{0x.* is located 0 bytes after global variable}}
   // CHECK:   {{.*YYY.* of size 10}}
   res += XXX[argc] + ZZZ[argc];
   return res;

diff  --git a/compiler-rt/test/asan/TestCases/global-underflow.cpp b/compiler-rt/test/asan/TestCases/global-underflow.cpp
index 81aac5897117f..32b4ce82f9b04 100644
--- a/compiler-rt/test/asan/TestCases/global-underflow.cpp
+++ b/compiler-rt/test/asan/TestCases/global-underflow.cpp
@@ -10,7 +10,7 @@ int main(int argc, char **argv) {
   memset(XXX, 0, 2*sizeof(int));
   // CHECK: {{READ of size 4 at 0x.* thread T0}}
   // CHECK: {{    #0 0x.* in main .*global-underflow.cpp:}}[[@LINE+3]]
-  // CHECK: {{0x.* is located 4 bytes to the left of global variable}}
+  // CHECK: {{0x.* is located 4 bytes before global variable}}
   // CHECK:   {{.*YYY.* of size 12}}
   int res = YYY[-1];
   return res;

diff  --git a/compiler-rt/test/asan/TestCases/heap-overflow.cpp b/compiler-rt/test/asan/TestCases/heap-overflow.cpp
index a9b62d8743546..f5bdcd5386373 100644
--- a/compiler-rt/test/asan/TestCases/heap-overflow.cpp
+++ b/compiler-rt/test/asan/TestCases/heap-overflow.cpp
@@ -15,7 +15,7 @@ int main(int argc, char **argv) {
   int res = x[argc * 10];  // BOOOM
   // CHECK: {{READ of size 1 at 0x.* thread T0}}
   // CHECK: {{    #0 0x.* in main .*heap-overflow.cpp:}}[[@LINE-2]]
-  // CHECK: {{0x.* is located 0 bytes to the right of 10-byte region}}
+  // CHECK: {{0x.* is located 0 bytes after 10-byte region}}
   // CHECK: {{allocated by thread T0 here:}}
 
   // CHECK: {{    #0 0x.* in .*malloc}}

diff  --git a/compiler-rt/test/asan/TestCases/huge_negative_hea_oob.cpp b/compiler-rt/test/asan/TestCases/huge_negative_hea_oob.cpp
index 96e7e613d4bbe..69247dd20b833 100644
--- a/compiler-rt/test/asan/TestCases/huge_negative_hea_oob.cpp
+++ b/compiler-rt/test/asan/TestCases/huge_negative_hea_oob.cpp
@@ -1,13 +1,13 @@
 // RUN: %clangxx_asan %s -o %t && not %run %t 2>&1 | FileCheck %s
 // RUN: %clangxx_asan -O %s -o %t && not %run %t 2>&1 | FileCheck %s
-// Check that we can find huge buffer overflows to the left.
+// Check that we can find huge buffer overflows before.
 #include <stdlib.h>
 #include <string.h>
 int main(int argc, char **argv) {
   char *x = (char*)malloc(1 << 20);
   memset(x, 0, 10);
   int res = x[-argc * 4000];  // BOOOM
-  // CHECK: is located 4000 bytes to the left of
+  // CHECK: is located 4000 bytes before
   free(x);
   return res;
 }

diff  --git a/compiler-rt/test/asan/TestCases/large_func_test.cpp b/compiler-rt/test/asan/TestCases/large_func_test.cpp
index 563c1458c966e..37fec8bef6ce8 100644
--- a/compiler-rt/test/asan/TestCases/large_func_test.cpp
+++ b/compiler-rt/test/asan/TestCases/large_func_test.cpp
@@ -46,7 +46,7 @@ int main(int argc, char **argv) {
   int *x = new int[100];
   LargeFunction(x, argc - 1);
   // CHECK: {{    #1 0x.* in main .*large_func_test.cpp:}}[[@LINE-1]]
-  // CHECK: {{0x.* is located 12 bytes to the right of 400-byte region}}
+  // CHECK: {{0x.* is located 12 bytes after 400-byte region}}
   // CHECK: {{allocated by thread T0 here:}}
   // CHECK-Linux:  {{    #0 0x.* in operator new}}
   // CHECK-SunOS:  {{    #0 0x.* in operator new}}

diff  --git a/compiler-rt/test/asan/TestCases/load_and_store_n.cpp b/compiler-rt/test/asan/TestCases/load_and_store_n.cpp
index 6e437e452889f..87d1565314c32 100644
--- a/compiler-rt/test/asan/TestCases/load_and_store_n.cpp
+++ b/compiler-rt/test/asan/TestCases/load_and_store_n.cpp
@@ -19,10 +19,10 @@
 // RUN: not %run %t D 2>&1 | FileCheck %s --check-prefix=CHECK_1_BYTES
 
 // CHECK_0_BYTES: ERROR: AddressSanitizer: global-buffer-overflow on address [[ADDR:.*]] at
-// CHECK_0_BYTES: [[ADDR]] is located 0 bytes to the right
+// CHECK_0_BYTES: [[ADDR]] is located 0 bytes after
 
 // CHECK_1_BYTES: ERROR: AddressSanitizer: global-buffer-overflow on address [[ADDR:.*]] at
-// CHECK_1_BYTES: [[ADDR]] is located 1 bytes to the right
+// CHECK_1_BYTES: [[ADDR]] is located 1 bytes after
 
 #include <sanitizer/asan_interface.h>
 

diff  --git a/compiler-rt/test/asan/TestCases/partial_right.cpp b/compiler-rt/test/asan/TestCases/partial_right.cpp
index b60c1a5976355..9ba1f8e525423 100644
--- a/compiler-rt/test/asan/TestCases/partial_right.cpp
+++ b/compiler-rt/test/asan/TestCases/partial_right.cpp
@@ -8,6 +8,6 @@ int main(int argc, char **argv) {
   volatile int *x = (int*)malloc(2*sizeof(int) + 2);
   int res = x[2];  // BOOOM
   // CHECK: {{READ of size 4 at 0x.* thread T0}}
-  // CHECK: [[ADDR:0x[01-9a-fa-f]+]] is located 0 bytes to the right of {{.*}}-byte region [{{.*}},{{.*}}[[ADDR]])
+  // CHECK: [[ADDR:0x[01-9a-fa-f]+]] is located 0 bytes after {{.*}}-byte region [{{.*}},{{.*}}[[ADDR]])
   return res;
 }

diff  --git a/compiler-rt/test/asan/TestCases/poison_partial.cpp b/compiler-rt/test/asan/TestCases/poison_partial.cpp
index 3a1b4199945ed..41f0942e6b9fb 100644
--- a/compiler-rt/test/asan/TestCases/poison_partial.cpp
+++ b/compiler-rt/test/asan/TestCases/poison_partial.cpp
@@ -16,4 +16,4 @@ int main(int argc, char **argv) {
   int *y = (int*)x;
   return y[5];
 }
-// CHECK: 0 bytes to the right
+// CHECK: 0 bytes after

diff  --git a/compiler-rt/test/asan/TestCases/strncpy-overflow.cpp b/compiler-rt/test/asan/TestCases/strncpy-overflow.cpp
index 19497efaed989..d852ccebd9a77 100644
--- a/compiler-rt/test/asan/TestCases/strncpy-overflow.cpp
+++ b/compiler-rt/test/asan/TestCases/strncpy-overflow.cpp
@@ -30,7 +30,7 @@ int main(int argc, char **argv) {
   // CHECK: {{WRITE of size 10 at 0x.* thread T0}}
   // CHECK: {{    #0 0x.* in .*strncpy}}
   // CHECK: {{    #1 0x.* in main .*strncpy-overflow.cpp:}}[[@LINE-3]]
-  // CHECK: {{0x.* is located 0 bytes to the right of 9-byte region}}
+  // CHECK: {{0x.* is located 0 bytes after 9-byte region}}
   // CHECK: {{allocated by thread T0 here:}}
   // CHECK: {{    #0 0x.* in .*malloc}}
   // CHECK: {{    #1 0x.* in main .*strncpy-overflow.cpp:}}[[@LINE-8]]

diff  --git a/compiler-rt/test/asan/TestCases/unaligned_loads_and_stores.cpp b/compiler-rt/test/asan/TestCases/unaligned_loads_and_stores.cpp
index 17415971c2e6d..62f4870f379b7 100644
--- a/compiler-rt/test/asan/TestCases/unaligned_loads_and_stores.cpp
+++ b/compiler-rt/test/asan/TestCases/unaligned_loads_and_stores.cpp
@@ -24,7 +24,7 @@ int main(int argc, char **argv) {
     case 'A': res = __sanitizer_unaligned_load16(x + 15); break;
 //  CHECK-A ERROR: AddressSanitizer: heap-buffer-overflow on address
 //  CHECK-A: main{{.*}}unaligned_loads_and_stores.cpp:[[@LINE-2]]
-//  CHECK-A: is located 0 bytes to the right of 16-byte region
+//  CHECK-A: is located 0 bytes after 16-byte region
     case 'B': res = __sanitizer_unaligned_load32(x + 14); break;
 //  CHECK-B: main{{.*}}unaligned_loads_and_stores.cpp:[[@LINE-1]]
     case 'C': res = __sanitizer_unaligned_load32(x + 13); break;
@@ -37,7 +37,7 @@ int main(int argc, char **argv) {
     case 'K': __sanitizer_unaligned_store16(x + 15, 0); break;
 //  CHECK-K ERROR: AddressSanitizer: heap-buffer-overflow on address
 //  CHECK-K: main{{.*}}unaligned_loads_and_stores.cpp:[[@LINE-2]]
-//  CHECK-K: is located 0 bytes to the right of 16-byte region
+//  CHECK-K: is located 0 bytes after 16-byte region
     case 'L': __sanitizer_unaligned_store32(x + 15, 0); break;
 //  CHECK-L: main{{.*}}unaligned_loads_and_stores.cpp:[[@LINE-1]]
     case 'M': __sanitizer_unaligned_store32(x + 13, 0); break;


        


More information about the llvm-commits mailing list