OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [obj-c++.dg/] [const-str-8.mm] - Blame information for rev 484

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 308 jeremybenn
/* Test for assigning compile-time constant-string objects to static variables.  */
2
/* Contributed by Ziemowit Laski   */
3
 
4
/* { dg-options "-fconstant-string-class=Foo" } */
5
/* { dg-do run { target *-*-darwin* } } */
6
 
7
#include "../objc-obj-c++-shared/Object1.h"
8
#include 
9
 
10
@interface Foo: Object {
11
  char *cString;
12
  unsigned int len;
13
}
14
@end
15
 
16
#ifdef NEXT_OBJC_USE_NEW_INTERFACE
17
Class _FooClassReference;
18
#else
19
struct objc_class _FooClassReference;
20
#endif
21
 
22
@implementation Foo : Object
23
- (char *)customString {
24
  return cString;
25
}
26
@end
27
 
28
static const Foo *appKey = @"MyApp";
29
static int CFPreferencesSynchronize (const Foo *ref) {
30
  return ref == appKey;
31
}
32
 
33
static void PrefsSynchronize(void)
34
{
35
  if(!CFPreferencesSynchronize(appKey))
36
    abort();
37
}
38
 
39
int main () {
40
  PrefsSynchronize();
41
  return 0;
42
}
43
 
44
#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.