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-7.mm] - Blame information for rev 424

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

Line No. Rev Author Line
1 308 jeremybenn
/* Test to make sure that the const objc strings are the same across
2
   scopes.  */
3
/* Developed by Andrew Pinski  */
4
 
5
/* { dg-options "-fconstant-string-class=Foo" } */
6
/* { dg-do run } */
7
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
8
 
9
#include "../objc-obj-c++-shared/Object1.h"
10
#include "../objc-obj-c++-shared/next-mapping.h"
11
#include 
12
#include 
13
#include 
14
#include 
15
 
16
@interface Foo: Object {
17
  char *cString;
18
  unsigned int len;
19
}
20
- (char *)customString;
21
@end
22
 
23
#ifdef NEXT_OBJC_USE_NEW_INTERFACE
24
struct fudge_objc_class _FooClassReference;
25
#else
26
struct objc_class _FooClassReference;
27
#endif
28
 
29
@implementation Foo : Object
30
- (char *)customString {
31
  return cString;
32
}
33
@end
34
 
35
 
36
int main () {
37
  Foo *string = @"bla";
38
  {
39
    Foo *string2 = @"bla";
40
 
41
    if(string != string2)
42
      abort();
43
    printf("Strings are being uniqued properly\n");
44
   }
45
  return 0;
46
}
47
#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.