parent
e7255da917
commit
0fea3ad0c7
|
|
@ -1,10 +1,12 @@
|
|||
// RUN: %clangxx_tsan -O1 %s -o %t && not %t 2>&1 | FileCheck %s
|
||||
#include <pthread.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
const long kOffset = 64*1024;
|
||||
|
||||
void *Thread(void *p) {
|
||||
sleep(1);
|
||||
((char*)p)[-kOffset] = 43;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,11 +5,13 @@
|
|||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int fd;
|
||||
char buf;
|
||||
|
||||
void *Thread(void *x) {
|
||||
sleep(1);
|
||||
read(fd, &buf, 1);
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue