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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc.dg/] [attributes/] [proto-attribute-2.m] - Blame information for rev 801

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 deprecate attribute with a forward declarations of
5
   @protocol.  */
6
 
7
#include <stdlib.h>
8
#include <objc/objc.h>
9
 
10
__attribute__ ((deprecated))
11
@protocol DeprecatedProtocol1;
12
 
13
@protocol NonDeprecatedProtocol1;
14
 
15
void function1 (id <DeprecatedProtocol1> object); /* { dg-warning "is deprecated" } */
16
void function2 (id <NonDeprecatedProtocol1> object);
17
 
18
@class Class4;
19
 
20
void function3 (Class4 <DeprecatedProtocol1> *object); /* { dg-warning "is deprecated" } */
21
void function4 (Class4 <NonDeprecatedProtocol1> *object);
22
void function5 (Class4 <NonDeprecatedProtocol1, DeprecatedProtocol1> *object); /* { dg-warning "is deprecated" } */
23
 
24
int function6 (void)
25
{
26
  Protocol *p1 = @protocol (DeprecatedProtocol1); /* { dg-warning "is deprecated" } */
27
  Protocol *p2 = @protocol (NonDeprecatedProtocol1);
28
 
29
  return (p1 == p2);
30
}
31
 

powered by: WebSVN 2.1.0

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