aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/obj-c++.dg/try-catch-7.mm
blob: 608f1d5a52c0ecf85a1996b9e3ddad2307e937d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* APPLE LOCAL file mainline */
/* { 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;
}