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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc.dg/] [proto-init-mimatch-1.m] - Blame information for rev 704

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 704 jeremybenn
/* Test to warn on protocol mismatch in a variety of initializations. */
2
 
3
/* { dg-do compile } */
4
 
5
typedef struct objc_class *Class;
6
 
7
typedef struct objc_object {
8
        Class isa;
9
} *id;
10
 
11
@protocol NSObject
12
@end
13
 
14
@interface NSObject <NSObject>
15
@end
16
 
17
@protocol NSCopying
18
- (void)copyWithZone;
19
@end
20
 
21
@interface Foo:NSObject <NSCopying>
22
@end
23
 
24
 
25
extern id <NSObject> NSCopyObject();
26
 
27
@implementation Foo
28
- (void)copyWithZone {
29
    Foo *copy = NSCopyObject(); /* { dg-warning "type \\'id <NSObject>\\' does not conform to the \\'NSCopying\\' protocol" } */
30
 
31
    Foo<NSObject,NSCopying> *g = NSCopyObject(); /* { dg-warning "type \\'id <NSObject>\\' does not conform to the \\'NSCopying\\' protocol" } */
32
 
33
    id<NSObject,NSCopying> h = NSCopyObject(); /* { dg-warning "type \\'id <NSObject>\\' does not conform to the \\'NSCopying\\' protocol" } */
34
}
35
@end

powered by: WebSVN 2.1.0

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