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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [opt/] [ptrintsum1.C] - Blame information for rev 315

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

Line No. Rev Author Line
1 301 jeremybenn
// PR c++/4401
2
// This testcase was miscompiled on 64-bit platforms, resulting to
3
// operating on a[0x100000000] instead of a[0].
4
// { dg-do run }
5
// { dg-options "-O2" }
6
 
7
char *a;
8
char b[] = "AAAA";
9
 
10
extern "C" void abort (void);
11
extern "C" void exit (int);
12
 
13
void foo (void)
14
{
15
  unsigned int i, j;
16
 
17
  i = 2;
18
  j = 3;
19
  a[i + 1 - j] += i;
20
}
21
 
22
int main (void)
23
{
24
  a = b;
25
  foo ();
26
  if (b[0] != 'A' + 2)
27
    abort ();
28
  exit (0);
29
}

powered by: WebSVN 2.1.0

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