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-03-04 01:25:55 +08:00
|
|
|
// CHECK: [[HPP:.*]] = !MDFile(filename: "./template.hpp",
|
|
|
|
// CHECK: [[SP:.*]] = !MDSubprogram(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-01-15 06:28:03 +08:00
|
|
|
// CHECK: [[DBG]] = !MDLocation(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
|
|
|
}
|