[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / CodeGenCXX / mangle-lambdas-cxx14.cpp
blobfbecc6cf6ab924a9e942624013b1ee3ca2308f76
1 // RUN: %clang_cc1 -std=c++14 -triple x86_64-apple-macosx10.7.0 -emit-llvm -o - %s -w | FileCheck %s
3 template<typename T = int>
4 auto ft1() {
5 return [](int p = [] { return 0; } ()) { return p; };
7 void test_ft1() {
8 // CHECK: call noundef i32 @_ZZZ3ft1IiEDavENKUliE_clEiEd_NKUlvE_clEv
9 // CHECK: call noundef i32 @_ZZ3ft1IiEDavENKUliE_clEi
10 ft1<>()();
12 // CHECK-LABEL: define linkonce_odr noundef i32 @_ZZ3ft1IiEDavENKUliE_clEi
13 // CHECK-LABEL: define linkonce_odr noundef i32 @_ZZZ3ft1IiEDavENKUliE_clEiEd_NKUlvE_clEv
15 template <typename T>
16 auto ft2() {
17 struct S {
18 T operator()(T p = []{ return 0; }()) const { return p; }
20 return S{};
22 void test_ft2() {
23 // CHECK: call noundef i32 @_ZZZ3ft2IiEDavENK1SclEiEd_NKUlvE_clEv
24 // CHECK: call noundef i32 @_ZZ3ft2IiEDavENK1SclEi
25 ft2<int>()();
27 // CHECK-LABEL: define linkonce_odr noundef i32 @_ZZ3ft2IiEDavENK1SclEi
28 // CHECK-LABEL: define linkonce_odr noundef i32 @_ZZZ3ft2IiEDavENK1SclEiEd_NKUlvE_clEv
30 template <typename>
31 auto vt1 = [](int p = [] { return 0; } ()) { return p; };
32 void test_vt1() {
33 // CHECK: call noundef i32 @_ZZNK3vt1IiEMUliE_clEiEd_NKUlvE_clEv
34 // CHECK: call noundef i32 @_ZNK3vt1IiEMUliE_clEi
35 vt1<int>();
37 // CHECK-LABEL: define linkonce_odr noundef i32 @_ZNK3vt1IiEMUliE_clEi
38 // CHECK-LABEL: define linkonce_odr noundef i32 @_ZZNK3vt1IiEMUliE_clEiEd_NKUlvE_clEv