1 /* { dg-do compile } */
2 /* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
3 /* { dg-options "-ffat-lto-objects" } */
5 typedef unsigned char uint8_t;
6 typedef unsigned int uint32_t;
8 typedef uint32_t u32bit;
9 __extension__ typedef __SIZE_TYPE__ size_t;
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" } */
18 inline void clear_mem(void* ptr, u32bit n) {
21 template<typename T> class MemoryRegion {
25 const T* begin() const {
27 void set(const T in[], u32bit n) {
30 void set(const MemoryRegion<T>& in) {
31 set(in.begin(), in.size());
34 clear_mem(buf, allocated);
42 mutable u32bit allocated;
44 template<typename T> void MemoryRegion<T>::create(u32bit n) {
49 template<typename T> class SecureVector : public MemoryRegion<T> {
51 SecureVector<T>& operator=(const MemoryRegion<T>& in) {
52 if(this != &in) this->set(in);
57 SecureVector<byte> bits_of() const {
59 OctetString& operator^=(const OctetString&);
60 void change(const MemoryRegion<byte>& in) {
63 OctetString(const MemoryRegion<byte>& in) {
66 SecureVector<byte> bits;
68 OctetString& OctetString::operator^=(const OctetString& k) {
73 bool __attribute__((flatten))
74 operator==(const OctetString& s1, const OctetString& s2) {
75 return (s1.bits_of() == s2.bits_of());