|
1 | 1 | // REQUIRES: aarch64-registered-target
|
2 | 2 |
|
3 | 3 | // Test that features requiring FEAT_PAuth fail early if the requirement is not met:
|
| 4 | +// Specifying the precise target triples here to prevent accidentally enabling unexpected |
| 5 | +// -fptrauth-* options as target defaults (would violate NO-UNEXPECTED check lines). |
4 | 6 | //
|
5 | 7 | // RUN: not %clang %s -S -o - -target aarch64-linux-gnu -mcpu=cortex-a72 -mbranch-protection=pauthabi 2>&1 \
|
6 | 8 | // RUN: | FileCheck %s --check-prefixes=FAIL-INTRINSICS,FAIL-CALLS,FAIL-RETURNS,NO-UNEXPECTED
|
|
14 | 16 | // RUN: | FileCheck %s --check-prefixes=FAIL-OBJC-ISA,NO-UNEXPECTED
|
15 | 17 | //
|
16 | 18 | // Test that no errors and warnings are generated if FEAT_PAUTH is supported:
|
17 |
| -// RUN: %clang %s -S -o - -target aarch64-linux-gnu -mcpu=apple-a12 -mbranch-protection=pauthabi 2>&1 \ |
| 19 | +// RUN: %clang %s -S -o - -target aarch64 -mcpu=apple-a12 -mbranch-protection=pauthabi 2>&1 \ |
18 | 20 | // RUN: | FileCheck %s --check-prefix=PAUTH --implicit-check-not=error --implicit-check-not=warning
|
19 |
| -// RUN: %clang %s -S -o - -target aarch64-linux-gnu -march=armv8.3-a -mbranch-protection=pauthabi 2>&1 \ |
| 21 | +// RUN: %clang %s -S -o - -target aarch64 -march=armv8.3-a -mbranch-protection=pauthabi 2>&1 \ |
20 | 22 | // RUN: | FileCheck %s --check-prefix=PAUTH --implicit-check-not=error --implicit-check-not=warning
|
21 |
| -// RUN: %clang %s -S -o - -target aarch64-linux-gnu -march=armv9-a -mbranch-protection=pauthabi 2>&1 \ |
| 23 | +// RUN: %clang %s -S -o - -target aarch64 -march=armv9-a -mbranch-protection=pauthabi 2>&1 \ |
22 | 24 | // RUN: | FileCheck %s --check-prefix=PAUTH --implicit-check-not=error --implicit-check-not=warning
|
23 |
| -// RUN: %clang %s -S -o - -target aarch64-linux-gnu -march=armv8.2-a+pauth -mbranch-protection=pauthabi 2>&1 \ |
| 25 | +// RUN: %clang %s -S -o - -target aarch64 -march=armv8.2-a+pauth -mbranch-protection=pauthabi 2>&1 \ |
24 | 26 | // RUN: | FileCheck %s --check-prefix=PAUTH --implicit-check-not=error --implicit-check-not=warning
|
25 | 27 | //
|
26 |
| -// Test a few combinations of options that should not generate warnings (technically, the prefix is CHECK): |
27 |
| -// RUN: %clang %s -S -o - -target aarch64-linux-gnu -march=armv8.3-a -fptrauth-returns 2>&1 \ |
| 28 | +// Test a few combinations of options that should not generate warnings: |
| 29 | +// RUN: %clang %s -S -o - -target aarch64 -march=armv8.3-a -fptrauth-returns 2>&1 \ |
28 | 30 | // RUN: | FileCheck %s --check-prefix=NO-UNEXPECTED
|
29 |
| -// RUN: %clang %s -S -o - -target aarch64-linux-gnu -march=armv8.3-a -fptrauth-objc-isa 2>&1 \ |
| 31 | +// RUN: %clang %s -S -o - -target aarch64 -march=armv8.3-a -fptrauth-objc-isa 2>&1 \ |
30 | 32 | // RUN: | FileCheck %s --check-prefix=NO-UNEXPECTED
|
31 |
| -// RUN: %clang %s -S -o - -target aarch64-linux-gnu -march=armv8.3-a -fptrauth-init-fini -fptrauth-calls 2>&1 \ |
| 33 | +// RUN: %clang %s -S -o - -target aarch64 -march=armv8.3-a -fptrauth-init-fini -fptrauth-calls 2>&1 \ |
32 | 34 | // RUN: | FileCheck %s --check-prefix=NO-UNEXPECTED
|
33 |
| -// RUN: %clang %s -S -o - -target aarch64-linux-gnu -march=armv8.3-a -fptrauth-init-fini -mbranch-protection=pauthabi 2>&1 \ |
| 35 | +// RUN: %clang %s -S -o - -target aarch64 -march=armv8.3-a -fptrauth-init-fini -mbranch-protection=pauthabi 2>&1 \ |
34 | 36 | // RUN: | FileCheck %s --check-prefix=NO-UNEXPECTED
|
35 | 37 |
|
36 | 38 | // Test that the following options are still gated on -fptrauth-calls.
|
37 |
| -// If they are not, in assertion builds they would usually fail at asm printing time: |
| 39 | +// If they are not, in assertion builds they would usually fail at asm printing time. |
| 40 | +// These tests rely on -fptrauth-calls not being implicitly enabled, so |
| 41 | +// specifying the precise target triple. |
38 | 42 | //
|
39 | 43 | // RUN: %clang %s -S -o - -target aarch64-linux-gnu -mcpu=cortex-a72 -fptrauth-init-fini 2>&1 \
|
40 | 44 | // RUN: | FileCheck %s --check-prefixes=NO-PTRAUTH-CALLS,NO-UNEXPECTED -DOPTION=-fptrauth-init-fini
|
|
0 commit comments