OSDN Git Service

[gcc/testsuite/ChangeLog]
authorzlaski <zlaski@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 26 May 2005 00:51:53 +0000 (00:51 +0000)
committerzlaski <zlaski@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 26 May 2005 00:51:53 +0000 (00:51 +0000)
2005-05-25  Ziemowit Laski  <zlaski@apple.com>

        * obj-c++.dg/selector-1.mm: New.
        * obj-c++.dg/selector-2.mm: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100179 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/obj-c++.dg/selector-1.mm [new file with mode: 0644]
gcc/testsuite/obj-c++.dg/selector-2.mm [new file with mode: 0644]

index 4605f72..36234bb 100644 (file)
@@ -1,5 +1,10 @@
 2005-05-25  Ziemowit Laski  <zlaski@apple.com>
 
+       * obj-c++.dg/selector-1.mm: New.
+       * obj-c++.dg/selector-2.mm: New.
+
+2005-05-25  Ziemowit Laski  <zlaski@apple.com>
+
        * obj-c++.dg/selector-3.mm: New.
        * objc.dg/selector-3.m: New.
 
diff --git a/gcc/testsuite/obj-c++.dg/selector-1.mm b/gcc/testsuite/obj-c++.dg/selector-1.mm
new file mode 100644 (file)
index 0000000..b9cc5e0
--- /dev/null
@@ -0,0 +1,26 @@
+/* Test warning for non existing selectors.  */
+/* Contributed by Devang Patel <dpatel@apple.com>.  */
+/* { dg-options "-Wselector -fnext-runtime" } */
+/* { dg-do compile } */
+
+typedef struct objc_object { struct objc_class *class_pointer; } *id;
+typedef struct objc_selector    *SEL;
+
+@interface Foo
+- (void) foo;
+- (void) bar;
+@end
+
+@implementation Foo
+- (void) bar
+{
+}
+
+- (void) foo
+{
+  SEL a,b,c;
+  a = @selector(b1ar); /* { dg-warning "creating selector for nonexistent method .b1ar." } */
+  b = @selector(bar);
+}
+@end
+
diff --git a/gcc/testsuite/obj-c++.dg/selector-2.mm b/gcc/testsuite/obj-c++.dg/selector-2.mm
new file mode 100644 (file)
index 0000000..09fbc25
--- /dev/null
@@ -0,0 +1,17 @@
+/* Test that we don't ICE when issuing a -Wselector warning.  */
+/* { dg-options "-Wselector" } */
+/* { dg-do compile } */
+
+#include <objc/Object.h>
+
+@interface Foo
+@end
+@implementation Foo
+-(void) foo
+{
+  SEL a;
+  a = @selector(b1ar);
+}
+@end
+/* { dg-warning "creating selector for nonexistent method .b1ar." "" { target *-*-* } 0 } */
+