OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [objc.dg/] [const-str-8.m] - Diff between revs 309 and 338

Only display areas with differences | Details | Blame | View Log

Rev 309 Rev 338
/* 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"
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.