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

Mitch Phillips via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 30 10:35:05 PDT 2019


hctim added inline comments.


================
Comment at: compiler-rt/lib/gwp_asan/tests/driver.cpp:14
+  return RUN_ALL_TESTS();
+}
----------------
morehouse wrote:
> hctim wrote:
> > 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. 
> Then how does this driver.cpp get included in each unit test?
> 
> Maybe we should put the `main` in each test as is usually done.
Basically what happens:
```
for x in *.cpp;
  do clang++ $x -o $x.o
done
clang++ *.o -o GwpAsanUnitTests
```

The unittests are all packaged together into a single binary. Also, AFAIK, compiler-rt all has a single `main()` driver for unittests (at least ASan+MSan+Scudo do this).


================
Comment at: compiler-rt/lib/gwp_asan/tests/mutex_test.cpp:102
+TEST(GwpAsanMutexTest, ThrashTests) {
+  runThrashTest(2, 10000);
+  runThrashTest(4, 10000);
----------------
morehouse wrote:
> morehouse wrote:
> > This test case seems to test a superset of ThreadedConstructionTest, so do we really need that one?
> This test case seems to test a superset of ThreadedConstructionTest, so do we really need that one?
Deleted ThreadedLockUnlockTest.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61923





More information about the llvm-commits mailing list