[compiler-rt] r200012 - tsan: fix test for -O2

Dmitry Vyukov dvyukov at google.com
Fri Jan 24 07:58:20 PST 2014


Author: dvyukov
Date: Fri Jan 24 09:58:20 2014
New Revision: 200012

URL: http://llvm.org/viewvc/llvm-project?rev=200012&view=rev
Log:
tsan: fix test for -O2

Modified:
    compiler-rt/trunk/lib/tsan/lit_tests/thread_leak5.c

Modified: compiler-rt/trunk/lib/tsan/lit_tests/thread_leak5.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/lit_tests/thread_leak5.c?rev=200012&r1=200011&r2=200012&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/lit_tests/thread_leak5.c (original)
+++ compiler-rt/trunk/lib/tsan/lit_tests/thread_leak5.c Fri Jan 24 09:58:20 2014
@@ -7,7 +7,8 @@ void *Thread(void *x) {
 }
 
 int main() {
-  for (int i = 0; i < 5; i++) {
+  volatile int N = 5;  // prevent loop unrolling
+  for (int i = 0; i < N; i++) {
     pthread_t t;
     pthread_create(&t, 0, Thread, 0);
   }





More information about the llvm-commits mailing list