OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [objc.dg/] [const-str-10.m] - Rev 867

Go to most recent revision | Compare with Previous | Blame | View Log

/* Test if ObjC constant string layout is checked properly, regardless of how
   constant string classes get derived.  */
/* Contributed by Ziemowit Laski <zlaski@apple.com>  */
 
/* { dg-options "-fnext-runtime" } */
/* { dg-do compile { target *-*-darwin* } } */
 
#include <objc/Object.h>
 
@interface NSString: Object
@end
 
@interface NSSimpleCString : NSString {
@protected
    char *bytes;
    unsigned int numBytes;
}
@end
 
@interface NSConstantString : NSSimpleCString
@end
 
extern struct objc_class _NSConstantStringClassReference;
 
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" } } */
 

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.