| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-options "-O2 -ftree-tail-merge" } */ |
| 3 |
|
| 4 |
static inline void set_longish(int is_long_long, void *p, long x) |
| 5 |
{ |
| 6 |
if (is_long_long) |
| 7 |
*(long long*)p = x; |
| 8 |
else |
| 9 |
*(long*)p = x; |
| 10 |
} |
| 11 |
static long test(long long *p, int index, int mode) |
| 12 |
{ |
| 13 |
*p = 1; |
| 14 |
set_longish(mode, p+index, 2); |
| 15 |
return *p; |
| 16 |
} |
| 17 |
long (*volatile vtest)(long long*, int, int) = test; |
| 18 |
int main(void) |
| 19 |
{ |
| 20 |
long long x; |
| 21 |
long result = vtest(&x, 0, 1); |
| 22 |
if (result != 2 || x != 2) |
| 23 |
__builtin_abort (); |
| 24 |
return 0; |
| 25 |
} |