OSDN Git Service

2010-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / struct / wo_prof_single_str_global.c
1 /* { 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 str;
14
15 int
16 main ()
17 {
18   int i;
19   int res = 1<<(1<<N);
20   str.a = 2;
21
22   for (i = 0; i < N; i++)
23     str.a = str.a * str.a;
24   
25   if (str.a != res)
26     abort ();
27
28   /* POSIX ignores all but the 8 low-order bits, but other
29      environments may not.  */
30   return (str.a & 255);
31 }
32
33 /*--------------------------------------------------------------------------*/
34 /* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */
35 /* { dg-final { cleanup-ipa-dump "*" } } */