OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [tls/] [struct-1.c] - Rev 378

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

/* This testcase ICEd on IA-32 because the backend was inconsistent whether
   to allow addends for @dtpoff relocs or not.  */
/* { dg-do compile } */
/* { dg-require-effective-target fpic } */
/* { dg-options "-O2 -fpic" } */
/* { dg-require-effective-target tls } */
 
struct S {
  int s0, s1, s2, s3;
};
static __thread struct S x;
extern void abort (void);
extern void exit (int);
 
void
foo (struct S *s)
{
  s->s2 = 231;
}
 
void
bar (void)
{
  if (x.s0 == 231 || x.s2 != 231)
    abort ();
}
 
int
main ()
{
  foo (&x);
  bar ();
  exit (0);
}
 

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

powered by: WebSVN 2.1.0

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