> On Mar 1, 2016, at 12:31 PM, Maxim Kuvyrkov <maxim.kuvyr...@linaro.org> wrote: > > This patch improves sanitizer testsuite to avoid sporadic failures, > especially when [cross-]testing on a remote machine. > > There are several unstable sanitizer tests in GCC testsuite (e.g., > g++.dg/tsan/aligned_vs_unaligned_race.C), and the instability comes from the > test doing this: > > printf("Pass\n"); > /* { dg-output "WARNING: ThreadSanitizer: data race.*(\n|\r\n|\r)" } */ > /* { dg-output "Pass.*" } */ > > . Thread sanitizer prints its data to stderr, and then printf prints to > stdout. The testcase expects stderr to be flushed before stdout, and "Pass" > to be at the end of the output. AFAIK, that works fine in native/local > environment, but fails in remote testing from time to time. The failure case > happens when stdout output is printed before stderr output. This is, likely, > because there is no strict ordering of stdout and stderr when remote testing. > > This patch fixes the affected tests in GCC testsuite, and I'll be also > posting a similar patch for LLVM testsuite.
FYI, this was posted to LLVM (and approved) here: http://reviews.llvm.org/D17757 . > > OK for trunk? -- Maxim Kuvyrkov www.linaro.org