aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorIain Sandoe <iains@gcc.gnu.org>2010-11-29 16:52:41 +0000
committerIain Sandoe <iains@gcc.gnu.org>2010-11-29 16:52:41 +0000
commit98c1c7cd1e9ca19eef4899312e963e61087d91b6 (patch)
tree29b53ac5fc814506a12a7bd3c596931c3da8b606 /gcc
parente12bcbf492904c2ead0b91a00e9eff35b2d67c94 (diff)
downloadgcc-98c1c7cd1e9ca19eef4899312e963e61087d91b6.zip
gcc-98c1c7cd1e9ca19eef4899312e963e61087d91b6.tar.gz
gcc-98c1c7cd1e9ca19eef4899312e963e61087d91b6.tar.bz2
strings-1.m: Move to...
gcc/testsuite: * gcc/testsuite/objc.dg/strings-1.m: Move to... * gcc/testsuite/objc.dg/strings/strings-1.m: ... here. Update paths. * gcc/testsuite/objc.dg/strings-2.m: Move to ... * gcc/testsuite/objc.dg/strings/strings-2.m ... here, provide a constructor and class reference for NeXT runtime. Update paths. * gcc/testsuite/obj-c++.dg/strings-1.m: Move to... * gcc/testsuite/obj-c++.dg/strings/strings-1.m: ... here. Update paths. * gcc/testsuite/obj-c++.dg/strings-2.m: Move to ... * gcc/testsuite/obj-c__.dg/strings/strings-2.m ... here, provide a constructor and class reference for NeXT runtime. Update paths. From-SVN: r167253
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog13
-rw-r--r--gcc/testsuite/obj-c++.dg/strings/strings-1.mm (renamed from gcc/testsuite/obj-c++.dg/strings-1.mm)4
-rw-r--r--gcc/testsuite/obj-c++.dg/strings/strings-2.mm (renamed from gcc/testsuite/obj-c++.dg/strings-2.mm)26
-rw-r--r--gcc/testsuite/objc.dg/strings/strings-1.m (renamed from gcc/testsuite/objc.dg/strings-1.m)4
-rw-r--r--gcc/testsuite/objc.dg/strings/strings-2.m (renamed from gcc/testsuite/objc.dg/strings-2.m)26
5 files changed, 63 insertions, 10 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 1cfb5b2..19080bc 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,16 @@
+2010-11-29 Iain Sandoe <iains@gcc.gnu.org>
+
+ * gcc/testsuite/objc.dg/strings-1.m: Move to...
+ * gcc/testsuite/objc.dg/strings/strings-1.m: ... here. Update paths.
+ * gcc/testsuite/objc.dg/strings-2.m: Move to ...
+ * gcc/testsuite/objc.dg/strings/strings-2.m ... here, provide a
+ constructor and class reference for NeXT runtime. Update paths.
+ * gcc/testsuite/obj-c++.dg/strings-1.m: Move to...
+ * gcc/testsuite/obj-c++.dg/strings/strings-1.m: ... here. Update paths.
+ * gcc/testsuite/obj-c++.dg/strings-2.m: Move to ...
+ * gcc/testsuite/obj-c__.dg/strings/strings-2.m ... here, provide a
+ constructor and class reference for NeXT runtime. Update paths.
+
2010-11-29 Dodji Seketeli <dodji@redhat.com>
PR c++/42260
diff --git a/gcc/testsuite/obj-c++.dg/strings-1.mm b/gcc/testsuite/obj-c++.dg/strings/strings-1.mm
index 2630220..fc3f211 100644
--- a/gcc/testsuite/obj-c++.dg/strings-1.mm
+++ b/gcc/testsuite/obj-c++.dg/strings/strings-1.mm
@@ -1,8 +1,8 @@
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010. */
/* { dg-do compile } */
-#include "../objc-obj-c++-shared/Object1.h"
-#include "../objc-obj-c++-shared/next-mapping.h"
+#include "../../objc-obj-c++-shared/Object1.h"
+#include "../../objc-obj-c++-shared/next-mapping.h"
#ifndef __NEXT_RUNTIME__
#include <objc/NXConstStr.h>
#endif
diff --git a/gcc/testsuite/obj-c++.dg/strings-2.mm b/gcc/testsuite/obj-c++.dg/strings/strings-2.mm
index 9b7023a..09d7a7f 100644
--- a/gcc/testsuite/obj-c++.dg/strings-2.mm
+++ b/gcc/testsuite/obj-c++.dg/strings/strings-2.mm
@@ -5,10 +5,10 @@
/* { dg-options "-fconstant-string-class=MyTestString" } */
/* { dg-options "-mno-constant-cfstrings -fconstant-string-class=MyTestString" { target *-*-darwin* } } */
-/* { dg-additional-sources "../objc-obj-c++-shared/Object1.mm" } */
+/* { dg-additional-sources "../../objc-obj-c++-shared/Object1.mm" } */
-#include "../objc-obj-c++-shared/Object1.h"
-#include "../objc-obj-c++-shared/next-mapping.h"
+#include "../../objc-obj-c++-shared/Object1.h"
+#include "../../objc-obj-c++-shared/next-mapping.h"
#include <stdlib.h> /* For abort() */
@@ -31,6 +31,14 @@
}
@end
+#ifdef __NEXT_RUNTIME__
+# ifdef NEXT_OBJC_USE_NEW_INTERFACE
+struct fudge_objc_class _MyTestStringClassReference;
+# else
+struct objc_class _MyTestStringClassReference;
+# endif
+#endif
+
int main (void)
{
MyTestString *test_valid1 = @"test";
@@ -49,3 +57,15 @@ int main (void)
return 0;
}
+
+#ifdef __NEXT_RUNTIME__
+/* The MyTestString metaclass will need to be initialized before we can
+ send messages to strings. */
+
+void testsuite_mytest_string_init (void) __attribute__((constructor));
+void testsuite_mytest_string_init (void) {
+ memcpy (&_MyTestStringClassReference,
+ objc_getClass ("MyTestString"),
+ sizeof (_MyTestStringClassReference));
+}
+#endif \ No newline at end of file
diff --git a/gcc/testsuite/objc.dg/strings-1.m b/gcc/testsuite/objc.dg/strings/strings-1.m
index 2630220..fc3f211 100644
--- a/gcc/testsuite/objc.dg/strings-1.m
+++ b/gcc/testsuite/objc.dg/strings/strings-1.m
@@ -1,8 +1,8 @@
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010. */
/* { dg-do compile } */
-#include "../objc-obj-c++-shared/Object1.h"
-#include "../objc-obj-c++-shared/next-mapping.h"
+#include "../../objc-obj-c++-shared/Object1.h"
+#include "../../objc-obj-c++-shared/next-mapping.h"
#ifndef __NEXT_RUNTIME__
#include <objc/NXConstStr.h>
#endif
diff --git a/gcc/testsuite/objc.dg/strings-2.m b/gcc/testsuite/objc.dg/strings/strings-2.m
index d69967a..29d9375 100644
--- a/gcc/testsuite/objc.dg/strings-2.m
+++ b/gcc/testsuite/objc.dg/strings/strings-2.m
@@ -5,10 +5,10 @@
/* { dg-options "-fconstant-string-class=MyTestString" } */
/* { dg-options "-mno-constant-cfstrings -fconstant-string-class=MyTestString" { target *-*-darwin* } } */
-/* { dg-additional-sources "../objc-obj-c++-shared/Object1.m" } */
+/* { dg-additional-sources "../../objc-obj-c++-shared/Object1.m" } */
-#include "../objc-obj-c++-shared/Object1.h"
-#include "../objc-obj-c++-shared/next-mapping.h"
+#include "../../objc-obj-c++-shared/Object1.h"
+#include "../../objc-obj-c++-shared/next-mapping.h"
#include <stdlib.h> /* For abort() */
@@ -31,6 +31,14 @@
}
@end
+#ifdef __NEXT_RUNTIME__
+# ifdef NEXT_OBJC_USE_NEW_INTERFACE
+struct fudge_objc_class _MyTestStringClassReference;
+# else
+struct objc_class _MyTestStringClassReference;
+# endif
+#endif
+
int main (void)
{
MyTestString *test_valid1 = @"test";
@@ -49,3 +57,15 @@ int main (void)
return 0;
}
+
+#ifdef __NEXT_RUNTIME__
+/* The MyTestString metaclass will need to be initialized before we can
+ send messages to strings. */
+
+void testsuite_mytest_string_init (void) __attribute__((constructor));
+void testsuite_mytest_string_init (void) {
+ memcpy (&_MyTestStringClassReference,
+ objc_getClass ("MyTestString"),
+ sizeof (_MyTestStringClassReference));
+}
+#endif \ No newline at end of file