URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Go to most recent revision |
Details |
Compare with Previous |
View Log
Line No. |
Rev |
Author |
Line |
1 |
704 |
jeremybenn |
/* 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> */
|
4 |
|
|
|
5 |
|
|
/* { dg-do compile { target { *-*-darwin* } } } */
|
6 |
|
|
/* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
|
7 |
|
|
/* { dg-options "-mno-constant-cfstrings" { target *-*-darwin* } } */
|
8 |
|
|
|
9 |
|
|
#include <objc/Object.h>
|
10 |
|
|
#include "../../../objc-obj-c++-shared/runtime.h" /* For NEXT_OBJC_USE_NEW_INTERFACE. */
|
11 |
|
|
|
12 |
|
|
@interface NSString: Object
|
13 |
|
|
@end
|
14 |
|
|
|
15 |
|
|
@interface NSSimpleCString : NSString {
|
16 |
|
|
@protected
|
17 |
|
|
char *bytes;
|
18 |
|
|
unsigned int numBytes;
|
19 |
|
|
}
|
20 |
|
|
@end
|
21 |
|
|
|
22 |
|
|
@interface NSConstantString : NSSimpleCString
|
23 |
|
|
@end
|
24 |
|
|
|
25 |
|
|
#ifndef NEXT_OBJC_USE_NEW_INTERFACE
|
26 |
|
|
extern struct objc_class _NSConstantStringClassReference;
|
27 |
|
|
#else
|
28 |
|
|
extern Class _NSConstantStringClassReference;
|
29 |
|
|
#endif
|
30 |
|
|
|
31 |
|
|
const NSConstantString *appKey = @"MyApp";
|
32 |
|
|
|
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__NSConstantStringClassReference\n\t.long\t.*\n\t.long\t5\n\t.data" { target { *-*-darwin* && { ! lp64 } } } } } */
|
36 |
|
|
/* { dg-final { scan-assembler ".quad\t_OBJC_CLASS_._NSConstantString\n\t.quad\t.*\n\t.long\t5\n\t.space" { target { *-*-darwin* && { lp64 } } } } } */
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.