+Mon Dec 17 16:54:56 2001 Nicola Pero <nicola@brainstorm.co.uk>
+
+ * objc.dg/special/: New directory.
+ * objc.dg/special/special.exp: New file.
+ * objc.dg/special/unclaimed-category-1.h: New file.
+ * objc.dg/special/unclaimed-category-1a.m: New file.
+ * objc.dg/special/unclaimed-category-1.m: New file.
+
2001-12-17 Andreas Jaeger <aj@suse.de>
* gcc.c-torture/compile/20011217-2.c: New test.
--- /dev/null
+# GCC Objective-C testsuite that uses the `dg.exp' driver.
+# Copyright (C) 1997, 2001 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Load support procs.
+load_lib objc-dg.exp
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_CFLAGS
+if ![info exists DEFAULT_CFLAGS] then {
+ set DEFAULT_CFLAGS ""
+}
+
+# Initialize `dg'.
+dg-init
+
+#
+# unclaimed-category-1 test
+#
+# This test is special because we must compile two different modules,
+# unclaimed-category-1a.m and unclaimed-category-1.m, then link
+# together, then run the resulting executable.
+set lines [objc_target_compile "$srcdir/$subdir/unclaimed-category-1a.m" "unclaimed-category-1a.o" object ""]
+if ![string match "" $lines] then {
+ fail "unclaimed-category-1a.o"
+} else {
+ dg-runtest "$srcdir/$subdir/unclaimed-category-1.m" "unclaimed-category-1a.o" ""
+ file delete unclaimed-category-1a.o
+}
+
+# All done.
+dg-finish
+
--- /dev/null
+/* Contributed by Nicola Pero - Fri Dec 14 08:36:00 GMT 2001 */
+#include <objc/objc.h>
+#include <objc/Object.h>
+
+/* Test loading unclaimed categories - categories of a class defined
+ separately from the class itself. */
+
+@interface TestClass
+{
+ id isa;
+}
+- (int)D;
+@end
+
+@interface TestClass (A)
+- (int)A;
+@end
+
+@interface TestClass (B)
+- (int)B;
+@end
+
+@interface TestClass (C)
+- (int)C;
+@end
+
+
--- /dev/null
+/* Contributed by Nicola Pero - Fri Dec 14 08:36:00 GMT 2001 */
+/* { dg-do run } */
+#include <objc/objc.h>
+#include <objc/Object.h>
+
+/* Test loading unclaimed categories - categories of a class defined
+ separately from the class itself. */
+
+
+/* unclaimed-category-1.m contains only the class definition but not
+ the categories. unclaimed-category-1a.m contains only the
+ categories of the class, but not the class itself. We want to
+ check that the runtime can load the class from one module (file)
+ and the categories from another module (file). */
+
+#include "unclaimed-category-1.h"
+
+@implementation TestClass
+- (int)D
+{
+ return 4;
+}
+@end
+
+
+int main (void)
+{
+ TestClass *test;
+ Class testClass;
+
+ testClass = objc_get_class ("TestClass");
+ if (testClass == Nil)
+ {
+ abort ();
+ }
+
+ test = (TestClass *)(class_create_instance (testClass));
+ if (test == nil)
+ {
+ abort ();
+ }
+
+ if ([test A] != 1)
+ {
+ abort ();
+ }
+
+ if ([test B] != 2)
+ {
+ abort ();
+ }
+
+ if ([test C] != 3)
+ {
+ abort ();
+ }
+
+
+ if ([test D] != 4)
+ {
+ abort ();
+ }
+
+ return 0;
+}
--- /dev/null
+/* Contributed by Nicola Pero - Fri Dec 14 08:36:00 GMT 2001 */
+#include <objc/objc.h>
+#include <objc/Object.h>
+
+/* Test loading unclaimed categories - categories of a class defined
+ separately from the class itself. */
+
+#include "unclaimed-category-1.h"
+
+@implementation TestClass (A)
+- (int)A
+{
+ return 1;
+}
+@end
+
+@implementation TestClass (B)
+- (int)B
+{
+ return 2;
+}
+@end
+
+@implementation TestClass (C)
+- (int)C
+{
+ return 3;
+}
+@end
+
+