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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc.dg/] [strings/] [const-str-6.m] - Blame information for rev 704

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 704 jeremybenn
/* Negative test case for constant string layout.  */
2
/* Contributed by Ziemowit Laski  <zlaski@apple.com>.  */
3
 
4
/* { dg-do compile } */
5
/* { dg-options "-fconstant-string-class=MyConstantString" } */
6
/* { dg-options "-mno-constant-cfstrings -fconstant-string-class=MyConstantString" { target *-*-darwin* } } */
7
 
8
@interface MyBase {
9
  char p;
10
}
11
@end
12
 
13
@interface MyConstantString: MyBase {
14
  union {
15
    void     *u;
16
    unsigned char   *c;
17
  } _contents;
18
  char  _count;
19
}
20
@end
21
 
22
/* The NeXT runtime initializes the 'isa' pointer of string constants at
23
   compile time.  */
24
#ifdef __NEXT_RUNTIME__
25
extern void *_MyConstantStringClassReference;
26
#endif
27
 
28
MyConstantString *str = @"Hello"; /* { dg-error "interface .MyConstantString. does not have valid constant string layout" } */

powered by: WebSVN 2.1.0

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