PATCH: A couple more selector thingies

Ziemowit Laski zlaski@apple.com
Thu May 26 00:53:00 GMT 2005


Basically to make ObjC and ObjC++ testing more "symmetric".


[gcc/testsuite/ChangeLog]
2005-05-25  Ziemowit Laski  <zlaski@apple.com>

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

Index: gcc/testsuite/obj-c++.dg/selector-1.mm
===================================================================
RCS file: gcc/testsuite/obj-c++.dg/selector-1.mm
diff -N gcc/testsuite/obj-c++.dg/selector-1.mm
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ gcc/testsuite/obj-c++.dg/selector-1.mm      26 May 2005 00:49:19 
-0000
@@ -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
+
Index: gcc/testsuite/obj-c++.dg/selector-2.mm
===================================================================
RCS file: gcc/testsuite/obj-c++.dg/selector-2.mm
diff -N gcc/testsuite/obj-c++.dg/selector-2.mm
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ gcc/testsuite/obj-c++.dg/selector-2.mm      26 May 2005 00:49:19 
-0000
@@ -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 } */
+

--------------------------------------------------------------
Ziemowit Laski                 1 Infinite Loop, MS 301-2K
Mac OS X Compiler Group        Cupertino, CA USA  95014-2083
Apple Computer, Inc.           +1.408.974.6229  Fax .5477



More information about the Gcc-patches mailing list