1 // RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s
2 
3 // We emit "auto" for deduced return types for member functions but we should
4 // not emitting "auto" for deduced return types for lambdas call function which
5 // will be implmented as operator() in a class type. This test will verify that
6 // behavior.
7 
g()8 __attribute__((used)) int g() {
9   auto f = []() { return 10; };
10   return f();
11 }
12 
13 // g() is not a member function so we should not emit "auto" for the deduced
14 // return type.
15 //
16 // CHECK: !DISubprogram(name: "g",{{.*}}, type: ![[FUN_TYPE:[0-9]+]],{{.*}}
17 // CHECK: ![[FUN_TYPE]] = !DISubroutineType(types: ![[TYPE_NODE:[0-9]+]])
18 // CHECK: ![[TYPE_NODE]] = !{![[INT_TYPE:[0-9]+]]}
19 // CHECK: ![[INT_TYPE]] = !DIBasicType(name: "int", {{.*}})
20 
21 // operator() of the local lambda should have the same return type as g()
22 //
23 // CHECK: distinct !DISubprogram(name: "operator()",{{.*}}, type: ![[FUN_TYPE_LAMBDA:[0-9]+]],{{.*}}
24 // CHECK: ![[FUN_TYPE_LAMBDA]] = !DISubroutineType({{.*}}types: ![[TYPE_NODE_LAMBDA:[0-9]+]])
25 // CHECK: ![[TYPE_NODE_LAMBDA]] = !{![[INT_TYPE]], {{.*}}
26