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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [objc.dg/] [const-str-6.m] - Blame information for rev 455

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

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