2018-04-30 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / loop-35.c
blob4e9d03a86daad6fafda74841422719a3271effcc
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-lim2-details" } */
4 int x;
5 int a[100];
7 struct a
9 int X;
10 int Y;
13 /* Word size is long long for 64-bit mingw target. */
14 #ifdef _WIN64
15 #define LONG long long
16 #else
17 #define LONG long
18 #endif
20 struct a arr[100];
22 void test1(int b)
24 unsigned i;
26 /* And here. */
27 for (i = 0; i < 100; i++)
29 arr[b+8].X += i;
30 arr[b+9].X += i;
34 void test2(struct a *A, int b)
36 unsigned i;
38 /* And here as well. */
39 for (i = 0; i < 100; i++)
41 A[b].X += i;
42 A[b+1].Y += i;
46 void test3(unsigned LONG b)
48 unsigned i;
50 /* And here. */
51 for (i = 0; i < 100; i++)
53 arr[b+8].X += i;
54 arr[b+9].X += i;
58 void test4(struct a *A, unsigned LONG b)
60 unsigned i;
62 /* And here as well. */
63 for (i = 0; i < 100; i++)
65 A[b].X += i;
66 A[b+1].Y += i;
69 /* long index not hoisted for avr target PR 36561 */
70 /* { dg-final { scan-tree-dump-times "Executing store motion of" 8 "lim2" { xfail { "avr-*-*" } } } } */
71 /* { dg-final { scan-tree-dump-times "Executing store motion of" 6 "lim2" { target { "avr-*-*" } } } } */