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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [tree-ssa/] [ssa-ccp-9.c] - Blame information for rev 298

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-O1 -fdump-tree-optimized" } */
3
 
4
/* Check that cprop works for assignments to array elements and structs.  */
5
 
6
struct foo {
7
  int a;
8
};
9
 
10
extern void link_error (void);
11
 
12
void
13
test9 (struct foo f)
14
{
15
  f.a = 0;
16
  if (f.a != 0)
17
    link_error ();
18
}
19
 
20
void
21
test99 (struct foo *f)
22
{
23
  f->a = 0;
24
  if (f->a != 0)
25
    link_error ();
26
}
27
 
28
void
29
test999 (int *arr)
30
{
31
  *arr = 0;
32
  if (*arr != 0)
33
    link_error ();
34
}
35
 
36
void
37
test9999 (int *arr)
38
{
39
  arr[13] = 0;
40
  if (arr[13] != 0)
41
    link_error ();
42
}
43
 
44
void
45
test99999 (int *arr, int j)
46
{
47
  arr[j] = 0;
48
  if (arr[j] != 0)
49
    link_error ();
50
}
51
 
52
/* There should be no link_error calls, if there is any, the
53
   optimization has failed */
54
/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized"} } */
55
/* { dg-final { cleanup-tree-dump "optimized" } } */

powered by: WebSVN 2.1.0

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