OSDN Git Service

2006-03-24 Geoffrey Keating <geoffk@apple.com>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / objc.dg / const-str-9.m
1 /* Test if ObjC constant strings get placed in the correct section.  */
2 /* Contributed by Ziemowit Laski <zlaski@apple.com>  */
3
4 /* { dg-options "-fnext-runtime" } */
5 /* { dg-do compile { target *-*-darwin* } } */
6
7 #include <objc/Object.h>
8
9 @interface NSConstantString: Object {
10   char *cString;
11   unsigned int len;
12 }
13 @end
14
15 extern struct objc_class _NSConstantStringClassReference;
16
17 static const NSConstantString *appKey = @"MyApp";
18
19 /* { dg-final { scan-assembler ".section __OBJC, __cstring_object" } } */
20 /* { dg-final { scan-assembler ".long\t__NSConstantStringClassReference\n\t.long\t.*\n\t.long\t5\n\t.data" } } */