summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/AArch64/note-gnu-property-pac-bti-3.ll
diff options
context:
space:
mode:
authorMomchil Velikov <momchil.velikov@arm.com>2019-12-13 17:37:22 +0000
committerMomchil Velikov <momchil.velikov@arm.com>2019-12-13 17:38:20 +0000
commitd53e61863d48a07ce285d5b0a36abc67583023bd (patch)
tree8bde0f4b031e8478cd9e27c208a368398db5171f /llvm/test/CodeGen/AArch64/note-gnu-property-pac-bti-3.ll
parentf99eedeb72644671cd584f48e4c136d47f6b0020 (diff)
downloadbcm5719-llvm-d53e61863d48a07ce285d5b0a36abc67583023bd.tar.gz
bcm5719-llvm-d53e61863d48a07ce285d5b0a36abc67583023bd.zip
[AArch64] Emit PAC/BTI .note.gnu.property flags
This patch make LLVM emit the processor specific program property types defined in AArch64 ELF spec https://developer.arm.com/docs/ihi0056/f/elf-for-the-arm-64-bit-architecture-aarch64-abi-2019q2-documentation A file containing no functions gets both property flags. Otherwise, a property is set iff all the functions in the file have the corresponding attribute. Patch by Daniel Kiss and Momchil Velikov. Differential Revision: https://reviews.llvm.org/D71019
Diffstat (limited to 'llvm/test/CodeGen/AArch64/note-gnu-property-pac-bti-3.ll')
-rw-r--r--llvm/test/CodeGen/AArch64/note-gnu-property-pac-bti-3.ll18
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AArch64/note-gnu-property-pac-bti-3.ll b/llvm/test/CodeGen/AArch64/note-gnu-property-pac-bti-3.ll
new file mode 100644
index 00000000000..98a8e5e758d
--- /dev/null
+++ b/llvm/test/CodeGen/AArch64/note-gnu-property-pac-bti-3.ll
@@ -0,0 +1,18 @@
+; RUN: llc -mtriple=aarch64-linux %s -o - | \
+; RUN: FileCheck %s --check-prefix=ASM
+; RUN: llc -mtriple=aarch64-linux %s -filetype=obj -o - | \
+; RUN: llvm-readelf --notes | FileCheck %s --check-prefix=OBJ
+
+define dso_local i32 @f() #0 {
+entry:
+ ret i32 0
+}
+
+attributes #0 = { "branch-target-enforcement" "sign-return-address"="non-leaf" }
+
+; Both attribute present
+; ASM: .word 3221225472
+; ASM-NEXT: .word 4
+; ASM-NEXT .word 3
+
+; OBJ: Properties: aarch64 feature: BTI, PAC
OpenPOWER on IntegriCloud