Patchwork libobjc - testcase for pr18255.m

login
register
mail settings
Submitter Nicola Pero
Date Oct. 17, 2010, 10:11 a.m.
Message ID <1287310287.25177978@192.168.2.227>
Download mbox | patch
Permalink /patch/68074/
State New
Headers show

Comments

Nicola Pero - Oct. 17, 2010, 10:11 a.m.
I fixed objc/18255 (really, a libobjc bug) while working on the protocol initialization in libobjc the other day.  This is the associated testcase (which segfaults my stock 4.1.2 GCC, but runs fine on trunk). :-)

Committed to trunk.

Thanks

Patch

Index: ChangeLog
===================================================================
--- ChangeLog   (revision 165577)
+++ ChangeLog   (working copy)
@@ -1,3 +1,8 @@ 
+2010-10-17  Nicola Pero  <nicola.pero@meta-innovation.com>
+
+       PR objc/18255
+       * objc.dg/pr18255.m: New.
+
 2010-10-16  Jan Hubicka  <jh@suse.cz>
 
        PR middle-end/44206
Index: objc.dg/pr18255.m
===================================================================
--- objc.dg/pr18255.m   (revision 0)
+++ objc.dg/pr18255.m   (revision 0)
@@ -0,0 +1,24 @@ 
+/* This is a test for a GNU Objective-C Runtime library bug.  */
+/* { dg-do run } */
+/* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */
+
+#include <objc/Protocol.h>
+#include <stdlib.h>
+
+@protocol a
+- aMethod;
+@end
+
+
+@protocol b <a>
+- bMethod;
+@end
+
+
+int main (int argc, char **argv)
+{
+  if ([@protocol(b) descriptionForInstanceMethod: @selector(aMethod)] == NULL)
+    abort ();
+
+  return 0;
+}