This is an archive of the discontinued LLVM Phabricator instance.

Fix hello_watchlocation test after r230691
ClosedPublic

Authored by ki.stfu on Feb 26 2015, 11:03 PM.

Details

Summary

pthread_barrier_t isn't supported on OS X therefore it causes a compilation failure

1: test_hello_watchlocation_with_dwarf (TestWatchLocation.HelloWatchLocationTestCase)
   Test watching a location with '-x size' option. ...
os command: make clean EXE='test_hello_watchlocation_with_dwarf' CXX_SOURCES='main.cpp'; make MAKE_DSYM=NO ARCH=x86_64 CC="clang" EXE='test_hello_watchlocation_with_dwarf' CXX_SOURCES='main.cpp'
with pid: 90141
stdout: rm -f "test_hello_watchlocation_with_dwarf"  main.o main.d main.d.tmp
rm -f -r "test_hello_watchlocation_with_dwarf.dSYM"
clang++ -std=c++11 -g -O0 -arch x86_64   -I/Users/IliaK/p/llvm/tools/lldb/test/make/../../include   -c -o main.o main.cpp

stderr: main.cpp:21:1: error: unknown type name 'pthread_barrier_t'
pthread_barrier_t g_barrier;
^
1 error generated.
make: *** [main.o] Error 1

retcode: 2


ERROR

This patch uses pthread_mutex_t and pthread_cond_t which are standard.

This test works on OS X.

Diff Detail

Event Timeline

ki.stfu updated this revision to Diff 20828.Feb 26 2015, 11:03 PM
ki.stfu retitled this revision from to Fix hello_watchlocation test after r230691.
ki.stfu updated this object.
ki.stfu edited the test plan for this revision. (Show Details)
ki.stfu added reviewers: chaoren, clayborg, zturner, abidh.
ki.stfu added subscribers: chaoren, clayborg, zturner and 2 others.
ki.stfu accepted this revision.Feb 26 2015, 11:37 PM
ki.stfu added a reviewer: ki.stfu.
This revision is now accepted and ready to land.Feb 26 2015, 11:37 PM
ki.stfu closed this revision.Feb 26 2015, 11:39 PM

the author created own version of this patch: http://reviews.llvm.org/D7933
This patch will not be committed.

clayborg edited edge metadata.Feb 27 2015, 9:34 AM

Looks good.

We could also use the C++11 library to abstract us from the system instead of using pthread_ types and functions.

Should we use std::condition and std::mutex?