From 168b27e91b8e3a45a31da1867c910598c93b0348 Mon Sep 17 00:00:00 2001
From: Hans Wennborg <hans@hanshq.net>
Date: Mon, 8 Aug 2016 22:11:41 +0000
Subject: [PATCH] Merging r278036:
 ------------------------------------------------------------------------
 r278036 | dim | 2016-08-08 11:34:05 -0700 (Mon, 08 Aug 2016) | 18 lines

Fix linking of omp_foreign_thread_team_reuse test on FreeBSD

Summary:
On FreeBSD, linking the misc_bugs/omp_foreign_thread_team_reuse.c test
case fails with:

   /usr/local/bin/ld: /tmp/omp_foreign_thread_team_reuse-c5e71b.o: undefined reference to symbol 'pthread_create@@FBSD_1.0'

This is because the program is linked without `-lpthread`.  Since the
%libomp-compile-and-run macro does not allow that option to be added to
the compile command line, split it up and add the required `-lpthread`
between %libomp-compile and %libomp-run.

Reviewers: jlpeyton, hfinkel, Hahnfeld

Subscribers: Hahnfeld, emaste, openmp-commits

Differential Revision: https://reviews.llvm.org/D23084
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/openmp/branches/release_39@278059 91177308-0d34-0410-b5e6-96231b3b80d8
---
 runtime/test/misc_bugs/omp_foreign_thread_team_reuse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/runtime/test/misc_bugs/omp_foreign_thread_team_reuse.c b/runtime/test/misc_bugs/omp_foreign_thread_team_reuse.c
index a8400e4..4d70d47 100644
--- a/runtime/test/misc_bugs/omp_foreign_thread_team_reuse.c
+++ b/runtime/test/misc_bugs/omp_foreign_thread_team_reuse.c
@@ -1,4 +1,4 @@
-// RUN: %libomp-compile-and-run
+// RUN: %libomp-compile -lpthread && %libomp-run
 #include <stdio.h>
 #include "omp_testsuite.h"
 
-- 
GitLab