1 // RUN: %clang_cc1 -emit-llvm -g %s -o - | FileCheck %s
2 // Test that the line table info for Foo<T>::bar() is pointing to the
3 // right header file.
4 // CHECK: define{{.*}}bar
5 // CHECK-NOT: define
6 // CHECK: ret {{.*}}, !dbg [[DBG:.*]]
7 // CHECK: [[HPP:.*]] = !{!"./template.hpp",
8 // CHECK: [[SP:.*]] = !{!"0x2e\00{{.*}}", [[HPP]],{{.*}}[ DW_TAG_subprogram ] [line 22] [def] [bar]
9 // We shouldn't need a lexical block for this function.
10 // CHECK: [[DBG]] = !MDLocation(line: 23, scope: [[SP]])
11 
12 
13 # 1 "./template.h" 1
14 template <typename T>
15 class Foo {
16 public:
17   int bar();
18 };
19 # 21 "./template.hpp"
20 template <typename T>
21 int Foo<T>::bar() {
22   return 23;
23 }
24 int main (int argc, const char * argv[])
25 {
26   Foo<int> f;
27   return f.bar();
28 }
29