brintos

brintos / llvm-project-archived public Read only

0
0
Text · 578 B · ce65970 Raw
28 lines · cpp
1// This file is used from other tests.2// RUN: true3 4#include <thread>5 6#include <stdio.h>7#include <stdlib.h>8 9struct MyObject;10typedef MyObject *MyObjectRef;11extern "C" {12  void InitializeLibrary();13  MyObject *ObjectCreate();14  long ObjectRead(MyObject *);15  void ObjectWrite(MyObject *, long);16  void ObjectWriteAnother(MyObject *, long);17}18 19extern "C" void NonInstrumentedModule() {20  InitializeLibrary();21  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();27}28