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 | lineno2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/lineno2.C | 374 | utf_8 | 8c62ee37ef42b6a370fd60335a40f4aa | // { dg-do assemble }
// Bug: g++ wasn't listing candidates for a failed conversion.
void f(int, double); // { dg-message "" } candidate
void f(double, int); // { dg-message "" } candidate
void f(int); // { dg-message "" } candidate
int
main ()
{
void (*ptr)(int, int);
ptr = &f; // { dg-error "" } no matc... |
google | android | unchanging1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/unchanging1.C | 676 | utf_8 | b62e589f26ea50c3e520fbd34f0dfe9d | // { dg-do run }
// { dg-options "-O2" }
#include <iostream>
#include <complex>
using namespace std;
class A {
protected:
int a;
complex<double> *b;
public:
A(int n);
inline complex<double>& operator[] (int x);
};
A::A(int n)
{
a = n;
b = new complex<double>[a];
for (int i=0; i<a; i++) b[i] = complex... |
google | android | covar1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/covar1.C | 135 | utf_8 | d7423d0670f9d8abf6b30397edaa1235 | // { dg-do assemble }
struct A {
virtual A& f();
};
struct B: public A {
B& f();
}; |
google | android | for1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/for1.C | 414 | utf_8 | cbd2042bbd0e31ca134217190c71ebbb | // { dg-do assemble }
int i;
int j;
struct S {
int operator()(int)
{
i = 1;
return i;
}
typedef int I;
void f() {
for (S I; false; )
;
int k = I(3);
}
};
typedef int J;
struct T {
int operator()(int)
{
j = 1;
return j;
}
void f() {
for (T J; ... |
google | android | init19 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/init19.C | 945 | utf_8 | 7ea4460cf540fe55e5279ed995092458 | // { dg-do run { xfail { { ! cxa_atexit } && { ! *-*-solaris2* } } } }
// { dg-require-effective-target cxa_atexit }
#include <stdlib.h>
#define assert(x) do { if (! (x)) abort(); } while (0)
int count = 0;
class A
{
public:
explicit A(int i);
~A();
int i;
A(const A&);
A& operator=(const A&);
};
A::A(int i_)... |
google | android | virtual4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/virtual4.C | 411 | utf_8 | aae91d68382d78f5fff446edb0141d1c | // { dg-do assemble }
class A {
public:
virtual int foo() = 0; // { dg-error "" } original definition
};
class B {
public:
virtual double foo() = 0;
};
class C
: public A, public B
{
public:
virtual double foo() { return 2; } // { dg-error "" } conflicting return type
};
class D
: public B, public A
{
... |
google | android | rtti3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/rtti3.C | 1,394 | utf_8 | a38005b6d0e8fdd5bd057e0c2b48bccd | // { dg-do run }
// { dg-options "-frtti" }
// test of rtti of single inheritance and multiple inheritance with
// virtual functions
#include <typeinfo>
extern "C" {
int printf(const char *, ...);
void exit(int);
}
class X {
public:
int xi;
virtual int f() {return 0;};
};
class Y : public X {
short ys;... |
google | android | lookup4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/lookup4.C | 257 | utf_8 | 2adb0f0075c1250803736bde31fee757 | // { dg-do run }
// Test for proper handling of references to overloaded member functions.
struct A {
static void f (int) { }
void f ();
};
void (*p)(int) = &A::f;
void A::f ()
{
p = f;
}
int main()
{
A a;
p = &a.f;
(a.f)();
(a.f)(42);
}
|
google | android | printf1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/printf1.C | 221 | utf_8 | ceecfe2bb2ab30a7f08b690dee78b96a | // { dg-do assemble }
// { dg-options "-Wall" }
struct a
{
void x(char *f,...) __attribute__((format(printf,2,3)));
};
int main()
{
a A;
A.x("%d"); // { dg-warning "" } too few arguments for format
return 0;
}
|
google | android | array1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/array1.C | 237 | utf_8 | 3f1e42cde842279c479b7e4613fc7b6e | // { dg-do run }
int i;
struct S {
S (int) {
++i;
if (i == 3)
throw 3;
}
S () {}
~S() {
--i;
}
};
int main()
{
try {
S s[5] = { 0, 1, 2, 3, 4 };
} catch (...) {
}
if (i != 1)
return 1;
}
|
google | android | sibcall2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/sibcall2.C | 286 | utf_8 | 4bad359f7d21b4dc141fcb698ae426a1 | // { dg-do assemble }
// { dg-options "-O2 -foptimize-sibling-calls -fno-exceptions" }
struct X
{
const char *c() const { return b; };
char *b;
};
extern "C" int f (const char *);
struct A
{
X x;
void y();
};
void A::y()
{
const char *const a[] = { x.c() };
f (a[0]);
}
|
google | android | builtins6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/builtins6.C | 377 | utf_8 | b6316b52e8653a9cd53c0f5148b0daee | // { dg-do run }
// { dg-options "-O2" }
// Test that built-in functions are recognized with a prototype.
// Origin: Roger Sayle Mar 20, 2002
//
typedef __SIZE_TYPE__ size_t;
extern "C" size_t strlen (const char*);
extern "C" void link_error (void);
int
main ()
{
if (strlen ("foo") != 3)
link_error ();
return... |
google | android | friend5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/friend5.C | 145 | utf_8 | 0161e6b486d3b3dee4f0cf2bc41f3cd9 | // { dg-do assemble }
struct A {
friend bool(); // { dg-error "" } invalid declaration
}; |
google | android | sc1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/sc1.C | 220 | utf_8 | 2fc4734e1062da92300b8aa3641fcc10 | // { dg-do assemble }
} |
google | android | access1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/access1.C | 137 | utf_8 | 4781d101689a334ce5edaf88a1e77c83 | // { dg-do assemble }
class X{
unsigned int i;
public:
void f();
};
void X::f()
{
union {
int foo[sizeof (i)];
};
}
|
google | android | static9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/static9.C | 204 | utf_8 | 6acb6adf2268d2428bbada70553fa5ba | // { dg-do assemble }
struct st
{
int a, b, c, d;
};
void g ()
{
static const st i = { 0,1,2,3 };
}
void h ()
{
static const st i = { 0,1,2,3 };
} |
google | android | crash30 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/crash30.C | 191 | utf_8 | 8ddbf498f146b1275504ed7450d2e35b | // { dg-do assemble }
struct foo
{
foo();
void x();
};
void foo::x() throw(bar) // { dg-error "" } parse error
{
}
void bar()
{
foo x;
} |
google | android | struct1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/struct1.C | 893 | utf_8 | ec78eb238242362c4c13e308b6521746 | // { dg-do assemble }
// Duplicate definitions are wrong, we should just cough
// politely, but we used to die horribly.
class Y // { dg-error "" } previous definition
{
};
class Y // { dg-error "" } redefinition
{
};
template<class T> class X // { dg-error "" } previous definition
{
};
template<class T> class X //... |
google | android | conv1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/conv1.C | 110 | utf_8 | 3ce601b39551204293395f2d5fca36c7 | // { dg-do assemble }
class X {
public:
const operator int (); // { dg-error "" } invalid declaration.
};
|
google | android | comdat2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/comdat2.C | 526 | utf_8 | e421748ca6191ef379db9252886457f1 | // { dg-do run }
// { dg-additional-sources " comdat2-aux.cc" }
// { dg-options "-O" }
// Test that statics in inline functions are unified between
// translation units. Currently we handle this by just suppressing
// inling and relying on unification of the function itself.
template <class T>
struct S {
static in... |
google | android | static2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/static2.C | 178 | utf_8 | 33149c771cc5305bbfb6fa0b743567a1 | // { dg-do assemble }
struct foo {
static void (*mystatic) ();
};
void bar(foo& t) {
t.mystatic ();
} |
google | android | inline6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/inline6.C | 187 | utf_8 | 4b2c8697535041bce609a3148c50d503 | // { dg-do assemble }
// { dg-options "-O2" }
struct S
{
};
void f (S s = S ());
inline void g ()
{
f ();
}
void h ()
{
g ();
} |
google | android | crash29 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/crash29.C | 175 | utf_8 | 52b9cd9c6a2f857dac5de21020b454ea | // { dg-do assemble }
class bar
{
public:
void foo ();
void baz ();
};
void bar::foo ()
{
baz x(); // { dg-error "" }
} |
google | android | rtti1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/rtti1.C | 2,543 | utf_8 | 975c6f5dc39ccf0719efb4a802333342 | // { dg-do run }
// { dg-options "-frtti" }
// test of rtti of non-class types
#include <typeinfo>
extern "C" {
int printf(const char *, ...);
void exit(int);
}
int i;
short s;
char c;
long l;
unsigned int ui;
unsigned short us;
unsigned char uc;
unsigned long ul;
float f;
double d;
int& ri = i;
const volatile int... |
google | android | friend2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/friend2.C | 187 | utf_8 | dba3090eb844e8c6c1d4e88f5f742e83 | // { dg-do assemble }
void
f()
{
class Local_2 {
friend class Friend;
int i;
};
class Friend {
public:
void g() {
Local_2 l2;
l2.i = 3;
}
};
}
|
google | android | static5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/static5.C | 187 | utf_8 | 1e9288736d4e4b254b0aa94a642002d2 | // { dg-do assemble }
struct S
{
~S();
};
inline void f()
{
static S s;
atexit (0); // { dg-error "" } implicit declaration
} |
google | android | dtor4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/dtor4.C | 494 | utf_8 | beaa62d9f1bf0ffca6cd65768337e910 | // { dg-do assemble }
struct S1 {
~S1(); // { dg-error "" } candidate
};
S1::~S1() const // { dg-error "" } prototype does not match
{
}
struct S2 {
~S2() volatile; // { dg-error "" } destructors may not be volatile
};
template <class T>
struct S3 {
~S3(); // { dg-error "" } candidate
};
template <class ... |
google | android | cond4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/cond4.C | 467 | utf_8 | ac45c51548ac5c0e398a0afcf2e9042b | // { dg-do assemble }
template <class V>
class _vec3d
{
public:
double _x, _y;
};
class Wvec : public _vec3d<int> { };
template <class T>
class TDI {
public:
T &get();
};
template <class T>
class hashvar {
public :
T _val;
TDI<T> *val() const;
T get() const { return true ? va... |
google | android | pmf3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/pmf3.C | 517 | utf_8 | 84d0baac75e4976bb17d8330e2b0c0f6 | // { dg-do assemble }
// Bug: g++ was crashing after giving errors.
template<class T>
void connect_to_method(
T *receiver,
void (T::*method)())
{}
class Gtk_Base
{
public:
void expose();
void show();
void show(int);
Gtk_Base();
};
Gtk_Base::Gtk_Base()
{
connect_to_method(this,&show); // { dg-er... |
google | android | lookup10 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/lookup10.C | 106 | utf_8 | d870c2b83ff4174d5142d37d47482ac8 | // { dg-do assemble }
struct A {
struct B {
static int i;
};
enum { a };
};
int A::B::i = a;
|
google | android | sizeof3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/sizeof3.C | 560 | utf_8 | 4fc019ae48048136a589dc3fc21ec8b9 | // { dg-do run }
// C++ does not decay lvalues into rvalues until as late as possible. This
// means things like the rhs of a comma operator mustn't decay. This will make
// a difference if it is an array or function.
extern "C" void abort();
int main (int argc, char **argv)
{
int ary[10];
int ary1[10];
if (s... |
google | android | vaarg3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/vaarg3.C | 1,234 | utf_8 | 70f91224097bf89f99dc8cd7b932e0e9 | // { dg-do assemble }
// { dg-options "-Wno-abi" { target arm_eabi } }
// Make sure we diagnose bad uses of va_arg
#include <stdarg.h>
struct X {int m;};
struct Y { Y(const Y&); };
struct Z; // { dg-error "forward decl" }
void fn1(va_list args)
{
int i = va_arg (args, int);
Y x = va_arg (args, Y); // { ... |
google | android | ref1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/ref1.C | 230 | utf_8 | 3d97599f1668f6276ba8fcb8536abf4f | // { dg-do assemble }
int f();
void g()
{
const int& i = f(); // OK
int& j = f(); // { dg-error "" } initialization of non-const reference
const volatile int& k = f(); // { dg-error "" } initialization of volatile ref
}
|
google | android | conv4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/conv4.C | 230 | utf_8 | cd23d62f08b43907a909a92b9ad1acd5 | // { dg-do run }
// Testcase for proper hiding of base conversion ops.
struct A
{
operator const char *();
};
struct B : public A
{
operator const char *() { return 0; }
};
int main( void )
{
B b;
const char *p = b;
}
|
google | android | deref1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/deref1.C | 496 | utf_8 | 382473fc6c53960e79489c1e820820b1 | // { dg-do assemble }
// [expr.unary.op]/1 says you can dereference all pointers except for pointers
// to cv void.
void fn (void *vp, volatile void *vvp)
{
*vp; // { dg-error "" } not a pointer to object
*vvp; // { dg-error "" } not a pointer to object
&*vp; // { dg-error "" } not a pointer to obje... |
google | android | builtins3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/builtins3.C | 363 | utf_8 | 0b197580584cf50c69e128310bb59412 | // { dg-do run }
// { dg-options "-O2" }
// Test whether this builtin minimally works in G++.
// Origin: Kaveh Ghazi Jan 16, 2001
//
namespace std
{
extern "C" void abort (void);
}
int main ()
{
using namespace std;
void *foo;
foo = ::__builtin_alloca (32);
if (!foo)
abort ();
return 0;
} |
google | android | const1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/const1.C | 119 | utf_8 | 6f779a48e303e5714ade1dc1eaf9964f | // { dg-do assemble }
struct S
{
void f()
{
const int i; // { dg-error "" } uninitialized const
}
};
|
google | android | overcnv1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/overcnv1.C | 162 | utf_8 | 85b2e733960278035f693286903dd300 | // { dg-do assemble }
class A {
public:
void f(const char * const * );
};
void f(const char * const *) {}
void g()
{
char *ar[10];
A a;
f(ar);
a.f(ar);
}
|
google | android | pmf6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/pmf6.C | 462 | utf_8 | b31a25b82d28a89a3180f169923be884 | // { dg-do run }
// Test that we only call f once and that pointers to different subobjects
// compare as different.
struct A { void f() { } };
struct B: public A { };
struct C: public A { };
struct D : public B, public C { };
typedef void (B::*bp)();
typedef void (C::*cp)();
typedef void (D::*dp)();
dp d1;
int ca... |
google | android | rttid3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/rttid3.C | 1,468 | utf_8 | a9cc0e1c16e568172282adb889a34614 | // { dg-do run }
// { dg-options "-frtti" }
// test of rtti of single inheritance and multiple inheritance with
// virtual functions
// dynamic casting
#include <typeinfo>
extern "C" {
int printf(const char *, ...);
void exit(int);
}
class X {
public:
int xi;
virtual int f() {return 0;};
};
class Y : pub... |
google | android | lookup14 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/lookup14.C | 163 | utf_8 | 557c4eed5560ec6f7f08ef624ba62960 | // { dg-do assemble }
union U {
typedef int I;
struct S {
void f();
};
};
void U::S::f() {
I i;
} |
google | android | init1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/init1.C | 107 | utf_8 | a5b35401aabff5d46ee703160a256207 | // { dg-do run }
extern "C" void abort();
int i;
int j = i++;
int main()
{
if (i != 1)
abort();
}
|
google | android | static10 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/static10.C | 199 | utf_8 | 8a674bc4fae54c6f2e6187118ffc8d1f | // { dg-do assemble }
// { dg-options "-w" }
struct st
{
int a;
};
int
foo (int a)
{
static const st i = { 0 };
if (i.a == a)
return 0;
} |
google | android | init7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/init7.C | 527 | utf_8 | 218366b1db7ad573de9089b8dc32b49f | // { dg-do run }
// simplified from testcase in Windows Developer Journal,
// The initialization of a static local variable must be retried if a
// previous try finished by throwing an exception [stmt.dcl]/4
extern "C" void abort ();
struct foo {
foo() { throw true; }
};
void bar() {
static foo baz;
}
int main() {... |
google | android | cast5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/cast5.C | 915 | utf_8 | 3da45a84fdb0e4b43d9260d61d9695bb | // { dg-do assemble }
// Array of cv T decays to pointer to cv T, and pointer to array of cv T can
// be converted to pointer to cv T. We need to make sure the `cv's don't
// confuse us.
typedef char const *ary_t[2];
void f0 (ary_t const *const &ary)
{
static_cast <void const *> (ary);
static_cast <void *> (ary); ... |
google | android | qual1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/qual1.C | 426 | utf_8 | 9a413d6cc2fc61c326d8be31a011267d | // { dg-do assemble }
// { dg-options "-O" }
// DR 295 allows qualification via typedef
typedef const char *(func_type)();
class C
{
public:
func_type *Function;
// The following is DR 295 dependent
const func_type* function(void) { return Function; }
volatile func_type* functionv(void);
} action;
void work(co... |
google | android | crash19 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/crash19.C | 159 | utf_8 | 0ab3c2f96220a27295790bc3c1e52831 | // { dg-do assemble }
template <class T>
struct S {};
struct X {};
void f () {
typedef X Y;
S<Y> s;
} |
google | android | crash23 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/crash23.C | 238 | utf_8 | 05b369a1c5371d2bd48e37bffd922ac3 | // { dg-do assemble }
class T;
inline void operator<(T&, T&) { } // { dg-message "" } previous definition
inline void operator<(T&, T&) { } // { dg-error "" } duplicate definition |
google | android | eh2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/eh2.C | 230 | utf_8 | fff040d0461db3bb906852d2efd56a9d | // { dg-do assemble }
// { dg-options "-O2" }
class a {
public:
double b;
int c;
~a() { }
};
int bar(a x);
a foo(double x);
int baz(double x, int y)
{
return bar(foo(x));
} |
google | android | signed | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/signed.C | 283 | utf_8 | 75a099ea3dd81f52fe5c8a7f4baa9726 | // { dg-do assemble }
// Determine that function style casts are groked
void fn()
{
+char(5);
+short(5);
+int(5);
+long(5);
+signed(5);
+unsigned(5);
} |
google | android | crash8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/crash8.C | 133 | utf_8 | fe179e76a385143c20d1033600901ddd | // { dg-do assemble }
int main()
{
void f();
class A {
friend void f();
};
} |
google | android | inline16 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/inline16.C | 310 | utf_8 | 94a6d3c26b108e05298c1283ec8a85a9 | // { dg-do assemble }
// { dg-options "-O1" }
struct foo {
bool x;
inline void a (unsigned char y);
inline void b (void);
virtual ~foo ();
};
foo::~foo ()
{
}
void foo::a (unsigned char y)
{
x = ((y & 2) != 0);
}
void foo::b (void)
{
a(0x07);
} |
google | android | access8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/access8.C | 498 | utf_8 | e63ab962df8f1acaa0719e9e325a762c | // { dg-do assemble }
// Test that access to static members from a nested class of the derived
// type works.
class Base
{
protected:
static int Some_var;
typedef int Some_t;
};
class Derived : Base
{
protected:
struct Nested
{
void Foo (Some_t);
void Bar (Base::Some_t) { Base::Some_var = 1; }
};... |
google | android | addrof1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/addrof1.C | 510 | utf_8 | 97d12fac5830df23ec0def891ee3ccdb | // { dg-do run }
extern "C" void abort ();
typedef struct st {
unsigned char a;
unsigned char b;
unsigned char c;
unsigned char d;
} __attribute__((aligned(4))) st;
void testme(int, int, int);
static inline void
stupid_func(st s)
{
testme(s.a, s.b, s.c);
}
int main(... |
google | android | overload2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/overload2.C | 463 | utf_8 | 7ac2eb316531c89193f2d2d44e146cb5 | // { dg-do link }
template <class T>
class ConstArray {
};
template <class T1, class T2>
void operator+(const ConstArray<T1>&, const ConstArray<T2>&)
{
}
template <class T1, class T2>
void operator+(const ConstArray<T1>&, T2);
template <class T1, class T2>
void operator+(T1, const ConstArray<T2>&);
const ConstArr... |
google | android | new7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/new7.C | 624 | utf_8 | 183c9676ec93bdbec47a8769eab34fa8 | // { dg-do run }
#include <new>
extern "C" void abort();
bool new_flag = false;
bool delete_flag = false;
struct X {
X()
{
throw 1;
}
void* operator new ( std::size_t n ) throw ( std::bad_alloc )
{
new_flag = true;
return ::operator new( n );
}
void operator delete( void* p, std::size_t n ) t... |
google | android | crash22 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/crash22.C | 619 | utf_8 | 4d21fb21f1a5c07669bf5bcc4701f5d6 | // { dg-do link }
// { dg-options "-O2" }
class foo
{
};
typedef void *voidp;
class vect : public foo
{
public:
voidp& a();
int b();
};
class bar
{
public:
bar *c(bool (*f)(bar *node), voidp g)
{
int i=0;
bool j;
while (i < d.b()){
j = (f == __null) || f((bar*)d.a());
if ... |
google | android | 900519_12 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/900519_12.C | 264 | utf_8 | d2a61b5f238fbeef49772675bd6c035f | // { dg-do assemble }
// GROUPS abort
// g++ 1.37.1 bug 900519_12
// The following erroneous code causes g++ to segfault.
// cfront 2.0 passes this test.
// keywords: segfault, typedef, pointer type, function type
typedef eek void (*)(); // { dg-error "" }
|
google | android | builtins5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/builtins5.C | 340 | utf_8 | 7f04f8d8d62ea3de9f05662634d150c4 | // { dg-do assemble }
// Test that built-in functions aren't recognized without a prototype.
// Origin: Roger Sayle Mar 20, 2002
int
foo ()
{
return (int) ::strlen ("foo"); // { dg-error "" } undeclared
}
int
bar ()
{
return (int) std::strlen ("bar"); // { dg-error "" } undeclared
} |
google | android | conv8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/conv8.C | 405 | utf_8 | 9b12408882bf33ddd9b1857d3ffaa148 | // { dg-do assemble }
class bar
{
public:
bar();
virtual ~bar();
static void a();
};
class baz : public bar
{
};
class foo : virtual public baz
{
public:
static void a();
void b();
};
typedef void (bar::*T)();
T d;
void foo::a()
{
typedef void(foo::*t)();
t c = & foo::b;
d = (T) c; //... |
google | android | copy1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/copy1.C | 317 | utf_8 | bcb09919195a6c71370b1f44704a9ace | // { dg-do run }
// Bug: expand_vec_init doesn't copy arrays of builtin types.
struct B {
B() { }
B(const B&) { }
};
struct A
{
B b;
int ar[5];
};
int main()
{
A a;
for (int i = 0; i < 5; ++i)
a.ar[i] = i;
A a2 = a;
for (int i = 0; i < 5; ++i)
if (a2.ar[i] != a.ar[i])
return 1;
}
|
google | android | crash60 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/crash60.C | 90 | utf_8 | f839835fe7ce739cfe40a15d9429985c | // { dg-do assemble }
void foo ()
{
int e;
e := e; // { dg-error "" } parse error
}
|
google | android | new6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/new6.C | 443 | utf_8 | 8d97f61246148e95eb61f4e8e573780f | // { dg-do run }
// Test that we properly default-initialize the new int when () is given.
#include <new>
using namespace std;
extern "C" void *malloc (size_t);
int special;
int space = 0xdeadbeef;
void *operator new (size_t size)
#if __cplusplus <= 199711L
throw (std::bad_alloc)
#endif
{
if (special)
retur... |
google | android | new4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/new4.C | 150 | utf_8 | 30ec7e2f8989e636154506533aaaaabd | // { dg-do assemble }
struct S {
S();
virtual int f() {
new S[+f()];
return 0;
}
}; |
google | android | using5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/using5.C | 230 | utf_8 | 6bcc4660e6325badf5bd5b3a485f9a4d | // { dg-do assemble }
// Based on bug report by Klaus-Georg Adams
struct bar {
typedef bar t;
};
struct foo : bar {
using bar::t;
t field;
t meth();
void baz(t arg);
}; |
google | android | override1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/override1.C | 318 | utf_8 | ce00cea856ec8d8bf5df0e966319573e | // { dg-do assemble }
struct A {
virtual void f ();
};
struct B : virtual public A {
void f ();
};
struct C : virtual public A {
void f ();
};
struct D : virtual public B, virtual public C {
void f ();
};
struct Di : virtual public B, virtual public C, virtual public D {}; |
google | android | vtbl1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/vtbl1.C | 186 | utf_8 | d53c4432baa20a0f63dd7f479d478d65 | // { dg-do link }
class X {
public:
int i;
X() { i = 0; }
~X();
virtual int foo() { return i; }
virtual void bar();
};
int main()
{
} |
google | android | access10 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/access10.C | 187 | utf_8 | 557115836c5559580c903849b953750e | // { dg-do assemble }
// Test that defining a static member of private type with the () syntax works.
class A {
private:
struct B { B(int) {} };
static B b;
};
A::B A::b (1);
|
google | android | using7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/using7.C | 211 | utf_8 | 555cd6e25e52a5dcd11e63480967cc2e | // { dg-do assemble }
class A {
protected:
static void f() {}
};
class B : A {
public:
using A::f;
void g() {
f();
A::f();
}
struct C {
void g() {
f();
A::f();
}
};
};
|
google | android | dyncast4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/dyncast4.C | 438 | utf_8 | e7ae9ecae1158825c61dc13b8aa8b855 | // { dg-do run }
// Even in a derived class, a private base cannot be dynamically downcasted
// from.
extern "C" void abort();
struct A {
virtual ~A () {}
};
struct B : private A {
B* a2b (A* objp)
{
return dynamic_cast<B*> (objp);
}
};
int
main ()
{
B b;
A* aptr = (A*) &b;
if (dynamic_cast <B*> (apt... |
google | android | overload9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/overload9.C | 220 | utf_8 | 7a6d8d2604d3c3cdbd9267f412bb7ad2 | // { dg-do run }
struct T { ~T() {} };
int g ()
{
foo:
T t;
int f(int);
bar:
T t2;
int f(double);
return f(3);
}
int f(int)
{
return 0;
}
int f(double)
{
return 1;
}
int main()
{
return g();
}
|
google | android | overload14 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/overload14.C | 384 | utf_8 | 1814ba09dcbbc9987c90048e924acf14 | // { dg-do run }
// { dg-options "-Wconversion" }
extern "C" void abort();
struct A {
typedef double (&B);
typedef const double (&C);
A() { }
operator C () const;
operator B ();
};
static const double d = 2.0;
static double e = 3.0;
A::operator A::C () const
{
abort ();
return d;
}
A::operator A::B... |
google | android | warn5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/warn5.C | 378 | utf_8 | fbe9ec3566cd58bff749af239478babb | // { dg-do assemble }
// { dg-options "-W " }
//
// Bug 1765. We gave bogus warning on default initializer.
struct X
{
int i;
};
X *foo ()
{
return new X (); // gets bogus warning
}
X x = {}; // { dg-warning "" } missing initializer |
google | android | goto1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/goto1.C | 276 | utf_8 | f7be1197051cef5c4a84228232f830bc | // { dg-do assemble }
struct S
{
S ();
~S ();
};
void f ()
{
{
S s1; // { dg-error "" } skips initialization
t: // { dg-error "" } jump to label
S s2;
;
}
goto t; // { dg-error "" } from here
} |
google | android | overload8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/overload8.C | 308 | utf_8 | f272a8b69636a219100a059f6d6fbae0 | // { dg-do run }
class a {
public:
int f() { return 0; }
int f() const { return 1; }
};
class b : public a {
};
int main()
{
int (b::* ptr1)() = &b::f;
int (b::* ptr2)() const = &b::f;
b ao;
if ((ao.*ptr1)() != 0)
return 1;
if ((ao.*ptr2)() != 1)
return 1;
}
|
google | android | virtual2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/virtual2.C | 210 | utf_8 | facad90a3e09689495cfd0bb984b74ad | // { dg-do run }
struct B
{
virtual int f() volatile
{ return 0; }
};
struct D : public B
{
virtual int f()
{ return 1; }
};
int main()
{
volatile D d;
volatile B& b = d;
return b.f();
}
|
google | android | virtual6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/virtual6.C | 308 | utf_8 | 6aa085a55573a3d71f21cd92d50b53b8 | // { dg-do assemble }
// { dg-options "-Woverloaded-virtual" }
// Bug: g++ checks certain non-virtual functions to see if they override
// virtual functions.
struct A {
virtual void f (int);
};
struct B: public A {
static void f ();
void f (int);
}; |
google | android | temporary1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/temporary1.C | 1,009 | utf_8 | 5b478975b250ff7adfafa04082a3ca7b | // { dg-do run }
extern "C" int printf (const char *, ...);
int c, d;
class Foo
{
public:
Foo() { printf("Foo() 0x%08lx\n", (__SIZE_TYPE__)this); ++c; }
Foo(Foo const &) { printf("Foo(Foo const &) 0x%08lx\n", (__SIZE_TYPE__)this); }
~Foo() { printf("~Foo() 0x%08lx\n", (__SIZE_TYPE__)this); ++d; }
};
// Bar... |
google | android | align | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/align.C | 224 | utf_8 | 73bdfe8d6d8f2a96e6ea0812e1c73bc8 | // { dg-do assemble }
#include <string.h>
class bar {
public:
bar() { rw = 0; }
static const bar baz;
private:
unsigned char rw;
};
char buf[4096];
void foo(char *uc)
{
memcpy(buf,&bar::baz,sizeof(bar));
}
|
google | android | crash15 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/crash15.C | 613 | utf_8 | 86b31fd7ce431a2d82f09b6039da031c | // { dg-do assemble }
// { dg-options "-O2" }
// g++ crashed because we unsaved the TARGET_EXPR for the return value
// for get_allocator without first expanding it, because it was part of the
// cleanup for the temporary string.
// Derived from libstdc++ v3 code.
class AA {};
void fee (const AA&);
class basic_st... |
google | android | inline17 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/inline17.C | 250 | utf_8 | 71248f6786229af294e1836c18601abb | // { dg-do assemble }
// { dg-options "-O3" }
struct foo
{
char a;
foo ();
void bar ();
void baz (char c);
};
void foo::baz (char c)
{
if (c != a)
a = c;
}
void foo::bar ()
{
baz (1);
} |
google | android | instan1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/instan1.C | 353 | utf_8 | 024add5304c41b827990193948da5b1f | // { dg-do link }
// { dg-options "-fno-implicit-templates" }
template <class T>
struct U {
static int j;
};
template <class T>
struct S {
static const int i = 7;
};
template <class T>
const int S<T>::i;
template <class T>
int U<T>::j = S<T>::i + 5;
template int U<double>::j;
int main () {
} |
google | android | static1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/static1.C | 154 | utf_8 | 94bc9e6417859abe314b0eb330f97196 | // { dg-do assemble }
extern "C" void abort();
struct S
{
static const int i = 3;
};
const int S::i = 2; // { dg-error "" } duplicate initialization
|
google | android | lookup23 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/lookup23.C | 211 | utf_8 | 5ea9b908bb1ed71c03d053c66cbcbcee | // { dg-do assemble }
// Test for proper handling of type lookup if base class has field with the
// same name as the containing class.
struct a { int a; };
struct b : a {};
b x;
void foo ()
{
x.a = 22;
}
|
google | android | access2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/access2.C | 301 | utf_8 | 5607efc598712c2be2844d0ce4b7d7e1 | // { dg-do assemble }
// Based on a testcase in the Standard, submitted by several people
class Outer {
typedef int T;
struct Inner {
T i; // { dg-error "" "" { xfail *-*-* } } not accessible -
void f() {
T j; // { dg-error "" "" { xfail *-*-* } } not accessible -
}
};
};
|
google | android | explicit1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/explicit1.C | 189 | utf_8 | a062e6feea05b79de6f4a91e26e7acb3 | // { dg-do assemble }
struct A
{
A ();
explicit A (int);
};
int main ()
{
const A& r = 1; // { dg-error "" } no suitable constructor
} |
google | android | syntax1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/syntax1.C | 207 | utf_8 | ae4eba98ae301d865a86a5f999875b69 | // { dg-do assemble }
// { dg-options "-fsyntax-only" }
class AAA{
public:
virtual void fff();
};
void AAA::fff() {}
AAA aaa;
main ()
{
aaa.fff();
} |
google | android | vaarg1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/vaarg1.C | 211 | utf_8 | 12a6c106f340c7482ff5acff5c3ba0c7 | // { dg-do assemble }
#include <stdarg.h>
#include <stdio.h>
void f (int i, ...)
{
va_list ap;
va_start (ap, i);
vprintf ("test", ap);
va_end (ap);
} |
google | android | crash34 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/crash34.C | 225 | utf_8 | 8737598586da048dab5bd4c2c89c4eaf | // { dg-do assemble }
class v
{
double x, y;
public:
v();
};
class w : public v {
public :
static const w X;
w();
};
void bar(w x);
void foo()
{
bar(w::X);
} |
google | android | vaarg4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/vaarg4.C | 394 | utf_8 | 8acac086379f3da71d7c6026e1e5330a | // { dg-do assemble }
// { dg-options "-Wno-abi" { target arm_eabi } }
// Bug 845. We were treating __builtin_va_arg as a unary expr, not a primary,
// and hence getting parse errors.
typedef __builtin_va_list __gnuc_va_list;
typedef __gnuc_va_list va_list;
struct X { int y; };
void func(va_list va)
{
char* a = ... |
google | android | virtual11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/virtual11.C | 488 | utf_8 | c85db2d12c2f86f74278074a4ea6cbd7 | // { dg-do assemble }
// We failed to check virtual functions hidden by using declarations.
struct A
{
virtual int foo ();
};
struct B
{
virtual void foo (); // { dg-error "" } of this function
};
struct C : A , B
{
};
struct D : C
{
void foo (short);
using A::foo;
};
struct E : D
{
virtual int foo (); //... |
google | android | lookup8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/lookup8.C | 127 | utf_8 | 83207211c82e3d97cf37257247e71e10 | // { dg-do assemble }
struct S {
int A;
struct A {
enum { a = 0 };
};
void f();
};
void S::f() {
A = A::a;
}
|
google | android | init16 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/init16.C | 324 | utf_8 | 3a30cb3e5ae697139f2bcd67859bffad | // { dg-do run }
struct bar {
char c;
bar (const char *);
bar (const bar &);
};
struct foo {
bar x;
};
extern const struct foo y = { "foo" };
bar::bar (const bar &ref)
{
c = ref.c;
}
bar::bar (const char *p)
{
c = p[2];
}
int main ()
{
return y.x.c != 'o';
} |
google | android | virtual3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/virtual3.C | 243 | utf_8 | 126d0ea106a5252fb709751de41abae2 | // { dg-do run }
struct B
{
virtual int f() volatile
{ return 1; }
};
struct D : public B
{
int f()
{ return 0; }
};
struct D2 : public D
{
int f()
{ return 2; }
};
int main()
{
D2 d2;
D& d = d2;
return d.f();
}
|
google | android | array2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/array2.C | 145 | utf_8 | d50b30478795daedce9de07a07ed3991 | // { dg-do run }
int i;
struct S {
S () {
++i;
}
S (int) {
}
};
int main()
{
S s[3][3] = { 2 };
if (i != 8)
return 1;
}
|
google | android | virtual8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/virtual8.C | 322 | utf_8 | 28eb577ae2eb298d335601c4cb3648be | // { dg-do run }
extern "C" int printf (const char*, ...);
struct A
{
virtual void f () {
printf ("%x\n", this);
}
};
struct B : public A
{
};
struct C : public A
{
};
struct D : virtual public B, public C
{
};
int main ()
{
D d;
A* a1 = (A*) (B*) &d;
A* a2 = (A*) (C*) &d;
a1->f ();
a2->f ();
... |
google | android | ptrmem3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/ptrmem3.C | 126 | utf_8 | e3f652dc9cfb0d8f1306ed706fdc31ce | // { dg-do assemble }
class c {
void (c::*x)();
public:
void f() { this->x(); } // { dg-error "" } pointer-to-member
};
|
google | android | anon2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/anon2.C | 308 | utf_8 | 89bb93dbf845b7033c1fbe70d2dfb2be | // { dg-do run }
extern "C" void abort (void);
static union {
int x1;
long x2;
short x3;
long x4;
};
static union {
union {
union {
int z;
};
};
union {
union {
double d;
int i;
};
};
};
int main()
{
z = 3;
if (i != 3)
abort ();
d = 2.5;
}
|
google | android | inline14 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/inline14.C | 738 | utf_8 | 5048bcdb68a786e7e91b6c13276ea7d9 | // { dg-do assemble }
#include <iostream>
struct IDENT
{
enum TYPE { Variable, Constant } type;
std::ostream& printTo(std::ostream& out) const
{
switch (type)
{
case Variable:
out << '_';
break;
default:
break;
}
return out;
}
};
template <class T>
struct TC
{
IDEN... |
google | android | builtins8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/builtins8.C | 419 | utf_8 | dfc338f135a8279a02404bc9fe49be59 | // { 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*);
}
using namespace std;
int
main ()
{
if (strlen ("... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.