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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc.dg/] [property/] [at-property-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 that properties can be deprecated.  */
5
 
6
#include <stdlib.h>
7
#include <objc/objc.h>
8
#include <objc/runtime.h>
9
 
10
@interface MyRootClass
11
{
12
  Class isa;
13
  int a;
14
}
15
@property int a __attribute__((deprecated));
16
+ (id) initialize;
17
+ (id) alloc;
18
- (id) init;
19
@end
20
 
21
@implementation MyRootClass
22
+ (id) initialize { return self; }
23
+ (id) alloc { return class_createInstance (self, 0); }
24
- (id) init { return self; }
25
@synthesize a;
26
@end
27
 
28
int main (void)
29
{
30
  MyRootClass *object = [[MyRootClass alloc] init];
31
 
32
  object.a = 40;      /* { dg-warning "is deprecated" } */
33
  if (object.a != 40) /* { dg-warning "is deprecated" } */
34
    abort ();
35
 
36
  return 0;
37
}

powered by: WebSVN 2.1.0

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