OSDN Git Service

* obj-c++.dg/defs.mm (abort): Make it extern "C".
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / obj-c++.dg / const-str-5.mm
1 /* Positive 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   const char *p;
9 }
10 @end
11
12 @interface MyConstantString: MyBase {
13   union {
14     void     *u;
15     unsigned char   *c;
16   } _contents;
17   unsigned int  _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";