blob: c06efe2edee9b5a66577021bd37a6f520891953c [file] [log] [blame]
David Majnemer8f774532014-03-04 05:38:05 +00001// RUN: %clang_cc1 -std=c++1y -fms-extensions -emit-llvm %s -o - -triple=i386-pc-win32 | FileCheck %s
2
3template <typename> int x = 0;
4
5// CHECK: "\01??$x@X@@3HA"
6template <> int x<void>;
7// CHECK: "\01??$x@H@@3HA"
8template <> int x<int>;
David Majnemer2e1e04912014-04-01 05:29:46 +00009
10// CHECK: "\01?FunctionWithLocalType@@YA?A?<auto>@@XZ"
11auto FunctionWithLocalType() {
12 struct LocalType {};
13 return LocalType{};
14}
15
David Majnemer040fa342014-10-05 06:44:53 +000016// CHECK: "\01?ValueFromFunctionWithLocalType@@3ULocalType@?1??FunctionWithLocalType@@YA?A?<auto>@@XZ@A"
David Majnemer2e1e04912014-04-01 05:29:46 +000017auto ValueFromFunctionWithLocalType = FunctionWithLocalType();
18
19// CHECK: "\01??R<lambda_0>@@QBE?A?<auto>@@XZ"
20auto LambdaWithLocalType = [] {
21 struct LocalType {};
22 return LocalType{};
23};
24
David Majnemer040fa342014-10-05 06:44:53 +000025// CHECK: "\01?ValueFromLambdaWithLocalType@@3ULocalType@?1???R<lambda_0>@@QBE?A?<auto>@@XZ@A"
David Majnemer2e1e04912014-04-01 05:29:46 +000026auto ValueFromLambdaWithLocalType = LambdaWithLocalType();
27
28template <typename T>
29auto TemplateFuncionWithLocalLambda(T) {
30 auto LocalLambdaWithLocalType = []() {
31 struct LocalType {};
32 return LocalType{};
33 };
34 return LocalLambdaWithLocalType();
35}
36
37// CHECK: "\01?ValueFromTemplateFuncionWithLocalLambda@@3ULocalType@?2???R<lambda_1>@??$TemplateFuncionWithLocalLambda@H@@YA?A?<auto>@@H@Z@QBA?A?3@XZ@A"
38// CHECK: "\01??$TemplateFuncionWithLocalLambda@H@@YA?A?<auto>@@H@Z"
39// CHECK: "\01??R<lambda_1>@??$TemplateFuncionWithLocalLambda@H@@YA?A?<auto>@@H@Z@QBA?A?1@XZ"
40auto ValueFromTemplateFuncionWithLocalLambda = TemplateFuncionWithLocalLambda(0);