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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc/] [execute/] [exceptions/] [foward-1.m] - Blame information for rev 702

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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