[PATCH] D61923: [GWP-ASan] Mutex implementation [2].

Mitch Phillips via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 29 16:32:51 PDT 2019


hctim added inline comments.


================
Comment at: compiler-rt/lib/gwp_asan/tests/driver.cpp:14
+  return RUN_ALL_TESTS();
+}
----------------
morehouse wrote:
> Can we just link with gtest_main instead of having this?
Unfortunately not easily. `generate_compiler_rt_tests` builds each test cpp file individually, and provides no way to add `gtest_main` only during link time. 


================
Comment at: compiler-rt/lib/gwp_asan/tests/mutex_test.cpp:46
+  while (!StartingGun->load())
+    ;
+  for (unsigned i = 0; i < kNumLocksInARow; ++i) {
----------------
morehouse wrote:
> Format seems weird.  Does clang-format let us do `while (...) {}` on one line?
CF changes it to 
```
while (!StartingGun) {
}
```


================
Comment at: compiler-rt/test/gwp_asan/CMakeLists.txt:1
+set(GWP_ASAN_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+set(GWP_ASAN_LIT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
----------------
morehouse wrote:
> Can the lit test stuff go in another patch when we actually have tests?
Not AFAIK. The unit tests are actually invoked through the lit configurations in this directory.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61923/new/

https://reviews.llvm.org/D61923





More information about the cfe-commits mailing list