summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/tsan/malloc_overflow.cc
diff options
context:
space:
mode:
authorRenato Golin <renato.golin@linaro.org>2016-03-02 11:10:02 +0000
committerRenato Golin <renato.golin@linaro.org>2016-03-02 11:10:02 +0000
commitba29b5794c0302bf7071afeca019260affdf179c (patch)
treed0af37bdd0e023d2aaac70c88730d5b58da0fcff /compiler-rt/test/tsan/malloc_overflow.cc
parentf0f24628cbbdc4f57a35b039f532dc965e1ae3c0 (diff)
downloadbcm5719-llvm-ba29b5794c0302bf7071afeca019260affdf179c.tar.gz
bcm5719-llvm-ba29b5794c0302bf7071afeca019260affdf179c.zip
[RT] Make tsan tests more portable
by avoiding potential races when scanning stdout and stderr output. Patch by Maxim Kuvyrkov. llvm-svn: 262476
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