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:.*]]
|
|
|
|
// CHECK: [[HPP:.*]] = metadata !{metadata !"./template.hpp",
|
2014-04-02 06:54:59 +08:00
|
|
|
// CHECK: [[SP:.*]] = metadata !{i32 786478, metadata [[HPP]],{{.*}}[ DW_TAG_subprogram ] [line 22] [def] [bar]
|
2014-04-02 06:25:28 +08:00
|
|
|
// We shouldn't need a lexical block for this function.
|
|
|
|
// CHECK: [[DBG]] = metadata !{i32 23, i32 0, metadata [[SP]], null}
|
|
|
|
|
|
|
|
|
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
|
|
|
}
|