2018-02-09 Sebastian Perta <sebastian.perta@renesas.com>
[official-gcc.git] / gcc / testsuite / gcc.target / arm / attr-neon3.c
blob17e429ad73934c2b829d3cefd6a89ebd52052978
1 /* { dg-do compile } */
2 /* { dg-require-effective-target arm_crypto_ok } */
3 /* { dg-require-effective-target arm_fp_ok } */
4 /* { dg-options "-O2" } */
5 /* { dg-add-options arm_fp } */
7 /* Reset fpu to a value compatible with the next pragmas. */
8 #pragma GCC target ("fpu=vfp")
9 #pragma GCC push_options
11 #include <arm_neon.h>
13 /* Check that neon is used. */
14 int8x8_t __attribute__ ((target("fpu=neon")))
15 my (int8x8_t __a, int8x8_t __b)
17 return __a + __b;
20 /* Check that crypto builtins are recognized. */
21 poly128_t __attribute__ ((target("fpu=crypto-neon-fp-armv8")))
22 foo (poly128_t* ptr)
24 return vldrq_p128 (ptr);
27 /* Check that default mode is restored. */
28 int8x8_t
29 my1 (int8x8_t __a, int8x8_t __b)
31 return __a + __b;
34 /* { dg-final { scan-assembler-times "\.fpu vfp" 1 } } */
35 /* { dg-final { scan-assembler-times "\.fpu neon" 1 } } */
36 /* { dg-final { scan-assembler-times "\.fpu crypto-neon-fp-armv8" 1 } } */
37 /* { dg-final { scan-assembler-times "vld1" 1 } } */
38 /* { dg-final { scan-assembler-times "vadd" 1} } */