aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/pr52698.c
blob: 8d8988fccc348a5d0af7cd02b400618756bffb47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* { dg-do compile { target { ! ia32 } } } */
/* { dg-require-effective-target maybe_x32 } */
/* { dg-options "-O2 -mx32 -maddress-mode=long" } */

extern void abort (void);
static __thread unsigned char foo [32]
__attribute__ ((tls_model ("initial-exec"), aligned (sizeof (void *))));

void
test2 (void)
{
  unsigned int s;
  for (s = 0; s < sizeof (foo); ++s)
    {
      if (foo [s] != s)
	abort ();
      foo [s] = sizeof (foo) - s;
    }
}