OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [opt/] [memcpy1.C] - Blame information for rev 693

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// PR target/34403
2
// Origin: Martin Michlmayr 
3
 
4
// { dg-do compile }
5
// { dg-options "-O" }
6
 
7
typedef unsigned char uint8_t;
8
typedef uint8_t uint8;
9
__extension__ typedef __SIZE_TYPE__ size_t;
10
class csVector2
11
{
12
public:float x;
13
};
14
class csBox2
15
{
16
};
17
struct iBase
18
{
19
};
20
struct iClipper2D:public virtual iBase
21
{
22
};
23
template < class Class > class scfImplementation:public virtual iBase
24
{
25
};
26
template < class Class, class I1 > class scfImplementation1:public
27
scfImplementation < Class >,
28
  public I1
29
{
30
};
31
class csClipper:public scfImplementation1 < csClipper, iClipper2D >
32
{
33
};
34
class csBoxClipper:public csClipper
35
{
36
  csBox2 region;
37
  virtual uint8 Clip (csVector2 * InPolygon, size_t InCount,
38
                      csVector2 * OutPolygon, size_t & OutCount);
39
};
40
struct StatusOutputNone
41
{
42
};
43
namespace CS
44
{
45
  template < typename BoxTest, typename StatusOutput > class BoxClipper
46
  {
47
    BoxTest boxTest;
48
    StatusOutput statOut;
49
    const csBox2 & region;
50
    csVector2 *InP;
51
    size_t InV;
52
    csVector2 *OutP;
53
    size_t OutV;
54
  public:  BoxClipper (const BoxTest & boxTest, const StatusOutput & statOut,
55
                  const csBox2 & region, csVector2 * InP, size_t InV,
56
                  csVector2 * OutP):boxTest (boxTest), statOut (statOut),
57
      region (region), InP (InP), InV (InV), OutP (OutP), OutV (-1)
58
    {
59
    }
60
    uint8 Clip ()
61
    {
62
      __builtin_memcpy (this->OutP, InP, OutV * sizeof (csVector2));
63
    }
64
  };
65
}
66
struct BoxTestAll
67
{
68
};
69
uint8
70
csBoxClipper::Clip (csVector2 * InPolygon, size_t InCount,
71
                    csVector2 * OutPolygon, size_t & OutCount)
72
{
73
  BoxTestAll b;
74
  StatusOutputNone n;
75
  CS::BoxClipper < BoxTestAll, StatusOutputNone > boxClip (b, n, region,
76
                                                           InPolygon, InCount,
77
                                                           OutPolygon);
78
  uint8 Clipped = boxClip.Clip ();
79
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.