Increase test coverage on OS X, by re-enabling the none/tests/*/movbe regression tests with a handy memalign() shim.
n-i-bz
$ perl tests/vg_regtest none/tests/x86/movbe none/tests/amd64/movbe
movbe: valgrind -q ./movbe
movbe: valgrind -q ./movbe
== 2 tests, 0 stderr failures, 0 stdout failures, 0 stderrB failures, 0 stdoutB failures, 0 post failures ==
On OS X 10.10
Before:
== 592 tests, 215 stderr failures, 9 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==
After:
== 594 tests, 215 stderr failures, 9 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15549 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/tests/malloc.h b/tests/malloc.h
index 0179b38..6a73dde 100644
--- a/tests/malloc.h
+++ b/tests/malloc.h
@@ -23,5 +23,21 @@
assert(x);
assert(0 == ((16-1) & (unsigned long)x));
return x;
-}
+}
+
+// Allocates a 32-aligned block. Asserts if the allocation fails.
+__attribute__((unused))
+static void* memalign32(size_t szB)
+{
+ void* x;
+#if defined(VGO_darwin)
+ // Darwin lacks memalign
+ posix_memalign((void **)&x, 32, szB);
+#else
+ x = memalign(32, szB);
+#endif
+ assert(x);
+ assert(0 == ((32-1) & (unsigned long)x));
+ return x;
+}