This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: Trivial fix for objc.dg/selector-2.m test case
On 25 May 2005, at 16.38, Ziemowit Laski wrote:
What we need is a mirror image of selector-1.m, with -fgnu-runtime
instead
of -fnext-runtime. The new selector-2.m is still useful, since it
exercises
the default runtime used by a particular target.
I'll whip up a selector-3.m.
Here goes.
[gcc/testsuite/ChangeLog]
2005-05-25 Ziemowit Laski <zlaski@apple.com>
* obj-c++.dg/selector-3.mm: New.
* objc.dg/selector-3.m: New.
Index: gcc/testsuite/obj-c++.dg/selector-3.mm
===================================================================
RCS file: gcc/testsuite/obj-c++.dg/selector-3.mm
diff -N gcc/testsuite/obj-c++.dg/selector-3.mm
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gcc/testsuite/obj-c++.dg/selector-3.mm 25 May 2005 23:58:17
-0000
@@ -0,0 +1,26 @@
+/* Test warning for non-existent selectors. */
+/* This is the "-fgnu-runtime" variant of objc.dg/selector-1.m. */
+/* { dg-options "-Wselector -fgnu-runtime" } */
+/* { dg-do compile } */
+
+typedef struct objc_object { struct objc_class *class_pointer; } *id;
+typedef const struct objc_selector *SEL;
+
+@interface Foo
+- (void) foo;
+- (void) bar;
+@end
+
+@implementation Foo
+- (void) bar
+{
+}
+
+- (void) foo
+{
+ SEL a,b,c;
+ a = @selector(b1ar);
+ b = @selector(bar);
+}
+@end /* { dg-warning "creating selector for nonexistent method .b1ar."
} */
+
Index: gcc/testsuite/objc.dg/selector-3.m
===================================================================
RCS file: gcc/testsuite/objc.dg/selector-3.m
diff -N gcc/testsuite/objc.dg/selector-3.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gcc/testsuite/objc.dg/selector-3.m 25 May 2005 23:58:17 -0000
@@ -0,0 +1,26 @@
+/* Test warning for non-existent selectors. */
+/* This is the "-fgnu-runtime" variant of objc.dg/selector-1.m. */
+/* { dg-options "-Wselector -fgnu-runtime" } */
+/* { dg-do compile } */
+
+typedef struct objc_object { struct objc_class *class_pointer; } *id;
+typedef const struct objc_selector *SEL;
+
+@interface Foo
+- (void) foo;
+- (void) bar;
+@end
+
+@implementation Foo
+- (void) bar
+{
+}
+
+- (void) foo
+{
+ SEL a,b,c;
+ a = @selector(b1ar);
+ b = @selector(bar);
+}
+@end /* { dg-warning "creating selector for nonexistent method .b1ar."
} */
+
--------------------------------------------------------------
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