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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [torture/] [pr19683-1.c] - Blame information for rev 867

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

Line No. Rev Author Line
1 149 jeremybenn
/* From PR rtl-optimization/19683.  On little-endian MIPS targets,
2
   reload would incorrectly inherit the high part of the multiplication
3
   result.  */
4
/* { dg-do run { target mips*-*-* } } */
5
 
6
extern void abort (void);
7
extern void exit (int);
8
 
9
#ifndef __mips16
10
#define REPEAT10(X, Y)                                  \
11
  X(Y##0); X(Y##1); X(Y##2); X(Y##3); X(Y##4);          \
12
  X(Y##5); X(Y##6); X(Y##7); X(Y##8); X(Y##9)
13
 
14
#define REPEAT30(X) REPEAT10 (X, 0); REPEAT10 (X, 1); REPEAT10 (X, 2)
15
#define IN(X) unsigned int x##X = ptr[0]
16
#define OUT(X) ptr[0] = x##X
17
 
18
union u { unsigned long long ll; unsigned int i[2]; };
19
 
20
unsigned int
21
foo (volatile unsigned int *ptr)
22
{
23
  union u u;
24
  int result;
25
 
26
  u.ll = (unsigned long long) ptr[0] * ptr[0];
27
  REPEAT30 (IN);
28
  REPEAT30 (OUT);
29
  asm ("#" : "=l" (result) : "l" (u.i[1]));
30
  return result;
31
}
32
 
33
int
34
main (void)
35
{
36
  unsigned int array[] = { 1000 * 1000 * 1000 };
37
  union u u;
38
 
39
  u.ll = (unsigned long long) array[0] * array[0];
40
  if (foo (array) != u.i[1])
41
    abort ();
42
  exit (0);
43
}
44
#else
45
int
46
main (void)
47
{
48
  exit (0);
49
}
50
#endif

powered by: WebSVN 2.1.0

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