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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc/] [execute/] [formal_protocol-5.m] - Blame information for rev 702

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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