From 17b8b0625252be3d14609b248c6701fe0d10dbb8 Mon Sep 17 00:00:00 2001 From: Renato Golin Date: Thu, 14 Apr 2016 12:10:21 +0000 Subject: Make tsan tests more portable (take 2) Using stderr more uniformily, avoiding potential races when scanning stdout and stderr output. Patch by Maxim Kuvyrkov. llvm-svn: 266294 --- compiler-rt/test/tsan/malloc_overflow.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'compiler-rt/test/tsan/malloc_overflow.cc') diff --git a/compiler-rt/test/tsan/malloc_overflow.cc b/compiler-rt/test/tsan/malloc_overflow.cc index b2f9b0f5779..3db412978d0 100644 --- a/compiler-rt/test/tsan/malloc_overflow.cc +++ b/compiler-rt/test/tsan/malloc_overflow.cc @@ -6,17 +6,17 @@ int main() { void *p = malloc((size_t)-1); if (p != 0) - printf("FAIL malloc(-1) = %p\n", p); + fprintf(stderr, "FAIL malloc(-1) = %p\n", p); p = malloc((size_t)-1 / 2); if (p != 0) - printf("FAIL malloc(-1/2) = %p\n", p); + fprintf(stderr, "FAIL malloc(-1/2) = %p\n", p); p = calloc((size_t)-1, (size_t)-1); if (p != 0) - printf("FAIL calloc(-1, -1) = %p\n", p); + fprintf(stderr, "FAIL calloc(-1, -1) = %p\n", p); p = calloc((size_t)-1 / 2, (size_t)-1 / 2); if (p != 0) - printf("FAIL calloc(-1/2, -1/2) = %p\n", p); - printf("OK\n"); + fprintf(stderr, "FAIL calloc(-1/2, -1/2) = %p\n", p); + fprintf(stderr, "OK\n"); } // CHECK-NOT: FAIL -- cgit v1.2.3