31 lines · cpp
1// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s2// Test that the line table info for Foo<T>::bar() is pointing to the3// right header file.4// CHECK: define{{.*}}bar5// CHECK-NOT: define6// CHECK: ret {{.*}}, !dbg [[DBG:.*]]7// CHECK: [[HPP:.*]] = !DIFile(filename: "./template.hpp",8// CHECK: [[SP:.*]] = distinct !DISubprogram(name: "bar",9// CHECK-SAME: file: [[HPP]], line: 2210// CHECK-SAME: DISPFlagDefinition11// We shouldn't need a lexical block for this function.12// CHECK: [[DBG]] = !DILocation(line: 23, column: 3, scope: [[SP]])13 14 15# 1 "./template.h" 116template <typename T>17class Foo {18public:19 int bar();20};21# 21 "./template.hpp"22template <typename T>23int Foo<T>::bar() {24 return 23;25}26int main (int argc, const char * argv[])27{28 Foo<int> f;29 return f.bar();30}31