Fixed race conditions in thread tests; exposed by UBSan
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@178029 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -88,6 +88,10 @@ function afunc
|
|||||||
if (ls *.pass.cpp &> /dev/null)
|
if (ls *.pass.cpp &> /dev/null)
|
||||||
then
|
then
|
||||||
for FILE in $(ls *.pass.cpp); do
|
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
|
if $CC $OPTIONS $HEADER_INCLUDE $SOURCE_LIB $FILE $LIBS -o ./$TEST_EXE
|
||||||
then
|
then
|
||||||
if ./$TEST_EXE
|
if ./$TEST_EXE
|
||||||
|
@@ -32,7 +32,7 @@ public:
|
|||||||
void operator()()
|
void operator()()
|
||||||
{
|
{
|
||||||
assert(alive_ == 1);
|
assert(alive_ == 1);
|
||||||
assert(n_alive == 1);
|
assert(n_alive >= 1);
|
||||||
op_run = true;
|
op_run = true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@@ -32,7 +32,7 @@ public:
|
|||||||
void operator()()
|
void operator()()
|
||||||
{
|
{
|
||||||
assert(alive_ == 1);
|
assert(alive_ == 1);
|
||||||
assert(n_alive == 1);
|
assert(n_alive >= 1);
|
||||||
op_run = true;
|
op_run = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -32,14 +32,14 @@ public:
|
|||||||
void operator()()
|
void operator()()
|
||||||
{
|
{
|
||||||
assert(alive_ == 1);
|
assert(alive_ == 1);
|
||||||
assert(n_alive == 1);
|
assert(n_alive >= 1);
|
||||||
op_run = true;
|
op_run = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void operator()(int i, double j)
|
void operator()(int i, double j)
|
||||||
{
|
{
|
||||||
assert(alive_ == 1);
|
assert(alive_ == 1);
|
||||||
assert(n_alive == 1);
|
assert(n_alive >= 1);
|
||||||
assert(i == 5);
|
assert(i == 5);
|
||||||
assert(j == 5.5);
|
assert(j == 5.5);
|
||||||
op_run = true;
|
op_run = true;
|
||||||
|
@@ -32,14 +32,14 @@ public:
|
|||||||
void operator()()
|
void operator()()
|
||||||
{
|
{
|
||||||
assert(alive_ == 1);
|
assert(alive_ == 1);
|
||||||
assert(n_alive == 1);
|
assert(n_alive >= 1);
|
||||||
op_run = true;
|
op_run = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void operator()(int i, double j)
|
void operator()(int i, double j)
|
||||||
{
|
{
|
||||||
assert(alive_ == 1);
|
assert(alive_ == 1);
|
||||||
assert(n_alive == 1);
|
assert(n_alive >= 1);
|
||||||
assert(i == 5);
|
assert(i == 5);
|
||||||
assert(j == 5.5);
|
assert(j == 5.5);
|
||||||
op_run = true;
|
op_run = true;
|
||||||
|
@@ -32,14 +32,14 @@ public:
|
|||||||
void operator()()
|
void operator()()
|
||||||
{
|
{
|
||||||
assert(alive_ == 1);
|
assert(alive_ == 1);
|
||||||
assert(n_alive == 1);
|
assert(n_alive >= 1);
|
||||||
op_run = true;
|
op_run = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void operator()(int i, double j)
|
void operator()(int i, double j)
|
||||||
{
|
{
|
||||||
assert(alive_ == 1);
|
assert(alive_ == 1);
|
||||||
assert(n_alive == 1);
|
assert(n_alive >= 1);
|
||||||
assert(i == 5);
|
assert(i == 5);
|
||||||
assert(j == 5.5);
|
assert(j == 5.5);
|
||||||
op_run = true;
|
op_run = true;
|
||||||
|
@@ -32,7 +32,7 @@ public:
|
|||||||
void operator()()
|
void operator()()
|
||||||
{
|
{
|
||||||
assert(alive_ == 1);
|
assert(alive_ == 1);
|
||||||
assert(n_alive == 1);
|
assert(n_alive >= 1);
|
||||||
op_run = true;
|
op_run = true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@@ -32,7 +32,7 @@ public:
|
|||||||
void operator()()
|
void operator()()
|
||||||
{
|
{
|
||||||
assert(alive_ == 1);
|
assert(alive_ == 1);
|
||||||
assert(n_alive == 1);
|
assert(n_alive >= 1);
|
||||||
op_run = true;
|
op_run = true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@@ -32,7 +32,7 @@ public:
|
|||||||
void operator()()
|
void operator()()
|
||||||
{
|
{
|
||||||
assert(alive_ == 1);
|
assert(alive_ == 1);
|
||||||
assert(n_alive == 1);
|
assert(n_alive >= 1);
|
||||||
op_run = true;
|
op_run = true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@@ -32,7 +32,7 @@ public:
|
|||||||
void operator()()
|
void operator()()
|
||||||
{
|
{
|
||||||
assert(alive_ == 1);
|
assert(alive_ == 1);
|
||||||
assert(n_alive == 1);
|
assert(n_alive >= 1);
|
||||||
op_run = true;
|
op_run = true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@@ -32,7 +32,7 @@ public:
|
|||||||
void operator()()
|
void operator()()
|
||||||
{
|
{
|
||||||
assert(alive_ == 1);
|
assert(alive_ == 1);
|
||||||
assert(n_alive == 1);
|
assert(n_alive >= 1);
|
||||||
op_run = true;
|
op_run = true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@@ -32,7 +32,7 @@ public:
|
|||||||
void operator()()
|
void operator()()
|
||||||
{
|
{
|
||||||
assert(alive_ == 1);
|
assert(alive_ == 1);
|
||||||
assert(n_alive == 1);
|
assert(n_alive >= 1);
|
||||||
op_run = true;
|
op_run = true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@@ -32,7 +32,7 @@ public:
|
|||||||
void operator()()
|
void operator()()
|
||||||
{
|
{
|
||||||
assert(alive_ == 1);
|
assert(alive_ == 1);
|
||||||
assert(n_alive == 1);
|
assert(n_alive >= 1);
|
||||||
op_run = true;
|
op_run = true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user