mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-24 12:02:36 +08:00
fix newly failing c++03 tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290472 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -44,8 +44,9 @@ int test1 = 0;
|
|||||||
int test2 = 0;
|
int test2 = 0;
|
||||||
|
|
||||||
int runs = 0;
|
int runs = 0;
|
||||||
|
bool expect_result = false;
|
||||||
|
|
||||||
void f(bool expect_result)
|
void f()
|
||||||
{
|
{
|
||||||
typedef std::chrono::system_clock Clock;
|
typedef std::chrono::system_clock Clock;
|
||||||
typedef std::chrono::milliseconds milliseconds;
|
typedef std::chrono::milliseconds milliseconds;
|
||||||
@@ -73,8 +74,9 @@ void f(bool expect_result)
|
|||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
expect_result = true;
|
||||||
L1 lk(m0);
|
L1 lk(m0);
|
||||||
std::thread t(f, /*expect_result*/true);
|
std::thread t(f);
|
||||||
assert(test1 == 0);
|
assert(test1 == 0);
|
||||||
while (test1 == 0)
|
while (test1 == 0)
|
||||||
cv.wait(lk);
|
cv.wait(lk);
|
||||||
@@ -87,8 +89,9 @@ int main()
|
|||||||
test1 = 0;
|
test1 = 0;
|
||||||
test2 = 0;
|
test2 = 0;
|
||||||
{
|
{
|
||||||
|
expect_result = false;
|
||||||
L1 lk(m0);
|
L1 lk(m0);
|
||||||
std::thread t(f, /*expect_result*/false);
|
std::thread t(f);
|
||||||
assert(test1 == 0);
|
assert(test1 == 0);
|
||||||
while (test1 == 0)
|
while (test1 == 0)
|
||||||
cv.wait(lk);
|
cv.wait(lk);
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ constexpr decltype(std::placeholders::_10) cp10 = std::placeholders::_10;
|
|||||||
#endif // TEST_STD_VER >= 11
|
#endif // TEST_STD_VER >= 11
|
||||||
|
|
||||||
void use_placeholders_to_prevent_unused_warning() {
|
void use_placeholders_to_prevent_unused_warning() {
|
||||||
|
#if TEST_STD_VER >= 11
|
||||||
((void)cp1);
|
((void)cp1);
|
||||||
((void)cp2);
|
((void)cp2);
|
||||||
((void)cp3);
|
((void)cp3);
|
||||||
@@ -77,6 +78,7 @@ void use_placeholders_to_prevent_unused_warning() {
|
|||||||
((void)default8);
|
((void)default8);
|
||||||
((void)default9);
|
((void)default9);
|
||||||
((void)default10);
|
((void)default10);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
|
|||||||
Reference in New Issue
Block a user