added tests as prepared by oliver

This commit is contained in:
mrdudz
2014-09-24 16:45:10 +02:00
parent d75f9c2051
commit 9b82eaadd0
121 changed files with 25206 additions and 0 deletions

38
test/ref/divmod.c Normal file
View File

@@ -0,0 +1,38 @@
/*
!!DESCRIPTION!! div/mod test
!!ORIGIN!!
!!LICENCE!! public domain
*/
#include <stdio.h>
void printc(signed char a,signed char b){
signed char x=a/b,y=a%b,z=a*b;
printf("%3d,%3d is %3d,%3d,%3d\n",a,b,x,y,z);
}
void prints(short a,short b){
short x=a/b,y=a%b,z=a*b;
printf("%3d,%3d is %3d,%3d,%3d\n",a,b,x,y,z);
}
void printl(long a,long b){
long x=a/b,y=a%b,z=a*b;
printf("%3ld,%3ld is %3ld,%3ld,%3ld\n",a,b,x,y,z);
}
int main(void) {
printl( 3,-2);
printl(-3,-2);
printl(-3, 2);
printl( 3, 2);
printf("-\n");
prints( 3,-2);
prints(-3,-2);
prints(-3, 2);
prints( 3, 2);
printf("-\n");
printc( 3,-2);
printc(-3,-2);
printc(-3, 2);
printc( 3, 2);
return 0;
}