OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [torture/] [pr36745.C] - Blame information for rev 302

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 301 jeremybenn
/* PR target/36745 */
2
/* { dg-do compile } */
3
/* { dg-options "-O2 -fPIC" } */
4
/* { dg-require-effective-target fpic } */
5
 
6
typedef __SIZE_TYPE__ size_t;
7
class QBasicAtomicInt
8
{
9
public:
10
  int _q_value;
11
  inline bool operator== (int value) const
12
  {
13
  }
14
  bool ref ();
15
  bool deref ();
16
};
17
inline bool
18
QBasicAtomicInt::ref ()
19
{
20
  __asm__ ("": "=m" (_q_value): :);
21
  return true;
22
}
23
 
24
namespace std
25
{
26
  using::size_t;
27
}
28
extern "C++"
29
{
30
  inline void *operator new (std::size_t, void *__p)
31
  {
32
    return __p;
33
  }
34
}
35
struct QMapData
36
{
37
  QBasicAtomicInt ref;
38
  static QMapData shared_null;
39
};
40
template < class Key, class T > class QMap
41
{
42
  QMapData *d;
43
public: inline QMap ():d (&QMapData::shared_null)
44
  {
45
  }
46
  inline ~ QMap ()
47
  {
48
    if (!d->ref.deref ())
49
      freeData (d);
50
  }
51
  void freeData (QMapData * d);
52
};
53
struct QVectorData
54
{
55
  static QVectorData shared_null;
56
};
57
template < typename T > struct QVectorTypedData
58
{
59
  QBasicAtomicInt ref;
60
};
61
template < typename T > class QVector
62
{
63
  union
64
  {
65
    QVectorData *p;
66
    QVectorTypedData < T > *d;
67
  };
68
public: inline QVector ():p (&QVectorData::shared_null)
69
  {
70
    d->ref.ref ();
71
  }
72
  inline void detach ()
73
  {
74
    if (d->ref == 1)
75
      detach_helper ();
76
  }
77
  inline T *data ()
78
  {
79
    detach ();
80
  }
81
  T & operator[](int i);
82
  void detach_helper ();
83
  void realloc ();
84
};
85
template < typename T > void QVector < T >::detach_helper ()
86
{
87
  realloc ();
88
}
89
 
90
template < typename T > inline T & QVector < T >::operator[](int i)
91
{
92
  return data ()[i];
93
}
94
template < typename T > void QVector < T >::realloc ()
95
{
96
  T *j, *i;
97
  i->~T ();
98
  while (j-- == i)
99
    new (j) T;
100
}
101
 
102
void
103
mergeInto (QVector < int >*a)
104
{
105
};
106
struct QRegExpAutomatonState
107
{
108
  QVector < int >outs;
109
  QMap < int, int >reenter;
110
  QMap < int, int >anchors;
111
};
112
class QRegExpEngine
113
{
114
  void addCatTransitions ();
115
  QVector < QRegExpAutomatonState > s;
116
};
117
void
118
QRegExpEngine::addCatTransitions ()
119
{
120
  mergeInto (&s[2].outs);
121
}

powered by: WebSVN 2.1.0

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