OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.17.0/] [libgloss/] [testsuite/] [libgloss.all/] [div.c] - Blame information for rev 148

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 148 jeremybenn
/* WinBond bug report
2
 
3
   Please don't use "gcc -O3 -S hello.c" command, because it
4
   will optimize "i/5" to be "2" in compile time.
5
 
6
 */
7
 
8
#include <stdio.h>
9
#define TESTSEED 10
10
 
11
main ()
12
{
13
  int    a1,b1,c1;
14
  long   a2,b2,c2;
15
  double a3,b3,c3;
16
  float  a4,b4,c4;
17
  char   buf[20];
18
 
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);
30
    }
31
    fflush (stdout);
32
  }
33
}
34
 
35
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.