| /* APPLE LOCAL file mainline */ |
| /* Test if ObjC constant strings get placed in the correct section. */ |
| /* Contributed by Ziemowit Laski <zlaski@apple.com> */ |
| |
| /* { dg-options "-fnext-runtime -fno-constant-cfstrings" } */ |
| /* { dg-do compile { target *-*-darwin* } } */ |
| /* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ |
| |
| #include <objc/Object.h> |
| |
| @interface NSConstantString: Object { |
| char *cString; |
| unsigned int len; |
| } |
| @end |
| |
| # if (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 || __OBJC2__) |
| extern Class _NSConstantStringClassReference; |
| #else |
| extern struct objc_class _NSConstantStringClassReference; |
| #endif |
| |
| const NSConstantString *appKey = @"MyApp"; |
| |
| /* { dg-final { scan-assembler ".section __OBJC, __cstring_object" } } */ |
| /* { dg-final { scan-assembler ".long\t__NSConstantStringClassReference\n\t.long\t.*\n\t.long\t5\n\t.data" } } */ |