URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 307 |
Rev 338 |
/* Check that throwing an exception from a -forward:: works. */
|
/* Check that throwing an exception from a -forward:: works. */
|
/* Developed by Marcin Koziej <creep@desk.pl>. */
|
/* Developed by Marcin Koziej <creep@desk.pl>. */
|
|
|
#include <stdlib.h>
|
#include <stdlib.h>
|
#import "../../../objc-obj-c++-shared/Object1.h"
|
#import "../../../objc-obj-c++-shared/Object1.h"
|
#import <objc/objc-api.h>
|
#import <objc/objc-api.h>
|
|
|
static int i;
|
static int i;
|
|
|
@interface Thrower : Object
|
@interface Thrower : Object
|
- forward: (SEL) s : (void*) a;
|
- forward: (SEL) s : (void*) a;
|
@end
|
@end
|
|
|
@implementation Thrower
|
@implementation Thrower
|
- forward: (SEL) s : (void*) a
|
- forward: (SEL) s : (void*) a
|
{
|
{
|
i++;
|
i++;
|
@throw [Object new];
|
@throw [Object new];
|
}
|
}
|
@end
|
@end
|
int
|
int
|
main()
|
main()
|
{
|
{
|
id t = [Thrower new];
|
id t = [Thrower new];
|
@try
|
@try
|
{
|
{
|
[t doesnotexist];
|
[t doesnotexist];
|
}
|
}
|
@catch (id error)
|
@catch (id error)
|
{
|
{
|
i++;
|
i++;
|
[error free];
|
[error free];
|
}
|
}
|
|
|
if (i != 2)
|
if (i != 2)
|
abort ();
|
abort ();
|
|
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.