Merge trunk version 201119 into gupc branch.
[official-gcc.git] / gcc / testsuite / objc.dg / attributes / method-deprecated-3.m
blob5c715a20b683450d7aecb92f1795f087767c9f5b
1 /* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, October 2010.  */
2 /* { dg-do compile } */
4 #include <objc/objc.h>
6 /* Test that __attribute__ ((__deprecated__)) works as well as __attribute__ ((deprecated)).  */
7 @interface MyClass
9   Class isa;
10
11 + (int) deprecatedClassMethod: (id)firstObject, ...    __attribute__((__deprecated__));
12 - (int) deprecatedInstanceMethod: (id)firstobject, ... __attribute__((__deprecated__));
13 @end
15 void foo (void)
17   MyClass *object = nil;
19   [MyClass deprecatedClassMethod: object, nil];           /* { dg-warning "is deprecated" } */
20   [object deprecatedInstanceMethod: object, nil];         /* { dg-warning "is deprecated" } */