-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AArch64][MachO] Support ptrauth ABI version.
- Loading branch information
1 parent
b46cf39
commit 306f70f
Showing
56 changed files
with
861 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// RUN: %clang_cc1 %s -triple arm64e-apple-ios -disable-llvm-passes -emit-llvm -o - | FileCheck %s --check-prefix=CHECK-NONE | ||
// RUN: %clang_cc1 %s -fptrauth-kernel-abi-version -triple arm64e-apple-ios -disable-llvm-passes -emit-llvm -o - | FileCheck %s --check-prefix=CHECK-WITH --check-prefix=CHECK-ZEROK | ||
// RUN: %clang_cc1 %s -fptrauth-abi-version=0 -triple arm64e-apple-ios -disable-llvm-passes -emit-llvm -o - | FileCheck %s --check-prefix=CHECK-WITH --check-prefix=CHECK-ZERO | ||
// RUN: %clang_cc1 %s -fptrauth-abi-version=0 -fptrauth-kernel-abi-version -triple arm64e-apple-ios -disable-llvm-passes -emit-llvm -o - | FileCheck %s --check-prefix=CHECK-WITH --check-prefix=CHECK-ZEROK | ||
// RUN: %clang_cc1 %s -fptrauth-abi-version=5 -triple arm64e-apple-ios -disable-llvm-passes -emit-llvm -o - | FileCheck %s --check-prefix=CHECK-WITH --check-prefix=CHECK-FIVE | ||
// RUN: %clang_cc1 %s -fptrauth-abi-version=5 -fptrauth-kernel-abi-version -triple arm64e-apple-ios -disable-llvm-passes -emit-llvm -o - | FileCheck %s --check-prefix=CHECK-WITH --check-prefix=CHECK-FIVEK | ||
|
||
int f(void) { | ||
return 0; | ||
} | ||
// CHECK-NONE-NOT: ptrauth.abi-version | ||
// CHECK-WITH: !llvm.module.flags = !{{{.*}} ![[ABI_VERSION_REF:[0-9]+]]} | ||
// CHECK-WITH: ![[ABI_VERSION_REF]] = !{i32 6, !"ptrauth.abi-version", ![[ABI_VERSION_VAR:[0-9]+]]} | ||
// CHECK-WITH: ![[ABI_VERSION_VAR]] = !{![[ABI_VERSION_VAL:[0-9]+]]} | ||
// CHECK-ZERO: ![[ABI_VERSION_VAL]] = !{i32 0, i1 false} | ||
// CHECK-ZEROK: ![[ABI_VERSION_VAL]] = !{i32 0, i1 true} | ||
// CHECK-FIVE: ![[ABI_VERSION_VAL]] = !{i32 5, i1 false} | ||
// CHECK-FIVEK: ![[ABI_VERSION_VAL]] = !{i32 5, i1 true} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Check the ABI version support defaults. | ||
|
||
// RUN: %clang -arch arm64e -c %s -### 2>&1 | FileCheck %s --check-prefix ABIVERSION-DEFAULT --check-prefix NOKERNELABIVERSION | ||
// RUN: %clang -mkernel -arch arm64e -c %s -### 2>&1 | FileCheck %s --check-prefix ABIVERSION-DEFAULT --check-prefix KERNELABIVERSION | ||
// RUN: %clang -fapple-kext -arch arm64e -c %s -### 2>&1 | FileCheck %s --check-prefix ABIVERSION-DEFAULT --check-prefix KERNELABIVERSION | ||
// | ||
// RUN: %clang -fno-ptrauth-kernel-abi-version -mkernel -arch arm64e -c %s -### 2>&1 | FileCheck %s --check-prefix ABIVERSION-DEFAULT --check-prefix NOKERNELABIVERSION | ||
// RUN: %clang -mkernel -fno-ptrauth-kernel-abi-version -arch arm64e -c %s -### 2>&1 | FileCheck %s --check-prefix ABIVERSION-DEFAULT --check-prefix NOKERNELABIVERSION | ||
// RUN: %clang -fno-ptrauth-kernel-abi-version -fapple-kext -arch arm64e -c %s -### 2>&1 | FileCheck %s --check-prefix ABIVERSION-DEFAULT --check-prefix NOKERNELABIVERSION | ||
// RUN: %clang -fapple-kext -fno-ptrauth-kernel-abi-version -arch arm64e -c %s -### 2>&1 | FileCheck %s --check-prefix ABIVERSION-DEFAULT --check-prefix NOKERNELABIVERSION | ||
// RUN: %clang -fno-ptrauth-kernel-abi-version -fptrauth-kernel-abi-version -arch arm64e -c %s -### 2>&1 | FileCheck %s --check-prefix ABIVERSION-DEFAULT --check-prefix NOKERNELABIVERSION | ||
// RUN: %clang -fptrauth-kernel-abi-version -fno-ptrauth-kernel-abi-version -arch arm64e -c %s -### 2>&1 | FileCheck %s --check-prefix ABIVERSION-DEFAULT --check-prefix NOKERNELABIVERSION | ||
// | ||
// ABIVERSION-DEFAULT: "-fptrauth-abi-version=0" | ||
// KERNELABIVERSION: "-fptrauth-kernel-abi-version" | ||
// NOKERNELABIVERSION-NOT: fptrauth-kernel-abi-version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Check the ABI version support. | ||
|
||
// RUN: %clang -fptrauth-abi-version=5 -arch arm64e -c %s -### 2>&1 | FileCheck %s --check-prefix ABIVERSION --check-prefix NOKERNELABIVERSION | ||
// RUN: %clang -fptrauth-abi-version=5 -mkernel -arch arm64e -c %s -### 2>&1 | FileCheck %s --check-prefix ABIVERSION --check-prefix KERNELABIVERSION | ||
// RUN: %clang -fptrauth-abi-version=5 -fapple-kext -arch arm64e -c %s -### 2>&1 | FileCheck %s --check-prefix ABIVERSION --check-prefix KERNELABIVERSION | ||
// RUN: %clang -fptrauth-abi-version=5 -fptrauth-kernel-abi-version -arch arm64e -c %s -### 2>&1 | FileCheck %s --check-prefix ABIVERSION --check-prefix KERNELABIVERSION | ||
|
||
// RUN: %clang -fno-ptrauth-abi-version -arch arm64e -c %s -### 2>&1 | FileCheck %s --check-prefix NOABIVERSION --check-prefix NOKERNELABIVERSION | ||
// RUN: %clang -fptrauth-abi-version=5 -fno-ptrauth-abi-version -arch arm64e -c %s -### 2>&1 | FileCheck %s --check-prefix NOABIVERSION --check-prefix NOKERNELABIVERSION | ||
// RUN: %clang -fno-ptrauth-abi-version -fptrauth-abi-version=5 -arch arm64e -c %s -### 2>&1 | FileCheck %s --check-prefix ABIVERSION --check-prefix NOKERNELABIVERSION | ||
|
||
// ABIVERSION: "-fptrauth-abi-version=5" | ||
// ABIVERSION-DEFAULT: "-fptrauth-abi-version=0" | ||
// NOABIVERSION-NOT: fptrauth-abi-version | ||
// KERNELABIVERSION: "-fptrauth-kernel-abi-version" | ||
// NOKERNELABIVERSION-NOT: fptrauth-kernel-abi-version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=arm64e-apple-ios < /dev/null | FileCheck %s --check-prefix=NONE | ||
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=arm64e-apple-ios -fptrauth-abi-version=0 < /dev/null | FileCheck %s --check-prefix=ZERO | ||
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=arm64e-apple-ios -fptrauth-kernel-abi-version < /dev/null | FileCheck %s --check-prefix=ZERO | ||
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=arm64e-apple-ios -fptrauth-abi-version=5 < /dev/null | FileCheck %s --check-prefix=FIVE | ||
|
||
// ZERO: #define __ptrauth_abi_version__ 0 | ||
// FIVE: #define __ptrauth_abi_version__ 5 | ||
// NONE-NOT: __ptrauth_abi_version__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.