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.2.2/] [gcc/] [testsuite/] [gcc.dg/] [tls/] [opt-2.c] - Blame information for rev 645

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

Line No. Rev Author Line
1 149 jeremybenn
/* This testcase generated invalid assembly on IA-32,
2
   since %gs:0 memory load was not exposed to the compiler
3
   as memory load and mem to mem moves are not possible
4
   on IA-32.  */
5
/* { dg-do link } */
6
/* { dg-options "-O2 -ftls-model=initial-exec" } */
7
/* { dg-options "-O2 -ftls-model=initial-exec -march=i686" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
8
/* { dg-require-effective-target tls } */
9
 
10
__thread int thr;
11
 
12
struct A
13
{
14
  unsigned int a, b, c, d, e;
15
};
16
 
17
int bar (int x, unsigned long y, void *z)
18
{
19
  return 0;
20
}
21
 
22
int
23
foo (int x, int y, const struct A *z)
24
{
25
  struct A b;
26
  int d;
27
 
28
  b = *z;
29
  d = bar (x, y, &b);
30
  if (d == 0 && y == 0x5402)
31
    {
32
      int e = thr;
33
      d = bar (x, 0x5401, &b);
34
      if (d)
35
        {
36
          thr = e;
37
          d = 0;
38
        }
39
      else if ((z->c & 0600) != (b.c & 0600)
40
               || ((z->c & 060) && ((z->c & 060) != (b.c & 060))))
41
        {
42
          thr = 22;
43
          d = -1;
44
        }
45
    }
46
 
47
  return d;
48
}
49
 
50
int main (void)
51
{
52
  foo (1, 2, 0);
53
  return 0;
54
}

powered by: WebSVN 2.1.0

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