diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/objc/execute/exceptions/finally-1.m | 45 |
2 files changed, 51 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5169ef6..dff2251 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2005-08-13 Marcin Koziej <creep@desk.pl> + Andrew Pinski <pinskia@physics.uc.edu> + + PR libobjc/22492 + * execute/exceptions/finally-1.m: New test. + 2005-08-13 Andrew Pinski <pinskia@physics.uc.edu> * objc.dg/nested-func-1.m: Move to ... diff --git a/gcc/testsuite/objc/execute/exceptions/finally-1.m b/gcc/testsuite/objc/execute/exceptions/finally-1.m new file mode 100644 index 0000000..9d4c396 --- /dev/null +++ b/gcc/testsuite/objc/execute/exceptions/finally-1.m @@ -0,0 +1,45 @@ +#include <objc/Object.h> + +int +thrower_try_body() +{ + printf("Thrower try body\n"); + return (0); +} + +int +finally_body() +{ + printf("Finally body\n"); + return (0); +} + +int +thrower() +{ + @try + { + thrower_try_body(); + @throw [Object new]; + } + @finally + { + finally_body(); + } // <----- program aborts here. + return 0; +} + + +int +main(int ac, char *av[]) +{ + @try + { + thrower(); + } + @catch (id exc) + { + printf("Got exception of class %s\n", [[exc class] name]); + [exc free]; + } +} |