URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
/* Check if the '-fno-zero-link' flag correctly _omits_ an objc_getClass() call. */
|
/* Check if the '-fno-zero-link' flag correctly _omits_ an objc_getClass() call. */
|
/* Contributed by Ziemowit Laski <zlaski@apple.com>. */
|
/* Contributed by Ziemowit Laski <zlaski@apple.com>. */
|
/* { dg-options "-fnext-runtime -fno-zero-link" } */
|
/* { dg-options "-fnext-runtime -fno-zero-link" } */
|
/* { dg-do compile } */
|
/* { dg-do compile } */
|
|
|
#include <objc/objc.h>
|
#include <objc/objc.h>
|
#include <objc/Object.h>
|
#include <objc/Object.h>
|
|
|
extern void abort(void);
|
extern void abort(void);
|
#define CHECK_IF(expr) if(!(expr)) abort();
|
#define CHECK_IF(expr) if(!(expr)) abort();
|
|
|
@interface Base: Object
|
@interface Base: Object
|
+ (int) getValue;
|
+ (int) getValue;
|
@end
|
@end
|
|
|
@implementation Base
|
@implementation Base
|
+ (int) getValue { return 1593; }
|
+ (int) getValue { return 1593; }
|
@end
|
@end
|
|
|
int main(void) {
|
int main(void) {
|
int val = [Base getValue];
|
int val = [Base getValue];
|
CHECK_IF(val == 1593);
|
CHECK_IF(val == 1593);
|
return 0;
|
return 0;
|
}
|
}
|
|
|
/* { dg-final { scan-assembler "_OBJC_CLASS_REFERENCES_0" } } */
|
/* { dg-final { scan-assembler "_OBJC_CLASS_REFERENCES_0" } } */
|
/* { dg-final { scan-assembler-not "objc_getClass" } } */
|
/* { dg-final { scan-assembler-not "objc_getClass" } } */
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.