summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/code-coverage.c
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2018-05-02 22:57:20 +0000
committerChandler Carruth <chandlerc@gmail.com>2018-05-02 22:57:20 +0000
commit9325c38fdb55db041ac19f24f7cafb5943e58cae (patch)
tree5985585232cb42ffcee88e09f40b4e74a36bb95f /clang/test/CodeGen/code-coverage.c
parent2139e99e47f1fcb602a75d07f2eb979c0fd8e208 (diff)
downloadbcm5719-llvm-9325c38fdb55db041ac19f24f7cafb5943e58cae.tar.gz
bcm5719-llvm-9325c38fdb55db041ac19f24f7cafb5943e58cae.zip
[gcov] Make the CLang side coverage test work with the new
instrumentation codegeneration strategy of using a data structure and a loop. Required some finesse to get the critical things being tested to surface in a nice way for FileCheck but I think this preserves the original intent of the test. llvm-svn: 331411
Diffstat (limited to 'clang/test/CodeGen/code-coverage.c')
-rw-r--r--clang/test/CodeGen/code-coverage.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/clang/test/CodeGen/code-coverage.c b/clang/test/CodeGen/code-coverage.c
index 4fbfd5b8ce2..310d58544e4 100644
--- a/clang/test/CodeGen/code-coverage.c
+++ b/clang/test/CodeGen/code-coverage.c
@@ -23,17 +23,25 @@ int test1(int a) {
return a;
}
+int test2(int b) {
+ return b * 2;
+}
+
+// Inside function emission data structure, check that
+// -coverage-no-function-names-in-data uses null as the function name.
+// CHECK: @__llvm_internal_gcov_emit_function_args.0 = internal unnamed_addr constant
+// CHECK-SAME: { i32 {{[0-9]+}}, i8* getelementptr inbounds ({{[^,]*}}, {{[^,]*}}* @
+// CHECK-SAME: { i32 {{[0-9]+}}, i8* getelementptr inbounds ({{[^,]*}}, {{[^,]*}}* @
+// WITHOUTNAMES: @__llvm_internal_gcov_emit_function_args.0 = internal unnamed_addr constant
+// WITHOUTNAMES-NOT: getelementptr inbounds ({{.*}}@
+// WITHOUTNAMES-SAME: zeroinitializer,
+// WITHOUTNAMES-NOT: getelementptr inbounds ({{.*}}@
+// WITHOUTNAMES-SAME: { i32 {{[0-9]+}}, i8* null,
+
// Check that the noredzone flag is set on the generated functions.
// CHECK: void @__llvm_gcov_indirect_counter_increment(i32* %{{.*}}, i64** %{{.*}}) unnamed_addr [[NRZ:#[0-9]+]]
-
-// Inside llvm_gcov_writeout, check that -coverage-no-function-names-in-data
-// passes null as the function name.
// CHECK: void @__llvm_gcov_writeout() unnamed_addr [[NRZ]]
-// CHECK: call void @llvm_gcda_emit_function({{.*}}, i8* getelementptr {{.*}}, {{.*}})
-// WITHOUTNAMES: void @__llvm_gcov_writeout() unnamed_addr
-// WITHOUTNAMES: call void @llvm_gcda_emit_function({{.*}}, i8* null, {{.*}})
-
// CHECK: void @__llvm_gcov_flush() unnamed_addr [[NRZ]]
// CHECK: void @__llvm_gcov_init() unnamed_addr [[NRZ]]
OpenPOWER on IntegriCloud