blob: d4ad89fc4bec12ace173d7cf290be541ca4e9d96 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
/* PR c/83801 */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-original" } */
static const char a[] = "01234567890123456789012345678901234567890123456789012345678901234567890123456789";
static const char b = a[27];
struct S { const char c[30]; const char d[30]; };
static const struct S e[] = { { "01234567890123456789012345678", "90123456789012345678901234567" },
{ "89012345678901234567890123456", "78901234567890123456789012345" } };
static const char f = e[1].c[4];
char
foo (int i)
{
return a[i];
}
char
bar (int i)
{
return e[0].d[i];
}
/* { dg-final { scan-tree-dump {a\[i]} "original" } } */
/* { dg-final { scan-tree-dump-not {"01234567890123456789012345678901234567890123456789012345678901234567890123456789"\[i]} "original" } } */
/* { dg-final { scan-tree-dump {e\[0]\.d\[i]} "original" } } */
/* { dg-final { scan-tree-dump-not {"90123456789012345678901234567"\[i]} "original" } } */
|