test set build fixes for clang/gcc

This commit is contained in:
Ben Gras 2011-08-14 12:35:55 +00:00
parent 940bbe18b6
commit 65de5d71a9
4 changed files with 17 additions and 11 deletions

View file

@ -1,9 +1,10 @@
# 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
@ -27,10 +28,10 @@ all: $(OBJ) $(BIGOBJ) $(GCCOBJ) $(GCCFPUOBJ) $(ROOTOBJ) $(OTHEROBJ) depend
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
@ -39,7 +40,7 @@ $(GCCFPUOBJ):
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

View file

@ -109,11 +109,14 @@ void test36a()
#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

View file

@ -170,7 +170,9 @@ static void test_round_value_mode(double value, int mode, int exp_nearbyint,
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);
@ -212,7 +214,7 @@ static void test_remainder_value(double x, double y)
/* 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 */

View file

@ -170,7 +170,7 @@ void do_test(void)
}
}
int main(int argc, void* argv[])
int main(int argc, char* argv[])
{
start(58);
do_test();