aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/pr50763-3.C
blob: b66be87b1b8821087a9e10436ac19baac448c711 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-O2 -ftree-tail-merge" } */

class v2d {
public:
   double x;
   double y;
};

class v3d {
public:
   double x;
   v3d() {}
   v3d(const v2d & cr2Dv) {}
};

class e2d {
protected:
   v2d _Min;
   v2d _Max;
public:
   int cop2d(const v2d & rPnt) const;
   v2d clp2d(const v2d & rPnt) const;
};

inline int e2d::cop2d(const v2d & rPnt) const {
   int bRet = 1;
   if (rPnt.x < _Min.x) bRet = 0;
   else if (rPnt.x > _Max.x) bRet = 0;
   else if (rPnt.y > _Max.y) bRet = 0;
   return bRet;
}

inline v2d e2d::clp2d(const v2d & rPnt) const {
   v2d sRet = rPnt;
   if (rPnt.x < _Min.x) sRet.x = _Min.x;
   if (rPnt.y < _Min.y) sRet.y = _Min.y;
   if (rPnt.x > _Max.x) sRet.x = _Max.x;
   if (rPnt.y > _Max.y) sRet.y = _Max.y;
   return sRet;
}

class sExt {
protected:
   e2d _Dom;
   long eval() const;
   long evalPoint(const v2d & crUV, v3d & rPnt) const;
};

long sExt::evalPoint(const v2d & crUV, v3d & rPnt) const {
   v3d sUV = crUV;
   if (!_Dom.cop2d(crUV)) {
      sUV = _Dom.clp2d(crUV);
   }
   eval();
}