URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 309 |
Rev 384 |
/* Test for assigning compile-time constant-string objects to static variables. */
|
/* Test for assigning compile-time constant-string objects to static variables. */
|
/* Contributed by Ziemowit Laski <zlaski@apple.com> */
|
/* Contributed by Ziemowit Laski <zlaski@apple.com> */
|
/* { dg-options "-fconstant-string-class=Foo" } */
|
/* { dg-options "-fconstant-string-class=Foo" } */
|
/* { dg-do run } */
|
/* { dg-do run } */
|
|
|
#include "../objc-obj-c++-shared/Object1.h"
|
#include "../objc-obj-c++-shared/Object1.h"
|
#include <stdlib.h>
|
#include <stdlib.h>
|
|
|
@interface Foo: Object {
|
@interface Foo: Object {
|
char *cString;
|
char *cString;
|
unsigned int len;
|
unsigned int len;
|
}
|
}
|
@end
|
@end
|
|
|
#ifndef NEXT_OBJC_USE_NEW_INTERFACE
|
#ifndef NEXT_OBJC_USE_NEW_INTERFACE
|
struct objc_class _FooClassReference;
|
struct objc_class _FooClassReference;
|
#else
|
#else
|
Class _FooClassReference;
|
Class _FooClassReference;
|
#endif
|
#endif
|
|
|
@implementation Foo : Object
|
@implementation Foo : Object
|
- (char *)customString {
|
- (char *)customString {
|
return cString;
|
return cString;
|
}
|
}
|
@end
|
@end
|
|
|
static const Foo *appKey = @"MyApp";
|
static const Foo *appKey = @"MyApp";
|
static int CFPreferencesSynchronize (const Foo *ref) {
|
static int CFPreferencesSynchronize (const Foo *ref) {
|
return ref == appKey;
|
return ref == appKey;
|
}
|
}
|
|
|
static void PrefsSynchronize(void)
|
static void PrefsSynchronize(void)
|
{
|
{
|
if(!CFPreferencesSynchronize(appKey))
|
if(!CFPreferencesSynchronize(appKey))
|
abort();
|
abort();
|
}
|
}
|
|
|
int main () {
|
int main () {
|
PrefsSynchronize();
|
PrefsSynchronize();
|
return 0;
|
return 0;
|
}
|
}
|
|
|
#include "../objc-obj-c++-shared/Object1-implementation.h"
|
#include "../objc-obj-c++-shared/Object1-implementation.h"
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.