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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [sms-9.c] - Blame information for rev 754

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

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-O2 -fmodulo-sched -fmodulo-sched-allow-regmoves" } */
3
 
4
#include <stdlib.h>
5
#include <stdarg.h>
6
 
7
struct df_ref_info
8
{
9
  unsigned int *begin;
10
  unsigned int *count;
11
};
12
 
13
extern void *memset (void *s, int c, __SIZE_TYPE__ n);
14
 
15
 
16
__attribute__ ((noinline))
17
int
18
df_reorganize_refs_by_reg_by_insn (struct df_ref_info *ref_info,
19
                                   int num, unsigned int start)
20
{
21
  unsigned int m = num;
22
  unsigned int offset = 77;
23
  unsigned int r;
24
 
25
  for (r = start; r < m; r++)
26
    {
27
      ref_info->begin[r] = offset;
28
      offset += ref_info->count[r];
29
      ref_info->count[r] = 0;
30
    }
31
 
32
  return offset;
33
}
34
 
35
int
36
main ()
37
{
38
  struct df_ref_info temp;
39
  int num = 100;
40
  unsigned int start = 5;
41
  int i, offset;
42
 
43
  temp.begin = malloc (100 * sizeof (unsigned int));
44
  temp.count = malloc (100 * sizeof (unsigned int));
45
 
46
  memset (temp.begin, 0, sizeof (unsigned int) * num);
47
  memset (temp.count, 0, sizeof (unsigned int) * num);
48
 
49
  for (i = 0; i < num; i++)
50
    temp.count[i] = i + 1;
51
 
52
  offset = df_reorganize_refs_by_reg_by_insn (&temp, num, start);
53
 
54
  if (offset != 5112)
55
    abort ();
56
 
57
  free (temp.begin);
58
  free (temp.count);
59
  return 0;
60
}

powered by: WebSVN 2.1.0

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