2014-03-22 05:01:58 +08:00
|
|
|
// RUN: %clang_cc1 -emit-llvm -g %s -o - | FileCheck %s
|
|
|
|
// 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
|
|
|
|
// CHECK-SAME: isDefinition: true
|
2014-04-02 06:25:28 +08:00
|
|
|
// We shouldn't need a lexical block for this function.
|
2015-04-30 00:40:08 +08:00
|
|
|
// CHECK: [[DBG]] = !DILocation(line: 23, 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
|
|
|
}
|