-/* Check if casting 'self' or 'super' affects message lookup in the
- correct way. */
+/* Check if casting 'self' or 'super' affects message lookup in the correct way. */
/* Contributed by Ziemowit Laski <zlaski@apple.com>. */
/* { dg-do compile } */
+#include "../objc-obj-c++-shared/Object1.h"
+#include "../objc-obj-c++-shared/next-mapping.h"
#include <stddef.h>
-#include <objc/objc.h>
-#include <objc/Object.h>
-
-#ifdef __NEXT_RUNTIME__
-#define OBJC_GETCLASS objc_getClass
-#else
-#define OBJC_GETCLASS objc_get_class
-#endif
@protocol Func
+ (int) class_func0;
}
+ (int) class_func6
{
- return (size_t)[OBJC_GETCLASS("Object") class_func1]; /* { dg-warning ".Object. may not respond to .\\+class_func1." } */
+ return (size_t)[objc_get_class("Object") class_func1]; /* { dg-warning ".Object. may not respond to .\\+class_func1." } */
}
+ (int) class_func7
{
- return [OBJC_GETCLASS("Derived") class_func1];
+ return [objc_get_class("Derived") class_func1];
}
- (int) instance_func1
{
}
- (int) instance_func6
{
- return (size_t)[OBJC_GETCLASS("Object") class_func1]; /* { dg-warning ".Object. may not respond to .\\+class_func1." } */
+ return (size_t)[objc_get_class("Object") class_func1]; /* { dg-warning ".Object. may not respond to .\\+class_func1." } */
}
- (int) instance_func7
{
- return [OBJC_GETCLASS("Derived") class_func1];
+ return [objc_get_class("Derived") class_func1];
}
@end
int i = (size_t)[self instance_func0]; /* { dg-warning ".Derived. may not respond to .\\-instance_func0." } */
i += [(Derived <Func> *)self categ_instance_func2];
i += (size_t)[(Object <Func> *)self categ_instance_func2]; /* { dg-warning ".Object. may not respond to .\\-categ_instance_func2." } */
- /* { dg-warning ".\\-categ_instance_func2. not found in protocol" "" { target *-*-* } 131 } */
+ /* { dg-warning ".\\-categ_instance_func2. not found in protocol" "" { target *-*-* } 124 } */
i += (size_t)[(id <Func>)self categ_instance_func2]; /* { dg-warning ".\\-categ_instance_func2. not found in protocol" } */
i += [(id)self categ_instance_func2];
return i + (size_t)[super instance_func0]; /* { dg-warning ".Object. may not respond to .\\-instance_func0." } */