libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / 20240517-1.c
blobab83d3ca6fba20362dcced7062bf11313972ca47
1 /* { dg-do run } */
2 /* { dg-additional-options "-fmerge-all-constants" } */
4 char *p;
6 char * __attribute__((noipa))
7 foo () { return p+1; }
9 volatile int z;
11 int main()
13 /* ESCAPED = CONST_POOL */
14 p = "Hello";
15 /* PT = ESCAPED */
16 char *x = foo ();
17 char *y;
18 /* y PT = CONST_POOL */
19 if (z)
20 y = "Baz";
21 else
22 y = "Hello" + 1;
23 if (y != x)
24 __builtin_abort ();
25 return 0;