<div dir="ltr">Hi,<div><br></div><div>it looks like instrprof-shared-gcov-flush.test needs more XFAILs. See this x86/x86_64 failure:</div><div><a href="http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/13413/steps/test%20standalone%20compiler-rt/logs/stdio">http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/13413/steps/test%20standalone%20compiler-rt/logs/stdio</a><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 10, 2018 at 7:12 AM, Marco Castelluccio via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: marco<br>
Date: Tue Jul 10 07:12:03 2018<br>
New Revision: 336678<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=336678&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=336678&view=rev</a><br>
Log:<br>
Reapply "Make __gcov_flush flush counters for all shared libraries"<br>
<br>
This reapplies r336365, after marking tests as failing on various<br>
configurations.<br>
<br>
Added:<br>
compiler-rt/trunk/test/<wbr>profile/Inputs/instrprof-<wbr>dlopen-dlclose-main.c.gcov<br>
- copied unchanged from r336473, compiler-rt/trunk/test/<wbr>profile/Inputs/instrprof-<wbr>dlopen-dlclose-main.c.gcov<br>
compiler-rt/trunk/test/<wbr>profile/Inputs/instrprof-<wbr>dlopen-dlclose-main_three-<wbr>libs.c.gcov<br>
- copied unchanged from r336473, compiler-rt/trunk/test/<wbr>profile/Inputs/instrprof-<wbr>dlopen-dlclose-main_three-<wbr>libs.c.gcov<br>
compiler-rt/trunk/test/<wbr>profile/Inputs/instrprof-<wbr>dlopen-func.c.gcov<br>
- copied unchanged from r336473, compiler-rt/trunk/test/<wbr>profile/Inputs/instrprof-<wbr>dlopen-func.c.gcov<br>
compiler-rt/trunk/test/<wbr>profile/Inputs/instrprof-<wbr>dlopen-func2.c.gcov<br>
- copied unchanged from r336473, compiler-rt/trunk/test/<wbr>profile/Inputs/instrprof-<wbr>dlopen-func2.c.gcov<br>
compiler-rt/trunk/test/<wbr>profile/Inputs/instrprof-<wbr>dlopen-func3.c<br>
- copied unchanged from r336473, compiler-rt/trunk/test/<wbr>profile/Inputs/instrprof-<wbr>dlopen-func3.c<br>
compiler-rt/trunk/test/<wbr>profile/Inputs/instrprof-<wbr>dlopen-func3.c.gcov<br>
- copied unchanged from r336473, compiler-rt/trunk/test/<wbr>profile/Inputs/instrprof-<wbr>dlopen-func3.c.gcov<br>
compiler-rt/trunk/test/<wbr>profile/Inputs/instrprof-<wbr>shared-lib.c.gcov<br>
- copied unchanged from r336473, compiler-rt/trunk/test/<wbr>profile/Inputs/instrprof-<wbr>shared-lib.c.gcov<br>
compiler-rt/trunk/test/<wbr>profile/Inputs/instrprof-<wbr>shared-lib_called-twice.c.gcov<br>
- copied unchanged from r336473, compiler-rt/trunk/test/<wbr>profile/Inputs/instrprof-<wbr>shared-lib_called-twice.c.gcov<br>
compiler-rt/trunk/test/<wbr>profile/Inputs/instrprof-<wbr>shared-lib_in-loop.c.gcov<br>
- copied unchanged from r336473, compiler-rt/trunk/test/<wbr>profile/Inputs/instrprof-<wbr>shared-lib_in-loop.c.gcov<br>
compiler-rt/trunk/test/<wbr>profile/Inputs/instrprof-<wbr>shared-main-gcov-flush.c<br>
- copied unchanged from r336473, compiler-rt/trunk/test/<wbr>profile/Inputs/instrprof-<wbr>shared-main-gcov-flush.c<br>
compiler-rt/trunk/test/<wbr>profile/Inputs/instrprof-<wbr>shared-main-gcov-flush_no-<wbr>writeout.c.gcov<br>
- copied unchanged from r336473, compiler-rt/trunk/test/<wbr>profile/Inputs/instrprof-<wbr>shared-main-gcov-flush_no-<wbr>writeout.c.gcov<br>
compiler-rt/trunk/test/<wbr>profile/Inputs/instrprof-<wbr>shared-main-gcov-flush_shared-<wbr>call-after.c.gcov<br>
- copied unchanged from r336473, compiler-rt/trunk/test/<wbr>profile/Inputs/instrprof-<wbr>shared-main-gcov-flush_shared-<wbr>call-after.c.gcov<br>
compiler-rt/trunk/test/<wbr>profile/Inputs/instrprof-<wbr>shared-main-gcov-flush_shared-<wbr>call-before-after.c.gcov<br>
- copied unchanged from r336473, compiler-rt/trunk/test/<wbr>profile/Inputs/instrprof-<wbr>shared-main-gcov-flush_shared-<wbr>call-before-after.c.gcov<br>
compiler-rt/trunk/test/<wbr>profile/Inputs/instrprof-<wbr>shared-main-gcov-flush_shared-<wbr>call-before.c.gcov<br>
- copied unchanged from r336473, compiler-rt/trunk/test/<wbr>profile/Inputs/instrprof-<wbr>shared-main-gcov-flush_shared-<wbr>call-before.c.gcov<br>
compiler-rt/trunk/test/<wbr>profile/Inputs/instrprof-<wbr>shared-main.c.gcov<br>
- copied unchanged from r336473, compiler-rt/trunk/test/<wbr>profile/Inputs/instrprof-<wbr>shared-main.c.gcov<br>
compiler-rt/trunk/test/<wbr>profile/instrprof-gcov-two-<wbr>objects.test<br>
- copied, changed from r336473, compiler-rt/trunk/test/<wbr>profile/instrprof-gcov-two-<wbr>objects.test<br>
compiler-rt/trunk/test/<wbr>profile/instrprof-shared-gcov-<wbr>flush.test<br>
- copied, changed from r336473, compiler-rt/trunk/test/<wbr>profile/instrprof-shared-gcov-<wbr>flush.test<br>
Modified:<br>
compiler-rt/trunk/lib/profile/<wbr>GCDAProfiling.c<br>
compiler-rt/trunk/test/<wbr>profile/Inputs/instrprof-<wbr>dlopen-dlclose-main.c<br>
compiler-rt/trunk/test/<wbr>profile/instrprof-dlopen-<wbr>dlclose-gcov.test<br>
<br>
Modified: compiler-rt/trunk/lib/profile/<wbr>GCDAProfiling.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/GCDAProfiling.c?rev=336678&r1=336677&r2=336678&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/compiler-rt/trunk/lib/<wbr>profile/GCDAProfiling.c?rev=<wbr>336678&r1=336677&r2=336678&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- compiler-rt/trunk/lib/profile/<wbr>GCDAProfiling.c (original)<br>
+++ compiler-rt/trunk/lib/profile/<wbr>GCDAProfiling.c Tue Jul 10 07:12:03 2018<br>
@@ -86,31 +86,76 @@ static uint64_t file_size = 0;<br>
static int new_file = 0;<br>
static int fd = -1;<br>
<br>
-/*<br>
- * A list of functions to write out the data.<br>
- */<br>
-typedef void (*writeout_fn)();<br>
+typedef void (*fn_ptr)();<br>
<br>
-struct writeout_fn_node {<br>
- writeout_fn fn;<br>
- struct writeout_fn_node *next;<br>
+typedef void* dynamic_object_id;<br>
+// The address of this variable identifies a given dynamic object.<br>
+static dynamic_object_id current_id;<br>
+#define CURRENT_ID (¤t_id)<br>
+<br>
+struct fn_node {<br>
+ dynamic_object_id id;<br>
+ fn_ptr fn;<br>
+ struct fn_node* next;<br>
};<br>
<br>
-static struct writeout_fn_node *writeout_fn_head = NULL;<br>
-static struct writeout_fn_node *writeout_fn_tail = NULL;<br>
+struct fn_list {<br>
+ struct fn_node *head, *tail;<br>
+};<br>
<br>
/*<br>
- * A list of flush functions that our __gcov_flush() function should call.<br>
+ * A list of functions to write out the data, shared between all dynamic objects.<br>
*/<br>
-typedef void (*flush_fn)();<br>
+struct fn_list writeout_fn_list;<br>
<br>
-struct flush_fn_node {<br>
- flush_fn fn;<br>
- struct flush_fn_node *next;<br>
-};<br>
+/*<br>
+ * A list of flush functions that our __gcov_flush() function should call, shared between all dynamic objects.<br>
+ */<br>
+struct fn_list flush_fn_list;<br>
+<br>
+static void fn_list_insert(struct fn_list* list, fn_ptr fn) {<br>
+ struct fn_node* new_node = malloc(sizeof(struct fn_node));<br>
+ new_node->fn = fn;<br>
+ new_node->next = NULL;<br>
+ new_node->id = CURRENT_ID;<br>
+<br>
+ if (!list->head) {<br>
+ list->head = list->tail = new_node;<br>
+ } else {<br>
+ list->tail->next = new_node;<br>
+ list->tail = new_node;<br>
+ }<br>
+}<br>
+<br>
+static void fn_list_remove(struct fn_list* list) {<br>
+ struct fn_node* curr = list->head;<br>
+ struct fn_node* prev = NULL;<br>
+ struct fn_node* next = NULL;<br>
+<br>
+ while (curr) {<br>
+ next = curr->next;<br>
+<br>
+ if (curr->id == CURRENT_ID) {<br>
+ if (curr == list->head) {<br>
+ list->head = next;<br>
+ }<br>
+<br>
+ if (curr == list->tail) {<br>
+ list->tail = prev;<br>
+ }<br>
+<br>
+ if (prev) {<br>
+ prev->next = next;<br>
+ }<br>
+<br>
+ free(curr);<br>
+ } else {<br>
+ prev = curr;<br>
+ }<br>
<br>
-static struct flush_fn_node *flush_fn_head = NULL;<br>
-static struct flush_fn_node *flush_fn_tail = NULL;<br>
+ curr = next;<br>
+ }<br>
+}<br>
<br>
static void resize_write_buffer(uint64_t size) {<br>
if (!new_file) return;<br>
@@ -403,6 +448,7 @@ void llvm_gcda_summary_info() {<br>
const uint32_t obj_summary_len = 9; /* Length for gcov compatibility. */<br>
uint32_t i;<br>
uint32_t runs = 1;<br>
+ static uint32_t run_counted = 0; // We only want to increase the run count once.<br>
uint32_t val = 0;<br>
uint64_t save_cur_pos = cur_pos;<br>
<br>
@@ -429,7 +475,9 @@ void llvm_gcda_summary_info() {<br>
<br>
read_32bit_value(); /* checksum, unused */<br>
read_32bit_value(); /* num, unused */<br>
- runs += read_32bit_value(); /* Add previous run count to new counter. */<br>
+ uint32_t prev_runs = read_32bit_value();<br>
+ /* Add previous run count to new counter, if not already counted before. */<br>
+ runs = run_counted ? prev_runs : prev_runs + 1;<br>
}<br>
<br>
cur_pos = save_cur_pos;<br>
@@ -447,6 +495,8 @@ void llvm_gcda_summary_info() {<br>
write_bytes("\0\0\0\xa3", 4); /* tag indicates 1 program */<br>
write_32bit_value(0); /* 0 length */<br>
<br>
+ run_counted = 1;<br>
+<br>
#ifdef DEBUG_GCDAPROFILING<br>
fprintf(stderr, "llvmgcda: %u runs\n", runs);<br>
#endif<br>
@@ -479,61 +529,34 @@ void llvm_gcda_end_file() {<br>
}<br>
<br>
COMPILER_RT_VISIBILITY<br>
-void llvm_register_writeout_<wbr>function(writeout_fn fn) {<br>
- struct writeout_fn_node *new_node = malloc(sizeof(struct writeout_fn_node));<br>
- new_node->fn = fn;<br>
- new_node->next = NULL;<br>
-<br>
- if (!writeout_fn_head) {<br>
- writeout_fn_head = writeout_fn_tail = new_node;<br>
- } else {<br>
- writeout_fn_tail->next = new_node;<br>
- writeout_fn_tail = new_node;<br>
- }<br>
+void llvm_register_writeout_<wbr>function(fn_ptr fn) {<br>
+ fn_list_insert(&writeout_fn_<wbr>list, fn);<br>
}<br>
<br>
COMPILER_RT_VISIBILITY<br>
void llvm_writeout_files(void) {<br>
- struct writeout_fn_node *curr = writeout_fn_head;<br>
+ struct fn_node *curr = writeout_fn_list.head;<br>
<br>
while (curr) {<br>
- curr->fn();<br>
+ if (curr->id == CURRENT_ID) {<br>
+ curr->fn();<br>
+ }<br>
curr = curr->next;<br>
}<br>
}<br>
<br>
COMPILER_RT_VISIBILITY<br>
void llvm_delete_writeout_function_<wbr>list(void) {<br>
- while (writeout_fn_head) {<br>
- struct writeout_fn_node *node = writeout_fn_head;<br>
- writeout_fn_head = writeout_fn_head->next;<br>
- free(node);<br>
- }<br>
- <br>
- writeout_fn_head = writeout_fn_tail = NULL;<br>
+ fn_list_remove(&writeout_fn_<wbr>list);<br>
}<br>
<br>
COMPILER_RT_VISIBILITY<br>
-void llvm_register_flush_function(<wbr>flush_fn fn) {<br>
- struct flush_fn_node *new_node = malloc(sizeof(struct flush_fn_node));<br>
- new_node->fn = fn;<br>
- new_node->next = NULL;<br>
-<br>
- if (!flush_fn_head) {<br>
- flush_fn_head = flush_fn_tail = new_node;<br>
- } else {<br>
- flush_fn_tail->next = new_node;<br>
- flush_fn_tail = new_node;<br>
- }<br>
+void llvm_register_flush_function(<wbr>fn_ptr fn) {<br>
+ fn_list_insert(&flush_fn_list, fn);<br>
}<br>
<br>
-// __gcov_flush is hidden. When called in a .so file,<br>
-// it dumps profile data of the calling .so file.<br>
-// If a main program needs to dump profile data of each linked<br>
-// .so files, it should use dlsym to find and call llvm_gcov_flush.<br>
-COMPILER_RT_VISIBILITY<br>
void __gcov_flush() {<br>
- struct flush_fn_node *curr = flush_fn_head;<br>
+ struct fn_node* curr = flush_fn_list.head;<br>
<br>
while (curr) {<br>
curr->fn();<br>
@@ -541,25 +564,13 @@ void __gcov_flush() {<br>
}<br>
}<br>
<br>
-// llvm_gcov_flush is not hidden for a program to use dlsym to<br>
-// find and call for any linked .so file.<br>
-void llvm_gcov_flush() {<br>
- __gcov_flush();<br>
-}<br>
-<br>
COMPILER_RT_VISIBILITY<br>
void llvm_delete_flush_function_<wbr>list(void) {<br>
- while (flush_fn_head) {<br>
- struct flush_fn_node *node = flush_fn_head;<br>
- flush_fn_head = flush_fn_head->next;<br>
- free(node);<br>
- }<br>
-<br>
- flush_fn_head = flush_fn_tail = NULL;<br>
+ fn_list_remove(&flush_fn_list)<wbr>;<br>
}<br>
<br>
COMPILER_RT_VISIBILITY<br>
-void llvm_gcov_init(writeout_fn wfn, flush_fn ffn) {<br>
+void llvm_gcov_init(fn_ptr wfn, fn_ptr ffn) {<br>
static int atexit_ran = 0;<br>
<br>
if (wfn)<br>
<br>
Modified: compiler-rt/trunk/test/<wbr>profile/Inputs/instrprof-<wbr>dlopen-dlclose-main.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/profile/Inputs/instrprof-dlopen-dlclose-main.c?rev=336678&r1=336677&r2=336678&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/compiler-rt/trunk/<wbr>test/profile/Inputs/instrprof-<wbr>dlopen-dlclose-main.c?rev=<wbr>336678&r1=336677&r2=336678&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- compiler-rt/trunk/test/<wbr>profile/Inputs/instrprof-<wbr>dlopen-dlclose-main.c (original)<br>
+++ compiler-rt/trunk/test/<wbr>profile/Inputs/instrprof-<wbr>dlopen-dlclose-main.c Tue Jul 10 07:12:03 2018<br>
@@ -10,6 +10,12 @@ int main(int argc, char *argv[]) {<br>
return EXIT_FAILURE;<br>
}<br>
<br>
+ void (*func)(void) = (void (*)(void))dlsym(f1_handle, "func");<br>
+ if (func == NULL) {<br>
+ fprintf(stderr, "unable to lookup symbol 'func': %s\n", dlerror());<br>
+ return EXIT_FAILURE;<br>
+ }<br>
+<br>
dlerror();<br>
void *f2_handle = dlopen("func2.shared", RTLD_LAZY | RTLD_GLOBAL);<br>
if (f2_handle == NULL) {<br>
@@ -17,31 +23,44 @@ int main(int argc, char *argv[]) {<br>
return EXIT_FAILURE;<br>
}<br>
<br>
- dlerror();<br>
- void (*gcov_flush)() = (void (*)())dlsym(f1_handle, "__gcov_flush");<br>
- if (gcov_flush != NULL || dlerror() == NULL) {<br>
- fprintf(stderr, "__gcov_flush should not be visible in func.shared'\n");<br>
+ void (*func2)(void) = (void (*)(void))dlsym(f2_handle, "func2");<br>
+ if (func2 == NULL) {<br>
+ fprintf(stderr, "unable to lookup symbol 'func2': %s\n", dlerror());<br>
+ return EXIT_FAILURE;<br>
+ }<br>
+ func2();<br>
+<br>
+#ifdef USE_LIB3<br>
+ void *f3_handle = dlopen("func3.shared", RTLD_LAZY | RTLD_GLOBAL);<br>
+ if (f3_handle == NULL) {<br>
+ fprintf(stderr, "unable to open 'func3.shared': %s\n", dlerror());<br>
+ return EXIT_FAILURE;<br>
+ }<br>
+<br>
+ void (*func3)(void) = (void (*)(void))dlsym(f3_handle, "func3");<br>
+ if (func3 == NULL) {<br>
+ fprintf(stderr, "unable to lookup symbol 'func3': %s\n", dlerror());<br>
return EXIT_FAILURE;<br>
}<br>
+ func3();<br>
+#endif<br>
<br>
dlerror();<br>
- void (*f1_flush)() = (void (*)())dlsym(f1_handle, "llvm_gcov_flush");<br>
- if (f1_flush == NULL) {<br>
- fprintf(stderr, "unable to find llvm_gcov_flush in func.shared': %s\n", dlerror());<br>
+ void (*gcov_flush1)() = (void (*)())dlsym(f1_handle, "__gcov_flush");<br>
+ if (gcov_flush1 == NULL) {<br>
+ fprintf(stderr, "unable to find __gcov_flush in func.shared': %s\n", dlerror());<br>
return EXIT_FAILURE;<br>
}<br>
- f1_flush();<br>
<br>
dlerror();<br>
- void (*f2_flush)() = (void (*)())dlsym(f2_handle, "llvm_gcov_flush");<br>
- if (f2_flush == NULL) {<br>
- fprintf(stderr, "unable to find llvm_gcov_flush in func2.shared': %s\n", dlerror());<br>
+ void (*gcov_flush2)() = (void (*)())dlsym(f2_handle, "__gcov_flush");<br>
+ if (gcov_flush2 == NULL) {<br>
+ fprintf(stderr, "unable to find __gcov_flush in func2.shared': %s\n", dlerror());<br>
return EXIT_FAILURE;<br>
}<br>
- f2_flush();<br>
<br>
- if (f1_flush == f2_flush) {<br>
- fprintf(stderr, "Same llvm_gcov_flush found in func.shared and func2.shared\n");<br>
+ if (gcov_flush1 == gcov_flush2) {<br>
+ fprintf(stderr, "Same __gcov_flush found in func.shared and func2.shared\n");<br>
return EXIT_FAILURE;<br>
}<br>
<br>
@@ -51,6 +70,17 @@ int main(int argc, char *argv[]) {<br>
return EXIT_FAILURE;<br>
}<br>
<br>
+ func();<br>
+<br>
+ int g1 = 0;<br>
+ int g2 = 0;<br>
+ int n = 10;<br>
+<br>
+ if (n % 5 == 0)<br>
+ g1++;<br>
+ else<br>
+ g2++;<br>
+<br>
return EXIT_SUCCESS;<br>
}<br>
<br>
<br>
Modified: compiler-rt/trunk/test/<wbr>profile/instrprof-dlopen-<wbr>dlclose-gcov.test<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/profile/instrprof-dlopen-dlclose-gcov.test?rev=336678&r1=336677&r2=336678&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/compiler-rt/trunk/<wbr>test/profile/instrprof-dlopen-<wbr>dlclose-gcov.test?rev=336678&<wbr>r1=336677&r2=336678&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- compiler-rt/trunk/test/<wbr>profile/instrprof-dlopen-<wbr>dlclose-gcov.test (original)<br>
+++ compiler-rt/trunk/test/<wbr>profile/instrprof-dlopen-<wbr>dlclose-gcov.test Tue Jul 10 07:12:03 2018<br>
@@ -1,6 +1,33 @@<br>
+# This test fails on powerpc64 BE and s390x (<a href="https://bugs.llvm.org/show_bug.cgi?id=38121" rel="noreferrer" target="_blank">https://bugs.llvm.org/show_<wbr>bug.cgi?id=38121</a>).<br>
+XFAIL: s390x || powerpc64-unknown-linux-gnu<br>
+<br>
RUN: mkdir -p %t.d<br>
-RUN: %clang --coverage -o %t.d/func.shared -fPIC -shared %S/Inputs/instrprof-dlopen-<wbr>func.c<br>
-RUN: %clang --coverage -o %t.d/func2.shared -fPIC -shared %S/Inputs/instrprof-dlopen-<wbr>func2.c<br>
+RUN: cd %t.d<br>
+<br>
+RUN: %clang --coverage -o func.shared -fPIC -shared %S/Inputs/instrprof-dlopen-<wbr>func.c<br>
+RUN: %clang --coverage -o func2.shared -fPIC -shared %S/Inputs/instrprof-dlopen-<wbr>func2.c<br>
+RUN: %clang --coverage -o func3.shared -fPIC -shared %S/Inputs/instrprof-dlopen-<wbr>func3.c<br>
RUN: %clang --coverage -o %t -fPIC -rpath %t.d %S/Inputs/instrprof-dlopen-<wbr>dlclose-main.c<br>
<br>
+# Test with two dlopened libraries.<br>
+RUN: %run %t<br>
+RUN: llvm-cov gcov instrprof-dlopen-dlclose-main.<wbr>gcda<br>
+RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-dlopen-dlclose-main.<wbr>c.gcov %S/Inputs/instrprof-dlopen-<wbr>dlclose-main.c.gcov<br>
+RUN: llvm-cov gcov instrprof-dlopen-func.gcda<br>
+RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-dlopen-func.c.gcov %S/Inputs/instrprof-dlopen-<wbr>func.c.gcov<br>
+RUN: llvm-cov gcov instrprof-dlopen-func2.gcda<br>
+RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-dlopen-func2.c.gcov %S/Inputs/instrprof-dlopen-<wbr>func2.c.gcov<br>
+RUN: rm instrprof-dlopen-dlclose-main.<wbr>gcda instrprof-dlopen-func.gcda instrprof-dlopen-func2.gcda<br>
+<br>
+# Test with three dlopened libraries.<br>
+RUN: %clang -DUSE_LIB3 --coverage -o %t -fPIC -rpath %t.d %S/Inputs/instrprof-dlopen-<wbr>dlclose-main.c<br>
RUN: %run %t<br>
+RUN: llvm-cov gcov instrprof-dlopen-dlclose-main.<wbr>gcda<br>
+RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-dlopen-dlclose-main.<wbr>c.gcov %S/Inputs/instrprof-dlopen-<wbr>dlclose-main_three-libs.c.gcov<br>
+RUN: llvm-cov gcov instrprof-dlopen-func.gcda<br>
+RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-dlopen-func.c.gcov %S/Inputs/instrprof-dlopen-<wbr>func.c.gcov<br>
+RUN: llvm-cov gcov instrprof-dlopen-func2.gcda<br>
+RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-dlopen-func2.c.gcov %S/Inputs/instrprof-dlopen-<wbr>func2.c.gcov<br>
+RUN: llvm-cov gcov instrprof-dlopen-func3.gcda<br>
+RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-dlopen-func2.c.gcov %S/Inputs/instrprof-dlopen-<wbr>func3.c.gcov<br>
+RUN: rm instrprof-dlopen-dlclose-main.<wbr>gcda instrprof-dlopen-func.gcda instrprof-dlopen-func2.gcda instrprof-dlopen-func3.gcda<br>
<br>
Copied: compiler-rt/trunk/test/<wbr>profile/instrprof-gcov-two-<wbr>objects.test (from r336473, compiler-rt/trunk/test/<wbr>profile/instrprof-gcov-two-<wbr>objects.test)<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/profile/instrprof-gcov-two-objects.test?p2=compiler-rt/trunk/test/profile/instrprof-gcov-two-objects.test&p1=compiler-rt/trunk/test/profile/instrprof-gcov-two-objects.test&r1=336473&r2=336678&rev=336678&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/compiler-rt/trunk/<wbr>test/profile/instrprof-gcov-<wbr>two-objects.test?p2=compiler-<wbr>rt/trunk/test/profile/<wbr>instrprof-gcov-two-objects.<wbr>test&p1=compiler-rt/trunk/<wbr>test/profile/instrprof-gcov-<wbr>two-objects.test&r1=336473&r2=<wbr>336678&rev=336678&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- compiler-rt/trunk/test/<wbr>profile/instrprof-gcov-two-<wbr>objects.test (original)<br>
+++ compiler-rt/trunk/test/<wbr>profile/instrprof-gcov-two-<wbr>objects.test Tue Jul 10 07:12:03 2018<br>
@@ -1,3 +1,6 @@<br>
+# This test fails on powerpc64 BE and s390x (<a href="https://bugs.llvm.org/show_bug.cgi?id=38121" rel="noreferrer" target="_blank">https://bugs.llvm.org/show_<wbr>bug.cgi?id=38121</a>).<br>
+XFAIL: s390x || powerpc64-unknown-linux-gnu<br>
+<br>
RUN: mkdir -p %t.d<br>
RUN: cd %t.d<br>
<br>
<br>
Copied: compiler-rt/trunk/test/<wbr>profile/instrprof-shared-gcov-<wbr>flush.test (from r336473, compiler-rt/trunk/test/<wbr>profile/instrprof-shared-gcov-<wbr>flush.test)<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/profile/instrprof-shared-gcov-flush.test?p2=compiler-rt/trunk/test/profile/instrprof-shared-gcov-flush.test&p1=compiler-rt/trunk/test/profile/instrprof-shared-gcov-flush.test&r1=336473&r2=336678&rev=336678&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/compiler-rt/trunk/<wbr>test/profile/instrprof-shared-<wbr>gcov-flush.test?p2=compiler-<wbr>rt/trunk/test/profile/<wbr>instrprof-shared-gcov-flush.<wbr>test&p1=compiler-rt/trunk/<wbr>test/profile/instrprof-shared-<wbr>gcov-flush.test&r1=336473&r2=<wbr>336678&rev=336678&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- compiler-rt/trunk/test/<wbr>profile/instrprof-shared-gcov-<wbr>flush.test (original)<br>
+++ compiler-rt/trunk/test/<wbr>profile/instrprof-shared-gcov-<wbr>flush.test Tue Jul 10 07:12:03 2018<br>
@@ -1,3 +1,6 @@<br>
+# This test fails on Mac, powerpc64 BE and s390x (<a href="https://bugs.llvm.org/show_bug.cgi?id=38121" rel="noreferrer" target="_blank">https://bugs.llvm.org/show_<wbr>bug.cgi?id=38121</a>).<br>
+XFAIL: darwin || s390x || powerpc64-unknown-linux-gnu<br>
+<br>
RUN: mkdir -p %t.d<br>
RUN: cd %t.d<br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>