tree-optimization/115640 - outer loop vect with inner SLP permute
[official-gcc.git] / gcc / testsuite / objc.dg / method-7.m
blob314e8abaf8931093e20d71d65cdcc6d6c7af9b75
1 /* Check if finding multiple signatures for a method is handled gracefully.  */
2 /* Author:  Ziemowit Laski <zlaski@apple.com>  */
3 /* { dg-do compile } */
4 /* { dg-options "-Wstrict-selector-match" } */
6 #include <objc/objc.h>
7 #include "../objc-obj-c++-shared/TestsuiteObject.h"
9 @interface Class1
10 - (void)setWindow:(TestsuiteObject *)wdw; /* { dg-line Class1_setWindow } */
11 @end
13 @interface Class2
14 - (void)setWindow:(Class1 *)window;       /* { dg-line Class2_setWindow } */
15 @end
17 id foo(void) {
18   TestsuiteObject *obj = [[TestsuiteObject alloc] init];
19   id obj2 = obj;
20   [obj setWindow:nil];  /* { dg-warning ".TestsuiteObject. may not respond to .\\-setWindow:." } */
21   /* { dg-warning "messages without a matching method signature will be assumed to return .id. and accept .\.\.\.. as arguments" "" { target *-*-* } 0 } */
22   [obj2 setWindow:nil]; /* { dg-warning "multiple methods named .\\-setWindow:. found" } */
23   /* { dg-message "using .\\-\\(void\\)setWindow:\\(TestsuiteObject \\*\\)wdw." "" { target *-*-* } Class1_setWindow } */
24   /* { dg-message "also found .\\-\\(void\\)setWindow:\\(Class1 \\*\\)window." "" { target *-*-* } Class2_setWindow } */
26   return obj;