1  /* { dg-do compile } */
       2  /* { dg-options "-O2" } */
       3  
       4  #pragma GCC push_options
       5  #pragma GCC target ("arch=armv8-a")
       6  
       7  #ifdef __ARM_FEATURE_SVE
       8  #error "__ARM_FEATURE_SVE is defined but should not be!"
       9  #endif
      10  
      11  #ifdef __ARM_FEATURE_SVE2
      12  #error "__ARM_FEATURE_SVE2 is defined but should not be!"
      13  #endif
      14  
      15  #ifdef __ARM_FEATURE_SVE2_AES
      16  #error "__ARM_FEATURE_SVE2_AES is defined but should not be!"
      17  #endif
      18  
      19  #ifdef __ARM_FEATURE_SVE2_BITPERM
      20  #error "__ARM_FEATURE_SVE2_BITPERM is defined but should not be!"
      21  #endif
      22  
      23  #ifdef __ARM_FEATURE_SVE2_SHA3
      24  #error "__ARM_FEATURE_SVE2_SHA3 is defined but should not be!"
      25  #endif
      26  
      27  #ifdef __ARM_FEATURE_SVE2_SM4
      28  #error "__ARM_FEATURE_SVE2_SM4 is defined but should not be!"
      29  #endif
      30  
      31  #pragma GCC push_options
      32  #pragma GCC target ("arch=armv8.2-a+sve")
      33  
      34  #ifndef __ARM_FEATURE_SVE
      35  #error "__ARM_FEATURE_SVE is not defined but should be!"
      36  #endif
      37  
      38  #ifdef __ARM_FEATURE_SVE2
      39  #error "__ARM_FEATURE_SVE2 is defined but should not be!"
      40  #endif
      41  
      42  #ifdef __ARM_FEATURE_SVE2_AES
      43  #error "__ARM_FEATURE_SVE2_AES is defined but should not be!"
      44  #endif
      45  
      46  #ifdef __ARM_FEATURE_SVE2_BITPERM
      47  #error "__ARM_FEATURE_SVE2_BITPERM is defined but should not be!"
      48  #endif
      49  
      50  #ifdef __ARM_FEATURE_SVE2_SHA3
      51  #error "__ARM_FEATURE_SVE2_SHA3 is defined but should not be!"
      52  #endif
      53  
      54  #ifdef __ARM_FEATURE_SVE2_SM4
      55  #error "__ARM_FEATURE_SVE2_SM4 is defined but should not be!"
      56  #endif
      57  
      58  #pragma GCC pop_options
      59  
      60  #pragma GCC push_options
      61  #pragma GCC target ("arch=armv8.5-a+sve2")
      62  
      63  #ifndef __ARM_FEATURE_SVE
      64  #error "__ARM_FEATURE_SVE is not defined but should be!"
      65  #endif
      66  
      67  #ifndef __ARM_FEATURE_SVE2
      68  #error "__ARM_FEATURE_SVE2 is not defined but should be!"
      69  #endif
      70  
      71  #ifdef __ARM_FEATURE_SVE2_AES
      72  #error "__ARM_FEATURE_SVE2_AES is defined but should not be!"
      73  #endif
      74  
      75  #ifdef __ARM_FEATURE_SVE2_BITPERM
      76  #error "__ARM_FEATURE_SVE2_BITPERM is defined but should not be!"
      77  #endif
      78  
      79  #ifdef __ARM_FEATURE_SVE2_SHA3
      80  #error "__ARM_FEATURE_SVE2_SHA3 is defined but should not be!"
      81  #endif
      82  
      83  #ifdef __ARM_FEATURE_SVE2_SM4
      84  #error "__ARM_FEATURE_SVE2_SM4 is defined but should not be!"
      85  #endif
      86  
      87  #pragma GCC pop_options
      88  
      89  #pragma GCC push_options
      90  #pragma GCC target ("arch=armv8.5-a+sve2-aes")
      91  
      92  #ifndef __ARM_FEATURE_SVE
      93  #error "__ARM_FEATURE_SVE is not defined but should be!"
      94  #endif
      95  
      96  #ifndef __ARM_FEATURE_SVE2
      97  #error "__ARM_FEATURE_SVE2 is not defined but should be!"
      98  #endif
      99  
     100  #ifndef __ARM_FEATURE_AES
     101  #error "__ARM_FEATURE_AES is not defined but should be!"
     102  #endif
     103  
     104  #ifndef __ARM_FEATURE_SVE2_AES
     105  #error "__ARM_FEATURE_SVE2_AES is not defined but should be!"
     106  #endif
     107  
     108  #ifdef __ARM_FEATURE_SVE2_BITPERM
     109  #error "__ARM_FEATURE_SVE2_BITPERM is defined but should not be!"
     110  #endif
     111  
     112  #ifdef __ARM_FEATURE_SVE2_SHA3
     113  #error "__ARM_FEATURE_SVE2_SHA3 is defined but should not be!"
     114  #endif
     115  
     116  #ifdef __ARM_FEATURE_SVE2_SM4
     117  #error "__ARM_FEATURE_SVE2_SM4 is defined but should not be!"
     118  #endif
     119  
     120  #pragma GCC pop_options
     121  
     122  #pragma GCC push_options
     123  #pragma GCC target ("arch=armv8.5-a+sve2-bitperm")
     124  
     125  #ifndef __ARM_FEATURE_SVE
     126  #error "__ARM_FEATURE_SVE is not defined but should be!"
     127  #endif
     128  
     129  #ifndef __ARM_FEATURE_SVE2
     130  #error "__ARM_FEATURE_SVE2 is not defined but should be!"
     131  #endif
     132  
     133  #ifdef __ARM_FEATURE_SVE2_AES
     134  #error "__ARM_FEATURE_SVE2_AES is defined but should not be!"
     135  #endif
     136  
     137  #ifndef __ARM_FEATURE_SVE2_BITPERM
     138  #error "__ARM_FEATURE_SVE2_BITPERM is not defined but should be!"
     139  #endif
     140  
     141  #ifdef __ARM_FEATURE_SVE2_SHA3
     142  #error "__ARM_FEATURE_SVE2_SHA3 is defined but should not be!"
     143  #endif
     144  
     145  #ifdef __ARM_FEATURE_SVE2_SM4
     146  #error "__ARM_FEATURE_SVE2_SM4 is defined but should not be!"
     147  #endif
     148  
     149  #pragma GCC pop_options
     150  
     151  #pragma GCC push_options
     152  #pragma GCC target ("arch=armv8.5-a+sve2-sha3")
     153  
     154  #ifndef __ARM_FEATURE_SVE
     155  #error "__ARM_FEATURE_SVE is not defined but should be!"
     156  #endif
     157  
     158  #ifndef __ARM_FEATURE_SVE2
     159  #error "__ARM_FEATURE_SVE2 is not defined but should be!"
     160  #endif
     161  
     162  #ifdef __ARM_FEATURE_SVE2_AES
     163  #error "__ARM_FEATURE_SVE2_AES is defined but should not be!"
     164  #endif
     165  
     166  #ifdef __ARM_FEATURE_SVE2_BITPERM
     167  #error "__ARM_FEATURE_SVE2_BITPERM is defined but should not be!"
     168  #endif
     169  
     170  #ifndef __ARM_FEATURE_SHA3
     171  #error "__ARM_FEATURE_SHA3 is not defined but should be!"
     172  #endif
     173  
     174  #ifndef __ARM_FEATURE_SVE2_SHA3
     175  #error "__ARM_FEATURE_SVE2_SHA3 is not defined but should be!"
     176  #endif
     177  
     178  #ifdef __ARM_FEATURE_SVE2_SM4
     179  #error "__ARM_FEATURE_SVE2_SM4 is defined but should not be!"
     180  #endif
     181  
     182  #pragma GCC pop_options
     183  
     184  #pragma GCC push_options
     185  #pragma GCC target ("arch=armv8.5-a+sve2-sm4")
     186  
     187  #ifndef __ARM_FEATURE_SVE
     188  #error "__ARM_FEATURE_SVE is not defined but should be!"
     189  #endif
     190  
     191  #ifndef __ARM_FEATURE_SVE2
     192  #error "__ARM_FEATURE_SVE2 is not defined but should be!"
     193  #endif
     194  
     195  #ifdef __ARM_FEATURE_SVE2_AES
     196  #error "__ARM_FEATURE_SVE2_AES is defined but should not be!"
     197  #endif
     198  
     199  #ifdef __ARM_FEATURE_SVE2_BITPERM
     200  #error "__ARM_FEATURE_SVE2_BITPERM is defined but should not be!"
     201  #endif
     202  
     203  #ifdef __ARM_FEATURE_SVE2_SHA3
     204  #error "__ARM_FEATURE_SVE2_SHA3 is defined but should not be!"
     205  #endif
     206  
     207  #ifndef __ARM_FEATURE_SM4
     208  #error "__ARM_FEATURE_SM4 is not defined but should be!"
     209  #endif
     210  
     211  #ifndef __ARM_FEATURE_SVE2_SM4
     212  #error "__ARM_FEATURE_SVE2_SM4 is not defined but should be!"
     213  #endif
     214  
     215  #pragma GCC pop_options
     216  
     217  /* Make sure that general-regs-only works too.  */
     218  #pragma GCC push_options
     219  #pragma GCC target ("arch=armv8.5-a+sve2-aes+sve2-bitperm+sve2-sha3+sve2-sm4")
     220  
     221  #ifndef __ARM_FEATURE_SVE
     222  #error "__ARM_FEATURE_SVE is not defined but should be!"
     223  #endif
     224  
     225  #ifndef __ARM_FEATURE_SVE2
     226  #error "__ARM_FEATURE_SVE2 is not defined but should be!"
     227  #endif
     228  
     229  #ifndef __ARM_FEATURE_SVE2_AES
     230  #error "__ARM_FEATURE_SVE2_AES is not defined but should be!"
     231  #endif
     232  
     233  #ifndef __ARM_FEATURE_SVE2_BITPERM
     234  #error "__ARM_FEATURE_SVE2_BITPERM is not defined but should be!"
     235  #endif
     236  
     237  #ifndef __ARM_FEATURE_SVE2_SHA3
     238  #error "__ARM_FEATURE_SVE2_SHA3 is not defined but should be!"
     239  #endif
     240  
     241  #ifndef __ARM_FEATURE_SVE2_SM4
     242  #error "__ARM_FEATURE_SVE2_SM4 is not defined but should be!"
     243  #endif
     244  
     245  #pragma GCC push_options
     246  #pragma GCC target ("general-regs-only")
     247  
     248  #ifdef __ARM_FEATURE_SVE
     249  #error "__ARM_FEATURE_SVE is defined but should not be!"
     250  #endif
     251  
     252  #ifdef __ARM_FEATURE_SVE2
     253  #error "__ARM_FEATURE_SVE2 is defined but should not be!"
     254  #endif
     255  
     256  #ifdef __ARM_FEATURE_SVE2_AES
     257  #error "__ARM_FEATURE_SVE2_AES is defined but should not be!"
     258  #endif
     259  
     260  #ifdef __ARM_FEATURE_SVE2_BITPERM
     261  #error "__ARM_FEATURE_SVE2_BITPERM is defined but should not be!"
     262  #endif
     263  
     264  #ifdef __ARM_FEATURE_SVE2_SHA3
     265  #error "__ARM_FEATURE_SVE2_SHA3 is defined but should not be!"
     266  #endif
     267  
     268  #ifdef __ARM_FEATURE_SVE2_SM4
     269  #error "__ARM_FEATURE_SVE2_SM4 is defined but should not be!"
     270  #endif
     271  
     272  #pragma GCC pop_options
     273  
     274  #pragma GCC pop_options
     275  
     276  int
     277  foo (int a)
     278  {
     279    return a;
     280  }