This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Refactor tests for trivially copyable atomics
ClosedPublic

Authored by ldionne on Nov 17 2021, 8:18 AM.

Details

Summary
  • Replace irrelevant synopsis by a comment
  • Use a .verify.cpp test instead of .compile.fail.cpp
  • Remove unnecessary includes in one of the tests (was a copy-paste error)

Diff Detail

Event Timeline

ldionne requested review of this revision.Nov 17 2021, 8:18 AM
ldionne created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptNov 17 2021, 8:18 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
philnik added inline comments.
libcxx/test/std/atomics/atomics.types.generic/trivially_copyable.pass.cpp
28

Could you fix the indentation in this patch as well?

Quuxplusone added a subscriber: Quuxplusone.
Quuxplusone added inline comments.
libcxx/test/std/atomics/atomics.types.generic/trivially_copyable.pass.cpp
24–25

Bonus nit here and in the new test: explicit constructors :)

libcxx/test/std/atomics/atomics.types.generic/trivially_copyable.verify.cpp
21

Consider exactly copy-pasting the comment wording from libcxx/test/std/utilities/any/any.nonmembers/any.cast/const_correctness.verify.cpp, just for hypothetical greppability.

ldionne accepted this revision as: Restricted Project.Nov 17 2021, 10:31 AM
ldionne marked 2 inline comments as done.

Will apply comments when committing.

libcxx/test/std/atomics/atomics.types.generic/trivially_copyable.verify.cpp
21

Unfortunately, that comment is specific to any_cast, so it wouldn't apply here. However, for greppability, one could just look for ADDITIONAL_COMPILE_FLAGS: -Xclang -verify-ignore-unexpected=error.

This revision is now accepted and ready to land.Nov 17 2021, 10:31 AM
This revision was automatically updated to reflect the committed changes.
libcxx/include/atomic