Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / objc / execute / exceptions / foward-1.m
blob67fbfcbb9e77eb4802db8eaa31da85a51393d18b
1 /* Check that throwing an exception from a -forward:: works.  */
2 /* Developed by Marcin Koziej <creep@desk.pl>.  */
4 #import <objc/Object.h>
5 #import <objc/objc-api.h>
6 #include <stdlib.h>
8 static int i;
10 @interface Thrower : Object
11 - forward: (SEL) s : (void*) a;
12 @end
14 @implementation Thrower
15 - forward: (SEL) s : (void*) a
17   i++;
18   @throw [Object new];
20 @end
21 int
22 main()
24   id t = [Thrower new];
25   @try
26   {
27     [t doesnotexist];
28   }
29   @catch (id error)
30   {
31     i++;
32     [error free];
33   }
34   
35   if (i != 2)
36     abort ();
37   
38   return 0;