diff options
author | pinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-08-14 02:01:52 +0000 |
---|---|---|
committer | pinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-08-14 02:01:52 +0000 |
commit | 34dcb2fb8181f38c6471c563dcc50f7cc7860dfc (patch) | |
tree | 3986954b339cf4c36b639fae792976b61051eda5 /gcc/testsuite/objc | |
parent | ef5b12be802ba23674c57c509c1151c88d443c06 (diff) | |
download | gcc-34dcb2fb8181f38c6471c563dcc50f7cc7860dfc.tar.gz |
libobjc/ChangeLog:
2005-08-13 Marcin Koziej <creep@desk.pl>
Andrew Pinski <pinskia@physics.uc.edu>
PR libobjc/22492
* exception.c (PERSONALITY_FUNCTION): Fix the PC with finally.
testsuite/ChangeLog:
2005-08-13 Marcin Koziej <creep@desk.pl>
Andrew Pinski <pinskia@physics.uc.edu>
PR libobjc/22492
* execute/exceptions/finally-1.m: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103073 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/objc')
-rw-r--r-- | gcc/testsuite/objc/execute/exceptions/finally-1.m | 45 |
1 files changed, 45 insertions, 0 deletions
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 00000000000..9d4c396393e --- /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]; + } +} |