From patchwork Sun Oct 17 10:11:27 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: libobjc - testcase for pr18255.m Date: Sun, 17 Oct 2010 00:11:27 -0000 From: Nicola Pero X-Patchwork-Id: 68074 Message-Id: <1287310287.25177978@192.168.2.227> To: "gcc-patches@gnu.org" 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 Index: ChangeLog =================================================================== --- ChangeLog (revision 165577) +++ ChangeLog (working copy) @@ -1,3 +1,8 @@ +2010-10-17 Nicola Pero + + PR objc/18255 + * objc.dg/pr18255.m: New. + 2010-10-16 Jan Hubicka 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 +#include + +@protocol a +- aMethod; +@end + + +@protocol b +- bMethod; +@end + + +int main (int argc, char **argv) +{ + if ([@protocol(b) descriptionForInstanceMethod: @selector(aMethod)] == NULL) + abort (); + + return 0; +}