Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lldb / test / API / macosx / corefile-exception-reason / main.cpp
blobaa32441feec69b6b68142a24e91799fa05be2d52
1 #include <stdlib.h>
2 #include <thread>
3 #include <unistd.h>
4 #include <vector>
6 void *sleep_worker(void *in) {
7 sleep(30);
8 sleep(30);
9 return nullptr;
12 void *crash_worker(void *in) {
13 sleep(1);
14 volatile int *p = nullptr; // break here
15 return (void *)*p;
18 int main() {
19 std::vector<std::thread> threads;
20 threads.push_back(std::move(std::thread(crash_worker, nullptr)));
21 for (int i = 0; i < 15; i++)
22 threads.push_back(std::move(std::thread(sleep_worker, nullptr)));
23 sleep(10);