repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
PR c++/80290
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
opt
/
ptrintsum1.C
blob
a6a3c9727db059b587cf6edf8c30d82b33263af2
1
// 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
}