-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: Test that we can throw and catch the same exception multiple t…
…imes sequentially. (#188) This originally came up as an issue with libc++abi support (#152), but is not specific to that ABI. * Use the C++ runtime to check for uncaught C++ exceptions. As discussed in #152, use the function defined in the Itanium C++ ABI to check whether the thrown exception is the current caught C++ exception and needs rethrowing via `__cxa_rethrow()`. Co-authored-by: Niels Grewe <grewe@ocean-insights.com> Co-authored-by: David Chisnall <gnustep@theravensnest.org>
- Loading branch information
1 parent
14619f2
commit a357cb9
Showing
3 changed files
with
45 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#import "Test.h" | ||
|
||
#import "stdio.h" | ||
|
||
|
||
void excerciseExceptionCXX(Test *e) { | ||
@try { | ||
printf("Raising Test\n"); | ||
@throw e; | ||
} @catch (Test *localException) { | ||
printf("Caught\n"); | ||
} | ||
} | ||
|
||
int main(void) | ||
{ | ||
Test *e = [Test new]; | ||
excerciseExceptionCXX(e); | ||
excerciseExceptionCXX(e); | ||
[e release]; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters