Adding assertions will aid users that have bugs in their code to receive better error messages.
Details
- Reviewers
ldionne - Group Reviewers
Restricted Project - Commits
- rG1122cbf40354: [libc++] add basic runtime assertions to <barrier>
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
libcxx/include/barrier | ||
---|---|---|
318 | I see this:
It seems that we're not checking the second condition here. I think that's something we could check from __barrier_base::arrive. |
I think the up-to-date code should capture and assert that as well. I added the test file to confirm the correctness of the assertion
Note: the tests appear to have failed but in reality it's just two sole time outs out of the entire CI run.
add test for both ctors of barrier, remove extra compiler flag from test file that might be causing issues (fails) on the mac runners.
LGTM with comments applied and green CI. Thanks!
libcxx/test/libcxx/thread/thread.barrier/assert.arrive.pass.cpp | ||
---|---|---|
22–24 | We generally try to group Lit annotations like this. Please move those above right under the XFAIL. Here and elsewhere. | |
libcxx/test/libcxx/thread/thread.barrier/assert.ctor.pass.cpp | ||
39 | constexpr and noexcept are not necessary here, and they make the reader wonder whether they are relevant to the test. I'd remove them. |
As this CI turned green and should be approved, please use the following details when landing it. However, if the XFAILs flags needs to be modified please let me know.
Edoardo Sanguineti <edoardo.sanguineti222@gmail.com>
Thanks to the reviewers here and on the Discord server
I see this:
It seems that we're not checking the second condition here. I think that's something we could check from __barrier_base::arrive.