PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-dse-24.c
blob282194c1e3279e21e54b1f9349ca45ba0b6a05ad
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-dse1" } */
5 typedef unsigned int wchar_t;
6 struct printf_info
8 int prec;
9 int width;
10 wchar_t spec;
11 unsigned int is_long_double:1;
12 unsigned int is_short:1;
13 unsigned int is_long:1;
14 unsigned int alt:1;
15 unsigned int space:1;
16 unsigned int left:1;
17 unsigned int showsign:1;
18 unsigned int group:1;
19 unsigned int extra:1;
20 unsigned int is_char:1;
21 unsigned int wide:1;
22 unsigned int i18n:1;
23 unsigned int __pad:4;
24 unsigned short int user;
25 wchar_t pad;
26 } info;
28 void bar (struct printf_info *);
30 void foo(int prec,
31 int width,
32 wchar_t spec,
33 unsigned int is_long_double,
34 unsigned int is_short,
35 unsigned int is_long,
36 unsigned int alt,
37 unsigned int space,
38 unsigned int left,
39 unsigned int showsign,
40 unsigned int group,
41 wchar_t pad)
43 struct printf_info info = {
44 .prec = prec,
45 .width = width,
46 .spec = spec,
47 .is_long_double = is_long_double,
48 .is_short = is_short,
49 .is_long = is_long,
50 .alt = alt,
51 .space = space,
52 .left = left,
53 .showsign = showsign,
54 .group = group,
55 .pad = pad,
56 .extra = 0,
57 .wide = sizeof (char) != 1 };
59 bar (&info);
62 /* { dg-final { scan-tree-dump-times "MEM\\\[\\(struct printf_info \\*\\)&info \\+ \[0-9\]+B\\\] = {}" 1 "dse1" } } */