[PATCH] D14731: [libcxx] Add clang thread safety annotations to mutex and lock_guard

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 15 09:15:44 PDT 2016


EricWF added inline comments.

================
Comment at: test/libcxx/thread/thread.mutex/thread_safety_access_guarded_without_lock.fail.cpp:1
@@ +1,2 @@
+#if !defined(__clang__) || !__has_attribute(acquire_capability)
+// This test is only meaningful on versions of clang that understand thread
----------------
This test doesn't really test any libc++ behavior. It would fail in the same way before and after applying your patch. I don't think we need it.


================
Comment at: test/libcxx/thread/thread.mutex/thread_safety_annotations_not_enabled.cpp:1
@@ +1,2 @@
+// This test does not define _LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS so it
+// should compile without any warnings or errors even though this pattern is not
----------------
'.pass.cpp'

================
Comment at: test/libcxx/thread/thread.mutex/thread_safety_call_requires_capability_without_having.fail.cpp:1
@@ +1,2 @@
+#if !defined(__clang__) || !__has_attribute(acquire_capability)
+// This test is only meaningful on versions of clang that understand thread
----------------
This test doesn't really test any libc++ behavior. It would fail in the same way before and after applying your patch. I don't think we need it.


================
Comment at: test/libcxx/thread/thread.mutex/thread_safety_lock_guard.cpp:1
@@ +1,2 @@
+#if !defined(__clang__) || !__has_attribute(acquire_capability)
+// This test is only meaningful on versions of clang that understand thread
----------------
'.pass.cpp' and main().

================
Comment at: test/libcxx/thread/thread.mutex/thread_safety_lock_unlock.cpp:1
@@ +1,2 @@
+#if !defined(__clang__) || !__has_attribute(acquire_capability)
+// This test is only meaningful on versions of clang that understand thread
----------------
'.pass.cpp' and add another 'main()' definition.

================
Comment at: test/libcxx/thread/thread.mutex/thread_safety_requires_capability.cpp:1
@@ +1,2 @@
+#if !defined(__clang__) || !__has_attribute(acquire_capability)
+// This test is only meaningful on versions of clang that understand thread
----------------
Passing tests need to have the suffix ".pass.cpp" in order for the test suite to pick them up.
Also this function will still need a definition for main in order to pass with GCC and other configurations.


http://reviews.llvm.org/D14731





More information about the cfe-commits mailing list