File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,6 +62,8 @@ if (ENABLE_OBJCXX)
6262 list (APPEND TESTS
6363 ExceptionTestObjCXX.mm
6464 ExceptionTestObjCXX_arc.mm
65+ NestedExceptionsObjCXX.mm
66+ NestedExceptionsObjCXX_arc.mm
6567 )
6668endif ()
6769
Original file line number Diff line number Diff line change 1+ #include " Test.h"
2+
3+
4+ id a;
5+ int throwException (void )
6+ {
7+ @throw a;
8+ }
9+
10+
11+ int main (void )
12+ {
13+ id e1 = @" e1" ;
14+ id e2 = @" e2" ;
15+ @try
16+ {
17+ a = e1 ;
18+ throwException ();
19+ }
20+ @catch (id x)
21+ {
22+ assert (x == e1 );
23+ @try {
24+ a = e2 ;
25+ @throw a;
26+ }
27+ @catch (id y)
28+ {
29+ assert (y == e2 );
30+ }
31+ }
32+ [e1 dealloc ];
33+ [e2 dealloc ];
34+ return 0 ;
35+ }
Original file line number Diff line number Diff line change 1+ #include " Test.h"
2+
3+
4+ id a;
5+ int throwException (void )
6+ {
7+ @throw a;
8+ }
9+
10+
11+ int main (void )
12+ {
13+ id e1 = @" e1" ;
14+ id e2 = @" e2" ;
15+ @try
16+ {
17+ a = e1 ;
18+ throwException ();
19+ }
20+ @catch (id x)
21+ {
22+ assert (x == e1 );
23+ @try {
24+ a = e2 ;
25+ @throw a;
26+ }
27+ @catch (id y)
28+ {
29+ assert (y == e2 );
30+ }
31+ }
32+ return 0 ;
33+ }
You can’t perform that action at this time.
0 commit comments