OSDN Git Service

2005-07-26 Andrew Pinski <pinskia@physics.uc.edu>
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 26 Jul 2005 14:27:33 +0000 (14:27 +0000)
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 26 Jul 2005 14:27:33 +0000 (14:27 +0000)
        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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@102386 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/objc.dg/try-catch-11.m [new file with mode: 0644]
libobjc/ChangeLog
libobjc/Makefile.in

index 693ddc9..c4df73c 100644 (file)
@@ -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 (file)
index 0000000..745deca
--- /dev/null
@@ -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
index 0fa3b08..4456989 100644 (file)
@@ -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,
index 44e3dd7..4dd1f9d 100644 (file)
@@ -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