1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10.0.0 -fblocks -emit-llvm -o - %s -fexceptions -std=c++11 | FileCheck %s
2 
3 // CHECK-LABEL: define void @_ZN19non_inline_function3fooEv()
4 // CHECK-LABEL: define internal void @"_ZZN19non_inline_function3fooEvENK3$_0clEi"(%class.anon
5 // CHECK-LABEL: define internal signext i8 @"_ZZZN19non_inline_function3fooEvENK3$_0clEiENKUlcE_clEc"(%class.anon
6 namespace non_inline_function {
foo()7 void foo() {
8   auto L = [](int a) {
9     return [](char b) {
10      return b;
11     };
12   };
13   L(3)('a');
14 }
15 }
16 
17 namespace non_template {
18   struct L {
__anond416f5530402(int b) 19     int t = ([](int a) { return [](int b) { return b; };})(2)(3);
20   };
21   L l;
22 }
23 
24 namespace lambdas_in_NSDMIs_template_class {
25 template<class T>
26 struct L {
__anond416f5530602(int b) 27     T t2 = ([](int a) { return [](int b) { return b; };})(T{})(T{});
28 };
29 L<int> l;
30 }
31 
32 // CHECK-LABEL: define linkonce_odr i32 @_ZN15inline_function3fooEv
33 
34 // CHECK-LABEL: define linkonce_odr void @_ZNK12non_template1L1tMUliE_clEi(%class.anon
35 // CHECK-LABEL: define linkonce_odr i32 @_ZZNK12non_template1L1tMUliE_clEiENKUliE_clEi(%class.anon
36 
37 
38 // CHECK-LABEL: define linkonce_odr void @_ZNK32lambdas_in_NSDMIs_template_class1LIiEUliE_clEi(%class.anon
39 // CHECK-LABEL: define linkonce_odr i32 @_ZZNK32lambdas_in_NSDMIs_template_class1LIiEUliE_clEiENKUliE_clEi(%class.anon
40 
41 // CHECK-LABEL: define linkonce_odr void @_ZZN15inline_function3fooEvENKUliE_clEi
42 // CHECK-LABEL: define linkonce_odr signext i8 @_ZZZN15inline_function3fooEvENKUliE_clEiENKUlcE_clEc
43 namespace inline_function {
foo()44 inline int foo() {
45   auto L = [](int a) {
46     return [](char b) {
47      return b;
48     };
49   };
50   L(3)('a');
51 }
52 int use = foo();
53 }
54