mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-27 21:16:05 +00:00

Instead of writing something like `XFAIL: use_system_cxx_lib && target=...` to XFAIL back-deployment tests, introduce named Lit features like `availability-shared_mutex-missing` to represent those. This makes the XFAIL annotations leaner, and solves the problem of XFAIL comments potentially getting out of sync. This would also make it easier for another vendor to add their own annotations to the test suite by simply changing how the feature is defined for their OS releases, instead of having to modify hundreds of tests to add repetitive annotations. This doesn't touch *all* annotations -- only annotations that were widely duplicated are given named features (e.g. when filesystem or shared_mutex were introduced). I still think it probably doesn't make sense to have a named feature for every single fix we make to the dylib. This is in essence a revert of 2659663, but since then the test suite has changed significantly. Back when I did 2659663, the configuration files we have for the test suite right now were being bootstrapped and it wasn't clear how to provide these features for back-deployment in that context. Since then, we have a streamlined way of defining these features in `features.py` and that doesn't impact the ability for a configuration file to stay minimal. The original motivation for this change was that I am about to propose a change that would touch essentially all XFAIL annotations for back-deployment in the test suite, and this greatly reduces the number of lines changed by that upcoming change, in addition to making the test suite generally better. Differential Revision: https://reviews.llvm.org/D146359
36 lines
815 B
C++
36 lines
815 B
C++
//===----------------------------------------------------------------------===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// UNSUPPORTED: no-threads
|
|
// UNSUPPORTED: c++03, c++11
|
|
|
|
// XFAIL: availability-synchronization_library-missing
|
|
|
|
// <barrier>
|
|
|
|
#include <barrier>
|
|
#include <thread>
|
|
#include <cassert>
|
|
|
|
#include "make_test_thread.h"
|
|
#include "test_macros.h"
|
|
|
|
int main(int, char**)
|
|
{
|
|
std::barrier<> b(2);
|
|
|
|
std::thread t = support::make_test_thread([&](){
|
|
b.arrive_and_drop();
|
|
});
|
|
|
|
b.arrive_and_wait();
|
|
b.arrive_and_wait();
|
|
t.join();
|
|
return 0;
|
|
}
|