[RISCV] Add RVVConstraint to SiFive custom matrix multiply instructions. (#124055)
[llvm-project.git] / clang / test / Driver / aarch64-ptrauth.c
blobd036189e61498326e6b51f060c3a54e90f3922e7
1 // REQUIRES: aarch64-registered-target
3 // RUN: %clang -### -c --target=aarch64 %s 2>&1 | FileCheck %s --check-prefix NONE
4 // NONE: "-cc1"
5 // NONE-NOT: "-fptrauth-
7 // RUN: %clang -### -c --target=aarch64 \
8 // RUN: -fno-ptrauth-intrinsics -fptrauth-intrinsics \
9 // RUN: -fno-ptrauth-calls -fptrauth-calls \
10 // RUN: -fno-ptrauth-returns -fptrauth-returns \
11 // RUN: -fno-ptrauth-auth-traps -fptrauth-auth-traps \
12 // RUN: -fno-ptrauth-vtable-pointer-address-discrimination -fptrauth-vtable-pointer-address-discrimination \
13 // RUN: -fno-ptrauth-vtable-pointer-type-discrimination -fptrauth-vtable-pointer-type-discrimination \
14 // RUN: -fno-ptrauth-type-info-vtable-pointer-discrimination -fptrauth-type-info-vtable-pointer-discrimination \
15 // RUN: -fno-ptrauth-indirect-gotos -fptrauth-indirect-gotos \
16 // RUN: -fno-ptrauth-init-fini -fptrauth-init-fini \
17 // RUN: -fno-ptrauth-init-fini-address-discrimination -fptrauth-init-fini-address-discrimination \
18 // RUN: -fno-aarch64-jump-table-hardening -faarch64-jump-table-hardening \
19 // RUN: %s 2>&1 | FileCheck %s --check-prefix=ALL
20 // ALL: "-cc1"{{.*}} "-fptrauth-intrinsics" "-fptrauth-calls" "-fptrauth-returns" "-fptrauth-auth-traps" "-fptrauth-vtable-pointer-address-discrimination" "-fptrauth-vtable-pointer-type-discrimination" "-fptrauth-type-info-vtable-pointer-discrimination" "-fptrauth-indirect-gotos" "-fptrauth-init-fini" "-fptrauth-init-fini-address-discrimination" "-faarch64-jump-table-hardening"
22 // RUN: %clang -### -c --target=aarch64-linux -mabi=pauthtest %s 2>&1 | FileCheck %s --check-prefix=PAUTHABI1
23 // RUN: %clang -### -c --target=aarch64-linux-pauthtest %s 2>&1 | FileCheck %s --check-prefix=PAUTHABI1
24 // PAUTHABI1: "-cc1"{{.*}} "-triple" "aarch64-unknown-linux-pauthtest"
25 // PAUTHABI1-SAME: "-target-abi" "pauthtest"
26 // PAUTHABI1-SAME: "-fptrauth-intrinsics" "-fptrauth-calls" "-fptrauth-returns" "-fptrauth-auth-traps" "-fptrauth-vtable-pointer-address-discrimination" "-fptrauth-vtable-pointer-type-discrimination" "-fptrauth-indirect-gotos" "-fptrauth-init-fini"
28 // RUN: %clang -### -c --target=aarch64 -mabi=pauthtest -fno-ptrauth-intrinsics \
29 // RUN: -fno-ptrauth-calls -fno-ptrauth-returns -fno-ptrauth-auth-traps \
30 // RUN: -fno-ptrauth-vtable-pointer-address-discrimination -fno-ptrauth-vtable-pointer-type-discrimination \
31 // RUN: -fno-ptrauth-indirect-gotos -fno-ptrauth-init-fini %s 2>&1 | FileCheck %s --check-prefix=PAUTHABI2
32 // RUN: %clang -### -c --target=aarch64-pauthtest -fno-ptrauth-intrinsics \
33 // RUN: -fno-ptrauth-calls -fno-ptrauth-returns -fno-ptrauth-auth-traps \
34 // RUN: -fno-ptrauth-vtable-pointer-address-discrimination -fno-ptrauth-vtable-pointer-type-discrimination \
35 // RUN: -fno-ptrauth-indirect-gotos -fno-ptrauth-init-fini %s 2>&1 | FileCheck %s --check-prefix=PAUTHABI2
36 // PAUTHABI2: "-cc1"
37 // PAUTHABI2-NOT: "-fptrauth-
39 // RUN: not %clang -### -c --target=x86_64 -fptrauth-intrinsics -fptrauth-calls -fptrauth-returns -fptrauth-auth-traps \
40 // RUN: -fptrauth-vtable-pointer-address-discrimination -fptrauth-vtable-pointer-type-discrimination \
41 // RUN: -fptrauth-type-info-vtable-pointer-discrimination -fptrauth-indirect-gotos -fptrauth-init-fini \
42 // RUN: -fptrauth-init-fini-address-discrimination -faarch64-jump-table-hardening %s 2>&1 | FileCheck %s --check-prefix=ERR1
43 // ERR1: error: unsupported option '-fptrauth-intrinsics' for target '{{.*}}'
44 // ERR1-NEXT: error: unsupported option '-fptrauth-calls' for target '{{.*}}'
45 // ERR1-NEXT: error: unsupported option '-fptrauth-returns' for target '{{.*}}'
46 // ERR1-NEXT: error: unsupported option '-fptrauth-auth-traps' for target '{{.*}}'
47 // ERR1-NEXT: error: unsupported option '-fptrauth-vtable-pointer-address-discrimination' for target '{{.*}}'
48 // ERR1-NEXT: error: unsupported option '-fptrauth-vtable-pointer-type-discrimination' for target '{{.*}}'
49 // ERR1-NEXT: error: unsupported option '-fptrauth-type-info-vtable-pointer-discrimination' for target '{{.*}}'
50 // ERR1-NEXT: error: unsupported option '-fptrauth-indirect-gotos' for target '{{.*}}'
51 // ERR1-NEXT: error: unsupported option '-fptrauth-init-fini' for target '{{.*}}'
52 // ERR1-NEXT: error: unsupported option '-fptrauth-init-fini-address-discrimination' for target '{{.*}}'
53 // ERR1-NEXT: error: unsupported option '-faarch64-jump-table-hardening' for target '{{.*}}'
55 //// Only support PAuth ABI for Linux as for now.
56 // RUN: not %clang -o /dev/null -c --target=aarch64-unknown -mabi=pauthtest %s 2>&1 | FileCheck %s --check-prefix=ERR2
57 // RUN: not %clang -o /dev/null -c --target=aarch64-unknown-pauthtest %s 2>&1 | FileCheck %s --check-prefix=ERR2
58 // ERR2: error: ABI 'pauthtest' is not supported for 'aarch64-unknown-unknown-pauthtest'
60 //// PAuth ABI is encoded as environment part of the triple, so don't allow to explicitly set other environments.
61 // RUN: not %clang -### -c --target=aarch64-linux-gnu -mabi=pauthtest %s 2>&1 | FileCheck %s --check-prefix=ERR3
62 // ERR3: error: unsupported option '-mabi=pauthtest' for target 'aarch64-unknown-linux-gnu'
63 // RUN: %clang -### -c --target=aarch64-linux-pauthtest -mabi=pauthtest %s
65 //// The only branch protection option compatible with PAuthABI is BTI.
66 // RUN: not %clang -### -c --target=aarch64-linux -mabi=pauthtest -mbranch-protection=pac-ret %s 2>&1 | \
67 // RUN: FileCheck %s --check-prefix=ERR4
68 // RUN: not %clang -### -c --target=aarch64-linux-pauthtest -mbranch-protection=pac-ret %s 2>&1 | \
69 // RUN: FileCheck %s --check-prefix=ERR4
70 // ERR4: error: unsupported option '-mbranch-protection=pac-ret' for target 'aarch64-unknown-linux-pauthtest'
72 // RUN: not %clang -### -c --target=aarch64-linux -mabi=pauthtest -mbranch-protection=gcs %s 2>&1 | \
73 // RUN: FileCheck %s --check-prefix=ERR5
74 // RUN: not %clang -### -c --target=aarch64-linux-pauthtest -mbranch-protection=gcs %s 2>&1 | \
75 // RUN: FileCheck %s --check-prefix=ERR5
76 // ERR5: error: unsupported option '-mbranch-protection=gcs' for target 'aarch64-unknown-linux-pauthtest'
78 // RUN: not %clang -### -c --target=aarch64-linux -mabi=pauthtest -mbranch-protection=standard %s 2>&1 | \
79 // RUN: FileCheck %s --check-prefix=ERR6
80 // RUN: not %clang -### -c --target=aarch64-linux-pauthtest -mbranch-protection=standard %s 2>&1 | \
81 // RUN: FileCheck %s --check-prefix=ERR6
82 // ERR6: error: unsupported option '-mbranch-protection=standard' for target 'aarch64-unknown-linux-pauthtest'
84 // RUN: not %clang -### -c --target=aarch64-linux -mabi=pauthtest -msign-return-address=all %s 2>&1 | \
85 // RUN: FileCheck %s --check-prefix=ERR7
86 // RUN: not %clang -### -c --target=aarch64-linux-pauthtest -msign-return-address=all %s 2>&1 | \
87 // RUN: FileCheck %s --check-prefix=ERR7
88 // ERR7: error: unsupported option '-msign-return-address=all' for target 'aarch64-unknown-linux-pauthtest'
90 // RUN: not %clang -### -c --target=aarch64-linux -mabi=pauthtest -msign-return-address=non-leaf %s 2>&1 | \
91 // RUN: FileCheck %s --check-prefix=ERR8
92 // RUN: not %clang -### -c --target=aarch64-linux-pauthtest -msign-return-address=non-leaf %s 2>&1 | \
93 // RUN: FileCheck %s --check-prefix=ERR8
94 // ERR8: error: unsupported option '-msign-return-address=non-leaf' for target 'aarch64-unknown-linux-pauthtest'
96 // RUN: %clang -### -c --target=aarch64-linux -mabi=pauthtest -msign-return-address=none %s
97 // RUN: %clang -### -c --target=aarch64-linux-pauthtest -msign-return-address=none %s
98 // RUN: %clang -### -c --target=aarch64-linux -mabi=pauthtest -mbranch-protection=bti %s
99 // RUN: %clang -### -c --target=aarch64-linux-pauthtest -mbranch-protection=bti %s
100 // RUN: %clang -### -c --target=aarch64-linux -mabi=pauthtest -mbranch-protection=none %s
101 // RUN: %clang -### -c --target=aarch64-linux-pauthtest -mbranch-protection=none %s