URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Details |
Compare with Previous |
View Log
Line No. |
Rev |
Author |
Line |
1 |
689 |
jeremybenn |
/* Test whether the __builtin__CFStringMakeConstantString
|
2 |
|
|
"function" generates compile-time objects with the correct layout. */
|
3 |
|
|
/* Developed by Ziemowit Laski <zlaski@apple.com>. */
|
4 |
|
|
|
5 |
|
|
/* { dg-do compile { target *-*-darwin* } } */
|
6 |
|
|
/* { dg-options "-mconstant-cfstrings" } */
|
7 |
|
|
|
8 |
|
|
typedef const struct __CFString *CFStringRef;
|
9 |
|
|
|
10 |
|
|
#ifdef __CONSTANT_CFSTRINGS__
|
11 |
|
|
#define CFSTR(STR) ((CFStringRef) __builtin___CFStringMakeConstantString (STR))
|
12 |
|
|
#else
|
13 |
|
|
#error __CONSTANT_CFSTRINGS__ not defined
|
14 |
|
|
#endif
|
15 |
|
|
|
16 |
|
|
extern int cond;
|
17 |
|
|
extern const char *func(void);
|
18 |
|
|
|
19 |
|
|
CFStringRef s0 = CFSTR("Hello" "there");
|
20 |
|
|
|
21 |
|
|
void foo(void) {
|
22 |
|
|
const CFStringRef s1 = CFSTR("Str1");
|
23 |
|
|
|
24 |
|
|
s0 = s1;
|
25 |
|
|
}
|
26 |
|
|
|
27 |
|
|
/* { dg-final { scan-assembler "\\.long\[ \\t\]+___CFConstantStringClassReference\n\[ \\t\]*\\.long\[ \\t\]+1992\n\[ \\t\]*\\.long\[ \\t\]+LC.*\n\[ \\t\]*\\.long\[ \\t\]+4\n" { target { *-*-darwin* && { ! lp64 } } } } } */
|
28 |
|
|
/* { dg-final { scan-assembler "\\.long\[ \\t\]+___CFConstantStringClassReference\n\[ \\t\]*\\.long\[ \\t\]+1992\n\[ \\t\]*\\.long\[ \\t\]+LC.*\n\[ \\t\]*\\.long\[ \\t\]+10\n" { target { *-*-darwin* && { ! lp64 } } } } } */
|
29 |
|
|
/* { dg-final { scan-assembler ".quad\t___CFConstantStringClassReference\n\t.long\t1992\n\t.space 4\n\t.quad\t.*\n\t.quad\t4\n" { target { *-*-darwin* && { lp64 } } } } } */
|
30 |
|
|
/* { dg-final { scan-assembler ".quad\t___CFConstantStringClassReference\n\t.long\t1992\n\t.space 4\n\t.quad\t.*\n\t.quad\t10\n" { target { *-*-darwin* && { lp64 } } } } } */
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.