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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [tls/] [opt-11.c] - Blame information for rev 300

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

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

powered by: WebSVN 2.1.0

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