plateform
stringclasses
1 value
repo_name
stringclasses
2 values
name
stringlengths
1
78
ext
stringclasses
2 values
path
stringlengths
15
1.11k
size
int64
1
8.55M
source_encoding
stringclasses
11 values
md5
stringlengths
32
32
text
stringlengths
0
8.49M
google
android
complex4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/complex4.C
270
utf_8
8a5a897536e97520b29744f3237bd4fd
// PR 24362 // { dg-do compile } // { dg-options "-O2" } typedef __complex__ double cdouble; cdouble elt_zero(); const cdouble *pointer(); cdouble trace(void) { cdouble output = elt_zero(); const cdouble *data = pointer(); output += data[1]; return output; }
google
android
inline5
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/inline5.C
166
utf_8
d6211992cdc6ec155a7621cf706f93dd
// PR c++/12519 // { dg-do compile } // { dg-options "-O" } struct A { ~A(); }; inline const A foo() { A a; return a; } A bar() { return foo(); }
google
android
inline3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/inline3.C
617
utf_8
f8d8b6e43c65e932c2f62a1b6414e898
// PR opt/6793 // We failed to supress inlining of a varargs function when it's a template. // { dg-do compile } // { dg-options "-O3" } #include <stdarg.h> typedef __SIZE_TYPE__ size_t; template < class Type > class VectorNd { size_t size; Type *data; public: VectorNd (size_t _size, size_t count, ...) : si...
google
android
pr20991
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/pr20991.C
388
utf_8
54c9b415ffbafe11bc784d68421c5e25
// PR middle-end/20991 // { dg-options "-O2" } // { dg-do compile } struct S { virtual inline int foo () const; virtual inline bool bar () const; virtual int baz (int) const; }; inline int S::foo () const { return 1; } inline bool S::bar () const { return foo () == 0; } void A () { S s; if (s.bar ()) ...
google
android
pr60849
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/pr60849.C
156
utf_8
cd9ce81573f1dd55ed9926ad0afbe423
// { dg-do compile } // { dg-options "-O2" } int g; extern "C" int isnan (); void foo(float a) { int (*xx)(...); xx = isnan; if (xx(a)) g++; }
google
android
pr46864
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/pr46864.C
310
utf_8
6d0b610fcb163b0324355022a3aa7006
// PR tree-optimization/46864 // { dg-do compile } // { dg-options "-O -fnon-call-exceptions" } int baz (); struct S { int k; bool bar () throw () { int m = baz (); for (int i = 0; i < m; i++) k = i; return m; } }; extern S *s; void foo () { while (baz () && s->bar ()) ; }
google
android
pr46640
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/pr46640.C
744
utf_8
e6220bf5fccf045fc75d8ebc8920dc60
// { dg-do compile { target x86_64-*-* } } // { dg-options "-fschedule-insns2 -fsel-sched-pipelining -fselective-scheduling2 -fno-exceptions -O" } struct QBasicAtomicInt { int i, j; bool deref () { asm volatile ("":"=m" (i), "=qm" (j)); } }; struct Data { QBasicAtomicInt ref; void *data; }; struct QB...
google
android
pr47280
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/pr47280.C
201
utf_8
795f414b8075cb07e338e90313b07d50
// { dg-do compile } // { dg-options "-O -fnon-call-exceptions -ftrapv" } void bar (int n, char *p) { try { n++; for (int i = 0; i < n - 1; i++) p[i]; } catch (...) {} }
google
android
pr23372
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/pr23372.C
339
utf_8
0cb3ec2bc521912639efb2ca41ad1fa0
// PR c++/23372 // { dg-options -fdump-tree-gimple } // There shouldn't be an assignment to a temporary in the GIMPLE, // as that represents a redundant copy. // { dg-final { scan-tree-dump-not "=" gimple } } struct A { int a[1000]; //A(A const &); }; void f(A); void g(A *a) { f(*a); } // { dg-final { cleanup-tr...
google
android
nrv2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/nrv2.C
308
utf_8
360692bdb55de35cb68717ceb6c51fd7
// Test for the named return value optimization, this time with inlining. // { dg-do run } // { dg-options -O2 } int c; int d; struct A { A() { ++c; } A(const A&) { ++c; }; ~A() { ++d; } }; inline A f () { A a; return a; } int main () { { A a = f (); } return !(c == 1 && c == d); }
google
android
nrv3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/nrv3.C
241
utf_8
42adcc800d5d2029a2b831e1453e8f32
// PR optimization/6189 // Bug: we forgot about foo's nrv after writing it out. // { dg-options -O3 } // { dg-do run } struct A { int i; }; A foo () { A a; a.i = 42; return a; } int main() { A b = foo(); return b.i != 42; }
google
android
switch3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/switch3.C
207
utf_8
0cc8575163405751cafdeec02c836cfb
// PR c++/20023 // { dg-do compile } // { dg-options "-O2" } void f (void); typedef __SIZE_TYPE__ size_t; void g (void *a) { size_t b = (size_t) a; switch (b) { case 1: f (); break; } }
google
android
pr23454
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/pr23454.C
512
utf_8
6b44bd46dbabf935a497942dd88a002b
/* PR rtl-optimization/23454 */ /* { dg-do compile } */ /* { dg-options "-O2" } */ void foo (); int a, b; char c; long long d, e; static inline int bar (const long long s, const long long t) { return ((s < t) ? -1 : s > t ? 1 : 0); } int fn (); int f; void baz (int x) { long long g = fn (); if (f) { ...
google
android
longbranch1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/longbranch1.C
1,538
utf_8
74049e3e36b5fbdab2f271b70320a6d8
// PR c++/5964 // This testcase failed to link on sparc -m64 -O0, because instruction // lengths were incorrectly computed // { dg-do link } // { dg-options "-O0" } #define makecode for (int i = 1; i < 1000; ++i) i *= 3 #define muchcode \ makecode; makecode; makecode; makecode; makecode; makecode; \ ma...
google
android
life1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/life1.C
426
utf_8
d3914504bba83652fe1a238821c3dea2
// This testcase did not set up the pic register on IA-32 due // to bug in calculate_global_regs_live EH edge handling. // { dg-do compile { target { { i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } && ia32 } } } // { dg-require-effective-target fpic } // { dg-options "-O2 -fPIC" } struct A { }; void foo (A (*fn)()) { ...
google
android
pr59470
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/pr59470.C
3,325
utf_8
b5c6104c29743bbd0bba0fb8c0978bd7
// PR middle-end/59470 // { dg-do run } // { dg-options "-O2 -fstack-protector" } // { dg-additional-options "-fPIC" { target fpic } } // { dg-require-effective-target fstack_protector } struct A { int a1; A () throw () : a1 (0) {} }; struct B { unsigned int b1 () throw (); }; __attribute__((noinline, noclone)) u...
google
android
pr15054-2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/pr15054-2.C
549
utf_8
e528f6bb2289dcc1c6827539dc3dc194
// PR middle-end/15054 // { dg-do run } // { dg-options "-O2" } extern "C" void abort (void); void __attribute__((noinline)) check (long x, long y) { if (x != y) abort (); } struct A { A() : a(2) { check (a, 2); } ~A() { check (a, 2); } private: long a; }; class B { long b; B& operator =(const B& )...
google
android
pr23478
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/pr23478.C
2,818
utf_8
a81feb0dd82790d6b31abe4dc3925070
// PR rtl-optimization/23478 // { dg-do run } // { dg-options "-O2" } extern "C" void abort (); bool tthrow; struct C3 { int i; }; class C14 {}; struct C7 { virtual ~C7 (); }; C7::~C7 () { asm volatile ("" : : : "memory"); } class C2 : public C7 {}; template <class X> class C13 { bool ma; X *mb; public: ex...
google
android
cfg2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/cfg2.C
671
utf_8
2db7ebcb2c45714978fcb3cadb7cb570
// PR optimization/12215 // This used to fail because the CSE pass destroyed the CFG in presence // of trapping loads, which led to the deletion of basic blocks. // { dg-do compile } // { dg-options "-O2 -fno-gcse -fnon-call-exceptions" } struct B { ~B() throw() {} }; struct X { X(const char*, const B&); ~X() {} ...
google
android
inline9
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/inline9.C
556
utf_8
13c304c377f82ba4b80f337f555069a3
// PR c++/17972 // { dg-do run } // { dg-options "-O" } // { dg-options "-O -mtune=i686" { target { { i?86-*-* x86_64-*-* } && ia32 } } } struct thread_info { short preempt_count; } x; static inline struct thread_info *cti (void) __attribute__ ((const)); static inline struct thread_info *cti (void) { return &x; } v...
google
android
reload1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/reload1.C
449
utf_8
25e9962e240d8c8ed05cecb4820f38d3
// PR 7944 // { dg-do compile } // { dg-options -O2 } struct B { B & operator << (short s) { int j; if (j) return operator << (s); else return operator << (s); } }; struct A { int i; static void bar (); static int quux () { bar (); return 0; } A ():i (quux ()) ...
google
android
pr55717
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/pr55717.C
2,697
utf_8
7057b0c0d36c90d59e489132e8fff3fe
// PR debug/55717 // { dg-do compile } // { dg-options "-O -g" } struct DebugOnly {}; template <class T> struct StripConst { typedef T result; }; class TempAllocPolicy {}; template <class T> class HashTableEntry { unsigned keyHash; template <class, class, class> friend class HashTable; T t; void setLive (uns...
google
android
strength-reduce
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/strength-reduce.C
889
utf_8
60be25e48eb621d1ff683d818d13b520
// This testcase was miscompiled on s390x, because strength-reduction // did not see biv in C::foo as used after loop, but it was used // in a REG_EQUAL note. // { dg-do run } // { dg-options "-O2" } extern "C" void abort (void); struct C { int foo (char ch, int offset = __INT_MAX__) const; int bar (int offset, c...
google
android
pr30965
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/pr30965.C
676
utf_8
810ab5a2c055975ae9ca41789db9b27d
/* { dg-do compile } */ /* { dg-options "-O3 -fdump-tree-optimized" } */ #include <tr1/functional> #include <algorithm> extern void assign( long* variable, long v ) { std::transform( variable, variable + 1, variable, std::tr1::bind( std::plus< long >(), 0L, v ) ); } extern void assign( long& v...
google
android
noreturn-1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/noreturn-1.C
2,150
utf_8
aae564cdd9b50225ee28c64cfe203a3b
// PR optimization/12965 // This ICEd on Alpha because the reload pass emitted save/restore // insns around a no-return call. // { dg-do compile } // { dg-options "-O2" } template <typename _Alloc> class allocator; template <class _CharT> struct char_traits; template <typename _CharT, typename _Traits = char_traits<...
google
android
dtor3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/dtor3.C
349
utf_8
b38ce2cc80cbd8da836a5faae6d33aff
// PR c++/42386 // { dg-do compile } // { dg-options "-O2" } # 1 "A.h" 1 #pragma interface struct D { virtual bool d () const; }; struct E { virtual ~E (); virtual void *e () const = 0; }; struct A : public D, public E { ~A () {} }; # 5 "dtor3.C" 1 struct F : public A { void *f () const; void *e () const; }; void *F::e...
google
android
switch4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/switch4.C
679
utf_8
3f7a508706743fec6408316af296cebd
// { dg-do compile } // { dg-options "-fshort-enums -w" } // PR c++/20008 // We failed to compile this because CFG cleanup left the switch // statement intact, whereas expand_case expected at least one // in-range case to remain. typedef enum _SECStatus { SECWouldBlock = -2, SECFailure = -1, SECSuccess = 0 } S...
google
android
anonunion1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/anonunion1.C
433
utf_8
a20397e7aec19ce67e72ee637a08a416
// PR c++/5748 // This testcase ICEd because used flag from the anon union variables // was not propagated back to the anon union itself, causing addressof // not to be replaced with stack slot. // { dg-do compile } // { dg-options "-O2" } struct A { A (); ~A (); int foo (); int bar (void *x, int y); }; int A...
google
android
new1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/new1.C
2,056
utf_8
0283a838e012e953c0cd443e6bafc313
// PR c++/39367 // { dg-options "-O" } class QScriptEnginePrivate; class QScriptClassInfo; namespace QScript { enum Type { InvalidType }; }; class QScriptValueImpl { public: inline QScriptValueImpl(); QScript::Type m_type; }; namespace QScript { namespace Ecma { class Core { public: ...
google
android
cfg3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/cfg3.C
1,189
utf_8
edb10b502f24cdcc3e2d6bd03834f453
// PR optimization/11646 // This used to fail because the compiler inadvertently cleared // the EDGE_ABNORMAL flag on a EDGE_EH edge and didn't delete // unreachable blocks after CSE. // { dg-do compile } // { dg-options "-O -fgcse -fnon-call-exceptions" } struct C { int i; }; struct allocator { ~allocator() throw(...
google
android
devirt3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/devirt3.C
415
utf_8
341416acef4c503a054ba199d359a4f3
// { dg-do compile } // { dg-options "-O2 -fdevirtualize" } class ert_RefCounter { protected: int refCounterE; virtual ~ert_RefCounter() {} }; class ebs_Object : virtual public ert_RefCounter { }; class dpr_App : public ebs_Object { public: virtual void run(); }; class dpr_Job : public ebs_Object {}; void ...
google
android
pr60597
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/pr60597.C
511
utf_8
e676633b5d90b99891eacfad5d4d65cc
// PR middle-end/60597 // { dg-do compile } // { dg-options "-O2 -g" } struct A { int foo () const; int bar () const; int a; }; struct B { int foo (); int bar (); }; int *c, d; int A::foo () const { int b = a >> 16; return b; } int A::bar () const { int b = a; return b; } void baz (A &x, B h, in...
google
android
pr61456
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/pr61456.C
345
utf_8
b1b3a2b530cb188994df8ef142ab9234
// { dg-do compile } // { dg-options "-O2 -std=c++11 -Werror=uninitialized" } int rand (); class Funcs { public: int *f1 (); int *f2 (); }; typedef decltype (&Funcs::f1) pfunc; static int Set (Funcs * f, const pfunc & fp) { (f->*fp) (); } void Foo () { pfunc fp = &Funcs::f1; if (rand ()) fp = &Fun...
google
android
pr28116
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/pr28116.C
271
utf_8
fab88c0645bc906fcbd7a8fc1c71987b
/* { dg-do compile } */ /* { dg-options "-O3" } */ struct QDateTime { QDateTime addSecs( int secs ) const; int t; }; QDateTime gridToDate(long x) { QDateTime date; date = date.addSecs(1); return date; } void whatsOnAt(long x, long y) { gridToDate(x); }
google
android
pr48549
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/pr48549.C
1,091
utf_8
8180642ecf780c784fe5bdb6d35644fe
// PR rtl-optimization/48549 // { dg-do compile } // { dg-options "-fcompare-debug -O2" } // { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } __extension__ typedef __PTRDIFF_TYPE__ pdiff_t; void foo (void *from, void *to) { pdiff_t offset = reinterpret_cast <pdiff_t>(to) - reinterpret_cast <pdiff_t>(from...
google
android
pr51117
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/pr51117.C
484
utf_8
49d030e5fbcd2ef045f3f98408ae6990
// PR tree-optimization/51117 // { dg-do compile } // { dg-options "-O2 -fexceptions" } struct A { char buf[64]; }; void bar (A *); int foo () { A c; bar (&c); try { { A a; bar (&a); if (a.buf[13]) throw 1; else if (a.buf[52]) throw 3; } { A b; b...
google
android
empty1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/empty1.C
142
utf_8
d4a3cae21366e7a978e0f1b8371a6543
// PR c++/43787 // Test that we don't try to copy *x. // { dg-do run } class empty_t {}; int main() { empty_t* x = 0; empty_t y = *x; }
google
android
pr46649
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/pr46649.C
199
utf_8
8cc9399dd972318b6a188f19c5701035
// { dg-do compile { target powerpc*-*-* ia64-*-* x86_64-*-* } } // { dg-options "-fschedule-insns -fselective-scheduling" } void foo () { for (;;) for (;;({break;})) ; }
google
android
pr13066-1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/pr13066-1.C
226
utf_8
2896f5b1a96dd9fabb1dbb65cb4c5921
/* { dg-do compile } */ /* { dg-options "-O2" } */ class nsIURI; struct nsCOMPtr { operator nsIURI*() const { return mRawPtr; } nsIURI *mRawPtr; }; void func() { nsCOMPtr u1; if (!u1 == !u1) return; }
google
android
pr32383
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/pr32383.C
228
utf_8
e2528624f74d72e058180aa73e89ab6b
// { dg-do compile } // { dg-options "-O -ffast-math" } struct A { ~A(); }; double& foo(); inline void bar (double d) { foo() /= d; } void baz() { A a; bar(2); }
google
android
nrv10
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/nrv10.C
710
utf_8
40b7f29b2dd16f80e4119778fc7d06f4
// PR c++/25979 // Bug: we were eliding too many temporaries, so that a1 was used // as both 'a' and 'x' in the second operator+. // { dg-do run } struct A { A() : data1_(0), data2_(0) {} A(int i, int j) : data1_(i), data2_(j) {} A operator+(int); friend A operator+(int, const A&); ~A() {} //privat...
google
android
ptrintsum1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/ptrintsum1.C
430
utf_8
0841088f825be785d32663d712ecf675
// PR c++/4401 // This testcase was miscompiled on 64-bit platforms, resulting to // operating on a[0x100000000] instead of a[0]. // { dg-do run } // { dg-options "-O2" } char *a; char b[] = "AAAA"; extern "C" void abort (void); extern "C" void exit (int); void foo (void) { unsigned int i, j; i = 2; j = 3; ...
google
android
loop1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/loop1.C
362
utf_8
7138258a897096adae7238a76c0f3756
// PR rtl-optimization/16590 // { dg-do run } // { dg-options "-O2" } extern "C" void abort(); struct iterator { char * p; int *dummy; }; static iterator pend(char * start) { iterator p = {start, 0}; if (p.p == start) p.p = start+5; --p.p; return p; } int main() { char mem[4+1]; if...
google
android
pr19108
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/pr19108.C
244
utf_8
600947cbff5b96bdeb482a5d5adb992b
// PR tree-optimization/19108 // This used to abort due to not handing RANGE_EXPR in SRA. // { dg-do compile } // { dg-options "-O" } struct A { int i[6]; A () : i() {} }; struct B { A a; B(const A& x) : a(x) {} }; B b=A();
google
android
loop2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/loop2.C
258
utf_8
c11dcb63c226e2ccd7df1403d7c85717
// PR middle-end/22484 // { dg-do compile } // { dg-options "-O3" } struct A { ~A(); }; typedef bool B; bool foo(); bool bar(A&) { B b = true; for (int i = 0; i < 2 && b; ++i) b = foo(); return b; } void baz() { A a; if (bar(a)) foo(); }
google
android
typeinfo1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/typeinfo1.C
364
utf_8
88cb064325abdff24b813c432e193161
// PR c++/61020 // { dg-options "-O2" } // { dg-do run } #include <typeinfo> struct Base { virtual ~Base() { } }; struct Derived : public Base { }; int compare(const Base& base) { return typeid(base) == typeid(typeid(Derived)); } int main() { Base base; Derived derived; if (compare(base)) return 1; if...
google
android
ptrmem6
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/ptrmem6.C
483
utf_8
b0d55030f465e0c394fac453469489e7
// PR tree-opt/18040 // { dg-do compile } // { dg-options "-O3" } int PyObject_IsTrue(); struct object_base { void ptr() const; void ptr1() const; }; struct object : public object_base { typedef void (object::*bool_type)() const; inline operator bool_type() const { return PyObject_IsTrue() ? &object...
google
android
pr17724-6
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/pr17724-6.C
404
utf_8
144b08c56b97351a4e649cf301cc3f38
// PR tree-optimization/17724 // { dg-do compile } // { dg-options "-O2" } extern char *strcpy (char* d, const char* s); class A { public: A (); ~A (); }; inline char * B (char *s, const char *t) { return ::strcpy (s, t); } class C { int D (void); int E; }; int C::D (void) { A a; try { char z[22]; ...
google
android
cse2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/cse2.C
697
utf_8
828575acbc93114de791741277b04c03
// This testcase caused ICE on IA-32 in simplify_unary_operation // CSE did not assume SUBREGs changing mode from integral to floating. // { dg-do run { target i?86-*-* sparc*-*-* x86_64-*-* } } // { dg-options "-O2" } struct A { union { float f; unsigned int w; } a; static inline const A foo ...
google
android
emptyunion
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/emptyunion.C
212
utf_8
eb5f705d59dfe97f6ee0739884a4d329
// PR optimization/11059 // This testcase ICEd because clear_by_pieces was called with zero length. // { dg-do compile } // { dg-options "-O2" } union uni {}; int main() { uni *h; h = (uni *)new uni(); }
google
android
static3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/static3.C
539
utf_8
d314ec5e414fa9ff7becb1b3ec214a79
// { dg-do link } // { dg-options "-O2" } class Foo { public: // No out-of-class definition is provided for these class members. // That's technically a violation of the standard, but no diagnostic // is required, and, as a QOI issue, we should optimize away all // references. static const int erf = 0; sta...
google
android
inline4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/inline4.C
257
utf_8
255209f312d67a90af5347445715b3c5
// { dg-options "-O2 -ftemplate-depth-20000" } template <int I> inline void g() { g<I-1>(); return; } template <> inline void g<0>() { int i; return; } void h() { g<250>(); } // { dg-final { scan-assembler-not "\n_?_Z1gILi\[0-9\]+EEvv\[: \t\n\]" } }
google
android
pr17902
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/pr17902.C
365
utf_8
c4dea16df9a30d5151a70b435783f02b
/* { dg-options "-O3" } */ /* { dg-do compile } */ void foo(); struct A { ~A(){ foo(); } }; struct B { A a; }; void bar() { A a; bool b = false; int i, j; for (j=0; j<i; j++) { if (i) b=true; if (j && i) foo(); if (j && i) i++; } for (j=0; j<i; j++) if ( ...
google
android
nrv1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/nrv1.C
291
utf_8
835771d4b580573ed930662d2b25babf
// Test for the named return value optimization. // { dg-do run } // { dg-options -fno-inline } int c; int d; struct A { A() { ++c; } A(const A&) { ++c; }; ~A() { ++d; } }; inline A f () { A a; return a; } int main () { { A a = f (); } return !(c == 1 && c == d); }
google
android
dtor2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/dtor2.C
164
utf_8
1746b14290a8e8010d79689c8f79394b
// PR c++/42317 // { dg-do link } // { dg-options "-O0" } // { dg-additional-sources "dtor2-aux.cc" } #include "dtor2.h" D::D (int x) : C (x) {} int main () { }
google
android
empty2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/empty2.C
160
utf_8
d1d055611bb2998e370992816712eb3a
// PR c++/46160 // { dg-do compile } struct S { enum E { A }; } s; volatile S t; void f (S::E); void g () { volatile S *p = &s; f (p->A); f (t.A); }
google
android
inline8
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/inline8.C
132
utf_8
9f754de8bb8b020810cf2dc268d5cffb
// PR c++/15871 // { dg-options "-O2 -fkeep-inline-functions" } // { dg-final { scan-assembler "foo" } } inline void foo(void) { }
google
android
pr16693-2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/pr16693-2.C
232
utf_8
b33d962f4d889b6838bfcd5d254ef7bb
// PR middle-end/16693 // { dg-do run } // { dg-options "-O2" } extern "C" void abort(); char foo() { return 0x10; } enum E { e = 0x0f }; int main() { char c = (char)(E)(e & foo()); if (c != 0) abort(); return 0; }
google
android
inline11
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/inline11.C
653
utf_8
e0f42268d9f567a319e38d1af1fc885e
/* Verify that gnu_inline inlines disregard inlining limits. */ /* { dg-do link } */ /* { dg-options "-O2" } */ extern int foo (int); extern int baz (int); extern inline __attribute__((gnu_inline)) int foo (int x) { int i; if (!__builtin_constant_p (x)) { #define B(n) baz (1##n) + baz (2##n) + baz (3##n) \ ...
google
android
conj1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/conj1.C
430
utf_8
b879c3972fcf09a0bef4781d973dea10
// PR target/5740 // This testcase ICEd on SPARC -m64 because emit_group_load tried // to move a DFmode register into DImode register directly. // { dg-do compile } // { dg-options "-O2" } struct C { C (double y, double z) { __real__ x = y; __imag__ x = z; } double r () const { return __real__ x; } double i () c...
google
android
eh1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/eh1.C
194
utf_8
c59d630e23488d9f894a7904300cdd96
// PR middle-end/14477 // { dg-do compile } // { dg-options "-O2 -fno-default-inline" } struct A { A(); }; struct B { B(const A*); }; struct C { B b; C(int) : b(new A) {} }; C c(0);
google
android
nrv5
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/nrv5.C
883
utf_8
13481653ab41a707cb4c4eed2199c57f
// PR c++/7279 // Test for the named return value optimization with inlining. // { dg-do run } // { dg-options -O2 } enum E { E0, E1, E2, E3 }; struct S { E s0 : 2; bool s1 : 1, s2 : 1, s3 : 1, s4 : 1, s5 : 1, s6 : 1; S (); void foo (E x); }; S::S() : s1 (true), s2 (false), s0 (E1), s3 (true), s4 (false), s5 ...
google
android
eh3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/eh3.C
349
utf_8
18b23691d6af0cdfab89ec422af1cdb1
// PR target/18841 // { dg-do run } // { dg-options "-O2" } extern "C" void abort (); int r, i1 = 1, i2 = 2, i3 = 3, i4 = 4, i5 = 5; struct S { ~S() { r = i1 + i2 + i3 + i4 + i5; } }; void foo() { S s; throw 1; } void bar() { try { foo(); } catch (...) { } } int main() { bar(); if (r != 1 + 2 ...
google
android
pr58006
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/pr58006.C
386
utf_8
828022ccc1e84d3cca942139c1d8d082
// PR tree-optimization/58006 // { dg-do compile } // { dg-require-effective-target pthread } // { dg-options "-Ofast -ftree-parallelize-loops=2" } extern "C" float sqrtf (float); struct S { float i, j; float foo () const { return sqrtf (i * i + j * j); } S () : i (1), j (1) {} }; void bar (int a, int b) { i...
google
android
pr25857
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/pr25857.C
184
utf_8
46204dbd322cbbcf824c37d22442fd47
/* { dg-do compile } */ /* { dg-options "-O2" } */ int foo(); int i; struct A { ~A() { if (this != (A*)(&i)) foo(); } }; struct B { A a1, a2, a3, a4; ~B() { foo(); } }; B b;
google
android
eh5
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/eh5.C
573
utf_8
357f6793be1e4f02ea1767644836f548
// PR 41377 // { dg-do compile } // { dg-options "-O3" } struct A { bool foo(int*) const; } a; struct B {}; struct B1 : B { bool (A::*pmf)(int*) const; const A* pa; B1() : pmf(&A::foo), pa(&a) {} bool operator()() const { return (pa->*pmf)(new int); } }; struct B2 : B { B1 b1; B2(const B1& _b1) : b1...
google
android
builtins2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/builtins2.C
236
utf_8
658263688b08330a026e1ad24c8f9b8f
// PR c++/49813 // We should handle asinh as a built-in in C++0x mode, even when strict. // { dg-do compile { target c++11 } } // { dg-final { scan-assembler-not "asinh" } } #include <math.h> int main() { double das = asinh(1.0); }
google
android
pr40496
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/pr40496.C
427
utf_8
d6a356e006ceb7cfd944f66314b28fac
// { dg-do compile } // { dg-options "-O2 -fprefetch-loop-arrays -msse2" { target i?86-*-* x86_64-*-* } } // { dg-require-effective-target sse2 { target i?86-*-* x86_64-*-* } } struct DOMStringHandle { unsigned int fLength; int fRefCount; }; static void *freeListPtr; void foo(DOMStringHandle *dsg) { int i; for...
google
android
inline10
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/inline10.C
155
utf_8
580b8bf9e7c5a9db23c948678d8f0d22
// PR c++/25010 // { dg-options "-O2" } #pragma interface struct T { T *p; void baz () { p->baz (); } }; void foo (T *p) { p->baz (); }
google
android
pr51262
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/pr51262.C
242
utf_8
f113a6b1fc4f62f852bc2a622d8bf8e9
// { dg-do compile } // { dg-require-effective-target lto } // { dg-options "-flto -g" } template < typename > void * bar (int *p) { union { int *p; } u; u.p = p; return u.p; } void foo (int *p) { bar < void >(p); }
google
android
pr17724-1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/pr17724-1.C
446
utf_8
299566d461676c146df9f785903f6f2d
// PR tree-optimization/17724 // { dg-do compile } // { dg-options "-O2" } namespace N { char *strcpy (char *, const char *); } extern "C" char *strcpy (char *, const char *) throw (); inline char *N::strcpy (char *s, const char *t) { return ::strcpy (s, t); } struct S { ~S (); }; int foo (); int main () { S s; ...
google
android
complex5
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/complex5.C
254
utf_8
32b59098b47ea537d04c0f7e24c564c7
// PR 24365 // { dg-do compile } // { dg-options "-O2" } typedef __complex__ double cdouble; inline cdouble to_complex(double r) { cdouble z; __real__ z = r; return z; } cdouble elt_zero() { cdouble a = to_complex(0.0); a+=1.0; return a; }
google
android
pr55137
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/pr55137.C
84
utf_8
085e0397f9e2df3105230ab5abb3ba77
// PR c++/55137 // { dg-do compile } enum E { F = -1 + (int) (sizeof (int) - 1) };
google
android
interface2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/interface2.C
286
utf_8
1ac038665b7965caf38f2ddc0a55b918
#include "interface2.h" struct A { A() { } virtual ~A() { } }; int main() { A a; C<A> c(a); }
google
android
const3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/const3.C
771
utf_8
45fe728a90ca30ef5afd18351211d63f
// PR optimization/12926 // This failed on SPARC64 because the assignments to the bit-fields // were wrongly swapped in the constructor. // { dg-do run } // { dg-options "-O2" } extern "C" void abort(void); typedef __SIZE_TYPE__ size_t; void *my_out; struct A { enum Type {P, U, S}; int foo1(void *, const char...
google
android
nrv6
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/nrv6.C
378
utf_8
cc4e1f139fd98494395c4313684fa753
// PR c++/9993 // Bug: We were failing to destroy b. // { dg-do run } int c, d; struct Object { Object() { ++c; } Object(const Object&) { ++c; } ~Object() { ++d; } }; Object function() { int i = 0; do { Object b; if (i++ == 2) return b; } wh...
google
android
cond1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/cond1.C
243
utf_8
d596297fb4b8cfc0dbc45507354819a3
// { dg-do run } // { dg-options "-O2" } struct D { int x; }; struct W { W () {} D & operator * () { return d; } D d; }; int foo (int y) { W m; (*m).x = (y > 1 ? y : 0); return (*m).x; } int main () { return (foo (6) != 6); }
google
android
alias1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/alias1.C
363
utf_8
960bd912d3dccb44df0ecdebdfd45b44
// Test that type punning using an anonymous union works with strict aliasing. // { dg-do run } // { dg-options "-O2 -fstrict-aliasing" } extern "C" void abort (); void f (long i) { union { long ui; float uf[20]; }; ui = i; if (uf[0] != 42.0) abort (); } int main () { union U { long i; float...
google
android
unroll1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/unroll1.C
8,750
utf_8
5a0d1f452801f903b71f360e2af9dab9
// PR optimization/12340 // This used to segfault on x86 because the loop optimizer wrongly // interpreted a double assignment to a biv as a double increment, // which subsequently fooled the unroller. // { dg-do run } // { dg-options "-O2 -fno-exceptions -funroll-loops" } typedef __SIZE_TYPE__ size_t; inline void* ope...
google
android
static4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/static4.C
299
utf_8
da113259afc60dbf3dd7e421650ce386
// PR 13898 // Make sure the two X variables get assigned unique assembler names // if they are promoted to static storage. // { dg-do compile } int g(int i) { if (i<1) { const int x[3] = { 1,2,3 }; return x[i]; } else { const int x[3] = { 4,5,6 }; return x[i]; } }
google
android
nrv11
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/nrv11.C
1,289
utf_8
01bc5d5859f1dffb5f5ddc08cc6cbfa7
// PR middle-end/25977 // Bug: We were assuming that the return slot of the current function is // always safe to use as the return slot for another call, because its // address cannot escape. But its address can escape if we perform the // named return value optimization. // { dg-do run } struct A { A( int left...
google
android
local1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/local1.C
273
utf_8
83a82f683c2ef38a1d683e0c8055bded
// { dg-options "-O" } struct Outer { struct Inner { virtual bool f() = 0; }; void g(Inner &) const; }; inline void h(const Outer &o) { struct Local : public Outer::Inner { virtual bool f() {}; }; Local l; o.g(l); } void f(Outer &req) { h (req); }
google
android
pr47632
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/pr47632.C
216
utf_8
32b9348acc365a25c1e63908184a61bc
// { dg-do compile } // { dg-options "-O -fnon-call-exceptions -ftrapv" } template < typename > struct S { int n; void bar () { int *i = new int[n]; } }; void foo (S < char >*s) { s->bar (); }
google
android
switch2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/switch2.C
388
utf_8
61704a5f57c4a5f46b6144e7223f9962
// { dg-do compile } // { dg-options "-O2 -w" } extern int foo (int); void bar (void) { char tmp = foo (0); switch (tmp) { case 1: foo (1); break; case 2: foo (2); break; case 3: foo (3); break; case 4: foo (4); break; case 5: foo (5); break; case 6: foo (6); break; case 7: foo (7)...
google
android
ptrmem1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/ptrmem1.C
170
utf_8
8ceccf2f02b3f64f372600e32148e146
// { dg-options "-O2" } class QWidget { public: void repaint( bool erase = 1 ); }; void f (void) { typedef void (QWidget::*A)(bool); A b = &QWidget::repaint; }
google
android
reg-stack2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/reg-stack2.C
628
utf_8
424e403345e23e621b477afd23b875db
// PR target/9786 // This used to fail on x86 because the reg-stack pass deleted // an insn that could seemingly trap (but actually doesn't) // without updating the CFG. // { dg-do compile } // { dg-options "-O2 -fnon-call-exceptions" } struct D1 { float l; D1 GS() const {D1 d;float f=.299*l;d.l=f;return d;} ...
google
android
dtor1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/dtor1.C
240
utf_8
efd4841018dde44e1a577570a64e42de
// { dg-do run } // { dg-options "-O2" } int i; struct S { S (); S (const S&); ~S (); }; S::S () { ++i; } S::S (const S&) { ++i; } S::~S () { --i; } inline void f (S) { } int main () { { S s; f (s); } return i; }
google
android
pr55081
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/pr55081.C
337
utf_8
fe9b6c3dabf0ae1d3eb188f56c992822
// PR c++/55081 // { dg-do compile } struct R { int field; } r; __UINTPTR_TYPE__ * foo () { static __UINTPTR_TYPE__ array[] = { sizeof (char), (reinterpret_cast <__UINTPTR_TYPE__>(&r.field) - reinterpret_cast <__UINTPTR_TYPE__>(&r)) + 1 }; return array; } // { dg-final { scan-assembler-not "_ZGVZ3...
google
android
pr17624
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/pr17624.C
282
utf_8
efb7827d1ecf7697e74820c9396cd46b
// { dg-do compile } // { dg-options "-O2" } extern void foo (void); int c; void foo (int n) { int j = 0; try { for(;;) { foo (); if (j ++ == n) break; foo (); } } catch (...) { c = j; } }
google
android
ice1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/ice1.C
489
utf_8
e9864875d79d70c5a28e303b80cda9bd
// PR c++/43024 // { dg-options "-O2" } void foo(); template<int> struct X { enum { e }; typedef int Y; }; template<int N = 0> struct A { ~A() { foo(); } A() { a<0>(0); } template<int> void a(typename X<!X<N>::e>::Y); struct B b(); }; struct B { A<> b0, b1, b2, b3; B operator+ (const B&); }; struct...
google
android
enum2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/enum2.C
363
utf_8
0cc6612ad68203677bc3bffeabb3b1dc
// PR c++/43680 // Test that we don't make excessively aggressive assumptions about what // values an enum variable can have. // { dg-do run { target fpic } } // { dg-options "-O2 -fPIC" } extern "C" void abort (); enum E { A, B, C, D }; void CheckE(const E value) { long v = value; if (v <= D) abort (); } i...
google
android
nrv7
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/nrv7.C
141
utf_8
b16ae5b90244df2461a7c023c7f3c88e
// PR c++/15461 struct A { int i; }; inline A foo () { int j = 1; A a = { j }; return a; } A tv = foo();
google
android
pr51575
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/pr51575.C
242
utf_8
46179be5b37b7d0cc0eaa5683ebd4d28
// PR tree-optimization/51575 // { dg-do compile } // { dg-options "-O -fnon-call-exceptions" } #include <new> struct S { S () { for (int i = 0; i < 3; ++i) new (&a[i]) double (); } double a[4]; }; void foo () { S s; }
google
android
pr52643
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/pr52643.C
856
utf_8
94a19aafc8a1aec4cf6e17d2ab933a9b
// PR c++/52643 // { dg-options "-O" } template<class T> class already_AddRefd {}; template<class T> class ObjRef { public: ObjRef() {} ObjRef(const already_AddRefd<T> aar) {} ~ObjRef() { T* mPtr; mPtr->release_ref(); } operator T* () const { return __null; } template<class U> void...
google
android
pr56999
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/pr56999.C
4,725
utf_8
47b528a0159c73411ef4285b052d60be
// PR rtl-optimization/56999 // { dg-do run } // { dg-options "-O2" } // { dg-additional-options "-fpic" { target fpic } } // { dg-additional-options "-march=i686 -mtune=atom" { target ia32 } } // { dg-require-visibility "" } extern "C" void abort (void); extern "C" void exit (int); volatile bool do_exit = true; struc...
google
android
pr15551
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/pr15551.C
447
utf_8
680ea3809743d092ac547ddcbaa16a89
// PR target/15551 // This used to crash on pentium4-pc-cygwin due to an alloca problem. // Testcase submitted by Hans Horn to mingw bug tracker // // { dg-do run } // { dg-options "-O3" } #include <cstring> #include <fstream> #include <cstdio> using namespace std; ostream* logfile; int main () { logfile = new of...
google
android
declone1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/declone1.C
214
utf_8
da545b524f9533548787d2126af2b0ea
// { dg-options "-fdeclone-ctor-dtor -O3" } struct V {}; template <class T> struct A: virtual V { static A* p; A(); }; template <class T> A<T>::A() { if (!p) p = new A(); } int main() { A<int> a; }
google
android
pr14029
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/pr14029.C
841
utf_8
4f87f86b9f018cae74888e97468b2fe0
// { dg-do run } // { dg-options "-O2" } // We used to mis-compile this testcase as we did not know that // &a+offsetof(b,a) was the same as &a.b struct Iterator { int * ptr; Iterator(int * i) : ptr(i) { } void operator++() { ++ptr; } int *const & base() const { return ptr; } }; Iterator find_7(Iter...
google
android
pr52582
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/pr52582.C
304
utf_8
dd86735f0679bdb2fc27bf6f589696ee
// PR c++/52582 // { dg-do compile } // { dg-options "-O2" } inline void *operator new (__SIZE_TYPE__, void *p) throw () { return p; } struct B { virtual ~B (); B (); }; struct A : B { A () : B () {} virtual void bar (); }; void foo () { char a[64]; B *b = new (&a) A (); b->~B (); }
google
android
pr45316
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/opt/pr45316.C
233
utf_8
144f6e4897f5aeb63b6da39909c71ed9
// { dg-do compile } // { dg-options "-O1 -ftree-pre -fnon-call-exceptions" } struct A { int i; }; struct B : A { int i[6]; B (int = 0) : A () { m (); } int m (); }; struct C : B { }; void foo () { new C (); }