2012-03-02 05:36:52 +08:00
|
|
|
// RUN: %clang_cc1 -triple x86_64-apple-darwin10.0.0 -emit-llvm -o - %s -fexceptions -std=c++11 -g | FileCheck %s
|
|
|
|
|
|
|
|
auto var = [](int i) { return i+1; };
|
2012-08-07 12:16:51 +08:00
|
|
|
void *use = &var;
|
2012-03-02 05:36:52 +08:00
|
|
|
|
|
|
|
extern "C" auto cvar = []{};
|
|
|
|
|
|
|
|
int a() { return []{ return 1; }(); }
|
|
|
|
|
|
|
|
int b(int x) { return [x]{return x;}(); }
|
|
|
|
|
|
|
|
int c(int x) { return [&x]{return x;}(); }
|
|
|
|
|
|
|
|
struct D { D(); D(const D&); int x; };
|
2013-08-10 01:20:05 +08:00
|
|
|
int d(int x) { D y[10]; return [x,y] { return y[x].x; }(); }
|
2012-03-02 05:36:52 +08:00
|
|
|
|
|
|
|
// Randomness for file. -- 6
|
2013-03-18 04:29:22 +08:00
|
|
|
// CHECK: [[FILE:.*]] = {{.*}} [ DW_TAG_file_type ] [{{.*}}debug-lambda-expressions.cpp]
|
2012-07-24 09:40:49 +08:00
|
|
|
|
|
|
|
// A: 10
|
2013-03-20 07:10:14 +08:00
|
|
|
// CHECK: [[A_FUNC:.*]] = {{.*}} [ DW_TAG_subprogram ] [line [[A_LINE:.*]]] [def] [a]
|
2012-03-02 05:36:52 +08:00
|
|
|
|
2012-07-24 09:40:49 +08:00
|
|
|
// B: 14
|
2013-03-20 07:10:14 +08:00
|
|
|
// CHECK: [[B_FUNC:.*]] = {{.*}} [ DW_TAG_subprogram ] [line [[B_LINE:.*]]] [def] [b]
|
2012-03-02 05:36:52 +08:00
|
|
|
|
|
|
|
// C: 17
|
2013-03-20 07:10:14 +08:00
|
|
|
// CHECK: [[C_FUNC:.*]] = {{.*}} [ DW_TAG_subprogram ] [line [[C_LINE:.*]]] [def] [c]
|
2012-03-02 05:36:52 +08:00
|
|
|
|
2012-07-24 09:40:49 +08:00
|
|
|
// D: 18
|
2013-03-20 07:10:14 +08:00
|
|
|
// CHECK: [[D_FUNC:.*]] = {{.*}} [ DW_TAG_subprogram ] [line [[D_LINE:.*]]] [def] [d]
|
2012-03-02 05:36:52 +08:00
|
|
|
|
2012-07-24 09:40:49 +08:00
|
|
|
// Back to D. -- 24
|
2013-08-27 06:40:31 +08:00
|
|
|
// CHECK: [[LAM_D:.*]] = {{.*}}, metadata [[D_FUNC]], {{.*}}, metadata [[LAM_D_ARGS:.*]], i32 0, null, null, null} ; [ DW_TAG_class_type ] [line [[D_LINE]],
|
2013-08-10 01:20:05 +08:00
|
|
|
// CHECK: [[LAM_D_ARGS]] = metadata !{metadata [[CAP_D_X:.*]], metadata [[CAP_D_Y:.*]], metadata [[CON_LAM_D:.*]]}
|
2013-03-20 07:10:14 +08:00
|
|
|
// CHECK: [[CAP_D_X]] = {{.*}}, metadata [[LAM_D]], {{.*}} [ DW_TAG_member ] [x] [line [[D_LINE]],
|
|
|
|
// CHECK: [[CAP_D_Y]] = {{.*}}, metadata [[LAM_D]], {{.*}} [ DW_TAG_member ] [y] [line [[D_LINE]],
|
|
|
|
// CHECK: [[CON_LAM_D]] = {{.*}}, metadata [[LAM_D]], {{.*}} [ DW_TAG_subprogram ] [line [[D_LINE]]] [operator()]
|
2012-03-02 05:36:52 +08:00
|
|
|
|
|
|
|
|
2012-07-24 09:40:49 +08:00
|
|
|
// Back to C. -- 55
|
2013-08-27 06:40:31 +08:00
|
|
|
// CHECK: [[LAM_C:.*]] = {{.*}}, metadata [[C_FUNC]], {{.*}}, metadata [[LAM_C_ARGS:.*]], i32 0, null, null, null} ; [ DW_TAG_class_type ] [line [[C_LINE]],
|
2013-08-10 01:20:05 +08:00
|
|
|
// CHECK: [[LAM_C_ARGS]] = metadata !{metadata [[CAP_C:.*]], metadata [[CON_LAM_C:.*]]}
|
2012-03-02 05:36:52 +08:00
|
|
|
// Ignoring the member type for now.
|
2013-03-20 07:10:14 +08:00
|
|
|
// CHECK: [[CAP_C]] = {{.*}}, metadata [[LAM_C]], {{.*}}} ; [ DW_TAG_member ] [x] [line [[C_LINE]],
|
|
|
|
// CHECK: [[CON_LAM_C]] = {{.*}}, metadata [[LAM_C]], {{.*}} [ DW_TAG_subprogram ] [line [[C_LINE]]] [operator()]
|
2012-03-02 05:36:52 +08:00
|
|
|
|
|
|
|
|
2012-07-24 09:40:49 +08:00
|
|
|
// Back to B. -- 67
|
2013-08-27 06:40:31 +08:00
|
|
|
// CHECK: [[LAM_B:.*]] = {{.*}}, metadata [[B_FUNC]], {{.*}}, metadata [[LAM_B_ARGS:.*]], i32 0, null, null, null} ; [ DW_TAG_class_type ] [line [[B_LINE]],
|
2013-08-10 01:20:05 +08:00
|
|
|
// CHECK: [[LAM_B_ARGS]] = metadata !{metadata [[CAP_B:.*]], metadata [[CON_LAM_B:.*]]}
|
2013-03-20 07:10:14 +08:00
|
|
|
// CHECK: [[CAP_B]] = {{.*}}, metadata [[LAM_B]], {{.*}}} ; [ DW_TAG_member ] [x] [line [[B_LINE]],
|
|
|
|
// CHECK: [[CON_LAM_B]] = {{.*}}, metadata [[LAM_B]], {{.*}} [ DW_TAG_subprogram ] [line [[B_LINE]]] [operator()]
|
2012-03-02 05:36:52 +08:00
|
|
|
|
2012-07-24 09:40:49 +08:00
|
|
|
// Back to A. -- 78
|
2013-08-27 06:40:31 +08:00
|
|
|
// CHECK: [[LAM_A:.*]] = {{.*}}, metadata [[A_FUNC]], {{.*}}, metadata [[LAM_A_ARGS:.*]], i32 0, null, null, null} ; [ DW_TAG_class_type ] [line [[A_LINE]],
|
2013-08-10 01:20:05 +08:00
|
|
|
// CHECK: [[LAM_A_ARGS]] = metadata !{metadata [[CON_LAM_A:.*]]}
|
2013-03-20 07:10:14 +08:00
|
|
|
// CHECK: [[CON_LAM_A]] = {{.*}}, metadata [[LAM_A]], {{.*}} [ DW_TAG_subprogram ] [line [[A_LINE]]] [operator()]
|
2012-03-02 05:36:52 +08:00
|
|
|
|
|
|
|
// CVAR:
|
2013-03-20 07:10:14 +08:00
|
|
|
// CHECK: {{.*}} metadata [[CVAR_T:![0-9]*]], {{.*}} ; [ DW_TAG_variable ] [cvar] [line [[CVAR_LINE:[0-9]*]]]
|
2013-08-27 06:40:31 +08:00
|
|
|
// CHECK: [[CVAR_T]] = {{.*}}, metadata ![[CVAR_ARGS:.*]], i32 0, null, null, null} ; [ DW_TAG_class_type ] [line [[CVAR_LINE]],
|
2013-08-10 01:20:05 +08:00
|
|
|
// CHECK: [[CVAR_ARGS]] = metadata !{metadata !{{.*}}}
|
2012-08-07 12:16:51 +08:00
|
|
|
|
|
|
|
// VAR:
|
2013-03-20 07:10:14 +08:00
|
|
|
// CHECK: {{.*}} metadata [[VAR_T:![0-9]*]], {{.*}} ; [ DW_TAG_variable ] [var] [line [[VAR_LINE:[0-9]*]]]
|
2013-08-27 06:40:31 +08:00
|
|
|
// CHECK: [[VAR_T]] = {{.*}}, metadata [[VAR_ARGS:![0-9]*]], i32 0, null, null, null} ; [ DW_TAG_class_type ] [line [[VAR_LINE]],
|
2013-08-10 01:20:05 +08:00
|
|
|
// CHECK: [[VAR_ARGS]] = metadata !{metadata !{{.*}}}
|