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/Object1.h"
12 @interface XString: Object {
18 @interface XStr : XString {
24 #ifndef NEXT_OBJC_USE_NEW_INTERFACE
25 extern struct objc_class _XStrClassReference;
27 extern Class _XStrClassReference;
30 const XStr *appKey = @"MyApp";
32 /* { dg-final { scan-assembler ".section __OBJC, __cstring_object" { target { *-*-darwin* && { ! lp64 } } } } } */
33 /* { dg-final { scan-assembler ".section __DATA, __objc_stringobj" { target { *-*-darwin* && { lp64 } } } } } */
34 /* { dg-final { scan-assembler ".long\t__XStrClassReference\n\t.long\t.*\n\t.long\t5\n\t.data" { target { *-*-darwin* && { ! lp64 } } } } } */
35 /* { dg-final { scan-assembler ".quad\t_OBJC_CLASS_._XStr\n\t.quad\t.*\n\t.long\t5\n\t.space" { target { *-*-darwin* && { lp64 } } } } } */