fixes for host gcc 4.6.1
[zpugcc/jano.git] / toolchain / gcc / libgloss / testsuite / libgloss.all / div.c
blob32eff9d4d0755396675b2aa3321426a5e7dc3bb2
1 /* WinBond bug report
3 Please don't use "gcc -O3 -S hello.c" command, because it
4 will optimize "i/5" to be "2" in compile time.
6 */
8 #include <stdio.h>
9 #define TESTSEED 10
11 main ()
13 int a1,b1,c1;
14 long a2,b2,c2;
15 double a3,b3,c3;
16 float a4,b4,c4;
17 char buf[20];
19 /* integer tests */
20 for (a1 = 1; a1 < 16; a1++) {
21 b1 = TESTSEED/a1;
22 c1 = TESTSEED%a1;
23 printf ("%d/%d = %d, ^ = %d\n", TESTSEED, a1, b1, c1);
24 if ((c1 + (a1 * b1)) == TESTSEED) {
25 sprintf (buf, "div %d by %d", TESTSEED, a1);
26 pass (buf);
27 } else {
28 sprintf (buf, "div %d by %d", TESTSEED, a1);
29 fail (buf);
31 fflush (stdout);