1 /* Test program for the annotations that suppress both reads and writes. */
3 #include <assert.h> /* assert() */
6 #include <stdio.h> /* EOF */
7 #include <unistd.h> /* getopt() */
8 #include "../../drd/drd.h"
14 static void* thread_func(void* arg
)
16 /* Read s_a and modify s_b. */
24 int main(int argc
, char** argv
)
26 const struct timespec delay
= { 0, 100 * 1000 * 1000 };
31 while ((optchar
= getopt(argc
, argv
, "r")) != EOF
)
43 pthread_create(&tid
, 0, thread_func
, 0);
48 ANNOTATE_IGNORE_READS_AND_WRITES_BEGIN();
49 /* Read s_b and modify s_a. */
52 ANNOTATE_IGNORE_READS_AND_WRITES_END();
55 * Insert a delay here in order to make sure the load of s_c happens
56 * after s_c has been modified.
61 fprintf(stderr
, "%s", "x" + s_c
);
65 fprintf(stderr
, "Finished.\n");