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
chromium
vrp2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/vrp2.C
411
utf_8
c4f8b2aee6bbe8bb7c04aa1a20ed7b46
/* { dg-do run } */ /* { dg-options "-O2" } */ /* VRP was miscompiling the following as it thought &a->b was a dereference and therfore a was non-null. extern "C" void abort (void); struct T { int i; } t; struct A : T { int j; } *p = __null; int main (void) { if (p == &t) return 0; if (p) abort (); r...
google
chromium
pr22167
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/pr22167.C
525
utf_8
395e10896a3d5235a8f3f2b9d6ad4cc7
// Derived from PR22167, which failed on some RISC targets. The call to // foo() has two successors, one normal and one exceptional, and both // successors use &a[0] and x. Expressions involving &a[0] can be hoisted // before the call but those involving x cannot. // { dg-options "-Os" } // { dg-do run } int a[4]; ...
google
chromium
ptrmem5
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/ptrmem5.C
292
utf_8
84530a6d66888302453a1415559319c5
// PR tree-opt/18904 // { dg-do compile } // { dg-options "-O3" } struct Data; struct Wrapper { Data* D; }; struct Data { int X; void init(Wrapper&); }; void Data::init( Wrapper &w ) { int Data::* res = &Data::X; w.D = this; for( int i = 0; i < 4; i++ ) (w.D->*res) = 0; }
google
chromium
nrv1
.C
native_client/nacl-gcc/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
chromium
pr15054
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/pr15054.C
525
utf_8
ce93d5cdf106ea7731b61f4421ac7fd8
// PR middle-end/15054 // This used to abort due to overlapping stack temporaries. // { dg-do run } // { dg-options "-O" } extern "C" void abort (void); struct pointer { void* ptr; pointer(void* x = 0) : ptr(x) {} pointer(const pointer& x) : ptr(x.ptr) {} }; struct element { int canary; element() : cana...
google
chromium
eh1
.C
native_client/nacl-gcc/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
chromium
static2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/static2.C
189
utf_8
8423b578cde01fb65b9fcfbfb4cf06cd
// PR 5571 // { dg-options "-O2" } template <class T> struct A {}; struct B { static A<int> a; void f() { a; } }; A<int> B::a = A<int>();
google
chromium
static5
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/static5.C
319
utf_8
e6a6097b4d5bd61ae38897f3b753019c
// PR c++/31809 // { dg-do run } // { dg-options "-O2" } struct S { unsigned v; static inline S f (unsigned a); }; inline S S::f (unsigned a) { static S t = { a }; return t; } const static S s = S::f (26); extern "C" void abort (void); int main () { S t = s; if (t.v != 26) abort (); return 0; }
google
chromium
static3
.C
native_client/nacl-gcc/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
chromium
pr17697-1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/pr17697-1.C
452
utf_8
12d4b0003e16ec3f7d70dc927be21000
// PR tree-optimization/17697 // { dg-do run } // { dg-options "-O2" } extern "C" { extern int strcmp (const char *s, const char *t) throw () __attribute__ ((pure)); } namespace A { extern int strcmp (const char *s, const char *t); } inline int A::strcmp (const char *s, const char *t) { return ::strcmp (s,...
google
chromium
pr25005
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/pr25005.C
569
utf_8
ca5cdb74119d9bef0cb07e16f7c3c88e
// PR target/25005 // { dg-options "-O2 -funroll-loops" } // { dg-do compile } inline void *operator new (__SIZE_TYPE__, void *__p) throw() { return __p; } struct M { ~M() { } }; struct P { P () { v[0] = 0; v[1] = 0; v[2] = 0; } P (const P &x) { for (int i = 0; i < 3; ++i) v[i] = x.v[i]; } double v[3]; }; str...
google
chromium
compound1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/compound1.C
168
utf_8
c4554b5d4200bad32c81fd1af4c0f3de
// PR c++/33709 // { dg-do compile } // { dg-options "-O2" } class S { virtual void foo (); }; struct T { S *s; void bar (unsigned x) { s = (new S[1]) - x; } };
google
chromium
expect2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/expect2.C
239
utf_8
e8a21bcc87a675b894f8d5ad9b5b0170
// PR c++/13392 // { dg-do compile } // { dg-options "-O0" } extern "C" void abort (void); struct X { ~X () throw() {} }; bool foo (X s = X ()) { return false; } void bar () { __builtin_expect (foo () && true, 1) ? 0 : (abort (), 0); }
google
chromium
pr17624
.C
native_client/nacl-gcc/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
chromium
switch1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/switch1.C
277
utf_8
5ed0d3826b9088598be9656c25162529
// { dg-options "-O1" } template <typename T> int f(T t) { switch (t) { case 1: return 5; case 2: return 6; case 3: return -4; case 4: return 8; case 5: return 12; case 6: return 13; default: return -27; } } template int f(int);
google
chromium
range-test-1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/range-test-1.C
7,309
utf_8
96e85c11cbf5f478b281be4fdf987288
// Test fold-const.c (fold_range_test) optimizations. // { dg-do run } */ // { dg-options "-O2" } */ #ifndef __RANGE_TEST_HDR_INCL #define __RANGE_TEST_HDR_INCL /* Protect against fix-header weakness */ #include <stdlib.h> #include <stdio.h> #include <limits.h> #endif #if (INT_MAX == 2147483647) && (INT_MIN == -21474...
google
chromium
placeholder1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/placeholder1.C
160
utf_8
1b20239db4498d5cce85a900755fb433
// PR rtl-optimization/15159 // { dg-options "-O2" } struct S { S (); }; struct P { P (S *); }; void foo (const P &); void bar () { P p = new S; foo (p); }
google
chromium
pr15054-2
.C
native_client/nacl-gcc/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
chromium
stack1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/stack1.C
2,937
utf_8
64cddd41580d4c444ced76036ddd036a
// PR optimization/11198 // The compiler used to allocate the same stack slot for two aggregates, // overlooking that assignments to members given the same address on the // stack may not alias and thus may be reordered by the scheduling passes. // { dg-do run } // { dg-options "-O2 -frename-registers" } double zero_; ...
google
chromium
float1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/float1.C
421
utf_8
d48bf743fe7cd2670b77dd76e8fc1714
// PR optimization/11637 // This used to fail to assemble on x86 because a decimal // floating point litteral was emitted, which originated // from a bogus REG_EQUAL note not removed by the combiner. // { dg-do assemble } // { dg-options "-O2 -fnon-call-exceptions" } void f(long int seed); void g(float &o) { float a ...
google
chromium
emptyunion
.C
native_client/nacl-gcc/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
chromium
const5
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/const5.C
424
utf_8
21c55b941a72d23fcdeb0dbff8b7b415
// We don't have a good way of determining how ".rodata" is spelled on // all targets, so we limit this test to a few common targets where we // do know the spelling. // { dg-do compile { target i?86-*-linux* x86_64-*-linux* } } // { dg-final { scan-assembler "\\.rodata" } } template <typename T> struct B { int i; }...
google
chromium
pr14888
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/pr14888.C
365
utf_8
8fb7e68e9e9b5eb02628e03f5333e645
// PR target/14888 // This used to ICE because the truncdfsf2 isn't completely eliminated // { dg-do compile } // { dg-options "-O2 -ffast-math" } class xcomplex { public: float re, im; xcomplex &operator*= (const float &fact) { re*=fact; im*=fact; return *this; } }; void foo (xcomplex &almT, xcomplex &almG) ...
google
chromium
nrv13
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/nrv13.C
731
utf_8
64f9c4b7ac5155de7756890af79b38cb
// PR tree-optimization/32353 // { dg-do run } // { dg-options "-O2" } extern "C" void abort (); struct A { int f; A (int x) : f (x) {} }; A foo (const A &x, const A &y) { A r (0); r = x.f == -111 ? y : (y.f == -111 || x.f > y.f) ? x : y; A s (0); r = r.f == -111 ? s : (r.f > s.f) ? r : s; return r; } ...
google
chromium
nrv4
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/nrv4.C
406
utf_8
b2773b15109a2fc43572a97edf29b236
// PR optimization/7145 // Bug: The NRV optimization caused us to lose the initializer for 'ret'. // { dg-options -O } // { dg-do run } struct GdkColor { long pixel; short red; short green; short blue; }; inline GdkColor mkcolor() { GdkColor ret={0,1,2,3}; return ret; } int main() { GdkColor col=mkcol...
google
chromium
dtor3
.C
native_client/nacl-gcc/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
chromium
pr36187
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/pr36187.C
906
utf_8
4f1c59fff71e91fcca07fc5604a22f07
/* { dg-do run } */ /* { dg-options "-O2 --param max-aliased-vops=20" } */ extern "C" void abort (void); enum SbxDataType { SbxINTEGER, SbxDECIMAL, SbxBYREF = 0x4000 }; struct SbxValues { union { float nSingle; float* pSingle; }; SbxDataType eType; }; static bool ImpPutDoubleFoo( SbxValues* p) { bool...
google
chromium
pr19108
.C
native_client/nacl-gcc/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
chromium
pr23056
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/pr23056.C
139
utf_8
5b3e2f8cbfc0d9247561a93b1028c186
// PR c++/23056 // { dg-do compile } template <bool T> struct S { virtual ~S(); }; void foo () { static_cast<bool>("Foo"); } S<true> a;
google
chromium
const3
.C
native_client/nacl-gcc/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
chromium
pr18968
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/pr18968.C
178
utf_8
92af3809e34a8d30b737f310d7e57654
// { dg-do compile } // { dg-options "-O1" } struct X { int i; }; struct Y : virtual X {}; struct Z : Y {}; struct A { Z* p; A(); }; A::A() : p(0) { ((X*)(Y*)p)->i++; }
google
chromium
longbranch1
.C
native_client/nacl-gcc/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
chromium
reg-stack3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/reg-stack3.C
373
utf_8
3150d3bfe22de91401bf7cbcd067207d
// PR target/12712 // This used to segfault on x86 because the reg-stack pass // created an unreachable basic block by purging an outgoing // edge, and was not prepared to handle it. // { dg-do compile } struct A { ~A(); float f(float x); float g() const {return 0;} }; void h() { A a, b; a.f(b.g() + 1); }
google
chromium
inline12
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/inline12.C
293
utf_8
ade9d860b214762222f5c8cd67008323
// PR tree-optimization/33458 // { dg-do compile } // { dg-options "-O" } inline void foo (int *p, int n) { for (; n > 0; --n, ++p) *p = 0; } struct A { int x[2]; A () { foo (x, 2); } }; inline A getA () { return A (); } struct B { A a; B (); }; B::B () : a (getA ()) { }
google
chromium
interface2
.C
native_client/nacl-gcc/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
chromium
alias3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/alias3.C
649
utf_8
91fe29b9b1f08a3ca87595896db03497
// { dg-options "-O2" } C f1 (C x) { return x; } void f2 (short)__attribute__ ((noinline));; short s; void f2 (short s_) { s = s_; } C g (C x)__attribute__ ((noinline)); C g (C x) { x = f1 (x); f2 (*x); return x; } int main () { short p[2] = { 0x1234, 0x5678 }; C x (p, 1); g (x); return s != p[1]; }
google
chromium
anchor1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/anchor1.C
1,048
utf_8
76a1ade7c3b02a35300f798365e098d3
// { dg-do run } // { dg-options "-O2" } // The size of the construction vtable for YFont in YCoreFont was not // updated to reflect its actual size. On targets with section anchor // support, the vtable for YCoreFont was laid out immediately after // that, but the compiler thought it was about 40 bytes closer to the...
google
chromium
tmp1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/tmp1.C
1,031
utf_8
240c5e869a8b5ad0a8bf6049a8d00862
// { dg-do run } // compound exprs were causing additional temporaries. extern "C" int printf (char const *, ...); extern "C" void abort (); static unsigned order[] = { 1, 2, 502, 102, 101, 0 }; static unsigned point; static void Check (unsigned t, unsigned i, void const *ptr, char const *name) { printf ("%d %d ...
google
chromium
pr24780
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/pr24780.C
279
utf_8
80bd32221811a65643ddd8ba225d7d48
// PR c++/24780 // { dg-do compile } template<typename S=int> struct Move { Move(); static Move<S> const MOVES[2][2]; }; template<typename S> Move<S> const Move<S>::MOVES[2][2]={}; typedef Move<int> const MoveClass; void moves(int x, int y) { &MoveClass::MOVES[x][y]; }
google
chromium
complex1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/complex1.C
140
utf_8
36372e9d039276c581f0a32167271310
// PR tree-opt/21994 // { dg-do compile } // { dg-options "-O2" } _Complex float f(void); _Complex float g(void) throw() { return f(); }
google
chromium
temp2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/temp2.C
966
utf_8
3a03380a215b8d907bcfc208d09d5204
// { dg-do run } // Originally from PR 16681, found also in init/array15.C // This variant of the testcase verifies that we do not create // a temporary on the stack, which is PR 27620. int i; extern "C" void *memcpy (void *dest, const void *src, __SIZE_TYPE__ n) { char *d = (char *) dest; const char *s = (const ch...
google
chromium
pr15551
.C
native_client/nacl-gcc/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
chromium
call1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/call1.C
209
utf_8
def63acb8ef99a4c443fc492c744024e
// { dg-options "-O2" } void a (void (*f)()) { f(); } struct RunState { static void runcallback() { } static void wait() { a (runcallback); } }; int main() { RunState::wait(); return 0; }
google
chromium
ptrmem4
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/ptrmem4.C
222
utf_8
487df22214708e120d70825e74769ba6
// { dg-do compile } // { dg-options "-O3" } struct X { void foo (); }; template <typename> inline void spawn (void (X::*fun_ptr)()) {} void bar () { void (X::*const comp)() = &X::foo; spawn<int> (comp); }
google
chromium
pr16693-2
.C
native_client/nacl-gcc/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
chromium
pr19650
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/pr19650.C
1,810
utf_8
b7cdbcea5a86232321c1cb34701e6a9f
// { dg-options "-O1 -w -fpermissive" } // { dg-do "run" } // Tests the fold bug described in PR 19650. #include <stdio.h> #include <stdlib.h> #define test(a) ((a) ? 1 : 0) typedef int (*arg_cmp_func)(); class Item_func { public: enum Functype { UNKNOWN_FUNC, EQ_FUNC, EQUAL_FUNC }; virtual enum Functype func...
google
chromium
pr18683-1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/pr18683-1.C
482
utf_8
b2ae3464686798e5eff26df852913eff
// PR middle-end/18683 // { dg-do compile } // { dg-options "-O0" } template<typename _CharT> struct basic_ostream { basic_ostream& operator<<(int __n); }; extern basic_ostream<char> cout; template<int> struct linear_congruential { template<class CharT> friend basic_ostream<CharT>& operator<<(basic_ostream<...
google
chromium
reload3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/reload3.C
843
utf_8
cc59a920019c5a1283b69a21d8bdd150
// PR target/38287 // { dg-do run } // { dg-options "-O2 -mcpu=v8 -fPIC" { target { { sparc*-*-* } && { ilp32 && fpic } } } } #include <cstdlib> class QTime { public: explicit QTime(int ms = 0) : ds(ms) {} static QTime currentTime() { return QTime(); } QTime addMSecs(int ms) const; int msecs() const {...
google
chromium
pr27826
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/pr27826.C
203
utf_8
f29c0bb6b9b69984ecfcac1439154146
/* { dg-do compile } */ /* { dg-options "-O3" } */ struct Geometry { int type:16; }; struct Geometry get() {}; int f() { struct Geometry test; return get().type == test.type; }
google
chromium
devirt1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/devirt1.C
196
utf_8
b78629432d8191727f95c1df6d1b5557
// { dg-do compile } // { dg-options "-O" } // { dg-final { scan-assembler "xyzzy" } } struct S { S(); virtual void xyzzy(); }; inline void foo(S *s) { s->xyzzy(); } void bar() { S s; foo(&s); }
google
chromium
cfg4
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/cfg4.C
730
utf_8
2bb81d8b4e035fe5f91ce41ef3284779
// PR optimization/13067 // This used to fail on the tree-ssa because of "out-of-ssa" // We might have a valid variable, but not a valid value when trying to find // useless statements created by out-of-ssa translation. In this case // val will be set to null, then later dereferenced. Bad. // { dg-do compile } // {...
google
chromium
eh3
.C
native_client/nacl-gcc/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
chromium
pr34036
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/pr34036.C
594
utf_8
948b9afc167841a68f26959f0d915ee0
/* { dg-do compile } */ /* { dg-options "-O2 -fnon-call-exceptions -ffast-math -fsignaling-nans" } */ /* { dg-warning "-fassociative-math disabled" "" { target *-*-* } 1 } */ template <class T> class ggStaticArray { public: ~ggStaticArray(); }; template <class T> class ggGrid { public: ggGrid() : grid() { } ggS...
google
chromium
const1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/const1.C
2,491
utf_8
815190a461caeca9af90923572df6303
// This testcase was miscompiled on IA-64 to read from unitialized memory // and dereference it. // { dg-do run } // { dg-options "-O2" } struct A { A () { a = 1; } void a1 () { a++; } bool a2 () { return !--a; } unsigned int a; }; struct B {}; template <class T> struct C { C () {} C (const T& t) : c (t)...
google
chromium
covariant1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/covariant1.C
562
utf_8
fe3330f4dcc4be90e5790ce38f643df9
// PR c++/20206 // { dg-do run } // { dg-options "-O0" } void bar (int x) { asm ("" : : "g" (x)); } struct S { S () {}; virtual ~S () {}; }; struct T { virtual T *foo (int) {}; }; struct V : virtual S, virtual T {}; struct V v; struct U : public S, public T { bool a; U () {} virtual ~U () {} virtual V *foo ...
google
chromium
loop2
.C
native_client/nacl-gcc/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
chromium
pr17724-3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/pr17724-3.C
417
utf_8
159caaf3ecf96a86d91ffdb2a401e612
// PR tree-optimization/17724 // { dg-do compile } // { dg-options "-O2" } extern "C" char *strcpy (char* d, const char* s) throw (); 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 { c...
google
chromium
20050511-1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/20050511-1.C
1,134
utf_8
80450d00a25790eac61041efe3b30bc0
/* { dg-do run } */ /* { dg-options "-w" } */ /* { dg-options "-O3 -w" { target powerpc*-*-* } } */ #include <stdio.h> #include <stdlib.h> // The VxWorks kernel headers define their own UINT32 #if defined __vxworks && !defined __RTP__ #define UINT32 my_UINT32 #endif typedef signed short SINT16 ; typedef unsigned long...
google
chromium
cse2
.C
native_client/nacl-gcc/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
chromium
loop1
.C
native_client/nacl-gcc/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
chromium
pr17724-4
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/pr17724-4.C
408
utf_8
a756ddc55da373498280cb4569b36df4
// PR tree-optimization/17724 // { dg-do compile } // { dg-options "-O2" } extern "C" 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
chromium
pr6713
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/pr6713.C
2,423
utf_8
ac2356162f00cd5e8804482480f1795a
// PR optimization/6713 // This testcase segfaulted on x86 because a dangling REG_EQUAL note // resulted in incorrect substitutions later. // { dg-do run } // { dg-options "-O2" } template<typename _CharT> class basic_iterator { public: basic_iterator(_CharT* _p) : _M_current(_p) {} basic_iterator& operator+...
google
chromium
reg-stack
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/reg-stack.C
635
utf_8
8c97bd5e5c1c0f5ce05a0c69a6e6df27
// PR target/6087 // The code that moves around insns emitted by reg-stack to cope with // exception edges lost the REG_DEAD note indicating a pop. Which // eventually fills up the register stack resulting in Z == NaN. // { dg-do run } // { dg-options "-O" } extern "C" void abort (); struct Base { virtual ~Base()...
google
chromium
inline8
.C
native_client/nacl-gcc/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
chromium
pr17411-1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/pr17411-1.C
276
utf_8
e3aba5b07f3934dcb30e156cc679a866
// PR middle-end/17411 // { dg-do compile } // { dg-options "-O2" } struct CalibData { float mean_pedestal; }; struct pair { CalibData second; pair(const CalibData& __b) : second(__b) { } }; void insert(const pair& __x); void foo() { insert(pair(CalibData())); }
google
chromium
pr26179
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/pr26179.C
308
utf_8
9590b7328fb217704747cb8432db6f9e
/* The problem here is that Load PRE on the tree level forgot to handle RETURN_DECL which causes us to ICE. */ // { dg-do compile } // { dg-options "-O2" } struct a { int i; }; void h(struct a&); void l(void); struct a g(void) { struct a fl; h(fl); if (fl.i) l(); fl.i+=2; return fl; }
google
chromium
pr23299
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/pr23299.C
572
utf_8
8649f7896552ca6fbd94cc9825bd264c
// PR rtl-optimization/23299 // { dg-do run } // { dg-options "-Os" } extern "C" void abort (); struct A { virtual int a () {} }; struct B : public A { virtual int b () {} }; struct C : public A { virtual int c () {} }; struct D { D () { d = 64; } ~D (); int d; }; int x; D::~D () { x |= 1; if (d != 6...
google
chromium
switch4
.C
native_client/nacl-gcc/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
chromium
pr14029
.C
native_client/nacl-gcc/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
chromium
nrv7
.C
native_client/nacl-gcc/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
chromium
pr19768
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/pr19768.C
468
utf_8
45d19dda46c647dc885d443b5fced384
// PR tree-opt/19768 // tree DSE was removing one store to LL.currentLevel // but forgot that since the vop was in an abnormal PHI // that we have to update the SSA_NAME which we propagate // into the abnormal PHI // { dg-do compile } // { dg-options "-O" } struct LeveLogger { int currentLevel; }; extern LeveLo...
google
chromium
inline4
.C
native_client/nacl-gcc/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
chromium
pr17724-5
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/pr17724-5.C
413
utf_8
cffbcf404312fe67a6054e66e6bb6ace
// PR tree-optimization/17724 // { dg-do compile } // { dg-options "-O2" } extern char *strcpy (char* d, const char* s) throw (); 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 ...
google
chromium
pr20931
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/pr20931.C
359
utf_8
fbf4a598c8089049715d4d2af8e480b8
// PR middle-end // This testcase ICEd because fold checking saw a type change which // is allowed as TYPE_CONTAINS_PLACEHOLDER_INTERNAL could change. // { dg-do compile } // { dg-options "-O2" } int __finite (double __x) throw () { return (__extension__ (((((union { double __d; int __i[2]; }) {__d: __x}).__i[1...
google
chromium
nrv10
.C
native_client/nacl-gcc/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
chromium
pr23478
.C
native_client/nacl-gcc/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
chromium
pr40496
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/pr40496.C
356
utf_8
a10d4b77b14c3ef4080f99f298383120
// { dg-do compile } // { dg-options "-O2 -fprefetch-loop-arrays -msse2" { target i?86-*-* x86_64-*-* } } struct DOMStringHandle { unsigned int fLength; int fRefCount; }; static void *freeListPtr; void foo(DOMStringHandle *dsg) { int i; for (i = 1; i < 1023; i++) { *(void **) &dsg[i] = freeListPtr; ...
google
chromium
nothrow1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/nothrow1.C
434
utf_8
50e5944dd7f93a4f4ec66fa768db7684
// Test that the nothrow optimization works properly. // { dg-do compile } // { dg-options "-O -fdump-tree-optimized" } extern void blah() throw(); int i, j, k; int main() { try { ++i; blah(); ++j; } catch (...) { return -42; } } // The catch block should be optimized awa...
google
chromium
inline10
.C
native_client/nacl-gcc/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
chromium
static6
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/static6.C
425
utf_8
f8fa04e44f6fd70dc42a62899c9f64d6
// PR c++/31806 // { dg-do run } // { dg-options "-O2 -fno-inline -fno-threadsafe-statics" } extern "C" void abort(void); struct A { void *d; }; static const A& staticA() { static A s_static; return s_static; } void assert_failed() { abort(); } A testMethod() { static const A& s = staticA( ); ...
google
chromium
nrv15
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/nrv15.C
1,144
utf_8
4ed264b192fadaa6f3076ca27b4fc086
// PR debug/39086 // { dg-options "-g -O -fno-tree-sra" } struct A { int v; }; A ax; struct B { static A f1 () { return ax; } static bool f2 (); static A f3 (); }; struct C { A f4 () { A x; if (__builtin_expect (this->f6 () < this->f12 (), true)) x = B::f1 (); else x = this->f7 (); ...
google
chromium
cse3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/cse3.C
1,007
utf_8
110fc27204a84af6a62744d613b30944
// This testcase resulted in invalid code generation on x86_64 targets // due to a bug in fold_rtx. For a "true" value, fold_rtx represented it // as const_true_rtx in floating-point mode, if the FLOAT_STORE_FLAG_VALUE // macro is not defined. // { dg-do run } // { dg-options "-O1 -fno-guess-branch-probability -fcse-f...
google
chromium
alias2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/alias2.C
1,056
utf_8
15bcb0db43b0a7c6f0b1a4ff014da35d
// { dg-do run } // { dg-options "-O2" } extern "C" int printf (const char*, ...); struct _Deque_iterator { int _M_cur; int x[2]; int* _M_node; _Deque_iterator() : _M_cur(0), _M_node(0) {} _Deque_iterator(const _Deque_iterator& __x) : _M_cur(__x._M_cur), _M_node(__x._M_node) {} }; class _Deque_b...
google
chromium
array2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/array2.C
210
utf_8
004765f1bd46208118158a52b348e859
/* { dg-do compile } */ /* { dg-options "-O2" } */ struct JArray { int data[1]; }; void *copyIntoByteArray (struct JArray *dest, __SIZE_TYPE__ offset) { void *pdest = dest->data + offset; return pdest; }
google
chromium
pr17697-3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/pr17697-3.C
394
utf_8
09e65527612dc3099d57c0849f92ed55
// PR tree-optimization/17697 // { dg-do run } // { dg-options "-O2" } extern "C" int strcmp (const char *s, const char *t); namespace A { extern int strcmp (const char *s, const char *t); } inline int A::strcmp (const char *s, const char *t) { return ::strcmp (s, t); } int foo (const char *x) { return A::str...
google
chromium
cond1
.C
native_client/nacl-gcc/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
chromium
nrv12
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/nrv12.C
528
utf_8
7e63c70f63e2531215d2ce81180e9bd3
/* Verify that gimple-level NRV is occurring even for RESULT_DECLs. *./ /* { dg-do compile { target i?86-*-* x86_64-*-* } } */ /* { dg-options "-O -fdump-tree-optimized" } */ /* { dg-require-effective-target ilp32 } */ struct P { long long l; int a; unsigned int b; P(long long x) : l(x) {} }; P foo (P); P ba...
google
chromium
memcpy1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/memcpy1.C
1,899
utf_8
c957a3148e195478447cb2ddaf3d122e
// PR target/34403 // { dg-do compile } // { dg-options "-O" } typedef unsigned char uint8_t; typedef uint8_t uint8; __extension__ typedef __SIZE_TYPE__ size_t; class csVector2 { public:float x; }; class csBox2 { }; struct iBase { }; struct iClipper2D:public virtual iBase { }; template < class Class > class scfImplemen...
google
chromium
expect1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/expect1.C
264
utf_8
a46d4940a485effb55a52f27a3660542
// PR c++/13239 // { dg-do run } // { dg-options "-O2" } extern "C" void abort (void); struct Y { int i; }; bool foo () { return true; } Y bar () { Y y = {0}; return y; } int main () { __builtin_expect (foo () && (bar ().i) == 0, 0) ? 0 : (abort (), 1); }
google
chromium
template1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/template1.C
391
utf_8
0146d1b3727676ef281dada91e18ba91
// { dg-options "-O2" } // { dg-final { scan-assembler-not "\n_?_ZN1AILi0EE4foo1Ev\[: \t\n\]" } } template <int> struct A { void foo1 () throw (); void foo2 (); void UNRELATED (); }; template <> void A<0>::UNRELATED (); template <int dim> inline void A<dim>::foo1 () throw () {} template <int dim> inline...
google
chromium
ptrintsum1
.C
native_client/nacl-gcc/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
chromium
asm2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/asm2.C
154
utf_8
c9481d742a48253660d16743a6beecf9
/* PR inline-asm/15740 */ /* { dg-do compile } */ /* { dg-options "-O" } */ void foo(void) { int a, b; a = 1; b = a + 1; asm ("" : : "m" (a)); }
google
chromium
pr18084-1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/pr18084-1.C
472
utf_8
8ebdd0e826546bdb2f9be82a0c9a3631
// { dg-do run } // { dg-options "-O3" } extern "C" void abort (void); struct X { bool init; void foo() { if (!init) init = true; } void bar() { foo(); } }; typedef unsigned long long int uint64_t; uint64_t mask1, mask2; uint64_t calc() { return mask1 & mask2; } int main() { mask1...
google
chromium
inline7
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/inline7.C
238
utf_8
b7cb98f473e1920797490085dbf7bb94
// PR c++/13543 // { dg-do compile } // { dg-options "-O3" } struct basic_string { basic_string(const basic_string&); }; basic_string operator+(const basic_string& lhs, char); void dumpNode(basic_string start) { dumpNode(start + 'a'); }
google
chromium
bitfield1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/bitfield1.C
186
utf_8
cd9d658bcc74632f8c5f64180e52c3e8
// PR c++/26534 // { dg-do run } // { dg-options "-w -O2" } struct X { unsigned a:4; }; unsigned i; int main() { struct X x = { 63u }; i = x.a; if (i != 15) return 1; }
google
chromium
pr20991
.C
native_client/nacl-gcc/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
chromium
dtor1
.C
native_client/nacl-gcc/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
chromium
new1
.C
native_client/nacl-gcc/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
chromium
pr23714
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/pr23714.C
276
utf_8
a00726702d5f995d777b0a88498791ae
// { dg-do compile } // { dg-options "-O2 -fnon-call-exceptions" } void run (void) { float stack[1]; float *sp = stack; try { float value2 = ((float) *(--sp)); float value1 = ((float) *(--sp)); *(sp++) = (value1 - value2); } catch (int *ex) { } }
google
chromium
pr19317-2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/opt/pr19317-2.C
352
utf_8
0d1816a449bc871b905970e91070536b
// PR c++/19317 // { dg-options "-O2" } // { dg-do run } extern "C" void abort (void); struct A { A () { d = e = 0; f = -1; } A (int x) : d (0), e (0), f (x) { } A b () const; int d; int e; int f; }; A A::b () const { A t; t.f = 10 + this->f; return t; } int main () { A a (100); a = a.b (); ...