1 /* PR target/54589 */
2 /* { dg-do compile { target { *-*-linux* && lp64 } } } */
3 /* { dg-options "-O2 -masm=att" } */
4 /* { dg-final { scan-assembler "movl\[ \t]+(?:t\\+336\\(%r..\\)|336\\(%r..,%r..\\)), %eax" } } */
5 /* { dg-final { scan-assembler "movl\[ \t]+340\\(%r..,%r..\\), %eax" } } */
6 /* { dg-final { scan-assembler-times "salq\[^\n\r]*4, %" 2 } } */
7 /* { dg-final { scan-assembler-not "addq\[ \t]" } } */
8 
9 struct S { int a, b, c, d; };
10 struct T { struct S e[16]; struct S f[1024]; } t;
11 
12 int
foo(unsigned long x)13 foo (unsigned long x)
14 {
15   return t.f[x + 5].a;
16 }
17 
18 int
bar(struct T * x,unsigned long y)19 bar (struct T *x, unsigned long y)
20 {
21   return x->f[y + 5].b;
22 }
23