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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [obj-c++.dg/] [protocol-qualifier-2.mm] - Blame information for rev 703

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 703 jeremybenn
/* Contributed by Nicola Pero , November 2010.  */
2
/* { dg-do compile } */
3
 
4
/* Test that protocol qualifiers are maintained correctly when a
5
   @class is replaced by its @interface.  */
6
 
7
#include 
8
 
9
@protocol MyProtocol
10
- (void) method;
11
@end
12
 
13
@class MyClass;
14
 
15
static MyClass  *object1;
16
static MyClass *object2;
17
 
18
/* Declarating the @interface now will need to update all the existing
19
   ObjC types referring to MyClass with the new information.  We need
20
   to test that protocol information is not lost in the process.  */
21
@interface MyClass
22
@end
23
 
24
void test1 (void)
25
{
26
  [object1 method]; /* Ok */
27
  [object2 method]; /* { dg-warning ".MyClass. may not respond to ..method." } */
28
                    /* { dg-warning "without a matching method" "" { target *-*-* } 27 } */
29
                    /* { dg-warning "will be assumed to return" "" { target *-*-* } 27 } */
30
                    /* { dg-warning "as arguments" "" { target *-*-* } 27 } */
31
}

powered by: WebSVN 2.1.0

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