From: Iain Sandoe Date: Fri, 5 Nov 2021 19:19:53 +0000 (+0000) Subject: testsuite, Darwin : Fix tsvc test build on Darwin. X-Git-Tag: upstream/12.2.0~3739 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8f4860f956871c3fd77ed60567d707490104f370;p=platform%2Fupstream%2Fgcc.git testsuite, Darwin : Fix tsvc test build on Darwin. Currently all the tsvc tests fail to build on Darwin because they assume that and memalign() are available. For Darwin, 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 gcc/testsuite/ChangeLog: * gcc.dg/vect/tsvc/tsvc.h: Do not try to include malloc.h on Darwin also use posix_memalign (). --- diff --git a/gcc/testsuite/gcc.dg/vect/tsvc/tsvc.h b/gcc/testsuite/gcc.dg/vect/tsvc/tsvc.h index b52108d..5dd9ca9 100644 --- a/gcc/testsuite/gcc.dg/vect/tsvc/tsvc.h +++ b/gcc/testsuite/gcc.dg/vect/tsvc/tsvc.h @@ -11,7 +11,9 @@ #include #include +#ifndef __APPLE__ #include +#endif #include #include @@ -187,8 +189,13 @@ void set_2d_array(real_t arr[LEN_2D][LEN_2D], real_t value, int stride) } 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);