diff options
author | Nicholas Duffek <nsd@redhat.com> | 2000-07-09 05:10:13 +0000 |
---|---|---|
committer | Nicholas Duffek <nsd@redhat.com> | 2000-07-09 05:10:13 +0000 |
commit | 2bec05724f1e0b0b643a6b81ad80155d994d3ffe (patch) | |
tree | 67aca220dfee6deee7d2c8f9e2841533fe641a39 /gdb/testsuite/gdb.c++/misc.cc | |
parent | 623aa22419d58c1988155c2b876bf389d9019137 (diff) | |
download | binutils-2bec05724f1e0b0b643a6b81ad80155d994d3ffe.zip binutils-2bec05724f1e0b0b643a6b81ad80155d994d3ffe.tar.gz binutils-2bec05724f1e0b0b643a6b81ad80155d994d3ffe.tar.bz2 |
* gdb.c++/classes.exp (test_nonexistant_members): Fix name
spelling.
(test_enums): New procedure. Move enum tests from end of script
to here. Set breakpoint on function name instead of line number.
* gdb.c++/misc.cc (ClassWithEnum): Move past Foo definitions.
(enums2): New marker function.
(enums1): New function.
(main): Call enums1(). Move enum tests to enums1().
Diffstat (limited to 'gdb/testsuite/gdb.c++/misc.cc')
-rw-r--r-- | gdb/testsuite/gdb.c++/misc.cc | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/gdb/testsuite/gdb.c++/misc.cc b/gdb/testsuite/gdb.c++/misc.cc index 3090800..e4c3520 100644 --- a/gdb/testsuite/gdb.c++/misc.cc +++ b/gdb/testsuite/gdb.c++/misc.cc @@ -393,13 +393,6 @@ class Bar : public Base1, public Foo { Bar (int i, int j, int k) : Base1 (10*k), Foo (i, j) { z = k; } }; -class ClassWithEnum { -public: - enum PrivEnum { red, green, blue, yellow = 42 }; - PrivEnum priv_enum; - int x; -}; - int Foo::operator! () { return !x; } int Foo::times (int y) { return x * y; } @@ -411,6 +404,29 @@ Foo::operator int() { return x; } Foo foo(10, 11); Bar bar(20, 21, 22); +class ClassWithEnum { +public: + enum PrivEnum { red, green, blue, yellow = 42 }; + PrivEnum priv_enum; + int x; +}; + +void enums2 (void) +{ +} + +/* classes.exp relies on statement order in this function for testing + enumeration fields. */ + +void enums1 () +{ + ClassWithEnum obj_with_enum; + obj_with_enum.priv_enum = ClassWithEnum::red; + obj_with_enum.x = 0; + enums2 (); + obj_with_enum.priv_enum = ClassWithEnum::green; +} + class Contains_static_instance { public: @@ -509,6 +525,7 @@ main() dummy(); inheritance1 (); inheritance3 (); + enums1 (); register_class (); /* FIXME: pmi gets optimized out. Need to do some more computation with @@ -519,12 +536,6 @@ main() /* Make sure the AIX linker doesn't remove the variable. */ v_tagless.one = 5; - /* Class with enumeration inside it */ - ClassWithEnum obj_with_enum; - obj_with_enum.priv_enum = ClassWithEnum::red; - obj_with_enum.x = 0; - obj_with_enum.priv_enum = ClassWithEnum::green; - return foo.*pmi; } |