1 // RUN: %clang_cc1 -std=c++1y -fms-extensions -emit-llvm %s -o - -triple=i386-pc-win32 -fms-compatibility-version=19.00 | FileCheck -allow-deprecated-dag-overlap %s --check-prefix=CHECK --check-prefix=MSVC2015
2 // RUN: %clang_cc1 -std=c++1y -fms-extensions -emit-llvm %s -o - -triple=i386-pc-win32 -fms-compatibility-version=18.00 | FileCheck -allow-deprecated-dag-overlap %s --check-prefix=CHECK --check-prefix=MSVC2013
4 template <typename
> int x
= 0;
6 // CHECK-DAG: "??$x@X@@3HA"
7 template <> int x
<void>;
8 // CHECK-DAG: "??$x@H@@3HA"
9 template <> int x
<int>;
11 // CHECK-DAG: "?FunctionWithLocalType@@YA?A?<auto>@@XZ"
12 auto FunctionWithLocalType() {
17 // CHECK-DAG: "?ValueFromFunctionWithLocalType@@3ULocalType@?1??FunctionWithLocalType@@YA?A?<auto>@@XZ@A"
18 auto ValueFromFunctionWithLocalType
= FunctionWithLocalType();
20 // CHECK-DAG: "??R<lambda_0>@@QBE?A?<auto>@@XZ"
21 auto LambdaWithLocalType
= [] {
26 // CHECK-DAG: "?ValueFromLambdaWithLocalType@@3ULocalType@?1???R<lambda_0>@@QBE?A?<auto>@@XZ@A"
27 auto ValueFromLambdaWithLocalType
= LambdaWithLocalType();
30 auto TemplateFuncionWithLocalLambda(T
) {
31 auto LocalLambdaWithLocalType
= []() {
35 return LocalLambdaWithLocalType();
38 // MSVC2013-DAG: "?ValueFromTemplateFuncionWithLocalLambda@@3ULocalType@?2???R<lambda_1>@?0???$TemplateFuncionWithLocalLambda@H@@YA?A?<auto>@@H@Z@QBE?A?3@XZ@A"
39 // MSVC2013-DAG: "?ValueFromTemplateFuncionWithLocalLambda@@3ULocalType@?2???R<lambda_1>@?0???$TemplateFuncionWithLocalLambda@H@@YA?A?<auto>@@H@Z@QBE?A?3@XZ@A"
40 // MSVC2015-DAG: "?ValueFromTemplateFuncionWithLocalLambda@@3ULocalType@?1???R<lambda_1>@?0???$TemplateFuncionWithLocalLambda@H@@YA?A?<auto>@@H@Z@QBE?A?3@XZ@A"
41 // MSVC2015-DAG: "?ValueFromTemplateFuncionWithLocalLambda@@3ULocalType@?1???R<lambda_1>@?0???$TemplateFuncionWithLocalLambda@H@@YA?A?<auto>@@H@Z@QBE?A?3@XZ@A"
42 // CHECK-DAG: "??$TemplateFuncionWithLocalLambda@H@@YA?A?<auto>@@H@Z"
43 // CHECK-DAG: "??R<lambda_1>@?0???$TemplateFuncionWithLocalLambda@H@@YA?A?<auto>@@H@Z@QBE?A?1@XZ"
44 auto ValueFromTemplateFuncionWithLocalLambda
= TemplateFuncionWithLocalLambda(0);
50 template <> int WithPMD
<nullptr>;
51 // CHECK-DAG: "??$WithPMD@$GA@A@?0@@3HA"
53 template <const int *, const int *>
56 Foo
<&x
<int>, &x
<int>> Zoo
;
57 // CHECK-DAG: "?Zoo@@3U?$Foo@$1??$x@H@@3HA$1?1@3HA@@A"
59 template <typename T
> T unaligned_x
;
60 extern auto test_unaligned() { return unaligned_x
<int __unaligned
*>; }
61 // CHECK-DAG: "??$unaligned_x@PFAH@@3PFAHA"