From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1698) id 76155385840A; Fri, 5 Nov 2021 21:07:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 76155385840A MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Iain D Sandoe To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-4958] testsuite, Darwin : Fix tsvc test build on Darwin. X-Act-Checkin: gcc X-Git-Author: Iain Sandoe X-Git-Refname: refs/heads/master X-Git-Oldrev: f1e2879ecfc8897df0e25a53e81d1868363c5e08 X-Git-Newrev: 8f4860f956871c3fd77ed60567d707490104f370 Message-Id: <20211105210706.76155385840A@sourceware.org> Date: Fri, 5 Nov 2021 21:07:06 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Nov 2021 21:07:06 -0000 https://gcc.gnu.org/g:8f4860f956871c3fd77ed60567d707490104f370 commit r12-4958-g8f4860f956871c3fd77ed60567d707490104f370 Author: Iain Sandoe Date: Fri Nov 5 19:19:53 2021 +0000 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: --- gcc/testsuite/gcc.dg/vect/tsvc/tsvc.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gcc/testsuite/gcc.dg/vect/tsvc/tsvc.h b/gcc/testsuite/gcc.dg/vect/tsvc/tsvc.h index b52108dae9f..5dd9ca91040 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);