tests: Test that we can throw and catch the same exception multiple times 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>main
parent
14619f2905
commit
a357cb999c
@ -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];
|
||||||
|
}
|
||||||
|
|
||||||
Loading…
Reference in New Issue