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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [objc/] [execute/] [formal_protocol-5.m] - Blame information for rev 825

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

Line No. Rev Author Line
1 149 jeremybenn
/* Contributed by Nicola Pero - Fri Mar  9 21:35:47 CET 2001 */
2
#include <objc/objc.h>
3
#include <objc/Protocol.h>
4
 
5
/* Test defining a protocol, and accessing it using @protocol */
6
 
7
@protocol Evaluating
8
- (int) importance;
9
@end
10
 
11
/* A class adopting the protocol */
12
@interface Test <Evaluating>
13
@end
14
 
15
@implementation Test
16
- (int) importance
17
{
18
  return 1000;
19
}
20
@end
21
 
22
int main (void)
23
{
24
  Protocol *protocol = @protocol (Evaluating);
25
 
26
  if (strcmp ([protocol name], "Evaluating"))
27
    {
28
      abort ();
29
    }
30
 
31
  return 0;
32
}
33
 

powered by: WebSVN 2.1.0

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