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
|
|
|
|
// CHECK: ret {{.*}}, !dbg ![[DBG:.*]]
|
2014-03-25 05:19:34 +08:00
|
|
|
// CHECK: ![[HPP:.*]] = metadata !{metadata !"./template.hpp",
|
|
|
|
// CHECK: ![[DBG]] = metadata !{i32 23, i32 0, metadata ![[BLOCK:.*]], null}
|
|
|
|
// CHECK: ![[BLOCK]] = metadata !{{{.*}}, metadata ![[HPP]], {{.*}}} ; [ DW_TAG_lexical_block ]
|
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
|
|
|
}
|