virtual9.C: New test.

* g++.old-deja/g++.other/virtual9.C: New test.
	* g++.old-deja/g++.pt/crash61.C: New test.
	* gcc.c-torture/execute/loop-9.c: New test.

From-SVN: r38019
This commit is contained in:
Neil Booth 2000-12-04 23:44:51 +00:00 committed by Neil Booth
parent a67ded0fdc
commit 72ca2deef3
4 changed files with 102 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2000-12-04 Neil Booth <neilb@earthling.net>
* g++.old-deja/g++.other/virtual9.C: New test.
* g++.old-deja/g++.pt/crash61.C: New test.
* gcc.c-torture/execute/loop-9.c: New test.
2000-12-04 Neil Booth <neilb@earthling.net>
* g++.old-deja/g++.other/instan1.C, instan2.C: Move to...

View File

@ -0,0 +1,45 @@
// Source: Neil Booth, from PR #111.
class A
{
public :
int i;
};
class B : virtual public A
{
};
class C : virtual public A
{
};
class D : public B, public C
{
public :
int f(void);
int g(void);
};
int D::f(void)
{
return B::i;
}
int D::g(void)
{
return this->B::i;
}
D d;
extern "C" void abort (void);
int main(void)
{
d.C::i=325;
if (d.f() != d.B::i || d.f() != d.g())
abort ();
return 0;
}

View File

@ -0,0 +1,30 @@
// Build don't link:
// Source: Neil Booth, from PR # 106. 4 Dec 2000.
template <bool b> class bar
{
};
class A_a
{
public:
static const bool b = true;
};
class B_b
{
public:
static const bool b = false;
};
template <class A, class B> class foo
{
};
template <class A, class B>
bar<(A::b || B::b)> do_funky(const foo<A, B>&);
int main()
{
bar<true> a_bar = do_funky(foo<A_a, B_b>());
}

View File

@ -0,0 +1,21 @@
/* Source: Neil Booth, from PR # 115. */
int false()
{
return 0;
}
extern void abort (void);
int main (int argc,char *argv[])
{
int count = 0;
while (false() || count < -123)
++count;
if (count)
abort ();
return 0;
}