OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [objc/] [execute/] [exceptions/] [foward-1.m] - Blame information for rev 378

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

Line No. Rev Author Line
1 307 jeremybenn
/* Check that throwing an exception from a -forward:: works.  */
2
/* Developed by Marcin Koziej <creep@desk.pl>.  */
3
 
4
#include <stdlib.h>
5
#import "../../../objc-obj-c++-shared/Object1.h"
6
#import <objc/objc-api.h>
7
 
8
static int i;
9
 
10
@interface Thrower : Object
11
- forward: (SEL) s : (void*) a;
12
@end
13
 
14
@implementation Thrower
15
- forward: (SEL) s : (void*) a
16
{
17
  i++;
18
  @throw [Object new];
19
}
20
@end
21
int
22
main()
23
{
24
  id t = [Thrower new];
25
  @try
26
  {
27
    [t doesnotexist];
28
  }
29
  @catch (id error)
30
  {
31
    i++;
32
    [error free];
33
  }
34
 
35
  if (i != 2)
36
    abort ();
37
 
38
  return 0;
39
}

powered by: WebSVN 2.1.0

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