diff options
author | Neil Booth <neilb@earthling.net> | 2000-12-04 23:44:51 +0000 |
---|---|---|
committer | Neil Booth <neil@gcc.gnu.org> | 2000-12-04 23:44:51 +0000 |
commit | 72ca2deef30d958e2c6485480446e05ccc596727 (patch) | |
tree | 92ea61d927bbed1517d841bfa2544137e328798d | |
parent | a67ded0fdcf2ceb323d111995dafda1c73e73bca (diff) | |
download | gcc-72ca2deef30d958e2c6485480446e05ccc596727.zip gcc-72ca2deef30d958e2c6485480446e05ccc596727.tar.gz gcc-72ca2deef30d958e2c6485480446e05ccc596727.tar.bz2 |
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
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/virtual9.C | 45 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.pt/crash61.C | 30 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/loop-9.c | 21 |
4 files changed, 102 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ba166ad..1045ec4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,11 @@ 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... * g++.old-deja/g++.pt/instantiate1.C, instantiate2.C: ...here. * gcc.dg/cpp/19960224-2.c, endif.c, if-6.c: Move into... diff --git a/gcc/testsuite/g++.old-deja/g++.other/virtual9.C b/gcc/testsuite/g++.old-deja/g++.other/virtual9.C new file mode 100644 index 0000000..29472b8 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/virtual9.C @@ -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; +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/crash61.C b/gcc/testsuite/g++.old-deja/g++.pt/crash61.C new file mode 100644 index 0000000..30312c7 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/crash61.C @@ -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>()); +} diff --git a/gcc/testsuite/gcc.c-torture/execute/loop-9.c b/gcc/testsuite/gcc.c-torture/execute/loop-9.c new file mode 100644 index 0000000..5230575 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/loop-9.c @@ -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; +} |