Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 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:.*]] |
Pirama Arumuga Nainar | 3ea9e33 | 2015-04-08 08:57:32 -0700 | [diff] [blame] | 7 | // CHECK: [[HPP:.*]] = !MDFile(filename: "./template.hpp", |
| 8 | // CHECK: [[SP:.*]] = !MDSubprogram(name: "bar", |
| 9 | // CHECK-SAME: file: [[HPP]], line: 22 |
| 10 | // CHECK-SAME: isDefinition: true |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 11 | // We shouldn't need a lexical block for this function. |
Stephen Hines | 0e2c34f | 2015-03-23 12:09:02 -0700 | [diff] [blame] | 12 | // CHECK: [[DBG]] = !MDLocation(line: 23, scope: [[SP]]) |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 13 | |
| 14 | |
| 15 | # 1 "./template.h" 1 |
| 16 | template <typename T> |
| 17 | class Foo { |
| 18 | public: |
| 19 | int bar(); |
| 20 | }; |
| 21 | # 21 "./template.hpp" |
| 22 | template <typename T> |
| 23 | int Foo<T>::bar() { |
| 24 | return 23; |
| 25 | } |
| 26 | int main (int argc, const char * argv[]) |
| 27 | { |
| 28 | Foo<int> f; |
| 29 | return f.bar(); |
| 30 | } |