Fixed race conditions in thread tests; exposed by UBSan
authorMarshall Clow <mclow@qualcomm.com>
Tue, 26 Mar 2013 15:28:33 +0000 (15:28 +0000)
committerMarshall Clow <mclow@qualcomm.com>
Tue, 26 Mar 2013 15:28:33 +0000 (15:28 +0000)
llvm-svn: 178029

13 files changed:
libcxx/test/testit
libcxx/test/thread/thread.threads/thread.thread.class/thread.thread.algorithm/swap.pass.cpp
libcxx/test/thread/thread.threads/thread.thread.class/thread.thread.assign/copy.fail.cpp
libcxx/test/thread/thread.threads/thread.thread.class/thread.thread.assign/move.pass.cpp
libcxx/test/thread/thread.threads/thread.thread.class/thread.thread.constr/copy.fail.cpp
libcxx/test/thread/thread.threads/thread.thread.class/thread.thread.constr/move.pass.cpp
libcxx/test/thread/thread.threads/thread.thread.class/thread.thread.destr/dtor.pass.cpp
libcxx/test/thread/thread.threads/thread.thread.class/thread.thread.member/detach.pass.cpp
libcxx/test/thread/thread.threads/thread.thread.class/thread.thread.member/get_id.pass.cpp
libcxx/test/thread/thread.threads/thread.thread.class/thread.thread.member/join.pass.cpp
libcxx/test/thread/thread.threads/thread.thread.class/thread.thread.member/joinable.pass.cpp
libcxx/test/thread/thread.threads/thread.thread.class/thread.thread.member/native_handle.pass.cpp
libcxx/test/thread/thread.threads/thread.thread.class/thread.thread.member/swap.pass.cpp

index 945c700..1833812 100755 (executable)
@@ -88,6 +88,10 @@ function afunc
        if (ls *.pass.cpp &> /dev/null)
        then
                for FILE in $(ls *.pass.cpp); do
+            if [ "$VERBOSE" ]
+            then
+               echo "Running test: " $FILE
+            fi
                        if $CC $OPTIONS $HEADER_INCLUDE $SOURCE_LIB $FILE $LIBS -o ./$TEST_EXE
                        then
                                if ./$TEST_EXE
index 4db3a1b..9a7f8dc 100644 (file)
@@ -32,7 +32,7 @@ public:
     void operator()()
     {
         assert(alive_ == 1);
-        assert(n_alive == 1);
+        assert(n_alive >= 1);
         op_run = true;
     }
 };
index 246488e..7373886 100644 (file)
@@ -32,7 +32,7 @@ public:
     void operator()()
     {
         assert(alive_ == 1);
-        assert(n_alive == 1);
+        assert(n_alive >= 1);
         op_run = true;
     }
 
index 7e35652..1a5f320 100644 (file)
@@ -32,14 +32,14 @@ public:
     void operator()()
     {
         assert(alive_ == 1);
-        assert(n_alive == 1);
+        assert(n_alive >= 1);
         op_run = true;
     }
 
     void operator()(int i, double j)
     {
         assert(alive_ == 1);
-        assert(n_alive == 1);
+        assert(n_alive >= 1);
         assert(i == 5);
         assert(j == 5.5);
         op_run = true;
index afba0f7..f66474c 100644 (file)
@@ -32,14 +32,14 @@ public:
     void operator()()
     {
         assert(alive_ == 1);
-        assert(n_alive == 1);
+        assert(n_alive >= 1);
         op_run = true;
     }
 
     void operator()(int i, double j)
     {
         assert(alive_ == 1);
-        assert(n_alive == 1);
+        assert(n_alive >= 1);
         assert(i == 5);
         assert(j == 5.5);
         op_run = true;
index 3d92b59..17268ab 100644 (file)
@@ -32,14 +32,14 @@ public:
     void operator()()
     {
         assert(alive_ == 1);
-        assert(n_alive == 1);
+        assert(n_alive >= 1);
         op_run = true;
     }
 
     void operator()(int i, double j)
     {
         assert(alive_ == 1);
-        assert(n_alive == 1);
+        assert(n_alive >= 1);
         assert(i == 5);
         assert(j == 5.5);
         op_run = true;
index dfd8f57..e068c04 100644 (file)
@@ -32,7 +32,7 @@ public:
     void operator()()
     {
         assert(alive_ == 1);
-        assert(n_alive == 1);
+        assert(n_alive >= 1);
         op_run = true;
     }
 };
index c1391cb..dbb98b5 100644 (file)
@@ -32,7 +32,7 @@ public:
     void operator()()
     {
         assert(alive_ == 1);
-        assert(n_alive == 1);
+        assert(n_alive >= 1);
         op_run = true;
     }
 };
index d086fb6..6af4f3b 100644 (file)
@@ -32,7 +32,7 @@ public:
     void operator()()
     {
         assert(alive_ == 1);
-        assert(n_alive == 1);
+        assert(n_alive >= 1);
         op_run = true;
     }
 };
index 3b278da..32faef4 100644 (file)
@@ -32,7 +32,7 @@ public:
     void operator()()
     {
         assert(alive_ == 1);
-        assert(n_alive == 1);
+        assert(n_alive >= 1);
         op_run = true;
     }
 };
index 1cae60c..9c90eb7 100644 (file)
@@ -32,7 +32,7 @@ public:
     void operator()()
     {
         assert(alive_ == 1);
-        assert(n_alive == 1);
+        assert(n_alive >= 1);
         op_run = true;
     }
 };
index 8feded7..1aae922 100644 (file)
@@ -32,7 +32,7 @@ public:
     void operator()()
     {
         assert(alive_ == 1);
-        assert(n_alive == 1);
+        assert(n_alive >= 1);
         op_run = true;
     }
 };
index 46bccd6..820091e 100644 (file)
@@ -32,7 +32,7 @@ public:
     void operator()()
     {
         assert(alive_ == 1);
-        assert(n_alive == 1);
+        assert(n_alive >= 1);
         op_run = true;
     }
 };