aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorNicola Pero <nicola.pero@meta-innovation.com>2011-02-28 14:48:23 +0000
committerNicola Pero <nicola@gcc.gnu.org>2011-02-28 14:48:23 +0000
commit68ade9e4e84617fd5c613618cfdc0cc1fa6d6d81 (patch)
tree2206ef603597ed2c4ee93c47cebe6a18a1f3fcb0 /gcc
parent2f2935b6d5c7d9976710d40b79036bec4c7087aa (diff)
downloadgcc-68ade9e4e84617fd5c613618cfdc0cc1fa6d6d81.zip
gcc-68ade9e4e84617fd5c613618cfdc0cc1fa6d6d81.tar.gz
gcc-68ade9e4e84617fd5c613618cfdc0cc1fa6d6d81.tar.bz2
In libobjc/: 2011-02-28 Nicola Pero <nicola.pero@meta-innovation.com>
In libobjc/: 2011-02-28 Nicola Pero <nicola.pero@meta-innovation.com> * selector.c (sel_getTypedSelector): Return NULL if there are multiple selectors with conflicting types. * objc/runtime.h (sel_getTypedSelector): Updated documentation. In gcc/testsuite/: 2011-02-28 Nicola Pero <nicola.pero@meta-innovation.com> * objc.dg/gnu-api-2-sel.m: Test that sel_getTypedSelector return NULL in case of a selector with conflicting types. * obj-c++.dg/gnu-api-2-sel.mm: Same change. From-SVN: r170563
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/obj-c++.dg/gnu-api-2-sel.mm22
-rw-r--r--gcc/testsuite/objc.dg/gnu-api-2-sel.m22
3 files changed, 50 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 213e9c2..fe2cedd 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2011-02-28 Nicola Pero <nicola.pero@meta-innovation.com>
+
+ * objc.dg/gnu-api-2-sel.m: Test that sel_getTypedSelector return
+ NULL in case of a selector with conflicting types.
+ * obj-c++.dg/gnu-api-2-sel.mm: Same change.
+
2011-02-28 Kazu Hirata <kazu@codesourcery.com>
* gcc.target/arm/vfp-ldmdbd.c, gcc.target/arm/vfp-ldmdbs.c,
diff --git a/gcc/testsuite/obj-c++.dg/gnu-api-2-sel.mm b/gcc/testsuite/obj-c++.dg/gnu-api-2-sel.mm
index b00588c..ff50058 100644
--- a/gcc/testsuite/obj-c++.dg/gnu-api-2-sel.mm
+++ b/gcc/testsuite/obj-c++.dg/gnu-api-2-sel.mm
@@ -46,6 +46,21 @@
- (void) method { return; }
@end
+@interface ClassA : MyRootClass
+- (id) conflictingSelectorMethod;
+@end
+
+@implementation ClassA
+- (id) conflictingSelectorMethod { return nil; }
+@end
+
+@interface ClassB : MyRootClass
+- (void) conflictingSelectorMethod;
+@end
+
+@implementation ClassB
+- (void) conflictingSelectorMethod { return; }
+@end
int main ()
{
@@ -134,6 +149,13 @@ int main ()
if (selector != NULL)
abort ();
+
+ /* Now try a selector with multiple, conflicting types. NULL
+ should be returned. */
+ selector = sel_getTypedSelector ("conflictingSelectorMethod");
+
+ if (selector != NULL)
+ abort ();
}
#endif
diff --git a/gcc/testsuite/objc.dg/gnu-api-2-sel.m b/gcc/testsuite/objc.dg/gnu-api-2-sel.m
index 9a6aef2..b71fdfa 100644
--- a/gcc/testsuite/objc.dg/gnu-api-2-sel.m
+++ b/gcc/testsuite/objc.dg/gnu-api-2-sel.m
@@ -46,6 +46,21 @@
- (void) method { return; }
@end
+@interface ClassA : MyRootClass
+- (id) conflictingSelectorMethod;
+@end
+
+@implementation ClassA
+- (id) conflictingSelectorMethod { return nil; }
+@end
+
+@interface ClassB : MyRootClass
+- (void) conflictingSelectorMethod;
+@end
+
+@implementation ClassB
+- (void) conflictingSelectorMethod { return; }
+@end
int main(int argc, void **args)
{
@@ -134,6 +149,13 @@ int main(int argc, void **args)
if (selector != NULL)
abort ();
+
+ /* Now try a selector with multiple, conflicting types. NULL
+ should be returned. */
+ selector = sel_getTypedSelector ("conflictingSelectorMethod");
+
+ if (selector != NULL)
+ abort ();
}
#endif