1 // This program is used to generate a core dump for testing multithreading
9 std::atomic_int start_counter
{3};
11 void pseudobarrier_wait() {
13 while (start_counter
> 0);
16 void fcommon(uint32_t a
, uint32_t b
, uint32_t c
, uint32_t d
, double fa
, double fb
, double fc
, double fd
, bool segv
) {
25 volatile uint32_t a
= 0x01010101;
26 volatile uint32_t b
= 0x02020202;
27 volatile uint32_t c
= 0x03030303;
28 volatile uint32_t d
= 0x04040404;
29 volatile double fa
= 2.0;
30 volatile double fb
= 4.0;
31 volatile double fc
= 8.0;
32 volatile double fd
= 16.0;
35 std::this_thread::sleep_for(std::chrono::milliseconds(200));
36 fcommon(a
, b
, c
, d
, fa
, fb
, fc
, fd
, true);
40 volatile uint32_t a
= 0x11111111;
41 volatile uint32_t b
= 0x12121212;
42 volatile uint32_t c
= 0x13131313;
43 volatile uint32_t d
= 0x14141414;
44 volatile double fa
= 3.0;
45 volatile double fb
= 6.0;
46 volatile double fc
= 9.0;
47 volatile double fd
= 12.0;
50 fcommon(a
, b
, c
, d
, fa
, fb
, fc
, fd
, false);
54 volatile uint32_t a
= 0x21212121;
55 volatile uint32_t b
= 0x22222222;
56 volatile uint32_t c
= 0x23232323;
57 volatile uint32_t d
= 0x24242424;
58 volatile double fa
= 5.0;
59 volatile double fb
= 10.0;
60 volatile double fc
= 15.0;
61 volatile double fd
= 20.0;
64 fcommon(a
, b
, c
, d
, fa
, fb
, fc
, fd
, false);