brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 155b766 Raw
27 lines · cpp
1// RUN: %clang_cc1 -std=c++11 -fptrauth-intrinsics -fptrauth-calls -emit-llvm -o - -triple=arm64-apple-ios %s | FileCheck %s2// RUN: %clang_cc1 -std=c++11 -fptrauth-intrinsics -fptrauth-calls -emit-llvm -o - -triple=aarch64-linux-gnu %s | FileCheck %s3// RUN: %clang_cc1 -std=c++11 -fptrauth-intrinsics -fptrauth-calls -emit-llvm -o - -triple=arm64-apple-ios -fclang-abi-compat=4 %s | FileCheck %s4 5// clang previously emitted an incorrect discriminator for the member function6// 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 89namespace test_substitution {10struct S { int f(void *, void *); };11 12typedef int (S::*s_func)(void *, void *);13 14s_func funcs[] = { (s_func)(&S::f) };15}16 17 18// CHECK: define {{.*}}void @_Z3fooPU9__ptrauthILj3ELb1ELj234EEPi(19void foo(int * __ptrauth(3, 1, 234) *) {}20 21template <class T>22void foo(T t) {}23 24// CHECK: define weak_odr void @_Z3fooIPU9__ptrauthILj1ELb0ELj64EEPiEvT_(25template void foo<int * __ptrauth(1, 0, 64) *>(int * __ptrauth(1, 0, 64) *);26 27