diff options
Diffstat (limited to 'gcc/testsuite/objc.dg/try-catch-6.m')
-rw-r--r-- | gcc/testsuite/objc.dg/try-catch-6.m | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/objc.dg/try-catch-6.m b/gcc/testsuite/objc.dg/try-catch-6.m new file mode 100644 index 00000000000..5276f0f68d1 --- /dev/null +++ b/gcc/testsuite/objc.dg/try-catch-6.m @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* { dg-options "-fobjc-exceptions" } */ + +#include <objc/Object.h> + +int main (int argc, const char * argv[]) { + Object * pool = [Object new]; + int a; + + if ( 1 ) { + + @try { + a = 1; + } + @catch (Object *e) { + a = 2; + } + @finally { + a = 3; + } + } + + [pool free]; + return 0; +} |