[AArch64][12/14] Target attributes and target pragmas tests
[official-gcc.git] / gcc / testsuite / gcc.target / aarch64 / target_attr_2.c
blob39bb6e7dd364c173993e6e363b5d11321380642a
1 /* { dg-do assemble } */
2 /* { dg-options "-O2 -mcpu=cortex-a57 -ftree-vectorize -fdump-tree-vect-all" } */
4 /* The various ways to turn off simd availability should
5 turn off vectorization. */
7 __attribute__ ((target ("+nosimd")))
8 int
9 baz (int *a)
11 for (int i = 0; i < 1024; i++)
12 a[i] += 5;
15 __attribute__ ((target ("arch=armv8-a+nosimd")))
16 int
17 baz2 (int *a)
19 for (int i = 0; i < 1024; i++)
20 a[i] += 5;
23 __attribute__ ((target ("cpu=cortex-a53+nosimd")))
24 int
25 baz3 (int *a)
27 for (int i = 0; i < 1024; i++)
28 a[i] += 5;
31 __attribute__ ((target ("general-regs-only")))
32 int
33 baz4 (int *a)
35 for (int i = 0; i < 1024; i++)
36 a[i] += 5;
39 /* { dg-final { scan-tree-dump-not "vectorized 1 loops" "vect" } } */