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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
/* { dg-do assemble } */
2
 
3
/* Minimized from the testcase in PR c++/44473; mangling of decimal types
4
   did not include CV qualifiers. */
5
 
6
namespace std
7
{
8
  namespace decimal
9
  {
10
    class decimal32
11
    {
12
    public:
13
      typedef float __decfloat32 __attribute__ ((mode (SD)));
14
      explicit decimal32 (float __r):__val (__r) {}
15
    private:
16
      __decfloat32 __val;
17
    };
18
  };
19
 
20
  template 
21
  _BI2 copy_backward (_BI1 __first, _BI2 __result);
22
}
23
 
24
namespace __gnu_cxx
25
{
26
  template 
27
  class __normal_iterator
28
  {
29
  public:
30
    explicit __normal_iterator (const _Iterator & __i) {}
31
    const _Iterator & base () const {}
32
  };
33
 
34
  template 
35
  bool operator== (const __normal_iterator <_IteratorL, _Container> &__lhs,
36
                   const __normal_iterator <_IteratorR, _Container> &__rhs)
37
  {
38
    return __lhs.base () == __rhs.base ();
39
  }
40
 
41
  template 
42
  class new_allocator
43
  {
44
  public:
45
    typedef _Tp *pointer;
46
    typedef const _Tp *const_pointer;
47
    template 
48
    struct rebind
49
    {
50
      typedef new_allocator <_Tp1> other;
51
    };
52
  };
53
}
54
 
55
namespace std
56
{
57
  template 
58
  class allocator:public __gnu_cxx::new_allocator <_Tp> {};
59
 
60
  template 
61
  struct _Vector_base
62
  {
63
    typedef typename _Alloc::template rebind <_Tp>::other _Tp_alloc_type;
64
    struct _Vector_impl:public _Tp_alloc_type
65
    {
66
      typename _Tp_alloc_type::pointer _M_finish;
67
    };
68
  public:  _Vector_impl _M_impl;
69
  };
70
 
71
  template  >
72
  class vector:protected _Vector_base <_Tp, _Alloc>
73
  {
74
    typedef _Vector_base <_Tp, _Alloc> _Base;
75
    typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
76
  public:
77
    typedef _Tp value_type;
78
    typedef typename _Tp_alloc_type::pointer pointer;
79
    typedef typename _Tp_alloc_type::const_pointer const_pointer;
80
    typedef __gnu_cxx::__normal_iterator  iterator;
81
    typedef __gnu_cxx::__normal_iterator 
82
      const_iterator;
83
    const_iterator begin () const;
84
    iterator end ()
85
    {
86
      return iterator (this->_M_impl._M_finish);
87
    }
88
    const_iterator end () const
89
    {
90
      return const_iterator (this->_M_impl._M_finish);
91
    }
92
    bool empty () const
93
    {
94
      return begin () == end ();
95
    }
96
    void push_back (const value_type & __x)
97
    {
98
      _M_insert_aux (end ());
99
    }
100
    void _M_insert_aux (iterator __position);
101
  };
102
 
103
  template 
104
  void vector <_Tp, _Alloc>::_M_insert_aux (iterator __position)
105
  {
106
    std::copy_backward (__position.base (), this->_M_impl._M_finish - 1);
107
  }
108
}
109
 
110
std::vector  vec;
111
 
112
int
113
foo ()
114
{
115
  return (vec.empty ()) ? 1 : 0;
116
}
117
 
118
bool
119
bar ()
120
{
121
  vec.push_back (std::decimal::decimal32 (0));
122
}

powered by: WebSVN 2.1.0

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