Fix tsvc test build on DragonFly.
authorRimvydas Jasinskas <rimvydas.jas@gmail.com>
Tue, 18 Jan 2022 06:27:17 +0000 (06:27 +0000)
committerMartin Liska <mliska@suse.cz>
Wed, 19 Jan 2022 06:47:07 +0000 (07:47 +0100)
Currently all tsvc tests fail to build on DragonFly BSD because they
assume <malloc.h> and memalign() are available.

gcc/testsuite/ChangeLog:

PR testsuite/104021
* gcc.dg/vect/tsvc/tsvc.h: Do not include malloc.h on dragonfly
and use posix_memalign ().

Signed-off-by: Rimvydas Jasinskas <rimvydas.jas@gmail.com>
gcc/testsuite/gcc.dg/vect/tsvc/tsvc.h

index 665ca74..75494c2 100644 (file)
@@ -11,7 +11,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#ifndef __APPLE__
+#if !defined(__APPLE__) && !defined(__DragonFly__)
 #include <malloc.h>
 #endif
 #include <string.h>
@@ -189,7 +189,7 @@ 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){
-#if !defined (__APPLE__) && !defined (_AIX)
+#if !defined (__APPLE__) && !defined (_AIX) && !defined(__DragonFly__)
     xx = (real_t*) memalign(ARRAY_ALIGNMENT, LEN_1D*sizeof(real_t));
     *ip = (int *) memalign(ARRAY_ALIGNMENT, LEN_1D*sizeof(real_t));
 #else