mirror of
https://github.com/VibeDarling/darling-libobjc2.git
synced 2026-11-15 10:08:05 -10:00
clang trunk if -fobjc-runtime-1.7 is specified and provides significantly better interoperability with foreign exceptions. Note: Most of the exception tests will not pass with gcc or clang < 3.3. They test things that are impossible to implement quite correctly with the GCC-compatible exception ABI. Also updated the release notes to reflect recent improvements.
39 lines
361 B
Objective-C
39 lines
361 B
Objective-C
#include "Test.h"
|
|
|
|
#if __cplusplus
|
|
#error This is not an ObjC++ test!
|
|
#endif
|
|
|
|
|
|
id a;
|
|
int throw(void)
|
|
{
|
|
@throw a;
|
|
}
|
|
|
|
|
|
int main(void)
|
|
{
|
|
id e1 = [Test new];
|
|
id e2 = [Test new];
|
|
@try
|
|
{
|
|
a = e1;
|
|
throw();
|
|
}
|
|
@catch (id x)
|
|
{
|
|
assert(x == e1);
|
|
@try {
|
|
a = e2;
|
|
}
|
|
@catch (id y)
|
|
{
|
|
assert(y == e2);
|
|
}
|
|
}
|
|
[e1 dealloc];
|
|
[e2 dealloc];
|
|
return 0;
|
|
}
|