36 lines · plain
1// RUN: %clang_cc1 -triple arm64-apple-ios11 -fptrauth-calls -fptrauth-intrinsics -std=c++11 -fobjc-arc -emit-llvm -o - %s | FileCheck %s2 3#define AQ __ptrauth(1,1,50)4 5struct AddrDiscStrong0 {6 int * AQ f0; // Signed using address discrimination.7 __strong id f1;8};9 10struct AddrDiscStrong1 {11 AddrDiscStrong1(const AddrDiscStrong1 &);12 int * AQ f0; // Signed using address discrimination.13 __strong id f1;14};15 16// Check that AddrDiscStrong0 is destructed in the callee.17 18// CHECK: define void @_Z24testParamAddrDiscStrong015AddrDiscStrong0(ptr dead_on_return noundef %[[A:.*]])19// CHECK: call noundef ptr @_ZN15AddrDiscStrong0D1Ev(ptr noundef nonnull align {{[0-9]+}} dereferenceable(16) %[[A]])20// CHECK: ret void21 22// CHECK: define linkonce_odr noundef ptr @_ZN15AddrDiscStrong0D1Ev(23 24void testParamAddrDiscStrong0(AddrDiscStrong0 a) {25}26 27// Check that AddrDiscStrong1 is not destructed in the callee because it has a28// non-trivial copy constructor.29 30// CHECK: define void @_Z24testParamAddrDiscStrong115AddrDiscStrong1(ptr noundef %{{.*}})31// CHECK-NOT: call32// CHECK: ret void33 34void testParamAddrDiscStrong1(AddrDiscStrong1 a) {35}36