Merged r157653 through r157895 into branch.
[official-gcc.git] / gcc / testsuite / objc.dg / const-str-9.m
blobddf3b02f03c28794e159a5ec349a186995c845c1
1 /* Test if ObjC constant strings get placed in the correct section.  */
2 /* Contributed by Ziemowit Laski <zlaski@apple.com>  */
4 /* { dg-do compile } */
5 /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
7 #include "../objc-obj-c++-shared/Object1.h"
9 @interface NSConstantString: Object {
10   char *cString;
11   unsigned int len;
13 @end
15 #ifndef NEXT_OBJC_USE_NEW_INTERFACE
16 extern struct objc_class _NSConstantStringClassReference;
17 #else
18 Class _NSConstantStringClassReference;
19 #endif
21 static const NSConstantString *appKey = @"MyApp";
23 /* { dg-final { scan-assembler ".section __OBJC, __cstring_object" } } */
24 /* { dg-final { scan-assembler ".long\t__NSConstantStringClassReference\n\t.long\t.*\n\t.long\t5\n\t.data" { target { *-*-darwin* && { ! lp64 } } } } } */
25 /* { dg-final { scan-assembler ".quad\t__NSConstantStringClassReference\n\t.quad\t.*\n\t.long\t5\n\t.space" { target { *-*-darwin* && { lp64 } } } } } */