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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [guality/] [pr43077-1.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/43077 */
2
/* { dg-do run } */
3
/* { dg-options "-g" } */
4
 
5
int varb;
6
 
7
int __attribute__((noinline))
8
fn1 (void)
9
{
10
  int vara = (varb == 3);               /* { dg-final { gdb-test 11 "vara" "0" } } */
11
  asm volatile ("" : : "g" (vara));     /* { dg-final { gdb-test 11 "varb" "2" } } */
12
  return 0;
13
}
14
 
15
int __attribute__((noinline))
16
fn2 (void)
17
{
18
  int vara = (varb == 3);               /* { dg-final { gdb-test 19 "vara" "1" } } */
19
  asm volatile ("" : : "g" (vara));     /* { dg-final { gdb-test 19 "varb" "3" } } */
20
  return 0;
21
}
22
 
23
int __attribute__((noinline))
24
foo (unsigned long *p, unsigned long *q)
25
{
26
  int ret;
27
  asm volatile ("" : "=r" (ret), "=r" (*p), "=r" (*q) : "0" (1), "1" (2), "2" (3));
28
  return ret;
29
}
30
 
31
int __attribute__((noinline))
32
fn3 (void)
33
{
34
  unsigned long a = 0, b = 0, c = 0;
35
  a = foo (&b, &c);
36
                                        /* { dg-final { gdb-test 42 "a" "1" } } */
37
                                        /* { dg-final { gdb-test 42 "b" "2" } } */
38
                                        /* { dg-final { gdb-test 42 "c" "3" } } */
39
  unsigned long vara = a;               /* { dg-final { gdb-test 42 "vara" "1" } } */
40
  unsigned long varb = b;               /* { dg-final { gdb-test 42 "varb" "2" } } */
41
  unsigned long varc = c;               /* { dg-final { gdb-test 42 "varc" "3" } } */
42
  asm volatile ("" : : "g" (vara), "g" (varb), "g" (varc));
43
  return a;
44
}
45
 
46
int
47
main (void)
48
{
49
  asm volatile ("" : "=r" (varb) : "0" (2));
50
  fn1 ();
51
  asm volatile ("" : "=r" (varb) : "0" (3));
52
  fn2 ();
53
  fn3 ();
54
  return 0;
55
}

powered by: WebSVN 2.1.0

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