1 /* { dg-do compile } */
2 /* { dg-options "-O3 -mzarch -march=z13" } */
3
4 /* The user alignment ends up in DECL_ALIGN of the VAR_DECL and is
5 currently ignored if it is smaller than the alignment of the type.
6 In this testcase an alignment hint ",3" is emitted also for
7 accessing a4 which is wrong.
8 Hence this testcase currently fails:
9 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88085 */
10
11 typedef int __attribute__((vector_size(16))) v4si;
12
13 v4si a4 __attribute__((aligned(4)));
14 v4si a8 __attribute__((aligned(8)));
15 v4si a16 __attribute__((aligned(16)));
16 v4si a32 __attribute__((aligned(32)));
17
18 void
foo(v4si a)19 foo (v4si a)
20 {
21 a4 += a; /* vl ... vst ... */
22 a8 += a; /* vl ...,3 vst ...,3 */
23 a16 += a; /* vl ...,4 vst ...,4 */
24 a32 += a; /* vl ...,4 vst ...,4 */
25 }
26
27 /* { dg-final { scan-assembler-times "vl\t%v\[0-9\]*,\[0-9\]*\\(%r\[0-9\]*\\),3\n" 1 } } */
28 /* { dg-final { scan-assembler-times "vl\t%v\[0-9\]*,\[0-9\]*\\(%r\[0-9\]*\\),4\n" 2 } } */
29 /* { dg-final { scan-assembler-times "vst\t%v\[0-9\]*,\[0-9\]*\\(%r\[0-9\]*\\),3\n" 1 } } */
30 /* { dg-final { scan-assembler-times "vst\t%v\[0-9\]*,\[0-9\]*\\(%r\[0-9\]*\\),4" 2 } } */
31