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;
|
|
|
|
|
|
|
|
void f(id<P>, id, id<P>, id) {}
|
2018-03-17 04:36:49 +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-03-17 04:36:49 +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-03-17 04:36:49 +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-03-17 04:36:49 +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-03-17 04:36:49 +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-03-17 04:36:49 +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-03-17 04:36:49 +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-03-17 04:36:49 +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-03-17 04:36:49 +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-03-17 04:36:49 +08:00
|
|
|
// CHECK-LABEL: "?f@@YAXU?$S@PAUobjc_object@@@@@Z"
|
2018-02-09 11:23:54 +08:00
|
|
|
|
|
|
|
void f(S<__autoreleasing id>) {}
|
2018-03-17 04:36:49 +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-03-17 04:36:49 +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-03-17 04:36:49 +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-03-17 04:36:49 +08:00
|
|
|
// CHECK-LABEL: "?w@@YAXPAUobjc_object@@@Z"
|
2018-02-09 11:23:54 +08:00
|
|
|
|
|
|
|
void s(__strong id) {}
|
2018-03-17 04:36:49 +08:00
|
|
|
// CHECK-LABEL: "?s@@YAXPAUobjc_object@@@Z"
|
2018-02-09 11:23:54 +08:00
|
|
|
|
|
|
|
void a(__autoreleasing id) {}
|
2018-03-17 04:36:49 +08:00
|
|
|
// CHECK-LABEL: "?a@@YAXPAUobjc_object@@@Z"
|
2018-02-09 11:23:54 +08:00
|
|
|
|
|
|
|
void u(__unsafe_unretained id) {}
|
2018-03-17 04:36:49 +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-03-17 04:36:49 +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-03-17 04:36:49 +08:00
|
|
|
// CHECK-LABEL: "?h@@YAPAUobjc_object@@XZ"
|