Merge from mainline (151362:151806)
[official-gcc/graphite-test-results.git] / gcc / testsuite / gcc.c-torture / execute / pr41935.c
blobef8d08ce0239d515461e72f1e62109e6e015673d
1 /* PR middle-end/41935 */
3 extern void abort (void);
5 long int
6 foo (int n, int i, int j)
8 typedef int T[n];
9 struct S { int a; T b[n]; };
10 return __builtin_offsetof (struct S, b[i][j]);
13 int
14 main (void)
16 typedef int T[5];
17 struct S { int a; T b[5]; };
18 if (foo (5, 2, 3)
19 != __builtin_offsetof (struct S, b) + (5 * 2 + 3) * sizeof (int))
20 abort ();
21 if (foo (5, 5, 5)
22 != __builtin_offsetof (struct S, b) + (5 * 5 + 5) * sizeof (int))
23 abort ();
24 return 0;