Debian Codegraph @

clang/test/CodeGenCXX/mangle-itanium-ptrauth.cpp

raw
1 // RUN: %clang_cc1 -std=c++11 -fptrauth-intrinsics -fptrauth-calls -emit-llvm -o - -triple=arm64-apple-ios %s | FileCheck %s
2 // RUN: %clang_cc1 -std=c++11 -fptrauth-intrinsics -fptrauth-calls -emit-llvm -o - -triple=aarch64-linux-gnu %s | FileCheck %s
3 // RUN: %clang_cc1 -std=c++11 -fptrauth-intrinsics -fptrauth-calls -emit-llvm -o - -triple=arm64-apple-ios -fclang-abi-compat=4 %s | FileCheck %s
4
5 // clang previously emitted an incorrect discriminator for the member function
6 // pointer because of a bug in the mangler.
7
8 // CHECK: @_ZN17test_substitution5funcsE = global [1 x { i64, i64 }] [{ i64, i64 } { i64 ptrtoint (ptr ptrauth (ptr @_ZN17test_substitution1S1fEPvS1_, i32 0, i64 48995) to i64), i64 0 }], align 8
9 namespace test_substitution {
10 struct S { int f(void *, void *); };
11
12 typedef int (S::*s_func)(void *, void *);
13
14 s_func funcs[] = { (s_func)(&S::f) };
15 }
16
17
18 // CHECK: define {{.*}}void @_Z3fooPU9__ptrauthILj3ELb1ELj234EEPi(
19 void foo(int * __ptrauth(3, 1, 234) *) {}
20
21 template <class T>
22 void foo(T t) {}
23
24 // CHECK: define weak_odr void @_Z3fooIPU9__ptrauthILj1ELb0ELj64EEPiEvT_(
25 template void foo<int * __ptrauth(1, 0, 64) *>(int * __ptrauth(1, 0, 64) *);
26