OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [20020201-1.c] - Blame information for rev 297

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

Line No. Rev Author Line
1 297 jeremybenn
/* Test whether division by constant works properly.  */
2
 
3
extern void abort (void);
4
extern void exit (int);
5
 
6
unsigned char cx = 7;
7
unsigned short sx = 14;
8
unsigned int ix = 21;
9
unsigned long lx = 28;
10
unsigned long long Lx = 35;
11
 
12
int
13
main ()
14
{
15
  unsigned char cy;
16
  unsigned short sy;
17
  unsigned int iy;
18
  unsigned long ly;
19
  unsigned long long Ly;
20
 
21
  cy = cx / 6; if (cy != 1) abort ();
22
  cy = cx % 6; if (cy != 1) abort ();
23
 
24
  sy = sx / 6; if (sy != 2) abort ();
25
  sy = sx % 6; if (sy != 2) abort ();
26
 
27
  iy = ix / 6; if (iy != 3) abort ();
28
  iy = ix % 6; if (iy != 3) abort ();
29
 
30
  ly = lx / 6; if (ly != 4) abort ();
31
  ly = lx % 6; if (ly != 4) abort ();
32
 
33
  Ly = Lx / 6; if (Ly != 5) abort ();
34
  Ly = Lx % 6; if (Ly != 5) abort ();
35
 
36
  exit(0);
37
}

powered by: WebSVN 2.1.0

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