1 struct s {
2 int c[1];
3 };
4
5 static struct s x, y;
6 static int p;
7
foo0(void)8 static void foo0(void)
9 {
10 (x = y).c; // x = y;
11 }
12
foo1(void)13 static void foo1(void)
14 {
15 int *t = (x = y).c; // x = y;
16 }
17
foo2(void)18 static void foo2(void)
19 {
20 (x = y).c + 1; // x = y;
21 }
22
foo3(void)23 static void foo3(void)
24 {
25 (x = y).c[0]; // x = y;
26 }
27
foo4(void)28 static void foo4(void)
29 {
30 (p ? x : y).c[0]; // ;
31 }
32
foo5(void)33 static void foo5(void)
34 {
35 (p, y).c[0]; // ;
36 }
37
38 /*
39 * check-name: kill-stores1
40 * check-command: test-linearize -Wno-decl $file
41 *
42 * check-output-ignore
43 * check-output-pattern(4): load\\.
44 * check-output-pattern(4): load\\..*0\\[y\\]
45 * check-output-pattern(4): store\\.
46 * check-output-pattern(4): store\\..*0\\[x\\]
47 * check-output-excludes: select\\.
48 */
49