2 /* { dg-options "--param allow-store-data-races=0" } */
3 /* { dg-final { simulate-thread } } */
6 #include "../../gcc.dg/simulate-thread/simulate-thread.h"
8 /* Test that we don't store past VAR.A. */
12 volatile unsigned int a : 4;
17 static int global = 0;
19 /* Called before each instruction, simulating another thread
21 void simulate_thread_other_threads()
25 /* Don't go past the 6 bits var.c can hold. */
29 /* Called after each instruction. Returns 1 if any inconsistency is
30 found, 0 otherwise. */
31 int simulate_thread_step_verify()
36 printf("FAIL: invalid intermediate value for <b>.\n");
39 if (var.c != global % 64)
41 printf("FAIL: invalid intermediate value for <c>.\n");
47 /* Called at the end of the program (simulate_thread_fini == 1). Verifies
48 the state of the program and returns 1 if any inconsistency is
49 found, 0 otherwise. */
50 int simulate_thread_final_verify()
54 printf("FAIL: invalid final result for <a>.\n");
60 __attribute__((noinline))
61 void simulate_thread_main()
68 simulate_thread_main();
69 simulate_thread_done();