URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
/* Contributed by Nicola Pero - Tue Jul 3 10:55:21 BST 2001 */
|
/* Contributed by Nicola Pero - Tue Jul 3 10:55:21 BST 2001 */
|
#include <objc/objc.h>
|
#include <objc/objc.h>
|
#include <objc/objc-api.h>
|
#include <objc/objc-api.h>
|
#include <objc/Object.h>
|
#include <objc/Object.h>
|
|
|
#include "next_mapping.h"
|
#include "next_mapping.h"
|
|
|
/* This test demonstrate a failure in object_is_meta_class which was fixed */
|
/* This test demonstrate a failure in object_is_meta_class which was fixed */
|
|
|
@interface EvilClass : Object
|
@interface EvilClass : Object
|
{
|
{
|
Class super_class;
|
Class super_class;
|
const char* name;
|
const char* name;
|
long version;
|
long version;
|
unsigned long info;
|
unsigned long info;
|
}
|
}
|
@end
|
@end
|
|
|
@implementation EvilClass
|
@implementation EvilClass
|
- (id) init
|
- (id) init
|
{
|
{
|
self = [super init];
|
self = [super init];
|
/* The following one is used in the runtime to mark meta classes */
|
/* The following one is used in the runtime to mark meta classes */
|
info = 0x2L;
|
info = 0x2L;
|
return self;
|
return self;
|
}
|
}
|
@end
|
@end
|
|
|
int main (void)
|
int main (void)
|
{
|
{
|
/* Create an object of our EvilClass */
|
/* Create an object of our EvilClass */
|
EvilClass *evilObject = [EvilClass new];
|
EvilClass *evilObject = [EvilClass new];
|
|
|
/* Now check that the object is not a meta class object */
|
/* Now check that the object is not a meta class object */
|
if (object_is_meta_class (evilObject))
|
if (object_is_meta_class (evilObject))
|
{
|
{
|
printf ("object_is_meta_class failed\n");
|
printf ("object_is_meta_class failed\n");
|
abort ();
|
abort ();
|
}
|
}
|
|
|
return 0;
|
return 0;
|
}
|
}
|
|
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.