]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/struct/wo_prof_single_str_local.c
re PR middle-end/42834 (memcpy folding overeager)
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / struct / wo_prof_single_str_local.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 int
14 main ()
15 {
16 int i;
17 int res = 1<<(1<<N);
18 str_t str;
19
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 "No structures to transform" "ipa_struct_reorg" { xfail *-*-* } } } */
35 /* { dg-final { cleanup-ipa-dump "*" } } */