Skip to content

Commit eb62a64

Browse files
committed
Use generic triples in tests, if possible
1 parent cb64475 commit eb62a64

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

clang/test/CodeGen/ptrauth-cpu-feature.cpp

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// REQUIRES: aarch64-registered-target
22

33
// 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).
46
//
57
// RUN: not %clang %s -S -o - -target aarch64-linux-gnu -mcpu=cortex-a72 -mbranch-protection=pauthabi 2>&1 \
68
// RUN: | FileCheck %s --check-prefixes=FAIL-INTRINSICS,FAIL-CALLS,FAIL-RETURNS,NO-UNEXPECTED
@@ -14,27 +16,29 @@
1416
// RUN: | FileCheck %s --check-prefixes=FAIL-OBJC-ISA,NO-UNEXPECTED
1517
//
1618
// 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 \
1820
// 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 \
2022
// 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 \
2224
// 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 \
2426
// RUN: | FileCheck %s --check-prefix=PAUTH --implicit-check-not=error --implicit-check-not=warning
2527
//
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 \
2830
// 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 \
3032
// 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 \
3234
// 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 \
3436
// RUN: | FileCheck %s --check-prefix=NO-UNEXPECTED
3537

3638
// 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.
3842
//
3943
// RUN: %clang %s -S -o - -target aarch64-linux-gnu -mcpu=cortex-a72 -fptrauth-init-fini 2>&1 \
4044
// RUN: | FileCheck %s --check-prefixes=NO-PTRAUTH-CALLS,NO-UNEXPECTED -DOPTION=-fptrauth-init-fini

0 commit comments

Comments
 (0)