Index: lib/msan/msan.h =================================================================== --- lib/msan/msan.h +++ lib/msan/msan.h @@ -329,11 +329,20 @@ StackTrace::GetCurrentPc(), GET_CURRENT_FRAME(), \ common_flags()->fast_unwind_on_malloc) +// For platforms which support slow unwinder only, we restrict the store context +// size to 1, basically only storing the current pc. We do this because the slow +// unwinder which is based on libunwind is not async signal safe and causes +// random freezes in forking applications as well as in signal handlers. #define GET_STORE_STACK_TRACE_PC_BP(pc, bp) \ BufferedStackTrace stack; \ - if (__msan_get_track_origins() > 1 && msan_inited) \ - GetStackTrace(&stack, flags()->store_context_size, pc, bp, \ - common_flags()->fast_unwind_on_malloc) + if (__msan_get_track_origins() > 1 && msan_inited) { \ + if (!SANITIZER_CAN_FAST_UNWIND) \ + GetStackTrace(&stack, 1, pc, bp, \ + common_flags()->fast_unwind_on_malloc); \ + else \ + GetStackTrace(&stack, flags()->store_context_size, pc, bp, \ + common_flags()->fast_unwind_on_malloc); \ + } #define GET_FATAL_STACK_TRACE_PC_BP(pc, bp) \ BufferedStackTrace stack; \ Index: test/asan/TestCases/Darwin/sandbox-symbolizer.cc =================================================================== --- test/asan/TestCases/Darwin/sandbox-symbolizer.cc +++ test/asan/TestCases/Darwin/sandbox-symbolizer.cc @@ -3,11 +3,11 @@ // Second, `atos` symbolizer can't inspect a process that has an inaccessible // task port, in which case we should again fallback to dladdr gracefully. -// RUN: %clangxx_asan -O0 %s -o %t +// RUN: %clangxx_asan -O0 %s -o %t // RUN: not %run sandbox-exec -p '(version 1)(allow default)(deny process-fork)' %t 2>&1 | FileCheck %s // RUN: not %run sandbox-exec -p '(version 1)(allow default)(deny mach-priv-task-port)' %t 2>&1 | FileCheck %s // RUN: env ASAN_SYMBOLIZER_PATH="" not %run sandbox-exec -p '(version 1)(allow default)(deny mach-priv-task-port)' %t 2>&1 | FileCheck %s -// RUN: %clangxx_asan -O3 %s -o %t +// RUN: %clangxx_asan -O3 %s -o %t // RUN: not %run sandbox-exec -p '(version 1)(allow default)(deny process-fork)' %t 2>&1 | FileCheck %s // RUN: not %run sandbox-exec -p '(version 1)(allow default)(deny mach-priv-task-port)' %t 2>&1 | FileCheck %s // RUN: env ASAN_SYMBOLIZER_PATH="" not %run sandbox-exec -p '(version 1)(allow default)(deny mach-priv-task-port)' %t 2>&1 | FileCheck %s Index: test/asan/TestCases/Linux/function-sections-are-bad.cc =================================================================== --- test/asan/TestCases/Linux/function-sections-are-bad.cc +++ test/asan/TestCases/Linux/function-sections-are-bad.cc @@ -25,7 +25,7 @@ printf("%s\n", dlerror()); assert(dlerror() == 0); f(); - + dlclose(handle); return 0; } Index: test/asan/TestCases/Linux/shmctl.cc =================================================================== --- test/asan/TestCases/Linux/shmctl.cc +++ test/asan/TestCases/Linux/shmctl.cc @@ -22,6 +22,6 @@ struct shm_info shmInfo; res = shmctl(0, SHM_INFO, (struct shmid_ds *)&shmInfo); assert(res > -1); - + return 0; } Index: test/asan/TestCases/Linux/static_tls.cc =================================================================== --- test/asan/TestCases/Linux/static_tls.cc +++ test/asan/TestCases/Linux/static_tls.cc @@ -11,7 +11,7 @@ // XFAIL: aarch64 // binutils 2.26 has a change that causes this test to fail on powerpc64. -// UNSUPPORTED: powerpc64 +// UNSUPPORTED: powerpc64 #ifndef SHARED #include Index: test/asan/TestCases/Posix/coverage-direct-large.cc =================================================================== --- test/asan/TestCases/Posix/coverage-direct-large.cc +++ test/asan/TestCases/Posix/coverage-direct-large.cc @@ -44,7 +44,7 @@ #ifdef SHARED extern "C" void so_entry() { F4(CALL, f) -} +} #else #include Index: test/asan/TestCases/Posix/halt_on_error-torture.cc =================================================================== --- test/asan/TestCases/Posix/halt_on_error-torture.cc +++ test/asan/TestCases/Posix/halt_on_error-torture.cc @@ -38,7 +38,7 @@ unsigned seed = (unsigned)(size_t)arg; volatile char tmp[2]; - __asan_poison_memory_region(&tmp, sizeof(tmp)); + __asan_poison_memory_region(&tmp, sizeof(tmp)); for (size_t i = 0; i < niter; ++i) { random_delay(&seed); Index: test/asan/TestCases/Windows/intercept_strlen.cc =================================================================== --- test/asan/TestCases/Windows/intercept_strlen.cc +++ test/asan/TestCases/Windows/intercept_strlen.cc @@ -18,7 +18,7 @@ // CHECK: AddressSanitizer: stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] // FIXME: Should be READ of size 1, see issue 155. // CHECK: READ of size {{[0-9]+}} at [[ADDR]] thread T0 -// CHECK: strlen +// CHECK: strlen // CHECK-NEXT: main {{.*}}intercept_strlen.cc:[[@LINE-5]] // CHECK: Address [[ADDR]] is located in stack of thread T0 at offset {{.*}} in frame // CHECK-NEXT: main {{.*}}intercept_strlen.cc Index: test/msan/Linux/process_vm_readv.cc =================================================================== --- test/msan/Linux/process_vm_readv.cc +++ test/msan/Linux/process_vm_readv.cc @@ -49,7 +49,7 @@ __msan_poison(&b, sizeof(b)); ssize_t res = process_vm_readv(getpid(), iov_b, 2, iov_a, 2, 0); - if (errno == ENOSYS) // Function not implemented + if (errno == ENOSYS) // Function not implemented return exit_dummy(); assert(res == 30); Index: test/msan/Linux/tcgetattr.cc =================================================================== --- test/msan/Linux/tcgetattr.cc +++ test/msan/Linux/tcgetattr.cc @@ -10,7 +10,7 @@ int main(int argc, char *argv[]) { int fd = getpt(); assert(fd >= 0); - + struct termios t; int res = tcgetattr(fd, &t); assert(!res); Index: test/msan/chained_origin.cc =================================================================== --- test/msan/chained_origin.cc +++ test/msan/chained_origin.cc @@ -1,19 +1,19 @@ // RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -O3 %s -o %t && \ // RUN: not %run %t >%t.out 2>&1 -// RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-STACK < %t.out +// RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-%unwind --check-prefix=CHECK-STACK < %t.out // RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -DHEAP=1 -O3 %s -o %t && \ // RUN: not %run %t >%t.out 2>&1 -// RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-HEAP < %t.out +// RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-%unwind --check-prefix=CHECK-HEAP < %t.out // RUN: %clangxx_msan -mllvm -msan-instrumentation-with-call-threshold=0 -fsanitize-memory-track-origins=2 -O3 %s -o %t && \ // RUN: not %run %t >%t.out 2>&1 -// RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-STACK < %t.out +// RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-%unwind --check-prefix=CHECK-STACK < %t.out // RUN: %clangxx_msan -mllvm -msan-instrumentation-with-call-threshold=0 -fsanitize-memory-track-origins=2 -DHEAP=1 -O3 %s -o %t && \ // RUN: not %run %t >%t.out 2>&1 -// RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-HEAP < %t.out +// RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-%unwind-HEAP -check-prefix=CHECK-HEAP < %t.out #include @@ -50,16 +50,18 @@ // CHECK: {{#0 .* in main.*chained_origin.cc:}}[[@LINE-4]] // CHECK: Uninitialized value was stored to memory at -// CHECK: {{#0 .* in fn_h.*chained_origin.cc:}}[[@LINE-19]] -// CHECK: {{#1 .* in main.*chained_origin.cc:}}[[@LINE-9]] +// CHECK-NON-MIPS-FRAMES: {{#0 .* in fn_h.*chained_origin.cc:}}[[@LINE-19]] +// CHECK-NON-MIPS-FRAMES: {{#1 .* in main.*chained_origin.cc:}}[[@LINE-9]] +// CHECK-MIPS-FRAMES: {{#0 .* in fn_h.*chained_origin.cc:}}[[@LINE-21]] // CHECK: Uninitialized value was stored to memory at -// CHECK: {{#0 .* in fn_g.*chained_origin.cc:}}[[@LINE-33]] -// CHECK: {{#1 .* in fn_f.*chained_origin.cc:}}[[@LINE-29]] -// CHECK: {{#2 .* in main.*chained_origin.cc:}}[[@LINE-15]] +// CHECK-NON-MIPS-FRAMES: {{#0 .* in fn_g.*chained_origin.cc:}}[[@LINE-34]] +// CHECK-NON-MIPS-FRAMES: {{#1 .* in fn_f.*chained_origin.cc:}}[[@LINE-30]] +// CHECK-NON-MIPS-FRAMES: {{#2 .* in main.*chained_origin.cc:}}[[@LINE-16]] +// CHECK-MIPS-FRAMES: {{#0 .* in fn_g.*chained_origin.cc:}}[[@LINE-37]] // CHECK-STACK: Uninitialized value was created by an allocation of 'z' in the stack frame of function 'main' -// CHECK-STACK: {{#0 .* in main.*chained_origin.cc:}}[[@LINE-25]] +// CHECK-STACK: {{#0 .* in main.*chained_origin.cc:}}[[@LINE-27]] // CHECK-HEAP: Uninitialized value was created by a heap allocation -// CHECK-HEAP: {{#1 .* in main.*chained_origin.cc:}}[[@LINE-26]] +// CHECK-HEAP: {{#1 .* in main.*chained_origin.cc:}}[[@LINE-28]] Index: test/msan/chained_origin_limits.cc =================================================================== --- test/msan/chained_origin_limits.cc +++ test/msan/chained_origin_limits.cc @@ -10,7 +10,7 @@ // RUN: FileCheck %s --check-prefix=CHECK2 < %t.out // RUN: MSAN_OPTIONS=origin_history_per_stack_limit=1 not %run %t >%t.out 2>&1 -// RUN: FileCheck %s --check-prefix=CHECK-PER-STACK < %t.out +// RUN: FileCheck %s --check-prefix=CHECK-PER-STACK --check-prefix=CHECK-%unwind-PER-STACK < %t.out // RUN: MSAN_OPTIONS=origin_history_size=7,origin_history_per_stack_limit=0 not %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK7 < %t.out @@ -25,7 +25,7 @@ // RUN: FileCheck %s --check-prefix=CHECK2 < %t.out // RUN: MSAN_OPTIONS=origin_history_per_stack_limit=1 not %run %t >%t.out 2>&1 -// RUN: FileCheck %s --check-prefix=CHECK-PER-STACK < %t.out +// RUN: FileCheck %s --check-prefix=CHECK-PER-STACK --check-prefix=CHECK-%unwind-PER-STACK < %t.out // RUN: MSAN_OPTIONS=origin_history_size=7,origin_history_per_stack_limit=0 not %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK7 < %t.out @@ -41,7 +41,7 @@ // RUN: FileCheck %s --check-prefix=CHECK2 < %t.out // RUN: MSAN_OPTIONS=origin_history_per_stack_limit=1 not %run %t >%t.out 2>&1 -// RUN: FileCheck %s --check-prefix=CHECK-PER-STACK < %t.out +// RUN: FileCheck %s --check-prefix=CHECK-PER-STACK --check-prefix=CHECK-%unwind-PER-STACK < %t.out // RUN: MSAN_OPTIONS=origin_history_size=7,origin_history_per_stack_limit=0 not %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK7 < %t.out @@ -57,7 +57,7 @@ // RUN: FileCheck %s --check-prefix=CHECK2 < %t.out // RUN: MSAN_OPTIONS=origin_history_per_stack_limit=1 not %run %t >%t.out 2>&1 -// RUN: FileCheck %s --check-prefix=CHECK-PER-STACK < %t.out +// RUN: FileCheck %s --check-prefix=CHECK-PER-STACK --check-prefix=CHECK-%unwind-PER-STACK < %t.out // RUN: MSAN_OPTIONS=origin_history_size=7,origin_history_per_stack_limit=0 not %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK7 < %t.out @@ -149,11 +149,12 @@ // CHECK-PER-STACK: WARNING: MemorySanitizer: use-of-uninitialized-value // CHECK-PER-STACK: Uninitialized value was stored to memory at -// CHECK-PER-STACK: in fn3 -// CHECK-PER-STACK: Uninitialized value was stored to memory at -// CHECK-PER-STACK: in fn2 -// CHECK-PER-STACK: Uninitialized value was stored to memory at -// CHECK-PER-STACK: in fn1 +// CHECK-NON-MIPS-FRAMES-PER-STACK: in fn3 +// CHECK-MIPS-FRAMES-PER-STACK: in __msan_memmove +// CHECK-NON-MIPS-FRAMES-PER-STACK: Uninitialized value was stored to memory at +// CHECK-NON-MIPS-FRAMES-PER-STACK: in fn2 +// CHECK-NON-MIPS-FRAMES-PER-STACK: Uninitialized value was stored to memory at +// CHECK-NON-MIPS-FRAMES-PER-STACK: in fn1 // CHECK-PER-STACK: Uninitialized value was created // CHECK-UNLIMITED: WARNING: MemorySanitizer: use-of-uninitialized-value Index: test/msan/chained_origin_memcpy.cc =================================================================== --- test/msan/chained_origin_memcpy.cc +++ test/msan/chained_origin_memcpy.cc @@ -1,19 +1,19 @@ // RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -DOFFSET=0 -O3 %s -o %t && \ // RUN: not %run %t >%t.out 2>&1 -// RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-Z1 < %t.out +// RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-Z1 --check-prefix=CHECK-%unwind < %t.out // RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -DOFFSET=10 -O3 %s -o %t && \ // RUN: not %run %t >%t.out 2>&1 -// RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-Z2 < %t.out +// RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-Z2 --check-prefix=CHECK-%unwind < %t.out // RUN: %clangxx_msan -mllvm -msan-instrumentation-with-call-threshold=0 -fsanitize-memory-track-origins=2 -DOFFSET=0 -O3 %s -o %t && \ // RUN: not %run %t >%t.out 2>&1 -// RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-Z1 < %t.out +// RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-Z1 --check-prefix=CHECK-%unwind < %t.out // RUN: %clangxx_msan -mllvm -msan-instrumentation-with-call-threshold=0 -fsanitize-memory-track-origins=2 -DOFFSET=10 -O3 %s -o %t && \ // RUN: not %run %t >%t.out 2>&1 -// RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-Z2 < %t.out +// RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-Z2 --check-prefix=CHECK-%unwind < %t.out #include #include @@ -49,12 +49,14 @@ // CHECK: {{#0 .* in main .*chained_origin_memcpy.cc:}}[[@LINE-4]] // CHECK: Uninitialized value was stored to memory at -// CHECK: {{#1 .* in fn_h.*chained_origin_memcpy.cc:}}[[@LINE-15]] +// CHECK-NON-MIPS-FRAMES: {{#1 .* in fn_h.*chained_origin_memcpy.cc:}}[[@LINE-15]] +// CHECK-MIPS-FRAMES: {{#0 .* in __msan_memcpy .*msan_interceptors.cc:}} // CHECK: Uninitialized value was stored to memory at -// CHECK: {{#0 .* in fn_g.*chained_origin_memcpy.cc:}}[[@LINE-28]] -// CHECK: {{#1 .* in fn_f.*chained_origin_memcpy.cc:}}[[@LINE-24]] +// CHECK-NON-MIPS-FRAMES: {{#0 .* in fn_g.*chained_origin_memcpy.cc:}}[[@LINE-29]] +// CHECK-NON-MIPS-FRAMES: {{#1 .* in fn_f.*chained_origin_memcpy.cc:}}[[@LINE-25]] +// CHECK-MIPS-FRAMES: {{#0 .* in fn_g.*chained_origin_memcpy.cc:}}[[@LINE-31]] // CHECK-Z1: Uninitialized value was created by an allocation of 'z1' in the stack frame of function 'main' // CHECK-Z2: Uninitialized value was created by an allocation of 'z2' in the stack frame of function 'main' -// CHECK: {{#0 .* in main.*chained_origin_memcpy.cc:}}[[@LINE-20]] +// CHECK: {{#0 .* in main.*chained_origin_memcpy.cc:}}[[@LINE-22]] Index: test/msan/lit.cfg =================================================================== --- test/msan/lit.cfg +++ test/msan/lit.cfg @@ -35,3 +35,11 @@ if config.target_arch != 'aarch64': config.available_features.add('stable-runtime') + +# For mips64, mips64el we have forced store_context_size to 1 because these +# archs use slow unwinder which is not async signal safe. Therefore we only +# check the first frame since store_context size is 1. +if config.host_arch in ['mips64', 'mips64el']: + config.substitutions.append( ('CHECK-%unwind', ("CHECK-MIPS-FRAMES"))) +else: + config.substitutions.append( ('CHECK-%unwind', ("CHECK-NON-MIPS-FRAMES"))) Index: test/msan/msan_copy_shadow.cc =================================================================== --- test/msan/msan_copy_shadow.cc +++ test/msan/msan_copy_shadow.cc @@ -1,7 +1,7 @@ // Test that __msan_copy_shadow copies shadow, updates origin and does not touch // the application memory. // RUN: %clangxx_msan -fsanitize-memory-track-origins=0 -O0 %s -o %t && not %run %t 2>&1 -// RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -O0 %s -o %t && not %run %t 2>&1 | FileCheck --check-prefix=CHECK --check-prefix=CHECK-%unwind %s #include #include @@ -28,7 +28,8 @@ // CHECK: use-of-uninitialized-value // CHECK: {{in main.*msan_copy_shadow.cc:}}[[@LINE-2]] // CHECK: Uninitialized value was stored to memory at - // CHECK: {{in main.*msan_copy_shadow.cc:}}[[@LINE-8]] + // CHECK-NON-MIPS-FRAMES: {{in main.*msan_copy_shadow.cc:}}[[@LINE-8]] + // CHECK-MIPS-FRAMES: {{in __msan_copy_shadow .*msan_interceptors.cc:}} // CHECK: Uninitialized value was created by a heap allocation - // CHECK: {{in main.*msan_copy_shadow.cc:}}[[@LINE-22]] + // CHECK: {{in main.*msan_copy_shadow.cc:}}[[@LINE-23]] } Index: test/msan/print_stats.cc =================================================================== --- test/msan/print_stats.cc +++ test/msan/print_stats.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -g %s -o %t +// RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -g %s -o %t // RUN: %run %t 2>&1 | \ // RUN: FileCheck --check-prefixes=CHECK,CHECK-NOSTATS %s // RUN: MSAN_OPTIONS=print_stats=1 %run %t 2>&1 | \ @@ -6,7 +6,7 @@ // RUN: MSAN_OPTIONS=print_stats=1,atexit=1 %run %t 2>&1 | \ // RUN: FileCheck --check-prefixes=CHECK,CHECK-STATS %s -// RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -g -DPOSITIVE=1 %s -o %t +// RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -g -DPOSITIVE=1 %s -o %t // RUN: not %run %t 2>&1 | \ // RUN: FileCheck --check-prefixes=CHECK,CHECK-NOSTATS %s // RUN: MSAN_OPTIONS=print_stats=1 not %run %t 2>&1 | \ Index: test/msan/realloc-large-origin.cc =================================================================== --- test/msan/realloc-large-origin.cc +++ test/msan/realloc-large-origin.cc @@ -1,7 +1,7 @@ // RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -O0 %s -o %t && not %run %t >%t.out 2>&1 -// RUN: FileCheck %s < %t.out +// RUN: FileCheck --check-prefix=CHECK --check-prefix=CHECK-%unwind %s < %t.out // RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -O2 %s -o %t && not %run %t >%t.out 2>&1 -// RUN: FileCheck %s < %t.out +// RUN: FileCheck --check-prefix=CHECK --check-prefix=CHECK-%unwind %s < %t.out // This is a regression test: there used to be broken "stored to memory at" // stacks with @@ -21,10 +21,11 @@ // CHECK: {{#0 0x.* in main .*realloc-large-origin.cc:}}[[@LINE-3]] // CHECK: Uninitialized value was stored to memory at -// CHECK: {{#0 0x.* in .*realloc}} -// CHECK: {{#1 0x.* in main .*realloc-large-origin.cc:}}[[@LINE-10]] +// CHECK-NON-MIPS-FRAMES: {{#0 0x.* in .*realloc}} +// CHECK-NON-MIPS-FRAMES: {{#1 0x.* in main .*realloc-large-origin.cc:}}[[@LINE-10]] +// CHECK-MIPS-FRAMES: {{#0 0x.* in .*realloc}} // CHECK: Uninitialized value was created by a heap allocation // CHECK: {{#0 0x.* in .*malloc}} -// CHECK: {{#1 0x.* in main .*realloc-large-origin.cc:}}[[@LINE-15]] +// CHECK: {{#1 0x.* in main .*realloc-large-origin.cc:}}[[@LINE-16]] } Index: test/msan/scandir.cc =================================================================== --- test/msan/scandir.cc +++ test/msan/scandir.cc @@ -40,7 +40,7 @@ assert(argc == 2); char buf[1024]; snprintf(buf, sizeof(buf), "%s/%s", argv[1], "scandir_test_root/"); - + struct dirent **d; int res = scandir(buf, &d, my_filter, my_compar); assert(res == 2); Index: test/msan/scandir_null.cc =================================================================== --- test/msan/scandir_null.cc +++ test/msan/scandir_null.cc @@ -21,7 +21,7 @@ assert(argc == 2); char buf[1024]; snprintf(buf, sizeof(buf), "%s/%s", argv[1], "scandir_test_root/"); - + struct dirent **d; int res = scandir(buf, &d, NULL, NULL); assert(res >= 3); Index: test/msan/textdomain.cc =================================================================== --- test/msan/textdomain.cc +++ test/msan/textdomain.cc @@ -6,7 +6,7 @@ int main() { const char *td = textdomain("abcd"); if (td[0] == 0) { - printf("Try read"); + printf("Try read"); } return 0; } Index: test/profile/Inputs/comdat_rename_1.cc =================================================================== --- test/profile/Inputs/comdat_rename_1.cc +++ test/profile/Inputs/comdat_rename_1.cc @@ -2,12 +2,12 @@ // callee's out-of-line instance profile data -- it comes // from external calls to it from comdat_rename_2.cc. // Its inline instance copy's profile data is different and -// is collected in 'caller''s context. +// is collected in 'caller''s context. int FOO::callee() { // CHECK-LABEL: define {{.*}}callee{{.*}} // CHECK-NOT: br i1 {{.*}} // CHECK: br {{.*}}label{{.*}}, label %[[BB1:.*]], !prof ![[PD1:[0-9]+]] - // CHECK: {{.*}}[[BB1]]: + // CHECK: {{.*}}[[BB1]]: if (b != 0) return a / b; if (a != 0) @@ -21,10 +21,10 @@ // CHECK-LABEL: define {{.*}}caller{{.*}} // CHECK-NOT: br i1 {{.*}} // CHECK: br {{.*}}label{{.*}}, label %[[BB2:.*]], !prof ![[PD2:[0-9]+]] -// CHECK: {{.*}}[[BB2]]: +// CHECK: {{.*}}[[BB2]]: // CHECK: br {{.*}}label{{.*}}, label %{{.*}}, !prof !{{.*}} // CHECK: br {{.*}}label %[[BB3:.*]], label %{{.*}} !prof ![[PD3:[0-9]+]] -// CHECK: {{.*}}[[BB3]]: +// CHECK: {{.*}}[[BB3]]: // // CHECK:![[PD1]] = !{!"branch_weights", i32 0, i32 1} // CHECK:![[PD2]] = !{!"branch_weights", i32 1, i32 0} Index: test/profile/Inputs/comdat_rename_2.cc =================================================================== --- test/profile/Inputs/comdat_rename_2.cc +++ test/profile/Inputs/comdat_rename_2.cc @@ -14,5 +14,5 @@ // CHECK: {{.*}} call {{.*}} // CHECK-NOT: br i1 {{.*}} // CHECK: br {{.*}}label %[[BB1:.*]], label{{.*}}!prof ![[PD1:[0-9]+]] -// CHECK: {{.*}}[[BB1]]: +// CHECK: {{.*}}[[BB1]]: // CHECK:![[PD1]] = !{!"branch_weights", i32 0, i32 1} Index: test/sanitizer_common/TestCases/Linux/signal_segv_handler.cc =================================================================== --- test/sanitizer_common/TestCases/Linux/signal_segv_handler.cc +++ test/sanitizer_common/TestCases/Linux/signal_segv_handler.cc @@ -36,7 +36,7 @@ a.sa_flags = SA_SIGINFO; sigaction(SIGSEGV, &a, &old); guard = mmap(0, 3 * page_size, PROT_NONE, MAP_ANON | MAP_PRIVATE, -1, 0); - guard = (char*)guard + page_size; // work around a kernel bug + guard = (char*)guard + page_size; // work around a kernel bug for (int i = 0; i < 1000000; i++) { mprotect(guard, page_size, PROT_NONE); *(int*)guard = 1; Index: test/sanitizer_common/TestCases/Linux/timerfd.cc =================================================================== --- test/sanitizer_common/TestCases/Linux/timerfd.cc +++ test/sanitizer_common/TestCases/Linux/timerfd.cc @@ -47,6 +47,6 @@ printf("DONE\n"); // CHECK: DONE - + return 0; } Index: test/scudo/lit.cfg =================================================================== --- test/scudo/lit.cfg +++ test/scudo/lit.cfg @@ -27,8 +27,8 @@ "-pie", "-O0"] -def build_invocation(compile_flags): - return " " + " ".join([config.clang] + compile_flags) + " " +def build_invocation(compile_flags): + return " " + " ".join([config.clang] + compile_flags) + " " # Add clang substitutions. config.substitutions.append( ("%clang_scudo ",