[test-suite] r349273 - [test-suite] Fix NetBSD build

Kamil Rytarowski via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 15 07:05:28 PST 2018


Author: kamil
Date: Sat Dec 15 07:05:28 2018
New Revision: 349273

URL: http://llvm.org/viewvc/llvm-project?rev=349273&view=rev
Log:
[test-suite] Fix NetBSD build

No functional change intended for other OSes.

Modified:
    test-suite/trunk/MultiSource/Applications/JM/ldecod/image.c
    test-suite/trunk/MultiSource/Applications/JM/lencod/image.c
    test-suite/trunk/MultiSource/Applications/hexxagon/hexxagonmove.cpp
    test-suite/trunk/MultiSource/Applications/minisat/Main.cpp
    test-suite/trunk/MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/fmemopen.c
    test-suite/trunk/MultiSource/Benchmarks/MiBench/office-ispell/term.c
    test-suite/trunk/MultiSource/Benchmarks/Olden/voronoi/newvor.c
    test-suite/trunk/SingleSource/Benchmarks/Misc/oourafft.c
    test-suite/trunk/SingleSource/UnitTests/2005-05-11-Popcount-ffs-fls.c
    test-suite/trunk/SingleSource/UnitTests/2007-04-25-weak.c

Modified: test-suite/trunk/MultiSource/Applications/JM/ldecod/image.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/JM/ldecod/image.c?rev=349273&r1=349272&r2=349273&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/Applications/JM/ldecod/image.c (original)
+++ test-suite/trunk/MultiSource/Applications/JM/ldecod/image.c Sat Dec 15 07:05:28 2018
@@ -63,7 +63,7 @@
 
 #include "vlc.h"
 
-#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
 #include <sys/time.h>
 int ftime(struct timeb *tp)
 { 

Modified: test-suite/trunk/MultiSource/Applications/JM/lencod/image.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/JM/lencod/image.c?rev=349273&r1=349272&r2=349273&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/Applications/JM/lencod/image.c (original)
+++ test-suite/trunk/MultiSource/Applications/JM/lencod/image.c Sat Dec 15 07:05:28 2018
@@ -51,7 +51,7 @@
 #include "output.h"
 #include "cabac.h"
 
-#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
 #include <sys/time.h>
 int ftime(struct timeb *tp)
 { 
@@ -2885,5 +2885,3 @@ void read_SP_coefficients()
   }
   fclose(SP_coeff_file);
 }
-
-

Modified: test-suite/trunk/MultiSource/Applications/hexxagon/hexxagonmove.cpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/hexxagon/hexxagonmove.cpp?rev=349273&r1=349272&r2=349273&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/Applications/hexxagon/hexxagonmove.cpp (original)
+++ test-suite/trunk/MultiSource/Applications/hexxagon/hexxagonmove.cpp Sat Dec 15 07:05:28 2018
@@ -25,7 +25,7 @@
 
 #include <iostream>
 #include <stdlib.h>
-#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
 #include <sys/time.h>
 #else
 #include <sys/timeb.h>
@@ -91,7 +91,7 @@ void HexxagonMoveList::sortList()
 
 int getTime()
 {
-#if defined(__FreeBSD__) || defined(__OpenBSD__ )|| defined(__APPLE__)
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__ ) || defined(__APPLE__)
 	struct timeval tv;
 
 	gettimeofday(&tv, NULL);
@@ -200,7 +200,3 @@ HexxagonMove *HexxagonMoveList::getBestM
 	
 	return NULL;
 }
-
-
-
-

