1 /* Test whether the __builtin__CFStringMakeConstantString
2 "function" generates compile-time objects with the correct layout. */
3 /* Developed by Ziemowit Laski <zlaski@apple.com>. */
5 /* { dg-do compile { target *-*-darwin* } } */
6 /* { dg-options "-mconstant-cfstrings" } */
8 typedef const struct __CFString
*CFStringRef
;
10 #ifdef __CONSTANT_CFSTRINGS__
11 #define CFSTR(STR) ((CFStringRef) __builtin___CFStringMakeConstantString (STR))
13 #error __CONSTANT_CFSTRINGS__ not defined
17 extern const char *func(void);
19 CFStringRef s0
= CFSTR("Hello" "there");
22 const CFStringRef s1
= CFSTR("Str1");
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 } } } } } */