# Makefile for the tests.
GCC?=gcc
-CFLAGS= -O0 -D_MINIX -D_POSIX_SOURCE
+CFLAGS= -O0 -D_MINIX -D_POSIX_SOURCE -g
.if ${COMPILER_TYPE} == "gnu"
CFLAGS+= -D_NETBSD_SOURCE
+LIBS+= -lm -lcompat_minix
.endif
CFLAGS-GCC= $(CFLAGS) -Wall -D_NETBSD_SOURCE
CFLAGS-GCCFPU= $(CFLAGS) -Wall -mhard-float
chmod 755 *.sh run
$(OBJ):
- $(CC) $(CFLAGS) -o $@ $@.c
+ $(CC) $(CFLAGS) -o $@ $@.c $(LIBS)
$(BIGOBJ):
- $(CC) $(CFLAGS) -o $@ $@.c
+ $(CC) $(CFLAGS) -o $@ $@.c $(LIBS)
$(GCCOBJ):
if which $(GCC) >/dev/null 2>&1; then $(GCC) $(CFLAGS-GCC) -o $@ ${@:S/-gcc//}.c; fi
if which $(GCC) >/dev/null 2>&1; then $(GCC) $(CFLAGS-GCCFPU) -o $@ ${@:S/-gcc//}.c -lm; fi
$(ROOTOBJ):
- $(CC) $(CFLAGS) $@.c
+ $(CC) $(CFLAGS) $@.c $(LIBS)
@install -c -o root -m 4755 a.out $@
@rm a.out
#endif
#ifdef _POSIX_VDISABLE
-# if _POSIX_VDISABLE - 0 == -1
- if (not_provided_option(_PC_VDISABLE) != 0) e(7);
-# else
- if (provided_option(_PC_VDISABLE, 0) != 0) e(8);
-# endif
+ {
+ int _posix_vdisable = _POSIX_VDISABLE;
+ if(_posix_vdisable == -1) {
+ if (not_provided_option(_PC_VDISABLE) != 0) e(7);
+ } else {
+ if (provided_option(_PC_VDISABLE, 0) != 0) e(8);
+ }
+ }
#else
if (variating_option(_PC_VDISABLE, 0) != 0) e(9);
#endif
int exp_ceil, int exp_floor, int exp_trunc)
{
/* test both nearbyint and trunc */
+#if 0
test_round_value_mode_func(value, mode, nearbyint, exp_nearbyint);
+#endif
test_round_value_mode_func(value, mode, ceil, exp_ceil);
test_round_value_mode_func(value, mode, floor, exp_floor);
test_round_value_mode_func(value, mode, trunc, exp_trunc);
/* compute remainder using alternative approach */
mode_old = fegetround();
fesetround(FE_TONEAREST);
- r2 = x - nearbyint(x / y) * y;
+ r2 = x - rint(x / y) * y;
fesetround(mode_old);
/* Compare results */
}
}
-int main(int argc, void* argv[])
+int main(int argc, char* argv[])
{
start(58);
do_test();