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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc.dg/] [property/] [dotsyntax-deprecated-1.m] - Blame information for rev 704

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 704 jeremybenn
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, October 2010.  */
2
/* { dg-do compile } */
3
 
4
/* Test the 'dot syntax' with deprecated methods.  */
5
 
6
#include <objc/objc.h>
7
 
8
@interface MyClass
9
{
10
  Class isa;
11
}
12
+ (int) classCount __attribute__ ((deprecated));
13
+ (void) setClassCount: (int)value __attribute__ ((deprecated));
14
 
15
- (int) count __attribute__ ((deprecated));
16
- (void) setCount: (int)value __attribute__ ((deprecated));
17
 
18
- (int) classCount2;
19
- (void) setClassCount2: (int)value;
20
 
21
- (int) count2;
22
- (void) setCount2: (int)value;
23
@end
24
 
25
void foo (void)
26
{
27
  MyClass *object = nil;
28
 
29
 
30
  if (object.count > 0)  /* { dg-warning "is deprecated" } */
31
    object.count = 20;  /* { dg-warning "is deprecated" } */
32
 
33
  if (MyClass.classCount < -7)   /* { dg-warning "is deprecated" } */
34
    MyClass.classCount = 11;  /* { dg-warning "is deprecated" } */
35
 
36
  if (object.classCount2 > 0)
37
    object.classCount2 = 19;
38
 
39
  if (object.count2 < -7)
40
    object.count2 = 74;
41
}

powered by: WebSVN 2.1.0

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