* gcc.target/powerpc/fold-vec-add-1.c: Add dg-options -maltivec.
[official-gcc.git] / gcc / testsuite / objc.dg / method-6.m
bloba14c14d6d5c5a805a4fe956bfbfc8d0765af4e78
1 /* Check that sending messages to variables of type 'Class' does not involve instance methods,
2    unless they reside in root classes.  */
3 /* Author: Ziemowit Laski <zlaski@apple.com>  */
4 /* { dg-do compile } */
5 /* { dg-options "-Wstrict-selector-match" } */
7 #ifdef __NEXT_RUNTIME__
8 #include <Foundation/NSObject.h>
9 #define OBJECT NSObject
10 #else
11 #include <objc/Object.h>
12 #include <objc/Protocol.h>
13 #define OBJECT Object
14 #endif
16 @interface Base
17 - (unsigned)port;
18 @end
20 @interface Derived: Base
21 - (OBJECT *)port;
22 + (Protocol *)port;
23 - (id)starboard;
24 @end
26 void foo(void) {
27   Class receiver;
29   [receiver port];  /* { dg-warning "multiple methods named .\\+port. found" } */
30        /* { dg-message "using .\\-\\(unsigned( int)?\\)port." "" { target *-*-* } 17 } */
31        /* { dg-message "also found .\\+\\(Protocol \\*\\)port." "" { target *-*-* } 22 } */
33   [receiver starboard];  /* { dg-warning "no .\\+starboard. method found" } */
34        /* { dg-warning "Messages without a matching method signature" "" { target *-*-* } 33 } */
35        /* { dg-warning "will be assumed to return .id. and accept" "" { target *-*-* } 33 } */
36        /* { dg-warning ".\.\.\.. as arguments" "" { target *-*-* } 33 } */
38   [Class port];  /* { dg-error ".Class. is not an Objective\\-C class name or alias" } */