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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [guality/] [vla-2.c] - Blame information for rev 753

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

Line No. Rev Author Line
1 689 jeremybenn
/* PR debug/42801 */
2
/* { dg-do run } */
3
/* { dg-options "-g" } */
4
 
5
void __attribute__((noinline))
6
fn1 (int *x, int y)
7
{
8
  asm volatile ("" : : "rm" (x), "rm" (y) : "memory");
9
}
10
 
11
static inline __attribute__((always_inline)) int
12
fn2 (int i)
13
{
14
  int a[i];
15
  fn1 (a, i);
16
  fn1 (a, i);           /* { dg-final { gdb-test 16 "sizeof (a)" "5 * sizeof (int)" } } */
17
  return i;
18
}
19
 
20
static inline __attribute__((always_inline)) int
21
fn3 (int i)
22
{
23
  int a[i];
24
  fn1 (a, i);
25
  fn1 (a, i);           /* { dg-final { gdb-test 25 "sizeof (a)" "6 * sizeof (int)" } } */
26
  return i;
27
}
28
 
29
static inline __attribute__((always_inline)) int
30
fn4 (int i)
31
{
32
  return fn3 (i);
33
}
34
 
35
int __attribute__((noinline))
36
fn5 (void)
37
{
38
  return fn2 (5) + 1;
39
}
40
 
41
int __attribute__((noinline))
42
fn6 (int i)
43
{
44
  return fn2 (i + 1) + fn4 (i + 2) + fn4 (i + 2) + 1;
45
}
46
 
47
int
48
main (void)
49
{
50
  int x = 4;
51
  asm volatile ("" : "+r" (x));
52
  fn5 ();
53
  fn6 (x);
54
  return 0;
55
}

powered by: WebSVN 2.1.0

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