diff options
author | Andrew Pinski <pinskia@physics.uc.edu> | 2005-07-26 14:27:33 +0000 |
---|---|---|
committer | Andrew Pinski <pinskia@gcc.gnu.org> | 2005-07-26 07:27:33 -0700 |
commit | 84fd360ddcdabfe1209c0139aa937e9e0ee7547a (patch) | |
tree | 66e7ece37d4f807569dcb1cffb5e42711da37e1d | |
parent | a4174ebf41fcfc398b6868b1c71f3172993f76da (diff) | |
download | gcc-84fd360ddcdabfe1209c0139aa937e9e0ee7547a.zip gcc-84fd360ddcdabfe1209c0139aa937e9e0ee7547a.tar.gz gcc-84fd360ddcdabfe1209c0139aa937e9e0ee7547a.tar.bz2 |
re PR libobjc/22606 (Exceptions cannot be thrown from -forward::)
2005-07-26 Andrew Pinski <pinskia@physics.uc.edu>
PR libobjc/22606
* Makefile.in (ALL_CFLAGS): Add -fexceptions.
2005-07-26 Andrew Pinski <pinskia@physics.uc.edu>
PR libobjc/22606
* objc.dg/try-catch-11.m: New test.
From-SVN: r102386
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/objc.dg/try-catch-11.m | 42 | ||||
-rw-r--r-- | libobjc/ChangeLog | 5 | ||||
-rw-r--r-- | libobjc/Makefile.in | 2 |
4 files changed, 53 insertions, 1 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 693ddc9..c4df73c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-07-26 Andrew Pinski <pinskia@physics.uc.edu> + + PR libobjc/22606 + * objc.dg/try-catch-11.m: New test. + 2005-07-26 Richard Guenther <rguenther@suse.de> PR tree-optimization/22486 diff --git a/gcc/testsuite/objc.dg/try-catch-11.m b/gcc/testsuite/objc.dg/try-catch-11.m new file mode 100644 index 0000000..745deca --- /dev/null +++ b/gcc/testsuite/objc.dg/try-catch-11.m @@ -0,0 +1,42 @@ +/* Check that throwing an exception from a -forward:: works. */ +/* Developed by Marcin Koziej <creep@desk.pl>. */ + +/* { dg-do run } */ +/* { dg-options "-fobjc-exceptions -w" } */ + +#import <objc/Object.h> +#import <objc/objc-api.h> +#include <stdlib.h> + +static int i; + +@interface Thrower : Object +- forward: (SEL) s : (void*) a; +@end + +@implementation Thrower +- forward: (SEL) s : (void*) a +{ + i++; + @throw [Object new]; +} +@end +int +main() +{ + id t = [Thrower new]; + @try + { + [t doesnotexist]; + } + @catch (id error) + { + i++; + [error free]; + } + + if (i != 2) + abort (); + + return 0; +}
\ No newline at end of file diff --git a/libobjc/ChangeLog b/libobjc/ChangeLog index 0fa3b08..4456989 100644 --- a/libobjc/ChangeLog +++ b/libobjc/ChangeLog @@ -1,3 +1,8 @@ +2005-07-26 Andrew Pinski <pinskia@physics.uc.edu> + + PR libobjc/22606 + * Makefile.in (ALL_CFLAGS): Add -fexceptions. + 2005-06-08 David Ayers <d.ayers@inode.at> * objc/NXConstStr.h, objc/Object.h, objc/Protocol.h, diff --git a/libobjc/Makefile.in b/libobjc/Makefile.in index 44e3dd7..4dd1f9d 100644 --- a/libobjc/Makefile.in +++ b/libobjc/Makefile.in @@ -73,7 +73,7 @@ CC = @CC@ CFLAGS = @CFLAGS@ WARN_CFLAGS = -W -Wall -Wwrite-strings -Wstrict-prototypes ALL_CFLAGS = -I. -I$(srcdir) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(WARN_CFLAGS) \ - -DIN_GCC -DIN_TARGET_LIBS -fno-strict-aliasing + -DIN_GCC -DIN_TARGET_LIBS -fno-strict-aliasing -fexceptions # Libtool # The following strings describe the version of the obj-C library |