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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-dev/] [fsf-gcc-snapshot-1-mar-12/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [torture/] [pr34850.C] - Blame information for rev 783

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
/* { dg-do compile } */
2
/* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
3
/* { dg-options "-ffat-lto-objects" } */
4
 
5
typedef unsigned char uint8_t;
6
typedef unsigned int uint32_t;
7
typedef uint8_t byte;
8
typedef uint32_t u32bit;
9
__extension__ typedef __SIZE_TYPE__ size_t;
10
extern "C" {
11
    extern void __warn_memset_zero_len (void) __attribute__((__warning__ ("")));
12
    extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__))
13
    void * memset (void *__dest, int __ch, size_t __len) throw () {
14
        if (__builtin_constant_p (__len) && __len == 0)
15
            __warn_memset_zero_len (); /* { dg-warning "declared with attribute warning" } */
16
    }
17
}
18
inline void clear_mem(void* ptr, u32bit n)    {
19
    memset(ptr, 0, n);
20
}
21
template class MemoryRegion    {
22
public:
23
    u32bit size() const {
24
    }
25
    const T* begin() const {
26
    }
27
    void set(const T in[], u32bit n) {
28
        create(n);
29
    }
30
    void set(const MemoryRegion& in) {
31
        set(in.begin(), in.size());
32
    }
33
    void clear() {
34
        clear_mem(buf, allocated);
35
    }
36
    void create(u32bit);
37
    MemoryRegion() {
38
        used = allocated = 0;
39
    }
40
    mutable T* buf;
41
    mutable u32bit used;
42
    mutable u32bit allocated;
43
};
44
template void MemoryRegion::create(u32bit n)    {
45
    if(n <= allocated) {
46
        clear();
47
    }
48
}
49
template class SecureVector : public MemoryRegion    {
50
public:
51
    SecureVector& operator=(const MemoryRegion& in)          {
52
        if(this != &in) this->set(in);
53
    }
54
};
55
class OctetString    {
56
public:
57
    SecureVector bits_of() const {
58
    }
59
    OctetString& operator^=(const OctetString&);
60
    void change(const MemoryRegion& in) {
61
        bits = in;
62
    }
63
    OctetString(const MemoryRegion& in) {
64
        change(in);
65
    }
66
    SecureVector bits;
67
};
68
OctetString& OctetString::operator^=(const OctetString& k)    {
69
    if(&k == this) {
70
        bits.clear();
71
    }
72
}
73
bool __attribute__((flatten))
74
operator==(const OctetString& s1, const OctetString& s2)    {
75
    return (s1.bits_of() == s2.bits_of());
76
}

powered by: WebSVN 2.1.0

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