In gcc/testsuite/: 2010-12-26 Nicola Pero <nicola.pero@meta-innovation.com>
authorNicola Pero <nicola.pero@meta-innovation.com>
Sun, 26 Dec 2010 18:05:00 +0000 (18:05 +0000)
committerNicola Pero <nicola@gcc.gnu.org>
Sun, 26 Dec 2010 18:05:00 +0000 (18:05 +0000)
In gcc/testsuite/:
2010-12-26  Nicola Pero  <nicola.pero@meta-innovation.com>

* objc.dg/gnu-api-2-class.m: Updated the test to work with the
Apple runtime as well.
* obj-c++.dg/gnu-api-2-class.mm: Same change.
* objc.dg/gnu-api-2-ivar.m: Same change.
* obj-c++.dg/gnu-api-2-ivar.mm: Same change.
* objc.dg/gnu-api-2-method.m: Same change.
* obj-c++.dg/gnu-api-2-method.mm: Same change.
* objc.dg/gnu-api-2-objc.m: Same change.
* obj-c++.dg/gnu-api-2-objc.mm: Same change.
* objc.dg/gnu-api-2-object.m: Same change.
* obj-c++.dg/gnu-api-2-object.mm: Same change.
* objc.dg/gnu-api-2-property.m: Same change.
* obj-c++.dg/gnu-api-2-property.mm: Same change.
* objc.dg/gnu-api-2-protocol.m: Same change.
* obj-c++.dg/gnu-api-2-protocol.mm: Same change.

* objc.dg/gnu-api-2-objc.m: Also, fixed test for
objc_disposeClassPair not to create a new class pair with the same
name as an existing class, and to test that the class pair is
created correctly.
* obj-c++.dg/gnu-api-2-objc.mm: Same change.

From-SVN: r168252

15 files changed:
gcc/testsuite/ChangeLog
gcc/testsuite/obj-c++.dg/gnu-api-2-class.mm
gcc/testsuite/obj-c++.dg/gnu-api-2-ivar.mm
gcc/testsuite/obj-c++.dg/gnu-api-2-method.mm
gcc/testsuite/obj-c++.dg/gnu-api-2-objc.mm
gcc/testsuite/obj-c++.dg/gnu-api-2-object.mm
gcc/testsuite/obj-c++.dg/gnu-api-2-property.mm
gcc/testsuite/obj-c++.dg/gnu-api-2-protocol.mm
gcc/testsuite/objc.dg/gnu-api-2-class.m
gcc/testsuite/objc.dg/gnu-api-2-ivar.m
gcc/testsuite/objc.dg/gnu-api-2-method.m
gcc/testsuite/objc.dg/gnu-api-2-objc.m
gcc/testsuite/objc.dg/gnu-api-2-object.m
gcc/testsuite/objc.dg/gnu-api-2-property.m
gcc/testsuite/objc.dg/gnu-api-2-protocol.m

index c4a012b9c7c660802a9e5feba163831b563662d5..60773fb90c7824e5c0528ee3bf4b30c63f8e6db5 100644 (file)
@@ -1,3 +1,27 @@
+2010-12-26  Nicola Pero  <nicola.pero@meta-innovation.com>
+
+       * objc.dg/gnu-api-2-class.m: Updated the test to work with the
+       Apple runtime as well.
+       * obj-c++.dg/gnu-api-2-class.mm: Same change.
+       * objc.dg/gnu-api-2-ivar.m: Same change.
+       * obj-c++.dg/gnu-api-2-ivar.mm: Same change.
+       * objc.dg/gnu-api-2-method.m: Same change.
+       * obj-c++.dg/gnu-api-2-method.mm: Same change.
+       * objc.dg/gnu-api-2-objc.m: Same change.
+       * obj-c++.dg/gnu-api-2-objc.mm: Same change.
+       * objc.dg/gnu-api-2-object.m: Same change.
+       * obj-c++.dg/gnu-api-2-object.mm: Same change.
+       * objc.dg/gnu-api-2-property.m: Same change.
+       * obj-c++.dg/gnu-api-2-property.mm: Same change.
+       * objc.dg/gnu-api-2-protocol.m: Same change.
+       * obj-c++.dg/gnu-api-2-protocol.mm: Same change.
+
+       * objc.dg/gnu-api-2-objc.m: Also, fixed test for
+       objc_disposeClassPair not to create a new class pair with the same
+       name as an existing class, and to test that the class pair is
+       created correctly.
+       * obj-c++.dg/gnu-api-2-objc.mm: Same change.
+       
 2010-12-26  Nicola Pero  <nicola.pero@meta-innovation.com>
 
        * objc.dg/special/special.exp: Added load-category-2 and
