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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [objc/] [execute/] [formal_protocol-5.m] - Blame information for rev 816

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

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

powered by: WebSVN 2.1.0

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