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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [tls/] [opt-11.c] - Blame information for rev 689

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do run } */
2
/* { dg-require-effective-target tls_runtime } */
3
/* { dg-add-options tls } */
4
 
5
__extension__ typedef __SIZE_TYPE__ size_t;
6
 
7
extern void abort (void);
8
extern void *memset (void *, int, size_t);
9
 
10
struct A
11
{
12
  char pad[48];
13
  int i;
14
  int pad2;
15
  int j;
16
};
17
__thread struct A a;
18
 
19
int *
20
__attribute__((noinline))
21
foo (void)
22
{
23
  return &a.i;
24
}
25
 
26
int
27
main (void)
28
{
29
  int *p = foo ();
30
  memset (&a, 0, sizeof (a));
31
  a.i = 6;
32
  a.j = 8;
33
  if (p[0] != 6 || p[1] != 0 || p[2] != 8)
34
    abort ();
35
  return 0;
36
}

powered by: WebSVN 2.1.0

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