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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [objc.dg/] [try-catch-10.m] - Blame information for rev 455

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

Line No. Rev Author Line
1 149 jeremybenn
/* Ensure that @try/@catch blocks do not mess with types of
2
   local objects (other than their volatile bits).  */
3
 
4
/* { dg-options "-fobjc-exceptions -fnext-runtime" } */
5
/* { dg-do compile } */
6
 
7
#include <objc/Object.h>
8
 
9
@protocol Proto1
10
- (int)meth1;
11
@end
12
 
13
@protocol Proto2
14
- (int)meth2;
15
@end
16
 
17
@interface MyClass: Object <Proto2> {
18
  int a;
19
}
20
- (int)meth2;
21
- (Object *)parm1: (id)p1 parm2: (id<Proto1>)p2;
22
@end
23
 
24
MyClass *mc1, *mc2;
25
 
26
@implementation MyClass
27
- (int)meth2 {
28
  return a;
29
}
30
- (Object *)parm1: (id)p1 parm2: (id<Proto1>)p2 {
31
  @try {
32
    mc2 = p2;   /* { dg-warning "type .id <Proto1>. does not conform to the .Proto2. protocol" } */
33
  }
34
  @catch (id exc) {
35
    return exc;
36
  }
37
  mc1 = p1;  /* no warning here! */
38
  return self;
39
}
40
@end

powered by: WebSVN 2.1.0

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