Debian Codegraph @

clang/test/Preprocessor/ptrauth_extension.c

raw
1 // RUN: %clang_cc1 -E %s -triple=aarch64 -fptrauth-intrinsics | \
2 // RUN: FileCheck %s --check-prefixes=INTRIN
3
4 // RUN: %clang_cc1 -E %s -triple=aarch64 -fptrauth-calls | \
5 // RUN: FileCheck %s --check-prefixes=NOINTRIN
6
7 // RUN: %clang_cc1 -E %s -DIS_DARWIN -triple=arm64e-apple-darwin -fptrauth-intrinsics | \
8 // RUN: FileCheck %s --check-prefixes=INTRIN,INTRIN_MAC
9
10 // RUN: %clang_cc1 -E %s -DIS_DARWIN -triple=arm64e-apple-darwin -fptrauth-calls | \
11 // RUN: FileCheck %s --check-prefixes=NOINTRIN
12
13 #if defined(IS_DARWIN) && __has_extension(ptrauth_qualifier)
14 // INTRIN_MAC: has_ptrauth_qualifier1
15 void has_ptrauth_qualifier1() {}
16 #ifndef __PTRAUTH__
17 #error ptrauth_qualifier extension present without predefined test macro
18 #endif
19 #endif
20 #if defined(IS_DARWIN) && __has_feature(ptrauth_qualifier)
21 // INTRIN_MAC: has_ptrauth_qualifier2
22 void has_ptrauth_qualifier2() {}
23 #ifndef __PTRAUTH__
24 #error ptrauth_qualifier extension present without predefined test macro
25 #endif
26 #endif
27 #if defined(__PTRAUTH__)
28 // INTRIN: has_ptrauth_qualifier3
29 void has_ptrauth_qualifier3() {}
30 #endif
31
32 #if !defined(__PTRAUTH__) && !__has_feature(ptrauth_qualifier) && !__has_extension(ptrauth_qualifier)
33 // NOINTRIN: no_ptrauth_qualifier
34 void no_ptrauth_qualifier() {}
35 #endif