This testcase is sensitive to some sleep period. On slower
machines we need to sleep longer. See bugzilla #268623 comment #2.
So let's sleep 500ms instead of 100ms, get rid of the load
barrier and enable the testcase for s390x again.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12031 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/helgrind/tests/annotate_hbefore.c b/helgrind/tests/annotate_hbefore.c
index c05c8c2..5f96942 100644
--- a/helgrind/tests/annotate_hbefore.c
+++ b/helgrind/tests/annotate_hbefore.c
@@ -235,9 +235,9 @@
int shared_var = 0; // is not raced upon
-void delay100ms ( void )
+void delay500ms ( void )
{
- struct timespec ts = { 0, 100 * 1000 * 1000 };
+ struct timespec ts = { 0, 500 * 1000 * 1000 };
nanosleep(&ts, NULL);
}
@@ -245,13 +245,8 @@
{
UWord w0 = *w;
UWord volatile * wV = w;
- while (*wV == w0) {
-#ifdef VGA_s390x
- asm volatile ("bcr 15,0\n\t"); /* load barrier */
-#else
+ while (*wV == w0)
;
-#endif
- }
ANNOTATE_HAPPENS_AFTER(w);
}
@@ -266,11 +261,11 @@
void* thread_fn1 ( void* arg )
{
UWord* w = (UWord*)arg;
- delay100ms(); // ensure t2 gets to its wait first
+ delay500ms(); // ensure t2 gets to its wait first
shared_var = 1; // first access
do_signal(w); // cause h-b edge to second thread
- delay100ms();
+ delay500ms();
return NULL;
}
@@ -280,7 +275,7 @@
do_wait(w); // wait for h-b edge from first thread
shared_var = 2; // second access
- delay100ms();
+ delay500ms();
return NULL;
}
diff --git a/helgrind/tests/annotate_hbefore.vgtest b/helgrind/tests/annotate_hbefore.vgtest
index 9dc936b..1e37939 100644
--- a/helgrind/tests/annotate_hbefore.vgtest
+++ b/helgrind/tests/annotate_hbefore.vgtest
@@ -1,3 +1,2 @@
-prereq: (../../tests/arch_test s390x; if [ $? = 0 ]; then false; else true; fi)
vgopts: -q
prog: annotate_hbefore