| 1 |
// { dg-do compile } |
| 2 |
// { dg-options "-O2" } |
| 3 |
|
| 4 |
typedef __complex__ double Value; |
| 5 |
struct LorentzVector |
| 6 |
{ |
| 7 |
LorentzVector & operator+=(const LorentzVector & a) { |
| 8 |
theX += a.theX; |
| 9 |
theY += a.theY; |
| 10 |
theZ += a.theZ; |
| 11 |
theT += a.theT; |
| 12 |
return *this; |
| 13 |
} |
| 14 |
|
| 15 |
Value theX; |
| 16 |
Value theY; |
| 17 |
Value theZ; |
| 18 |
Value theT; |
| 19 |
}; |
| 20 |
|
| 21 |
inline LorentzVector |
| 22 |
operator+(LorentzVector a, const LorentzVector & b) { |
| 23 |
return a += b; |
| 24 |
} |
| 25 |
|
| 26 |
Value ex, et; |
| 27 |
LorentzVector sum() { |
| 28 |
LorentzVector v1; v1.theX =ex; v1.theY =ex+et; v1.theZ =ex-et; v1.theT =et; |
| 29 |
return v1+v1; |
| 30 |
} |