[NFC][AArch64] move AArch64 non auto-generated tests to static file (#126312)
[llvm-project.git] / lldb / test / API / commands / expression / call-throws / call-throws.m
bloba184718be7ddcb2ac307a9f18c03f7e86984dc69
1 #import <Foundation/Foundation.h>
3 @interface MyClass : NSObject
6 - (int) callMeIThrow;
7 - (int) iCatchMyself;
8 @end
10 @implementation MyClass
11 - (int) callMeIThrow
13     NSException *e = [NSException
14                        exceptionWithName:@"JustForTheHeckOfItException"
15                        reason:@"I felt like it"
16                        userInfo:nil];
17     @throw e;
18     return 56;
21 - (int) iCatchMyself
23   int return_value = 55;
24   @try
25     {
26       return_value = [self callMeIThrow];
27     }
28   @catch (NSException *e)
29     {
30       return_value = 57;
31     }
32   return return_value;
34 @end
36 int
37 main ()
39   int return_value;
40   MyClass *my_class = [[MyClass alloc] init];
42   NSLog (@"I am about to throw.");
44   return_value = [my_class iCatchMyself];
46   return return_value;