diff --git a/lldb/test/API/commands/watchpoints/multiple_threads/TestWatchpointMultipleThreads.py b/lldb/test/API/commands/watchpoints/multiple_threads/TestWatchpointMultipleThreads.py --- a/lldb/test/API/commands/watchpoints/multiple_threads/TestWatchpointMultipleThreads.py +++ b/lldb/test/API/commands/watchpoints/multiple_threads/TestWatchpointMultipleThreads.py @@ -23,8 +23,12 @@ self.do_watchpoint_test("Before running the thread") @expectedFailureAll(oslist=["freebsd"]) + def test_watchpoint_after_thread_launch(self): + """Test that we can hit a watchpoint we set after launching another thread""" + self.do_watchpoint_test("After launching the thread") + def test_watchpoint_after_thread_start(self): - """Test that we can hit a watchpoint we set after starting another thread""" + """Test that we can hit a watchpoint we set after another thread starts""" self.do_watchpoint_test("After running the thread") def do_watchpoint_test(self, line): diff --git a/lldb/test/API/commands/watchpoints/multiple_threads/main.cpp b/lldb/test/API/commands/watchpoints/multiple_threads/main.cpp --- a/lldb/test/API/commands/watchpoints/multiple_threads/main.cpp +++ b/lldb/test/API/commands/watchpoints/multiple_threads/main.cpp @@ -3,10 +3,11 @@ #include volatile uint32_t g_val = 0; -pseudo_barrier_t g_barrier; +pseudo_barrier_t g_barrier, g_barrier2; void thread_func() { pseudo_barrier_wait(g_barrier); + pseudo_barrier_wait(g_barrier2); printf("%s starting...\n", __FUNCTION__); for (uint32_t i = 0; i < 10; ++i) g_val = i; @@ -15,11 +16,15 @@ int main(int argc, char const *argv[]) { printf("Before running the thread\n"); pseudo_barrier_init(g_barrier, 2); + pseudo_barrier_init(g_barrier2, 2); std::thread thread(thread_func); - printf("After running the thread\n"); + printf("After launching the thread\n"); pseudo_barrier_wait(g_barrier); + printf("After running the thread\n"); + pseudo_barrier_wait(g_barrier2); + thread.join(); return 0;