1 /* Test if ObjC constant string layout is checked properly, regardless of how
2 constant string classes get derived. */
3 /* Contributed by Ziemowit Laski <zlaski@apple.com> */
5 /* { dg-do compile { target *-*-darwin* } } */
6 /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
7 /* { dg-options "-fconstant-string-class=XStr" } */
8 /* { dg-options "-mno-constant-cfstrings -fconstant-string-class=XStr" { target *-*-darwin* } } */
10 #include "../../../objc-obj-c++-shared/F-NSObject.h"
11 #include "../../../objc-obj-c++-shared/runtime.h" /* For NEXT_OBJC_USE_NEW_INTERFACE. */
13 @interface XString: NSObject {
19 @interface XStr : XString {
25 #ifndef NEXT_OBJC_USE_NEW_INTERFACE
26 extern struct objc_class _XStrClassReference;
28 extern Class _XStrClassReference;
31 const XStr *appKey = @"MyApp";
33 /* { dg-final { scan-assembler ".section __OBJC, __cstring_object" { target { *-*-darwin* && { ! lp64 } } } } } */
34 /* { dg-final { scan-assembler ".section __DATA, __objc_stringobj" { target { *-*-darwin* && { lp64 } } } } } */
35 /* { dg-final { scan-assembler ".long\t__XStrClassReference\n\t.long\t.*\n\t.long\t5\n\t.data" { target { *-*-darwin* && { ! lp64 } } } } } */
36 /* { dg-final { scan-assembler ".quad\t_OBJC_CLASS_._XStr\n\t.quad\t.*\n\t.long\t5\n\t.space" { target { *-*-darwin* && { lp64 } } } } } */