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

Subversion Repositories openrisc

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

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 work in the same way with @class and @interface.  */
5
 
6
#include <objc/objc.h>
7
 
8
@protocol MyProtocol
9
- (void) method;
10
@end
11
 
12
 
13
/* This first snippet gives no warnings, which is correct as 'object'
14
   implements <MyProtocol> and hence responds to 'method'.  Note how
15
   the details of the class 'MyClass' are never used.  */
16
@interface MyClass
17
@end
18
 
19
void test (MyClass <MyProtocol> *object)
20
{
21
  [object method];
22
}
23
 
24
 
25
/* This second snippet should behave identically.  'object' still implements
26
   the same protocol and responds to 'method'.  The details of MyClass or
27
   MyClass2 are irrelevant.  */
28
@class MyClass2;
29
 
30
void test2 (MyClass2 <MyProtocol> *object)
31
{
32
  [object method];
33
}

powered by: WebSVN 2.1.0

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