1212// Test that the following options are still gated on -fptrauth-calls.
1313// If they are not, in assertion builds they would fail at asm printing time:
1414//
15- // RUN: %clang -S -o - -target aarch64-linux-gnu -mcpu=cortex-a72 -fptrauth-init-fini
16- // RUN: %clang -S -o - -target aarch64-linux-gnu -mcpu=cortex-a72 -fptrauth-function-pointer-type-discrimination
17- // RUN: %clang -S -o - -target aarch64-linux-gnu -mcpu=cortex-a72 -fptrauth-vtable-pointer-address-discrimination
18- // RUN: %clang -S -o - -target aarch64-linux-gnu -mcpu=cortex-a72 -fptrauth-vtable-pointer-type-discrimination
19- // RUN: %clang -S -o - -target aarch64-linux-gnu -mcpu=cortex-a72 -fptrauth-block-descriptor-pointers
15+ // RUN: %clang %s -S -o - -target aarch64-linux-gnu -mcpu=cortex-a72 -fptrauth-init-fini
16+ // RUN: %clang %s -S -o - -target aarch64-linux-gnu -mcpu=cortex-a72 -fptrauth-function-pointer-type-discrimination
17+ // RUN: %clang %s -S -o - -target aarch64-linux-gnu -mcpu=cortex-a72 -fptrauth-vtable-pointer-address-discrimination
18+ // RUN: %clang %s -S -o - -target aarch64-linux-gnu -mcpu=cortex-a72 -fptrauth-vtable-pointer-type-discrimination
19+ // RUN: %clang %s -S -o - -target aarch64-linux-gnu -mcpu=cortex-a72 -fptrauth-block-descriptor-pointers -fblocks -DBLOCKS
2020
2121// Test that v8.2-compatible code is generated, if possible:
2222//
2323// RUN: %clang %s -S -o - -target aarch64-linux-gnu -mcpu=cortex-a72 -msign-return-address=all 2>&1 | FileCheck %s --check-prefix=COMPAT
2424// RUN: %clang %s -S -o - -target aarch64-linux-gnu -mcpu=cortex-a72 -mbranch-protection=pac-ret 2>&1 | FileCheck %s --check-prefix=COMPAT
25+ // RUN: %clang %s -S -o - -target aarch64-linux-gnu -mcpu=cortex-a72 -mbranch-protection=pac-ret+b-key 2>&1 | FileCheck %s --check-prefix=COMPAT
2526
2627// arm64e has ptrauth enabled and assumes modern enough CPU by default:
2728//
@@ -35,15 +36,21 @@ int f(void) {
3536 return 0 ;
3637}
3738
39+ #ifdef BLOCKS
40+ int g (int (^bptr )(int )) {
41+ return bptr (42 );
42+ }
43+ #endif
44+
3845// FIXME At now, the error message is printed twice.
3946// Ideally, this should be fixed, but it seems rather harmless.
4047//
41- // FAIL-2: error: A feature is requested that needs CPU with Pointer Authentication support
48+ // FAIL-COUNT- 2: error: A feature is requested that needs CPU with Pointer Authentication support
4249
4350// COMPAT: f:
44- // COMPAT: hint #25
51+ // COMPAT: hint {{ #25|#27}}
4552//
46- // COMPAT: hint #29
53+ // COMPAT: hint {{ #29|#31}}
4754// COMPAT: ret
4855
4956// PAUTH: f:
0 commit comments