Home | History | Annotate | Download | only in CodeGenCXX
      1 // 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
      2 // 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
      3 
      4 template <typename> int x = 0;
      5 
      6 // CHECK-DAG: "\01??$x@X@@3HA"
      7 template <> int x<void>;
      8 // CHECK-DAG: "\01??$x@H@@3HA"
      9 template <> int x<int>;
     10 
     11 // CHECK-DAG: "\01?FunctionWithLocalType@@YA?A?<auto>@@XZ"
     12 auto FunctionWithLocalType() {
     13   struct LocalType {};
     14   return LocalType{};
     15 }
     16 
     17 // CHECK-DAG: "\01?ValueFromFunctionWithLocalType@@3ULocalType@?1??FunctionWithLocalType@@YA?A?<auto>@@XZ@A"
     18 auto ValueFromFunctionWithLocalType = FunctionWithLocalType();
     19 
     20 // CHECK-DAG: "\01??R<lambda_0>@@QBE?A?<auto>@@XZ"
     21 auto LambdaWithLocalType = [] {
     22   struct LocalType {};
     23   return LocalType{};
     24 };
     25 
     26 // CHECK-DAG: "\01?ValueFromLambdaWithLocalType@@3ULocalType@?1???R<lambda_0>@@QBE?A?<auto>@@XZ@A"
     27 auto ValueFromLambdaWithLocalType = LambdaWithLocalType();
     28 
     29 template <typename T>
     30 auto TemplateFuncionWithLocalLambda(T) {
     31   auto LocalLambdaWithLocalType = []() {
     32     struct LocalType {};
     33     return LocalType{};
     34   };
     35   return LocalLambdaWithLocalType();
     36 }
     37 
     38 // MSVC2013-DAG: "\01?ValueFromTemplateFuncionWithLocalLambda@@3ULocalType@?2???R<lambda_1>@??$TemplateFuncionWithLocalLambda@H@@YA?A?<auto>@@H@Z@QBE?A?3@XZ@A"
     39 // MSVC2013-DAG: "\01?ValueFromTemplateFuncionWithLocalLambda@@3ULocalType@?2???R<lambda_1>@??$TemplateFuncionWithLocalLambda@H@@YA?A?<auto>@@H@Z@QBE?A?3@XZ@A"
     40 // MSVC2015-DAG: "\01?ValueFromTemplateFuncionWithLocalLambda@@3ULocalType@?1???R<lambda_1>@??$TemplateFuncionWithLocalLambda@H@@YA?A?<auto>@@H@Z@QBE?A?3@XZ@A"
     41 // MSVC2015-DAG: "\01?ValueFromTemplateFuncionWithLocalLambda@@3ULocalType@?1???R<lambda_1>@??$TemplateFuncionWithLocalLambda@H@@YA?A?<auto>@@H@Z@QBE?A?3@XZ@A"
     42 // CHECK-DAG: "\01??$TemplateFuncionWithLocalLambda@H@@YA?A?<auto>@@H@Z"
     43 // CHECK-DAG: "\01??R<lambda_1>@??$TemplateFuncionWithLocalLambda@H@@YA?A?<auto>@@H@Z@QBE?A?1@XZ"
     44 auto ValueFromTemplateFuncionWithLocalLambda = TemplateFuncionWithLocalLambda(0);
     45 
     46 struct S;
     47 template <int S::*>
     48 int WithPMD = 0;
     49 
     50 template <> int WithPMD<nullptr>;
     51 // CHECK-DAG: "\01??$WithPMD@$GA@A@?0@@3HA"
     52