2018-05-17 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / pr83801.c
blobd4ad89fc4bec12ace173d7cf290be541ca4e9d96
1 /* PR c/83801 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -fdump-tree-original" } */
5 static const char a[] = "01234567890123456789012345678901234567890123456789012345678901234567890123456789";
6 static const char b = a[27];
7 struct S { const char c[30]; const char d[30]; };
8 static const struct S e[] = { { "01234567890123456789012345678", "90123456789012345678901234567" },
9 { "89012345678901234567890123456", "78901234567890123456789012345" } };
10 static const char f = e[1].c[4];
12 char
13 foo (int i)
15 return a[i];
18 char
19 bar (int i)
21 return e[0].d[i];
24 /* { dg-final { scan-tree-dump {a\[i]} "original" } } */
25 /* { dg-final { scan-tree-dump-not {"01234567890123456789012345678901234567890123456789012345678901234567890123456789"\[i]} "original" } } */
26 /* { dg-final { scan-tree-dump {e\[0]\.d\[i]} "original" } } */
27 /* { dg-final { scan-tree-dump-not {"90123456789012345678901234567"\[i]} "original" } } */