2007-03-01 Paul Brook <paul@codesourcery.com>
[official-gcc.git] / gcc / testsuite / objc.dg / const-str-10.m
blob4efe044c13e35dac87b42ef0048382cf4d355d20
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" } */
6 /* { dg-do compile { target *-*-darwin* } } */
8 #include <objc/Object.h>
10 @interface NSString: Object
11 @end
13 @interface NSSimpleCString : NSString {
14 @protected
15     char *bytes;
16     unsigned int numBytes;
18 @end
19     
20 @interface NSConstantString : NSSimpleCString
21 @end
23 extern struct objc_class _NSConstantStringClassReference;
25 const NSConstantString *appKey = @"MyApp";
27 /* { dg-final { scan-assembler ".section __OBJC, __cstring_object" } } */
28 /* { dg-final { scan-assembler ".long\t__NSConstantStringClassReference\n\t.long\t.*\n\t.long\t5\n\t.data" } } */