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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [20020219-1.c] - Blame information for rev 801

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

Line No. Rev Author Line
1 689 jeremybenn
/* PR c/4389
2
   This testcase failed because host_integerp (x, 0) was returning
3
   1 even for constants bigger than 2^31.  It fails under under hppa
4
   hpux without -mdisable-indexing because the pointer x - 1 is used
5
   as the base address of an indexed load.  Because the struct A is not
6
   actually allocated, x - 1 lies in the text segment and this causes
7
   the wrong space register to be selected for the load.  It fails on
8
   IA64 hpux in ILP32 mode because extending x - 1 before adding the
9
   array offset gives a different answer then adding first and then
10
   extending.  The underlying problem is the same as with hppa, x - 1 is
11
   not a legal data address.  It also fails on x32 targets for the
12
   same reason.  */
13
/* { dg-do run } */
14
/* { dg-options "-O2" } */
15
/* { dg-options "-O2 -mdisable-indexing" { target hppa*-*-hpux* } } */
16
/* { dg-skip-if "" { "ia64-*-hpux*" } "*" "-mlp64" } */
17
/* { dg-skip-if "" { { i?86-*-* x86_64-*-* } && x32 } { "*" } { "" } } */
18
 
19
/* Disable the test entirely for 16-bit targets.  */
20
#if __INT_MAX__ > 32767
21
 
22
extern void abort (void);
23
extern void exit (int);
24
struct A {
25
  int a[10000][10000];
26
};
27
int b[2] = { 213151, 0 };
28
 
29
void foo (struct A *x, int y)
30
{
31
  if (x->a[9999][9999] != x->a[y][y])
32
    abort ();
33
  if (x->a[9999][9999] != 213151)
34
    abort ();
35
}
36
 
37
int main (void)
38
{
39
  struct A *x;
40
  asm ("" : "=r" (x) : "0" (&b[1]));
41
  foo (x - 1, 9999);
42
  exit (0);
43
}
44
 
45
#else
46
 
47
int main () { return 0; }
48
 
49
#endif /* __INT_MAX__ */

powered by: WebSVN 2.1.0

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