Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGenCXX / mangle-ms-auto-templates.cpp
blobc17f5f5e4477f9e4038b21deac1e6859bd8d4578
1 // RUN: %clang_cc1 -std=c++17 -fms-compatibility-version=19.20 -emit-llvm %s -o - -fms-extensions -fdelayed-template-parsing -triple=x86_64-pc-windows-msvc | FileCheck --check-prefix=AFTER %s
2 // RUN: %clang_cc1 -std=c++17 -fms-compatibility-version=19.14 -emit-llvm %s -o - -fms-extensions -fdelayed-template-parsing -triple=x86_64-pc-windows-msvc | FileCheck --check-prefix=BEFORE %s
4 template <auto a>
5 class AutoParmTemplate {
6 public:
7 AutoParmTemplate() {}
8 };
10 template <auto...>
11 class AutoParmsTemplate {
12 public:
13 AutoParmsTemplate() {}
16 template <auto a>
17 auto AutoFunc() {
18 return a;
21 void template_mangling() {
22 AutoFunc<1>();
23 // AFTER: call {{.*}} @"??$AutoFunc@$MH00@@YA?A?<auto>@@XZ"
24 // BEFORE: call {{.*}} @"??$AutoFunc@$00@@YA?A?<auto>@@XZ"
25 AutoParmTemplate<0> auto_int;
26 // AFTER: call {{.*}} @"??0?$AutoParmTemplate@$MH0A@@@QEAA@XZ"
27 // BEFORE: call {{.*}} @"??0?$AutoParmTemplate@$0A@@@QEAA@XZ"
28 AutoParmTemplate<'a'> auto_char;
29 // AFTER: call {{.*}} @"??0?$AutoParmTemplate@$MD0GB@@@QEAA@XZ"
30 // BEFORE: call {{.*}} @"??0?$AutoParmTemplate@$0GB@@@QEAA@XZ"
31 AutoParmTemplate<9223372036854775807LL> int64_max;
32 // AFTER: call {{.*}} @"??0?$AutoParmTemplate@$M_J0HPPPPPPPPPPPPPPP@@@QEAA@XZ"
33 // BEFORE: call {{.*}} @"??0?$AutoParmTemplate@$0HPPPPPPPPPPPPPPP@@@QEAA@XZ"
34 AutoParmTemplate<-9223372036854775807LL - 1LL> int64_min;
35 // AFTER: call {{.*}} @"??0?$AutoParmTemplate@$M_J0?IAAAAAAAAAAAAAAA@@@QEAA@XZ"
36 // BEFORE: call {{.*}} @"??0?$AutoParmTemplate@$0?IAAAAAAAAAAAAAAA@@@QEAA@XZ"
37 AutoParmTemplate<(unsigned long long)-1> uint64_neg_1;
38 // AFTER: call {{.*}} @"??0?$AutoParmTemplate@$M_K0?0@@QEAA@XZ"
39 // BEFORE: call {{.*}} @"??0?$AutoParmTemplate@$0?0@@QEAA@XZ"
41 AutoParmsTemplate<0, false, 'a'> c1;
42 // AFTER: call {{.*}} @"??0?$AutoParmsTemplate@$MH0A@$M_N0A@$MD0GB@@@QEAA@XZ"
43 // BEFORE: call {{.*}} @"??0?$AutoParmsTemplate@$0A@$0A@$0GB@@@QEAA@XZ"
44 AutoParmsTemplate<(unsigned long)1, 9223372036854775807LL> c2;
45 // AFTER: call {{.*}} @"??0?$AutoParmsTemplate@$MK00$M_J0HPPPPPPPPPPPPPPP@@@QEAA@XZ"
46 // BEFORE: call {{.*}} @"??0?$AutoParmsTemplate@$00$0HPPPPPPPPPPPPPPP@@@QEAA@XZ"