2018-02-09 11:23:54 +08:00
|
|
|
// RUN: %clang_cc1 -triple thumbv7-windows-msvc -fobjc-runtime=ios-6.0 -fobjc-arc -o - -emit-llvm %s | FileCheck %s
|
|
|
|
|
|
|
|
@protocol P;
|
|
|
|
@protocol Q;
|
|
|
|
|
|
|
|
@class I;
|
2018-09-29 00:47:53 +08:00
|
|
|
@class J<T>;
|
2018-02-09 11:23:54 +08:00
|
|
|
|
|
|
|
void f(id<P>, id, id<P>, id) {}
|
2018-10-05 03:50:14 +08:00
|
|
|
// CHECK-LABEL: "?f@@YAXPAU?$objc_object@U?$Protocol@UP@@@__ObjC@@@@PAUobjc_object@@01@Z"
|
2018-02-09 11:23:54 +08:00
|
|
|
|
|
|
|
void f(id, id<P>, id<P>, id) {}
|
2018-10-05 03:50:14 +08:00
|
|
|
// CHECK-LABEL: "?f@@YAXPAUobjc_object@@PAU?$objc_object@U?$Protocol@UP@@@__ObjC@@@@10@Z"
|
2018-02-09 11:23:54 +08:00
|
|
|
|
|
|
|
void f(id<P>, id<P>) {}
|
2018-10-05 03:50:14 +08:00
|
|
|
// CHECK-LABEL: "?f@@YAXPAU?$objc_object@U?$Protocol@UP@@@__ObjC@@@@0@Z"
|
2018-02-09 11:23:54 +08:00
|
|
|
|
|
|
|
void f(id<P>) {}
|
2018-10-05 03:50:14 +08:00
|
|
|
// CHECK-LABEL: "?f@@YAXPAU?$objc_object@U?$Protocol@UP@@@__ObjC@@@@@Z"
|
2018-02-09 11:23:54 +08:00
|
|
|
|
|
|
|
void f(id<P, Q>) {}
|
2018-10-05 03:50:14 +08:00
|
|
|
// CHECK-LABEL: "?f@@YAXPAU?$objc_object@U?$Protocol@UP@@@__ObjC@@U?$Protocol@UQ@@@2@@@@Z"
|
2018-02-09 11:23:54 +08:00
|
|
|
|
|
|
|
void f(Class<P>) {}
|
2018-10-05 03:50:14 +08:00
|
|
|
// CHECK-LABEL: "?f@@YAXPAU?$objc_class@U?$Protocol@UP@@@__ObjC@@@@@Z"
|
2018-02-09 11:23:54 +08:00
|
|
|
|
|
|
|
void f(Class<P, Q>) {}
|
2018-10-05 03:50:14 +08:00
|
|
|
// CHECK-LABEL: "?f@@YAXPAU?$objc_class@U?$Protocol@UP@@@__ObjC@@U?$Protocol@UQ@@@2@@@@Z"
|
2018-02-09 11:23:54 +08:00
|
|
|
|
|
|
|
void f(I<P> *) {}
|
2018-10-05 03:50:14 +08:00
|
|
|
// CHECK-LABEL: "?f@@YAXPAU?$I@U?$Protocol@UP@@@__ObjC@@@@@Z"
|
2018-02-09 11:23:54 +08:00
|
|
|
|
|
|
|
void f(I<P, Q> *) {}
|
2018-10-05 03:50:14 +08:00
|
|
|
// CHECK-LABEL: "?f@@YAXPAU?$I@U?$Protocol@UP@@@__ObjC@@U?$Protocol@UQ@@@2@@@@Z"
|
2018-02-09 11:23:54 +08:00
|
|
|
|
|
|
|
template <typename>
|
|
|
|
struct S {};
|
|
|
|
|
|
|
|
void f(S<__unsafe_unretained id>) {}
|
2018-10-05 03:50:14 +08:00
|
|
|
// CHECK-LABEL: "?f@@YAXU?$S@PAUobjc_object@@@@@Z"
|
2018-02-09 11:23:54 +08:00
|
|
|
|
|
|
|
void f(S<__autoreleasing id>) {}
|
2018-10-05 03:50:14 +08:00
|
|
|
// CHECK-LABEL: "?f@@YAXU?$S@U?$Autoreleasing@PAUobjc_object@@@__ObjC@@@@@Z"
|
2018-02-09 11:23:54 +08:00
|
|
|
|
|
|
|
void f(S<__strong id>) {}
|
2018-10-05 03:50:14 +08:00
|
|
|
// CHECK-LABEL: "?f@@YAXU?$S@U?$Strong@PAUobjc_object@@@__ObjC@@@@@Z"
|
2018-02-09 11:23:54 +08:00
|
|
|
|
|
|
|
void f(S<__weak id>) {}
|
2018-10-05 03:50:14 +08:00
|
|
|
// CHECK-LABEL: "?f@@YAXU?$S@U?$Weak@PAUobjc_object@@@__ObjC@@@@@Z"
|
2018-02-09 11:23:54 +08:00
|
|
|
|
|
|
|
void w(__weak id) {}
|
2018-10-05 03:50:14 +08:00
|
|
|
// CHECK-LABEL: "?w@@YAXPAUobjc_object@@@Z"
|
2018-02-09 11:23:54 +08:00
|
|
|
|
|
|
|
void s(__strong id) {}
|
2018-10-05 03:50:14 +08:00
|
|
|
// CHECK-LABEL: "?s@@YAXPAUobjc_object@@@Z"
|
2018-02-09 11:23:54 +08:00
|
|
|
|
|
|
|
void a(__autoreleasing id) {}
|
2018-10-05 03:50:14 +08:00
|
|
|
// CHECK-LABEL: "?a@@YAXPAUobjc_object@@@Z"
|
2018-02-09 11:23:54 +08:00
|
|
|
|
|
|
|
void u(__unsafe_unretained id) {}
|
2018-10-05 03:50:14 +08:00
|
|
|
// CHECK-LABEL: "?u@@YAXPAUobjc_object@@@Z"
|
2018-02-09 11:23:54 +08:00
|
|
|
|
|
|
|
S<__autoreleasing id> g() { return S<__autoreleasing id>(); }
|
2018-10-05 03:50:14 +08:00
|
|
|
// CHECK-LABEL: "?g@@YA?AU?$S@U?$Autoreleasing@PAUobjc_object@@@__ObjC@@@@XZ"
|
2018-02-09 11:23:54 +08:00
|
|
|
|
|
|
|
__autoreleasing id h() { return nullptr; }
|
2018-10-05 03:50:14 +08:00
|
|
|
// CHECK-LABEL: "?h@@YAPAUobjc_object@@XZ"
|
2018-09-29 00:47:53 +08:00
|
|
|
|
|
|
|
void f(I *) {}
|
2018-10-05 03:50:14 +08:00
|
|
|
// CHECK-LABEL: "?f@@YAXPAUI@@@Z"
|
2018-09-29 00:47:53 +08:00
|
|
|
|
|
|
|
void f(__kindof I *) {}
|
2018-10-05 03:50:14 +08:00
|
|
|
// CHECK-LABEL: "?f@@YAXPAU?$KindOf@UI@@@__ObjC@@@Z"
|
2018-09-29 00:47:53 +08:00
|
|
|
|
|
|
|
void f(__kindof I<P> *) {}
|
2018-10-05 03:50:14 +08:00
|
|
|
// CHECK-LABEL: "?f@@YAXPAU?$KindOf@U?$I@U?$Protocol@UP@@@__ObjC@@@@@__ObjC@@@Z"
|
2018-09-29 00:47:53 +08:00
|
|
|
|
|
|
|
void f(S<I *>) {}
|
2018-10-05 03:50:14 +08:00
|
|
|
// CHECK-LABEL: "?f@@YAXU?$S@U?$Strong@PAUI@@@__ObjC@@@@@Z"
|
2018-09-29 00:47:53 +08:00
|
|
|
|
|
|
|
void f(S<__kindof I *>) {}
|
2018-10-05 03:50:14 +08:00
|
|
|
// CHECK-LABEL: "?f@@YAXU?$S@U?$Strong@PAU?$KindOf@UI@@@__ObjC@@@__ObjC@@@@@Z"
|
2018-09-29 00:47:53 +08:00
|
|
|
|
|
|
|
void f(S<__kindof I<P> *>) {}
|
2018-10-05 03:50:14 +08:00
|
|
|
// CHECK-LABEL: "?f@@YAXU?$S@U?$Strong@PAU?$KindOf@U?$I@U?$Protocol@UP@@@__ObjC@@@@@__ObjC@@@__ObjC@@@@@Z"
|
2018-09-29 00:47:53 +08:00
|
|
|
|
|
|
|
void f(S<__weak __kindof I *>) {}
|
2018-10-05 03:50:14 +08:00
|
|
|
// CHECK-LABEL: "?f@@YAXU?$S@U?$Weak@PAU?$KindOf@UI@@@__ObjC@@@__ObjC@@@@@Z"
|
2018-09-29 00:47:53 +08:00
|
|
|
|
|
|
|
void f(S<__weak __kindof I<P> *>) {}
|
2018-10-05 03:50:14 +08:00
|
|
|
// CHECK-LABEL: "?f@@YAXU?$S@U?$Weak@PAU?$KindOf@U?$I@U?$Protocol@UP@@@__ObjC@@@@@__ObjC@@@__ObjC@@@@@Z"
|
2018-09-29 00:47:53 +08:00
|
|
|
|
|
|
|
void f(J<I *> *) {}
|
2018-10-05 03:50:14 +08:00
|
|
|
// CHECK-LABEL: "?f@@YAXPAU?$J@PAUI@@@@@Z"
|
2018-09-29 00:47:53 +08:00
|
|
|
|
|
|
|
void f(J<__kindof I *> *) {}
|
2018-10-05 03:50:14 +08:00
|
|
|
// CHECK-LABEL: "?f@@YAXPAU?$J@PAU?$KindOf@UI@@@__ObjC@@@@@Z"
|