aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr87054.c
blob: 3cb3b7dac6586b18e804bb451c03fc710c3badd7 (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
28
29
// { dg-do run }
// { dg-options "-O2" }

#ifndef T
# if __SIZEOF_INT128__ && defined __SSE__
#  define T __int128
# else
#  define T long
# endif
#endif
#ifndef R
# ifdef __SSE__
#  define R "x"
# else
#  define R "r"
# endif
#endif


typedef T A; // #define T to long or __int128
struct B { char d; A c; } __attribute__((packed));
struct B b[50]; // many elements to avoid loop unrolling

int main () {
  int i;
  for (i = 0; i < sizeof(b) / sizeof(*b); i++) {
    asm ("" : "+" R (b[i].c)); // #define R to "r" on ppc or "x" on x86_64
  }
}