1  /* { dg-do "compile" } */
       2  
       3  void __attribute__ ((target("branch-protection=leaf")))
       4  foo1 ()
       5  {
       6  }
       7  /* { dg-error {invalid protection type 'leaf' in 'target\("branch-protection="\)' pragma or attribute} "" { target *-*-* } 5 } */
       8  /* { dg-error {pragma or attribute 'target\("branch-protection=leaf"\)' is not valid} "" { target *-*-* } 5 } */
       9  
      10  void __attribute__ ((target("branch-protection=none+pac-ret")))
      11  foo2 ()
      12  {
      13  }
      14  /* { dg-error "unexpected 'pac-ret' after 'none'" "" { target *-*-* } 12 } */
      15  /* { dg-error {pragma or attribute 'target\("branch-protection=none\+pac-ret"\)' is not valid} "" { target *-*-* } 12 } */
      16  
      17  void __attribute__ ((target("branch-protection=")))
      18  foo3 ()
      19  {
      20  }
      21  /* { dg-error {missing argument to 'target\("branch-protection="\)' pragma or attribute} "" { target *-*-* } 19 } */
      22  /* { dg-error {pragma or attribute 'target\("branch-protection="\)' is not valid} "" { target *-*-* } 19 } */