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

Subversion Repositories openrisc

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /openrisc/tags/gnu-src/gcc-4.5.1/gcc-4.5.1-or32-1.0rc1/gcc/testsuite/g++.dg/torture
    from Rev 301 to Rev 338
    Reverse comparison

Rev 301 → Rev 338

/pr39764.C
0,0 → 1,14
/* { dg-do compile } */
 
class A;
class B { };
extern const double NaN;
B foo(A* exec, double d);
inline B baz(A* a) {
return foo(a, NaN);
}
B bar(A* a) {
return baz(a);
}
extern const double NaN = (__builtin_nanf(""));
 
pr39764.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr33887-3.C =================================================================== --- pr33887-3.C (nonexistent) +++ pr33887-3.C (revision 338) @@ -0,0 +1,26 @@ +/* { dg-do run } */ + +extern "C" void abort (void); + +struct s +{ + unsigned long long f1 : 40; + unsigned int f2 : 24; +}; + +s sv; + +void __attribute__((noinline)) foo(unsigned int i) +{ + unsigned int tmp; + sv.f2 = i; + tmp = sv.f2; + if (tmp != 0) + abort (); +} + +int main() +{ + foo (0xff000000u); + return 0; +}
pr33887-3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: 20090329-1.C =================================================================== --- 20090329-1.C (nonexistent) +++ 20090329-1.C (revision 338) @@ -0,0 +1,59 @@ +/* { dg-do compile } */ + +struct input_iterator_tag { }; +template +struct iterator { + typedef _Category iterator_category; +}; +template struct iterator_traits { + typedef typename _Iterator::iterator_category iterator_category; +}; +template struct __lc_rai { + template + static _II1 __newlast1(_II1, _II1 __last1, _II2, _II2) { + return __last1; + } + template + static bool __cnd2(_II __first, _II __last) { + return __first != __last; + } +}; +template +bool lexicographical_compare(_II1 __first1, _II1 __last1, _II2 __first2, + _II2 __last2, _Compare __comp) { + typedef typename iterator_traits<_II1>::iterator_category _Category1; + typedef typename iterator_traits<_II2>::iterator_category _Category2; + typedef __lc_rai<_Category1, _Category2> __rai_type; + __last1 = __rai_type::__newlast1(__first1, __last1, __first2, __last2); + for (; + __first1 != __last1 && __rai_type::__cnd2(__first2, __last2); + ++__first1, ++__first2) { + if (__comp(*__first1, *__first2)) return true; + } +} +void __assert_fail () throw () __attribute__ ((__noreturn__)); +template struct BoundsContainer { }; +template class input_iterator_wrapper : public iterator { +public: + typedef BoundsContainer ContainerType; + T* ptr; + ContainerType* SharedInfo; + input_iterator_wrapper(const input_iterator_wrapper& in) : ptr(in.ptr), SharedInfo(in.SharedInfo) { } + bool operator==(const input_iterator_wrapper& in) const { + (static_cast ((SharedInfo != __null + && SharedInfo == in.SharedInfo) + ? 0 : (__assert_fail (), 0))); + } + bool operator!=(const input_iterator_wrapper& in) const { + return !(*this == in); + } + T& operator*() const { } + input_iterator_wrapper& operator++() { } +}; +struct X { }; +bool predicate(const X&, const X&) { + return true; +} +bool test2(input_iterator_wrapper& x) { + return lexicographical_compare(x, x, x, x, predicate); +}
20090329-1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ipa-cp-1.C =================================================================== --- ipa-cp-1.C (nonexistent) +++ ipa-cp-1.C (revision 338) @@ -0,0 +1,18 @@ +/* { dg-do compile } */ + +// With IPA-CP, this caused a problem on darwin, where +// _M_reset is being cloned, it was still being marked +// as weak and then we had to change the calls to the +// newly marked function for the non throwing behavior. + +int& f(int&); +inline void _M_reset(int &_M_vbp) throw() +{ + f(_M_vbp); +} +extern int _S_last_request; +void _M_allocate_single_object() throw() +{ + _M_reset(_S_last_request); + _M_reset(_S_last_request); +}
ipa-cp-1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr40081.C =================================================================== --- pr40081.C (nonexistent) +++ pr40081.C (revision 338) @@ -0,0 +1,16 @@ +struct Atomic_t { + Atomic_t(int i) : val(i) { } + volatile int val; +}; +class RefCount { +public: + RefCount(Atomic_t c) : m_count(c) { } + Atomic_t m_count; +}; +class IntrusiveCountableBase { + RefCount m_useCount; +protected: + IntrusiveCountableBase(); +}; +IntrusiveCountableBase::IntrusiveCountableBase() : m_useCount(0) { } +
pr40081.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr40460.C =================================================================== --- pr40460.C (nonexistent) +++ pr40460.C (revision 338) @@ -0,0 +1,9 @@ +/* { dg-do compile } */ + +void bar(int); +void foo(void) +{ + for (int i = 0; i<1; ++i) + bar (i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i); +} +
pr40460.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr33134.C =================================================================== --- pr33134.C (nonexistent) +++ pr33134.C (revision 338) @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +/* Used to crash in VRP. */ +/* Testcase by Martin Michlmayr */ + +class FXObject; +class FXStream +{ + public:FXStream (const FXObject *cont = __null); + FXStream & operator<< (const unsigned char &v); +}; + +bool fxsaveGIF (FXStream &store) +{ + int bitsperpixel; + unsigned char c1; + c1 = 0x80; + c1 |= (bitsperpixel - 1) << 4; + store << c1; +}
pr33134.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr42704.C =================================================================== --- pr42704.C (nonexistent) +++ pr42704.C (revision 338) @@ -0,0 +1,44 @@ +/* { dg-do compile } */ + +typedef int PRInt32; +class nsTreeRows { + class Subtree { }; + enum { kMaxDepth = 32 }; + struct Link { + Subtree* mParent; + PRInt32 mChildIndex; + Link& operator=(const Link& aLink) { + mParent = aLink.mParent; + mChildIndex = aLink.mChildIndex; + } + }; + class iterator { + PRInt32 mTop; + PRInt32 mRowIndex; + Link mLink[kMaxDepth]; + public: + iterator() : mTop(-1), mRowIndex(-1) { } + iterator& operator=(const iterator& aIterator); + }; + Subtree* EnsureSubtreeFor(Subtree* aParent, PRInt32 aChildIndex); + Subtree* GetSubtreeFor(const Subtree* aParent, +PRInt32 aChildIndex, PRInt32* aSubtreeSize = 0); + void InvalidateCachedRow() { + mLastRow = iterator(); + } + iterator mLastRow; +}; +nsTreeRows::Subtree* nsTreeRows::EnsureSubtreeFor(Subtree* aParent, + PRInt32 aChildIndex) { + Subtree* subtree = GetSubtreeFor(aParent, aChildIndex); + if (! subtree) { + InvalidateCachedRow(); + } +} +nsTreeRows::iterator& nsTreeRows::iterator::operator=(const iterator& +aIterator) { + mTop = aIterator.mTop; + for (PRInt32 i = mTop; + i >= 0; + --i) mLink[i] = aIterator.mLink[i]; +}
pr42704.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr41257-2.C =================================================================== --- pr41257-2.C (nonexistent) +++ pr41257-2.C (revision 338) @@ -0,0 +1,16 @@ +/* { dg-do link } */ + +struct A +{ + virtual ~A(); +}; + +struct B : virtual A +{ + virtual ~B() {} +}; + +int main() +{ + return 0; +}
pr41257-2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr41257.C =================================================================== --- pr41257.C (nonexistent) +++ pr41257.C (revision 338) @@ -0,0 +1,20 @@ +/* { dg-do compile } */ + +struct A +{ + virtual void foo(); + virtual ~A(); + int i; +}; + +struct B : virtual A {}; + +struct C : B +{ + virtual void foo(); +}; + +void bar() +{ + C().foo(); +}
pr41257.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr40924.C =================================================================== --- pr40924.C (nonexistent) +++ pr40924.C (revision 338) @@ -0,0 +1,111 @@ +// PR rtl-optimization/40924 +// { dg-do run } + +extern "C" void abort (void); + +#define MAY_ALIAS __attribute__((__may_alias__)) + +typedef struct { float v[2]; } floata; +typedef struct { int v[2]; } inta; + +typedef unsigned int uint MAY_ALIAS; +typedef signed int sint MAY_ALIAS; +typedef float flt MAY_ALIAS; + +static inline unsigned short +less_than (inta a, inta b) +{ + unsigned short r = 0; + const uint *p1 = (const uint *) &a; + const uint *p2 = (const uint *) &b; + for (int i=0; i < 2; i++) + if (p1[i] < p2[i]) r |= (1 << i); + return r; +} + +static inline inta +multiply (inta b, inta c) +{ + inta r; + sint *p3 = (sint *) &c; + for (int i=0; i < 2; i++) + r.v[i] = (int) (b.v[i] * p3[i] & 0xFFFFFFFF); + return r; +} + +static inline floata +gather (inta indexes, const void *baseAddr) +{ + floata r; + + sint *idx = (sint *) &indexes; + flt *src = (flt *) baseAddr; + for (int i=0; i < 2; i++) + r.v[i] = *(src + idx[i]); + return r; +} + +static inline inta +add (const inta &b, const inta &c) +{ + inta result; + sint *r = (sint *) &result; + + for (int i=0; i < 2; i++) + r[i] = b.v[i] + c.v[i]; + return result; +} + +struct uintv +{ + inta data; + inline uintv () { data.v[0] = 0; data.v[1] = 1; } + inline uintv (unsigned int a) + { + for (int i=0; i < 2; i++) + *(uint *) &data.v[i] = a; + } + inline uintv (inta x) : data (x) {} + inline uintv operator* (const uintv &x) const + { return multiply (data, x.data); } + inline uintv operator+ (const uintv &x) const + { return uintv (add (data, x.data)); } + inline unsigned short operator< (const uintv &x) const + { return less_than (data, x.data); } +}; + +struct floatv +{ + floata data; + explicit inline floatv (const uintv &x) + { + uint *p2 = (uint *) &x.data; + for (int i=0; i < 2; i++) + data.v[i] = p2[i]; + } + inline floatv (const float *array, const uintv &indexes) + { + const uintv &offsets = indexes * uintv (1); + data = gather (offsets.data, array); + } + unsigned short operator== (const floatv &x) const + { + unsigned short r = 0; + for (int i=0; i < 2; i++) + if (data.v[i] == x.data.v[i]) r |= (1 << i); + return r; + } +}; + +int +main () +{ + const float array[2] = { 2, 3 }; + for (uintv i; (i < 2) == 3; i = i + 2) + { + const floatv ii (i + 2); + floatv a (array, i); + if ((a == ii) != 3) + abort (); + } +}
pr40924.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr33572.C =================================================================== --- pr33572.C (nonexistent) +++ pr33572.C (revision 338) @@ -0,0 +1,17 @@ +// { dg-do run } +#include +#include + +struct Foo { virtual void f() {} }; + +int main(int argc, char**) +{ + std::auto_ptr foo; + if (argc >= 0) { + foo.reset(new Foo()); + } else { + std::vector v; + } + Foo* p = foo.release(); + p->f(); +}
pr33572.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr27218.C =================================================================== --- pr27218.C (nonexistent) +++ pr27218.C (revision 338) @@ -0,0 +1,16 @@ +/* { dg-do compile } */ + +struct Vector +{ + double _x, _y; +}; +typedef Vector Point; +Vector d; +static inline Vector f(void) +{ + return d; +} +void add_duck (void) +{ + new Point (f()); +}
pr27218.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: str_empty.C =================================================================== --- str_empty.C (nonexistent) +++ str_empty.C (revision 338) @@ -0,0 +1,15 @@ +// PR c++/31617 +// Segfault in integer_zerop +// Origin: Andrew Pinski +// { dg-do compile } + +struct polynomial { + ~polynomial (); +}; + +void spline_rep1 () +{ + new polynomial[0]; // { dg-bogus "allocating zero-element array" } +} + +
str_empty.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr30567.C =================================================================== --- pr30567.C (nonexistent) +++ pr30567.C (revision 338) @@ -0,0 +1,32 @@ +/* { dg-do run } */ + +template +struct const_ref +{ + const T* begin; + const_ref(const T* b) : begin(b) {} +}; + +template +T sum(const_ref const& a) +{ + T result = 0; + for(unsigned i=0;i<1;i++) result += a.begin[i]; + return result; +} + +struct tiny_plain +{ + int elems[2]; + tiny_plain() { elems[0]=1; } +}; + +struct vec3 : tiny_plain {}; + +struct mat3 +{ + int type() const { return sum(const_ref(vec3().elems)) == 1; } +}; + +int main() { return mat3().type() ? 0 : 1; } +
pr30567.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr36445.C =================================================================== --- pr36445.C (nonexistent) +++ pr36445.C (revision 338) @@ -0,0 +1,22 @@ +/* { dg-do compile } */ +// This used to fail as we would try to expand a VCE where one side had +// a mode of BLKmode and the other side was a vector mode. +#define vector __attribute__((vector_size(16) )) +struct struct1 { + union { float a[3]; } vmx; + struct struct2 { + struct2(const struct2& r) {} + } w; +} __attribute__((aligned(16))); +struct struct3 { + vector float vmx; + operator const struct1& () const{ + return *reinterpret_cast(this); + } +}; +struct3 func3( struct3 V1); +struct3 func2( void ); +void func1( ) { + struct1 vVec = func2() ; + func3 ( (struct3&)vVec ); +}
pr36445.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr33819.C =================================================================== --- pr33819.C (nonexistent) +++ pr33819.C (revision 338) @@ -0,0 +1,22 @@ +/* { dg-do run } */ + +class s +{ +public: + s(long long aa) : a(aa), i1(0) { } + long long id() const { return (this->a << 16) >> 16; } + bool operator< (s sv) { return this->a < sv.id(); } +private: + long long a : 48; + int i1 : 16; +}; +s g(1); +extern "C" void abort (void); +int +main(int, char**) +{ + if (g < (1LL << 38) - 1) + return 0; + abort (); +} +
pr33819.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr40389.C =================================================================== --- pr40389.C (nonexistent) +++ pr40389.C (revision 338) @@ -0,0 +1,84 @@ +/* { dg-do run } */ + +template struct S +{ + V *f, *l; + __attribute__ ((noinline)) S (void) { f = 0, l = 0; } + void foo (V *x) + { + if (x->p != 0) + x->p->n = x->n; + else + f = x->n; + if (x->n != 0) + x->n->p = x->p; + else + l = x->p; + } + __attribute__ ((noinline)) void bar (V *x) + { + x->n = 0; + x->p = l; + if (l != 0) + l->n = x; + else + f = x; + l = x; + } +}; + +struct H; + +struct A +{ + S k; +}; + +struct H +{ + A *a; + H *p, *n; + __attribute__ ((noinline)) H (void) { p = 0, n = 0, a = 0; } + __attribute__ ((noinline)) H (A *b) : a (b) + { + p = 0; + n = 0; + if (a != 0) + a->k.bar (this); + } + __attribute__ ((noinline)) H (const H &h) : a (h.a) + { + p = 0; + n = 0; + if (a != 0) + a->k.bar (this); + } + ~H (void) { if (a != 0) a->k.foo (this); } + H &operator= (const H &o) + { + if (a != 0 || &o == this) + __builtin_abort (); + a = o.a; + if (a != 0) + a->k.bar (this); + return *this; + } +}; + +__attribute__ ((noinline)) +H baz (void) +{ + return H (new A); +} + +H g; + +int +main (void) +{ + g = baz (); + if (g.a->k.f != &g) + __builtin_abort (); + return 0; +} +
pr40389.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr36826.C =================================================================== --- pr36826.C (nonexistent) +++ pr36826.C (revision 338) @@ -0,0 +1,166 @@ +template T CoinMax(register const T x1, register const T x2); +template T CoinMin(register const T x1, register const T x2); +class CoinIndexedVector; +class ClpModel { +protected: + double objectiveScale_; + double rhsScale_; + int numberRows_; + int numberColumns_; + double * rowActivity_; + double * columnActivity_; + double * dual_; + double * reducedCost_; + double* rowLower_; + double* rowUpper_; + double * rowObjective_; + double * columnLower_; + double * columnUpper_; + double * rowScale_; + double * columnScale_; + double * inverseRowScale_; + double * inverseColumnScale_; + int problemStatus_; + int secondaryStatus_; +}; +class ClpSimplex : public ClpModel { + void deleteRim(int getRidOfFactorizationData=2); + double upperOut_; + double dualTolerance_; + double primalTolerance_; + double * rowLowerWork_; + double * columnLowerWork_; + double * rowUpperWork_; + double * columnUpperWork_; + double * rowObjectiveWork_; + CoinIndexedVector * columnArray_[6]; + double * reducedCostWork_; + double * rowActivityWork_; + double * columnActivityWork_; + ClpSimplex * auxiliaryModel_; +}; +class CoinIndexedVector { +public: + void clear(); +}; +void ClpSimplex::deleteRim(int getRidOfFactorizationData) +{ + int numberRows=numberRows_; + int numberColumns=numberColumns_; + int i; + int numberPrimalScaled=0; + int numberPrimalUnscaled=0; + int numberDualScaled=0; + int numberDualUnscaled=0; + double scaleC = 1.0/objectiveScale_; + double scaleR = 1.0/rhsScale_; + if (!inverseColumnScale_) { + for (i=0; i-1.0e20||upperScaled<1.0e20) { + if (valueScaledupperScaled+primalTolerance_) + numberPrimalScaled++; + else + upperOut_ = CoinMax(upperOut_,CoinMin(valueScaled-lowerScaled,upperScaled-valueScaled)); + } + columnActivity_[i] = valueScaled*scaleFactor*scaleR; + double value = columnActivity_[i]; + if (valuecolumnUpper_[i]+primalTolerance_) + numberPrimalUnscaled++; + double valueScaledDual = reducedCostWork_[i]; + if (valueScaled>columnLowerWork_[i]+primalTolerance_&&valueScaledDual>dualTolerance_) + numberDualScaled++; + if (valueScaledcolumnLower_[i]+primalTolerance_&&valueDual>dualTolerance_) + numberDualUnscaled++; + if (value-1.0e20||upperScaled<1.0e20) { if (valueScaledupperScaled+primalTolerance_) numberPrimalScaled++; else upperOut_ = CoinMax(upperOut_,CoinMin(valueScaled-lowerScaled,upperScaled-valueScaled)); } + rowActivity_[i] = (valueScaled*scaleR)/scaleFactor; + double value = rowActivity_[i]; + if (valuerowUpper_[i]+primalTolerance_) numberPrimalUnscaled++; + double valueScaledDual = dual_[i]+rowObjectiveWork_[i]; + ; + if (valueScaled>rowLowerWork_[i]+primalTolerance_&&valueScaledDual>dualTolerance_) numberDualScaled++; + if (valueScaledrowLower_[i]+primalTolerance_&&valueDual>dualTolerance_) numberDualUnscaled++; + if (value-1.0e20||upperScaled<1.0e20) { if (valueScaledupperScaled+primalTolerance_) numberPrimalScaled++; else upperOut_ = CoinMax(upperOut_,CoinMin(valueScaled-lowerScaled,upperScaled-valueScaled)); } + columnActivity_[i] = valueScaled*scaleFactor*scaleR; + double value = columnActivity_[i]; + if (valuecolumnUpper_[i]+primalTolerance_) numberPrimalUnscaled++; + double valueScaledDual = reducedCostWork_[i]; + if (valueScaled>columnLowerWork_[i]+primalTolerance_&&valueScaledDual>dualTolerance_) numberDualScaled++; + if (valueScaledcolumnLower_[i]+primalTolerance_&&valueDual>dualTolerance_) numberDualUnscaled++; + if (value-1.0e20||upperScaled<1.0e20) { if (valueScaledupperScaled+primalTolerance_) numberPrimalScaled++; else upperOut_ = CoinMax(upperOut_,CoinMin(valueScaled-lowerScaled,upperScaled-valueScaled)); } + rowActivity_[i] = (valueScaled*scaleR)*inverseScale[i]; + double value = rowActivity_[i]; + if (valuerowUpper_[i]+primalTolerance_) numberPrimalUnscaled++; + double valueScaledDual = dual_[i]+rowObjectiveWork_[i]; + ; + if (valueScaled>rowLowerWork_[i]+primalTolerance_&&valueScaledDual>dualTolerance_) numberDualScaled++; + if (valueScaledrowLower_[i]+primalTolerance_&&valueDual>dualTolerance_) numberDualUnscaled++; + if (valueclear(); +}
pr36826.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr36745.C =================================================================== --- pr36745.C (nonexistent) +++ pr36745.C (revision 338) @@ -0,0 +1,121 @@ +/* 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 +{ + 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); +}
pr36745.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr31579.C =================================================================== --- pr31579.C (nonexistent) +++ pr31579.C (revision 338) @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +// middle-end/31579 +// Expand was crashing while expanding the tree for the initializer + +struct Industry { + unsigned char produced_cargo[2]; +}; +unsigned int a = (((__SIZE_TYPE__)&reinterpret_cast((((Industry*)(char*)8)->produced_cargo[0]))) - 8); +
pr31579.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr38565.C =================================================================== --- pr38565.C (nonexistent) +++ pr38565.C (revision 338) @@ -0,0 +1,11 @@ +// { dg-do compile } +// Ignore warning on some powerpc-linux configurations. +// { dg-prune-output "non-standard ABI extension" } +#define vector __attribute__((vector_size(16) )) +vector unsigned int f(int a) +{ + vector unsigned int mask = a ? (vector unsigned int){ 0x80000000, 0x80000000, +0x80000000, 0x80000000 } : (vector unsigned int){0}; + return mask; +} +
pr38565.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: stackalign/throw-1.C =================================================================== --- stackalign/throw-1.C (nonexistent) +++ stackalign/throw-1.C (revision 338) @@ -0,0 +1,61 @@ +/* { dg-do run } */ + +#include "check.h" + +#ifndef ALIGNMENT +#define ALIGNMENT 64 +#endif + +typedef int t_align __attribute__((aligned(ALIGNMENT))); + + +int global, global2; +void bar() +{ + volatile t_align a = 1; + int i,j,k,l,m,n; + i=j=k=0; + for (i=0; i < global; i++) + for (j=0; j < i; j++) + for (k=0; k < j; k++) + for (l=0; l < k; l++) + for (m=0; m < l; m++) + for (n=0; n < m; n++) + global2 = k; + if (check_int ((int *) &a, __alignof__(a)) != a) + abort (); + throw 0; +} + +void foo() +{ + bar(); +} + +int main() +{ + int ll = 1; + int i = 0,j = 1,k = 2,l = 3,m = 4,n = 5; + try { + for (; i < global; i++) + for (; j < i; j++) + for (; k < j; k++) + for (; l < k; l++) + for (; m < l; m++) + for (; n < m; n++) + global2 = k; + foo(); + } + catch (...) + { + } + ll = i+j+k+l+m+n; + if (ll != 15) + { +#ifdef DEBUG + printf("FAIL: sum %d != 15\n", ll); +#endif + abort(); + } + return 0; +}
stackalign/throw-1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: stackalign/unwind-0.C =================================================================== --- stackalign/unwind-0.C (nonexistent) +++ stackalign/unwind-0.C (revision 338) @@ -0,0 +1,12 @@ +/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */ + +#include "test-unwind.h" + +#if !defined __PIC__ && !defined __USING_SJLJ_EXCEPTIONS__ +void __attribute__ ((noinline)) foo() +{ + ALTER_REGS(); + // Throw the except and expect returning to main + throw 1; +} +#endif
stackalign/unwind-0.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: stackalign/unwind-1.C =================================================================== --- stackalign/unwind-1.C (nonexistent) +++ stackalign/unwind-1.C (revision 338) @@ -0,0 +1,16 @@ +/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */ + +#include "test-unwind.h" + +#if !defined __PIC__ && !defined __USING_SJLJ_EXCEPTIONS__ +/* Test situation 1: Stack really realign without DRAP */ +void __attribute__ ((noinline)) +foo () +{ + int __attribute__ ((aligned(64))) a=1; + if (check_int (&a, __alignof__(a)) != a) + abort (); + ALTER_REGS(); + throw a; +} +#endif
stackalign/unwind-1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: stackalign/throw-2.C =================================================================== --- stackalign/throw-2.C (nonexistent) +++ stackalign/throw-2.C (revision 338) @@ -0,0 +1,52 @@ +/* { dg-do run } */ + +#include "check.h" + +#ifndef ALIGNMENT +#define ALIGNMENT 64 +#endif + +typedef int t_align __attribute__((aligned(ALIGNMENT))); + + +int global, global2; +void bar() +{ + volatile t_align a = 1; + int i,j,k; + i=j=k=0; + for (i=0; i < global; i++) + for (j=0; j < i; j++) + global2 = k; + if (check_int ((int *) &a, __alignof__(a)) != a) + abort (); + throw 0; +} + +int main() +{ + int ll = 1; + int i = 0,j = 1,k = 2,l = 3,m = 4,n = 5; + try { + for (; i < global; i++) + for (; j < i; j++) + for (; k < j; k++) + for (; l < k; l++) + for (; m < l; m++) + for (; n < m; n++) + global2 = k; + bar (); + } + catch (...) + { + } + ll = i+j+k+l+m+n; + if (ll != 15) + { +#ifdef DEBUG + printf("FAIL: sum %d != 15\n", ll); +#endif + abort(); + } + return 0; +}
stackalign/throw-2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: stackalign/unwind-2.C =================================================================== --- stackalign/unwind-2.C (nonexistent) +++ stackalign/unwind-2.C (revision 338) @@ -0,0 +1,29 @@ +/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */ + +#include "test-unwind.h" + +#if !defined __PIC__ && !defined __USING_SJLJ_EXCEPTIONS__ +/* Test situation 2: stack really realign with DRAP reg CX */ +void __attribute__ ((noinline)) +foo () +{ + int __attribute__ ((aligned(64))) a=4; + char * s = (char *) __builtin_alloca (a + 1); + + copy (s, a); + if (__builtin_strncmp (s, "good", a) != 0) + { +#ifdef DEBUG + s[a] = '\0'; + printf ("Failed: %s != good\n", s); +#endif + abort (); + } + + if (check_int (&a, __alignof__(a)) != a) + abort (); + + ALTER_REGS(); + throw a; +} +#endif
stackalign/unwind-2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: stackalign/throw-3.C =================================================================== --- stackalign/throw-3.C (nonexistent) +++ stackalign/throw-3.C (revision 338) @@ -0,0 +1,52 @@ +/* { dg-do run } */ + +#include "check.h" + +#ifndef ALIGNMENT +#define ALIGNMENT 64 +#endif + +typedef int t_align __attribute__((aligned(ALIGNMENT))); + + +int global, global2; +void bar() +{ + volatile t_align a = 1; + int i,j,k; + i=j=k=0; + for (i=0; i < global; i++) + for (j=0; j < i; j++) + global2 = k; + throw 0; + if (check_int ((int *) &a, __alignof__(a)) != a) + abort (); +} + +int main() +{ + int ll = 1; + int i = 0,j = 1,k = 2,l = 3,m = 4,n = 5; + try { + for (; i < global; i++) + for (; j < i; j++) + for (; k < j; k++) + for (; l < k; l++) + for (; m < l; m++) + for (; n < m; n++) + global2 = k; + bar (); + } + catch (...) + { + } + ll = i+j+k+l+m+n; + if (ll != 15) + { +#ifdef DEBUG + printf("FAIL: sum %d != 15\n", ll); +#endif + abort(); + } + return 0; +}
stackalign/throw-3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: stackalign/unwind-3.C =================================================================== --- stackalign/unwind-3.C (nonexistent) +++ stackalign/unwind-3.C (revision 338) @@ -0,0 +1,35 @@ +/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */ + +#include "test-unwind.h" + +#if !defined __PIC__ && !defined __USING_SJLJ_EXCEPTIONS__ +/* Test situation 3: Stack realign really happen with DRAP reg DI */ +void __attribute__ ((noinline)) __attribute__ ((regparm(3))) +bar (int arg1, int arg2, int arg3) +{ + int __attribute__ ((aligned(64))) a=1; + char * s = (char *) __builtin_alloca (arg3 + 1); + + copy (s, arg3); + if (__builtin_strncmp (s, "good", arg3) != 0) + { +#ifdef DEBUG + s[arg3] = '\0'; + printf ("Failed: %s != good\n", s); +#endif + abort (); + } + + if (check_int (&a, __alignof__(a)) != a) + abort (); + + ALTER_REGS(); + throw arg1+arg2+arg3+a; +} + +void +foo() +{ + bar (1,2,3); +} +#endif
stackalign/unwind-3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: stackalign/throw-4.C =================================================================== --- stackalign/throw-4.C (nonexistent) +++ stackalign/throw-4.C (revision 338) @@ -0,0 +1,54 @@ +/* { dg-do run } */ + +#include "check.h" + +#ifndef ALIGNMENT +#define ALIGNMENT 64 +#endif + +typedef int t_align __attribute__((aligned(ALIGNMENT))); + + +int global, global2; +void bar() +{ + volatile t_align a = 1; + int i,j,k; + i=j=k=0; + for (i=0; i < global; i++) + for (j=0; j < i; j++) + { + global2 = k; + throw 0; + } + if (check_int ((int *) &a, __alignof__(a)) != a) + abort (); +} + +int main() +{ + int ll = 1; + int i = 0,j = 1,k = 2,l = 3,m = 4,n = 5; + try { + for (; i < global; i++) + for (; j < i; j++) + for (; k < j; k++) + for (; l < k; l++) + for (; m < l; m++) + for (; n < m; n++) + global2 = k; + bar (); + } + catch (...) + { + } + ll = i+j+k+l+m+n; + if (ll != 15) + { +#ifdef DEBUG + printf("FAIL: sum %d != 15\n", ll); +#endif + abort(); + } + return 0; +}
stackalign/throw-4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: stackalign/unwind-4.C =================================================================== --- stackalign/unwind-4.C (nonexistent) +++ stackalign/unwind-4.C (revision 338) @@ -0,0 +1,17 @@ +/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */ + +#include "test-unwind.h" + +#if !defined __PIC__ && !defined __USING_SJLJ_EXCEPTIONS__ +volatile int __attribute__ ((aligned(32))) g_a=1; +/* Test situation 4: no Drap and stack realign doesn't really happen */ +void __attribute__ ((noinline)) +foo() +{ + int i; + ALTER_REGS(); + for (i=0; i < 10; i++) + g_a++; + throw g_a; +} +#endif
stackalign/unwind-4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: stackalign/unwind-5.C =================================================================== --- stackalign/unwind-5.C (nonexistent) +++ stackalign/unwind-5.C (revision 338) @@ -0,0 +1,31 @@ +/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */ + +#include "test-unwind.h" + +#if !defined __PIC__ && !defined __USING_SJLJ_EXCEPTIONS__ +double g_f=1.0; +/* Test situation 5: Stack realign dosn't really happen with DRAP reg CX */ +void __attribute__ ((noinline)) __attribute__ ((regparm(2))) +bar(int arg1, int arg2, int arg3, int arg4) +{ + char * s = (char *) __builtin_alloca (arg4 + 1); + + copy (s, arg4); + if (__builtin_strncmp (s, "good", arg4) != 0) + { +#ifdef DEBUG + s[arg4] = '\0'; + printf ("Failed: %s != good\n", s); +#endif + abort (); + } + ALTER_REGS(); + if (g_f) throw arg1+arg2+arg3+ g_f; +} + +void __attribute__((noinline)) +foo() +{ + bar(1,2,3,4); +} +#endif
stackalign/unwind-5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: stackalign/eh-inline-1.C =================================================================== --- stackalign/eh-inline-1.C (nonexistent) +++ stackalign/eh-inline-1.C (revision 338) @@ -0,0 +1,39 @@ +/* { dg-do run } */ + +#include "check.h" + +#ifndef ALIGNMENT +#define ALIGNMENT 64 +#endif + +typedef int aligned __attribute__((aligned(ALIGNMENT))); + +int global; + +class Base {}; + +struct A : virtual public Base +{ + A() {} +}; + +struct B {}; + +static void +inline __attribute__((always_inline)) +foo (void) throw (B,A) +{ + aligned i; + + if (check_int (&i, __alignof__(i)) != i) + abort (); + throw A(); +} + +int +main() +{ + try { foo (); } + catch (A& a) { } + return 0; +}
stackalign/eh-inline-1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: stackalign/unwind-6.C =================================================================== --- stackalign/unwind-6.C (nonexistent) +++ stackalign/unwind-6.C (revision 338) @@ -0,0 +1,31 @@ +/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */ + +#include "test-unwind.h" + +#if !defined __PIC__ && !defined __USING_SJLJ_EXCEPTIONS__ +double g_f=1.0; +/* Test situation 6: Stack realign dosn't really happen with DRAP reg DI */ +void __attribute__ ((noinline)) __attribute__ ((regparm(3))) +bar(int arg1, int arg2, int arg3, int arg4) +{ + char * s = (char *) __builtin_alloca (arg4 + 1); + + copy (s, arg4); + if (__builtin_strncmp (s, "good", arg4) != 0) + { +#ifdef DEBUG + s[arg4] = '\0'; + printf ("Failed: %s != good\n", s); +#endif + abort (); + } + ALTER_REGS(); + if (g_f) throw arg1+arg2+arg3+ g_f; +} + +void __attribute__((noinline)) +foo() +{ + bar(1,2,3,4); +} +#endif
stackalign/unwind-6.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: stackalign/eh-inline-2.C =================================================================== --- stackalign/eh-inline-2.C (nonexistent) +++ stackalign/eh-inline-2.C (revision 338) @@ -0,0 +1,57 @@ +/* { dg-do run } */ + +#include "check.h" + +#ifndef ALIGNMENT +#define ALIGNMENT 64 +#endif + +typedef int aligned __attribute__((aligned(ALIGNMENT))); + +int global; + +void +bar (char *p, int size) +{ + __builtin_strncpy (p, "good", size); +} + +class Base {}; + +struct A : virtual public Base +{ + A() {} +}; + +struct B {}; + +static void +inline __attribute__((always_inline)) +foo (int size) throw (B,A) +{ + char *p = (char *) __builtin_alloca (size + 1); + aligned i; + + bar (p, size); + if (__builtin_strncmp (p, "good", size) != 0) + { +#ifdef DEBUG + p[size] = '\0'; + printf ("Failed: %s != good\n", p); +#endif + abort (); + } + + if (check_int (&i, __alignof__(i)) != i) + abort (); + + throw A(); +} + +int +main() +{ + try { foo (5); } + catch (A& a) { } + return 0; +}
stackalign/eh-inline-2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: stackalign/eh-vararg-1.C =================================================================== --- stackalign/eh-vararg-1.C (nonexistent) +++ stackalign/eh-vararg-1.C (revision 338) @@ -0,0 +1,72 @@ +/* { dg-do run } */ + +#include +#include "check.h" + +#ifndef ALIGNMENT +#define ALIGNMENT 64 +#endif + +typedef int aligned __attribute__((aligned(ALIGNMENT))); + +int global; + +void +bar (char *p, int size) +{ + __builtin_strncpy (p, "good", size); +} + +class Base {}; + +struct A : virtual public Base +{ + A() {} +}; + +struct B {}; + +void +foo (const char *fmt, ...) throw (B,A) +{ + va_list arg; + char *p; + aligned i; + int size; + double x; + + va_start (arg, fmt); + size = va_arg (arg, int); + if (size != 5) + abort (); + p = (char *) __builtin_alloca (size + 1); + + x = va_arg (arg, double); + if (x != 5.0) + abort (); + + bar (p, size); + if (__builtin_strncmp (p, "good", size) != 0) + { +#ifdef DEBUG + p[size] = '\0'; + printf ("Failed: %s != good\n", p); +#endif + abort (); + } + + if (check_int (&i, __alignof__(i)) != i) + abort (); + + throw A(); + + va_end (arg); +} + +int +main() +{ + try { foo ("foo", 5, 5.0); } + catch (A& a) { } + return 0; +}
stackalign/eh-vararg-1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: stackalign/eh-vararg-2.C =================================================================== --- stackalign/eh-vararg-2.C (nonexistent) +++ stackalign/eh-vararg-2.C (revision 338) @@ -0,0 +1,77 @@ +/* { dg-do run } */ + +#include +#include "check.h" + +#ifndef ALIGNMENT +#define ALIGNMENT 64 +#endif + +typedef int aligned __attribute__((aligned(ALIGNMENT))); + +int global; + +void +bar (char *p, int size) +{ + __builtin_strncpy (p, "good", size); +} + +class Base {}; + +struct A : virtual public Base +{ + A() {} +}; + +struct B {}; + +void +test (va_list arg) throw (B,A) +{ + char *p; + aligned i; + int size; + double x; + + size = va_arg (arg, int); + if (size != 5) + abort (); + + p = (char *) __builtin_alloca (size + 1); + + x = va_arg (arg, double); + if (x != 5.0) + abort (); + + bar (p, size); + if (__builtin_strncmp (p, "good", size) != 0) + { +#ifdef DEBUG + p[size] = '\0'; + printf ("Failed: %s != good\n", p); +#endif + abort (); + } + + if (check_int (&i, __alignof__(i)) != i) + abort (); + + throw A(); +} + +void +foo (const char *fmt, ...) +{ + va_list arg; + va_start (arg, fmt); + test (arg); + va_end (arg); +} +int +main() +{ + try { foo ("foo", 5, 5.0); } + catch (A& a) { } + return 0; +}
stackalign/eh-vararg-2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: stackalign/eh-fastcall-1.C =================================================================== --- stackalign/eh-fastcall-1.C (nonexistent) +++ stackalign/eh-fastcall-1.C (revision 338) @@ -0,0 +1,43 @@ +/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */ + +#include "check.h" + +#ifndef ALIGNMENT +#define ALIGNMENT 64 +#endif + +typedef int aligned __attribute__((aligned(ALIGNMENT))); + +int global; + +class Base {}; + +struct A : virtual public Base +{ + A() {} +}; + +struct B {}; + +__attribute__ ((fastcall)) +void +foo (int j, int k, int m, int n, int o) throw (B,A) +{ + aligned i; + + if (check_int (&i, __alignof__(i)) != i) + abort (); + + if (i != 20 || j != 1 || k != 2 || m != 3 || n != 4 || o != 5) + abort (); + + throw A(); +} + +int +main() +{ + try { foo (1, 2, 3, 4, 5); } + catch (A& a) { } + return 0; +}
stackalign/eh-fastcall-1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: stackalign/check.h =================================================================== --- stackalign/check.h (nonexistent) +++ stackalign/check.h (revision 338) @@ -0,0 +1,36 @@ +#include +#ifdef DEBUG +#include +#endif + +#ifdef __cplusplus +extern "C" void abort (void); +#else +extern void abort (void); +#endif + +int +check_int (int *i, int align) +{ + *i = 20; + if ((((ptrdiff_t) i) & (align - 1)) != 0) + { +#ifdef DEBUG + printf ("\nUnalign address (%d): %p!\n", align, i); +#endif + abort (); + } + return *i; +} + +void +check (void *p, int align) +{ + if ((((ptrdiff_t) p) & (align - 1)) != 0) + { +#ifdef DEBUG + printf ("\nUnalign address (%d): %p!\n", align, p); +#endif + abort (); + } +}
stackalign/check.h Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: stackalign/eh-alloca-1.C =================================================================== --- stackalign/eh-alloca-1.C (nonexistent) +++ stackalign/eh-alloca-1.C (revision 338) @@ -0,0 +1,56 @@ +/* { dg-do run } */ + +#include "check.h" + +#ifndef ALIGNMENT +#define ALIGNMENT 64 +#endif + +typedef int aligned __attribute__((aligned(ALIGNMENT))); + +int global; + +void +bar (char *p, int size) +{ + __builtin_strncpy (p, "good", size); +} + +class Base {}; + +struct A : virtual public Base +{ + A() {} +}; + +struct B {}; + +void +foo (int size) throw (B,A) +{ + char *p = (char*) __builtin_alloca (size + 1); + aligned i; + + bar (p, size); + if (__builtin_strncmp (p, "good", size) != 0) + { +#ifdef DEBUG + p[size] = '\0'; + printf ("Failed: %s != good\n", p); +#endif + abort (); + } + + if (check_int (&i, __alignof__(i)) != i) + abort (); + + throw A(); +} + +int +main() +{ + try { foo (5); } + catch (A& a) { } + return 0; +}
stackalign/eh-alloca-1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: stackalign/stdcall-1.C =================================================================== --- stackalign/stdcall-1.C (nonexistent) +++ stackalign/stdcall-1.C (revision 338) @@ -0,0 +1,17 @@ +// { dg-do compile { target { { i?86-*-* x86_64-*-* } && ilp32 } } } + +// This case is to detect an assertion failure in stack branch development. + +bool f(); +struct S { + __attribute__ ((stdcall)) ~S(); +}; +void g() { + for (;;) { + S s1, s2, s3; + if (f()) + continue; + if (f()) + return; + } +}
stackalign/stdcall-1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: stackalign/test-unwind.h =================================================================== --- stackalign/test-unwind.h (nonexistent) +++ stackalign/test-unwind.h (revision 338) @@ -0,0 +1,137 @@ +#include "check.h" + + +#define ASMNAME(cname) ASMNAME2 (__USER_LABEL_PREFIX__, cname) +#define ASMNAME2(prefix, cname) STRING (prefix) cname +#define STRING(x) #x + +#ifdef __cplusplus +extern "C" void abort (void); +#else +extern void abort (void); +#endif + +extern void foo(void); + +#define INIT_EDI 1 +#define INIT_ESI 2 +#define INIT_EBX 3 + +/* Set DI/SI/BX to wrong value + Use following template so that RA will save/restore callee + save registers in prologue/epilogue */ +#define ALTER_REGS() \ + { \ + int dummy; \ + __asm__ __volatile__ (\ + "movl %1, %0" : "=D" (dummy) : "i" (-INIT_EDI)\ + );\ + __asm__ __volatile__ (\ + "movl %1, %0" : "=S" (dummy) : "i" (-INIT_ESI)\ + );\ + __asm__ __volatile__ (\ + "movl %1, %0" : "=b" (dummy) : "i" (-INIT_EBX)\ + );\ + } + +#if defined __PIC__ || defined __USING_SJLJ_EXCEPTIONS__ +int +main () +{ + return 0; +} +#else +void __attribute__ ((noinline)) +copy (char *p, int size) +{ + __builtin_strncpy (p, "good", size); +} + +int g_edi=INIT_EDI, g_esi=INIT_ESI, g_ebx=INIT_EBX; +int g_ebp, g_ebp_save, g_esp, g_esp_save; +int n_error; + +int +main() +{ + int dummy; + // Init registers to correct value. + // Use following template so that RA will save/restore callee + // save registers in prologue/epilogue + __asm__ __volatile__ ( + "movl %1, %0" + : "=D" (dummy) + : "i" (INIT_EDI) + ); + __asm__ __volatile__ ( + "movl %1, %0" + : "=S" (dummy) + : "i" (INIT_ESI) + ); + __asm__ __volatile__ ( + "movl %1, %0" + : "=b" (dummy) + : "i" (INIT_EBX) + ); + __asm__ __volatile__ ( + "movl %ebp," ASMNAME("g_ebp_save")"\n\t" + "movl %esp," ASMNAME("g_esp_save")"\n\t" + ); + try { + foo(); + } + catch (...) + { + } + + // Get DI/SI/BX register value after exception caught + __asm__ __volatile__ ( + "movl %edi," ASMNAME("g_edi")"\n\t" + "movl %esi," ASMNAME("g_esi")"\n\t" + "movl %ebx," ASMNAME("g_ebx")"\n\t" + "movl %ebp," ASMNAME("g_ebp")"\n\t" + "movl %esp," ASMNAME("g_esp")"\n\t" + ); + + // Check if DI/SI/BX register value are the same as before calling + // foo. + if (g_edi != INIT_EDI) + { + n_error++; +#ifdef DEBUG + printf("edi=%d, correct value:%d\n", g_edi, INIT_EDI); +#endif + } + if (g_esi != INIT_ESI) + { + n_error++; +#ifdef DEBUG + printf("esi=%d, correct value:%d\n", g_esi, INIT_ESI); +#endif + } + if (g_ebx != INIT_EBX) + { + n_error++; +#ifdef DEBUG + printf("ebx=%d, correct value:%d\n", g_ebx, INIT_EBX); +#endif + } + if (g_ebp != g_ebp_save) + { + n_error++; +#ifdef DEBUG + printf("ebp=0x%x, correct value:0x%x\n", g_ebp, g_ebp_save); +#endif + } + if (g_esp != g_esp_save) + { + n_error++; +#ifdef DEBUG + printf("esp=0x%x, correct value:0x%x\n", g_esp, g_esp_save); +#endif + } + if (n_error !=0) + abort(); + return 0; +} +#endif
stackalign/test-unwind.h Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: stackalign/eh-global-1.C =================================================================== --- stackalign/eh-global-1.C (nonexistent) +++ stackalign/eh-global-1.C (revision 338) @@ -0,0 +1,39 @@ +/* { dg-do run } */ + +#include "check.h" + +#ifndef ALIGNMENT +#define ALIGNMENT 64 +#endif + +typedef int aligned __attribute__((aligned(ALIGNMENT))); + +int global; + +class Base {}; + +struct A : virtual public Base +{ + A() {} +}; + +struct B {}; + +void +foo (void) throw (B,A) +{ + aligned i; + + if (check_int (&i, __alignof__(i)) != i) + abort (); + + throw A(); +} + +int +main() +{ + try { foo (); } + catch (A& a) { } + return 0; +}
stackalign/eh-global-1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: stackalign/stackalign.exp =================================================================== --- stackalign/stackalign.exp (nonexistent) +++ stackalign/stackalign.exp (revision 338) @@ -0,0 +1,39 @@ +# Copyright (C) 2008 +# Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# . + +# This harness is for tests that should be run at all optimisation levels. + +load_lib g++-dg.exp + +# Only run on targets which support automatic stack alignment. +if { ![check_effective_target_automatic_stack_alignment] } then { + return +} + +set additional_flags "" +if { [istarget i?86*-*-*] || [istarget x86_64-*-*] } then { + lappend additional_flags "-mstackrealign" + lappend additional_flags "-mpreferred-stack-boundary=5" +} + +dg-init +gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.C]] $additional_flags +if { [check_effective_target_fpic] } then { + lappend additional_flags "-fpic" + gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.C]] $additional_flags +} +dg-finish Index: pr31081-1.C =================================================================== --- pr31081-1.C (nonexistent) +++ pr31081-1.C (revision 338) @@ -0,0 +1,23 @@ +/* { dg-do compile } */ + +static int get_record (void); +void f(void); +int g(void); +static int get_record (void) +{ + int result; + try + { + result = g(); + f(); + } + catch (const int &) { } + return result; +} +int NAV_get_record ( ) +{ + int result; + for (;;) + if (get_record ()) + return 1; +}
pr31081-1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr35400.C =================================================================== --- pr35400.C (nonexistent) +++ pr35400.C (revision 338) @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-Wtype-limits" } */ + +struct A +{ + A(); + ~A(); +}; + +void foo() +{ + A x[1]; +}
pr35400.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr39002.C =================================================================== --- pr39002.C (nonexistent) +++ pr39002.C (revision 338) @@ -0,0 +1,88 @@ +// PR target/39002 +// { dg-do run } + +struct S +{ + double x; + double y; + double z; +}; + +double foo (S *, S *); +void bar (S *, S *, S *, double &, double &, double &); + +double +foo (S *a1, S *a2) +{ + return __builtin_sqrt ((a1->x - a2->x) * (a1->x - a2->x) + + (a1->y - a2->y) * (a1->y - a2->y) + + (a1->z - a2->z) * (a1->z - a2->z)); +} + +void +bar (S *p, S *q, S *r, double &x, double &y, double &z) +{ + if (foo (p, q) == 0.0) + { + x = r->x; + y = r->y; + z = r->z; + return; + } + if (foo (p, r) == 0.0) + { + x = r->x; + y = r->y; + z = r->z; + return; + } + if (foo (q, r) == 0.0) + { + x = r->x; + y = r->y; + z = r->z; + return; + } + + double a1, b1, c1, d1, e1; + double dx, dy, dz, dw, dv; + + a1 = q->x - p->x; + b1 = q->y - p->y; + c1 = q->z - p->z; + e1 = __builtin_sqrt (a1 * a1 + b1 * b1 + c1 * c1); + a1 = a1 / e1; + b1 = b1 / e1; + c1 = c1 / e1; + dx = p->x - r->x; + dy = p->y - r->y; + dz = p->z - r->z; + dw = dx * dx + dy * dy + dz * dz; + dv = 2.0 * dx * a1 + 2.0 * dy * b1 + 2.0 * dz * c1; + d1 = -dv / 2.0; + x = p->x + (a1 * d1); + y = p->y + (b1 * d1); + z = p->z + (c1 * d1); + return; +} + +int +main (void) +{ + S a, b, c, d, *p, *q, *r; + + p = &a; + q = &b; + r = &c; + a.x = 0.0; + a.y = 0.0; + a.z = 0.0; + b.x = 1.0; + b.y = 0.0; + b.z = 0.0; + c.x = 0.0; + c.y = 1.0; + c.z = 0.0; + bar (p, q, r, d.x, d.y, d.z); + return 0; +}
pr39002.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pushpop_macro.C =================================================================== --- pushpop_macro.C (nonexistent) +++ pushpop_macro.C (revision 338) @@ -0,0 +1,19 @@ +/* Do the preprocessor push_macro/pop_macro test. */ + +/* { dg-do run } */ + +extern "C" void abort (); + +#define _ 2 +#pragma push_macro("_") +#undef _ +#define _ 1 +#pragma pop_macro("_") + +int main () +{ + if (_ != 2) + abort (); + return 0; +} +
pushpop_macro.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr40335.C =================================================================== --- pr40335.C (nonexistent) +++ pr40335.C (revision 338) @@ -0,0 +1,16 @@ +/* { dg-do run } */ + +extern "C" void abort (void); +int +main (void) +{ + int i = -1; + switch ((signed char) i) + { + case 255: /* { dg-bogus "exceeds maximum value" "" { xfail *-*-* } } */ + abort (); + default: + break; + } +} +
pr40335.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr35164-1.C =================================================================== --- pr35164-1.C (nonexistent) +++ pr35164-1.C (revision 338) @@ -0,0 +1,69 @@ +typedef __SIZE_TYPE__ size_t; +template class __normal_iterator { +public: + const _Iterator& base() const; +}; +template inline +void copy_backward(_BI1 __first, _BI1 __last, _BI2 __result) { + while (__first != __last) *--__result = *--__last; +} +template struct _Vector_base { + struct _Vector_impl { _Tp* _M_finish; }; + _Vector_impl _M_impl; +}; +template class vector : protected _Vector_base<_Tp> { + typedef vector<_Tp> vector_type; + typedef _Tp * pointer; + typedef _Tp & reference; + typedef __normal_iterator iterator; + typedef size_t size_type; +public: + iterator end(); + void resize(size_type __new_size) { insert(end(), __new_size); } + reference operator[](size_type __n); + void insert(iterator __position, size_type __n) + { + pointer __old_finish(this->_M_impl._M_finish); + copy_backward(__position.base(), __old_finish - __n, __old_finish); + } +}; +struct A { + virtual ~A (); + void incRef (); + void decRef (); +}; +struct C : public A { + static C *alloc (); +}; +template struct B { + B () : ptr (T::alloc ()) { } + B (T *a_ptr) : ptr (a_ptr) { } + ~B () { decRef (); } + B& operator= (const B& a) { if (a.get () != this->get ()) { decRef (); +incRef (); } } + template operator B () const { return B (ptr); } + T* operator-> () const { } + T* get () const { return ptr; } + void decRef () const { if (ptr != 0) ptr->decRef (); } + void incRef () const { if (ptr != 0) ptr->incRef (); } + T *ptr; +}; +struct D : public C { + template inline void foo (const B & x) { d.resize (1); d[0] = x; +} + vector > d; +}; +struct E : public C { + static E *alloc (); +}; +struct F : public D { + static F *alloc (); +}; +void foo (vector > & x) { + for (int i = 0; i < 2; ++i) + { + B l; + B m; + l->foo (m); + } +}
pr35164-1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr41183.C =================================================================== --- pr41183.C (nonexistent) +++ pr41183.C (revision 338) @@ -0,0 +1,30 @@ +// PR c++/41183 +// { dg-do compile } + +void foo (const char *); + +template +struct A +{ + template A (const int &, T); + int i; +}; + +template +template +A::A (const int &j, T) : i(j) +{ + foo (0); + foo (0); + foo (__PRETTY_FUNCTION__); +} + +int N; + +struct B +{ + B (); + A<&N> a; +}; + +B::B() : a(N, 0) {}
pr41183.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr40492.C =================================================================== --- pr40492.C (nonexistent) +++ pr40492.C (revision 338) @@ -0,0 +1,26 @@ +typedef unsigned short ushort; +class QChar { +public: + QChar( const QChar& c ); + ushort ucs; +}; +inline QChar::QChar( const QChar& c ) : ucs( c.ucs ) { }; +class QString { }; +class KoAutoFormat { +public: + struct TypographicQuotes { QChar begin, end; }; + TypographicQuotes getConfigTypographicDoubleQuotes() const { + return m_typographicDoubleQuotes; + } + TypographicQuotes m_typographicDoubleQuotes; +}; +class KoAutoFormatDia { + QChar oDoubleBegin, oDoubleEnd; + KoAutoFormat * m_docAutoFormat; + bool noSignal; + void changeAutoformatLanguage(void); +}; +void KoAutoFormatDia::changeAutoformatLanguage(void) +{ + oDoubleEnd= m_docAutoFormat->getConfigTypographicDoubleQuotes().end; +}
pr40492.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr32950.C =================================================================== --- pr32950.C (nonexistent) +++ pr32950.C (revision 338) @@ -0,0 +1,19 @@ +/* { dg-do compile } */ + +struct A +{ + __complex__ double c; +}; + +struct B +{ + A a; + B(A x) : a(x) {} + void foo(); +}; + +void bar() +{ + B b = A(); + B(b).foo(); +}
pr32950.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr37146-1.C =================================================================== --- pr37146-1.C (nonexistent) +++ pr37146-1.C (revision 338) @@ -0,0 +1,83 @@ +// PR c++/37146 +// { dg-do run } + +extern "C" void abort (); +int a, b; +struct A { int i:8; int j:8; int k:16; int l:32; } c; + +void +f1 (int x, int y) +{ + (x ? a : b) = y; +} + +void +f2 (int x, int y) +{ + (x ? c.i : c.j) = y; +} + +void +f3 (int x, int y) +{ + (x ? c.i : a) = y; +} + +void +f4 (int x, int y) +{ + (x ? c.i : c.k) = y; +} + +void +f5 (int x, int y) +{ + (x ? c.l : b) = y; +} + +#define CHECK(var, exp) \ + do \ + { \ + if (var != exp) \ + abort (); \ + var = -1; \ + if (a != -1 \ + || b != -1 \ + || c.i != -1 \ + || c.j != -1 \ + || c.k != -1 \ + || c.l != -1) \ + abort (); \ + } \ + while (0) + +int +main () +{ + a = -1; + b = -1; + c.i = -1; + c.j = -1; + c.k = -1; + c.l = -1; + f1 (1, 264); + CHECK (a, 264); + f1 (0, 264); + CHECK (b, 264); + f2 (1, 112); + CHECK (c.i, 112); + f2 (0, 112); + CHECK (c.j, 112); + f3 (1, 26); + CHECK (c.i, 26); + f3 (0, 26); + CHECK (a, 26); + f4 (1, 107); + CHECK (c.i, 107); + f4 (0, 107); + CHECK (c.k, 107); + f5 (1, 95); + CHECK (c.l, 95); + f5 (0, 95); + CHECK (b, 95); +}
pr37146-1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr34651.C =================================================================== --- pr34651.C (nonexistent) +++ pr34651.C (revision 338) @@ -0,0 +1,25 @@ +/* { dg-do compile } */ + +typedef bool Bool; +struct CString { + CString (const char * =__null); + CString & operator += (const CString &); +}; +struct THotKey { + short Key; + Bool Control; + Bool Shift; + Bool Alt; +}; +THotKey m_HotKey; +THotKey GetHotKey () { return m_HotKey; } +void Serialize () +{ + THotKey inHotKey (GetHotKey()); + CString outCombinaison (inHotKey.Control + ? ((inHotKey.Alt || inHotKey.Shift) + ? "ctrl+" : "ctrl") + : __null); + outCombinaison += inHotKey.Alt ? inHotKey.Shift ? "alt+" : "alt" : ""; + outCombinaison += inHotKey.Shift ? "shift" : ""; +}
pr34651.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr37343.C =================================================================== --- pr37343.C (nonexistent) +++ pr37343.C (revision 338) @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +typedef enum RW { rwBitmapGrey, rwBitmapGrey16 } RW; +void FindDepth(RW); +void ParseDumpBitmap(RW kind, int maxfiles) +{ + static const RW normalTypes[] = { }; + const RW *bitmapTypes; + int i; + switch (kind) { + case rwBitmapGrey: + case rwBitmapGrey16: + bitmapTypes = &kind; + break; + default: + bitmapTypes = normalTypes; + } + for (i = 0; i < maxfiles; i++) + FindDepth(bitmapTypes[i]); +}
pr37343.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr42357.C =================================================================== --- pr42357.C (nonexistent) +++ pr42357.C (revision 338) @@ -0,0 +1,30 @@ +// { dg-do compile } +typedef unsigned char uint8; +typedef unsigned int uint32; +class PixelARGB { +public: + ~PixelARGB() throw() { } + PixelARGB (const uint32 argb_) throw() : argb (argb_) { } + inline __attribute__((always_inline)) uint8 getRed() const throw() { + return components.r; + } + union { + uint32 argb; + struct { + uint8 b, g, r, a; + } components; + }; +}; +class Colour { +public: + Colour() throw() : argb (0) {}; + uint8 getRed() const throw() { + return argb.getRed(); + } + PixelARGB argb; +}; +uint8 writeImage (void) { + Colour pixel; + pixel = Colour (); + return pixel.getRed(); +}
pr42357.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr31863.C =================================================================== --- pr31863.C (nonexistent) +++ pr31863.C (revision 338) @@ -0,0 +1,777 @@ +/* { dg-do link } */ +/* { dg-timeout-factor 2.0 } */ + +namespace Loki +{ + class NullType {}; + template + struct Typelist + { + typedef T Head; + typedef U Tail; + }; + + + + namespace TL + { + template + < + typename T1 = NullType, typename T2 = NullType, typename T3 = +NullType, + typename T4 = NullType, typename T5 = NullType, typename T6 = +NullType, + typename T7 = NullType, typename T8 = NullType, typename T9 = +NullType, + typename T10 = NullType, typename T11 = NullType, typename T12 += NullType, + typename T13 = NullType, typename T14 = NullType, typename T15 += NullType, + typename T16 = NullType, typename T17 = NullType, typename T18 += NullType, + typename T19 = NullType, typename T20 = NullType, typename T21 += NullType, + typename T22 = NullType, typename T23 = NullType, typename T24 += NullType, + typename T25 = NullType, typename T26 = NullType, typename T27 += NullType, + typename T28 = NullType, typename T29 = NullType, typename T30 += NullType, + typename T31 = NullType, typename T32 = NullType, typename T33 += NullType, + typename T34 = NullType, typename T35 = NullType, typename T36 += NullType, + typename T37 = NullType, typename T38 = NullType, typename T39 += NullType, + typename T40 = NullType + > + struct MakeTypelist + { + private: + typedef typename MakeTypelist + < + T2 , T3 , T4 , + T5 , T6 , T7 , + T8 , T9 , T10, + T11, T12, T13, + T14, T15, T16, + T17, T18, T19, + T20, T21, T22, + T23, T24, T25, + T26, T27, T28, + T29, T30, T31, + T32, T33, T34, + T35, T36, T37, + T38, T39, T40 + > + ::Result TailResult; + + public: + typedef Typelist Result; + }; + + template<> + struct MakeTypelist<> + { + typedef NullType Result; + }; + + } +} +template +class Factory; + +template +struct Context +{ + typedef Key KeyType; + enum + { + isWrite = iW + }; +}; + +namespace detail +{ + +template +class CreatorUnitBaseImpl +{ +public: + typedef Context Context_; +private: + typedef void*(CreatorUnitBaseImpl::*CreateFun)(Context_&, unsigned&, const +Key&); + CreateFun createFun_; + +protected: + virtual void* createUninitialized () = 0; + template + void* createImpl (Context_& ctx, unsigned& ver, const Key& k) + { + return createUninitialized(); + } +private: + CreatorUnitBaseImpl(); +public: + template + CreatorUnitBaseImpl (Value*) : + createFun_( &CreatorUnitBaseImpl::template createImpl ) + { + } + + virtual ~CreatorUnitBaseImpl () {} + + CreatorUnitBaseImpl(const CreatorUnitBaseImpl& s) + : createFun_(s.createFun_) + { + } + + CreatorUnitBaseImpl& operator=(const CreatorUnitBaseImpl& s) + { + createFun_ = s.createFun_; + return *this; + } + void* create (Context_& ctx, unsigned& ver, const Key& k) + { + return (this->*createFun_)(ctx, ver, k); + } +}; + +template +class Creator : protected CreatorUnitBaseImpl, protected +CreatorUnitBaseImpl +{ +public: + typedef void* (*CreatorFun) (); + +private: + CreatorFun fun_; +protected: + virtual void* createUninitialized () + { + if (fun_) + return (*fun_)(); + return 0; + } +private: + Creator (); +public: + template + Creator (CreatorFun f, Value*) : + CreatorUnitBaseImpl((Value*)0), + CreatorUnitBaseImpl((Value*)0), + fun_(f) + { + } + + Creator(const Creator& s) : + CreatorUnitBaseImpl(s), + CreatorUnitBaseImpl(s), + fun_(s.fun_) + { + + } + + Creator& operator=(const Creator& s) + { + CreatorUnitBaseImpl::operator=(s); + CreatorUnitBaseImpl::operator=(s); + fun_ = s.fun_; + return *this; + } + + virtual ~Creator () + { + } + + template + void* createObject (Context& ctx, unsigned& ver, const Key& k) + { + void* r = CreatorUnitBaseImpl::create(ctx, ver, +k); + return r; + } +}; + +} + +template +class Factory +{ +public: + typedef Key KeyType; + typedef void* (*CreatorFun) (); + typedef detail::Creator Creator; +public: + Factory () {} + ~Factory () {} + + template + bool registerCreator (const Key& k, CreatorFun fun) + { + return true; + } + template + void* createObject (const Key& k, Context& ctx, unsigned& ver) + { + return 0; + } +}; + +template +struct ClassSpec +{ + typedef Key KeyType; + typedef Base BaseType; + enum {KeyValue = key}; +}; + +template +class Serializer; + +template +class Serializer > + : public virtual Factory +{ + typedef Key KeyType; + typedef Base BaseType; + enum {KeyValue = key}; + typedef Factory Inherited; + typedef Serializer > SelfType; + + static void* create () + { + return (void*) (new BaseType); + } +public: + Serializer() + { + Inherited::template registerCreator( + KeyValue, + &SelfType::create); + } +}; + +template +class Serializer >: + public Serializer +{ +}; + +template +class Serializer >: + public virtual Serializer, + public virtual Serializer +{ +}; + +template +class Serializer : public virtual Factory +{ +}; + + + + +typedef unsigned KeyType; + + + +typedef Factory FactoryType; + +typedef KeyType Key; + +struct A001 +{ + template + bool serialize(Context& ctx, unsigned& ver) + { + return true; + } + static Key classId() { return 1; } + static const char* className () {return "A001";} +}; + +struct A002 +{ + template + bool serialize(Context& ctx, unsigned& ver) + { + return true; + } + static Key classId() { return 2; } + static const char* className () {return "A002";} +}; + +struct A003 +{ + template + bool serialize(Context& ctx, unsigned& ver) + { + return true; + } + static Key classId() { return 3; } + static const char* className () {return "A003";} +}; + +struct A004 +{ + template + bool serialize(Context& ctx, unsigned& ver) + { + return true; + } + static Key classId() { return 4; } + static const char* className () {return "A004";} +}; + +struct A005 +{ + template + bool serialize(Context& ctx, unsigned& ver) + { + return true; + } + static Key classId() { return 5; } + static const char* className () {return "A005";} +}; + +struct A006 +{ + template + bool serialize(Context& ctx, unsigned& ver) + { + return true; + } + static Key classId() { return 6; } + static const char* className () {return "A006";} +}; + +struct A007 +{ + template + bool serialize(Context& ctx, unsigned& ver) + { + return true; + } + static Key classId() { return 7; } + static const char* className () {return "A007";} +}; + +struct A008 +{ + template + bool serialize(Context& ctx, unsigned& ver) + { + return true; + } + static Key classId() { return 8; } + static const char* className () {return "A008";} +}; + +struct A009 +{ + template + bool serialize(Context& ctx, unsigned& ver) + { + return true; + } + static Key classId() { return 9; } + static const char* className () {return "A009";} +}; + +struct A010 +{ + template + bool serialize(Context& ctx, unsigned& ver) + { + return true; + } + static Key classId() { return 10; } + static const char* className () {return "A010";} +}; + +struct A011 +{ + template + bool serialize(Context& ctx, unsigned& ver) + { + return true; + } + static Key classId() { return 11; } + static const char* className () {return "A011";} +}; + +struct A012 +{ + template + bool serialize(Context& ctx, unsigned& ver) + { + return true; + } + static Key classId() { return 12; } + static const char* className () {return "A012";} +}; + +struct A013 +{ + template + bool serialize(Context& ctx, unsigned& ver) + { + return true; + } + static Key classId() { return 13; } + static const char* className () {return "A013";} +}; + +struct A014 +{ + template + bool serialize(Context& ctx, unsigned& ver) + { + return true; + } + static Key classId() { return 14; } + static const char* className () {return "A014";} +}; + +struct A015 +{ + template + bool serialize(Context& ctx, unsigned& ver) + { + return true; + } + static Key classId() { return 15; } + static const char* className () {return "A015";} +}; + +struct A016 +{ + template + bool serialize(Context& ctx, unsigned& ver) + { + return true; + } + static Key classId() { return 16; } + static const char* className () {return "A016";} +}; + +struct A017 +{ + template + bool serialize(Context& ctx, unsigned& ver) + { + return true; + } + static Key classId() { return 17; } + static const char* className () {return "A017";} +}; + +struct A018 +{ + template + bool serialize(Context& ctx, unsigned& ver) + { + return true; + } + static Key classId() { return 18; } + static const char* className () {return "A018";} +}; + +struct A019 +{ + template + bool serialize(Context& ctx, unsigned& ver) + { + return true; + } + static Key classId() { return 19; } + static const char* className () {return "A019";} +}; + +struct A020 +{ + template + bool serialize(Context& ctx, unsigned& ver) + { + return true; + } + static Key classId() { return 20; } + static const char* className () {return "A020";} +}; + +struct A021 +{ + template + bool serialize(Context& ctx, unsigned& ver) + { + return true; + } + static Key classId() { return 21; } + static const char* className () {return "A021";} +}; + +struct A022 +{ + template + bool serialize(Context& ctx, unsigned& ver) + { + return true; + } + static Key classId() { return 22; } + static const char* className () {return "A022";} +}; + +struct A023 +{ + template + bool serialize(Context& ctx, unsigned& ver) + { + return true; + } + static Key classId() { return 23; } + static const char* className () {return "A023";} +}; + +struct A024 +{ + template + bool serialize(Context& ctx, unsigned& ver) + { + return true; + } + static Key classId() { return 24; } + static const char* className () {return "A024";} +}; + +struct A025 +{ + template + bool serialize(Context& ctx, unsigned& ver) + { + return true; + } + static Key classId() { return 25; } + static const char* className () {return "A025";} +}; + +struct A026 +{ + template + bool serialize(Context& ctx, unsigned& ver) + { + return true; + } + static Key classId() { return 26; } + static const char* className () {return "A026";} +}; + +struct A027 +{ + template + bool serialize(Context& ctx, unsigned& ver) + { + return true; + } + static Key classId() { return 27; } + static const char* className () {return "A027";} +}; + +struct A028 +{ + template + bool serialize(Context& ctx, unsigned& ver) + { + return true; + } + static Key classId() { return 28; } + static const char* className () {return "A028";} +}; + +struct A029 +{ + template + bool serialize(Context& ctx, unsigned& ver) + { + return true; + } + static Key classId() { return 29; } + static const char* className () {return "A029";} +}; + +struct A030 +{ + template + bool serialize(Context& ctx, unsigned& ver) + { + return true; + } + static Key classId() { return 30; } + static const char* className () {return "A030";} +}; + +struct A031 +{ + template + bool serialize(Context& ctx, unsigned& ver) + { + return true; + } + static Key classId() { return 31; } + static const char* className () {return "A031";} +}; + +struct A032 +{ + template + bool serialize(Context& ctx, unsigned& ver) + { + return true; + } + static Key classId() { return 32; } + static const char* className () {return "A032";} +}; + +struct A033 +{ + template + bool serialize(Context& ctx, unsigned& ver) + { + return true; + } + static Key classId() { return 33; } + static const char* className () {return "A033";} +}; + +struct A034 +{ + template + bool serialize(Context& ctx, unsigned& ver) + { + return true; + } + static Key classId() { return 34; } + static const char* className () {return "A034";} +}; + +struct A035 +{ + template + bool serialize(Context& ctx, unsigned& ver) + { + return true; + } + static Key classId() { return 35; } + static const char* className () {return "A035";} +}; + +struct A036 +{ + template + bool serialize(Context& ctx, unsigned& ver) + { + return true; + } + static Key classId() { return 36; } + static const char* className () {return "A036";} +}; + +struct A037 +{ + template + bool serialize(Context& ctx, unsigned& ver) + { + return true; + } + static Key classId() { return 37; } + static const char* className () {return "A037";} +}; + +struct A038 +{ + template + bool serialize(Context& ctx, unsigned& ver) + { + return true; + } + static Key classId() { return 38; } + static const char* className () {return "A038";} +}; + +struct A039 +{ + template + bool serialize(Context& ctx, unsigned& ver) + { + return true; + } + static Key classId() { return 39; } + static const char* className () {return "A039";} +}; + +struct A040 +{ + template + bool serialize(Context& ctx, unsigned& ver) + { + return true; + } + static Key classId() { return 40; } + static const char* className () {return "A040";} +}; + +Factory& getInstance() +{ + static Serializer, + ClassSpec, + ClassSpec, + ClassSpec, + ClassSpec, + ClassSpec, + ClassSpec, + ClassSpec, + ClassSpec, + ClassSpec, + ClassSpec, + ClassSpec, + ClassSpec, + ClassSpec, + ClassSpec, + ClassSpec, + ClassSpec, + ClassSpec, + ClassSpec, + ClassSpec, + ClassSpec, + ClassSpec, + ClassSpec, + ClassSpec, + ClassSpec, + ClassSpec, + ClassSpec, + ClassSpec, + ClassSpec, + ClassSpec, + ClassSpec, + ClassSpec, + ClassSpec, + ClassSpec, + ClassSpec, + ClassSpec, + ClassSpec, + ClassSpec, + ClassSpec, + ClassSpec + >::Result + > instance; + return instance; +} + +int main () +{ + return 0; +}
pr31863.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr38811.C =================================================================== --- pr38811.C (nonexistent) +++ pr38811.C (revision 338) @@ -0,0 +1,73 @@ +/* { dg-do compile } */ + +typedef unsigned long ULONG; +void iwos_ErrorMessage(long error, const char * const file_name, + ULONG line_num, const char * const message); +class AbcA2d { +public: + double x; + double y; + ~AbcA2d() { } +}; +enum AbcZyParamType { ABC_SP_1 }; +class AbcExtent2d { + AbcA2d m_vMin; + AbcA2d m_vMax; +public: + AbcExtent2d(const AbcA2d & rMin, const AbcA2d & rMax); + AbcA2d ClampPoint2d(const AbcA2d & rPoint) const; + AbcA2d GetMax() const { return m_vMax; } + AbcA2d GetMin() const { } + AbcA2d Evaluate(double dNormalizedX, double dNormalizedY) const; +}; +inline AbcExtent2d::AbcExtent2d(const AbcA2d & rMin, const AbcA2d & rMax) +{ + if (rMin.x > rMax.x || rMin.y > rMax.y) + { + long sErr = (1007); + if (sErr != 1000) + iwos_ErrorMessage(sErr,(const char * const)__null, + 0,(const char * const)__null); + } + else + { + m_vMin = rMin; + m_vMax = rMax; + } +} +inline AbcA2d AbcExtent2d::ClampPoint2d(const AbcA2d & rPoint) const +{ + AbcA2d sRet = rPoint; + if (rPoint.x < m_vMin.x) + sRet.x = m_vMin.x; + return sRet; +} +inline AbcA2d AbcExtent2d::Evaluate(double dNormalizedX, double dNormalizedY) +const +{ + AbcA2d sRet; + sRet.x = m_vMin.x + dNormalizedX * (m_vMax.x - m_vMin.x); + sRet.y = m_vMin.y + dNormalizedY * (m_vMax.y - m_vMin.y); + return ClampPoint2d(sRet); +} +class AbcAbcdTracer { + AbcExtent2d m_vUVDomain; + virtual long TestIsoAbcde(AbcZyParamType eZyParam, double dParam, + int & rbZyxIsSolution); + virtual int DoesPointLieOnAbcde(AbcA2d & rUV, int bRefinePoint) const; +}; +long AbcAbcdTracer::TestIsoAbcde(AbcZyParamType eZyParam, double dParam, + int & rbZyxIsSolution) +{ + AbcA2d sUV1(m_vUVDomain.GetMin()); + AbcA2d sUV2(m_vUVDomain.GetMax()); + AbcExtent2d sUVIso(sUV1,sUV2); + for (ULONG i=0; i<10; i++) + { + double dT = i / (10 -1.0); + AbcA2d sUV = sUVIso.Evaluate(dT,dT); + if (!DoesPointLieOnAbcde(sUV,0)) + ; + } +} +
pr38811.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr37345.C =================================================================== --- pr37345.C (nonexistent) +++ pr37345.C (revision 338) @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +class EbmlElement { + virtual EbmlElement * Clone() const; +}; +class KaxTracks : public EbmlElement { +public: + EbmlElement * Clone() const { + return new KaxTracks(*this); + } +}; +KaxTracks kax_tracks; +void finish_file(void) +{ + kax_tracks.Clone(); +}
pr37345.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr43880.C =================================================================== --- pr43880.C (nonexistent) +++ pr43880.C (revision 338) @@ -0,0 +1,16 @@ +// { dg-do compile } + +extern void xread(void *); +class test +{ +public: + test(void); +}; +test::test(void) +{ + union { + char pngpal[1]; + }; + xread(pngpal); +} +
pr43880.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr37922.C =================================================================== --- pr37922.C (nonexistent) +++ pr37922.C (revision 338) @@ -0,0 +1,502 @@ +// { dg-do run } +// { dg-options "-fpic" { target fpic } } + +typedef __SIZE_TYPE__ size_t; + +template +inline +NumType +absolute(NumType const& x) +{ + if (x < NumType(0)) return -x; + return x; +} + +class trivial_accessor +{ + public: + typedef size_t index_type; + struct index_value_type {}; + + trivial_accessor() : size_(0) {} + + trivial_accessor(size_t const& n) : size_(n) {} + + size_t size_1d() const { return size_; } + + protected: + size_t size_; +}; + +namespace N0 +{ + template + class const_ref + { + public: + typedef ElementType value_type; + typedef size_t size_type; + + typedef AccessorType accessor_type; + typedef typename accessor_type::index_type index_type; + typedef typename accessor_type::index_value_type index_value_type; + + const_ref() {} + + const_ref(const ElementType* begin, accessor_type const& accessor) + : begin_(begin), accessor_(accessor) + { + init(); + } + + const_ref(const ElementType* begin, index_value_type const& n0) + : begin_(begin), accessor_(n0) + { + init(); + } + + const_ref(const ElementType* begin, index_value_type const& n0, + index_value_type const& n1) + : begin_(begin), accessor_(n0, n1) + { + init(); + } + + const_ref(const ElementType* begin, index_value_type const& n0, + index_value_type const& n1, + index_value_type const& n2) + : begin_(begin), accessor_(n0, n1, n2) + { + init(); + } + + accessor_type const& accessor() const { return accessor_; } + size_type size() const { return size_; } + + const ElementType* begin() const { return begin_; } + const ElementType* end() const { return end_; } + + ElementType const& + operator[](size_type i) const { return begin_[i]; } + + const_ref + as_1d() const + { + return const_ref(begin_, size_); + } + + protected: + void + init() + { + size_ = accessor_.size_1d(); + end_ = begin_ + size_; + } + + const ElementType* begin_; + accessor_type accessor_; + size_type size_; + const ElementType* end_; + }; +} + +template +class ref : public N0::const_ref +{ + public: + typedef ElementType value_type; + typedef size_t size_type; + + typedef N0::const_ref base_class; + typedef AccessorType accessor_type; + typedef typename accessor_type::index_type index_type; + + ref() {} + + ElementType* + begin() const { return const_cast(this->begin_); } + + ElementType* + end() const { return const_cast(this->end_); } + + ElementType& + operator[](size_type i) const { return begin()[i]; } +}; + +namespace N1 { + template + class tiny_plain + { + public: + typedef ElementType value_type; + typedef size_t size_type; + + static const size_t fixed_size=N; + + ElementType elems[N]; + + tiny_plain() {} + + static size_type size() { return N; } + + ElementType* begin() { return elems; } + const ElementType* begin() const { return elems; } + ElementType* end() { return elems+N; } + const ElementType* end() const { return elems+N; } + ElementType& operator[](size_type i) { return elems[i]; } + ElementType const& operator[](size_type i) const { return elems[i]; } + }; + + template + class tiny : public tiny_plain + { + public: + typedef ElementType value_type; + typedef size_t size_type; + + typedef tiny_plain base_class; + + tiny() {} + }; +} + +template +class mat3 : public N1::tiny_plain +{ + public: + typedef typename N1::tiny_plain base_type; + + mat3() {} + mat3(NumType const& e00, NumType const& e01, NumType const& e02, + NumType const& e10, NumType const& e11, NumType const& e12, + NumType const& e20, NumType const& e21, NumType const& e22) + : base_type(e00, e01, e02, e10, e11, e12, e20, e21, e22) + {} + mat3(base_type const& a) + : base_type(a) + {} + + NumType const& + operator()(size_t r, size_t c) const + { + return this->elems[r * 3 + c]; + } + NumType& + operator()(size_t r, size_t c) + { + return this->elems[r * 3 + c]; + } + + NumType + trace() const + { + mat3 const& m = *this; + return m[0] + m[4] + m[8]; + } + + NumType + determinant() const + { + mat3 const& m = *this; + return m[0] * (m[4] * m[8] - m[5] * m[7]) + - m[1] * (m[3] * m[8] - m[5] * m[6]) + + m[2] * (m[3] * m[7] - m[4] * m[6]); + } +}; + +template +inline +mat3 +operator-(mat3 const& v) +{ + mat3 result; + for(size_t i=0;i<9;i++) { + result[i] = -v[i]; + } + return result; +} + +class mat_grid : public N1::tiny +{ + public: + typedef N1::tiny index_type; + typedef index_type::value_type index_value_type; + + mat_grid() { this->elems[0]=0; this->elems[1]=0; } + + mat_grid(index_type const& n) : index_type(n) {} + + mat_grid(index_value_type const& n0, index_value_type const& n1) + { this->elems[0]=n0; this->elems[1]=n1; } + + size_t size_1d() const { return elems[0] * elems[1]; } + + size_t + operator()(index_value_type const& r, index_value_type const& c) const + { + return r * elems[1] + c; + } +}; + +template +class mat_const_ref : public N0::const_ref +{ + public: + typedef AccessorType accessor_type; + typedef typename N0::const_ref base_type; + typedef typename accessor_type::index_value_type index_value_type; + + mat_const_ref() {} + + mat_const_ref(const NumType* begin, accessor_type const& grid) + : base_type(begin, grid) + {} + + mat_const_ref(const NumType* begin, index_value_type const& n_rows, + index_value_type const& n_columns) + : base_type(begin, accessor_type(n_rows, n_columns)) + {} + + accessor_type + grid() const { return this->accessor(); } + + index_value_type const& + n_rows() const { return this->accessor()[0]; } + + index_value_type const& + n_columns() const { return this->accessor()[1]; } + + NumType const& + operator()(index_value_type const& r, index_value_type const& c) const + { + return this->begin()[this->accessor()(r, c)]; + } +}; + +template +class mat_ref : public mat_const_ref +{ + public: + typedef AccessorType accessor_type; + typedef mat_const_ref base_type; + typedef typename accessor_type::index_value_type index_value_type; + + mat_ref() {} + + mat_ref(NumType* begin, accessor_type const& grid) + : base_type(begin, grid) + {} + + mat_ref(NumType* begin, index_value_type n_rows, + index_value_type n_columns) + : base_type(begin, accessor_type(n_rows, n_columns)) + {} + + NumType* + begin() const { return const_cast(this->begin_); } + + NumType* + end() const { return const_cast(this->end_); } + + NumType& + operator[](index_value_type const& i) const { return begin()[i]; } + + NumType& + operator()(index_value_type const& r, index_value_type const& c) const + { + return this->begin()[this->accessor()(r, c)]; + } +}; + + template + inline void + swap(AnyType* a, AnyType* b, size_t n) + { + for(size_t i=0;i +size_t +form_t(mat_ref& m, + mat_ref const& t) +{ + typedef size_t size_t; + size_t mr = m.n_rows(); + size_t mc = m.n_columns(); + size_t tc = t.n_columns(); + if (tc) { + } + size_t i, j; + for (i = j = 0; i < mr && j < mc;) { + size_t k = i; while (k < mr && m(k,j) == 0) k++; + if (k == mr) + j++; + else { + if (i != k) { + swap(&m(i,0), &m(k,0), mc); + if (tc) swap(&t(i,0), &t(k,0), tc); + } + for (k++; k < mr; k++) { + IntType a = absolute(m(k, j)); + if (a != 0 && a < absolute(m(i,j))) { + swap(&m(i,0), &m(k,0), mc); + if (tc) swap(&t(i,0), &t(k,0), tc); + } + } + if (m(i,j) < 0) { + for(size_t ic=0;ic(m.begin(), i, mc); + return i; +} + +template +size_t +form(mat_ref& m) +{ + mat_ref t(0,0,0); + return form_t(m, t); +} + +typedef mat3 sg_mat3; + +class rot_mx +{ + public: + explicit + rot_mx(sg_mat3 const& m, int denominator=1) + : num_(m), den_(denominator) + {} + + sg_mat3 const& + num() const { return num_; } + sg_mat3& + num() { return num_; } + + int const& + operator[](size_t i) const { return num_[i]; } + int& + operator[](size_t i) { return num_[i]; } + + int + const& operator()(int r, int c) const { return num_(r, c); } + int& + operator()(int r, int c) { return num_(r, c); } + + int const& + den() const { return den_; } + int& + den() { return den_; } + + rot_mx + minus_unit_mx() const + { + rot_mx result(*this); + for (size_t i=0;i<9;i+=4) result[i] -= den_; + return result; + } + + rot_mx + operator-() const { return rot_mx(-num_, den_); } + + int + type() const; + + int + order(int type=0) const; + + private: + sg_mat3 num_; + int den_; +}; + +class rot_mx_info +{ + public: + rot_mx_info(rot_mx const& r); + + int type() const { return type_; } + + private: + int type_; +}; + +int rot_mx::type() const +{ + int det = num_.determinant(); + if (det == -1 || det == 1) { + switch (num_.trace()) { + case -3: return -1; + case -2: return -6; + case -1: if (det == -1) return -4; + else return 2; + case 0: if (det == -1) return -3; + else return 3; + case 1: if (det == -1) return -2; + else return 4; + case 2: return 6; + case 3: return 1; + } + } + return 0; +} + +int rot_mx::order(int type) const +{ + if (type == 0) type = rot_mx::type(); + if (type > 0) return type; + if (type % 2) return -type * 2; + return -type; +} + +rot_mx_info::rot_mx_info(rot_mx const& r) +: type_(r.type()) +{ + if (type_ == 0) { + return; + } + rot_mx proper_r = r; + int proper_order = type_; + // THE PROBLEM IS AROUND HERE + if (proper_order < 0) { + proper_order *= -1; + proper_r = -proper_r; // THIS FAILS ... + } + if (proper_order > 1) { + rot_mx rmi = proper_r.minus_unit_mx(); // ... THEREFORE WRONG HERE + mat_ref re_mx(rmi.num().begin(), 3, 3); + if (form(re_mx) != 2) { + type_ = 0; + } + } +} + +int main() +{ + N1::tiny e; + e[0] = 1; e[1] = 0; e[2] = 0; + e[3] = 0; e[4] = -1; e[5] = 0; + e[6] = 0; e[7] = 0; e[8] = 1; + rot_mx r(e); + rot_mx_info ri(r); + if (ri.type() != -2) + __builtin_abort (); + return 0; +}
pr37922.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr34953.C =================================================================== --- pr34953.C (nonexistent) +++ pr34953.C (revision 338) @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-w" } */ + +void B_CLEAR(void* ret); +void B_NeverReturns(void* ret) __attribute__((noreturn)); + +int main() +{ + const struct AutoErrPop { ~AutoErrPop() { } } AutoErrPopper = { }; + B_NeverReturns(0); +} + +void B_NeverReturns(void* ret) +{ + B_CLEAR(ret); /* Never returns (does a setjmp/goto) */ +} +
pr34953.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr34099.C =================================================================== --- pr34099.C (nonexistent) +++ pr34099.C (revision 338) @@ -0,0 +1,25 @@ +/* { dg-do run } */ + +#include + +typedef std::complex NumType; + +void +multiply(NumType a, NumType b, unsigned ac, NumType &ab) +{ + NumType s; + for (unsigned j=0; j
pr34099.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr33589-1.C =================================================================== --- pr33589-1.C (nonexistent) +++ pr33589-1.C (revision 338) @@ -0,0 +1,22 @@ +// { dg-do compile } +struct base { void somemethod() {} }; +struct derived : public base { }; + +struct smartpointer +{ + ~smartpointer() { } + operator derived*() const + { + return 0; + } +}; +typedef void ( derived::* methodptr_type )(); +methodptr_type getmemberptr() +{ + return &derived::somemethod; +} +void somefunction() +{ + smartpointer pObj; + ( pObj->*getmemberptr() )(); +}
pr33589-1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr33887-2.C =================================================================== --- pr33887-2.C (nonexistent) +++ pr33887-2.C (revision 338) @@ -0,0 +1,21 @@ +/* { dg-do run } */ + +extern "C" void abort() __attribute__ ((noreturn)); + +struct s +{ + unsigned long long f1 : 40; + unsigned int f2 : 24; +} sv; + +int main() +{ + int f2; + sv.f2 = (1 << 24) - 1; + __asm__ volatile ("" : : : "memory"); + ++sv.f2; + f2 = sv.f2; + if (f2 != 0) + abort(); + return 0; +}
pr33887-2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: 20070621-1.C =================================================================== --- 20070621-1.C (nonexistent) +++ 20070621-1.C (revision 338) @@ -0,0 +1,116 @@ +/* Reduced from libstdc++-v3/testsuite/25_algorithms/equal/1.cc + +1.2.ii: In function 'void test1()': +1.2.ii:104: error: true/false edge after a non-COND_EXPR in bb 15 +1.2.ii:104: internal compiler error: verify_flow_info failed + +*/ + +__extension__ typedef __PTRDIFF_TYPE__ ptrdiff_t; +namespace std __attribute__ ((__visibility__ ("default"))) { + template struct __are_same { + enum { + __value = 0 }; + }; + template struct __is_integer { + enum { + __value = 0 }; + }; + template struct __is_pointer { + enum { + __value = 0 }; + }; + template struct __is_normal_iterator { + enum { + __value = 0 }; + }; + struct input_iterator_tag { + }; + template struct iterator { + typedef _Tp value_type; + }; + template struct iterator_traits { + typedef typename _Iterator::value_type value_type; + }; + template::__value> struct __niter_base { + static const _Iterator& __b(const _Iterator& __it) { + return __it; + } + }; + template struct __equal { + template static bool equal(_II1 __first1, _II1 __last1, _II2 __first2) { + for (; + __first1 != __last1; + ++__first1, ++__first2) if (!(*__first1 == *__first2)) return false; + } + }; + template inline bool __equal_aux(_II1 __first1, _II1 __last1, _II2 __first2) { + typedef typename iterator_traits<_II1>::value_type _ValueType1; + typedef typename iterator_traits<_II2>::value_type _ValueType2; + const bool __simple = (__is_integer<_ValueType1>::__value && __is_pointer<_II1>::__value && __is_pointer<_II2>::__value && __are_same<_ValueType1, _ValueType2>::__value); + return std::__equal<__simple>::equal(__first1, __last1, __first2); + } + template inline bool equal(_II1 __first1, _II1 __last1, _II2 __first2) { + return std::__equal_aux(__niter_base<_II1>::__b(__first1), __niter_base<_II1>::__b(__last1), __niter_base<_II2>::__b(__first2)); + } + } +extern "C" { + extern void __assert_fail (__const char *__assertion, __const char *__file, unsigned int __line, __const char *__function) throw () __attribute__ ((__noreturn__)); + } +namespace __gnu_test { + template struct BoundsContainer { + T* first; + T* last; + BoundsContainer(T* _first, T* _last) : first(_first), last(_last) { + } + }; + template class input_iterator_wrapper:public std::iterator { + public: + typedef BoundsContainer ContainerType; + T* ptr; + ContainerType* SharedInfo; + input_iterator_wrapper(T* _ptr, ContainerType* SharedInfo_in) : ptr(_ptr), SharedInfo(SharedInfo_in) { + } + bool operator==(const input_iterator_wrapper& in) const { + (static_cast (__builtin_expect (!!(SharedInfo != __null && SharedInfo == in.SharedInfo), 1) ? 0 : (__assert_fail ("SharedInfo != __null && SharedInfo == in.SharedInfo", "/abuild/rguenther/gcc/libstdc++-v3/testsuite/util/testsuite_iterators.h", 201, __PRETTY_FUNCTION__), 0))); + (static_cast (__builtin_expect (!!(ptr>=SharedInfo->first && in.ptr>=SharedInfo->first), 1) ? 0 : (__assert_fail ("ptr>=SharedInfo->first && in.ptr>=SharedInfo->first", "/abuild/rguenther/gcc/libstdc++-v3/testsuite/util/testsuite_iterators.h", 202, __PRETTY_FUNCTION__), 0))); + } + bool operator!=(const input_iterator_wrapper& in) const { + return !(*this == in); + } + T& operator*() const { + (static_cast (__builtin_expect (!!(SharedInfo && ptr < SharedInfo->last), 1) ? 0 : (__assert_fail ("SharedInfo && ptr < SharedInfo->last", "/abuild/rguenther/gcc/libstdc++-v3/testsuite/util/testsuite_iterators.h", 215, __PRETTY_FUNCTION__), 0))); + (static_cast (__builtin_expect (!!(ptr >= SharedInfo->first), 1) ? 0 : (__assert_fail ("ptr >= SharedInfo->first", "/abuild/rguenther/gcc/libstdc++-v3/testsuite/util/testsuite_iterators.h", 216, __PRETTY_FUNCTION__), 0))); + } + input_iterator_wrapper& operator++() { + (static_cast (__builtin_expect (!!(SharedInfo && ptr < SharedInfo->last), 1) ? 0 : (__assert_fail ("SharedInfo && ptr < SharedInfo->last", "/abuild/rguenther/gcc/libstdc++-v3/testsuite/util/testsuite_iterators.h", 237, __PRETTY_FUNCTION__), 0))); + ptr++; + SharedInfo->first=ptr; + } + }; + template class ItType> struct test_container { + typename ItType::ContainerType bounds; + test_container(T* _first, T* _last):bounds(_first, _last) { + } + ItType it(T* pos) { + return ItType(pos, &bounds); + } + ItType begin() { + return it(bounds.first); + } + ItType end() { + } + }; + } +using __gnu_test::test_container; +using __gnu_test::input_iterator_wrapper; +typedef test_container Container; +int array1[] = { + 0, 1}; +int array2[] = { + 1, 0}; +void test1() { + Container con1(array1, array1); + Container con2(array2, array2); + (static_cast (__builtin_expect (!!(std::equal(con1.begin(), con1.end(), con2.begin())), 1) ? 0 : (__assert_fail ("std::equal(con1.begin(), con1.end(), con2.begin())", "/abuild/rguenther/gcc/libstdc++-v3/testsuite/25_algorithms/equal/1.cc", 35, __PRETTY_FUNCTION__), 0))); + }
20070621-1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: 20080625-1.C =================================================================== --- 20080625-1.C (nonexistent) +++ 20080625-1.C (revision 338) @@ -0,0 +1,27 @@ +extern "C" { + typedef unsigned char sal_Bool; + typedef struct _rtl_uString { + } rtl_uString; + void rtl_uString_release( rtl_uString * str ) throw (); +} +class OUString { + rtl_uString * pData; +public: + OUString() {} + ~OUString() { + rtl_uString_release( pData ); + } + sal_Bool equalsIgnoreAsciiCase( const OUString & str ) const; +}; +bool findAndRemove(); +long getAttributeProps() +{ + long nAttrs = 0; + OUString aValue; + if (findAndRemove() + && aValue.equalsIgnoreAsciiCase(OUString())) + ; + else + nAttrs |= 1; + return nAttrs; +}
20080625-1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: 20090706-1.C =================================================================== --- 20090706-1.C (nonexistent) +++ 20090706-1.C (revision 338) @@ -0,0 +1,41 @@ +/* { dg-do compile } */ + +namespace std __attribute__ ((__visibility__ ("default"))) { + template class new_allocator { }; + template class allocator: public new_allocator<_Tp> { }; + template struct _Vector_base { }; + template > + class vector : protected _Vector_base<_Tp, _Alloc> { }; +}; +template class Vector { }; +enum CenteringType { VertexType, EdgeType, FaceType, CellType }; +enum ContinuityType { XDim = 1, YDim = XDim << 1, ZDim = YDim << 1 }; +template class Centering { +public: + typedef Vector Position; + typedef std::vector Positions; + Centering(const Positions &positions); + Positions positions_m; +}; +template class CanonicalCentering { + CanonicalCentering(); + template static T combine(const T &op1, const T &op2); + static Centering*** centering_table_m; +}; +template CanonicalCentering::CanonicalCentering() +{ + typename Centering::Positions positions[Dim][2]; + enum { x = 0, y, z }; + int cont = 0; + if (Dim > 1) + { + centering_table_m[EdgeType][cont][YDim] = Centering(positions[y][cont]); + centering_table_m[EdgeType][cont][XDim|YDim] = Centering(combine(positions[x][cont], positions[y][cont])); + } + if (Dim > 2) + { + centering_table_m[EdgeType][cont][ZDim] = Centering(positions[z][cont]); + centering_table_m[EdgeType][cont][XDim|ZDim] = Centering(combine(positions[x][cont], positions[z][cont])); + } +} +template class CanonicalCentering<2>;
20090706-1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dg-torture.exp =================================================================== --- dg-torture.exp (nonexistent) +++ dg-torture.exp (revision 338) @@ -0,0 +1,7 @@ +# This harness is for tests that should be run at all optimisation levels. + +load_lib g++-dg.exp + +dg-init +gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.C $srcdir/c-c++-common/torture/*.c]] "" +dg-finish Index: pr40102.C =================================================================== --- pr40102.C (nonexistent) +++ pr40102.C (revision 338) @@ -0,0 +1,41 @@ +/* { dg-do compile } */ +bool foo0(int) { return true; } + +bool foo1(); + +struct A +{ + A(); + ~A(); + + template void bar1(T f) + { + if (f(0)) + foo1(); + } + + template void bar2(T); +}; + +template void A::bar2(T f) +{ + A a, b[1], *p; + + while (foo1()) + { + if (p) + ++p; + if (p && foo1()) + bar1(f); + if (p) + ++p; + } + + if (foo1()) + bar1(f); +} + +void baz() +{ + A().bar2(foo0); +}
pr40102.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr40321.C =================================================================== --- pr40321.C (nonexistent) +++ pr40321.C (revision 338) @@ -0,0 +1,25 @@ +/* { dg-do compile } */ + +struct VectorD2 +{ + VectorD2() : x(0), y(0) { } + VectorD2(int _x, int _y) : x(_x), y(_y) { } + int x, y; + int GetLength2() const { return x*x + y*y; }; + VectorD2 operator+(const VectorD2 vec) const { + return VectorD2(x+vec.x,y+vec.y); + } +}; +struct Shape +{ + enum Type { ST_RECT, ST_CIRCLE } type; + VectorD2 pos; + VectorD2 radius; + bool CollisionWith(const Shape& s) const; +}; +bool Shape::CollisionWith(const Shape& s) const +{ + if(type == ST_CIRCLE && s.type == ST_RECT) + return s.CollisionWith(*this); + return (pos + s.pos).GetLength2() < (radius + s.radius).GetLength2(); +}
pr40321.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr40323.C =================================================================== --- pr40323.C (nonexistent) +++ pr40323.C (revision 338) @@ -0,0 +1,68 @@ +/* Testcase for PR 40323. */ +/* { dg-do compile } */ +/* { dg-options "-fno-early-inlining" } */ +/* { dg-add-options bind_pic_locally } */ + +extern void do_something (const char *, int); + +class Parent +{ +private: + const char *data; + +public: + Parent (const char *d) : data(d) + {} + + int funcOne (int delim) const; +}; + +class AnotherParent +{ +private: + double d; +public: + AnotherParent (void) : d(0) + {} +}; + + +class Child : public AnotherParent, Parent +{ +private: + int zzz; +public: + Child (const char *d) : Parent(d) + {} +}; + + +int Parent::funcOne (int delim) const +{ + int i; + for (i = 0; i < delim; i++) + do_something(data, i); + + return 1; +} + +int docalling (int (Child::* f)(int delim) const) +{ + Child S ("muhehehe"); + + return (S.*f)(4); +} + +typedef int (Parent::* my_mp_type)(int delim); + +int main (int argc, char *argv[]) +{ + int i; + int (Parent::* f)(int ) const; + int (Child::* g)(int ) const; + + f = &Parent::funcOne; + g = (int (Child::* )(int) const) f; + i = docalling (g); + return i; +}
pr40323.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr32304.C =================================================================== --- pr32304.C (nonexistent) +++ pr32304.C (revision 338) @@ -0,0 +1,9 @@ +// { dg-do compile } + +struct S { + S() {} +}; +S f() { + static S s; + return s; +}
pr32304.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr34222.C =================================================================== --- pr34222.C (nonexistent) +++ pr34222.C (revision 338) @@ -0,0 +1,65 @@ +/* { dg-do compile } */ + +namespace std __attribute__ ((__visibility__ ("default"))) { + template struct char_traits; + } +__extension__ typedef __PTRDIFF_TYPE__ ptrdiff_t; +namespace std __attribute__ ((__visibility__ ("default"))) { + typedef ptrdiff_t streamsize; + template > class basic_ifstream; + typedef basic_ifstream ifstream; + class ios_base { + }; + } +template class Vector4 { + public: + inline Vector4(); + inline Vector4(T, T, T, T); + T x, y, z, w; + }; +template class Matrix4 { + public: + Matrix4(const Vector4&, const Vector4&, const Vector4&, const Vector4&); + Matrix4(const Matrix4& m); + Vector4 r[4]; + }; +typedef Vector4 Vec4f; +typedef Matrix4 Mat4f; +template Vector4::Vector4() : x(0), y(0), z(0), w(0) { + } +template Vector4::Vector4(T _x, T _y, T _z, T _w) : x(_x), y(_y), z(_z), w(_w) { + } +template Matrix4::Matrix4(const Vector4& v0, const Vector4& v1, const Vector4& v2, const Vector4& v3) { + } +namespace std __attribute__ ((__visibility__ ("default"))) { + template class basic_ios : public ios_base { + }; + template class basic_istream : virtual public basic_ios<_CharT, _Traits> { + public: + typedef _CharT char_type; + typedef basic_istream<_CharT, _Traits> __istream_type; + __istream_type& read(char_type* __s, streamsize __n); + }; + template class basic_ifstream : public basic_istream<_CharT, _Traits> { + }; + } +using namespace std; +static float readFloat(ifstream& in) { + float f; + in.read((char*) &f, sizeof(float)); + } +Mat4f readMeshMatrix(ifstream& in, int nBytes) { + float m00 = readFloat(in); + float m01 = readFloat(in); + float m02 = readFloat(in); + float m10 = readFloat(in); + float m11 = readFloat(in); + float m12 = readFloat(in); + float m20 = readFloat(in); + float m21 = readFloat(in); + float m22 = readFloat(in); + float m30 = readFloat(in); + float m31 = readFloat(in); + float m32 = readFloat(in); + return Mat4f(Vec4f(m00, m01, m02, 0), Vec4f(m10, m11, m12, 0), Vec4f(m20, m21, m22, 0), Vec4f(m30, m31, m32, 1)); + }
pr34222.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr34241.C =================================================================== --- pr34241.C (nonexistent) +++ pr34241.C (revision 338) @@ -0,0 +1,18 @@ +/* { dg-do compile } */ + +inline void *operator new (__SIZE_TYPE__, void *__p) throw () +{ + return __p; +} +struct A +{ + A(int, double); + inline explicit A (int pattern, bool cs) + { + new (this) A (pattern, double(cs)); + } +}; +A test () +{ + const A a (42, true); +}
pr34241.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr43611.C =================================================================== --- pr43611.C (nonexistent) +++ pr43611.C (revision 338) @@ -0,0 +1,22 @@ +// { dg-do compile } +// { dg-options "-fkeep-inline-functions" } + +template < typename > +struct A { + void init (int); + A () + { + this->init (0); + } +}; + +template < typename > +struct B : A < int > { + A < int > a; + B () {} +}; + +extern template struct A < int >; +extern template struct B < int >; + +B < int > b;
pr43611.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr40642.C =================================================================== --- pr40642.C (nonexistent) +++ pr40642.C (revision 338) @@ -0,0 +1,26 @@ +// { dg-do compile } +// { dg-options "-fprofile-generate" } + +// GCC used to ICE with some EH edge missing. + +inline void* operator new(__SIZE_TYPE__, void* p) throw() { return p; } +inline void operator delete (void*, void*) throw() { } + +template void foo(void* p, T t) +{ + new(p) T(t); +} + +void bar(); + +template struct A +{ + T* p; + + A() { try { foo(p, T()); } catch(...) {} } + + A(const A&) { try { bar(); } catch(...) { throw; } } +}; + +A > a; +
pr40642.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr44900.C =================================================================== --- pr44900.C (nonexistent) +++ pr44900.C (revision 338) @@ -0,0 +1,76 @@ +/* { dg-do run { target i?86-*-* x86_64-*-* } } */ +/* { dg-options "-msse" } */ +/* { dg-require-effective-target sse } */ + +typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__)); +typedef float __v4sf __attribute__ ((__vector_size__ (16))); + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, +__artificial__)) +_mm_set_ps (const float __Z, const float __Y, const float __X, const float __W) +{ + return __extension__ (__m128)(__v4sf){ __W, __X, __Y, __Z }; +} + +struct vec +{ + union { + __m128 v; + float e[4]; + }; + + static const vec & zero() + { + static const vec v = _mm_set_ps(0, 0, 0, 0); + return v; + } + + vec() {} + vec(const __m128 & a) : v(a) {} + + operator const __m128&() const { return v; } +}; + +struct vec2 +{ + vec _v1; + vec _v2; + + vec2() {} + vec2(const vec & a, const vec & b) : _v1(a), _v2(b) {} + + static vec2 load(const float * a) + { + return vec2( + __builtin_ia32_loadups(&a[0]), + __builtin_ia32_loadups(&a[4])); + } + + const vec & v1() const { return _v1; } + const vec & v2() const { return _v2; } +}; + +extern "C" void abort(void); + + +inline bool operator==(const vec & a, const vec & b) +{ return 0xf == __builtin_ia32_movmskps(__builtin_ia32_cmpeqps(a, b)); } + +int main( int argc, char * argv[] ) +{ + __attribute__((aligned(16))) float data[] = + { 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5 }; + + float * p = &data[2]; + vec2 a; + + a = vec2::load(p); + + vec v1 = a.v1(); + vec v2 = a.v2(); + + if (v2.e[3] != 7.0) + abort(); + + return 0; +}
pr44900.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr41273.C =================================================================== --- pr41273.C (nonexistent) +++ pr41273.C (revision 338) @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-g" } */ + +long *H2_ipX_ener_sort; +double H2_old_populations[2]; +double H2_total; + +void H2_LevelPops() +{ + double sum_pop = 0.; + long nEner = 0; + while( nEner < 3 && sum_pop/H2_total < 0.99999 ) + { + long ip = H2_ipX_ener_sort[nEner]; + sum_pop += H2_old_populations[ip]; + ++nEner; + } +}
pr41273.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr42462.C =================================================================== --- pr42462.C (nonexistent) +++ pr42462.C (revision 338) @@ -0,0 +1,47 @@ +/* { dg-do run } */ + +#define INLINE inline __attribute__((always_inline)) +extern "C" void abort (void); + +template struct Foo { + inline bool isFalse() { return false; } + template void f1() {} + template INLINE void f2() { f1(); } + template void f3() { f2(); } + template INLINE void f4() { f3(); } + int exec2(); + void execute(); + inline void unused(); +}; + +template inline void Foo::unused() { + f4(); +} + +static int counter = 0; + +template int Foo::exec2() { + static void* table[2] = { &&begin, &&end }; + if (counter++ > 10) + return 0; + goto *(table[0]); +begin: + if (isFalse()) f1(); +end: + return 1; +} + +template void Foo::execute() { + int r = 1; + while (r) { r = exec2(); } +} + +template class Foo; + +int main() { + Foo c; + c.execute(); + if (counter < 10) + abort (); + return 0; +}
pr42462.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr42183.C =================================================================== --- pr42183.C (nonexistent) +++ pr42183.C (revision 338) @@ -0,0 +1,51 @@ +// { dg-do compile } + +class IntSize { +public: + IntSize(int width, int height) : m_width(width), m_height(height) { } + int m_width, m_height; +}; +class IntPoint { +public: + IntPoint(int x, int y) : m_x(x), m_y(y) { } + int m_x, m_y; +}; +class IntRect { +public: + IntRect(int x, int y, int width, int height) + : m_location(IntPoint(x, y)), m_size(IntSize(width, height)) { } + void intersect(const IntRect&); + IntPoint m_location; + IntSize m_size; +}; +inline IntRect intersection(const IntRect& a, const IntRect& b) { + IntRect c = a; + c.intersect(b); + return c; +} +class RenderObject { +public: + int contentWidth() const { } + int contentHeight() const { } + virtual int xPos() const { } + virtual int yPos() const { } + virtual int paddingTop() const; + virtual int paddingLeft() const; + virtual int borderTop() const { } + virtual int borderLeft() const { } +}; +class RenderMenuList : public RenderObject { + virtual IntRect controlClipRect(int tx, int ty) const; + RenderObject* m_innerBlock; +}; +IntRect RenderMenuList::controlClipRect(int tx, int ty) const { + IntRect outerBox(tx + borderLeft() + paddingLeft(), + ty + borderTop() + paddingTop(), + contentWidth(), contentHeight()); + IntRect innerBox(tx + m_innerBlock->xPos() + m_innerBlock->paddingLeft(), + ty + m_innerBlock->yPos() + m_innerBlock->paddingTop(), + m_innerBlock->contentWidth(), + m_innerBlock->contentHeight()); + return intersection(outerBox, innerBox); +} +
pr42183.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr34641.C =================================================================== --- pr34641.C (nonexistent) +++ pr34641.C (revision 338) @@ -0,0 +1,177 @@ +// { dg-do compile } +// { dg-require-effective-target fpic } +// { dg-require-visibility "" } +// { dg-options "-fPIC" } + + +typedef __SIZE_TYPE__ size_t; +extern "C" void * +malloc (size_t __size) +throw () __attribute__ ((__malloc__)); + namespace std __attribute__ ((__visibility__ ("default"))) +{ + using::size_t; +} +inline void *operator +new (std::size_t, void *__p) +throw () +{ + return __p; +} +template < class _T1, class _T2 > struct pair +{ + _T1 first; + _T2 second; + pair (const _T1 & __a, const _T2 & __b):first (__a), second (__b) + { + } + template < class _U1, class _U2 > + pair (const pair < _U1, _U2 > &__p):first (__p.first), second (__p.second) + { + } +}; + +template < class _T1, class _T2 > + inline pair < _T1, _T2 > make_pair (_T1 __x, _T2 __y) +{ + return pair < _T1, _T2 > (__x, __y); +} +template < typename _Tp > inline const _Tp & +max (const _Tp & __a, const _Tp & __b) +{ +} +typedef unsigned short int uint16_t; +typedef unsigned long int uintptr_t; +typedef uint16_t UChar; +namespace std __attribute__ ((__visibility__ ("default"))) +{ + struct __numeric_limits_base + { + }; + template < typename _Tp > struct numeric_limits:public __numeric_limits_base + { + static _Tp max () throw () + { + } + }; +} + +template < typename T > class VectorBufferBase +{ +public: + void allocateBuffer (size_t newCapacity) + { + if (newCapacity > std::numeric_limits < size_t >::max () / sizeof (T)) + *(int *) (uintptr_t) 0xbbadbeef = 0; + } +}; + +template < typename T, size_t inlineCapacity > class VectorBuffer; +template < typename T > class VectorBuffer < T, 0 >:private VectorBufferBase < + T > +{ +public: + typedef VectorBufferBase < T > Base; + using Base::allocateBuffer; +}; + +template < typename T, size_t inlineCapacity = 0 > class Vector +{ + typedef VectorBuffer < T, inlineCapacity > Impl; +public: + typedef T *iterator; + size_t size () const + { + return m_size; + } + size_t capacity () const + { + } + iterator begin () + { + } + iterator end () + { + return begin () + m_size; + } + void shrink (size_t size); + void reserveCapacity (size_t newCapacity); + void clear () + { + shrink (0); + } + template < typename U > void append (const U &); + void expandCapacity (size_t newMinCapacity); + template < typename U > U * expandCapacity (size_t newMinCapacity, U *); + size_t m_size; + Impl m_impl; +}; +template < typename T, size_t inlineCapacity > + void Vector < T, inlineCapacity >::expandCapacity (size_t newMinCapacity) +{ + reserveCapacity (max + (newMinCapacity, + max (static_cast < size_t > (16), + capacity () + capacity () / 4 + 1))); +} + +template < typename T, size_t inlineCapacity > + template < typename U > + inline U * Vector < T, + inlineCapacity >::expandCapacity (size_t newMinCapacity, U * ptr) +{ + expandCapacity (newMinCapacity); +} +template < typename T, size_t inlineCapacity > + void Vector < T, inlineCapacity >::reserveCapacity (size_t newCapacity) +{ + m_impl.allocateBuffer (newCapacity); +} +template < typename T, size_t inlineCapacity > + template < typename U > + inline void Vector < T, inlineCapacity >::append (const U & val) +{ + const U *ptr = &val; + if (size () == capacity ()) + ptr = expandCapacity (size () + 1, ptr); + new (end ())T (*ptr); +} + +class Range; +class TextIterator +{ +public: + explicit TextIterator (const Range *, + bool emitCharactersBetweenAllVisiblePositions = + false); + bool atEnd () const + { + } + void advance (); + int length () const + { + } +}; +UChar * +plainTextToMallocAllocatedBuffer (const Range * r, unsigned &bufferLength) +{ + static const unsigned cMaxSegmentSize = 1 << 16; + typedef pair < UChar *, unsigned >TextSegment; + Vector < TextSegment > *textSegments = 0; + Vector < UChar > textBuffer; + for (TextIterator it (r); !it.atEnd (); it.advance ()) + { + if (textBuffer.size () + && textBuffer.size () + it.length () > cMaxSegmentSize) + { + UChar *newSegmentBuffer = + static_cast < + UChar * >(malloc (textBuffer.size () * sizeof (UChar))); + if (!textSegments) + textSegments = new Vector < TextSegment >; + textSegments-> + append (make_pair (newSegmentBuffer, textBuffer.size ())); + textBuffer.clear (); + } + } +}
pr34641.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr42760.C =================================================================== --- pr42760.C (nonexistent) +++ pr42760.C (revision 338) @@ -0,0 +1,46 @@ +// PR middle-end/42760 +// { dg-do compile } + +template +struct A +{ + static T b (T it) { return it; } +}; + +template +static U +baz (T x, T y, U z) +{ + for (long n = y - x; n > 0; --n) + { + *z = *x; + ++z; + } +}; + +template +U +bar (T x, T y, U z) +{ + baz (A ::b (x), A ::b (y), A ::b (z)); +} + +struct C +{ + __complex__ float v; +}; + +template +struct B +{ + B (T y[]) { bar (y, y + 1, x); } + operator T *() { return x; } + T x[1]; +}; + +B +foo () +{ + C y[1]; + return B (y); +};
pr42760.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr32563.C =================================================================== --- pr32563.C (nonexistent) +++ pr32563.C (revision 338) @@ -0,0 +1,8 @@ +/* { dg-do compile } */ + +struct A +{ + char c[1]; +} a; + +const __SIZE_TYPE__ i = (__SIZE_TYPE__)&a.c[0] - 1;
pr32563.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr36444.C =================================================================== --- pr36444.C (nonexistent) +++ pr36444.C (revision 338) @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +#define vector __attribute__((vector_size(16) )) +struct struct1 { + union {} vmx; + struct struct2 { + struct2(const struct2& r) {} + } w; +} __attribute__((aligned(16))); +struct struct3 { + vector float vmx; + operator const struct1& () const{ + return *reinterpret_cast(this); + } +}; +struct3 func3( struct3 V1); +struct3 func2( void ); +void func1( ) { + struct1 vVec = func2() ; + func3 ( (struct3&)vVec ); +} +
pr36444.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr33735.C =================================================================== --- pr33735.C (nonexistent) +++ pr33735.C (revision 338) @@ -0,0 +1,21 @@ +// { dg-do compile } +#include +typedef struct _ts { } PyThreadState; +PyThreadState * Py_NewInterpreter(void); +void Py_EndInterpreter(PyThreadState *); +class ApplicationError { +public: + ApplicationError(std::string errormsg) : errormsg(errormsg) { } + std::string errormsg; +}; +void run() +{ + PyThreadState *py_state=__null; + try { + if (!(py_state=Py_NewInterpreter())) + throw ApplicationError("error"); + } + catch(ApplicationError e) { + Py_EndInterpreter(py_state); + } +}
pr33735.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr43257.C =================================================================== --- pr43257.C (nonexistent) +++ pr43257.C (revision 338) @@ -0,0 +1,30 @@ +/* { dg-do assemble } */ + +class A {}; +class B {}; + +static void *func (int n) +{ + void *p; + if (p == 0) throw ::A (); +} + +static void *func (int n, B const &) +{ + try { + return func (n); + } + catch (::A const &) { + } + return func (n); +} + +void *f1 (int n) +{ + return func (n, B()); +} + +void *f2 (int n) +{ + return func (n, B()); +}
pr43257.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr37354.C =================================================================== --- pr37354.C (nonexistent) +++ pr37354.C (revision 338) @@ -0,0 +1,14 @@ +/* { dg-do compile } */ + +class GenericClass; +struct AlsaDriver +{ + virtual int _read (unsigned nframes); +}; +typedef void (GenericClass::*GenericMemFuncType) (); +GenericMemFuncType m_pFunction; +void AlsaDriver1 () +{ + m_pFunction = reinterpret_cast < GenericMemFuncType > (&AlsaDriver::_read); +} +
pr37354.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr39713.C =================================================================== --- pr39713.C (nonexistent) +++ pr39713.C (revision 338) @@ -0,0 +1,25 @@ +/* { dg-do compile } */ + +template +static inline To +bitwise_cast (From from) +{ + union + { + From f; + To t; + } u; + u.f = from; + return u.t; +} + +extern void foo (unsigned char *); + +double +bar () +{ + unsigned char b[sizeof (unsigned long long)]; + foo (b); + return bitwise_cast (*(unsigned long long *) b); +} +
pr39713.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr38705.C =================================================================== --- pr38705.C (nonexistent) +++ pr38705.C (revision 338) @@ -0,0 +1,27 @@ +// PR c++/38705 +// { dg-do compile } + +typedef int T; +typedef __SIZE_TYPE__ size_t; +extern "C" void *memcpy (void *, const void *, size_t); + +void +foo (char *p, const int q) +{ + memcpy (p, &q, sizeof (int)); +} + +struct S +{ + T t; + int u; + int bar () const; + template void foo (const T &x) const {} +}; + +int +S::bar () const +{ + foo (u); + foo (t); +}
pr38705.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr40388.C =================================================================== --- pr40388.C (nonexistent) +++ pr40388.C (revision 338) @@ -0,0 +1,21 @@ +void foo(); + +struct A +{ + ~A() + { + try + { + foo(); + foo(); + } + catch (...) + { + } + } +}; + +void bar() +{ + A a1, a2; +}
pr40388.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr44069.C =================================================================== --- pr44069.C (nonexistent) +++ pr44069.C (revision 338) @@ -0,0 +1,25 @@ +/* { dg-do run } */ + +template +class M { +public: + M(const int* arr) { + for (unsigned long r = 0; r < R; ++r) + for (unsigned long c = 0; c < C; ++c) + m[r*C+c] = arr[r*C+c]; + } + int operator()(unsigned r, unsigned c) const + { return m[r*C+c]; } +private: + int m[R*C]; +}; +extern "C" void abort (void); +int main() +{ + int vals[2][2] = { { 1, 2 }, { 5, 6 } }; + M<2,2> m( &(vals[0][0]) ); + if (m(1,0) != 5) + abort (); + return 0; +} +
pr44069.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr39732.C =================================================================== --- pr39732.C (nonexistent) +++ pr39732.C (revision 338) @@ -0,0 +1,29 @@ +/* { dg-do compile } */ +/* { dg-options "-fprofile-generate" } */ + +template struct char_traits; +template +_OI __copy_move_a2(_OI __result); +template inline _OI +copy(_OI __result) +{ + return __copy_move_a2 (__result); +} +template +class basic_ostream { }; +template > +class ostream_iterator { + typedef basic_ostream<_CharT, _Traits> ostream_type; + ostream_type* _M_stream; + const _CharT* _M_string; +public: + ostream_iterator(ostream_type& __s, const _CharT* __c) + : _M_stream(&__s), _M_string(__c) { } + ostream_iterator(const ostream_iterator& __obj) + : _M_stream(__obj._M_stream), _M_string(__obj._M_string) { } +}; +int f(void) +{ + basic_ostream > os; + copy(ostream_iterator(os, ",")); +}
pr39732.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr37716.C =================================================================== --- pr37716.C (nonexistent) +++ pr37716.C (revision 338) @@ -0,0 +1,56 @@ +// PR tree-optimization/37716 +// { dg-do compile } + +struct A +{ + struct B + { + int a, b, c, d; + void *e[1]; + }; + B *d; + inline void **f1 (int i) const + { + return d->e + d->c + i; + } +}; + +template +struct C +{ + struct D + { + void *v; + inline T & f3 () + { + return *reinterpret_cast (this); + } + }; + union + { + A p; + A::B *d; + }; + T & operator[](int i) + { + if (d->a != 1) + f2 (); + return reinterpret_cast (p.f1 (i))->f3 (); + } + void f2 (); + void f3 (int i, const T & t); +}; + +class E +{ + int e, f; +}; + +C c; + +void +foo (int x) +{ + E e = c[x]; + c.f3 (x, e); +}
pr37716.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr41775.C =================================================================== --- pr41775.C (nonexistent) +++ pr41775.C (revision 338) @@ -0,0 +1,284 @@ +/* { dg-do compile } */ +/* { dg-require-visibility "" } */ + +typedef unsigned int size_t; +namespace std __attribute__ ((__visibility__ ("default"))) +{ + template < typename _Iterator > struct iterator_traits + { + }; + template < typename _Tp > struct iterator_traits <_Tp * > + { + typedef _Tp & reference; + }; +} + +namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) +{ + using std::iterator_traits; + template < typename _Iterator, typename _Container > class __normal_iterator + { + public:typedef _Iterator iterator_type; + typedef typename iterator_traits < _Iterator >::reference reference; + reference operator* () const + { + } + __normal_iterator operator++ (int) + { + } + }; + template < typename _IteratorL, typename _IteratorR, + typename _Container > inline bool operator!= (const __normal_iterator < + _IteratorL, + _Container > &__lhs, + const __normal_iterator < + _IteratorR, + _Container > &__rhs) + { + } +} + +extern "C" +{ + extern "C" + { + __extension__ typedef __SIZE_TYPE__ __intptr_t; + } +} +namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) +{ + template < typename _Tp > class new_allocator + { + public:typedef size_t size_type; + typedef _Tp *pointer; + template < typename _Tp1 > struct rebind + { + typedef new_allocator < _Tp1 > other; + }; + }; +} + +namespace std __attribute__ ((__visibility__ ("default"))) +{ +template < typename _Tp > class allocator:public __gnu_cxx::new_allocator < + _Tp > + { + }; +} + +extern "C" +{ + typedef __intptr_t intptr_t; +} +namespace llvm +{ + template < typename NodeTy > class ilist_half_node + { + }; +template < typename NodeTy > class ilist_node:private ilist_half_node < + NodeTy > + { + }; + class MachineBasicBlock; + class MachineOperand + { + public:enum MachineOperandType + { + } + Contents; + unsigned getReg () const + { + } + }; + class TargetRegisterInfo; +} + +namespace std __attribute__ ((__visibility__ ("default"))) +{ + template < typename _Tp, typename _Alloc > struct _Vector_base + { + typedef typename _Alloc::template rebind < _Tp >::other _Tp_alloc_type; + }; +template < typename _Tp, typename _Alloc = std::allocator < _Tp > >class vector:protected _Vector_base < _Tp, + _Alloc + > + { + typedef _Vector_base < _Tp, _Alloc > _Base; + typedef typename _Base::_Tp_alloc_type _Tp_alloc_type; + public:typedef _Tp value_type; + typedef typename _Tp_alloc_type::pointer pointer; + typedef __gnu_cxx::__normal_iterator < pointer, vector > iterator; + iterator begin () + { + } + iterator end () + { + } + }; +} + +namespace llvm +{ + class MachineFunction; + class MachineInstr:public ilist_node < MachineInstr > + { + public:const MachineBasicBlock *getParent () const + { + } + const MachineOperand & getOperand (unsigned i) const + { + } + bool registerDefIsDead (unsigned Reg, const TargetRegisterInfo * TRI = + __null) const + { + } + }; + class AnalysisResolver; + class Pass + { + AnalysisResolver *Resolver; + intptr_t PassID; + public: explicit Pass (intptr_t pid):Resolver (0), PassID (pid) + { + } + explicit Pass (const void *pid):Resolver (0), PassID ((intptr_t) pid) + { + } + template < typename AnalysisType > AnalysisType & getAnalysis () const; + }; + class FunctionPass:public Pass + { + public:explicit FunctionPass (intptr_t pid):Pass (pid) + { + } + explicit FunctionPass (const void *pid):Pass (pid) + { + } + }; + class PassInfo + { + public:typedef Pass *(*NormalCtor_t) (); + private:const char *const PassName; + const char *const PassArgument; + const intptr_t PassID; + const bool IsCFGOnlyPass; + const bool IsAnalysis; + const bool IsAnalysisGroup; + NormalCtor_t NormalCtor; + public: PassInfo (const char *name, const char *arg, intptr_t pi, NormalCtor_t normal = 0, bool isCFGOnly = false, bool is_analysis = false):PassName (name), PassArgument (arg), PassID (pi), + IsCFGOnlyPass (isCFGOnly), IsAnalysis (is_analysis), + IsAnalysisGroup (false), NormalCtor (normal) + { + } + }; + template < typename PassName > Pass * callDefaultCtor () + { + return new PassName (); + } + template < typename passName > struct RegisterPass:public PassInfo + { + RegisterPass (const char *PassArg, const char *Name, bool CFGOnly = false, bool is_analysis = false):PassInfo (Name, PassArg, intptr_t (&passName::ID), + PassInfo::NormalCtor_t (callDefaultCtor < passName >), CFGOnly, + is_analysis) + { + } + }; + template < typename T > class SmallVectorImpl + { + }; + template < typename T, + unsigned N > class SmallVector:public SmallVectorImpl < T > + { + }; + class MachineFunctionPass:public FunctionPass + { + protected:explicit MachineFunctionPass (intptr_t ID):FunctionPass (ID) + { + } + explicit MachineFunctionPass (void *ID):FunctionPass (ID) + { + } + virtual bool runOnMachineFunction (MachineFunction & MF) = 0; + }; + class LiveIndex + { + private:unsigned index; + }; + class VNInfo + { + }; + struct LiveRange + { + LiveIndex start; + LiveIndex end; + VNInfo *valno; + }; + class LiveInterval + { + public:typedef SmallVector < LiveRange, 4 > Ranges; + bool containsOneValue () const + { + } + LiveRange *getLiveRangeContaining (LiveIndex Idx) + { + } + void removeRange (LiveIndex Start, LiveIndex End, bool RemoveDeadValNo = + false); + void removeRange (LiveRange LR, bool RemoveDeadValNo = false) + { + removeRange (LR.start, LR.end, RemoveDeadValNo); + } + }; + class LiveIntervals:public MachineFunctionPass + { + public:static char ID; + LiveIndex getDefIndex (LiveIndex index) + { + } + LiveInterval & getInterval (unsigned reg) + { + } + LiveIndex getInstructionIndex (const MachineInstr * instr) const + { + } + }; +} + +using namespace llvm; +namespace +{ +struct __attribute__ ((visibility ("hidden"))) StrongPHIElimination:public + MachineFunctionPass + { + static char ID; + StrongPHIElimination ():MachineFunctionPass (&ID) + { + } + bool runOnMachineFunction (MachineFunction & Fn); + }; +} + +static RegisterPass < StrongPHIElimination > X ("strong-phi-node-elimination", + "Eliminate PHI nodes for register allocation, intelligently"); +bool +StrongPHIElimination::runOnMachineFunction (MachineFunction & Fn) +{ + LiveIntervals & LI = getAnalysis < LiveIntervals > (); + std::vector < MachineInstr * >phis; + for (std::vector < MachineInstr * >::iterator I = phis.begin (), E = + phis.end (); I != E;) + { + MachineInstr *PInstr = *(I++); + unsigned DestReg = PInstr->getOperand (0).getReg (); + LiveInterval & PI = LI.getInterval (DestReg); + if (PInstr->registerDefIsDead (DestReg)) + { + if (PI.containsOneValue ()) + { + LiveIndex idx = + LI.getDefIndex (LI.getInstructionIndex (PInstr)); + PI.removeRange (*PI.getLiveRangeContaining (idx), true); + } + } + } +}
pr41775.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr37456.C =================================================================== --- pr37456.C (nonexistent) +++ pr37456.C (revision 338) @@ -0,0 +1,14 @@ +/* { dg-do compile } */ + +int zot(int); +struct bar { + ~bar() { } +}; +int x; +void doit(int a, int b, int c) +{ + bar pn; + int b1 = zot(a) * c; + int b2 = zot(b) * c; + x = b1 + b2; +}
pr37456.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr42883.C =================================================================== --- pr42883.C (nonexistent) +++ pr42883.C (revision 338) @@ -0,0 +1,63 @@ +// { dg-do compile } + +typedef __SIZE_TYPE__ size_t; +namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) { + template class new_allocator { + public: + typedef size_t size_type; + typedef _Tp* pointer; + typedef _Tp& reference; + void deallocate(pointer __p, size_type) { + ::operator delete(__p); + } + }; +} +namespace std __attribute__ ((__visibility__ ("default"))) { + template class allocator: public __gnu_cxx::new_allocator<_Tp> { + public: + template struct rebind { + typedef allocator<_Tp1> other; + }; + }; + template struct _Vector_base { + typedef typename _Alloc::template rebind<_Tp>::other _Tp_alloc_type; + struct _Vector_impl : public _Tp_alloc_type { + typename _Tp_alloc_type::pointer _M_start; + typename _Tp_alloc_type::pointer _M_end_of_storage; + }; + ~_Vector_base() { + _M_deallocate(this->_M_impl._M_start, this->_M_impl._M_end_of_storage - this->_M_impl._M_start); + } + _Vector_impl _M_impl; + void _M_deallocate(typename _Tp_alloc_type::pointer __p, size_t __n) { + if (__p) _M_impl.deallocate(__p, __n); + } + }; + template > class vector : protected _Vector_base<_Tp, _Alloc> { + typedef _Vector_base<_Tp, _Alloc> _Base; + typedef typename _Base::_Tp_alloc_type _Tp_alloc_type; + public: + typedef typename _Tp_alloc_type::reference reference; + typedef size_t size_type; + size_type size() const { + } + reference operator[](size_type __n) { + } + }; +}; +class vtkConvexPointSet { +public: + static vtkConvexPointSet *New(); +}; +void MakeInternalMesh() { + std::vector< int > tempFaces[2]; + std::vector< int > firstFace; + int i, j, k; + for(i = 0; i < 1000; i++) { + for(int pointCount = 0; pointCount < 1000; pointCount++) { + for(j = 0; j < (int)tempFaces[0].size(); k++) + if(tempFaces[0][j] == tempFaces[1][k]) break; + } + vtkConvexPointSet::New(); + } +}
pr42883.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr38745.C =================================================================== --- pr38745.C (nonexistent) +++ pr38745.C (revision 338) @@ -0,0 +1,36 @@ +/* { dg-do compile } */ + +union u_u16 +{ + unsigned short v; + struct + { + unsigned char lo8, hi8; + } __attribute__ ((__may_alias__)) u; +} __attribute__ ((__may_alias__)); +union u_u32 +{ + unsigned int v; + struct + { + u_u16 lo16, hi16; + } u; +} __attribute__ ((__may_alias__)); +union u_u64 +{ + struct + { + u_u32 lo32, hi32; + } u; +}; +struct Record +{ +}; +long long +UnpackFullKey (Record & rec, const char *&p) +{ + long long c64 = 0; + (*(u_u16 *) & (*(u_u32 *) & ( *(u_u64*)&c64).u.lo32.v).u.lo16.v).u.hi8 = 1; + return c64; +} +
pr38745.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr39259.C =================================================================== --- pr39259.C (nonexistent) +++ pr39259.C (revision 338) @@ -0,0 +1,40 @@ +// PR tree-optimization/39259 +// { dg-do compile } +// { dg-options "-O2" } + + +extern "C" int __mysetjmp () __attribute__ ((__returns_twice__)); + +class TContStatus {}; + +class TContEvent +{ +public: + inline void Execute () throw(); +}; + +class TCont +{ +public: + TContStatus ReadD (void* buf, int deadline) + { + TContEvent event; + event.Execute (); + return TContStatus(); + } + TContStatus ReadI (void *buf) + { + return ReadD (buf, 1); + } +}; + +void TContEvent::Execute () throw () +{ + __mysetjmp(); +} + +void Broken (TCont *mCont) +{ + mCont->ReadI(0); + mCont->ReadI(0); +}
pr39259.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr38747.C =================================================================== --- pr38747.C (nonexistent) +++ pr38747.C (revision 338) @@ -0,0 +1,19 @@ +/* { dg-do run } */ + +extern "C" void abort (void); +inline void *operator new (__SIZE_TYPE__, void *__p) throw () { return __p; } + +int __attribute__((noinline)) +foo(void) +{ + float f = 0; + int *i = new (&f) int (1); + return *(int *)&f; +} + +int main() +{ + if (foo() != 1) + abort (); + return 0; +}
pr38747.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr39678.C =================================================================== --- pr39678.C (nonexistent) +++ pr39678.C (revision 338) @@ -0,0 +1,26 @@ +/* PR target/39678 */ +/* { dg-do run } */ +/* { dg-options "-Wno-psabi" } */ +struct Y {}; +struct X { + struct Y y; + __complex__ float val; +}; + +struct X __attribute__((noinline)) +foo (float *p) +{ + struct X x; + __real x.val = p[0]; + __imag x.val = p[1]; + return x; +} +extern "C" void abort (void); +float a[2] = { 3., -2. }; +int main() +{ + struct X x = foo(a); + if (__real x.val != 3. || __imag x.val != -2.) + abort (); + return 0; +}
pr39678.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr42110.C =================================================================== --- pr42110.C (nonexistent) +++ pr42110.C (revision 338) @@ -0,0 +1,27 @@ +/* { dg-do compile } */ +bool foo(); + +struct A +{ + A* fooA() { if (foo()) foo(); return this; } + + virtual void barA(char); +}; + +template struct B +{ + A *p, *q; + + void fooB(char c) { p->fooA()->barA(c); } +}; + +template inline void bar(B b) { b.fooB(0); } + +extern template void bar(B<0>); + +void (*f)(B<0>) = bar; + +void baz() +{ + B<0>().fooB(0); +}
pr42110.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr31081-2.C =================================================================== --- pr31081-2.C (nonexistent) +++ pr31081-2.C (revision 338) @@ -0,0 +1,48 @@ +/* { dg-do compile } */ + +class CString +{ +public: + CString(); + ~CString() { operator delete(_rep); } + operator const char*() const { return _rep; } +private: + CString(char* cstr); + char* _rep; +}; + +class String +{ +public: + + String(); + String(const char* str); + ~String(); + CString getCString() const; +}; + +int is_absolute_path(const char *path); + +inline void getAbsolutePath( + const char* path, + const String& filename) +{ + (!is_absolute_path(filename.getCString()) && path); + return; +} + +int foo(int &value); + +int main(int argc, char** argv) +{ + int repeatTestCount = 0; + if (foo(repeatTestCount)) + { + repeatTestCount = 1; + } + for (int numTests = 1; numTests <= repeatTestCount; numTests++) + { + getAbsolutePath("blah", "blah"); + } + return 0; +}
pr31081-2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr30252.C =================================================================== --- pr30252.C (nonexistent) +++ pr30252.C (revision 338) @@ -0,0 +1,226 @@ +/* { dg-do run } */ +/* { dg-options "-fstrict-aliasing" } */ + +extern "C" void abort (void); +namespace sigc { + template + struct type_trait + { + typedef T_type& pass; + typedef const T_type& take; + typedef T_type* pointer; + }; + template + struct is_base_and_derived + { + struct big { + char memory[64]; + }; + static big is_base_class_(...); + static char is_base_class_(typename type_trait::pointer); + static const bool value = + sizeof(is_base_class_(reinterpret_cast::pointer>(0))) == + sizeof(char); + }; + struct nil; + struct functor_base {}; + template ::value> + struct functor_trait + { + }; + template + struct functor_trait + { + typedef typename T_functor::result_type result_type; + typedef T_functor functor_type; + }; + template + class pointer_functor1 : public functor_base + { + typedef T_return (*function_type)(T_arg1); + function_type func_ptr_; + public: + typedef T_return result_type; + explicit pointer_functor1(function_type _A_func): func_ptr_(_A_func) {} + T_return operator()(typename type_trait::take _A_a1) const + { return func_ptr_(_A_a1); } + }; + template + inline pointer_functor1 + ptr_fun1(T_return (*_A_func)(T_arg1)) + { return pointer_functor1(_A_func); } + struct adaptor_base : public functor_base {}; + template ::value> + struct deduce_result_type + { typedef typename functor_trait::result_type type; }; + template + struct adaptor_functor : public adaptor_base + { + template + struct deduce_result_type + { typedef typename sigc::deduce_result_type::type type; }; + typedef typename functor_trait::result_type result_type; + result_type + operator()() const; + template + typename deduce_result_type::type + operator()(T_arg1 _A_arg1) const + { return functor_(_A_arg1); } + explicit adaptor_functor(const T_functor& _A_functor) + : functor_(_A_functor) + {} + mutable T_functor functor_; + }; + template + typename adaptor_functor::result_type + adaptor_functor::operator()() const + { return functor_(); } + template ::value> struct adaptor_trait; + template + struct adaptor_trait + { + typedef T_functor adaptor_type; + }; + template + struct adaptor_trait + { + typedef typename functor_trait::functor_type functor_type; + typedef adaptor_functor adaptor_type; + }; + template + struct adapts : public adaptor_base + { + typedef typename adaptor_trait::adaptor_type adaptor_type; + explicit adapts(const T_functor& _A_functor) + : functor_(_A_functor) + {} + mutable adaptor_type functor_; + }; + template + struct reference_wrapper + { + }; + template + struct unwrap_reference + { + typedef T_type type; + }; + template + class bound_argument + { + public: + bound_argument(const T_type& _A_argument) + : visited_(_A_argument) + {} + inline T_type& invoke() + { return visited_; } + T_type visited_; + }; + template + class bound_argument< reference_wrapper > + { + }; + template + struct bind_functor; + template + struct bind_functor<-1, T_functor, T_type1> : public adapts + { + typedef typename adapts::adaptor_type adaptor_type; + typedef typename adaptor_type::result_type result_type; + result_type + operator()() + { + return this->functor_.template operator()::type>::pass> (bound1_.invoke()); + } + bind_functor(typename type_trait::take _A_func, typename type_trait::take _A_bound1) + : adapts(_A_func), bound1_(_A_bound1) + {} + bound_argument bound1_; + }; + template + inline bind_functor<-1, T_functor, + T_type1> + bind(const T_functor& _A_func, T_type1 _A_b1) + { return bind_functor<-1, T_functor, + T_type1> + (_A_func, _A_b1); + } + namespace internal { + struct slot_rep; + typedef void* (*hook)(slot_rep *); + struct slot_rep + { + hook call_; + }; + } + class slot_base : public functor_base + { + public: + typedef internal::slot_rep rep_type; + explicit slot_base(rep_type* rep) + : rep_(rep) + { + } + mutable rep_type *rep_; + }; + namespace internal { + template + struct typed_slot_rep : public slot_rep + { + typedef typename adaptor_trait::adaptor_type adaptor_type; + adaptor_type functor_; + inline typed_slot_rep(const T_functor& functor) + : functor_(functor) + { + } + }; + template + struct slot_call0 + { + static void *call_it(slot_rep* rep) + { + typedef typed_slot_rep typed_slot; + typed_slot *typed_rep = static_cast(rep); + return (typed_rep->functor_)(); + } + static hook address() + { + return &call_it; + } + }; + } + + class slot0 : public slot_base + { + public: + typedef void * (*call_type)(rep_type*); + inline void *operator()() const + { + return slot_base::rep_->call_ (slot_base::rep_); + } + template + slot0(const T_functor& _A_func) + : slot_base(new internal::typed_slot_rep(_A_func)) + { + slot_base::rep_->call_ = internal::slot_call0::address(); + } + }; +} +struct A +{ + static void *foo (void *p) { return p; } + typedef sigc::slot0 C; + C bar(); +}; +A::C A::bar () +{ + return sigc::bind (sigc::ptr_fun1 (&A::foo), (void*)0); +} +int main (void) +{ + A a; + if (a.bar ()() != 0) + abort (); +}
pr30252.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr33340.C =================================================================== --- pr33340.C (nonexistent) +++ pr33340.C (revision 338) @@ -0,0 +1,27 @@ +void* operator new(__SIZE_TYPE__, void* __p) { } + +struct auto_ptr { + int* p; + ~auto_ptr() { delete p; } +}; + +typedef void* T; +struct vector { + void push_back(const T& __x) { + ::new(0) T(__x); + insert(__x); + } + void insert(const T& __x); +} v; + +void g(); +void f() { + auto_ptr ap; + if (ap.p) { + ap.p = new int(); + } + g(); + int* tmp = ap.p; + ap.p = 0; + v.push_back(tmp); +}
pr33340.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr41144.C =================================================================== --- pr41144.C (nonexistent) +++ pr41144.C (revision 338) @@ -0,0 +1,23 @@ +/* { dg-do compile } */ + +struct rgba8; +template class span_gouraud { +public: + struct coord_type { }; + coord_type m_coord[3]; +}; +template class span_gouraud_rgba : public span_gouraud +{ + typedef ColorT color_type; + typedef span_gouraud base_type; + typedef typename base_type::coord_type coord_type; +public: + void prepare() { + coord_type coord[3]; + } +}; +void the_application() { + typedef span_gouraud_rgba gouraud_span_gen_type; + gouraud_span_gen_type span_gouraud; + span_gouraud.prepare(); +}
pr41144.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr42450.C =================================================================== --- pr42450.C (nonexistent) +++ pr42450.C (revision 338) @@ -0,0 +1,112 @@ +/* { dg-do compile } */ + +template < typename > class basic_stringstream; + +struct basic_string { + basic_string(); +}; + +struct ios_base { + virtual ~ios_base(); +}; + +class ostream:ios_base {}; +class istream:virtual ios_base {}; + +template < typename > struct basic_iostream:public istream, ostream { + ~basic_iostream () {} +}; +extern template class basic_iostream < char >; + +template < typename > struct basic_stringstream:public basic_iostream < char > { + basic_string _M_stringbuf; + ~basic_stringstream () {} +}; +extern template class basic_stringstream < char >; + +template < typename > struct AnyMatrixBase; +template < typename, int _Rows, int _Cols, int = _Rows, int = _Cols > class Matrix; +template < typename > class CwiseNullaryOp; + +template < typename Derived > struct MatrixBase:public AnyMatrixBase < Derived > { + typedef CwiseNullaryOp < Derived > ConstantReturnType; + ConstantReturnType Constant (); + template < typename > Derived cast (); + static CwiseNullaryOp < Derived > Random (int); +}; + +template < typename Derived > struct AnyMatrixBase { + Derived derived () {} + Derived & derived () const {} +}; + +template < typename, int > struct ei_matrix_storage {}; + +template < typename _Scalar, int, int, int _MaxRows, int _MaxCols > struct Matrix:MatrixBase < Matrix < _Scalar, _MaxRows, _MaxCols > > { + typedef MatrixBase < Matrix > Base; + ei_matrix_storage < int, _MaxCols > m_storage; + Matrix operator= (const Matrix other) { + _resize_to_match (other); + lazyAssign (other.derived ()); + } + template < typename OtherDerived > Matrix lazyAssign (MatrixBase < OtherDerived > other) { + _resize_to_match (other); + return Base (other.derived ()); + } + Matrix (); + template < typename OtherDerived > Matrix (const MatrixBase < OtherDerived > &other) { + *this = other; + } + template < typename OtherDerived > void _resize_to_match (const MatrixBase < OtherDerived > &) { + throw 1; + } +}; + +template < typename MatrixType > class CwiseNullaryOp: +public MatrixBase < CwiseNullaryOp < MatrixType > > {}; + +int f() +{ + bool align_cols; + if (align_cols) { + basic_stringstream sstr; + f(); + } +} + +template < typename > struct AutoDiffScalar; +template < typename Functor > struct AutoDiffJacobian:Functor { + AutoDiffJacobian (Functor); + typedef typename Functor::InputType InputType; + typedef typename Functor::ValueType ValueType; + typedef Matrix < int, Functor::InputsAtCompileTime, 1 > DerivativeType; + typedef AutoDiffScalar < DerivativeType > ActiveScalar; + typedef Matrix < ActiveScalar, Functor::InputsAtCompileTime, 1 > ActiveInput; + void operator () (InputType x, ValueType *) { + ActiveInput ax = x.template cast < ActiveScalar > (); + } +}; + +template < int NX, int NY > struct TestFunc1 { + enum { + InputsAtCompileTime = NX + }; + typedef Matrix < float, NX, 1 > InputType; + typedef Matrix < float, NY, 1 > ValueType; + typedef Matrix < float, NY, NX > JacobianType; + int inputs (); +}; + +template < typename Func > void forward_jacobian (Func f) { + typename Func::InputType x = Func::InputType::Random (f.inputs ()); + typename Func::ValueType y; + typename Func::JacobianType jref = jref.Constant (); + AutoDiffJacobian < Func > autoj (f); + autoj (x, &y); +} + +void test_autodiff_scalar () +{ + forward_jacobian (TestFunc1 < 2, 2 > ()); + forward_jacobian (TestFunc1 < 3, 2 > ()); +}
pr42450.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr43801.C =================================================================== --- pr43801.C (nonexistent) +++ pr43801.C (revision 338) @@ -0,0 +1,22 @@ +// PR tree-optimization/43801 +// { dg-do compile } +// { dg-options "-fipa-cp -fipa-cp-clone" } + +struct A +{ + virtual void f (int); +}; +struct B : virtual A +{ + virtual void f (int i) { if (i) A::f(0); } +}; +struct C : virtual B +{ + virtual void f (int) { B::f(0); } +}; + +void +foo () +{ + C (); +}
pr43801.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr37421.C =================================================================== --- pr37421.C (nonexistent) +++ pr37421.C (revision 338) @@ -0,0 +1,39 @@ +/* { dg-do compile } */ + +#include +#include + +inline int +bci (const float &source) +{ + int dest; + memcpy (&dest, &source, sizeof (dest)); + return dest; +} + +inline float +bcf (const int &source) +{ + float dest; + memcpy (&dest, &source, sizeof (dest)); + return dest; +} + +float +Foo () +{ + const int foo = bci (0.0f); + int bar = foo; + const int baz = foo & 1; + if (!baz && (foo & 2)) + bar = 0; + return bcf (bar); +} + +int +main () +{ + printf ("Foo() = %f\n", Foo()); + return 0; +} +
pr37421.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr34235.C =================================================================== --- pr34235.C (nonexistent) +++ pr34235.C (revision 338) @@ -0,0 +1,11 @@ +/* { dg-do run } */ + +extern "C" void abort (void); +int main() +{ + short x = -1; + unsigned int c = ((unsigned int)x) >> 1; + if (c != 0x7fffffff) + abort(); + return 0; +}
pr34235.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr35164-2.C =================================================================== --- pr35164-2.C (nonexistent) +++ pr35164-2.C (revision 338) @@ -0,0 +1,27 @@ +struct __shared_count { + __shared_count() { _M_pi = new int; } + int * _M_pi; +}; +template +class __shared_ptr { +public: + __shared_ptr(_Tp* __p); + void reset(int * __p) { + __shared_ptr(__p).swap(*this); + } + void swap(__shared_ptr<_Tp>& __other) { + __other._M_refcount._M_pi = _M_refcount._M_pi; + } + __shared_count _M_refcount; +}; +template class shared_ptr : public __shared_ptr<_Tp> {}; +int main() { + for (shared_ptr *iter;;) + { + try { + (iter++)->reset(new int); + } + catch (...) { + } + } +}
pr35164-2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr42714.C =================================================================== --- pr42714.C (nonexistent) +++ pr42714.C (revision 338) @@ -0,0 +1,37 @@ +struct QVectorData { + static QVectorData shared_null; +}; +template class QVector { + union { + QVectorData *d; + }; +public: + inline QVector() : d(&QVectorData::shared_null) { } + inline QVector(const QVector &v) : d(v.d) { } +}; +class QXmlStreamAttribute { }; +class QXmlStreamAttributes : public QVector { }; +class __attribute__ ((visibility("default"))) Smoke { +public: + union StackItem; + typedef StackItem* Stack; + typedef short Index; +}; +class SmokeBinding { }; +namespace __smokeqt { + class x_QXmlStreamAttributes : public QXmlStreamAttributes { + SmokeBinding* _binding; + public: + static void x_11(Smoke::Stack x) { + x_QXmlStreamAttributes* xret = new x_QXmlStreamAttributes(); + } + explicit x_QXmlStreamAttributes() : QXmlStreamAttributes() { } + }; + void xcall_QXmlStreamAttributes(Smoke::Index xi, void *obj, + Smoke::Stack args) + { + switch(xi) { + case 11: x_QXmlStreamAttributes::x_11(args); + } + } +}
pr42714.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr40834.C =================================================================== --- pr40834.C (nonexistent) +++ pr40834.C (revision 338) @@ -0,0 +1,52 @@ +/* { dg-do run } */ + +extern "C" void abort (void); +class XalanDOMString +{ +public: + int y; +}; + +class XObject +{ +public: + const XalanDOMString& str() const { return x; } + XalanDOMString x; +}; + +class XObjectPtr +{ +public: + XObjectPtr(const XObjectPtr& theSource) + { + m_xobjectPtr = theSource.m_xobjectPtr; + } + const XObject* operator->() const + { + return m_xobjectPtr; + }; + XObjectPtr(XObject *p) { m_xobjectPtr = p; } + XObject* m_xobjectPtr; +}; + +class FunctionSubstringBefore +{ +public: + int execute( const XObjectPtr arg1) const + { + const XalanDOMString& theFirstString = arg1->str(); + return theFirstString.y; + } +}; + +int +main () +{ + XObject x; + XObjectPtr y (&x); + x.x.y = -1; + FunctionSubstringBefore z; + if (z.execute (y) != -1) + abort (); + return 0; +}
pr40834.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr41680.C =================================================================== --- pr41680.C (nonexistent) +++ pr41680.C (revision 338) @@ -0,0 +1,23 @@ +// PR target/41680 +// { dg-do compile } + +extern void baz (float); + +inline bool +bar (float x) +{ + union { float f; int i; } u; + u.f = x; + return (u.i & 1); +} + +void +foo (float *x) +{ + for (int i = 0; i < 10; i++) + { + float f = x[i]; + if (!bar (f)) + baz (f); + } +}
pr41680.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr37146-2.C =================================================================== --- pr37146-2.C (nonexistent) +++ pr37146-2.C (revision 338) @@ -0,0 +1,67 @@ +// PR c++/37146 +// { dg-do run } + +extern "C" void abort (); +int a, b; +struct A { int i:8; int j:8; int k:16; int l:32; } c; + +int +f1 (int x) +{ + return x ? a : b; +} + +int +f2 (int x) +{ + return x ? c.i : c.j; +} + +int +f3 (int x) +{ + return x ? c.i : a; +} + +int +f4 (int x) +{ + return x ? c.i : c.k; +} + +int +f5 (int x) +{ + return x ? c.l : b; +} + +int +main () +{ + a = 17; + b = 18; + c.i = 19; + c.j = 20; + c.k = 21; + c.l = 22; + if (f1 (1) != a) + abort (); + if (f1 (0) != b) + abort (); + if (f2 (1) != c.i) + abort (); + if (f2 (0) != c.j) + abort (); + if (f3 (1) != c.i) + abort (); + if (f3 (0) != a) + abort (); + if (f4 (1) != c.i) + abort (); + if (f4 (0) != c.k) + abort (); + if (f5 (1) != c.l) + abort (); + if (f5 (0) != b) + abort (); +}
pr37146-2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr36191.C =================================================================== --- pr36191.C (nonexistent) +++ pr36191.C (revision 338) @@ -0,0 +1,17 @@ +// PR c++/36191 +// { dg-do compile } +// { dg-options "-fnon-call-exceptions" } +// { dg-skip-if "Frame pointer required for unwind tables" { sh*-*-* m68k*-*-* fido*-*-* } "-fomit-frame-pointer" "" } + +__complex__ double +foo (__complex__ double x, double y) +{ + try + { + return x / y; + } + catch (char *s) + { + return x; + } +}
pr36191.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr34850.C =================================================================== --- pr34850.C (nonexistent) +++ pr34850.C (revision 338) @@ -0,0 +1,74 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +typedef unsigned char uint8_t; +typedef unsigned int uint32_t; +typedef uint8_t byte; +typedef uint32_t u32bit; +__extension__ typedef __SIZE_TYPE__ size_t; +extern "C" { + extern void __warn_memset_zero_len (void) __attribute__((__warning__ (""))); + extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) + void * memset (void *__dest, int __ch, size_t __len) throw () { + if (__builtin_constant_p (__len) && __len == 0) + __warn_memset_zero_len (); /* { dg-warning "" } */ + } +} +inline void clear_mem(void* ptr, u32bit n) { + memset(ptr, 0, n); +} +template class MemoryRegion { +public: + u32bit size() const { + } + const T* begin() const { + } + void set(const T in[], u32bit n) { + create(n); + } + void set(const MemoryRegion& in) { + set(in.begin(), in.size()); + } + void clear() { + clear_mem(buf, allocated); + } + void create(u32bit); + MemoryRegion() { + used = allocated = 0; + } + mutable T* buf; + mutable u32bit used; + mutable u32bit allocated; +}; +template void MemoryRegion::create(u32bit n) { + if(n <= allocated) { + clear(); + } +} +template class SecureVector : public MemoryRegion { +public: + SecureVector& operator=(const MemoryRegion& in) { + if(this != &in) set(in); + } +}; +class OctetString { +public: + SecureVector bits_of() const { + } + OctetString& operator^=(const OctetString&); + void change(const MemoryRegion& in) { + bits = in; + } + OctetString(const MemoryRegion& in) { + change(in); + } + SecureVector bits; +}; +OctetString& OctetString::operator^=(const OctetString& k) { + if(&k == this) { + bits.clear(); + } +} +bool operator==(const OctetString& s1, const OctetString& s2) { + return (s1.bits_of() == s2.bits_of()); +}
pr34850.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr41186.C =================================================================== --- pr41186.C (nonexistent) +++ pr41186.C (revision 338) @@ -0,0 +1,29 @@ +/* { dg-do run } */ + +struct Foo { + Foo() {}; + int i; + short f; +}; +struct Bar : public Foo { + Bar() {}; + short b; +}; + +extern "C" void abort(void); + +int main() +{ + Bar b1, b2; + b2.i = 0; + b1.f = 0; + b1.b = 1; + b2.f = 1; + b2.b = 2; + static_cast(b1) = static_cast(b2); + if (b1.i != 0 || b1.b != 1) + abort (); + if (b1.f != 1) + abort (); + return 0; +}
pr41186.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr35526.C =================================================================== --- pr35526.C (nonexistent) +++ pr35526.C (revision 338) @@ -0,0 +1,18 @@ +/* { dg-do compile } */ + +extern void *memcpy (void *__dest, __const void *__src, __SIZE_TYPE__ __n); + +char internal_crash_read_ip[] = { 0xb8 }; + +struct u_internal_crash_read_t +{ + char ip[sizeof (internal_crash_read_ip)]; +} +u_internal_crash_read; + +void +gSignalHandler (int psignalNr, int pinfo, int pctx) +{ + memcpy (u_internal_crash_read.ip, internal_crash_read_ip, + sizeof (internal_crash_read_ip)); +}
pr35526.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr33627.C =================================================================== --- pr33627.C (nonexistent) +++ pr33627.C (revision 338) @@ -0,0 +1,57 @@ +/* { dg-do compile } */ + +typedef unsigned int UT_uint32; +typedef UT_uint32 PT_DocPosition; +typedef UT_uint32 PT_BlockOffset; +typedef enum _PTStruxType { PTX_Block } PTStruxType; +typedef UT_uint32 PL_ListenerId; +typedef const void * PL_StruxFmtHandle; +class PX_ChangeRecord; +class pf_Frag { + public: + typedef enum _PFType { PFT_Object } PFType; + inline PFType getType(void) const { } + inline pf_Frag * getNext(void) const { } + PT_DocPosition getPos(void) const { } +}; +class pf_Fragments { + public: + pf_Frag * getFirst() const; +}; +class pt_PieceTable { + bool getStruxOfTypeFromPosition(PL_ListenerId listenerId, PT_DocPosition docPos, PTStruxType pts, PL_StruxFmtHandle * psfh) const; + bool _tellAndMaybeAddListener(PL_ListenerId listenerId, bool bAdd); + pf_Fragments m_fragments; +}; +class pf_Frag_Object : public pf_Frag +{ + public: + virtual bool createSpecialChangeRecord(PX_ChangeRecord ** ppcr, PT_DocPosition dpos, PT_BlockOffset blockOffset) const; +}; +bool pt_PieceTable::_tellAndMaybeAddListener(PL_ListenerId listenerId, bool bAdd) +{ + PL_StruxFmtHandle sfh = 0; + PT_DocPosition sum = 0; + UT_uint32 blockOffset = 0; + for (pf_Frag * pf = m_fragments.getFirst(); (pf); pf=pf->getNext()) + { + pf_Frag_Object * pfo = static_cast (pf); + PX_ChangeRecord * pcr = __null; + bool bStatus1 = false; + if(sfh != __null) { + bStatus1 = pfo->createSpecialChangeRecord(&pcr,sum,blockOffset); + if (!(bStatus1)) + return (false); + } + else + { + PT_DocPosition pos = pf->getPos(); + getStruxOfTypeFromPosition(listenerId,pos,PTX_Block,&sfh); + bStatus1 = pfo->createSpecialChangeRecord(&pcr,pos,blockOffset); + if (!(bStatus1)) + return (false); + } + if (!(bStatus1)) + return (false); + } +}
pr33627.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr43068.C =================================================================== --- pr43068.C (nonexistent) +++ pr43068.C (revision 338) @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-freorder-blocks -ftracer} */ + +struct A { + virtual A *f(); +}; +struct B : virtual A { + virtual B *f(); +}; +B *B::f() { return 0; }
pr43068.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr43905.C =================================================================== --- pr43905.C (nonexistent) +++ pr43905.C (revision 338) @@ -0,0 +1,13 @@ +extern void sf ( __const char *); +struct Matrix{ + int operator[](int n){ + sf ( __PRETTY_FUNCTION__); + } + int operator[](int n)const{ + sf ( __PRETTY_FUNCTION__); + } +}; +void calcmy(Matrix const &b, Matrix &c, int k){ + b[k]; + c[k]; +}
pr43905.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr42871.C =================================================================== --- pr42871.C (nonexistent) +++ pr42871.C (revision 338) @@ -0,0 +1,40 @@ +struct C +{ + ~C (); + int c3; +}; + +C *b2; + +static void +b1 (const C &x, unsigned b3, unsigned b4) +{ + unsigned i = 0; + for (; i < b3; i++) + if (i < b4) + { + b2[0].c3 = x.c3; + return; + } +} + +int a (); + +void +bar (unsigned b3, unsigned b4) +{ + C c[100]; + for (int i = 0; i < 100; i++) + { + c[i].c3 = i; + for (int j = 0; j < b3; j++) + if (j < b4) + { + b2[0].c3 = 0; + break; + } + b1 (c[i], b3, b4); + a (); + } +} +
pr42871.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: predcom-1.C =================================================================== --- predcom-1.C (nonexistent) +++ predcom-1.C (revision 338) @@ -0,0 +1,29 @@ +/* Test for ICE in predictive commoning with empty loop header block + on arm-none-linux-gnueabi. */ + +struct Foo +{ + double *ptr; + + Foo (double *ptr_) + : ptr (ptr_) + { + } + + Foo PostInc () + { + return Foo (ptr++); + } +}; + +bool Baz (Foo first, double *last) +{ + Foo prev (first.ptr); + + first.ptr++; + + while (first.ptr != last) + if (*first.PostInc ().ptr < *prev.PostInc ().ptr) + return false; +} +
predcom-1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr39362.C =================================================================== --- pr39362.C (nonexistent) +++ pr39362.C (revision 338) @@ -0,0 +1,105 @@ +/* { dg-do compile } */ + +void *fastMalloc (int n); +void fastFree (void *p); +template struct C +{ + void deref () { delete static_cast (this); } +}; +template +struct D +{ + D (T *ptr) : m_ptr (ptr) { } + ~D () { if (T * ptr = m_ptr) ptr->deref (); } + T *operator-> () const; + T *m_ptr; + typedef T *UnspecifiedBoolType; + operator UnspecifiedBoolType () const; +}; +template struct E +{ + static void destruct (T * begin, T * end) + { + for (T * cur = begin; cur != end; ++cur) + cur->~T (); + } +}; +template class F; +template struct G +{ + static void destruct (T * begin, T * end) + { + E ::destruct (begin, end); + } + static void uninitializedFill (T * dst, T * dstEnd, const T & val) + { + F::uninitializedFill (dst, dstEnd, val); + } +}; +template struct H +{ + void allocateBuffer (int newCapacity) + { + m_buffer = static_cast (fastMalloc (newCapacity * sizeof (T))); + } + void deallocateBuffer (T * bufferToDeallocate) + { + if (m_buffer == bufferToDeallocate) + fastFree (bufferToDeallocate); + } + T *buffer () { } + int capacity () const { } + T *m_buffer; +}; +template class I; +template struct I : H +{ + I (int capacity) { allocateBuffer (capacity); } + ~I () { deallocateBuffer (buffer ()); } + using H ::allocateBuffer; + H ::buffer; +}; +template struct J +{ + typedef T *iterator; + ~J () { if (m_size) shrink (0); } + J (const J &); + int capacity () const { m_buffer.capacity (); } + T & operator[](int i) { } + iterator begin () { } + iterator end () { return begin () + m_size; } + void shrink (int size); + template void append (const U &); + int m_size; + I m_buffer; +}; +template +J ::J (const J & other) : m_buffer (other.capacity ()) +{ +} +template +void J ::shrink (int size) +{ + G ::destruct (begin () + size, end ()); + m_size = size; +} +struct A : public C +{ + virtual ~A (); + typedef J > B; + virtual A *firstChild () const; + virtual A *nextSibling () const; + virtual const B & children (int length); + B m_children; +}; +const A::B & +A::children (int length) +{ + for (D obj = firstChild (); obj; obj = obj->nextSibling ()) + { + B children = obj->children (2); + for (unsigned i = 0; i
pr39362.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr40991.C =================================================================== --- pr40991.C (nonexistent) +++ pr40991.C (revision 338) @@ -0,0 +1,113 @@ +/* { dg-options "-std=gnu++0x" } */ + +typedef __SIZE_TYPE__ size_t; +namespace std __attribute__ ((__visibility__ ("default"))) { + using ::size_t; + void __throw_bad_function_call() __attribute__((__noreturn__)); +} +inline void* operator new(std::size_t, void* __p) throw() { + return __p; +} +namespace std { + class type_info { + public: + bool operator==(const type_info& __arg) const { } + }; + namespace tr1 { + template struct integral_constant { }; + typedef integral_constant true_type; + template + struct _Maybe_unary_or_binary_function { }; + class _Undefined_class; + union _Nocopy_types { + void (_Undefined_class::*_M_member_pointer)(); + }; + union _Any_data { + void* _M_access() { + return &_M_pod_data[0]; + } + char _M_pod_data[sizeof(_Nocopy_types)]; + }; + enum _Manager_operation { __get_type_info, __get_functor_ptr, __clone_functor, __destroy_functor }; + template struct _Simple_type_wrapper { + _Simple_type_wrapper(_Tp __value) : __value(__value) { } + _Tp __value; + }; + template class function; + class _Function_base { + public: + static const std::size_t _M_max_size = sizeof(_Nocopy_types); + static const std::size_t _M_max_align = __alignof__(_Nocopy_types); + template class _Base_manager { + static const bool __stored_locally = (sizeof(_Functor) <= _M_max_size && __alignof__(_Functor) <= _M_max_align && (_M_max_align % __alignof__(_Functor) == 0)); + typedef integral_constant _Local_storage; + public: + static bool _M_manager(_Any_data& __dest, const _Any_data& __source, _Manager_operation __op) { } + static void _M_init_functor(_Any_data& __functor, const _Functor& __f) { + _M_init_functor(__functor, __f, _Local_storage()); + } + template static bool _M_not_empty_function(_Tp _Class::* const& __mp) { + return __mp; + } + static void _M_init_functor(_Any_data& __functor, const _Functor& __f, true_type) { + new (__functor._M_access()) _Functor(__f); + } + }; + ~_Function_base() { + if (_M_manager) _M_manager(_M_functor, _M_functor, __destroy_functor); + } + bool _M_empty() const { + return !_M_manager; + } + typedef bool (*_Manager_type)(_Any_data&, const _Any_data&, _Manager_operation); + _Any_data _M_functor; + _Manager_type _M_manager; + }; + template class _Function_handler; + template class _Function_handler<_Res(_ArgTypes...), _Member _Class::*> : public _Function_handler { + public: + static _Res _M_invoke(const _Any_data& __functor, _ArgTypes... __args) { } + }; + template class _Function_handler : public _Function_base::_Base_manager< _Simple_type_wrapper< _Member _Class::* > > { }; + template class function<_Res(_ArgTypes...)> : public _Maybe_unary_or_binary_function<_Res, _ArgTypes...>, private _Function_base { + typedef _Res _Signature_type(_ArgTypes...); + struct _Useless { }; + public: + template function(_Functor __f, _Useless = _Useless()); + _Res operator()(_ArgTypes... __args) const; + const type_info& target_type() const; + typedef _Res (*_Invoker_type)(const _Any_data&, _ArgTypes...); + _Invoker_type _M_invoker; + }; + template template function<_Res(_ArgTypes...)>:: function(_Functor __f, _Useless) : _Function_base() { + typedef _Function_handler<_Signature_type, _Functor> _My_handler; + if (_My_handler::_M_not_empty_function(__f)) { + _M_invoker = &_My_handler::_M_invoke; + _M_manager = &_My_handler::_M_manager; + _My_handler::_M_init_functor(_M_functor, __f); + } + } + template _Res function<_Res(_ArgTypes...)>:: operator()(_ArgTypes... __args) const { + if (_M_empty()) { + __throw_bad_function_call(); + } + return _M_invoker(_M_functor, __args...); + } + template const type_info& function<_Res(_ArgTypes...)>:: target_type() const { + if (_M_manager) { + _Any_data __typeinfo_result; + _M_manager(__typeinfo_result, _M_functor, __get_type_info); + } + } + } +} +struct X { + int bar; +}; +void test05() { + using std::tr1::function; + X x; + function frm(&X::bar); + frm(x) == 17; + typeid(int X::*) == frm.target_type(); +}
pr40991.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr42773.C =================================================================== --- pr42773.C (nonexistent) +++ pr42773.C (revision 338) @@ -0,0 +1,54 @@ +// { dg-do compile } +// { dg-options "-fno-exceptions" } + +typedef unsigned int uint; +struct QShared { + bool deref() { + return !--count; + } + uint count; +}; +template class QValueListNode { +public: + QValueListNode* next; + QValueListNode* prev; +}; +template class QValueListPrivate : public QShared { +public: + typedef QValueListNode Node; + typedef QValueListNode* NodePtr; + QValueListPrivate(); + void derefAndDelete() { + if ( deref() ) delete this; + } + ~QValueListPrivate(); + NodePtr node; +}; +template QValueListPrivate::QValueListPrivate() { + node = new Node; + node->next = node->prev = node; +} +template QValueListPrivate::~QValueListPrivate() { + NodePtr p = node->next; + while( p != node ) { + NodePtr x = p->next; + delete p; + p = x; + } +} +template class QValueList { +public: + QValueList() { + sh = new QValueListPrivate; + } + ~QValueList() { + sh->derefAndDelete(); + } + QValueListPrivate* sh; +}; +class Cell { + QValueList obscuringCells() const; +}; +QValueList Cell::obscuringCells() const { + QValueList empty; +}
pr42773.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr42890.C =================================================================== --- pr42890.C (nonexistent) +++ pr42890.C (revision 338) @@ -0,0 +1,25 @@ +// PR tree-optimization/42890 +// { dg-do compile } + +extern "C" int puts (const char *) throw (); + +struct S +{ + const char *a; + const char **b; + S (const char *s) { a = s; b = &a; } + ~S () { puts (a); } +}; + +void +foo (int (*fn) (const char *)) +{ + S a ("foo"); + fn ("bar"); +} + +int +main () +{ + foo (puts); +}
pr42890.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: type-generic-1.C =================================================================== --- type-generic-1.C (nonexistent) +++ type-generic-1.C (revision 338) @@ -0,0 +1,13 @@ +/* Do the type-generic tests. Unlike pr28796-2.c, we test these + without any fast-math flags. */ + +/* { dg-do run } */ +/* { dg-add-options ieee } */ +/* { dg-skip-if "No Inf/NaN support" { spu-*-* } } */ + +#include "../../gcc.dg/tg-tests.h" + +int main(void) +{ + return main_tests (); +}
type-generic-1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr42739.C =================================================================== --- pr42739.C (nonexistent) +++ pr42739.C (revision 338) @@ -0,0 +1,16 @@ +/* { dg-do compile } */ + +struct s { ~s() { s(); } }; + +int f() +{ + M: + s o = s(); + f(); + f(); + + L: + goto *(f() ? &&L : &&M); + + return 0; +}
pr42739.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr33589-2.C =================================================================== --- pr33589-2.C (nonexistent) +++ pr33589-2.C (revision 338) @@ -0,0 +1,13 @@ +// { dg-do compile } + +void f(void*) throw(); + +void somefunction() +{ +try { + void (*g)(void*) = (void (*)(void*))f; + void (*g2)(int*) = (void (*)(int*))g; + g2(0); +} catch (...) +{throw;} +}
pr33589-2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr33887-1.C =================================================================== --- pr33887-1.C (nonexistent) +++ pr33887-1.C (revision 338) @@ -0,0 +1,44 @@ +/* { dg-do run } */ + +extern "C" void abort (void); +struct S { unsigned int i : 24; } x; +void __attribute__((noinline)) test1() +{ + if (--x.i != 0x00ffffff) + abort (); + if (x.i != 0x00ffffff) + abort (); +} +void __attribute__((noinline)) test2() +{ + if (x.i-- != 0) + abort (); + if (x.i != 0x00ffffff) + abort (); +} +void __attribute__((noinline)) test3() +{ + if (++x.i != 0) + abort (); + if (x.i != 0) + abort (); +} +void __attribute__((noinline)) test4() +{ + if (x.i++ != 0x00ffffff) + abort (); + if (x.i != 0) + abort (); +} +int main() +{ + x.i = 0; + test1(); + x.i = 0; + test2(); + x.i = 0x00ffffff; + test3(); + x.i = 0x00ffffff; + test4(); + return 0; +}
pr33887-1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property

powered by: WebSVN 2.1.0

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