1 /* { dg-do compile } */
2 /* Make sure we can force fpu=vfp before switching using the
3    pragma.  */
4 /* { dg-require-effective-target arm_fp_ok } */
5 /* { dg-options "-O2 -march=armv8-a" } */
6 /* { dg-add-options arm_fp } */
7 
8 /* Reset fpu to a value compatible with the next pragmas.  */
9 #pragma GCC target ("fpu=vfp")
10 #pragma GCC push_options
11 
12 #pragma GCC target ("fpu=crypto-neon-fp-armv8")
13 
14 #ifndef __ARM_FEATURE_CRYPTO
15 #error __ARM_FEATURE_CRYPTO not defined.
16 #endif
17 
18 #ifndef __ARM_NEON
19 #error __ARM_NEON not defined.
20 #endif
21 
22 #if !defined(__ARM_FP) || (__ARM_FP != 14)
23 #error __ARM_FP
24 #endif
25 
26 #include "arm_neon.h"
27 
28 int
foo(void)29 foo (void)
30 {
31   uint32x4_t a = {0xd, 0xe, 0xa, 0xd};
32   uint32x4_t b = {0, 1, 2, 3};
33 
34   uint32x4_t res = vsha256su0q_u32 (a, b);
35   return res[0];
36 }
37 
38 #pragma GCC pop_options
39 
40 /* Check that the FP version is correctly reset.  */
41 
42 #if !defined(__ARM_FP) || (__ARM_FP != 12)
43 #error __ARM_FP
44 #endif
45 
46 /* { dg-final { scan-assembler "sha256su0.32\tq\[0-9\]+, q\[0-9\]+" } } */
47