Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1479)

Unified Diff: gcc/gcc/testsuite/objc.dg/encode-2.m

Issue 3050029: [gcc] GCC 4.5.0=>4.5.1 (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/nacl-toolchain.git
Patch Set: Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gcc/gcc/testsuite/objc.dg/encode-1.m ('k') | gcc/gcc/testsuite/objc.dg/fix-and-continue-2.m » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gcc/gcc/testsuite/objc.dg/encode-2.m
diff --git a/gcc/gcc/testsuite/objc.dg/encode-2.m b/gcc/gcc/testsuite/objc.dg/encode-2.m
index b9003696c025ef054c113698c46e4493af50f122..ea0ff6a7dae0f61569b99666344b378d0d061df6 100644
--- a/gcc/gcc/testsuite/objc.dg/encode-2.m
+++ b/gcc/gcc/testsuite/objc.dg/encode-2.m
@@ -15,19 +15,17 @@
/* Contributed by Ziemowit Laski <zlaski@apple.com>. */
/* { dg-do run } */
+/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
-#include <objc/objc.h>
-#include <objc/Object.h>
+#include "../objc-obj-c++-shared/Object1.h"
+#include "../objc-obj-c++-shared/next-mapping.h"
#ifdef __NEXT_RUNTIME__
#define METHOD Method
-#define OBJC_GETCLASS objc_getClass
-#define CLASS_GETINSTANCEMETHOD class_getInstanceMethod
#else
#include <objc/objc-api.h>
#define METHOD Method_t
-#define OBJC_GETCLASS objc_get_class
-#define CLASS_GETINSTANCEMETHOD class_get_instance_method
+#define method_get_types(M) (M)->method_types
#endif
extern int sscanf(const char *str, const char *format, ...);
@@ -76,27 +74,31 @@ unsigned offs1, offs2, offs3, offs4, offs5, offs6, offs7;
int main(void) {
Foo *foo = [[Foo alloc] init];
- Class fooClass = OBJC_GETCLASS("Foo");
+ Class fooClass = objc_get_class("Foo");
METHOD meth;
const char *string;
- meth = CLASS_GETINSTANCEMETHOD(fooClass, @selector(setRect:withInt:));
+ meth = class_get_instance_method(fooClass, @selector(setRect:withInt:));
offs2 = 9999;
- sscanf(meth->method_types, "@%u@%u:%u{_XXRect={?=ff}{?=ff}}%ui%u", &offs1, &offs2, &offs3,
+
+ sscanf(method_get_types(meth), "@%u@%u:%u{_XXRect={?=ff}{?=ff}}%ui%u", &offs1, &offs2, &offs3,
&offs4, &offs5);
+
CHECK_IF(!offs2);
[foo setRect:my_rect withInt:123];
- meth = CLASS_GETINSTANCEMETHOD(fooClass, @selector(char:float:double:long:));
+ meth = class_get_instance_method(fooClass, @selector(char:float:double:long:));
offs2 = 9999;
if (sizeof (long) == 8)
string = "v%u@%u:%uc%uf%ud%uq%u";
else
string = "v%u@%u:%uc%uf%ud%ul%u";
- sscanf(meth->method_types, string, &offs1, &offs2, &offs3,
+ sscanf(method_get_types(meth), string, &offs1, &offs2, &offs3,
&offs4, &offs5, &offs6, &offs7);
CHECK_IF(!offs2);
[foo char:'c' float:2.3 double:3.5 long:2345L];
return 0;
}
+
+#include "../objc-obj-c++-shared/Object1-implementation.h"
« no previous file with comments | « gcc/gcc/testsuite/objc.dg/encode-1.m ('k') | gcc/gcc/testsuite/objc.dg/fix-and-continue-2.m » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698