2 /* { dg-options "-fno-allow-store-data-races" } */
3 /* { dg-final { simulate-thread } } */
6 #include "simulate-thread.h"
8 /* This file tests that speculative store movement out of a loop doesn't
9 happen. This is disallowed when -fno-allow-store-data-races. */
13 /* Other thread makes sure global is 100 before the next instruction is
15 void simulate_thread_other_threads()
20 int simulate_thread_step_verify()
24 printf("FAIL: global variable was assigned to. \n");
30 int simulate_thread_final_verify()
35 /* The variable global should never be assigned if func(0) is called.
36 This tests store movement out of loop thats never executed. */
42 global
= y
; /* This should never speculatively execute. */
46 __attribute__((noinline
))
47 void simulate_thread_main()
50 simulate_thread_done();
53 __attribute__((noinline
))
56 simulate_thread_main();