tree-optimization/111233 - loop splitting miscompile
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / darwin-cfstring-3.c
blobee4b385b17fad6cf20257df2d6caaed6fc958c7d
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))
12 #else
13 #error __CONSTANT_CFSTRINGS__ not defined
14 #endif
16 extern int cond;
17 extern const char *func(void);
19 CFStringRef s0 = CFSTR("Hello" "there");
21 void foo(void) {
22 const CFStringRef s1 = CFSTR("Str1");
24 s0 = s1;
27 /* { dg-final { scan-assembler "\\.long\[ \\t\]+___CFConstantStringClassReference\n\[ \\t\]*\\.long\[ \\t\]+1992\n\[ \\t\]*\\.long\[ \\t\]+\[lL\]C.*\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\]+\[lL\]C.*\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 } } } } } */