2007-03-01 Paul Brook <paul@codesourcery.com>
[official-gcc.git] / gcc / testsuite / objc.dg / const-str-11.m
blob3b7ec7ad51f5c38aa82e87dd36ee2cbc3e0d63f1
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-options "-fnext-runtime -fconstant-string-class=XStr" } */
6 /* { dg-do compile { target *-*-darwin* } } */
8 #include <objc/Object.h>
10 @interface XString: Object {
11 @protected
12     char *bytes;
14 @end
16 @interface XStr : XString {
17 @public
18     unsigned int len;
20 @end
22 extern struct objc_class _XStrClassReference;
24 const XStr *appKey = @"MyApp";
26 /* { dg-final { scan-assembler ".section __OBJC, __cstring_object" } } */
27 /* { dg-final { scan-assembler ".long\t__XStrClassReference\n\t.long\t.*\n\t.long\t5\n\t.data" } } */