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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [obj-c++.dg/] [const-str-8.mm] - Diff between revs 154 and 816

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 154 Rev 816
/* 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   */
/* Contributed by Ziemowit Laski   */
/* { dg-options "-fnext-runtime -fconstant-string-class=Foo -lobjc" } */
/* { dg-options "-fnext-runtime -fconstant-string-class=Foo -lobjc" } */
/* { dg-do run { target *-*-darwin* } } */
/* { dg-do run { target *-*-darwin* } } */
#include 
#include 
#include 
#include 
@interface Foo: Object {
@interface Foo: Object {
  char *cString;
  char *cString;
  unsigned int len;
  unsigned int len;
}
}
@end
@end
struct objc_class _FooClassReference;
struct objc_class _FooClassReference;
@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;
}
}
 
 

powered by: WebSVN 2.1.0

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