Currently all the tsvc tests fail to build on Darwin because
they assume that <malloc.h> and memalign() are available.
For Darwin, <stdlib.h> is sufficient to obtain the declarations
for malloc and the port has posix_memalign () but not memalign.
Fixed as below.
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/testsuite/ChangeLog:
* gcc.dg/vect/tsvc/tsvc.h: Do not try to include malloc.h
on Darwin also use posix_memalign ().
#include <stdio.h>
#include <stdlib.h>
+#ifndef __APPLE__
#include <malloc.h>
+#endif
#include <string.h>
#include <math.h>
}
void init(int** ip, real_t* s1, real_t* s2){
+#ifndef __APPLE__
xx = (real_t*) memalign(ARRAY_ALIGNMENT, LEN_1D*sizeof(real_t));
*ip = (int *) memalign(ARRAY_ALIGNMENT, LEN_1D*sizeof(real_t));
+#else
+ posix_memalign ((void*)&xx, ARRAY_ALIGNMENT, LEN_1D*sizeof(real_t));
+ posix_memalign ((void*)ip, ARRAY_ALIGNMENT, LEN_1D*sizeof(real_t));
+#endif
for (int i = 0; i < LEN_1D; i = i+5){
(*ip)[i] = (i+4);