brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.2 KiB · 613945c Raw
94 lines · c
1// Check the -mbranch-protection=option2 3// RUN: %clang -target arm-arm-none-eabi -march=armv8.1-m.main -c %s -### -mbranch-protection=pac-ret 2>&1 | \4// RUN: FileCheck %s --check-prefix=RA-NON-LEAF --check-prefix=KEY-A --check-prefix=BTE-OFF5 6// RUN: %clang -target arm-arm-none-eabi -march=armv8.1-m.main -c %s -### -mbranch-protection=pac-ret+leaf 2>&1 | \7// RUN: FileCheck %s --check-prefix=RA-ALL --check-prefix=KEY-A --check-prefix=BTE-OFF8 9// RUN: %clang -target arm-arm-none-eabi -march=armv8.1-m.main -c %s -### -mbranch-protection=pac-ret+leaf+b-key 2>&1 | \10// RUN: FileCheck %s --check-prefix=RA-ALL --check-prefix=KEY-B --check-prefix=BTE-OFF11 12// RUN: %clang -target arm-arm-none-eabi -march=armv8.1-m.main -c %s -### -mbranch-protection=pac-ret+b-key 2>&1 | \13// RUN: FileCheck %s --check-prefix=RA-NON-LEAF --check-prefix=KEY-B --check-prefix=BTE-OFF14 15// RUN: %clang -target arm-arm-none-eabi -march=armv8.1-m.main -c %s -### -mbranch-protection=bti 2>&1 | \16// RUN: FileCheck %s --check-prefix=RA-OFF --check-prefix=BTE-ON17 18// RUN: %clang -target arm-arm-none-eabi -march=armv8.1-m.main -c %s -### -mbranch-protection=bti+pac-ret 2>&1 | \19// RUN: FileCheck %s --check-prefix=RA-NON-LEAF --check-prefix=KEY-A --check-prefix=BTE-ON20 21// RUN: %clang -target arm-arm-none-eabi -march=armv8.1-m.main -c %s -### -mbranch-protection=bti+pac-ret+leaf 2>&1 | \22// RUN: FileCheck %s --check-prefix=RA-ALL --check-prefix=KEY-A --check-prefix=BTE-ON23 24// RUN: %clang -target arm-arm-none-eabi -march=armv8.1-m.main -c %s -### -mbranch-protection=bti 2>&1 | \25// RUN: FileCheck %s --check-prefix=RA-OFF --check-prefix=BTE-ON26 27// RUN: %clang -target arm-arm-none-eabi -march=armv8.1-m.main -c %s -### -mbranch-protection=bti+pac-ret+b-key 2>&1 | \28// RUN: FileCheck %s --check-prefix=RA-NON-LEAF --check-prefix=KEY-B --check-prefix=BTE-ON29 30// RUN: %clang -target arm-arm-none-eabi -march=armv8.1-m.main -c %s -### -mbranch-protection=bti+pac-ret+leaf+b-key 2>&1 | \31// RUN: FileCheck %s --check-prefix=RA-ALL --check-prefix=KEY-B --check-prefix=BTE-ON32 33// -mbranch-protection with standard34// RUN: %clang -target arm-arm-none-eabi -march=armv8.1-m.main -c %s -### -mbranch-protection=standard 2>&1 | \35// RUN: FileCheck %s --check-prefix=RA-NON-LEAF --check-prefix=KEY-A --check-prefix=BTE-ON36 37// RUN: not %clang --target=arm-arm-none-eabi -march=armv8.1-m.main -c %s -### -mbranch-protection=bar 2>&1 | \38// RUN: FileCheck %s --check-prefix=BAD-BP-PROTECTION39 40// RUN: not %clang --target=arm-arm-none-eabi -march=armv8.1-m.main -c %s -### -mbranch-protection=pac-ret+bti+b-key 2>&1 | \41// RUN: FileCheck %s --check-prefix=BAD-B-KEY-COMBINATION42 43// RUN: not %clang --target=arm-arm-none-eabi -march=armv8.1-m.main -c %s -### -mbranch-protection=pac-ret+bti+leaf 2>&1 | \44// RUN: FileCheck %s --check-prefix=BAD-LEAF-COMBINATION45 46// -mbranch-protection with supported architectures other than v8.1-m.main47// RUN: %clang -target arm-arm-none-eabi -march=armv8-m.main -c %s -### -mbranch-protection=pac-ret 2>&1 | \48// RUN: FileCheck %s --check-prefix=RA-NON-LEAF --check-prefix=KEY-A --check-prefix=BTE-OFF49 50// RUN: %clang -target arm-arm-none-eabi -march=armv7-m -c %s -### -mbranch-protection=pac-ret 2>&1 | \51// RUN: FileCheck %s --check-prefix=RA-NON-LEAF --check-prefix=KEY-A --check-prefix=BTE-OFF52 53// RUN: %clang -target arm-arm-none-eabi -march=armv7e-m -c %s -### -mbranch-protection=pac-ret 2>&1 | \54// RUN: FileCheck %s --check-prefix=RA-NON-LEAF --check-prefix=KEY-A --check-prefix=BTE-OFF55 56// -mbranch-protection with unsupported architectures57// RUN: %clang -target arm-arm-none-eabi -march=armv6-m -c %s -### -mbranch-protection=bti 2>&1 | \58// RUN: FileCheck %s --check-prefix=INCOMPATIBLE-ARCH59 60// RUN: %clang -target arm-arm-none-eabi -march=armv8-m.base -c %s -### -mbranch-protection=bti 2>&1 | \61// RUN: FileCheck %s --check-prefix=INCOMPATIBLE-ARCH62 63// RUN: %clang -target arm-arm-none-eabi -march=armv8-a -c %s -### -mbranch-protection=bti 2>&1 | \64// RUN: FileCheck %s --check-prefix=INCOMPATIBLE-ARCH65 66// RUN: %clang -target arm-arm-none-eabi -march=armv8-r -c %s -### -mbranch-protection=bti 2>&1 | \67// RUN: FileCheck %s --check-prefix=INCOMPATIBLE-ARCH68 69// RUN: %clang -target arm-arm-none-eabi -march=armv7-a -c %s -### -mbranch-protection=bti 2>&1 | \70// RUN: FileCheck %s --check-prefix=INCOMPATIBLE-ARCH71 72/// RUN: %clang -target arm-arm-none-eabi -march=armv7-a -mthumb -c %s -### -mbranch-protection=bti 2>&1 | \73/// RUN: FileCheck %s --check-prefix=INCOMPATIBLE-ARCH74 75// RUN: %clang -target arm-arm-none-eabi -march=armv7-r -c %s -### -mbranch-protection=bti 2>&1 | \76// RUN: FileCheck %s --check-prefix=INCOMPATIBLE-ARCH77 78// RA-OFF: "-msign-return-address=none"79// RA-NON-LEAF: "-msign-return-address=non-leaf"80// RA-ALL: "-msign-return-address=all"81 82// KEY-A: "-msign-return-address-key=a_key"83// KEY-B: "-msign-return-address-key=b_key"84 85// BTE-OFF-NOT: "-mbranch-target-enforce"86// BTE-ON: "-mbranch-target-enforce"87 88// BAD-BP-PROTECTION: unsupported argument 'bar' to option '-mbranch-protection='89 90// BAD-B-KEY-COMBINATION: unsupported argument 'b-key' to option '-mbranch-protection='91// BAD-LEAF-COMBINATION: unsupported argument 'leaf' to option '-mbranch-protection='92 93// INCOMPATIBLE-ARCH: '-mbranch-protection=' option is incompatible with the '{{.*}}' architecture94