summaryrefslogtreecommitdiff
path: root/gcc/testsuite/obj-c++.dg/encode-7.mm
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/obj-c++.dg/encode-7.mm')
-rw-r--r--gcc/testsuite/obj-c++.dg/encode-7.mm26
1 files changed, 9 insertions, 17 deletions
diff --git a/gcc/testsuite/obj-c++.dg/encode-7.mm b/gcc/testsuite/obj-c++.dg/encode-7.mm
index 523c7ce02e8..74c58ab95c8 100644
--- a/gcc/testsuite/obj-c++.dg/encode-7.mm
+++ b/gcc/testsuite/obj-c++.dg/encode-7.mm
@@ -9,21 +9,13 @@
/* Contributed by Alexander Malmberg <alexander@malmberg.org> */
-#include "../objc-obj-c++-shared/Object1.h"
-#include "../objc-obj-c++-shared/next-mapping.h"
+#include "../objc-obj-c++-shared/TestsuiteObject.m"
+#include "../objc-obj-c++-shared/runtime.h"
#include <stdlib.h>
#include <stdio.h>
#define CHECK_IF(expr) if(!(expr)) abort()
-#ifdef __NEXT_RUNTIME__
-#define METHOD Method
-#else
-#include <objc/objc-api.h>
-#define METHOD Method_t
-#define method_get_types(M) (M)->method_types
-#endif
-
-@interface Test : Object
+@interface Test : TestsuiteObject
{ float j; }
-(void) test2: (int [5])a with: (int [])b;
-(id) test3: (Test **)b; /* { dg-message "previous declaration of .\\-\\(id\\)test3:\\(Test \\*\\*\\)b." } */
@@ -47,8 +39,8 @@ int offs1, offs2, offs3, offs4, offs5, offs6;
int main(int argc, char **argv)
{
- Class testClass = objc_get_class("Test");
- METHOD meth;
+ Class testClass = objc_getClass("Test");
+ Method meth;
cc[0] = [Test new];
CHECK_IF (bb[3] == 3);
@@ -58,16 +50,16 @@ int main(int argc, char **argv)
[*c test2: bb with: bb + 5];
CHECK_IF (bb[3] == 5);
- meth = class_get_instance_method(testClass, @selector(test2:with:));
+ meth = class_getInstanceMethod(testClass, @selector(test2:with:));
offs1 = offs2 = offs3 = offs4 = offs5 = offs6 = -1;
- sscanf(method_get_types(meth), "v%d@%d:%d[%di]%d^i%d", &offs1, &offs2, &offs3,
+ sscanf(method_getTypeEncoding(meth), "v%d@%d:%d[%di]%d^i%d", &offs1, &offs2, &offs3,
&offs4, &offs5, &offs6);
CHECK_IF (!offs2 && offs4 == 5 && offs3 > 0);
CHECK_IF (offs5 == 2 * offs3 && offs6 == 3 * offs3 && offs1 == 4 * offs3);
- meth = class_get_instance_method(testClass, @selector(test3:));
+ meth = class_getInstanceMethod(testClass, @selector(test3:));
offs1 = offs2 = offs3 = offs4 = offs5 = offs6 = -1;
- sscanf(method_get_types(meth), "v%d@%d:%d[%d[%d{Test=#f}]]%d", &offs1, &offs2, &offs3,
+ sscanf(method_getTypeEncoding(meth), "v%d@%d:%d[%d[%d{Test=#f}]]%d", &offs1, &offs2, &offs3,
&offs4, &offs5, &offs6);
CHECK_IF (!offs2 && offs4 == 3 && offs5 == 4 && offs3 > 0);
CHECK_IF (offs6 == 2 * offs3 && offs1 == 3 * offs3);