summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/tsan/malloc_overflow.cc
diff options
context:
space:
mode:
authorRenato Golin <renato.golin@linaro.org>2016-04-14 12:10:21 +0000
committerRenato Golin <renato.golin@linaro.org>2016-04-14 12:10:21 +0000
commit17b8b0625252be3d14609b248c6701fe0d10dbb8 (patch)
treeb3cd4a7617ff121fcbe8dd0e3515472294c87d13 /compiler-rt/test/tsan/malloc_overflow.cc
parent217a98c0d115af277b6749c70a8db8e82b4d336b (diff)
downloadbcm5719-llvm-17b8b0625252be3d14609b248c6701fe0d10dbb8.tar.gz
bcm5719-llvm-17b8b0625252be3d14609b248c6701fe0d10dbb8.zip
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
Diffstat (limited to 'compiler-rt/test/tsan/malloc_overflow.cc')
-rw-r--r--compiler-rt/test/tsan/malloc_overflow.cc10
1 files changed, 5 insertions, 5 deletions
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
OpenPOWER on IntegriCloud