aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/objc
diff options
context:
space:
mode:
authorMarcin Koziej <creep@desk.pl>2005-08-14 04:01:52 +0200
committerAndrew Pinski <pinskia@gcc.gnu.org>2005-08-13 19:01:52 -0700
commitee1658f34360cd994f12c0bc525b714b2efe7bb8 (patch)
tree3986954b339cf4c36b639fae792976b61051eda5 /gcc/testsuite/objc
parent65045c09038446c48783fe7e30134d72c131a0b1 (diff)
downloadgcc-ee1658f34360cd994f12c0bc525b714b2efe7bb8.zip
gcc-ee1658f34360cd994f12c0bc525b714b2efe7bb8.tar.gz
gcc-ee1658f34360cd994f12c0bc525b714b2efe7bb8.tar.bz2
re PR libobjc/22492 ([PATCH] Abort after @finally: libobjc passing exception value instead of exception.)
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. Co-Authored-By: Andrew Pinski <pinskia@physics.uc.edu> From-SVN: r103073
Diffstat (limited to 'gcc/testsuite/objc')
-rw-r--r--gcc/testsuite/objc/execute/exceptions/finally-1.m45
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 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];
+ }
+}