2015-03-20 05:54:30 +08:00
|
|
|
// RUN: %clang_cc1 -std=c++1y -fms-extensions -emit-llvm %s -o - -triple=i386-pc-win32 -fms-compatibility-version=19.00 | FileCheck %s --check-prefix=CHECK --check-prefix=MSVC2015
|
|
|
|
// RUN: %clang_cc1 -std=c++1y -fms-extensions -emit-llvm %s -o - -triple=i386-pc-win32 -fms-compatibility-version=18.00 | FileCheck %s --check-prefix=CHECK --check-prefix=MSVC2013
|
2014-03-04 13:38:05 +08:00
|
|
|
|
|
|
|
template <typename> int x = 0;
|
|
|
|
|
2015-12-02 03:13:51 +08:00
|
|
|
// CHECK-DAG: "\01??$x@X@@3HA"
|
2014-03-04 13:38:05 +08:00
|
|
|
template <> int x<void>;
|
2015-12-02 03:13:51 +08:00
|
|
|
// CHECK-DAG: "\01??$x@H@@3HA"
|
2014-03-04 13:38:05 +08:00
|
|
|
template <> int x<int>;
|
2014-04-01 13:29:46 +08:00
|
|
|
|
2015-12-02 03:13:51 +08:00
|
|
|
// CHECK-DAG: "\01?FunctionWithLocalType@@YA?A?<auto>@@XZ"
|
2014-04-01 13:29:46 +08:00
|
|
|
auto FunctionWithLocalType() {
|
|
|
|
struct LocalType {};
|
|
|
|
return LocalType{};
|
|
|
|
}
|
|
|
|
|
2015-12-02 03:13:51 +08:00
|
|
|
// CHECK-DAG: "\01?ValueFromFunctionWithLocalType@@3ULocalType@?1??FunctionWithLocalType@@YA?A?<auto>@@XZ@A"
|
2014-04-01 13:29:46 +08:00
|
|
|
auto ValueFromFunctionWithLocalType = FunctionWithLocalType();
|
|
|
|
|
2015-12-02 03:13:51 +08:00
|
|
|
// CHECK-DAG: "\01??R<lambda_0>@@QBE?A?<auto>@@XZ"
|
2014-04-01 13:29:46 +08:00
|
|
|
auto LambdaWithLocalType = [] {
|
|
|
|
struct LocalType {};
|
|
|
|
return LocalType{};
|
|
|
|
};
|
|
|
|
|
2015-12-02 03:13:51 +08:00
|
|
|
// CHECK-DAG: "\01?ValueFromLambdaWithLocalType@@3ULocalType@?1???R<lambda_0>@@QBE?A?<auto>@@XZ@A"
|
2014-04-01 13:29:46 +08:00
|
|
|
auto ValueFromLambdaWithLocalType = LambdaWithLocalType();
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
auto TemplateFuncionWithLocalLambda(T) {
|
|
|
|
auto LocalLambdaWithLocalType = []() {
|
|
|
|
struct LocalType {};
|
|
|
|
return LocalType{};
|
|
|
|
};
|
|
|
|
return LocalLambdaWithLocalType();
|
|
|
|
}
|
|
|
|
|
2015-04-02 04:22:13 +08:00
|
|
|
// MSVC2013-DAG: "\01?ValueFromTemplateFuncionWithLocalLambda@@3ULocalType@?2???R<lambda_1>@??$TemplateFuncionWithLocalLambda@H@@YA?A?<auto>@@H@Z@QBE?A?3@XZ@A"
|
|
|
|
// MSVC2013-DAG: "\01?ValueFromTemplateFuncionWithLocalLambda@@3ULocalType@?2???R<lambda_1>@??$TemplateFuncionWithLocalLambda@H@@YA?A?<auto>@@H@Z@QBE?A?3@XZ@A"
|
|
|
|
// MSVC2015-DAG: "\01?ValueFromTemplateFuncionWithLocalLambda@@3ULocalType@?1???R<lambda_1>@??$TemplateFuncionWithLocalLambda@H@@YA?A?<auto>@@H@Z@QBE?A?3@XZ@A"
|
|
|
|
// MSVC2015-DAG: "\01?ValueFromTemplateFuncionWithLocalLambda@@3ULocalType@?1???R<lambda_1>@??$TemplateFuncionWithLocalLambda@H@@YA?A?<auto>@@H@Z@QBE?A?3@XZ@A"
|
2015-12-02 03:13:51 +08:00
|
|
|
// CHECK-DAG: "\01??$TemplateFuncionWithLocalLambda@H@@YA?A?<auto>@@H@Z"
|
|
|
|
// CHECK-DAG: "\01??R<lambda_1>@??$TemplateFuncionWithLocalLambda@H@@YA?A?<auto>@@H@Z@QBE?A?1@XZ"
|
2014-04-01 13:29:46 +08:00
|
|
|
auto ValueFromTemplateFuncionWithLocalLambda = TemplateFuncionWithLocalLambda(0);
|
2015-12-02 03:13:51 +08:00
|
|
|
|
|
|
|
struct S;
|
|
|
|
template <int S::*>
|
|
|
|
int WithPMD = 0;
|
|
|
|
|
|
|
|
template <> int WithPMD<nullptr>;
|
|
|
|
// CHECK-DAG: "\01??$WithPMD@$GA@A@?0@@3HA"
|
2015-12-30 13:40:32 +08:00
|
|
|
|
|
|
|
template <const int *, const int *>
|
|
|
|
struct Foo {};
|
|
|
|
|
|
|
|
Foo<&x<int>, &x<int>> Zoo;
|
|
|
|
// CHECK-DAG: "\01?Zoo@@3U?$Foo@$1??$x@H@@3HA$1?1@3HA@@A"
|