summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tls/pr45870.c
blob: 8a5d3c74a4c992434fcf24d1558e26a932c56191 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* PR target/45870 */
/* { dg-do compile } */
/* { dg-options "-g -O" } */
/* { dg-require-effective-target tls } */

__thread int v[30];
int bar (void);

int
foo (int x, int y, int z)
{
  int a, b = z, c;
  while (b > 0)
    {
      c = (bar () % 3);
      a = v[x];
      if (x < y)
	for (;;);
      b += a;
    }
}