2015-10-08 12:24:12 +08:00
|
|
|
// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s
|
2014-03-22 05:01:58 +08:00
|
|
|
// Test that the line table info for Foo<T>::bar() is pointing to the
|
|
|
|
// right header file.
|
2014-03-22 06:58:28 +08:00
|
|
|
// CHECK: define{{.*}}bar
|
2014-03-22 05:01:58 +08:00
|
|
|
// CHECK-NOT: define
|
2014-04-02 06:25:28 +08:00
|
|
|
// CHECK: ret {{.*}}, !dbg [[DBG:.*]]
|
2015-04-30 00:40:08 +08:00
|
|
|
// CHECK: [[HPP:.*]] = !DIFile(filename: "./template.hpp",
|
2015-08-27 06:50:48 +08:00
|
|
|
// CHECK: [[SP:.*]] = distinct !DISubprogram(name: "bar",
|
|
|
|
// CHECK-SAME: file: [[HPP]], line: 22
|
2018-11-29 05:18:07 +08:00
|
|
|
// CHECK-SAME: DISPFlagDefinition
|
2014-04-02 06:25:28 +08:00
|
|
|
// We shouldn't need a lexical block for this function.
|
2020-07-06 02:47:02 +08:00
|
|
|
// CHECK: [[DBG]] = !DILocation(line: 23, column: 3, scope: [[SP]])
|
2014-04-02 06:25:28 +08:00
|
|
|
|
|
|
|
|
2014-03-22 05:01:58 +08:00
|
|
|
# 1 "./template.h" 1
|
|
|
|
template <typename T>
|
|
|
|
class Foo {
|
|
|
|
public:
|
2014-03-25 05:19:34 +08:00
|
|
|
int bar();
|
2014-03-22 05:01:58 +08:00
|
|
|
};
|
|
|
|
# 21 "./template.hpp"
|
|
|
|
template <typename T>
|
|
|
|
int Foo<T>::bar() {
|
2014-03-25 05:19:34 +08:00
|
|
|
return 23;
|
2014-03-22 05:01:58 +08:00
|
|
|
}
|
|
|
|
int main (int argc, const char * argv[])
|
|
|
|
{
|
|
|
|
Foo<int> f;
|
2014-03-25 05:19:34 +08:00
|
|
|
return f.bar();
|
2014-03-22 05:01:58 +08:00
|
|
|
}
|