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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [guality/] [pr48466.c] - Blame information for rev 774

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

Line No. Rev Author Line
1 689 jeremybenn
/* PR debug/48466 */
2
/* { dg-do run } */
3
/* { dg-options "-g" } */
4
/* { dg-skip-if "" { *-*-* }  { "*" } { "-O0" } } */
5
 
6
struct S { unsigned int a; unsigned int *b; };
7
struct T { struct S a; struct S b; };
8
struct U { const char *u; };
9
int n[10];
10
volatile int v;
11
 
12
struct U
13
foo (const char *s)
14
{
15
  struct U r;
16
  r.u = s;
17
  return r;
18
}
19
 
20
void
21
bar (struct T *s, int a, int b)
22
{
23
  s->a.a = a;
24
  s->a.b = &s->a.a;
25
  s->b.a = b;
26
  s->b.b = &s->b.a;
27
}
28
 
29
int
30
main ()
31
{
32
  struct T t;
33
  struct U x = foo ("this is x");
34
  struct S y, z;
35
  y.b = n;              /* { dg-final { gdb-test 38 "t.a.a" "17" } } */
36
  y.a = 0;               /* { dg-final { gdb-test 38 "*t.a.b" "17" } } */
37
  bar (&t, 17, 21);     /* { dg-final { gdb-test 38 "t.b.a" "21" } } */
38
  v++;                  /* { dg-final { gdb-test 38 "*t.b.b" "21" } } */
39
  z = y;
40
  return 0;
41
}

powered by: WebSVN 2.1.0

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