1  /* { dg-do run } */
       2  /* { dg-require-effective-target mbranch_protection_ok } */
       3  /* { dg-require-effective-target arm_pacbti_hw } */
       4  /* { dg-skip-if "do not override march" { *-*-* } { "-march=*" } { "-march=armv8.1-m.main" } } */
       5  /* { dg-additional-options "-march=armv8.1-m.main -mbranch-protection=bti+pac-ret" } */
       6  
       7  #if !defined (__ARM_FEATURE_BTI_DEFAULT)
       8  #error "Feature test macro __ARM_FEATURE_BTI_DEFAULT should be defined."
       9  #endif
      10  
      11  #if !defined (__ARM_FEATURE_PAC_DEFAULT)
      12  #error "Feature test macro __ARM_FEATURE_PAC_DEFAULT should be defined."
      13  #endif
      14  
      15  int
      16  main()
      17  {
      18    if (__ARM_FEATURE_BTI_DEFAULT != 1)
      19      __builtin_abort ();
      20  
      21    if (__ARM_FEATURE_PAC_DEFAULT != 1)
      22      __builtin_abort ();
      23  
      24    return 0;
      25  }