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
p3570
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/p3570.C
441
utf_8
c56de2f1a760155687a8422e25fb3ee7
// { dg-do run } // prms-id: 3570 extern "C" int printf(const char *, ...); struct A { void print() {printf("A");} }; struct B : A { typedef A superB; void print() {superB::print(); printf("B");} }; struct C : B { typedef B superC; void print() {superC::print(); printf("C");} }; int main () { ...
google
android
p4104
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/p4104.C
176
utf_8
22d30b8bbd18f04f5de2a5f7e2c4e7a6
// { dg-do run } // prms-id: 4104 template <class T> void F(T &a, void (*P)(T &temp)) { (*P)(a); } template <class T> void G(T &a) { } int main() { int a; F(a, G); }
google
android
ns12
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/ns12.C
232
utf_8
bbb693427523d00af2fdf69c55f7c100
// { dg-do run } namespace { int i = 10; enum fish { one = 1, two = 2, red = 3, blue = 4 }; } extern "C" int printf (const char *, ...); int main(void) { if (i != 10) { return 1; } if (one != 1) { return 2; } }
google
android
eh31
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/eh31.C
311
utf_8
30a2f5acc6fedadf5518dea877209d33
// { dg-do run { xfail sparc64-*-elf arm-*-pe } } // { dg-options "-fexceptions" } int count; class Foo { public: Foo() { ++count; } Foo(const Foo&) { ++count; } ~Foo() { --count; } }; main() { try { throw Foo(); } catch (Foo& object) { if (count == 1) return 0; } return 1; }
google
android
p811
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/p811.C
16,728
utf_8
719feecb4b15a1fe26ce57186c64eb7d
// { dg-do assemble } // { dg-options "" } // This test case caused the compiler to abort at one point in time. // prms-id: 811 class ostream; class streambuf; typedef long streamoff, streampos; struct _ios_fields { streambuf *_strbuf; ostream* _tie; int _width; unsigned long _flags; char _fill; ...
google
android
p3579
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/p3579.C
731
utf_8
b7e7e78063f9c58b7ecd8910a63effd2
// { dg-do run } // prms-id: 3579 extern "C" int printf(const char *, ...); int num_x; class Y { public: Y () { printf("Y() this: %x\n", this); } ~Y () { printf("~Y() this: %x\n", this); } }; class X { public: X () { ++num_x; printf("X() this: %x\n", this); Y y; ...
google
android
p4173
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/p4173.C
478
utf_8
4f6ee516c9189f4a6633e52ad03bfa44
// { dg-do assemble } // { dg-options "-Wall -ansi -pedantic-errors" } // This error happens because lvalue is not done well in the C++ front-end. // NOPs should be lvalues if their arguments are. // NON_LVALUE_EXPRs shouldn't be. // prms-id: 4173 enum TypeKind { RecordTypeKind }; struct Type { enum TypeKind...
google
android
net17
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/net17.C
756
utf_8
e82383c7382af9a2f3860fa185523314
// { dg-do run } // example from the ARM page 292 and 293 extern "C" int printf(const char *, ...); extern "C" void exit(int); int i = 0; class A { public: A() { printf("Doing A\n"); if (++i != 1) exit(1); } }; class B { public: B() { printf("Doing B\n"); if (++i != 2) exit(1); ...
google
android
ns10
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/ns10.C
105
utf_8
80364ad5d626abafba75898156d3b9f1
// { dg-do run } namespace Foo { int bar() { return 0; } } int main() { return Foo::bar(); }
google
android
p4736b
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/p4736b.C
833
utf_8
6f4367f0483ce7f0a154d0c04cb4ec07
// { dg-do run } // prms-id: 4736 class Rep { public: virtual int foo() { return 1; } }; class Rep_1 : public Rep { }; class VBaseMain { public: virtual int foo() { return 2; } }; class OtherVBase { public: virtual int foo() { return 3; } }; class Rep_2 : public Rep { }; class DVBase : public VBaseMain, pu...
google
android
p6578
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/p6578.C
88
utf_8
6305cff2956e86afbcf693994724bcc8
// { dg-do assemble } // prms-id: 6578 struct A { operator int (); }; int i = A();
google
android
p10769b
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/p10769b.C
513
utf_8
f271df16b48e3afe49d5fd41c9889e1b
// { dg-do assemble } // { dg-options "-ftrack-macro-expansion=0" } // prms-id: 10769 #define PMF2PF(PMF) ((void (*)())(PMF)) class A { public: void f1a() { } void main(); } a; class B { public: void bf1() { } } b; void A::main() { void (B::*mPtrB)(B*); (*(void (*)(A*))PMF2PF(mPtrB))(&b); // { dg-error "...
google
android
p2431
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/p2431.C
300
utf_8
2735e2b721c738ef8978ce4b00e2a8be
// { dg-do assemble } // GROUPS passed infinite_loop class A { public: A(A &); // { dg-message "note" } }; class B { public: operator A (); }; class C { public : C() { B b; A a = b;// { dg-error "match" } // { dg-message "candidate" "candidate note" { target *-*-* } 21 } } };
google
android
pt1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/pt1.C
517
utf_8
0d61464bbc8d4965e0bcc3d85dfbae54
// { dg-do run } template <class T, class V> class A { public: A (T at, V av); void print () { } protected: T t; V v; }; template <class T, class V> A<T, V>::A (T at, V av) { t = at; v = av; } template <class T, class V> class B: public virtual A<T, V> { public: B (T at, V av); void print () { } }; ...
google
android
ns11
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/ns11.C
193
utf_8
bececf06bce4b261ae8fcfd6da928cff
// { dg-do run } class Foo { }; namespace A { namespace Foo { int bar() { return 0; } } int mymain() { return Foo::bar(); } } int main() { return A::mymain(); }
google
android
eh28
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/eh28.C
342
utf_8
77cf371488942d7df5bee29391342479
// { dg-do run { xfail sparc64-*-elf arm-*-pe } } // { dg-options "-fexceptions" } #include <typeinfo> int fail = 1; class X { public: virtual void p() { } }; class Y : public X { public: virtual void p() { fail = 0; } }; main() { try { Y y; throw y; } catch (X& x) { x.p(); } catch (...) ...
google
android
p7868
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/p7868.C
517
utf_8
10fbf12cb75d8a0bfcc4c2149def524d
// { dg-do assemble } // prms-id: 7868 struct DIAGTYP { }; struct DIAGTYP1 { struct DIAGTYP; // { dg-error "" } forward declaration void bar() { new struct DIAGTYP; } // { dg-error "" } undefined void foo() { new struct DIAGTYP1; } }; int main () { struct DIAGTYP; // { dg-error "" } forwa...
google
android
pt4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/pt4.C
132
utf_8
88b4a8bb3105a05c27aabf0c65e6b717
// { dg-do assemble } template <char* c> struct B { B() { } }; B<0> bnull; // { dg-error "" } could not convert template argument
google
android
p1989
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/p1989.C
9,255
utf_8
9781f1a45d6ff2d7ea488787966ed81d
// { dg-do assemble } // prms-id: 1989 #define TRUE true #define FALSE false typedef void *Pix; template<class T> struct link { T item; link *next; link *prev; link(const T& t): item(t), prev(0), next(0) { } link(const T& t, link<T> *p, link<T> *n): item(t), prev(p), next(n) { } }; template<c...
google
android
misc11
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/misc11.C
104
utf_8
50eafe2d854e823c0502d93e211bcf29
// { dg-do assemble } // GROUPS passed pt coredump template<class T> class A; void f () { A<int> *a; }
google
android
asm1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/asm1.C
118
utf_8
129bceb4bc33692606a172a18c581baa
// { dg-do assemble } // { dg-options "" } struct A { static void foo() asm("_my_routine"); }; void A::foo() { }
google
android
dyncast6
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/dyncast6.C
208
utf_8
069452d36238432ebbfbcdceb8893624
// { dg-do assemble } #include <typeinfo> class A { public: virtual void j () {} }; class B : public A { }; void x (A& a) { const B& b1 = dynamic_cast<B&>((const A&)a); // { dg-error "" } opps }
google
android
eh56
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/eh56.C
265
utf_8
721631abb8736c7422b3f6ca658cee39
// { dg-do run } // { dg-options "-fexceptions" } struct A { A() { } A(const char *) { } A(const A&) { } ~A() { } }; struct bmf { bmf (const A n) { } ~bmf (void) { } A name; }; void imf (void) { bmf Sabs ("abs"); } int main(void) { imf (); }
google
android
eh37
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/eh37.C
279
utf_8
f052f09a81a548adc57a3e951793cb2d
// { dg-do run { xfail sparc64-*-elf arm-*-pe } } // { dg-options "-fexceptions" } #include <typeinfo> class B { public: int data; B(int i) : data(i) { } } b(42); main() { try { throw &b; } catch (B* b) { if (b->data == 42) return 0; } return 1; }
google
android
eh33
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/eh33.C
334
utf_8
3867225ff984641e86921f4db88a4cac
// { dg-do run { xfail sparc64-*-elf z8k-*-* arm-*-pe } } // { dg-options "-fexceptions" } #include <exception> void my_unexpected() { throw 42; } void foo() throw (int) { throw "Hi"; } int main() { std::set_unexpected (my_unexpected); try { foo(); } catch (int i) { if (i == 42) return 0; } ...
google
android
eh58
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/eh58.C
237
utf_8
b820d9ebc457c4c7452aac881a7adfbf
// { dg-do assemble } // { dg-options "-fexceptions" } struct C { bool mem; ~C(); }; C genTemp(); int foo_notok(int arg) { switch (arg) { case 0: return genTemp().mem; default: return 3; } }
google
android
p658
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/p658.C
1,328
utf_8
2128b4975a9eca5711e8fae9df9ee8b8
// { dg-do run } // prms-id: 658 #include <iostream> #include <cstdlib> /* We may not find the libg++ <bool.h>. */ #ifndef FALSE #define FALSE false #endif #ifndef TRUE #define TRUE true #endif // The VxWorks kernel-mode headers define a macro named "OK", which is not // ISO-compliant, but is part of the VxWorks API....
google
android
scast1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/scast1.C
140
utf_8
3adc1175a5b32a0ce0ca08c6f7bd6dc2
// { dg-do assemble } class A {}; class C {}; int main() { A* a = 0; C* c = static_cast<C*>(a); // { dg-error "" } bad static cast }
google
android
pmf1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/pmf1.C
1,187
utf_8
e05fcf8a9737b8fb16bb9855e30f8117
// { dg-do run } // extern "C" int printf(const char *, ...); class X { public: int a; int f(int); }; class Y { public: int b; int c; int g(int); }; class MD : public X, public Y { public: int c; int hf(int); }; int MD::* pmi0 = &MD::a; int MD::* pmi1 = &MD::b; int MD::* pmi2 = &MD::c; int (MD::* p...
google
android
p2855
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/p2855.C
318
utf_8
1cf0cefd0b27e3b8cf977554203da65c
// { dg-do assemble } // { dg-options "-Wcast-qual" } // prms-id: 2855 class Ctest { private: char* data; public: operator const char *() const; }; Ctest::operator const char *() const { return data; } int main() { Ctest obj; char* temp = (char *)obj; // { dg-error "invalid cast" } temp[0] = '\0'; }
google
android
p710
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/p710.C
692
utf_8
e7b146af94ac9a8c09caf0f119938b97
// { dg-do assemble } // GROUPS passed delete /* Bug Id: PRMS Id: p0000710 Bug is : overloading operator delete in class def not allowed */ /* In addition to this bug, the compiler permits overloading operator delete in the class definition. This is verboten, and should be caught by a regression suite. ...
google
android
bool4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/bool4.C
55
utf_8
69e978fc0ca81f91fb0f670cf32387d8
// { dg-do assemble } void foo(bool arg = (1==0)) {}
google
android
eh12
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/eh12.C
213
utf_8
3fbd53f3e50679f0a3c1aa9139a4d4dd
// { dg-do run { xfail sparc64-*-elf arm-*-pe } } // { dg-options "-fexceptions" } class MyError { }; int main (int argc, char **argv) { try { throw MyError(); } catch (MyError x) { } return 0; }
google
android
eh55
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/eh55.C
337
utf_8
5f1721d5c09cecd3be24d1aec6205ae9
// { dg-do run { xfail sparc64-*-elf arm-*-pe } } // { dg-options "-fexceptions" } #include <exception> #include <stdlib.h> void my_terminate_handler() { exit(0); } void throw_an_unexpected_exception() throw() { throw 1; } int main() { std::set_terminate(my_terminate_handler); throw_an_unexpected_exception(...
google
android
eh54
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/eh54.C
103
utf_8
262974dca680b7a7debb6d5ed0a3fce1
// { dg-do assemble } // { dg-options "-fexceptions" } int main() { try { 1; } } // { dg-error "" }
google
android
dyncast2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/dyncast2.C
377
utf_8
86abb12e108b3cedc02dfb1a813ba683
// { dg-do run { xfail sparc64-*-elf arm-*-pe } } // { dg-options "-fexceptions -w" } // Ensure reference handling works. #include <typeinfo> struct B { virtual int f() { } } ob; struct D : public B { virtual int f() { } } od; main() { B *b=&ob; try { void *vp = &dynamic_cast<D&>(*b); return 1; }...
google
android
sizeof
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/sizeof.C
137
utf_8
d0afc2a3ff6b8a542115e2222fe77431
// { dg-do compile } class Foo { int children[4]; public: unsigned function(void) { return sizeof (((Foo*)0)->children); } };
google
android
warn6
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/warn6.C
841
utf_8
16346793065565bb593c169af2965c42
// { dg-do assemble } // { dg-options "-Woverloaded-virtual" } struct B4 { virtual void bothfardiff(float); // { dg-warning "" } was hidden }; struct B3 : public B4 { }; struct B2 { }; struct B { virtual void baseonly(int); virtual void bothsame(int); virtual void bothdiff(float); // { dg-warning "" } w...
google
android
net8
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/net8.C
539
utf_8
71389a19dcb69af31ad527d15df09a0d
// { dg-do assemble } // { dg-options "-pedantic-errors" } class Base { public: int foo; }; class Derived : public Base { public: int bar; }; void func(Base&); // { dg-message "passing argument 1" } void func2(const Derived& d) { func(d); // { dg-error "invalid initialization" } } void foo (int& a) ...
google
android
warn3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/warn3.C
235
utf_8
2563256f0551307948cae5bc60102644
// { dg-do assemble } // { dg-options "-Wall" } class B { public: B(int) { } }; class D : public B { int member; // { dg-warning "" } reordered D() : member(0), B(member) { } // { dg-warning "" } reordered };
google
android
eh4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/eh4.C
83
utf_8
32ef0149e44d04220f38eed05b06290a
// { dg-do assemble } // { dg-options "-fexceptions" } void foo() { throw 1; }
google
android
ns13
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/ns13.C
111
utf_8
b0789f1b98268e2d7f80d5b25c929e42
// { dg-do assemble } namespace N { struct C { C(); }; } namespace M { struct C { C(); }; }
google
android
p3708
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/p3708.C
1,513
utf_8
ac66cf1afe1f18e49f271d8d0e8992b7
// { dg-do run } // prms-id: 3708 extern "C" int printf (const char *, ...); extern "C" int atoi (const char *); void *ptr; class A { public: A() { printf ("A is constructed.\n"); } virtual void xx(int doit) { printf ("A is destructed.\n"); } }; class A1 { public: A1() { printf ("A1 is constructed.\n"); } virt...
google
android
eh44
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/eh44.C
536
utf_8
deef1561fc322e65c7cadc2c4e9c3724
// { dg-do run { xfail sparc64-*-elf arm-*-pe } } // { dg-options "-fexceptions" } // prms-id: 9159 static unsigned int iCounter = 0; static unsigned int iMax; int fail = 0; class ca { public: ca(int) { if (iCounter++ == iMax) throw (const char*)"iCounter"; } virtual ~ca() { } }; class cc { public:...
google
android
mangle3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/mangle3.C
137
utf_8
a3e73677687a8a5c81621fbc6e5553c5
// { dg-do run } struct ZZ { int p; }; template <int ZZ::* ptr> struct YY { ZZ qq; YY() { } }; int main() { YY<&ZZ::p> ww; }
google
android
misc8
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/misc8.C
158
utf_8
7baa89fdc351351ac514a4fdec32841e
// { dg-do assemble } // GROUPS passed vtable class T { public: virtual ~T() {} }; template<class P> class X : public virtual T {}; int main() { X<int> x; }
google
android
leak1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/leak1.C
435
utf_8
593856051e9e324918f7fd9134403224
// { dg-do run } int count = 0; class T { int i; public: T() { i = 1; ++count; } T(const T& o) { i = o.i; ++count; } T operator +(const T& o) { T r; r.i = this->i + o.i; return r; } operator int () { return i; } ~T() { --count; } } s, b; void bar() { static...
google
android
p7476
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/p7476.C
500
utf_8
568923051a6f75c6fddc0d7ab86212bd
// { dg-do assemble } // prms-id: 7476 class HeapTracked { public: virtual ~HeapTracked() { } static void isObjectAllocation(const HeapTracked *ptr); static void isObjectAllocation(HeapTracked *ptr); }; void HeapTracked::isObjectAllocation(HeapTracked *ptr) { dynamic_cast<const void*>(ptr); dynamic_cast<vo...
google
android
net2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/net2.C
341
utf_8
776bc4dc879552e2838a4f361d21a375
// { dg-do assemble } // Here is another program from the net. class B; class A { // { dg-message "note" } copy ctor candidate private: A(B *); // { dg-message "note" } public: A(long); // { dg-message "note" } }; A a(0); // { dg-error "ambiguous" } // { dg-message "candidate" "candidate note" {...
google
android
virt3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/virt3.C
246
utf_8
02db7475614a1f60376a90ce4b4466ca
// { dg-do assemble } class B { public: int Bi; virtual int g() { return 0; } }; class D : private B { int Di; }; class E : public virtual D, public B { // { dg-warning "" } direct base inaccessible due to ambiguity int Ei; }; E e;
google
android
p2573
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/p2573.C
242
utf_8
a082959685370b1e84cf84f6d14e7426
// { dg-do assemble } // prms-id: 2573 class X { public: int key(); virtual int vkey(); char *add(); }; char *X::add() { char *f1 = (char *) &key; // { dg-error "" } char *f2 = (char *) &vkey; // { dg-error "" } return f1; }
google
android
asm2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/asm2.C
297
utf_8
4361730c74788dfa2cb6c60418e162db
// { dg-do run } // Compile with -S, there should be no references to // LTRAMP in the output. extern "C" int printf (const char *, ...); void sub2 (void (*func) ()) { (*func) (); } int main(void) { extern void sub (void); sub2 (sub); } void sub (void) { printf ("hello world\n"); }
google
android
eh25
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/eh25.C
544
utf_8
4aebc6c16b8807b009dff44fe9481ed2
// { dg-do run { xfail sparc64-*-elf arm-*-pe } } // { dg-options "-fexceptions" } #include <exception> #include <stdlib.h> void my_terminate() { exit (0); // Double faults should call terminate } struct A { A() { } ~A() { std::set_terminate (my_terminate); throw 1; // This throws from EH dtor, shoul...
google
android
dyncast3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/dyncast3.C
332
utf_8
6835b0f0050677acc01b699642f4a892
// { dg-do run { xfail sparc64-*-elf arm-*-pe**-* } } // { dg-options "-fexceptions -w" } // Ensure that the return type of dynamic_cast is the real type. struct B { virtual int f() { } }; struct D : public B { virtual int f() { } int i; } od; main() { B *b=&od; if (dynamic_cast<D*>(b)->i) return 1; ...
google
android
net4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/net4.C
792
utf_8
6ed085cd73d962df4c9fcd30c29b3e12
// { dg-do assemble } // Subject: nested type handling // // The last couple of days I've been struggling with nested types in the // C++ compiler. Frankly, it's a mess! Was it impossible to put the stuff // into the parser instead of the lexer? Well, anyway, to get the following // code to compile: // // struct ...
google
android
p755a
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/p755a.C
250
utf_8
cb11150c8c6f4f167d0545a01519ccb6
// { dg-do run } // It checks to see if you can define your own global delete operator. // prms-id: 755 extern "C" void _exit(int); void operator delete(void *p) throw() { _exit(0); } int main () { int* i = new int; delete i; return 1; }
google
android
s24939
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/s24939.C
125
utf_8
d98aace07ae1f94f01edf1afec351d59
// { dg-do assemble } class A; class B { public: B(); private: A a; // { dg-error "" } }; class A { }; B::B() { }
google
android
init2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/init2.C
87
utf_8
07adef42f807e44f37a5de53e30e2a3e
// { dg-do assemble } struct Foo { Foo (int); }; int bar (Foo); int x = bar (3);
google
android
p6901
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/p6901.C
126
utf_8
f2c302be5b4bfcfe6a838f96e32fd4d4
// { dg-do assemble } // prms-id: 6901 void green() { for (int i = 0; i < 10; i++) {} for (int i = 0; i < 10; i++) {} }
google
android
eh59
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/eh59.C
186
utf_8
792280ad242691137ea2d82056759fbe
// { dg-do run } // { dg-options "-O -funroll-loops" } struct A { ~A(); }; void foo(); int main() { for (int i=0;i<4;i++) { A a; foo(); } } void foo() { } A::~A() { }
google
android
eh53
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/eh53.C
203
utf_8
3f10506613385d154f4f3c9ff3452bb5
// { dg-do run { xfail sparc64-*-elf arm-*-pe } } // { dg-options "-fexceptions -g" } class zeroset { public: ~zeroset () { } }; int main () { zeroset a; try { ; } catch( zeroset ) { } }
google
android
eh13
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/eh13.C
100
utf_8
cd58fc804b26fda0deffec80193914d1
// { dg-do run { xfail arm-*-pe } } // { dg-options "-fexceptions" } #include <string> main() { }
google
android
p5793
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/p5793.C
327
utf_8
077fae62a5b7aeec962ebf2200272b09
// { dg-do assemble } // prms-id: 5793 class temp_string { public: temp_string (const int); temp_string (const char * const); }; class Range { public: Range ( const int); operator int () const ; }; int operator == (const int, temp_string ); void CheckArrayConstraints(void) { if (Range(0L) == 0L) ...
google
android
virt2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/virt2.C
470
utf_8
c9f8fdb0cef02c349b963b6d7b46cb0c
// { dg-do run } struct S0 { virtual int is_kind_of_S1 () const { return 0; } virtual void dummy () { } }; struct S1 : virtual public S0 { virtual int is_kind_of_S1 () const { return 1; } virtual void dummy () { } }; struct S2 : virtual public S0 { virtual void dummy () { } }; struct S3 : public S2, publi...
google
android
p11144
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/p11144.C
265
utf_8
b5b4f062ee7ca457204aa955b5a85d9a
// { dg-do run } // { dg-options "-O" } // prms-id: 11144 class Id { public: int d_i; Id(int i) : d_i(i) {} int value() {return d_i;} } ID(1); Id foo() { return ID; } int main() { const Id &id1 = foo(); const Id &id2 = foo(); return &id1 == &id2; }
google
android
p783
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/p783.C
204
utf_8
368c01f3f90fe646e405891838c2f2f1
// { dg-do run } // prms-id: 783 extern "C" int printf (const char *, ...); class C { public: C() { } ~C() { } }; int main(int argc, char**argv) { C c,d; c = (argc&1) ? C() : d; return 0; }
google
android
net36
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/net36.C
230
utf_8
28f8a18b6b7101562538aef8da543777
// { dg-do assemble } class X; class A { public: void handlerFn(X*); }; typedef void (A::*handler) (X*); class B { public: void setHandler(handler); }; void f(B* b) { b->setHandler(A::handlerFn); // { dg-error "" } }
google
android
offset1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/offset1.C
755
utf_8
3965fc19eb6663be08307c5616215720
// { dg-do run } extern "C" int printf(const char *, ...); void *vp; int fail = 0; class Foo { public: virtual void setName() { printf("Foo at %x\n", this); if (vp != (void*)this) fail = 1; } }; class Bar : public Foo { public: virtual void init(int argc, char **argv) { printf("Bar's Foo...
google
android
thunk1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/thunk1.C
186
utf_8
9e0cfc35c0d2295b4355e5a7b092450b
// { dg-do assemble } struct C1 { virtual ~C1(); }; struct C2 : public virtual C1 { virtual ~C2(); }; struct C3 : public virtual C2 { virtual ~C3(); }; C3::~C3() {}
google
android
eh29
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/eh29.C
363
utf_8
bca23900eef1c34444f983dd30ad6c47
// { dg-do run { xfail sparc64-*-elf arm-*-pe } } // { dg-options "-fexceptions" } int count; class A { public: A() { // printf("ctor %x\n", (int)this); if (count==3) throw 1; ++count; } ~A() { --count; // printf("dtor %x\n", (int)this); } }; main() { try { A a[5]; } catch (...
google
android
err3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/err3.C
105
utf_8
1f0a7db71d7fa6ac9e919a5922c7bd13
// { dg-do assemble } class cb { }; class cc { public: cc() : cb() { // { dg-error "" } } };
google
android
enum1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/enum1.C
266
utf_8
10144c94a2f441305a90efc8f0ae0548
// { dg-do assemble } // Warn if a enum cannot fit into a small bit-field. enum TypeKind { ATK, BTK, CTK, DTK } ; struct Type { enum TypeKind kind : 1; // { dg-warning "" } void setBTK(); }; void Type::setBTK() { kind = DTK; } // { dg-warning "truncate" }
google
android
p9129
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/p9129.C
339
utf_8
f91ed64334b058e6d71346ddb0fd2b21
// { dg-do assemble } // { dg-options "-ansi -pedantic-errors" } // prms-id: 9129 class Foo { public: int DoSomething(); }; int (Foo::*pA)() = { &Foo::DoSomething }; int (Foo::*X[1])(int) = { { &Foo::DoSomething } }; // { dg-error "" } int (Foo::*Y[])(int) = { { &Foo::DoSomething, &Foo::DoSomething, 0 } }; /...
google
android
p7626
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/p7626.C
816
utf_8
3178d0b0d5cb858eeca888d735f5e861
// { dg-do assemble } // prms-id: 7626 int fail; typedef unsigned int UINT; class CObject{}; class CCmdTarget : public CObject { }; typedef void (CCmdTarget::*AFX_PMSG)(void); struct AFX_MSGMAP_ENTRY { AFX_PMSG pfn; }; class CWnd : public CCmdTarget { public: void OnMyMsg() { fail = 1; } // If this o...
google
android
eh52
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/eh52.C
250
utf_8
b510dab899ef0bf0c572e31b58dadecb
// { dg-do run } // { dg-options "-fexceptions -O9" } int promote_mode (int mode, int *punsignedp) { int unsignedp = *punsignedp; *punsignedp = unsignedp; return mode; } int main() { int i; i = promote_mode (42, &i); return i != 42; }
google
android
warn7
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/warn7.C
164
utf_8
c0cce74869cd1549b71d008abc96ecaa
// { dg-do assemble } // { dg-options "-Wall" } const int& foo() { extern int bar; return bar; } const int* baz() { extern int bar; return &bar; }
google
android
warn2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/warn2.C
294
utf_8
5f092c001d9cbc9ff1df604ef1450faa
// { dg-do assemble } // { dg-options "-Wall" } enum Boolean { Ok = 0, NotOk = 1, }; enum OpResult { Succeeded = 0, TempFail = 1, PermFail = 2, }; OpResult fn1() { return TempFail; } extern void foo(); int main () { if (fn1() == Ok) { // { dg-warning "" } foo(); } }
google
android
net21
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/net21.C
662
utf_8
8a2e6c3fb3f01622359acff267ee1ec3
// { dg-do run } // Make sure we can initialize complex (MI ambiguous) vtables. extern "C" int printf(const char *, ...); struct a { virtual void f() = 0; }; struct b { virtual void g() { } }; struct c: public a, public b { virtual void f(); virtual void g(); }; void c::f() { printf("c::f()\n"...
google
android
align2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/align2.C
322
utf_8
4fb6d8a2e9e7a21697897eb5376ee39a
// { dg-do run } class Foo { }; class Bar : virtual Foo { public: int b; } x; int main() { // printf("Foo offset %d\n", (int)(Foo*)&x - (int)&x); // printf("b offset %d\n", (int)&x.b - (int)&x); // printf("sizeof is %d\n", sizeof(Bar)); // This core dumps on a SPARC is alignment is wrong. Bar blist[10]; ...
google
android
misc7
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/misc7.C
235
utf_8
c9236b6c45f41911c2786a0c494cbd04
// { dg-do assemble } // GROUPS passed MI struct S1 { }; struct S2 : S1 { }; struct S3 : S1 { }; struct S4 : S3, S2 { }; struct S1 *p1; struct S4 *p4; void foobar () { p1 = p4; // { dg-error "" } this is illegal// ERROR - .* }
google
android
p6611
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/p6611.C
445
utf_8
3140578e9dcaa7d7356d613cbcfdc303
// { dg-do run } // prms-id: 6611 class COMPLEX { public: COMPLEX(double a, double b=0) { re = a; im = b; } void print() const { } private: double re; double im; }; int main(void) { COMPLEX a[3][3] = { { 1, COMPLEX(2,3), COMPLEX(3,4), }, { 1, COMPLEX(2,3), COMPLEX(3,4), }, { 1, COMPLEX(2,3), CO...
google
android
net46
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/net46.C
364
utf_8
693654781a04b93e6cd44c4144a745d6
// { dg-do run } #include <iostream> #include <cstdlib> #include <cstddef> #include <new> int fail = 1; int in_main = 0; void *operator new(size_t size) #if __cplusplus <= 199711L throw (std::bad_alloc) #endif { if (!in_main) return malloc (size); --fail; return (void*) 0; } int main() { std::cout << "";...
google
android
thunk3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/thunk3.C
449
utf_8
115e216cdda5a2dd749db502b8bc2dbf
// { dg-do run } int state; int fail; class A { public: A() { if (++state != 1) fail = 1; } virtual int foo() { if (++state != 2) fail = 1; return 0; } virtual ~A() { if (++state != 3) fail = 1; } }; A* bar() { return new A; } int main() { A *aptr = bar(); aptr->f...
google
android
fresco1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/fresco1.C
216
utf_8
a1e7ce7dc410f960fdf67a65a9619343
// { dg-do assemble } // This is a Fresco found bug. class WhoCares {}; typedef float Coord; class BugDemo : public WhoCares { public: typedef Coord Matrix[4][4]; virtual void vf1(BugDemo::Matrix m) = 0; };
google
android
p8154
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/p8154.C
399
utf_8
9b2f7221b1057f9366eef01c11cf09cd
// { dg-do assemble } // { dg-options "-w -fpermissive" } // prms-id: 8154 class QvFieldData; class QvNode { QvFieldData *fieldData; }; class QvGroup : public QvNode { static QvFieldData *fieldData; }; class QvUnknownNode : public QvGroup { public: QvUnknownNode :: QvUnknownNode (); private: static QvFieldD...
google
android
ns14
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/ns14.C
152
utf_8
075f2dbb8b6d85c4822f746063384fdb
// { dg-do assemble } namespace Jazz { int horn( int h ) { return 1; } } using Jazz::horn; namespace Jazz { int horn ( char c ) { return 0; } }
google
android
p2960
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/p2960.C
618
utf_8
f9eabf76220ab85f7858705f32bf365c
// { dg-do run } // prms-id: 2960 extern "C" int printf(const char *, ...); class Test0 { public: virtual void f0() { } // works fine if this virtual removed }; class Test1 : public Test0 { public: void f1() { f2(); } // generates bus error here virtual void f2() { printf("Test1::f2\n"); } }; class Tes...
google
android
net26
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/net26.C
447
utf_8
5de271d6f2511783cadfb261027cbb71
// { dg-do run } // A test case found by InterViews testing... extern "C" int printf(const char *, ...); class A { public: int foo() { printf("ok nv\n"); return 0; } virtual int vfoo() { printf("ok v\n"); return 0; } }; struct S { int (A::*pfn1)(); int (A::*pfn2)(); int (A::*pfn3)(); }; // This failed before....
google
android
eh6
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/eh6.C
272
utf_8
3486f5d02b19667a477a3e678734e894
// { dg-do run { xfail sparc64-*-elf arm-*-pe } } // { dg-options "-fexceptions" } extern "C" int printf(const char *, ...); void main1() { throw 1; } int main() { try { main1(); } catch (...) { printf("Unwind works!\n"); return 0; } return 1; }
google
android
p6149
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/p6149.C
88
utf_8
9ec5c6a4192bdb3c75ad240873354bbc
// { dg-do assemble } // prms-id: 6149 int a[3 - sizeof(double)]; // { dg-error "" }
google
android
misc2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/misc2.C
209
utf_8
e7c9db1b2be675ff14addb88e2a90cef
// { dg-do assemble } // { dg-options "-ansi -pedantic" } // GROUPS passed /* -ansi -pedantic-errors should catch this. */ class C { public: extern inline int A() {// { dg-error "" } .* return 1; } };
google
android
thunk2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/thunk2.C
520
utf_8
136b4927aff7a9815802dcaef30303c3
// { dg-do run } #include <typeinfo> int state; int fail; class A { public: A() { if (++state != 1) fail = 1; } virtual int foo() { if (++state != 2) fail = 1; return 0; } virtual ~A() { if (++state != 3) fail = 1; } }; A* bar() { return new A; } int main() { A *ap...
google
android
net18
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/net18.C
335
utf_8
958f63e02561b7efb4c8b51b17f069f3
// { dg-do assemble } class ClassA { public: typedef ClassA& (*PMFV)(const char*); static PMFV setMapper(PMFV); static PMFV _mapper; }; class ClassB { public: typedef ClassB& (*PMFV)(const char*); }; ClassA::PMFV ClassA::setMapper(ClassA::PMFV newFunc) { PMFV oldFunc = _mapper; _mapper = newFunc; ret...
google
android
rtti2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/rtti2.C
70
utf_8
2513b099c9e2ec37fc88cbfeebdf00dc
// { dg-do run } #include <typeinfo> int main() { typeid(bool); }
google
android
p8155
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/p8155.C
3,005
utf_8
cbdb4e245f3353232e9b4d18983cdeea
// { dg-do run } // prms-id: 8155 int fail = 1; class CMainWindow; class CFrameWnd; class CWnd; class CCmdTarget; typedef void (CCmdTarget::*AFX_PMSG)( void); typedef void (CWnd::*AFX_PMSGW)( void); struct AFX_MSGMAP_ENTRY { unsigned int nMessage; AFX_PMSG pfn; }; struct AFX_MSGMAP { const AFX_MSGMAP*...
google
android
eh9
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/eh9.C
104
utf_8
9f75968c804ca5948bb72ccf8edd25d6
// { dg-do run { xfail sparc64-*-elf arm-*-pe } } // { dg-options "-fexceptions" } main() throw () { }
google
android
p3070
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/p3070.C
523
utf_8
1fb2c06275c87273a5ba4ff5af7984d2
// { dg-do assemble } // Caused an Internal Compiler Error. Works now. // prms-id: 3070 class Object { public: virtual ~Object() {} }; class BaseView { protected: virtual void _forwardReceiveUpdate() = 0; }; class View : public BaseView { public: virtual ~View(); }; class TestViewBaseUpdate { protected: ...
google
android
p755
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/p755.C
346
utf_8
8803cf6c10b127dce849e86a3a7fcd39
// { dg-do run } // It checks to see if you can define your own global new operator. // prms-id: 755 #include <new> extern "C" void _exit(int); void* operator new(std::size_t sz) #if __cplusplus <= 199711L throw (std::bad_alloc) #endif { void* p = 0; _exit(0); return p; } int main () { int* i = new int; ...
google
android
p10511
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/p10511.C
181
utf_8
653cff7be2aed2432b42ba1821f0f61e
// { dg-do assemble } // prms-id: 10511 class S { public: enum E {a, b, c}; }; class C { public: bool f (S::E()) { return true; } virtual void foo(); }; void C::foo() { }
google
android
p6004
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.mike/p6004.C
345
utf_8
9aa27ef6f15a2d31fc03755fa465bafe
// { dg-do run } // { dg-options "" } // prms-id: 6004 class A { public: static int foo() asm("_my_routine"); }; int bar1() asm("foo__1A"); int bar2() asm("_foo__1A"); int bar3() asm("__foo__1A"); int bar1() { return 45; } int bar2() { return 44; } int bar3() { return 43; } int A::foo() { return 42; } main() { ...