2 /* { dg-options "-fno-allow-store-data-races -O2" } */
3 /* { dg-final { simulate-thread } } */
8 #include "simulate-thread.h"
10 /* Test that speculative stores do not happen for --param
11 allow-store-data-races=0. */
20 void simulate_thread_other_threads ()
26 int simulate_thread_step_verify ()
31 int simulate_thread_final_verify ()
33 /* If count != insns, someone must have cached `count' and stored a
34 racy value into it. */
37 printf("FAIL: count was incorrectly cached\n");
43 /* Test that `count' is not written to unless p->data > 0. */
45 __attribute__((noinline
))
46 void simulate_thread_main()
49 for (p
= q
; p
; p
= p
->next
)
55 insert(struct obj
*head
, int data
)
57 struct obj
*t
= (struct obj
*) malloc (sizeof (struct obj
));
71 simulate_thread_main ();
72 simulate_thread_done ();