Modified: test-suite/trunk/MultiSource/Applications/minisat/Main.cpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/minisat/Main.cpp?rev=349273&r1=349272&r2=349273&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/Applications/minisat/Main.cpp (original)
+++ test-suite/trunk/MultiSource/Applications/minisat/Main.cpp Sat Dec 15 07:05:28 2018
@@ -65,7 +65,7 @@ static inline int memReadStat(int field)
 static inline uint64_t memUsed() { return (uint64_t)memReadStat(0) * (uint64_t)getpagesize(); }
 
 
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(__NetBSD__)
 static inline uint64_t memUsed(void) {
     struct rusage ru;
     getrusage(RUSAGE_SELF, &ru);

Modified: test-suite/trunk/MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/fmemopen.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/DOE-ProxyApps-C%2B%2B/CLAMR/fmemopen.c?rev=349273&r1=349272&r2=349273&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/fmemopen.c (original)
+++ test-suite/trunk/MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/fmemopen.c Sat Dec 15 07:05:28 2018
@@ -15,7 +15,7 @@
 // limitations under the License.
 //
 
-#ifndef __linux__
+#if !defined(__linux__) && !defined(__NetBSD__)
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -111,4 +111,3 @@ FILE *fmemopen(void *buf, size_t size, c
 }
 
 #endif // __linux__
-

Modified: test-suite/trunk/MultiSource/Benchmarks/MiBench/office-ispell/term.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/MiBench/office-ispell/term.c?rev=349273&r1=349272&r2=349273&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/Benchmarks/MiBench/office-ispell/term.c (original)
+++ test-suite/trunk/MultiSource/Benchmarks/MiBench/office-ispell/term.c Sat Dec 15 07:05:28 2018
@@ -72,7 +72,7 @@ static char Rcs_Id[] =
 #include "msgs.h"
 #include <signal.h>
 
-#if defined(__GLIBC__) || defined(__FreeBSD__) || defined(__APPLE__)
+#if defined(__GLIBC__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)
 /* Use termios under at least glibc */
 #include <termios.h>
 #define USE_TERMIOS

Modified: test-suite/trunk/MultiSource/Benchmarks/Olden/voronoi/newvor.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Olden/voronoi/newvor.c?rev=349273&r1=349272&r2=349273&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/Benchmarks/Olden/voronoi/newvor.c (original)
+++ test-suite/trunk/MultiSource/Benchmarks/Olden/voronoi/newvor.c Sat Dec 15 07:05:28 2018
@@ -165,7 +165,7 @@ QUAD_EDGE next_edge, avail_edge;
 
 void delete_all_edges() { next_edge= 0; avail_edge = NYL;}
 
-#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__MINGW32__)
+#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__MINGW32__)
 #define MEMALIGN_IS_NOT_AVAILABLE
 #endif
 

Modified: test-suite/trunk/SingleSource/Benchmarks/Misc/oourafft.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Misc/oourafft.c?rev=349273&r1=349272&r2=349273&view=diff
==============================================================================
--- test-suite/trunk/SingleSource/Benchmarks/Misc/oourafft.c (original)
+++ test-suite/trunk/SingleSource/Benchmarks/Misc/oourafft.c Sat Dec 15 07:05:28 2018
@@ -2,7 +2,7 @@
 #include <memory.h>
 #include <stdio.h>
 #include <stdlib.h>
-#if !defined(__APPLE__) && !defined(__FreeBSD__) // memalign
+#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__NetBSD__) // memalign
 #include <malloc.h>
 #endif
 
@@ -37,7 +37,7 @@ int main()
   t_overhead = t_end - t_start;
 
   /* Prepare aux data */
-#if !defined(__APPLE__) && !defined(__FreeBSD__) /* Darwin always 16-byte aligns malloc data */
+#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__NetBSD__) /* Darwin always 16-byte aligns malloc data */
   ip = memalign(16, sqrt(N)*sizeof(int));
   w  = memalign(16, 2*N*5/4*sizeof(double));
 #else
@@ -47,7 +47,7 @@ int main()
   makewt(N >> 1, ip, w);
   
   /* Allocate buffers */
-#if !defined(__APPLE__) && !defined(__FreeBSD__) /* Darwin always 16-byte aligns malloc data */
+#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__NetBSD__) /* Darwin always 16-byte aligns malloc data */
   ref = memalign(16, 2*N*sizeof(double));
   cmp = memalign(16, 2*N*sizeof(double));
   src = memalign(16, 2*N*sizeof(double));
@@ -757,4 +757,3 @@ void cftmdl(int n, int l, double *a, dou
     }
   }
 }
-

Modified: test-suite/trunk/SingleSource/UnitTests/2005-05-11-Popcount-ffs-fls.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/UnitTests/2005-05-11-Popcount-ffs-fls.c?rev=349273&r1=349272&r2=349273&view=diff
==============================================================================
--- test-suite/trunk/SingleSource/UnitTests/2005-05-11-Popcount-ffs-fls.c (original)
+++ test-suite/trunk/SingleSource/UnitTests/2005-05-11-Popcount-ffs-fls.c Sat Dec 15 07:05:28 2018
@@ -2,6 +2,9 @@
  * http://www.hackersdelight.org/HDcode/nlz.cc and
  * http://www.hackersdelight.org/HDcode/ntz.cc
  */
+#if defined(__NetBSD__)
+#include <sys/bitops.h>
+#endif
 #include <stdio.h>
 #include <string.h>
 #include <strings.h>
@@ -72,6 +75,10 @@ int ntz8(unsigned x) {
 #define ffsl ffs
 #endif
 
+#if defined(__NetBSD__)
+#define ffsl ffs64
+#endif
+
 int i;
 int main(void) {
   long long l;
@@ -107,4 +114,3 @@ int main(void) {
 
   return(0);
 }
-

Modified: test-suite/trunk/SingleSource/UnitTests/2007-04-25-weak.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/UnitTests/2007-04-25-weak.c?rev=349273&r1=349272&r2=349273&view=diff
==============================================================================
--- test-suite/trunk/SingleSource/UnitTests/2007-04-25-weak.c (original)
+++ test-suite/trunk/SingleSource/UnitTests/2007-04-25-weak.c Sat Dec 15 07:05:28 2018
@@ -1,5 +1,5 @@
 
-#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
+#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__)
 extern int test_weak () __attribute__ ((weak_import));
 #else
 extern int test_weak () __attribute__ ((weak));




More information about the llvm-commits mailing list