OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [objc/] [execute/] [exceptions/] [foward-1.m] - Diff between revs 307 and 338

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;
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.