Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / CodeGen / AArch64 / elf-pauthabi.c
blobb176f708db85b4566c7c36d9aeb464ffc5a3b48c
1 // RUN: %clang_cc1 -triple aarch64-linux -emit-llvm -o - \
2 // RUN: -fptrauth-intrinsics \
3 // RUN: -fptrauth-calls \
4 // RUN: -fptrauth-returns \
5 // RUN: -fptrauth-auth-traps \
6 // RUN: -fptrauth-vtable-pointer-address-discrimination \
7 // RUN: -fptrauth-vtable-pointer-type-discrimination \
8 // RUN: -fptrauth-init-fini \
9 // RUN: -fptrauth-init-fini-address-discrimination \
10 // RUN: -fptrauth-elf-got \
11 // RUN: -fptrauth-indirect-gotos \
12 // RUN: -fptrauth-type-info-vtable-pointer-discrimination \
13 // RUN: -fptrauth-function-pointer-type-discrimination %s | \
14 // RUN: FileCheck %s --check-prefix=ALL
16 // RUN: %clang_cc1 -triple aarch64-linux -emit-llvm -o - \
17 // RUN: -fptrauth-intrinsics %s | FileCheck %s --check-prefix=INTRIN
19 // RUN: %clang_cc1 -triple aarch64-linux -emit-llvm -o - \
20 // RUN: -fptrauth-calls %s | FileCheck %s --check-prefix=CALL
22 // RUN: %clang_cc1 -triple aarch64-linux -emit-llvm -o - \
23 // RUN: -fptrauth-returns %s | FileCheck %s --check-prefix=RET
25 // RUN: %clang_cc1 -triple aarch64-linux -emit-llvm -o - \
26 // RUN: -fptrauth-auth-traps %s | FileCheck %s --check-prefix=TRAP
28 // RUN: %clang_cc1 -triple aarch64-linux -emit-llvm -o - \
29 // RUN: -fptrauth-calls -fptrauth-vtable-pointer-address-discrimination %s | \
30 // RUN: FileCheck %s --check-prefix=VPTRADDR
32 // RUN: %clang_cc1 -triple aarch64-linux -emit-llvm -o - \
33 // RUN: -fptrauth-calls -fptrauth-vtable-pointer-type-discrimination %s | \
34 // RUN: FileCheck %s --check-prefix=VPTRTYPE
36 // RUN: %clang_cc1 -triple aarch64-linux -emit-llvm -o - \
37 // RUN: -fptrauth-calls -fptrauth-init-fini %s | \
38 // RUN: FileCheck %s --check-prefix=INITFINI
40 // RUN: %clang_cc1 -triple aarch64-linux -emit-llvm -o - \
41 // RUN: -fptrauth-calls -fptrauth-init-fini -fptrauth-init-fini-address-discrimination %s | \
42 // RUN: FileCheck %s --check-prefix=INITFINIADDR
44 // RUN: %clang_cc1 -triple aarch64-linux -emit-llvm -o - \
45 // RUN: -fptrauth-elf-got %s | FileCheck %s --check-prefix=ELFGOT
47 // RUN: %clang_cc1 -triple aarch64-linux -emit-llvm -o - \
48 // RUN: -fptrauth-indirect-gotos %s | FileCheck %s --check-prefix=GOTOS
50 // RUN: %clang_cc1 -triple aarch64-linux -emit-llvm -o - \
51 // RUN: -fptrauth-calls -fptrauth-type-info-vtable-pointer-discrimination %s | \
52 // RUN: FileCheck %s --check-prefix=TYPEINFO
54 // RUN: %clang_cc1 -triple aarch64-linux -emit-llvm -o - \
55 // RUN: -fptrauth-calls -fptrauth-function-pointer-type-discrimination %s | \
56 // RUN: FileCheck %s --check-prefix=FPTRTYPE
58 // ALL: !{i32 1, !"aarch64-elf-pauthabi-platform", i32 268435458}
59 // ALL: !{i32 1, !"aarch64-elf-pauthabi-version", i32 4095}
61 // INTRIN: !{i32 1, !"aarch64-elf-pauthabi-platform", i32 268435458}
62 // INTRIN: !{i32 1, !"aarch64-elf-pauthabi-version", i32 1}
64 // CALL: !{i32 1, !"aarch64-elf-pauthabi-platform", i32 268435458}
65 // CALL: !{i32 1, !"aarch64-elf-pauthabi-version", i32 2}
67 // RET: !{i32 1, !"aarch64-elf-pauthabi-platform", i32 268435458}
68 // RET: !{i32 1, !"aarch64-elf-pauthabi-version", i32 4}
70 // TRAP: !{i32 1, !"aarch64-elf-pauthabi-platform", i32 268435458}
71 // TRAP: !{i32 1, !"aarch64-elf-pauthabi-version", i32 8}
73 // VPTRADDR: !{i32 1, !"aarch64-elf-pauthabi-platform", i32 268435458}
74 // VPTRADDR: !{i32 1, !"aarch64-elf-pauthabi-version", i32 18}
76 // VPTRTYPE: !{i32 1, !"aarch64-elf-pauthabi-platform", i32 268435458}
77 // VPTRTYPE: !{i32 1, !"aarch64-elf-pauthabi-version", i32 34}
79 // INITFINI: !{i32 1, !"aarch64-elf-pauthabi-platform", i32 268435458}
80 // INITFINI: !{i32 1, !"aarch64-elf-pauthabi-version", i32 66}
82 // INITFINIADDR: !{i32 1, !"aarch64-elf-pauthabi-platform", i32 268435458}
83 // INITFINIADDR: !{i32 1, !"aarch64-elf-pauthabi-version", i32 194}
85 // ELFGOT: !{i32 1, !"aarch64-elf-pauthabi-platform", i32 268435458}
86 // ELFGOT: !{i32 1, !"aarch64-elf-pauthabi-version", i32 256}
88 // GOTOS: !{i32 1, !"aarch64-elf-pauthabi-platform", i32 268435458}
89 // GOTOS: !{i32 1, !"aarch64-elf-pauthabi-version", i32 512}
91 // TYPEINFO: !{i32 1, !"aarch64-elf-pauthabi-platform", i32 268435458}
92 // TYPEINFO: !{i32 1, !"aarch64-elf-pauthabi-version", i32 1026}
94 // FPTRTYPE: !{i32 1, !"aarch64-elf-pauthabi-platform", i32 268435458}
95 // FPTRTYPE: !{i32 1, !"aarch64-elf-pauthabi-version", i32 2050}
97 void foo() {}