blob: 9a449874cb85e34718389d916d42b8172dcc2f4c [file] [log] [blame]
Faisal Vali49b4c1f2013-10-01 02:51:53 +00001// 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
6namespace non_inline_function {
7void foo() {
8 auto L = [](int a) {
9 return [](char b) {
10 return b;
11 };
12 };
13 L(3)('a');
14}
15}
16
17namespace non_template {
18 struct L {
19 int t = ([](int a) { return [](int b) { return b; };})(2)(3);
20 };
21 L l;
22}
23
24namespace lambdas_in_NSDMIs_template_class {
25template<class T>
26struct L {
27 T t2 = ([](int a) { return [](int b) { return b; };})(T{})(T{});
28};
29L<int> l;
30}
31
32// CHECK-LABEL: define linkonce_odr i32 @_ZN15inline_function3fooEv
Rafael Espindolae5df59f2015-01-22 00:24:57 +000033
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
Rafael Espindola701d2dd2015-01-21 23:33:55 +000041// CHECK-LABEL: define linkonce_odr void @_ZZN15inline_function3fooEvENKUliE_clEi
42// CHECK-LABEL: define linkonce_odr signext i8 @_ZZZN15inline_function3fooEvENKUliE_clEiENKUlcE_clEc
Faisal Vali49b4c1f2013-10-01 02:51:53 +000043namespace inline_function {
44inline int foo() {
45 auto L = [](int a) {
46 return [](char b) {
47 return b;
48 };
49 };
50 L(3)('a');
51}
52int use = foo();
53}