2019-11-15 19:34:47 +08:00
|
|
|
// RUN: %clang_cc1 -triple aarch64 -verify -fsyntax-only %s
|
|
|
|
|
|
|
|
__attribute__((target("branch-protection=foo"))) // expected-error {{invalid or misplaced branch protection specification 'foo'}}
|
2021-12-01 18:22:19 +08:00
|
|
|
void
|
2022-02-04 05:39:21 +08:00
|
|
|
badvalue0(void) {}
|
2019-11-15 19:34:47 +08:00
|
|
|
|
|
|
|
__attribute__((target("branch-protection=+bti"))) // expected-error {{invalid or misplaced branch protection specification '<empty>'}}
|
2021-12-01 18:22:19 +08:00
|
|
|
void
|
2022-02-04 05:39:21 +08:00
|
|
|
badvalue1(void) {}
|
2019-11-15 19:34:47 +08:00
|
|
|
|
|
|
|
__attribute__((target("branch-protection=bti+"))) // expected-error {{invalid or misplaced branch protection specification '<empty>'}}
|
2021-12-01 18:22:19 +08:00
|
|
|
void
|
2022-02-04 05:39:21 +08:00
|
|
|
badvalue2(void) {}
|
2019-11-15 19:34:47 +08:00
|
|
|
|
|
|
|
__attribute__((target("branch-protection=pac-ret+bkey"))) // expected-error {{invalid or misplaced branch protection specification 'bkey'}}
|
2021-12-01 18:22:19 +08:00
|
|
|
void
|
2022-02-04 05:39:21 +08:00
|
|
|
badvalue3(void) {}
|
2019-11-15 19:34:47 +08:00
|
|
|
|
|
|
|
__attribute__((target("branch-protection=bti+leaf"))) // expected-error {{invalid or misplaced branch protection specification 'leaf'}}
|
2021-12-01 18:22:19 +08:00
|
|
|
void
|
2022-02-04 05:39:21 +08:00
|
|
|
badoption0(void) {}
|
2019-11-15 19:34:47 +08:00
|
|
|
|
|
|
|
__attribute__((target("branch-protection=bti+leaf+pac-ret"))) // expected-error {{invalid or misplaced branch protection specification 'leaf'}}
|
2021-12-01 18:22:19 +08:00
|
|
|
void
|
2022-02-04 05:39:21 +08:00
|
|
|
badorder0(void) {}
|
2019-11-15 19:34:47 +08:00
|
|
|
|
2021-12-01 18:22:19 +08:00
|
|
|
__attribute__((target("branch-protection=pac-ret+bti+leaf"))) // expected-error {{invalid or misplaced branch protection specification 'leaf'}}
|
|
|
|
void
|
2022-02-04 05:39:21 +08:00
|
|
|
badorder1(void) {}
|