Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / tsan / Darwin / external-noninstrumented-module.cpp
blobce65970834e51a9dc7572be03276ee401e3de5e2
1 // This file is used from other tests.
2 // RUN: true
4 #include <thread>
6 #include <stdio.h>
7 #include <stdlib.h>
9 struct MyObject;
10 typedef MyObject *MyObjectRef;
11 extern "C" {
12 void InitializeLibrary();
13 MyObject *ObjectCreate();
14 long ObjectRead(MyObject *);
15 void ObjectWrite(MyObject *, long);
16 void ObjectWriteAnother(MyObject *, long);
19 extern "C" void NonInstrumentedModule() {
20 InitializeLibrary();
22 MyObjectRef ref = ObjectCreate();
23 std::thread t1([ref]{ ObjectWrite(ref, 42); });
24 std::thread t2([ref]{ ObjectWrite(ref, 43); });
25 t1.join();
26 t2.join();