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-6.m] - Blame information for rev 832

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
/* Without a class adopting the protocol - this doesn't work
12
   with gcc-2.95.2 as well */
13
 
14
int main (void)
15
{
16
  Protocol *protocol = @protocol (Evaluating);
17
 
18
  if (strcmp ([protocol name], "Evaluating"))
19
    {
20
      abort ();
21
    }
22
 
23
  return 0;
24
}
25
 

powered by: WebSVN 2.1.0

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