xref: /llvm-project/clang/test/Driver/aarch64-pauth-lr.c (revision 9df71899bd5dbbaf0640c74cc82a6330dc7760cf)
17bd17212STomas Matheson // Check the -cc1 flags for the various forms of -mbranch-protection=pac-ret+pc.
27bd17212STomas Matheson 
3*9df71899SFangrui Song // RUN: %clang --target=aarch64 -c %s -### -mbranch-protection=pac-ret+pc                  2>&1 |  FileCheck %s --check-prefixes=PAUTH-LR
4*9df71899SFangrui Song // RUN: %clang --target=aarch64 -c %s -### -mbranch-protection=pac-ret+pc+b-key            2>&1 |  FileCheck %s --check-prefixes=PAUTH-LR-B-KEY
5*9df71899SFangrui Song // RUN: %clang --target=aarch64 -c %s -### -mbranch-protection=pac-ret+pc+leaf             2>&1 |  FileCheck %s --check-prefixes=PAUTH-LR-LEAF
6*9df71899SFangrui Song // RUN: %clang --target=aarch64 -c %s -### -mbranch-protection=pac-ret+pc+bti              2>&1 |  FileCheck %s --check-prefixes=PAUTH-LR-BTI
7*9df71899SFangrui Song // 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*9df71899SFangrui Song // RUN: %clang --target=aarch64 -c %s -### -mbranch-protection=pac-ret+pc                  -march=armv9.5-a 2>&1 |  FileCheck %s --check-prefixes=PAUTH-LR
9*9df71899SFangrui Song // 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*9df71899SFangrui Song // 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*9df71899SFangrui Song // 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*9df71899SFangrui Song // 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
137bd17212STomas Matheson 
147bd17212STomas Matheson // PAUTH-LR: "-msign-return-address=non-leaf" "-msign-return-address-key=a_key" "-mbranch-protection-pauth-lr"
157bd17212STomas Matheson // PAUTH-LR-B-KEY: "-msign-return-address=non-leaf" "-msign-return-address-key=b_key" "-mbranch-protection-pauth-lr"
167bd17212STomas Matheson // PAUTH-LR-LEAF: "-msign-return-address=all" "-msign-return-address-key=a_key" "-mbranch-protection-pauth-lr"
177bd17212STomas Matheson // PAUTH-LR-BTI: "-msign-return-address=non-leaf" "-msign-return-address-key=a_key" "-mbranch-protection-pauth-lr"
187bd17212STomas Matheson // PAUTH-LR-LEAF-B-KEY-BTI: "-msign-return-address=all" "-msign-return-address-key=b_key" "-mbranch-protection-pauth-lr" "-mbranch-target-enforce"
197bd17212STomas Matheson 
207bd17212STomas Matheson // NOT-PAUTH-LR: "-mbranch-target-enforce"
217bd17212STomas Matheson // NOT-PAUTH-LR-B-KEY: "-mbranch-target-enforce"
227bd17212STomas Matheson // NOT-PAUTH-LR-LEAF: "-mbranch-target-enforce"
237bd17212STomas Matheson // NOT-PAUTH-LR-BTI: "-mbranch-target-enforce"
24