summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CoverageMapping/abspath.cpp4
-rw-r--r--clang/test/CoverageMapping/ir.c25
-rw-r--r--clang/test/Profile/def-assignop.cpp7
-rw-r--r--clang/test/Profile/def-ctors.cpp10
-rw-r--r--clang/test/Profile/def-dtors.cpp10
5 files changed, 43 insertions, 13 deletions
diff --git a/clang/test/CoverageMapping/abspath.cpp b/clang/test/CoverageMapping/abspath.cpp
index 892dff8de01..1c415691651 100644
--- a/clang/test/CoverageMapping/abspath.cpp
+++ b/clang/test/CoverageMapping/abspath.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -emit-llvm -main-file-name abspath.cpp %S/Inputs/../abspath.cpp -o - | FileCheck -check-prefix=RMDOTS %s
+// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -mllvm -enable-name-compression=false -emit-llvm -main-file-name abspath.cpp %S/Inputs/../abspath.cpp -o - | FileCheck -check-prefix=RMDOTS %s
// RMDOTS: @__llvm_coverage_mapping = {{.*}}"\01
// RMDOTS-NOT: Inputs
@@ -6,7 +6,7 @@
// RUN: mkdir -p %t/test && cd %t/test
// RUN: echo "void f1() {}" > f1.c
-// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -emit-llvm -main-file-name abspath.cpp ../test/f1.c -o - | FileCheck -check-prefix=RELPATH %s
+// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -mllvm -enable-name-compression=false -emit-llvm -main-file-name abspath.cpp ../test/f1.c -o - | FileCheck -check-prefix=RELPATH %s
// RELPATH: @__llvm_coverage_mapping = {{.*}}"\01
// RELPATH: {{[/\\].*(/|\\\\)test(/|\\\\)f1}}.c
diff --git a/clang/test/CoverageMapping/ir.c b/clang/test/CoverageMapping/ir.c
index 469b2992ecd..f5ba39c7472 100644
--- a/clang/test/CoverageMapping/ir.c
+++ b/clang/test/CoverageMapping/ir.c
@@ -1,12 +1,31 @@
// Check the data structures emitted by coverage mapping
-// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name ir.c %s -o - -emit-llvm -fprofile-instrument=clang -fcoverage-mapping | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name ir.c %s -o - -emit-llvm -fprofile-instrument=clang -fcoverage-mapping -mllvm -enable-name-compression=false | FileCheck %s -check-prefixes=COMMON,DARWIN
+// RUN: %clang_cc1 -triple x86_64--windows-msvc -main-file-name ir.c %s -o - -emit-llvm -fprofile-instrument=clang -fcoverage-mapping -mllvm -enable-name-compression=false | FileCheck %s -check-prefixes=COMMON,WINDOWS
+static inline void unused() {}
-void foo(void) { }
+void foo(void) {}
int main(void) {
foo();
return 0;
}
-// CHECK: @__llvm_coverage_mapping = internal constant { { i32, i32, i32, i32 }, [2 x <{ i64, i32, i64 }>], [{{[0-9]+}} x i8] } { { i32, i32, i32, i32 } { i32 2, i32 {{[0-9]+}}, i32 {{[0-9]+}}, i32 {{[0-9]+}} }, [2 x <{ i64, i32, i64 }>] [<{{.*}}> <{{.*}}>, <{{.*}}> <{{.*}}>]
+// Check the function records. Two of the record names should come in the 'used'
+// flavor, and one should not.
+
+// DARWIN: [[FuncRecord1:@__covrec_[0-9A-F]+u]] = linkonce_odr hidden constant <{ i64, i32, i64, i64, [{{.*}} x i8] }> <{ {{.*}} }>, section "__LLVM_COV,__llvm_covfun", align 8
+// DARWIN: [[FuncRecord2:@__covrec_[0-9A-F]+u]] = linkonce_odr hidden constant <{ i64, i32, i64, i64, [{{.*}} x i8] }> <{ {{.*}} }>, section "__LLVM_COV,__llvm_covfun", align 8
+// DARWIN: [[FuncRecord3:@__covrec_[0-9A-F]+]] = linkonce_odr hidden constant <{ i64, i32, i64, i64, [{{.*}} x i8] }> <{ {{.*}} }>, section "__LLVM_COV,__llvm_covfun", align 8
+// DARWIN: @__llvm_coverage_mapping = private constant { { i32, i32, i32, i32 }, [{{.*}} x i8] } { {{.*}} }, section "__LLVM_COV,__llvm_covmap", align 8
+
+// WINDOWS: [[FuncRecord1:@__covrec_[0-9A-F]+u]] = linkonce_odr hidden constant <{ i64, i32, i64, i64, [{{.*}} x i8] }> <{ {{.*}} }>, section ".lcovfun$M", comdat, align 8
+// WINDOWS: [[FuncRecord2:@__covrec_[0-9A-F]+u]] = linkonce_odr hidden constant <{ i64, i32, i64, i64, [{{.*}} x i8] }> <{ {{.*}} }>, section ".lcovfun$M", comdat, align 8
+// WINDOWS: [[FuncRecord3:@__covrec_[0-9A-F]+]] = linkonce_odr hidden constant <{ i64, i32, i64, i64, [{{.*}} x i8] }> <{ {{.*}} }>, section ".lcovfun$M", comdat, align 8
+// WINDOWS: @__llvm_coverage_mapping = private constant { { i32, i32, i32, i32 }, [{{.*}} x i8] } { {{.*}} }, section ".lcovmap$M", align 8
+
+// COMMON: @llvm.used = appending global [{{.*}} x i8*]
+// COMMON-SAME: [[FuncRecord1]]
+// COMMON-SAME: [[FuncRecord2]]
+// COMMON-SAME: [[FuncRecord3]]
+// COMMON-SAME: @__llvm_coverage_mapping
diff --git a/clang/test/Profile/def-assignop.cpp b/clang/test/Profile/def-assignop.cpp
index 2d453364a55..d17654f3142 100644
--- a/clang/test/Profile/def-assignop.cpp
+++ b/clang/test/Profile/def-assignop.cpp
@@ -18,9 +18,12 @@ struct A {
// PGOGEN: {{.*}}add{{.*}}%pgocount, 1
// PGOGEN: store{{.*}}@__profc__ZN1AaSEOS_
- // Check that coverage mapping includes 6 function records including the
+ // Check that coverage mapping includes 3 function records including the
// defaulted copy and move operators: A::operator=
- // COVMAP: @__llvm_coverage_mapping = {{.*}} { { i32, i32, i32, i32 }, [3 x <{{.*}}>],
+ // COVMAP: section "__llvm_covfun", comdat
+ // COVMAP: section "__llvm_covfun", comdat
+ // COVMAP: section "__llvm_covfun", comdat
+ // COVMAP: @__llvm_coverage_mapping = {{.*}} { { i32, i32, i32, i32 }
B b;
};
diff --git a/clang/test/Profile/def-ctors.cpp b/clang/test/Profile/def-ctors.cpp
index 1b52d559e01..0179bc92dbb 100644
--- a/clang/test/Profile/def-ctors.cpp
+++ b/clang/test/Profile/def-ctors.cpp
@@ -20,11 +20,15 @@ struct Derived : public Base {
// PGOGEN-DAG: {{.*}}add{{.*}}%pgocount, 1
// PGOGEN-DAG: store{{.*}}@__profc__ZN7DerivedC2Ev
- // Check that coverage mapping has 6 function records including
+ // Check that coverage mapping has 5 function records including
// the defaulted Derived::Derived(const Derived), and Derived::Derived()
// methds.
- // COVMAP: @__llvm_coverage_mapping = {{.*}} { { i32, i32, i32, i32 }, [5 x
- // <{{.*}}>],
+ // COVMAP: section "__llvm_covfun", comdat
+ // COVMAP: section "__llvm_covfun", comdat
+ // COVMAP: section "__llvm_covfun", comdat
+ // COVMAP: section "__llvm_covfun", comdat
+ // COVMAP: section "__llvm_covfun", comdat
+ // COVMAP: @__llvm_coverage_mapping = {{.*}} { { i32, i32, i32, i32 }
};
Derived dd;
diff --git a/clang/test/Profile/def-dtors.cpp b/clang/test/Profile/def-dtors.cpp
index bfa535634d1..dc87508fe7c 100644
--- a/clang/test/Profile/def-dtors.cpp
+++ b/clang/test/Profile/def-dtors.cpp
@@ -16,10 +16,14 @@ struct Derived : public Base {
// PGOGEN: {{.*}}add{{.*}}%pgocount, 1
// PGOGEN: store{{.*}}@__profc__ZN7DerivedD2Ev
- // Check that coverage mapping has 6 function records including
+ // Check that coverage mapping has 5 function records including
// the default destructor in the derived class.
- // COVMAP: @__llvm_coverage_mapping = {{.*}} { { i32, i32, i32, i32 }, [5 x
- // <{{.*}}>],
+ // COVMAP: section "__llvm_covfun", comdat
+ // COVMAP: section "__llvm_covfun", comdat
+ // COVMAP: section "__llvm_covfun", comdat
+ // COVMAP: section "__llvm_covfun", comdat
+ // COVMAP: section "__llvm_covfun", comdat
+ // COVMAP: @__llvm_coverage_mapping = {{.*}} { { i32, i32, i32, i32 }
};
int main() {
OpenPOWER on IntegriCloud