Summary:
Around a third of our test sources have LLVM license headers. This patch removes those headers from all test
sources and also fixes any tests that depended on the length of the license header.
The reasons for this are:
* A few tests verify line numbers and will start failing if the number of lines in the LLVM license header changes. Once I landed my patch for valid SourceLocations in debug info we will probably have even more tests that verify line numbers.
* No other LLVM project is putting license headers in its test files to my knowledge.
* They make the test sources much more verbose than they have to be. Several tests have longer license headers than the actual test source.
For the record, the following tests had their line numbers changed to pass with the removal of the license header:
lldb-api :: functionalities/breakpoint/breakpoint_by_line_and_column/TestBreakpointByLineAndColumn.py
lldb-shell :: Reproducer/TestGDBRemoteRepro.test
lldb-shell :: Reproducer/TestMultipleTargets.test
lldb-shell :: Reproducer/TestReuseDirectory.test
lldb-shell :: ExecControl/StopHook/stop-hook-threads.test
lldb-shell :: ExecControl/StopHook/stop-hook.test
lldb-api :: lang/objc/exceptions/TestObjCExceptions.py
Reviewers: #lldb, espindola, JDevlieghere
Reviewed By: #lldb, JDevlieghere
Subscribers: emaste, aprantl, arphaman, JDevlieghere, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D74839
66 lines
1.5 KiB
C++
66 lines
1.5 KiB
C++
// This test verifies the correct handling of child thread exits.
|
|
|
|
#include "pseudo_barrier.h"
|
|
#include <thread>
|
|
|
|
pseudo_barrier_t g_barrier1;
|
|
pseudo_barrier_t g_barrier2;
|
|
pseudo_barrier_t g_barrier3;
|
|
|
|
void *
|
|
thread1 ()
|
|
{
|
|
// Synchronize with the main thread.
|
|
pseudo_barrier_wait(g_barrier1);
|
|
|
|
// Synchronize with the main thread and thread2.
|
|
pseudo_barrier_wait(g_barrier2);
|
|
|
|
// Return
|
|
return NULL; // Set second breakpoint here
|
|
}
|
|
|
|
void *
|
|
thread2 ()
|
|
{
|
|
// Synchronize with thread1 and the main thread.
|
|
pseudo_barrier_wait(g_barrier2);
|
|
|
|
// Synchronize with the main thread.
|
|
pseudo_barrier_wait(g_barrier3);
|
|
|
|
// Return
|
|
return NULL;
|
|
}
|
|
|
|
int main ()
|
|
{
|
|
pseudo_barrier_init(g_barrier1, 2);
|
|
pseudo_barrier_init(g_barrier2, 3);
|
|
pseudo_barrier_init(g_barrier3, 2);
|
|
|
|
// Create a thread.
|
|
std::thread thread_1(thread1);
|
|
|
|
// Wait for thread1 to start.
|
|
pseudo_barrier_wait(g_barrier1);
|
|
|
|
// Create another thread.
|
|
std::thread thread_2(thread2); // Set first breakpoint here
|
|
|
|
// Wait for thread2 to start.
|
|
pseudo_barrier_wait(g_barrier2);
|
|
|
|
// Wait for the first thread to finish
|
|
thread_1.join();
|
|
|
|
// Synchronize with the remaining thread
|
|
int dummy = 47; // Set third breakpoint here
|
|
pseudo_barrier_wait(g_barrier3);
|
|
|
|
// Wait for the second thread to finish
|
|
thread_2.join();
|
|
|
|
return 0; // Set fourth breakpoint here
|
|
}
|