1 /* { dg-do compile } */
2 /* { dg-require-effective-target arm_neon_ok } */
3 /* { dg-require-effective-target arm_fp_ok } */
4 /* { dg-options "-Ofast" } */
5 /* { dg-add-options arm_fp } */
6
7 /* Reset fpu to a value compatible with the next pragmas. */
8 #pragma GCC target ("fpu=vfp")
9 #pragma GCC push_options
10
11 #pragma GCC target ("fpu=neon")
12 #include <arm_neon.h>
13
14 /* Check that pragma target is used. */
15 /*
16 **my:
17 ** ...
18 ** vadd.f32 d[0-9]+, d[0-9]+, d[0-9]+
19 ** ...
20 ** bx lr
21 */
22 float32x2_t
23 my (float32x2_t __a, float32x2_t __b)
24 {
25 return __a + __b;
26 }
27
28 #pragma GCC pop_options
29
30 /* Check that fpu=vfp is restored. */
31 /*
32 **my1:
33 ** ...
34 ** vadd.f32 s[0-9]+, s[0-9]+, s[0-9]+
35 ** vadd.f32 s[0-9]+, s[0-9]+, s[0-9]+
36 ** ...
37 ** bx lr
38 */
39 float32x2_t
40 my1 (float32x2_t __a, float32x2_t __b)
41 {
42 return __a + __b;
43 }
44
45 /* { dg-final { scan-assembler "\.fpu\\s+vfp\n" } } */
46 /* { dg-final { scan-assembler "\.fpu\\s+neon\n" } } */
47 /* { dg-final { check-function-bodies "**" "" } } */