| 1 |
// RUN: %clang_cc1 -triple thumbv7m -verify -fsyntax-only %s |
| 2 |
|
| 3 |
__attribute__((target("branch-protection=foo"))) // expected-error {{invalid or misplaced branch protection specification 'foo'}} |
| 4 |
void |
| 5 |
badvalue0(void) {} |
| 6 |
|
| 7 |
__attribute__((target("branch-protection=+bti"))) // expected-error {{invalid or misplaced branch protection specification '<empty>'}} |
| 8 |
void |
| 9 |
badvalue1(void) {} |
| 10 |
|
| 11 |
__attribute__((target("branch-protection=bti+"))) // expected-error {{invalid or misplaced branch protection specification '<empty>'}} |
| 12 |
void |
| 13 |
badvalue2(void) {} |
| 14 |
|
| 15 |
__attribute__((target("branch-protection=pac-ret+bkey"))) // expected-error {{invalid or misplaced branch protection specification 'bkey'}} |
| 16 |
void |
| 17 |
badvalue3(void) {} |
| 18 |
|
| 19 |
__attribute__((target("branch-protection=pac-ret+b-key"))) // expected-warning {{unsupported branch protection specification 'b-key'}} |
| 20 |
void |
| 21 |
badvalue4(void) {} |
| 22 |
|
| 23 |
__attribute__((target("branch-protection=bti+leaf"))) // expected-error {{invalid or misplaced branch protection specification 'leaf'}} |
| 24 |
void |
| 25 |
badoption0(void) {} |
| 26 |
|
| 27 |
__attribute__((target("branch-protection=bti+leaf+pac-ret"))) // expected-error {{invalid or misplaced branch protection specification 'leaf'}} |
| 28 |
void |
| 29 |
badorder0(void) {} |
| 30 |
|
| 31 |
__attribute__((target("branch-protection=pac-ret+bti+leaf"))) // expected-error {{invalid or misplaced branch protection specification 'leaf'}} |
| 32 |
void |
| 33 |
badorder1(void) {} |