• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// REQUIRES: aarch64-registered-target
2
3// When -mmark-bti-property is passed the generated file object gets BTI marking.
4// RUN: %clang -target arm64-linux-none -mmark-bti-property -c -o - %s | llvm-readobj -n - | FileCheck -check-prefix=CHECK  -check-prefix=CHECK_GEN %s
5// RUN: %clang -target arm64-linux-none -DNOTE_PRESENT -c %s -o - | llvm-readobj -n - | FileCheck -check-prefix=CHECK  -check-prefix=CHECK_PRESET %s
6// RUN: %clang -target arm64-linux-none -mmark-bti-property -DNOTE_PRESENT -c %s -o - | llvm-readobj -n - | FileCheck -check-prefix=CHECK  -check-prefix=CHECK_PRESET %s
7// RUN: %clang -target arm64-linux-none -mmark-bti-property -DNOTE_PRESENT -c %s -o - 2>&1 |  FileCheck -check-prefix=CHECK_WARNING %s
8//
9// CHECK_WARNING: The .note.gnu.property is not emitted because it is already present.
10// CHECK: Name: .note.gnu.property
11// CHECK: Type: NT_GNU_PROPERTY_TYPE_0
12// CHECK_GEN: aarch64 feature: BTI
13// CHECK_PRESET: aarch64 feature: BTI, PAC
14
15#ifdef NOTE_PRESENT
16  .section .note.gnu.property, "a";
17  .balign 8;
18  .long 4;
19  .long 0x10;
20  .long 0x5
21  .asciz "GNU"
22  .long 0xc0000000
23  .long 4
24  .long 3
25  .long 0
26#endif
27