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 | vaarg2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/vaarg2.C | 1,174 | utf_8 | 8c21b5e35109125a2fe0210c85ae1bc6 | // { dg-do run }
// { dg-options "-Wno-abi" { target arm_eabi } }
// Make sure we can deal with POD aggregate in va_args
#include <stdarg.h>
extern "C" void abort ();
struct X {int m;};
struct Y {int a; int b; int c; int d; int e; int f;};
void fn1(va_list args)
{
int i = va_arg (args, int);
X x = va_arg (args, X)... |
google | android | lookup3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/lookup3.C | 283 | utf_8 | 3bd35389c0d7c63e698e0dd66eac2663 | // { dg-do run }
// Test to make sure that the use of __typeof__ in WIFEXITED works.
int main ()
{
int stat_loc = 0;
(__extension__
({
union
{
__typeof__ (stat_loc) __in;
int __i;
} __u;
__u.__in = (stat_loc);
__u.__i;
})
);
}
|
google | android | rtti5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/rtti5.C | 358 | utf_8 | f57f671f89a2d7c44af7acf386f3fba3 | // { dg-do assemble }
// { dg-options "-fno-rtti" }
// check we don't die with disabled rtti
int main(void) {
int i;
typeid(i); // { dg-error "" } rtti disabled
} |
google | android | inline15 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/inline15.C | 485 | utf_8 | d065f7b802be155187ff416cf56db93e | // { dg-do assemble }
// { dg-options "-O1" }
class Type;
template<class E>
class X
{
public:
X<E>();
inline X<E>(int);
inline ~X<E>();
};
template<class E> const Type &foo(const X<E> *);
template<class E> inline X<E>::X(int x)
{
const Type &a = foo(this);
}
template<class E> inline X<E>::~X()
{
const Type &... |
google | android | dll-4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/dll-4.C | 520 | utf_8 | 17d764709d0c92abbfa72daf5aec6b8e | // { dg-do assemble { target arm-*-*pe } }
// Ensure dllexport overrides dllimport.
// set compiler_result "\.section${spaces}\.drectve\n\[^\n\]*-export:foo1.*\.section${spaces}\.drectve\n\[^\n\]*-export:foo2"
// set not_compiler_result "(__imp_foo1|__imp_foo2)"
__declspec (dllimport) int foo1 ();
__declspec (dllexpor... |
google | android | bitfld5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/bitfld5.C | 77 | utf_8 | b64773507b85e60ad31dac30c11ec352 | // { dg-do assemble }
// { dg-options "-w" }
struct S
{
int i : 1756;
};
|
google | android | lookup16 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/lookup16.C | 576 | utf_8 | 68b1b92ac10f904ef8d7df25feb47671 | // { dg-do assemble }
// Bug 3
// typenames are not injected early enough, [basic.scope.pdecl]3.3.1/4
// indicates this should compile.
struct A {
};
struct B : A {
typedef A Parent;
struct F {
};
};
struct C : B {
typedef B Parent;
struct G {};
struct F : C::Parent::F {
typedef C::Parent::F Parent;
... |
google | android | headers1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/headers1.C | 1,235 | utf_8 | b8e82e677a564e8f59b1b3efcf52cfc8 | // { dg-do run }
//
// This test catches the occasional macro/symbol conflict between
// C++ and system-provided headers.
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <c... |
google | android | field1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/field1.C | 102 | utf_8 | ab5dac12c9731d9f382f77c22f943ed2 | // { dg-do assemble }
struct X
{
static const bool b = true;
static const int i = b ? 1 : 2;
};
|
google | android | string1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/string1.C | 356 | utf_8 | 92b98ec5c36a99fa733a7b345e6d5d26 | // { dg-do assemble }
class Wrapper {
public:
static const char msgPtr[];
static const char *JunkFunc() {
return &msgPtr[0];
}
};
const char Wrapper::msgPtr[] = "Hello world.";
int main() {
const char *p1 = &Wrapper::msgPtr[0];
const char *p2 = Wrapper::JunkFunc();
if (p1 != p2)
return 1;
} |
google | android | dtor9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/dtor9.C | 201 | utf_8 | f3a397572b3d30079dae4262a09ad6dd | // { dg-do run }
int i;
struct CC
{
virtual ~CC () { ++i; }
};
class BB : virtual public CC
{
};
class AA : public virtual BB
{
};
int main ()
{
{
AA xx;
}
if (i != 1)
return 1;
}
|
google | android | conv5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/conv5.C | 186 | utf_8 | b9ae66aae4340b5cdc832fb897055d10 | // { dg-do assemble }
// { dg-options "" }
int foo();
const int (*bar)() = foo; // { dg-error "" } adding const |
google | android | lookup2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/lookup2.C | 139 | utf_8 | a0a6b7f99c096f6cba8f03f9c614a72f | // { dg-do assemble }
struct B {
int i;
};
struct D: virtual public B {
int i;
};
struct D2 : public D {
void f() { i = 3; }
};
|
google | android | init17 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/init17.C | 469 | utf_8 | cc3c1af250386499471f365de78ad096 | // { dg-do assemble }
// Bug 1631. Default initialization of enumeral types did not convert to the
// enumeral type.
enum X { alpha, beta };
void f(void *ptr)
{
X y = X ();
X y1 (0); // { dg-error "" } cannot convert
X y2 = X (0);
X *x = new X ();
X *x2 = new X (0); // { dg-error "... |
google | android | cond6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/cond6.C | 297 | utf_8 | 60cc2216254cf4d88abe1ad138469b1b | // { dg-do assemble }
// Test that the result of `x ? const E : E' is an E rvalue.
enum E { a };
bool b;
int main ()
{
E e1 = a;
const E &er = e1;
E e2 = b ? er : a; // OK
const E* ep = &(b ? er : a); // { dg-error "" } non-lvalue
} |
google | android | sizeof2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/sizeof2.C | 271 | utf_8 | b31eda0e2e2b2a4d007a778a5211d562 | // { dg-do assemble }
struct S
{
int j;
int i[2]; // { dg-error "" "" { xfail *-*-* } } non-static data member
};
void f ()
{
sizeof (S::j);
sizeof (S::i[0]); // { dg-error "" "" { xfail *-*-* } } used here
} |
google | android | typedef2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/typedef2.C | 135 | utf_8 | 7691281c2c879357cb49ac4141e7abdf | // { dg-do assemble }
struct S{
static const int i;
static const int j;
};
typedef S T;
const int T::i = 4;
const int T::j = 4;
|
google | android | friend9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/friend9.C | 429 | utf_8 | 5eea2191994afdf9e4907504265a6124 | // { dg-do assemble }
// Bug 853: We reported the wrong line no for a friend access violation
class F
{
class Internal; // { dg-error "" } is private
};
class C
{
friend class F::Internal; // { dg-error "" } in this context
public:
typedef enum { A, B } e;
C ();
~C();
void m();
}; |
google | android | array6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/array6.C | 226 | utf_8 | e3d968a14c4d5d023f855b46af29bb70 | // { dg-do run }
// { dg-options "-O1" }
int count = 0;
double foo () {
count++;
return 0;
}
double bar () {
const double x[1] = { foo() };
return x[0];
}
int main ()
{
bar();
if (count != 1)
return 1;
}
|
google | android | ref2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/ref2.C | 216 | utf_8 | cc81859ae9c266583b18d8a58fe87aed | // { dg-do assemble }
struct A {
int operator * ();
};
struct B : public A { };
int operator * (B &);
int main ()
{
B b;
B& br = b;
*br;
} |
google | android | crash17 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/crash17.C | 143 | utf_8 | 7976e30c9ad8cf3f397394bd62325bcd | // { dg-do assemble }
class C {
static int const N (1000); // { dg-error "" } invalid declaration
}; |
google | android | rtti2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/rtti2.C | 1,185 | utf_8 | 47269c712b78f6938afa4ebc3cd7cadb | // { dg-do run }
// { dg-options "-frtti" }
// test of rtti of single inheritance and multiple inheritance classes
#include <typeinfo>
extern "C" {
int printf(const char *, ...);
void exit(int);
}
class X {
public:
int xi;
};
class Y : public X {
short ys;
};
class Z : public Y {
int zi;
};
Z z;
Y y;
... |
google | android | virtual5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/virtual5.C | 246 | utf_8 | f183acc74794fda2e8a0f2e69d95b26c | // { dg-do assemble }
// { dg-options "-w" }
class vector {};
class V
{
};
class A : public vector
{
};
class B : public A, virtual V, public vector
{
B() {}
}; |
google | android | ptrmem2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/ptrmem2.C | 410 | utf_8 | 5ea815fbe90353ec75e1c966fd8245fc | // { dg-do assemble }
class cow {
public:
void moo (char *);
};
void f()
{
cow* c;
void (cow::*fp0)(char*) = &cow::moo; // OK
void (cow::*fp1)(int) = &cow::moo; // { dg-error "" } conversion
int (cow::*fp2)(char*) = &cow::moo; // { dg-error "" } conversion
int (cow::*fp3)(char*, void*) = fp2; // {... |
google | android | typedef6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/typedef6.C | 270 | utf_8 | 24954a094357425d2ce1a0a996eb4186 | // { dg-do assemble }
// Bug: g++ fails to see through the T typedef in the C ctor.
struct A {
A (int) { }
};
typedef A T;
struct B: public virtual T {
B (): T(1) { }
};
struct C: public B {
C (): T(1) { }
}; |
google | android | inline21 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/inline21.C | 634 | utf_8 | 7a3ef5192a33feec85ef28205357b71b | // { dg-do run }
// { dg-options "-O2" }
// DECLARATIONS
struct Record {
Record (int bb) :
b (bb)
{ }
int extra; // Having an extra member in record is crucial.
int b;
};
struct Container {
Record record;
// The const on the next line is crucial.
Container ( const Record b) : re... |
google | android | crash2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/crash2.C | 246 | utf_8 | ac66e95a7eb0f724b07b49df214cb0be | // { dg-do assemble }
struct A {
int rep;
static const A a(0); // { dg-error "" } initialization
static const A b = 3; // { dg-error "" } initialization
static const A& c = 2; // { dg-error "" } initialization
A(int x) : rep(x) {}
};
|
google | android | cast6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/cast6.C | 1,657 | utf_8 | e756897428a8086edd93bb63250c2b81 | // { dg-do assemble }
// We failed to reject static_cast and implicit conversions of pointers to
// member that traversed a virtual base.
struct bar
{
int barm;
static void a();
};
struct filler1 {int fm;};
struct filler2 {int fm;};
struct filler3 {int fm;};
struct filler4 {int fm;};
struct baz : filler1, bar, f... |
google | android | refinit1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/refinit1.C | 258 | utf_8 | 2b5e35f667bf97fa9e5512c25a5c776b | // { dg-do assemble }
// Test that we don't allow multiple user-defined conversions in reference
// initialization.
struct B { };
struct A {
A (const B&);
};
struct C {
operator B ();
};
C c; |
google | android | cond7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/cond7.C | 523 | utf_8 | 1d89ee7d1846d1e50779a90e46fc5a7e | // { dg-do assemble }
//
// Bug 3416. We left some unchecked overloaded functions lying around.
struct X
{
void operator << (int);
void operator << (float);
};
void OVL1 (int);
void OVL1 (float);
void OVL2 (int);
void OVL2 (float);
X x;
void foo (bool a)
{
x << (a ? OVL1 : OVL2); // { dg-error "" } incomplete t... |
google | android | overload13 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/overload13.C | 222 | utf_8 | 52b8dcde24c324a2d8dc19ecd0d0eb40 | // { dg-do assemble }
struct A {
bool operator== (A const &);
operator bool () const;
operator int * () const;
};
bool foo (A &a1, A &a2)
{
return a1 == a2;
} |
google | android | lookup12 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/lookup12.C | 202 | utf_8 | 498b648156e20d27ee54c22b9aa0a165 | // { dg-do assemble }
struct B {
struct X {};
};
struct D : public B {
void X();
struct X x;
void f();
};
void D::f()
{
struct X y;
} |
google | android | vbase2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/vbase2.C | 298 | utf_8 | 25e374f2166f5b9af6e33b6d1797ed8b | // { dg-do run }
int i;
struct A
{
~A ();
};
A::~A () {
i = 1;
}
struct B : virtual public A {
};
struct C {
C ();
B b;
};
C::C () {
throw 3;
}
int main ()
{
try {
C c;
} catch (...) {
}
if (i != 1)
return 1;
} |
google | android | defarg3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/defarg3.C | 131 | utf_8 | 66bed1c478469224297df66607f38744 | // { dg-do assemble }
int* hp;
int* jp;
void f (int *ip, int kp = hp - jp)
{
} |
google | android | crash14 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/crash14.C | 188 | utf_8 | a41c516fa6d4cda9be81fec03b88b214 | // { dg-do assemble }
struct S
{
};
struct T : public S
{
};
struct U : public T
{
};
void f (U);
int main ()
{
U u;
f (u);
} |
google | android | cleanup4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/cleanup4.C | 359 | utf_8 | da96bf64cf2b426e4b27b07809d4d55f | // { dg-do assemble }
// { dg-options "-O2 -fno-exceptions" }
class foo
{
public:
foo ();
~foo ();
};
class bar
{
public:
bar ();
bar (const foo&);
};
int i;
foo f ();
inline bar x ()
{
switch (i)
{
case 0: return bar (f ());
default: return bar ();
}
}
bar y ()
{
return x ();
} |
google | android | optimize2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/optimize2.C | 1,172 | utf_8 | d5d37e6cb7f00378dcaaddfcc4604637 | // { dg-do run }
// { dg-options "-O2" }
//
// Bug 2823. Inlineing the body of a thunk broke things. But that's
// rarely a sensible thing to do anyway.
#include <cstdio>
#include <cstdlib>
int objCount = 0;
struct Thing
{
int count;
Thing ();
Thing (Thing const &src);
~Thing ();
};
Thing::Thing ()
:c... |
google | android | dll-2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/dll-2.C | 651 | utf_8 | d967c7f394d25e627016c2e15ede2890 | // { dg-do assemble { target arm-*-*pe } }
// Microsoft's MSVC 2.0 allows dllimport followed by dllexport for variables,
// but does not allow dllexport followed by dllimport.
//
// Switching between dll{export,import} works for functions.
// We test for that too (by ensuring no error is produced).
__declspec (dllimpo... |
google | android | base1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/base1.C | 476 | utf_8 | 36c431a39d28f498a58eb22d770db47a | // { dg-do assemble }
// We lost information about which base wasn't an aggregate type.
typedef int I;
typedef int cI;
struct A {};
typedef const A cA;
typedef A pA;
struct B : I {}; // { dg-error "" } not an aggregate
struct C : cI {}; // { dg-error "" } not an aggregate
struct D : cA {}; // cv-qualified is fine per... |
google | android | crash5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/crash5.C | 175 | utf_8 | 408d886884b4f130230a709d77c58ad3 | // { dg-do assemble }
class TecMesh {};
extern TecMesh& m;
struct X {
X(TecMesh&);
};
struct D {
D();
TecMesh& Mesh;
};
D::D ()
: Mesh(m)
{
X x(D::Mesh);
}
|
google | android | friend1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/friend1.C | 1,416 | utf_8 | f5b511f3ec5f4d24414f371b7643aad5 | // { dg-do assemble }
// f() should be able to access B::j, as of FDIS [class.protected]/1
// Subject: Re: [bug] Inheritance and friend access control broken
// Date: 06 Mar 1998 01:43:18 -0300
template <int*>
class X {};
template <typename T>
void g();
struct S;
template <typename T>
struct R;
class B {
protected:
... |
google | android | using4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/using4.C | 219 | utf_8 | b9957a14eef8c9cfa198dafcb46f2a11 | // { dg-do assemble }
struct foo {
void m();
};
struct bar : foo {
using foo::m;
void m(int);
};
void f() {
bar b;
b.m();
b.m(1);
} |
google | android | string2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/string2.C | 386 | utf_8 | 54063a09aa297bbbcf4708e110652da3 | // { dg-do run }
// A char const array should never be confused for a string literal.
int main ()
{
static const char ary[] = "wibble";
void const *ptr = 0;
ptr = ary;
if (ptr == "wibble")
return 1;
if (ptr != ary)
return 1;
return 0;
} |
google | android | syntax3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/syntax3.C | 553 | utf_8 | ea0aa7ca8d71e498d340c85c8bcc2ddf | // { dg-do assemble }
// and several others. With templates, it's very easy to say something
// erroneous like
// template class X::X<whatever>
// The culprit
// ... class X::X ...
// caused us to ICE as we got confused about pushing and popping scopes.
class X
{
public:
X();
};
class X::X () {} // { dg-e... |
google | android | crash11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/crash11.C | 351 | utf_8 | 476429a62cb15b3c9ee8c125027e40c3 | // { dg-do assemble }
template <typename T>
struct allocator
{
typedef int size_type;
};
template <typename T>
struct string
{
typedef typename allocator<T>::size_type size_type;
static size_type size;
size_type
max_size() const { return size; }
};
template struct string <char>; |
google | android | pmf2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/pmf2.C | 208 | utf_8 | 24409f65f5180d90e9b1dccd3ab7fede | // { dg-do assemble }
struct S
{
void f();
};
void (S ::* pmf) ();
S * pf;
void
f()
{
pmf = & pf->f; // { dg-error "" } not a valid pmf expression
} |
google | android | incomplete | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/incomplete.C | 556 | utf_8 | 5eac42064e4beea7ad7dcd49e3ed88db | // { dg-do assemble }
// gcc represents non-ellipsis parmlists by terminating them with
// a void parm. We need to distinguish between a parmlist of (void), and
// some ill-formed ones.
struct S; // { dg-error "" } forward ref
void f(S); // ok
void f(S s) {} // { dg-error "" } incomplete type
void... |
google | android | typedef3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/typedef3.C | 164 | utf_8 | 8016305c244d25142ebc9bf73cf36155 | // { dg-do assemble }
template<class T>
struct X{
T v;
X(){}
virtual ~X(){}
virtual inline T f(T x){return x;}
};
void f()
{
typedef int H;
X<H> y;
}
|
google | android | conv2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/conv2.C | 391 | utf_8 | c1e0694d756e50904baf31182dd73510 | // { dg-do assemble }
// { dg-options "-pedantic-errors" }
void cheat( int* i ) { ++(*i); }
struct t {
void cheat( int& i ) { ++i; }
};
int main()
{
void (t::*member)( const int& ) = &t::cheat; // { dg-error "" } conversion
void (*cheater)( const int* ) = &cheat; // { dg-error "" } converting
t t2;
... |
google | android | crash42 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/crash42.C | 377 | utf_8 | af8f62de6c70479ed39928da6720383e | // { dg-do assemble }
// { dg-options "-g" }
//
// Bug 3152. Using a typedef to declare a function used an unset
// global variable, last_function_parms.
struct actor
{
typedef bool (operation)();
operation a;
operation b;
operation c;
}; |
google | android | lex1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/lex1.C | 297 | utf_8 | 7c7aaab427900113172f72ddcd0b0c5e | // { dg-do assemble }
//
// Bug 2510. We ICEd when a bogus char was present.
void foo ()
{
// there is a ctrl-h on the next line
// { dg-error "" } stray char
} |
google | android | debug9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/debug9.C | 801 | utf_8 | b82c1ff0b46d37526b002e9eadb7b5a2 | // { dg-do assemble }
// { dg-options "-g" }
// This illustrates that debugging information for CONCAT RTL's
// supports only COMPLEX_TYPE types, not other types.
namespace std {
template<typename _Tp> class complex;
template<> class complex<double>
{
public:
complex(double =0.0, double =0.0);
private:
... |
google | android | using3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/using3.C | 170 | utf_8 | e4a2069418bcc2986985c27805d0f9fc | // { dg-do assemble }
struct A{
A();
};
typedef struct {
A i;
} S;
struct B: S{
using S::S; // { dg-error "" "" { target { ! c++11 } } } no such field
};
|
google | android | lookup22 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/lookup22.C | 196 | utf_8 | 45c0f0aa9666c49e0065d9e14fe7f8fb | // { dg-do assemble }
struct super {
union {
int myName;
void* secondMember;
};
};
struct sub : super {
int myName() { return 1; }
}; |
google | android | dtor11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/dtor11.C | 338 | utf_8 | 2c756b64f3f0786c22e84ea88c6573d6 | // { dg-do run }
extern "C" void abort ();
int j;
struct S {
S () { ++j; }
S (const S&) { ++j; }
~S () {
if (--j < 0)
abort ();
}
};
struct T {
void g (S) {
}
};
struct U {
int i;
S s;
};
U u;
U f () { return u; }
int main ()
{
T t;
t.g (f ().s);
} |
google | android | ptrmem8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/ptrmem8.C | 1,567 | utf_8 | 009011b9cd19b98128e3af55e810f0df | // { dg-do assemble }
// bug 827. We died issuing warnings about dangerous pointer to member
// conversions.
struct bar
{
int barm;
static void a();
};
struct filler1 {int fm;};
struct filler2 {int fm;};
struct filler3 {int fm;};
struct filler4 {int fm;};
struct baz : filler1, bar, filler2
{
int bazm;
};
struc... |
google | android | mangle2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/mangle2.C | 269 | utf_8 | 87f64d8c97e5d1f8d2473475b0171ff6 | // { dg-do assemble }
// Test for overloaded operators in "C" linkage
extern "C" {
typedef struct b
{
int a;
} c;
extern const c z;
inline bool operator!=(const c& x, const c& y)
{
return x.a != y.a;
}
}
void foo();
void bar(c x)
{
if (x != z)
foo();
}
|
google | android | call1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/call1.C | 577 | utf_8 | 0c90f373fd88712b9af55b3d45ab88f8 | // { dg-do run }
// Test that various calls to non-functions work.
void f () { }
typedef void (*fptr)();
typedef void (&fref)();
fptr p = f;
fref r = f;
const fptr &pr = p;
struct A {
fptr p;
A (fptr n): p(n) { }
operator fptr () { return p; }
};
struct B {
fref r;
B (fptr n): r(*n) { }
operator cons... |
google | android | delete4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/delete4.C | 1,154 | utf_8 | 48cb9639142065438719c2e0123ef935 | // { dg-do assemble }
// delete (void *)e and delete[] (void *)e result in undefined behavior
// [expr.delete/3]. Check we warn about them
// operator new functions can only return NULL, if their exceptions
// specification is `throw()'. All other cases must return a non-null pointer
// [expr.new/13].
typedef __SIZE_T... |
google | android | rttid2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/rttid2.C | 1,092 | utf_8 | 42faab5f8138a94eaefe65e8f33afa4a | // { dg-do run }
// { dg-options "-frtti" }
// test of rtti of single inheritance and multiple inheritance classes
// dynamic casting
#include <typeinfo>
extern "C" {
int printf(const char *, ...);
void exit(int);
}
class X {
public:
int xi;
};
class Y : public X {
short ys;
};
class Z : public Y {
int... |
google | android | lookup11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/lookup11.C | 120 | utf_8 | 4d8dd7569edee5d6f3ae1b7961abcaf3 | // { dg-do assemble }
namespace A {
int i;
}
using namespace A;
namespace B {
int i;
}
using namespace B;
int i;
|
google | android | inline2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/inline2.C | 223 | utf_8 | cdf515ec26e7beadbb14fdea9061b732 | // { dg-do assemble }
// { dg-options "-O2 -Winline" }
#include <cmath>
int main()
{
double foo = 4.5;
if (std::abs (0.5-std::abs (foo-0.5)) < 1e-10) foo+=1;
} |
google | android | decl7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/decl7.C | 157 | utf_8 | b7922b62c66771d84dbb60a4b1b4545c | // { dg-do assemble }
struct S
{
void* sp;
};
void* f ()
{
struct S s = { &s.sp };
return s.sp;
} |
google | android | op3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/op3.C | 1,615 | utf_8 | 7f0f2835698d0b670a7025708a71bdcd | // { dg-do run }
// Related to bug 91. We'd not preserve constness accessing a member of the
// source type in copy ctor and assignment op.
#include <stdio.h>
int value = 0;
struct A
{
A() {}
A( A& arg)
{ printf ("%s\n", __PRETTY_FUNCTION__); value = 1;}
A( const A& arg)
{ printf ("%s\n", __PRETTY_FUNCTION_... |
google | android | overload12 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/overload12.C | 442 | utf_8 | 4ce08bd991a3d17e3a64a27b989b2bdb | // { dg-do assemble }
struct A{};
struct B:A{};
struct C:B{};
struct CX
{
C c;
operator C&(){return c;}
};
// viable functions for call below
void f(A&);
void f(B&);
int main()
{
CX cx;
C c;
f(cx); // after user defined conversion to C&
// the standard conversion to B& is better than to A&
} |
google | android | lineno4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/lineno4.C | 86 | utf_8 | 259b00ebc759f1c2be8bf93afcc1c26c | // { dg-do assemble }
#define x \
y
int; // { dg-error "" } invalid declaration
|
google | android | crash16 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/crash16.C | 261 | utf_8 | e2583d606408edde03d81c01b8ba817f | // { dg-do assemble }
// { dg-options "-O2" }
void _S_initialize();
class locale
{
public:
locale() throw()
{ _S_initialize (); }
};
void foo(const locale& __loc);
void print (const int&)
{
foo(locale());
} |
google | android | delete1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/delete1.C | 251 | utf_8 | 34f6525c6eb87fdc45c8fcf8d0b2115a | // { dg-do assemble }
struct cl_heap_ring{
void operator delete (void* ptr) { }
cl_heap_ring ()
{ }
};
struct cl_heap_null_ring : public cl_heap_ring {
void operator delete (void* ptr) { }
};
void f()
{
new cl_heap_null_ring();
}
|
google | android | delete2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/delete2.C | 312 | utf_8 | 779792404c1ce0b4fc3262f45ab83083 | // { dg-do assemble }
struct foo {
operator char*() const;
};
void bar(foo a) {
delete a; // should be accepted
delete[] a; // should be accepted
char b[1];
delete b; // { dg-warning "deleting array" } expecting pointer type
delete[] b; // { dg-warning "deleting array" } expecting pointer type
}
|
google | android | mangle10 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/mangle10.C | 311 | utf_8 | cf3e71d84bec47a484318564617d434d | // { dg-do assemble }
template<int T>
struct A {
char *a;
A (const char* x)
{
a = (char*) x;
}
};
template<int U, int V, class T>
struct B {
T a[V-U+1];
friend A<V-U+1> f (B const &x)
{
return A<V-U+1> ((char*) x.a);
}
};
const int a = 8;
typedef B<1,a,int> C;
struct D {
C x;
};
|
google | android | comdat4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/comdat4.C | 672 | utf_8 | f3481f025b2bc515a0e79ac333c18c02 | // PR c++/16276
// { dg-do link }
// { dg-additional-sources " comdat4-aux.cc" }
// { dg-options "-O2" }
extern void
bar (int x);
inline void
foo (int i)
{
switch (i)
{
case 3:
case 5:
case 6:
case 9:
case 15:
bar (1);
break;
case 2:
case 4:
case 7:
case 10:
c... |
google | android | typename2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/typename2.C | 112 | utf_8 | 5ada46d551dbf758c5f205a1191c4e09 | // { dg-do assemble }
template<typename T>
void f()
{
typename T::u; // { dg-error "" } declare anything
}
|
google | android | bitfld4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/bitfld4.C | 315 | utf_8 | ee1225393f6bfc001e60b0b16f335bdf | // { dg-do assemble }
template <class T>
bool operator!=(const T&, const T&);
enum MsgType {
MSG_DATA
};
class C {
public:
MsgType mType : 8;
};
int main(void)
{
extern C& c;
c.mType = MSG_DATA;
if (c.mType != MSG_DATA)
return -1;
return 0;
} |
google | android | dyncast5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/dyncast5.C | 732 | utf_8 | 45acf9d82067b001c75d4c13f6867940 | // { dg-do run }
// dynamic cast can only cast to public unambiguous bases
extern "C" void abort ();
struct A {virtual ~A(){} int m; };
struct B {virtual ~B(){} int m; };
struct C1 : A {int m;};
struct C2 : A {int m;};
// A is ambiguous, but private in one branch
struct D1 : B, C1, private C2 {int m;};
// A is ambiguo... |
google | android | sizeof5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/sizeof5.C | 513 | utf_8 | 4ca4b75456ba54e283ab183ea72ddd89 | // { dg-do assemble }
struct A;
void foo ()
{
sizeof ( void ()); // { dg-error "" } ISO forbids
sizeof ( void (A::*) ());
sizeof ( void (A::*) () const);
sizeof (void (*) () const); // { dg-error "" } invalid quals
sizeof ( void () const); // { dg-error "" } ISO forbids, ERROR - invalid quals
} |
google | android | debug1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/debug1.C | 647 | utf_8 | 561238771ab14ea542b51d0fed719ca1 | // { dg-do assemble }
// { dg-options "-g" }
typedef unsigned int size_t;
struct dummy { };
struct arrrrrgh { };
template<class Par,class Rand = arrrrrgh>
struct whyyyyyyy { };
template<class T, class S =dummy>
struct grrrrrrrr { };
template<class Par, class Par2 =Par, class Rand =arrrrrgh>
cla... |
google | android | inline7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/inline7.C | 203 | utf_8 | 4eaa61a7f4169081f2327958cf38f524 | // { dg-do run }
// { dg-options "-O2" }
#include <list>
std::list<int*> li;
void f ()
{
li.size ();
}
int main ()
{
li.push_back (0);
f ();
} |
google | android | crash21 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/crash21.C | 224 | utf_8 | 7a4372cd40c6563853635eb0ae16404d | // { dg-do assemble }
struct A {
virtual void f(int&) const;
};
struct B : public A {
int x;
};
void B::f(int& t) { // { dg-error "" } undeclared method
x = t;
} |
google | android | type | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/type.C | 196 | utf_8 | 6d84e8dcfc220d81a1b71b1eb0c4eb68 | // { dg-do assemble }
typedef unsigned short ushort;
class foo {
public:
static ushort a;
};
extern "C" {
typedef unsigned short ushort;
}
ushort foo::a;
static int baz()
{
return foo::a;
}
|
google | android | inline5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/inline5.C | 313 | utf_8 | ccfaa381b4b7ddc2ae21136f982f0584 | // { dg-do assemble }
// { dg-options "-O2" }
class X;
extern X* tab1;
struct Y {
explicit Y(int);
};
void* x ();
Y k (void *);
inline void f() { k (x ()); }
inline void* x ()
{
return 0;
}
static void g() {
f();
}
static void h() {
f();
} |
google | android | redecl3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/redecl3.C | 129 | utf_8 | 5e934e52ca0ebb8aec763916909e5aa0 | // { dg-do assemble }
// Bug: g++ thought this was a redeclaration of a local variable.
int i;
int main ()
{
extern int i;
}
|
google | android | inline3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/inline3.C | 596 | utf_8 | 7b08662ff0ad8e5c427bcdd4565beaf7 | // { dg-do assemble }
// { dg-options "-O3" }
class ostream;
struct S
{
virtual void print(ostream&) const = 0;
};
template <class _Tp>
class vector
{
public:
_Tp& operator[](unsigned __n) const { return *(_M_start + __n); }
_Tp* _M_start;
};
class T
{
public:
void print(ostream&) const;
vector<S*> bcList_m;... |
google | android | overload1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/overload1.C | 134 | utf_8 | ed134b735a26a8d28537d1024870f261 | // { dg-do run }
struct A {
A operator+ (int) const { return *this; }
};
A operator+ (A, float);
int main ()
{
A a;
a + 1;
}
|
google | android | crash3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/crash3.C | 147 | utf_8 | 05f9169b3c0aa560e0ba3e11e6ed4a94 | // { dg-do assemble }
// { dg-options "-g -O2" }
inline void f() {
struct S {};
S s;
}
void g()
{
for (int i = 0; i < 2; ++i)
f();
}
|
google | android | cast7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/cast7.C | 254 | utf_8 | da02549549f36fdbec2ad51af3f80f0b | // { dg-do run }
// Test that we can add cv-quals in a static cast to a pointer-to-base type.
struct A { int i; };
struct B : public A {};
int main()
{
int B::* bp = &B::i;
const int A::* ap = static_cast<const int A::*>(bp);
return ap != bp;
}
|
google | android | nested3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/nested3.C | 158 | utf_8 | 878198f66083d1a53425f4fc666da671 | // { dg-do assemble }
class Foo {
public:
class Bar;
};
class Foo::Bar {
public:
Bar() {}
}; |
google | android | enum4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/enum4.C | 856 | utf_8 | e0a5382f9850ff79b21d419d8956809a | // { dg-do run }
// { dg-options "-fshort-enums" }
// On ARM EABI targets this testcase will cause a warning to be emitted
// whilst EABI attributes are being merged at link time unless
// the --no-enum-size-warning option is passed to the linker. Whilst the
// enum-size attributes should only be emitted if there are... |
google | android | badopt1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/badopt1.C | 480 | utf_8 | 31c33cf79e513b19bb021aa4e593d7b3 | // { dg-do run }
// { dg-options "-O2" }
// egcs 1.1 fails to increment count
struct Base { Base() {} }; // removing the constructor fixes the problem
struct Derived : Base {}; // so does removing the base class
int main() {
int count = 0;
Derived* array[1]; // making this Base*[1] does not fix the problem
array... |
google | android | perf1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/perf1.C | 1,772 | utf_8 | a2272ed46f0dfbf3a43486c9c3083da5 | // { dg-do assemble }
// Test of severe performance regression from 2.95. This code generates
// a heavily self-referential tree which caused the inliner to take
// O(3**N) time to scan it for function calls.
bool in0 ;
bool in1 ;
bool in2 ;
bool in3 ;
bool in4 ;
bool in5 ;
bool in6 ;
bool in7 ;
bool in8 ;
bool in9 ;... |
google | android | crash13 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/crash13.C | 182 | utf_8 | b0a2fa7128614543dd35f84eefd11f1a | // { dg-do assemble }
struct Base_bitset {
unsigned M_w[2];
void M_do_right_shift();
};
void Base_bitset::M_do_right_shift ()
{
unsigned n = 0;
M_w[0] = M_w[n + 1] ;
}
|
google | android | static16 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/static16.C | 277 | utf_8 | 60c3c7e60e3f883eb653b72d84f8ae6d | // { dg-do run }
// Test that we properly evaluate the object parameter when accessing static
// members.
struct A {
static void f () {}
static int i;
};
int A::i;
int c = 0;
A g ()
{
++c;
return A();
}
int main ()
{
g().f();
g().i = 42;
return (c != 2);
}
|
google | android | builtins7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/builtins7.C | 400 | utf_8 | 4395e6192c7bdea88521a5bbd51f34e0 | // { dg-do run }
// { dg-options "-O2" }
// Test that built-in functions are recognized with a prototype.
// Origin: Roger Sayle Mar 20, 2002
//
extern "C" void link_error (void);
namespace std {
typedef __SIZE_TYPE__ size_t;
extern "C" size_t strlen (const char*);
}
int
main ()
{
if (std::strlen ("foo") != 3)
... |
google | android | dcast1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/dcast1.C | 256 | utf_8 | c747550f76f0c18401c345889e28d956 | // { dg-do assemble }
class C {
public:
virtual void f();
};
extern volatile C* cp;
extern volatile C& cr;
void f ()
{
dynamic_cast<void*>(cp); // { dg-error "" } cannot dynamic_cast
dynamic_cast<C&>(cr); // { dg-error "" } cannot dynamic_cast
}
|
google | android | dll-6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/dll-6.C | 230 | utf_8 | 8df2e74fcad2732785e27e0358174919 | // { dg-do assemble { target arm-*-*pe } }
// set not_compiler_result "__imp_"
// dll.h
class aClass
{
public:
__declspec(dllimport) aClass();
};
// dll.cpp
__declspec(dllexport) aClass::aClass()
{
}
|
google | android | initstring | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/initstring.C | 61 | utf_8 | 8aea0874ae47ec6f53fb668325fd6e48 | // { dg-do assemble }
static const char foo[] = { "bar" };
|
google | android | dcast2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/dcast2.C | 276 | utf_8 | 76c9f4918ecd1c1a16e2d4a1cfd10a97 | // { dg-do assemble }
struct B {
virtual ~B();
};
struct D : public B {
};
void foo() {
B x;
dynamic_cast<D*>(&x); // { dg-warning "" } will never succeed
B* p = &x;
dynamic_cast<D*>(p);
} |
google | android | linkage2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/linkage2.C | 415 | utf_8 | 067776f37f51cf629f0593f1091482f1 | // { dg-do assemble { target { ! c++11 } } }
extern "C"
{
typedef struct {int dummy[10];} *GDBM_FILE;
extern GDBM_FILE gdbm_open();
}
typedef struct { int dummy[10]; } *FAIL_FILE;
extern FAIL_FILE fail_open(); // { dg-error "" } non-local function
typedef struct { int dummy[10]; } *SUCCESS_FILE, S;
extern SUCCESS_FILE... |
google | android | inline9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/inline9.C | 190 | utf_8 | 4ff7844073d913c0d5099f3c5a9d1905 | // { dg-do assemble }
// { dg-options "-O2" }
inline void f ()
{
int n;
int i[n];
}
void g ()
{
f ();
}
void h ()
{
f ();
} |
google | android | crash6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/crash6.C | 173 | utf_8 | a5242e83d48fc8527715027a7b0e1314 | // { dg-do assemble }
// { dg-options "-O2" }
struct E
{
int f(int);
};
void ha()
{
enum {X = 0};
int A, C;
E vList[10];
A = (C + 1) % 3;
vList[1].f(A);
}
|
google | android | reload1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/reload1.C | 653 | utf_8 | 0467e717fdd659d1980c52044a16d1e1 | // { dg-do run }
extern "C" void abort ();
struct A {
unsigned long long u;
} *a;
struct B {
unsigned long long v;
unsigned long long w ()
{
return a->u - v;
}
} b;
struct C {
static unsigned long long x;
static void y (unsigned long long z);
};
unsigned long long C::x = 0;
int main ()
{
a = n... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.