| 1 |
// Check the -cc1 flags for the various forms of -mbranch-protection=pac-ret+pc. |
| 2 |
|
| 3 |
// RUN: %clang --target=aarch64 -c %s -### -mbranch-protection=pac-ret+pc 2>&1 | FileCheck %s --check-prefixes=PAUTH-LR |
| 4 |
// RUN: %clang --target=aarch64 -c %s -### -mbranch-protection=pac-ret+pc+b-key 2>&1 | FileCheck %s --check-prefixes=PAUTH-LR-B-KEY |
| 5 |
// RUN: %clang --target=aarch64 -c %s -### -mbranch-protection=pac-ret+pc+leaf 2>&1 | FileCheck %s --check-prefixes=PAUTH-LR-LEAF |
| 6 |
// RUN: %clang --target=aarch64 -c %s -### -mbranch-protection=pac-ret+pc+bti 2>&1 | FileCheck %s --check-prefixes=PAUTH-LR-BTI |
| 7 |
// RUN: %clang --target=aarch64 -c %s -### -mbranch-protection=pac-ret+pc+leaf+b-key+bti 2>&1 | FileCheck %s --check-prefixes=PAUTH-LR-LEAF-B-KEY-BTI |
| 8 |
// RUN: %clang --target=aarch64 -c %s -### -mbranch-protection=pac-ret+pc -march=armv9.5-a 2>&1 | FileCheck %s --check-prefixes=PAUTH-LR |
| 9 |
// RUN: %clang --target=aarch64 -c %s -### -mbranch-protection=pac-ret+pc+b-key -march=armv9.5-a 2>&1 | FileCheck %s --check-prefixes=PAUTH-LR-B-KEY |
| 10 |
// RUN: %clang --target=aarch64 -c %s -### -mbranch-protection=pac-ret+pc+leaf -march=armv9.5-a 2>&1 | FileCheck %s --check-prefixes=PAUTH-LR-LEAF |
| 11 |
// RUN: %clang --target=aarch64 -c %s -### -mbranch-protection=pac-ret+pc+bti -march=armv9.5-a 2>&1 | FileCheck %s --check-prefixes=PAUTH-LR-BTI |
| 12 |
// RUN: %clang --target=aarch64 -c %s -### -mbranch-protection=pac-ret+pc+leaf+b-key+bti -march=armv9.5-a 2>&1 | FileCheck %s --check-prefixes=PAUTH-LR-LEAF-B-KEY-BTI |
| 13 |
|
| 14 |
// PAUTH-LR: "-msign-return-address=non-leaf" "-msign-return-address-key=a_key" "-mbranch-protection-pauth-lr" |
| 15 |
// PAUTH-LR-B-KEY: "-msign-return-address=non-leaf" "-msign-return-address-key=b_key" "-mbranch-protection-pauth-lr" |
| 16 |
// PAUTH-LR-LEAF: "-msign-return-address=all" "-msign-return-address-key=a_key" "-mbranch-protection-pauth-lr" |
| 17 |
// PAUTH-LR-BTI: "-msign-return-address=non-leaf" "-msign-return-address-key=a_key" "-mbranch-protection-pauth-lr" |
| 18 |
// PAUTH-LR-LEAF-B-KEY-BTI: "-msign-return-address=all" "-msign-return-address-key=b_key" "-mbranch-protection-pauth-lr" "-mbranch-target-enforce" |
| 19 |
|
| 20 |
// NOT-PAUTH-LR: "-mbranch-target-enforce" |
| 21 |
// NOT-PAUTH-LR-B-KEY: "-mbranch-target-enforce" |
| 22 |
// NOT-PAUTH-LR-LEAF: "-mbranch-target-enforce" |
| 23 |
// NOT-PAUTH-LR-BTI: "-mbranch-target-enforce" |