blob: b24bfb8a4a483f25be4cfd29673d641a274cb18b [file] [log] [blame]
Xinliang David Liabf6d972016-02-07 16:31:13 +00001// 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
6struct Base {
7 int B;
8 Base(int B_) : B(B_) {}
9 ~Base() {}
10};
11
12struct Derived : public Base {
Xinliang David Lie5c9b5f2016-02-07 20:06:36 +000013 Derived(int K) : Base(K), I(K), J(K) {}
14 ~Derived() = default; // CHECK: 2| [[@LINE]]| ~Derived
Xinliang David Liabf6d972016-02-07 16:31:13 +000015 int I;
Xinliang David Lie5c9b5f2016-02-07 20:06:36 +000016 int J;
Xinliang David Liabf6d972016-02-07 16:31:13 +000017 int getI() { return I; }
18};
19
20int g;
21int main() {
22 Derived dd(10);
23 Derived dd2(120);
24 g = dd2.getI() + dd.getI();
25 return 0;
26}