| 1 |
// { dg-do run } |
| 2 |
|
| 3 |
// Copyright (C) 2001 Free Software Foundation, Inc. |
| 4 |
// Contributed by Nathan Sidwell 17 Oct 2002 <[email protected]> |
| 5 |
|
| 6 |
// PR 7209. We didn't SAVE_EXPR in the right place |
| 7 |
|
| 8 |
char a[2][1][16]={ |
| 9 |
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}, |
| 10 |
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}}; |
| 11 |
|
| 12 |
int f() {return 0;} |
| 13 |
|
| 14 |
char * Foo (int d) |
| 15 |
{ |
| 16 |
char *c1; |
| 17 |
|
| 18 |
c1=a[d==0 ? 0 : 1][f()]; |
| 19 |
|
| 20 |
return c1; |
| 21 |
} |
| 22 |
|
| 23 |
int main () |
| 24 |
{ |
| 25 |
if (Foo (0) != (void *)a) |
| 26 |
return 1; |
| 27 |
return 0; |
| 28 |
} |