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 strings get placed in the correct section. */
|
2 |
|
|
/* Contributed by Ziemowit Laski <zlaski@apple.com> */
|
3 |
|
|
|
4 |
|
|
/* { dg-do compile } */
|
5 |
|
|
/* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
|
6 |
|
|
/* { dg-options "-mno-constant-cfstrings" { target *-*-darwin* } } */
|
7 |
|
|
|
8 |
|
|
#include <objc/Object.h>
|
9 |
|
|
#include "../../../objc-obj-c++-shared/runtime.h" /* For NEXT_OBJC_USE_NEW_INTERFACE. */
|
10 |
|
|
|
11 |
|
|
@interface NSConstantString: Object {
|
12 |
|
|
char *cString;
|
13 |
|
|
unsigned int len;
|
14 |
|
|
}
|
15 |
|
|
@end
|
16 |
|
|
|
17 |
|
|
#ifndef NEXT_OBJC_USE_NEW_INTERFACE
|
18 |
|
|
extern struct objc_class _NSConstantStringClassReference;
|
19 |
|
|
#else
|
20 |
|
|
Class _NSConstantStringClassReference;
|
21 |
|
|
#endif
|
22 |
|
|
|
23 |
|
|
const NSConstantString *appKey = @"MyApp";
|
24 |
|
|
|
25 |
|
|
/* { dg-final { scan-assembler ".section __OBJC, __cstring_object" { target { *-*-darwin* && { ! lp64 } } } } } */
|
26 |
|
|
/* { dg-final { scan-assembler ".section __DATA, __objc_stringobj" { target { *-*-darwin* && { lp64 } } } } } */
|
27 |
|
|
/* { dg-final { scan-assembler ".long\t__NSConstantStringClassReference\n\t.long\t.*\n\t.long\t5\n\t.data" { target { *-*-darwin* && { ! lp64 } } } } } */
|
28 |
|
|
/* { 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.