diff options
-rw-r--r-- | test/SemaObjC/debugger-cast-result-to-id.m | 18 | ||||
-rw-r--r-- | test/SemaObjCXX/debugger-cast-result-to-id.mm | 9 | ||||
-rw-r--r-- | test/SemaObjCXX/unknown-anytype.mm | 2 |
3 files changed, 10 insertions, 19 deletions
diff --git a/test/SemaObjC/debugger-cast-result-to-id.m b/test/SemaObjC/debugger-cast-result-to-id.m index 86f4c3aa24..81a630703e 100644 --- a/test/SemaObjC/debugger-cast-result-to-id.m +++ b/test/SemaObjC/debugger-cast-result-to-id.m @@ -7,21 +7,3 @@ void test_unknown_anytype_receiver() { (void)(int)[[test0 unknownMethod] otherUnknownMethod];; (void)(id)[[test1() unknownMethod] otherUnknownMethod]; } -// RUN: %clang_cc1 -funknown-anytype -fsyntax-only -fdebugger-support -fdebugger-cast-result-to-id -verify %s - -extern __unknown_anytype test0; -extern __unknown_anytype test1(); - -void test_unknown_anytype_receiver() { - (void)(int)[[test0 unknownMethod] otherUnknownMethod];; - (void)(id)[[test1() unknownMethod] otherUnknownMethod]; -} -// RUN: %clang_cc1 -funknown-anytype -fsyntax-only -fdebugger-support -fdebugger-cast-result-to-id -verify %s - -extern __unknown_anytype test0; -extern __unknown_anytype test1(); - -void test_unknown_anytype_receiver() { - (void)(int)[[test0 unknownMethod] otherUnknownMethod];; - (void)(id)[[test1() unknownMethod] otherUnknownMethod]; -} diff --git a/test/SemaObjCXX/debugger-cast-result-to-id.mm b/test/SemaObjCXX/debugger-cast-result-to-id.mm new file mode 100644 index 0000000000..9487a22b6c --- /dev/null +++ b/test/SemaObjCXX/debugger-cast-result-to-id.mm @@ -0,0 +1,9 @@ +// RUN: %clang_cc1 -fdebugger-support -fdebugger-cast-result-to-id -funknown-anytype -fsyntax-only -verify %s + +// rdar://problem/9416370 +namespace test0 { + void test(id x) { + if ([x foo]) {} // expected-error {{no known method '-foo'; cast the message send to the method's return type}} + [x foo]; + } +} diff --git a/test/SemaObjCXX/unknown-anytype.mm b/test/SemaObjCXX/unknown-anytype.mm index 40954c85eb..b28b1355ef 100644 --- a/test/SemaObjCXX/unknown-anytype.mm +++ b/test/SemaObjCXX/unknown-anytype.mm @@ -4,6 +4,6 @@ namespace test0 { void test(id x) { if ([x foo]) {} // expected-error {{no known method '-foo'; cast the message send to the method's return type}} - [x foo]; + [x foo]; // expected-error {{no known method '-foo'; cast the message send to the method's return type}} } } |