gcc/testsuite/g++.dg/ipa/pr50605.C
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-O3 -fno-early-inlining" } */ |
| 3 | |
| 4 | class A |
| 5 | { |
| 6 | public: |
| 7 | int a; |
| 8 | void *stuff; |
| 9 | }; |
| 10 | |
| 11 | class B |
| 12 | { |
| 13 | public: |
| 14 | int b; |
| 15 | void *other_stuff; |
| 16 | A array[50]; |
| 17 | }; |
| 18 | |
| 19 | extern B gb; |
| 20 | |
| 21 | int process_A (A *a) |
| 22 | { |
| 23 | return a->a; |
| 24 | } |
| 25 | |
| 26 | int process_A_complex (A *a) |
| 27 | { |
| 28 | return process_A (a+3); |
| 29 | } |
| 30 | |
| 31 | int process_B (B *b) |
| 32 | { |
| 33 | return process_A_complex (&b->array[0]); |
| 34 | } |
| 35 | |
| 36 | int foo (void) |
| 37 | { |
| 38 | return process_B (&gb); |
| 39 | } |
| 40 |