Xinliang David Li | abf6d97 | 2016-02-07 16:31:13 +0000 | [diff] [blame] | 1 | // RUN: %clang -x c++ -fno-exceptions -std=c++11 -fuse-ld=gold -fprofile-instr-generate -fcoverage-mapping -o %t %s |
| 2 | // RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t |
| 3 | // RUN: llvm-profdata merge -o %t.profdata %t.profraw |
| 4 | // RUN: llvm-cov show %t -instr-profile %t.profdata -filename-equivalence 2>&1 | FileCheck %s |
| 5 | |
| 6 | struct Base { |
| 7 | int B; |
| 8 | Base(int B_) : B(B_) {} |
| 9 | ~Base() {} |
| 10 | }; |
| 11 | |
| 12 | struct Derived : public Base { |
Xinliang David Li | 879e143 | 2016-02-07 20:08:36 +0000 | [diff] [blame^] | 13 | Derived(int K) : Base(K), I(K) {} |
| 14 | ~Derived() = default; // CHECK: 2| [[@LINE]]| ~Derived() = default; |
Xinliang David Li | abf6d97 | 2016-02-07 16:31:13 +0000 | [diff] [blame] | 15 | int I; |
Xinliang David Li | abf6d97 | 2016-02-07 16:31:13 +0000 | [diff] [blame] | 16 | int getI() { return I; } |
| 17 | }; |
| 18 | |
| 19 | int g; |
| 20 | int main() { |
| 21 | Derived dd(10); |
| 22 | Derived dd2(120); |
| 23 | g = dd2.getI() + dd.getI(); |
| 24 | return 0; |
| 25 | } |