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/] [pr21985.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
struct
5
{
6
  struct
7
    {
8
      int a;
9
      int b;
10
    } a[100];
11
} a;
12
 
13
typedef __SIZE_TYPE__ size_t;
14
void foo(size_t);
15
size_t *bar (void);
16
 
17
int
18
main (void)
19
{
20
  size_t *b = bar ();
21
 
22
  /* This should be folded.  */
23
  foo (&a.a[50].a - &a.a[33].b);
24
  foo ((size_t) &a.a[50].b - (size_t) &a);
25
 
26
  /* And this should not.  */
27
  foo ((size_t) &b - (size_t) b);
28
  return 0;
29
}
30
 
31
/* Two of the calls to foo should be folded to just foo(constant).  */
32
 
33
/* { dg-final { scan-tree-dump-times "foo \\(\[0-9\]*\\)" 2 "optimized" } } */
34
/* { 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.