OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [tls/] [opt-12.c] - Blame information for rev 149

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* PR target/29198 */
2
/* { dg-do run } */
3
/* { dg-options "-O2 -fpic" } */
4
/* { dg-require-effective-target tls_runtime } */
5
/* { dg-require-effective-target fpic } */
6
 
7
extern void abort (void);
8
 
9
int f2 (int, int, int, int);
10
struct s { char b[4]; };
11
__thread struct s thra[2];
12
 
13
void
14
__attribute__((noinline))
15
f1 (int a1, int a2)
16
{
17
  int i, j;
18
  for (i = 0; i < 4; i++)
19
    {
20
      int tot = 0;
21
      for (j = 0; j < 4; j++)
22
        tot += f2 (a1, a2, i, j);
23
      *(&thra[0].b[0] + i) = tot;
24
    }
25
}
26
 
27
int
28
__attribute__((noinline))
29
f2 (int a, int b, int c, int d)
30
{
31
  return a + b + c + d;
32
}
33
 
34
int
35
main (void)
36
{
37
  f1 (0, 0);
38
  if (thra[0].b[0] != 6
39
      || thra[0].b[1] != 10
40
      || thra[0].b[2] != 14
41
      || thra[0].b[3] != 18)
42
    abort ();
43
  f1 (2, 3);
44
  if (thra[0].b[0] != 26
45
      || thra[0].b[1] != 30
46
      || thra[0].b[2] != 34
47
      || thra[0].b[3] != 38)
48
    abort ();
49
  return 0;
50
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.