1
0
mirror of https://github.com/adtools/clib2.git synced 2025-12-08 14:59:05 +00:00

- 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
This commit is contained in:
Olaf Barthel
2006-04-18 08:29:46 +00:00
parent c26ee0ba7f
commit 2cf92a6395
3 changed files with 33 additions and 5 deletions

View File

@ -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:

View File

@ -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

20
test_programs/rand.c Executable file
View File

@ -0,0 +1,20 @@
#include <stdlib.h>
#include <stdio.h>
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);
}