gcc/testsuite/gcc.c-torture/execute/pr60822.c
raw| 1 | /* { dg-require-effective-target int32plus } */ |
| 2 | struct X { |
| 3 | char fill0[800000]; |
| 4 | int a; |
| 5 | char fill1[900000]; |
| 6 | int b; |
| 7 | }; |
| 8 | |
| 9 | int __attribute__((noinline,noclone)) |
| 10 | Avg(struct X *p, int s) |
| 11 | { |
| 12 | return (s * (long long)(p->a + p->b)) >> 17; |
| 13 | } |
| 14 | |
| 15 | struct X x; |
| 16 | |
| 17 | int main() |
| 18 | { |
| 19 | x.a = 1 << 17; |
| 20 | x.b = 2 << 17; |
| 21 | if (Avg(&x, 1) != 3) |
| 22 | __builtin_abort(); |
| 23 | return 0; |
| 24 | } |
| 25 |