libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / aligned-section-anchors-vect-70.c
blob7010a52b58d5fd0362389a41129e0a7e2ef1f08a
1 /* { dg-do compile } */
2 /* { dg-require-effective-target section_anchors } */
3 /* { dg-require-effective-target vect_int } */
5 #define N 32
7 /* Increase alignment of struct if an array's offset is multiple of alignment of
8 vector type corresponding to it's scalar type.
9 For the below test-case:
10 offsetof(e) == 8 bytes.
11 i) For arm: let x = alignment of vector type corresponding to int,
12 x == 8 bytes.
13 Since offsetof(e) % x == 0, set DECL_ALIGN(a, b, c) to x.
14 ii) For aarch64, ppc: x == 16 bytes.
15 Since offsetof(e) % x != 0, don't increase alignment of a, b, c.
18 static struct A {
19 int p1, p2;
20 int e[N];
21 } a, b, c;
23 int foo(void)
25 for (int i = 0; i < N; i++)
26 a.e[i] = b.e[i] + c.e[i];
28 return a.e[0];
31 /* { dg-final { scan-ipa-dump-times "Increasing alignment of decl" 0 "increase_alignment" { target aarch64*-*-* } } } */
32 /* { dg-final { scan-ipa-dump-times "Increasing alignment of decl" 0 "increase_alignment" { target powerpc64*-*-* } } } */
33 /* { dg-final { scan-ipa-dump-times "Increasing alignment of decl" 3 "increase_alignment" { target arm*-*-* } } } */