URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc/] [execute/] [exceptions/] [foward-1.m] - Rev 761
Go to most recent revision | Compare with Previous | Blame | View Log
/* Check that throwing an exception from a -forward:: works. */ /* Developed by Marcin Koziej <creep@desk.pl>. */ #include <stdio.h> #include <stdlib.h> #include "../../../objc-obj-c++-shared/TestsuiteObject.m" static int i; __attribute__((objc_exception)) @interface Thrower : TestsuiteObject - forward: (SEL) s : (void*) a; @end @implementation Thrower - forward: (SEL) s : (void*) a { i++; @throw [TestsuiteObject new]; return nil; } @end int main() { id t = [Thrower new]; @try { [t doesnotexist]; } @catch (id error) { i++; [error free]; } if (i != 2) abort (); return 0; }
Go to most recent revision | Compare with Previous | Blame | View Log