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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [guality/] [pr41353-1.c] - Blame information for rev 701

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

Line No. Rev Author Line
1 689 jeremybenn
/* PR debug/41353 */
2
/* { dg-do run } */
3
/* { dg-options "-g" } */
4
 
5
int vari __attribute__((used)) = 17, varj;
6
 
7
__attribute__((noinline)) int
8
f1 (void)
9
{
10
  /* { dg-final { gdb-test 17 "vari" "17" } } */
11
  int vari1 = 2 * vari; /* { dg-final { gdb-test 17 "vari1" "2 * 17" } } */
12
  int vari2 = 3 * vari; /* { dg-final { gdb-test 17 "vari2" "3 * 17" } } */
13
  int vari3 = 2 * vari; /* { dg-final { gdb-test 17 "vari3" "2 * 17" } } */
14
  int vari4 = 3 * vari; /* { dg-final { gdb-test 17 "vari4" "3 * 17" } } */
15
  int vari5 = 4 * vari; /* { dg-final { gdb-test 17 "vari5" "4 * 17" } } */
16
  int vari6 = 5 * vari; /* { dg-final { gdb-test 17 "vari6" "5 * 17" } } */
17
  return varj;
18
}
19
 
20
__attribute__((noinline)) int
21
f2 (int i, int j)
22
{
23
  j += i;
24
  /* { dg-final { gdb-test 28 "i" "37" } } */
25
  /* { dg-final { gdb-test 28 "j" "28 + 37" { xfail *-*-* } } } */
26
  int i1 = 2 * i; /* { dg-final { gdb-test 28 "i1" "2 * 37" } } */
27
  int i2 = 3 * i; /* { dg-final { gdb-test 28 "i2" "3 * 37" } } */
28
  return j;
29
}
30
 
31
__attribute__((noinline)) int
32
f3 (int i)
33
{
34
  asm volatile ("" : "+r" (i));
35
  /* { dg-final { gdb-test 39 "i" "12" } } */
36
  int i1 = 2 * i; /* { dg-final { gdb-test 39 "i1" "2 * 12" } } */
37
  int i2 = 2 * i; /* { dg-final { gdb-test 39 "i2" "2 * 12" } } */
38
  int i3 = 3 * i; /* { dg-final { gdb-test 39 "i3" "3 * 12" } } */
39
  return i;
40
}
41
 
42
int (*volatile fnp1) (void) = f1;
43
int (*volatile fnp2) (int, int) = f2;
44
int (*volatile fnp3) (int) = f3;
45
 
46
int
47
main (int argc, char *argv[])
48
{
49
  asm volatile ("" : : "r" (&fnp1) : "memory");
50
  asm volatile ("" : : "r" (&fnp2) : "memory");
51
  asm volatile ("" : : "r" (&fnp3) : "memory");
52
  fnp1 ();
53
  fnp2 (37, 28);
54
  fnp3 (12);
55
  return 0;
56
}

powered by: WebSVN 2.1.0

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