1/* { dg-do compile } */ 2/* { dg-require-effective-target ilp32 } */ 3/* { dg-options "-O2 -ftree-tail-merge" } */ 4 5class v2d { 6public: 7 double x; 8 double y; 9}; 10 11class v3d { 12public: 13 double x; 14 v3d() {} 15 v3d(const v2d & cr2Dv) {} 16}; 17 18class e2d { 19protected: 20 v2d _Min; 21 v2d _Max; 22public: 23 int cop2d(const v2d & rPnt) const; 24 v2d clp2d(const v2d & rPnt) const; 25}; 26 27inline int e2d::cop2d(const v2d & rPnt) const { 28 int bRet = 1; 29 if (rPnt.x < _Min.x) bRet = 0; 30 else if (rPnt.x > _Max.x) bRet = 0; 31 else if (rPnt.y > _Max.y) bRet = 0; 32 return bRet; 33} 34 35inline v2d e2d::clp2d(const v2d & rPnt) const { 36 v2d sRet = rPnt; 37 if (rPnt.x < _Min.x) sRet.x = _Min.x; 38 if (rPnt.y < _Min.y) sRet.y = _Min.y; 39 if (rPnt.x > _Max.x) sRet.x = _Max.x; 40 if (rPnt.y > _Max.y) sRet.y = _Max.y; 41 return sRet; 42} 43 44class sExt { 45protected: 46 e2d _Dom; 47 long eval() const; 48 long evalPoint(const v2d & crUV, v3d & rPnt) const; 49}; 50 51long sExt::evalPoint(const v2d & crUV, v3d & rPnt) const { 52 v3d sUV = crUV; 53 if (!_Dom.cop2d(crUV)) { 54 sUV = _Dom.clp2d(crUV); 55 } 56 eval(); 57} 58