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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc.dg/] [protocol-qualifier-2.m] - Blame information for rev 774

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

Line No. Rev Author Line
1 704 jeremybenn
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, 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 <objc/objc.h>
8
 
9
@protocol MyProtocol
10
- (void) method;
11
@end
12
 
13
@class MyClass;
14
 
15
static MyClass <MyProtocol> *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.