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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [torture/] [pr49770.C] - Blame information for rev 774

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

Line No. Rev Author Line
1 693 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-std=c++0x -fno-tree-forwprop" } */
3
 
4
typedef __SIZE_TYPE__ size_t;
5
 
6
template < typename > struct remove_reference;
7
template < typename _Tp > struct remove_reference <_Tp & >
8
{
9
  typedef _Tp type;
10
};
11
template < typename _Tp > typename remove_reference < _Tp >::type &&
12
move (_Tp && __t)
13
{
14
  return static_cast < typename remove_reference < _Tp >::type && >(__t);
15
}
16
 
17
template < typename _Tp > void
18
stdswap (_Tp & __a, _Tp & __b)
19
{
20
  _Tp __tmp (__a);
21
  __a = (__b);
22
  __b = (__tmp);
23
}
24
 
25
struct _Deque_iterator
26
{
27
  int *_M_cur;
28
  int *_M_first;
29
  int *_M_last;
30
  int **_M_node;
31
};
32
 
33
static inline int operatorMIN (_Deque_iterator & __x, _Deque_iterator & __y)
34
{
35
  return sizeof (int) * (__x._M_node - __y._M_node - 1)
36
    + (__x._M_cur - __x._M_first) + (__y._M_last - __y._M_cur);
37
}
38
 
39
struct deque
40
{
41
  deque & operator = (deque && __x)
42
  {
43
    stdswap (_M_finish, __x._M_finish);
44
    return *this;
45
  }
46
  size_t size ()
47
  {
48
    return operatorMIN (_M_finish, _M_start);
49
  }
50
 
51
deque ():
52
  _M_map (), _M_map_size (), _M_start (), _M_finish ()
53
  {
54
    _M_start._M_last = _M_start._M_first + sizeof (int);
55
  }
56
 
57
  int **_M_map;
58
  size_t _M_map_size;
59
  _Deque_iterator _M_start;
60
  _Deque_iterator _M_finish;
61
};
62
 
63
struct queue
64
{
65
  deque c;
66
  size_t size ()
67
  {
68
    return c.size ();
69
  }
70
};
71
 
72
void
73
test01 ()
74
{
75
  queue a, b;
76
  ++a.c._M_finish._M_cur;
77
  b = move (a);
78
  if (!b.size ())
79
    __builtin_abort ();
80
}
81
 
82
main ()
83
{
84
  test01 ();
85
}
86
 

powered by: WebSVN 2.1.0

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