gcc/testsuite/g++.dg/opt/reload1.C
raw| 1 | // PR 7944 |
| 2 | // { dg-do compile } |
| 3 | // { dg-options -O2 } |
| 4 | |
| 5 | struct B |
| 6 | { |
| 7 | B & operator << (short s) |
| 8 | { |
| 9 | int j; |
| 10 | if (j) |
| 11 | return operator << (s); |
| 12 | else |
| 13 | return operator << (s); |
| 14 | } |
| 15 | }; |
| 16 | |
| 17 | struct A |
| 18 | { |
| 19 | int i; |
| 20 | static void bar (); |
| 21 | static int quux () |
| 22 | { |
| 23 | bar (); |
| 24 | return 0; |
| 25 | } |
| 26 | |
| 27 | A ():i (quux ()) |
| 28 | { |
| 29 | } |
| 30 | ~A () |
| 31 | { |
| 32 | } |
| 33 | }; |
| 34 | |
| 35 | void |
| 36 | foo () |
| 37 | { |
| 38 | short s[4] = { 0, 0, 0, 1 }; |
| 39 | A a[2] = { A (), A () }; |
| 40 | |
| 41 | B b; |
| 42 | b << s[0] << s[2]; |
| 43 | } |