From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- gcc/testsuite/g++.dg/torture/pr36745.C | 122 +++++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 gcc/testsuite/g++.dg/torture/pr36745.C (limited to 'gcc/testsuite/g++.dg/torture/pr36745.C') diff --git a/gcc/testsuite/g++.dg/torture/pr36745.C b/gcc/testsuite/g++.dg/torture/pr36745.C new file mode 100644 index 000000000..53845aaa7 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr36745.C @@ -0,0 +1,122 @@ +/* PR target/36745 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fPIC" } */ +/* { dg-require-effective-target fpic } */ + +typedef __SIZE_TYPE__ size_t; +class QBasicAtomicInt +{ +public: + int _q_value; + inline bool operator== (int value) const + { + } + bool ref (); + bool deref (); +}; +inline bool +QBasicAtomicInt::ref () +{ + __asm__ ("": "=m" (_q_value): :); + return true; +} + +namespace std +{ + using::size_t; +} +extern "C++" +{ + inline void *operator new (std::size_t, void *__p) + { + return __p; + } +} +struct QMapData +{ + QBasicAtomicInt ref; + static QMapData shared_null; +}; +template < class Key, class T > class QMap +{ + QMapData *d; +public: inline QMap ():d (&QMapData::shared_null) + { + } + inline ~ QMap () + { + if (!d->ref.deref ()) + freeData (d); + } + void freeData (QMapData * d); +}; +struct QVectorData +{ + QBasicAtomicInt ref; + static QVectorData shared_null; +}; +template < typename T > struct QVectorTypedData +{ + QBasicAtomicInt ref; +}; +template < typename T > class QVector +{ + union + { + QVectorData *p; + QVectorTypedData < T > *d; + }; +public: inline QVector ():p (&QVectorData::shared_null) + { + d->ref.ref (); + } + inline void detach () + { + if (d->ref == 1) + detach_helper (); + } + inline T *data () + { + detach (); + } + T & operator[](int i); + void detach_helper (); + void realloc (); +}; +template < typename T > void QVector < T >::detach_helper () +{ + realloc (); +} + +template < typename T > inline T & QVector < T >::operator[](int i) +{ + return data ()[i]; +} +template < typename T > void QVector < T >::realloc () +{ + T *j, *i; + i->~T (); + while (j-- == i) + new (j) T; +} + +void +mergeInto (QVector < int >*a) +{ +}; +struct QRegExpAutomatonState +{ + QVector < int >outs; + QMap < int, int >reenter; + QMap < int, int >anchors; +}; +class QRegExpEngine +{ + void addCatTransitions (); + QVector < QRegExpAutomatonState > s; +}; +void +QRegExpEngine::addCatTransitions () +{ + mergeInto (&s[2].outs); +} -- cgit v1.2.3