From 2cf92a6395e442f39724002cb05727064f60eca9 Mon Sep 17 00:00:00 2001 From: Olaf Barthel Date: Tue, 18 Apr 2006 08:29:46 +0000 Subject: [PATCH] - Added the rand() test program. git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15099 87f5fb63-7c3d-0410-a384-fd976d0f7a62 --- test_programs/GNUmakefile.68k | 10 +++++++--- test_programs/GNUmakefile.os4 | 8 ++++++-- test_programs/rand.c | 20 ++++++++++++++++++++ 3 files changed, 33 insertions(+), 5 deletions(-) create mode 100755 test_programs/rand.c diff --git a/test_programs/GNUmakefile.68k b/test_programs/GNUmakefile.68k index 130dc2d..a7a325e 100644 --- a/test_programs/GNUmakefile.68k +++ b/test_programs/GNUmakefile.68k @@ -1,5 +1,5 @@ # -# $Id: GNUmakefile.68k,v 1.11 2006-04-05 06:35:42 obarthel Exp $ +# $Id: GNUmakefile.68k,v 1.12 2006-04-18 08:29:46 obarthel Exp $ # # :ts=8 # @@ -49,13 +49,13 @@ LIBS = -lm -lc -lgcc all: test fgets_test iotest sscanf_test printf_test sprintf_test \ stack_size_test translate_test strtok_test uname simple \ fstat_stdout_test simple_sprintf date_test sscanf_64 factorial \ - setlocale + setlocale rand clean: $(DELETE) #?.o #?.map test fgets_test iotest sscanf_test printf_test \ sprintf_test stack_size_test translate_test strtok_test uname \ simple fstat_stdout_test simple_sprintf date_test sscanf_64 \ - factorial setlocale + factorial setlocale rand ############################################################################## @@ -127,6 +127,10 @@ factorial : factorial.o @echo "Linking $@" $(CC) $(CFLAGS) -o $@ factorial.o $(LIBS) -Wl,--cref,-M,-Map=$@.map +rand : rand.o + @echo "Linking $@" + $(CC) $(CFLAGS) -o $@ rand.o $(LIBS) -Wl,--cref,-M,-Map=$@.map + ############################################################################## mkid: diff --git a/test_programs/GNUmakefile.os4 b/test_programs/GNUmakefile.os4 index cd766a6..955164a 100644 --- a/test_programs/GNUmakefile.os4 +++ b/test_programs/GNUmakefile.os4 @@ -1,5 +1,5 @@ # -# $Id: GNUmakefile.os4,v 1.12 2006-04-05 06:35:42 obarthel Exp $ +# $Id: GNUmakefile.os4,v 1.13 2006-04-18 08:29:46 obarthel Exp $ # # :ts=8 # @@ -47,7 +47,7 @@ clean: $(DELETE) *.o *.map test fgets_test iotest sscanf_test printf_test \ sprintf_test stack_size_test translate_test strtok_test \ uname simple fstat_stdout_test simple_sprintf date_test \ - sscanf_64 factorial setlocale + sscanf_64 factorial setlocale rand ############################################################################## @@ -118,3 +118,7 @@ sscanf_64 : sscanf_64.o factorial : factorial.o @echo "Linking $@" $(CC) -nostdlib $(CFLAGS) -o $@ factorial.o -lc -lgcc -Wl,--cref,-M,-Map=$@.map + +rand : rand.o + @echo "Linking $@" + $(CC) -nostdlib $(CFLAGS) -o $@ rand.o -lc -lgcc -Wl,--cref,-M,-Map=$@.map diff --git a/test_programs/rand.c b/test_programs/rand.c new file mode 100755 index 0000000..a855e00 --- /dev/null +++ b/test_programs/rand.c @@ -0,0 +1,20 @@ +#include +#include + +int +main(int argc,char **argv) +{ + int n = 10,i,x; + + if(argc > 1) + n = atoi(argv[1]); + + for(i = 0 ; i < n ; i++) + { + x = rand(); + + printf("0x%08lx %d\n",x,x); + } + + return(0); +}