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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [objc/] [execute/] [exceptions/] [foward-1.m] - Rev 310

Go to most recent revision | Compare with Previous | Blame | View Log

/* Check that throwing an exception from a -forward:: works.  */
/* Developed by Marcin Koziej <creep@desk.pl>.  */
 
#include <stdlib.h>
#import "../../../objc-obj-c++-shared/Object1.h"
#import <objc/objc-api.h>
 
static int i;
 
@interface Thrower : Object
- forward: (SEL) s : (void*) a;
@end
 
@implementation Thrower
- forward: (SEL) s : (void*) a
{
  i++;
  @throw [Object new];
}
@end
int
main()
{
  id t = [Thrower new];
  @try
  {
    [t doesnotexist];
  }
  @catch (id error)
  {
    i++;
    [error free];
  }
 
  if (i != 2)
    abort ();
 
  return 0;
}
 

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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