File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,6 +60,8 @@ if (ENABLE_OBJCXX)
6060 list (APPEND TESTS
6161 ExceptionTestObjCXX.mm
6262 ExceptionTestObjCXX_arc.mm
63+ NestedExceptionsObjCXX.mm
64+ NestedExceptionsObjCXX_arc.mm
6365 )
6466endif ()
6567
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