libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / pr87052.c
blob90f3c3b14a805e14235d899acc9c788fe1322361
1 /* PR middle-end/87052 - STRING_CST printing incomplete in Gimple dumps
2 { dg-do compile }
3 { dg-options "-fdump-tree-gimple" } */
5 void sink (const void*, ...);
7 void test (void)
9 const char a[3] = "\000ab";
11 /* Expect the following in the dump:
12 a = "\x00ab"; */
14 const char b[] = { 'a', 0, 'b', 'c' };
16 /* Expect the following:
17 b = "a\x00bc"; */
19 const char c[] = "";
21 /* Expect the following:
22 c = ""; */
24 const char d[0] = { };
26 /* Expect nothing. */
28 const char e[0] = "";
30 /* Expect nothing. */
32 sink (a, b, c, d, e);
35 /* { dg-final { scan-tree-dump-times "a = \"\\\\x00ab\";" 1 "gimple" } }
36 { dg-final { scan-tree-dump-times "b = \"a\\\\x00bc\";" 1 "gimple" } }
37 { dg-final { scan-tree-dump-times "c = \"\";" 1 "gimple" } }
38 { dg-final { scan-tree-dump-times "d = " 1 "gimple" } }
39 { dg-final { scan-tree-dump-times "d = {CLOBBER\\(eos\\)}" 1 "gimple" } }
40 { dg-final { scan-tree-dump-times "e = " 1 "gimple" } }
41 { dg-final { scan-tree-dump-times "e = {CLOBBER\\(eos\\)}" 1 "gimple" } } */