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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [struct/] [wo_prof_single_str_pointer.c] - Blame information for rev 826

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do compile } */
2
/* { dg-do run } */
3
 
4
#include <stdlib.h>
5
typedef struct
6
{
7
  int a;
8
  int *b;
9
}str_t;
10
 
11
#define N 3
12
 
13
str_t *p;
14
 
15
int
16
main ()
17
{
18
  str_t str;
19
  int i;
20
  int res = 1 << (1 << N);
21
  p = &str;
22
  str.a = 2;
23
 
24
  p->b = &(p->a);
25
 
26
  for (i=0; i < N; i++)
27
    p->a = *(p->b)*(*(p->b));
28
 
29
  if (p->a != res)
30
    abort ();
31
 
32
  /* POSIX ignores all but the 8 low-order bits, but other
33
     environments may not.  */
34
  return (p->a & 255);
35
}
36
 
37
/*--------------------------------------------------------------------------*/
38
/* The access &(p->a) is handled incorrectly in ipa-struct-reorg.c.  */
39
/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */
40
/* { dg-final { cleanup-ipa-dump "*" } } */

powered by: WebSVN 2.1.0

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