blob: c91dd42d21d3c54794f20ec654c6f4cd60698cb2 [file] [log] [blame]
Xinliang David Li80d4b892016-02-28 00:54:28 +00001// RUN: %clang_profgen -x c++ -fno-exceptions -std=c++11 -fuse-ld=gold -fcoverage-mapping -o %t %s
Xinliang David Liabf6d972016-02-07 16:31:13 +00002// RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t
3// RUN: llvm-profdata merge -o %t.profdata %t.profraw
Sean Evesoncf9525e2017-08-14 12:43:05 +00004// RUN: llvm-cov show %t -instr-profile %t.profdata -path-equivalence=/tmp,%S 2>&1 | FileCheck %s
Xinliang David Liabf6d972016-02-07 16:31:13 +00005
Xinliang David Lia3be8952016-02-08 20:46:26 +00006int g = 100;
Xinliang David Liabf6d972016-02-07 16:31:13 +00007struct Base {
8 int B;
9 Base(int B_) : B(B_) {}
Xinliang David Lia3be8952016-02-08 20:46:26 +000010 ~Base() { g -= B; }
Xinliang David Liabf6d972016-02-07 16:31:13 +000011};
12
13struct Derived : public Base {
Xinliang David Lia3be8952016-02-08 20:46:26 +000014 Derived(int K) : Base(K) {}
Vedant Kumar5e3c5e82016-08-09 21:04:22 +000015 ~Derived() = default; // CHECK: [[@LINE]]| 2| ~Derived() = default;
Xinliang David Liabf6d972016-02-07 16:31:13 +000016};
17
Xinliang David Liabf6d972016-02-07 16:31:13 +000018int main() {
Xinliang David Lia3be8952016-02-08 20:46:26 +000019 {
20 Derived dd(10);
21 Derived dd2(90);
22 }
23 if (g != 0)
Vedant Kumar5e3c5e82016-08-09 21:04:22 +000024 return 1; // CHECK: [[@LINE]]| 0| return 1;
Xinliang David Liabf6d972016-02-07 16:31:13 +000025 return 0;
26}