index 18c3393fa1e905de4dae416135639712db301d7a..1e0aaa967e18c3e44b921fed69ce7fb6e89143bb 100644 (file)
@@ -3,7 +3,6 @@
   This is test 'class', covering all functions starting with 'class'.  */
 
 /* { dg-do run } */
-/* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */
 
 /* To get the modern GNU Objective-C Runtime API, you include
    objc/runtime.h.  */
 { Class isa; }
 + alloc;
 - init;
++ initialize;
 @end
 
 @implementation MyRootClass
 + alloc { return class_createInstance (self, 0); }
 - init  { return self; }
++ initialize { return self; }
 @end
 
 @protocol MyProtocol
@@ -256,7 +257,7 @@ int main ()
   std::cout << "Testing class_copyPropertyList ()...\n";
   {
     unsigned int count;
-    Property * list = class_copyPropertyList (objc_getClass ("MySubClass"), &count);
+    objc_property_t * list = class_copyPropertyList (objc_getClass ("MySubClass"), &count);
 
     if (count != 0  ||  list != NULL)
       abort ();
index a95cbac7fcc7600388f1e4bb80d7a8bc02c39d5e..47cc57521313d5f850e0b5df65868352c509b749 100644 (file)
@@ -3,7 +3,6 @@
   This is test 'ivar', covering all functions starting with 'ivar'.  */
 
 /* { dg-do run } */
-/* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */
 
 /* To get the modern GNU Objective-C Runtime API, you include
    objc/runtime.h.  */
 { Class isa; }
 + alloc;
 - init;
++ initialize;
 @end
 
 @implementation MyRootClass
 + alloc { return class_createInstance (self, 0); }
 - init  { return self; }
++ initialize { return self; }
 @end
 
 @protocol MyProtocol
index ea665052660f98d9f4269a4a726c2fa2727afd28..56f9f2d155769e79883d7f972c25071aa1ad8517 100644 (file)
@@ -3,7 +3,6 @@
   This is test 'method', covering all functions starting with 'method'.  */
 
 /* { dg-do run } */
-/* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */
 
 /* To get the modern GNU Objective-C Runtime API, you include
    objc/runtime.h.  */
 { Class isa; }
 + alloc;
 - init;
++ initialize;
 @end
 
 @implementation MyRootClass
 + alloc { return class_createInstance (self, 0); }
 - init  { return self; }
++ initialize { return self; }
 @end
 
 @protocol MyProtocol
index 4761278c955cdeb6e030728948481629edeb76c6..b7d4ace00704a75685a1c743bb928351f9faf6c8 100644 (file)
@@ -3,7 +3,6 @@
   This is test 'objc', covering all functions starting with 'objc'.  */
 
 /* { dg-do run } */
-/* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */
 
 /* To get the modern GNU Objective-C Runtime API, you include
    objc/runtime.h.  */
 { Class isa; }
 + alloc;
 - init;
++ initialize;
 @end
 
 @implementation MyRootClass
 + alloc { return class_createInstance (self, 0); }
 - init  { return self; }
++ initialize { return self; }
 @end
 
 @protocol MyProtocol
@@ -103,7 +104,10 @@ int main ()
   std::cout << "Testing objc_disposeClassPair ()...\n";
   {
     Method method = class_getInstanceMethod (objc_getClass ("MySubClass"), @selector (setVariable:));
-    Class new_class = objc_allocateClassPair (objc_getClass ("MyRootClass"), "MyNewSubClass", 0);
+    Class new_class = objc_allocateClassPair (objc_getClass ("MyRootClass"), "MyNewSubClass2", 0);
+
+    if (new_class == Nil)
+      abort ();
 
     /* Add a bit of everything to the class to exercise undoing all these changes.  */
 
index 2a544474d375b2a49bb7f40ade4c969c8b9fe0c0..219cd3d1cc5a55e647a92339cab0b9e466c111b5 100644 (file)
@@ -3,7 +3,6 @@
   This is test 'object', covering all functions starting with 'object'.  */
 
 /* { dg-do run } */
-/* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */
 
 /* To get the modern GNU Objective-C Runtime API, you include
    objc/runtime.h.  */
 { Class isa; }
 + alloc;
 - init;
++ initialize;
 @end
 
 @implementation MyRootClass
 + alloc { return class_createInstance (self, 0); }
 - init  { return self; }
++ initialize { return self; }
 @end
 
 @protocol MyProtocol
index 9907d4438f3bca7a5fd747b2770ebdcf438134f0..0279124dcc099cdc4df868357e6c7d1550a291d2 100644 (file)
@@ -3,7 +3,6 @@
   This is test 'property', covering all functions starting with 'property'.  */
 
 /* { dg-do run } */
-/* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */
 
 /* To get the modern GNU Objective-C Runtime API, you include
    objc/runtime.h.  */
 { Class isa; }
 + alloc;
 - init;
++ initialize;
 @end
 
 @implementation MyRootClass
 + alloc { return class_createInstance (self, 0); }
 - init  { return self; }
++ initialize { return self; }
 @end
 
 @protocol MyProtocol
@@ -50,15 +51,22 @@ int main ()
   /* TODO: Test new ABI (when available).  */
   std::cout << "Testing property_getAttributes () ...\n";
   {
+    /* The Apple/NeXT runtime seems to crash on the following.  */
+#ifdef __GNU_LIBOBJC__
     if (property_getAttributes (NULL) != NULL)
       abort ();
+#endif
   }
 
   /* TODO: Test new ABI (when available).  */
   std::cout << "Testing property_getName () ...\n";
   {
+    /* The Apple/NeXT runtime seems to crash on the following.  */
+#ifdef __GNU_LIBOBJC__
+
     if (property_getName (NULL) != NULL)
       abort ();
+#endif
   }
 
   return (0);
index 1db7d7661830c907ef04da491e611346b1d6d7cb..b16ba5c898a70e1834c224f2a5c3a289ae59c5ac 100644 (file)
@@ -3,7 +3,6 @@
   This is test 'protocol', covering all functions starting with 'protocol'.  */
 
 /* { dg-do run } */
-/* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */
 
 /* To get the modern GNU Objective-C Runtime API, you include
    objc/runtime.h.  */
 { Class isa; }
 + alloc;
 - init;
++ initialize;
 @end
 
 @implementation MyRootClass
 + alloc { return class_createInstance (self, 0); }
 - init  { return self; }
++ initialize { return self; }
 @end
 
 @protocol MyProtocol
@@ -88,7 +89,7 @@ int main ()
   std::cout << "Testing protocol_copyPropertyList ()...\n";
   {
     unsigned int count;
-    Property *list;
+    objc_property_t *list;
 
     list = protocol_copyPropertyList (@protocol (MyProtocol), &count);
 
@@ -136,7 +137,7 @@ int main ()
   /* TODO: Test new ABI (when available).  */
   std::cout << "Testing protocol_getProperty ()...\n";
   {
-    Property property;
+    objc_property_t property;
 
     property = protocol_getProperty (objc_getProtocol ("MyProtocol"), "someProperty",
                                     YES, YES);
index 3302fccbb17aeb628ddf247b676296a9a1969087..2b2715ceb3db2067702b72cf4a8d76ead9d2d462 100644 (file)
@@ -3,7 +3,6 @@
   This is test 'class', covering all functions starting with 'class'.  */
 
 /* { dg-do run } */
-/* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */
 
 /* To get the modern GNU Objective-C Runtime API, you include
    objc/runtime.h.  */
 { Class isa; }
 + alloc;
 - init;
++ initialize;
 @end
 
 @implementation MyRootClass
 + alloc { return class_createInstance (self, 0); }
 - init  { return self; }
++ initialize { return self; }
 @end
 
 @protocol MyProtocol
@@ -256,7 +257,7 @@ int main(int argc, void **args)
   printf ("Testing class_copyPropertyList ()...\n");
   {
     unsigned int count;
-    Property * list = class_copyPropertyList (objc_getClass ("MySubClass"), &count);
+    objc_property_t * list = class_copyPropertyList (objc_getClass ("MySubClass"), &count);
 
     if (count != 0  ||  list != NULL)
       abort ();
index 914a439553de1ecd2d88e9018db297af799429c4..484489ed75e5f7a0f9e3a7e51a33d8781924559b 100644 (file)
@@ -3,7 +3,6 @@
   This is test 'ivar', covering all functions starting with 'ivar'.  */
 
 /* { dg-do run } */
-/* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */
 
 /* To get the modern GNU Objective-C Runtime API, you include
    objc/runtime.h.  */
 { Class isa; }
 + alloc;
 - init;
++ initialize;
 @end
 
 @implementation MyRootClass
 + alloc { return class_createInstance (self, 0); }
 - init  { return self; }
++ initialize { return self; }
 @end
 
 @protocol MyProtocol
index cfcf28a9905754e81740e9d737930b860fbaff3f..a46305721f5ec09df6bf31e7ae92581aa3598fe8 100644 (file)
@@ -3,7 +3,6 @@
   This is test 'method', covering all functions starting with 'method'.  */
 
 /* { dg-do run } */
-/* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */
 
 /* To get the modern GNU Objective-C Runtime API, you include
    objc/runtime.h.  */
 { Class isa; }
 + alloc;
 - init;
++ initialize;
 @end
 
 @implementation MyRootClass
 + alloc { return class_createInstance (self, 0); }
 - init  { return self; }
++ initialize { return self; }
 @end
 
 @protocol MyProtocol
index c7f3946e596f66f8cf4891e4f30290e606439067..67e43c9d50bd8da6cccc3c8dfc76b26d52d750c8 100644 (file)
@@ -3,7 +3,6 @@
   This is test 'objc', covering all functions starting with 'objc'.  */
 
 /* { dg-do run } */
-/* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */
 
 /* To get the modern GNU Objective-C Runtime API, you include
    objc/runtime.h.  */
 { Class isa; }
 + alloc;
 - init;
++ initialize;
 @end
 
 @implementation MyRootClass
 + alloc { return class_createInstance (self, 0); }
 - init  { return self; }
++ initialize { return self; }
 @end
 
 @protocol MyProtocol
@@ -103,7 +104,10 @@ int main(int argc, void **args)
   printf ("Testing objc_disposeClassPair ()...\n");
   {
     Method method = class_getInstanceMethod (objc_getClass ("MySubClass"), @selector (setVariable:));
-    Class new_class = objc_allocateClassPair (objc_getClass ("MyRootClass"), "MyNewSubClass", 0);
+    Class new_class = objc_allocateClassPair (objc_getClass ("MyRootClass"), "MyNewSubClass2", 0);
+
+    if (new_class == Nil)
+      abort ();
 
     /* Add a bit of everything to the class to exercise undoing all these changes.  */
 
index 6068411d79b91a73406bfaf2ed176c8c0dd48ef4..db9576fc6fc680f5299c708195d438b3c2e224a8 100644 (file)
@@ -3,7 +3,6 @@
   This is test 'object', covering all functions starting with 'object'.  */
 
 /* { dg-do run } */
-/* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */
 
 /* To get the modern GNU Objective-C Runtime API, you include
    objc/runtime.h.  */
 { Class isa; }
 + alloc;
 - init;
++ initialize;
 @end
 
 @implementation MyRootClass
 + alloc { return class_createInstance (self, 0); }
 - init  { return self; }
++ initialize { return self; }
 @end
 
 @protocol MyProtocol
index 974ab6c80b8e665612da61872fa999c193f62063..8ac34e981f1d1b596dcce3953cb3af07d54a4beb 100644 (file)
@@ -3,7 +3,6 @@
   This is test 'property', covering all functions starting with 'property'.  */
 
 /* { dg-do run } */
-/* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */
 
 /* To get the modern GNU Objective-C Runtime API, you include
    objc/runtime.h.  */
 { Class isa; }
 + alloc;
 - init;
++ initialize;
 @end
 
 @implementation MyRootClass
 + alloc { return class_createInstance (self, 0); }
 - init  { return self; }
++ initialize { return self; }
 @end
 
 @protocol MyProtocol
@@ -50,15 +51,21 @@ int main(int argc, void **args)
   /* TODO: Test new ABI (when available).  */
   printf ("Testing property_getAttributes () ...\n");
   {
+    /* The Apple/NeXT runtime seems to crash on the following.  */
+#ifdef __GNU_LIBOBJC__
     if (property_getAttributes (NULL) != NULL)
       abort ();
+#endif
   }
 
   /* TODO: Test new ABI (when available).  */
   printf ("Testing property_getName () ...\n");
   {
+    /* The Apple/NeXT runtime seems to crash on the following.  */
+#ifdef __GNU_LIBOBJC__
     if (property_getName (NULL) != NULL)
       abort ();
+#endif
   }
 
   return 0;
index 537e5dfbc7d74d71634ef1d506cfad2f0ffc783b..84aca5d2c9561bf61510868a1b1cbbfc02116ac6 100644 (file)
@@ -3,7 +3,6 @@
   This is test 'protocol', covering all functions starting with 'protocol'.  */
 
 /* { dg-do run } */
-/* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */
 
 /* To get the modern GNU Objective-C Runtime API, you include
    objc/runtime.h.  */
 { Class isa; }
 + alloc;
 - init;
++ initialize;
 @end
 
 @implementation MyRootClass
 + alloc { return class_createInstance (self, 0); }
 - init  { return self; }
++ initialize { return self; }
 @end
 
 @protocol MyProtocol
@@ -88,7 +89,7 @@ int main(int argc, void **args)
   printf ("Testing protocol_copyPropertyList ()...\n");
   {
     unsigned int count;
-    Property *list;
+    objc_property_t *list;
 
     list = protocol_copyPropertyList (@protocol (MyProtocol), &count);
 
@@ -136,7 +137,7 @@ int main(int argc, void **args)
   /* TODO: Test new ABI (when available).  */
   printf ("Testing protocol_getProperty ()...\n");
   {
-    Property property;
+    objc_property_t property;
 
     property = protocol_getProperty (objc_getProtocol ("MyProtocol"), "someProperty",
                                     YES, YES);