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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.dg/] [opt/] [noreturn-1.C] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 301 jeremybenn
// PR optimization/12965
2
// Origin: 
3
// Reduced testcase: Falk Hueffner 
4
 
5
// This ICEd on Alpha because the reload pass emitted save/restore
6
// insns around a no-return call.
7
 
8
// { dg-do compile }
9
// { dg-options "-O2" }
10
 
11
template  class allocator;
12
template  struct char_traits;
13
template 
14
          typename _Traits = char_traits<_CharT>,
15
          typename _Alloc = allocator<_CharT> >
16
class basic_string;
17
typedef basic_string string;
18
 
19
static inline int __exchange_and_add(volatile int * __mem, int __val) {
20
    int __result;
21
    asm("" : "=&r"(__result));
22
    return __result;
23
}
24
 
25
template struct allocator {
26
    allocator() throw() { }
27
    allocator(const allocator &) throw() {}
28
};
29
 
30
template
31
struct basic_string {
32
    typedef _Alloc allocator_type;
33
    struct _Rep {
34
        int _M_references;
35
        void _M_dispose(const _Alloc & __a) {
36
            if (__exchange_and_add(&_M_references, -1) <= 0)
37
                _M_destroy(__a);
38
        } void _M_destroy(const _Alloc &) throw();
39
    };
40
    struct _Alloc_hider : _Alloc {
41
        _CharT *_M_p;
42
    };
43
    mutable _Alloc_hider _M_dataplus;
44
    _CharT *_M_data() const { return _M_dataplus._M_p; }
45
    _Rep *_M_rep() const {
46
        return &((reinterpret_cast<_Rep *>(_M_data()))[-1]);
47
    }
48
    basic_string();
49
    basic_string(const _CharT * __s, const _Alloc & __a = _Alloc());
50
    ~basic_string() {
51
        _M_rep()->_M_dispose(this->get_allocator());
52
    }
53
    allocator_type get_allocator() const { return _M_dataplus; }
54
};
55
 
56
struct Egeneric {
57
    void stack(const string & passage, const string & message = "") { }
58
};
59
 
60
struct infinint {
61
    void detruit() throw(Egeneric);
62
    template void infinint_from(T a) throw(Egeneric);
63
    infinint(long a = 0) throw(Egeneric) {
64
        try {
65
            infinint_from(a);
66
        } catch(Egeneric& e) {
67
            e.stack("infinint::infinint", "long");
68
        }
69
    }
70
    ~infinint() throw(Egeneric) {
71
        try {
72
            detruit();
73
        } catch(Egeneric& e) { }
74
    }
75
};
76
 
77
struct inode {
78
    string x;
79
    infinint a, c;
80
    infinint ea_offset;
81
    inode();
82
};
83
 
84
inode::inode()
85
{
86
    ea_offset = 0;
87
}

powered by: WebSVN 2.1.0

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